@spatial-elements/sveltekit 1.0.0-beta.15 → 1.0.0-beta.19
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 +11 -2
- package/dist/spatial-element/ContentPage.svelte.d.ts +7 -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 +139 -32
- 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/SpatialElementBreadcrumbs.svelte +1 -1
- 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 +17 -2
- 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 +12 -45
- 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 +11 -8
- package/dist/spatial-element/carouselTextHit.js +2 -1
- package/dist/spatial-element/contentSidebars.js +15 -7
- package/dist/spatial-element/index.d.ts +2 -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 +8 -2
- package/dist/spatial-element/spatialThemeStyle.js +7 -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 +14 -4
- package/dist/stage/panelShadowStyle.d.ts +3 -0
- package/dist/stage/panelShadowStyle.js +11 -0
- package/package.json +9 -9
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
3
|
import { Card, type CardElements } from '@page-sections/svelte';
|
|
4
|
-
import type {
|
|
5
|
-
CardMediaAspect,
|
|
6
|
-
CardMediaFit,
|
|
7
|
-
CardVariant,
|
|
8
|
-
SurfaceTone
|
|
9
|
-
} from '@page-sections/core';
|
|
4
|
+
import type { CardMediaAspect, CardMediaFit, SurfaceTone } from '@page-sections/core';
|
|
10
5
|
import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
|
|
11
6
|
import { catalogViewLink } from '@spatial-elements/core/catalog/catalogViewLink';
|
|
12
7
|
import {
|
|
@@ -34,7 +29,7 @@
|
|
|
34
29
|
mediaFit = 'contain',
|
|
35
30
|
reserveEyebrow = false,
|
|
36
31
|
cardTone = 'standard',
|
|
37
|
-
|
|
32
|
+
cardShadow = false
|
|
38
33
|
}: {
|
|
39
34
|
spatialElement: SpatialListItem;
|
|
40
35
|
occurrence: string;
|
|
@@ -46,7 +41,7 @@
|
|
|
46
41
|
mediaFit?: CardMediaFit;
|
|
47
42
|
reserveEyebrow?: boolean;
|
|
48
43
|
cardTone?: SurfaceTone;
|
|
49
|
-
|
|
44
|
+
cardShadow?: boolean;
|
|
50
45
|
} = $props();
|
|
51
46
|
const readTheme = useSpatialTheme();
|
|
52
47
|
const brand = $derived(readTheme());
|
|
@@ -73,7 +68,6 @@
|
|
|
73
68
|
const ready = $derived.by(() => {
|
|
74
69
|
void reserveEyebrow;
|
|
75
70
|
void cardSize;
|
|
76
|
-
void cardVariant;
|
|
77
71
|
const enabled = active,
|
|
78
72
|
themeId = brand.id,
|
|
79
73
|
current = spatialElement,
|
|
@@ -102,7 +96,9 @@
|
|
|
102
96
|
bind(parts.root, 'container');
|
|
103
97
|
bind(parts.surface, 'summary-surface', 'spatial-element-card-surface');
|
|
104
98
|
bind(parts.media, 'geometry', 'spatial-element-card-geometry');
|
|
105
|
-
|
|
99
|
+
// Register the actual clipped label as the spatial text endpoint.
|
|
100
|
+
const titleLabel = parts.title.querySelector<HTMLElement>('.title-label') ?? parts.title;
|
|
101
|
+
bind(titleLabel, 'title');
|
|
106
102
|
bind(
|
|
107
103
|
parts.copy.querySelector('[data-ps-card-part="eyebrow"]'),
|
|
108
104
|
'eyebrow',
|
|
@@ -113,10 +109,45 @@
|
|
|
113
109
|
parts.media.dataset.catalogOccurrence = key;
|
|
114
110
|
parts.media.dataset.catalogSlot = 'catalog.card';
|
|
115
111
|
cleanups.push(mouseHover(parts.root).destroy);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
// The tilted card can briefly move behind its stationary presentation root.
|
|
113
|
+
// Keep that part of the card's hit area linked as well, without replaying
|
|
114
|
+
// events from the actual link or any nested interactive content.
|
|
115
|
+
const presentation = parts.root.closest<HTMLElement>('.spatial-card-root');
|
|
116
|
+
if (presentation) {
|
|
117
|
+
const activatePresentation = (event: MouseEvent) => {
|
|
118
|
+
if (event.target === presentation) activate(event);
|
|
119
|
+
};
|
|
120
|
+
presentation.addEventListener('click', activatePresentation);
|
|
121
|
+
cleanups.push(() => presentation.removeEventListener('click', activatePresentation));
|
|
122
|
+
}
|
|
123
|
+
const link = parts.title.querySelector('a');
|
|
119
124
|
if (link) {
|
|
125
|
+
// preserve-3d creates containing blocks. Size the stretched hit area from
|
|
126
|
+
// untransformed layout offsets so it still covers the complete card.
|
|
127
|
+
parts.root.dataset.spatialCardLinkReady = '';
|
|
128
|
+
const sizeLink = () => {
|
|
129
|
+
let left = 0,
|
|
130
|
+
top = 0;
|
|
131
|
+
for (
|
|
132
|
+
let node: HTMLElement | null = link;
|
|
133
|
+
node && node !== parts.root;
|
|
134
|
+
node = node.offsetParent as HTMLElement | null
|
|
135
|
+
) {
|
|
136
|
+
left += node.offsetLeft;
|
|
137
|
+
top += node.offsetTop;
|
|
138
|
+
}
|
|
139
|
+
link.style.setProperty('--spatial-card-link-left', -left + 'px');
|
|
140
|
+
link.style.setProperty('--spatial-card-link-top', -top + 'px');
|
|
141
|
+
link.style.setProperty('--spatial-card-link-width', parts.root.offsetWidth + 'px');
|
|
142
|
+
link.style.setProperty('--spatial-card-link-height', parts.root.offsetHeight + 'px');
|
|
143
|
+
};
|
|
144
|
+
const observer = new ResizeObserver(sizeLink);
|
|
145
|
+
for (const node of [parts.root, parts.copy, parts.title, link]) observer.observe(node);
|
|
146
|
+
sizeLink();
|
|
147
|
+
cleanups.push(() => {
|
|
148
|
+
observer.disconnect();
|
|
149
|
+
delete parts.root.dataset.spatialCardLinkReady;
|
|
150
|
+
});
|
|
120
151
|
link.dataset.catalogFocusKey = 'catalog:' + JSON.stringify([themeId, current.id, key]);
|
|
121
152
|
cleanups.push(
|
|
122
153
|
catalogViewLink(link, {
|
|
@@ -126,7 +157,7 @@
|
|
|
126
157
|
);
|
|
127
158
|
}
|
|
128
159
|
parts.title.removeAttribute('title');
|
|
129
|
-
cleanups.push(truncatedTitle(
|
|
160
|
+
cleanups.push(truncatedTitle(titleLabel, current.title).destroy);
|
|
130
161
|
return () => cleanups.reverse().forEach((stop) => stop());
|
|
131
162
|
};
|
|
132
163
|
});
|
|
@@ -135,6 +166,40 @@
|
|
|
135
166
|
event.preventDefault();
|
|
136
167
|
return;
|
|
137
168
|
}
|
|
169
|
+
|
|
170
|
+
const target = event.target as HTMLElement;
|
|
171
|
+
if (
|
|
172
|
+
!event.defaultPrevented &&
|
|
173
|
+
event.button === 0 &&
|
|
174
|
+
!target.closest('a, button, input, select, textarea')
|
|
175
|
+
) {
|
|
176
|
+
// A tilted card can move its hit plane between pointerdown and pointerup.
|
|
177
|
+
// The browser then targets their common article instead of its stretched
|
|
178
|
+
// anchor. Replay through the native link, preserving modifier-key behavior.
|
|
179
|
+
const link = (event.currentTarget as HTMLElement).querySelector<HTMLAnchorElement>(
|
|
180
|
+
'a.primary-link'
|
|
181
|
+
);
|
|
182
|
+
if (link) {
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
event.stopPropagation();
|
|
185
|
+
link.dispatchEvent(
|
|
186
|
+
new MouseEvent('click', {
|
|
187
|
+
bubbles: true,
|
|
188
|
+
cancelable: true,
|
|
189
|
+
button: event.button,
|
|
190
|
+
detail: event.detail,
|
|
191
|
+
ctrlKey: event.ctrlKey,
|
|
192
|
+
metaKey: event.metaKey,
|
|
193
|
+
shiftKey: event.shiftKey,
|
|
194
|
+
altKey: event.altKey,
|
|
195
|
+
clientX: event.clientX,
|
|
196
|
+
clientY: event.clientY,
|
|
197
|
+
view: event.view
|
|
198
|
+
})
|
|
199
|
+
);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
138
203
|
endpoints?.prefer(brand.id, spatialElement.id, occurrence);
|
|
139
204
|
sections?.activate({
|
|
140
205
|
brandId: brand.id,
|
|
@@ -153,9 +218,10 @@
|
|
|
153
218
|
{textAlign}
|
|
154
219
|
{mediaAspect}
|
|
155
220
|
{mediaFit}
|
|
221
|
+
mediaHoverZoom={false}
|
|
156
222
|
{reserveEyebrow}
|
|
157
223
|
tone={cardTone}
|
|
158
|
-
|
|
224
|
+
shadow={cardShadow}
|
|
159
225
|
headingLevel={3}
|
|
160
226
|
class="spatial-element-card"
|
|
161
227
|
onready={ready}
|
|
@@ -164,9 +230,6 @@
|
|
|
164
230
|
data-catalog-order={order}
|
|
165
231
|
data-catalog-occurrence={occurrence}
|
|
166
232
|
data-spatial-element-id={spatialElement.id}
|
|
167
|
-
data-catalog-focus-key={cardVariant === 'catalog'
|
|
168
|
-
? `catalog:${JSON.stringify([brand.id, spatialElement.id, occurrence])}`
|
|
169
|
-
: undefined}
|
|
170
233
|
aria-busy={busy || undefined}
|
|
171
234
|
onclick={activate}
|
|
172
235
|
onpointerenter={() => {
|
|
@@ -175,11 +238,8 @@
|
|
|
175
238
|
onpointerdown={() => {
|
|
176
239
|
if (active) prepare(spatialElement);
|
|
177
240
|
}}
|
|
178
|
-
|
|
179
|
-
if (
|
|
180
|
-
active &&
|
|
181
|
-
!(event.currentTarget as HTMLElement).hasAttribute('data-catalog-restoring-focus')
|
|
182
|
-
)
|
|
241
|
+
onfocusin={(event) => {
|
|
242
|
+
if (active && !(event.target as HTMLElement).hasAttribute('data-catalog-restoring-focus'))
|
|
183
243
|
prepare(spatialElement);
|
|
184
244
|
}}
|
|
185
245
|
>
|
|
@@ -198,6 +258,42 @@
|
|
|
198
258
|
<span class="catalog-status" role="status">{busy ? 'Opening spatial element…' : ''}</span>
|
|
199
259
|
|
|
200
260
|
<style>
|
|
261
|
+
:global(
|
|
262
|
+
.ps-card.spatial-element-card[data-catalog-card][data-spatial-card-link-ready]
|
|
263
|
+
[data-ps-card-part='copy']
|
|
264
|
+
),
|
|
265
|
+
:global(
|
|
266
|
+
.ps-card.spatial-element-card[data-catalog-card][data-spatial-card-link-ready]
|
|
267
|
+
[data-ps-card-part='title']
|
|
268
|
+
),
|
|
269
|
+
:global(
|
|
270
|
+
.ps-card.spatial-element-card[data-catalog-card][data-spatial-card-link-ready] .primary-link
|
|
271
|
+
) {
|
|
272
|
+
transform-style: preserve-3d;
|
|
273
|
+
}
|
|
274
|
+
:global(
|
|
275
|
+
.ps-card.spatial-element-card[data-catalog-card][data-spatial-card-link-ready] .primary-link
|
|
276
|
+
) {
|
|
277
|
+
display: block;
|
|
278
|
+
}
|
|
279
|
+
:global(
|
|
280
|
+
.ps-card.spatial-element-card[data-catalog-card][data-spatial-card-link-ready]
|
|
281
|
+
.primary-link::after
|
|
282
|
+
) {
|
|
283
|
+
inset: auto;
|
|
284
|
+
left: var(--spatial-card-link-left);
|
|
285
|
+
top: var(--spatial-card-link-top);
|
|
286
|
+
width: var(--spatial-card-link-width);
|
|
287
|
+
height: var(--spatial-card-link-height);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
:global(.ps-card.spatial-element-card[data-catalog-card]:has(.primary-link:focus-visible)) {
|
|
291
|
+
outline: 3px solid var(--ps-accent);
|
|
292
|
+
outline-offset: 4px;
|
|
293
|
+
}
|
|
294
|
+
:global(.ps-card.spatial-element-card[data-catalog-card] .primary-link:focus-visible::after) {
|
|
295
|
+
outline: none;
|
|
296
|
+
}
|
|
201
297
|
:global(.ps-card.spatial-element-card[data-catalog-card]) {
|
|
202
298
|
isolation: auto;
|
|
203
299
|
--ps-radius: var(--spatial-element-control-radius);
|
|
@@ -208,18 +304,21 @@
|
|
|
208
304
|
rotateX(var(--catalog-rotate-x, 0deg)) rotateY(var(--catalog-rotate-y, 0deg));
|
|
209
305
|
}
|
|
210
306
|
:global(.ps-card.spatial-element-card[data-catalog-card] [data-ps-card-part='media-frame']) {
|
|
307
|
+
pointer-events: none;
|
|
211
308
|
overflow: visible;
|
|
212
309
|
}
|
|
213
|
-
:global(.ps-card.spatial-element-card[data-catalog-card] [data-ps-card-part='media'])
|
|
214
|
-
:global(.ps-card.spatial-element-card[data-catalog-card] [data-ps-card-part='copy']) {
|
|
310
|
+
:global(.ps-card.spatial-element-card[data-catalog-card] [data-ps-card-part='media']) {
|
|
215
311
|
transform-style: preserve-3d;
|
|
216
312
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
313
|
+
/* Contained spatial posters share the model's depth and may leave the frame.
|
|
314
|
+
* Page Sections' image viewport otherwise flattens and clips that 3D fallback. */
|
|
315
|
+
:global(.ps-card.spatial-element-card[data-catalog-card][data-media-fit='contain'] .media-viewport) {
|
|
316
|
+
overflow: visible;
|
|
317
|
+
isolation: auto;
|
|
318
|
+
transform-style: preserve-3d;
|
|
220
319
|
}
|
|
221
320
|
:global(
|
|
222
|
-
.ps-card.spatial-element-card[data-catalog-card]:is([data-mouse-hover], :focus-visible)
|
|
321
|
+
.ps-card.spatial-element-card[data-catalog-card]:is([data-mouse-hover], :has(:focus-visible))
|
|
223
322
|
[data-ps-card-part='surface']
|
|
224
323
|
) {
|
|
225
324
|
border-color: var(--ps-accent);
|
|
@@ -236,7 +335,7 @@
|
|
|
236
335
|
transition: opacity 180ms ease;
|
|
237
336
|
}
|
|
238
337
|
:global(
|
|
239
|
-
.ps-card.spatial-element-card[data-catalog-card]:is([data-mouse-hover], :focus-visible)
|
|
338
|
+
.ps-card.spatial-element-card[data-catalog-card]:is([data-mouse-hover], :has(:focus-visible))
|
|
240
339
|
[data-ps-card-part='surface']::after
|
|
241
340
|
) {
|
|
242
341
|
opacity: 1;
|
|
@@ -245,7 +344,12 @@
|
|
|
245
344
|
opacity: var(--spatial-card-frozen-after-opacity) !important;
|
|
246
345
|
transition-property: none !important;
|
|
247
346
|
}
|
|
248
|
-
:global(.
|
|
347
|
+
:global(.spatial-element-card[data-spatial-card-appearance-frozen]::after) {
|
|
348
|
+
border-color: var(--spatial-card-frozen-after-border) !important;
|
|
349
|
+
}
|
|
350
|
+
:global(
|
|
351
|
+
.ps-card.spatial-element-card[data-catalog-card] [data-ps-card-part='title'] .title-label
|
|
352
|
+
) {
|
|
249
353
|
transform: translateZ(var(--card-title-depth, 0px));
|
|
250
354
|
}
|
|
251
355
|
:global(.ps-card.spatial-element-card[data-catalog-card] [data-ps-card-part='eyebrow']) {
|
|
@@ -258,7 +362,9 @@
|
|
|
258
362
|
transform 260ms ease,
|
|
259
363
|
text-shadow 260ms ease;
|
|
260
364
|
}
|
|
261
|
-
:global(
|
|
365
|
+
:global(
|
|
366
|
+
.ps-card.spatial-element-card[data-catalog-card]:is([data-mouse-hover], :has(:focus-visible))
|
|
367
|
+
) {
|
|
262
368
|
--card-eyebrow-depth: 40px;
|
|
263
369
|
--card-title-depth: 64px;
|
|
264
370
|
--card-model-depth: 96px;
|
|
@@ -302,6 +408,7 @@
|
|
|
302
408
|
@media (prefers-reduced-motion: reduce) {
|
|
303
409
|
:global(.ps-card.spatial-element-card[data-catalog-card]),
|
|
304
410
|
:global(.ps-card.spatial-element-card[data-catalog-card] [data-shared-role]),
|
|
411
|
+
:global(.ps-card.spatial-element-card[data-catalog-card] [data-ps-card-part='title'] .title-label),
|
|
305
412
|
.catalog-poster {
|
|
306
413
|
transform: none;
|
|
307
414
|
transition: none;
|
|
@@ -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 = {
|
|
@@ -12,7 +12,7 @@ type $$ComponentProps = {
|
|
|
12
12
|
mediaFit?: CardMediaFit;
|
|
13
13
|
reserveEyebrow?: boolean;
|
|
14
14
|
cardTone?: SurfaceTone;
|
|
15
|
-
|
|
15
|
+
cardShadow?: boolean;
|
|
16
16
|
};
|
|
17
17
|
declare const SpatialCardPresentation: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
18
18
|
type SpatialCardPresentation = ReturnType<typeof SpatialCardPresentation>;
|
|
@@ -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;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
const resolved = $derived(items.map(item => ({ ...item, href: item.href ? resolve(...([item.href] as unknown as Parameters<typeof resolve>)) : undefined })));
|
|
43
43
|
</script>
|
|
44
44
|
<div bind:this={element} class="breadcrumbs spatial-content-width" style:translate={travel} style:filter={focus > 0 ? `blur(${focus * 4}px)` : 'none'} data-stage-dom-content data-catalog-transition-dom={transition}>
|
|
45
|
-
<Breadcrumbs items={resolved} />
|
|
45
|
+
<Breadcrumbs items={resolved} homeHref={resolve(...(['/'] as unknown as Parameters<typeof resolve>))} />
|
|
46
46
|
</div>
|
|
47
47
|
<style>
|
|
48
48
|
.breadcrumbs { height: var(--ps-breadcrumb-height); padding-inline: var(--ps-grid-gap, 12px); box-sizing: border-box; pointer-events: auto; overflow-x: auto; scrollbar-width: none; direction: rtl; }
|
|
@@ -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);
|