@phis/ui 0.7.8 → 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-address-control.d.ts +23 -0
- package/components/controls/phi-address-control.js +43 -0
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-country-select-control.d.ts +22 -0
- package/components/controls/phi-country-select-control.js +16 -0
- package/components/controls/phi-dialog-control.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.js +5 -3
- package/components/controls/phi-drawer-control.d.ts +7 -5
- package/components/controls/phi-float-button-control.d.ts +8 -1
- package/components/controls/phi-float-button-control.js +19 -3
- package/components/controls/phi-form-control.js +52 -8
- 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-modal-control-adapter.d.ts +1 -1
- package/components/controls/phi-modal-control-adapter.js +14 -37
- package/components/controls/phi-modal-control.d.ts +5 -5
- package/components/controls/phi-options-provider.d.ts +1 -0
- package/components/controls/phi-options-provider.js +1 -0
- package/components/controls/phi-overlay-control-contract.d.ts +52 -17
- package/components/controls/phi-overlay-control-contract.js +55 -30
- package/components/controls/phi-popover-control.js +4 -1
- package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
- package/components/controls/phi-reveal-once-dialog-control.js +52 -0
- package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
- package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
- package/components/controls/phi-table-control.d.ts +7 -1
- package/components/controls/phi-table-control.js +23 -8
- package/components/forms/flags-field.d.ts +22 -0
- package/components/forms/flags-field.js +58 -0
- 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-option-flags.d.ts +20 -0
- package/components/forms/form-option-flags.js +38 -0
- package/components/forms/form-provider-contract.d.ts +23 -0
- package/components/forms/form-provider-contract.js +36 -0
- package/components/forms/form-provider-registry.d.ts +5 -1
- 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/forms/shared-form-provider-registry.js +13 -0
- package/components/forms/structured-field-labels.d.ts +24 -0
- package/components/forms/structured-field-labels.js +43 -0
- package/components/forms/structured-form-field-controls.d.ts +12 -0
- package/components/forms/structured-form-field-controls.js +65 -0
- 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 +13 -11
- package/components/regions/phi-cms-region-shell.js +2 -2
- package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +13 -2
- package/components/regions/presets/phi-settings-page-shell-tree.js +4 -4
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/shell/phi-antd-icon.d.ts +1 -8
- package/components/shell/phi-antd-icon.js +1 -227
- package/components/shell/phi-icon-names.d.ts +22 -0
- package/components/shell/phi-icon-names.js +267 -0
- package/components/shell/phi-icon.d.ts +4 -15
- package/components/shell/phi-icon.js +9 -50
- 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 +29 -2
- package/components/widgets/client/shared/phi-command-buttons.js +19 -5
- package/components/widgets/client/shared/phi-rendered-value.js +27 -3
- package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
- package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
- package/components/widgets/config/background.d.ts +3 -2
- package/components/widgets/config/choice-shared.d.ts +10 -1
- package/components/widgets/config/choice-shared.js +8 -2
- package/components/widgets/label-sets/admin-locales.js +1 -1
- package/components/widgets/label-sets/admin-users.d.ts +3 -5
- package/components/widgets/label-sets/admin-users.js +6 -10
- package/components/widgets/label-sets/builder-modules.js +4 -0
- package/components/widgets/label-sets/effects.js +2 -4
- package/components/widgets/label-sets/profile.d.ts +13 -16
- package/components/widgets/label-sets/profile.js +24 -33
- 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/search-results.js +2 -4
- package/components/widgets/label-sets/signals.js +2 -0
- package/components/widgets/label-sets/table.js +9 -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/effects.d.ts +3 -2
- package/components/widgets/label-types/effects.js +1 -2
- package/components/widgets/label-types/revisions.d.ts +2 -0
- package/components/widgets/label-types/revisions.js +2 -1
- package/components/widgets/label-types/search-results.d.ts +2 -2
- package/components/widgets/label-types/search-results.js +1 -2
- package/components/widgets/label-types/signals.d.ts +2 -0
- package/components/widgets/label-types/signals.js +1 -0
- package/components/widgets/label-types/table.d.ts +3 -0
- package/components/widgets/label-types/table.js +2 -0
- package/components/widgets/server/builder-chrome.d.ts +4 -1
- package/components/widgets/server/builder-chrome.js +2 -2
- package/components/widgets/shared/markdown-body-client.d.ts +26 -0
- package/components/widgets/shared/markdown-body-client.js +31 -1
- package/components/widgets/shared/markdown-render.d.ts +10 -2
- package/components/widgets/shared/markdown-render.js +35 -13
- 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/countries.d.ts +9 -0
- package/constants/countries.js +28 -0
- package/constants/customer-file.d.ts +34 -0
- package/constants/customer-file.js +35 -0
- package/constants/record-field-kinds.d.ts +15 -0
- package/constants/record-field-kinds.js +13 -0
- package/constants/runtime-module-ownership.js +15 -2
- package/constants/runtime-render-client-types.d.ts +5 -0
- package/constants/runtime-render-client-types.js +5 -0
- 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/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
- package/constants.d.ts +2 -0
- package/constants.js +4 -0
- package/gateway/form-handler-request.d.ts +22 -0
- package/gateway/form-handler-request.js +40 -0
- package/gateway/label-set.d.ts +15 -2
- package/gateway/label-set.js +60 -22
- package/gateway/site-cms-write-validation.js +19 -3
- package/gateway/site-form-route.js +11 -2
- package/helpers/address-field.d.ts +43 -0
- package/helpers/address-field.js +68 -0
- package/helpers/announced-action.d.ts +17 -0
- package/helpers/announced-action.js +29 -0
- package/helpers/cms-dialog.d.ts +5 -20
- package/helpers/cms-dialog.js +8 -13
- package/helpers/cms-page-catalog.d.ts +10 -0
- package/helpers/cms-page-catalog.js +19 -0
- package/helpers/cms-preset-nodes.d.ts +4 -4
- package/helpers/cms-preset-nodes.js +1 -1
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/country-names.d.ts +12 -0
- package/helpers/country-names.js +14 -0
- package/helpers/phi-metadata.d.ts +25 -1
- package/helpers/phi-metadata.js +53 -1
- 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 +38 -0
- package/helpers/preset-table-check.js +118 -0
- package/helpers/preset-text-source-check.d.ts +4 -1
- package/helpers/preset-text-source-check.js +6 -1
- package/helpers/preset-tree-contract-check.d.ts +3 -2
- package/helpers/preset-tree-contract-check.js +30 -5
- package/helpers/public-route-claims.d.ts +9 -1
- package/helpers/public-route-claims.js +23 -3
- package/helpers/record-fields.d.ts +1 -5
- package/helpers/record-fields.js +15 -6
- 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/route-address-check.d.ts +22 -2
- package/helpers/route-address-check.js +29 -8
- package/helpers/site-address-row.d.ts +23 -0
- package/helpers/site-address-row.js +36 -0
- package/helpers/surface-style.d.ts +8 -1
- package/helpers/surface-style.js +12 -2
- package/helpers/table-widget-binding.d.ts +12 -0
- package/helpers/table-widget-binding.js +296 -0
- package/helpers/thread-inbox-row.d.ts +20 -0
- package/helpers/thread-inbox-row.js +26 -0
- package/helpers/translation-format.d.ts +26 -0
- package/helpers/translation-format.js +31 -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-labels.d.ts +1 -1
- package/module-labels.js +1 -1
- package/module-page-check.d.ts +3 -0
- package/module-page-check.js +3 -0
- package/module-records.d.ts +2 -2
- package/module-records.js +1 -0
- package/next/area-route.js +34 -1
- package/next/root-route.js +4 -4
- package/package.json +2 -2
- package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
- package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
- package/plugins/runtime-modules/accounting/data-providers.js +1 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +14 -0
- package/plugins/runtime-modules/accounting/ids.js +34 -0
- package/plugins/runtime-modules/accounting/presets.js +32 -5
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +78 -0
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +136 -0
- package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +29 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +450 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
- package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/app/client-data-providers.js +9 -0
- package/plugins/runtime-modules/app/data-providers.d.ts +43 -0
- package/plugins/runtime-modules/app/data-providers.js +45 -0
- package/plugins/runtime-modules/app/definition.d.ts +60 -1
- package/plugins/runtime-modules/app/definition.js +2 -0
- package/plugins/runtime-modules/app/forms.d.ts +33 -3
- package/plugins/runtime-modules/app/forms.js +166 -31
- package/plugins/runtime-modules/app/ids.d.ts +8 -0
- package/plugins/runtime-modules/app/ids.js +9 -0
- package/plugins/runtime-modules/app/module.d.ts +60 -1
- package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
- package/plugins/runtime-modules/app/services/addresses-collection.js +105 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +21 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +143 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +57 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +104 -0
- 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 +28 -19
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.js +5 -14
- package/plugins/runtime-modules/asset/presets.d.ts +4 -0
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
- package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
- package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
- package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
- package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
- package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
- package/plugins/runtime-modules/blog/presets.d.ts +4 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +6 -3
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
- package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
- package/plugins/runtime-modules/builder/persistence.js +4 -0
- package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
- 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 +8 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +47 -7
- package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
- package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
- package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
- package/plugins/runtime-modules/client-manifests/app.js +3 -0
- package/plugins/runtime-modules/client-manifests/builder.js +10 -0
- package/plugins/runtime-modules/client-manifests/common.js +6 -0
- package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
- package/plugins/runtime-modules/contracts.js +31 -1
- package/plugins/runtime-modules/core/definition.d.ts +23 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -2
- package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/card/editor.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 +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/client.js +3 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/dimension/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/client.js +4 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
- package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
- 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/header-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
- package/plugins/runtime-modules/core/widgets/number-input/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/simple-text/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +48 -51
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/table/config.js +9 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -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/dashboard/trees/dashboard-cards-page-tree.js +3 -1
- package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
- package/plugins/runtime-modules/descriptor-compiler.js +44 -16
- package/plugins/runtime-modules/editor/presets.d.ts +4 -0
- package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/localization/presets.d.ts +4 -0
- 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-admin-locales-page-tree.js +3 -1
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +9 -2
- package/plugins/runtime-modules/news/presets.d.ts +4 -0
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
- package/plugins/runtime-modules/resolver.js +17 -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 +86 -60
- 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/controller/draft-context-target.d.ts +25 -0
- package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -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/presets.d.ts +4 -0
- package/plugins/runtime-modules/revisions/services/options.js +14 -4
- package/plugins/runtime-modules/revisions/services/table.js +54 -25
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +79 -4
- package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
- package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
- package/plugins/runtime-modules/theme/presets.d.ts +4 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +105 -7
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
- package/plugins/runtime-modules/threads/client-data-providers.js +10 -0
- package/plugins/runtime-modules/threads/controller/client.js +62 -2
- package/plugins/runtime-modules/threads/controller/definition.js +49 -1
- package/plugins/runtime-modules/threads/data-providers.d.ts +100 -2
- package/plugins/runtime-modules/threads/data-providers.js +96 -0
- package/plugins/runtime-modules/threads/definition.d.ts +100 -2
- package/plugins/runtime-modules/threads/definition.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +4 -0
- package/plugins/runtime-modules/threads/ids.js +5 -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 +126 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.js +79 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
- package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
- package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
- package/plugins/runtime-modules/user-management/data-providers.js +101 -3
- package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
- package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
- package/plugins/runtime-modules/user-management/ids.js +9 -0
- package/plugins/runtime-modules/user-management/presets.js +17 -1
- package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
- package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +90 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +122 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +181 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +24 -18
- package/server-helpers/cms-page-record.d.ts +9 -1
- package/server-helpers/cms-page-record.js +11 -1
- package/server-helpers/cms-request.js +8 -5
- package/server-helpers/link-preview-image.d.ts +30 -0
- package/server-helpers/link-preview-image.js +57 -0
- package/server-helpers/runtime.js +0 -1
- package/server-helpers/search-text.js +3 -0
- package/server-helpers.d.ts +1 -1
- package/server-helpers.js +1 -1
- package/styles/controls.css +4 -2
- package/styles/layout.css +7 -0
- package/styles/shell.css +30 -6
- 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-composition.js +9 -0
- package/theme/phi-theme-gradients.js +4 -22
- package/theme/phi-theme-inverse-ground.d.ts +39 -0
- package/theme/phi-theme-inverse-ground.js +103 -0
- package/theme/phi-theme-palette-defaults.d.ts +16 -0
- package/theme/phi-theme-palette-defaults.js +103 -0
- package/theme/phi-theme-tokens.d.ts +2 -1
- package/theme/phi-theme-tokens.js +2 -0
- package/types/cms-module-descriptors.d.ts +14 -0
- package/types/cms-overlay.d.ts +13 -6
- package/types/cms-overlay.js +6 -22
- package/types/cms-plugins.d.ts +20 -3
- package/types/cms.d.ts +10 -0
- 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 +9 -3
- package/types/link-preview.d.ts +19 -0
- package/types/link-preview.js +19 -0
- package/types/record-provider.d.ts +22 -1
- package/types/signals.d.ts +2 -0
- package/types/signals.js +2 -0
- package/types/site-theme.d.ts +27 -0
- package/types/table-embed.d.ts +48 -0
- package/types/table-embed.js +1 -0
- package/types/table-widget.d.ts +29 -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 +3 -1
- package/types.d.ts +2 -1
- package/types.js +1 -1
- /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
|
@@ -218,6 +218,25 @@ export function findPhiBuilderPageKeyFromStoragePath(area, path, pages) {
|
|
|
218
218
|
};
|
|
219
219
|
return visit(pages);
|
|
220
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* The key of the Module Page a preset identity names, wherever its path stands now.
|
|
223
|
+
*
|
|
224
|
+
* A Module Page is stored and addressed by `ownerModuleId` + `presetKey`, never by path: a revision scope
|
|
225
|
+
* of one carries no path at all, so looking it up by path finds nothing.
|
|
226
|
+
*/
|
|
227
|
+
export function findPhiBuilderPageKeyFromPresetSource(source, pages) {
|
|
228
|
+
for (const node of pages) {
|
|
229
|
+
if (node.sourcePreset?.ownerModuleId === source.ownerModuleId &&
|
|
230
|
+
node.sourcePreset.presetKey === source.presetKey) {
|
|
231
|
+
return node.key;
|
|
232
|
+
}
|
|
233
|
+
const childKey = node.children ? findPhiBuilderPageKeyFromPresetSource(source, node.children) : null;
|
|
234
|
+
if (childKey) {
|
|
235
|
+
return childKey;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
221
240
|
export function resolvePhiBuilderPageKeyFromCatalogPath(area, path, pages) {
|
|
222
241
|
const normalizedPath = normalizePhiBuilderCmsCatalogPath(path);
|
|
223
242
|
const visit = (nodes) => {
|
|
@@ -67,16 +67,16 @@ export type PhiCmsPresetOverlayInput = {
|
|
|
67
67
|
* What it decides is what differs between dialogs: its ids, its title and wiring, what extra the body
|
|
68
68
|
* Layout carries (a form's label column, say), and its buttons. How the body and the actions look is the
|
|
69
69
|
* one answer every dialog shares (`helpers/cms-dialog.ts`), so it is not an input. Nor is the width, as
|
|
70
|
-
* long as the dialog can see the Form it holds: given `body.form`,
|
|
71
|
-
* (`resolvePhiDialogFormWidth`); given none, `PHI_DIALOG_WIDTH`. A
|
|
72
|
-
* own, for a table or an editor that needs more.
|
|
70
|
+
* long as the dialog can see the Form it holds: given `body.form`, its `size` takes the width that Form
|
|
71
|
+
* needs (`resolvePhiDialogFormWidth`); given none, `PHI_DIALOG_WIDTH`. A `size` in `config` is the
|
|
72
|
+
* caller's own, for a table or an editor that needs more, and replaces the pair whole.
|
|
73
73
|
*/
|
|
74
74
|
export type PhiCmsPresetDialogInput = {
|
|
75
75
|
id: PhiCmsInstanceId;
|
|
76
76
|
bodyLayoutNodeId: PhiCmsInstanceId;
|
|
77
77
|
sortOrder: number;
|
|
78
78
|
label: string | null;
|
|
79
|
-
/** The Overlay's config: title, mount and close policy, open action, routes. `
|
|
79
|
+
/** The Overlay's config: title, mount and close policy, open action, routes. `size` follows `body.form`. */
|
|
80
80
|
config: Record<string, unknown>;
|
|
81
81
|
headerLayoutNodeId?: PhiCmsInstanceId | null;
|
|
82
82
|
/**
|
|
@@ -82,7 +82,7 @@ function createPhiCmsPresetNodeSet(defaults) {
|
|
|
82
82
|
config: { ...input.body?.config, ...PHI_DIALOG_BODY_CONFIG },
|
|
83
83
|
});
|
|
84
84
|
const form = input.body?.form;
|
|
85
|
-
const config = { width: form ? resolvePhiDialogFormWidth(form.descriptor) : PHI_DIALOG_WIDTH, ...input.config };
|
|
85
|
+
const config = { size: { width: form ? resolvePhiDialogFormWidth(form.descriptor) : PHI_DIALOG_WIDTH }, ...input.config };
|
|
86
86
|
const commands = input.commands;
|
|
87
87
|
if (!commands) {
|
|
88
88
|
return {
|
|
@@ -32,5 +32,5 @@ export type PhiCmsRegionOwnership = "shell" | "page";
|
|
|
32
32
|
* know is not a placement anybody chose -- refusing it would hide Widgets over a typo.
|
|
33
33
|
*/
|
|
34
34
|
export declare function phiCmsRegionAcceptsWidget(regionKey: string | null | undefined, required: PhiCmsRegionOwnership | null | undefined): boolean;
|
|
35
|
-
export declare function resolvePhiCmsRegionType(regionKey: string | null | undefined): 11 | 10 | 12 |
|
|
35
|
+
export declare function resolvePhiCmsRegionType(regionKey: string | null | undefined): 11 | 10 | 12 | 40 | 50 | 20 | 21 | 25 | 30 | 39 | 41;
|
|
36
36
|
export declare function resolvePhiCmsRegionKey(regionType: number | null | undefined): "content" | "header_top" | "header_main" | "header_bottom" | "sider_left" | "sider_right" | "hero" | "footer_top" | "footer_main" | "footer_bottom" | "drawer_right" | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PhiCountryCode } from "../constants/countries";
|
|
2
|
+
export type PhiCountryOption = {
|
|
3
|
+
value: PhiCountryCode;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Every ISO 3166-1 country as an option named in the reader's language (`Intl.DisplayNames`, type
|
|
8
|
+
* `region`), sorted as that language sorts. A code the runtime has no name for is shown as the code.
|
|
9
|
+
* The locale is the page's (`usePhiIntlLocale`), never the browser's, so the server and the browser draw
|
|
10
|
+
* the same list.
|
|
11
|
+
*/
|
|
12
|
+
export declare function listPhiCountryOptions(locale: string): PhiCountryOption[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PHI_ISO_3166_ALPHA2_CODES } from "../constants/countries";
|
|
2
|
+
/**
|
|
3
|
+
* Every ISO 3166-1 country as an option named in the reader's language (`Intl.DisplayNames`, type
|
|
4
|
+
* `region`), sorted as that language sorts. A code the runtime has no name for is shown as the code.
|
|
5
|
+
* The locale is the page's (`usePhiIntlLocale`), never the browser's, so the server and the browser draw
|
|
6
|
+
* the same list.
|
|
7
|
+
*/
|
|
8
|
+
export function listPhiCountryOptions(locale) {
|
|
9
|
+
const names = new Intl.DisplayNames([locale], { type: "region", fallback: "code" });
|
|
10
|
+
const collator = new Intl.Collator(locale);
|
|
11
|
+
return PHI_ISO_3166_ALPHA2_CODES
|
|
12
|
+
.map((code) => ({ value: code, label: names.of(code) ?? code }))
|
|
13
|
+
.sort((left, right) => collator.compare(left.label, right.label));
|
|
14
|
+
}
|
|
@@ -3,6 +3,28 @@ import type { PhiCmsAreaKey } from "../constants/cms-areas";
|
|
|
3
3
|
import { type PhiAreaMeta } from "./cms-area-config";
|
|
4
4
|
import type { PhiSignetHead } from "./phi-signet-head";
|
|
5
5
|
import { type PhiPublicPageAddress } from "./phi-seo";
|
|
6
|
+
/** The picture of a link preview, resolved: its absolute address, its exact size and what it shows. */
|
|
7
|
+
export type PhiLinkPreviewImage = {
|
|
8
|
+
url: string;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
alt: string;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* What a Public Page's link preview is built from, beside the Page's own title and description
|
|
16
|
+
* (NEXT_INTEGRATION.md, "Link previews").
|
|
17
|
+
*/
|
|
18
|
+
export type PhiLinkPreviewInput = {
|
|
19
|
+
/** The record's preview title and description, where the Page is about a record whose Provider marks them. */
|
|
20
|
+
recordTitle?: string | null;
|
|
21
|
+
recordDescription?: string | null;
|
|
22
|
+
/** The Theme's slogan, the description where the Page states none. */
|
|
23
|
+
slogan?: string | null;
|
|
24
|
+
image?: PhiLinkPreviewImage | null;
|
|
25
|
+
/** `brand.xAccount`; stated as `twitter:site` only where it is an X account name. */
|
|
26
|
+
xAccount?: string | null;
|
|
27
|
+
};
|
|
6
28
|
export type PhiMetadataScope = {
|
|
7
29
|
title?: string | null;
|
|
8
30
|
description?: string | null;
|
|
@@ -49,7 +71,7 @@ export declare function buildPhiRootMetadata(options?: PhiRootMetadataInput): Me
|
|
|
49
71
|
* be indexed, because naming the preferred address of a Page that asks to stay out says nothing a
|
|
50
72
|
* search engine can use, and an hreflang set pointing at it contradicts the sitemap that leaves it out.
|
|
51
73
|
*/
|
|
52
|
-
export declare function buildPhiAreaPageMetadata({ area, meta, siteName, pageTitle, pageDescription, pageNoindex, publicAddress, }: {
|
|
74
|
+
export declare function buildPhiAreaPageMetadata({ area, meta, siteName, pageTitle, pageDescription, pageNoindex, publicAddress, linkPreview, }: {
|
|
53
75
|
area: PhiCmsAreaKey;
|
|
54
76
|
meta: PhiAreaMeta | null | undefined;
|
|
55
77
|
siteName?: string | null;
|
|
@@ -58,4 +80,6 @@ export declare function buildPhiAreaPageMetadata({ area, meta, siteName, pageTit
|
|
|
58
80
|
pageNoindex?: boolean | null;
|
|
59
81
|
/** Where this Page lives. Only Public has such an address; elsewhere it is ignored. */
|
|
60
82
|
publicAddress?: PhiPublicPageAddress | null;
|
|
83
|
+
/** What a link preview is built from; stated only for a Public Page with an address. */
|
|
84
|
+
linkPreview?: PhiLinkPreviewInput | null;
|
|
61
85
|
}): Metadata;
|
package/helpers/phi-metadata.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { PHI_AREA_META_PUBLIC_DEFAULTS, PHI_AREA_TITLE_TEMPLATE_PLACEHOLDER, } from "./cms-area-config";
|
|
2
2
|
import { buildPhiPublicPageAlternates } from "./phi-seo";
|
|
3
|
+
import { readPhiXAccount } from "../types/link-preview";
|
|
4
|
+
import { resolvePhiSiteDescription } from "./phi-site-description";
|
|
5
|
+
/** A Site locale as Open Graph spells it: `pt-BR` is `pt_BR`. */
|
|
6
|
+
function toPhiOpenGraphLocale(locale) {
|
|
7
|
+
return locale.replaceAll("-", "_");
|
|
8
|
+
}
|
|
3
9
|
function resolveFirstText(...values) {
|
|
4
10
|
for (const value of values) {
|
|
5
11
|
const trimmed = value?.trim();
|
|
@@ -92,7 +98,7 @@ export function buildPhiRootMetadata(options = {}) {
|
|
|
92
98
|
* be indexed, because naming the preferred address of a Page that asks to stay out says nothing a
|
|
93
99
|
* search engine can use, and an hreflang set pointing at it contradicts the sitemap that leaves it out.
|
|
94
100
|
*/
|
|
95
|
-
export function buildPhiAreaPageMetadata({ area, meta, siteName, pageTitle, pageDescription, pageNoindex, publicAddress, }) {
|
|
101
|
+
export function buildPhiAreaPageMetadata({ area, meta, siteName, pageTitle, pageDescription, pageNoindex, publicAddress, linkPreview, }) {
|
|
96
102
|
const resolvedSiteName = resolveFirstText(siteName);
|
|
97
103
|
const resolvedPageTitle = resolveFirstText(pageTitle);
|
|
98
104
|
const template = resolveFirstText(meta?.titleTemplate);
|
|
@@ -114,10 +120,56 @@ export function buildPhiAreaPageMetadata({ area, meta, siteName, pageTitle, page
|
|
|
114
120
|
&& (meta?.index ?? PHI_AREA_META_PUBLIC_DEFAULTS.index)
|
|
115
121
|
&& pageNoindex !== true;
|
|
116
122
|
const alternates = indexable && publicAddress ? buildPhiPublicPageAlternates(publicAddress) : null;
|
|
123
|
+
const preview = area === "public" && publicAddress && linkPreview
|
|
124
|
+
? buildPhiLinkPreviewMetadata({
|
|
125
|
+
input: linkPreview,
|
|
126
|
+
address: publicAddress,
|
|
127
|
+
siteName: resolvedSiteName,
|
|
128
|
+
title: resolveFirstText(resolvedPageTitle, fallbackTitle),
|
|
129
|
+
description,
|
|
130
|
+
})
|
|
131
|
+
: null;
|
|
117
132
|
return {
|
|
118
133
|
...(title ? { title: { absolute: title } } : {}),
|
|
119
134
|
...(description ? { description } : {}),
|
|
120
135
|
...(indexable ? {} : { robots: { index: false, follow: false } }),
|
|
121
136
|
...(alternates ? { alternates: { canonical: alternates.canonical, languages: alternates.languages } } : {}),
|
|
137
|
+
...(preview ?? {}),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The Open Graph and X tags of one Public Page (NEXT_INTEGRATION.md, "Link previews").
|
|
142
|
+
*
|
|
143
|
+
* Said of every Public Page, indexable or not: a link is shared whether or not a search engine may file
|
|
144
|
+
* it. The title is the Page's own, without the template the tab title wears -- the preview names the Site
|
|
145
|
+
* beside it as `og:site_name` -- and a record the Page is about may answer title and description first.
|
|
146
|
+
* The description falls back as the Root's does: the Theme's slogan, then the starter's placeholder. X
|
|
147
|
+
* reads the Open Graph tags; what this states for it is the card, large with a picture, and the Site's
|
|
148
|
+
* account where the Theme names one. Next copies title, description and picture into `twitter:*` itself.
|
|
149
|
+
*/
|
|
150
|
+
function buildPhiLinkPreviewMetadata({ input, address, siteName, title, description, }) {
|
|
151
|
+
const url = buildPhiPublicPageAlternates(address)?.canonical;
|
|
152
|
+
const image = input.image ?? null;
|
|
153
|
+
const xAccount = readPhiXAccount(input.xAccount);
|
|
154
|
+
const previewTitle = resolveFirstText(input.recordTitle, title, siteName);
|
|
155
|
+
return {
|
|
156
|
+
openGraph: {
|
|
157
|
+
type: "website",
|
|
158
|
+
...(siteName ? { siteName } : {}),
|
|
159
|
+
...(previewTitle ? { title: previewTitle } : {}),
|
|
160
|
+
description: resolveFirstText(input.recordDescription, description) ?? resolvePhiSiteDescription(input.slogan),
|
|
161
|
+
...(url ? { url } : {}),
|
|
162
|
+
locale: toPhiOpenGraphLocale(address.locale),
|
|
163
|
+
alternateLocale: address.availableLocales
|
|
164
|
+
.filter((code) => code !== address.locale)
|
|
165
|
+
.map(toPhiOpenGraphLocale),
|
|
166
|
+
...(image
|
|
167
|
+
? { images: [{ url: image.url, width: image.width, height: image.height, alt: image.alt, type: image.type }] }
|
|
168
|
+
: {}),
|
|
169
|
+
},
|
|
170
|
+
twitter: {
|
|
171
|
+
card: image ? "summary_large_image" : "summary",
|
|
172
|
+
...(xAccount ? { site: xAccount } : {}),
|
|
173
|
+
},
|
|
122
174
|
};
|
|
123
175
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the head says of a Site that has said nothing: neither the Page's description nor the Theme's
|
|
3
|
+
* slogan. Worded as the placeholder it is, so a link shared before anybody replaced it tells the operator
|
|
4
|
+
* where to.
|
|
5
|
+
*
|
|
6
|
+
* A file of its own, apart from `phi-metadata.ts`, because the Theme workspace's link card shows the same
|
|
7
|
+
* words in the browser and the head builder would bring the whole route metadata along with them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PHI_DEFAULT_SITE_DESCRIPTION = "Default description of the phis starter. Set your own in the Page meta or as the Theme's slogan.";
|
|
10
|
+
/** The Site's description: the Theme's slogan, else the starter's placeholder. */
|
|
11
|
+
export declare function resolvePhiSiteDescription(slogan: string | null | undefined): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the head says of a Site that has said nothing: neither the Page's description nor the Theme's
|
|
3
|
+
* slogan. Worded as the placeholder it is, so a link shared before anybody replaced it tells the operator
|
|
4
|
+
* where to.
|
|
5
|
+
*
|
|
6
|
+
* A file of its own, apart from `phi-metadata.ts`, because the Theme workspace's link card shows the same
|
|
7
|
+
* words in the browser and the head builder would bring the whole route metadata along with them.
|
|
8
|
+
*/
|
|
9
|
+
export const PHI_DEFAULT_SITE_DESCRIPTION = "Default description of the phis starter. Set your own in the Page meta or as the Theme's slogan.";
|
|
10
|
+
/** The Site's description: the Theme's slogan, else the starter's placeholder. */
|
|
11
|
+
export function resolvePhiSiteDescription(slogan) {
|
|
12
|
+
return slogan?.trim() || PHI_DEFAULT_SITE_DESCRIPTION;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PhiFormDescriptor } from "@phis/contracts/forms";
|
|
2
|
+
import type { PhiPresetTreeContractFinding } from "./preset-tree-contract-check";
|
|
3
|
+
/**
|
|
4
|
+
* Every Form a package ships, held to the rules its fields' Controls read them by
|
|
5
|
+
* (`checkPhiFormDescriptorFields`: a money field's currency and `currencyField`, a flags field's bits),
|
|
6
|
+
* as findings whose `node` is the Form id (THIRD_PARTY_MODULES.md, "Checking a Page preset").
|
|
7
|
+
*
|
|
8
|
+
* Verify-time only, from `@phis/ui/module/page-check`: a package runs it in its own tests over its Form
|
|
9
|
+
* definitions (`definePhiRuntimeModuleForm`), as phis-ui runs it over its own, and a Site never loads it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function checkPhiPresetForms(forms: Iterable<{
|
|
12
|
+
formId: string;
|
|
13
|
+
descriptor: Pick<PhiFormDescriptor, "fields">;
|
|
14
|
+
}>): PhiPresetTreeContractFinding[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { checkPhiFormDescriptorFields } from "../components/forms/form-descriptor-field-check";
|
|
2
|
+
/**
|
|
3
|
+
* Every Form a package ships, held to the rules its fields' Controls read them by
|
|
4
|
+
* (`checkPhiFormDescriptorFields`: a money field's currency and `currencyField`, a flags field's bits),
|
|
5
|
+
* as findings whose `node` is the Form id (THIRD_PARTY_MODULES.md, "Checking a Page preset").
|
|
6
|
+
*
|
|
7
|
+
* Verify-time only, from `@phis/ui/module/page-check`: a package runs it in its own tests over its Form
|
|
8
|
+
* definitions (`definePhiRuntimeModuleForm`), as phis-ui runs it over its own, and a Site never loads it.
|
|
9
|
+
*/
|
|
10
|
+
export function checkPhiPresetForms(forms) {
|
|
11
|
+
return [...forms].flatMap((form) => checkPhiFormDescriptorFields(form.descriptor).map((message) => ({ node: form.formId, message })));
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PhiResolvedCmsPageTree } from "../types/cms";
|
|
2
|
+
import type { PhiPresetTreeContractFinding } from "./preset-tree-contract-check";
|
|
3
|
+
import type { PhiRuntimeModuleDefinition } from "../types/cms-plugins";
|
|
4
|
+
import { type PhiBindingCheckProvider } from "./widget-binding-check";
|
|
5
|
+
/**
|
|
6
|
+
* Every bound Widget of a preset tree -- Table, Tree and record Widget -- read against the resource its
|
|
7
|
+
* Provider declares (THIRD_PARTY_MODULES.md, "Checking a Page preset"), by the same check the Builder's
|
|
8
|
+
* save runs (`checkPhiWidgetBinding`): a Table's columns, filters, sorting, counted footer and actions
|
|
9
|
+
* (`validatePhiTableWidgetBinding`) and every icon its actions and binding tools name
|
|
10
|
+
* (`isPhiIconNameKnown`), a Tree's node fields, tools, actions and drag and drop
|
|
11
|
+
* (`validatePhiTreeWidgetBinding`), a record Widget's actions (`validatePhiRecordWidgetBinding`). And one
|
|
12
|
+
* rule of the house: a Table that shows its header row ends in its footer (`presentation.footer`, the
|
|
13
|
+
* count or paging line), and a Table without a header -- one that only lays out rows or aligns columns --
|
|
14
|
+
* needs none (TABLES.md, "Footer and summary"); the rare Table with a header and nothing to count says why
|
|
15
|
+
* in `footerOmitted`. New Pages kept leaving the footer out, and nothing but a reader missing the count
|
|
16
|
+
* noticed.
|
|
17
|
+
*
|
|
18
|
+
* Nothing in the browser checks a binding (owner, 2026-11-24): a live Widget trusts the config it is
|
|
19
|
+
* handed, so a binding that does not hold is a Widget that draws the wrong thing, and this check is where
|
|
20
|
+
* it is caught. A package runs it in its own tests over every tree its presets build, beside
|
|
21
|
+
* `checkPhiPresetTreeContract`, with every data Provider it ships (`dataProviders`: its Module's Provider
|
|
22
|
+
* descriptors, Table and Tree alike). A Widget on a Provider not handed over is not judged.
|
|
23
|
+
*
|
|
24
|
+
* Verify-time only, and apart from the contract check on purpose: that one also runs while a Site serves
|
|
25
|
+
* a Page, which must not pay for checks that belong where the config is made.
|
|
26
|
+
*/
|
|
27
|
+
export declare function checkPhiPresetTables(tree: PhiResolvedCmsPageTree, options: {
|
|
28
|
+
dataProviders: Iterable<PhiBindingCheckProvider>;
|
|
29
|
+
}): PhiPresetTreeContractFinding[];
|
|
30
|
+
/**
|
|
31
|
+
* Every Table a Module offers to Markdown (TABLES.md, "Tables in Markdown"), checked as a Preset's Table is
|
|
32
|
+
* above: its columns against its resource, and what makes it an embed -- no editor; pinned filters and
|
|
33
|
+
* parameters naming a filter field or binding field of the resource, with values a parameter can check;
|
|
34
|
+
* `maxRows` on a resource that pages; each required binding field fixed or settable. The catalog refuses
|
|
35
|
+
* the key, Provider, resource and access policy itself; this half needs the Table's own code, so it runs
|
|
36
|
+
* where Preset Tables are checked: a package's tests, and `validate-module-descriptors` here.
|
|
37
|
+
*/
|
|
38
|
+
export declare function checkPhiEmbeddableTables(definition: Pick<PhiRuntimeModuleDefinition, "embeddableTables" | "dataProviders">): PhiPresetTreeContractFinding[];
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { PhiCmsWidgetType } from "../constants/cms-widget-types";
|
|
2
|
+
import { validatePhiTableWidgetBinding } from "./table-widget-binding";
|
|
3
|
+
import { checkPhiWidgetBinding } from "./widget-binding-check";
|
|
4
|
+
/**
|
|
5
|
+
* Every bound Widget of a preset tree -- Table, Tree and record Widget -- read against the resource its
|
|
6
|
+
* Provider declares (THIRD_PARTY_MODULES.md, "Checking a Page preset"), by the same check the Builder's
|
|
7
|
+
* save runs (`checkPhiWidgetBinding`): a Table's columns, filters, sorting, counted footer and actions
|
|
8
|
+
* (`validatePhiTableWidgetBinding`) and every icon its actions and binding tools name
|
|
9
|
+
* (`isPhiIconNameKnown`), a Tree's node fields, tools, actions and drag and drop
|
|
10
|
+
* (`validatePhiTreeWidgetBinding`), a record Widget's actions (`validatePhiRecordWidgetBinding`). And one
|
|
11
|
+
* rule of the house: a Table that shows its header row ends in its footer (`presentation.footer`, the
|
|
12
|
+
* count or paging line), and a Table without a header -- one that only lays out rows or aligns columns --
|
|
13
|
+
* needs none (TABLES.md, "Footer and summary"); the rare Table with a header and nothing to count says why
|
|
14
|
+
* in `footerOmitted`. New Pages kept leaving the footer out, and nothing but a reader missing the count
|
|
15
|
+
* noticed.
|
|
16
|
+
*
|
|
17
|
+
* Nothing in the browser checks a binding (owner, 2026-11-24): a live Widget trusts the config it is
|
|
18
|
+
* handed, so a binding that does not hold is a Widget that draws the wrong thing, and this check is where
|
|
19
|
+
* it is caught. A package runs it in its own tests over every tree its presets build, beside
|
|
20
|
+
* `checkPhiPresetTreeContract`, with every data Provider it ships (`dataProviders`: its Module's Provider
|
|
21
|
+
* descriptors, Table and Tree alike). A Widget on a Provider not handed over is not judged.
|
|
22
|
+
*
|
|
23
|
+
* Verify-time only, and apart from the contract check on purpose: that one also runs while a Site serves
|
|
24
|
+
* a Page, which must not pay for checks that belong where the config is made.
|
|
25
|
+
*/
|
|
26
|
+
export function checkPhiPresetTables(tree, options) {
|
|
27
|
+
const findings = [];
|
|
28
|
+
const providers = new Map([...options.dataProviders].map((provider) => [provider.key, provider]));
|
|
29
|
+
for (const widget of tree.contentWidgets) {
|
|
30
|
+
// The config as the preset wrote it, which is what the Widget receives: a preset states the whole shape.
|
|
31
|
+
const bindingFindings = checkPhiWidgetBinding(widget.widgetType, widget.config, providers);
|
|
32
|
+
for (const message of bindingFindings)
|
|
33
|
+
findings.push({ node: widget.id, message });
|
|
34
|
+
if (widget.widgetType !== PhiCmsWidgetType.Table)
|
|
35
|
+
continue;
|
|
36
|
+
const config = widget.config;
|
|
37
|
+
const provider = config.source?.providerKey ? providers.get(config.source.providerKey) : undefined;
|
|
38
|
+
const declared = provider?.resources?.some((candidate) => candidate.resourceKey === config.source?.resourceKey);
|
|
39
|
+
if (!declared)
|
|
40
|
+
continue;
|
|
41
|
+
const footerOmitted = config.presentation?.footerOmitted?.trim();
|
|
42
|
+
if (config.presentation?.footer && footerOmitted) {
|
|
43
|
+
findings.push({ node: widget.id, message: "Table states a footer and `footerOmitted` beside it; a reason for leaving the footer out is for a Table without one." });
|
|
44
|
+
}
|
|
45
|
+
else if (config.presentation?.header !== false && !config.presentation?.footer && !footerOmitted) {
|
|
46
|
+
findings.push({ node: widget.id, message: "Table shows a header and no footer: a Table with a header row ends in `presentation.footer` (TABLES.md, \"Footer and summary\"); one that only lays out rows says `header: false`, and one with a header and nothing to count says why in `footerOmitted`." });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return findings;
|
|
50
|
+
}
|
|
51
|
+
const hasStaticOptions = (field) => (field.options?.length ?? 0) > 0 && !field.optionsProvider;
|
|
52
|
+
/**
|
|
53
|
+
* Every Table a Module offers to Markdown (TABLES.md, "Tables in Markdown"), checked as a Preset's Table is
|
|
54
|
+
* above: its columns against its resource, and what makes it an embed -- no editor; pinned filters and
|
|
55
|
+
* parameters naming a filter field or binding field of the resource, with values a parameter can check;
|
|
56
|
+
* `maxRows` on a resource that pages; each required binding field fixed or settable. The catalog refuses
|
|
57
|
+
* the key, Provider, resource and access policy itself; this half needs the Table's own code, so it runs
|
|
58
|
+
* where Preset Tables are checked: a package's tests, and `validate-module-descriptors` here.
|
|
59
|
+
*/
|
|
60
|
+
export function checkPhiEmbeddableTables(definition) {
|
|
61
|
+
const findings = [];
|
|
62
|
+
for (const embed of definition.embeddableTables ?? []) {
|
|
63
|
+
const report = (message) => findings.push({ node: embed.key, message });
|
|
64
|
+
const provider = definition.dataProviders?.find((candidate) => candidate.key === embed.source.providerKey);
|
|
65
|
+
const resource = provider?.kind === "table"
|
|
66
|
+
? provider.resources.find((candidate) => candidate.resourceKey === embed.source.resourceKey)
|
|
67
|
+
: undefined;
|
|
68
|
+
if (!resource) {
|
|
69
|
+
report("reads a resource no table Provider of this Module declares.");
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const { query, bindingFields = [], fields } = resource;
|
|
73
|
+
const pager = embed.maxRows || query.pagination === "none" ? { pagination: { enabled: false } } : {};
|
|
74
|
+
const config = { presentation: embed.presentation, features: pager, source: embed.source };
|
|
75
|
+
validatePhiTableWidgetBinding(config, resource).forEach(report);
|
|
76
|
+
if (!embed.title?.trim())
|
|
77
|
+
report("needs a title.");
|
|
78
|
+
if (embed.presentation.columns.some((column) => column.editor))
|
|
79
|
+
report("has a column editor; an embedded Table is read-only.");
|
|
80
|
+
const filterFields = new Set(query.filterFields ?? []);
|
|
81
|
+
for (const key of Object.keys(embed.fixedFilters ?? {})) {
|
|
82
|
+
if (!filterFields.has(key))
|
|
83
|
+
report(`pins "${key}", which is no filter field of the resource.`);
|
|
84
|
+
}
|
|
85
|
+
if (embed.maxRows !== undefined && (!Number.isInteger(embed.maxRows) || embed.maxRows < 1 || embed.maxRows > 100)) {
|
|
86
|
+
report("needs maxRows from 1 to 100.");
|
|
87
|
+
}
|
|
88
|
+
else if (embed.maxRows !== undefined && query.pagination !== "offset" && query.pagination !== "cursor") {
|
|
89
|
+
report("has maxRows, which needs a resource that pages.");
|
|
90
|
+
}
|
|
91
|
+
const params = Object.entries(embed.params ?? {});
|
|
92
|
+
const fixed = (key) => Object.hasOwn(embed.source.params ?? {}, key);
|
|
93
|
+
for (const field of bindingFields) {
|
|
94
|
+
if (field.required && field.defaultValue === undefined && !fixed(field.key) &&
|
|
95
|
+
!params.some(([, param]) => "binding" in param && param.binding === field.key)) {
|
|
96
|
+
report(`leaves the required binding field "${field.key}" open.`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const targets = new Set();
|
|
100
|
+
for (const [name, param] of params) {
|
|
101
|
+
const key = "binding" in param ? param.binding : param.filter;
|
|
102
|
+
const field = "binding" in param ? bindingFields.find((candidate) => candidate.key === key) : fields.find((candidate) => candidate.key === key);
|
|
103
|
+
const problem = !/^[A-Za-z][A-Za-z0-9_-]*$/u.test(name) ? "is no parameter name"
|
|
104
|
+
: targets.has(`${"binding" in param}:${key}`) ? "sets what another parameter sets"
|
|
105
|
+
: !field || ("filter" in param && !filterFields.has(key)) ? `names "${key}", which the resource does not declare for this`
|
|
106
|
+
: "binding" in param ? fixed(key) ? `binds "${key}", which the source fixes` : null
|
|
107
|
+
: Object.hasOwn(embed.fixedFilters ?? {}, key) ? `filters by "${key}", which a fixed filter pins`
|
|
108
|
+
: !["string", "number", "boolean", "enum"].includes(field.type) ? `filters by a ${field.type} field`
|
|
109
|
+
: null;
|
|
110
|
+
targets.add(`${"binding" in param}:${key}`);
|
|
111
|
+
if (problem)
|
|
112
|
+
report(`parameter "${name}" ${problem}.`);
|
|
113
|
+
else if (field?.type === "enum" && !hasStaticOptions(field))
|
|
114
|
+
report(`parameter "${name}" needs choices it can check, not a Provider's.`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return findings;
|
|
118
|
+
}
|
|
@@ -12,7 +12,10 @@ import type { PhiResolvedCmsPageTree } from "../types/cms";
|
|
|
12
12
|
* own package does not run it: every word in its Pages is the Site's, which is what no marker means.
|
|
13
13
|
*
|
|
14
14
|
* It reads the config as stated, by the field names alone (`helpers/config-text-fields.ts`), so it needs
|
|
15
|
-
* no Widget definition: a text under a text's name, at the top
|
|
15
|
+
* no Widget definition: a text under a text's name, at the top, inside a list's entries or inside a nested
|
|
16
|
+
* object -- a Table's `presentation.columns[].title`, `features.filters[].label` and
|
|
17
|
+
* `presentation.emptyState.title` are words as much as a Button's label. A Table whose texts come from the
|
|
18
|
+
* Module's Label Set, already in the reader's language, says so with `NoTranslate` on its node.
|
|
16
19
|
*/
|
|
17
20
|
export type PhiPresetTextSourceFinding = {
|
|
18
21
|
/** The node's label, or its id where it has none. */
|
|
@@ -3,7 +3,7 @@ import { readPhiTextSource } from "./text-source";
|
|
|
3
3
|
import { PhiCmsFlags } from "../constants/phi-cms";
|
|
4
4
|
import { hasPhiFlag } from "./flags";
|
|
5
5
|
function findTextKey(value, depth = 0) {
|
|
6
|
-
if (depth >
|
|
6
|
+
if (depth > 6 || value == null || typeof value !== "object")
|
|
7
7
|
return null;
|
|
8
8
|
if (Array.isArray(value)) {
|
|
9
9
|
for (const item of value) {
|
|
@@ -21,6 +21,11 @@ function findTextKey(value, depth = 0) {
|
|
|
21
21
|
if (found)
|
|
22
22
|
return `${key}[].${found}`;
|
|
23
23
|
}
|
|
24
|
+
else if (entry !== null && typeof entry === "object") {
|
|
25
|
+
const found = findTextKey(entry, depth + 1);
|
|
26
|
+
if (found)
|
|
27
|
+
return `${key}.${found}`;
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
return null;
|
|
26
31
|
}
|
|
@@ -10,8 +10,9 @@ import type { PhiCmsPageNode, PhiResolvedCmsPageTree } from "../types/cms";
|
|
|
10
10
|
*
|
|
11
11
|
* The rules: every node a preset instance id, none twice, every parent, Region root, Overlay root and Page
|
|
12
12
|
* root resolved; the base page layout node only as the canonical scaffold; an actions Footer the canonical
|
|
13
|
-
* Flex preset;
|
|
14
|
-
*
|
|
13
|
+
* Flex preset; an Overlay's geometry the block's pairs, never `width` or one bare length; a modal's body
|
|
14
|
+
* and actions the dialog's (`helpers/cms-dialog.ts`), and a modal at the default `PHI_DIALOG_WIDTH` not
|
|
15
|
+
* holding only Forms of one column; a Form's or a record Widget's title from its
|
|
15
16
|
* record read, sent, and heard where it goes. The findings come in the order the compiler used to throw them, so its first is the
|
|
16
17
|
* error it always gave.
|
|
17
18
|
*
|
|
@@ -4,6 +4,7 @@ import { PhiCmsWidgetType } from "../constants/cms-widget-types";
|
|
|
4
4
|
import { isPhiCmsInstanceId, readPhiCmsInstanceIdDescriptor } from "../types/cms-instance-id";
|
|
5
5
|
import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH, isPhiFormSingleColumn, } from "./cms-dialog";
|
|
6
6
|
import { resolvePhiLayoutCreationPreset } from "./cms-layout-defaults";
|
|
7
|
+
import { isPhiRecord } from "./is-record";
|
|
7
8
|
import { PHI_FORM_RECORD_TITLE_CAPABILITY, readPhiFormWidgetTitleFromRecord, } from "../components/forms/form-record-title";
|
|
8
9
|
import { readPhiRecordWidgetTitleFromRecord } from "./record-widget";
|
|
9
10
|
function stablePresetNodeJson(value) {
|
|
@@ -106,6 +107,7 @@ export function checkPhiPresetTreeContract(tree, options = {}) {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
for (const overlay of tree.overlays) {
|
|
110
|
+
checkOverlayGeometry(overlay, report);
|
|
109
111
|
if (overlay.overlayType !== "modal")
|
|
110
112
|
continue;
|
|
111
113
|
const body = layoutsById.get(overlay.bodyLayoutNodeId);
|
|
@@ -182,14 +184,37 @@ function checkDialogCommands(overlayId, footerLayoutId, widgets, report) {
|
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
}
|
|
187
|
+
/** The keys an Overlay states its geometry in: the block's three pairs. */
|
|
188
|
+
const PHI_OVERLAY_GEOMETRY_KEYS = ["size", "minSize", "maxSize"];
|
|
189
|
+
/*
|
|
190
|
+
* An Overlay is sized like a block: `size`, `minSize` and `maxSize`, each a `{ width?, height? }` pair
|
|
191
|
+
* (OVERLAYS.md, "Presentation config"). The Modal's `width` and the Drawer's single length are gone, and
|
|
192
|
+
* nothing reads them -- so a preset still writing either would open a dialog at a width nobody chose,
|
|
193
|
+
* with nothing said. Refused instead, with the spelling that replaces it. A bare length is refused too,
|
|
194
|
+
* although the block reader takes it as a width: a Drawer at the top or bottom opens along its height,
|
|
195
|
+
* and a bare `size: 377` there is the old single length meaning the wrong axis.
|
|
196
|
+
*/
|
|
197
|
+
function checkOverlayGeometry(overlay, report) {
|
|
198
|
+
if (overlay.config.width !== undefined) {
|
|
199
|
+
report(overlay.id, `Preset Overlay "${overlay.id}" states \`width\`; an Overlay is sized like a block. ` +
|
|
200
|
+
"State `size: { width }` (a dialog: `size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN }`), and a viewport limit as `maxSize`.");
|
|
201
|
+
}
|
|
202
|
+
for (const key of PHI_OVERLAY_GEOMETRY_KEYS) {
|
|
203
|
+
const value = overlay.config[key];
|
|
204
|
+
if (value != null && !isPhiRecord(value)) {
|
|
205
|
+
report(overlay.id, `Preset Overlay "${overlay.id}" states \`${key}\` as one length; state the pair, \`${key}: { width }\` or \`${key}: { height }\`.`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
185
209
|
/*
|
|
186
210
|
* A dialog is as wide as its Form needs (`helpers/cms-dialog.ts`): one column takes
|
|
187
|
-
* `PHI_DIALOG_WIDTH_SINGLE_COLUMN`, two keep `PHI_DIALOG_WIDTH
|
|
188
|
-
* did not choose -- the default, holding nothing but
|
|
189
|
-
* caller that knows what else the body holds; a
|
|
211
|
+
* `PHI_DIALOG_WIDTH_SINGLE_COLUMN`, two keep `PHI_DIALOG_WIDTH`, either as the width of the Overlay's
|
|
212
|
+
* `size`. What is refused is the one width a Preset did not choose -- the default, holding nothing but
|
|
213
|
+
* Forms of one column. Any other width was stated, by a caller that knows what else the body holds; a
|
|
214
|
+
* Form the caller cannot see is not judged.
|
|
190
215
|
*/
|
|
191
216
|
function checkDialogWidth(overlay, tree, forms, report) {
|
|
192
|
-
if (stablePresetNodeJson(overlay.config.
|
|
217
|
+
if (stablePresetNodeJson(overlay.config.size) !== stablePresetNodeJson({ width: PHI_DIALOG_WIDTH }))
|
|
193
218
|
return;
|
|
194
219
|
const bodyLayoutIds = new Set([overlay.bodyLayoutNodeId]);
|
|
195
220
|
for (let grown = true; grown;) {
|
|
@@ -209,7 +234,7 @@ function checkDialogWidth(overlay, tree, forms, report) {
|
|
|
209
234
|
const descriptors = formIds.map((formId) => (typeof formId === "string" ? forms.get(formId) : undefined)?.descriptor);
|
|
210
235
|
if (descriptors.every((descriptor) => descriptor != null && isPhiFormSingleColumn(descriptor))) {
|
|
211
236
|
report(overlay.id, `Preset Overlay "${overlay.id}" holds the one-column Form "${String(formIds[0])}" at the full dialog width ` +
|
|
212
|
-
"(PHI_DIALOG_WIDTH). Hand the Form to `dialog` as `body.form`, or state `width: PHI_DIALOG_WIDTH_SINGLE_COLUMN`.");
|
|
237
|
+
"(PHI_DIALOG_WIDTH). Hand the Form to `dialog` as `body.form`, or state `size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN }`.");
|
|
213
238
|
}
|
|
214
239
|
}
|
|
215
240
|
function readRoutes(config, side) {
|
|
@@ -35,6 +35,13 @@ export type PhiPublicRoutePathCollision = {
|
|
|
35
35
|
/** The address contested: the assignment this Site already made, or the declared path. */
|
|
36
36
|
path: string;
|
|
37
37
|
heldBy: PhiPublicRouteAddressHolder;
|
|
38
|
+
/**
|
|
39
|
+
* How the two addresses meet: the same address, or one beneath the other -- a Page and a folder at once
|
|
40
|
+
* (`isPhiRouteAddressBeneath`, THIRD_PARTY_MODULES.md "Addresses and folders").
|
|
41
|
+
*/
|
|
42
|
+
relation: "same" | "beneath" | "above";
|
|
43
|
+
/** The holder's address: `path` itself, or the one above or beneath it. */
|
|
44
|
+
heldPath: string;
|
|
38
45
|
};
|
|
39
46
|
/**
|
|
40
47
|
* The address a route answers on: what this Site assigned it, or what it declared.
|
|
@@ -62,7 +69,8 @@ export declare function buildPhiPublicRouteAddressMap({ claims, activeModuleIds,
|
|
|
62
69
|
}[];
|
|
63
70
|
}): Map<string, PhiPublicRouteAddressHolder>;
|
|
64
71
|
/**
|
|
65
|
-
* The addresses a Module could not have if it were switched on now
|
|
72
|
+
* The addresses a Module could not have if it were switched on now: one another holder answers on, or one
|
|
73
|
+
* beneath or above another holder's -- a Site Page's or another Module's route.
|
|
66
74
|
*
|
|
67
75
|
* `/` is left out on purpose: it is an application for the Area root slot, not a route of the Module's
|
|
68
76
|
* own, and several applicants are a list to choose from rather than a conflict.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPhiRouteAddressBeneath } from "./route-address-check";
|
|
1
2
|
function buildPhiPublicRouteIdentity(ownerModuleId, presetKey) {
|
|
2
3
|
return `${ownerModuleId}/${presetKey}`;
|
|
3
4
|
}
|
|
@@ -38,7 +39,8 @@ export function buildPhiPublicRouteAddressMap({ claims, activeModuleIds, assignm
|
|
|
38
39
|
return addresses;
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
|
-
* The addresses a Module could not have if it were switched on now
|
|
42
|
+
* The addresses a Module could not have if it were switched on now: one another holder answers on, or one
|
|
43
|
+
* beneath or above another holder's -- a Site Page's or another Module's route.
|
|
42
44
|
*
|
|
43
45
|
* `/` is left out on purpose: it is an application for the Area root slot, not a route of the Module's
|
|
44
46
|
* own, and several applicants are a list to choose from rather than a conflict.
|
|
@@ -50,9 +52,27 @@ export function findPhiPublicRoutePathCollisions({ moduleId, claims, addresses,
|
|
|
50
52
|
continue;
|
|
51
53
|
}
|
|
52
54
|
const path = resolvePhiPublicRoutePath(claim, assignments);
|
|
55
|
+
const foreign = (holder) => !(holder.kind === "module" && holder.claim.ownerModuleId === moduleId);
|
|
53
56
|
const heldBy = addresses.get(path);
|
|
54
|
-
if (heldBy &&
|
|
55
|
-
collisions.push({ claim, path, heldBy });
|
|
57
|
+
if (heldBy && foreign(heldBy)) {
|
|
58
|
+
collisions.push({ claim, path, heldBy, relation: "same", heldPath: path });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
/*
|
|
62
|
+
* An address that is free can still lie beneath another one, or above it: a route assigned
|
|
63
|
+
* `/contracts/terms` under a Site Page `/contracts` makes that Page a folder, which equality alone
|
|
64
|
+
* never saw.
|
|
65
|
+
*/
|
|
66
|
+
for (const [heldPath, holder] of addresses) {
|
|
67
|
+
if (!foreign(holder))
|
|
68
|
+
continue;
|
|
69
|
+
const relation = isPhiRouteAddressBeneath(heldPath, path)
|
|
70
|
+
? "beneath"
|
|
71
|
+
: isPhiRouteAddressBeneath(path, heldPath) ? "above" : null;
|
|
72
|
+
if (relation) {
|
|
73
|
+
collisions.push({ claim, path, heldBy: holder, relation, heldPath });
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
56
76
|
}
|
|
57
77
|
}
|
|
58
78
|
return collisions;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
import { type PHI_RECORD_TEXT_FIELD_KINDS } from "../constants/record-field-kinds";
|
|
1
2
|
import type { PhiRuntimeModuleCatalogEntry } from "../types/cms-plugins";
|
|
2
3
|
import type { PhiRuntimeDataProviderKey } from "../types/runtime-data-provider";
|
|
3
4
|
import type { PhiRecordDeclaration, PhiRecordField, PhiRecordFieldKind, PhiRecordFieldValueByKind } from "../types/record-provider";
|
|
4
5
|
/** `value` as a field of `kind`, or `undefined` where it is not one. */
|
|
5
6
|
export declare function readPhiRecordFieldValue<K extends PhiRecordFieldKind>(kind: K, value: unknown): PhiRecordFieldValueByKind[K] | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* The kinds a line of text can show: a text as it is, a number, a date and an amount of money in the
|
|
8
|
-
* page's language.
|
|
9
|
-
*/
|
|
10
|
-
export declare const PHI_RECORD_TEXT_FIELD_KINDS: readonly ["text", "number", "date", "money"];
|
|
11
7
|
/**
|
|
12
8
|
* A text, number, date or money field as the words a page shows, written for `locale`; a date on the
|
|
13
9
|
* calendar of the Site's `timeZone`, as every other date the page shows (`formatPhiDate`).
|