@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
|
@@ -117,10 +117,14 @@ function resolveLayoutRegistryType(type) {
|
|
|
117
117
|
* A block that cannot be drawn, said to the person who can do something about it.
|
|
118
118
|
*
|
|
119
119
|
* In a workspace that is the author: the diagnostic sits in the block's own place, names the type and
|
|
120
|
-
* the Module, and the hole is visible where it has to be repaired. On a live page it is
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
120
|
+
* the Module, and the hole is visible where it has to be repaired. On a live page it is Staff, who see
|
|
121
|
+
* the same card without the notification (`PhiCmsRenderDiagnostic` with `live`): a config that slipped
|
|
122
|
+
* past the checks where configs are made, a renderer that failed, a node the tree does not hold is a
|
|
123
|
+
* failure nobody would see otherwise (owner, 2026-11-24). A Module switched off in the Area is not one
|
|
124
|
+
* -- its blocks leave with it on purpose -- and stays absent for everybody. A visitor sees nothing: they
|
|
125
|
+
* cannot switch a Module back on and have no business reading a Module id off a page, so the block is
|
|
126
|
+
* simply absent and the rest of the page stands. The warning is written either way, which is where an
|
|
127
|
+
* operator finds it.
|
|
124
128
|
*/
|
|
125
129
|
function renderCmsDiagnostic(issue, renderMode, error) {
|
|
126
130
|
logRuntimeEvent("warn", "cms.render.block_not_renderable", {
|
|
@@ -131,7 +135,9 @@ function renderCmsDiagnostic(issue, renderMode, error) {
|
|
|
131
135
|
error,
|
|
132
136
|
meta: { code: issue.code, detail: issue.detail ?? null, renderMode },
|
|
133
137
|
});
|
|
134
|
-
|
|
138
|
+
if (renderMode !== "live")
|
|
139
|
+
return _jsx(PhiCmsRenderDiagnostic, { issue: issue });
|
|
140
|
+
return issue.code === "missing-module" ? null : _jsx(PhiCmsRenderDiagnostic, { issue: issue, live: true });
|
|
135
141
|
}
|
|
136
142
|
/**
|
|
137
143
|
* A node whose condition reads a Module that could not be asked, said in the node's place.
|
|
@@ -551,6 +557,8 @@ function wrapPhiRenderedSlotChild(node, options) {
|
|
|
551
557
|
if (!isRenderableNode(node)) {
|
|
552
558
|
return node;
|
|
553
559
|
}
|
|
560
|
+
// On a live page a failed block's diagnostic is Staff's alone (`PhiCmsRenderDiagnostic`).
|
|
561
|
+
const live = readPhiRuntimeTreeRenderMode((options.config ?? {})) === "live";
|
|
554
562
|
if (isThenable(node)) {
|
|
555
563
|
/*
|
|
556
564
|
* A Widget that fails while rendering on the server fails alone.
|
|
@@ -562,9 +570,9 @@ function wrapPhiRenderedSlotChild(node, options) {
|
|
|
562
570
|
* which Widget it was. Caught here, where the rejection is, it becomes the same diagnostic the
|
|
563
571
|
* Client Boundary shows -- and everything else on the page still renders on the server.
|
|
564
572
|
*/
|
|
565
|
-
return node.then((resolvedNode) => wrapPhiRenderedSlotChild(resolvedNode, options), (error) => wrapPhiRenderedSlotChild(_jsx(PhiCmsRenderDiagnostic, { issue: buildPhiRenderFailureIssue(error, options) }), options));
|
|
573
|
+
return node.then((resolvedNode) => wrapPhiRenderedSlotChild(resolvedNode, options), (error) => wrapPhiRenderedSlotChild(_jsx(PhiCmsRenderDiagnostic, { issue: buildPhiRenderFailureIssue(error, options), live: live }), options));
|
|
566
574
|
}
|
|
567
|
-
const framed = (_jsx(PhiSlotChildFrame, { kind: options.kind, slotSizePolicy: options.slotSizePolicy, surfacePolicy: options.surfacePolicy, blockId: options.blockId, config: options.config, runtime: options.signalRuntime, signalScope: options.signalScope, signalParticipant: options.signalParticipant, children: _jsx(PhiCmsRenderErrorBoundary, { kind: options.kind, blockId: options.blockId, typeKey: options.typeKey, moduleId: options.moduleId, children: node }) }, options.key));
|
|
575
|
+
const framed = (_jsx(PhiSlotChildFrame, { kind: options.kind, slotSizePolicy: options.slotSizePolicy, surfacePolicy: options.surfacePolicy, blockId: options.blockId, config: options.config, runtime: options.signalRuntime, signalScope: options.signalScope, signalParticipant: options.signalParticipant, children: _jsx(PhiCmsRenderErrorBoundary, { kind: options.kind, blockId: options.blockId, typeKey: options.typeKey, moduleId: options.moduleId, live: live, children: node }) }, options.key));
|
|
568
576
|
/*
|
|
569
577
|
* The gate goes outside the slot frame, so a node that stays away takes its frame with it. Inside it,
|
|
570
578
|
* the frame would still be in the slot -- an empty box between two visible ones, which a Layout with
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { PhiCmsRenderIssue } from "../../types/cms-plugins";
|
|
2
|
-
|
|
2
|
+
/** `quiet` draws the card without the notification, for Staff reading a live page. */
|
|
3
|
+
export declare function PhiCmsRenderDiagnostic({ issue, quiet }: {
|
|
3
4
|
issue: PhiCmsRenderIssue;
|
|
5
|
+
quiet?: boolean;
|
|
4
6
|
}): import("react").JSX.Element;
|
|
@@ -36,7 +36,8 @@ function buildIssueDescription(issue) {
|
|
|
36
36
|
function buildIssueKey(issue) {
|
|
37
37
|
return [issue.kind, issue.type, issue.code, issue.moduleId ?? "unknown"].join(":");
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/** `quiet` draws the card without the notification, for Staff reading a live page. */
|
|
40
|
+
export function PhiCmsRenderDiagnostic({ issue, quiet = false }) {
|
|
40
41
|
const { showNotification } = usePhiApplicationFeedback();
|
|
41
42
|
const issueKey = buildIssueKey(issue);
|
|
42
43
|
const title = buildIssueTitle(issue);
|
|
@@ -44,7 +45,7 @@ export function PhiCmsRenderDiagnostic({ issue }) {
|
|
|
44
45
|
useEffect(() => {
|
|
45
46
|
console.warn(`[phi-cms-render-diagnostic] ${title}: ${description} ` +
|
|
46
47
|
`(code=${issue.code}, blockId=${issue.blockId ?? "unknown"})`);
|
|
47
|
-
if (issue.code === "missing-module") {
|
|
48
|
+
if (quiet || issue.code === "missing-module") {
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
if (notifiedIssueKeys.has(issueKey)) {
|
|
@@ -58,7 +59,7 @@ export function PhiCmsRenderDiagnostic({ issue }) {
|
|
|
58
59
|
placement: "bottomRight",
|
|
59
60
|
durationSeconds: 6,
|
|
60
61
|
});
|
|
61
|
-
}, [description, issue.blockId, issue.code, issue.detail, issue.kind, issue.moduleId, issue.type, issueKey, showNotification, title]);
|
|
62
|
+
}, [description, issue.blockId, issue.code, issue.detail, issue.kind, issue.moduleId, issue.type, issueKey, quiet, showNotification, title]);
|
|
62
63
|
return (_jsx("div", { "data-phi-cms-render-diagnostic": issue.kind, "data-phi-cms-render-diagnostic-code": issue.code, "data-phi-cms-render-diagnostic-type": issue.type, "data-phi-cms-render-diagnostic-block-id": issue.blockId ?? undefined, "data-phi-cms-render-diagnostic-module": issue.moduleId ?? undefined, children: _jsx(PhiAlertControl, { level: "error", showIcon: true, title: title, description: (_jsxs("div", { children: [_jsx(PhiTypographyControl, { code: true, children: issue.type }), _jsx("br", {}), _jsx(PhiTypographyControl, { children: issue.code === "missing-module"
|
|
63
64
|
? issue.moduleId
|
|
64
65
|
? `Missing module: ${issue.moduleId}`
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { PhiCmsRenderIssue } from "../../types/cms-plugins";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* `live` for a block that failed on a live page: drawn for Staff only (`usePhiWidgetFailureStaff`), in
|
|
4
|
+
* its place and without the notification a workspace raises, and for a visitor not at all -- the chunk
|
|
5
|
+
* is not even fetched.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PhiCmsRenderDiagnostic({ issue, live }: {
|
|
3
8
|
issue: PhiCmsRenderIssue;
|
|
4
|
-
|
|
9
|
+
live?: boolean;
|
|
10
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { lazy, Suspense } from "react";
|
|
4
|
+
import { usePhiWidgetFailureStaff } from "../widgets/shared/widget-failure-audience";
|
|
4
5
|
/**
|
|
5
6
|
* Lazy boundary for the render diagnostic. The layout renderer references the diagnostic from
|
|
6
7
|
* the server graph on every route, so a direct implementation here would put its antd surface
|
|
@@ -10,6 +11,15 @@ import { lazy, Suspense } from "react";
|
|
|
10
11
|
const PhiCmsRenderDiagnosticImplementation = lazy(async () => ({
|
|
11
12
|
default: (await import("./phi-cms-render-diagnostic-client")).PhiCmsRenderDiagnostic,
|
|
12
13
|
}));
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* `live` for a block that failed on a live page: drawn for Staff only (`usePhiWidgetFailureStaff`), in
|
|
16
|
+
* its place and without the notification a workspace raises, and for a visitor not at all -- the chunk
|
|
17
|
+
* is not even fetched.
|
|
18
|
+
*/
|
|
19
|
+
export function PhiCmsRenderDiagnostic({ issue, live = false }) {
|
|
20
|
+
const staff = usePhiWidgetFailureStaff();
|
|
21
|
+
if (live && !staff) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return (_jsx(Suspense, { fallback: null, children: _jsx(PhiCmsRenderDiagnosticImplementation, { issue: issue, quiet: live }) }));
|
|
15
25
|
}
|
|
@@ -14,6 +14,8 @@ export type PhiCmsRenderErrorBoundaryProps = {
|
|
|
14
14
|
* be taken out of the tree it broke.
|
|
15
15
|
*/
|
|
16
16
|
renderDiagnostic?: (diagnostic: ReactNode) => ReactNode;
|
|
17
|
+
/** The block is on a live page, where only Staff read its diagnostic (`PhiCmsRenderDiagnostic`). */
|
|
18
|
+
live?: boolean;
|
|
17
19
|
children: ReactNode;
|
|
18
20
|
};
|
|
19
21
|
type PhiCmsRenderErrorBoundaryState = {
|
|
@@ -27,7 +27,7 @@ export class PhiCmsRenderErrorBoundary extends Component {
|
|
|
27
27
|
blockId: this.props.blockId,
|
|
28
28
|
moduleId: this.props.moduleId,
|
|
29
29
|
detail: this.state.error.message,
|
|
30
|
-
} });
|
|
30
|
+
}, live: this.props.live });
|
|
31
31
|
return this.props.renderDiagnostic ? this.props.renderDiagnostic(diagnostic) : diagnostic;
|
|
32
32
|
}
|
|
33
33
|
return this.props.children;
|
|
@@ -19,6 +19,8 @@ import { resolvePhiUnauthenticatedLoginHref, } from "../../server-helpers/public
|
|
|
19
19
|
import { isPhiCmsGatewayAuthError } from "../../gateway/errors";
|
|
20
20
|
import { PhiRuntimeControllerServerHost } from "../runtime/runtime-controller-server-host";
|
|
21
21
|
import { PhiRuntimeModuleProvider } from "../runtime/runtime-module-context";
|
|
22
|
+
import { PhiWidgetFailureAudienceProvider } from "../widgets/shared/widget-failure-audience";
|
|
23
|
+
import { canPhiViewerReadWidgetFailures } from "../widgets/shared/widget-failure-staff";
|
|
22
24
|
import { PhiModuleIconsProvider } from "../shell/phi-module-icons";
|
|
23
25
|
import { collectPhiModuleIconSets } from "../../helpers/module-icons";
|
|
24
26
|
import { PhiRuntimeModuleDataProviderHost } from "../runtime/runtime-module-data-provider-host";
|
|
@@ -172,7 +174,7 @@ export async function PhiCmsAreaBoundary({ root, cmsBridge, children, path, page
|
|
|
172
174
|
...runtimeModuleScope.moduleSet.mediaSourceDescriptorsByKey.values(),
|
|
173
175
|
], videoProviderDescriptors: [
|
|
174
176
|
...runtimeModuleScope.moduleSet.videoProviderDescriptorsByKey.values(),
|
|
175
|
-
], children: _jsx(PhiModuleIconsProvider, { sets: collectPhiModuleIconSets(runtimeModuleScope.moduleSet.moduleDefinitionsById.values()), children: _jsxs(PhiRuntimeModuleDataProviderHost, { providerKeys: [...scope.runtimeRegistry.dataProviderDescriptorsByKey.keys()], children: [areaControllers.registeredControllerSettings && areaControllers.registeredControllerSettings.length > 0 ? (_jsx(PhiRuntimeControllerServerHost, { controllers: areaControllers.registeredControllerSettings, runtime: runtime, registry: areaControllers.controllerDefinitionsByType, controllerModuleIdsByType: runtimeModuleScope.moduleSet.ownerModuleIdByControllerType, runtimeModuleCatalog: scope.runtimeRegistry.runtimeModuleCatalog, serverCapabilities: scope.runtimeRegistry.serverCapabilities })) : null, children, filteredLayoutTree ? (_jsx(PhiCmsOverlayRenderer, { tree: filteredLayoutTree, runtime: runtime, registry: scope.runtimeRegistry, signalScope: "area", deferredOrigin: { area: runtime.area, root, path: path ?? pagePath ?? null } })) : null] }) }) }) }));
|
|
177
|
+
], children: _jsx(PhiModuleIconsProvider, { sets: collectPhiModuleIconSets(runtimeModuleScope.moduleSet.moduleDefinitionsById.values()), children: _jsx(PhiWidgetFailureAudienceProvider, { staff: canPhiViewerReadWidgetFailures(runtime.viewer), children: _jsxs(PhiRuntimeModuleDataProviderHost, { providerKeys: [...scope.runtimeRegistry.dataProviderDescriptorsByKey.keys()], children: [areaControllers.registeredControllerSettings && areaControllers.registeredControllerSettings.length > 0 ? (_jsx(PhiRuntimeControllerServerHost, { controllers: areaControllers.registeredControllerSettings, runtime: runtime, registry: areaControllers.controllerDefinitionsByType, controllerModuleIdsByType: runtimeModuleScope.moduleSet.ownerModuleIdByControllerType, runtimeModuleCatalog: scope.runtimeRegistry.runtimeModuleCatalog, serverCapabilities: scope.runtimeRegistry.serverCapabilities })) : null, children, filteredLayoutTree ? (_jsx(PhiCmsOverlayRenderer, { tree: filteredLayoutTree, runtime: runtime, registry: scope.runtimeRegistry, signalScope: "area", deferredOrigin: { area: runtime.area, root, path: path ?? pagePath ?? null } })) : null] }) }) }) }) }));
|
|
176
178
|
}
|
|
177
179
|
/**
|
|
178
180
|
* The Area-owned Regions around a Page, or nothing but the grid they share.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PhisSiteAddressInput } from "@phis/contracts/users";
|
|
2
|
+
import { type PhiAddressPart } from "../../helpers/address-field";
|
|
3
|
+
export type PhiAddressControlLabels = Record<PhiAddressPart, string>;
|
|
4
|
+
export type PhiAddressControlProps = {
|
|
5
|
+
/** The id of the first part's input, so a label outside the control can name it. */
|
|
6
|
+
id?: string;
|
|
7
|
+
value: PhisSiteAddressInput;
|
|
8
|
+
labels: PhiAddressControlLabels;
|
|
9
|
+
/** A sentence per part that is wrong, shown under it. */
|
|
10
|
+
errors?: Partial<Record<PhiAddressPart, string>>;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
onChange?: (next: PhisSiteAddressInput) => void;
|
|
14
|
+
/** A part was left, so whoever validates may now say what is wrong with it. */
|
|
15
|
+
onPartBlur?: (part: PhiAddressPart) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* One postal address in the shape Core writes (`PhisSiteAddressInput`): name, company, two street lines,
|
|
19
|
+
* postal code and city, region and the country -- chosen with `PhiCountrySelectControl`. Each part has its
|
|
20
|
+
* label above it and its sentence under it when it is wrong; required parts carry the marker. The value is
|
|
21
|
+
* the whole address, an empty optional part `null`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function PhiAddressControl({ id, value, labels, errors, disabled, readOnly, onChange, onPartBlur, }: PhiAddressControlProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { PHI_ADDRESS_PART_MAX_LENGTHS, PHI_ADDRESS_REQUIRED_PARTS, writePhiAddressFieldPart, } from "../../helpers/address-field";
|
|
5
|
+
import { usePhiConfig } from "../root/phi-config-provider";
|
|
6
|
+
import { PhiCountrySelectControl } from "./phi-country-select-control";
|
|
7
|
+
import { PhiTextControl } from "./phi-text-control";
|
|
8
|
+
const AUTOCOMPLETE = {
|
|
9
|
+
name: "name",
|
|
10
|
+
companyName: "organization",
|
|
11
|
+
line1: "address-line1",
|
|
12
|
+
line2: "address-line2",
|
|
13
|
+
postalCode: "postal-code",
|
|
14
|
+
city: "address-level2",
|
|
15
|
+
region: "address-level1",
|
|
16
|
+
};
|
|
17
|
+
/* Two parts share a row where they are short: postal code beside city, region beside country. */
|
|
18
|
+
const ROWS = [
|
|
19
|
+
["name"],
|
|
20
|
+
["companyName"],
|
|
21
|
+
["line1"],
|
|
22
|
+
["line2"],
|
|
23
|
+
["postalCode", "city"],
|
|
24
|
+
["region", "country"],
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* One postal address in the shape Core writes (`PhisSiteAddressInput`): name, company, two street lines,
|
|
28
|
+
* postal code and city, region and the country -- chosen with `PhiCountrySelectControl`. Each part has its
|
|
29
|
+
* label above it and its sentence under it when it is wrong; required parts carry the marker. The value is
|
|
30
|
+
* the whole address, an empty optional part `null`.
|
|
31
|
+
*/
|
|
32
|
+
export function PhiAddressControl({ id, value, labels, errors, disabled, readOnly, onChange, onPartBlur, }) {
|
|
33
|
+
const { token } = usePhiConfig();
|
|
34
|
+
const ownId = useId();
|
|
35
|
+
const partId = (part) => (part === "name" && id ? id : `${ownId}-${part}`);
|
|
36
|
+
const write = (part, next) => onChange?.(writePhiAddressFieldPart(value, part, next));
|
|
37
|
+
const renderPart = (part) => {
|
|
38
|
+
const required = PHI_ADDRESS_REQUIRED_PARTS.includes(part);
|
|
39
|
+
const error = errors?.[part];
|
|
40
|
+
return (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: token.paddingXXS, minWidth: 0 }, children: [_jsxs("label", { htmlFor: partId(part), style: { color: token.colorTextHeading, fontSize: token.fontSizeSM }, children: [required ? _jsx("span", { "aria-hidden": true, style: { color: token.colorError, marginInlineEnd: "0.25em" }, children: "*" }) : null, labels[part]] }), part === "country" ? (_jsx(PhiCountrySelectControl, { id: partId(part), value: value.country, disabled: disabled, readOnly: readOnly, onBlur: () => onPartBlur?.(part), onChange: (next) => write(part, next) })) : (_jsx(PhiTextControl, { id: partId(part), value: value[part] ?? "", disabled: disabled, readOnly: readOnly, autoComplete: AUTOCOMPLETE[part], maxLength: PHI_ADDRESS_PART_MAX_LENGTHS[part], onBlur: () => onPartBlur?.(part), onChange: (next) => write(part, next) })), error ? (_jsx("span", { role: "alert", style: { color: token.colorError, fontSize: token.fontSizeSM }, children: error })) : null] }, part));
|
|
41
|
+
};
|
|
42
|
+
return (_jsx("div", { style: { display: "flex", flexDirection: "column", gap: token.paddingSM, width: "100%", minWidth: 0 }, children: ROWS.map((row) => row.length === 1 ? renderPart(row[0]) : (_jsx("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(10rem, 1fr))", gap: token.paddingSM }, children: row.map(renderPart) }, row.join("-")))) }));
|
|
43
|
+
}
|
|
@@ -20,6 +20,8 @@ export type PhiColorControlProps = PhiPickerTransactionCallbacks<string | null>
|
|
|
20
20
|
defaultValue?: string;
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
allowClear?: boolean;
|
|
23
|
+
/** Offer no transparency: the alpha slider is gone and a picked colour with alpha is made opaque. */
|
|
24
|
+
disabledAlpha?: boolean;
|
|
23
25
|
mode?: PhiColorPickerMode;
|
|
24
26
|
open?: boolean;
|
|
25
27
|
showText?: boolean;
|
|
@@ -33,4 +35,4 @@ export type PhiColorControlProps = PhiPickerTransactionCallbacks<string | null>
|
|
|
33
35
|
renderPanel?: (panel: ReactNode) => ReactNode;
|
|
34
36
|
onClear?: () => void;
|
|
35
37
|
};
|
|
36
|
-
export declare function PhiColorControl({ value, defaultValue, disabled, allowClear, mode, open, showText, trigger, placement, size, children, presets, getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }: PhiColorControlProps): import("react").JSX.Element;
|
|
38
|
+
export declare function PhiColorControl({ value, defaultValue, disabled, allowClear, disabledAlpha, mode, open, showText, trigger, placement, size, children, presets, getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }: PhiColorControlProps): import("react").JSX.Element;
|
|
@@ -56,7 +56,7 @@ function resolveCssValue(nextValue, fallbackCss) {
|
|
|
56
56
|
function resolveAntdMode(mode) {
|
|
57
57
|
return mode === "both" ? ["single", "gradient"] : mode;
|
|
58
58
|
}
|
|
59
|
-
export function PhiColorControl({ value = null, defaultValue = "#f0f0f0", disabled, allowClear, mode = "single", open, showText, trigger, placement = "auto", size, children, presets = [], getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }) {
|
|
59
|
+
export function PhiColorControl({ value = null, defaultValue = "#f0f0f0", disabled, allowClear, disabledAlpha, mode = "single", open, showText, trigger, placement = "auto", size, children, presets = [], getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }) {
|
|
60
60
|
const { token } = theme.useToken();
|
|
61
61
|
const picker = usePhiImmediatePicker({
|
|
62
62
|
value,
|
|
@@ -93,7 +93,7 @@ export function PhiColorControl({ value = null, defaultValue = "#f0f0f0", disabl
|
|
|
93
93
|
colors: [...preset.colors],
|
|
94
94
|
defaultOpen: preset.defaultOpen,
|
|
95
95
|
}));
|
|
96
|
-
return (_jsx(ColorPicker, { mode: resolveAntdMode(mode), value: resolveAntdColorValue(resolvePhiColorReferences(picker.value, references), defaultValue), open: picker.open, disabled: disabled, allowClear: allowClear, trigger: trigger, placement: placement === "auto" ? undefined : placement, size: size, showText: resolvedShowText, presets: antdPresets, getPopupContainer: getPopupContainer, classNames: { popup: { root: joinPhiClassNames("phi-color-widget-popup", popupClassName) } }, styles: {
|
|
96
|
+
return (_jsx(ColorPicker, { mode: resolveAntdMode(mode), value: resolveAntdColorValue(resolvePhiColorReferences(picker.value, references), defaultValue), open: picker.open, disabled: disabled, allowClear: allowClear, disabledAlpha: disabledAlpha, trigger: trigger, placement: placement === "auto" ? undefined : placement, size: size, showText: resolvedShowText, presets: antdPresets, getPopupContainer: getPopupContainer, classNames: { popup: { root: joinPhiClassNames("phi-color-widget-popup", popupClassName) } }, styles: {
|
|
97
97
|
root: {
|
|
98
98
|
display: "inline-flex",
|
|
99
99
|
alignItems: "center",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
import type { PhiControlSize } from "../../types/control";
|
|
3
|
+
export type PhiCountrySelectControlProps = {
|
|
4
|
+
id?: string;
|
|
5
|
+
/** An ISO 3166-1 alpha-2 code, uppercase; anything else shows as no choice. */
|
|
6
|
+
value?: string | null;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
allowClear?: boolean;
|
|
12
|
+
size?: PhiControlSize;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
onChange: (code: string | null) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A country chosen from ISO 3166-1, by name in the page's language: the Select Control with every code
|
|
19
|
+
* of `PHI_ISO_3166_ALPHA2_CODES` named through `Intl.DisplayNames` and sorted as the language sorts,
|
|
20
|
+
* searchable by name and by code. What it holds is the code.
|
|
21
|
+
*/
|
|
22
|
+
export declare function PhiCountrySelectControl({ id, value, placeholder, ariaLabel, disabled, readOnly, allowClear, size, style, onBlur, onChange, }: PhiCountrySelectControlProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { listPhiCountryOptions } from "../../helpers/country-names";
|
|
5
|
+
import { usePhiIntlLocale } from "../root/phi-intl-locale";
|
|
6
|
+
import { PhiSelectControl } from "./phi-select-control";
|
|
7
|
+
/**
|
|
8
|
+
* A country chosen from ISO 3166-1, by name in the page's language: the Select Control with every code
|
|
9
|
+
* of `PHI_ISO_3166_ALPHA2_CODES` named through `Intl.DisplayNames` and sorted as the language sorts,
|
|
10
|
+
* searchable by name and by code. What it holds is the code.
|
|
11
|
+
*/
|
|
12
|
+
export function PhiCountrySelectControl({ id, value, placeholder, ariaLabel, disabled, readOnly, allowClear, size, style, onBlur, onChange, }) {
|
|
13
|
+
const locale = usePhiIntlLocale();
|
|
14
|
+
const options = useMemo(() => listPhiCountryOptions(locale), [locale]);
|
|
15
|
+
return (_jsx(PhiSelectControl, { id: id, value: value && options.some((option) => option.value === value) ? value : undefined, placeholder: placeholder, ariaLabel: ariaLabel, disabled: disabled, readOnly: readOnly, allowClear: allowClear, size: size, options: options, style: style ?? { width: "100%" }, onBlur: onBlur, onChange: (next) => onChange(typeof next === "string" && next ? next : null) }));
|
|
16
|
+
}
|
|
@@ -74,7 +74,7 @@ export type PhiDialogControlProps = {
|
|
|
74
74
|
presentation?: "modal" | "drawer";
|
|
75
75
|
/** The edge a Drawer comes from. */
|
|
76
76
|
placement?: PhiDrawerControlProps["placement"];
|
|
77
|
-
/** A Drawer's width
|
|
77
|
+
/** A Drawer's size, a block's pair: its `width`, or its `height` from the top or bottom. */
|
|
78
78
|
size?: PhiDrawerControlProps["size"];
|
|
79
79
|
onDismiss?: (source: PhiOverlayCloseSource) => void;
|
|
80
80
|
afterOpenChange?: (open: boolean) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PhiDrawerControlProps } from "./phi-drawer-control";
|
|
2
|
-
export declare function PhiDrawerControlAdapter({ open, title, header, body, footer, closable, keyboard, mask, mountPolicy, placement, size, maxSize, resizable, push, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }: PhiDrawerControlProps): import("react").JSX.Element;
|
|
2
|
+
export declare function PhiDrawerControlAdapter({ open, title, header, body, footer, closable, keyboard, mask, mountPolicy, placement, size, minSize, maxSize, resizable, push, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }: PhiDrawerControlProps): import("react").JSX.Element;
|
|
@@ -6,21 +6,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { Drawer } from "antd";
|
|
8
8
|
import { PHI_FONT_SIZE, PHI_SPACE } from "../../theme/antd-css-var-contract";
|
|
9
|
-
import { PHI_OVERLAY_DEFAULT_MASK, resolvePhiOverlayDismissSource, resolvePhiOverlayMaskPresentation, } from "./phi-overlay-control-contract";
|
|
9
|
+
import { PHI_OVERLAY_DEFAULT_MASK, resolvePhiDrawerGeometry, resolvePhiOverlayDismissSource, resolvePhiOverlayMaskPresentation, } from "./phi-overlay-control-contract";
|
|
10
10
|
import { usePhiHydrated } from "../state/use-phi-hydrated";
|
|
11
11
|
const PHI_DRAWER_HEADER_MIN_BLOCK_SIZE = `calc(var(--phi-control-height) + ${PHI_SPACE.xs} + ${PHI_SPACE.xs})`;
|
|
12
12
|
/** Where a title starts when the close button stands before it: past the button, not beneath it. */
|
|
13
13
|
const PHI_DRAWER_TITLE_AFTER_CLOSE = `calc(${PHI_SPACE.sm} + var(--phi-control-height) + ${PHI_SPACE.xs})`;
|
|
14
|
-
export function PhiDrawerControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", placement = "right", size, maxSize, resizable = false, push = false, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }) {
|
|
14
|
+
export function PhiDrawerControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", placement = "right", size, minSize, maxSize, resizable = false, push = false, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }) {
|
|
15
15
|
const hydrated = usePhiHydrated();
|
|
16
16
|
const resolvedMask = resolvePhiOverlayMaskPresentation(mask);
|
|
17
|
+
const geometry = resolvePhiDrawerGeometry({ size, minSize, maxSize, placement });
|
|
17
18
|
const closeAtInlineStart = placement === "right";
|
|
18
19
|
// A drawer with nothing to say in its header draws none: no title, no header content, no close button.
|
|
19
20
|
const hasHeaderContent = header != null || title != null;
|
|
20
21
|
const hasHeader = hasHeaderContent || closable;
|
|
21
22
|
const titleInset = closable && closeAtInlineStart ? PHI_DRAWER_TITLE_AFTER_CLOSE : PHI_SPACE.lg;
|
|
22
23
|
const renderedTitle = hasHeaderContent ? (_jsxs("div", { style: { display: "grid", minBlockSize: PHI_DRAWER_HEADER_MIN_BLOCK_SIZE, minWidth: 0, position: "relative", width: "100%" }, children: [header, title == null ? null : (_jsx("div", { style: { insetInlineStart: titleInset, minWidth: 0, position: "absolute", top: "50%", transform: "translateY(-50%)", zIndex: 1 }, children: title }))] })) : null;
|
|
23
|
-
return (_jsx(Drawer, { open: open, title: renderedTitle, closable: closable ? { placement: closeAtInlineStart ? "start" : "end" } : false, keyboard: keyboard, mask: resolvedMask.adapterMask, destroyOnHidden: mountPolicy === "remount", forceRender: hydrated && mountPolicy === "eager", placement: placement, size: size, maxSize:
|
|
24
|
+
return (_jsx(Drawer, { open: open, title: renderedTitle, closable: closable ? { placement: closeAtInlineStart ? "start" : "end" } : false, keyboard: keyboard, mask: resolvedMask.adapterMask, destroyOnHidden: mountPolicy === "remount", forceRender: hydrated && mountPolicy === "eager", placement: placement, size: geometry.size, maxSize: geometry.resizeMaxSize, resizable: resizable, push: push, zIndex: zIndex, footer: footer ?? null, focusable: { trap: true, focusTriggerAfterClose: true }, styles: {
|
|
24
25
|
mask: resolvedMask.maskStyle,
|
|
25
26
|
wrapper: {
|
|
26
27
|
/*
|
|
@@ -31,6 +32,7 @@ export function PhiDrawerControlAdapter({ open, title, header, body, footer, clo
|
|
|
31
32
|
*/
|
|
32
33
|
background: "var(--phi-color-bg-elevated)",
|
|
33
34
|
...containerStyle,
|
|
35
|
+
...geometry.style,
|
|
34
36
|
padding: 0,
|
|
35
37
|
},
|
|
36
38
|
section: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { PhiCmsOverlayConfig,
|
|
2
|
-
import type { PhiOverlayControlCommonProps } from "./phi-overlay-control-contract";
|
|
3
|
-
|
|
1
|
+
import type { PhiCmsOverlayConfig, PhiOverlayPushBehaviour } from "../../types/cms-overlay";
|
|
2
|
+
import type { PhiOverlayControlCommonProps, PhiOverlayControlGeometryProps } from "./phi-overlay-control-contract";
|
|
3
|
+
/**
|
|
4
|
+
* `size`, `minSize` and `maxSize` are the block's pairs; the Drawer draws the axis it opens along
|
|
5
|
+
* (`resolvePhiDrawerGeometry`).
|
|
6
|
+
*/
|
|
7
|
+
export type PhiDrawerControlProps = PhiOverlayControlCommonProps & PhiOverlayControlGeometryProps & {
|
|
4
8
|
placement?: PhiCmsOverlayConfig["placement"];
|
|
5
|
-
size?: PhiCmsOverlaySize;
|
|
6
|
-
maxSize?: number;
|
|
7
9
|
resizable?: boolean;
|
|
8
10
|
push?: PhiOverlayPushBehaviour;
|
|
9
11
|
zIndex?: number;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { PhiToolbarControlItem } from "./phi-toolbar-control";
|
|
2
2
|
export type PhiFloatButtonControlPlacement = "bottom-end" | "bottom-start" | "top-end" | "top-start";
|
|
3
|
+
/**
|
|
4
|
+
* How large the buttons are. A Float Button is drawn at the large control height by Ant Design; that is
|
|
5
|
+
* `medium` here, and `small` steps one down the Theme's control heights. The ladder has no step above
|
|
6
|
+
* it, so there is no `large`.
|
|
7
|
+
*/
|
|
8
|
+
export type PhiFloatButtonControlSize = "small" | "medium";
|
|
3
9
|
export type PhiFloatButtonControlGroup = {
|
|
4
10
|
/** How the group opens. Left out, it is always open: every button stands in the corner. */
|
|
5
11
|
trigger?: "click" | "hover";
|
|
@@ -24,6 +30,7 @@ export type PhiFloatButtonControlProps = {
|
|
|
24
30
|
* floating over the editor could neither be seen in its slot nor selected there.
|
|
25
31
|
*/
|
|
26
32
|
inPlace?: boolean;
|
|
33
|
+
size?: PhiFloatButtonControlSize;
|
|
27
34
|
disabled?: boolean;
|
|
28
35
|
onActivate?: (key: string) => void;
|
|
29
36
|
};
|
|
@@ -36,4 +43,4 @@ export type PhiFloatButtonControlProps = {
|
|
|
36
43
|
* on a Float Button and are not imitated: `danger`, and `loading`, which disables the button instead of
|
|
37
44
|
* spinning.
|
|
38
45
|
*/
|
|
39
|
-
export declare function PhiFloatButtonControl({ items, placement, offset, shape, group, inPlace, disabled, onActivate, }: PhiFloatButtonControlProps): import("react").JSX.Element | null;
|
|
46
|
+
export declare function PhiFloatButtonControl({ items, placement, offset, shape, group, inPlace, size, disabled, onActivate, }: PhiFloatButtonControlProps): import("react").JSX.Element | null;
|
|
@@ -5,6 +5,21 @@ import { createPortal } from "react-dom";
|
|
|
5
5
|
import { FloatButton } from "antd";
|
|
6
6
|
import { PhiIcon } from "../shell/phi-icon";
|
|
7
7
|
import { usePhiHydrated } from "../state/use-phi-hydrated";
|
|
8
|
+
import { PHI_CONTROL } from "../../theme/antd-css-var-contract";
|
|
9
|
+
/*
|
|
10
|
+
* Ant Design sizes the button by its own variable (`--ant-float-btn-size`, under the component prefix, as
|
|
11
|
+
* the Select's are) and opens a group's list from the trigger by the same length plus the padding.
|
|
12
|
+
*/
|
|
13
|
+
function resolveSizeStyle(size) {
|
|
14
|
+
if (size !== "small")
|
|
15
|
+
return undefined;
|
|
16
|
+
return { "--ant-float-btn-size": PHI_CONTROL.md };
|
|
17
|
+
}
|
|
18
|
+
function resolveGroupSizeStyle(size) {
|
|
19
|
+
if (size !== "small")
|
|
20
|
+
return undefined;
|
|
21
|
+
return { "--ant-float-btn-list-trigger-offset": `calc(${PHI_CONTROL.md} + var(--phi-padding))` };
|
|
22
|
+
}
|
|
8
23
|
/**
|
|
9
24
|
* Where a fixed button is drawn: on `document.body`, outside every box of the page.
|
|
10
25
|
*
|
|
@@ -47,7 +62,8 @@ function resolveCornerStyle(placement, offset, inPlace) {
|
|
|
47
62
|
* on a Float Button and are not imitated: `danger`, and `loading`, which disables the button instead of
|
|
48
63
|
* spinning.
|
|
49
64
|
*/
|
|
50
|
-
export function PhiFloatButtonControl({ items, placement = "bottom-end", offset, shape = "circle", group, inPlace = false, disabled, onActivate, }) {
|
|
65
|
+
export function PhiFloatButtonControl({ items, placement = "bottom-end", offset, shape = "circle", group, inPlace = false, size, disabled, onActivate, }) {
|
|
66
|
+
const sizeStyle = resolveSizeStyle(size);
|
|
51
67
|
const visibleItems = items.filter((item) => item.visible !== false);
|
|
52
68
|
if (visibleItems.length === 0) {
|
|
53
69
|
return null;
|
|
@@ -65,9 +81,9 @@ export function PhiFloatButtonControl({ items, placement = "bottom-end", offset,
|
|
|
65
81
|
}
|
|
66
82
|
: undefined,
|
|
67
83
|
/* A single button carries the corner itself; inside a group, the group does. */
|
|
68
|
-
style: visibleItems.length === 1 && index === 0 ? cornerStyle :
|
|
84
|
+
style: visibleItems.length === 1 && index === 0 ? { ...cornerStyle, ...sizeStyle } : sizeStyle, onClick: item.readOnly || !onActivate ? undefined : () => onActivate(item.key) }, item.key));
|
|
69
85
|
});
|
|
70
|
-
const placed = buttons.length === 1 ? buttons[0] : (_jsx(FloatButton.Group, { trigger: group?.trigger, icon: group?.icon ? _jsx(PhiIcon, { name: group.icon, size: "inherit" }) : undefined, placement: group?.direction ?? (placement.startsWith("top") ? "bottom" : "top"), shape: shape, style: cornerStyle, children: buttons }));
|
|
86
|
+
const placed = buttons.length === 1 ? buttons[0] : (_jsx(FloatButton.Group, { trigger: group?.trigger, icon: group?.icon ? _jsx(PhiIcon, { name: group.icon, size: "inherit" }) : undefined, placement: group?.direction ?? (placement.startsWith("top") ? "bottom" : "top"), shape: shape, style: { ...cornerStyle, ...resolveGroupSizeStyle(size) }, children: buttons }));
|
|
71
87
|
/* In place it stays in its slot, where the Builder's canvas can show and select it. */
|
|
72
88
|
return inPlace ? placed : _jsx(PhiFloatButtonPortal, { children: placed });
|
|
73
89
|
}
|
|
@@ -10,6 +10,7 @@ import { PhiDescriptionHint } from "./phi-description-tooltip-icon";
|
|
|
10
10
|
import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_FIELD_UNAVAILABLE_DEFAULT_LABEL, PHI_FORM_FIELD_UNAVAILABLE_LABEL_KEY, PHI_FORM_VALIDATION_PROVIDER_KEYS, } from "../forms/form-provider-contract";
|
|
11
11
|
import { phiFormCellOpensColumn, phiFormControlGridColumn, phiFormFieldFollowsLayoutColumns, phiFormLabelGridColumn, resolvePhiFormGridPlacement, resolvePhiFormLayout, PHI_FORM_RESPONSIVE_MODES, resolvePhiFormText, shouldPhiFormSubmitOnKeyDown, } from "../forms/form-descriptor-contract";
|
|
12
12
|
import { readPhiMoneyFieldCurrencyFieldKey } from "../forms/money-field-currency-key";
|
|
13
|
+
import { collectFormOptionFlagFieldKeys, resolveFormChosenOptionFlags, } from "../forms/form-option-flags";
|
|
13
14
|
import { PHI_SHARED_FORM_PROVIDER_REGISTRY } from "../forms/shared-form-provider-registry";
|
|
14
15
|
import { resolvePhiControlOptionsDependencies, usePhiControlOptionsProvider, } from "./phi-options-provider";
|
|
15
16
|
/** The id Ant Design gives a Form Item's control: the form's name and the field's key, joined by `_`. */
|
|
@@ -83,7 +84,7 @@ function pickPhiFormWatchedValues(values, keys) {
|
|
|
83
84
|
}
|
|
84
85
|
return picked;
|
|
85
86
|
}
|
|
86
|
-
function PhiResolvedFormFieldControl({ id, provider, field, label, description, labels, formConfig, placeholder, disabled, readOnly, value, checked, onChange, formContext, formValues, mediaLimits, }) {
|
|
87
|
+
function PhiResolvedFormFieldControl({ id, provider, field, label, description, labels, formConfig, placeholder, disabled, readOnly, value, checked, onChange, formContext, formValues, mediaLimits, onChosenOptionFlags, }) {
|
|
87
88
|
const staticOptions = useMemo(() => field.options?.map((option) => ({
|
|
88
89
|
...option,
|
|
89
90
|
label: resolvePhiFormText(option.label, labels, formConfig),
|
|
@@ -139,6 +140,13 @@ function PhiResolvedFormFieldControl({ id, provider, field, label, description,
|
|
|
139
140
|
if (value != null && value !== "")
|
|
140
141
|
onChange?.(undefined);
|
|
141
142
|
}, [onChange, requiredDependencyKey, value]);
|
|
143
|
+
const chosenOptionFlags = onChosenOptionFlags
|
|
144
|
+
? resolveFormChosenOptionFlags(resolvedOptions.options, value)
|
|
145
|
+
: undefined;
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
onChosenOptionFlags?.(chosenOptionFlags);
|
|
148
|
+
}, [chosenOptionFlags, onChosenOptionFlags]);
|
|
149
|
+
useEffect(() => () => onChosenOptionFlags?.(undefined), [onChosenOptionFlags]);
|
|
142
150
|
const Control = provider.Control;
|
|
143
151
|
const controlLabel = field.controlLabel
|
|
144
152
|
? resolvePhiFormText(field.controlLabel, labels, formConfig)
|
|
@@ -250,8 +258,10 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
|
|
|
250
258
|
async function submit(values) {
|
|
251
259
|
const holds = [...submitHoldsRef.current];
|
|
252
260
|
if (holds.length > 0) {
|
|
253
|
-
form.setFields(holds.
|
|
254
|
-
|
|
261
|
+
form.setFields(holds.flatMap(([name, { reason, onRefused }]) => onRefused ? [] : [{ name, errors: [reason] }]));
|
|
262
|
+
for (const [, { onRefused }] of holds)
|
|
263
|
+
onRefused?.();
|
|
264
|
+
onValidationFailed?.({ valid: false, errors: Object.fromEntries(holds.map(([name, { reason }]) => [name, [reason]])) });
|
|
255
265
|
return;
|
|
256
266
|
}
|
|
257
267
|
setSubmitting(true);
|
|
@@ -301,20 +311,52 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
|
|
|
301
311
|
const selectWatchedFormValues = useCallback((values) => pickPhiFormWatchedValues(values, watchedFormKeys), [watchedFormKeys]);
|
|
302
312
|
const watchedFormValues = Form.useWatch(selectWatchedFormValues, { form, preserve: true });
|
|
303
313
|
const formValues = useMemo(() => watchedFormValues ?? pickPhiFormWatchedValues(resolvedInitialValues, watchedFormKeys), [resolvedInitialValues, watchedFormKeys, watchedFormValues]);
|
|
314
|
+
/*
|
|
315
|
+
* What an `optionFlag` condition reads: the flags of the option chosen in each field one of them names.
|
|
316
|
+
* Written-out options are known here and answered during the render, the server's included; a
|
|
317
|
+
* Provider's are known only to the field that resolved them, which reports them once it has.
|
|
318
|
+
*/
|
|
319
|
+
const optionFlagFieldKeys = useMemo(() => collectFormOptionFlagFieldKeys(descriptor.fields), [descriptor.fields]);
|
|
320
|
+
const [reportedOptionFlags, setReportedOptionFlags] = useState({});
|
|
321
|
+
const optionFlagReporters = useMemo(() => new Map([...optionFlagFieldKeys].map((key) => [
|
|
322
|
+
key,
|
|
323
|
+
(flags) => setReportedOptionFlags((current) => {
|
|
324
|
+
if (current[key] === flags)
|
|
325
|
+
return current;
|
|
326
|
+
const next = { ...current };
|
|
327
|
+
if (flags === undefined)
|
|
328
|
+
delete next[key];
|
|
329
|
+
else
|
|
330
|
+
next[key] = flags;
|
|
331
|
+
return next;
|
|
332
|
+
}),
|
|
333
|
+
])), [optionFlagFieldKeys]);
|
|
334
|
+
const formOptionFlags = useMemo(() => {
|
|
335
|
+
const flags = {};
|
|
336
|
+
for (const key of optionFlagFieldKeys) {
|
|
337
|
+
const field = descriptor.fields.find((entry) => entry.key === key);
|
|
338
|
+
const chosen = field?.optionsProvider
|
|
339
|
+
? reportedOptionFlags[key]
|
|
340
|
+
: resolveFormChosenOptionFlags(field?.options, formValues[key]);
|
|
341
|
+
if (chosen !== undefined)
|
|
342
|
+
flags[key] = chosen;
|
|
343
|
+
}
|
|
344
|
+
return flags;
|
|
345
|
+
}, [descriptor.fields, formValues, optionFlagFieldKeys, reportedOptionFlags]);
|
|
304
346
|
const fieldFormContext = useMemo(() => ({
|
|
305
347
|
getValues: () => form.getFieldsValue(true),
|
|
306
|
-
holdSubmit: (fieldKey, reason) => {
|
|
348
|
+
holdSubmit: (fieldKey, reason, onRefused) => {
|
|
307
349
|
const holds = submitHoldsRef.current;
|
|
308
350
|
const held = holds.get(fieldKey);
|
|
309
351
|
if (reason == null) {
|
|
310
352
|
holds.delete(fieldKey);
|
|
311
353
|
// The sentence a refused submit left on the field goes with the hold; any other error stays.
|
|
312
|
-
if (held != null && form.getFieldError(fieldKey).includes(held)) {
|
|
354
|
+
if (held != null && form.getFieldError(fieldKey).includes(held.reason)) {
|
|
313
355
|
form.setFields([{ name: fieldKey, errors: [] }]);
|
|
314
356
|
}
|
|
315
357
|
return;
|
|
316
358
|
}
|
|
317
|
-
holds.set(fieldKey, reason);
|
|
359
|
+
holds.set(fieldKey, onRefused ? { reason, onRefused } : { reason });
|
|
318
360
|
},
|
|
319
361
|
setValues: (values) => {
|
|
320
362
|
form.setFields(Object.entries(values).map(([name, value]) => ({ name, value, touched: true })));
|
|
@@ -335,8 +377,9 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
|
|
|
335
377
|
!field.visibleWhen ||
|
|
336
378
|
evaluatePhiRuntimeConditionExpression(field.visibleWhen, {
|
|
337
379
|
form: formValues,
|
|
380
|
+
formOptionFlags,
|
|
338
381
|
controllers: conditionControllerStates,
|
|
339
|
-
}) === "matched"), [activeRegistry, conditionControllerStates, descriptor.fields, formValues]);
|
|
382
|
+
}) === "matched"), [activeRegistry, conditionControllerStates, descriptor.fields, formOptionFlags, formValues]);
|
|
340
383
|
/*
|
|
341
384
|
* Where every part of every field lies, at each of the three widths, worked out before anything is
|
|
342
385
|
* drawn. Labels and controls are direct children of the form's grid and name their own row and
|
|
@@ -488,6 +531,7 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
|
|
|
488
531
|
const fieldDisabled = field.disabledWhen
|
|
489
532
|
? evaluatePhiRuntimeConditionExpression(field.disabledWhen, {
|
|
490
533
|
form: formValues,
|
|
534
|
+
formOptionFlags,
|
|
491
535
|
controllers: conditionControllerStates,
|
|
492
536
|
})
|
|
493
537
|
: "not-matched";
|
|
@@ -529,6 +573,6 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
|
|
|
529
573
|
...resolveHoneypotStyle(provider.presentation),
|
|
530
574
|
}, children: _jsx(Form.Item, { name: field.key, messageVariables: { label: labelText ?? field.key }, hidden: hidden, valuePropName: provider.valuePropName, dependencies: dependencies, required: required, rules: resolvedRules.length === 0 ? undefined : resolvedRules, style: { marginBottom: 0 }, children: _jsx(PhiResolvedFormFieldControl, { provider: provider, field: field, label: providerLabel, description: providerDescription, labels: labels, formConfig: formConfig, placeholder: field.placeholder
|
|
531
575
|
? resolvePhiFormText(field.placeholder, labels, formConfig)
|
|
532
|
-
: undefined, disabled: disabled || submitting || readOnly || field.config?.disabled === true || fieldDisabled !== "not-matched", readOnly: readOnly, formContext: fieldFormContext, formValues: formValues, mediaLimits: mediaLimits }) }) })] }, field.key));
|
|
576
|
+
: undefined, disabled: disabled || submitting || readOnly || field.config?.disabled === true || fieldDisabled !== "not-matched", readOnly: readOnly, formContext: fieldFormContext, formValues: formValues, mediaLimits: mediaLimits, onChosenOptionFlags: field.optionsProvider ? optionFlagReporters.get(field.key) : undefined }) }) })] }, field.key));
|
|
533
577
|
}) }) }));
|
|
534
578
|
});
|
|
@@ -49,6 +49,15 @@ export type PhiMediaPickerControlProps = PhiPickerTransactionCallbacks<number |
|
|
|
49
49
|
loading?: boolean;
|
|
50
50
|
disabled?: boolean;
|
|
51
51
|
readOnly?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Where the picker opens, which the host decides: it knows where the room is. A panel at the window's
|
|
54
|
+
* right, the Builder Inspector, says `left`, towards the canvas. Absent, it opens centred below: the
|
|
55
|
+
* library is wider than most panels, and opened beside a panel at the window's left it ran past the
|
|
56
|
+
* window's edge and the page scrolled sideways (the Theme's Link preview, 2026-11-24). Ant Design's
|
|
57
|
+
* overflow adjustment is on for every placement (`PhiPopoverControl`), and the width is capped to the
|
|
58
|
+
* window; centred below it slides sideways and upwards into the window, which a corner placement such
|
|
59
|
+
* as `bottomLeft` does not.
|
|
60
|
+
*/
|
|
52
61
|
placement?: PhiPickerPlacement;
|
|
53
62
|
showSearchBar?: boolean;
|
|
54
63
|
showFolderFilter?: boolean;
|