@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
|
@@ -337,6 +337,21 @@ function EditableTableCell({ value, editor, onCommit }) {
|
|
|
337
337
|
// A row that offers its own choices: the value can only be one of them.
|
|
338
338
|
return _jsx(PhiSelectControl, { value: typeof draft === "string" && draft ? draft : undefined, disabled: disabled, size: "small", variant: variant, options: editor.options ?? [], style: { width: "100%" }, onChange: (next) => { draftRef.current = next; setDraft(next); onCommit(next); } });
|
|
339
339
|
}
|
|
340
|
+
if (editor.type === "string" && editor.control === "textarea") {
|
|
341
|
+
/*
|
|
342
|
+
* Several lines in a cell: the area is as tall as its text, so a long value wraps instead of
|
|
343
|
+
* running out of the column. Enter still commits, as in every other cell; Shift+Enter is the line
|
|
344
|
+
* break. No clear glyph -- it would stand over the first line's end.
|
|
345
|
+
*/
|
|
346
|
+
return _jsx(PhiTextControl, { presentation: "textarea", autoSize: { minRows: 1 }, value: typeof draft === "string" ? draft : "", variant: variant, disabled: disabled, size: "small", style: { width: "100%" }, onChange: (next) => { draftRef.current = next; setDraft(next); }, onBlur: commitOnBlur, onKeyDown: (event) => {
|
|
347
|
+
if (event.key !== "Enter" || event.shiftKey || event.nativeEvent.isComposing)
|
|
348
|
+
return;
|
|
349
|
+
event.preventDefault();
|
|
350
|
+
skipNextBlurRef.current = true;
|
|
351
|
+
commit();
|
|
352
|
+
event.currentTarget.blur();
|
|
353
|
+
} });
|
|
354
|
+
}
|
|
340
355
|
return _jsx(PhiTextControl, { value: typeof draft === "string" ? draft : "", variant: variant, inputRef: textInputRef, disabled: disabled, allowClear: !editor.required, size: "small", style: { width: "100%" }, onChange: (next) => { draftRef.current = next; setDraft(next); }, onBlur: commitOnBlur, onPressEnter: () => {
|
|
341
356
|
skipNextBlurRef.current = true;
|
|
342
357
|
commit();
|
|
@@ -75,7 +75,8 @@ function readTableCellEditor(value) {
|
|
|
75
75
|
editor.control === "segmented" ||
|
|
76
76
|
editor.control === "multi-select" ||
|
|
77
77
|
editor.control === "checkbox-group" ||
|
|
78
|
-
editor.control === "icon-picker"
|
|
78
|
+
editor.control === "icon-picker" ||
|
|
79
|
+
editor.control === "textarea"
|
|
79
80
|
? editor.control
|
|
80
81
|
: undefined,
|
|
81
82
|
required: editor.required === true,
|
|
@@ -40,6 +40,8 @@ const PHI_OBSERVABILITY_LOGS_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
40
40
|
detail_status: "Status",
|
|
41
41
|
empty_title: definePhiMessageLabel("No logs found."),
|
|
42
42
|
empty_text: definePhiMessageLabel("Adjust the filters or extend the time window."),
|
|
43
|
+
count_footer: definePhiMessageLabel("%1 entries found."),
|
|
44
|
+
truncated_footer: definePhiMessageLabel("%1 entries found. Only the newest %2 of this time window were read; choose a shorter window to see the older ones."),
|
|
43
45
|
},
|
|
44
46
|
});
|
|
45
47
|
export async function getPhiObservabilityLogsWidgetLabels(options) {
|
|
@@ -92,5 +94,7 @@ export async function getPhiObservabilityLogsWidgetLabels(options) {
|
|
|
92
94
|
title: labels.empty_title,
|
|
93
95
|
text: labels.empty_text,
|
|
94
96
|
},
|
|
97
|
+
countFooter: labels.count_footer,
|
|
98
|
+
truncatedFooter: labels.truncated_footer,
|
|
95
99
|
};
|
|
96
100
|
}
|
|
@@ -11,6 +11,7 @@ const PHI_SEARCH_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
11
11
|
aria_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.ariaLabel,
|
|
12
12
|
clear_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.clearLabel,
|
|
13
13
|
submit_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.submitLabel,
|
|
14
|
+
close_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.closeLabel,
|
|
14
15
|
},
|
|
15
16
|
});
|
|
16
17
|
export async function getPhiSearchWidgetLabels(options) {
|
|
@@ -21,5 +22,6 @@ export async function getPhiSearchWidgetLabels(options) {
|
|
|
21
22
|
ariaLabel: labels.aria_label,
|
|
22
23
|
clearLabel: labels.clear_label,
|
|
23
24
|
submitLabel: labels.submit_label,
|
|
25
|
+
closeLabel: labels.close_label,
|
|
24
26
|
};
|
|
25
27
|
}
|
|
@@ -4,5 +4,7 @@ export type PhiSearchWidgetLabels = {
|
|
|
4
4
|
ariaLabel: string;
|
|
5
5
|
clearLabel: string;
|
|
6
6
|
submitLabel: string;
|
|
7
|
+
/** The magnifier's way back: the phone's search row closes without searching. */
|
|
8
|
+
closeLabel: string;
|
|
7
9
|
};
|
|
8
10
|
export declare const PHI_SEARCH_WIDGET_DEFAULT_LABELS: PhiSearchWidgetLabels;
|
|
@@ -18,6 +18,7 @@ const PHI_CMS_WIDGET_PLUGIN_KEYS = {
|
|
|
18
18
|
"core": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/core/widgets`,
|
|
19
19
|
"news": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/news/widgets`,
|
|
20
20
|
"observability": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/observability/widgets`,
|
|
21
|
+
"search": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/search/widgets`,
|
|
21
22
|
"theme": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/theme/widgets`,
|
|
22
23
|
"threads": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/threads/widgets`,
|
|
23
24
|
"video": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/video/widgets`,
|
|
@@ -101,8 +102,8 @@ const PHI_CMS_WIDGET_MODULE_BY_TYPE_KEY = {
|
|
|
101
102
|
"record": "core",
|
|
102
103
|
"rate": "core",
|
|
103
104
|
"result": "core",
|
|
104
|
-
"search-box": "
|
|
105
|
-
"search-results": "
|
|
105
|
+
"search-box": "search",
|
|
106
|
+
"search-results": "search",
|
|
106
107
|
"segmented": "core",
|
|
107
108
|
"select-box": "core",
|
|
108
109
|
"sidebar-navigation": "core",
|
package/helpers/site-runtime.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { notePhiLogSiteKey } from "../net/log";
|
|
4
5
|
const DEFAULT_TIMEOUT_MS = 8000;
|
|
5
6
|
function asObject(value) {
|
|
6
7
|
return value && typeof value === "object" ? value : {};
|
|
@@ -62,6 +63,8 @@ export function readPhiSiteRuntimeConfigSync() {
|
|
|
62
63
|
},
|
|
63
64
|
};
|
|
64
65
|
siteRuntimeConfig = { configPath, value };
|
|
66
|
+
// Every record this process writes belongs to this Site (net/log.ts).
|
|
67
|
+
notePhiLogSiteKey(value.site.key);
|
|
65
68
|
return value;
|
|
66
69
|
}
|
|
67
70
|
export function getPhiInternalApiTimeoutMs() {
|
package/net/log.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { PhiLogEvent, PhiLogLevel, PhiLogService, PhiLogger, PhiLoggerContext, } from "@phis/contracts/logging";
|
|
2
2
|
import type { PhiLogEvent, PhiLogLevel, PhiLoggerContext } from "@phis/contracts/logging";
|
|
3
|
+
export declare function notePhiLogSiteKey(siteKey: string): void;
|
|
3
4
|
export declare function logRuntimeEvent(level: PhiLogLevel, event: string, input?: PhiLogEvent & Partial<PhiLoggerContext>): void;
|
package/net/log.js
CHANGED
|
@@ -30,13 +30,31 @@ function emit(level, payload) {
|
|
|
30
30
|
}
|
|
31
31
|
console.info(line);
|
|
32
32
|
}
|
|
33
|
+
/*
|
|
34
|
+
* The Site this process serves, stamped on every record that does not name one.
|
|
35
|
+
*
|
|
36
|
+
* A Site process serves exactly one Site, but its callers almost never passed `siteKey`, so nearly every
|
|
37
|
+
* record carried null and the Site's admin log, which shows only that Site's records, came up empty. The
|
|
38
|
+
* Site's runtime reader notes the key when it reads the configuration (`notePhiLogSiteKey`); in the browser
|
|
39
|
+
* nothing does, and a record there stays as it was. Kept on `globalThis` because the server bundles this
|
|
40
|
+
* file once per layer, and the key noted in one layer must be read in the others.
|
|
41
|
+
*/
|
|
42
|
+
const PHI_LOG_SITE_KEY = Symbol.for("phis.log.siteKey");
|
|
43
|
+
export function notePhiLogSiteKey(siteKey) {
|
|
44
|
+
if (siteKey)
|
|
45
|
+
globalThis[PHI_LOG_SITE_KEY] = siteKey;
|
|
46
|
+
}
|
|
47
|
+
function readNotedSiteKey() {
|
|
48
|
+
const value = globalThis[PHI_LOG_SITE_KEY];
|
|
49
|
+
return typeof value === "string" ? value : null;
|
|
50
|
+
}
|
|
33
51
|
function normalizeContext(context) {
|
|
34
52
|
if (!context.service) {
|
|
35
53
|
throw new Error("Logger service is required.");
|
|
36
54
|
}
|
|
37
55
|
return {
|
|
38
56
|
service: context.service,
|
|
39
|
-
siteKey: context.siteKey ??
|
|
57
|
+
siteKey: context.siteKey ?? readNotedSiteKey(),
|
|
40
58
|
area: context.area ?? null,
|
|
41
59
|
requestId: context.requestId ?? null,
|
|
42
60
|
userId: context.userId ?? null,
|
package/net/phi-next-proxy.js
CHANGED
|
@@ -155,8 +155,16 @@ async function proxyRequest(request, path, config) {
|
|
|
155
155
|
},
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
+
/*
|
|
159
|
+
* How loud a status is depends on what it says. A 5xx is the Server failing: an error. A 409 is a write
|
|
160
|
+
* the Server refused because it collides with what is there -- someone tried something and it did not
|
|
161
|
+
* happen: a warning. Every other 4xx is the Server answering as designed -- no draft is a 404, a visitor
|
|
162
|
+
* who is not signed in a 401 on every page -- and warned about, those buried the rest under hundreds of
|
|
163
|
+
* lines a day. They stay in the log as debug, where a search for one request finds them.
|
|
164
|
+
*/
|
|
158
165
|
if (!targetResponse.ok) {
|
|
159
|
-
|
|
166
|
+
const level = targetResponse.status >= 500 ? "error" : targetResponse.status === 409 ? "warn" : "debug";
|
|
167
|
+
logRuntimeEvent(level, "proxy.request.unhealthy_response", {
|
|
160
168
|
area: "proxy",
|
|
161
169
|
message: "Proxy upstream responded with a non-OK status.",
|
|
162
170
|
method: request.method,
|
package/package.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { PHI_BASE_PAGE_LAYOUT_VERSION } from "../../../components/regions/presets/phi-base-page-layout";
|
|
2
|
-
import { PhiCmsFlags } from "../../../constants/phi-cms";
|
|
3
2
|
import { buildPhiAreaRootRoutePresetDescriptor } from "../area-root-route";
|
|
4
|
-
import { PHI_APP_SEARCH_PAGE_PRESET_KEY } from "../search-page-references";
|
|
5
3
|
import { PHI_APP_RUNTIME_MODULE_ID } from "./ids";
|
|
6
4
|
/* What the App base Module brings: its Area shell, the Area root and the profile Page. */
|
|
7
5
|
export const PHI_APP_RUNTIME_MODULE_AREA_SHELLS = [
|
|
@@ -66,25 +64,4 @@ export const PHI_APP_RUNTIME_MODULE_ROUTES = [
|
|
|
66
64
|
loadTree: ({ page, runtime }) => import("./trees/phi-default-app-profile-page-tree")
|
|
67
65
|
.then((module) => module.buildPhiDefaultAppProfilePageTree({ page, runtime })),
|
|
68
66
|
},
|
|
69
|
-
/*
|
|
70
|
-
* The App's own results Page (SEARCH.md). A signed-in member searches the App and the Public Site
|
|
71
|
-
* at once, and that is decided by where the results Widget stands: on this Page, in the App. The box
|
|
72
|
-
* in the App's sider leads here. No menu entry and `NoIndex`, as for the Public one.
|
|
73
|
-
*/
|
|
74
|
-
{
|
|
75
|
-
ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
|
|
76
|
-
presetKey: PHI_APP_SEARCH_PAGE_PRESET_KEY,
|
|
77
|
-
presetVersion: 1,
|
|
78
|
-
area: "app",
|
|
79
|
-
title: "Search",
|
|
80
|
-
path: "/search",
|
|
81
|
-
navigation: [],
|
|
82
|
-
defaultPageFlags: PhiCmsFlags.NoIndex,
|
|
83
|
-
loadTree: ({ page }) => import("../search-page-tree")
|
|
84
|
-
.then((module) => module.buildPhiDefaultSearchPageTree({
|
|
85
|
-
page,
|
|
86
|
-
ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
|
|
87
|
-
presetKey: PHI_APP_SEARCH_PAGE_PRESET_KEY,
|
|
88
|
-
})),
|
|
89
|
-
},
|
|
90
67
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
|
|
1
|
+
export declare const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
|
|
@@ -4,6 +4,7 @@ import { createPhiDashboardRuntimeModuleServerAreaContribution } from "../dashbo
|
|
|
4
4
|
import { createPhiGroupsRuntimeModuleServerAreaContribution } from "../groups/server";
|
|
5
5
|
import { createPhiAuthRuntimeModuleServerAreaContribution } from "../auth/server";
|
|
6
6
|
import { createPhiVideoRuntimeModuleServerAreaContribution } from "../video/server";
|
|
7
|
+
import { createPhiSearchRuntimeModuleServerAreaContribution } from "../search/server";
|
|
7
8
|
import { PHI_APP_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION } from "../app/server";
|
|
8
9
|
export const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
|
|
9
10
|
...createPhiCommonRuntimeModuleServerAreaContributions(),
|
|
@@ -12,5 +13,6 @@ export const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
|
|
|
12
13
|
createPhiGroupsRuntimeModuleServerAreaContribution(),
|
|
13
14
|
createPhiAvatarRuntimeModuleServerAreaContribution(),
|
|
14
15
|
createPhiVideoRuntimeModuleServerAreaContribution(),
|
|
16
|
+
createPhiSearchRuntimeModuleServerAreaContribution(),
|
|
15
17
|
PHI_APP_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION,
|
|
16
18
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
|
|
1
|
+
export declare const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
|
|
@@ -4,6 +4,7 @@ import { createPhiNewsRuntimeModuleServerAreaContribution } from "../news/server
|
|
|
4
4
|
import { createPhiBlogRuntimeModuleServerAreaContribution } from "../blog/server";
|
|
5
5
|
import { PHI_PUBLIC_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION } from "../public/server";
|
|
6
6
|
import { createPhiVideoRuntimeModuleServerAreaContribution } from "../video/server";
|
|
7
|
+
import { createPhiSearchRuntimeModuleServerAreaContribution } from "../search/server";
|
|
7
8
|
export const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
|
|
8
9
|
...createPhiCommonRuntimeModuleServerAreaContributions(),
|
|
9
10
|
PHI_PUBLIC_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION,
|
|
@@ -11,4 +12,5 @@ export const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
|
|
|
11
12
|
createPhiNewsRuntimeModuleServerAreaContribution(),
|
|
12
13
|
createPhiBlogRuntimeModuleServerAreaContribution(),
|
|
13
14
|
createPhiVideoRuntimeModuleServerAreaContribution(),
|
|
15
|
+
createPhiSearchRuntimeModuleServerAreaContribution(),
|
|
14
16
|
];
|
|
@@ -15,18 +15,37 @@ const PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID = firstPartyModuleId("user-managemen
|
|
|
15
15
|
const PHI_DASHBOARD_RUNTIME_MODULE_ID = firstPartyModuleId("dashboard");
|
|
16
16
|
const PHI_NEWS_RUNTIME_MODULE_ID = firstPartyModuleId("news");
|
|
17
17
|
const PHI_REVISIONS_RUNTIME_MODULE_ID = firstPartyModuleId("revisions");
|
|
18
|
+
/*
|
|
19
|
+
* The Site's search starts on where it is read (SEARCH.md): the Public header carries its magnifier and
|
|
20
|
+
* the App's sider its box, and both go with the Module when a Site switches it off.
|
|
21
|
+
*/
|
|
22
|
+
const PHI_SEARCH_RUNTIME_MODULE_ID = firstPartyModuleId("search");
|
|
18
23
|
/*
|
|
19
24
|
* Conversations are a Site's communication system, so every Area with a sidebar starts with them: the
|
|
20
25
|
* Area ships the Page and its sidebar offers the entry, and a default without the Module would offer an
|
|
21
26
|
* entry leading nowhere. Public has neither.
|
|
22
27
|
*/
|
|
23
28
|
const PHI_THREADS_RUNTIME_MODULE_ID = firstPartyModuleId("threads");
|
|
29
|
+
/*
|
|
30
|
+
* Tours explain the working Areas, so every Area but Public starts with the Module that runs them: the
|
|
31
|
+
* Pages carry their Tours either way, and without it their buttons stay hidden. Public has no Tour to give.
|
|
32
|
+
*/
|
|
33
|
+
const PHI_TOUR_RUNTIME_MODULE_ID = firstPartyModuleId("tour");
|
|
24
34
|
export function createPhiDefaultAreaRuntimeModuleIds(area) {
|
|
35
|
+
const moduleIds = listAreaRuntimeModuleIds(area);
|
|
36
|
+
return area === "public" ? moduleIds : [...moduleIds, PHI_TOUR_RUNTIME_MODULE_ID];
|
|
37
|
+
}
|
|
38
|
+
function listAreaRuntimeModuleIds(area) {
|
|
25
39
|
if (area === "public") {
|
|
26
|
-
return [PHI_AUTH_RUNTIME_MODULE_ID];
|
|
40
|
+
return [PHI_AUTH_RUNTIME_MODULE_ID, PHI_SEARCH_RUNTIME_MODULE_ID];
|
|
27
41
|
}
|
|
28
42
|
if (area === "app") {
|
|
29
|
-
return [
|
|
43
|
+
return [
|
|
44
|
+
PHI_AUTH_RUNTIME_MODULE_ID,
|
|
45
|
+
PHI_DASHBOARD_RUNTIME_MODULE_ID,
|
|
46
|
+
PHI_THREADS_RUNTIME_MODULE_ID,
|
|
47
|
+
PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
48
|
+
];
|
|
30
49
|
}
|
|
31
50
|
if (area === "builder") {
|
|
32
51
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];
|
|
1
|
+
export declare const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];
|
|
@@ -5,6 +5,7 @@ import { PHI_AUTH_RUNTIME_MODULE_ID } from "../auth/ids";
|
|
|
5
5
|
import { PHI_GROUPS_RUNTIME_MODULE_ID } from "../groups/ids";
|
|
6
6
|
import { PHI_AVATAR_RUNTIME_MODULE_ID } from "../avatar/ids";
|
|
7
7
|
import { PHI_VIDEO_RUNTIME_MODULE_ID } from "../video/ids";
|
|
8
|
+
import { PHI_SEARCH_RUNTIME_MODULE_ID } from "../search/ids";
|
|
8
9
|
import { PHI_COMMON_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS } from "./common";
|
|
9
10
|
import { PHI_DASHBOARD_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTION } from "../dashboard/authoring-client";
|
|
10
11
|
export const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS = [
|
|
@@ -25,6 +26,11 @@ export const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS = [
|
|
|
25
26
|
loadAuthoring: () => import("../avatar/authoring")
|
|
26
27
|
.then((module) => module.PhiAvatarRuntimeModuleAuthoringClient),
|
|
27
28
|
}),
|
|
29
|
+
definePhiRuntimeModuleAuthoringClientContribution({
|
|
30
|
+
moduleId: PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
31
|
+
loadAuthoring: () => import("../search/authoring")
|
|
32
|
+
.then((module) => module.PhiSearchRuntimeModuleAuthoringClient),
|
|
33
|
+
}),
|
|
28
34
|
definePhiRuntimeModuleAuthoringClientContribution({
|
|
29
35
|
moduleId: PHI_VIDEO_RUNTIME_MODULE_ID,
|
|
30
36
|
loadAuthoring: () => import("../video/authoring")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PHI_PUBLIC_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];
|
|
1
|
+
export declare const PHI_PUBLIC_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];
|
|
@@ -3,6 +3,7 @@ import { definePhiRuntimeModuleAuthoringClientContribution, } from "../authoring
|
|
|
3
3
|
import { PHI_PUBLIC_RUNTIME_MODULE_ID } from "../public/ids";
|
|
4
4
|
import { PHI_AUTH_RUNTIME_MODULE_ID } from "../auth/ids";
|
|
5
5
|
import { PHI_VIDEO_RUNTIME_MODULE_ID } from "../video/ids";
|
|
6
|
+
import { PHI_SEARCH_RUNTIME_MODULE_ID } from "../search/ids";
|
|
6
7
|
import { PHI_NEWS_RUNTIME_MODULE_ID } from "../news/ids";
|
|
7
8
|
import { PHI_BLOG_RUNTIME_MODULE_ID } from "../blog/ids";
|
|
8
9
|
import { PHI_COMMON_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS } from "./common";
|
|
@@ -18,6 +19,11 @@ export const PHI_PUBLIC_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS = [
|
|
|
18
19
|
loadAuthoring: () => import("../auth/authoring")
|
|
19
20
|
.then((module) => module.PhiAuthRuntimeModuleAuthoringClient),
|
|
20
21
|
}),
|
|
22
|
+
definePhiRuntimeModuleAuthoringClientContribution({
|
|
23
|
+
moduleId: PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
24
|
+
loadAuthoring: () => import("../search/authoring")
|
|
25
|
+
.then((module) => module.PhiSearchRuntimeModuleAuthoringClient),
|
|
26
|
+
}),
|
|
21
27
|
definePhiRuntimeModuleAuthoringClientContribution({
|
|
22
28
|
moduleId: PHI_VIDEO_RUNTIME_MODULE_ID,
|
|
23
29
|
loadAuthoring: () => import("../video/authoring")
|
|
@@ -257,11 +257,11 @@ export const PHI_COMMON_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST = createPhiRuntime
|
|
|
257
257
|
],
|
|
258
258
|
[
|
|
259
259
|
PhiCmsWidgetType.SearchBox,
|
|
260
|
-
definePhiRuntimeModuleRenderClient(dynamic(() => import("../
|
|
260
|
+
definePhiRuntimeModuleRenderClient(dynamic(() => import("../search/widgets/search-box/client").then((module) => module.PhiSearchBoxWidgetClient))),
|
|
261
261
|
],
|
|
262
262
|
[
|
|
263
263
|
PhiCmsWidgetType.SearchResults,
|
|
264
|
-
definePhiRuntimeModuleRenderClient(dynamic(() => import("../
|
|
264
|
+
definePhiRuntimeModuleRenderClient(dynamic(() => import("../search/widgets/search-results/client").then((module) => module.PhiSearchResultsWidgetClient))),
|
|
265
265
|
],
|
|
266
266
|
[
|
|
267
267
|
PhiCmsWidgetType.EntryDetail,
|
|
@@ -45,8 +45,6 @@ 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";
|
|
50
48
|
import { PHI_ENTRY_DETAIL_WIDGET_DEFINITION } from "./widgets/entry-detail/config";
|
|
51
49
|
import { PHI_ENTRY_HEADER_WIDGET_DEFINITION } from "./widgets/entry-header/config";
|
|
52
50
|
import { PHI_THREAD_CONVERSATION_WIDGET_DEFINITION } from "./widgets/thread-conversation/config";
|
|
@@ -105,8 +103,6 @@ export default createPhiAuthoringWidgetModule([
|
|
|
105
103
|
definePhiAuthoringWidgetModuleLoader(PHI_GALLERY_WIDGET_DEFINITION, () => import("./widgets/gallery/authoring").then((module) => module.PHI_GALLERY_WIDGET_BUILDER_PLUGIN)),
|
|
106
104
|
definePhiAuthoringWidgetModuleLoader(PHI_STEPS_WIDGET_DEFINITION, () => import("./widgets/steps/authoring").then((module) => module.PHI_STEPS_WIDGET_BUILDER_PLUGIN)),
|
|
107
105
|
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)),
|
|
110
106
|
definePhiAuthoringWidgetModuleLoader(PHI_ENTRY_LIST_WIDGET_DEFINITION, () => import("./widgets/entry-list/authoring").then((module) => module.PHI_ENTRY_LIST_WIDGET_BUILDER_PLUGIN)),
|
|
111
107
|
definePhiAuthoringWidgetModuleLoader(PHI_ENTRY_DETAIL_WIDGET_DEFINITION, () => import("./widgets/entry-detail/authoring").then((module) => module.PHI_ENTRY_DETAIL_WIDGET_BUILDER_PLUGIN)),
|
|
112
108
|
definePhiAuthoringWidgetModuleLoader(PHI_ENTRY_HEADER_WIDGET_DEFINITION, () => import("./widgets/entry-header/authoring").then((module) => module.PHI_ENTRY_HEADER_WIDGET_BUILDER_PLUGIN)),
|
|
@@ -245,7 +245,7 @@ export function PhiAssetCollectionViewBinding({ config, binding, labels: rawLabe
|
|
|
245
245
|
const display = action.display ?? "icon";
|
|
246
246
|
const label = action.label ?? (action.key === "upload" ? labels.tool.uploadToggleLabel : action.key);
|
|
247
247
|
return (_jsx(PhiButtonControl, { label: display === "icon" ? undefined : label, ariaLabel: label, tooltip: action.description, icon: display === "label" || !action.icon ? undefined : resolvePhiButtonIcon(action.icon), type: action.mode === "primary" ? "primary" : "default", danger: action.mode === "danger", size: controlSize, onClick: action.key === "upload" ? () => binding.setOpenPanelKey(state.uploadPanelOpen ? null : "upload") : undefined }, action.key));
|
|
248
|
-
}), features.tools.reset ? (_jsx(PhiButtonControl, { ariaLabel: labels.tool.resetLabel, tooltip: labels.tool.resetLabel, icon: resolvePhiButtonIcon("antd:
|
|
248
|
+
}), features.tools.reset ? (_jsx(PhiButtonControl, { ariaLabel: labels.tool.resetLabel, tooltip: labels.tool.resetLabel, icon: resolvePhiButtonIcon("antd:rollback-outlined"), size: controlSize, onClick: () => binding.setQuery({
|
|
249
249
|
...(config.initialQuery ?? {}),
|
|
250
250
|
page: config.initialQuery?.page ?? 1,
|
|
251
251
|
pageSize: config.initialQuery?.pageSize ?? features.pagination?.pageSize ?? 20,
|
|
@@ -67,5 +67,5 @@ export function PhiMarkdownTocWidgetClient({ config }) {
|
|
|
67
67
|
overflowY: "auto",
|
|
68
68
|
overflowX: "hidden",
|
|
69
69
|
minWidth: 0,
|
|
70
|
-
}, children: _jsxs("div", { style: { display: "grid", gap: token.paddingSM, width: "100%", minWidth: 0 }, children: [showTitle ? (_jsx(PhiTypographyControl, { strong: true, style: { color: token.colorTextHeading }, children: title })) : null, headings.length > 0 ? (_jsx(PhiAnchorNavControl, { offsetTop: config?.offsetTop ?? 0, items: buildAnchorItems(headings, token.paddingSM), style: { width: "100%" } })) : (_jsx(PhiEmptyControl, { description: "No markdown headings" }))] }) }));
|
|
70
|
+
}, children: _jsxs("div", { style: { display: "grid", gap: token.paddingSM, width: "100%", minWidth: 0 }, children: [showTitle ? (_jsx(PhiTypographyControl, { strong: true, style: { color: token.colorTextHeading, paddingInlineStart: token.lineWidthBold + token.padding }, children: title })) : null, headings.length > 0 ? (_jsx(PhiAnchorNavControl, { offsetTop: config?.offsetTop ?? 0, items: buildAnchorItems(headings, token.paddingSM), style: { width: "100%" } })) : (_jsx(PhiEmptyControl, { description: "No markdown headings" }))] }) }));
|
|
71
71
|
}
|
|
@@ -4,7 +4,7 @@ import { PHI_TABLE_WIDGET_DEFAULT_LABELS } from "../../../../../components/widge
|
|
|
4
4
|
import { formatPhiTableWidgetLabel } from "../../../../../components/widgets/label-types/table";
|
|
5
5
|
import { PhiNameControl } from "../../../../../components/controls/phi-name-control";
|
|
6
6
|
import { PhiDescriptionHint } from "../../../../../components/controls/phi-description-tooltip-icon";
|
|
7
|
-
import {
|
|
7
|
+
import { useCallback, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
|
|
8
8
|
import { PhiMultiSelectControl } from "../../../../../components/controls/phi-multi-select-control";
|
|
9
9
|
import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
|
|
10
10
|
import { PhiWidgetFailure } from "../../../../../components/widgets/shared/widget-failure-client";
|
|
@@ -760,13 +760,15 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
760
760
|
filters: updateTableQueryFilters(current.filters, filter, value),
|
|
761
761
|
}));
|
|
762
762
|
} }));
|
|
763
|
+
// The description goes where every Control's goes: behind the glyph after a shown label, and
|
|
764
|
+
// as the Control's own hover text where the label is dropped.
|
|
763
765
|
if (filter.labelPlacement === "none") {
|
|
764
|
-
return _jsx(
|
|
766
|
+
return _jsx(PhiLabeledControl, { description: filter.description, children: control }, filter.key);
|
|
765
767
|
}
|
|
766
768
|
if (filter.labelPlacement === "inline") {
|
|
767
|
-
return _jsx(PhiLabeledControl, { label: filter.label, children: control }, filter.key);
|
|
769
|
+
return _jsx(PhiLabeledControl, { label: filter.label, description: filter.description, children: control }, filter.key);
|
|
768
770
|
}
|
|
769
|
-
return (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsx(PhiTypographyControl, { type: "secondary", children: filter.label }), control] }, filter.key));
|
|
771
|
+
return (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsxs(PhiFlexControl, { align: "center", gap: token.paddingXXS, children: [_jsx(PhiTypographyControl, { type: "secondary", children: filter.label }), filter.description ? _jsx(PhiDescriptionHint, { description: filter.description }) : null] }), control] }, filter.key));
|
|
770
772
|
}), features.search?.enabled ? (_jsx(PhiTextControl, { inputType: "search", allowClear: true, placeholder: features.search.placeholder ?? labels.search, value: searchDraft, size: resolvedControlSize, onChange: (value) => setSearchDraft(value ?? ""), style: { width: 260 } })) : null] })) : null;
|
|
771
773
|
const collectionToolbar = hasSelfContainedTools && (toolbarActions.length > 0 ||
|
|
772
774
|
bulkActions.length > 0 ||
|
|
@@ -781,7 +783,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
781
783
|
return null;
|
|
782
784
|
const disabled = findMatchingCondition(null, action.disabledWhen, conditionSources);
|
|
783
785
|
return _jsx(TableAction, { action: action, size: resolvedControlSize, disabled: selectedRowIdentities.length === 0 || Boolean(disabled), disabledReason: disabled && "reason" in disabled ? disabled.reason : undefined, templateValue: selectedRowIdentities.length, onActivate: () => activateAction(action, undefined, selectedRowIdentities) }, action.key);
|
|
784
|
-
}), hasQueryTools && features.tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "
|
|
786
|
+
}), hasQueryTools && features.tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "rollback-outlined", size: "inherit" }), ariaLabel: labels.reset, tooltip: labels.reset, size: resolvedControlSize, onClick: resetQuery })) : null, features.tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: resolvedControlSize, onClick: reload })) : null] })) : null;
|
|
785
787
|
/*
|
|
786
788
|
* The source's failures end the Table here: a binding that does not hold, a resource the
|
|
787
789
|
* configuration does not fit, a read that failed. A refused edit is not one of them -- it stays in
|
|
@@ -125,7 +125,7 @@ const PHI_TABLE_COLUMN_RENDERERS = [
|
|
|
125
125
|
"text", "email", "date", "datetime", "badge", "tags", "link", "code", "json", "switch", "checkbox", "icon",
|
|
126
126
|
];
|
|
127
127
|
const PHI_TABLE_COLUMN_EDITOR_CONTROLS = [
|
|
128
|
-
"switch", "checkbox", "select", "radio", "segmented", "multi-select", "checkbox-group", "icon-picker",
|
|
128
|
+
"switch", "checkbox", "select", "radio", "segmented", "multi-select", "checkbox-group", "icon-picker", "textarea",
|
|
129
129
|
];
|
|
130
130
|
const PHI_TABLE_ALIGNS = ["left", "center", "right"];
|
|
131
131
|
function readCondition(reader, key) {
|
|
@@ -269,6 +269,7 @@ function readFilter(reader) {
|
|
|
269
269
|
const key = requireString(reader, "key");
|
|
270
270
|
const label = requireString(reader, "label");
|
|
271
271
|
const labelPlacement = reader.oneOf("labelPlacement", ["inline", "none"]);
|
|
272
|
+
const description = reader.string("description");
|
|
272
273
|
const type = reader.oneOf("type", ["text", "select", "boolean", "dateRange"]) ?? "text";
|
|
273
274
|
if (type === "select") {
|
|
274
275
|
return {
|
|
@@ -276,6 +277,7 @@ function readFilter(reader) {
|
|
|
276
277
|
type,
|
|
277
278
|
label,
|
|
278
279
|
labelPlacement,
|
|
280
|
+
description,
|
|
279
281
|
multiple: reader.boolean("multiple"),
|
|
280
282
|
options: reader.list("options", (optionReader) => ({
|
|
281
283
|
label: requireString(optionReader, "label"),
|
|
@@ -295,6 +297,7 @@ function readFilter(reader) {
|
|
|
295
297
|
control: reader.oneOf("control", ["switch"]),
|
|
296
298
|
label,
|
|
297
299
|
labelPlacement,
|
|
300
|
+
description,
|
|
298
301
|
defaultValue: reader.boolean("defaultValue"),
|
|
299
302
|
};
|
|
300
303
|
}
|
|
@@ -304,6 +307,7 @@ function readFilter(reader) {
|
|
|
304
307
|
type,
|
|
305
308
|
label,
|
|
306
309
|
labelPlacement,
|
|
310
|
+
description,
|
|
307
311
|
startKey: requireString(reader, "startKey"),
|
|
308
312
|
endKey: requireString(reader, "endKey"),
|
|
309
313
|
startPlaceholder: reader.string("startPlaceholder"),
|
|
@@ -319,6 +323,7 @@ function readFilter(reader) {
|
|
|
319
323
|
type,
|
|
320
324
|
label,
|
|
321
325
|
labelPlacement,
|
|
326
|
+
description,
|
|
322
327
|
placeholder: reader.string("placeholder"),
|
|
323
328
|
defaultValue: reader.string("defaultValue"),
|
|
324
329
|
};
|
|
@@ -698,6 +703,7 @@ export const PHI_TABLE_WIDGET_DEFINITION = {
|
|
|
698
703
|
{ value: "multi-select", label: "Multi-select" },
|
|
699
704
|
{ value: "checkbox-group", label: "Checkbox group" },
|
|
700
705
|
{ value: "icon-picker", label: "Icon picker" },
|
|
706
|
+
{ value: "textarea", label: "Text area" },
|
|
701
707
|
],
|
|
702
708
|
},
|
|
703
709
|
// The unit beside a number editor; the column title names the value, not its unit.
|
|
@@ -736,6 +742,7 @@ export const PHI_TABLE_WIDGET_DEFINITION = {
|
|
|
736
742
|
{ value: "dateRange", label: "Date Range" },
|
|
737
743
|
],
|
|
738
744
|
},
|
|
745
|
+
{ key: "description", type: "string", label: "Description" },
|
|
739
746
|
{ key: "placeholder", type: "string", label: "Placeholder", visibleWhen: { field: "type", equals: "text" } },
|
|
740
747
|
{ key: "defaultValue", type: "string", label: "Default", visibleWhen: { field: "type", equals: "text" } },
|
|
741
748
|
{ key: "multiple", type: "boolean", label: "Multiple", visibleWhen: { field: "type", equals: "select" } },
|
|
@@ -184,7 +184,7 @@ export function PhiTreeWidgetClient({ config, labels, renderMode }) {
|
|
|
184
184
|
const toolbar = selfContained && ((config.features.actions?.selection?.length ?? 0) > 0 ||
|
|
185
185
|
(config.features.actions?.toolbar?.length ?? 0) > 0 ||
|
|
186
186
|
hasResettableQuery && tools?.reset !== false ||
|
|
187
|
-
tools?.reload === true) ? (_jsxs(PhiToolbarControl, { size: controlSize, compact: true, children: [(config.features.actions?.toolbar ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, onActivate: () => activate(action) }, action.key))), (config.features.actions?.selection ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, disabled: binding.selectedNodeIdentities.length === 0, onActivate: () => activate(action) }, action.key))), hasResettableQuery && tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "
|
|
187
|
+
tools?.reload === true) ? (_jsxs(PhiToolbarControl, { size: controlSize, compact: true, children: [(config.features.actions?.toolbar ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, onActivate: () => activate(action) }, action.key))), (config.features.actions?.selection ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, disabled: binding.selectedNodeIdentities.length === 0, onActivate: () => activate(action) }, action.key))), hasResettableQuery && tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "rollback-outlined", size: "inherit" }), ariaLabel: labels.reset, tooltip: labels.reset, size: controlSize, onClick: resetTools })) : null, tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: controlSize, onClick: binding.reload })) : null] })) : null;
|
|
188
188
|
/*
|
|
189
189
|
* The source's failures end the Tree here: a binding that does not hold, a resource the configuration
|
|
190
190
|
* does not fit, a read that failed. A refused change stays in `binding.error` alone, said above the
|
|
@@ -45,8 +45,6 @@ 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";
|
|
50
48
|
import { PHI_ENTRY_DETAIL_WIDGET_DEFINITION } from "./widgets/entry-detail/config";
|
|
51
49
|
import { PHI_ENTRY_HEADER_WIDGET_DEFINITION } from "./widgets/entry-header/config";
|
|
52
50
|
import { PHI_THREAD_CONVERSATION_WIDGET_DEFINITION } from "./widgets/thread-conversation/config";
|
|
@@ -371,21 +369,6 @@ export const PHI_RUNTIME_MODULE_WIDGETS = [
|
|
|
371
369
|
loadRuntime: () => import("./widgets/timeline/plugin").then((module) => module.PHI_TIMELINE_WIDGET_PLUGIN),
|
|
372
370
|
loadPreview: () => import("./widgets/timeline/plugin").then((module) => module.PHI_TIMELINE_WIDGET_PLUGIN),
|
|
373
371
|
}),
|
|
374
|
-
// The Site's own search (SEARCH.md): the box a visitor types into and the Page that answers it.
|
|
375
|
-
definePhiFirstPartyWidget({
|
|
376
|
-
definition: PHI_SEARCH_BOX_WIDGET_DEFINITION,
|
|
377
|
-
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
378
|
-
renderPolicies: { "runtime": "custom", "preview": "custom", "authoring": "custom" },
|
|
379
|
-
loadRuntime: () => import("./widgets/search-box/plugin").then((module) => module.PHI_SEARCH_BOX_WIDGET_PLUGIN),
|
|
380
|
-
loadPreview: () => import("./widgets/search-box/plugin").then((module) => module.PHI_SEARCH_BOX_WIDGET_PLUGIN),
|
|
381
|
-
}),
|
|
382
|
-
definePhiFirstPartyWidget({
|
|
383
|
-
definition: PHI_SEARCH_RESULTS_WIDGET_DEFINITION,
|
|
384
|
-
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
385
|
-
renderPolicies: { "runtime": "custom", "preview": "custom", "authoring": "custom" },
|
|
386
|
-
loadRuntime: () => import("./widgets/search-results/plugin").then((module) => module.PHI_SEARCH_RESULTS_WIDGET_PLUGIN),
|
|
387
|
-
loadPreview: () => import("./widgets/search-results/plugin").then((module) => module.PHI_SEARCH_RESULTS_WIDGET_PLUGIN),
|
|
388
|
-
}),
|
|
389
372
|
// A content kind's entries and one entry of it, for every kind's Module (`CONTENT_ENTRIES.md`).
|
|
390
373
|
definePhiFirstPartyWidget({
|
|
391
374
|
definition: PHI_ENTRY_LIST_WIDGET_DEFINITION,
|