@phis/ui 0.6.2 → 0.6.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-root-layout.js +2 -0
- package/components/controls/phi-mask-picker-control.d.ts +7 -1
- package/components/controls/phi-mask-picker-control.js +18 -16
- package/components/controls/phi-media-picker-control.d.ts +30 -1
- package/components/controls/phi-media-picker-control.js +15 -2
- package/components/controls/phi-media-source-item-tile-control.d.ts +22 -0
- package/components/controls/phi-media-source-item-tile-control.js +65 -0
- package/components/controls/phi-segmented-control.js +15 -1
- package/components/forms/form-field-labels.d.ts +19 -0
- package/components/forms/form-field-labels.js +78 -0
- package/components/forms/form-provider-contract.d.ts +1 -17
- package/components/forms/form-provider-contract.js +4 -18
- package/components/forms/media-asset-field-keys.d.ts +27 -0
- package/components/forms/media-asset-field-keys.js +27 -0
- package/components/forms/phi-form-widget.js +5 -1
- package/components/forms/upload-field-keys.d.ts +27 -0
- package/components/forms/upload-field-keys.js +27 -0
- package/components/forms/upload-form-control.js +11 -5
- package/components/media/asset-controller-requirement.d.ts +9 -0
- package/components/media/asset-controller-requirement.js +42 -0
- package/components/media/label-sets/media-upload.d.ts +10 -0
- package/components/media/label-sets/media-upload.js +85 -0
- package/components/media/label-sets/media.js +31 -135
- package/components/media/media-upload-labels.d.ts +43 -0
- package/components/media/media-upload-labels.js +23 -0
- package/components/media/media-upload-refusals.d.ts +12 -0
- package/components/media/media-upload-refusals.js +28 -0
- package/components/media/media-widget-labels.d.ts +33 -26
- package/components/media/media-widget-labels.js +27 -36
- package/components/media/phi-area-upload-widget.js +3 -4
- package/components/media/phi-asset-inspector-section.d.ts +2 -2
- package/components/media/phi-image-inspector-widget.d.ts +2 -5
- package/components/media/phi-media-picker-binding.d.ts +17 -0
- package/components/media/phi-media-picker-binding.js +199 -4
- package/components/media/phi-media-picker-labels.d.ts +7 -0
- package/components/media/phi-media-picker-labels.js +25 -0
- package/components/media/phi-media-sources.d.ts +69 -0
- package/components/media/phi-media-sources.js +254 -0
- package/components/media/phi-media-upload.d.ts +1 -27
- package/components/media/phi-media-upload.js +4 -48
- package/components/runtime/runtime-controller-materialization.d.ts +5 -4
- package/components/runtime/runtime-controller-materialization.js +5 -4
- package/components/runtime/runtime-module-context.d.ts +5 -1
- package/components/runtime/runtime-module-context.js +4 -1
- package/components/runtime/runtime-module-media-source-client-manifest.d.ts +17 -0
- package/components/runtime/runtime-module-media-source-client-manifest.js +53 -0
- package/components/widgets/client/shared/phi-mask-picker.js +23 -13
- package/components/widgets/client/shared/phi-widget-image-tool-button.d.ts +7 -5
- package/components/widgets/client/shared/phi-widget-image-tool-button.js +11 -7
- package/components/widgets/client/shared/phi-widget-tool-buttons.js +2 -2
- package/components/widgets/config/mask.d.ts +6 -8
- package/components/widgets/config/mask.js +14 -12
- package/components/widgets/label-sets/authoring-tools.js +55 -1
- package/components/widgets/label-sets/history.js +0 -2
- package/components/widgets/label-sets/slot-upload.js +4 -4
- package/components/widgets/label-types/authoring-tools.d.ts +10 -0
- package/components/widgets/label-types/authoring-tools.js +6 -0
- package/components/widgets/label-types/history.d.ts +1 -1
- package/components/widgets/label-types/history.js +0 -1
- package/components/widgets/label-types/mask-picker.d.ts +31 -0
- package/components/widgets/label-types/mask-picker.js +30 -0
- package/components/widgets/label-types/slot-upload.d.ts +2 -2
- package/controls.d.ts +2 -0
- package/controls.js +1 -0
- package/helpers/cms-region-keys.d.ts +1 -1
- package/module-client.d.ts +5 -1
- package/module-projection-client.js +1 -0
- package/next/areas/accounting-client.js +3 -2
- package/next/areas/admin-client.js +3 -2
- package/next/areas/app-client.js +3 -2
- package/next/areas/builder-client.js +3 -2
- package/next/areas/editor-client.js +3 -2
- package/next/areas/public-client.js +3 -2
- package/next/runtime-module-client-boundary.d.ts +3 -1
- package/next/runtime-module-client-boundary.js +3 -2
- package/package.json +7 -2
- package/plugins/runtime-modules/area-module-defaults.js +4 -3
- package/plugins/runtime-modules/asset/controller/definition.d.ts +2 -2
- package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
- package/plugins/runtime-modules/asset/definition.d.ts +3 -2
- package/plugins/runtime-modules/asset/definition.js +11 -3
- package/plugins/runtime-modules/asset/ids.d.ts +8 -0
- package/plugins/runtime-modules/asset/ids.js +8 -0
- package/plugins/runtime-modules/asset/labels.d.ts +4 -0
- package/plugins/runtime-modules/asset/labels.js +94 -0
- package/plugins/runtime-modules/asset/media-asset-form-control.js +32 -7
- package/plugins/runtime-modules/asset/metadata-form.js +27 -18
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +14 -11
- package/plugins/runtime-modules/asset/widgets/area-upload/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/area-upload/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/area-upload/server.js +3 -3
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/server.js +2 -2
- package/plugins/runtime-modules/asset/widgets/media-picker/config.d.ts +1 -0
- package/plugins/runtime-modules/asset/widgets/media-picker/config.js +3 -0
- package/plugins/runtime-modules/auth/presets.d.ts +11 -0
- package/plugins/runtime-modules/auth/presets.js +17 -8
- package/plugins/runtime-modules/auth/services/installations-table.js +3 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +1 -4
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +2 -2
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +1 -3
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +4 -5
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -8
- package/plugins/runtime-modules/builder/clients/pages-header.js +2 -0
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +0 -1
- package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -1
- package/plugins/runtime-modules/builder/controller/page-controller.js +3 -3
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +4 -1
- package/plugins/runtime-modules/builder/inspector-section-widget.js +5 -2
- package/plugins/runtime-modules/builder/module-authoring-catalog.server.js +3 -1
- package/plugins/runtime-modules/builder/navigation-catalog.server.js +3 -0
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +1 -1
- package/plugins/runtime-modules/builder/offered-page-catalog.js +8 -3
- package/plugins/runtime-modules/builder/options-providers.js +2 -2
- package/plugins/runtime-modules/builder/page-address-rule.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-address-rule.js +12 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +4 -0
- package/plugins/runtime-modules/builder/persistence.js +2 -3
- package/plugins/runtime-modules/builder/public-route-collisions.d.ts +1 -1
- package/plugins/runtime-modules/builder/public-route-collisions.js +6 -1
- package/plugins/runtime-modules/builder/runtime-module-sandbox.server.js +8 -1
- package/plugins/runtime-modules/builder/runtime-module-selection.js +5 -5
- package/plugins/runtime-modules/builder/services/runtime-modules-table.js +24 -6
- package/plugins/runtime-modules/builder/signal-endpoints.js +2 -1
- package/plugins/runtime-modules/builder/use-offered-page-catalog.d.ts +2 -2
- package/plugins/runtime-modules/builder/use-offered-page-catalog.js +5 -3
- package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +19 -12
- package/plugins/runtime-modules/client-manifests/accounting.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/accounting.js +1 -0
- package/plugins/runtime-modules/client-manifests/admin.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/admin.js +1 -0
- package/plugins/runtime-modules/client-manifests/app.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/app.js +1 -0
- package/plugins/runtime-modules/client-manifests/builder.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/builder.js +1 -0
- package/plugins/runtime-modules/client-manifests/common.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/common.js +3 -0
- package/plugins/runtime-modules/client-manifests/editor.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/editor.js +1 -0
- package/plugins/runtime-modules/client-manifests/public.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/public.js +1 -0
- package/plugins/runtime-modules/contracts.js +61 -0
- package/plugins/runtime-modules/core/client-media-sources.d.ts +5 -0
- package/plugins/runtime-modules/core/client-media-sources.js +6 -0
- package/plugins/runtime-modules/core/messaging/forms.js +2 -15
- package/plugins/runtime-modules/core/messaging/labels.d.ts +0 -12
- package/plugins/runtime-modules/core/messaging/labels.js +0 -24
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -6
- package/plugins/runtime-modules/core/widgets/collection-view/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +7 -0
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +8 -2
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
- package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/server.js +14 -2
- package/plugins/runtime-modules/core/widgets/image/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/image/editor.d.ts +1 -4
- package/plugins/runtime-modules/core/widgets/image/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +2 -3
- package/plugins/runtime-modules/editor/services/releases-table.js +4 -1
- package/plugins/runtime-modules/observability/services/table.js +3 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -25
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
- package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -1
- package/plugins/runtime-modules/resolver.js +27 -1
- package/plugins/runtime-modules/settings.d.ts +20 -3
- package/plugins/runtime-modules/settings.js +35 -5
- package/plugins/runtime-modules/site-module-client-manifests.d.ts +2 -0
- package/plugins/runtime-modules/site-module-client-manifests.js +2 -0
- package/plugins/runtime-modules/site-modules-client.d.ts +5 -0
- package/plugins/runtime-modules/site-modules-client.js +1 -0
- package/plugins/runtime-modules/theme/brand-theme-model.js +0 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +97 -192
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +6 -2
- package/plugins/runtime-modules/user-management/services/table.js +3 -1
- package/runtime-client-manifests-accounting.d.ts +1 -1
- package/runtime-client-manifests-accounting.js +1 -1
- package/runtime-client-manifests-admin.d.ts +1 -1
- package/runtime-client-manifests-admin.js +1 -1
- package/runtime-client-manifests-app.d.ts +1 -1
- package/runtime-client-manifests-app.js +1 -1
- package/runtime-client-manifests-builder.d.ts +1 -1
- package/runtime-client-manifests-builder.js +1 -1
- package/runtime-client-manifests-editor.d.ts +1 -1
- package/runtime-client-manifests-editor.js +1 -1
- package/runtime-client-manifests-public.d.ts +2 -1
- package/runtime-client-manifests-public.js +1 -1
- package/runtime-media-source-client.d.ts +3 -0
- package/runtime-media-source-client.js +2 -0
- package/server-helpers/cms-request.js +10 -4
- package/theme/phi-theme-presets.d.ts +13 -3
- package/theme/phi-theme-presets.js +20 -3
- package/theme/phi-theme-seed-derivation.d.ts +240 -0
- package/theme/phi-theme-seed-derivation.js +126 -0
- package/types/cms-plugins.d.ts +29 -0
- package/types/media-source.d.ts +48 -0
- package/types/media-source.js +1 -0
- package/types/site-config.d.ts +1 -2
- package/types/site-theme.d.ts +0 -6
- package/types.d.ts +1 -0
- package/components/media/asset-controller-routes.d.ts +0 -8
- package/components/media/asset-controller-routes.js +0 -31
- package/helpers/brand-contact.d.ts +0 -14
- package/helpers/brand-contact.js +0 -26
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PhisMediaSourceListInput, PhisMediaSourcePage } from "@phis/contracts/media-source";
|
|
2
|
+
import type { PhiRuntimeModuleId } from "./cms-module-descriptors";
|
|
3
|
+
/**
|
|
4
|
+
* A media source a Module offers: somewhere other than the Site's library a file can be taken from. The
|
|
5
|
+
* list contract is `@phis/contracts/media-source`; what is chosen is imported into the library as an
|
|
6
|
+
* ordinary Asset, and nothing ever stores a reference into the source (THIRD_PARTY_MODULES.md, "Offering a
|
|
7
|
+
* media source").
|
|
8
|
+
*/
|
|
9
|
+
/** Namespaced like a data provider key: `<owner>/<name>`. */
|
|
10
|
+
export type PhiMediaSourceKey = `${string}/${string}`;
|
|
11
|
+
/** What the Server half declares: the catalog validates the key and that the declaring Module owns it. */
|
|
12
|
+
export type PhiMediaSourceDescriptor = {
|
|
13
|
+
key: PhiMediaSourceKey;
|
|
14
|
+
ownerModuleId: PhiRuntimeModuleId;
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* An item, taken: the bytes in the browser and what is known about them. The picker uploads the file
|
|
20
|
+
* into the Site's library; the Module never writes an Asset itself.
|
|
21
|
+
*/
|
|
22
|
+
export type PhiMediaSourceTakenFile = {
|
|
23
|
+
file: Blob;
|
|
24
|
+
fileName: string;
|
|
25
|
+
title: string;
|
|
26
|
+
altText?: string | null;
|
|
27
|
+
credit?: string | null;
|
|
28
|
+
};
|
|
29
|
+
export type PhiMediaSourceClient = {
|
|
30
|
+
/** What the picker's source switch says, in the reader's language; the Module translates its own words. */
|
|
31
|
+
describe(input: {
|
|
32
|
+
locale: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
label: string;
|
|
35
|
+
}>;
|
|
36
|
+
list(input: PhisMediaSourceListInput & {
|
|
37
|
+
signal: AbortSignal;
|
|
38
|
+
}): Promise<PhisMediaSourcePage>;
|
|
39
|
+
take(input: {
|
|
40
|
+
itemId: string;
|
|
41
|
+
signal: AbortSignal;
|
|
42
|
+
}): Promise<PhiMediaSourceTakenFile>;
|
|
43
|
+
};
|
|
44
|
+
export type PhiMediaSourceClientDefinition = {
|
|
45
|
+
key: PhiMediaSourceKey;
|
|
46
|
+
ownerModuleId: PhiRuntimeModuleId;
|
|
47
|
+
load: () => Promise<PhiMediaSourceClient>;
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/site-config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PhiShellTheme } from "../components/shell/shell-types";
|
|
2
|
-
import type { PhiSiteFontSlots, PhiSiteThemeBrand,
|
|
2
|
+
import type { PhiSiteFontSlots, PhiSiteThemeBrand, PhiSiteThemeRoot } from "./site-theme";
|
|
3
3
|
import type { PhiLocaleCapability } from "../helpers/site-locale-config";
|
|
4
4
|
import type { PhiThemePalette } from "../theme/phi-theme-presets";
|
|
5
5
|
import type { PhiThemeBlockSelection } from "../theme/phi-theme-composition";
|
|
@@ -22,7 +22,6 @@ export type PhiSiteTheme = {
|
|
|
22
22
|
controls?: PhiControlShapeCorners | null;
|
|
23
23
|
} | null;
|
|
24
24
|
fonts?: PhiSiteFontSlots;
|
|
25
|
-
contact?: PhiSiteThemeContact | null;
|
|
26
25
|
brand?: PhiSiteThemeBrand | null;
|
|
27
26
|
widgets?: {
|
|
28
27
|
locale?: {
|
package/types/site-theme.d.ts
CHANGED
|
@@ -178,12 +178,6 @@ export type PhiSiteThemeBrand = {
|
|
|
178
178
|
location?: PhiSiteThemeBrandLine | null;
|
|
179
179
|
wordmark?: PhiSiteThemeWordmark | null;
|
|
180
180
|
};
|
|
181
|
-
/** The one way to reach whoever runs this Site, as the frame offers it. */
|
|
182
|
-
export type PhiSiteThemeContact = {
|
|
183
|
-
label?: string | null;
|
|
184
|
-
href?: string | null;
|
|
185
|
-
icon?: string | null;
|
|
186
|
-
};
|
|
187
181
|
export type PhiWidgetFontFamilyKey = "inherit" | "system" | "body" | "mono" | "serif" | "accent" | "display";
|
|
188
182
|
export type PhiWidgetFontSizeKey = "inherit" | "xs" | "sm" | "base" | "lg" | "xl" | "xxl";
|
|
189
183
|
export type PhiSiteFontSlots = {
|
package/types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./types/layout-style";
|
|
|
14
14
|
export * from "./types/control";
|
|
15
15
|
export * from "./types/calendar";
|
|
16
16
|
export * from "./types/calendar-keys";
|
|
17
|
+
export type * from "./types/media-source";
|
|
17
18
|
export * from "./types/dimension";
|
|
18
19
|
export * from "./types/length";
|
|
19
20
|
export * from "./types/responsive";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type PhiSignalRouteSet, type PhiSignalScope } from "../../types/signals";
|
|
2
|
-
/**
|
|
3
|
-
* The signal routes a media picker emits towards the asset controller.
|
|
4
|
-
*
|
|
5
|
-
* It sits beside the address and the channels it builds on, because it is used by the asset Module,
|
|
6
|
-
* by the builder Module and by two shared widget components -- so no single Module can own it.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createPhiMediaPickerAssetControllerRoutes(routeKeyPrefix: string, scope: Extract<PhiSignalScope, "area" | "page">): PhiSignalRouteSet;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { PHI_SIGNAL_VALUE_SCHEMAS, } from "../../types/signals";
|
|
2
|
-
import { createPhiAssetControllerAddress } from "./asset-controller-address";
|
|
3
|
-
import { PHI_ASSET_SIGNAL_CHANNELS } from "./asset-controller-signals";
|
|
4
|
-
/**
|
|
5
|
-
* The signal routes a media picker emits towards the asset controller.
|
|
6
|
-
*
|
|
7
|
-
* It sits beside the address and the channels it builds on, because it is used by the asset Module,
|
|
8
|
-
* by the builder Module and by two shared widget components -- so no single Module can own it.
|
|
9
|
-
*/
|
|
10
|
-
export function createPhiMediaPickerAssetControllerRoutes(routeKeyPrefix, scope) {
|
|
11
|
-
const receiver = createPhiAssetControllerAddress();
|
|
12
|
-
return {
|
|
13
|
-
emits: [
|
|
14
|
-
{ routeKey: `${routeKeyPrefix}-kind`, capabilityId: "kind", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.kind, action: "change", valueType: "string", receiver },
|
|
15
|
-
{ routeKey: `${routeKeyPrefix}-presentationFlags`, capabilityId: "presentationFlags", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.presentationFlags, action: "change", valueType: "number[]", receiver },
|
|
16
|
-
{ routeKey: `${routeKeyPrefix}-query`, capabilityId: "query", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.query, action: "change", valueType: "string", receiver },
|
|
17
|
-
{ routeKey: `${routeKeyPrefix}-path`, capabilityId: "path", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.path, action: "change", valueType: "path", receiver },
|
|
18
|
-
{ routeKey: `${routeKeyPrefix}-reload`, capabilityId: "reload", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.reload, action: "activate", valueType: "none", receiver },
|
|
19
|
-
{
|
|
20
|
-
routeKey: `${routeKeyPrefix}-pagination`,
|
|
21
|
-
capabilityId: "pagination",
|
|
22
|
-
scope,
|
|
23
|
-
channel: PHI_ASSET_SIGNAL_CHANNELS.pagination,
|
|
24
|
-
action: "change",
|
|
25
|
-
valueType: "json",
|
|
26
|
-
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.pagination,
|
|
27
|
-
receiver,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
};
|
|
31
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { PhiBlockRuntime } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* The one way to reach whoever runs this Site.
|
|
4
|
-
*
|
|
5
|
-
* Two presets need it now -- the Area Shell, and the Public landing page, which draws its own header
|
|
6
|
-
* and footer because no Shell is drawn around it. They have to agree: a landing page offering a
|
|
7
|
-
* different address than the footer one click away is a bug the operator only hears about from a
|
|
8
|
-
* customer.
|
|
9
|
-
*/
|
|
10
|
-
export declare function resolvePhiBrandContact(runtime: PhiBlockRuntime): {
|
|
11
|
-
label: string;
|
|
12
|
-
href: string;
|
|
13
|
-
icon: string;
|
|
14
|
-
};
|
package/helpers/brand-contact.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
function normalizeContactHost(hostname) {
|
|
2
|
-
const normalized = hostname?.trim().toLowerCase();
|
|
3
|
-
if (!normalized) {
|
|
4
|
-
return undefined;
|
|
5
|
-
}
|
|
6
|
-
return normalized.replace(/^www\./, "");
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The one way to reach whoever runs this Site.
|
|
10
|
-
*
|
|
11
|
-
* Two presets need it now -- the Area Shell, and the Public landing page, which draws its own header
|
|
12
|
-
* and footer because no Shell is drawn around it. They have to agree: a landing page offering a
|
|
13
|
-
* different address than the footer one click away is a bug the operator only hears about from a
|
|
14
|
-
* customer.
|
|
15
|
-
*/
|
|
16
|
-
export function resolvePhiBrandContact(runtime) {
|
|
17
|
-
return {
|
|
18
|
-
label: runtime.site.theme?.contact?.label?.trim() || "Contact",
|
|
19
|
-
href: runtime.site.theme?.contact?.href?.trim() ||
|
|
20
|
-
(() => {
|
|
21
|
-
const host = normalizeContactHost(runtime.site.hostname);
|
|
22
|
-
return host ? `mailto:info@${host}` : "mailto:info@example.com";
|
|
23
|
-
})(),
|
|
24
|
-
icon: runtime.site.theme?.contact?.icon?.trim() || "antd:mail",
|
|
25
|
-
};
|
|
26
|
-
}
|