@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createElement, useCallback, useEffect, useMemo } from "react";
|
|
2
|
+
import { createElement, useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
3
|
import { useRouter } from "next/navigation";
|
|
4
4
|
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
|
|
5
5
|
import { readPhiTableBindingParamsSignalValue } from "../../../../types/table-signal-values";
|
|
@@ -9,13 +9,13 @@ import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../compon
|
|
|
9
9
|
import { dispatchPhiSignalCapability } from "../../../../components/runtime/runtime-signal-identity";
|
|
10
10
|
import { usePhiApplicationFeedback } from "../../../../components/runtime/use-phi-application-feedback";
|
|
11
11
|
import { getPhiWorkspaceCatalogSnapshot, usePhiWorkspaceCatalogValue, } from "../../../../components/workspace/catalog-store";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { findPhiBuilderPageKeyFromStoragePath, resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
|
|
12
|
+
import { PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM, PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, normalizePhiBuilderRevisionsKindSearchParam, } from "../../../../helpers/cms-scope-search-params";
|
|
13
|
+
import { isPhiRevisionsCatalogReady, readPhiRevisionsAddressKind, readPhiRevisionsTableBinding, resolvePhiRevisionsControllerBinding, } from "./binding";
|
|
15
14
|
import { PHI_REVISIONS_RUNTIME_CONTROLLER_DEFINITION, } from "../controller/definition";
|
|
16
|
-
import {
|
|
15
|
+
import { resolvePhiRevisionsDraftContextTarget } from "./draft-context-target";
|
|
17
16
|
import { deleteCmsDraft } from "../../../../helpers/cms-draft-delete";
|
|
18
17
|
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
18
|
+
import { matchesPhiTypedConfirmation } from "../../../../helpers/typed-confirmation";
|
|
19
19
|
import { usePhiPathname } from "../../../../components/runtime/use-phi-pathname";
|
|
20
20
|
function PhiRevisionsControllerMount({ address, config, }) {
|
|
21
21
|
const dispatchSignal = usePhiSignalDispatcher();
|
|
@@ -50,33 +50,39 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
50
50
|
const modulePresetPagesByArea = usePhiWorkspaceCatalogValue((state) => state.modulePresetPagesByArea);
|
|
51
51
|
const customPages = usePhiWorkspaceCatalogValue((state) => state.customPages);
|
|
52
52
|
const persistedPageCatalogByArea = usePhiWorkspaceCatalogValue((state) => state.persistedPageCatalogByArea);
|
|
53
|
+
const catalogHydrated = usePhiWorkspaceCatalogValue((state) => state.catalogHydrated);
|
|
54
|
+
const pageCatalogHydratedByArea = usePhiWorkspaceCatalogValue((state) => state.pageCatalogHydratedByArea);
|
|
55
|
+
/*
|
|
56
|
+
* The scope the address names, handed to the Table once the catalog stands for that address.
|
|
57
|
+
*
|
|
58
|
+
* Before, it was resolved on the catalog's first answer, which names the default Area (`public`)
|
|
59
|
+
* until the Builder has read the address: a Module Page of the App was handed as a Public Page,
|
|
60
|
+
* then again as the App's, each a history read. The catalog changes many times more while the
|
|
61
|
+
* Builder opens, and after every Page action, and each change hands the scope again; the Table
|
|
62
|
+
* takes the same scope as no change (`updateBindingParams`), so only another scope is read.
|
|
63
|
+
*/
|
|
64
|
+
/*
|
|
65
|
+
* The last scope handed, to know it when the Table hands it back: the Table announces every change
|
|
66
|
+
* of its binding, this Controller's own among them, and written into the address the scope that was
|
|
67
|
+
* read off the address (or the open Page standing in for it) is one more fetch of the Page for nothing.
|
|
68
|
+
*/
|
|
69
|
+
const handedBindingKey = useRef(null);
|
|
70
|
+
const handBinding = useCallback((binding, correlationId) => {
|
|
71
|
+
handedBindingKey.current = JSON.stringify(binding);
|
|
72
|
+
emitCapability("bindingParamsChange", { params: binding }, correlationId);
|
|
73
|
+
}, [emitCapability]);
|
|
53
74
|
useEffect(() => {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const pageKey = resolvePhiBuilderActivePageKey(normalizePhiBuilderPageSearchParam(search.get(PHI_BUILDER_PAGE_SEARCH_PARAM)) ?? state.pageKey, pages);
|
|
58
|
-
if (!pageKey)
|
|
59
|
-
return;
|
|
60
|
-
const kind = normalizePhiBuilderRevisionsKindSearchParam(search.get(PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM)) ?? "area";
|
|
61
|
-
const requestedScope = search.get(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM)?.trim() ?? "";
|
|
62
|
-
const scopeKey = kind === "page"
|
|
63
|
-
? requestedScope.startsWith("/")
|
|
64
|
-
? requestedScope
|
|
65
|
-
: resolvePhiBuilderRevisionPagePath(state.area, pageKey, pages)
|
|
66
|
-
: kind === "navigation"
|
|
67
|
-
? requestedScope.includes(":")
|
|
68
|
-
? requestedScope
|
|
69
|
-
: resolvePhiBuilderRevisionNavScopeKey(state.area, search.get(PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM))
|
|
70
|
-
: kind === "theme"
|
|
71
|
-
? requestedScope || search.get(PHI_BUILDER_THEME_KEY_SEARCH_PARAM) || "default"
|
|
72
|
-
: normalizePhiBuilderAreaSearchParam(requestedScope) ?? state.area;
|
|
73
|
-
emitCapability("bindingParamsChange", { params: { area: state.area, kind, scopeKey } });
|
|
75
|
+
const binding = resolvePhiRevisionsControllerBinding(getPhiWorkspaceCatalogSnapshot(), new URLSearchParams(window.location.search));
|
|
76
|
+
if (binding)
|
|
77
|
+
handBinding(binding);
|
|
74
78
|
}, [
|
|
75
79
|
builderArea,
|
|
76
80
|
builderPageKey,
|
|
81
|
+
catalogHydrated,
|
|
77
82
|
customPages,
|
|
78
|
-
|
|
83
|
+
handBinding,
|
|
79
84
|
modulePresetPagesByArea,
|
|
85
|
+
pageCatalogHydratedByArea,
|
|
80
86
|
persistedPageCatalogByArea,
|
|
81
87
|
]);
|
|
82
88
|
/*
|
|
@@ -118,10 +124,16 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
118
124
|
signal.action === "change" &&
|
|
119
125
|
isPhiBuilderAreaKey(signal.value)) {
|
|
120
126
|
const search = new URLSearchParams(window.location.search);
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
/*
|
|
128
|
+
* Not before the catalog stands for the address: the Area select says which Area it shows when it
|
|
129
|
+
* mounts, which is the catalog's default until the Builder has read the address -- the App's
|
|
130
|
+
* Revisions read the Public Area's history first.
|
|
131
|
+
*/
|
|
132
|
+
if (readPhiRevisionsAddressKind(search) !== "area" ||
|
|
133
|
+
!isPhiRevisionsCatalogReady(getPhiWorkspaceCatalogSnapshot(), search)) {
|
|
123
134
|
return;
|
|
124
|
-
|
|
135
|
+
}
|
|
136
|
+
handBinding({ area: signal.value, kind: "area", scopeKey: signal.value }, signal.correlationId);
|
|
125
137
|
return;
|
|
126
138
|
}
|
|
127
139
|
if (signal.receiver !== address)
|
|
@@ -137,15 +149,26 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
137
149
|
*/
|
|
138
150
|
const area = getPhiWorkspaceCatalogSnapshot().area;
|
|
139
151
|
emitCapability("deleteAreaWarning", `The structure this Site stored for ${area} is cleared -- its Shell, drafts and published alike. What is live changes at once, the shell's preset takes the Area back, and no revision is left to restore it from. It cannot be undone. The Module selection is kept.`, signal.correlationId);
|
|
152
|
+
emitCapability("deleteAreaKey", area, signal.correlationId);
|
|
153
|
+
emitCapability("deleteAreaConfirmEnabled", false, signal.correlationId);
|
|
140
154
|
emitCapability("deleteAreaOpen", null, signal.correlationId);
|
|
141
155
|
return;
|
|
142
156
|
}
|
|
157
|
+
/*
|
|
158
|
+
* The key as it is typed: the confirm button wakes the moment it matches and sleeps again when it
|
|
159
|
+
* no longer does, so pressing it is never answered with "that is not the key".
|
|
160
|
+
*/
|
|
161
|
+
if (signal.channel === "deleteAreaTyped" && signal.action === "change") {
|
|
162
|
+
const payload = isPhiRecord(signal.value) ? signal.value : null;
|
|
163
|
+
const values = isPhiRecord(payload?.values) ? payload.values : null;
|
|
164
|
+
emitCapability("deleteAreaConfirmEnabled", matchesPhiTypedConfirmation(values?.areaKey, getPhiWorkspaceCatalogSnapshot().area), signal.correlationId);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
143
167
|
if (signal.channel === "formValues" && signal.action === "change") {
|
|
144
168
|
const payload = isPhiRecord(signal.value) ? signal.value : null;
|
|
145
169
|
const values = isPhiRecord(payload?.values) ? payload.values : null;
|
|
146
|
-
const typed = typeof values?.areaKey === "string" ? values.areaKey.trim() : "";
|
|
147
170
|
const area = getPhiWorkspaceCatalogSnapshot().area;
|
|
148
|
-
if (
|
|
171
|
+
if (!matchesPhiTypedConfirmation(values?.areaKey, area)) {
|
|
149
172
|
// The Overlay stays open: what is wrong is the answer, not the question.
|
|
150
173
|
showMessage({ level: "error", content: "That is not the Area key." }, { correlationId: signal.correlationId });
|
|
151
174
|
return;
|
|
@@ -154,33 +177,44 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
154
177
|
return;
|
|
155
178
|
}
|
|
156
179
|
if (signal.channel === "bindingParams" && signal.action === "change") {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
180
|
+
/*
|
|
181
|
+
* A whole scope only. The Table's kind select answers before its scope select does, and the kind
|
|
182
|
+
* beside the scope of the kind before it names nothing; written into the address it was a
|
|
183
|
+
* navigation, and the scope's answer a second one.
|
|
184
|
+
*/
|
|
185
|
+
const binding = readPhiRevisionsTableBinding({
|
|
186
|
+
area: getPhiWorkspaceCatalogSnapshot().area,
|
|
187
|
+
...readPhiTableBindingParamsSignalValue(signal.value)?.params,
|
|
188
|
+
});
|
|
189
|
+
if (!binding || !pathname || JSON.stringify(binding) === handedBindingKey.current)
|
|
163
190
|
return;
|
|
191
|
+
const { kind, scopeKey } = binding;
|
|
164
192
|
const search = new URLSearchParams(window.location.search);
|
|
165
193
|
const currentKind = normalizePhiBuilderRevisionsKindSearchParam(search.get(PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM));
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
194
|
+
/*
|
|
195
|
+
* An Area's history is not written into the address beyond its kind, and an absent kind is the
|
|
196
|
+
* Area: nothing to navigate to. Asked to write `revisionKind=area` the Controller fetched the Page
|
|
197
|
+
* anew for an address that meant the same.
|
|
198
|
+
*/
|
|
199
|
+
if (kind === "area" && (currentKind == null || currentKind === "area")) {
|
|
169
200
|
return;
|
|
170
201
|
}
|
|
171
202
|
search.set(PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM, kind);
|
|
172
|
-
if (kind === "area"
|
|
203
|
+
if (kind === "area") {
|
|
173
204
|
search.delete(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM);
|
|
174
205
|
}
|
|
175
|
-
else
|
|
176
|
-
search.set(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, scopeKey);
|
|
177
|
-
}
|
|
178
|
-
else if (kind === "navigation" && scopeKey.includes(":")) {
|
|
179
|
-
search.set(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, scopeKey);
|
|
180
|
-
}
|
|
181
|
-
else if (kind === "theme" && scopeKey) {
|
|
206
|
+
else {
|
|
182
207
|
search.set(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, scopeKey);
|
|
183
208
|
}
|
|
209
|
+
/*
|
|
210
|
+
* Only a changed address is a navigation. The Table hands every scope it is given back to this
|
|
211
|
+
* Controller, and replacing the address with itself still fetches the Page from the server, whose
|
|
212
|
+
* answer refreshes the workspace catalog, which makes this Controller hand the scope to the Table
|
|
213
|
+
* again: a page scope asked for its history and the Page about once a second for as long as it
|
|
214
|
+
* stood open.
|
|
215
|
+
*/
|
|
216
|
+
if (search.toString() === window.location.search.replace(/^\?/, ""))
|
|
217
|
+
return;
|
|
184
218
|
router.replace(`${pathname}?${search.toString()}`, { scroll: false });
|
|
185
219
|
return;
|
|
186
220
|
}
|
|
@@ -193,21 +227,13 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
193
227
|
const area = scope?.area;
|
|
194
228
|
if (key === "restore" || key === "resetPage") {
|
|
195
229
|
const structural = (kind === "area" || kind === "page") && isPhiBuilderAreaKey(area);
|
|
196
|
-
|
|
197
|
-
if (kind === "page" && isPhiBuilderAreaKey(area) && typeof scope?.path === "string") {
|
|
198
|
-
const state = getPhiWorkspaceCatalogSnapshot();
|
|
199
|
-
const pages = resolvePhiBuilderActivePageCatalog(area, state.modulePresetPagesByArea, state.customPages, state.persistedPageCatalogByArea);
|
|
200
|
-
pageKey = findPhiBuilderPageKeyFromStoragePath(area, scope.path, pages)
|
|
201
|
-
?? resolvePhiBuilderPageKeyFromCatalogPath(area, scope.path, pages);
|
|
202
|
-
}
|
|
230
|
+
const target = resolvePhiRevisionsDraftContextTarget(scope, action?.areaModules === true, getPhiWorkspaceCatalogSnapshot());
|
|
203
231
|
reportDraftStatus({
|
|
204
232
|
status: key === "restore" ? "draft" : "published",
|
|
205
233
|
revisionId: typeof action?.restoredRevisionId === "number" ? action.restoredRevisionId : null,
|
|
206
234
|
...(kind === "navigation" ? { navKey: scope?.navKey } : {}),
|
|
207
235
|
...(kind === "theme" ? { themeKey: scope?.themeKey } : {}),
|
|
208
|
-
...(
|
|
209
|
-
...(pageKey !== null ? { pageKey } : {}),
|
|
210
|
-
...(action?.areaModules === true ? { areaModules: true } : {}),
|
|
236
|
+
...(target ?? {}),
|
|
211
237
|
}, signal.correlationId);
|
|
212
238
|
if (structural) {
|
|
213
239
|
router.refresh();
|
|
@@ -224,9 +250,9 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
224
250
|
else if (key === "deleteSelected")
|
|
225
251
|
showMessage({ level: "success", content: `Deleted ${String(action?.deletedCount ?? 0)} revisions.` }, { correlationId: signal.correlationId });
|
|
226
252
|
}
|
|
227
|
-
}, [address, deleteAreaShell, emitCapability, pathname, reportDraftStatus, router, showMessage]), {
|
|
253
|
+
}, [address, deleteAreaShell, emitCapability, handBinding, pathname, reportDraftStatus, router, showMessage]), {
|
|
228
254
|
scopes: ["area", "page"],
|
|
229
|
-
channels: ["areaSelection", "bindingParams", "command", "formValues", "mutation"],
|
|
255
|
+
channels: ["areaSelection", "bindingParams", "command", "deleteAreaTyped", "formValues", "mutation"],
|
|
230
256
|
},
|
|
231
257
|
/*
|
|
232
258
|
* The address this listener answers for.
|
|
@@ -26,6 +26,11 @@ export declare const PHI_REVISIONS_RUNTIME_CONTROLLER_DEFINITION: {
|
|
|
26
26
|
action: "change";
|
|
27
27
|
valueType: "string";
|
|
28
28
|
valueSchema?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
id: string;
|
|
31
|
+
action: "change";
|
|
32
|
+
valueType: "boolean";
|
|
33
|
+
valueSchema?: undefined;
|
|
29
34
|
} | {
|
|
30
35
|
id: string;
|
|
31
36
|
action: "activate";
|
|
@@ -23,6 +23,9 @@ export const PHI_REVISIONS_RUNTIME_CONTROLLER_DEFINITION = {
|
|
|
23
23
|
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.revisionsDraftStatus,
|
|
24
24
|
},
|
|
25
25
|
{ id: "deleteAreaWarning", action: "change", valueType: "string" },
|
|
26
|
+
/* The Area key the dialog shows to be typed, and its confirm button, awake only while it matches. */
|
|
27
|
+
{ id: "deleteAreaKey", action: "change", valueType: "string" },
|
|
28
|
+
{ id: "deleteAreaConfirmEnabled", action: "change", valueType: "boolean" },
|
|
26
29
|
{ id: "deleteAreaOpen", action: "activate", valueType: "none" },
|
|
27
30
|
{ id: "deleteAreaClose", action: "close", valueType: "none" },
|
|
28
31
|
/* The history is out of date once an Area is cleared: every revision it listed is gone. */
|
|
@@ -62,6 +65,13 @@ export const PHI_REVISIONS_RUNTIME_CONTROLLER_DEFINITION = {
|
|
|
62
65
|
action: "change",
|
|
63
66
|
valueType: "json",
|
|
64
67
|
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.formValues,
|
|
68
|
+
}, {
|
|
69
|
+
/* The same Form's values while the key is typed (`valuesChange`), for the confirm button. */
|
|
70
|
+
id: "deleteAreaTyped",
|
|
71
|
+
channel: "deleteAreaTyped",
|
|
72
|
+
action: "change",
|
|
73
|
+
valueType: "json",
|
|
74
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.formValues,
|
|
65
75
|
}],
|
|
66
76
|
},
|
|
67
77
|
defaultConfig: { signalRoutes: null },
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type PhiBuilderAreaKey } from "../../../../constants/cms-areas";
|
|
2
|
+
import type { PhiWorkspaceCatalogState } from "../../../../components/workspace/catalog-state";
|
|
3
|
+
/**
|
|
4
|
+
* The Builder context a revision action superseded, as the `draftStatus` broadcast names it: the Area's
|
|
5
|
+
* Module selection (`areaModules`), one Page (`pageKey`), or -- with the Area alone -- its Shell.
|
|
6
|
+
*/
|
|
7
|
+
export type PhiRevisionsDraftContextTarget = {
|
|
8
|
+
area: PhiBuilderAreaKey;
|
|
9
|
+
areaModules: true;
|
|
10
|
+
} | {
|
|
11
|
+
area: PhiBuilderAreaKey;
|
|
12
|
+
pageKey: string;
|
|
13
|
+
} | {
|
|
14
|
+
area: PhiBuilderAreaKey;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Which cached Builder context a restore or a Page reset replaced, read off the scope the Revisions
|
|
18
|
+
* Table acted on.
|
|
19
|
+
*
|
|
20
|
+
* A Page scope names its Page by storage path when it is the Site's own, and by preset identity when it
|
|
21
|
+
* is a Module's -- then its `path` is null. A Page scope that names no Page of the catalog has no target:
|
|
22
|
+
* the Area alone means its Shell, and discarding the Shell's edits for a Page's revision lost them while
|
|
23
|
+
* the Page kept showing what was replaced.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolvePhiRevisionsDraftContextTarget(scope: Readonly<Record<string, unknown>> | null, areaModules: boolean, catalog: Pick<PhiWorkspaceCatalogState, "modulePresetPagesByArea" | "customPages" | "persistedPageCatalogByArea">): PhiRevisionsDraftContextTarget | null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isPhiBuilderAreaKey } from "../../../../constants/cms-areas";
|
|
2
|
+
import { findPhiBuilderPageKeyFromPresetSource, findPhiBuilderPageKeyFromStoragePath, resolvePhiBuilderActivePageCatalog, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
|
|
3
|
+
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
4
|
+
/**
|
|
5
|
+
* Which cached Builder context a restore or a Page reset replaced, read off the scope the Revisions
|
|
6
|
+
* Table acted on.
|
|
7
|
+
*
|
|
8
|
+
* A Page scope names its Page by storage path when it is the Site's own, and by preset identity when it
|
|
9
|
+
* is a Module's -- then its `path` is null. A Page scope that names no Page of the catalog has no target:
|
|
10
|
+
* the Area alone means its Shell, and discarding the Shell's edits for a Page's revision lost them while
|
|
11
|
+
* the Page kept showing what was replaced.
|
|
12
|
+
*/
|
|
13
|
+
export function resolvePhiRevisionsDraftContextTarget(scope, areaModules, catalog) {
|
|
14
|
+
const area = scope?.area;
|
|
15
|
+
if (!isPhiBuilderAreaKey(area)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
if (scope?.kind === "area") {
|
|
19
|
+
return areaModules ? { area, areaModules: true } : { area };
|
|
20
|
+
}
|
|
21
|
+
if (scope?.kind !== "page") {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const pages = resolvePhiBuilderActivePageCatalog(area, catalog.modulePresetPagesByArea, catalog.customPages, catalog.persistedPageCatalogByArea);
|
|
25
|
+
const source = isPhiRecord(scope.sourcePreset) ? scope.sourcePreset : null;
|
|
26
|
+
const pageKey = typeof scope.path === "string"
|
|
27
|
+
? findPhiBuilderPageKeyFromStoragePath(area, scope.path, pages)
|
|
28
|
+
?? resolvePhiBuilderPageKeyFromCatalogPath(area, scope.path, pages)
|
|
29
|
+
: typeof source?.ownerModuleId === "string" && typeof source.presetKey === "string"
|
|
30
|
+
? findPhiBuilderPageKeyFromPresetSource({ ownerModuleId: source.ownerModuleId, presetKey: source.presetKey }, pages)
|
|
31
|
+
: null;
|
|
32
|
+
return pageKey === null ? null : { area, pageKey };
|
|
33
|
+
}
|
|
@@ -31,7 +31,7 @@ const PHI_REVISIONS_DELETE_AREA_FORM_DESCRIPTOR = {
|
|
|
31
31
|
{
|
|
32
32
|
key: "areaKey",
|
|
33
33
|
fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.text,
|
|
34
|
-
label: label("areaKey", "
|
|
34
|
+
label: label("areaKey", "Area key"),
|
|
35
35
|
validation: [{
|
|
36
36
|
providerKey: PHI_FORM_VALIDATION_PROVIDER_KEYS.required,
|
|
37
37
|
message: label("areaKeyRequired", "Write the Area key out to confirm."),
|
|
@@ -6,4 +6,4 @@ export declare const PHI_REVISIONS_TABLE_WIDGET_ID: import("@phis/contracts/cms"
|
|
|
6
6
|
/** The Revisions page's one irreversible command: deleting an Area's own shell. */
|
|
7
7
|
export declare const PHI_REVISIONS_DELETE_AREA_OVERLAY_IDS: Readonly<Record<"overlayDeleteArea", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
8
8
|
export declare const PHI_REVISIONS_DELETE_AREA_LAYOUT_IDS: Readonly<Record<"deleteAreaBody" | "deleteAreaFooter", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
9
|
-
export declare const PHI_REVISIONS_DELETE_AREA_WIDGET_IDS: Readonly<Record<"deleteAreaWarning" | "deleteAreaSurvives" | "deleteAreaForm" | "deleteAreaCommands", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
9
|
+
export declare const PHI_REVISIONS_DELETE_AREA_WIDGET_IDS: Readonly<Record<"deleteAreaWarning" | "deleteAreaKey" | "deleteAreaSurvives" | "deleteAreaTypeToConfirm" | "deleteAreaForm" | "deleteAreaCommands", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
@@ -25,4 +25,7 @@ export const PHI_REVISIONS_TABLE_WIDGET_ID = createPhiPresetCmsInstanceId({
|
|
|
25
25
|
/** The Revisions page's one irreversible command: deleting an Area's own shell. */
|
|
26
26
|
export const PHI_REVISIONS_DELETE_AREA_OVERLAY_IDS = createPhiPresetCmsInstanceIdMap(PHI_REVISIONS_PAGE_DIALOG_ID_CONTEXT, ["overlayDeleteArea"]);
|
|
27
27
|
export const PHI_REVISIONS_DELETE_AREA_LAYOUT_IDS = createPhiPresetCmsInstanceIdMap(PHI_REVISIONS_PAGE_DIALOG_ID_CONTEXT, ["deleteAreaBody", "deleteAreaFooter"]);
|
|
28
|
-
export const PHI_REVISIONS_DELETE_AREA_WIDGET_IDS = createPhiPresetCmsInstanceIdMap(PHI_REVISIONS_PAGE_DIALOG_ID_CONTEXT, [
|
|
28
|
+
export const PHI_REVISIONS_DELETE_AREA_WIDGET_IDS = createPhiPresetCmsInstanceIdMap(PHI_REVISIONS_PAGE_DIALOG_ID_CONTEXT, [
|
|
29
|
+
"deleteAreaWarning", "deleteAreaSurvives", "deleteAreaTypeToConfirm", "deleteAreaKey", "deleteAreaForm",
|
|
30
|
+
"deleteAreaCommands",
|
|
31
|
+
]);
|
|
@@ -44,6 +44,10 @@ export declare const PHI_REVISIONS_RUNTIME_MODULE_ROUTES: {
|
|
|
44
44
|
path: string;
|
|
45
45
|
landingPage?: true;
|
|
46
46
|
title: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
shareImage?: {
|
|
49
|
+
asset: string;
|
|
50
|
+
};
|
|
47
51
|
defaultPageFlags?: number;
|
|
48
52
|
loadTree: (context: import("../../../types").PhiCmsDescriptorBuildContext & {
|
|
49
53
|
activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
|
|
@@ -5,6 +5,7 @@ import { resolvePhiBuilderActivePageCatalog, } from "../../../../helpers/cms-pag
|
|
|
5
5
|
import { phiWorkspaceCatalogStore, PHI_WORKSPACE_CATALOG_SCOPE, } from "../../../../components/workspace/catalog-store";
|
|
6
6
|
import { PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, } from "../../../../helpers/cms-scope-search-params";
|
|
7
7
|
import { resolvePhiBuilderRevisionPagePath } from "../types";
|
|
8
|
+
import { isPhiRevisionsCatalogReady, readPhiRevisionsAddressKind } from "../controller/binding";
|
|
8
9
|
import { createPhiControlOptionsProviderClient, readPhiControlOptionsProviderParam, readPhiControlOptionsProviderSourceValue, } from "../../../../components/controls/phi-options-provider";
|
|
9
10
|
function readSnapshot(context) {
|
|
10
11
|
return context.snapshot;
|
|
@@ -26,6 +27,17 @@ function resolveKind(context) {
|
|
|
26
27
|
function resolveOptions(context) {
|
|
27
28
|
const snapshot = readSnapshot(context);
|
|
28
29
|
const mode = readPhiControlOptionsProviderParam(context.optionsProvider, "mode");
|
|
30
|
+
const search = typeof window === "undefined" ? null : new URLSearchParams(window.location.search);
|
|
31
|
+
/*
|
|
32
|
+
* Nothing to offer until the catalog stands for the address, as the Controller hands no scope before
|
|
33
|
+
* then (`resolvePhiRevisionsControllerBinding`). A select that answers a value is set to it, and
|
|
34
|
+
* the Table hands the value on: the kind select answered `area` whatever the address said, before the
|
|
35
|
+
* Controller had said `page`, and the Controller wrote the Area's history into the address -- a
|
|
36
|
+
* Module Page's Revisions opened on the Area's.
|
|
37
|
+
*/
|
|
38
|
+
if (!search || !isPhiRevisionsCatalogReady(snapshot, search)) {
|
|
39
|
+
return { options: [] };
|
|
40
|
+
}
|
|
29
41
|
if (mode === "kind") {
|
|
30
42
|
return {
|
|
31
43
|
options: [
|
|
@@ -34,7 +46,7 @@ function resolveOptions(context) {
|
|
|
34
46
|
{ value: "navigation", label: "Navigation" },
|
|
35
47
|
{ value: "theme", label: "Theme" },
|
|
36
48
|
],
|
|
37
|
-
value:
|
|
49
|
+
value: readPhiRevisionsAddressKind(search),
|
|
38
50
|
};
|
|
39
51
|
}
|
|
40
52
|
const area = snapshot.area;
|
|
@@ -42,9 +54,7 @@ function resolveOptions(context) {
|
|
|
42
54
|
const currentValue = typeof context.sourceConfig?.scopeKey === "string"
|
|
43
55
|
? context.sourceConfig.scopeKey
|
|
44
56
|
: null;
|
|
45
|
-
const requestedScope =
|
|
46
|
-
? null
|
|
47
|
-
: new URLSearchParams(window.location.search).get(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM);
|
|
57
|
+
const requestedScope = search.get(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM);
|
|
48
58
|
if (kind === "area") {
|
|
49
59
|
return {
|
|
50
60
|
options: [...PHI_BUILDER_AREA_OPTIONS],
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { PHI_REVISIONS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
3
3
|
import { deleteCmsDraft } from "../../../../helpers/cms-draft-delete";
|
|
4
4
|
import { readNumber } from "../../../../components/widgets/config/parser-primitives";
|
|
5
|
-
import {
|
|
5
|
+
import { isPhiCmsAreaKey } from "../../../../constants/cms-areas";
|
|
6
6
|
import { hasPhiCmsPresetUpdate } from "../../../../plugins/runtime-modules/preset-version";
|
|
7
7
|
import { PhiTableProviderError, } from "../../../../types/table-widget";
|
|
8
8
|
import { createPhiTableProviderClient } from "../../../../components/widgets/client/shared/phi-table-provider";
|
|
9
9
|
import { PHI_REVISIONS_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "../../../../plugins/runtime-modules/revisions/data-providers";
|
|
10
10
|
import { getPhiWorkspaceCatalogSnapshot, } from "../../../../components/workspace/catalog-store";
|
|
11
|
-
import { resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
|
|
12
|
-
import { PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM,
|
|
11
|
+
import { resolvePhiBuilderActivePageCatalog, findPhiBuilderPageKeyFromStoragePath, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
|
|
12
|
+
import { PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM, PHI_BUILDER_THEME_KEY_SEARCH_PARAM, } from "../../../../helpers/cms-scope-search-params";
|
|
13
|
+
import { readPhiRevisionsTableBinding } from "../controller/binding";
|
|
13
14
|
import { resolvePhiBuilderRevisionPagePath, resolvePhiBuilderRevisionScope, } from "../types";
|
|
14
15
|
import { resolvePhiBuilderRevisionNavScopeKey } from "../../../../helpers/cms-navigation-scope-key";
|
|
15
16
|
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
@@ -40,6 +41,15 @@ function readRevisionScope(value) {
|
|
|
40
41
|
sourcePreset,
|
|
41
42
|
};
|
|
42
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* What a request asks about, or null while it asks about nothing yet.
|
|
46
|
+
*
|
|
47
|
+
* The Table mounts with its labels alone; the scope is the Revisions Controller's to hand, once the
|
|
48
|
+
* workspace catalog stands for the address (`resolvePhiRevisionsControllerBinding`). This read used to
|
|
49
|
+
* make one up meanwhile, from the address and whatever the catalog held -- the default Area's, before
|
|
50
|
+
* the Builder had read the address -- and the Table asked for that history, then for the one handed a
|
|
51
|
+
* moment later: two reads on every open, and a Module Page of the App asked for as a Public Page.
|
|
52
|
+
*/
|
|
43
53
|
function readParams(value) {
|
|
44
54
|
if (!isPhiRecord(value) || !isPhiRecord(value.labels) || typeof value.locale !== "string"
|
|
45
55
|
|| typeof value.timeZone !== "string") {
|
|
@@ -47,20 +57,14 @@ function readParams(value) {
|
|
|
47
57
|
}
|
|
48
58
|
const locale = value.locale;
|
|
49
59
|
const timeZone = value.timeZone;
|
|
50
|
-
if (!isPhiRecord(value.scope)
|
|
60
|
+
if (!isPhiRecord(value.scope)) {
|
|
61
|
+
const binding = readPhiRevisionsTableBinding(value);
|
|
62
|
+
if (!binding || typeof window === "undefined")
|
|
63
|
+
return null;
|
|
64
|
+
const { kind, scopeKey: configuredScopeKey } = binding;
|
|
51
65
|
const state = getPhiWorkspaceCatalogSnapshot();
|
|
52
66
|
const search = new URLSearchParams(window.location.search);
|
|
53
|
-
const
|
|
54
|
-
normalizePhiBuilderRevisionsKindSearchParam(search.get(PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM)) ??
|
|
55
|
-
"area";
|
|
56
|
-
const configuredScopeKey = typeof value.scopeKey === "string" && value.scopeKey.trim()
|
|
57
|
-
? value.scopeKey.trim()
|
|
58
|
-
: search.get(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM)?.trim() ?? "";
|
|
59
|
-
const scopeArea = kind === "area"
|
|
60
|
-
? isPhiBuilderAreaKey(configuredScopeKey)
|
|
61
|
-
? configuredScopeKey
|
|
62
|
-
: state.area
|
|
63
|
-
: state.area;
|
|
67
|
+
const scopeArea = kind === "area" ? configuredScopeKey : binding.area;
|
|
64
68
|
const pages = resolvePhiBuilderActivePageCatalog(scopeArea, state.modulePresetPagesByArea, state.customPages, state.persistedPageCatalogByArea);
|
|
65
69
|
const activePageKey = resolvePhiBuilderActivePageKey(scopeArea === state.area ? state.pageKey : null, pages);
|
|
66
70
|
/*
|
|
@@ -68,18 +72,24 @@ function readParams(value) {
|
|
|
68
72
|
*
|
|
69
73
|
* Three of them never read one: `resolvePhiBuilderRevisionScope` takes the area, the nav key or the
|
|
70
74
|
* theme key and leaves the page alone, so demanding one made an Area whose pages all come from
|
|
71
|
-
* Modules unable to show the revisions it does have.
|
|
72
|
-
*
|
|
73
|
-
* moment rather than a fault. A page scope without a page asks for nothing and shows nothing, and
|
|
74
|
-
* fills in as soon as there is one.
|
|
75
|
+
* Modules unable to show the revisions it does have. A page scope whose Page the catalog does not
|
|
76
|
+
* hold asks for nothing and shows nothing.
|
|
75
77
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
/*
|
|
79
|
+
* The Page a page scope names, by the address it answers on: the Page Select, the Controller and the
|
|
80
|
+
* `revisionScope` search parameter all hand the storage path, package namespace included. Matched
|
|
81
|
+
* against the path the Builder shows instead, a Module Page (`/phis/ui/dashboard`, shown as
|
|
82
|
+
* `/dashboard`) was found nowhere, read as a Site Page of that path and asked for by a path its row
|
|
83
|
+
* does not have -- so its history was empty and "Reset to preset" had no preset to name.
|
|
84
|
+
*/
|
|
85
|
+
const pageKey = kind === "page"
|
|
86
|
+
? findPhiBuilderPageKeyFromStoragePath(scopeArea, configuredScopeKey, pages)
|
|
87
|
+
?? resolvePhiBuilderPageKeyFromCatalogPath(scopeArea, configuredScopeKey, pages)
|
|
78
88
|
: activePageKey ?? "";
|
|
79
|
-
const navScopeKey = kind === "navigation"
|
|
89
|
+
const navScopeKey = kind === "navigation"
|
|
80
90
|
? resolvePhiBuilderRevisionNavScopeKey(scopeArea, configuredScopeKey)
|
|
81
91
|
: resolvePhiBuilderRevisionNavScopeKey(scopeArea, search.get(PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM));
|
|
82
|
-
const themeKey = kind === "theme"
|
|
92
|
+
const themeKey = kind === "theme"
|
|
83
93
|
? configuredScopeKey
|
|
84
94
|
: search.get(PHI_BUILDER_THEME_KEY_SEARCH_PARAM) ?? "default";
|
|
85
95
|
const scope = resolvePhiBuilderRevisionScope(kind, scopeArea, pageKey, pages, navScopeKey, themeKey, state.areaPresetSourcesByArea[scopeArea] ?? null);
|
|
@@ -148,12 +158,13 @@ async function loadRevisionHistory(scope, signal) {
|
|
|
148
158
|
* Nothing is being asked about yet.
|
|
149
159
|
*
|
|
150
160
|
* Both cases are the same moment: a panel opened before the workspace catalog arrived. A page scope
|
|
151
|
-
* has no page
|
|
161
|
+
* has no page -- neither a Site Page's path nor a Module Page's preset -- and an Area scope has no
|
|
162
|
+
* preset source -- and the Area scope is refused by the server
|
|
152
163
|
* rather than the client, because a revision belongs to a preset and an Area without one names
|
|
153
164
|
* nothing. Asking anyway answers a surface that is waiting with an error; the scope key carries the
|
|
154
165
|
* preset, so the question is asked again by itself once there is one.
|
|
155
166
|
*/
|
|
156
|
-
if ((scope.kind === "page" && !scope.path) ||
|
|
167
|
+
if ((scope.kind === "page" && !scope.path && !scope.sourcePreset) ||
|
|
157
168
|
(scope.kind === "area" && !scope.sourcePreset)) {
|
|
158
169
|
return {
|
|
159
170
|
kind: scope.kind,
|
|
@@ -389,11 +400,26 @@ function buildTableData(params, result) {
|
|
|
389
400
|
},
|
|
390
401
|
};
|
|
391
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Answers once there is a question: a request without a scope stays open, the Table showing that it
|
|
405
|
+
* loads, until the scope handed to it replaces the request -- which aborts it. Answered empty instead,
|
|
406
|
+
* the Table drew "no revisions" between its skeleton and the history.
|
|
407
|
+
*/
|
|
408
|
+
function untilAborted(signal) {
|
|
409
|
+
return new Promise((_, reject) => {
|
|
410
|
+
if (signal.aborted)
|
|
411
|
+
reject(signal.reason);
|
|
412
|
+
else
|
|
413
|
+
signal.addEventListener("abort", () => reject(signal.reason), { once: true });
|
|
414
|
+
});
|
|
415
|
+
}
|
|
392
416
|
async function queryRevisions(request) {
|
|
393
417
|
if (request.resourceKey !== "history") {
|
|
394
418
|
throw new PhiTableProviderError("resource-not-found", `Unknown Revisions resource "${request.resourceKey}".`);
|
|
395
419
|
}
|
|
396
420
|
const params = readParams(request.params);
|
|
421
|
+
if (!params)
|
|
422
|
+
return untilAborted(request.signal);
|
|
397
423
|
return buildTableData(params, await loadRevisionHistory(params.scope, request.signal));
|
|
398
424
|
}
|
|
399
425
|
function readRevisionId(value) {
|
|
@@ -411,6 +437,9 @@ async function mutateRevision(request) {
|
|
|
411
437
|
throw new PhiTableProviderError("resource-not-found", `Unknown Revisions resource "${request.resourceKey}".`);
|
|
412
438
|
}
|
|
413
439
|
const params = readParams(request.params);
|
|
440
|
+
if (!params) {
|
|
441
|
+
throw new Error("Choose what to show the history of first.");
|
|
442
|
+
}
|
|
414
443
|
if (request.actionKey === "resetPage") {
|
|
415
444
|
/*
|
|
416
445
|
* Not a revision act: the override these revisions belong to goes as a whole, and the Module's preset
|