@spatial-elements/sveltekit 1.0.0-beta.15 → 1.0.0-beta.18
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/README.md +1 -1
- package/dist/catalog/ScrollNavigationBridge.svelte +5 -1
- package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +1 -1
- package/dist/catalog/stagedCatalogNavigation.d.ts +1 -1
- package/dist/spatial-element/BrandStageShell.svelte +27 -2
- package/dist/spatial-element/BrandStageShell.svelte.d.ts +2 -0
- package/dist/spatial-element/CarouselSpatialElement.svelte +7 -7
- package/dist/spatial-element/ContentPage.svelte +5 -2
- package/dist/spatial-element/ContentPage.svelte.d.ts +3 -0
- package/dist/spatial-element/OverflowControls.svelte +6 -6
- package/dist/spatial-element/PointerHint.svelte +5 -4
- package/dist/spatial-element/Section.svelte +1 -1
- package/dist/spatial-element/SpaceMouseControl.svelte +4 -4
- package/dist/spatial-element/SpatialCardGridSection.svelte +6 -9
- package/dist/spatial-element/SpatialCardPresentation.svelte +129 -33
- package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +2 -2
- package/dist/spatial-element/SpatialCardSlot.svelte +1 -1
- package/dist/spatial-element/SpatialCarouselSection.svelte +10 -2
- package/dist/spatial-element/SpatialElementCard.svelte +7 -13
- package/dist/spatial-element/SpatialElementCard.svelte.d.ts +2 -2
- package/dist/spatial-element/SpatialElementHelp.svelte +7 -5
- package/dist/spatial-element/SpatialElementMediaRail.svelte +2 -1
- package/dist/spatial-element/SpatialElementPage.svelte +1 -1
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +29 -5
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +16 -8
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +4 -0
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +2 -1
- package/dist/spatial-element/SpatialElementTabList.svelte +32 -10
- package/dist/spatial-element/SpatialIconButton.svelte +2 -0
- package/dist/spatial-element/SpatialListPage.svelte +2 -2
- package/dist/spatial-element/SpatialNavigationShell.svelte +10 -44
- package/dist/spatial-element/SpatialSummaryHost.svelte +1 -1
- package/dist/spatial-element/SpatialSummaryRoot.svelte +33 -10
- package/dist/spatial-element/SpatialSummarySlot.svelte +1 -1
- package/dist/spatial-element/cardAppearanceFreeze.js +1 -1
- package/dist/spatial-element/carouselTextHit.js +2 -1
- package/dist/spatial-element/contentSidebars.js +15 -7
- package/dist/spatial-element/index.d.ts +1 -2
- package/dist/spatial-element/layout.generated.css +41 -17
- package/dist/spatial-element/spatialCardGrid.d.ts +3 -3
- package/dist/spatial-element/spatialSummary.d.ts +4 -2
- package/dist/spatial-element/spatialThemeStyle.js +4 -4
- package/dist/stage/ButtonGroup.svelte +2 -0
- package/dist/stage/Panel.svelte +11 -3
- package/dist/stage/Panel.svelte.d.ts +2 -0
- package/dist/stage/Stage.svelte +6 -3
- package/dist/stage/panelShadowStyle.d.ts +3 -0
- package/dist/stage/panelShadowStyle.js +11 -0
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { browser } from '$app/
|
|
2
|
+
import { browser } from '$app/env';
|
|
3
3
|
import { createRawSnippet, getContext, onMount, untrack } from 'svelte';
|
|
4
4
|
import { render } from 'svelte/server';
|
|
5
5
|
import { SpatialSummaryHostController, SPATIAL_SUMMARY_HOST } from './spatialSummaryHost.svelte.js';
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
target.closest('.controls, .carousel-arrows, input, textarea, select, [contenteditable]')
|
|
258
258
|
)
|
|
259
259
|
return false;
|
|
260
|
-
return touch || !target.closest('a, button') || !!target.closest('.spatial-element-target');
|
|
260
|
+
return touch || !target.closest('a, button') || !!target.closest('.spatial-element-target, [data-spatial-summary-link], .compact-copy');
|
|
261
261
|
}
|
|
262
262
|
function pointerdown(event: PointerEvent) {
|
|
263
263
|
if (!interactive || blocked() || list.length < 2) return;
|
|
@@ -618,6 +618,10 @@
|
|
|
618
618
|
:global(.carousel.interactive .summary button) {
|
|
619
619
|
cursor: pointer;
|
|
620
620
|
}
|
|
621
|
+
:global(.carousel.interactive .summary [data-spatial-summary-link]),
|
|
622
|
+
:global(.carousel.interactive .summary .compact-copy) {
|
|
623
|
+
cursor: grab;
|
|
624
|
+
}
|
|
621
625
|
:global(.carousel.interactive [data-carousel-text-hit]) {
|
|
622
626
|
cursor: text;
|
|
623
627
|
}
|
|
@@ -639,7 +643,7 @@
|
|
|
639
643
|
grid-auto-flow: column;
|
|
640
644
|
grid-auto-columns: 100%;
|
|
641
645
|
position: relative;
|
|
642
|
-
height: calc(var(--spatial-carousel-
|
|
646
|
+
height: calc(var(--spatial-carousel-panel-reserve) + var(--spatial-carousel-fit-height));
|
|
643
647
|
overflow-x: auto;
|
|
644
648
|
overflow-y: hidden;
|
|
645
649
|
scroll-snap-type: x mandatory;
|
|
@@ -670,7 +674,11 @@
|
|
|
670
674
|
justify-content: space-between;
|
|
671
675
|
pointer-events: none;
|
|
672
676
|
}
|
|
677
|
+
@media (width < 840px) {
|
|
678
|
+
.carousel-arrows { top: calc(var(--spatial-carousel-fit-height) - var(--spatial-carousel-compact-overlap) + var(--spatial-carousel-compact-height) / 2); }
|
|
679
|
+
}
|
|
673
680
|
.carousel-arrows button {
|
|
681
|
+
outline: none;
|
|
674
682
|
pointer-events: auto;
|
|
675
683
|
width: 44px;
|
|
676
684
|
height: 44px;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
CardMediaAspect,
|
|
4
|
-
CardMediaFit,
|
|
5
|
-
CardVariant,
|
|
6
|
-
SurfaceTone
|
|
7
|
-
} from '@page-sections/core';
|
|
2
|
+
import type { CardMediaAspect, CardMediaFit, SurfaceTone } from '@page-sections/core';
|
|
8
3
|
import { getContext } from 'svelte';
|
|
9
4
|
import { CATALOG_ITEMS, type CatalogItems } from '@spatial-elements/core/catalog/catalogItems';
|
|
10
5
|
import type { SpatialListItem } from '@spatial-elements/core/spatial-element/types';
|
|
@@ -21,7 +16,7 @@
|
|
|
21
16
|
mediaFit = 'contain',
|
|
22
17
|
reserveEyebrow = false,
|
|
23
18
|
cardTone = 'standard',
|
|
24
|
-
|
|
19
|
+
cardShadow = false
|
|
25
20
|
}: {
|
|
26
21
|
spatialElement: SpatialListItem;
|
|
27
22
|
occurrence: string;
|
|
@@ -32,7 +27,7 @@
|
|
|
32
27
|
mediaFit?: CardMediaFit;
|
|
33
28
|
reserveEyebrow?: boolean;
|
|
34
29
|
cardTone?: SurfaceTone;
|
|
35
|
-
|
|
30
|
+
cardShadow?: boolean;
|
|
36
31
|
} = $props();
|
|
37
32
|
const items = getContext<CatalogItems | undefined>(CATALOG_ITEMS);
|
|
38
33
|
const readTheme = useSpatialTheme();
|
|
@@ -41,10 +36,7 @@
|
|
|
41
36
|
$effect(() => items?.register({ ...spatialElement, occurrence }));
|
|
42
37
|
</script>
|
|
43
38
|
|
|
44
|
-
<div
|
|
45
|
-
class="spatial-card-placement"
|
|
46
|
-
data-ps-card-size={cardVariant === 'catalog' ? cardSize : undefined}
|
|
47
|
-
>
|
|
39
|
+
<div class="spatial-card-placement" data-ps-card-size={cardSize}>
|
|
48
40
|
<SpatialCardSlot
|
|
49
41
|
instanceKey={`card:${brand.id}:${occurrence}`}
|
|
50
42
|
context={{
|
|
@@ -57,13 +49,15 @@
|
|
|
57
49
|
mediaFit,
|
|
58
50
|
reserveEyebrow,
|
|
59
51
|
cardTone,
|
|
60
|
-
|
|
52
|
+
cardShadow
|
|
61
53
|
}}
|
|
62
54
|
/>
|
|
63
55
|
</div>
|
|
64
56
|
|
|
65
57
|
<style>
|
|
66
58
|
.spatial-card-placement {
|
|
59
|
+
align-self: stretch;
|
|
60
|
+
display: grid;
|
|
67
61
|
grid-column: span var(--ps-card-span, 1);
|
|
68
62
|
min-width: 0;
|
|
69
63
|
min-height: 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardMediaAspect, CardMediaFit,
|
|
1
|
+
import type { CardMediaAspect, CardMediaFit, SurfaceTone } from '@page-sections/core';
|
|
2
2
|
import type { SpatialListItem } from '@spatial-elements/core/spatial-element/types';
|
|
3
3
|
import { type SpatialCardSize } from '@spatial-elements/core/spatial-element/responsiveLayout';
|
|
4
4
|
type $$ComponentProps = {
|
|
@@ -11,7 +11,7 @@ type $$ComponentProps = {
|
|
|
11
11
|
mediaFit?: CardMediaFit;
|
|
12
12
|
reserveEyebrow?: boolean;
|
|
13
13
|
cardTone?: SurfaceTone;
|
|
14
|
-
|
|
14
|
+
cardShadow?: boolean;
|
|
15
15
|
};
|
|
16
16
|
declare const SpatialElementCard: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
17
17
|
type SpatialElementCard = ReturnType<typeof SpatialElementCard>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
|
|
3
3
|
import { getContext, onMount, tick } from 'svelte';
|
|
4
|
-
import CircleHelp from 'lucide
|
|
5
|
-
import X from 'lucide
|
|
4
|
+
import CircleHelp from '@lucide/svelte/icons/circle-help';
|
|
5
|
+
import X from '@lucide/svelte/icons/x';
|
|
6
6
|
import InteractionGesture from './InteractionGesture.svelte';
|
|
7
|
-
import {
|
|
7
|
+
import { getSharedPanelBoxShadow } from '@spatial-elements/core/stage/panelShadow';
|
|
8
8
|
import { getInteractionGuidance, MODEL_INPUT_EVENT, type ModelInputState, type InteractionGuidance } from '@spatial-elements/core/stage/interactionGuidance';
|
|
9
9
|
import { STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame } from '@spatial-elements/core/stage/scrollFrame';
|
|
10
10
|
import { STAGE_CONTEXT_KEY, STAGE_PANEL_LAYOUT_EVENT, type StageContext } from '@spatial-elements/core/stage/panelContext';
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
`--help-tint: ${typeof theme.panelTheme.tint === 'number' ? '#' + theme.panelTheme.tint.toString(16).padStart(6, '0') : theme.panelTheme.tint ?? '#ffffff'}`,
|
|
49
49
|
`--help-tint-opacity: ${(theme.panelTheme.tintOpacity ?? 0.65) * 100}%`,
|
|
50
50
|
`--help-blur: ${Math.min(100, Math.max(0, theme.panelTheme.backdropBlur ?? 8))}px`,
|
|
51
|
-
`--help-shadow: ${
|
|
51
|
+
`--help-shadow: ${getSharedPanelBoxShadow(theme.panelTheme.shadowIntensity ?? 0.2, theme.panelTheme.shadowColor)}`,
|
|
52
52
|
`--help-radius: ${radii.panel}px`
|
|
53
53
|
].join(';'));
|
|
54
54
|
|
|
@@ -285,6 +285,7 @@
|
|
|
285
285
|
.help-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
286
286
|
h2 { margin: 0; font-size: 15px; font-weight: 650; }
|
|
287
287
|
.close-help {
|
|
288
|
+
outline: 1px solid var(--ps-border); outline-offset: -1px;
|
|
288
289
|
width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
|
|
289
290
|
padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); color: inherit; background: transparent; cursor: pointer;
|
|
290
291
|
}
|
|
@@ -295,6 +296,7 @@
|
|
|
295
296
|
/* Keep complete host-localized instructions available to assistive technology. */
|
|
296
297
|
dd { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
297
298
|
.navigation-hint { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid currentColor; font-size: 12px; }
|
|
298
|
-
.navigation-hint a { color: var(--spatial-element-accent); text-decoration:
|
|
299
|
+
.navigation-hint a { color: var(--spatial-element-accent); text-decoration: none; text-underline-offset: 2px; }
|
|
300
|
+
.navigation-hint a:hover { text-decoration: underline; }
|
|
299
301
|
.navigation-hint a:focus-visible { outline: 2px solid var(--spatial-element-accent); outline-offset: 3px; border-radius: 2px; }
|
|
300
302
|
</style>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
|
|
4
4
|
import { getPanelFocusOpacity } from '@spatial-elements/core/stage/panelFocusMath';
|
|
5
5
|
import { STAGE_CONTEXT_KEY, type StageContext } from '@spatial-elements/core/stage/panelContext';
|
|
6
|
-
import Play from 'lucide
|
|
6
|
+
import Play from '@lucide/svelte/icons/play';
|
|
7
7
|
import OverflowControls from './OverflowControls.svelte';
|
|
8
8
|
import SpatialMediaIndicator from './SpatialMediaIndicator.svelte';
|
|
9
9
|
import { STAGE_PANEL_LAYOUT_EVENT, STAGE_PANEL_VISUAL_EVENT } from '@spatial-elements/core/stage/panelContext';
|
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
visible={media.kind !== 'minimap' || minimapInRail || focused || minimapDocked}
|
|
119
119
|
minimapSelected={active}
|
|
120
120
|
class={`thumbnail-panel ${active ? 'active' : ''}`}
|
|
121
|
+
borderColor={active ? 'transparent' : 'var(--ps-border)'}
|
|
121
122
|
shape={{ ...theme.panelShape, radius: radii.control, contentInset: 0 }}
|
|
122
123
|
theme={theme.panelTheme}
|
|
123
124
|
contentClass="thumbnail-panel-content"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext, onMount, setContext } from 'svelte';
|
|
3
|
-
import ShoppingCart from 'lucide
|
|
3
|
+
import ShoppingCart from '@lucide/svelte/icons/shopping-cart';
|
|
4
4
|
import { SpatialElementPaneController } from '@spatial-elements/core/spatial-element/SpatialElementPaneController';
|
|
5
5
|
import { SpatialElementHeaderFields } from '@spatial-elements/core/spatial-element/SpatialElementHeaderFields';
|
|
6
6
|
import './headerFields.css';
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { getSharedPanelBoxShadow } from '@spatial-elements/core/stage/panelShadow';
|
|
3
|
+
import { useSpatialTheme } from './brandContext.js';
|
|
4
|
+
const readTheme = useSpatialTheme();
|
|
5
|
+
const shadow = $derived(getSharedPanelBoxShadow(readTheme().dockedPanelTheme.shadowIntensity, readTheme().dockedPanelTheme.shadowColor));
|
|
2
6
|
import type { Snippet } from 'svelte';
|
|
3
7
|
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
4
8
|
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
5
|
-
import ShoppingCart from 'lucide
|
|
9
|
+
import ShoppingCart from '@lucide/svelte/icons/shopping-cart';
|
|
6
10
|
import './layout.generated.css';
|
|
7
11
|
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
8
12
|
const catalogEndpoint = createCatalogEndpointAction();
|
|
@@ -27,6 +31,7 @@
|
|
|
27
31
|
|
|
28
32
|
<header
|
|
29
33
|
class="spatial-element-sticky-header"
|
|
34
|
+
style:--spatial-docked-default-shadow={shadow}
|
|
30
35
|
data-spatial-element-sticky-header
|
|
31
36
|
data-spatial-element-handoff-header
|
|
32
37
|
data-catalog-transition-dom="enter"
|
|
@@ -127,6 +132,7 @@
|
|
|
127
132
|
|
|
128
133
|
<div
|
|
129
134
|
class="spatial-element-sticky-tabs"
|
|
135
|
+
style:--spatial-docked-default-shadow={shadow}
|
|
130
136
|
data-spatial-element-sticky-tabs
|
|
131
137
|
data-catalog-transition-dom="enter"
|
|
132
138
|
aria-hidden="true"
|
|
@@ -199,7 +205,7 @@
|
|
|
199
205
|
opacity: 0;
|
|
200
206
|
visibility: hidden;
|
|
201
207
|
background: transparent;
|
|
202
|
-
box-shadow: var(--spatial-element-docked-panel-box-shadow);
|
|
208
|
+
box-shadow: var(--ps-panel-shadow, var(--spatial-element-docked-panel-box-shadow, var(--spatial-docked-default-shadow)));
|
|
203
209
|
pointer-events: none;
|
|
204
210
|
will-change: border-radius;
|
|
205
211
|
}
|
|
@@ -220,23 +226,41 @@
|
|
|
220
226
|
var(--spatial-element-docked-panel-tint-rgb) /
|
|
221
227
|
var(--spatial-element-docked-panel-tint-opacity)
|
|
222
228
|
);
|
|
223
|
-
box-shadow:
|
|
224
|
-
rgb(0 0 0 / calc(var(--spatial-element-docked-panel-shadow-strength) * 0.18));
|
|
229
|
+
box-shadow: none;
|
|
225
230
|
-webkit-backdrop-filter: blur(var(--spatial-element-docked-panel-backdrop-blur));
|
|
226
231
|
backdrop-filter: blur(var(--spatial-element-docked-panel-backdrop-blur));
|
|
227
232
|
}
|
|
228
233
|
|
|
229
234
|
.spatial-element-sticky-header::before {
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
border-bottom: 1px solid var(--ps-panel-border);
|
|
230
237
|
z-index: 2;
|
|
231
238
|
opacity: var(--spatial-element-sticky-header-progress, 0);
|
|
232
239
|
}
|
|
233
240
|
|
|
234
241
|
.spatial-element-sticky-header::after {
|
|
235
242
|
z-index: 1;
|
|
236
|
-
box-shadow: var(--spatial-element-docked-panel-box-shadow);
|
|
243
|
+
box-shadow: var(--ps-panel-shadow, var(--spatial-element-docked-panel-box-shadow, var(--spatial-docked-default-shadow)));
|
|
237
244
|
opacity: var(--spatial-element-sticky-header-progress, 0);
|
|
238
245
|
}
|
|
239
246
|
|
|
247
|
+
.spatial-element-sticky-tabs::after {
|
|
248
|
+
content: '';
|
|
249
|
+
position: absolute;
|
|
250
|
+
inset: 0;
|
|
251
|
+
border: 1px solid var(--ps-panel-border);
|
|
252
|
+
/* Fade only the shared edge with the corner morph. Keep the surface and
|
|
253
|
+
* its existing header overlap intact so docking cannot expose a gap. */
|
|
254
|
+
border-top-color: color-mix(
|
|
255
|
+
in srgb,
|
|
256
|
+
var(--ps-panel-border) var(--spatial-element-tabs-dock-top-border-opacity, 100%),
|
|
257
|
+
transparent
|
|
258
|
+
);
|
|
259
|
+
border-radius: inherit;
|
|
260
|
+
pointer-events: none;
|
|
261
|
+
z-index: 3;
|
|
262
|
+
}
|
|
263
|
+
|
|
240
264
|
.spatial-element-sticky-tabs::before {
|
|
241
265
|
z-index: 0;
|
|
242
266
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { catalogViewLink } from '@spatial-elements/core/catalog/catalogViewLink';
|
|
3
|
+
import type { SpatialSummaryContext } from './spatialSummary.js';
|
|
2
4
|
import type { Snippet } from "svelte";
|
|
3
5
|
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
4
6
|
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
5
7
|
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
6
|
-
import ShoppingCart from 'lucide
|
|
8
|
+
import ShoppingCart from '@lucide/svelte/icons/shopping-cart';
|
|
7
9
|
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
8
|
-
let { spatialElement, address, contentInset, heading = 'h3', leading, beforeAction, actionIcon, element = $bindable() }: {
|
|
10
|
+
let { spatialElement, address, contentInset, heading = 'h3', detailHref, carousel, leading, beforeAction, actionIcon, element = $bindable() }: {
|
|
9
11
|
spatialElement: { id: string; eyebrow: string; title: string; features: SpatialElementFeature[]; action?: SpatialElementAction };
|
|
10
12
|
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
11
13
|
contentInset: number;
|
|
12
14
|
heading?: 'h1' | 'h3';
|
|
15
|
+
/** Link for the eyebrow and title, normally provided by SpatialSummaryContext. */
|
|
16
|
+
detailHref?: string;
|
|
17
|
+
carousel?: SpatialSummaryContext['carousel'];
|
|
13
18
|
leading?: Snippet;
|
|
14
19
|
/** Optional content above the CTA, for example a price and quantity field. */
|
|
15
20
|
beforeAction?: Snippet;
|
|
@@ -23,7 +28,7 @@
|
|
|
23
28
|
data-catalog-rich-shared="leading" data-catalog-semantic={spatialElement.id}>
|
|
24
29
|
{@render leading()}
|
|
25
30
|
</div>{/if}
|
|
26
|
-
<
|
|
31
|
+
<a draggable="false" class="panel-copy" href={detailHref} data-spatial-summary-link data-catalog-focus-key={`summary-title:${JSON.stringify([spatialElement.id, carousel?.occurrence ?? 'detail'])}`} use:catalogViewLink={{ spatialElementId: spatialElement.id, targetPresentation: carousel?.item.targetPresentation }}>
|
|
27
32
|
{#if spatialElement.eyebrow}
|
|
28
33
|
<p
|
|
29
34
|
class="panel-kicker"
|
|
@@ -43,7 +48,7 @@
|
|
|
43
48
|
>
|
|
44
49
|
{spatialElement.title}
|
|
45
50
|
</svelte:element>
|
|
46
|
-
</
|
|
51
|
+
</a>
|
|
47
52
|
|
|
48
53
|
{#if spatialElement.features.length}<ul
|
|
49
54
|
class="feature-list"
|
|
@@ -117,21 +122,24 @@
|
|
|
117
122
|
box-sizing: border-box;
|
|
118
123
|
display: flex;
|
|
119
124
|
flex-direction: column;
|
|
120
|
-
gap:
|
|
125
|
+
gap: 12px;
|
|
121
126
|
/* The same live panel can leave a Section for the stage's detail layer. */
|
|
122
127
|
line-height: 24px;
|
|
123
128
|
pointer-events: auto;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
.summary-title {
|
|
127
|
-
margin:
|
|
132
|
+
margin: 6px 0 0;
|
|
128
133
|
font-size: 24px;
|
|
129
134
|
font-weight: 780;
|
|
130
135
|
line-height: 1.16;
|
|
131
136
|
}
|
|
132
|
-
.summary-commerce { display: grid; gap:
|
|
137
|
+
.summary-commerce { display: grid; gap: 12px; min-width: 0; align-content: start; }
|
|
133
138
|
.summary-leading, .panel-copy { min-width: 0; }
|
|
134
139
|
|
|
140
|
+
.panel-copy { user-select: text; display: block; color: inherit; text-decoration: none; }
|
|
141
|
+
.panel-copy:hover { text-decoration: none; }
|
|
142
|
+
.panel-copy:focus-visible { outline: 2px solid var(--spatial-element-accent); outline-offset: 4px; }
|
|
135
143
|
.panel-kicker {
|
|
136
144
|
margin: 0;
|
|
137
145
|
font-size: 14px;
|
|
@@ -142,7 +150,7 @@
|
|
|
142
150
|
|
|
143
151
|
.feature-list {
|
|
144
152
|
display: grid;
|
|
145
|
-
gap:
|
|
153
|
+
gap: 8px;
|
|
146
154
|
margin: 0;
|
|
147
155
|
padding: 0;
|
|
148
156
|
color: var(--spatial-element-body);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SpatialSummaryContext } from './spatialSummary.js';
|
|
1
2
|
import type { Snippet } from "svelte";
|
|
2
3
|
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
3
4
|
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
@@ -12,6 +13,9 @@ type $$ComponentProps = {
|
|
|
12
13
|
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
13
14
|
contentInset: number;
|
|
14
15
|
heading?: 'h1' | 'h3';
|
|
16
|
+
/** Link for the eyebrow and title, normally provided by SpatialSummaryContext. */
|
|
17
|
+
detailHref?: string;
|
|
18
|
+
carousel?: SpatialSummaryContext['carousel'];
|
|
15
19
|
leading?: Snippet;
|
|
16
20
|
/** Optional content above the CTA, for example a price and quantity field. */
|
|
17
21
|
beforeAction?: Snippet;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { page } from '$app/state';
|
|
2
3
|
import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
|
|
3
4
|
import { onMount } from 'svelte';
|
|
4
5
|
import SpatialSummarySlot from './SpatialSummarySlot.svelte';
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
data-spatial-element-id={spatialElement.id}
|
|
60
61
|
>
|
|
61
62
|
<SpatialSummarySlot instanceKey={`detail:${theme.id}:${spatialElement.id}`} bind:element={presentation}
|
|
62
|
-
context={{ spatialElement, contentInset, heading: 'h1', mode: 'detail',
|
|
63
|
+
context={{ spatialElement, contentInset, heading: 'h1', mode: 'detail', detailHref: page.url.pathname,
|
|
63
64
|
address: (role) => ({ brandId: theme.id, spatialElementId: spatialElement.id, slot: 'detail.summary', role }) }} />
|
|
64
65
|
</Panel>
|
|
65
66
|
</div>
|
|
@@ -26,11 +26,20 @@
|
|
|
26
26
|
const sectionId = currentSectionId;
|
|
27
27
|
if (!linksElement || !sectionId) return;
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const links = Array.from(
|
|
30
30
|
linksElement.querySelectorAll<HTMLElement>('[data-spatial-element-tab-id]')
|
|
31
|
-
)
|
|
31
|
+
);
|
|
32
|
+
const activeLink = links.find((element) => element.dataset.spatialElementTabId === sectionId);
|
|
32
33
|
if (!activeLink) return;
|
|
33
34
|
|
|
35
|
+
// Keep the dock's changing radii live; only select which group edges are rounded.
|
|
36
|
+
const rtl = getComputedStyle(linksElement).direction === 'rtl';
|
|
37
|
+
linksElement.style.setProperty(
|
|
38
|
+
'--spatial-element-tab-round-left', activeLink === links[rtl ? links.length - 1 : 0] ? '1' : '0'
|
|
39
|
+
);
|
|
40
|
+
linksElement.style.setProperty(
|
|
41
|
+
'--spatial-element-tab-round-right', activeLink === links[rtl ? 0 : links.length - 1] ? '1' : '0'
|
|
42
|
+
);
|
|
34
43
|
linksElement.style.setProperty('--spatial-element-tab-active-left', `${activeLink.offsetLeft}px`);
|
|
35
44
|
linksElement.style.setProperty('--spatial-element-tab-active-width', `${activeLink.offsetWidth}px`);
|
|
36
45
|
if (!linksElement.hasAttribute('data-spatial-element-tab-indicator-ready') && !readyFrame) {
|
|
@@ -169,9 +178,12 @@
|
|
|
169
178
|
left: 0;
|
|
170
179
|
z-index: 0;
|
|
171
180
|
width: var(--spatial-element-tab-active-width, 0px);
|
|
172
|
-
border-radius:
|
|
173
|
-
var(--spatial-element-tab-
|
|
174
|
-
|
|
181
|
+
border-radius:
|
|
182
|
+
calc(var(--spatial-element-tab-round-left, 0) * var(--spatial-element-tab-highlight-top-radius))
|
|
183
|
+
calc(var(--spatial-element-tab-round-right, 0) * var(--spatial-element-tab-highlight-top-radius))
|
|
184
|
+
calc(var(--spatial-element-tab-round-right, 0) * var(--spatial-element-tab-highlight-bottom-radius))
|
|
185
|
+
calc(var(--spatial-element-tab-round-left, 0) * var(--spatial-element-tab-highlight-bottom-radius));
|
|
186
|
+
background: var(--spatial-element-tab-background);
|
|
175
187
|
transform: translate3d(var(--spatial-element-tab-active-left, 0px), 0, 0);
|
|
176
188
|
pointer-events: none;
|
|
177
189
|
will-change: border-radius;
|
|
@@ -180,7 +192,8 @@
|
|
|
180
192
|
.spatial-element-tab-links:global([data-spatial-element-tab-indicator-ready]) .spatial-element-tab-selection {
|
|
181
193
|
transition:
|
|
182
194
|
width var(--spatial-element-tab-navigation-duration) var(--spatial-element-tab-navigation-easing),
|
|
183
|
-
transform var(--spatial-element-tab-navigation-duration) var(--spatial-element-tab-navigation-easing)
|
|
195
|
+
transform var(--spatial-element-tab-navigation-duration) var(--spatial-element-tab-navigation-easing),
|
|
196
|
+
border-radius var(--spatial-element-tab-navigation-duration) var(--spatial-element-tab-navigation-easing);
|
|
184
197
|
}
|
|
185
198
|
|
|
186
199
|
.spatial-element-tab-selection::after {
|
|
@@ -209,8 +222,7 @@
|
|
|
209
222
|
box-sizing: border-box;
|
|
210
223
|
height: 100%;
|
|
211
224
|
padding: 0 16px;
|
|
212
|
-
border-radius:
|
|
213
|
-
var(--spatial-element-tab-highlight-bottom-radius) var(--spatial-element-tab-highlight-bottom-radius);
|
|
225
|
+
border-radius: 0;
|
|
214
226
|
color: var(--spatial-element-navigation-ink, var(--spatial-element-ink));
|
|
215
227
|
background: transparent;
|
|
216
228
|
font-size: var(--spatial-element-tab-font-size);
|
|
@@ -221,6 +233,16 @@
|
|
|
221
233
|
transition: background-color 180ms ease;
|
|
222
234
|
}
|
|
223
235
|
|
|
236
|
+
.spatial-element-tab-list a:first-of-type {
|
|
237
|
+
border-start-start-radius: var(--spatial-element-tab-highlight-top-radius);
|
|
238
|
+
border-end-start-radius: var(--spatial-element-tab-highlight-bottom-radius);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.spatial-element-tab-list a:last-of-type {
|
|
242
|
+
border-start-end-radius: var(--spatial-element-tab-highlight-top-radius);
|
|
243
|
+
border-end-end-radius: var(--spatial-element-tab-highlight-bottom-radius);
|
|
244
|
+
}
|
|
245
|
+
|
|
224
246
|
a::before,
|
|
225
247
|
a > span {
|
|
226
248
|
grid-area: 1 / 1;
|
|
@@ -245,7 +267,7 @@
|
|
|
245
267
|
a.overview[aria-current='location'] svg { opacity: 1; }
|
|
246
268
|
|
|
247
269
|
.spatial-element-tab-links:not([data-spatial-element-tab-indicator-ready]) a[aria-current='location'] {
|
|
248
|
-
background:
|
|
270
|
+
background: var(--spatial-element-tab-background);
|
|
249
271
|
}
|
|
250
272
|
|
|
251
273
|
.spatial-element-tab-links:not([data-spatial-element-tab-indicator-ready]) a[aria-current='location']::after {
|
|
@@ -282,7 +304,7 @@
|
|
|
282
304
|
|
|
283
305
|
@media (prefers-reduced-motion: reduce) {
|
|
284
306
|
a,
|
|
285
|
-
.spatial-element-tab-selection {
|
|
307
|
+
.spatial-element-tab-links:global([data-spatial-element-tab-indicator-ready]) .spatial-element-tab-selection {
|
|
286
308
|
transition: none;
|
|
287
309
|
}
|
|
288
310
|
}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
<div class="icon-frame" class:wide data-spatial-control={label}>
|
|
27
27
|
<Panel
|
|
28
28
|
class="spatial-icon-panel"
|
|
29
|
+
borderColor="transparent"
|
|
29
30
|
shape={{ radius: radii.control, contentInset: 0 }}
|
|
30
31
|
theme={theme.panelTheme}
|
|
31
32
|
pointerReactive={false}
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
/* The renderer moves panel contents into its projection layer; retain the anchor size. */
|
|
52
53
|
.icon-frame :global(.spatial-icon-panel) { width: 40px; height: 40px; }
|
|
53
54
|
.spatial-icon-button {
|
|
55
|
+
outline: 1px solid var(--ps-border); outline-offset: -1px;
|
|
54
56
|
box-sizing: border-box; display: grid; place-items: center; width: 40px; height: 40px;
|
|
55
57
|
padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); background: transparent;
|
|
56
58
|
font: inherit; font-size: 13px;
|
|
@@ -15,7 +15,7 @@ import { HeadingSection } from '@page-sections/svelte';
|
|
|
15
15
|
hdr,
|
|
16
16
|
sectionLink,
|
|
17
17
|
cardSize,
|
|
18
|
-
|
|
18
|
+
cardShadow,
|
|
19
19
|
itemSpan,
|
|
20
20
|
textAlign,
|
|
21
21
|
mediaAspect,
|
|
@@ -39,7 +39,7 @@ import { HeadingSection } from '@page-sections/svelte';
|
|
|
39
39
|
section={{ id: 'elements', title: 'Elements' }}
|
|
40
40
|
list={spatialElements}
|
|
41
41
|
{cardSize}
|
|
42
|
-
{
|
|
42
|
+
{cardShadow}
|
|
43
43
|
{itemSpan}
|
|
44
44
|
{textAlign}
|
|
45
45
|
{mediaAspect}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
|
|
6
6
|
import { getStageVisualScrollPosition, STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame } from '@spatial-elements/core/stage/scrollFrame';
|
|
7
7
|
import { STAGE_PANEL_LAYOUT_EVENT } from '@spatial-elements/core/stage/panelContext';
|
|
8
|
-
import {
|
|
8
|
+
import { getSharedPanelBoxShadow } from '@spatial-elements/core/stage/panelShadow';
|
|
9
|
+
import { Header } from '@page-sections/svelte';
|
|
9
10
|
import { layoutTokens, type MenuItem } from '@page-sections/core';
|
|
10
11
|
import { STAGE_CONTEXT_KEY, type StageContext } from '@spatial-elements/core/stage/panelContext';
|
|
11
12
|
import { useSpatialTheme } from './brandContext.js';
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
const stageContext = getContext<StageContext | undefined>(STAGE_CONTEXT_KEY);
|
|
16
17
|
const readTheme = useSpatialTheme();
|
|
17
18
|
const theme = $derived(readTheme());
|
|
18
|
-
$effect(() => { void theme; void fixedDetail; void edgeToEdge; stageContext?.updatePanelAppearance?.(); });
|
|
19
|
+
$effect(() => { for (const element of rack?.querySelectorAll<HTMLElement>('.header, .satellite') ?? []) element.style.setProperty('--spatial-panel-default-shadow', getSharedPanelBoxShadow(theme.panelTheme.shadowIntensity ?? 0.2, theme.panelTheme.shadowColor)); void theme; void fixedDetail; void edgeToEdge; stageContext?.updatePanelAppearance?.(); });
|
|
19
20
|
const radii = $derived(resolveSpatialThemeRadii(theme));
|
|
20
21
|
let rack: HTMLDivElement;
|
|
21
22
|
let stage: HTMLElement | undefined;
|
|
@@ -43,48 +44,16 @@
|
|
|
43
44
|
if (previousMode !== `${enhancedScroll}/${fixedDetail}`) window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
|
|
44
45
|
}
|
|
45
46
|
function closePopovers() {
|
|
46
|
-
|
|
47
|
+
// Let the owning components close their state as well as their top-layer panels.
|
|
48
|
+
if (rack?.querySelector(':popover-open')) window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
|
|
47
49
|
for (const details of rack?.querySelectorAll<HTMLDetailsElement>('details[open]') ?? []) details.open = false;
|
|
48
50
|
}
|
|
49
51
|
afterNavigate(() => { void tick().then(updateMode); });
|
|
50
|
-
beforeNavigate(closePopovers);
|
|
52
|
+
beforeNavigate((navigation) => { if (!navigation.shallow || navigation.type === 'popstate') closePopovers(); });
|
|
51
53
|
|
|
52
54
|
onMount(() => {
|
|
53
55
|
stage = rack.closest<HTMLElement>('.stage') ?? undefined;
|
|
54
56
|
updateMode();
|
|
55
|
-
// Projected panel content lives above the ordinary DOM layer. Promote only
|
|
56
|
-
// open navigation dropdowns to the browser top layer, retaining their DOM
|
|
57
|
-
// ownership, shared markup and delegated events.
|
|
58
|
-
const dropdownStyles = new Map<HTMLElement, string | null>();
|
|
59
|
-
function restoreDropdown(panel: HTMLElement) {
|
|
60
|
-
if (!dropdownStyles.has(panel)) return;
|
|
61
|
-
if (panel.matches(':popover-open')) panel.hidePopover();
|
|
62
|
-
panel.removeAttribute('popover');
|
|
63
|
-
const style = dropdownStyles.get(panel);
|
|
64
|
-
if (style === null) panel.removeAttribute('style');
|
|
65
|
-
else panel.setAttribute('style', style!);
|
|
66
|
-
dropdownStyles.delete(panel);
|
|
67
|
-
}
|
|
68
|
-
function toggleDropdown(event: Event) {
|
|
69
|
-
if (!(event.target instanceof HTMLDetailsElement)) return;
|
|
70
|
-
const details = event.target;
|
|
71
|
-
const panel = details.querySelector<HTMLElement>(':scope > .settings-panel, :scope > .mobile-panel, :scope > .ps-submenu');
|
|
72
|
-
if (!panel || !('showPopover' in panel)) return;
|
|
73
|
-
// Nested menu entries stay inside their already elevated parent panel.
|
|
74
|
-
if (details.closest('.mobile-panel, .ps-submenu')) return;
|
|
75
|
-
if (!details.open) { restoreDropdown(panel); return; }
|
|
76
|
-
if (dropdownStyles.has(panel)) return;
|
|
77
|
-
const rect = panel.getBoundingClientRect();
|
|
78
|
-
dropdownStyles.set(panel, panel.getAttribute('style'));
|
|
79
|
-
panel.popover = 'manual';
|
|
80
|
-
Object.assign(panel.style, { position: 'fixed', inset: 'auto', margin: '0',
|
|
81
|
-
left: rect.left + 'px', top: rect.top + 'px', width: rect.width + 'px',
|
|
82
|
-
boxSizing: 'border-box', maxHeight: Math.max(0, innerHeight - rect.top - 12) + 'px', overflowY: 'auto' });
|
|
83
|
-
panel.showPopover();
|
|
84
|
-
}
|
|
85
|
-
rack.addEventListener('toggle', toggleDropdown, true);
|
|
86
|
-
window.addEventListener('scroll', closePopovers, { passive: true });
|
|
87
|
-
window.addEventListener('resize', closePopovers, { passive: true });
|
|
88
57
|
const observer = new MutationObserver(updateMode);
|
|
89
58
|
if (stage) observer.observe(stage, { attributes: true, attributeFilter: ['class'] });
|
|
90
59
|
// Shared navigation owns the boxes; the stage only enhances their surfaces.
|
|
@@ -92,6 +61,7 @@
|
|
|
92
61
|
const role = element.classList.contains('header') ? 'menu' : element.classList.contains('left') ? 'left' : 'right';
|
|
93
62
|
element.setAttribute('data-spatial-shell-' + role, '');
|
|
94
63
|
element.classList.add('spatial-shell-' + (role === 'menu' ? 'menu' : 'satellite'));
|
|
64
|
+
element.style.setProperty('--spatial-panel-default-shadow', getSharedPanelBoxShadow(theme.panelTheme.shadowIntensity ?? 0.2, theme.panelTheme.shadowColor));
|
|
95
65
|
element.dataset.stagePanelNativeContent = '';
|
|
96
66
|
return stageContext?.registerPanel({
|
|
97
67
|
getElement: () => element, getFrameElement: () => element, getSurfaceElement: () => element,
|
|
@@ -107,17 +77,13 @@
|
|
|
107
77
|
const stop = subscribeStageScrollFrame(frame => position(frame.scrollY), STAGE_SCROLL_PRIORITY.virtualDocument + 1);
|
|
108
78
|
window.addEventListener('resize', updateMode, { passive: true });
|
|
109
79
|
return () => {
|
|
110
|
-
rack.removeEventListener('toggle', toggleDropdown, true);
|
|
111
|
-
window.removeEventListener('scroll', closePopovers);
|
|
112
|
-
window.removeEventListener('resize', closePopovers);
|
|
113
|
-
for (const panel of dropdownStyles.keys()) restoreDropdown(panel);
|
|
114
80
|
releases.forEach(release => release?.()); stop(); observer.disconnect(); window.removeEventListener('resize', updateMode); };
|
|
115
81
|
});
|
|
116
82
|
</script>
|
|
117
83
|
|
|
118
84
|
<div class="spatial-shell-track" style:--ps-sticky-range={`${spatialLayoutTokens.menu.scrollThreshold}px`} data-spatial-navigation-shell>
|
|
119
|
-
<div bind:this={rack} class="spatial-shell-rack" data-stage-scroll-shell data-catalog-shell data-spatial-navigation-glass={theme.panelTheme.surface === 'glass' ? '' : undefined}>
|
|
120
|
-
{#if navigation}{@render navigation()}{:else}<
|
|
85
|
+
<div bind:this={rack} class="spatial-shell-rack" style:--spatial-panel-default-shadow={getSharedPanelBoxShadow(theme.panelTheme.shadowIntensity ?? 0.2, theme.panelTheme.shadowColor)} data-stage-scroll-shell data-catalog-shell data-spatial-navigation-glass={theme.panelTheme.surface === 'glass' ? '' : undefined}>
|
|
86
|
+
{#if navigation}{@render navigation()}{:else}<Header scrollBehavior="static" {menu} {items} {brand} {tools} {left} {right} />{/if}
|
|
121
87
|
</div>
|
|
122
88
|
</div>
|
|
123
89
|
<style>
|
|
@@ -131,7 +97,7 @@
|
|
|
131
97
|
background: rgb(var(--spatial-element-panel-tint-rgb) / var(--spatial-element-panel-tint-opacity));
|
|
132
98
|
-webkit-backdrop-filter: blur(var(--spatial-element-panel-backdrop-blur));
|
|
133
99
|
backdrop-filter: blur(var(--spatial-element-panel-backdrop-blur));
|
|
134
|
-
box-shadow: var(--spatial-element-panel-box-shadow);
|
|
100
|
+
box-shadow: var(--ps-navigation-shadow, var(--ps-panel-shadow, var(--spatial-element-panel-box-shadow, var(--spatial-panel-default-shadow))));
|
|
135
101
|
}
|
|
136
102
|
.spatial-shell-rack :global(.header) { border-radius: var(--spatial-element-panel-radius); }
|
|
137
103
|
.spatial-shell-rack :global(.satellite) { border-radius: var(--spatial-element-control-radius); }
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
{#snippet renderSummary(context: SpatialSummaryContext)}
|
|
15
15
|
{#if summary}{@render summary(context)}{:else}
|
|
16
|
-
<SpatialElementSummaryContent
|
|
16
|
+
<SpatialElementSummaryContent {...context} />
|
|
17
17
|
{/if}
|
|
18
18
|
{/snippet}
|
|
19
19
|
{@render children?.()}
|