@phis/ui 0.7.7 → 0.8.0
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/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 +64 -9
- 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-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/forms/extended-form-field-controls.d.ts +1 -1
- package/components/forms/extended-form-field-controls.js +23 -7
- package/components/forms/flags-field.d.ts +22 -0
- package/components/forms/flags-field.js +58 -0
- 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 +28 -0
- package/components/forms/form-provider-contract.js +45 -2
- package/components/forms/form-provider-registry.d.ts +11 -1
- package/components/forms/money-field-currency-key.d.ts +6 -0
- package/components/forms/money-field-currency-key.js +14 -0
- package/components/forms/money-field.d.ts +26 -3
- package/components/forms/money-field.js +54 -4
- 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/overlays/phi-overlay-container-client.js +2 -2
- 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/navigation-redirect.d.ts +4 -1
- package/components/regions/presets/navigation-redirect.js +6 -3
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +6 -2
- package/components/regions/presets/phi-settings-page-shell-tree.js +1 -1
- 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 +19 -0
- package/components/shell/phi-icon-names.js +264 -0
- package/components/shell/phi-icon.d.ts +2 -11
- package/components/shell/phi-icon.js +4 -32
- package/components/widgets/client/shared/phi-command-buttons.d.ts +13 -2
- package/components/widgets/client/shared/phi-command-buttons.js +10 -4
- package/components/widgets/client/shared/phi-rendered-value.js +32 -6
- 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 +2 -5
- package/components/widgets/label-sets/admin-users.js +4 -10
- package/components/widgets/label-sets/effects.js +2 -4
- package/components/widgets/label-sets/profile.d.ts +13 -0
- package/components/widgets/label-sets/profile.js +28 -0
- package/components/widgets/label-sets/search-results.js +2 -4
- package/components/widgets/label-sets/table.js +9 -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/search-results.d.ts +2 -2
- package/components/widgets/label-types/search-results.js +1 -2
- 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/constants/countries.d.ts +9 -0
- package/constants/countries.js +28 -0
- package/constants/customer-file.d.ts +25 -0
- package/constants/customer-file.js +26 -0
- package/constants/record-field-kinds.d.ts +15 -0
- package/constants/record-field-kinds.js +13 -0
- package/constants/runtime-module-ownership.js +12 -0
- package/constants/runtime-render-client-types.d.ts +5 -0
- package/constants/runtime-render-client-types.js +5 -0
- package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
- package/constants.d.ts +1 -0
- package/constants.js +2 -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-form-route.js +11 -2
- package/helpers/address-field.d.ts +43 -0
- package/helpers/address-field.js +68 -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/money-amount.d.ts +7 -0
- package/helpers/money-amount.js +15 -0
- package/helpers/phi-metadata.d.ts +33 -1
- package/helpers/phi-metadata.js +62 -1
- package/helpers/preset-table-check.d.ts +34 -0
- package/helpers/preset-table-check.js +124 -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/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/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/module-labels.d.ts +1 -1
- package/module-labels.js +1 -1
- package/module-page-check.d.ts +1 -0
- package/module-page-check.js +1 -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 -5
- 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 +11 -0
- package/plugins/runtime-modules/accounting/ids.js +23 -0
- package/plugins/runtime-modules/accounting/presets.js +32 -5
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +66 -0
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +122 -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 +26 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +381 -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 +98 -0
- package/plugins/runtime-modules/app/data-providers.js +80 -0
- package/plugins/runtime-modules/app/definition.d.ts +131 -0
- package/plugins/runtime-modules/app/definition.js +2 -0
- package/plugins/runtime-modules/app/forms.d.ts +46 -1
- package/plugins/runtime-modules/app/forms.js +195 -1
- package/plugins/runtime-modules/app/ids.d.ts +7 -0
- package/plugins/runtime-modules/app/ids.js +8 -0
- package/plugins/runtime-modules/app/module.d.ts +131 -0
- package/plugins/runtime-modules/app/presets.js +3 -6
- package/plugins/runtime-modules/app/services/addresses-table.d.ts +135 -0
- package/plugins/runtime-modules/app/services/addresses-table.js +101 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +17 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +179 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +62 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +108 -0
- package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.d.ts +3 -6
- package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.js +4 -7
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +27 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -0
- package/plugins/runtime-modules/app/trees/profile-label-set.js +3 -0
- package/plugins/runtime-modules/asset/presets.d.ts +4 -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-image-field.d.ts +2 -1
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -2
- 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/client.d.ts +5 -5
- package/plugins/runtime-modules/builder/controller/client.js +2 -1
- package/plugins/runtime-modules/builder/controller/definition.d.ts +4 -4
- package/plugins/runtime-modules/builder/controller/definition.js +7 -0
- package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +3 -1
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +2 -1
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +72 -18
- package/plugins/runtime-modules/builder/controller/server-definition.d.ts +4 -4
- package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +3 -1
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +8 -10
- package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +10 -0
- package/plugins/runtime-modules/builder/developer-workspace-store.js +35 -1
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +6 -0
- package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -6
- 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.d.ts +4 -1
- package/plugins/runtime-modules/builder/persistence.js +14 -3
- package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +33 -6
- 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/content-entry-routes.d.ts +4 -0
- package/plugins/runtime-modules/contracts.js +31 -1
- package/plugins/runtime-modules/core/definition.d.ts +28 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +28 -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 +0 -1
- 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/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/dimension/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/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/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/simple-text/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
- package/plugins/runtime-modules/core/widgets/spacer/client.js +3 -3
- package/plugins/runtime-modules/core/widgets/table/client.js +20 -5
- package/plugins/runtime-modules/core/widgets/table/config.js +6 -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/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/phi-default-admin-locales-page-tree.js +3 -1
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +4 -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/phi-default-site-area-preset-tree.js +46 -39
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
- package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
- package/plugins/runtime-modules/resolver.js +17 -0
- package/plugins/runtime-modules/revisions/controller/client.js +50 -46
- 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/presets.d.ts +4 -0
- package/plugins/runtime-modules/revisions/services/table.js +16 -5
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -1
- package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
- package/plugins/runtime-modules/theme/presets.d.ts +4 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +76 -4
- 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 +5 -0
- package/plugins/runtime-modules/threads/controller/definition.js +1 -1
- package/plugins/runtime-modules/threads/data-providers.d.ts +115 -2
- package/plugins/runtime-modules/threads/data-providers.js +85 -0
- package/plugins/runtime-modules/threads/definition.d.ts +115 -2
- package/plugins/runtime-modules/threads/definition.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +2 -0
- package/plugins/runtime-modules/threads/ids.js +3 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +192 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.js +164 -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 +86 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +118 -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 +166 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +19 -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/search-text.js +3 -0
- package/server-helpers.d.ts +1 -1
- package/server-helpers.js +1 -1
- package/styles/builder-scaffold.css +7 -1
- package/styles/layout-authoring-scaffold.css +27 -0
- package/styles/shell.css +30 -6
- package/theme/phi-theme-composition.js +9 -0
- package/theme/phi-theme-inverse-ground.d.ts +39 -0
- package/theme/phi-theme-inverse-ground.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 +14 -2
- package/types/cms.d.ts +10 -0
- package/types/core-widget-placements.d.ts +3 -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/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 +14 -0
- package/types/widget-runtime.d.ts +3 -0
- package/types.d.ts +1 -0
- /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
|
@@ -19,6 +19,7 @@ const SYNTHETIC_REGION_IDS = {
|
|
|
19
19
|
regionFooterBottom: -33,
|
|
20
20
|
};
|
|
21
21
|
export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetKey, ownerModuleId, runtimeModuleArea, }) {
|
|
22
|
+
const isApp = runtimeModuleArea === "app";
|
|
22
23
|
const PHI_DEFAULT_PUB_AREA_LAYOUT_IDS = createPhiPresetCmsInstanceIdMap({
|
|
23
24
|
domain: "area",
|
|
24
25
|
ownerModuleId,
|
|
@@ -161,7 +162,7 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
161
162
|
label: "pub header main three column",
|
|
162
163
|
config: {
|
|
163
164
|
...resolvePhiLayoutCreationPreset("threecol", "panel"),
|
|
164
|
-
balancedSides:
|
|
165
|
+
balancedSides: isApp,
|
|
165
166
|
justify: "space-between",
|
|
166
167
|
contentAlign: "center",
|
|
167
168
|
},
|
|
@@ -288,30 +289,36 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
288
289
|
config: {},
|
|
289
290
|
contentVersionId: null,
|
|
290
291
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
292
|
+
isApp
|
|
293
|
+
? nodes.widget({
|
|
294
|
+
typeKey: "page-title",
|
|
295
|
+
id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetPageTitle,
|
|
296
|
+
parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderMain,
|
|
297
|
+
slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Middle,
|
|
298
|
+
sortOrder: 10,
|
|
299
|
+
label: "Page title",
|
|
300
|
+
config: { display: "label" },
|
|
301
|
+
})
|
|
302
|
+
: {
|
|
303
|
+
id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetNav,
|
|
304
|
+
siteId: page.siteId,
|
|
305
|
+
parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderMain,
|
|
306
|
+
widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("header-navigation"), "header-navigation"),
|
|
307
|
+
slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Middle,
|
|
308
|
+
sortOrder: 10,
|
|
309
|
+
status: 1,
|
|
310
|
+
flags: 0,
|
|
311
|
+
visibilityMask: page.visibilityMask,
|
|
312
|
+
label: "pub header main navigation",
|
|
313
|
+
/* The current entry on a rounded ground rather than a bar under it, in either mode. */
|
|
314
|
+
config: {
|
|
315
|
+
navKey: `${runtimeModuleArea}:header`,
|
|
316
|
+
selectionStyle: "pill",
|
|
317
|
+
},
|
|
318
|
+
contentVersionId: null,
|
|
306
319
|
},
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
/*
|
|
310
|
-
* The magnifier, in Public only: the Area every visitor reads, and the one whose results Page it
|
|
311
|
-
* opens. The App carries its box in its Sider where its preset puts one; the operator's Areas are
|
|
312
|
-
* not searched. Before the locale switch, in the slot nothing else of this preset takes.
|
|
313
|
-
*/
|
|
314
|
-
...(runtimeModuleArea === "public"
|
|
320
|
+
// The magnifier leads to this Area's results Page wherever the Search Module is active.
|
|
321
|
+
...(runtimeModuleArea === "public" || isApp
|
|
315
322
|
? [{
|
|
316
323
|
id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetSearch,
|
|
317
324
|
siteId: page.siteId,
|
|
@@ -327,20 +334,20 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
327
334
|
contentVersionId: null,
|
|
328
335
|
}]
|
|
329
336
|
: []),
|
|
330
|
-
{
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
337
|
+
...(!isApp ? [{
|
|
338
|
+
id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetLocale,
|
|
339
|
+
siteId: page.siteId,
|
|
340
|
+
parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderActions,
|
|
341
|
+
widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("locale"), "locale"),
|
|
342
|
+
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[1].slotIndex,
|
|
343
|
+
sortOrder: 10,
|
|
344
|
+
status: 1,
|
|
345
|
+
flags: 0,
|
|
346
|
+
visibilityMask: page.visibilityMask,
|
|
347
|
+
label: "pub header main locale",
|
|
348
|
+
config: {},
|
|
349
|
+
contentVersionId: null,
|
|
350
|
+
}] : []),
|
|
344
351
|
/*
|
|
345
352
|
* The account trigger, in every Area that shares this preset.
|
|
346
353
|
*
|
|
@@ -354,7 +361,7 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
354
361
|
siteId: page.siteId,
|
|
355
362
|
parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderActions,
|
|
356
363
|
widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("account"), "account"),
|
|
357
|
-
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[2].slotIndex,
|
|
364
|
+
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[isApp ? 1 : 2].slotIndex,
|
|
358
365
|
sortOrder: 20,
|
|
359
366
|
status: 1,
|
|
360
367
|
flags: 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PHI_DEFAULT_PUB_AREA_PRESET_KEY = "public-area-preset";
|
|
2
2
|
export declare const PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS: readonly ["layoutHeaderMain", "layoutHeaderActions", "layoutHeaderBottom", "layoutSiderRight", "layoutFooterTop", "layoutFooterMain", "layoutFooterBottom"];
|
|
3
|
-
export declare const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetSearch", "widgetLocale", "widgetAccount", "widgetSiderRightNav", "widgetFooterLeft", "widgetFooterMiddle", "widgetFooterBottomText"];
|
|
3
|
+
export declare const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetPageTitle", "widgetSearch", "widgetLocale", "widgetAccount", "widgetSiderRightNav", "widgetFooterLeft", "widgetFooterMiddle", "widgetFooterBottomText"];
|
|
4
4
|
export declare const PHI_DEFAULT_PUB_AREA_COMPOSITION_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetLocale"];
|
|
@@ -405,6 +405,23 @@ export function collectPhiRuntimeDataProviderKeys({ moduleSet, trees, }) {
|
|
|
405
405
|
readPhiCollectionViewItemRendererKey(widgetConfig, moduleSet) === PHI_MEDIA_LIBRARY_ITEM_RENDERER_KEY) {
|
|
406
406
|
collected.add(PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.collection);
|
|
407
407
|
}
|
|
408
|
+
/*
|
|
409
|
+
* A Markdown text's Table embeds read the Provider their active Module names (TABLES.md), found in its
|
|
410
|
+
* source -- its own or its Content record's. One a code sample quotes mounts a Provider, never a Table.
|
|
411
|
+
*/
|
|
412
|
+
if (widget.widgetType === PhiCmsWidgetType.Markdown) {
|
|
413
|
+
const sources = [widgetConfig.markdown, widget.resolvedContent?.textFields.markdown?.source];
|
|
414
|
+
const keys = sources.flatMap((source) => typeof source === "string"
|
|
415
|
+
? [...source.matchAll(/!\[[^\]\n]*\]\(\s*<?phis:table\/([^\s?#)>]+)/gu)].map((match) => match[1])
|
|
416
|
+
: []);
|
|
417
|
+
for (const key of keys) {
|
|
418
|
+
for (const definition of moduleSet.moduleDefinitionsById.values()) {
|
|
419
|
+
const providerKey = definition.embeddableTables?.find((embed) => embed.key === key)?.source.providerKey;
|
|
420
|
+
if (providerKey && knownProviderKeys.has(providerKey))
|
|
421
|
+
collected.add(providerKey);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
408
425
|
if (widget.widgetType === PhiCmsWidgetType.Form) {
|
|
409
426
|
const formId = parsePhiFormWidgetConfig(widgetConfig).formId;
|
|
410
427
|
const form = formId ? moduleSet.formDefinitionsById.get(formId) : null;
|
|
@@ -11,8 +11,9 @@ import { usePhiApplicationFeedback } from "../../../../components/runtime/use-ph
|
|
|
11
11
|
import { getPhiWorkspaceCatalogSnapshot, usePhiWorkspaceCatalogValue, } from "../../../../components/workspace/catalog-store";
|
|
12
12
|
import { PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM, PHI_BUILDER_PAGE_SEARCH_PARAM, PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM, PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, PHI_BUILDER_THEME_KEY_SEARCH_PARAM, normalizePhiBuilderAreaSearchParam, normalizePhiBuilderPageSearchParam, normalizePhiBuilderRevisionsKindSearchParam, } from "../../../../helpers/cms-scope-search-params";
|
|
13
13
|
import { resolvePhiBuilderRevisionPagePath, } from "../types";
|
|
14
|
-
import { resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey,
|
|
14
|
+
import { resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey, } from "../../../../helpers/cms-page-catalog";
|
|
15
15
|
import { PHI_REVISIONS_RUNTIME_CONTROLLER_DEFINITION, } from "../controller/definition";
|
|
16
|
+
import { resolvePhiRevisionsDraftContextTarget } from "./draft-context-target";
|
|
16
17
|
import { resolvePhiBuilderRevisionNavScopeKey } from "../../../../helpers/cms-navigation-scope-key";
|
|
17
18
|
import { deleteCmsDraft } from "../../../../helpers/cms-draft-delete";
|
|
18
19
|
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
@@ -28,6 +29,20 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
28
29
|
*/
|
|
29
30
|
const emitRoutes = useMemo(() => config.signalRoutes?.emits ?? [], [config.signalRoutes?.emits]);
|
|
30
31
|
const emitCapability = useCallback((capabilityId, value, correlationId) => dispatchPhiSignalCapability(dispatchSignal, address, emitRoutes, capabilityId, value, correlationId), [address, dispatchSignal, emitRoutes]);
|
|
32
|
+
const reportDraftStatus = useCallback((value, correlationId) => {
|
|
33
|
+
dispatchSignal({
|
|
34
|
+
scope: "area",
|
|
35
|
+
channel: "draftStatus",
|
|
36
|
+
action: "change",
|
|
37
|
+
value,
|
|
38
|
+
valueType: "json",
|
|
39
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.revisionsDraftStatus,
|
|
40
|
+
sender: address,
|
|
41
|
+
receiver: "broadcast",
|
|
42
|
+
correlationId,
|
|
43
|
+
timestamp: Date.now(),
|
|
44
|
+
});
|
|
45
|
+
}, [address, dispatchSignal]);
|
|
31
46
|
const { showMessage } = usePhiApplicationFeedback();
|
|
32
47
|
const pathname = usePhiPathname();
|
|
33
48
|
const router = useRouter();
|
|
@@ -86,6 +101,7 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
86
101
|
ownerModuleId: source?.ownerModuleId,
|
|
87
102
|
presetKey: source?.presetKey,
|
|
88
103
|
});
|
|
104
|
+
reportDraftStatus({ status: "published", revisionId: null, area }, correlationId);
|
|
89
105
|
emitCapability("deleteAreaClose", null, correlationId);
|
|
90
106
|
emitCapability("historyReload", null, correlationId);
|
|
91
107
|
showMessage({ level: "success", content: `Cleared the ${area} structure back to its preset. Its Modules are kept.` });
|
|
@@ -97,7 +113,7 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
97
113
|
content: error instanceof Error ? error.message : "Clearing the Area failed.",
|
|
98
114
|
});
|
|
99
115
|
}
|
|
100
|
-
}, [emitCapability, router, showMessage]);
|
|
116
|
+
}, [emitCapability, reportDraftStatus, router, showMessage]);
|
|
101
117
|
usePhiSignalListener(useCallback((signal) => {
|
|
102
118
|
if (signal.channel === "areaSelection" &&
|
|
103
119
|
signal.action === "change" &&
|
|
@@ -166,6 +182,15 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
166
182
|
else if (kind === "theme" && scopeKey) {
|
|
167
183
|
search.set(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, scopeKey);
|
|
168
184
|
}
|
|
185
|
+
/*
|
|
186
|
+
* Only a changed address is a navigation. The Table hands every scope it is given back to this
|
|
187
|
+
* Controller, and replacing the address with itself still fetches the Page from the server, whose
|
|
188
|
+
* answer refreshes the workspace catalog, which makes this Controller hand the scope to the Table
|
|
189
|
+
* again: a page scope asked for its history and the Page about once a second for as long as it
|
|
190
|
+
* stood open.
|
|
191
|
+
*/
|
|
192
|
+
if (search.toString() === window.location.search.replace(/^\?/, ""))
|
|
193
|
+
return;
|
|
169
194
|
router.replace(`${pathname}?${search.toString()}`, { scroll: false });
|
|
170
195
|
return;
|
|
171
196
|
}
|
|
@@ -173,56 +198,35 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
173
198
|
const payload = signal.value;
|
|
174
199
|
const action = isPhiRecord(payload.value) ? payload.value : null;
|
|
175
200
|
const key = typeof action?.key === "string" ? action.key : "";
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
area: state.area,
|
|
199
|
-
pageKey: revisionScope.startsWith("/")
|
|
200
|
-
? resolvePhiBuilderPageKeyFromCatalogPath(state.area, revisionScope, pages)
|
|
201
|
-
: normalizePhiBuilderPageSearchParam(search.get(PHI_BUILDER_PAGE_SEARCH_PARAM)) ?? state.pageKey,
|
|
202
|
-
}
|
|
203
|
-
: {
|
|
204
|
-
area: normalizePhiBuilderAreaSearchParam(revisionScope) ?? state.area,
|
|
205
|
-
}),
|
|
206
|
-
},
|
|
207
|
-
valueType: "json",
|
|
208
|
-
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.revisionsDraftStatus,
|
|
209
|
-
sender: address,
|
|
210
|
-
receiver: "broadcast",
|
|
211
|
-
correlationId: signal.correlationId,
|
|
212
|
-
timestamp: Date.now(),
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
else if (key === "resetPage") {
|
|
216
|
-
showMessage({ level: "success", content: "The Page is back to its Module's preset." }, { correlationId: signal.correlationId });
|
|
217
|
-
// What stands now is the preset, which only the server knows how to build.
|
|
218
|
-
router.refresh();
|
|
201
|
+
const scope = isPhiRecord(action?.scope) ? action.scope : null;
|
|
202
|
+
const kind = normalizePhiBuilderRevisionsKindSearchParam(scope?.kind);
|
|
203
|
+
const area = scope?.area;
|
|
204
|
+
if (key === "restore" || key === "resetPage") {
|
|
205
|
+
const structural = (kind === "area" || kind === "page") && isPhiBuilderAreaKey(area);
|
|
206
|
+
const target = resolvePhiRevisionsDraftContextTarget(scope, action?.areaModules === true, getPhiWorkspaceCatalogSnapshot());
|
|
207
|
+
reportDraftStatus({
|
|
208
|
+
status: key === "restore" ? "draft" : "published",
|
|
209
|
+
revisionId: typeof action?.restoredRevisionId === "number" ? action.restoredRevisionId : null,
|
|
210
|
+
...(kind === "navigation" ? { navKey: scope?.navKey } : {}),
|
|
211
|
+
...(kind === "theme" ? { themeKey: scope?.themeKey } : {}),
|
|
212
|
+
...(target ?? {}),
|
|
213
|
+
}, signal.correlationId);
|
|
214
|
+
if (structural) {
|
|
215
|
+
router.refresh();
|
|
216
|
+
}
|
|
217
|
+
showMessage({
|
|
218
|
+
level: "success",
|
|
219
|
+
content: key === "restore"
|
|
220
|
+
? `Restored revision #${String(action?.revisionId ?? "")}.`
|
|
221
|
+
: "The Page is back to its Module's preset.",
|
|
222
|
+
}, { correlationId: signal.correlationId });
|
|
219
223
|
}
|
|
220
224
|
else if (key === "delete")
|
|
221
225
|
showMessage({ level: "success", content: `Deleted revision #${String(action?.revisionId ?? "")}.` }, { correlationId: signal.correlationId });
|
|
222
226
|
else if (key === "deleteSelected")
|
|
223
227
|
showMessage({ level: "success", content: `Deleted ${String(action?.deletedCount ?? 0)} revisions.` }, { correlationId: signal.correlationId });
|
|
224
228
|
}
|
|
225
|
-
}, [address, deleteAreaShell,
|
|
229
|
+
}, [address, deleteAreaShell, emitCapability, pathname, reportDraftStatus, router, showMessage]), {
|
|
226
230
|
scopes: ["area", "page"],
|
|
227
231
|
channels: ["areaSelection", "bindingParams", "command", "formValues", "mutation"],
|
|
228
232
|
},
|
|
@@ -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
|
+
}
|
|
@@ -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>;
|
|
@@ -8,7 +8,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";
|
|
11
|
+
import { resolvePhiBuilderActivePageCatalog, findPhiBuilderPageKeyFromStoragePath, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
|
|
12
12
|
import { PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM, PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM, PHI_BUILDER_THEME_KEY_SEARCH_PARAM, normalizePhiBuilderRevisionsKindSearchParam, } from "../../../../helpers/cms-scope-search-params";
|
|
13
13
|
import { resolvePhiBuilderRevisionPagePath, resolvePhiBuilderRevisionScope, } from "../types";
|
|
14
14
|
import { resolvePhiBuilderRevisionNavScopeKey } from "../../../../helpers/cms-navigation-scope-key";
|
|
@@ -73,8 +73,16 @@ function readParams(value) {
|
|
|
73
73
|
* moment rather than a fault. A page scope without a page asks for nothing and shows nothing, and
|
|
74
74
|
* fills in as soon as there is one.
|
|
75
75
|
*/
|
|
76
|
+
/*
|
|
77
|
+
* The Page a page scope names, by the address it answers on: the Page Select, the Controller and the
|
|
78
|
+
* `revisionScope` search parameter all hand the storage path, package namespace included. Matched
|
|
79
|
+
* against the path the Builder shows instead, a Module Page (`/phis/ui/dashboard`, shown as
|
|
80
|
+
* `/dashboard`) was found nowhere, read as a Site Page of that path and asked for by a path its row
|
|
81
|
+
* does not have -- so its history was empty and "Reset to preset" had no preset to name.
|
|
82
|
+
*/
|
|
76
83
|
const pageKey = kind === "page" && configuredScopeKey.startsWith("/")
|
|
77
|
-
?
|
|
84
|
+
? findPhiBuilderPageKeyFromStoragePath(scopeArea, configuredScopeKey, pages)
|
|
85
|
+
?? resolvePhiBuilderPageKeyFromCatalogPath(scopeArea, configuredScopeKey, pages)
|
|
78
86
|
: activePageKey ?? "";
|
|
79
87
|
const navScopeKey = kind === "navigation" && configuredScopeKey
|
|
80
88
|
? resolvePhiBuilderRevisionNavScopeKey(scopeArea, configuredScopeKey)
|
|
@@ -148,12 +156,13 @@ async function loadRevisionHistory(scope, signal) {
|
|
|
148
156
|
* Nothing is being asked about yet.
|
|
149
157
|
*
|
|
150
158
|
* Both cases are the same moment: a panel opened before the workspace catalog arrived. A page scope
|
|
151
|
-
* has no page
|
|
159
|
+
* has no page -- neither a Site Page's path nor a Module Page's preset -- and an Area scope has no
|
|
160
|
+
* preset source -- and the Area scope is refused by the server
|
|
152
161
|
* rather than the client, because a revision belongs to a preset and an Area without one names
|
|
153
162
|
* nothing. Asking anyway answers a surface that is waiting with an error; the scope key carries the
|
|
154
163
|
* preset, so the question is asked again by itself once there is one.
|
|
155
164
|
*/
|
|
156
|
-
if ((scope.kind === "page" && !scope.path) ||
|
|
165
|
+
if ((scope.kind === "page" && !scope.path && !scope.sourcePreset) ||
|
|
157
166
|
(scope.kind === "area" && !scope.sourcePreset)) {
|
|
158
167
|
return {
|
|
159
168
|
kind: scope.kind,
|
|
@@ -428,7 +437,7 @@ async function mutateRevision(request) {
|
|
|
428
437
|
return {
|
|
429
438
|
status: "accepted",
|
|
430
439
|
invalidation: "view",
|
|
431
|
-
value: { key: request.actionKey },
|
|
440
|
+
value: { key: request.actionKey, scope: params.scope },
|
|
432
441
|
};
|
|
433
442
|
}
|
|
434
443
|
const current = await loadRevisionHistory(params.scope, request.signal);
|
|
@@ -443,6 +452,8 @@ async function mutateRevision(request) {
|
|
|
443
452
|
key: request.actionKey,
|
|
444
453
|
revisionId,
|
|
445
454
|
restoredRevisionId: result.revisionId,
|
|
455
|
+
scope: params.scope,
|
|
456
|
+
areaModules: params.scope.kind === "area" && current.rows.some((row) => row.revisionId === revisionId && !row.sourcePreset),
|
|
446
457
|
};
|
|
447
458
|
}
|
|
448
459
|
else if (request.actionKey === "delete") {
|
|
@@ -95,7 +95,7 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
|
|
|
95
95
|
label: "Builder delete area",
|
|
96
96
|
config: {
|
|
97
97
|
title: revisionsLabels.deleteArea.title,
|
|
98
|
-
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
98
|
+
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
99
99
|
/*
|
|
100
100
|
* `remount` rather than `lazy-keep`: the field is the confirmation, and a dialog that kept a
|
|
101
101
|
* half-typed Area key from the last time it was opened would carry an answer across to a
|
|
@@ -396,6 +396,8 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
|
|
|
396
396
|
id: PHI_REVISIONS_TABLE_WIDGET_ID,
|
|
397
397
|
parentLayoutNodeId: PHI_REVISIONS_PAGE_LAYOUT_IDS.layoutContent,
|
|
398
398
|
slotIndex: 0,
|
|
399
|
+
// The Module's Label Set, translated already.
|
|
400
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
399
401
|
label: "dev revisions table",
|
|
400
402
|
config: {
|
|
401
403
|
source: {
|
|
@@ -3,7 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { PhiEmptyControl } from "../../../../../components/controls/phi-empty-control";
|
|
4
4
|
import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
|
|
5
5
|
import { PhiLink } from "../../../../../components/navigation/phi-link";
|
|
6
|
-
import {
|
|
6
|
+
import { usePhiIntlLocale } from "../../../../../components/root/phi-intl-locale";
|
|
7
|
+
import { formatPhiCountLabel, formatPhiTranslation } from "../../../../../helpers/translation-format";
|
|
7
8
|
import { PHI_SPACE } from "../../../../../theme/antd-css-var-contract";
|
|
8
9
|
function PhiSearchSnippet({ segments }) {
|
|
9
10
|
if (segments.length === 0)
|
|
@@ -18,6 +19,7 @@ function PhiSearchSnippet({ segments }) {
|
|
|
18
19
|
* answered, so a reader who arrived by a pasted link knows what they are looking at.
|
|
19
20
|
*/
|
|
20
21
|
export function PhiSearchResultsWidgetClient({ labels, config }) {
|
|
22
|
+
const locale = usePhiIntlLocale();
|
|
21
23
|
if (!config)
|
|
22
24
|
return null;
|
|
23
25
|
if (config.state === "idle") {
|
|
@@ -27,6 +29,6 @@ export function PhiSearchResultsWidgetClient({ labels, config }) {
|
|
|
27
29
|
return (_jsx(PhiTypographyControl, { type: "secondary", children: formatPhiTranslation(labels.short, [String(config.minLength)]) }));
|
|
28
30
|
}
|
|
29
31
|
const heading = config.title ?? formatPhiTranslation(labels.heading, [config.query]);
|
|
30
|
-
const count =
|
|
32
|
+
const count = formatPhiCountLabel(labels.count, config.total, locale);
|
|
31
33
|
return (_jsxs("section", { "aria-label": labels.region, style: { display: "flex", flexDirection: "column", gap: PHI_SPACE.sm }, children: [_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: PHI_SPACE.xxs }, children: [_jsx(PhiTypographyControl, { presentation: "title", level: 2, style: { marginTop: 0, marginBottom: 0 }, children: heading }), config.hits.length > 0 ? _jsx(PhiTypographyControl, { type: "secondary", children: count }) : null] }), config.hits.length === 0 ? (_jsx(PhiEmptyControl, { description: formatPhiTranslation(labels.empty, [config.query]) })) : (_jsx("ol", { style: { listStyle: "none", margin: 0, padding: 0, display: "flex", flexDirection: "column", gap: PHI_SPACE.base }, children: config.hits.map((hit) => (_jsxs("li", { style: { display: "flex", flexDirection: "column", gap: PHI_SPACE.xxs }, children: [_jsx(PhiTypographyControl, { presentation: "title", level: 3, style: { marginTop: 0, marginBottom: 0 }, children: _jsx(PhiLink, { href: hit.href, children: hit.title }) }), _jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: "0.85em" }, children: hit.href }), hit.description ? (_jsx(PhiTypographyControl, { presentation: "paragraph", style: { marginBottom: 0 }, children: hit.description })) : null, _jsx(PhiSearchSnippet, { segments: hit.snippet })] }, hit.href))) }))] }));
|
|
32
34
|
}
|
|
@@ -75,6 +75,10 @@ export declare const PHI_THEME_RUNTIME_MODULE_ROUTES: {
|
|
|
75
75
|
path: string;
|
|
76
76
|
landingPage?: true;
|
|
77
77
|
title: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
shareImage?: {
|
|
80
|
+
asset: string;
|
|
81
|
+
};
|
|
78
82
|
defaultPageFlags?: number;
|
|
79
83
|
loadTree: (context: import("../../../types").PhiCmsDescriptorBuildContext & {
|
|
80
84
|
activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
|