@phis/ui 0.4.15 → 0.4.16
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 +2 -1
- package/components/regions/clients/cms-region-container-client.d.ts +3 -1
- package/components/regions/clients/cms-region-container-client.js +2 -1
- 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 +16 -1
- package/components/regions/phi-cms-region-shell.js +39 -10
- package/components/regions/phi-cms-region-static.d.ts +3 -1
- package/components/regions/phi-cms-region-static.js +2 -1
- package/helpers/renderable-block-defaults.js +1 -0
- package/helpers/renderable-block-serialization.js +7 -1
- package/package.json +2 -2
- package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +13 -0
- package/plugins/runtime-modules/builder/page-meta-form.js +11 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +15 -1
- package/styles/root.css +2 -0
- package/styles/shell.css +41 -18
- package/types/renderable-block.d.ts +5 -0
|
@@ -11,6 +11,7 @@ import { PhiFlexVerticalLayout } from "../layouts/phi-flex-vertical-layout";
|
|
|
11
11
|
import { resolvePhiSlotChildSizingForConfig, } from "../../plugins/runtime/slot-size-policy";
|
|
12
12
|
import { PhiSlotChildFrame } from "../../plugins/runtime/phi-slot-child-frame";
|
|
13
13
|
import { PhiCmsRegionContainer } from "../regions/phi-cms-region-container";
|
|
14
|
+
import { phiCmsRegionRootLayoutPaintsGround } from "../regions/phi-cms-region-shell";
|
|
14
15
|
import { PhiCmsRenderErrorBoundary } from "./phi-cms-render-error-boundary";
|
|
15
16
|
import { PhiCmsRenderDiagnostic } from "./phi-cms-render-diagnostic";
|
|
16
17
|
import { resolvePhiRuntimeLayoutPluginByTypeKey, resolvePhiRuntimeLayoutPluginConfigParser, } from "../../plugins/runtime/layout-plugin-resolution";
|
|
@@ -792,7 +793,7 @@ export async function PhiCmsLayoutRenderer({ tree, runtime, regionClassName, reg
|
|
|
792
793
|
layoutPluginsByType.get(resolveLayoutRegistryType(root.widgetType))?.runtimeSignals != null,
|
|
793
794
|
})
|
|
794
795
|
: null;
|
|
795
|
-
return (_jsx(PhiCmsRegionContainer, { className: regionClassName, regionKey: regionKey, regionType: region.regionType, config: region.config, pageScope: resolvePhiCmsRegionPageScope(readPhiCmsRegionPageScope(regionKey, region.config), links, runtime.site.availableLocales.map((option) => option.code)), shellTheme: runtime.site.theme?.shell, previewMode: root?.config.renderMode === "preview", runtime: runtime, signalParticipant: signalParticipants.has(createPhiSignalAddress("region", regionKey)), children: renderedRoot }, `region-${region.id}`));
|
|
796
|
+
return (_jsx(PhiCmsRegionContainer, { className: regionClassName, regionKey: regionKey, regionType: region.regionType, config: region.config, pageScope: resolvePhiCmsRegionPageScope(readPhiCmsRegionPageScope(regionKey, region.config), links, runtime.site.availableLocales.map((option) => option.code)), shellTheme: runtime.site.theme?.shell, previewMode: root?.config.renderMode === "preview", rootPaintsGround: phiCmsRegionRootLayoutPaintsGround(root?.config), runtime: runtime, signalParticipant: signalParticipants.has(createPhiSignalAddress("region", regionKey)), children: renderedRoot }, `region-${region.id}`));
|
|
796
797
|
});
|
|
797
798
|
if (renderedRegions.length === 1) {
|
|
798
799
|
return renderedRegions[0];
|
|
@@ -18,6 +18,8 @@ type PhiCmsRegionContainerClientProps = {
|
|
|
18
18
|
pageScope?: PhiCmsResolvedRegionPageScope | null;
|
|
19
19
|
/** The Site's locales, handed over only where the Region has a Page scope to ask. */
|
|
20
20
|
availableLocales?: string[];
|
|
21
|
+
/** Whether the Region's top Layout paints a ground of its own (`phiCmsRegionRootLayoutPaintsGround`). */
|
|
22
|
+
rootPaintsGround?: boolean;
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* A Region that stays alive after it has rendered: it takes signals, runs effects, collapses, or moves
|
|
@@ -25,5 +27,5 @@ type PhiCmsRegionContainerClientProps = {
|
|
|
25
27
|
* fed with the config merged with the live runtime state and painted in the live colour mode. What is
|
|
26
28
|
* left here is what only a live Region has.
|
|
27
29
|
*/
|
|
28
|
-
export declare function PhiCmsRegionContainerClient({ children, className, regionKey, config: initialConfig, shellTheme, style, regionType, previewMode, runtime, routeScope, pageScope: resolvedPageScope, availableLocales, }: PhiCmsRegionContainerClientProps): import("react").JSX.Element | null;
|
|
30
|
+
export declare function PhiCmsRegionContainerClient({ children, className, regionKey, config: initialConfig, shellTheme, style, regionType, previewMode, runtime, routeScope, pageScope: resolvedPageScope, availableLocales, rootPaintsGround, }: PhiCmsRegionContainerClientProps): import("react").JSX.Element | null;
|
|
29
31
|
export {};
|
|
@@ -32,7 +32,7 @@ import { usePhiRegionRevealed, usePhiShellHeaderTopRoom } from "./use-phi-region
|
|
|
32
32
|
* fed with the config merged with the live runtime state and painted in the live colour mode. What is
|
|
33
33
|
* left here is what only a live Region has.
|
|
34
34
|
*/
|
|
35
|
-
export function PhiCmsRegionContainerClient({ children, className, regionKey, config: initialConfig, shellTheme, style, regionType, previewMode = false, runtime, routeScope, pageScope: resolvedPageScope = null, availableLocales, }) {
|
|
35
|
+
export function PhiCmsRegionContainerClient({ children, className, regionKey, config: initialConfig, shellTheme, style, regionType, previewMode = false, runtime, routeScope, pageScope: resolvedPageScope = null, availableLocales, rootPaintsGround = false, }) {
|
|
36
36
|
const { mode: liveThemeMode, token } = usePhiConfig();
|
|
37
37
|
const receiver = createPhiRenderableBlockReceiver("region", regionKey);
|
|
38
38
|
const anchorRef = usePhiVisualAnchor(receiver);
|
|
@@ -142,6 +142,7 @@ export function PhiCmsRegionContainerClient({ children, className, regionKey, co
|
|
|
142
142
|
regionType,
|
|
143
143
|
className,
|
|
144
144
|
style,
|
|
145
|
+
rootPaintsGround,
|
|
145
146
|
});
|
|
146
147
|
if (shell == null) {
|
|
147
148
|
return null;
|
|
@@ -15,6 +15,8 @@ export type PhiCmsRegionContainerProps = {
|
|
|
15
15
|
signalParticipant?: boolean;
|
|
16
16
|
/** The Pages this Region stands on, resolved for this render; null where it stands on every Page. */
|
|
17
17
|
pageScope?: PhiCmsResolvedRegionPageScope | null;
|
|
18
|
+
/** Whether the Region's top Layout paints a ground of its own (`phiCmsRegionRootLayoutPaintsGround`). */
|
|
19
|
+
rootPaintsGround?: boolean;
|
|
18
20
|
};
|
|
19
|
-
export declare function PhiCmsRegionContainer({ children, className, regionKey, config, shellTheme, style, regionType, previewMode, runtime, signalParticipant, pageScope, }: PhiCmsRegionContainerProps): import("react").JSX.Element;
|
|
21
|
+
export declare function PhiCmsRegionContainer({ children, className, regionKey, config, shellTheme, style, regionType, previewMode, runtime, signalParticipant, pageScope, rootPaintsGround, }: PhiCmsRegionContainerProps): import("react").JSX.Element;
|
|
20
22
|
export {};
|
|
@@ -9,7 +9,7 @@ import { PhiRuntimeModuleRenderClientHost } from "../runtime/runtime-module-rend
|
|
|
9
9
|
import { PhiRuntimeRenderClientType } from "../../constants/runtime-render-client-types";
|
|
10
10
|
import { resolvePhiBackgroundMotion } from "../widgets/config/background";
|
|
11
11
|
import { readPhiCmsRegionReveal } from "../../helpers/region-page-scope";
|
|
12
|
-
export function PhiCmsRegionContainer({ children, className, regionKey, config, shellTheme, style, regionType, previewMode = false, runtime, signalParticipant = false, pageScope = null, }) {
|
|
12
|
+
export function PhiCmsRegionContainer({ children, className, regionKey, config, shellTheme, style, regionType, previewMode = false, runtime, signalParticipant = false, pageScope = null, rootPaintsGround = false, }) {
|
|
13
13
|
const routeScope = isPhiCmsPageOwnedRegion(regionKey) ? "page" : "area";
|
|
14
14
|
const effectsConfig = config?.effects == null ? undefined : { effects: config.effects };
|
|
15
15
|
const effectsAttributes = resolveRenderableBlockEffectsAttributes(effectsConfig);
|
|
@@ -32,7 +32,7 @@ export function PhiCmsRegionContainer({ children, className, regionKey, config,
|
|
|
32
32
|
requiresEffectsObserver ||
|
|
33
33
|
resolvePhiBackgroundMotion(config?.surface?.background) != null;
|
|
34
34
|
if (!requiresClientEnhancement) {
|
|
35
|
-
return (_jsx(PhiCmsRegionStatic, { className: className, regionKey: regionKey, config: config, shellTheme: shellTheme, style: style, regionType: regionType, previewMode: previewMode, children: children }));
|
|
35
|
+
return (_jsx(PhiCmsRegionStatic, { className: className, regionKey: regionKey, config: config, shellTheme: shellTheme, style: style, regionType: regionType, previewMode: previewMode, rootPaintsGround: rootPaintsGround, children: children }));
|
|
36
36
|
}
|
|
37
37
|
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.RegionContainerEnhancer, componentProps: {
|
|
38
38
|
children,
|
|
@@ -43,6 +43,7 @@ export function PhiCmsRegionContainer({ children, className, regionKey, config,
|
|
|
43
43
|
style,
|
|
44
44
|
regionType,
|
|
45
45
|
previewMode,
|
|
46
|
+
rootPaintsGround,
|
|
46
47
|
runtime: {
|
|
47
48
|
siteKey: runtime.site.key,
|
|
48
49
|
publicUrl: runtime.site.publicUrl ?? null,
|
|
@@ -38,6 +38,7 @@ export type PhiCmsRegionShellAttributes = PhiRenderableBlockEffectsAttributes &
|
|
|
38
38
|
"data-phi-region-key": PhiCmsRegionKey;
|
|
39
39
|
"data-phi-region-type": number | undefined;
|
|
40
40
|
"data-phi-shell-chrome": "true" | undefined;
|
|
41
|
+
"data-phi-shell-own-ground": "band" | "box" | undefined;
|
|
41
42
|
"data-phi-renderable-block": "true";
|
|
42
43
|
"data-phi-signal-receiver": string;
|
|
43
44
|
"data-phi-block-visibility": string;
|
|
@@ -63,6 +64,13 @@ export type PhiCmsRegionShellInput = {
|
|
|
63
64
|
regionType?: number;
|
|
64
65
|
className?: string;
|
|
65
66
|
style?: CSSProperties;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the Layout at the top of this Region paints a ground of its own
|
|
69
|
+
* (`phiCmsRegionRootLayoutPaintsGround`). Such a band brings its own chrome -- a floating Header bar is
|
|
70
|
+
* the case it was made for -- so it neither paints the Theme's Chrome Overlay itself nor lets its
|
|
71
|
+
* family's pane paint one behind it (SHELL.md "A band with a ground of its own").
|
|
72
|
+
*/
|
|
73
|
+
rootPaintsGround?: boolean;
|
|
66
74
|
};
|
|
67
75
|
export type PhiCmsRegionShell = {
|
|
68
76
|
family: PhiCmsRegionShellFamily;
|
|
@@ -118,5 +126,12 @@ export declare function phiCmsRegionFooterSticks(regionKey: PhiCmsRegionKey, con
|
|
|
118
126
|
* The Region's shell, or null where the Region renders nothing: hidden, or collapsed in a preview.
|
|
119
127
|
* `header_bottom` is exempt from the preview collapse because the Page, not the Area, owns its content.
|
|
120
128
|
*/
|
|
121
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Whether a Region's top Layout paints a ground of its own: a tone, or a Background that paints something
|
|
131
|
+
* in either mode. Only the top Layout counts -- a Card or a Button somewhere inside a Header is content,
|
|
132
|
+
* not the band's chrome. "Paints" is `phiBackgroundWidgetConfigPaintsGround`'s answer, so the empty
|
|
133
|
+
* Background record the Builder stores on every box it has opened is no ground.
|
|
134
|
+
*/
|
|
135
|
+
export declare function phiCmsRegionRootLayoutPaintsGround(rootConfig: unknown): boolean;
|
|
136
|
+
export declare function resolvePhiCmsRegionShell({ regionKey, config, shellTheme, paint, animatesBackground, previewMode, regionType, className, style, rootPaintsGround, }: PhiCmsRegionShellInput): PhiCmsRegionShell | null;
|
|
122
137
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolvePhiSurfaceToneClassName } from "../../types/surface";
|
|
1
|
+
import { readPhiSurface, resolvePhiSurfaceToneClassName } from "../../types/surface";
|
|
2
2
|
import { composePhiModePaint, resolvePhiModeValue } from "../../helpers/mode-paint";
|
|
3
3
|
import { PHI_THEME_BORDER_LINE, resolvePhiBorderWidgetStyle } from "../../helpers/border-widget-style";
|
|
4
4
|
import { hasPhiFlag } from "../../helpers/flags";
|
|
@@ -129,7 +129,22 @@ function resolveRegionBorderLine(surface) {
|
|
|
129
129
|
* The Region's shell, or null where the Region renders nothing: hidden, or collapsed in a preview.
|
|
130
130
|
* `header_bottom` is exempt from the preview collapse because the Page, not the Area, owns its content.
|
|
131
131
|
*/
|
|
132
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Whether a Region's top Layout paints a ground of its own: a tone, or a Background that paints something
|
|
134
|
+
* in either mode. Only the top Layout counts -- a Card or a Button somewhere inside a Header is content,
|
|
135
|
+
* not the band's chrome. "Paints" is `phiBackgroundWidgetConfigPaintsGround`'s answer, so the empty
|
|
136
|
+
* Background record the Builder stores on every box it has opened is no ground.
|
|
137
|
+
*/
|
|
138
|
+
export function phiCmsRegionRootLayoutPaintsGround(rootConfig) {
|
|
139
|
+
const surface = readPhiSurface(rootConfig != null && typeof rootConfig === "object" ? rootConfig.surface : null);
|
|
140
|
+
if (!surface) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
return resolvePhiSurfaceToneClassName(surface.tone) != null
|
|
144
|
+
|| phiBackgroundWidgetConfigPaintsGround(surface.background ?? null)
|
|
145
|
+
|| phiBackgroundWidgetConfigPaintsGround(surface.backgroundDark ?? null);
|
|
146
|
+
}
|
|
147
|
+
export function resolvePhiCmsRegionShell({ regionKey, config, shellTheme, paint, animatesBackground = false, previewMode = false, regionType, className, style, rootPaintsGround = false, }) {
|
|
133
148
|
const visibility = config.visibility ?? "visible";
|
|
134
149
|
const enabled = config.enabled ?? true;
|
|
135
150
|
if (visibility === "hidden" ||
|
|
@@ -292,14 +307,16 @@ export function resolvePhiCmsRegionShell({ regionKey, config, shellTheme, paint,
|
|
|
292
307
|
* the stored one: the Builder persists an empty Background record for every Region an author has ever
|
|
293
308
|
* opened, and the raw value is never null for those.
|
|
294
309
|
*/
|
|
295
|
-
const usesShellChromeOverlay =
|
|
296
|
-
?
|
|
297
|
-
:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
310
|
+
const usesShellChromeOverlay = rootPaintsGround
|
|
311
|
+
? false
|
|
312
|
+
: themeGround
|
|
313
|
+
? themeGroundIsShellChrome
|
|
314
|
+
: !toneGround && phiRegionUsesShellChromeOverlay({
|
|
315
|
+
regionKey,
|
|
316
|
+
backgroundConfig,
|
|
317
|
+
pane: shellPane,
|
|
318
|
+
grounds: [chrome.light.background, chrome.dark.background],
|
|
319
|
+
});
|
|
303
320
|
/*
|
|
304
321
|
* The ground. Published, it is the pair of custom properties `shell.css` paints from, because it may
|
|
305
322
|
* be a colour or a gradient and only CSS can tell which without guessing; nothing inline may name a
|
|
@@ -441,6 +458,18 @@ export function resolvePhiCmsRegionShell({ regionKey, config, shellTheme, paint,
|
|
|
441
458
|
"data-phi-region-key": regionKey,
|
|
442
459
|
"data-phi-region-type": regionType,
|
|
443
460
|
"data-phi-shell-chrome": usesShellChromeOverlay ? "true" : undefined,
|
|
461
|
+
/*
|
|
462
|
+
* A band with a ground of its own (SHELL.md): `band` where the Region paints it -- a tone, or an
|
|
463
|
+
* authored Background other than the Theme's Overlay taken as the Shell's -- and `box` where its top
|
|
464
|
+
* Layout does, which is a bar inside the band rather than the band. `shell.css` lets the family's
|
|
465
|
+
* pane step aside for either, and for a `box` takes the pane's Shadow away too: the frame's edge
|
|
466
|
+
* would run the full width behind a bar that is narrower.
|
|
467
|
+
*/
|
|
468
|
+
"data-phi-shell-own-ground": rootPaintsGround
|
|
469
|
+
? "box"
|
|
470
|
+
: resolvePhiSurfaceToneClassName(surface?.tone) != null || (backgroundConfig != null && !themeGroundIsShellChrome)
|
|
471
|
+
? "band"
|
|
472
|
+
: undefined,
|
|
444
473
|
"data-phi-renderable-block": "true",
|
|
445
474
|
"data-phi-signal-receiver": createPhiSignalAddress("region", regionKey),
|
|
446
475
|
"data-phi-block-visibility": visibility,
|
|
@@ -10,10 +10,12 @@ export type PhiCmsRegionStaticProps = {
|
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
regionType?: number;
|
|
12
12
|
previewMode?: boolean;
|
|
13
|
+
/** Whether the Region's top Layout paints a ground of its own (`phiCmsRegionRootLayoutPaintsGround`). */
|
|
14
|
+
rootPaintsGround?: boolean;
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* A Region with nothing to do after it has rendered. Everything it draws comes from the Region-shell
|
|
16
18
|
* resolver it shares with the client renderer; it does not know the colour mode, so it publishes both
|
|
17
19
|
* and lets `shell.css` switch them.
|
|
18
20
|
*/
|
|
19
|
-
export declare function PhiCmsRegionStatic({ children, className, regionKey, config, shellTheme, style, regionType, previewMode, }: PhiCmsRegionStaticProps): import("react").JSX.Element | null;
|
|
21
|
+
export declare function PhiCmsRegionStatic({ children, className, regionKey, config, shellTheme, style, regionType, previewMode, rootPaintsGround, }: PhiCmsRegionStaticProps): import("react").JSX.Element | null;
|
|
@@ -7,7 +7,7 @@ import { PhiSurfaceTone } from "../surface/phi-surface-tone";
|
|
|
7
7
|
* resolver it shares with the client renderer; it does not know the colour mode, so it publishes both
|
|
8
8
|
* and lets `shell.css` switch them.
|
|
9
9
|
*/
|
|
10
|
-
export function PhiCmsRegionStatic({ children, className, regionKey, config = {}, shellTheme, style, regionType, previewMode = false, }) {
|
|
10
|
+
export function PhiCmsRegionStatic({ children, className, regionKey, config = {}, shellTheme, style, regionType, previewMode = false, rootPaintsGround = false, }) {
|
|
11
11
|
const shell = resolvePhiCmsRegionShell({
|
|
12
12
|
regionKey,
|
|
13
13
|
config,
|
|
@@ -17,6 +17,7 @@ export function PhiCmsRegionStatic({ children, className, regionKey, config = {}
|
|
|
17
17
|
regionType,
|
|
18
18
|
className,
|
|
19
19
|
style,
|
|
20
|
+
rootPaintsGround,
|
|
20
21
|
});
|
|
21
22
|
if (shell == null) {
|
|
22
23
|
return null;
|
|
@@ -185,6 +185,7 @@ function normalizeRenderableBlockViewportEffect(value) {
|
|
|
185
185
|
const rangeEnd = normalizeRenderableBlockViewportEffectRangePoint(value.rangeEnd);
|
|
186
186
|
const easing = normalizeRenderableBlockTransitionEasing(value.easing);
|
|
187
187
|
const clamp = typeof value.clamp === "boolean" ? value.clamp : undefined;
|
|
188
|
+
const perspectivePx = normalizeRenderableBlockTransitionNumber(value.perspectivePx, 0, 10000);
|
|
188
189
|
if (!axis &&
|
|
189
190
|
!property &&
|
|
190
191
|
from == null &&
|
|
@@ -193,7 +194,8 @@ function normalizeRenderableBlockViewportEffect(value) {
|
|
|
193
194
|
rangeStart == null &&
|
|
194
195
|
rangeEnd == null &&
|
|
195
196
|
!easing &&
|
|
196
|
-
clamp == null
|
|
197
|
+
clamp == null &&
|
|
198
|
+
perspectivePx == null) {
|
|
197
199
|
return undefined;
|
|
198
200
|
}
|
|
199
201
|
return {
|
|
@@ -206,6 +208,7 @@ function normalizeRenderableBlockViewportEffect(value) {
|
|
|
206
208
|
...(rangeEnd == null ? {} : { rangeEnd }),
|
|
207
209
|
...(easing ? { easing } : {}),
|
|
208
210
|
...(clamp == null ? {} : { clamp }),
|
|
211
|
+
...(perspectivePx == null ? {} : { perspectivePx }),
|
|
209
212
|
};
|
|
210
213
|
}
|
|
211
214
|
function normalizeRenderableBlockViewportEffects(value) {
|
|
@@ -400,6 +403,9 @@ function stripRenderableBlockEffects(value) {
|
|
|
400
403
|
if (merged.clamp !== PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.clamp) {
|
|
401
404
|
nextViewportEffect.clamp = merged.clamp;
|
|
402
405
|
}
|
|
406
|
+
if (merged.perspectivePx !== PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.perspectivePx) {
|
|
407
|
+
nextViewportEffect.perspectivePx = merged.perspectivePx;
|
|
408
|
+
}
|
|
403
409
|
return nextViewportEffect;
|
|
404
410
|
});
|
|
405
411
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phis/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
],
|
|
482
482
|
"peerDependencies": {
|
|
483
483
|
"@ant-design/icons": "^6.3.2",
|
|
484
|
-
"antd": "^6.
|
|
484
|
+
"antd": "^6.7.0",
|
|
485
485
|
"next": "^16.2.11",
|
|
486
486
|
"react": "^19.2.8",
|
|
487
487
|
"react-dom": "^19.2.8"
|
|
@@ -57,6 +57,7 @@ function resolveViewportEffectValues(effects, target) {
|
|
|
57
57
|
rotateZ: "0deg",
|
|
58
58
|
scale: "1",
|
|
59
59
|
opacity: null,
|
|
60
|
+
perspective: null,
|
|
60
61
|
};
|
|
61
62
|
for (const effect of effects) {
|
|
62
63
|
const property = effect.property ?? PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.property ?? "translate";
|
|
@@ -84,6 +85,12 @@ function resolveViewportEffectValues(effects, target) {
|
|
|
84
85
|
else {
|
|
85
86
|
values.rotateY = rotateValue;
|
|
86
87
|
}
|
|
88
|
+
// A turn about `x` or `y` tilts into the page only when seen from a distance; the first that names one
|
|
89
|
+
// holds for the element, as one transform has one eye.
|
|
90
|
+
const perspectivePx = effect.perspectivePx ?? PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.perspectivePx;
|
|
91
|
+
if (axis !== "z" && values.perspective == null && perspectivePx) {
|
|
92
|
+
values.perspective = `perspective(${perspectivePx}px)`;
|
|
93
|
+
}
|
|
87
94
|
continue;
|
|
88
95
|
}
|
|
89
96
|
const translateValue = formatViewportEffectValue(nextValue, effect.unit ?? "px");
|
|
@@ -103,6 +110,12 @@ function applyViewportEffectValues(target, values) {
|
|
|
103
110
|
target.style.setProperty("--phi-effects-viewport-rotate-y", values.rotateY);
|
|
104
111
|
target.style.setProperty("--phi-effects-viewport-rotate-z", values.rotateZ);
|
|
105
112
|
target.style.setProperty("--phi-effects-viewport-scale", values.scale);
|
|
113
|
+
if (values.perspective == null) {
|
|
114
|
+
target.style.removeProperty("--phi-effects-viewport-perspective");
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
target.style.setProperty("--phi-effects-viewport-perspective", values.perspective);
|
|
118
|
+
}
|
|
106
119
|
if (values.opacity == null) {
|
|
107
120
|
target.style.removeProperty("--phi-effects-viewport-opacity");
|
|
108
121
|
}
|
|
@@ -390,6 +390,14 @@ const effectsDescriptors = {
|
|
|
390
390
|
label: label("fields.clamp", "Clamp"),
|
|
391
391
|
initialValue: true,
|
|
392
392
|
},
|
|
393
|
+
{
|
|
394
|
+
key: "viewportPerspectivePx",
|
|
395
|
+
fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.number,
|
|
396
|
+
label: label("fields.perspective", "Perspective"),
|
|
397
|
+
initialValue: 800,
|
|
398
|
+
config: { min: 0 },
|
|
399
|
+
visibleWhen: formEquals("viewportProperty", "rotate"),
|
|
400
|
+
},
|
|
393
401
|
{
|
|
394
402
|
key: "viewportEffects",
|
|
395
403
|
fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.table,
|
|
@@ -413,6 +421,7 @@ const effectsDescriptors = {
|
|
|
413
421
|
rangeEnd: "exit",
|
|
414
422
|
easing: "linear",
|
|
415
423
|
clamp: true,
|
|
424
|
+
perspectivePx: 800,
|
|
416
425
|
},
|
|
417
426
|
sourceFields: {
|
|
418
427
|
property: "viewportProperty",
|
|
@@ -424,6 +433,7 @@ const effectsDescriptors = {
|
|
|
424
433
|
rangeEnd: "viewportRangeEnd",
|
|
425
434
|
easing: "viewportEasing",
|
|
426
435
|
clamp: "viewportClamp",
|
|
436
|
+
perspectivePx: "viewportPerspectivePx",
|
|
427
437
|
},
|
|
428
438
|
resetFields: {
|
|
429
439
|
viewportProperty: "translate",
|
|
@@ -435,6 +445,7 @@ const effectsDescriptors = {
|
|
|
435
445
|
viewportRangeEnd: "exit",
|
|
436
446
|
viewportEasing: "linear",
|
|
437
447
|
viewportClamp: true,
|
|
448
|
+
viewportPerspectivePx: 800,
|
|
438
449
|
},
|
|
439
450
|
},
|
|
440
451
|
remove: { enabled: true, label: "Remove viewport effect" },
|
|
@@ -25,6 +25,7 @@ import { PHI_CONTROL_HEIGHTS, PHI_PADDING, PHI_RADII, } from "../../../../../the
|
|
|
25
25
|
import { PHI_COLOR_PICKER_NEUTRAL_PRESETS, PHI_COLOR_PICKER_PRESETS } from "../../../../../components/widgets/config/color-picker-presets";
|
|
26
26
|
import { PHI_SPACING_TOKEN_KEYS } from "../../../../../components/widgets/config/spacing-options";
|
|
27
27
|
import { PhiColorFieldControl } from "../../../../../components/controls/phi-color-field-control";
|
|
28
|
+
import { usePhiColorControlPresets } from "../../../../../components/controls/use-phi-color-control-presets";
|
|
28
29
|
import { PhiBrandControl, resolvePhiBrandLogoUrl } from "../../../../../components/controls/phi-brand-control";
|
|
29
30
|
import { PhiBackgroundControl } from "../../../../../components/controls/phi-background-control";
|
|
30
31
|
import { PHI_ROOT_BACKGROUND_BASE_KINDS, PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, PHI_ROOT_BACKGROUND_FILTERS, PHI_ROOT_BACKGROUND_MOTION_MODES, resolvePhiRootBackgroundPaintStyle, } from "../../../../../components/root/phi-root-background";
|
|
@@ -1550,6 +1551,19 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1550
1551
|
const resolvedDraft = resolvePhiThemeRuntimePayload(state.draft, themeBlocks).theme;
|
|
1551
1552
|
return resolveBrandDraftAliasTokens(resolvedDraft, resolveThemePayloadPreset(resolvedDraft, themePresets), mode);
|
|
1552
1553
|
}, [mode, state.draft, themeBlocks, themePresets]);
|
|
1554
|
+
/*
|
|
1555
|
+
* A Wordmark part picks from what every colour field of the Theme offers: the draft's custom colours in
|
|
1556
|
+
* 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.
|
|
1558
|
+
*/
|
|
1559
|
+
const wordmarkCustomColors = useMemo(() => {
|
|
1560
|
+
const palette = resolveThemeCustomPalette(state.draft, resolveThemePayloadPreset(state.draft, themePresets), mode);
|
|
1561
|
+
return PHI_THEME_CUSTOM_COLOR_KEYS.map((key, index) => ({ key, label: `Custom ${index + 1}`, value: palette[key] }));
|
|
1562
|
+
}, [mode, state.draft, themePresets]);
|
|
1563
|
+
const wordmarkColorPresets = usePhiColorControlPresets({
|
|
1564
|
+
customColors: wordmarkCustomColors,
|
|
1565
|
+
presets: PHI_COLOR_PICKER_PRESETS,
|
|
1566
|
+
});
|
|
1553
1567
|
const [activeIdentitySection, changeActiveIdentitySection] = usePhiBrandAccordionSection(BRAND_THEME_IDENTITY_COLLAPSE_STORAGE_KEY, BRAND_THEME_IDENTITY_SECTION_KEYS);
|
|
1554
1568
|
const brand = state.draft.brand ?? {};
|
|
1555
1569
|
/*
|
|
@@ -1677,7 +1691,7 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1677
1691
|
? _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, "."] })
|
|
1678
1692
|
: _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,
|
|
1679
1693
|
// A part's row is narrow: the swatch says the colour, the value would overflow it.
|
|
1680
|
-
showText: false, value: part.color ?? null, presets:
|
|
1694
|
+
showText: false, value: part.color ?? null, presets: wordmarkColorPresets, onChange: (next) => updateWordmarkPart(index, { color: next }) }), _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: () => {
|
|
1681
1695
|
setWordmarkPartKeys((current) => ({
|
|
1682
1696
|
...current,
|
|
1683
1697
|
keys: current.keys.filter((_, at) => at !== index),
|
package/styles/root.css
CHANGED
|
@@ -91,7 +91,9 @@ samp {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
:where([data-phi-renderable-block="true"][data-phi-effects-transition], [data-phi-renderable-block="true"][data-phi-effects-viewport]) {
|
|
94
|
+
/* `--phi-effects-viewport-perspective` is unset unless a viewport effect turns about x or y; it must lead. */
|
|
94
95
|
--phi-effects-viewport-transform:
|
|
96
|
+
var(--phi-effects-viewport-perspective,)
|
|
95
97
|
translate3d(var(--phi-effects-viewport-x, 0px), var(--phi-effects-viewport-y, 0px), 0)
|
|
96
98
|
rotateX(var(--phi-effects-viewport-rotate-x, 0deg))
|
|
97
99
|
rotateY(var(--phi-effects-viewport-rotate-y, 0deg))
|
package/styles/shell.css
CHANGED
|
@@ -469,33 +469,36 @@
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
/*
|
|
472
|
-
* A
|
|
472
|
+
* A band with a ground of its own takes no paint from its family's pane (SHELL.md "A band with a ground
|
|
473
|
+
* of its own").
|
|
473
474
|
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
475
|
+
* The band carries `data-phi-shell-own-ground` when it paints its own ground: a tone (LAYOUTING.md
|
|
476
|
+
* "Surface tone"), an authored Background other than the Theme's Overlay taken as the Shell's, or a top
|
|
477
|
+
* Layout that paints one -- the floating Header bar. Such a band never carries the marker. The pane
|
|
478
|
+
* behind it would paint the frame under a ground that is already there: a second frosting under a
|
|
479
|
+
* glass band, the page-mode glass under a tone's, a full-width strip behind a floating bar. The pane
|
|
480
|
+
* cannot be cut around one band without knowing its height, so it stops painting for the whole family
|
|
481
|
+
* and the family's marker bands paint the Overlay themselves, as they do without panes. Its geometry and
|
|
482
|
+
* Shadow stay: the frame's edge is where it was, and the Header still stands over the Sider. The pane's
|
|
483
|
+
* paint is inline and reads these properties on the pane itself, so they are set there. Families
|
|
484
|
+
* without such a band match nothing here.
|
|
482
485
|
*/
|
|
483
|
-
.shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])
|
|
484
|
-
.shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])
|
|
485
|
-
.shell-sider-embedded:has(> [data-phi-region-key="header_bottom"]
|
|
486
|
-
[data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_left"]
|
|
487
|
-
[data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_right"]
|
|
488
|
-
[data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])
|
|
486
|
+
.shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])[data-phi-shell-own-ground]) > .phi-shell-chrome-pane--header,
|
|
487
|
+
.shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])[data-phi-shell-own-ground]) > .phi-shell-chrome-pane--header,
|
|
488
|
+
.shell-sider-embedded:has(> [data-phi-region-key="header_bottom"][data-phi-shell-own-ground]) > .phi-shell-chrome-pane--header-bottom,
|
|
489
|
+
[data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_left"][data-phi-shell-own-ground]) > .phi-shell-chrome-pane--sider,
|
|
490
|
+
[data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_right"][data-phi-shell-own-ground]) > .phi-shell-chrome-pane--sider-right,
|
|
491
|
+
[data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])[data-phi-shell-own-ground]) > .phi-shell-chrome-pane--footer {
|
|
489
492
|
--phi-shell-chrome-image: none;
|
|
490
493
|
--phi-shell-chrome-color: transparent;
|
|
491
494
|
--phi-shell-chrome-filter: none;
|
|
492
495
|
}
|
|
493
496
|
|
|
494
|
-
.shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])
|
|
497
|
+
.shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])[data-phi-shell-own-ground])
|
|
495
498
|
> .phi-cms-region-shell[data-phi-shell-chrome="true"]:is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"]),
|
|
496
|
-
.shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])
|
|
499
|
+
.shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])[data-phi-shell-own-ground])
|
|
497
500
|
> .phi-cms-region-shell[data-phi-shell-chrome="true"]:is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"]),
|
|
498
|
-
[data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])
|
|
501
|
+
[data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])[data-phi-shell-own-ground])
|
|
499
502
|
> .phi-cms-region-shell[data-phi-shell-chrome="true"]:is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"]) {
|
|
500
503
|
--phi-region-chrome-image: var(--phi-shell-chrome-image, none);
|
|
501
504
|
--phi-region-chrome-color: var(--phi-shell-chrome-color, transparent);
|
|
@@ -503,6 +506,26 @@
|
|
|
503
506
|
--phi-region-chrome-attachment: fixed;
|
|
504
507
|
}
|
|
505
508
|
|
|
509
|
+
/*
|
|
510
|
+
* A bar inside the band (`box`: the band's top Layout paints the ground, not the band) takes the pane's
|
|
511
|
+
* Shadow away as well. The Shadow marks the frame's edge across the full width, and the frame has stepped
|
|
512
|
+
* aside for a bar that is narrower and wears its own edge. A tone or a band's own Background keeps it.
|
|
513
|
+
*/
|
|
514
|
+
.shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])[data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--header,
|
|
515
|
+
.shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])[data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--header,
|
|
516
|
+
.shell-sider-embedded:has(> [data-phi-region-key="header_bottom"][data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--header-bottom {
|
|
517
|
+
--phi-shell-chrome-shadow-header: none;
|
|
518
|
+
}
|
|
519
|
+
[data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_left"][data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--sider {
|
|
520
|
+
--phi-shell-chrome-shadow-sider-left: none;
|
|
521
|
+
}
|
|
522
|
+
[data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_right"][data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--sider-right {
|
|
523
|
+
--phi-shell-chrome-shadow-sider-right: none;
|
|
524
|
+
}
|
|
525
|
+
[data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])[data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--footer {
|
|
526
|
+
--phi-shell-chrome-shadow-footer: none;
|
|
527
|
+
}
|
|
528
|
+
|
|
506
529
|
/* ---------------------------------------------------------------------------------------------
|
|
507
530
|
Revealing `header_top` (SHELL.md "Region visibility per Page")
|
|
508
531
|
|
|
@@ -83,6 +83,11 @@ export type PhiRenderableBlockViewportEffect = {
|
|
|
83
83
|
rangeEnd?: PhiRenderableBlockViewportEffectRangePoint | number | null;
|
|
84
84
|
easing?: PhiRenderableBlockTransitionEasing | null;
|
|
85
85
|
clamp?: boolean | null;
|
|
86
|
+
/**
|
|
87
|
+
* How far the eye stands from a turn about `x` or `y`, in pixels: smaller is deeper. Without it such a
|
|
88
|
+
* turn only foreshortens flat. `0` turns it off; `z` and the other properties ignore it.
|
|
89
|
+
*/
|
|
90
|
+
perspectivePx?: number | null;
|
|
86
91
|
};
|
|
87
92
|
export type PhiRenderableBlockEffects = {
|
|
88
93
|
opacity?: number | null;
|