@phis/ui 0.4.2 → 0.4.4
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 +4 -3
- package/components/cms/phi-cms-page-render-scope.d.ts +4 -5
- package/components/cms/phi-cms-page-render-scope.js +43 -22
- package/components/cms/phi-cms-render-diagnostic-client.js +7 -3
- package/components/cms/phi-cms-render-error-boundary.js +2 -1
- package/components/controls/phi-anchor-nav-control.js +4 -1
- package/components/controls/phi-background-control.js +21 -6
- package/components/controls/phi-bullet-list-control.d.ts +7 -2
- package/components/controls/phi-bullet-list-control.js +35 -5
- package/components/controls/phi-color-control.js +4 -2
- package/components/controls/phi-drawer-control-adapter.js +3 -2
- package/components/controls/phi-inline-text-editor.js +7 -1
- package/components/controls/phi-length-control.js +1 -1
- package/components/controls/phi-ribbon-control.d.ts +38 -0
- package/components/controls/phi-ribbon-control.js +57 -0
- package/components/controls/phi-ribbon-wrap-control.d.ts +26 -0
- package/components/controls/phi-ribbon-wrap-control.js +25 -0
- package/components/controls/phi-select-control.js +5 -2
- package/components/controls/phi-series-chart-control.d.ts +48 -0
- package/components/controls/phi-series-chart-control.js +82 -0
- package/components/controls/phi-table-control.d.ts +3 -0
- package/components/controls/phi-table-control.js +13 -1
- package/components/controls/phi-text-control.js +57 -3
- package/components/controls/phi-tree-control.js +4 -4
- package/components/controls/phi-truncated-hover-text.d.ts +15 -0
- package/components/controls/phi-truncated-hover-text.js +25 -0
- package/components/forms/link-target-form-control.d.ts +1 -1
- package/components/forms/link-target-form-control.js +2 -45
- package/components/forms/phi-form-widget-frame.js +4 -2
- package/components/forms/shared-form-provider-registry.js +1 -4
- package/components/layouts/clients/phi-three-column-layout-client.js +10 -1
- package/components/media/asset-collection-runtime.js +6 -16
- package/components/media/media-font-metrics.d.ts +3 -0
- package/components/media/media-font-metrics.js +43 -0
- package/components/media/phi-area-upload-widget.js +53 -97
- package/components/media/phi-image-preview-data.d.ts +13 -0
- package/components/media/phi-image-preview-data.js +184 -9
- package/components/media/phi-media-picker-binding.js +16 -13
- package/components/media/phi-media-upload.d.ts +15 -8
- package/components/media/phi-media-upload.js +18 -9
- package/components/media/phi-site-font-assets.js +7 -8
- package/components/navigation/phi-link.js +6 -1
- package/components/overlays/phi-overlay-container-client.js +16 -1
- package/components/regions/clients/cms-region-container-client.js +6 -1
- package/components/regions/phi-cms-region-container.js +3 -0
- package/components/regions/phi-cms-region-shell.d.ts +12 -1
- package/components/regions/phi-cms-region-shell.js +81 -19
- package/components/regions/presets/phi-settings-page-shell-tree.js +48 -1
- package/components/root/phi-config-provider.d.ts +13 -0
- package/components/root/phi-config-provider.js +12 -1
- package/components/root/phi-root-background.d.ts +7 -0
- package/components/root/phi-root-background.js +20 -1
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/root/phi-shell-chrome-overlay.d.ts +12 -1
- package/components/root/phi-shell-chrome-overlay.js +19 -3
- package/components/runtime/runtime-controller-materialization.js +12 -1
- package/components/shell/phi-antd-icon.d.ts +1 -0
- package/components/shell/phi-antd-icon.js +3 -0
- package/components/shell/use-phi-shell-sticky-top.js +61 -16
- package/components/state/scoped-state-store.js +20 -3
- package/components/surface/phi-surface-tone.d.ts +13 -0
- package/components/surface/phi-surface-tone.js +21 -0
- package/components/tables/client/phi-table-binding.d.ts +2 -1
- package/components/tables/client/phi-table-binding.js +45 -21
- package/components/trees/client/phi-tree-binding.js +19 -11
- package/components/widgets/client/bullet-list-entries-editor.d.ts +26 -0
- package/components/widgets/client/bullet-list-entries-editor.js +109 -0
- package/components/widgets/client/html-editor.js +1 -1
- package/components/widgets/client/shared/use-page-reference-options.d.ts +17 -0
- package/components/widgets/client/shared/use-page-reference-options.js +57 -0
- package/components/widgets/config/background.d.ts +32 -1
- package/components/widgets/config/background.js +41 -2
- package/components/widgets/config/choice-shared.js +12 -13
- package/components/widgets/config/command-buttons.d.ts +5 -1
- package/components/widgets/config/command-buttons.js +38 -81
- package/components/widgets/config/control-signal-config.d.ts +3 -1
- package/components/widgets/config/control-signal-config.js +19 -17
- package/components/widgets/config/image-source-parser.d.ts +1 -0
- package/components/widgets/config/image-source-parser.js +7 -8
- package/components/widgets/config/mask.d.ts +6 -1
- package/components/widgets/config/mask.js +24 -1
- package/components/widgets/config/parser-primitives.js +72 -0
- package/components/widgets/config/stack-tabs.d.ts +1 -1
- package/components/widgets/config/stack-tabs.js +2 -3
- package/components/widgets/config/strict-config-reader.d.ts +40 -0
- package/components/widgets/config/strict-config-reader.js +174 -0
- package/components/widgets/label-sets/background.js +2 -0
- package/components/widgets/label-sets/effects.js +2 -0
- package/components/widgets/label-types/background.d.ts +1 -0
- package/components/widgets/label-types/background.js +1 -0
- package/components/widgets/label-types/effects.d.ts +1 -0
- package/components/widgets/label-types/effects.js +1 -0
- package/components/widgets/navigation-descriptor-resolver.server.js +20 -8
- package/components/widgets/shared/bullet-list-vocabulary.d.ts +27 -1
- package/components/widgets/shared/bullet-list-vocabulary.js +24 -4
- package/components/widgets/shared/card-body-client.d.ts +18 -4
- package/components/widgets/shared/card-body-client.js +126 -26
- package/components/widgets/shared/card-vocabulary.d.ts +31 -4
- package/components/widgets/shared/card-vocabulary.js +35 -2
- package/components/widgets/shared/markdown-body-client.js +39 -10
- package/components/widgets/signals/control-signal-capabilities.d.ts +0 -18
- package/components/widgets/signals/control-signal-capabilities.js +10 -22
- package/components/workspace/catalog-store.d.ts +4 -3
- package/components/workspace/catalog-store.js +6 -5
- package/gateway/dashboard-cards-route.js +1 -0
- package/gateway/internal-references.d.ts +6 -1
- package/gateway/internal-references.js +48 -23
- package/gateway/site-cms-write-validation.d.ts +9 -0
- package/gateway/site-cms-write-validation.js +78 -0
- package/gateway/site-proxy.js +19 -3
- package/helpers/cms-container-chrome.js +6 -1
- package/helpers/locale.d.ts +8 -0
- package/helpers/locale.js +18 -0
- package/helpers/renderable-block-serialization.js +1 -1
- package/helpers/shell-region-style.js +2 -1
- package/helpers/surface-style.d.ts +12 -1
- package/helpers/surface-style.js +28 -2
- package/module-dashboard-cards.d.ts +1 -1
- package/module-dashboard-cards.js +1 -1
- package/next/config.d.mts +3 -0
- package/next/config.mjs +28 -1
- package/package.json +2 -2
- package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +5 -1
- package/plugins/runtime-modules/accounting/presets.d.ts +9 -0
- package/plugins/runtime-modules/accounting/presets.js +37 -0
- package/plugins/runtime-modules/accounting/server.d.ts +1 -4
- package/plugins/runtime-modules/accounting/server.js +4 -7
- package/plugins/runtime-modules/app/presets.d.ts +18 -0
- package/plugins/runtime-modules/app/presets.js +67 -0
- package/plugins/runtime-modules/app/server.d.ts +1 -4
- package/plugins/runtime-modules/app/server.js +4 -7
- package/plugins/runtime-modules/area-definitions.d.ts +0 -42
- package/plugins/runtime-modules/area-definitions.js +3 -8
- package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
- package/plugins/runtime-modules/asset/services/collection.js +9 -1
- package/plugins/runtime-modules/asset/services/options.js +2 -2
- package/plugins/runtime-modules/builder/area-settings-answer.js +2 -1
- package/plugins/runtime-modules/builder/authoring-canvas.js +6 -6
- package/plugins/runtime-modules/builder/cards.js +3 -5
- package/plugins/runtime-modules/builder/clients/builder-region-overrides.js +3 -3
- package/plugins/runtime-modules/builder/clients/canvas-widget.js +15 -54
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +25 -35
- package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +8 -8
- package/plugins/runtime-modules/builder/clients/inspector-title.js +6 -6
- package/plugins/runtime-modules/builder/clients/layout-inspector.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/layout-inspector.js +11 -25
- package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +10 -5
- package/plugins/runtime-modules/builder/clients/mode-switch.js +1 -1
- package/plugins/runtime-modules/builder/clients/pages-header.js +11 -11
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
- package/plugins/runtime-modules/builder/clients/shells-workspace.js +15 -31
- package/plugins/runtime-modules/builder/clients/structure-canvas.js +1 -1
- package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.d.ts +26 -0
- package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.js +36 -0
- package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +1 -0
- package/plugins/runtime-modules/builder/clients/workspace-scope-boundary.js +2 -2
- package/plugins/runtime-modules/builder/cms-instance-allocator.js +8 -28
- package/plugins/runtime-modules/builder/controller/client.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/definition.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/definition.js +0 -8
- package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +11 -30
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +15 -2
- package/plugins/runtime-modules/builder/controller/inspector-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/inspector-controller.js +4 -7
- package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/page-controller.js +16 -68
- package/plugins/runtime-modules/builder/controller/server-definition.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.d.ts +2 -5
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +6 -50
- package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +2 -3
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +89 -153
- package/plugins/runtime-modules/builder/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/builder/data-providers.js +1 -0
- package/plugins/runtime-modules/builder/definition.d.ts +1 -0
- package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +64 -30
- package/plugins/runtime-modules/builder/developer-workspace-store.js +255 -61
- package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +4 -3
- package/plugins/runtime-modules/builder/history.d.ts +3 -1
- package/plugins/runtime-modules/builder/options-providers.js +3 -2
- package/plugins/runtime-modules/builder/page-catalog-client.js +19 -7
- package/plugins/runtime-modules/builder/page-meta-form.js +1 -0
- package/plugins/runtime-modules/builder/page-references-provider.js +1 -1
- package/plugins/runtime-modules/builder/persistence.js +33 -69
- package/plugins/runtime-modules/builder/public-route-collisions.d.ts +2 -2
- package/plugins/runtime-modules/builder/public-route-collisions.js +6 -19
- package/plugins/runtime-modules/builder/render-root-node-preview.server.js +20 -3
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +28 -18
- package/plugins/runtime-modules/builder/runtime-module-selection.d.ts +2 -12
- package/plugins/runtime-modules/builder/runtime-module-selection.js +16 -42
- package/plugins/runtime-modules/builder/services/navigation-table.js +9 -15
- package/plugins/runtime-modules/builder/services/page-source-tree.js +8 -8
- package/plugins/runtime-modules/builder/services/runtime-modules-table.js +10 -10
- package/plugins/runtime-modules/builder/services/signal-routes-table.js +3 -3
- package/plugins/runtime-modules/builder/signal-route-selection.d.ts +1 -2
- package/plugins/runtime-modules/builder/signal-route-selection.js +2 -2
- package/plugins/runtime-modules/builder/signal-wiring-options.js +3 -2
- package/plugins/runtime-modules/builder/structure-dnd.js +8 -61
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +17 -10
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +27 -22
- package/plugins/runtime-modules/builder/workspace-catalog-actions.d.ts +55 -0
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +142 -0
- package/plugins/runtime-modules/client-authoring-module.d.ts +8 -1
- package/plugins/runtime-modules/client-authoring-module.js +13 -3
- package/plugins/runtime-modules/client-manifests/common.js +1 -1
- package/plugins/runtime-modules/{runtime-calendar-adapters.js → core/calendar-adapters.js} +2 -2
- package/plugins/runtime-modules/{client-calendar-adapters/core.js → core/client-calendar-adapters.js} +1 -1
- package/plugins/runtime-modules/core/content-entries/table.js +1 -1
- package/plugins/runtime-modules/core/data-providers.d.ts +3 -0
- package/plugins/runtime-modules/core/data-providers.js +2 -1
- package/plugins/runtime-modules/core/definition.d.ts +3 -0
- package/plugins/runtime-modules/core/definition.js +1 -1
- package/plugins/runtime-modules/core/messaging/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/core/messaging/data-providers.js +1 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +1 -1
- package/plugins/runtime-modules/core/server.js +1 -1
- package/plugins/runtime-modules/core/themes.d.ts +44 -0
- package/plugins/runtime-modules/core/themes.js +12 -0
- package/plugins/runtime-modules/core/widgets/brand/client.d.ts +12 -3
- package/plugins/runtime-modules/core/widgets/brand/client.js +3 -11
- package/plugins/runtime-modules/core/widgets/brand/home.d.ts +15 -0
- package/plugins/runtime-modules/core/widgets/brand/home.js +18 -0
- package/plugins/runtime-modules/core/widgets/brand/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/brand/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/card/collection-view-binding.js +25 -9
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +301 -254
- package/plugins/runtime-modules/core/widgets/card/config.js +68 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +41 -4
- package/plugins/runtime-modules/core/widgets/card/server.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/card/server.js +32 -3
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +7 -6
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +9 -2
- package/plugins/runtime-modules/core/widgets/description/client.js +3 -3
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/description/editor.js +7 -63
- package/plugins/runtime-modules/core/widgets/description/server.js +3 -2
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/html/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/image/config.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +320 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -4
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +11 -4
- package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +6 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.js +14 -2
- package/plugins/runtime-modules/core/widgets/quick-links/authoring.js +7 -2
- package/plugins/runtime-modules/core/widgets/quick-links/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.d.ts +0 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.js +0 -15
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +5 -25
- package/plugins/runtime-modules/core/widgets/result/config.js +2 -0
- package/plugins/runtime-modules/core/widgets/result/server.js +25 -19
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/client.js +8 -3
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +11 -2
- package/plugins/runtime-modules/core/widgets/table/client.js +8 -4
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +6 -83
- package/plugins/runtime-modules/core/widgets/table/config.js +302 -452
- package/plugins/runtime-modules/core/widgets/tree/config.js +5 -2
- package/plugins/runtime-modules/dashboard/card-rows.d.ts +7 -0
- package/plugins/runtime-modules/dashboard/card-rows.js +87 -0
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +32 -12
- package/plugins/runtime-modules/dashboard/services/collection.js +17 -7
- package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +5 -40
- package/plugins/runtime-modules/groups/data-providers.d.ts +2 -0
- package/plugins/runtime-modules/groups/data-providers.js +3 -3
- package/plugins/runtime-modules/groups/definition.d.ts +2 -0
- package/plugins/runtime-modules/localization/data-providers.d.ts +3 -0
- package/plugins/runtime-modules/localization/data-providers.js +2 -0
- package/plugins/runtime-modules/localization/definition.d.ts +3 -0
- package/plugins/runtime-modules/localization/services/table.js +3 -7
- package/plugins/runtime-modules/observability/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/observability/data-providers.js +1 -0
- package/plugins/runtime-modules/observability/definition.d.ts +1 -0
- package/plugins/runtime-modules/observability/module.d.ts +1 -0
- package/plugins/runtime-modules/observability/services/table.js +1 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +2 -105
- package/plugins/runtime-modules/public/presets.d.ts +115 -0
- package/plugins/runtime-modules/{area-base-presets.js → public/presets.js} +19 -119
- package/plugins/runtime-modules/public/server.d.ts +1 -4
- package/plugins/runtime-modules/public/server.js +4 -7
- package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +7 -8
- package/plugins/runtime-modules/public-base-page-references.d.ts +1 -1
- package/plugins/runtime-modules/public-base-page-references.js +1 -1
- package/plugins/runtime-modules/revisions/controller/client.js +11 -11
- package/plugins/runtime-modules/revisions/services/table.js +3 -3
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +22 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.d.ts +2 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +111 -72
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +2 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +28 -31
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +1 -1
- package/plugins/runtime-modules/theme-descriptors.js +1 -1
- package/plugins/runtime-modules/user-management/data-providers.d.ts +2 -0
- package/plugins/runtime-modules/user-management/data-providers.js +1 -0
- package/plugins/runtime-modules/user-management/definition.d.ts +2 -0
- package/server-helpers/cms-link-targets.js +6 -0
- package/styles/control-shape.css +11 -11
- package/styles/controls.css +67 -5
- package/styles/layout.css +61 -9
- package/styles/shell.css +73 -0
- package/theme/phi-antd-token-resolver.js +20 -1
- package/theme/phi-theme-tokens.d.ts +1 -1
- package/theme/phi-theme-tokens.js +1 -0
- package/theme/phi-theme.d.ts +5 -0
- package/theme/phi-theme.js +21 -0
- package/theme/phi-tokens.d.ts +16 -15
- package/theme/phi-tokens.js +16 -15
- package/types/cms-config.js +142 -185
- package/types/cms-plugins.d.ts +6 -11
- package/types/core-widget-placements.d.ts +14 -3
- package/types/dashboard-cards.d.ts +48 -4
- package/types/dashboard-cards.js +6 -0
- package/types/media.d.ts +0 -3
- package/types/renderable-block.d.ts +6 -1
- package/types/site-theme.d.ts +10 -2
- package/types/table-widget.d.ts +9 -0
- package/types/table-widget.js +20 -0
- package/types.d.ts +1 -1
- package/widget-config.d.ts +2 -0
- package/widget-config.js +6 -0
- package/plugins/runtime-modules/area-base-presets.d.ts +0 -139
- /package/plugins/runtime-modules/{runtime-calendar-adapters.d.ts → core/calendar-adapters.d.ts} +0 -0
- /package/plugins/runtime-modules/{client-calendar-adapters/core.d.ts → core/client-calendar-adapters.d.ts} +0 -0
|
@@ -7,7 +7,7 @@ import { hasPhiCmsPresetUpdate } from "../../../../plugins/runtime-modules/prese
|
|
|
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
|
-
import { getPhiWorkspaceCatalogSnapshot,
|
|
10
|
+
import { getPhiWorkspaceCatalogSnapshot, } from "../../../../components/workspace/catalog-store";
|
|
11
11
|
import { resolvePhiBuilderActivePageCatalog, 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";
|
|
@@ -46,7 +46,7 @@ function readParams(value) {
|
|
|
46
46
|
}
|
|
47
47
|
const locale = value.locale;
|
|
48
48
|
if (!isPhiRecord(value.scope) && typeof window !== "undefined") {
|
|
49
|
-
const state = getPhiWorkspaceCatalogSnapshot(
|
|
49
|
+
const state = getPhiWorkspaceCatalogSnapshot();
|
|
50
50
|
const search = new URLSearchParams(window.location.search);
|
|
51
51
|
const kind = normalizePhiBuilderRevisionsKindSearchParam(value.kind) ??
|
|
52
52
|
normalizePhiBuilderRevisionsKindSearchParam(search.get(PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM)) ??
|
|
@@ -251,7 +251,7 @@ function readModuleIds(value) {
|
|
|
251
251
|
* title to show, so it is written by its id -- it is still what the revision changed.
|
|
252
252
|
*/
|
|
253
253
|
function formatModuleChangeList(labels, modules) {
|
|
254
|
-
const titles = new Map(getPhiWorkspaceCatalogSnapshot(
|
|
254
|
+
const titles = new Map(getPhiWorkspaceCatalogSnapshot().runtimeModuleDefinitions
|
|
255
255
|
.map((definition) => [definition.moduleId, definition.title]));
|
|
256
256
|
const name = (moduleId) => titles.get(moduleId) ?? moduleId;
|
|
257
257
|
return [
|
|
@@ -13,6 +13,21 @@ import { PHI_THEME_SIGNAL_CHANNELS } from "../controller/signals";
|
|
|
13
13
|
import { PHI_THEME_RUNTIME_MODULE_ID } from "../ids";
|
|
14
14
|
import { buildPhiThemeSetSelectOptions } from "../set-options";
|
|
15
15
|
import { PHI_THEME_PAGE_LAYOUT_IDS, PHI_THEME_PAGE_WIDGET_IDS } from "../page-ids";
|
|
16
|
+
/**
|
|
17
|
+
* A Theme panel's way to hear the preview mode switch: the switch broadcasts on the Page, and every panel
|
|
18
|
+
* that draws in that mode takes it through this route, as any Widget takes an input.
|
|
19
|
+
*/
|
|
20
|
+
function brandPreviewModeListenRoute(widgetId) {
|
|
21
|
+
return {
|
|
22
|
+
routeKey: "brand-preview-mode",
|
|
23
|
+
capabilityId: "previewThemeMode",
|
|
24
|
+
scope: "page",
|
|
25
|
+
channel: PHI_THEME_SIGNAL_CHANNELS.previewThemeMode,
|
|
26
|
+
action: "change",
|
|
27
|
+
valueType: "boolean",
|
|
28
|
+
receiver: createPhiSignalAddress("cms", widgetId),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
16
31
|
const PHI_THEME_PAGE_PRESET_KEY = "builder-theme-page";
|
|
17
32
|
const PHI_THEME_PAGE_REGION_IDS = {
|
|
18
33
|
regionHeaderBottom: -511,
|
|
@@ -527,6 +542,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
|
|
|
527
542
|
label: "dev brand theme controls",
|
|
528
543
|
config: {
|
|
529
544
|
themeKey: "default",
|
|
545
|
+
signalRoutes: { listens: [brandPreviewModeListenRoute(PHI_THEME_PAGE_WIDGET_IDS.widgetBrandThemeControls)] },
|
|
530
546
|
minSize: { width: 300 },
|
|
531
547
|
maxSize: { width: 400 },
|
|
532
548
|
},
|
|
@@ -540,6 +556,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
|
|
|
540
556
|
label: "dev brand theme preview",
|
|
541
557
|
config: {
|
|
542
558
|
themeKey: "default",
|
|
559
|
+
signalRoutes: { listens: [brandPreviewModeListenRoute(PHI_THEME_PAGE_WIDGET_IDS.widgetBrandThemePreview)] },
|
|
543
560
|
minSize: { width: 360 },
|
|
544
561
|
},
|
|
545
562
|
}),
|
|
@@ -565,6 +582,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
|
|
|
565
582
|
label: "dev brand background controls",
|
|
566
583
|
config: {
|
|
567
584
|
themeKey: "default",
|
|
585
|
+
signalRoutes: { listens: [brandPreviewModeListenRoute(PHI_THEME_PAGE_WIDGET_IDS.widgetBrandBackgroundControls)] },
|
|
568
586
|
// The three Theme panels share one slot, so they share one width. A wider Background
|
|
569
587
|
// panel widened the slot itself and the column jumped whenever it was selected.
|
|
570
588
|
minSize: { width: 300 },
|
|
@@ -580,6 +598,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
|
|
|
580
598
|
label: "dev brand background preview",
|
|
581
599
|
config: {
|
|
582
600
|
themeKey: "default",
|
|
601
|
+
signalRoutes: { listens: [brandPreviewModeListenRoute(PHI_THEME_PAGE_WIDGET_IDS.widgetBrandBackgroundPreview)] },
|
|
583
602
|
minSize: { width: 360 },
|
|
584
603
|
},
|
|
585
604
|
}),
|
|
@@ -592,6 +611,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
|
|
|
592
611
|
label: "dev brand style preview",
|
|
593
612
|
config: {
|
|
594
613
|
themeKey: "default",
|
|
614
|
+
signalRoutes: { listens: [brandPreviewModeListenRoute(PHI_THEME_PAGE_WIDGET_IDS.widgetBrandStylePreview)] },
|
|
595
615
|
minSize: { width: 360 },
|
|
596
616
|
},
|
|
597
617
|
}),
|
|
@@ -604,6 +624,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
|
|
|
604
624
|
label: "dev brand identity controls",
|
|
605
625
|
config: {
|
|
606
626
|
themeKey: "default",
|
|
627
|
+
signalRoutes: { listens: [brandPreviewModeListenRoute(PHI_THEME_PAGE_WIDGET_IDS.widgetBrandIdentityControls)] },
|
|
607
628
|
minSize: { width: 300 },
|
|
608
629
|
maxSize: { width: 400 },
|
|
609
630
|
},
|
|
@@ -624,6 +645,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
|
|
|
624
645
|
label: "dev brand identity preview",
|
|
625
646
|
config: {
|
|
626
647
|
themeKey: "default",
|
|
648
|
+
signalRoutes: { listens: [brandPreviewModeListenRoute(PHI_THEME_PAGE_WIDGET_IDS.widgetBrandIdentityPreview)] },
|
|
627
649
|
minSize: { width: 360 },
|
|
628
650
|
},
|
|
629
651
|
}),
|
|
@@ -29,6 +29,7 @@ export declare function PhiBuilderBrandBackgroundControlsWidgetClient({ runtime,
|
|
|
29
29
|
runtime: PhiBlockRuntime;
|
|
30
30
|
config?: PhiBuilderBrandWidgetConfig | null;
|
|
31
31
|
}): import("react").JSX.Element;
|
|
32
|
-
export declare function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }: {
|
|
32
|
+
export declare function PhiBuilderBrandThemePreviewWidgetClient({ runtime, config, }: {
|
|
33
33
|
runtime: PhiBlockRuntime;
|
|
34
|
+
config?: PhiBuilderBrandWidgetConfig | null;
|
|
34
35
|
}): import("react").JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
|
|
4
4
|
import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../../components/runtime/runtime-signal-bus";
|
|
5
5
|
import { usePhiSignalIdentity } from "../../../../../components/runtime/runtime-signal-identity";
|
|
6
|
+
import { usePhiControlSignalController } from "../../../../../components/widgets/client/shared/phi-control-signals";
|
|
6
7
|
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../../types/signals";
|
|
7
8
|
import { createPhiThemeControllerAddress } from "../../../../../plugins/runtime-modules/theme/controller/address";
|
|
8
9
|
import { PHI_THEME_SIGNAL_CHANNELS } from "../../../../../plugins/runtime-modules/theme/controller/signals";
|
|
@@ -23,7 +24,7 @@ import { PHI_SPACING_TOKEN_KEYS } from "../../../../../components/widgets/config
|
|
|
23
24
|
import { PhiColorFieldControl } from "../../../../../components/controls/phi-color-field-control";
|
|
24
25
|
import { PhiBrandControl, resolvePhiBrandLogoUrl } from "../../../../../components/controls/phi-brand-control";
|
|
25
26
|
import { PhiBackgroundControl } from "../../../../../components/controls/phi-background-control";
|
|
26
|
-
import { PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, PHI_ROOT_BACKGROUND_FILTERS, PHI_ROOT_BACKGROUND_MOTION_MODES, resolvePhiRootBackgroundPaintStyle, } from "../../../../../components/root/phi-root-background";
|
|
27
|
+
import { PHI_ROOT_BACKGROUND_BASE_KINDS, PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, PHI_ROOT_BACKGROUND_FILTERS, PHI_ROOT_BACKGROUND_MOTION_MODES, resolvePhiRootBackgroundPaintStyle, } from "../../../../../components/root/phi-root-background";
|
|
27
28
|
import { PHI_SHELL_CHROME_OVERLAY_BASE_KINDS, PHI_SHELL_CHROME_OVERLAY_FILTERS, PHI_SHELL_CHROME_OVERLAY_IMAGE_SOURCE_KINDS, PHI_SHELL_CHROME_OVERLAY_MOTION_MODES, resolvePhiShellChromeOverlayConfig, resolvePhiShellChromePaneShadow, resolvePhiShellChromePaneShadows, resolvePhiShellChromeOverlayStyle, } from "../../../../../components/root/phi-shell-chrome-overlay";
|
|
28
29
|
import { normalizePhiBackgroundWidgetConfig } from "../../../../../components/widgets/config/background";
|
|
29
30
|
import { PhiMediaPickerBinding } from "../../../../../components/media/phi-media-picker-binding";
|
|
@@ -33,13 +34,12 @@ import { buildPhiMediaAssetContentDeliveryUrl, PhiMediaAssetFlags, PhiMediaKind,
|
|
|
33
34
|
import { createPhiMediaPickerAssetControllerRoutes } from "../../../../../components/media/asset-controller-routes";
|
|
34
35
|
import { PhiPresetSizeControl } from "../../../../../components/controls/phi-preset-size-control";
|
|
35
36
|
import { PhiButtonControl } from "../../../../../components/controls/phi-button-control";
|
|
36
|
-
import { PhiCascaderControl } from "../../../../../components/controls/phi-cascader-control";
|
|
37
37
|
import { PhiCheckboxControl } from "../../../../../components/controls/phi-checkbox-control";
|
|
38
38
|
import { PhiLabeledControl } from "../../../../../components/controls/phi-labeled-control";
|
|
39
39
|
import { PhiNumberControl } from "../../../../../components/controls/phi-number-control";
|
|
40
40
|
import { PhiColorControl } from "../../../../../components/controls/phi-color-control";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
41
|
+
import { PhiLinkTargetControl } from "../../../../../components/widgets/client/shared/phi-link-target-control";
|
|
42
|
+
import { usePhiPageReferenceOptions } from "../../../../../components/widgets/client/shared/use-page-reference-options";
|
|
43
43
|
import { PhiShadowControl } from "../../../../../components/controls/phi-shadow-control";
|
|
44
44
|
import { PhiIcon } from "../../../../../components/shell/phi-icon";
|
|
45
45
|
import { PhiIconPickerControl } from "../../../../../components/controls/phi-icon-picker-control";
|
|
@@ -484,6 +484,35 @@ function readEffectiveTokenString(token, key, fallback) {
|
|
|
484
484
|
const value = token[key];
|
|
485
485
|
return typeof value === "string" && value.trim() ? value : fallback;
|
|
486
486
|
}
|
|
487
|
+
/*
|
|
488
|
+
* A value the alias resolver always sets (`resolvePhiAntdAliasTokens`), read without a stand-in. The
|
|
489
|
+
* previews used to carry a hex fallback beside each of these, which could only ever show if the resolver
|
|
490
|
+
* broke -- and then showed a colour that was nobody's Theme instead of saying so.
|
|
491
|
+
*/
|
|
492
|
+
function readAliasTokenString(token, key) {
|
|
493
|
+
const value = token[key];
|
|
494
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
495
|
+
throw new Error(`The resolved Theme has no "${key}".`);
|
|
496
|
+
}
|
|
497
|
+
return value;
|
|
498
|
+
}
|
|
499
|
+
function readAliasTokenNumber(token, key) {
|
|
500
|
+
const value = token[key];
|
|
501
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
502
|
+
throw new Error(`The resolved Theme has no "${key}".`);
|
|
503
|
+
}
|
|
504
|
+
return value;
|
|
505
|
+
}
|
|
506
|
+
/** A draft's alias tokens for one mode, its blocks folded in, as the live render resolves a Theme. */
|
|
507
|
+
function resolveBrandDraftAliasTokens(resolvedTheme, preset, mode, fonts = {}) {
|
|
508
|
+
return resolvePhiAntdAliasTokens(mode, {
|
|
509
|
+
...buildPhiEffectiveNonColorThemeTokens(resolvedTheme),
|
|
510
|
+
...resolvePhiThemeColorTokens(preset, resolvedTheme.palette, mode),
|
|
511
|
+
...(resolvedTheme.style?.token ?? {}),
|
|
512
|
+
...(fonts.body ? { fontFamily: fonts.body } : {}),
|
|
513
|
+
...(fonts.mono ? { fontFamilyCode: fonts.mono } : {}),
|
|
514
|
+
});
|
|
515
|
+
}
|
|
487
516
|
function readEffectiveTokenNumber(token, key, fallback) {
|
|
488
517
|
const value = token[key];
|
|
489
518
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
@@ -808,18 +837,23 @@ function subscribePhiBrandPreviewMode(listener) {
|
|
|
808
837
|
phiBrandPreviewModeListeners.delete(listener);
|
|
809
838
|
};
|
|
810
839
|
}
|
|
811
|
-
function usePhiBrandPreviewMode(initialMode) {
|
|
840
|
+
function usePhiBrandPreviewMode(initialMode, signalRoutes) {
|
|
812
841
|
const heard = useSyncExternalStore(subscribePhiBrandPreviewMode, () => phiBrandPreviewModeHeard, () => null);
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
842
|
+
/* Through the routes the panel's tree wrote for `previewThemeMode`, as every Widget input arrives. */
|
|
843
|
+
usePhiControlSignalController({
|
|
844
|
+
key: "brandPreviewThemeMode",
|
|
845
|
+
valueType: "boolean",
|
|
846
|
+
sender: usePhiSignalIdentity().receiver ?? null,
|
|
847
|
+
signalRoutes,
|
|
848
|
+
onReceiveCapability: (capabilityId, signal) => {
|
|
849
|
+
if (capabilityId !== "previewThemeMode" || signal.valueType !== "boolean") {
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
819
852
|
phiBrandPreviewModeHeard = signal.value === true ? "dark" : "light";
|
|
820
853
|
for (const listener of phiBrandPreviewModeListeners)
|
|
821
854
|
listener();
|
|
822
|
-
|
|
855
|
+
return true;
|
|
856
|
+
},
|
|
823
857
|
});
|
|
824
858
|
return heard ?? initialMode;
|
|
825
859
|
}
|
|
@@ -986,7 +1020,7 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
|
|
|
986
1020
|
const colorControlWidth = clientToken.controlHeight * 5.5;
|
|
987
1021
|
const themeKey = resolveThemeKey(config);
|
|
988
1022
|
const { state, draftRef, publishDraft, pickerTransaction } = usePhiBrandThemeDraft(runtime, themeKey);
|
|
989
|
-
const previewMode = usePhiBrandPreviewMode(resolveThemePayloadMode(state.draft));
|
|
1023
|
+
const previewMode = usePhiBrandPreviewMode(resolveThemePayloadMode(state.draft), config?.signalRoutes);
|
|
990
1024
|
const loading = false;
|
|
991
1025
|
const saving = false;
|
|
992
1026
|
const [activeColorSection, changeActiveColorSection] = usePhiBrandAccordionSection(BRAND_THEME_COLOR_COLLAPSE_STORAGE_KEY, BRAND_THEME_COLOR_SECTION_KEYS);
|
|
@@ -1374,11 +1408,19 @@ const PHI_THEME_WORDMARK_WEIGHT_OPTIONS = [
|
|
|
1374
1408
|
* from, which is a different job from authoring them.
|
|
1375
1409
|
*/
|
|
1376
1410
|
export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }) {
|
|
1377
|
-
const { token: clientToken } = usePhiConfig();
|
|
1411
|
+
const { presets: themePresets, token: clientToken } = usePhiConfig();
|
|
1378
1412
|
const themeBlocks = usePhiThemeBlockCatalog();
|
|
1379
1413
|
const themeKey = resolveThemeKey(config);
|
|
1380
1414
|
const { state, publishDraft } = usePhiBrandThemeDraft(runtime, themeKey);
|
|
1381
|
-
const mode = usePhiBrandPreviewMode(resolveThemePayloadMode(state.draft));
|
|
1415
|
+
const mode = usePhiBrandPreviewMode(resolveThemePayloadMode(state.draft), config?.signalRoutes);
|
|
1416
|
+
/*
|
|
1417
|
+
* The ground the Logo of the mode being authored stands on: the draft's own container colour in that
|
|
1418
|
+
* mode, not a fixed black or white -- a Theme whose dark ground is navy shows its dark Logo on navy.
|
|
1419
|
+
*/
|
|
1420
|
+
const logoGroundToken = useMemo(() => {
|
|
1421
|
+
const resolvedDraft = resolvePhiThemeRuntimePayload(state.draft, themeBlocks).theme;
|
|
1422
|
+
return resolveBrandDraftAliasTokens(resolvedDraft, resolveThemePayloadPreset(resolvedDraft, themePresets), mode);
|
|
1423
|
+
}, [mode, state.draft, themeBlocks, themePresets]);
|
|
1382
1424
|
const [activeIdentitySection, changeActiveIdentitySection] = usePhiBrandAccordionSection(BRAND_THEME_IDENTITY_COLLAPSE_STORAGE_KEY, BRAND_THEME_IDENTITY_SECTION_KEYS);
|
|
1383
1425
|
const brand = state.draft.brand ?? {};
|
|
1384
1426
|
/*
|
|
@@ -1433,13 +1475,11 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1433
1475
|
*/
|
|
1434
1476
|
const fallbackWordmark = runtime.site.name ?? runtime.site.key;
|
|
1435
1477
|
/*
|
|
1436
|
-
* The Pages of the public Area, from the
|
|
1437
|
-
*
|
|
1438
|
-
*
|
|
1478
|
+
* The Pages of the public Area as references, from the list every link picker outside the Builder's
|
|
1479
|
+
* own catalog reads (`/api/site/page-references`). The Brand leads into the public Area wherever it
|
|
1480
|
+
* is drawn, so that is the Area written into the target.
|
|
1439
1481
|
*/
|
|
1440
|
-
const { options:
|
|
1441
|
-
optionsProvider: { providerKey: PHI_AUTHORING_OPTION_PROVIDER_KEYS.pages },
|
|
1442
|
-
});
|
|
1482
|
+
const { options: homePageOptions, failed: homePagesFailed } = usePhiPageReferenceOptions("public", "phi-theme-brand");
|
|
1443
1483
|
function updateWordmarkPart(index, patch) {
|
|
1444
1484
|
publishDraft(mergeThemeWordmarkParts(state.draft, editableWordmarkParts.map((part, at) => (at === index ? { ...part, ...patch } : part))));
|
|
1445
1485
|
}
|
|
@@ -1453,8 +1493,8 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1453
1493
|
height: 48,
|
|
1454
1494
|
paddingInline: clientToken.paddingSM,
|
|
1455
1495
|
borderRadius: clientToken.borderRadius,
|
|
1456
|
-
border: `1px solid ${
|
|
1457
|
-
background:
|
|
1496
|
+
border: `1px solid ${readAliasTokenString(logoGroundToken, "colorBorderSecondary")}`,
|
|
1497
|
+
background: readAliasTokenString(logoGroundToken, "colorBgContainer"),
|
|
1458
1498
|
}, children: logoPreviewUrl ? (_jsx("span", { style: {
|
|
1459
1499
|
display: "block",
|
|
1460
1500
|
width: "100%",
|
|
@@ -1463,7 +1503,7 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1463
1503
|
backgroundSize: "contain",
|
|
1464
1504
|
backgroundRepeat: "no-repeat",
|
|
1465
1505
|
backgroundPosition: "left center",
|
|
1466
|
-
} })) : (_jsx(PhiTypographyControl, { type: "secondary", style: { color:
|
|
1506
|
+
} })) : (_jsx(PhiTypographyControl, { type: "secondary", style: { color: readAliasTokenString(logoGroundToken, "colorTextTertiary") }, children: "No Logo" })) }), _jsxs(PhiFlexControl, { vertical: true, align: "stretch", gap: clientToken.paddingXXS, style: { flexShrink: 0 }, children: [_jsx(PhiBrandBlockResetButton, { disabled: brand.logo?.[mode] == null, blockTitle: markSet.title, onReset: () => publishDraft(mergeThemeBrandLogo(state.draft, mode, undefined)) }), _jsx(PhiBrandCopyModeButton, { mode: mode, disabled: JSON.stringify(logo) === JSON.stringify(logos[otherMode] ?? null), onCopy: () => publishDraft(mergeThemeBrandLogo(state.draft, otherMode, logo ?? { sourceKind: "none" })) })] })] }), _jsx(PhiMediaPickerBinding, { config: {
|
|
1467
1507
|
mediaType: PhiMediaKind.Image,
|
|
1468
1508
|
pageSize: 12,
|
|
1469
1509
|
showPagination: true,
|
|
@@ -1487,8 +1527,15 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1487
1527
|
})) }) }), _jsx(PhiLabeledControl, { label: "Offset", fill: true, children: _jsx(PhiNumberControl, { prefix: "px", style: { width: "100%" }, value: brand.logoYOffset ?? 0, step: 1, min: -16, max: 16, onChange: (next) => publishDraft(mergeThemeBrand(state.draft, {
|
|
1488
1528
|
// No offset is no key, the way `Forward` spells its default away below.
|
|
1489
1529
|
logoYOffset: next ? next : null,
|
|
1490
|
-
})) }) }), _jsx(PhiLabeledControl, { label: "Forward", fill: true, children: _jsx(
|
|
1491
|
-
|
|
1530
|
+
})) }) }), _jsx(PhiLabeledControl, { label: "Forward", fill: true, children: _jsx(PhiLinkTargetControl, { value: brand.homeLinkTarget, options: homePageOptions, area: "public", labels: {
|
|
1531
|
+
none: "Site root",
|
|
1532
|
+
page: "Page",
|
|
1533
|
+
external: "Address",
|
|
1534
|
+
pagePlaceholder: homePagesFailed ? "The Pages could not be loaded." : "Select a Page",
|
|
1535
|
+
externalPlaceholder: "https://example.com",
|
|
1536
|
+
newTab: "Open in a new tab",
|
|
1537
|
+
}, onChange: (next) => publishDraft(mergeThemeBrand(state.draft, {
|
|
1538
|
+
homeLinkTarget: next ?? null,
|
|
1492
1539
|
})) }) })] })] })),
|
|
1493
1540
|
},
|
|
1494
1541
|
{
|
|
@@ -1545,7 +1592,7 @@ export function PhiBuilderBrandBackgroundControlsWidgetClient({ runtime, config,
|
|
|
1545
1592
|
const themeBlocks = usePhiThemeBlockCatalog();
|
|
1546
1593
|
const themeKey = resolveThemeKey(config);
|
|
1547
1594
|
const { state, publishDraft, editTransaction } = usePhiBrandThemeDraft(runtime, themeKey);
|
|
1548
|
-
const mode = usePhiBrandPreviewMode(resolveThemePayloadMode(state.draft));
|
|
1595
|
+
const mode = usePhiBrandPreviewMode(resolveThemePayloadMode(state.draft), config?.signalRoutes);
|
|
1549
1596
|
const composition = resolvePhiThemeComposition(state.draft, themeBlocks);
|
|
1550
1597
|
const [activeBackgroundSection, changeActiveBackgroundSection] = usePhiBrandAccordionSection(BRAND_THEME_BACKGROUND_COLLAPSE_STORAGE_KEY, BRAND_THEME_BACKGROUND_SECTION_KEYS);
|
|
1551
1598
|
const modeLabel = mode === "dark" ? "Dark mode" : "Light mode";
|
|
@@ -1568,12 +1615,12 @@ export function PhiBuilderBrandBackgroundControlsWidgetClient({ runtime, config,
|
|
|
1568
1615
|
{
|
|
1569
1616
|
key: "root",
|
|
1570
1617
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Root Background" }),
|
|
1571
|
-
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". One layer behind the whole Site, fixed to the viewport."] }), _jsxs(PhiFlexControl, { align: "
|
|
1618
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". One layer behind the whole Site, fixed to the viewport."] }), _jsxs(PhiFlexControl, { vertical: true, align: "stretch", gap: clientToken.paddingXXS, style: { flexShrink: 0 }, children: [_jsx(PhiBrandBlockResetButton, { disabled: state.draft.root?.background?.[mode] == null, blockTitle: composition.ground.title, onReset: () => publishDraft(clearThemeRootSurface(state.draft, "background", mode)) }), _jsx(PhiBrandCopyModeButton, { mode: mode, disabled: isSamePhiBackgroundConfig(rootBackground, otherRootBackground), onCopy: () => publishDraft(mergeThemeRootSurface(state.draft, "background", otherMode, rootBackground)) })] })] }), _jsx(PhiBackgroundControl, { value: rootBackground, motionModes: PHI_ROOT_BACKGROUND_MOTION_MODES, filters: PHI_ROOT_BACKGROUND_FILTERS, baseKinds: PHI_ROOT_BACKGROUND_BASE_KINDS, imageSourceKinds: PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, renderMediaPicker: renderPhiThemeRootBackgroundMediaPicker, editTransaction: editTransaction, onChange: (value) => publishDraft(mergeThemeRootSurface(state.draft, "background", mode, value)) }, mode)] })),
|
|
1572
1619
|
},
|
|
1573
1620
|
{
|
|
1574
1621
|
key: "chrome",
|
|
1575
1622
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Chrome Overlay" }),
|
|
1576
|
-
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". Shared by the Header, Sider and Footer Regions. Content and Hero never take it, and a Region that authors its own Background or Effect paints over it."] }), _jsxs(PhiFlexControl, { align: "
|
|
1623
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". Shared by the Header, Sider and Footer Regions. Content and Hero never take it, and a Region that authors its own Background or Effect paints over it."] }), _jsxs(PhiFlexControl, { vertical: true, align: "stretch", gap: clientToken.paddingXXS, style: { flexShrink: 0 }, children: [_jsx(PhiBrandBlockResetButton, { disabled: state.draft.root?.chrome?.[mode] == null, blockTitle: composition.ground.title, onReset: () => publishDraft(clearThemeRootSurface(state.draft, "chrome", mode)) }), _jsx(PhiBrandCopyModeButton, { mode: mode, disabled: isSamePhiBackgroundConfig(chromeOverlay, otherChromeOverlay), onCopy: () => publishDraft(mergeThemeRootSurface(state.draft, "chrome", otherMode, chromeOverlay)) })] })] }), _jsx(PhiBackgroundControl, { value: chromeOverlay, motionModes: PHI_SHELL_CHROME_OVERLAY_MOTION_MODES, filters: PHI_SHELL_CHROME_OVERLAY_FILTERS, baseKinds: PHI_SHELL_CHROME_OVERLAY_BASE_KINDS, imageSourceKinds: PHI_SHELL_CHROME_OVERLAY_IMAGE_SOURCE_KINDS, renderMediaPicker: renderPhiThemeRootBackgroundMediaPicker, editTransaction: editTransaction, onChange: (value) => publishDraft(mergeThemeRootSurface(state.draft, "chrome", mode, value)) }, `chrome-${mode}`)] })),
|
|
1577
1624
|
},
|
|
1578
1625
|
{
|
|
1579
1626
|
key: "shadow",
|
|
@@ -1642,7 +1689,7 @@ function PhiBrandChromePreviewShell({ overlayStyle, paneShadows, rootBackgroundS
|
|
|
1642
1689
|
overflow: "hidden",
|
|
1643
1690
|
}, children: brand }), _jsxs("div", { "aria-hidden": true, style: { position: "absolute", inset: 0, fontSize: 11, color: labelColor, pointerEvents: "none" }, children: [_jsx("span", { style: { position: "absolute", left: 8, top: header + 8 }, children: "Sider" }), _jsx("span", { style: { position: "absolute", left: sider + 8, bottom: (footer - 14) / 2 }, children: "Footer" })] }), _jsx("div", { style: { display: "flex", flexDirection: "column", gap: padding, padding, minWidth: 0 }, children: children })] }));
|
|
1644
1691
|
}
|
|
1645
|
-
export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
1692
|
+
export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, config, }) {
|
|
1646
1693
|
// The sample field is typed into like a real one, so what the Theme does to a filled field shows too.
|
|
1647
1694
|
const [previewInput, setPreviewInput] = useState("");
|
|
1648
1695
|
const { presets: themePresets, token: clientToken } = usePhiConfig();
|
|
@@ -1669,7 +1716,7 @@ export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
|
1669
1716
|
emitThemeHydrateRequest(dispatchSignal, selfAddress);
|
|
1670
1717
|
}
|
|
1671
1718
|
}, [dispatchSignal, selfAddress]);
|
|
1672
|
-
const mode = usePhiBrandPreviewMode(resolveThemePayloadMode(fallbackTheme));
|
|
1719
|
+
const mode = usePhiBrandPreviewMode(resolveThemePayloadMode(fallbackTheme), config?.signalRoutes);
|
|
1673
1720
|
const previewPreset = resolveThemePayloadPreset(previewThemeResolved, themePresets);
|
|
1674
1721
|
const previewFontStacks = usePhiThemeFontStacks(previewThemeResolved.fonts);
|
|
1675
1722
|
const previewHeadingFontFamily = resolvePhiThemeHeadingFontFamily(previewThemeResolved.typography, {
|
|
@@ -1684,14 +1731,8 @@ export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
|
1684
1731
|
*/
|
|
1685
1732
|
const previewBodyFontStack = previewFontStacks.body.stack;
|
|
1686
1733
|
const previewMonoFontStack = previewFontStacks.mono.stack;
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
...resolvePhiThemeColorTokens(previewPreset, previewThemeResolved.palette, mode),
|
|
1690
|
-
...(previewThemeResolved.style?.token ?? {}),
|
|
1691
|
-
// The draft's lettering, applied as the root theme applies the Site's: body text and code.
|
|
1692
|
-
...(previewBodyFontStack ? { fontFamily: previewBodyFontStack } : {}),
|
|
1693
|
-
...(previewMonoFontStack ? { fontFamilyCode: previewMonoFontStack } : {}),
|
|
1694
|
-
}), [mode, previewBodyFontStack, previewMonoFontStack, previewPreset, previewThemeResolved]);
|
|
1734
|
+
// The draft's lettering, applied as the root theme applies the Site's: body text and code.
|
|
1735
|
+
const previewEffectiveToken = useMemo(() => resolveBrandDraftAliasTokens(previewThemeResolved, previewPreset, mode, { body: previewBodyFontStack, mono: previewMonoFontStack }), [mode, previewBodyFontStack, previewMonoFontStack, previewPreset, previewThemeResolved]);
|
|
1695
1736
|
const columns = [
|
|
1696
1737
|
{ title: "Name", key: "name", fieldPath: "name", sizing: { mode: "fill" } },
|
|
1697
1738
|
{ title: "Status", key: "status", fieldPath: "status", sizing: { mode: "content" }, render: (value) => _jsx(PhiTagControl, { color: "processing", children: String(value) }) },
|
|
@@ -1727,8 +1768,8 @@ export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
|
1727
1768
|
previewShapedComponents: applyPhiSurfaceShapeComponentTokens(applyPhiControlShapeComponentTokens({ ...(applyPhiButtonShadowComponentTokens(previewThemeResolved.components, previewThemeResolved.buttons, mode) ?? {}) }, previewControlShape, previewEffectiveToken), previewControlShape, previewEffectiveToken),
|
|
1728
1769
|
};
|
|
1729
1770
|
}, [mode, previewEffectiveToken, previewThemeResolved]);
|
|
1730
|
-
const previewCardBackground =
|
|
1731
|
-
const previewSurfaceBackground =
|
|
1771
|
+
const previewCardBackground = readAliasTokenString(previewEffectiveToken, "colorBgContainer");
|
|
1772
|
+
const previewSurfaceBackground = readAliasTokenString(previewEffectiveToken, "colorBgLayout");
|
|
1732
1773
|
/*
|
|
1733
1774
|
* The Theme Root Background, on the surface the preview treats as the page ground -- the same layer
|
|
1734
1775
|
* the Site paints behind everything, in the mode the preview switch is showing. A mode with no
|
|
@@ -1741,38 +1782,36 @@ export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
|
1741
1782
|
* only one the preview draws.
|
|
1742
1783
|
*/
|
|
1743
1784
|
const previewPaneShadows = resolvePhiShellChromePaneShadows(previewThemeResolved.root);
|
|
1744
|
-
const previewTextColor =
|
|
1745
|
-
const previewTextSecondaryColor =
|
|
1746
|
-
const previewTextTertiaryColor =
|
|
1747
|
-
const previewLinkColor =
|
|
1785
|
+
const previewTextColor = readAliasTokenString(previewEffectiveToken, "colorText");
|
|
1786
|
+
const previewTextSecondaryColor = readAliasTokenString(previewEffectiveToken, "colorTextSecondary");
|
|
1787
|
+
const previewTextTertiaryColor = readAliasTokenString(previewEffectiveToken, "colorTextTertiary");
|
|
1788
|
+
const previewLinkColor = readAliasTokenString(previewEffectiveToken, "colorLink");
|
|
1748
1789
|
/*
|
|
1749
1790
|
* What the sample swatch shows: the brand colour, so the hex beside it moves the moment the seed does.
|
|
1750
1791
|
*/
|
|
1751
|
-
const previewSwatchColor =
|
|
1752
|
-
const previewLinkHoverColor =
|
|
1753
|
-
const previewLinkActiveColor =
|
|
1792
|
+
const previewSwatchColor = readAliasTokenString(previewEffectiveToken, "colorPrimary");
|
|
1793
|
+
const previewLinkHoverColor = readAliasTokenString(previewEffectiveToken, "colorLinkHover");
|
|
1794
|
+
const previewLinkActiveColor = readAliasTokenString(previewEffectiveToken, "colorLinkActive");
|
|
1754
1795
|
/*
|
|
1755
1796
|
* Four status colours, one shape: text, ground and border, each with its hover. Info's border falls
|
|
1756
1797
|
* back to the link colour where the others fall back to their own base, which is how it always was.
|
|
1757
1798
|
*/
|
|
1758
1799
|
const statusPreviewItems = [
|
|
1759
|
-
{ key: "info", label: "Info", prefix: "colorInfo"
|
|
1760
|
-
{ key: "success", label: "Success", prefix: "colorSuccess"
|
|
1761
|
-
{ key: "warning", label: "Warning", prefix: "colorWarning"
|
|
1762
|
-
{ key: "error", label: "Error", prefix: "colorError"
|
|
1763
|
-
].map(({ key, label, prefix
|
|
1764
|
-
const read = (suffix
|
|
1765
|
-
const baseColor = read("", base);
|
|
1766
|
-
const hoverColor = read("Hover", hover);
|
|
1800
|
+
{ key: "info", label: "Info", prefix: "colorInfo" },
|
|
1801
|
+
{ key: "success", label: "Success", prefix: "colorSuccess" },
|
|
1802
|
+
{ key: "warning", label: "Warning", prefix: "colorWarning" },
|
|
1803
|
+
{ key: "error", label: "Error", prefix: "colorError" },
|
|
1804
|
+
].map(({ key, label, prefix }) => {
|
|
1805
|
+
const read = (suffix) => readAliasTokenString(previewEffectiveToken, `${prefix}${suffix}`);
|
|
1767
1806
|
return {
|
|
1768
1807
|
key,
|
|
1769
1808
|
label,
|
|
1770
|
-
color: read("Text"
|
|
1771
|
-
background: read("Bg"
|
|
1772
|
-
border: read("Border"
|
|
1773
|
-
hoverColor: read("TextHover"
|
|
1774
|
-
hoverBackground: read("BgHover"
|
|
1775
|
-
hoverBorder: read("BorderHover"
|
|
1809
|
+
color: read("Text"),
|
|
1810
|
+
background: read("Bg"),
|
|
1811
|
+
border: read("Border"),
|
|
1812
|
+
hoverColor: read("TextHover"),
|
|
1813
|
+
hoverBackground: read("BgHover"),
|
|
1814
|
+
hoverBorder: read("BorderHover"),
|
|
1776
1815
|
};
|
|
1777
1816
|
});
|
|
1778
1817
|
const fontPreviewItems = [
|
|
@@ -1816,34 +1855,34 @@ export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
|
1816
1855
|
{
|
|
1817
1856
|
key: "sm",
|
|
1818
1857
|
label: "Small",
|
|
1819
|
-
value:
|
|
1858
|
+
value: readAliasTokenNumber(previewEffectiveToken, "borderRadiusSM"),
|
|
1820
1859
|
},
|
|
1821
1860
|
{
|
|
1822
1861
|
key: "base",
|
|
1823
1862
|
label: "Base",
|
|
1824
|
-
value:
|
|
1863
|
+
value: readAliasTokenNumber(previewEffectiveToken, "borderRadius"),
|
|
1825
1864
|
},
|
|
1826
1865
|
{
|
|
1827
1866
|
key: "lg",
|
|
1828
1867
|
label: "Large",
|
|
1829
|
-
value:
|
|
1868
|
+
value: readAliasTokenNumber(previewEffectiveToken, "borderRadiusLG"),
|
|
1830
1869
|
},
|
|
1831
1870
|
];
|
|
1832
1871
|
const controlHeightPreviewItems = [
|
|
1833
1872
|
{
|
|
1834
1873
|
key: "sm",
|
|
1835
1874
|
label: "Small",
|
|
1836
|
-
value:
|
|
1875
|
+
value: readAliasTokenNumber(previewEffectiveToken, "controlHeightSM"),
|
|
1837
1876
|
},
|
|
1838
1877
|
{
|
|
1839
1878
|
key: "base",
|
|
1840
1879
|
label: "Base",
|
|
1841
|
-
value:
|
|
1880
|
+
value: readAliasTokenNumber(previewEffectiveToken, "controlHeight"),
|
|
1842
1881
|
},
|
|
1843
1882
|
{
|
|
1844
1883
|
key: "lg",
|
|
1845
1884
|
label: "Large",
|
|
1846
|
-
value:
|
|
1885
|
+
value: readAliasTokenNumber(previewEffectiveToken, "controlHeightLG"),
|
|
1847
1886
|
},
|
|
1848
1887
|
];
|
|
1849
1888
|
const wireframeEnabled = readEffectiveTokenBoolean(previewEffectiveToken, "wireframe", true);
|
|
@@ -1856,7 +1895,7 @@ export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
|
1856
1895
|
* variable is inherited, and the Builder's own Root carries the published Theme's.
|
|
1857
1896
|
*/
|
|
1858
1897
|
...{
|
|
1859
|
-
[PHI_THEME_HEADING_FONT_VARIABLE]: previewHeadingFontFamily ??
|
|
1898
|
+
[PHI_THEME_HEADING_FONT_VARIABLE]: previewHeadingFontFamily ?? readAliasTokenString(previewEffectiveToken, "fontFamily"),
|
|
1860
1899
|
},
|
|
1861
1900
|
/*
|
|
1862
1901
|
* Small and large Control radii are inherited custom properties, so the preview declares its
|
|
@@ -1888,15 +1927,15 @@ export function PhiBuilderBrandThemePreviewWidgetClient({ runtime, }) {
|
|
|
1888
1927
|
minWidth: 0,
|
|
1889
1928
|
}, children: fontPreviewItems.map((item) => (_jsxs("div", { style: {
|
|
1890
1929
|
minWidth: 0,
|
|
1891
|
-
border: `1px solid ${
|
|
1892
|
-
borderRadius: `${
|
|
1930
|
+
border: `1px solid ${readAliasTokenString(previewEffectiveToken, "colorBorderSecondary")}`,
|
|
1931
|
+
borderRadius: `${readAliasTokenNumber(previewEffectiveToken, "borderRadius")}px`,
|
|
1893
1932
|
background: previewCardBackground,
|
|
1894
1933
|
padding: clientToken.paddingXS,
|
|
1895
1934
|
}, children: [_jsx(PhiTypographyControl, { type: "secondary", style: { display: "block" }, children: item.label }), _jsx(PhiTypographyControl, { style: { display: "block", color: previewTextColor, fontFamily: item.family }, children: item.sample }), item.value ? (_jsx(PhiTypographyControl, { type: "secondary", style: { display: "block", fontFamily: item.family }, children: item.value })) : null] }, item.key))) })] }), _jsx(PhiFlexControl, { gap: clientToken.padding, wrap: "wrap", children: _jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingSM, style: { flex: "1 1 260px", minWidth: 0 }, children: [_jsx(PhiTypographyControl, { presentation: "title", level: 5, style: { margin: 0, color: previewTextColor }, children: "Border Radius" }), _jsx(PhiFlexControl, { gap: clientToken.paddingXS, wrap: "wrap", children: radiusPreviewItems.map((item) => (_jsxs("div", { style: {
|
|
1896
1935
|
// The tokens are numbers; `calc(40 * 2)` is no length, and the sample lost its size.
|
|
1897
1936
|
width: clientToken.controlHeightLG * 2,
|
|
1898
1937
|
minHeight: clientToken.controlHeight * 1.25,
|
|
1899
|
-
border: `1px solid ${
|
|
1938
|
+
border: `1px solid ${readAliasTokenString(previewEffectiveToken, "colorBorder")}`,
|
|
1900
1939
|
borderRadius: item.value,
|
|
1901
1940
|
background: previewCardBackground,
|
|
1902
1941
|
padding: clientToken.paddingXS,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PhiCmsWidgetPlugin } from "../../../../../types";
|
|
2
2
|
import { type PhiCmsAreaKey } from "../../../../../constants/cms-areas";
|
|
3
|
-
|
|
3
|
+
import { type PhiControlSignalConfig } from "../../../../../components/widgets/config/control-signal-config";
|
|
4
|
+
export type PhiBuilderBrandWidgetConfig = Pick<PhiControlSignalConfig, "key" | "signalRoutes"> & {
|
|
4
5
|
themeKey?: string;
|
|
5
6
|
reviewArea?: PhiCmsAreaKey;
|
|
6
7
|
};
|