@phis/ui 0.4.16 → 0.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/cms/phi-cms-render-error-boundary.d.ts +8 -0
- package/components/cms/phi-cms-render-error-boundary.js +2 -1
- 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/module-references.d.ts +19 -0
- package/module-references.js +18 -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 +6 -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/builder/render-root-node-scaffold.js +54 -54
- 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 +142 -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
|
@@ -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,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PhiTableActionDefinition, PhiTableColumnDefinition, PhiTableFooterConfig, PhiTableToolsConfig, PhiTableWidgetFeatures, PhiTableWidgetPresentation } from "../../../../types/table-widget";
|
|
2
|
+
import type { PhiProviderResourceSource } from "../../../../types/runtime-data-provider";
|
|
3
|
+
import type { getPhiGroupFormLabels } from "../labels";
|
|
4
|
+
type PhiGroupLabels = Awaited<ReturnType<typeof getPhiGroupFormLabels>>;
|
|
5
|
+
type PhiGroupRowCondition = {
|
|
6
|
+
valuePath: string;
|
|
7
|
+
operator: "truthy" | "falsy";
|
|
8
|
+
};
|
|
9
|
+
/** A membership level as the word the reader knows it by, for a badge and for the level editor. */
|
|
10
|
+
export declare function buildPhiGroupLevelValueMap(labels: PhiGroupLabels): Record<string, string>;
|
|
11
|
+
/** The switches someone who manages a group sets on it, each with its hint behind the heading. */
|
|
12
|
+
export declare function buildPhiGroupSettingColumns(labels: PhiGroupLabels): PhiTableColumnDefinition[];
|
|
13
|
+
/** How many groups the list holds, under it. */
|
|
14
|
+
export declare function buildPhiGroupsFooter(labels: PhiGroupLabels): PhiTableFooterConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Ending a group, from its row. `blockedWhen` names what makes a row one this reader cannot end -- the
|
|
17
|
+
* two Pages differ in that and in nothing else about the action.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildPhiGroupRetireAction(labels: PhiGroupLabels, blockedWhen: readonly PhiGroupRowCondition[]): PhiTableActionDefinition;
|
|
20
|
+
/**
|
|
21
|
+
* The members of the selected group: source, presentation and features of the Table. The Page adds
|
|
22
|
+
* its own signal routes, because whom the Table speaks to is the Page's arrangement.
|
|
23
|
+
*
|
|
24
|
+
* `audience` is the one real difference. `colleagues` is what a member sees of the others -- a name, a
|
|
25
|
+
* level, the company where the group shows it; no address and no source, because a colleague is
|
|
26
|
+
* recognized by name and where a membership comes from is an administration question. There a row may
|
|
27
|
+
* be removed where the control plane says this reader administers the group (`manageable`).
|
|
28
|
+
* `administration` adds address, source and date, and removes any membership the Site itself holds
|
|
29
|
+
* (`local`); one a Directory contributes is read here and changed at its source.
|
|
30
|
+
*
|
|
31
|
+
* The level is edited in the cell it is read in on both: the provider states per row, through the
|
|
32
|
+
* field's `mutableWhen`, whether this reader may -- a member sees the same table without an editor.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildPhiGroupMembersTable({ labels, audience, tools, toolbar, }: {
|
|
35
|
+
labels: PhiGroupLabels;
|
|
36
|
+
audience: "colleagues" | "administration";
|
|
37
|
+
tools?: PhiTableToolsConfig;
|
|
38
|
+
toolbar?: PhiTableActionDefinition[];
|
|
39
|
+
}): {
|
|
40
|
+
source: PhiProviderResourceSource;
|
|
41
|
+
presentation: PhiTableWidgetPresentation;
|
|
42
|
+
features: PhiTableWidgetFeatures;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { PhiGroupMembershipFlags } from "../../../../constants/site-groups";
|
|
2
|
+
import { PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
3
|
+
/** A membership level as the word the reader knows it by, for a badge and for the level editor. */
|
|
4
|
+
export function buildPhiGroupLevelValueMap(labels) {
|
|
5
|
+
return {
|
|
6
|
+
[String(PhiGroupMembershipFlags.Member)]: labels.levels.member,
|
|
7
|
+
[String(PhiGroupMembershipFlags.Author)]: labels.levels.author,
|
|
8
|
+
[String(PhiGroupMembershipFlags.Editor)]: labels.levels.editor,
|
|
9
|
+
[String(PhiGroupMembershipFlags.Manager)]: labels.levels.manager,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** The switches someone who manages a group sets on it, each with its hint behind the heading. */
|
|
13
|
+
export function buildPhiGroupSettingColumns(labels) {
|
|
14
|
+
const setting = (key, title, description) => ({
|
|
15
|
+
key,
|
|
16
|
+
fieldKey: key,
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
renderer: "switch",
|
|
20
|
+
editor: { control: "switch" },
|
|
21
|
+
sizing: { mode: "content" },
|
|
22
|
+
});
|
|
23
|
+
return [
|
|
24
|
+
setting("showMemberCompany", labels.columns.showCompany, labels.columns.showCompanyHint),
|
|
25
|
+
setting("threads", labels.columns.threads, labels.columns.threadsHint),
|
|
26
|
+
setting("crossGroupThreads", labels.columns.crossGroupThreads, labels.columns.crossGroupThreadsHint),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
/** How many groups the list holds, under it. */
|
|
30
|
+
export function buildPhiGroupsFooter(labels) {
|
|
31
|
+
return {
|
|
32
|
+
template: labels.groups.footer,
|
|
33
|
+
values: [{ key: "groups", value: { source: "core", fieldKey: "totalRows" } }],
|
|
34
|
+
align: "start",
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Ending a group, from its row. `blockedWhen` names what makes a row one this reader cannot end -- the
|
|
39
|
+
* two Pages differ in that and in nothing else about the action.
|
|
40
|
+
*/
|
|
41
|
+
export function buildPhiGroupRetireAction(labels, blockedWhen) {
|
|
42
|
+
return {
|
|
43
|
+
key: "retire",
|
|
44
|
+
label: labels.actions.retire,
|
|
45
|
+
icon: "antd:stop",
|
|
46
|
+
display: "icon",
|
|
47
|
+
mode: "danger",
|
|
48
|
+
execution: "provider",
|
|
49
|
+
disabledWhen: {
|
|
50
|
+
match: "any",
|
|
51
|
+
conditions: blockedWhen.map((condition) => ({
|
|
52
|
+
source: "row",
|
|
53
|
+
...condition,
|
|
54
|
+
reason: labels.actions.retire,
|
|
55
|
+
})),
|
|
56
|
+
},
|
|
57
|
+
confirm: {
|
|
58
|
+
title: labels.actions.retireConfirmTitle,
|
|
59
|
+
description: labels.actions.retireConfirmText,
|
|
60
|
+
okText: labels.actions.retireConfirmOk,
|
|
61
|
+
cancelText: labels.actions.removeConfirmCancel,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The members of the selected group: source, presentation and features of the Table. The Page adds
|
|
67
|
+
* its own signal routes, because whom the Table speaks to is the Page's arrangement.
|
|
68
|
+
*
|
|
69
|
+
* `audience` is the one real difference. `colleagues` is what a member sees of the others -- a name, a
|
|
70
|
+
* level, the company where the group shows it; no address and no source, because a colleague is
|
|
71
|
+
* recognized by name and where a membership comes from is an administration question. There a row may
|
|
72
|
+
* be removed where the control plane says this reader administers the group (`manageable`).
|
|
73
|
+
* `administration` adds address, source and date, and removes any membership the Site itself holds
|
|
74
|
+
* (`local`); one a Directory contributes is read here and changed at its source.
|
|
75
|
+
*
|
|
76
|
+
* The level is edited in the cell it is read in on both: the provider states per row, through the
|
|
77
|
+
* field's `mutableWhen`, whether this reader may -- a member sees the same table without an editor.
|
|
78
|
+
*/
|
|
79
|
+
export function buildPhiGroupMembersTable({ labels, audience, tools, toolbar, }) {
|
|
80
|
+
const administration = audience === "administration";
|
|
81
|
+
const columns = [
|
|
82
|
+
{ key: "displayName", fieldKey: "displayName", title: labels.columns.name, sizing: { mode: "fill", minWidth: 200 } },
|
|
83
|
+
administration
|
|
84
|
+
? { key: "email", fieldKey: "email", title: labels.columns.email, sizing: { mode: "content" } }
|
|
85
|
+
: { key: "companyName", fieldKey: "companyName", title: labels.columns.company, sizing: { mode: "content" } },
|
|
86
|
+
{
|
|
87
|
+
key: "membershipFlags",
|
|
88
|
+
fieldKey: "membershipFlags",
|
|
89
|
+
title: labels.columns.level,
|
|
90
|
+
renderer: "badge",
|
|
91
|
+
valueMap: buildPhiGroupLevelValueMap(labels),
|
|
92
|
+
editor: { control: "select" },
|
|
93
|
+
sizing: { mode: "content" },
|
|
94
|
+
},
|
|
95
|
+
...(administration ? [
|
|
96
|
+
{ key: "sourceProviderId", fieldKey: "sourceProviderId", title: labels.columns.source, renderer: "badge", sizing: { mode: "content" } },
|
|
97
|
+
{ key: "createdAt", fieldKey: "createdAt", title: labels.columns.since, renderer: "datetime", sizing: { mode: "content" } },
|
|
98
|
+
] : []),
|
|
99
|
+
];
|
|
100
|
+
return {
|
|
101
|
+
source: {
|
|
102
|
+
providerKey: PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
103
|
+
resourceKey: "groupMembers",
|
|
104
|
+
},
|
|
105
|
+
presentation: {
|
|
106
|
+
title: labels.members.title,
|
|
107
|
+
description: labels.members.description,
|
|
108
|
+
layout: { mode: "auto", overflowX: "auto" },
|
|
109
|
+
controlSize: "small",
|
|
110
|
+
columns,
|
|
111
|
+
emptyState: { title: labels.members.empty, description: "" },
|
|
112
|
+
footer: {
|
|
113
|
+
template: labels.members.footer,
|
|
114
|
+
values: [{ key: "members", value: { source: "core", fieldKey: "totalRows" } }],
|
|
115
|
+
align: "start",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
features: {
|
|
119
|
+
pagination: { enabled: true, pageSize: 25, pageSizes: [25, 50, 100] },
|
|
120
|
+
sorting: { mode: "none" },
|
|
121
|
+
search: { enabled: false },
|
|
122
|
+
...(tools ? { tools } : {}),
|
|
123
|
+
editing: { mode: "cell" },
|
|
124
|
+
actions: {
|
|
125
|
+
rowLayout: "compact",
|
|
126
|
+
...(toolbar ? { toolbar } : {}),
|
|
127
|
+
row: [{
|
|
128
|
+
key: "delete",
|
|
129
|
+
label: labels.actions.remove,
|
|
130
|
+
icon: "antd:delete",
|
|
131
|
+
display: "icon",
|
|
132
|
+
mode: "danger",
|
|
133
|
+
execution: "provider",
|
|
134
|
+
disabledWhen: { match: "any", conditions: [{
|
|
135
|
+
source: "row",
|
|
136
|
+
valuePath: administration ? "local" : "manageable",
|
|
137
|
+
operator: "falsy",
|
|
138
|
+
reason: labels.actions.remove,
|
|
139
|
+
}] },
|
|
140
|
+
confirm: {
|
|
141
|
+
title: labels.actions.removeConfirmTitle,
|
|
142
|
+
description: labels.actions.removeConfirmText,
|
|
143
|
+
okText: labels.actions.removeConfirmOk,
|
|
144
|
+
cancelText: labels.actions.removeConfirmCancel,
|
|
145
|
+
},
|
|
146
|
+
}],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|