@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, lazy, useContext, useMemo, } from "react";
|
|
3
|
+
import { createContext, lazy, useCallback, useContext, useMemo, } from "react";
|
|
4
4
|
const PhiRuntimeModuleAuthoringContext = createContext(new Map());
|
|
5
5
|
function createPhiLazyAuthoringLayout(load) {
|
|
6
6
|
return lazy(async () => {
|
|
@@ -54,8 +54,7 @@ export function usePhiRuntimeModuleAuthoringRegistration(moduleId) {
|
|
|
54
54
|
const modules = useContext(PhiRuntimeModuleAuthoringContext);
|
|
55
55
|
return moduleId ? modules.get(moduleId) ?? null : null;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
const modules = useContext(PhiRuntimeModuleAuthoringContext);
|
|
57
|
+
function findPhiAuthoringLayoutDefinition(modules, type) {
|
|
59
58
|
for (const registration of modules.values()) {
|
|
60
59
|
const definition = registration.layoutsByType.get(type);
|
|
61
60
|
if (definition) {
|
|
@@ -64,3 +63,14 @@ export function usePhiAuthoringLayoutDefinition(type) {
|
|
|
64
63
|
}
|
|
65
64
|
return null;
|
|
66
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* The authoring Layout definitions, as a lookup by type rather than one type's answer.
|
|
68
|
+
*
|
|
69
|
+
* A Layout names its nested Layouts only while it renders its children, and a parent Layout sizes each
|
|
70
|
+
* slot by the props of the element standing in it, before that element renders: a nested Layout's
|
|
71
|
+
* element has to carry its policy already, and a hook inside it would be too late.
|
|
72
|
+
*/
|
|
73
|
+
export function usePhiAuthoringLayoutDefinitionResolver() {
|
|
74
|
+
const modules = useContext(PhiRuntimeModuleAuthoringContext);
|
|
75
|
+
return useCallback((type) => findPhiAuthoringLayoutDefinition(modules, type), [modules]);
|
|
76
|
+
}
|
|
@@ -11,7 +11,7 @@ import { PHI_ASSET_RUNTIME_MODULE_ID } from "../asset/ids";
|
|
|
11
11
|
import { PHI_MEDIA_LIBRARY_ITEM_RENDERER_KEY } from "../../../constants/media-library-provider-keys";
|
|
12
12
|
import { PHI_DASHBOARD_CARD_ITEM_RENDERER_KEY } from "../../../constants/dashboard-card-provider-keys";
|
|
13
13
|
import { createPhiRuntimeModuleCalendarAdapterClientManifest } from "../../../components/runtime/runtime-module-calendar-adapter-client-manifest";
|
|
14
|
-
import { PHI_CORE_CALENDAR_ADAPTER_CLIENT_DEFINITIONS } from "../client-calendar-adapters
|
|
14
|
+
import { PHI_CORE_CALENDAR_ADAPTER_CLIENT_DEFINITIONS } from "../core/client-calendar-adapters";
|
|
15
15
|
import { PhiLazyAssetRuntimeControllerClient } from "../asset/client";
|
|
16
16
|
import { createPhiRuntimeModuleUiProviderClientManifest, } from "../../../components/runtime/runtime-module-ui-provider-client-manifest";
|
|
17
17
|
import { PHI_AUTH_RUNTIME_MODULE_ID } from "../auth/ids";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "
|
|
2
|
-
import { PHI_CORE_RUNTIME_MODULE_ID } from "./
|
|
1
|
+
import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "../../../types/calendar-keys";
|
|
2
|
+
import { PHI_CORE_RUNTIME_MODULE_ID } from "./ids";
|
|
3
3
|
export const PHI_CORE_CALENDAR_ADAPTER_DESCRIPTORS = [{
|
|
4
4
|
key: PHI_GREGORY_CALENDAR_ADAPTER_KEY,
|
|
5
5
|
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "../../../types/calendar-keys";
|
|
3
|
-
import { PHI_CORE_RUNTIME_MODULE_ID } from "
|
|
3
|
+
import { PHI_CORE_RUNTIME_MODULE_ID } from "./ids";
|
|
4
4
|
export const PHI_CORE_CALENDAR_ADAPTER_CLIENT_DEFINITIONS = [{
|
|
5
5
|
key: PHI_GREGORY_CALENDAR_ADAPTER_KEY,
|
|
6
6
|
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
@@ -53,7 +53,7 @@ async function loadEntries(kind, { query, signal }) {
|
|
|
53
53
|
}));
|
|
54
54
|
return {
|
|
55
55
|
rows,
|
|
56
|
-
total: readNumber(result?.total)
|
|
56
|
+
total: readNumber(result?.total),
|
|
57
57
|
page: readNumber(result?.page) ?? 1,
|
|
58
58
|
pageSize: readNumber(result?.pageSize) ?? (rows.length || 25),
|
|
59
59
|
/*
|
|
@@ -56,6 +56,7 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
56
56
|
search: false;
|
|
57
57
|
sorting: "none";
|
|
58
58
|
pagination: "offset";
|
|
59
|
+
total: true;
|
|
59
60
|
filterFields: string[];
|
|
60
61
|
};
|
|
61
62
|
actions: ({
|
|
@@ -115,6 +116,7 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
115
116
|
search: true;
|
|
116
117
|
sorting: "multiple";
|
|
117
118
|
pagination: "offset";
|
|
119
|
+
total: true;
|
|
118
120
|
};
|
|
119
121
|
}[];
|
|
120
122
|
settingsFields?: undefined;
|
|
@@ -205,6 +207,7 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
205
207
|
filterFields: string[];
|
|
206
208
|
sorting: "none";
|
|
207
209
|
pagination: "offset";
|
|
210
|
+
total: true;
|
|
208
211
|
facets: string[];
|
|
209
212
|
};
|
|
210
213
|
recordRead: true;
|
|
@@ -35,7 +35,7 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
35
35
|
description: "Neutral package-owned baseline for a provider-bound table.",
|
|
36
36
|
rowIdentityPath: "id",
|
|
37
37
|
fields: [{ key: "id", title: "ID", type: "string", required: true }],
|
|
38
|
-
query: { search: true, sorting: "multiple", pagination: "offset" },
|
|
38
|
+
query: { search: true, sorting: "multiple", pagination: "offset", total: true },
|
|
39
39
|
}],
|
|
40
40
|
},
|
|
41
41
|
...PHI_CORE_MESSAGING_DATA_PROVIDER_DESCRIPTORS,
|
|
@@ -121,6 +121,7 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
121
121
|
filterFields: ["status"],
|
|
122
122
|
sorting: "none",
|
|
123
123
|
pagination: "offset",
|
|
124
|
+
total: true,
|
|
124
125
|
facets: ["tags"],
|
|
125
126
|
},
|
|
126
127
|
recordRead: true,
|
|
@@ -67,6 +67,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
67
67
|
search: false;
|
|
68
68
|
sorting: "none";
|
|
69
69
|
pagination: "offset";
|
|
70
|
+
total: true;
|
|
70
71
|
filterFields: string[];
|
|
71
72
|
};
|
|
72
73
|
actions: ({
|
|
@@ -126,6 +127,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
126
127
|
search: true;
|
|
127
128
|
sorting: "multiple";
|
|
128
129
|
pagination: "offset";
|
|
130
|
+
total: true;
|
|
129
131
|
};
|
|
130
132
|
}[];
|
|
131
133
|
settingsFields?: undefined;
|
|
@@ -216,6 +218,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
216
218
|
filterFields: string[];
|
|
217
219
|
sorting: "none";
|
|
218
220
|
pagination: "offset";
|
|
221
|
+
total: true;
|
|
219
222
|
facets: string[];
|
|
220
223
|
};
|
|
221
224
|
recordRead: true;
|
|
@@ -6,7 +6,7 @@ import { PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "./data-providers";
|
|
|
6
6
|
import { PHI_CMS_AREA_KEYS } from "../../../constants/cms-areas";
|
|
7
7
|
import { PHI_CORE_FORM_PROVIDER_DESCRIPTORS } from "./form-providers";
|
|
8
8
|
import { PHI_CORE_SERVER_BINDING } from "../../../types/server-capabilities";
|
|
9
|
-
import { PHI_CORE_CALENDAR_ADAPTER_DESCRIPTORS } from "
|
|
9
|
+
import { PHI_CORE_CALENDAR_ADAPTER_DESCRIPTORS } from "./calendar-adapters";
|
|
10
10
|
export const PHI_CORE_RUNTIME_MODULE_DEFINITION = {
|
|
11
11
|
...PHI_CORE_RUNTIME_MODULE_IDENTITY,
|
|
12
12
|
kind: "platform",
|
|
@@ -61,7 +61,7 @@ async function queryThreadTable({ resourceKey, query, signal, }) {
|
|
|
61
61
|
const rows = readPhiTableRows(payload?.rows).map(readThreadRow);
|
|
62
62
|
return {
|
|
63
63
|
rows,
|
|
64
|
-
total: typeof payload?.total === "number" ? payload.total :
|
|
64
|
+
total: typeof payload?.total === "number" ? payload.total : undefined,
|
|
65
65
|
page: typeof payload?.page === "number" ? payload.page : undefined,
|
|
66
66
|
pageSize: typeof payload?.pageSize === "number" ? payload.pageSize : undefined,
|
|
67
67
|
// Unread among everything the listing matches, for a footer beside the total.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-data-provider-keys";
|
|
2
|
-
import { PHI_CORE_RUNTIME_MODULE_THEMES } from "
|
|
2
|
+
import { PHI_CORE_RUNTIME_MODULE_THEMES } from "./themes";
|
|
3
3
|
import { definePhiRuntimeModuleServerAreaContribution } from "../area-contributions";
|
|
4
4
|
import { PHI_CORE_RUNTIME_MODULE_DEFINITION } from "./definition";
|
|
5
5
|
import { PHI_RUNTIME_MODULE_LAYOUTS as PHI_CORE_LAYOUTS } from "./layouts";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const PHI_CORE_RUNTIME_MODULE_THEMES: {
|
|
2
|
+
loadPreset: () => {
|
|
3
|
+
readonly key: "phis";
|
|
4
|
+
readonly version: 1;
|
|
5
|
+
readonly title: "Phis";
|
|
6
|
+
readonly description: "Warm orange brand color with a deep blue text base.";
|
|
7
|
+
readonly palette: {
|
|
8
|
+
readonly seed: {
|
|
9
|
+
readonly colorPrimary: "#E05A2A";
|
|
10
|
+
readonly colorInfo: "#7088BA";
|
|
11
|
+
readonly colorSuccess: "#4D8F6B";
|
|
12
|
+
readonly colorWarning: "#D99A2B";
|
|
13
|
+
readonly colorError: "#C94A3A";
|
|
14
|
+
readonly colorLink: "#7088BA";
|
|
15
|
+
};
|
|
16
|
+
readonly modes: {
|
|
17
|
+
readonly light: {
|
|
18
|
+
readonly seed: {
|
|
19
|
+
readonly colorTextBase: "#223A61";
|
|
20
|
+
readonly colorBgBase: "#ffffff";
|
|
21
|
+
};
|
|
22
|
+
readonly overrides: {
|
|
23
|
+
readonly colorFillQuaternary: "rgba(34, 58, 97, 0.03)";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly dark: {
|
|
27
|
+
readonly seed: {
|
|
28
|
+
readonly colorTextBase: "#DCE7F8";
|
|
29
|
+
readonly colorBgBase: "#050914";
|
|
30
|
+
};
|
|
31
|
+
readonly overrides: {
|
|
32
|
+
readonly colorFillQuaternary: "rgba(220, 231, 248, 0.06)";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
description?: "Warm orange brand color with a deep blue text base." | undefined;
|
|
39
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
40
|
+
presetKey: string;
|
|
41
|
+
presetVersion: number;
|
|
42
|
+
themeKey: "phis";
|
|
43
|
+
title: "Phis";
|
|
44
|
+
}[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PHI_CORE_THEME_PRESET_PLUGINS } from "../../../theme/phi-theme-presets";
|
|
2
|
+
import { PHI_CORE_RUNTIME_MODULE_ID } from "./ids";
|
|
3
|
+
/* The Theme presets Core ships, one descriptor each. */
|
|
4
|
+
export const PHI_CORE_RUNTIME_MODULE_THEMES = PHI_CORE_THEME_PRESET_PLUGINS.map((preset) => ({
|
|
5
|
+
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
6
|
+
presetKey: `${preset.key}-theme-preset`,
|
|
7
|
+
presetVersion: 1,
|
|
8
|
+
themeKey: preset.key,
|
|
9
|
+
title: preset.title,
|
|
10
|
+
...(preset.description ? { description: preset.description } : {}),
|
|
11
|
+
loadPreset: () => preset,
|
|
12
|
+
}));
|
|
@@ -11,10 +11,19 @@ export type PhiBrandWidgetConfig = {
|
|
|
11
11
|
export declare const PHI_BRAND_LINE_FALLBACK_ICONS: Record<PhiBrandWidgetLineMode, string>;
|
|
12
12
|
export type PhiBrandWidgetClientProps = PhiClientBlockBaseProps<PhiNoLabels, PhiBrandWidgetConfig> & {
|
|
13
13
|
fallbackTitle?: ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Where the Brand leads, resolved on the Server: the Theme's `homeLinkTarget`, or the Site root in the
|
|
16
|
+
* language being read. A Page reference means nothing in a browser, so the address travels instead.
|
|
17
|
+
*/
|
|
18
|
+
home?: PhiBrandWidgetHome;
|
|
16
19
|
interactive?: boolean;
|
|
17
20
|
};
|
|
21
|
+
/** A ready address, and whether it leaves the Site -- the shape `resolvePhiLinkHref` answers. */
|
|
22
|
+
export type PhiBrandWidgetHome = {
|
|
23
|
+
href: string;
|
|
24
|
+
newTab: boolean;
|
|
25
|
+
external: boolean;
|
|
26
|
+
};
|
|
18
27
|
/**
|
|
19
28
|
* The Brand in the Site frame: what `PhiBrandControl` shows, and where clicking it leads.
|
|
20
29
|
*
|
|
@@ -22,4 +31,4 @@ export type PhiBrandWidgetClientProps = PhiClientBlockBaseProps<PhiNoLabels, Phi
|
|
|
22
31
|
* because the Theme workspace preview shows the same Brand without being in a frame and without
|
|
23
32
|
* leading anywhere.
|
|
24
33
|
*/
|
|
25
|
-
export declare function PhiBrandWidgetClient({ config,
|
|
34
|
+
export declare function PhiBrandWidgetClient({ config, home, fallbackTitle, interactive, }: PhiBrandWidgetClientProps): import("react").JSX.Element | null;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import Link from "next/link";
|
|
4
3
|
import { PhiBrandControl, PhiBrandLineControl, phiBrandControlIsEmpty, } from "../../../../../components/controls/phi-brand-control";
|
|
5
4
|
import { isPhiBrandWidgetLineMode, } from "./mode";
|
|
6
5
|
import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
|
|
7
6
|
import { usePhiSiteBrand } from "../../../../../components/root/phi-root-live-theme-provider";
|
|
8
7
|
import { resolvePhiWidgetFontFamily } from "../../../../../components/widgets/helpers/font-family";
|
|
9
8
|
import { resolvePhiWidgetFontSize } from "../../../../../components/widgets/helpers/font-size";
|
|
10
|
-
import {
|
|
9
|
+
import { PhiLink } from "../../../../../components/navigation/phi-link";
|
|
11
10
|
/** What a line shows in front of itself where the Brand names no icon for it. */
|
|
12
11
|
export const PHI_BRAND_LINE_FALLBACK_ICONS = {
|
|
13
12
|
slogan: "antd:star",
|
|
@@ -20,7 +19,7 @@ export const PHI_BRAND_LINE_FALLBACK_ICONS = {
|
|
|
20
19
|
* because the Theme workspace preview shows the same Brand without being in a frame and without
|
|
21
20
|
* leading anywhere.
|
|
22
21
|
*/
|
|
23
|
-
export function PhiBrandWidgetClient({ config,
|
|
22
|
+
export function PhiBrandWidgetClient({ config, home, fallbackTitle, interactive = true, }) {
|
|
24
23
|
const brand = usePhiSiteBrand();
|
|
25
24
|
// The Theme's mode, not the Widget's: one picks the Logo's picture, the other what is drawn at all.
|
|
26
25
|
const { fonts, token, mode: themeMode } = usePhiConfig();
|
|
@@ -54,13 +53,6 @@ export function PhiBrandWidgetClient({ config, locale, fallbackTitle, interactiv
|
|
|
54
53
|
if (phiBrandControlIsEmpty(presentation)) {
|
|
55
54
|
return null;
|
|
56
55
|
}
|
|
57
|
-
/*
|
|
58
|
-
* The front page in the language being read. `/` alone is answered with a redirect to the visitor's
|
|
59
|
-
* preferred language, so a reader of `/de` could be led to `/en`; and Next's prefetch of it, which loses
|
|
60
|
-
* its `_rsc` on that redirect, came back with the static tree's own address and a 404
|
|
61
|
-
* (AUDIT-2026-10-13, PM15).
|
|
62
|
-
*/
|
|
63
|
-
const homeHref = brand?.homeHref?.trim() || (locale ? localizePath(locale, "/") : "/");
|
|
64
56
|
const linkStyle = {
|
|
65
57
|
color: "inherit",
|
|
66
58
|
textDecoration: "none",
|
|
@@ -73,5 +65,5 @@ export function PhiBrandWidgetClient({ config, locale, fallbackTitle, interactiv
|
|
|
73
65
|
if (!interactive) {
|
|
74
66
|
return (_jsx("span", { "aria-disabled": "true", style: linkStyle, children: _jsx(PhiBrandControl, { ...presentation }) }));
|
|
75
67
|
}
|
|
76
|
-
return (_jsx(
|
|
68
|
+
return (_jsx(PhiLink, { href: home?.href ?? "/", external: home?.external, newTab: home?.newTab, style: linkStyle, children: _jsx(PhiBrandControl, { ...presentation }) }));
|
|
77
69
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PhiBlockRuntime } from "../../../../../types";
|
|
2
|
+
import { type PhiResolvedLinkTargets } from "../../../../../types/references";
|
|
3
|
+
import type { PhiBrandWidgetHome } from "./client";
|
|
4
|
+
/**
|
|
5
|
+
* Where the Brand leads, as an address: the Theme's target, resolved in this render's batch of link
|
|
6
|
+
* targets (`resolvePhiCmsTreeLinkTargets` collects the Brand's beside the tree's), or the Site root.
|
|
7
|
+
*
|
|
8
|
+
* The root is the root in the language being read. `/` alone is answered with a redirect to the
|
|
9
|
+
* visitor's preferred language, so a reader of `/de` could be led to `/en`; and Next's prefetch of it,
|
|
10
|
+
* which loses its `_rsc` on that redirect, came back with the static tree's own address and a 404
|
|
11
|
+
* (AUDIT-2026-10-13, PM15). A target that does not resolve -- a Page deleted, unpublished, or brought by
|
|
12
|
+
* a Module that is switched off -- leads there too: the Brand is the way home and always leads somewhere.
|
|
13
|
+
* A resolved Page path is already locale- and Area-correct (`REFERENCES.md`).
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolvePhiBrandWidgetHome(runtime: Pick<PhiBlockRuntime, "site" | "locale">, links: PhiResolvedLinkTargets | null | undefined): PhiBrandWidgetHome;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolvePhiLinkHref } from "../../../../../helpers/link-target";
|
|
2
|
+
import { localizePath } from "../../../../../helpers/locale";
|
|
3
|
+
import { readPhiLinkTarget } from "../../../../../types/references";
|
|
4
|
+
/**
|
|
5
|
+
* Where the Brand leads, as an address: the Theme's target, resolved in this render's batch of link
|
|
6
|
+
* targets (`resolvePhiCmsTreeLinkTargets` collects the Brand's beside the tree's), or the Site root.
|
|
7
|
+
*
|
|
8
|
+
* The root is the root in the language being read. `/` alone is answered with a redirect to the
|
|
9
|
+
* visitor's preferred language, so a reader of `/de` could be led to `/en`; and Next's prefetch of it,
|
|
10
|
+
* which loses its `_rsc` on that redirect, came back with the static tree's own address and a 404
|
|
11
|
+
* (AUDIT-2026-10-13, PM15). A target that does not resolve -- a Page deleted, unpublished, or brought by
|
|
12
|
+
* a Module that is switched off -- leads there too: the Brand is the way home and always leads somewhere.
|
|
13
|
+
* A resolved Page path is already locale- and Area-correct (`REFERENCES.md`).
|
|
14
|
+
*/
|
|
15
|
+
export function resolvePhiBrandWidgetHome(runtime, links) {
|
|
16
|
+
return resolvePhiLinkHref(readPhiLinkTarget(runtime.site.theme?.brand?.homeLinkTarget), links)
|
|
17
|
+
?? { href: localizePath(runtime.locale.current, "/"), newTab: false, external: false };
|
|
18
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { resolvePhiBrandWordmarkText } from "../../../../../helpers/brand-wordmark";
|
|
3
|
+
import { resolvePhiBrandWidgetHome } from "./home";
|
|
3
4
|
import { PhiBrandWidget } from "./server";
|
|
4
5
|
import { PHI_BRAND_WIDGET_DEFINITION, PHI_BRAND_WIDGET_PLUGIN_TYPE, } from "./config";
|
|
5
6
|
/*
|
|
@@ -13,7 +14,7 @@ import { PHI_BRAND_WIDGET_DEFINITION, PHI_BRAND_WIDGET_PLUGIN_TYPE, } from "./co
|
|
|
13
14
|
*/
|
|
14
15
|
export const PHI_BRAND_WIDGET_PLUGIN = {
|
|
15
16
|
...PHI_BRAND_WIDGET_DEFINITION,
|
|
16
|
-
render: ({ widget, config, runtime }) => (_jsx(PhiBrandWidget, { fallbackTitle: resolvePhiBrandWordmarkText(runtime),
|
|
17
|
-
renderPreview: ({ widget, config, runtime }) => (_jsx(PhiBrandWidget, { fallbackTitle: resolvePhiBrandWordmarkText(runtime),
|
|
17
|
+
render: ({ widget, config, runtime, links }) => (_jsx(PhiBrandWidget, { fallbackTitle: resolvePhiBrandWordmarkText(runtime), home: resolvePhiBrandWidgetHome(runtime, links), mode: config.mode, fontFamily: config.fontFamily, fontSize: config.fontSize }, `widget-${widget.id}`)),
|
|
18
|
+
renderPreview: ({ widget, config, runtime, links }) => (_jsx(PhiBrandWidget, { fallbackTitle: resolvePhiBrandWordmarkText(runtime), home: resolvePhiBrandWidgetHome(runtime, links), mode: config.mode, fontFamily: config.fontFamily, fontSize: config.fontSize, interactive: false }, `widget-${widget.id}`)),
|
|
18
19
|
};
|
|
19
20
|
export { PHI_BRAND_WIDGET_PLUGIN_TYPE };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PhiBrandWidgetClientProps, PhiBrandWidgetConfig } from "./client";
|
|
2
|
-
export type PhiBrandWidgetProps = Pick<PhiBrandWidgetClientProps, "fallbackTitle" | "interactive" | "
|
|
3
|
-
export declare function PhiBrandWidget({ fallbackTitle, interactive,
|
|
2
|
+
export type PhiBrandWidgetProps = Pick<PhiBrandWidgetClientProps, "fallbackTitle" | "interactive" | "home"> & PhiBrandWidgetConfig;
|
|
3
|
+
export declare function PhiBrandWidget({ fallbackTitle, interactive, home, mode, fontFamily, fontSize, }: PhiBrandWidgetProps): import("react").JSX.Element;
|
|
@@ -5,12 +5,12 @@ import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runt
|
|
|
5
5
|
* The Brand itself is not read here. It comes from the root on the Client (`usePhiSiteBrand`), which
|
|
6
6
|
* holds it with the Theme Set's Logo folded in and follows a live Theme draft.
|
|
7
7
|
*/
|
|
8
|
-
export function PhiBrandWidget({ fallbackTitle, interactive,
|
|
8
|
+
export function PhiBrandWidget({ fallbackTitle, interactive, home, mode, fontFamily, fontSize, }) {
|
|
9
9
|
const config = { mode, fontFamily, fontSize };
|
|
10
10
|
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Brand, componentProps: {
|
|
11
11
|
config,
|
|
12
12
|
fallbackTitle,
|
|
13
|
-
|
|
13
|
+
home,
|
|
14
14
|
interactive,
|
|
15
15
|
} }));
|
|
16
16
|
}
|
|
@@ -10,6 +10,8 @@ import { PHI_SURFACE_CARD } from "../../../../../helpers/surface-presets";
|
|
|
10
10
|
import { resolvePhiImagePresentation } from "../../../../../components/media/image-presentation";
|
|
11
11
|
import { normalizePhiCssSize } from "../../../../../components/layouts/phi-layout-contract";
|
|
12
12
|
import { usePhiSearchDraft } from "../../../../../components/widgets/client/shared/phi-search-draft";
|
|
13
|
+
import { PhiBulletListControl } from "../../../../../components/controls/phi-bullet-list-control";
|
|
14
|
+
import { buildPhiBulletListTree, readPhiBulletListEntries, } from "../../../../../components/widgets/shared/bullet-list-vocabulary";
|
|
13
15
|
/**
|
|
14
16
|
* A Collection drawn as Cards.
|
|
15
17
|
*
|
|
@@ -34,15 +36,18 @@ import { usePhiSearchDraft } from "../../../../../components/widgets/client/shar
|
|
|
34
36
|
* squeezed pair.
|
|
35
37
|
*/
|
|
36
38
|
const CARD_MIN_COLUMN_WIDTH = 260;
|
|
39
|
+
/* A dot path, because a provider's rows are documents and the interesting field is often one level in. */
|
|
40
|
+
function readValue(item, path) {
|
|
41
|
+
return path.split(".").reduce((current, key) => (current && typeof current === "object"
|
|
42
|
+
? current[key]
|
|
43
|
+
: undefined), item);
|
|
44
|
+
}
|
|
37
45
|
function readPath(item, path) {
|
|
38
46
|
if (!path) {
|
|
39
47
|
return undefined;
|
|
40
48
|
}
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
const value = path.split(".").reduce((current, key) => (current && typeof current === "object"
|
|
44
|
-
? current[key]
|
|
45
|
-
: undefined), item);
|
|
49
|
+
// Anything that is not a string or a number is not a label and is left alone.
|
|
50
|
+
const value = readValue(item, path);
|
|
46
51
|
return typeof value === "string" || typeof value === "number" ? String(value) : undefined;
|
|
47
52
|
}
|
|
48
53
|
/**
|
|
@@ -59,7 +64,7 @@ function readIconName(value) {
|
|
|
59
64
|
function readTruth(item, path) {
|
|
60
65
|
if (!path)
|
|
61
66
|
return false;
|
|
62
|
-
const value =
|
|
67
|
+
const value = readValue(item, path);
|
|
63
68
|
return value === true || value === "true" || value === 1;
|
|
64
69
|
}
|
|
65
70
|
/*
|
|
@@ -85,6 +90,11 @@ function buildCard(item, card) {
|
|
|
85
90
|
meta: readPath(item, card?.meta),
|
|
86
91
|
actionLabel: readPath(item, card?.actionLabel),
|
|
87
92
|
value: readPath(item, card?.value),
|
|
93
|
+
badge: readPath(item, card?.badge),
|
|
94
|
+
price: readPath(item, card?.price),
|
|
95
|
+
pricePeriod: readPath(item, card?.pricePeriod),
|
|
96
|
+
priceYearly: readPath(item, card?.priceYearly),
|
|
97
|
+
pricePeriodYearly: readPath(item, card?.pricePeriodYearly),
|
|
88
98
|
};
|
|
89
99
|
/*
|
|
90
100
|
* Two pictures with two jobs, and the fallbacks say which is which. A cover opens the card and takes
|
|
@@ -110,8 +120,14 @@ function buildCard(item, card) {
|
|
|
110
120
|
...(card?.variant ? { variant: card.variant } : {}),
|
|
111
121
|
...(card?.body ? { body: card.body } : {}),
|
|
112
122
|
highlight: readTruth(item, card?.highlight),
|
|
123
|
+
...(card?.billingPeriod ? { billingPeriod: card.billingPeriod } : {}),
|
|
113
124
|
};
|
|
114
|
-
|
|
125
|
+
/* A plan's features are a list in the row, drawn as a plan card's list is drawn on a page. */
|
|
126
|
+
const features = card?.body === "plan" && card.features
|
|
127
|
+
? readPhiBulletListEntries(readValue(item, card.features)).filter((entry) => Boolean(entry.text))
|
|
128
|
+
: [];
|
|
129
|
+
const listContent = features.length > 0 ? (_jsx(PhiBulletListControl, { items: buildPhiBulletListTree(features, (entry) => entry.text) })) : null;
|
|
130
|
+
return { labels, config, listContent };
|
|
115
131
|
}
|
|
116
132
|
export function PhiCardCollectionViewBinding({ config, binding, widgetId, }) {
|
|
117
133
|
void widgetId;
|
|
@@ -126,7 +142,7 @@ export function PhiCardCollectionViewBinding({ config, binding, widgetId, }) {
|
|
|
126
142
|
});
|
|
127
143
|
const cards = items.map((item, index) => {
|
|
128
144
|
const card = buildCard(item, presentation.card);
|
|
129
|
-
return (_jsx(PhiCardWidgetClient, { labels: card.labels, config: card.config }, readPath(item, "id") ?? readPath(item, "slug") ?? String(index)));
|
|
145
|
+
return (_jsx(PhiCardWidgetClient, { labels: card.labels, config: card.config, listContent: card.listContent }, readPath(item, "id") ?? readPath(item, "slug") ?? String(index)));
|
|
130
146
|
});
|
|
131
147
|
return (_jsx(PhiCollectionViewControl, { title: presentation.title, description: presentation.description, mode: presentation.mode, ...(presentation.gap ? { gap: presentation.gap } : {}), minColumnWidth: presentation.minColumnWidth ?? CARD_MIN_COLUMN_WIDTH, filters: features.search?.enabled ? (_jsx(PhiTextControl, { inputType: "search", value: searchDraft, placeholder: features.search.placeholder, ariaLabel: features.search.placeholder ?? "Search", onChange: (value) => setSearchDraft(value ?? ""), style: {
|
|
132
148
|
flex: "1 1 12rem",
|
|
@@ -134,7 +150,7 @@ export function PhiCardCollectionViewBinding({ config, binding, widgetId, }) {
|
|
|
134
150
|
}, size: presentation.controlSize })) : null, diagnostics: binding.error ? (_jsx(PhiAlertControl, { level: "error", title: binding.error })) : null, body: items.length === 0 && !binding.loading ? (_jsx(PhiEmptyControl, { description: presentation.emptyDescription ?? "Nothing here yet." })) : undefined, items: cards, pagination: features.pagination?.enabled === false ? null : {
|
|
135
151
|
page: binding.query.page ?? 1,
|
|
136
152
|
pageSize: binding.query.pageSize ?? features.pagination?.pageSize ?? 20,
|
|
137
|
-
total: binding.data?.total ??
|
|
153
|
+
total: binding.data?.total ?? 0,
|
|
138
154
|
...(features.pagination?.compact === undefined
|
|
139
155
|
? {}
|
|
140
156
|
: { simple: features.pagination.compact }),
|