@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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How many skeleton rows a loading Table draws (TABLES.md, "Loading").
|
|
3
|
+
*
|
|
4
|
+
* Few on purpose: most Tables hold a handful of rows, and a Table that loads as a page of ten and then
|
|
5
|
+
* shows two shrinks under the reader's eyes and takes the Page below it up with it. Three rows grow into
|
|
6
|
+
* what arrives. A Table that is known to be long -- a paged listing that fills its page -- may state its
|
|
7
|
+
* own count in `presentation.loadingRows`, up to the most a Table may ask for.
|
|
8
|
+
*
|
|
9
|
+
* Imports nothing, so the Table Control and the Widget's config reader share it without the weight of
|
|
10
|
+
* either.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PHI_TABLE_LOADING_ROWS = 3;
|
|
13
|
+
/** The most skeleton rows a Table may ask for: a page of 25, the usual page. */
|
|
14
|
+
export declare const PHI_TABLE_LOADING_ROWS_MAX = 25;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How many skeleton rows a loading Table draws (TABLES.md, "Loading").
|
|
3
|
+
*
|
|
4
|
+
* Few on purpose: most Tables hold a handful of rows, and a Table that loads as a page of ten and then
|
|
5
|
+
* shows two shrinks under the reader's eyes and takes the Page below it up with it. Three rows grow into
|
|
6
|
+
* what arrives. A Table that is known to be long -- a paged listing that fills its page -- may state its
|
|
7
|
+
* own count in `presentation.loadingRows`, up to the most a Table may ask for.
|
|
8
|
+
*
|
|
9
|
+
* Imports nothing, so the Table Control and the Widget's config reader share it without the weight of
|
|
10
|
+
* either.
|
|
11
|
+
*/
|
|
12
|
+
export const PHI_TABLE_LOADING_ROWS = 3;
|
|
13
|
+
/** The most skeleton rows a Table may ask for: a page of 25, the usual page. */
|
|
14
|
+
export const PHI_TABLE_LOADING_ROWS_MAX = 25;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PHI_SHARED_PACKAGE_NAME, createPhiControllerSignalAddress } from "
|
|
1
|
+
import { PHI_SHARED_PACKAGE_NAME, createPhiControllerSignalAddress } from "../types/signals";
|
|
2
2
|
export const PHI_THREADS_CONTROLLER_PLUGIN_KEY = `${PHI_SHARED_PACKAGE_NAME}/modules/threads/controller`;
|
|
3
3
|
export const PHI_THREADS_CONTROLLER_KEY = "default";
|
|
4
4
|
export const PHI_THREADS_CONTROLLER_TYPE = `${PHI_THREADS_CONTROLLER_PLUGIN_KEY}/${PHI_THREADS_CONTROLLER_KEY}`;
|
package/constants.d.ts
CHANGED
|
@@ -5,11 +5,13 @@ export { buildPhiCmsWidgetNamespacedTypeKey, splitPhiCmsWidgetNamespacedTypeKey,
|
|
|
5
5
|
export * from "./constants/cms-plugin-categories";
|
|
6
6
|
export * from "./constants/runtime-module-categories";
|
|
7
7
|
export { PHI_THREAD_LIBRARY_DATA_PROVIDER_KEYS } from "./constants/thread-library-provider-keys";
|
|
8
|
+
export { PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS, PHI_CUSTOMER_FILE_RESOURCE_KEYS, } from "./constants/customer-file";
|
|
8
9
|
export { PHIS_AREA_HEADER, PHIS_FORM_RELAY_HEADER, PHIS_REQUEST_PATH_HEADER, PHIS_REQUEST_SEARCH_HEADER, PHIS_SITE_KEY_HEADER, PHIS_TOKEN_HEADER, } from "./constants/http-headers";
|
|
9
10
|
export { buildPhiFontSubsetDeliveryUrl, buildPhiImageAssetVariantDeliveryUrl, buildPhiMediaAssetContentDeliveryUrl, isPhiMediaAssetOriginalOptimizable, isPhiMediaAssetPublic, isPhiMediaSvgContentType, normalizePhiImageAssetVariantKey, normalizePhiMediaKind, PhiImageAssetVariantKey, PhiImageAssetVariantKeyName, type PhiImageAssetVariantSpec, type PhiMediaAssetFlag, PhiMediaAssetFlags, PhiMediaDeliveryPolicy, PhiMediaFolderFlags, PhiMediaKind, PhiMediaLifecycleStatus, resolvePhiImageAssetVariantKeyName, resolvePhiImageAssetVariantSpec, resolvePhiMediaKindFromContentType, } from "./constants/media";
|
|
10
11
|
export * from "./constants/support";
|
|
11
12
|
export * from "./constants/threads";
|
|
12
13
|
export * from "./constants/user-state";
|
|
13
14
|
export * from "./constants/media-library-provider-keys";
|
|
15
|
+
export * from "./constants/site-address";
|
|
14
16
|
export * from "./constants/module-identity";
|
|
15
17
|
export { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "./constants/core-data-provider-keys";
|
package/constants.js
CHANGED
|
@@ -6,11 +6,15 @@ export * from "./constants/cms-plugin-categories";
|
|
|
6
6
|
export * from "./constants/runtime-module-categories";
|
|
7
7
|
// The conversations a viewer is in, for every Module that lists its own kind of them (`fixedFilters`).
|
|
8
8
|
export { PHI_THREAD_LIBRARY_DATA_PROVIDER_KEYS } from "./constants/thread-library-provider-keys";
|
|
9
|
+
// Staff's customer file on one member, for a Module's own file Page over the same Core route (THREADS.md, 10).
|
|
10
|
+
export { PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS, PHI_CUSTOMER_FILE_RESOURCE_KEYS, } from "./constants/customer-file";
|
|
9
11
|
export { PHIS_AREA_HEADER, PHIS_FORM_RELAY_HEADER, PHIS_REQUEST_PATH_HEADER, PHIS_REQUEST_SEARCH_HEADER, PHIS_SITE_KEY_HEADER, PHIS_TOKEN_HEADER, } from "./constants/http-headers";
|
|
10
12
|
export { buildPhiFontSubsetDeliveryUrl, buildPhiImageAssetVariantDeliveryUrl, buildPhiMediaAssetContentDeliveryUrl, isPhiMediaAssetOriginalOptimizable, isPhiMediaAssetPublic, isPhiMediaSvgContentType, normalizePhiImageAssetVariantKey, normalizePhiMediaKind, PhiImageAssetVariantKey, PhiImageAssetVariantKeyName, PhiMediaAssetFlags, PhiMediaDeliveryPolicy, PhiMediaFolderFlags, PhiMediaKind, PhiMediaLifecycleStatus, resolvePhiImageAssetVariantKeyName, resolvePhiImageAssetVariantSpec, resolvePhiMediaKindFromContentType, } from "./constants/media";
|
|
11
13
|
export * from "./constants/support";
|
|
12
14
|
export * from "./constants/threads";
|
|
13
15
|
export * from "./constants/user-state";
|
|
14
16
|
export * from "./constants/media-library-provider-keys";
|
|
17
|
+
// The address tiles, for any Module whose Collection's items are addresses of a Site's book (COLLECTIONS.md).
|
|
18
|
+
export * from "./constants/site-address";
|
|
15
19
|
export * from "./constants/module-identity";
|
|
16
20
|
export { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "./constants/core-data-provider-keys";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The field keys a handler's `upstreamPath` names as `{key}` segments, in order. */
|
|
2
|
+
export declare function readPhiFormHandlerPathKeys(upstreamPath: string): string[];
|
|
3
|
+
/**
|
|
4
|
+
* Why a handler's `upstreamPath` cannot be filled, or null: a field named in two `{key}` segments would
|
|
5
|
+
* leave the relay two places for one value.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readPhiFormHandlerPathError(upstreamPath: string | null): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* The request a relayed submit makes (FORMS.md, "Request shape"): the path's `{key}` segments filled with
|
|
10
|
+
* those fields' values, percent-encoded, and those fields left out of the body, which is every other value
|
|
11
|
+
* as the Form holds it. A path value that is empty or no text or number refuses the submit: an address
|
|
12
|
+
* without it is another route.
|
|
13
|
+
*/
|
|
14
|
+
export declare function shapePhiFormHandlerRequest(input: {
|
|
15
|
+
upstreamPath: string;
|
|
16
|
+
values: unknown;
|
|
17
|
+
}): {
|
|
18
|
+
path: string;
|
|
19
|
+
body: Record<string, unknown>;
|
|
20
|
+
} | {
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isPhiRecord } from "../helpers/is-record";
|
|
2
|
+
const PATH_PLACEHOLDER = /\{([A-Za-z][A-Za-z0-9_]*)\}/gu;
|
|
3
|
+
/** The field keys a handler's `upstreamPath` names as `{key}` segments, in order. */
|
|
4
|
+
export function readPhiFormHandlerPathKeys(upstreamPath) {
|
|
5
|
+
return [...upstreamPath.matchAll(PATH_PLACEHOLDER)].map((match) => match[1]);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Why a handler's `upstreamPath` cannot be filled, or null: a field named in two `{key}` segments would
|
|
9
|
+
* leave the relay two places for one value.
|
|
10
|
+
*/
|
|
11
|
+
export function readPhiFormHandlerPathError(upstreamPath) {
|
|
12
|
+
const named = new Set();
|
|
13
|
+
for (const key of upstreamPath ? readPhiFormHandlerPathKeys(upstreamPath) : []) {
|
|
14
|
+
if (named.has(key))
|
|
15
|
+
return `field "${key}" is named more than once`;
|
|
16
|
+
named.add(key);
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The request a relayed submit makes (FORMS.md, "Request shape"): the path's `{key}` segments filled with
|
|
22
|
+
* those fields' values, percent-encoded, and those fields left out of the body, which is every other value
|
|
23
|
+
* as the Form holds it. A path value that is empty or no text or number refuses the submit: an address
|
|
24
|
+
* without it is another route.
|
|
25
|
+
*/
|
|
26
|
+
export function shapePhiFormHandlerRequest(input) {
|
|
27
|
+
const values = isPhiRecord(input.values) ? { ...input.values } : {};
|
|
28
|
+
let missing = null;
|
|
29
|
+
const path = input.upstreamPath.replace(PATH_PLACEHOLDER, (_segment, key) => {
|
|
30
|
+
const value = values[key];
|
|
31
|
+
delete values[key];
|
|
32
|
+
const text = typeof value === "number" && Number.isFinite(value) ? String(value) : typeof value === "string" ? value.trim() : "";
|
|
33
|
+
if (!text)
|
|
34
|
+
missing ??= key;
|
|
35
|
+
return encodeURIComponent(text);
|
|
36
|
+
});
|
|
37
|
+
if (missing)
|
|
38
|
+
return { error: `The form has no value for "${missing}", which the address of its handler needs.` };
|
|
39
|
+
return { path, body: values };
|
|
40
|
+
}
|
package/gateway/label-set.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { type PhiGlobalTranslatorOptions } from "./tr";
|
|
3
|
+
import { type PhiCountLabel } from "../helpers/translation-format";
|
|
3
4
|
import type { PhiRuntimeModuleDefinition } from "../types/cms-plugins";
|
|
4
5
|
/**
|
|
5
6
|
* One label, and optionally the register it is written in.
|
|
@@ -12,6 +13,16 @@ import type { PhiRuntimeModuleDefinition } from "../types/cms-plugins";
|
|
|
12
13
|
export type PhiLabelSetEntry = string | {
|
|
13
14
|
text: string;
|
|
14
15
|
ctx: string;
|
|
16
|
+
} | PhiLabelSetCountEntry;
|
|
17
|
+
/**
|
|
18
|
+
* A label that says a count: one template per plural category, `other` required (TRANSLATIONS.md,
|
|
19
|
+
* "Count labels"). It reads back as a `PhiCountLabel` and is formatted with `formatPhiCountLabel`, never
|
|
20
|
+
* by a Widget's own `count === 1` branch. `ctx` names its register as a `{ text, ctx }` entry does;
|
|
21
|
+
* absent, it takes the set's.
|
|
22
|
+
*/
|
|
23
|
+
export type PhiLabelSetCountEntry = {
|
|
24
|
+
count: PhiCountLabel;
|
|
25
|
+
ctx?: string;
|
|
15
26
|
};
|
|
16
27
|
export type PhiLabelSetLabels = Record<string, PhiLabelSetEntry>;
|
|
17
28
|
/**
|
|
@@ -21,9 +32,11 @@ export type PhiLabelSetLabels = Record<string, PhiLabelSetEntry>;
|
|
|
21
32
|
* thing in the width of the text itself. Any other register is still written as the plain object.
|
|
22
33
|
*/
|
|
23
34
|
export declare function definePhiMessageLabel(text: string): PhiLabelSetEntry;
|
|
24
|
-
/**
|
|
35
|
+
/** A count label, `{ one: "%1 page", other: "%1 pages" }`, in the set's register unless `ctx` names another. */
|
|
36
|
+
export declare function definePhiCountLabel(count: PhiCountLabel, ctx?: string): PhiLabelSetCountEntry;
|
|
37
|
+
/** What a set reads as once translated: the same keys, plain text, and a count label for a count label. */
|
|
25
38
|
export type PhiLabelSetTexts<TLabels extends PhiLabelSetLabels> = {
|
|
26
|
-
[K in keyof TLabels]: string;
|
|
39
|
+
[K in keyof TLabels]: TLabels[K] extends PhiLabelSetCountEntry ? PhiCountLabel : string;
|
|
27
40
|
};
|
|
28
41
|
export type PhiLabelSetDefinition<TLabels extends PhiLabelSetLabels> = {
|
|
29
42
|
key: string;
|
package/gateway/label-set.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { createGlobalTranslator, PHI_TR_CTX_WEB_UI_MESSAGE, } from "./tr";
|
|
3
3
|
import { PHI_CANONICAL_SOURCE_LOCALE, isPhiLocaleReadableAsSource, resolvePhiTranslationLocale, } from "../helpers/locale";
|
|
4
|
+
import { PHI_PLURAL_CATEGORIES, } from "../helpers/translation-format";
|
|
4
5
|
import { resolvePhiRuntimeModuleSourceLocale } from "../types/runtime-module-locale";
|
|
5
6
|
/**
|
|
6
7
|
* One label that is a sentence rather than a caption, in a set that is otherwise captions.
|
|
@@ -11,10 +12,48 @@ import { resolvePhiRuntimeModuleSourceLocale } from "../types/runtime-module-loc
|
|
|
11
12
|
export function definePhiMessageLabel(text) {
|
|
12
13
|
return { text, ctx: PHI_TR_CTX_WEB_UI_MESSAGE };
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/** A count label, `{ one: "%1 page", other: "%1 pages" }`, in the set's register unless `ctx` names another. */
|
|
16
|
+
export function definePhiCountLabel(count, ctx) {
|
|
17
|
+
return ctx === undefined ? { count } : { count, ctx };
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The register a count label's category is translated in: the label's own, saying which form it is. The
|
|
21
|
+
* category belongs to the translation's identity because English often writes two forms alike -- "%1
|
|
22
|
+
* configured" is `one` and `other` both -- where a translator's language does not; under the bare register
|
|
23
|
+
* they would be one message with one answer. It also tells the translator which form to write.
|
|
24
|
+
*/
|
|
25
|
+
function readCountCategoryContext(ctx, category) {
|
|
26
|
+
return `${ctx}, plural category ${category}`;
|
|
27
|
+
}
|
|
28
|
+
function readLabelSetUnits(key, entry, setContext) {
|
|
29
|
+
if (typeof entry === "string") {
|
|
30
|
+
return [{ key, category: null, text: entry, ctx: setContext }];
|
|
31
|
+
}
|
|
32
|
+
if ("count" in entry) {
|
|
33
|
+
const ctx = entry.ctx ?? setContext;
|
|
34
|
+
return PHI_PLURAL_CATEGORIES.flatMap((category) => {
|
|
35
|
+
const text = entry.count[category];
|
|
36
|
+
return text === undefined
|
|
37
|
+
? []
|
|
38
|
+
: [{ key, category, text, ctx: readCountCategoryContext(ctx, category) }];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return [{ key, category: null, text: entry.text, ctx: entry.ctx }];
|
|
42
|
+
}
|
|
43
|
+
/** The units read back into the set's shape: a label's text, or a count label's categories. */
|
|
44
|
+
function assembleLabelSetTexts(units, readText) {
|
|
45
|
+
const labels = {};
|
|
46
|
+
units.forEach((unit, index) => {
|
|
47
|
+
const text = readText(unit, index);
|
|
48
|
+
if (unit.category === null) {
|
|
49
|
+
labels[unit.key] = text;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const count = (labels[unit.key] ?? {});
|
|
53
|
+
count[unit.category] = text;
|
|
54
|
+
labels[unit.key] = count;
|
|
55
|
+
});
|
|
56
|
+
return labels;
|
|
18
57
|
}
|
|
19
58
|
export function definePhiLabelSet(definition) {
|
|
20
59
|
return definition;
|
|
@@ -34,34 +73,33 @@ export function definePhiRuntimeModuleLabelSet(moduleDefinition, definition) {
|
|
|
34
73
|
export async function getPhiLabelSet(options, definition) {
|
|
35
74
|
const sourceLocale = resolvePhiTranslationLocale(definition.sourceLocale ?? options.sourceLocale ?? PHI_CANONICAL_SOURCE_LOCALE);
|
|
36
75
|
const targetLocale = resolvePhiTranslationLocale(options.locale);
|
|
37
|
-
const
|
|
38
|
-
.
|
|
76
|
+
const units = Object.entries(definition.labels)
|
|
77
|
+
.flatMap(([key, value]) => readLabelSetUnits(key, value, definition.ctx));
|
|
39
78
|
if (isPhiLocaleReadableAsSource(targetLocale, sourceLocale)) {
|
|
40
|
-
|
|
41
|
-
return labels;
|
|
79
|
+
return assembleLabelSetTexts(units, (unit) => unit.text);
|
|
42
80
|
}
|
|
43
81
|
/*
|
|
44
82
|
* One request per register rather than one per label: a set is nearly all one register, so this is
|
|
45
83
|
* the same single batch it always was plus one more for the handful of entries that are a sentence
|
|
46
|
-
* rather than a caption
|
|
84
|
+
* rather than a caption, and one per plural category a count label states. The batches run together,
|
|
85
|
+
* and each keeps its own translation identity; each answer goes back to its unit by position.
|
|
47
86
|
*/
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const group =
|
|
51
|
-
group.push(
|
|
52
|
-
|
|
53
|
-
}
|
|
87
|
+
const unitsByContext = new Map();
|
|
88
|
+
units.forEach((unit, index) => {
|
|
89
|
+
const group = unitsByContext.get(unit.ctx) ?? [];
|
|
90
|
+
group.push(index);
|
|
91
|
+
unitsByContext.set(unit.ctx, group);
|
|
92
|
+
});
|
|
54
93
|
const translator = createGlobalTranslator({ ...options, sourceLocale });
|
|
55
|
-
const
|
|
56
|
-
await Promise.all([...
|
|
57
|
-
const translated = await translator.trBulk(group.map((
|
|
94
|
+
const translatedByUnit = [];
|
|
95
|
+
await Promise.all([...unitsByContext].map(async ([context, group]) => {
|
|
96
|
+
const translated = await translator.trBulk(group.map((index) => units[index].text), context);
|
|
58
97
|
if (translated.length !== group.length) {
|
|
59
98
|
throw new Error(`Label set length mismatch for "${definition.key}".`);
|
|
60
99
|
}
|
|
61
|
-
group.forEach((
|
|
62
|
-
|
|
100
|
+
group.forEach((unitIndex, index) => {
|
|
101
|
+
translatedByUnit[unitIndex] = translated[index];
|
|
63
102
|
});
|
|
64
103
|
}));
|
|
65
|
-
|
|
66
|
-
return labels;
|
|
104
|
+
return assembleLabelSetTexts(units, (unit, index) => translatedByUnit[index] ?? unit.text);
|
|
67
105
|
}
|
|
@@ -3,7 +3,16 @@ import { isPhiCmsAreaKey } from "../constants/cms-areas";
|
|
|
3
3
|
import { isPhiRecord } from "../helpers/is-record";
|
|
4
4
|
import { buildPhiRuntimeModuleWidgetType } from "../plugins/runtime-modules/contracts";
|
|
5
5
|
import { isPhiConfigError } from "../components/widgets/config/strict-config-reader";
|
|
6
|
+
import { checkPhiWidgetBinding, checkPhiWidgetConfigIcons, } from "../helpers/widget-binding-check";
|
|
6
7
|
import { jsonResponse } from "./route-handler-helpers";
|
|
8
|
+
function buildDataProvidersByKey(catalog) {
|
|
9
|
+
const providers = new Map();
|
|
10
|
+
for (const entry of catalog.values()) {
|
|
11
|
+
for (const provider of entry.definition.dataProviders ?? [])
|
|
12
|
+
providers.set(provider.key, provider);
|
|
13
|
+
}
|
|
14
|
+
return providers;
|
|
15
|
+
}
|
|
7
16
|
function buildWidgetDefinitionsByType(catalog) {
|
|
8
17
|
const definitions = new Map();
|
|
9
18
|
for (const entry of catalog.values()) {
|
|
@@ -13,7 +22,7 @@ function buildWidgetDefinitionsByType(catalog) {
|
|
|
13
22
|
}
|
|
14
23
|
return definitions;
|
|
15
24
|
}
|
|
16
|
-
function findConfigIssue(body, definitions) {
|
|
25
|
+
function findConfigIssue(body, definitions, providers) {
|
|
17
26
|
const pending = [body];
|
|
18
27
|
while (pending.length > 0) {
|
|
19
28
|
const value = pending.pop();
|
|
@@ -28,8 +37,9 @@ function findConfigIssue(body, definitions) {
|
|
|
28
37
|
if (typeof widgetType === "string" && isPhiRecord(config)) {
|
|
29
38
|
const definition = definitions.get(widgetType);
|
|
30
39
|
if (definition) {
|
|
40
|
+
let parsed;
|
|
31
41
|
try {
|
|
32
|
-
definition.parseConfig(config);
|
|
42
|
+
parsed = definition.parseConfig(config);
|
|
33
43
|
}
|
|
34
44
|
catch (error) {
|
|
35
45
|
/*
|
|
@@ -44,6 +54,12 @@ function findConfigIssue(body, definitions) {
|
|
|
44
54
|
message: error instanceof Error ? error.message : String(error),
|
|
45
55
|
};
|
|
46
56
|
}
|
|
57
|
+
const [icon] = checkPhiWidgetConfigIcons(definition.fields, config);
|
|
58
|
+
const [binding] = checkPhiWidgetBinding(widgetType, isPhiRecord(parsed) ? parsed : config, providers);
|
|
59
|
+
const message = binding ?? icon;
|
|
60
|
+
if (message) {
|
|
61
|
+
return { widgetType, nodeId: value.id ?? null, path: null, message };
|
|
62
|
+
}
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
65
|
pending.push(...Object.values(value));
|
|
@@ -65,7 +81,7 @@ export async function validatePhiCmsStructureWrite(request, loadAreaBridge) {
|
|
|
65
81
|
const bridge = await loadAreaBridge(area);
|
|
66
82
|
if (!bridge)
|
|
67
83
|
return null;
|
|
68
|
-
const issue = findConfigIssue(body, buildWidgetDefinitionsByType(bridge.runtimeModuleCatalog));
|
|
84
|
+
const issue = findConfigIssue(body, buildWidgetDefinitionsByType(bridge.runtimeModuleCatalog), buildDataProvidersByKey(bridge.runtimeModuleCatalog));
|
|
69
85
|
if (!issue)
|
|
70
86
|
return null;
|
|
71
87
|
return jsonResponse({
|
|
@@ -2,6 +2,7 @@ import { buildPhiFormSubmitRouteFromHandlerProvider, resolvePhiFormSubmitTarget,
|
|
|
2
2
|
import { resolvePhiServerFormHandler } from "./form-handler-resolution";
|
|
3
3
|
import { PHIS_FORM_RELAY_HEADER, PHIS_SITE_KEY_HEADER } from "../constants/http-headers";
|
|
4
4
|
import { isPhiRecord } from "../helpers/is-record";
|
|
5
|
+
import { shapePhiFormHandlerRequest } from "./form-handler-request";
|
|
5
6
|
const PHI_SITE_SESSION_COOKIE_NAME = "phis_session";
|
|
6
7
|
const PHI_AUTH_LINK_COOKIE_NAME = "phis_auth_link";
|
|
7
8
|
/** Core's double-submit pair: the cookie `/api/auth/csrf` sets and the header that repeats it. */
|
|
@@ -264,10 +265,18 @@ export function buildPhiSiteFormRouteHandlers({ upstreamBaseUrl, buildHeaders, t
|
|
|
264
265
|
proxyHeaders.set(PHI_CSRF_HEADER_NAME, csrfToken);
|
|
265
266
|
appendCookieHeader(proxyHeaders, `${PHI_CSRF_COOKIE_NAME}=${csrfToken}`);
|
|
266
267
|
}
|
|
267
|
-
|
|
268
|
+
// The values as the handler's route takes them: its path's `{key}` segments filled.
|
|
269
|
+
const shaped = shapePhiFormHandlerRequest({
|
|
270
|
+
upstreamPath: target.upstreamPath ?? "",
|
|
271
|
+
values: body.values,
|
|
272
|
+
});
|
|
273
|
+
if ("error" in shaped) {
|
|
274
|
+
return toJsonResponse({ ok: false, error: shaped.error }, 400);
|
|
275
|
+
}
|
|
276
|
+
const upstreamResponse = await fetch(`${upstreamBaseUrl}${shaped.path}`, {
|
|
268
277
|
method: descriptor.method,
|
|
269
278
|
headers: headersToPlainObject(proxyHeaders),
|
|
270
|
-
body: JSON.stringify(body
|
|
279
|
+
body: JSON.stringify(shaped.body),
|
|
271
280
|
cache: "no-store",
|
|
272
281
|
signal: AbortSignal.timeout(timeoutMs),
|
|
273
282
|
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PhisSiteAddressInput } from "@phis/contracts/users";
|
|
2
|
+
/** The parts of an address a person writes (`PhisSiteAddressInput`), in the order the `address` field asks them. */
|
|
3
|
+
export declare const PHI_ADDRESS_PARTS: readonly ["name", "companyName", "line1", "line2", "postalCode", "city", "region", "country"];
|
|
4
|
+
export type PhiAddressPart = (typeof PHI_ADDRESS_PARTS)[number];
|
|
5
|
+
/** The parts Core refuses an address without (phis-server `readPhisSiteAddressInput`). */
|
|
6
|
+
export declare const PHI_ADDRESS_REQUIRED_PARTS: readonly ["name", "line1", "city", "country"];
|
|
7
|
+
/** The widths of `phis.site_addresses` Core holds each text part to; the country is a code. */
|
|
8
|
+
export declare const PHI_ADDRESS_PART_MAX_LENGTHS: {
|
|
9
|
+
readonly companyName: 256;
|
|
10
|
+
readonly name: 256;
|
|
11
|
+
readonly line1: 256;
|
|
12
|
+
readonly line2: 256;
|
|
13
|
+
readonly postalCode: 32;
|
|
14
|
+
readonly city: 128;
|
|
15
|
+
readonly region: 128;
|
|
16
|
+
};
|
|
17
|
+
type PhiAddressTextPart = keyof typeof PHI_ADDRESS_PART_MAX_LENGTHS;
|
|
18
|
+
/**
|
|
19
|
+
* The `address` field's value as a Form holds it: every part of `PhisSiteAddressInput`, an empty optional
|
|
20
|
+
* part `null`, an empty required part `""`. Read leniently -- it is what somebody is typing -- and never
|
|
21
|
+
* thrown on; whether it can be sent is `findPhiAddressProblems`'s answer.
|
|
22
|
+
*/
|
|
23
|
+
export declare function readPhiAddressFieldValue(value: unknown): PhisSiteAddressInput;
|
|
24
|
+
/** The value a part change makes: the part written, an empty optional part `null` again. */
|
|
25
|
+
export declare function writePhiAddressFieldPart(value: PhisSiteAddressInput, part: PhiAddressPart, next: string | null): PhisSiteAddressInput;
|
|
26
|
+
export type PhiAddressProblem = {
|
|
27
|
+
part: PhiAddressPart;
|
|
28
|
+
kind: "required";
|
|
29
|
+
} | {
|
|
30
|
+
part: PhiAddressTextPart;
|
|
31
|
+
kind: "tooLong";
|
|
32
|
+
max: number;
|
|
33
|
+
} | {
|
|
34
|
+
part: "country";
|
|
35
|
+
kind: "country";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* What keeps the address from being one Core takes, part by part in the field's order: a required part
|
|
39
|
+
* empty (after trimming, as Core trims), a part longer than its column, a country that is no ISO 3166-1
|
|
40
|
+
* alpha-2 code.
|
|
41
|
+
*/
|
|
42
|
+
export declare function findPhiAddressProblems(value: PhisSiteAddressInput): PhiAddressProblem[];
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { readPhiCountryCode } from "../constants/countries";
|
|
2
|
+
import { isPhiRecord } from "./is-record";
|
|
3
|
+
/** The parts of an address a person writes (`PhisSiteAddressInput`), in the order the `address` field asks them. */
|
|
4
|
+
export const PHI_ADDRESS_PARTS = ["name", "companyName", "line1", "line2", "postalCode", "city", "region", "country"];
|
|
5
|
+
/** The parts Core refuses an address without (phis-server `readPhisSiteAddressInput`). */
|
|
6
|
+
export const PHI_ADDRESS_REQUIRED_PARTS = ["name", "line1", "city", "country"];
|
|
7
|
+
/** The widths of `phis.site_addresses` Core holds each text part to; the country is a code. */
|
|
8
|
+
export const PHI_ADDRESS_PART_MAX_LENGTHS = {
|
|
9
|
+
companyName: 256,
|
|
10
|
+
name: 256,
|
|
11
|
+
line1: 256,
|
|
12
|
+
line2: 256,
|
|
13
|
+
postalCode: 32,
|
|
14
|
+
city: 128,
|
|
15
|
+
region: 128,
|
|
16
|
+
};
|
|
17
|
+
const OPTIONAL_PARTS = new Set(["companyName", "line2", "postalCode", "region"]);
|
|
18
|
+
/**
|
|
19
|
+
* The `address` field's value as a Form holds it: every part of `PhisSiteAddressInput`, an empty optional
|
|
20
|
+
* part `null`, an empty required part `""`. Read leniently -- it is what somebody is typing -- and never
|
|
21
|
+
* thrown on; whether it can be sent is `findPhiAddressProblems`'s answer.
|
|
22
|
+
*/
|
|
23
|
+
export function readPhiAddressFieldValue(value) {
|
|
24
|
+
const record = isPhiRecord(value) ? value : {};
|
|
25
|
+
const part = (key) => {
|
|
26
|
+
const raw = typeof record[key] === "string" ? record[key] : "";
|
|
27
|
+
return OPTIONAL_PARTS.has(key) && !raw ? null : raw;
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
name: part("name") ?? "",
|
|
31
|
+
companyName: part("companyName"),
|
|
32
|
+
line1: part("line1") ?? "",
|
|
33
|
+
line2: part("line2"),
|
|
34
|
+
postalCode: part("postalCode"),
|
|
35
|
+
city: part("city") ?? "",
|
|
36
|
+
region: part("region"),
|
|
37
|
+
country: part("country") ?? "",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** The value a part change makes: the part written, an empty optional part `null` again. */
|
|
41
|
+
export function writePhiAddressFieldPart(value, part, next) {
|
|
42
|
+
const text = next ?? "";
|
|
43
|
+
return { ...value, [part]: OPTIONAL_PARTS.has(part) && !text ? null : text };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* What keeps the address from being one Core takes, part by part in the field's order: a required part
|
|
47
|
+
* empty (after trimming, as Core trims), a part longer than its column, a country that is no ISO 3166-1
|
|
48
|
+
* alpha-2 code.
|
|
49
|
+
*/
|
|
50
|
+
export function findPhiAddressProblems(value) {
|
|
51
|
+
const problems = [];
|
|
52
|
+
for (const part of PHI_ADDRESS_PARTS) {
|
|
53
|
+
const text = (value[part] ?? "").trim();
|
|
54
|
+
if (PHI_ADDRESS_REQUIRED_PARTS.includes(part) && !text) {
|
|
55
|
+
problems.push({ part, kind: "required" });
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (part === "country") {
|
|
59
|
+
if (!readPhiCountryCode(text))
|
|
60
|
+
problems.push({ part, kind: "country" });
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const max = PHI_ADDRESS_PART_MAX_LENGTHS[part];
|
|
64
|
+
if (text.length > max)
|
|
65
|
+
problems.push({ part, kind: "tooLong", max });
|
|
66
|
+
}
|
|
67
|
+
return problems;
|
|
68
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PhiSignalValueSchema } from "../types/signals";
|
|
2
|
+
/**
|
|
3
|
+
* An action announced on the action channel, by whichever of the two announcers said it: a Table's
|
|
4
|
+
* `table-action` (`{ actionKey, rowIdentity }`) or a Collection View's `collection-action`
|
|
5
|
+
* (`{ actionKey, itemKey }`). Both name the action in the message, so every listener decides by its own
|
|
6
|
+
* `openActionKey` whether it was meant, and the record either names is `recordKey` -- a row's identity, an
|
|
7
|
+
* item's key, `null` for a toolbar action.
|
|
8
|
+
*
|
|
9
|
+
* `undefined` for a route of any other schema: not an announcement at all, and the caller treats it as it
|
|
10
|
+
* always did. `null` for an announcement that cannot be read.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readPhiAnnouncedAction(valueSchema: PhiSignalValueSchema | null | undefined, value: unknown): {
|
|
13
|
+
actionKey: string;
|
|
14
|
+
recordKey: string | number | null;
|
|
15
|
+
} | null | undefined;
|
|
16
|
+
/** Whether a route carries an announced action, a Table's or a Collection View's. */
|
|
17
|
+
export declare function isPhiAnnouncedActionSchema(valueSchema: PhiSignalValueSchema | null | undefined): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../types/signals";
|
|
2
|
+
import { readPhiTableActionSignalValue } from "../types/table-signal-values";
|
|
3
|
+
import { readPhiCollectionActionSignalValue } from "../types/collection-signal-values";
|
|
4
|
+
/**
|
|
5
|
+
* An action announced on the action channel, by whichever of the two announcers said it: a Table's
|
|
6
|
+
* `table-action` (`{ actionKey, rowIdentity }`) or a Collection View's `collection-action`
|
|
7
|
+
* (`{ actionKey, itemKey }`). Both name the action in the message, so every listener decides by its own
|
|
8
|
+
* `openActionKey` whether it was meant, and the record either names is `recordKey` -- a row's identity, an
|
|
9
|
+
* item's key, `null` for a toolbar action.
|
|
10
|
+
*
|
|
11
|
+
* `undefined` for a route of any other schema: not an announcement at all, and the caller treats it as it
|
|
12
|
+
* always did. `null` for an announcement that cannot be read.
|
|
13
|
+
*/
|
|
14
|
+
export function readPhiAnnouncedAction(valueSchema, value) {
|
|
15
|
+
if (valueSchema === PHI_SIGNAL_VALUE_SCHEMAS.tableAction) {
|
|
16
|
+
const action = readPhiTableActionSignalValue(value);
|
|
17
|
+
return action ? { actionKey: action.actionKey, recordKey: action.rowIdentity ?? null } : null;
|
|
18
|
+
}
|
|
19
|
+
if (valueSchema === PHI_SIGNAL_VALUE_SCHEMAS.collectionAction) {
|
|
20
|
+
const action = readPhiCollectionActionSignalValue(value);
|
|
21
|
+
return action ? { actionKey: action.actionKey, recordKey: action.itemKey ?? null } : null;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Whether a route carries an announced action, a Table's or a Collection View's. */
|
|
26
|
+
export function isPhiAnnouncedActionSchema(valueSchema) {
|
|
27
|
+
return valueSchema === PHI_SIGNAL_VALUE_SCHEMAS.tableAction ||
|
|
28
|
+
valueSchema === PHI_SIGNAL_VALUE_SCHEMAS.collectionAction;
|
|
29
|
+
}
|
package/helpers/cms-dialog.d.ts
CHANGED
|
@@ -42,13 +42,10 @@ export declare const PHI_DIALOG_COMMANDS_CONFIG: {
|
|
|
42
42
|
/**
|
|
43
43
|
* A dialog's width where it names none and its Form needs two columns: the reading measure, which is also
|
|
44
44
|
* where a Form's own cap lies, so a Form fills the dialog it opens in. A wider one -- a table, a preview
|
|
45
|
-
* -- says so, and takes its width from the same sequence (`PHI_LAYOUT`).
|
|
45
|
+
* -- says so, and takes its width from the same sequence (`PHI_LAYOUT`). A dialog states it as
|
|
46
|
+
* `size: { width: PHI_DIALOG_WIDTH }`.
|
|
46
47
|
*/
|
|
47
|
-
export declare const PHI_DIALOG_WIDTH:
|
|
48
|
-
readonly compact: "calc(100vw - 32px)";
|
|
49
|
-
readonly medium: 610;
|
|
50
|
-
readonly wide: 610;
|
|
51
|
-
};
|
|
48
|
+
export declare const PHI_DIALOG_WIDTH: 610;
|
|
52
49
|
/**
|
|
53
50
|
* A dialog's width where its Form stands in one column.
|
|
54
51
|
*
|
|
@@ -58,11 +55,7 @@ export declare const PHI_DIALOG_WIDTH: {
|
|
|
58
55
|
* (`PHI_FORM_RESPONSIVE_MIN_WIDTH.medium`, the same 377), and the Form stands inside the body's inset.
|
|
59
56
|
* So it is that measure plus the inset on both sides -- the Theme's `base` step, whatever it is set to.
|
|
60
57
|
*/
|
|
61
|
-
export declare const PHI_DIALOG_WIDTH_SINGLE_COLUMN:
|
|
62
|
-
readonly compact: "calc(100vw - 32px)";
|
|
63
|
-
readonly medium: "calc(377px + 2 * var(--phi-padding))";
|
|
64
|
-
readonly wide: "calc(377px + 2 * var(--phi-padding))";
|
|
65
|
-
};
|
|
58
|
+
export declare const PHI_DIALOG_WIDTH_SINGLE_COLUMN: string;
|
|
66
59
|
/**
|
|
67
60
|
* Whether a Form stands in one column wherever it can stand in two.
|
|
68
61
|
*
|
|
@@ -75,12 +68,4 @@ export declare const PHI_DIALOG_WIDTH_SINGLE_COLUMN: {
|
|
|
75
68
|
*/
|
|
76
69
|
export declare function isPhiFormSingleColumn(descriptor: PhiFormDescriptor): boolean;
|
|
77
70
|
/** The width a dialog takes for the Form in its body: `PHI_DIALOG_WIDTH_SINGLE_COLUMN` or `PHI_DIALOG_WIDTH`. */
|
|
78
|
-
export declare function resolvePhiDialogFormWidth(descriptor: PhiFormDescriptor):
|
|
79
|
-
readonly compact: "calc(100vw - 32px)";
|
|
80
|
-
readonly medium: 610;
|
|
81
|
-
readonly wide: 610;
|
|
82
|
-
} | {
|
|
83
|
-
readonly compact: "calc(100vw - 32px)";
|
|
84
|
-
readonly medium: "calc(377px + 2 * var(--phi-padding))";
|
|
85
|
-
readonly wide: "calc(377px + 2 * var(--phi-padding))";
|
|
86
|
-
};
|
|
71
|
+
export declare function resolvePhiDialogFormWidth(descriptor: PhiFormDescriptor): number | string;
|
package/helpers/cms-dialog.js
CHANGED
|
@@ -20,8 +20,10 @@ import { PHI_LAYOUT } from "../theme/phi-tokens";
|
|
|
20
20
|
* - The actions are one compact group, labelled, at the medium size: a dialog asks one question and its
|
|
21
21
|
* answers belong together.
|
|
22
22
|
* - The width is as wide as its Form needs: the reading measure for a Form of two columns, the narrowest
|
|
23
|
-
* width that keeps a Form's labels beside its fields for one of one column
|
|
24
|
-
*
|
|
23
|
+
* width that keeps a Form's labels beside its fields for one of one column. A table or an editor states
|
|
24
|
+
* a wider one. It is the width of the Overlay's `size`, a block's length (OVERLAYS.md, "Presentation config"),
|
|
25
|
+
* and the Modal holds it inside the viewport itself, so a phone gets the full width less the gutter
|
|
26
|
+
* without a second value.
|
|
25
27
|
*/
|
|
26
28
|
/** The body Layout's config: a vertical Flex with the `panel` creation preset under it. */
|
|
27
29
|
export const PHI_DIALOG_BODY_CONFIG = {
|
|
@@ -44,13 +46,10 @@ export const PHI_DIALOG_COMMANDS_CONFIG = {
|
|
|
44
46
|
/**
|
|
45
47
|
* A dialog's width where it names none and its Form needs two columns: the reading measure, which is also
|
|
46
48
|
* where a Form's own cap lies, so a Form fills the dialog it opens in. A wider one -- a table, a preview
|
|
47
|
-
* -- says so, and takes its width from the same sequence (`PHI_LAYOUT`).
|
|
49
|
+
* -- says so, and takes its width from the same sequence (`PHI_LAYOUT`). A dialog states it as
|
|
50
|
+
* `size: { width: PHI_DIALOG_WIDTH }`.
|
|
48
51
|
*/
|
|
49
|
-
export const PHI_DIALOG_WIDTH =
|
|
50
|
-
compact: "calc(100vw - 32px)",
|
|
51
|
-
medium: PHI_LAYOUT.contentMax,
|
|
52
|
-
wide: PHI_LAYOUT.contentMax,
|
|
53
|
-
};
|
|
52
|
+
export const PHI_DIALOG_WIDTH = PHI_LAYOUT.contentMax;
|
|
54
53
|
/**
|
|
55
54
|
* A dialog's width where its Form stands in one column.
|
|
56
55
|
*
|
|
@@ -60,11 +59,7 @@ export const PHI_DIALOG_WIDTH = {
|
|
|
60
59
|
* (`PHI_FORM_RESPONSIVE_MIN_WIDTH.medium`, the same 377), and the Form stands inside the body's inset.
|
|
61
60
|
* So it is that measure plus the inset on both sides -- the Theme's `base` step, whatever it is set to.
|
|
62
61
|
*/
|
|
63
|
-
export const PHI_DIALOG_WIDTH_SINGLE_COLUMN = {
|
|
64
|
-
compact: PHI_DIALOG_WIDTH.compact,
|
|
65
|
-
medium: `calc(${PHI_LAYOUT.contentMaxNarrow}px + 2 * ${PHI_DIALOG_BODY_CONFIG.padding})`,
|
|
66
|
-
wide: `calc(${PHI_LAYOUT.contentMaxNarrow}px + 2 * ${PHI_DIALOG_BODY_CONFIG.padding})`,
|
|
67
|
-
};
|
|
62
|
+
export const PHI_DIALOG_WIDTH_SINGLE_COLUMN = `calc(${PHI_LAYOUT.contentMaxNarrow}px + 2 * ${PHI_DIALOG_BODY_CONFIG.padding})`;
|
|
68
63
|
/** The widths at which a Form's labels stand beside its fields, and so the ones that have columns. */
|
|
69
64
|
const PHI_DIALOG_FORM_COLUMN_MODES = ["medium", "wide"];
|
|
70
65
|
/**
|
|
@@ -90,6 +90,16 @@ export declare function resolvePhiBuilderCatalogPathForCatalog(area: PhiBuilderP
|
|
|
90
90
|
* matched against the storage path or nothing outside Public would ever be found.
|
|
91
91
|
*/
|
|
92
92
|
export declare function findPhiBuilderPageKeyFromStoragePath(area: PhiBuilderPageCatalogArea, path: string, pages: readonly PhiPresetPageNode[]): string | null;
|
|
93
|
+
/**
|
|
94
|
+
* The key of the Module Page a preset identity names, wherever its path stands now.
|
|
95
|
+
*
|
|
96
|
+
* A Module Page is stored and addressed by `ownerModuleId` + `presetKey`, never by path: a revision scope
|
|
97
|
+
* of one carries no path at all, so looking it up by path finds nothing.
|
|
98
|
+
*/
|
|
99
|
+
export declare function findPhiBuilderPageKeyFromPresetSource(source: {
|
|
100
|
+
ownerModuleId: string;
|
|
101
|
+
presetKey: string;
|
|
102
|
+
}, pages: readonly PhiPresetPageNode[]): string | null;
|
|
93
103
|
export declare function resolvePhiBuilderPageKeyFromCatalogPath(area: PhiBuilderPageCatalogArea, path: string, pages: readonly PhiPresetPageNode[]): string;
|
|
94
104
|
export type PhiBuilderPersistedPageCatalogEntry = {
|
|
95
105
|
id: number;
|