@phis/ui 0.8.0 → 0.8.1
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-layout-renderer.js +15 -7
- package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
- package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
- package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
- package/components/cms/phi-cms-render-diagnostic.js +12 -2
- package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
- package/components/cms/phi-cms-render-error-boundary.js +1 -1
- package/components/cms/phi-cms-root-layout.js +3 -1
- package/components/controls/phi-media-picker-control.d.ts +9 -0
- package/components/controls/phi-media-picker-control.js +1 -1
- package/components/controls/phi-popover-control.js +4 -1
- package/components/controls/phi-table-control.d.ts +7 -1
- package/components/controls/phi-table-control.js +23 -8
- package/components/forms/form-descriptor-field-check.d.ts +18 -0
- package/components/forms/form-descriptor-field-check.js +41 -0
- package/components/forms/form-descriptor-runtime-client.js +11 -10
- package/components/forms/form-record-source.d.ts +38 -0
- package/components/forms/form-record-source.js +48 -0
- package/components/forms/shared-form-descriptors.d.ts +0 -34
- package/components/forms/shared-form-descriptors.js +0 -6
- package/components/forms/shared-form-ids.d.ts +1 -1
- package/components/forms/shared-form-ids.js +1 -1
- package/components/media/media-settings-labels.d.ts +1 -0
- package/components/media/media-settings-labels.js +2 -0
- package/components/media/phi-media-picker-binding.d.ts +41 -33
- package/components/media/phi-media-picker-binding.js +2 -1
- package/components/media/use-media-library-add-picker.d.ts +33 -32
- package/components/overlays/phi-overlay-container-client.js +11 -9
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +7 -0
- package/components/regions/presets/phi-settings-page-shell-tree.js +3 -3
- package/components/shell/phi-icon-names.d.ts +3 -0
- package/components/shell/phi-icon-names.js +3 -0
- package/components/shell/phi-icon.d.ts +5 -7
- package/components/shell/phi-icon.js +8 -21
- package/components/tables/client/phi-table-binding-params.d.ts +24 -0
- package/components/tables/client/phi-table-binding-params.js +39 -0
- package/components/tables/client/phi-table-binding.d.ts +1 -3
- package/components/tables/client/phi-table-binding.js +5 -9
- package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
- package/components/widgets/client/shared/phi-button-icons.js +8 -12
- package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
- package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
- package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
- package/components/widgets/client/shared/phi-collection-provider.js +5 -0
- package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
- package/components/widgets/client/shared/phi-command-buttons.d.ts +16 -0
- package/components/widgets/client/shared/phi-command-buttons.js +9 -1
- package/components/widgets/label-sets/admin-users.d.ts +1 -0
- package/components/widgets/label-sets/admin-users.js +2 -0
- package/components/widgets/label-sets/builder-modules.js +4 -0
- package/components/widgets/label-sets/profile.d.ts +0 -16
- package/components/widgets/label-sets/profile.js +0 -37
- package/components/widgets/label-sets/registration.d.ts +0 -1
- package/components/widgets/label-sets/registration.js +0 -2
- package/components/widgets/label-sets/revisions.js +2 -0
- package/components/widgets/label-sets/signals.js +2 -0
- package/components/widgets/label-types/builder-modules.d.ts +4 -0
- package/components/widgets/label-types/builder-modules.js +2 -0
- package/components/widgets/label-types/revisions.d.ts +2 -0
- package/components/widgets/label-types/revisions.js +2 -1
- package/components/widgets/label-types/signals.d.ts +2 -0
- package/components/widgets/label-types/signals.js +1 -0
- package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
- package/components/widgets/shared/widget-failure-audience.js +21 -0
- package/components/widgets/shared/widget-failure-client.js +5 -2
- package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice-client.js +10 -0
- package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice.js +17 -0
- package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
- package/components/widgets/shared/widget-failure-staff.js +18 -0
- package/components/widgets/shared/widget-failure.d.ts +9 -6
- package/components/widgets/shared/widget-failure.js +0 -9
- package/components/widgets/shared/widget-failure.server.d.ts +4 -2
- package/components/widgets/shared/widget-failure.server.js +8 -3
- package/constants/customer-file.d.ts +12 -3
- package/constants/customer-file.js +12 -3
- package/constants/runtime-module-ownership.js +4 -3
- package/constants/site-address.d.ts +9 -0
- package/constants/site-address.js +10 -0
- package/constants/table-loading.d.ts +14 -0
- package/constants/table-loading.js +14 -0
- package/constants.d.ts +2 -1
- package/constants.js +3 -1
- package/gateway/site-cms-write-validation.js +19 -3
- package/helpers/announced-action.d.ts +17 -0
- package/helpers/announced-action.js +29 -0
- package/helpers/phi-metadata.d.ts +0 -8
- package/helpers/phi-metadata.js +1 -10
- package/helpers/phi-site-description.d.ts +11 -0
- package/helpers/phi-site-description.js +13 -0
- package/helpers/preset-form-check.d.ts +14 -0
- package/helpers/preset-form-check.js +12 -0
- package/helpers/preset-table-check.d.ts +19 -15
- package/helpers/preset-table-check.js +33 -39
- package/helpers/record-widget-binding.d.ts +10 -0
- package/helpers/record-widget-binding.js +35 -0
- package/helpers/record-widget.d.ts +1 -10
- package/helpers/record-widget.js +4 -33
- package/helpers/table-widget-binding.d.ts +12 -0
- package/helpers/table-widget-binding.js +296 -0
- package/helpers/tree-widget-binding.d.ts +19 -0
- package/helpers/tree-widget-binding.js +72 -0
- package/helpers/typed-confirmation.d.ts +9 -0
- package/helpers/typed-confirmation.js +13 -0
- package/helpers/widget-binding-check.d.ts +22 -0
- package/helpers/widget-binding-check.js +91 -0
- package/module-page-check.d.ts +2 -0
- package/module-page-check.js +2 -0
- package/next/root-route.js +2 -1
- package/package.json +1 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +7 -4
- package/plugins/runtime-modules/accounting/ids.js +14 -3
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +21 -9
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +29 -15
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +11 -8
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +206 -137
- package/plugins/runtime-modules/app/client-data-providers.js +1 -1
- package/plugins/runtime-modules/app/data-providers.d.ts +14 -69
- package/plugins/runtime-modules/app/data-providers.js +19 -54
- package/plugins/runtime-modules/app/definition.d.ts +8 -80
- package/plugins/runtime-modules/app/forms.d.ts +1 -16
- package/plugins/runtime-modules/app/forms.js +0 -59
- package/plugins/runtime-modules/app/ids.d.ts +2 -1
- package/plugins/runtime-modules/app/ids.js +3 -2
- package/plugins/runtime-modules/app/module.d.ts +8 -80
- package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
- package/plugins/runtime-modules/app/services/{addresses-table.js → addresses-collection.js} +23 -19
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +10 -6
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +37 -73
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +0 -5
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +2 -6
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +1 -17
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +0 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.js +2 -14
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
- package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +5 -0
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +14 -1
- package/plugins/runtime-modules/client-manifests/common.js +6 -0
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +173 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +30 -48
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
- package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
- package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +5 -0
- package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
- package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
- package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/client.js +74 -50
- package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
- package/plugins/runtime-modules/revisions/forms.js +1 -1
- package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
- package/plugins/runtime-modules/revisions/page-ids.js +4 -1
- package/plugins/runtime-modules/revisions/services/options.js +14 -4
- package/plugins/runtime-modules/revisions/services/table.js +41 -21
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +76 -3
- package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +39 -13
- package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
- package/plugins/runtime-modules/threads/controller/client.js +62 -2
- package/plugins/runtime-modules/threads/controller/definition.js +48 -0
- package/plugins/runtime-modules/threads/data-providers.d.ts +22 -37
- package/plugins/runtime-modules/threads/data-providers.js +35 -24
- package/plugins/runtime-modules/threads/definition.d.ts +22 -37
- package/plugins/runtime-modules/threads/ids.d.ts +2 -0
- package/plugins/runtime-modules/threads/ids.js +2 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +14 -80
- package/plugins/runtime-modules/threads/services/customer-file-table.js +27 -112
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +4 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +4 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +15 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +5 -0
- package/server-helpers/runtime.js +0 -1
- package/styles/controls.css +4 -2
- package/styles/layout.css +7 -0
- package/theme/phi-antd-token-resolver.d.ts +8 -0
- package/theme/phi-antd-token-resolver.js +10 -0
- package/theme/phi-theme-color.d.ts +19 -0
- package/theme/phi-theme-color.js +42 -0
- package/theme/phi-theme-gradients.js +4 -22
- package/theme/phi-theme-palette-defaults.d.ts +16 -0
- package/theme/phi-theme-palette-defaults.js +103 -0
- package/types/cms-plugins.d.ts +6 -1
- package/types/collection-provider.d.ts +27 -0
- package/types/collection-signal-values.d.ts +2 -0
- package/types/collection-signal-values.js +23 -0
- package/types/collection-view-widget.d.ts +9 -0
- package/types/core-widget-placements.d.ts +6 -0
- package/types/signals.d.ts +2 -0
- package/types/signals.js +2 -0
- package/types/table-widget.d.ts +15 -1
- package/types/table-widget.js +0 -282
- package/types/tree-widget.d.ts +0 -1
- package/types/tree-widget.js +0 -60
- package/types/widget-runtime.d.ts +0 -1
- package/types.d.ts +1 -1
- package/types.js +1 -1
- package/plugins/runtime-modules/app/services/addresses-table.d.ts +0 -135
|
@@ -2,13 +2,17 @@ import type { PhiSettingsPageShellOverlay, PhiSettingsPageShellPanel } from "../
|
|
|
2
2
|
import type { getPhiAppAddressesLabels } from "./addresses-label-set";
|
|
3
3
|
type Labels = Awaited<ReturnType<typeof getPhiAppAddressesLabels>>;
|
|
4
4
|
/**
|
|
5
|
-
* The account's addresses on the Profile page: one panel holding the
|
|
5
|
+
* The account's addresses on the Profile page: one panel holding the address tiles, and the two dialogs
|
|
6
|
+
* they open.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* A Collection View drawn by Core's address renderer (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`, COLLECTIONS.md
|
|
9
|
+
* "The address renderer"), arranged as the Admin's provider installations are (the Settings shell's
|
|
10
|
+
* overlays): `+` in its toolbar announces `create` and opens the add dialog, a tile's pencil announces
|
|
11
|
+
* `edit` with the address id and opens the change dialog, whose Form reads that address through the same
|
|
12
|
+
* Provider (`recordOpen` on `collection-action`, FORMS.md "A record opened from a Collection View"); either
|
|
13
|
+
* Form's success reads the tiles again. Removing (after its confirmation) and the two defaults are the
|
|
14
|
+
* Provider's actions, each answered by the list as it now stands. An address is an item of a list somebody
|
|
15
|
+
* keeps, not a part of the page, so a panel per Form would describe things nobody is looking at.
|
|
12
16
|
*/
|
|
13
17
|
export declare function buildPhiAccountAddressesPanel(labels: Labels, presetKey: string): {
|
|
14
18
|
panel: PhiSettingsPageShellPanel;
|
|
@@ -4,18 +4,22 @@ import { createPhiPresetCmsInstanceIdMap } from "../../../../types/cms-instance-
|
|
|
4
4
|
import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress } from "../../../../types/signals";
|
|
5
5
|
import { PHI_DIALOG_WIDTH_SINGLE_COLUMN } from "../../../../helpers/cms-dialog";
|
|
6
6
|
/**
|
|
7
|
-
* The account's addresses on the Profile page: one panel holding the
|
|
7
|
+
* The account's addresses on the Profile page: one panel holding the address tiles, and the two dialogs
|
|
8
|
+
* they open.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* A Collection View drawn by Core's address renderer (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`, COLLECTIONS.md
|
|
11
|
+
* "The address renderer"), arranged as the Admin's provider installations are (the Settings shell's
|
|
12
|
+
* overlays): `+` in its toolbar announces `create` and opens the add dialog, a tile's pencil announces
|
|
13
|
+
* `edit` with the address id and opens the change dialog, whose Form reads that address through the same
|
|
14
|
+
* Provider (`recordOpen` on `collection-action`, FORMS.md "A record opened from a Collection View"); either
|
|
15
|
+
* Form's success reads the tiles again. Removing (after its confirmation) and the two defaults are the
|
|
16
|
+
* Provider's actions, each answered by the list as it now stands. An address is an item of a list somebody
|
|
17
|
+
* keeps, not a part of the page, so a panel per Form would describe things nobody is looking at.
|
|
14
18
|
*/
|
|
15
19
|
export function buildPhiAccountAddressesPanel(labels, presetKey) {
|
|
16
20
|
// The shell derives the instance ids from the node keys; the same derivation gives the addresses here.
|
|
17
21
|
const ids = createPhiPresetCmsInstanceIdMap({ domain: "page", ownerModuleId: PHI_APP_RUNTIME_MODULE_ID, presetKey }, ["widgetAddresses", "overlayAddressCreate", "overlayAddressEdit", "overlayAddressEditForm"]);
|
|
18
|
-
const
|
|
22
|
+
const viewAddress = createPhiSignalAddress("cms", ids.widgetAddresses);
|
|
19
23
|
const editFormAddress = createPhiSignalAddress("cms", ids.overlayAddressEditForm);
|
|
20
24
|
const source = { providerKey: PHI_APP_ADDRESSES_DATA_PROVIDER_KEY, resourceKey: PHI_APP_ADDRESSES_RESOURCE_KEY };
|
|
21
25
|
const actionTo = (routeKey, receiver) => ({
|
|
@@ -25,18 +29,18 @@ export function buildPhiAccountAddressesPanel(labels, presetKey) {
|
|
|
25
29
|
channel: "action",
|
|
26
30
|
action: "activate",
|
|
27
31
|
valueType: "json",
|
|
28
|
-
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.
|
|
32
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.collectionAction,
|
|
29
33
|
receiver,
|
|
30
34
|
});
|
|
31
|
-
// The
|
|
32
|
-
const
|
|
35
|
+
// The View's reload takes no value, and a listener matches on the value type too.
|
|
36
|
+
const reloadView = (routeKey) => ({
|
|
33
37
|
routeKey,
|
|
34
38
|
capabilityId: "submitSuccess",
|
|
35
39
|
scope: "page",
|
|
36
40
|
channel: "reload",
|
|
37
41
|
action: "activate",
|
|
38
42
|
valueType: "none",
|
|
39
|
-
receiver:
|
|
43
|
+
receiver: viewAddress,
|
|
40
44
|
});
|
|
41
45
|
return {
|
|
42
46
|
panel: {
|
|
@@ -45,74 +49,32 @@ export function buildPhiAccountAddressesPanel(labels, presetKey) {
|
|
|
45
49
|
description: labels.panel.description,
|
|
46
50
|
sections: [{
|
|
47
51
|
nodeKey: "widgetAddresses",
|
|
48
|
-
typeKey: "
|
|
52
|
+
typeKey: "collection-view",
|
|
49
53
|
label: labels.tableLabel,
|
|
50
54
|
config: {
|
|
51
55
|
source,
|
|
52
56
|
presentation: {
|
|
57
|
+
mode: "grid",
|
|
53
58
|
controlSize: "small",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
sizing: { mode: "content" },
|
|
64
|
-
valueMap: labels.purposes,
|
|
65
|
-
tagColorMap: { billing: "default", shipping: "default", defaultBilling: "processing", defaultShipping: "processing" },
|
|
59
|
+
emptyDescription: `${labels.empty.title} ${labels.empty.text}`,
|
|
60
|
+
// The tiles' words, from the Module's Label Set (the renderer's English under them).
|
|
61
|
+
labels: {
|
|
62
|
+
purposes: labels.purposes,
|
|
63
|
+
actions: {
|
|
64
|
+
edit: labels.actions.edit,
|
|
65
|
+
remove: labels.actions.remove,
|
|
66
|
+
defaultBilling: labels.actions.defaultBilling,
|
|
67
|
+
defaultShipping: labels.actions.defaultShipping,
|
|
66
68
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
remove: { title: labels.remove.title, text: labels.remove.text, ok: labels.remove.ok, cancel: labels.cancel },
|
|
70
|
+
},
|
|
69
71
|
},
|
|
70
72
|
features: {
|
|
71
|
-
pagination: { enabled: false },
|
|
72
|
-
sorting: { mode: "none" },
|
|
73
73
|
tools: { mode: "self-contained", reset: false, reload: false },
|
|
74
74
|
actions: {
|
|
75
|
-
|
|
76
|
-
toolbar: [{
|
|
77
|
-
key: "create",
|
|
78
|
-
label: labels.actions.add,
|
|
79
|
-
icon: "plus",
|
|
80
|
-
display: "icon",
|
|
81
|
-
mode: "primary",
|
|
82
|
-
execution: "signal",
|
|
83
|
-
}],
|
|
84
|
-
row: [
|
|
85
|
-
{ key: "edit", label: labels.actions.edit, icon: "edit", display: "icon", execution: "signal" },
|
|
86
|
-
{
|
|
87
|
-
key: "makeDefaultBilling",
|
|
88
|
-
label: labels.actions.defaultBilling,
|
|
89
|
-
icon: "antd:file-text",
|
|
90
|
-
display: "icon",
|
|
91
|
-
execution: "provider",
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
key: "makeDefaultShipping",
|
|
95
|
-
label: labels.actions.defaultShipping,
|
|
96
|
-
icon: "antd:shopping",
|
|
97
|
-
display: "icon",
|
|
98
|
-
execution: "provider",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
key: "delete",
|
|
102
|
-
label: labels.actions.remove,
|
|
103
|
-
icon: "antd:delete",
|
|
104
|
-
display: "icon",
|
|
105
|
-
mode: "danger",
|
|
106
|
-
execution: "provider",
|
|
107
|
-
confirm: {
|
|
108
|
-
title: labels.remove.title,
|
|
109
|
-
description: labels.remove.text,
|
|
110
|
-
okText: labels.remove.ok,
|
|
111
|
-
cancelText: labels.cancel,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
],
|
|
75
|
+
toolbar: [{ key: "create", label: labels.actions.add, icon: "plus", display: "icon", mode: "primary" }],
|
|
115
76
|
},
|
|
77
|
+
pagination: { enabled: false },
|
|
116
78
|
},
|
|
117
79
|
signalRoutes: {
|
|
118
80
|
// One announcement, three listeners; each decides by the action key whether it was meant.
|
|
@@ -128,7 +90,7 @@ export function buildPhiAccountAddressesPanel(labels, presetKey) {
|
|
|
128
90
|
channel: "reload",
|
|
129
91
|
action: "activate",
|
|
130
92
|
valueType: "none",
|
|
131
|
-
receiver:
|
|
93
|
+
receiver: viewAddress,
|
|
132
94
|
}],
|
|
133
95
|
},
|
|
134
96
|
},
|
|
@@ -139,28 +101,30 @@ export function buildPhiAccountAddressesPanel(labels, presetKey) {
|
|
|
139
101
|
nodeKey: "overlayAddressCreate",
|
|
140
102
|
title: labels.addTitle,
|
|
141
103
|
openActionKey: "create",
|
|
104
|
+
openValueSchema: PHI_SIGNAL_VALUE_SCHEMAS.collectionAction,
|
|
142
105
|
formId: PHI_APP_FORM_IDS.addressCreate,
|
|
143
106
|
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
144
107
|
label: labels.addTitle,
|
|
145
108
|
submitLabel: labels.save,
|
|
146
109
|
cancelLabel: labels.cancel,
|
|
147
|
-
configOverrides: { signalRoutes: { emits: [
|
|
110
|
+
configOverrides: { signalRoutes: { emits: [reloadView("app-address-create-success")] } },
|
|
148
111
|
},
|
|
149
112
|
{
|
|
150
113
|
nodeKey: "overlayAddressEdit",
|
|
151
114
|
title: labels.editTitle,
|
|
152
115
|
openActionKey: "edit",
|
|
116
|
+
openValueSchema: PHI_SIGNAL_VALUE_SCHEMAS.collectionAction,
|
|
153
117
|
formId: PHI_APP_FORM_IDS.addressEdit,
|
|
154
118
|
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
155
119
|
label: labels.editTitle,
|
|
156
120
|
submitLabel: labels.save,
|
|
157
121
|
cancelLabel: labels.cancel,
|
|
158
122
|
configOverrides: {
|
|
159
|
-
// The Form reads the
|
|
123
|
+
// The Form reads the address the same action opened the dialog with; both filter on this key.
|
|
160
124
|
source,
|
|
161
125
|
openActionKey: "edit",
|
|
162
126
|
signalRoutes: {
|
|
163
|
-
emits: [
|
|
127
|
+
emits: [reloadView("app-address-edit-success")],
|
|
164
128
|
listens: [{
|
|
165
129
|
routeKey: "app-address-edit-open",
|
|
166
130
|
capabilityId: "recordOpen",
|
|
@@ -168,7 +132,7 @@ export function buildPhiAccountAddressesPanel(labels, presetKey) {
|
|
|
168
132
|
channel: "action",
|
|
169
133
|
action: "activate",
|
|
170
134
|
valueType: "json",
|
|
171
|
-
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.
|
|
135
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.collectionAction,
|
|
172
136
|
receiver: editFormAddress,
|
|
173
137
|
}],
|
|
174
138
|
},
|
|
@@ -6,11 +6,6 @@ export declare function getPhiAppAddressesLabels(options: PhiGlobalTranslatorOpt
|
|
|
6
6
|
description: string;
|
|
7
7
|
};
|
|
8
8
|
tableLabel: string;
|
|
9
|
-
columns: {
|
|
10
|
-
name: string;
|
|
11
|
-
address: string;
|
|
12
|
-
purposes: string;
|
|
13
|
-
};
|
|
14
9
|
purposes: {
|
|
15
10
|
billing: string;
|
|
16
11
|
shipping: string;
|
|
@@ -3,8 +3,8 @@ import { PHI_TR_CTX_WEB_UI_LABEL } from "../../../../gateway/tr";
|
|
|
3
3
|
import { definePhiMessageLabel, definePhiRuntimeModuleLabelSet, getPhiLabelSet } from "../../../../gateway/label-set";
|
|
4
4
|
import { PHI_APP_RUNTIME_MODULE_IDENTITY } from "../ids";
|
|
5
5
|
/**
|
|
6
|
-
* What the account's addresses say: the panel, the
|
|
7
|
-
*
|
|
6
|
+
* What the account's addresses say: the panel, the tiles' marks and acts, and the two dialogs that add an
|
|
7
|
+
* address and change one. One set for all of it, because the Forms and the tiles name the same parts.
|
|
8
8
|
*/
|
|
9
9
|
const PHI_APP_ADDRESSES_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_APP_RUNTIME_MODULE_IDENTITY, {
|
|
10
10
|
key: "preset:account-addresses",
|
|
@@ -13,9 +13,6 @@ const PHI_APP_ADDRESSES_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_APP_RUNTI
|
|
|
13
13
|
panel_title: "Addresses",
|
|
14
14
|
panel_description: definePhiMessageLabel("Where invoices are made out to and orders are sent on this site."),
|
|
15
15
|
table_label: "addresses",
|
|
16
|
-
column_name: "Name",
|
|
17
|
-
column_address: "Address",
|
|
18
|
-
column_purposes: "Used for",
|
|
19
16
|
purpose_billing: "Billing",
|
|
20
17
|
purpose_shipping: "Shipping",
|
|
21
18
|
purpose_default_billing: "Default billing",
|
|
@@ -61,7 +58,6 @@ export async function getPhiAppAddressesLabels(options) {
|
|
|
61
58
|
return {
|
|
62
59
|
panel: { title: labels.panel_title, description: labels.panel_description },
|
|
63
60
|
tableLabel: labels.table_label,
|
|
64
|
-
columns: { name: labels.column_name, address: labels.column_address, purposes: labels.column_purposes },
|
|
65
61
|
purposes: {
|
|
66
62
|
billing: labels.purpose_billing,
|
|
67
63
|
shipping: labels.purpose_shipping,
|
|
@@ -5,8 +5,7 @@ import type { PhiCmsPageNode, PhiResolvedCmsPageTree } from "../../../../types/c
|
|
|
5
5
|
*
|
|
6
6
|
* It is a mounted Settings page like any other now (SETTINGS.md section 4), so it is built from the
|
|
7
7
|
* one shared shell: a Collapsible whose panels open one at a time, each panel one coherent thing to
|
|
8
|
-
* decide.
|
|
9
|
-
* a newsletter switch that now has a panel of its own.
|
|
8
|
+
* decide.
|
|
10
9
|
*
|
|
11
10
|
* Every panel is a registered Form reaching the server through its handler Provider. Language carries
|
|
12
11
|
* the Site's locales in its placement config, because a registered Form is the same on every Site and
|
|
@@ -15,8 +15,7 @@ const PROFILE_PRESET_KEY = "app-profile-page";
|
|
|
15
15
|
*
|
|
16
16
|
* It is a mounted Settings page like any other now (SETTINGS.md section 4), so it is built from the
|
|
17
17
|
* one shared shell: a Collapsible whose panels open one at a time, each panel one coherent thing to
|
|
18
|
-
* decide.
|
|
19
|
-
* a newsletter switch that now has a panel of its own.
|
|
18
|
+
* decide.
|
|
20
19
|
*
|
|
21
20
|
* Every panel is a registered Form reaching the server through its handler Provider. Language carries
|
|
22
21
|
* the Site's locales in its placement config, because a registered Form is the same on every Site and
|
|
@@ -169,21 +168,6 @@ export async function buildPhiDefaultAppProfilePageTree({ page, runtime, }) {
|
|
|
169
168
|
},
|
|
170
169
|
}],
|
|
171
170
|
},
|
|
172
|
-
{
|
|
173
|
-
nodeKey: "panelNewsletter",
|
|
174
|
-
title: labels.subscriptions,
|
|
175
|
-
sections: [{
|
|
176
|
-
kind: "form",
|
|
177
|
-
nodeKey: "widgetNewsletter",
|
|
178
|
-
formId: PHI_APP_FORM_IDS.profileNewsletter,
|
|
179
|
-
label: labels.newsletter,
|
|
180
|
-
submitOnChange: true,
|
|
181
|
-
savedMessage: labels.saved,
|
|
182
|
-
initialValues: {
|
|
183
|
-
newsletterOptIn: Boolean(runtime.viewer.newsletterOptIn),
|
|
184
|
-
},
|
|
185
|
-
}],
|
|
186
|
-
},
|
|
187
171
|
],
|
|
188
172
|
overlays: addresses.overlays,
|
|
189
173
|
});
|
|
@@ -13,18 +13,8 @@ const PHI_PROFILE_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_APP_RUNTIM
|
|
|
13
13
|
language: "Language",
|
|
14
14
|
appearance: "Appearance",
|
|
15
15
|
/*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* nothing else; named for the subject, a second thing somebody can subscribe to moves in beside
|
|
19
|
-
* the first without renaming anything.
|
|
20
|
-
*/
|
|
21
|
-
subscriptions: "Subscriptions",
|
|
22
|
-
/** The switch's own subject, and the authoring name of the Form that holds it. */
|
|
23
|
-
newsletter: "Newsletter",
|
|
24
|
-
/*
|
|
25
|
-
* What a panel says when it saved and its Form has no wording of its own -- the language select
|
|
26
|
-
* and the newsletter switch, which say nothing in place because there is nothing in place to say
|
|
27
|
-
* it in.
|
|
16
|
+
* What a panel says when it saved and its Form has no wording of its own -- the language select,
|
|
17
|
+
* which says nothing in place because there is nothing in place to say it in.
|
|
28
18
|
*/
|
|
29
19
|
saved: "Saved",
|
|
30
20
|
},
|
|
@@ -37,8 +27,6 @@ export async function getPhiProfilePageLabels(options) {
|
|
|
37
27
|
phone: labels.phone,
|
|
38
28
|
language: labels.language,
|
|
39
29
|
appearance: labels.appearance,
|
|
40
|
-
subscriptions: labels.subscriptions,
|
|
41
|
-
newsletter: labels.newsletter,
|
|
42
30
|
saved: labels.saved,
|
|
43
31
|
};
|
|
44
32
|
}
|
|
@@ -71,6 +71,11 @@ export async function buildPhiDefaultAdminMediaSettingsPageTree({ page, runtime,
|
|
|
71
71
|
{ key: "usedMegabytes", fieldKey: "usedMegabytes", title: labels.spaces.used, sizing: { mode: "content" }, align: "right" },
|
|
72
72
|
],
|
|
73
73
|
emptyState: { title: labels.spaces.empty },
|
|
74
|
+
footer: {
|
|
75
|
+
template: labels.spaces.footer,
|
|
76
|
+
values: [{ key: "spaces", value: { source: "core", fieldKey: "totalRows" } }],
|
|
77
|
+
align: "start",
|
|
78
|
+
},
|
|
74
79
|
},
|
|
75
80
|
features: {
|
|
76
81
|
search: { enabled: true, placeholder: labels.spaces.search, debounceMs: 250 },
|
|
@@ -563,6 +563,16 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
|
|
|
563
563
|
*/
|
|
564
564
|
const supportsStaticOptions = !field.providerKind || field.providerKind === "options" || field.providerKind === "timeline";
|
|
565
565
|
const selectedProvider = dataProviderDescriptors.find((descriptor) => descriptor.key === (field.providerKey ?? providerConfig?.providerKey)) ?? null;
|
|
566
|
+
// One kind, or the kinds a binding takes (a record source reads a Table's rows or a Collection's items).
|
|
567
|
+
const acceptedKinds = field.providerKind == null
|
|
568
|
+
? null
|
|
569
|
+
: typeof field.providerKind === "string" ? [field.providerKind] : field.providerKind;
|
|
570
|
+
// The kind that decides how a resource is chosen: the chosen Provider's, where the field takes several.
|
|
571
|
+
const kindOf = (providerKey) => typeof field.providerKind === "string"
|
|
572
|
+
? field.providerKind
|
|
573
|
+
: dataProviderDescriptors.find((descriptor) => descriptor.key === providerKey)?.kind;
|
|
574
|
+
const selectedKind = kindOf(selectedProvider?.key);
|
|
575
|
+
const choosesResource = (kind) => kind === "table" || kind === "tree" || kind === "collection";
|
|
566
576
|
const options = [
|
|
567
577
|
...(supportsStaticOptions
|
|
568
578
|
? [{
|
|
@@ -571,7 +581,7 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
|
|
|
571
581
|
}]
|
|
572
582
|
: []),
|
|
573
583
|
...dataProviderDescriptors
|
|
574
|
-
.filter((descriptor) => !
|
|
584
|
+
.filter((descriptor) => !acceptedKinds || acceptedKinds.includes(descriptor.kind))
|
|
575
585
|
.map((descriptor) => ({
|
|
576
586
|
value: descriptor.key,
|
|
577
587
|
label: descriptor.title,
|
|
@@ -581,12 +591,12 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
|
|
|
581
591
|
const bindingRow = renderPhiInspectorConfigFieldControl(field, _jsxs(PhiFlexControl, { vertical: true, gap: 8, style: { width: "100%" }, children: [_jsx(PhiSelectControl, { options: options, placeholder: fieldLabels.selectDataProvider, value: providerConfig?.providerKey ?? (supportsStaticOptions ? PHI_STATIC_OPTIONS_PROVIDER_VALUE : undefined), disabled: disabled || !onChange, style: { width: "100%" }, onChange: (providerKey) => onChange?.({
|
|
582
592
|
[field.key]: providerKey === PHI_STATIC_OPTIONS_PROVIDER_VALUE
|
|
583
593
|
? null
|
|
584
|
-
:
|
|
594
|
+
: choosesResource(kindOf(providerKey))
|
|
585
595
|
? {
|
|
586
596
|
providerKey,
|
|
587
597
|
resourceKey: (() => {
|
|
588
598
|
const resources = dataProviderDescriptors.find((descriptor) => descriptor.key === providerKey)?.resources ?? [];
|
|
589
|
-
if (
|
|
599
|
+
if (kindOf(providerKey) !== "collection")
|
|
590
600
|
return resources[0]?.resourceKey ?? "";
|
|
591
601
|
return resources.find((resource) => "defaultForWidget" in resource && resource.defaultForWidget === true)?.resourceKey ??
|
|
592
602
|
(resources.length === 1 ? resources[0]?.resourceKey : "") ?? "";
|
|
@@ -599,13 +609,13 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
|
|
|
599
609
|
: field.providerKind === "record"
|
|
600
610
|
? { providerKey, params: {} }
|
|
601
611
|
: { ...providerConfig, providerKey },
|
|
602
|
-
}) }), (
|
|
612
|
+
}) }), choosesResource(selectedKind) && selectedProvider ? (_jsx(PhiSelectControl, { options: (selectedProvider.resources ?? []).map((resource) => ({
|
|
603
613
|
value: resource.resourceKey,
|
|
604
614
|
label: resource.title,
|
|
605
615
|
description: resource.description,
|
|
606
|
-
})), placeholder:
|
|
616
|
+
})), placeholder: selectedKind === "tree"
|
|
607
617
|
? fieldLabels.selectTreeResource
|
|
608
|
-
:
|
|
618
|
+
: selectedKind === "collection"
|
|
609
619
|
? fieldLabels.selectCollectionResource
|
|
610
620
|
: fieldLabels.selectTableResource, value: typeof rawProviderConfig.resourceKey === "string" ? rawProviderConfig.resourceKey : undefined, disabled: disabled || !onChange, style: { width: "100%" }, onChange: (resourceKey) => onChange?.({
|
|
611
621
|
[field.key]: {
|
|
@@ -35,7 +35,9 @@ export function PhiInspectorImageFieldControl({ config, disabled, onChange, }) {
|
|
|
35
35
|
showPagination: true,
|
|
36
36
|
showGroupFilter: true,
|
|
37
37
|
showSearchBar: true,
|
|
38
|
-
}, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS,
|
|
38
|
+
}, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS,
|
|
39
|
+
// The Inspector stands at the window's right: the library opens over the canvas.
|
|
40
|
+
placement: "left", value: assetId, onAssetSelect: editable
|
|
39
41
|
? (picked) => onChange?.({
|
|
40
42
|
sourceKind: "asset",
|
|
41
43
|
assetId: picked.id,
|
|
@@ -163,7 +163,9 @@ function usePhiBuilderInspectorSectionState(signalRoutes) {
|
|
|
163
163
|
showPagination: true,
|
|
164
164
|
showGroupFilter: true,
|
|
165
165
|
showSearchBar: true,
|
|
166
|
-
}, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS,
|
|
166
|
+
}, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS,
|
|
167
|
+
// Every Background of the Inspector, Region, Layout and Widget: the library opens over the canvas.
|
|
168
|
+
placement: "left", value: props.value, open: props.open, trigger: props.trigger, onOpenChange: props.onOpenChange, onCommit: props.onCommit, onDiscard: props.onDiscard, onAssetSelect: props.onAssetSelect, onAssetClear: props.onAssetClear })), [mediaPickerLabels]);
|
|
167
169
|
return {
|
|
168
170
|
activeCalendarAdapterDescriptors,
|
|
169
171
|
activeVideoProviderDescriptors,
|
|
@@ -28,7 +28,11 @@ export function resolvePhiBuilderSignalWiringRoutes() {
|
|
|
28
28
|
const output = sender?.emits.find((capability) => capability.id === session.senderCapabilityId) ?? null;
|
|
29
29
|
const receiver = resolvePhiBuilderReceiverSignalEndpoints(state)
|
|
30
30
|
.find((endpoint) => endpoint.address === session.receiverAddress) ?? null;
|
|
31
|
-
|
|
31
|
+
/*
|
|
32
|
+
* One input id may stand for several schemas -- a Form's `recordOpen` takes a Table's row action and a
|
|
33
|
+
* Collection View's item action -- so the input is the one of that id this output can reach.
|
|
34
|
+
*/
|
|
35
|
+
const input = receiver?.listens.find((capability) => capability.id === session.receiverCapabilityId && phiSignalCapabilitiesMatch(output, capability)) ?? null;
|
|
32
36
|
if (!output || !receiver || !input || !phiSignalCapabilitiesMatch(output, input)) {
|
|
33
37
|
return { kind: "mismatched" };
|
|
34
38
|
}
|
|
@@ -187,9 +187,16 @@ function resolveReceiverCapabilityOptions(context) {
|
|
|
187
187
|
const sender = findEndpoint(resolvePhiBuilderSelectedSignalEndpoints(state), state.signalWiring.senderAddress);
|
|
188
188
|
const output = sender?.emits.find((capability) => capability.id === state.signalWiring.senderCapabilityId) ?? null;
|
|
189
189
|
const receiver = findEndpoint(resolvePhiBuilderReceiverSignalEndpoints(state), state.signalWiring.receiverAddress);
|
|
190
|
+
const inputs = (receiver?.listens ?? [])
|
|
191
|
+
.filter((input) => output == null || phiSignalCapabilitiesMatch(output, input));
|
|
190
192
|
return {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
/*
|
|
194
|
+
* An id names one choice: a Form's `recordOpen` is declared once per announcer it takes (a Table's
|
|
195
|
+
* row action, a Collection View's item action), and before an output is chosen both would be offered
|
|
196
|
+
* under the same value. Once it is chosen, only the one it reaches is left.
|
|
197
|
+
*/
|
|
198
|
+
options: inputs
|
|
199
|
+
.filter((input, index) => inputs.findIndex((candidate) => candidate.id === input.id) === index)
|
|
193
200
|
.map((capability) => ({ value: capability.id, label: formatInputCapability(capability) })),
|
|
194
201
|
};
|
|
195
202
|
}
|
package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js
CHANGED
|
@@ -559,6 +559,11 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
559
559
|
* has no routes yet, which is a normal starting point and not an error.
|
|
560
560
|
*/
|
|
561
561
|
emptyState: { title: signalsLabels.routes.title },
|
|
562
|
+
footer: {
|
|
563
|
+
template: signalsLabels.routes.footer,
|
|
564
|
+
values: [{ key: "routes", value: { source: "core", fieldKey: "totalRows" } }],
|
|
565
|
+
align: "start",
|
|
566
|
+
},
|
|
562
567
|
controlSize: "small",
|
|
563
568
|
},
|
|
564
569
|
features: {
|
|
@@ -1699,6 +1699,11 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1699
1699
|
{ key: "where", fieldKey: "where", title: modulesLabels?.usage.where ?? "Page", sizing: { mode: "fill", minWidth: 200 } },
|
|
1700
1700
|
{ key: "blocks", fieldKey: "blocks", title: modulesLabels?.usage.blocks ?? "Blocks", align: "right", sizing: { mode: "content" } },
|
|
1701
1701
|
],
|
|
1702
|
+
footer: {
|
|
1703
|
+
template: modulesLabels?.usage.footer ?? "%1 places draw it",
|
|
1704
|
+
values: [{ key: "places", value: { source: "core", fieldKey: "totalRows" } }],
|
|
1705
|
+
align: "start",
|
|
1706
|
+
},
|
|
1702
1707
|
controlSize: "small",
|
|
1703
1708
|
},
|
|
1704
1709
|
features: {
|
|
@@ -1797,6 +1802,11 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1797
1802
|
editor: {},
|
|
1798
1803
|
},
|
|
1799
1804
|
],
|
|
1805
|
+
footer: {
|
|
1806
|
+
template: modulesLabels?.publicRoutes.footer ?? "%1 addresses taken",
|
|
1807
|
+
values: [{ key: "addresses", value: { source: "core", fieldKey: "totalRows" } }],
|
|
1808
|
+
align: "start",
|
|
1809
|
+
},
|
|
1800
1810
|
controlSize: "small",
|
|
1801
1811
|
},
|
|
1802
1812
|
features: {
|
|
@@ -1862,6 +1872,9 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1862
1872
|
},
|
|
1863
1873
|
presentation: {
|
|
1864
1874
|
borders: true,
|
|
1875
|
+
// Caption and answer side by side: the rows are the heading, so there is none, and no
|
|
1876
|
+
// footer either (TABLES.md, "Footer and summary").
|
|
1877
|
+
header: false,
|
|
1865
1878
|
layout: { mode: "auto", overflowX: "auto" },
|
|
1866
1879
|
columns: [
|
|
1867
1880
|
{ key: "label", fieldKey: "label", title: modulesLabels?.detail.field ?? "Field" },
|
|
@@ -1873,7 +1886,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1873
1886
|
* with it.
|
|
1874
1887
|
*
|
|
1875
1888
|
* A summary row rather than the free-text footer, so it keeps the columns the list
|
|
1876
|
-
* is read in -- caption left, answer right,
|
|
1889
|
+
* is read in -- caption left, answer right, in the same two columns. The footer
|
|
1877
1890
|
* would have set the same sentence adrift across the full width.
|
|
1878
1891
|
*/
|
|
1879
1892
|
summary: {
|
|
@@ -9,6 +9,7 @@ import { PhiCmsLayoutType } from "../../../constants/cms-layout-type-keys";
|
|
|
9
9
|
import { PhiRuntimeRenderClientType } from "../../../constants/runtime-render-client-types";
|
|
10
10
|
import { PHI_ASSET_RUNTIME_MODULE_ID } from "../asset/ids";
|
|
11
11
|
import { PHI_MEDIA_LIBRARY_ITEM_RENDERER_KEY } from "../../../constants/media-library-provider-keys";
|
|
12
|
+
import { PHI_SITE_ADDRESS_ITEM_RENDERER_KEY } from "../../../constants/site-address";
|
|
12
13
|
import { PHI_DASHBOARD_CARD_ITEM_RENDERER_KEY } from "../../../constants/dashboard-card-provider-keys";
|
|
13
14
|
import { createPhiRuntimeModuleCalendarAdapterClientManifest } from "../../../components/runtime/runtime-module-calendar-adapter-client-manifest";
|
|
14
15
|
import { PHI_CORE_CALENDAR_ADAPTER_CLIENT_DEFINITIONS } from "../core/client-calendar-adapters";
|
|
@@ -210,6 +211,11 @@ export const PHI_COMMON_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST = createPhiRuntime
|
|
|
210
211
|
PHI_MEDIA_LIBRARY_ITEM_RENDERER_KEY,
|
|
211
212
|
definePhiRuntimeModuleRenderClient(dynamic(() => import("../core/widgets/collection-view/asset-binding").then((module) => module.PhiAssetCollectionViewBinding))),
|
|
212
213
|
],
|
|
214
|
+
// The address tiles, on the same terms: Core's renderer for any Collection of a Site's addresses.
|
|
215
|
+
[
|
|
216
|
+
PHI_SITE_ADDRESS_ITEM_RENDERER_KEY,
|
|
217
|
+
definePhiRuntimeModuleRenderClient(dynamic(() => import("../core/widgets/collection-view/site-address-binding").then((module) => module.PhiSiteAddressCollectionViewBinding))),
|
|
218
|
+
],
|
|
213
219
|
[
|
|
214
220
|
PhiCmsWidgetType.Description,
|
|
215
221
|
definePhiRuntimeModuleRenderClient(dynamic(() => import("../core/widgets/description/client").then((module) => module.PhiDescriptionWidgetClient))),
|
|
@@ -221,7 +221,7 @@ export declare const PHI_CARD_WIDGET_DEFINITION: {
|
|
|
221
221
|
heading?: string;
|
|
222
222
|
} & {
|
|
223
223
|
type: "data-provider";
|
|
224
|
-
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
224
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
|
|
225
225
|
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
226
226
|
}) | ({
|
|
227
227
|
key: string;
|
|
@@ -21,6 +21,7 @@ import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
|
21
21
|
import { usePhiSignalListener } from "../../../../../components/runtime/runtime-signal-bus";
|
|
22
22
|
import { findPhiSignalListenRoute, resolvePhiSignalListenFilter } from "../../../../../helpers/signal-listen-routes";
|
|
23
23
|
import { readPhiTableBindingParamsSignalValue } from "../../../../../types/table-signal-values";
|
|
24
|
+
import { layPhiCollectionBindingParams } from "../../../../../components/widgets/client/shared/phi-collection-binding-params";
|
|
24
25
|
import { isPhiRecord } from "../../../../../helpers/is-record";
|
|
25
26
|
/**
|
|
26
27
|
* The parts of a Collection View a Tour can point at, as `cms:<instanceId>:<part>` (design/TOURS.md): the
|
|
@@ -84,8 +85,10 @@ function PhiCollectionViewWidgetLive({ config, labels, reorderLabels, resourceDe
|
|
|
84
85
|
if (route?.capabilityId !== "bindingParamsChange")
|
|
85
86
|
return;
|
|
86
87
|
const next = readPhiTableBindingParamsSignalValue(signal.value);
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
// The same set again is no change: nothing starts over, nothing is asked again.
|
|
89
|
+
const params = next ? layPhiCollectionBindingParams(bindingParams, next.params) : null;
|
|
90
|
+
if (params)
|
|
91
|
+
setChosenBindingParams({ seed: bindingParamsSeed, params });
|
|
89
92
|
}, [bindingParams, bindingParamsSeed, listenRoutes, signalIdentity.receiver]), useMemo(() => resolvePhiSignalListenFilter(listenRoutes), [listenRoutes]), signalIdentity.receiver);
|
|
90
93
|
const { resource, bindingError, queryError, binding } = usePhiCollectionViewBinding({
|
|
91
94
|
source,
|
|
@@ -98,6 +98,12 @@ function readMediaFeatures(value) {
|
|
|
98
98
|
...(mediaType ? { mediaType } : {}),
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
+
/* Choosing an item (`features.selection`), read strictly: a mode the renderer does not know is a `PhiConfigError`. */
|
|
102
|
+
function readSelectionFeatures(value) {
|
|
103
|
+
const reader = createPhiConfigReader(value, "features.selection");
|
|
104
|
+
const mode = reader.oneOf("mode", ["single"]);
|
|
105
|
+
return { mode: mode ?? reader.fail("mode", "single") };
|
|
106
|
+
}
|
|
101
107
|
function readInitialQuery(value) {
|
|
102
108
|
if (!isPhiRecord(value))
|
|
103
109
|
return undefined;
|
|
@@ -129,6 +135,7 @@ function normalizePhiCmsCollectionViewWidgetConfig(config) {
|
|
|
129
135
|
const pagination = isPhiRecord(features.pagination) ? features.pagination : null;
|
|
130
136
|
const reorder = isPhiRecord(features.reorder) ? features.reorder : null;
|
|
131
137
|
const media = isPhiRecord(features.media) ? features.media : null;
|
|
138
|
+
const selection = isPhiRecord(features.selection) ? features.selection : null;
|
|
132
139
|
return {
|
|
133
140
|
presentation: {
|
|
134
141
|
title: readString(presentation.title),
|
|
@@ -159,6 +166,7 @@ function normalizePhiCmsCollectionViewWidgetConfig(config) {
|
|
|
159
166
|
actionKey: readString(reorder.actionKey)?.trim() || undefined,
|
|
160
167
|
} : undefined,
|
|
161
168
|
media: media ? readMediaFeatures(media) : undefined,
|
|
169
|
+
selection: selection ? readSelectionFeatures(selection) : undefined,
|
|
162
170
|
pagination: pagination ? {
|
|
163
171
|
enabled: readBoolean(pagination.enabled) ?? true,
|
|
164
172
|
pageSize: readNumber(pagination.pageSize),
|