@phis/ui 0.8.0 → 0.8.2
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 +9 -2
- 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 +26 -11
- 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/media-upload-flow.d.ts +62 -5
- package/components/media/media-upload-flow.js +62 -24
- package/components/media/phi-area-upload-widget.d.ts +44 -1
- package/components/media/phi-area-upload-widget.js +32 -7
- package/components/media/phi-media-picker-binding.d.ts +41 -33
- package/components/media/phi-media-picker-binding.js +2 -1
- package/components/media/phi-media-upload.d.ts +10 -3
- package/components/media/phi-media-upload.js +11 -8
- 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/shell/phi-widget-icon.js +1 -0
- 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/html-editor-link-node.d.ts +12 -0
- package/components/widgets/client/html-editor-link-node.js +60 -0
- package/components/widgets/client/html-editor.js +10 -6
- 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-collection-view-binding.js +33 -26
- 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/cms-widget-types.d.ts +1 -0
- package/constants/cms-widget-types.js +3 -0
- package/constants/customer-file.d.ts +12 -3
- package/constants/customer-file.js +12 -3
- package/constants/runtime-module-ownership.js +5 -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/gateway/site-proxy.d.ts +12 -0
- package/gateway/site-proxy.js +20 -0
- 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/net/phi-next-proxy.d.ts +7 -0
- package/net/phi-next-proxy.js +1 -1
- package/next/root-route.js +2 -1
- package/package.json +27 -14
- 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/area-contributions/admin.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/admin.js +2 -0
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
- package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
- 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/cdn/authoring-widgets.d.ts +3 -0
- package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
- package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
- package/plugins/runtime-modules/cdn/authoring.js +8 -0
- package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
- package/plugins/runtime-modules/cdn/bytes.js +17 -0
- package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
- package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
- package/plugins/runtime-modules/cdn/data-providers.js +117 -0
- package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
- package/plugins/runtime-modules/cdn/definition.js +23 -0
- package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
- package/plugins/runtime-modules/cdn/ids.js +20 -0
- package/plugins/runtime-modules/cdn/module.d.ts +131 -0
- package/plugins/runtime-modules/cdn/module.js +4 -0
- package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
- package/plugins/runtime-modules/cdn/platform.js +73 -0
- package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/presets.js +20 -0
- package/plugins/runtime-modules/cdn/server.d.ts +1 -0
- package/plugins/runtime-modules/cdn/server.js +14 -0
- package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
- package/plugins/runtime-modules/cdn/services/table.js +296 -0
- package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
- package/plugins/runtime-modules/cdn/services/upload.js +146 -0
- package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
- package/plugins/runtime-modules/cdn/table-params.js +10 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +479 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
- package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/widgets.js +13 -0
- package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
- package/plugins/runtime-modules/client-manifests/admin.js +11 -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/asset-binding.js +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 +175 -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 +36 -52
- 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 +17 -3
- 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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Tree's config against the resource its Provider declares: the node fields it shows and edits, its
|
|
3
|
+
* binding tools, search, every Provider action in its scope with the confirmation the resource asks for,
|
|
4
|
+
* and drag and drop (TREES.md).
|
|
5
|
+
*
|
|
6
|
+
* Checked where a config is made, as the Table's is (`helpers/table-widget-binding.ts`): a package's
|
|
7
|
+
* preset tests (`checkPhiPresetTables`), `pnpm verify` and the Builder's save, never in the browser or
|
|
8
|
+
* the render of a request. A live Tree trusts the config it is handed.
|
|
9
|
+
*/
|
|
10
|
+
export function validatePhiTreeWidgetBinding(config, resource) {
|
|
11
|
+
const errors = [];
|
|
12
|
+
const node = config.presentation?.node;
|
|
13
|
+
const features = config.features ?? {};
|
|
14
|
+
const fieldKeys = new Set(resource.fields.map((field) => field.key));
|
|
15
|
+
for (const key of [
|
|
16
|
+
node?.titleFieldKey,
|
|
17
|
+
node?.descriptionFieldKey,
|
|
18
|
+
node?.iconFieldKey,
|
|
19
|
+
].filter((value) => Boolean(value))) {
|
|
20
|
+
if (!fieldKeys.has(key))
|
|
21
|
+
errors.push(`Tree presentation references undeclared field "${key}".`);
|
|
22
|
+
}
|
|
23
|
+
for (const tool of features.tools?.bindingFields ?? []) {
|
|
24
|
+
if (!resource.bindingFields?.some((field) => field.key === tool.key)) {
|
|
25
|
+
errors.push(`Tree binding tool references undeclared field "${tool.key}".`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (features.search?.enabled && !resource.query.search) {
|
|
29
|
+
errors.push("Tree search requires Provider query search capability.");
|
|
30
|
+
}
|
|
31
|
+
if (features.editing?.enabled) {
|
|
32
|
+
for (const key of [
|
|
33
|
+
node?.titleEditor?.enabled ? node.titleFieldKey : null,
|
|
34
|
+
node?.iconEditor?.enabled ? node.iconFieldKey : null,
|
|
35
|
+
].filter((value) => Boolean(value))) {
|
|
36
|
+
if (!resource.fields.find((field) => field.key === key)?.mutable) {
|
|
37
|
+
errors.push(`Tree editor requires mutable Provider field "${key}".`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const providerActions = new Map(resource.actions?.map((action) => [action.key, action]) ?? []);
|
|
42
|
+
for (const [scope, actions] of [
|
|
43
|
+
["resource", features.actions?.toolbar ?? []],
|
|
44
|
+
["node", features.actions?.node ?? []],
|
|
45
|
+
["selection", features.actions?.selection ?? []],
|
|
46
|
+
]) {
|
|
47
|
+
for (const action of actions) {
|
|
48
|
+
const capability = providerActions.get(action.key);
|
|
49
|
+
if (action.execution === "provider" && !capability) {
|
|
50
|
+
errors.push(`Tree action references undeclared Provider capability "${action.key}".`);
|
|
51
|
+
}
|
|
52
|
+
else if (action.execution === "provider" && capability?.scope !== scope) {
|
|
53
|
+
errors.push(`Tree action "${action.key}" requires Provider scope "${scope}".`);
|
|
54
|
+
}
|
|
55
|
+
else if (action.execution === "provider" && capability?.confirmation === "required" && !action.confirm) {
|
|
56
|
+
errors.push(`Tree action "${action.key}" requires confirmation presentation.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const dndMode = features.dnd?.mode ?? "none";
|
|
61
|
+
if ((dndMode === "source" || dndMode === "source-reorder") && !resource.dragSources?.length) {
|
|
62
|
+
errors.push("Tree source DnD requires a declared Provider drag source.");
|
|
63
|
+
}
|
|
64
|
+
const payloadType = features.dnd?.payloadType;
|
|
65
|
+
if (payloadType && !resource.dragSources?.some((source) => source.payloadType === payloadType)) {
|
|
66
|
+
errors.push(`Tree DnD references undeclared payload type "${payloadType}".`);
|
|
67
|
+
}
|
|
68
|
+
if ((dndMode === "reorder" || dndMode === "source-reorder") && resource.nodeOrdering !== "tree") {
|
|
69
|
+
errors.push("Tree reorder DnD requires Provider nodeOrdering \"tree\".");
|
|
70
|
+
}
|
|
71
|
+
return errors;
|
|
72
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether what somebody typed to confirm an act is the word they were asked for.
|
|
3
|
+
*
|
|
4
|
+
* A threshold against reflex, not a password: the word is shown to them to type (or copy), so its case
|
|
5
|
+
* and the spaces a copy brings along around it are not what is being checked. Asked to write "app" out,
|
|
6
|
+
* "App" or " app " was refused -- the person had done exactly what was asked and was told it was wrong.
|
|
7
|
+
* Every type-to-confirm in this package compares through here, so they all accept the same answers.
|
|
8
|
+
*/
|
|
9
|
+
export declare function matchesPhiTypedConfirmation(typed: unknown, expected: string): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether what somebody typed to confirm an act is the word they were asked for.
|
|
3
|
+
*
|
|
4
|
+
* A threshold against reflex, not a password: the word is shown to them to type (or copy), so its case
|
|
5
|
+
* and the spaces a copy brings along around it are not what is being checked. Asked to write "app" out,
|
|
6
|
+
* "App" or " app " was refused -- the person had done exactly what was asked and was told it was wrong.
|
|
7
|
+
* Every type-to-confirm in this package compares through here, so they all accept the same answers.
|
|
8
|
+
*/
|
|
9
|
+
export function matchesPhiTypedConfirmation(typed, expected) {
|
|
10
|
+
const word = expected.trim();
|
|
11
|
+
return typeof typed === "string" && word.length > 0 &&
|
|
12
|
+
typed.trim().toLocaleLowerCase("en") === word.toLocaleLowerCase("en");
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PhiCmsConfigField } from "../types/cms-plugins";
|
|
2
|
+
/** A data Provider as its Module declares it: the key a Widget binds to and the resources it offers. */
|
|
3
|
+
export type PhiBindingCheckProvider = {
|
|
4
|
+
key: string;
|
|
5
|
+
kind?: string;
|
|
6
|
+
resources?: readonly unknown[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* What a Table, a Tree or a record Widget's config breaks of the resource it is bound to, as messages; an
|
|
10
|
+
* empty list for any other Widget, for one without a source, and for one bound to a Provider not among
|
|
11
|
+
* `providers` -- a Provider whose Module is not there is the Area's state, not the config's. `config` is
|
|
12
|
+
* the config the Widget reads: a preset's as it states it, or what the Widget's own `parseConfig` made
|
|
13
|
+
* of a stored one.
|
|
14
|
+
*/
|
|
15
|
+
export declare function checkPhiWidgetBinding(widgetType: string, config: Readonly<Record<string, unknown>>, providers: ReadonlyMap<string, PhiBindingCheckProvider>): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Every icon a Widget's config names in a field its Inspector offers as an icon (`type: "icon"`, in a
|
|
18
|
+
* collection's entries too) that `PhiIcon` does not know: a Button's, a Collection View action's, a
|
|
19
|
+
* Card's. A live Widget no longer looks a name up before it draws it, so an unknown one is refused where
|
|
20
|
+
* the author chose it, by the Builder's save.
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkPhiWidgetConfigIcons(fields: readonly PhiCmsConfigField[] | undefined, config: Readonly<Record<string, unknown>>): string[];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { PhiCmsWidgetType } from "../constants/cms-widget-types";
|
|
2
|
+
import { isPhiIconNameKnown } from "../components/shell/phi-icon-names";
|
|
3
|
+
import { readPhiDotPath } from "./dot-path";
|
|
4
|
+
import { isPhiRecord } from "./is-record";
|
|
5
|
+
import { validatePhiRecordWidgetBinding } from "./record-widget-binding";
|
|
6
|
+
import { validatePhiTableWidgetBinding } from "./table-widget-binding";
|
|
7
|
+
import { validatePhiTreeWidgetBinding } from "./tree-widget-binding";
|
|
8
|
+
function findResource(provider, resourceKey) {
|
|
9
|
+
return provider.resources?.find((candidate) => candidate.resourceKey === resourceKey);
|
|
10
|
+
}
|
|
11
|
+
function readSource(config) {
|
|
12
|
+
const source = config.source;
|
|
13
|
+
return isPhiRecord(source) && typeof source.providerKey === "string" ? source : null;
|
|
14
|
+
}
|
|
15
|
+
/** The icons a Table's actions and binding tools draw: those shown with an icon, named and unknown. */
|
|
16
|
+
function checkTableIcons(config) {
|
|
17
|
+
const findings = [];
|
|
18
|
+
const actions = [
|
|
19
|
+
...(config.features?.actions?.toolbar ?? []),
|
|
20
|
+
...(config.features?.actions?.row ?? []),
|
|
21
|
+
...(config.features?.actions?.bulk ?? []),
|
|
22
|
+
];
|
|
23
|
+
for (const action of actions) {
|
|
24
|
+
if (action.display !== "label" && action.icon && !isPhiIconNameKnown(action.icon.trim())) {
|
|
25
|
+
findings.push(`Table action "${action.key}" names the icon "${action.icon}", which PhiIcon does not know.`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const tool of config.features?.tools?.bindingFields ?? []) {
|
|
29
|
+
if (tool.create?.display !== "label" && tool.create?.icon && !isPhiIconNameKnown(tool.create.icon.trim())) {
|
|
30
|
+
findings.push(`Table binding field "${tool.key}" names the create icon "${tool.create.icon}", which PhiIcon does not know.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return findings;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* What a Table, a Tree or a record Widget's config breaks of the resource it is bound to, as messages; an
|
|
37
|
+
* empty list for any other Widget, for one without a source, and for one bound to a Provider not among
|
|
38
|
+
* `providers` -- a Provider whose Module is not there is the Area's state, not the config's. `config` is
|
|
39
|
+
* the config the Widget reads: a preset's as it states it, or what the Widget's own `parseConfig` made
|
|
40
|
+
* of a stored one.
|
|
41
|
+
*/
|
|
42
|
+
export function checkPhiWidgetBinding(widgetType, config, providers) {
|
|
43
|
+
if (widgetType !== PhiCmsWidgetType.Table &&
|
|
44
|
+
widgetType !== PhiCmsWidgetType.Tree &&
|
|
45
|
+
widgetType !== PhiCmsWidgetType.Record) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const source = readSource(config);
|
|
49
|
+
const provider = source ? providers.get(source.providerKey) : undefined;
|
|
50
|
+
if (!source || !provider)
|
|
51
|
+
return [];
|
|
52
|
+
const kind = widgetType === PhiCmsWidgetType.Table ? "Table" : widgetType === PhiCmsWidgetType.Tree ? "Tree" : "Record";
|
|
53
|
+
const missing = `${kind} is bound to resource "${String(source.resourceKey)}", which "${provider.key}" does not declare.`;
|
|
54
|
+
if (widgetType === PhiCmsWidgetType.Tree) {
|
|
55
|
+
const resource = findResource(provider, source.resourceKey);
|
|
56
|
+
return resource ? validatePhiTreeWidgetBinding(config, resource) : [missing];
|
|
57
|
+
}
|
|
58
|
+
const resource = findResource(provider, source.resourceKey);
|
|
59
|
+
if (!resource)
|
|
60
|
+
return [missing];
|
|
61
|
+
if (widgetType === PhiCmsWidgetType.Record) {
|
|
62
|
+
return validatePhiRecordWidgetBinding(config, resource);
|
|
63
|
+
}
|
|
64
|
+
const table = config;
|
|
65
|
+
return [...validatePhiTableWidgetBinding(table, resource), ...checkTableIcons(table)];
|
|
66
|
+
}
|
|
67
|
+
function checkFieldIcons(fields, value, where, findings) {
|
|
68
|
+
for (const field of fields) {
|
|
69
|
+
const fieldValue = readPhiDotPath(value, field.key);
|
|
70
|
+
if (field.type === "icon") {
|
|
71
|
+
const name = typeof fieldValue === "string" ? fieldValue.trim() : "";
|
|
72
|
+
if (name && !isPhiIconNameKnown(name)) {
|
|
73
|
+
findings.push(`${where}${field.key} names the icon "${name}", which PhiIcon does not know.`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else if (field.type === "collection" && Array.isArray(fieldValue)) {
|
|
77
|
+
fieldValue.forEach((item, index) => checkFieldIcons(field.itemFields, item, `${where}${field.key}[${index}].`, findings));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Every icon a Widget's config names in a field its Inspector offers as an icon (`type: "icon"`, in a
|
|
83
|
+
* collection's entries too) that `PhiIcon` does not know: a Button's, a Collection View action's, a
|
|
84
|
+
* Card's. A live Widget no longer looks a name up before it draws it, so an unknown one is refused where
|
|
85
|
+
* the author chose it, by the Builder's save.
|
|
86
|
+
*/
|
|
87
|
+
export function checkPhiWidgetConfigIcons(fields, config) {
|
|
88
|
+
const findings = [];
|
|
89
|
+
checkFieldIcons(fields ?? [], config, "", findings);
|
|
90
|
+
return findings;
|
|
91
|
+
}
|
package/module-page-check.d.ts
CHANGED
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
* No `server-only` here, on purpose: a test in a package loads this door without a mock.
|
|
16
16
|
*/
|
|
17
17
|
export { createPhiDeclaredMediaResolver, type PhiModuleMediaFinding } from "./helpers/module-media-check";
|
|
18
|
+
export { checkPhiPresetForms } from "./helpers/preset-form-check";
|
|
18
19
|
export { checkPhiPagePresetLayout, type PhiPageLayoutFinding } from "./helpers/page-layout-check";
|
|
19
20
|
export { checkPhiPresetTextSources, type PhiPresetTextSourceFinding } from "./helpers/preset-text-source-check";
|
|
20
21
|
export { checkPhiEmbeddableTables, checkPhiPresetTables } from "./helpers/preset-table-check";
|
|
21
22
|
export { checkPhiPresetTreeContract, type PhiPresetTreeContractFinding } from "./helpers/preset-tree-contract-check";
|
|
23
|
+
export { validatePhiTreeWidgetBinding } from "./helpers/tree-widget-binding";
|
|
22
24
|
export { checkPhiRouteAddresses, type PhiRouteAddressFinding, type PhiRouteAddressSubject } from "./helpers/route-address-check";
|
package/module-page-check.js
CHANGED
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
* No `server-only` here, on purpose: a test in a package loads this door without a mock.
|
|
16
16
|
*/
|
|
17
17
|
export { createPhiDeclaredMediaResolver } from "./helpers/module-media-check";
|
|
18
|
+
export { checkPhiPresetForms } from "./helpers/preset-form-check";
|
|
18
19
|
export { checkPhiPagePresetLayout } from "./helpers/page-layout-check";
|
|
19
20
|
export { checkPhiPresetTextSources } from "./helpers/preset-text-source-check";
|
|
20
21
|
export { checkPhiEmbeddableTables, checkPhiPresetTables } from "./helpers/preset-table-check";
|
|
21
22
|
export { checkPhiPresetTreeContract } from "./helpers/preset-tree-contract-check";
|
|
23
|
+
export { validatePhiTreeWidgetBinding } from "./helpers/tree-widget-binding";
|
|
22
24
|
export { checkPhiRouteAddresses } from "./helpers/route-address-check";
|
package/net/phi-next-proxy.d.ts
CHANGED
|
@@ -19,6 +19,13 @@ export type PhiNextProxyConfig = {
|
|
|
19
19
|
tags?: string[];
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* A request that may take longer than `timeoutMs` because its body is large, answered `null`: it is
|
|
24
|
+
* bounded by the browser alone -- aborted when the browser goes away (`request.signal`) -- and not
|
|
25
|
+
* by the clock. Every request this does not name keeps `timeoutMs`. A door names only what it must:
|
|
26
|
+
* a part of a CDN upload is 16 MiB on whatever link the person has, and eight seconds cut it.
|
|
27
|
+
*/
|
|
28
|
+
unboundedRequest?: (request: NextRequest, path: PhiProxyPath) => boolean;
|
|
22
29
|
};
|
|
23
30
|
export type PhiNextProxyHandler = (request: NextRequest, context: PhiNextProxyRouteContext) => Promise<Response>;
|
|
24
31
|
export type PhiNextProxyHandlers = {
|
package/net/phi-next-proxy.js
CHANGED
|
@@ -84,7 +84,7 @@ async function proxyRequest(request, path, config) {
|
|
|
84
84
|
...(hasBody ? { body: request.body, duplex: "half" } : {}),
|
|
85
85
|
...(config.buildFetchInit?.(request, path) ?? { cache: "no-store" }),
|
|
86
86
|
redirect: "manual",
|
|
87
|
-
signal: AbortSignal.timeout(config.timeoutMs),
|
|
87
|
+
signal: config.unboundedRequest?.(request, path) ? request.signal : AbortSignal.timeout(config.timeoutMs),
|
|
88
88
|
});
|
|
89
89
|
const durationMs = Date.now() - startedAt;
|
|
90
90
|
if (durationMs >= config.timeoutMs / 2 && targetResponse.ok) {
|
package/next/root-route.js
CHANGED
|
@@ -9,7 +9,8 @@ import { collectPhiThemeDescriptorContributions } from "../plugins/runtime-modul
|
|
|
9
9
|
import { resolvePhiThemeComposition } from "../theme/phi-theme-composition";
|
|
10
10
|
import { composePhiFontCatalogue } from "../theme/phi-font-catalogue";
|
|
11
11
|
import { PHI_REM_ROOT_PX } from "../theme/phi-css-vars";
|
|
12
|
-
import { buildPhiRootMetadata
|
|
12
|
+
import { buildPhiRootMetadata } from "../helpers/phi-metadata";
|
|
13
|
+
import { resolvePhiSiteDescription } from "../helpers/phi-site-description";
|
|
13
14
|
import { describePhiSignetHead } from "../helpers/phi-signet-head";
|
|
14
15
|
import { localizePath } from "../helpers/locale";
|
|
15
16
|
import { readPhiSiteRuntimeConfigSync, } from "../helpers/site-runtime";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phis/ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
"peerDependencies": {
|
|
502
502
|
"@ant-design/icons": "^6.3.2",
|
|
503
503
|
"antd": "^6.7.1",
|
|
504
|
-
"next": "^16.
|
|
504
|
+
"next": "^16.4.6",
|
|
505
505
|
"react": "^19.2.8",
|
|
506
506
|
"react-dom": "^19.2.8"
|
|
507
507
|
},
|
|
@@ -512,24 +512,37 @@
|
|
|
512
512
|
"@dnd-kit/core": "^6.3.1",
|
|
513
513
|
"@dnd-kit/sortable": "^10.0.0",
|
|
514
514
|
"@dnd-kit/utilities": "^3.2.2",
|
|
515
|
-
"@iconify/react": "^6.0.
|
|
516
|
-
"@lexical/history": "0.
|
|
517
|
-
"@lexical/html": "0.
|
|
518
|
-
"@lexical/link": "0.
|
|
519
|
-
"@lexical/list": "0.
|
|
520
|
-
"@lexical/react": "0.
|
|
521
|
-
"@lexical/rich-text": "0.
|
|
522
|
-
"@lexical/selection": "0.
|
|
523
|
-
"@lexical/utils": "0.
|
|
524
|
-
"@phis/contracts": "^0.8.
|
|
515
|
+
"@iconify/react": "^6.0.4",
|
|
516
|
+
"@lexical/history": "0.53.0",
|
|
517
|
+
"@lexical/html": "0.53.0",
|
|
518
|
+
"@lexical/link": "0.53.0",
|
|
519
|
+
"@lexical/list": "0.53.0",
|
|
520
|
+
"@lexical/react": "0.53.0",
|
|
521
|
+
"@lexical/rich-text": "0.53.0",
|
|
522
|
+
"@lexical/selection": "0.53.0",
|
|
523
|
+
"@lexical/utils": "0.53.0",
|
|
524
|
+
"@phis/contracts": "^0.8.12",
|
|
525
525
|
"dayjs": "^1.11.23",
|
|
526
526
|
"dom-serializer": "^2.0.0",
|
|
527
527
|
"htmlparser2": "^10.1.0",
|
|
528
|
-
"lexical": "0.
|
|
528
|
+
"lexical": "0.53.0",
|
|
529
529
|
"remark-gfm": "^4.0.1",
|
|
530
530
|
"remark-parse": "^11.0.0",
|
|
531
|
-
"sanitize-html": "2.
|
|
531
|
+
"sanitize-html": "2.18.2",
|
|
532
532
|
"server-only": "^0.0.1",
|
|
533
533
|
"unified": "^11.0.5"
|
|
534
|
+
},
|
|
535
|
+
"phis": {
|
|
536
|
+
"testedWith": {
|
|
537
|
+
"@ant-design/icons": "6.3.4",
|
|
538
|
+
"@types/node": "26.6.6",
|
|
539
|
+
"@types/react": "19.3.0",
|
|
540
|
+
"@types/react-dom": "19.3.0",
|
|
541
|
+
"antd": "6.7.2",
|
|
542
|
+
"next": "16.4.6",
|
|
543
|
+
"react": "19.3.1",
|
|
544
|
+
"react-dom": "19.3.1",
|
|
545
|
+
"typescript": "6.0.3"
|
|
546
|
+
}
|
|
534
547
|
}
|
|
535
548
|
}
|
|
@@ -24,9 +24,12 @@ export declare const PHI_ACCOUNTING_PRODUCTS_PAGE_WIDGET_IDS: Readonly<Record<"w
|
|
|
24
24
|
* Accounting Area beside the product directory.
|
|
25
25
|
*/
|
|
26
26
|
export declare const PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET_KEY = "accounting-customer-file-page";
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The person and their addresses, the file and its note dialog, the conversations with the one chosen and
|
|
29
|
+
* its Reply dialog -- every one named in a route by another.
|
|
30
|
+
*/
|
|
28
31
|
export declare const PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_IDS: {
|
|
29
|
-
widgets: Readonly<Record<"widgetConversation" | "widgetReplyForm" | "widgetReplyCommands" | "widgetPerson" | "widgetAddresses" | "widgetThreads", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
30
|
-
overlays: Readonly<Record<"overlayReply", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
31
|
-
layouts: Readonly<Record<"layoutReply" | "layoutReplyFooter", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
32
|
+
widgets: Readonly<Record<"widgetConversation" | "widgetReplyForm" | "widgetReplyCommands" | "widgetPerson" | "widgetAddresses" | "widgetFile" | "widgetThreads" | "widgetNoteForm" | "widgetNoteCommands", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
33
|
+
overlays: Readonly<Record<"overlayReply" | "overlayNote", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
34
|
+
layouts: Readonly<Record<"layoutReply" | "layoutReplyFooter" | "layoutNote" | "layoutNoteFooter", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
32
35
|
};
|
|
@@ -37,16 +37,27 @@ const PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET = {
|
|
|
37
37
|
ownerModuleId: PHI_ACCOUNTING_RUNTIME_MODULE_ID,
|
|
38
38
|
presetKey: PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET_KEY,
|
|
39
39
|
};
|
|
40
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* The person and their addresses, the file and its note dialog, the conversations with the one chosen and
|
|
42
|
+
* its Reply dialog -- every one named in a route by another.
|
|
43
|
+
*/
|
|
41
44
|
export const PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_IDS = {
|
|
42
45
|
widgets: createPhiPresetCmsInstanceIdMap(PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET, [
|
|
43
46
|
"widgetPerson",
|
|
44
47
|
"widgetAddresses",
|
|
48
|
+
"widgetFile",
|
|
45
49
|
"widgetThreads",
|
|
46
50
|
"widgetConversation",
|
|
51
|
+
"widgetNoteForm",
|
|
52
|
+
"widgetNoteCommands",
|
|
47
53
|
"widgetReplyForm",
|
|
48
54
|
"widgetReplyCommands",
|
|
49
55
|
]),
|
|
50
|
-
overlays: createPhiPresetCmsInstanceIdMap(PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET, ["overlayReply"]),
|
|
51
|
-
layouts: createPhiPresetCmsInstanceIdMap(PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET, [
|
|
56
|
+
overlays: createPhiPresetCmsInstanceIdMap(PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET, ["overlayNote", "overlayReply"]),
|
|
57
|
+
layouts: createPhiPresetCmsInstanceIdMap(PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_PRESET, [
|
|
58
|
+
"layoutNote",
|
|
59
|
+
"layoutNoteFooter",
|
|
60
|
+
"layoutReply",
|
|
61
|
+
"layoutReplyFooter",
|
|
62
|
+
]),
|
|
52
63
|
};
|
|
@@ -10,6 +10,7 @@ export declare function getPhiAccountingCustomerFilePageLabels(options: PhiGloba
|
|
|
10
10
|
picker: string;
|
|
11
11
|
pickerHint: string;
|
|
12
12
|
empty: string;
|
|
13
|
+
footer: string;
|
|
13
14
|
columns: {
|
|
14
15
|
displayName: string;
|
|
15
16
|
name: string;
|
|
@@ -23,11 +24,6 @@ export declare function getPhiAccountingCustomerFilePageLabels(options: PhiGloba
|
|
|
23
24
|
title: string;
|
|
24
25
|
label: string;
|
|
25
26
|
empty: string;
|
|
26
|
-
columns: {
|
|
27
|
-
name: string;
|
|
28
|
-
address: string;
|
|
29
|
-
purposes: string;
|
|
30
|
-
};
|
|
31
27
|
purposes: {
|
|
32
28
|
billing: string;
|
|
33
29
|
shipping: string;
|
|
@@ -39,6 +35,8 @@ export declare function getPhiAccountingCustomerFilePageLabels(options: PhiGloba
|
|
|
39
35
|
title: string;
|
|
40
36
|
label: string;
|
|
41
37
|
empty: string;
|
|
38
|
+
emptyHint: string;
|
|
39
|
+
footer: string;
|
|
42
40
|
columns: {
|
|
43
41
|
subject: string;
|
|
44
42
|
kind: string;
|
|
@@ -46,7 +44,6 @@ export declare function getPhiAccountingCustomerFilePageLabels(options: PhiGloba
|
|
|
46
44
|
activity: string;
|
|
47
45
|
};
|
|
48
46
|
kinds: {
|
|
49
|
-
file: string;
|
|
50
47
|
direct: string;
|
|
51
48
|
group: string;
|
|
52
49
|
crossGroup: string;
|
|
@@ -59,8 +56,23 @@ export declare function getPhiAccountingCustomerFilePageLabels(options: PhiGloba
|
|
|
59
56
|
locked: string;
|
|
60
57
|
};
|
|
61
58
|
};
|
|
62
|
-
|
|
59
|
+
file: {
|
|
60
|
+
title: string;
|
|
61
|
+
label: string;
|
|
62
|
+
empty: string;
|
|
63
|
+
add: string;
|
|
64
|
+
};
|
|
65
|
+
note: {
|
|
66
|
+
title: string;
|
|
67
|
+
save: string;
|
|
68
|
+
};
|
|
69
|
+
conversation: {
|
|
70
|
+
label: string;
|
|
71
|
+
empty: string;
|
|
72
|
+
};
|
|
63
73
|
ownFile: string;
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
reply: {
|
|
75
|
+
title: string;
|
|
76
|
+
send: string;
|
|
77
|
+
};
|
|
66
78
|
}>;
|
|
@@ -4,7 +4,7 @@ import { definePhiRuntimeModuleLabelSet, definePhiMessageLabel, getPhiLabelSet }
|
|
|
4
4
|
import { PHI_ACCOUNTING_RUNTIME_MODULE_IDENTITY } from "../ids";
|
|
5
5
|
/**
|
|
6
6
|
* What the customer file in the Accounting Area says: the member picker, the person's details, their
|
|
7
|
-
* addresses,
|
|
7
|
+
* addresses, their file with its note dialog, the conversations they are in with the Reply dialog. The conversation words
|
|
8
8
|
* are its own rather than the conversations Page's, since a Module does not read another's Label Set.
|
|
9
9
|
*/
|
|
10
10
|
const PHI_CUSTOMER_FILE_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_ACCOUNTING_RUNTIME_MODULE_IDENTITY, {
|
|
@@ -20,6 +20,9 @@ const PHI_CUSTOMER_FILE_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_ACCO
|
|
|
20
20
|
person_picker_hint: definePhiMessageLabel("Search by name, e-mail address or telephone number."),
|
|
21
21
|
person_empty: definePhiMessageLabel("Choose a member to open their file."),
|
|
22
22
|
own_file: definePhiMessageLabel("This is your own record; it is not shown here."),
|
|
23
|
+
person_footer: definePhiMessageLabel("Member no. %1. Opening a file is written to the access log."),
|
|
24
|
+
// Core pages the conversations without a count: what this page holds, and which page it is.
|
|
25
|
+
threads_footer: "%1 on page %2",
|
|
23
26
|
column_display_name: "Shown as",
|
|
24
27
|
column_name: "Name",
|
|
25
28
|
column_company: "Company",
|
|
@@ -29,18 +32,22 @@ const PHI_CUSTOMER_FILE_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_ACCO
|
|
|
29
32
|
addresses_title: "Addresses",
|
|
30
33
|
addresses_label: "customer addresses",
|
|
31
34
|
addresses_empty: definePhiMessageLabel("No address on file."),
|
|
32
|
-
column_address_name: "Name",
|
|
33
|
-
column_address: "Address",
|
|
34
|
-
column_purposes: "Used for",
|
|
35
35
|
purpose_billing: "Billing",
|
|
36
36
|
purpose_shipping: "Shipping",
|
|
37
37
|
purpose_default_billing: "Default billing",
|
|
38
38
|
purpose_default_shipping: "Default shipping",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
file_title: "File",
|
|
40
|
+
file_label: "customer file entries",
|
|
41
|
+
file_empty: definePhiMessageLabel("Choose a member to read their file."),
|
|
42
|
+
note_add: "Add note",
|
|
43
|
+
note_title: "Internal note",
|
|
44
|
+
note_save: "Add to file",
|
|
45
|
+
threads_title: "Conversations",
|
|
46
|
+
threads_label: "customer conversations",
|
|
47
|
+
threads_empty: definePhiMessageLabel("No conversations to show."),
|
|
48
|
+
threads_empty_hint: definePhiMessageLabel("Choose a member above: the conversations they are in that you may see are listed here."),
|
|
49
|
+
conversation_empty: definePhiMessageLabel("Choose a conversation to read."),
|
|
50
|
+
conversation_label: "customer conversation",
|
|
44
51
|
kind_direct: "Direct",
|
|
45
52
|
kind_group: "Group",
|
|
46
53
|
kind_cross_group: "Between groups",
|
|
@@ -53,7 +60,7 @@ const PHI_CUSTOMER_FILE_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_ACCO
|
|
|
53
60
|
state_open: { text: "Open", ctx: "Web UI label, state" },
|
|
54
61
|
state_archived: "Archived",
|
|
55
62
|
state_locked: "Locked",
|
|
56
|
-
|
|
63
|
+
reply_title: "Reply",
|
|
57
64
|
reply_send_label: "Send",
|
|
58
65
|
},
|
|
59
66
|
});
|
|
@@ -69,6 +76,7 @@ export async function getPhiAccountingCustomerFilePageLabels(options) {
|
|
|
69
76
|
picker: labels.person_picker,
|
|
70
77
|
pickerHint: labels.person_picker_hint,
|
|
71
78
|
empty: labels.person_empty,
|
|
79
|
+
footer: labels.person_footer,
|
|
72
80
|
columns: {
|
|
73
81
|
displayName: labels.column_display_name,
|
|
74
82
|
name: labels.column_name,
|
|
@@ -82,7 +90,6 @@ export async function getPhiAccountingCustomerFilePageLabels(options) {
|
|
|
82
90
|
title: labels.addresses_title,
|
|
83
91
|
label: labels.addresses_label,
|
|
84
92
|
empty: labels.addresses_empty,
|
|
85
|
-
columns: { name: labels.column_address_name, address: labels.column_address, purposes: labels.column_purposes },
|
|
86
93
|
purposes: {
|
|
87
94
|
billing: labels.purpose_billing,
|
|
88
95
|
shipping: labels.purpose_shipping,
|
|
@@ -94,6 +101,8 @@ export async function getPhiAccountingCustomerFilePageLabels(options) {
|
|
|
94
101
|
title: labels.threads_title,
|
|
95
102
|
label: labels.threads_label,
|
|
96
103
|
empty: labels.threads_empty,
|
|
104
|
+
emptyHint: labels.threads_empty_hint,
|
|
105
|
+
footer: labels.threads_footer,
|
|
97
106
|
columns: {
|
|
98
107
|
subject: labels.column_subject,
|
|
99
108
|
kind: labels.column_kind,
|
|
@@ -101,7 +110,6 @@ export async function getPhiAccountingCustomerFilePageLabels(options) {
|
|
|
101
110
|
activity: labels.column_activity,
|
|
102
111
|
},
|
|
103
112
|
kinds: {
|
|
104
|
-
file: labels.kind_file,
|
|
105
113
|
direct: labels.kind_direct,
|
|
106
114
|
group: labels.kind_group,
|
|
107
115
|
crossGroup: labels.kind_cross_group,
|
|
@@ -114,9 +122,15 @@ export async function getPhiAccountingCustomerFilePageLabels(options) {
|
|
|
114
122
|
locked: labels.state_locked,
|
|
115
123
|
},
|
|
116
124
|
},
|
|
117
|
-
|
|
125
|
+
file: {
|
|
126
|
+
title: labels.file_title,
|
|
127
|
+
label: labels.file_label,
|
|
128
|
+
empty: labels.file_empty,
|
|
129
|
+
add: labels.note_add,
|
|
130
|
+
},
|
|
131
|
+
note: { title: labels.note_title, save: labels.note_save },
|
|
132
|
+
conversation: { label: labels.conversation_label, empty: labels.conversation_empty },
|
|
118
133
|
ownFile: labels.own_file,
|
|
119
|
-
|
|
120
|
-
replySendLabel: labels.reply_send_label,
|
|
134
|
+
reply: { title: labels.reply_title, send: labels.reply_send_label },
|
|
121
135
|
};
|
|
122
136
|
}
|
package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts
CHANGED
|
@@ -6,15 +6,18 @@ import type { PhiBlockRuntime } from "../../../../types";
|
|
|
6
6
|
*
|
|
7
7
|
* A Page of the Accounting Module, beside the product directory, built from what the conversations Page
|
|
8
8
|
* already is and bound by Foundation names only (`constants/customer-file.ts`,
|
|
9
|
-
* `constants/threads-controller-address.ts`): the Table
|
|
10
|
-
* conversations Module's, which is active in the Accounting Area by default and has to
|
|
11
|
-
* to read anything. The person Table's filter is Core's member picker
|
|
9
|
+
* `constants/threads-controller-address.ts`): the Table and Collection Providers and the Conversations
|
|
10
|
+
* Controller are the conversations Module's, which is active in the Accounting Area by default and has to
|
|
11
|
+
* be for this Page to read anything. The person Table's filter is Core's member picker
|
|
12
12
|
* (the `site-members` options with Core's search, which matches names, e-mail addresses and telephone
|
|
13
|
-
* numbers); its query goes to the
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* file
|
|
13
|
+
* numbers); its query goes to the conversations Table and to the Conversations Controller, so one choice
|
|
14
|
+
* fills the Page with one request: the Controller hands the member to the addresses tiles as binding params
|
|
15
|
+
* (Core's address renderer, read-only), joins the Tables' read for the file's id and hands it to the file
|
|
16
|
+
* panel, a conversation reader whose "Add note" opens Core's Reply Form
|
|
17
|
+
* in a dialog of its own (every message of a file is internal). The conversations Table lists the person's
|
|
18
|
+
* conversations, the file not among them, and choosing a row is the conversations Page's choreography
|
|
19
|
+
* unchanged: the Controller makes the selection a thread, the conversation reader below reads it, and its
|
|
20
|
+
* Reply opens the Reply dialog with the internal note offered.
|
|
18
21
|
*
|
|
19
22
|
* The Page is for the holders of `accounting` (`PHI_ACCOUNTING_CUSTOMER_FILE_ACCESS`), who read every
|
|
20
23
|
* field, the addresses included. A viewer the Area admits without it is told so in the Page and nothing is
|