@phis/ui 0.4.21 → 0.4.23
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 +1 -1
- package/components/controls/phi-brand-control.d.ts +10 -2
- package/components/controls/phi-brand-control.js +12 -8
- package/components/controls/phi-cascader-control.js +6 -1
- package/components/controls/phi-geometry-control.d.ts +33 -1
- package/components/controls/phi-geometry-control.js +87 -29
- package/components/controls/phi-series-chart-control.js +4 -2
- package/components/forms/form-provider-contract.d.ts +1 -0
- package/components/forms/form-provider-contract.js +1 -0
- package/components/forms/upload-form-control.js +1 -0
- package/components/layouts/clients/phi-flex-layout-client.js +23 -5
- package/components/layouts/clients/phi-grid-layout-client.js +20 -10
- package/components/layouts/clients/phi-layout-anchored-overlay.d.ts +2 -0
- package/components/layouts/clients/phi-layout-anchored-overlay.js +9 -2
- package/components/layouts/clients/phi-three-column-layout-client.js +7 -4
- package/components/layouts/layout-definitions.d.ts +16 -16
- package/components/layouts/layout-definitions.js +8 -8
- package/components/layouts/phi-base-layout.js +13 -9
- package/components/layouts/phi-layout-contract.d.ts +12 -2
- package/components/layouts/phi-layout-contract.js +30 -7
- package/components/layouts/phi-masonry-layout.d.ts +6 -0
- package/components/layouts/phi-masonry-layout.js +13 -3
- package/components/layouts/plugins/masonry-layout-plugin.js +2 -1
- package/components/media/asset-collection-runtime.d.ts +1 -6
- package/components/media/asset-collection-runtime.js +2 -93
- package/components/media/label-sets/media.js +12 -0
- package/components/media/media-folder-lock.d.ts +19 -0
- package/components/media/media-folder-lock.js +40 -0
- package/components/media/media-folder-options.d.ts +14 -2
- package/components/media/media-folder-options.js +17 -5
- package/components/media/media-widget-labels.d.ts +9 -0
- package/components/media/media-widget-labels.js +6 -0
- package/components/media/phi-area-upload-widget.js +1 -0
- package/components/media/phi-asset-folder-control.d.ts +14 -1
- package/components/media/phi-asset-folder-control.js +11 -4
- package/components/media/phi-image-preview-store.d.ts +0 -4
- package/components/media/phi-image-preview-store.js +0 -10
- package/components/media/phi-media-picker-binding.d.ts +7 -2
- package/components/media/phi-media-upload.d.ts +2 -0
- package/components/media/phi-media-upload.js +3 -0
- package/components/regions/clients/cms-region-container-client.d.ts +3 -1
- package/components/regions/clients/cms-region-container-client.js +4 -3
- package/components/regions/phi-cms-region-container.d.ts +3 -1
- package/components/regions/phi-cms-region-container.js +3 -2
- package/components/regions/phi-cms-region-shell.d.ts +9 -1
- package/components/regions/phi-cms-region-shell.js +3 -1
- package/components/regions/phi-cms-region-static.d.ts +3 -1
- package/components/regions/phi-cms-region-static.js +3 -2
- package/components/regions/presets/navigation-redirect.d.ts +2 -2
- package/components/regions/presets/navigation-redirect.js +5 -3
- package/components/shell/phi-antd-icon.d.ts +2 -0
- package/components/shell/phi-antd-icon.js +6 -0
- package/components/widgets/label-sets/geometry.js +10 -0
- package/components/widgets/label-types/geometry.d.ts +7 -0
- package/components/widgets/label-types/geometry.js +6 -0
- package/components/widgets/shared/markdown-render.js +30 -135
- package/components/widgets/shared/markdown-translation-unit.d.ts +62 -0
- package/components/widgets/shared/markdown-translation-unit.js +211 -0
- package/helpers/block-geometry-profiles.d.ts +67 -0
- package/helpers/block-geometry-profiles.js +105 -0
- package/helpers/cms-navigation-catalog.js +4 -2
- package/helpers/renderable-block-effects.js +16 -0
- package/package.json +1 -1
- package/plugins/runtime/phi-slot-child-frame-view.js +14 -4
- package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +42 -2
- package/plugins/runtime/slot-size-policy.d.ts +15 -0
- package/plugins/runtime/slot-size-policy.js +29 -0
- package/plugins/runtime-modules/asset/data-providers.js +3 -0
- package/plugins/runtime-modules/asset/services/collection.js +34 -0
- package/plugins/runtime-modules/asset/services/options.js +19 -2
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +9 -0
- package/plugins/runtime-modules/auth/trees/phi-auth-runtime-page-tree.js +21 -17
- package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/client.js +2 -0
- package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
- package/plugins/runtime-modules/builder/render-root-node-preview.server.js +2 -1
- package/plugins/runtime-modules/builder/services/navigation-table.js +3 -2
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +7 -1
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +8 -2
- package/plugins/runtime-modules/core/messaging/data-providers.js +23 -0
- package/plugins/runtime-modules/core/messaging/labels.d.ts +2 -0
- package/plugins/runtime-modules/core/messaging/labels.js +8 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +32 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +31 -16
- package/plugins/runtime-modules/core/widgets/brand/client.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/brand/client.js +2 -1
- package/plugins/runtime-modules/core/widgets/brand/plugin.js +23 -2
- package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/brand/server.js +2 -1
- package/plugins/runtime-modules/core/widgets/card/server.js +7 -4
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +52 -6
- package/plugins/runtime-modules/core/widgets/gallery/plugin.js +3 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.js +12 -2
- package/plugins/runtime-modules/core/widgets/image/server.js +28 -5
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +8 -2
- package/plugins/runtime-modules/descriptor-compiler.js +45 -2
- package/plugins/runtime-modules/public/trees/phi-default-pub-welcome-page-tree.js +8 -14
- package/plugins/runtime-modules/search/widgets/search-box/client.d.ts +2 -1
- package/plugins/runtime-modules/search/widgets/search-box/client.js +28 -6
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +19 -2
- package/plugins/runtime-modules/threads/labels.d.ts +6 -0
- package/plugins/runtime-modules/threads/labels.js +16 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +24 -1
- package/styles/layout.css +101 -0
- package/styles/root.css +2 -1
- package/types/cms-config.d.ts +5 -1
- package/types/cms-config.js +1 -0
- package/types/cms-module-descriptors.d.ts +17 -0
- package/types/renderable-block.d.ts +5 -0
- package/types/site-theme.d.ts +9 -1
- package/types.d.ts +1 -1
|
@@ -4,6 +4,9 @@ import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
|
4
4
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
|
|
5
5
|
import { getPhiImageWidgetLabels } from "../../../../../components/widgets/label-sets/image";
|
|
6
6
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
|
|
7
|
+
import { PhiCmsFlags } from "../../../../../constants/phi-cms";
|
|
8
|
+
import { hasPhiFlag } from "../../../../../helpers/flags";
|
|
9
|
+
import { trBulk, trBulkForLocale } from "../../../../../server-helpers/translate";
|
|
7
10
|
async function resolveImageWidgetLabels(runtime) {
|
|
8
11
|
return getPhiImageWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
9
12
|
}
|
|
@@ -13,18 +16,38 @@ export async function PhiImageWidgetServer({ runtime, widget, config, }) {
|
|
|
13
16
|
const resolvedAsset = config?.sourceKind === "asset" && typeof assetId === "number"
|
|
14
17
|
? await resolvePhiPublicAssetReference({ runtime, assetId }).catch(() => null)
|
|
15
18
|
: null;
|
|
16
|
-
const
|
|
17
|
-
const
|
|
19
|
+
const recordTitle = widget?.resolvedContent?.textFields.title?.value?.trim();
|
|
20
|
+
const recordAlt = widget?.resolvedContent?.textFields.alt?.value?.trim();
|
|
21
|
+
/*
|
|
22
|
+
* The picture's description and title in the page's language, as every other Widget's words.
|
|
23
|
+
*
|
|
24
|
+
* A Content record's text arrives translated already and is taken as it is. The rest -- the Asset's own
|
|
25
|
+
* description from the Media library, or what the Widget's config states for an address -- is the Site's
|
|
26
|
+
* text and goes through the Site's translation, unless the Widget says not to translate.
|
|
27
|
+
*/
|
|
28
|
+
const translate = !hasPhiFlag(widget?.flags ?? 0, PhiCmsFlags.NoTranslate);
|
|
29
|
+
const sourceTexts = [
|
|
30
|
+
recordAlt ? "" : (resolvedAsset?.altText ?? "").trim(),
|
|
31
|
+
recordTitle ? "" : (resolvedAsset?.title ?? "").trim(),
|
|
32
|
+
config?.sourceKind === "asset" ? "" : (config?.alt ?? "").trim(),
|
|
33
|
+
config?.sourceKind === "asset" ? "" : (config?.title ?? "").trim(),
|
|
34
|
+
];
|
|
35
|
+
const [assetAlt, assetTitle, configAlt, configTitle] = translate && sourceTexts.some(Boolean)
|
|
36
|
+
? await (runtime.locale.current ? trBulkForLocale(runtime.locale.current, sourceTexts) : trBulk(sourceTexts))
|
|
37
|
+
: sourceTexts;
|
|
18
38
|
const contentResolvedAsset = resolvedAsset
|
|
19
39
|
? {
|
|
20
40
|
...resolvedAsset,
|
|
21
|
-
title:
|
|
22
|
-
altText:
|
|
41
|
+
title: recordTitle || assetTitle || resolvedAsset.title,
|
|
42
|
+
altText: recordAlt || assetAlt || resolvedAsset.altText,
|
|
23
43
|
}
|
|
24
44
|
: null;
|
|
45
|
+
const translatedConfig = config && config.sourceKind !== "asset"
|
|
46
|
+
? { ...config, ...(configAlt ? { alt: configAlt } : {}), ...(configTitle ? { title: configTitle } : {}) }
|
|
47
|
+
: config;
|
|
25
48
|
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Image, componentProps: {
|
|
26
49
|
labels,
|
|
27
|
-
config:
|
|
50
|
+
config: translatedConfig ?? undefined,
|
|
28
51
|
resolvedAsset: contentResolvedAsset,
|
|
29
52
|
focalRect: contentResolvedAsset?.focalRect ?? null,
|
|
30
53
|
} }));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { PhiBlockRuntime, PhiClientBlockBaseProps } from "../../../../../types";
|
|
2
|
+
import type { PhisThreadDetail } from "../../../../../types/threads";
|
|
2
3
|
import { type PhiThreadWidgetConfig } from "../thread-widget-config";
|
|
3
4
|
import type { PhiThreadConversationLabels } from "../../messaging/labels";
|
|
4
5
|
export type PhiThreadConversationWidgetClientProps = PhiClientBlockBaseProps<PhiThreadConversationLabels, PhiThreadWidgetConfig, Pick<PhiBlockRuntime, "site" | "locale" | "viewer">> & {
|
|
5
6
|
runtime: Pick<PhiBlockRuntime, "site" | "locale" | "viewer">;
|
|
6
7
|
};
|
|
7
8
|
export declare function PhiThreadConversationWidgetClient({ runtime, labels, config, }: PhiThreadConversationWidgetClientProps): import("react").JSX.Element;
|
|
9
|
+
/** Whether Core takes new messages into this conversation; `PhisThreadFlag.Locked` says it does not. */
|
|
10
|
+
export declare function isPhiThreadLocked(detail: Pick<PhisThreadDetail, "thread">): boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { useSearchParams } from "next/navigation";
|
|
5
|
-
import { PhisThreadMessageFlag, PhisThreadStatus } from "../../../../../constants/threads";
|
|
5
|
+
import { PhisThreadFlag, PhisThreadMessageFlag, PhisThreadStatus } from "../../../../../constants/threads";
|
|
6
6
|
import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
|
|
7
7
|
import { PhiButtonControl } from "../../../../../components/controls/phi-button-control";
|
|
8
8
|
import { PhiCardControl } from "../../../../../components/controls/phi-card-control";
|
|
@@ -458,7 +458,13 @@ export function PhiThreadConversationWidgetClient({ runtime, labels, config, })
|
|
|
458
458
|
if (!detail) {
|
|
459
459
|
return (_jsx(PhiCardControl, { padding: config?.padding, children: _jsx(PhiTypographyControl, { type: "secondary", children: labels.loadingText }) }));
|
|
460
460
|
}
|
|
461
|
-
|
|
461
|
+
const archived = detail.thread.status === PhisThreadStatus.Archived;
|
|
462
|
+
const locked = isPhiThreadLocked(detail);
|
|
463
|
+
return (_jsx(_Fragment, { children: _jsx(PhiCardControl, { padding: config?.padding, toolbar: config?.reply && !archived && !locked ? (_jsx(PhiButtonControl, { label: labels.replyLabel, icon: _jsx(PhiIcon, { name: "antd:message-outlined", size: "inherit" }), size: "small", onClick: reply })) : undefined, title: _jsxs(PhiFlexControl, { align: "center", gap: "small", wrap: true, children: [readThreadTitle(detail, labels), archived ? (_jsx(PhiTagControl, { children: labels.archivedLabel })) : null, locked ? (_jsxs(PhiTagControl, { color: "warning", children: [_jsx(PhiIcon, { name: "antd:lock", size: "inherit" }), " ", labels.lockedLabel] })) : null] }), children: _jsxs(PhiFlexControl, { vertical: true, gap: "middle", children: [detail.thread.subject?.trim() && detail.participants.length > 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: `${labels.participantsLabel}: ${readParticipantNames(detail, labels).join(", ")}` })) : null, config?.reply && locked && !archived ? (_jsx(PhiAlertControl, { level: "info", showIcon: true, title: labels.lockedText })) : null, error ? (_jsx(PhiAlertControl, { level: "error", title: labels.feedback.errorTitle, description: error })) : null, detail.hasMoreMessages ? (_jsx(PhiButtonControl, { label: labels.olderLabel, type: "link", loading: loadingOlder, onClick: () => void loadOlder() })) : null, detail.messages.length === 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.emptyText })) : (detail.messages.map((message, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(PhiDividerControl, { style: { margin: 0 } }) : null, _jsx(PhiThreadMessageRow, { message: message, labels: labels, formatTime: formatTime, formatLanguage: formatLanguage, translation: translations[message.id] ?? null, canTranslate: translationTarget != null, onTranslate: translate })] }, message.id))))] }) }) }));
|
|
464
|
+
}
|
|
465
|
+
/** Whether Core takes new messages into this conversation; `PhisThreadFlag.Locked` says it does not. */
|
|
466
|
+
export function isPhiThreadLocked(detail) {
|
|
467
|
+
return (detail.thread.flags & PhisThreadFlag.Locked) !== 0;
|
|
462
468
|
}
|
|
463
469
|
/**
|
|
464
470
|
* What to call this conversation.
|
|
@@ -424,6 +424,15 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
|
|
|
424
424
|
if (item.routePresetKey && item.overlayPresetKey) {
|
|
425
425
|
throw new Error(`${label}/${item.itemKey}: an item goes to a route or opens an Overlay, never both.`);
|
|
426
426
|
}
|
|
427
|
+
// Only a Module's injected entry may lead out; an Area's own items carry no `target`.
|
|
428
|
+
const externalTarget = "target" in item ? item.target : undefined;
|
|
429
|
+
if (externalTarget !== undefined) {
|
|
430
|
+
if (item.routePresetKey || item.overlayPresetKey || item.overlayNodeKey) {
|
|
431
|
+
throw new Error(`${label}/${item.itemKey}: an item leads to an external address, a route or an Overlay, ` +
|
|
432
|
+
"never more than one.");
|
|
433
|
+
}
|
|
434
|
+
assertNavigationExternalTarget(externalTarget, `${label}/${item.itemKey}`);
|
|
435
|
+
}
|
|
427
436
|
if (item.overlayPresetKey && !item.overlayNodeKey) {
|
|
428
437
|
throw new Error(`${label}/${item.itemKey}: an Overlay reference needs both a preset key and a node key.`);
|
|
429
438
|
}
|
|
@@ -753,6 +762,30 @@ export function compilePhiCmsActiveRouteTable({ catalog, area, activeModuleIds,
|
|
|
753
762
|
}
|
|
754
763
|
return { area, byPageId, exactByPath, dynamic };
|
|
755
764
|
}
|
|
765
|
+
/**
|
|
766
|
+
* A Module's external navigation address: `https:` with a host, and nothing else.
|
|
767
|
+
*
|
|
768
|
+
* Refused when the catalog is compiled, so a package that names `http:`, `mailto:` or a relative path
|
|
769
|
+
* fails where it is defined rather than rendering a link nobody checked.
|
|
770
|
+
*/
|
|
771
|
+
function assertNavigationExternalTarget(target, label) {
|
|
772
|
+
if (target.kind !== "external") {
|
|
773
|
+
throw new Error(`${label}: a navigation target must be of kind "external".`);
|
|
774
|
+
}
|
|
775
|
+
let url = null;
|
|
776
|
+
try {
|
|
777
|
+
url = new URL(target.href);
|
|
778
|
+
}
|
|
779
|
+
catch {
|
|
780
|
+
url = null;
|
|
781
|
+
}
|
|
782
|
+
if (!url || url.protocol !== "https:" || !url.hostname) {
|
|
783
|
+
throw new Error(`${label}: an external navigation target must be an https: address, got "${target.href}".`);
|
|
784
|
+
}
|
|
785
|
+
if (target.newTab !== undefined && typeof target.newTab !== "boolean") {
|
|
786
|
+
throw new Error(`${label}: an external navigation target's newTab must be a boolean.`);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
756
789
|
/**
|
|
757
790
|
* What an item points at, if anything currently answers there.
|
|
758
791
|
*
|
|
@@ -767,7 +800,17 @@ export function compilePhiCmsActiveRouteTable({ catalog, area, activeModuleIds,
|
|
|
767
800
|
* `/register` after the Site had moved registration to `/signup`, and kept a root applicant the Site had
|
|
768
801
|
* turned down in the sidebar, linking `/`.
|
|
769
802
|
*/
|
|
770
|
-
function resolveNavigationTarget(routeTable, ownerModuleId, routePresetKey, overlay) {
|
|
803
|
+
function resolveNavigationTarget(routeTable, ownerModuleId, routePresetKey, overlay, external) {
|
|
804
|
+
if (external) {
|
|
805
|
+
// The shape a Site's stored external link resolves to, so every surface renders both alike. The
|
|
806
|
+
// entry stays the Module's: `ownerModuleId` on the item, not the target, says whose it is.
|
|
807
|
+
return {
|
|
808
|
+
kind: "custom",
|
|
809
|
+
path: external.href,
|
|
810
|
+
external: true,
|
|
811
|
+
...(external.newTab === true ? { newTab: true } : {}),
|
|
812
|
+
};
|
|
813
|
+
}
|
|
771
814
|
if (overlay) {
|
|
772
815
|
// No path and no lookup against the route table: the item opens something that is already in the
|
|
773
816
|
// Area tree. Ownership was checked when the surface was compiled.
|
|
@@ -795,7 +838,7 @@ function resolveNavigationTarget(routeTable, ownerModuleId, routePresetKey, over
|
|
|
795
838
|
function buildResolvedNavigationNode(catalog, routeTable, navKey, ownerModuleId, descriptor, injection) {
|
|
796
839
|
const target = resolveNavigationTarget(routeTable, ownerModuleId, descriptor.routePresetKey, descriptor.overlayPresetKey && descriptor.overlayNodeKey
|
|
797
840
|
? { presetKey: descriptor.overlayPresetKey, nodeKey: descriptor.overlayNodeKey }
|
|
798
|
-
: null);
|
|
841
|
+
: null, "target" in descriptor ? descriptor.target : undefined);
|
|
799
842
|
const intrinsicChildren = (descriptor.children ?? []).map((child) => buildResolvedNavigationNode(catalog, routeTable, navKey, ownerModuleId, child, null));
|
|
800
843
|
const sourceLocale = catalog.sourceLocaleByModuleId.get(ownerModuleId);
|
|
801
844
|
if (!sourceLocale) {
|
|
@@ -31,7 +31,6 @@ const SYNTHETIC_WELCOME_LAYOUT_IDS = createPhiPresetCmsInstanceIdMap({
|
|
|
31
31
|
}, [
|
|
32
32
|
"layoutHeaderBottom",
|
|
33
33
|
"layoutContent",
|
|
34
|
-
"layoutContentStack",
|
|
35
34
|
]);
|
|
36
35
|
const SYNTHETIC_WELCOME_WIDGET_IDS = createPhiPresetCmsInstanceIdMap({
|
|
37
36
|
domain: "page",
|
|
@@ -88,20 +87,15 @@ export async function buildPhiDefaultPubWelcomePageTree({ page, runtime, }) {
|
|
|
88
87
|
contentAlign: "center",
|
|
89
88
|
},
|
|
90
89
|
}),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
96
|
-
sortOrder: 0,
|
|
97
|
-
label: "pub welcome page",
|
|
98
|
-
config: {},
|
|
99
|
-
}),
|
|
90
|
+
/*
|
|
91
|
+
* The page column is the root itself, a vertical Flex like every other Page's. Not the base
|
|
92
|
+
* scaffold: a landing brings its own chrome, and this column centres its copy in the screen.
|
|
93
|
+
*/
|
|
100
94
|
nodes.layout({
|
|
101
95
|
creationPreset: { layoutKind: "verticalflex", preset: "panel" },
|
|
102
96
|
typeKey: "flex-vertical",
|
|
103
|
-
id: SYNTHETIC_WELCOME_LAYOUT_IDS.
|
|
104
|
-
parentLayoutNodeId:
|
|
97
|
+
id: SYNTHETIC_WELCOME_LAYOUT_IDS.layoutContent,
|
|
98
|
+
parentLayoutNodeId: null,
|
|
105
99
|
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
106
100
|
sortOrder: 0,
|
|
107
101
|
label: "pub welcome copy and way on",
|
|
@@ -131,7 +125,7 @@ export async function buildPhiDefaultPubWelcomePageTree({ page, runtime, }) {
|
|
|
131
125
|
nodes.widget({
|
|
132
126
|
typeKey: "markdown",
|
|
133
127
|
id: SYNTHETIC_WELCOME_WIDGET_IDS.widgetMarkdown,
|
|
134
|
-
parentLayoutNodeId: SYNTHETIC_WELCOME_LAYOUT_IDS.
|
|
128
|
+
parentLayoutNodeId: SYNTHETIC_WELCOME_LAYOUT_IDS.layoutContent,
|
|
135
129
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[0].slotIndex,
|
|
136
130
|
sortOrder: 0,
|
|
137
131
|
label: "pub welcome markdown widget",
|
|
@@ -160,7 +154,7 @@ export async function buildPhiDefaultPubWelcomePageTree({ page, runtime, }) {
|
|
|
160
154
|
nodes.widget({
|
|
161
155
|
typeKey: "button",
|
|
162
156
|
id: SYNTHETIC_WELCOME_WIDGET_IDS.widgetReadMore,
|
|
163
|
-
parentLayoutNodeId: SYNTHETIC_WELCOME_LAYOUT_IDS.
|
|
157
|
+
parentLayoutNodeId: SYNTHETIC_WELCOME_LAYOUT_IDS.layoutContent,
|
|
164
158
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[1].slotIndex,
|
|
165
159
|
sortOrder: 0,
|
|
166
160
|
label: "pub welcome read more button",
|
|
@@ -30,7 +30,8 @@ export type PhiSearchBoxWidgetClientProps = PhiClientBlockBaseProps<PhiSearchWid
|
|
|
30
30
|
* a script too. After that it opens the field where it stands -- the field grows out of it -- or, on a
|
|
31
31
|
* phone, as a row over the whole band it stands in: a header on a phone has no room for a field beside
|
|
32
32
|
* the brand and the menu button, and one that wrapped would push the page down. Escape, the close mark,
|
|
33
|
-
* or leaving the field empty closes it again, the field folding back
|
|
33
|
+
* or leaving the field empty -- a press outside it, or Tab -- closes it again, the field folding back
|
|
34
|
+
* into the magnifier as it came.
|
|
34
35
|
*
|
|
35
36
|
* `auto` draws both the field and the magnifier and `styles/shell.css` shows one, the way the Header
|
|
36
37
|
* Navigation draws its row and its menu button: whether this is a phone is the Shell's width, known to
|
|
@@ -38,7 +38,8 @@ function readPhiReducedMotion() {
|
|
|
38
38
|
* a script too. After that it opens the field where it stands -- the field grows out of it -- or, on a
|
|
39
39
|
* phone, as a row over the whole band it stands in: a header on a phone has no room for a field beside
|
|
40
40
|
* the brand and the menu button, and one that wrapped would push the page down. Escape, the close mark,
|
|
41
|
-
* or leaving the field empty closes it again, the field folding back
|
|
41
|
+
* or leaving the field empty -- a press outside it, or Tab -- closes it again, the field folding back
|
|
42
|
+
* into the magnifier as it came.
|
|
42
43
|
*
|
|
43
44
|
* `auto` draws both the field and the magnifier and `styles/shell.css` shows one, the way the Header
|
|
44
45
|
* Navigation draws its row and its menu button: whether this is a phone is the Shell's width, known to
|
|
@@ -52,6 +53,8 @@ export function PhiSearchBoxWidgetClient({ labels, config }) {
|
|
|
52
53
|
const interactive = config?.interactive !== false;
|
|
53
54
|
const variant = config?.variant ?? "input";
|
|
54
55
|
const placeholder = config?.placeholder ?? "";
|
|
56
|
+
const draftRef = useRef(draft);
|
|
57
|
+
draftRef.current = draft;
|
|
55
58
|
/*
|
|
56
59
|
* Closing plays the opening backwards: the field is marked `closing`, folds, and is removed when its
|
|
57
60
|
* animation ends (`finishClosing`). Without motion there is nothing to wait for.
|
|
@@ -83,6 +86,25 @@ export function PhiSearchBoxWidgetClient({ labels, config }) {
|
|
|
83
86
|
region.style.position = previous;
|
|
84
87
|
};
|
|
85
88
|
}, [open]);
|
|
89
|
+
/*
|
|
90
|
+
* The inline field closes when the reader leaves it empty, and only then -- not whenever it loses focus.
|
|
91
|
+
* Safari's password AutoFill moves focus into a sign-in form's field by itself, so on the login page a
|
|
92
|
+
* close on blur shut the field the moment it opened. A press outside the box is the reader leaving it
|
|
93
|
+
* with the pointer; Tab (in `onKeyDown`) is leaving it with the keyboard.
|
|
94
|
+
*/
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (open?.kind !== "inline" || open.closing)
|
|
97
|
+
return undefined;
|
|
98
|
+
const pressed = (event) => {
|
|
99
|
+
const root = rootRef.current;
|
|
100
|
+
if (root && event.target instanceof Node && root.contains(event.target))
|
|
101
|
+
return;
|
|
102
|
+
if (!draftRef.current.trim())
|
|
103
|
+
close();
|
|
104
|
+
};
|
|
105
|
+
document.addEventListener("pointerdown", pressed, true);
|
|
106
|
+
return () => document.removeEventListener("pointerdown", pressed, true);
|
|
107
|
+
}, [open, close]);
|
|
86
108
|
const submit = (event) => {
|
|
87
109
|
if (!interactive || !config?.action)
|
|
88
110
|
event.preventDefault();
|
|
@@ -92,11 +114,11 @@ export function PhiSearchBoxWidgetClient({ labels, config }) {
|
|
|
92
114
|
event.preventDefault();
|
|
93
115
|
close();
|
|
94
116
|
}
|
|
117
|
+
// Leaving the inline field with the keyboard; focus moves on as usual.
|
|
118
|
+
if (event.key === "Tab" && open?.kind === "inline" && !open.closing && !draft.trim())
|
|
119
|
+
close();
|
|
95
120
|
};
|
|
96
|
-
const form = ({ autoFocus = false
|
|
97
|
-
if (!draft.trim())
|
|
98
|
-
close();
|
|
99
|
-
} : undefined, style: { width: "100%" } }) }));
|
|
121
|
+
const form = ({ autoFocus = false } = {}) => (_jsx("form", { method: "get", action: interactive ? config?.action : undefined, role: "search", "aria-label": labels.title, className: "phi-search-box__form", onSubmit: submit, children: _jsx(PhiTextControl, { name: PHI_SEARCH_QUERY_PARAM, inputType: "search", ariaLabel: labels.ariaLabel, placeholder: placeholder, clearLabel: labels.clearLabel, size: config?.size, value: draft, readOnly: !interactive, tabIndex: interactive ? undefined : -1, autoFocus: autoFocus, onChange: (value) => setDraft(value ?? ""), onClear: () => setDraft(""), onKeyDown: onKeyDown, style: { width: "100%" } }) }));
|
|
100
122
|
const pressMagnifier = () => {
|
|
101
123
|
const root = rootRef.current;
|
|
102
124
|
if (!root)
|
|
@@ -106,7 +128,7 @@ export function PhiSearchBoxWidgetClient({ labels, config }) {
|
|
|
106
128
|
setOpen(region && readPhiSearchBoxOnPhone(root) ? { kind: "row", region } : { kind: "inline" });
|
|
107
129
|
};
|
|
108
130
|
const magnifier = open?.kind === "inline"
|
|
109
|
-
? (_jsx("span", { className: open.closing ? "phi-search-box__expand phi-search-box__expand--closing" : "phi-search-box__expand", onAnimationEnd: finishClosing, children: form({ autoFocus: true
|
|
131
|
+
? (_jsx("span", { className: open.closing ? "phi-search-box__expand phi-search-box__expand--closing" : "phi-search-box__expand", onAnimationEnd: finishClosing, children: form({ autoFocus: true }) }))
|
|
110
132
|
: (_jsx("span", { className: "phi-search-box__magnifier", children: _jsx(PhiButtonControl, { type: "text", shape: "circle", ariaLabel: labels.title, ariaExpanded: open != null, icon: _jsx(PhiIcon, { name: "search", size: "inherit" }), size: config?.size, readOnly: !interactive, ...(interactive && !hydrated && config?.action ? { href: config.action } : { onClick: pressMagnifier }) }) }));
|
|
111
133
|
return (_jsxs("div", { ref: rootRef, className: `phi-search-box phi-search-box--${variant}`, children: [variant === "icon-only" ? null : _jsx("span", { className: "phi-search-box__field", children: form() }), variant === "input" ? null : magnifier, open?.kind === "row"
|
|
112
134
|
? createPortal(_jsxs("div", { className: open.closing ? "phi-search-box__row phi-search-box__row--closing" : "phi-search-box__row", onAnimationEnd: finishClosing, children: [form({ autoFocus: true }), _jsx(PhiButtonControl, { type: "text", shape: "circle", ariaLabel: labels.closeLabel, icon: _jsx(PhiIcon, { name: "close", size: "inherit" }), onClick: close })] }), open.region)
|
|
@@ -714,6 +714,19 @@ function mergeThemeWordmarkParts(theme, parts) {
|
|
|
714
714
|
*/
|
|
715
715
|
return mergeThemeWordmark(theme, { parts: hasText ? parts.map((part) => ({ ...part })) : null });
|
|
716
716
|
}
|
|
717
|
+
/**
|
|
718
|
+
* A part's colour with one mode's set or cleared and the other mode's kept. Nothing left in either
|
|
719
|
+
* mode is no colour at all, so the part goes back to the colour around it.
|
|
720
|
+
*/
|
|
721
|
+
function mergeWordmarkPartColor(color, mode, next) {
|
|
722
|
+
const merged = {};
|
|
723
|
+
for (const key of ["light", "dark"]) {
|
|
724
|
+
const value = key === mode ? next : color?.[key];
|
|
725
|
+
if (value)
|
|
726
|
+
merged[key] = value;
|
|
727
|
+
}
|
|
728
|
+
return Object.keys(merged).length > 0 ? merged : null;
|
|
729
|
+
}
|
|
717
730
|
/** Whether the Brand draws a name at all. Off is stated; on is simply the Wordmark without the word. */
|
|
718
731
|
function mergeThemeWordmarkShows(theme, shows) {
|
|
719
732
|
const wordmark = theme.brand?.wordmark ?? {};
|
|
@@ -1554,7 +1567,7 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1554
1567
|
/*
|
|
1555
1568
|
* A Wordmark part picks from what every colour field of the Theme offers: the draft's custom colours in
|
|
1556
1569
|
* the mode being authored, the primary and text ladders, then the fixed palettes. It stores the colour,
|
|
1557
|
-
* not the role -- the Theme is where those roles are set.
|
|
1570
|
+
* not the role -- the Theme is where those roles are set -- and stores it for the mode being authored.
|
|
1558
1571
|
*/
|
|
1559
1572
|
const wordmarkCustomColors = useMemo(() => {
|
|
1560
1573
|
const palette = resolveThemeCustomPalette(state.draft, resolveThemePayloadPreset(state.draft, themePresets), mode);
|
|
@@ -1691,7 +1704,11 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1691
1704
|
? _jsxs(_Fragment, { children: ["The Site name as it is set. One part per colour: a two-tone name is one word written in two. With no part at all the frame shows ", fallbackWordmark, "."] })
|
|
1692
1705
|
: _jsx(_Fragment, { children: "The Brand is the Logo alone. The name is not drawn, and neither is the Eyebrow above it." }) }), _jsx(PhiSwitchControl, { label: "Show name", checked: showsWordmark, checkedLabel: "On", uncheckedLabel: "Off", onChange: (checked) => publishDraft(mergeThemeWordmarkShows(state.draft, checked)) }), showsWordmark && (_jsxs(_Fragment, { children: [editableWordmarkParts.map((part, index) => (_jsx(PhiLabeledControl, { label: `Part #${index + 1}`, fill: true, children: _jsxs(PhiFlexControl, { gap: clientToken.paddingXXS, align: "center", style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTextControl, { value: part.text, placeholder: index === 0 ? fallbackWordmark : "Part", ariaLabel: `Wordmark part ${index + 1}`, allowClear: false, onChange: (next) => updateWordmarkPart(index, { text: next ?? "" }) }), _jsx(PhiColorControl, { mode: "single", allowClear: true,
|
|
1693
1706
|
// A part's row is narrow: the swatch says the colour, the value would overflow it.
|
|
1694
|
-
showText: false,
|
|
1707
|
+
showText: false,
|
|
1708
|
+
// The colour of the mode being authored; the other mode keeps its own.
|
|
1709
|
+
value: part.color?.[mode] ?? null, presets: wordmarkColorPresets, onChange: (next) => updateWordmarkPart(index, {
|
|
1710
|
+
color: mergeWordmarkPartColor(part.color, mode, next),
|
|
1711
|
+
}) }), _jsx(PhiButtonControl, { type: "text", size: "small", danger: true, disabled: wordmarkParts.length === 0, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: "Remove this part of the Wordmark", onClick: () => {
|
|
1695
1712
|
setWordmarkPartKeys((current) => ({
|
|
1696
1713
|
...current,
|
|
1697
1714
|
keys: current.keys.filter((_, at) => at !== index),
|
|
@@ -22,6 +22,7 @@ export declare function getPhiThreadPageLabels(options: PhiGlobalTranslatorOptio
|
|
|
22
22
|
unread: string;
|
|
23
23
|
open: string;
|
|
24
24
|
archived: string;
|
|
25
|
+
locked: string;
|
|
25
26
|
};
|
|
26
27
|
kinds: {
|
|
27
28
|
direct: string;
|
|
@@ -41,6 +42,11 @@ export declare function getPhiThreadPageLabels(options: PhiGlobalTranslatorOptio
|
|
|
41
42
|
archiveConfirmTitle: string;
|
|
42
43
|
archiveConfirmText: string;
|
|
43
44
|
archiveConfirmOk: string;
|
|
45
|
+
lock: string;
|
|
46
|
+
unlock: string;
|
|
47
|
+
lockConfirmTitle: string;
|
|
48
|
+
lockConfirmText: string;
|
|
49
|
+
lockConfirmOk: string;
|
|
44
50
|
confirmCancel: string;
|
|
45
51
|
};
|
|
46
52
|
}>;
|
|
@@ -40,6 +40,7 @@ const PHI_THREAD_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_THREADS_RUN
|
|
|
40
40
|
state_unread: "New",
|
|
41
41
|
state_open: "Open",
|
|
42
42
|
state_archived: "Archived",
|
|
43
|
+
state_locked: "Locked",
|
|
43
44
|
kind_direct: "Direct",
|
|
44
45
|
kind_group: "Group",
|
|
45
46
|
kind_cross_group: "Between groups",
|
|
@@ -57,6 +58,15 @@ const PHI_THREAD_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_THREADS_RUN
|
|
|
57
58
|
archive_confirm_title: "Archive this conversation?",
|
|
58
59
|
archive_confirm_text: definePhiMessageLabel("It closes for everyone in it. Anyone can reopen it later."),
|
|
59
60
|
archive_confirm_ok: "Archive",
|
|
61
|
+
/*
|
|
62
|
+
* Locking asks first for the reason archiving does: it stops everyone in the conversation from
|
|
63
|
+
* writing, not only the one who pressed it. Unlocking is the way back and asks nothing.
|
|
64
|
+
*/
|
|
65
|
+
lock_label: "Lock",
|
|
66
|
+
unlock_label: "Unlock",
|
|
67
|
+
lock_confirm_title: "Lock this conversation?",
|
|
68
|
+
lock_confirm_text: definePhiMessageLabel("Nobody can write in it until it is unlocked. Everything said so far stays readable."),
|
|
69
|
+
lock_confirm_ok: "Lock",
|
|
60
70
|
confirm_cancel: "Cancel",
|
|
61
71
|
},
|
|
62
72
|
});
|
|
@@ -84,6 +94,7 @@ export async function getPhiThreadPageLabels(options) {
|
|
|
84
94
|
unread: labels.state_unread,
|
|
85
95
|
open: labels.state_open,
|
|
86
96
|
archived: labels.state_archived,
|
|
97
|
+
locked: labels.state_locked,
|
|
87
98
|
},
|
|
88
99
|
kinds: {
|
|
89
100
|
direct: labels.kind_direct,
|
|
@@ -103,6 +114,11 @@ export async function getPhiThreadPageLabels(options) {
|
|
|
103
114
|
archiveConfirmTitle: labels.archive_confirm_title,
|
|
104
115
|
archiveConfirmText: labels.archive_confirm_text,
|
|
105
116
|
archiveConfirmOk: labels.archive_confirm_ok,
|
|
117
|
+
lock: labels.lock_label,
|
|
118
|
+
unlock: labels.unlock_label,
|
|
119
|
+
lockConfirmTitle: labels.lock_confirm_title,
|
|
120
|
+
lockConfirmText: labels.lock_confirm_text,
|
|
121
|
+
lockConfirmOk: labels.lock_confirm_ok,
|
|
106
122
|
confirmCancel: labels.confirm_cancel,
|
|
107
123
|
},
|
|
108
124
|
};
|
|
@@ -396,8 +396,9 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
|
|
|
396
396
|
unread: labels.states.unread,
|
|
397
397
|
open: labels.states.open,
|
|
398
398
|
archived: labels.states.archived,
|
|
399
|
+
locked: labels.states.locked,
|
|
399
400
|
},
|
|
400
|
-
tagColorMap: { unread: "processing", open: "default", archived: "default" },
|
|
401
|
+
tagColorMap: { unread: "processing", open: "default", archived: "default", locked: "warning" },
|
|
401
402
|
},
|
|
402
403
|
{
|
|
403
404
|
key: "latestMessageAt",
|
|
@@ -496,6 +497,28 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
|
|
|
496
497
|
icon: "antd:rollback",
|
|
497
498
|
display: "icon",
|
|
498
499
|
execution: "provider",
|
|
500
|
+
}, {
|
|
501
|
+
/*
|
|
502
|
+
* The lock, beside the archive and drawn the same way: one of the two is on a row, the
|
|
503
|
+
* closed lock where it is open and the open lock where it is closed.
|
|
504
|
+
*/
|
|
505
|
+
key: "lock",
|
|
506
|
+
label: labels.actions.lock,
|
|
507
|
+
icon: "antd:lock",
|
|
508
|
+
display: "icon",
|
|
509
|
+
execution: "provider",
|
|
510
|
+
confirm: {
|
|
511
|
+
title: labels.actions.lockConfirmTitle,
|
|
512
|
+
description: labels.actions.lockConfirmText,
|
|
513
|
+
okText: labels.actions.lockConfirmOk,
|
|
514
|
+
cancelText: labels.actions.confirmCancel,
|
|
515
|
+
},
|
|
516
|
+
}, {
|
|
517
|
+
key: "unlock",
|
|
518
|
+
label: labels.actions.unlock,
|
|
519
|
+
icon: "antd:unlock",
|
|
520
|
+
display: "icon",
|
|
521
|
+
execution: "provider",
|
|
499
522
|
}],
|
|
500
523
|
},
|
|
501
524
|
},
|
package/styles/layout.css
CHANGED
|
@@ -486,6 +486,107 @@
|
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
+
/*
|
|
490
|
+
* A block's geometry per profile (LAYOUTING.md, "Block geometry per profile";
|
|
491
|
+
* design/RESPONSIVE_BLOCK_GEOMETRY.md).
|
|
492
|
+
*
|
|
493
|
+
* The box that offers a block its room is the `phi-slot` container -- the Grid's cell, a Flex's or a
|
|
494
|
+
* Three Column's own box, an anchored slot, a Masonry column, a Region's content -- and only where the
|
|
495
|
+
* block standing in it names a value per profile, which the box states with `data-phi-slot-container`.
|
|
496
|
+
* The block's frame and a Layout's inner box name the declarations they hand over in
|
|
497
|
+
* `data-phi-block-profiled` and write all three answers as `--phi-block-<declaration>`, `-medium` and
|
|
498
|
+
* `-wide`; these rules pick one by the width of the nearest `phi-slot` container. Nothing measures, so
|
|
499
|
+
* the server's markup already stands where it stays. A box writes a declaration it hands over nowhere
|
|
500
|
+
* inline, because an inline declaration beats every `@container` rule.
|
|
501
|
+
*
|
|
502
|
+
* Plain attribute selectors rather than `:where()`: they have to beat the zero-specificity fill rules
|
|
503
|
+
* above, which would otherwise size a profiled frame.
|
|
504
|
+
*/
|
|
505
|
+
[data-phi-slot-container] {
|
|
506
|
+
container: phi-slot / inline-size;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
[data-phi-block-profiled~="width"] {
|
|
510
|
+
width: var(--phi-block-width);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
[data-phi-block-profiled~="height"] {
|
|
514
|
+
height: var(--phi-block-height);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
[data-phi-block-profiled~="min-width"] {
|
|
518
|
+
min-width: var(--phi-block-min-width);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
[data-phi-block-profiled~="min-height"] {
|
|
522
|
+
min-height: var(--phi-block-min-height);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
[data-phi-block-profiled~="max-width"] {
|
|
526
|
+
max-width: var(--phi-block-max-width);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
[data-phi-block-profiled~="max-height"] {
|
|
530
|
+
max-height: var(--phi-block-max-height);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/*
|
|
534
|
+
* The same numbers as `PHI_BLOCK_GEOMETRY_RESPONSIVE_MIN_WIDTH` (helpers/block-geometry-profiles.ts) --
|
|
535
|
+
* the Grid's pair, so `compact | medium | wide` means one thing across the tree -- held together by
|
|
536
|
+
* `validate-container-breakpoint-contracts.ts`.
|
|
537
|
+
*/
|
|
538
|
+
@container phi-slot (min-width: 377px) {
|
|
539
|
+
[data-phi-block-profiled~="width"] {
|
|
540
|
+
width: var(--phi-block-width-medium);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
[data-phi-block-profiled~="height"] {
|
|
544
|
+
height: var(--phi-block-height-medium);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
[data-phi-block-profiled~="min-width"] {
|
|
548
|
+
min-width: var(--phi-block-min-width-medium);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
[data-phi-block-profiled~="min-height"] {
|
|
552
|
+
min-height: var(--phi-block-min-height-medium);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
[data-phi-block-profiled~="max-width"] {
|
|
556
|
+
max-width: var(--phi-block-max-width-medium);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
[data-phi-block-profiled~="max-height"] {
|
|
560
|
+
max-height: var(--phi-block-max-height-medium);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
@container phi-slot (min-width: 610px) {
|
|
565
|
+
[data-phi-block-profiled~="width"] {
|
|
566
|
+
width: var(--phi-block-width-wide);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
[data-phi-block-profiled~="height"] {
|
|
570
|
+
height: var(--phi-block-height-wide);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
[data-phi-block-profiled~="min-width"] {
|
|
574
|
+
min-width: var(--phi-block-min-width-wide);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
[data-phi-block-profiled~="min-height"] {
|
|
578
|
+
min-height: var(--phi-block-min-height-wide);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
[data-phi-block-profiled~="max-width"] {
|
|
582
|
+
max-width: var(--phi-block-max-width-wide);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
[data-phi-block-profiled~="max-height"] {
|
|
586
|
+
max-height: var(--phi-block-max-height-wide);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
489
590
|
/*
|
|
490
591
|
* A Surface whose content is drawn in another mode (`tone`, LAYOUTING.md "Surface tone").
|
|
491
592
|
*
|
package/styles/root.css
CHANGED
|
@@ -99,7 +99,8 @@ samp {
|
|
|
99
99
|
rotateY(var(--phi-effects-viewport-rotate-y, 0deg))
|
|
100
100
|
rotateZ(var(--phi-effects-viewport-rotate-z, 0deg))
|
|
101
101
|
scale(var(--phi-effects-viewport-scale, 1));
|
|
102
|
-
|
|
102
|
+
/* `backwards` where the entrance ends at rest (helpers/renderable-block-effects.ts), so it lets go when done. */
|
|
103
|
+
animation-fill-mode: var(--phi-effects-animation-fill, both);
|
|
103
104
|
transform: var(--phi-effects-viewport-transform);
|
|
104
105
|
will-change: opacity, transform;
|
|
105
106
|
}
|
package/types/cms-config.d.ts
CHANGED
|
@@ -181,10 +181,14 @@ export type PhiCmsSplitCardLayoutConfig = PhiCmsLayerBase & {
|
|
|
181
181
|
/** The golden ratio the other way round: the left card the larger one. */
|
|
182
182
|
swapRatio?: boolean;
|
|
183
183
|
};
|
|
184
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Children in columns at their own heights: how many columns at each width, the gap between them, and
|
|
186
|
+
* `anchor`, where a child narrower than its column stands in it (inline axis only).
|
|
187
|
+
*/
|
|
185
188
|
export type PhiCmsMasonryLayoutConfig = PhiCmsLayerBase & {
|
|
186
189
|
columns?: PhiResponsiveValue<number>;
|
|
187
190
|
gap?: CSSProperties["gap"];
|
|
191
|
+
anchor?: PhiRenderableBlockAnchor;
|
|
188
192
|
};
|
|
189
193
|
export declare function parsePhiCmsContentLayoutConfig(config: Record<string, unknown>): PhiCmsContentLayoutConfig;
|
|
190
194
|
export declare function parsePhiCmsFlexLayoutConfig(config: Record<string, unknown>): PhiCmsFlexLayoutConfig;
|
package/types/cms-config.js
CHANGED
|
@@ -247,6 +247,7 @@ export function parsePhiCmsMasonryLayoutConfig(config) {
|
|
|
247
247
|
...readLayoutPadding(reader),
|
|
248
248
|
columns: readGridResponsiveCount(reader, "columns", "a Grid column count", isPhiGridColumnCount),
|
|
249
249
|
gap: readCssSizeField(reader, "gap"),
|
|
250
|
+
anchor: readLayoutAnchor(reader),
|
|
250
251
|
}, resolvePhiLayoutDefaults("masonry"));
|
|
251
252
|
}
|
|
252
253
|
export function parsePhiCmsStackLayoutConfig(config) {
|
|
@@ -202,6 +202,18 @@ export type PhiCmsNavigationSurfaceDescriptor = {
|
|
|
202
202
|
*/
|
|
203
203
|
anchors?: Partial<Record<PhiCmsNavigationAnchor, PhiCmsNavigationAnchorPlacement>>;
|
|
204
204
|
};
|
|
205
|
+
/**
|
|
206
|
+
* An address outside the Site a Module's navigation entry leads to.
|
|
207
|
+
*
|
|
208
|
+
* The same shape the Builder stores for a Site's own external link (`PhiCmsNavigationCustomItem`), with
|
|
209
|
+
* `newTab` beside `href` because a descriptor has no item around it to carry it. Only `https:` is
|
|
210
|
+
* accepted; the catalog refuses anything else when it is compiled.
|
|
211
|
+
*/
|
|
212
|
+
export type PhiCmsNavigationExternalTarget = {
|
|
213
|
+
kind: "external";
|
|
214
|
+
href: string;
|
|
215
|
+
newTab?: boolean;
|
|
216
|
+
};
|
|
205
217
|
export type PhiCmsNavigationInjectionItemDescriptor = {
|
|
206
218
|
itemKey: string;
|
|
207
219
|
label: PhiCmsNavigationLabel;
|
|
@@ -213,6 +225,11 @@ export type PhiCmsNavigationInjectionItemDescriptor = {
|
|
|
213
225
|
*/
|
|
214
226
|
overlayPresetKey?: string;
|
|
215
227
|
overlayNodeKey?: string;
|
|
228
|
+
/**
|
|
229
|
+
* An address outside the Site. Mutually exclusive with `routePresetKey` and the Overlay keys; resolved
|
|
230
|
+
* like a Site's stored external link, so every navigation surface renders it the same way.
|
|
231
|
+
*/
|
|
232
|
+
target?: PhiCmsNavigationExternalTarget;
|
|
216
233
|
accessPolicy?: PhiViewerAccessPolicy;
|
|
217
234
|
/** What this entry sends when it is chosen; see the base item descriptor. */
|
|
218
235
|
signalRoutes?: {
|