@spatial-elements/sveltekit 0.1.0-beta.2 → 1.0.0-beta.11
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 +18 -13
- package/dist/catalog/ScrollNavigationBridge.svelte +172 -47
- package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +9 -2
- package/dist/catalog/catalogNavigation.js +3 -2
- package/dist/catalog/catalogSummaryTransfer.d.ts +16 -0
- package/dist/catalog/catalogSummaryTransfer.js +79 -0
- package/dist/catalog/catalogTransition.css +58 -3
- package/dist/catalog/interruptedPresentation.d.ts +10 -0
- package/dist/catalog/interruptedPresentation.js +29 -0
- package/dist/catalog/presentationCleanup.d.ts +4 -0
- package/dist/catalog/presentationCleanup.js +20 -0
- package/dist/catalog/stagedCatalogNavigation.d.ts +44 -0
- package/dist/catalog/stagedCatalogNavigation.js +403 -0
- package/dist/catalog/stagedDomReveal.d.ts +8 -0
- package/dist/catalog/stagedDomReveal.js +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/spatial-element/BrandStageShell.svelte +52 -71
- package/dist/spatial-element/BrandStageShell.svelte.d.ts +31 -4
- package/dist/spatial-element/CarouselSpatialElement.svelte +152 -200
- package/dist/spatial-element/CarouselSpatialElement.svelte.d.ts +5 -1
- package/dist/spatial-element/ContentBlock.svelte +7 -0
- package/dist/spatial-element/ContentBlock.svelte.d.ts +9 -0
- package/dist/spatial-element/ContentGrid.svelte +7 -0
- package/dist/spatial-element/ContentGrid.svelte.d.ts +8 -0
- package/dist/spatial-element/ContentPage.svelte +51 -55
- package/dist/spatial-element/ContentPage.svelte.d.ts +14 -3
- package/dist/spatial-element/InteractionGesture.svelte +39 -0
- package/dist/spatial-element/InteractionGesture.svelte.d.ts +7 -0
- package/dist/spatial-element/OverflowControls.svelte +129 -0
- package/dist/spatial-element/OverflowControls.svelte.d.ts +9 -0
- package/dist/spatial-element/PointerHint.svelte +80 -0
- package/dist/spatial-element/PointerHint.svelte.d.ts +3 -0
- package/dist/spatial-element/Section.svelte +25 -106
- package/dist/spatial-element/Section.svelte.d.ts +1 -0
- package/dist/spatial-element/SectionSurfaceGroup.svelte +8 -0
- package/dist/spatial-element/SectionSurfaceGroup.svelte.d.ts +8 -0
- package/dist/spatial-element/SpaceMouseControl.svelte +159 -0
- package/dist/spatial-element/SpaceMouseControl.svelte.d.ts +7 -0
- package/dist/spatial-element/SpaceMouseIcon.svelte +12 -0
- package/dist/spatial-element/SpaceMouseIcon.svelte.d.ts +26 -0
- package/dist/spatial-element/SpatialCardGridSection.svelte +79 -0
- package/dist/spatial-element/SpatialCardGridSection.svelte.d.ts +11 -0
- package/dist/spatial-element/SpatialCardPresentation.svelte +311 -0
- package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +19 -0
- package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
- package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialCarouselSection.svelte +754 -0
- package/dist/spatial-element/{CarouselSection.svelte.d.ts → SpatialCarouselSection.svelte.d.ts} +5 -5
- package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +12 -65
- package/dist/spatial-element/SpatialElementCard.svelte +54 -238
- package/dist/spatial-element/SpatialElementCard.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialElementHelp.svelte +300 -0
- package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
- package/dist/spatial-element/SpatialElementMediaRail.svelte +322 -52
- package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +4 -1
- package/dist/spatial-element/SpatialElementNativeMedia.svelte +101 -0
- package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialElementPage.svelte +156 -71
- package/dist/spatial-element/SpatialElementPage.svelte.d.ts +10 -3
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +89 -105
- package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +6 -1
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +198 -0
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +23 -0
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +48 -380
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +2 -1
- package/dist/spatial-element/SpatialElementTabList.svelte +40 -17
- package/dist/spatial-element/SpatialElementTabList.svelte.d.ts +2 -1
- package/dist/spatial-element/SpatialElementTabs.svelte +61 -18
- package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +3 -1
- package/dist/spatial-element/SpatialElementViewToggle.svelte +54 -0
- package/dist/spatial-element/SpatialElementViewToggle.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialIconButton.svelte +66 -0
- package/dist/spatial-element/SpatialIconButton.svelte.d.ts +17 -0
- package/dist/spatial-element/SpatialListPage.svelte +37 -8
- package/dist/spatial-element/SpatialListPage.svelte.d.ts +4 -1
- package/dist/spatial-element/SpatialMediaIndicator.svelte +16 -0
- package/dist/spatial-element/SpatialMediaIndicator.svelte.d.ts +26 -0
- package/dist/spatial-element/SpatialNavigationShell.svelte +138 -0
- package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +15 -0
- package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
- package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialSummaryRoot.svelte +80 -0
- package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
- package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
- package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
- package/dist/spatial-element/brandContext.d.ts +1 -1
- package/dist/spatial-element/brandContext.js +1 -1
- package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
- package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
- package/dist/spatial-element/carouselTextHit.d.ts +2 -0
- package/dist/spatial-element/carouselTextHit.js +17 -0
- package/dist/spatial-element/contentSidebars.d.ts +3 -0
- package/dist/spatial-element/contentSidebars.js +56 -0
- package/dist/spatial-element/index.d.ts +19 -3
- package/dist/spatial-element/index.js +12 -2
- package/dist/spatial-element/layout.generated.css +363 -0
- package/dist/spatial-element/messagesContext.d.ts +3 -0
- package/dist/spatial-element/messagesContext.js +10 -0
- package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
- package/dist/spatial-element/presentationBoxFreeze.js +35 -0
- package/dist/spatial-element/spatialCardGrid.d.ts +12 -0
- package/dist/spatial-element/spatialCardGrid.js +1 -0
- package/dist/spatial-element/spatialPageContext.d.ts +4 -0
- package/dist/spatial-element/spatialPageContext.js +9 -0
- package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
- package/dist/spatial-element/spatialPresentationOwner.js +2 -0
- package/dist/spatial-element/spatialSummary.d.ts +43 -0
- package/dist/spatial-element/spatialSummary.js +1 -0
- package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
- package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
- package/dist/spatial-element/spatialThemeStyle.d.ts +3 -0
- package/dist/spatial-element/spatialThemeStyle.js +69 -0
- package/dist/spatial-element/truncatedTitle.d.ts +5 -0
- package/dist/spatial-element/truncatedTitle.js +28 -0
- package/dist/stage/ButtonGroup.svelte +152 -0
- package/dist/stage/ButtonGroup.svelte.d.ts +24 -0
- package/dist/stage/Panel.svelte +72 -14
- package/dist/stage/Panel.svelte.d.ts +14 -2
- package/dist/stage/Stage.svelte +471 -51
- package/dist/stage/Stage.svelte.d.ts +8 -1
- package/dist/stage/StageViewport.svelte +15 -2
- package/dist/stage/authoredStyle.d.ts +4 -0
- package/dist/stage/authoredStyle.js +17 -0
- package/dist/stage/buttonGroup.d.ts +9 -0
- package/dist/stage/buttonGroup.js +1 -0
- package/logo.svg +225 -0
- package/package.json +9 -6
- package/dist/spatial-element/CarouselSection.svelte +0 -350
- package/dist/spatial-element/ListSection.svelte +0 -30
- package/dist/spatial-element/ListSection.svelte.d.ts +0 -8
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext, onMount, setContext } from 'svelte';
|
|
3
|
+
import ShoppingCart from 'lucide-svelte/icons/shopping-cart';
|
|
4
|
+
import { SpatialElementPaneController } from '@spatial-elements/core/spatial-element/SpatialElementPaneController';
|
|
5
|
+
import { resolveActiveDetailSection } from '@spatial-elements/core/spatial-element/activeDetailSection';
|
|
6
|
+
import { resolveDetailLayout } from '@spatial-elements/core/spatial-element/responsiveLayout';
|
|
3
7
|
import {
|
|
4
8
|
CATALOG_ENDPOINTS,
|
|
5
9
|
type CatalogEndpointRegistry
|
|
@@ -11,30 +15,69 @@
|
|
|
11
15
|
STAGE_ANCHOR_NAVIGATION_EVENT,
|
|
12
16
|
type StageAnchorNavigationDetail
|
|
13
17
|
} from '@spatial-elements/core/stage/scrollAnimation';
|
|
14
|
-
import { STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame } from '@spatial-elements/core/stage/scrollFrame';
|
|
18
|
+
import { getStageVisualScrollPosition, STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame } from '@spatial-elements/core/stage/scrollFrame';
|
|
15
19
|
import SpatialElementBreadcrumbs from './SpatialElementBreadcrumbs.svelte';
|
|
16
20
|
import { useSpatialTheme } from './brandContext.js';
|
|
17
21
|
import SpatialElementMediaRail from './SpatialElementMediaRail.svelte';
|
|
22
|
+
import SpatialElementNativeMedia from './SpatialElementNativeMedia.svelte';
|
|
23
|
+
import { resolveSpatialElementMedia } from '@spatial-elements/core/spatial-element/spatialElementMedia';
|
|
18
24
|
import SpatialElementSummaryPanel from './SpatialElementSummaryPanel.svelte';
|
|
25
|
+
import SpatialElementHelp from './SpatialElementHelp.svelte';
|
|
19
26
|
import SpatialElementStickyHeader from './SpatialElementStickyHeader.svelte';
|
|
20
27
|
import SpatialElementTabs from './SpatialElementTabs.svelte';
|
|
28
|
+
import SectionSurfaceGroup from './SectionSurfaceGroup.svelte';
|
|
29
|
+
import './layout.generated.css';
|
|
21
30
|
import { SpatialElementDockController } from '@spatial-elements/core/spatial-element/SpatialElementDockController';
|
|
22
31
|
import { SPATIAL_ELEMENT_SECTION_REGISTRY_KEY, SpatialElementSectionRegistry } from '@spatial-elements/core/spatial-element/spatialElementSectionRegistry';
|
|
23
|
-
import type { SpatialElementData, SpatialElementSectionNavigationItem } from '@spatial-elements/core/spatial-element/types';
|
|
32
|
+
import type { SpatialElementData, SpatialElementMediaItem, SpatialElementSectionNavigationItem } from '@spatial-elements/core/spatial-element/types';
|
|
33
|
+
import { resolveSpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
34
|
+
import { registerSpatialPage } from './spatialPageContext.js';
|
|
35
|
+
import { STAGE_CONTEXT_KEY, type StageContext } from '@spatial-elements/core/stage/panelContext';
|
|
24
36
|
|
|
25
37
|
const SPATIAL_ELEMENT_OVERVIEW_SECTION = {
|
|
26
38
|
id: 'overview',
|
|
27
39
|
title: 'Übersicht'
|
|
28
40
|
} satisfies SpatialElementSectionNavigationItem;
|
|
29
|
-
// Switch while the next panel enters the upper reading area, before it reaches the sticky tabs.
|
|
30
|
-
const SPATIAL_ELEMENT_SECTION_ACTIVATION_VIEWPORT_RATIO = 0.25;
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
interface Props {
|
|
43
|
+
/** Complete element document from this page's load function. Registers assets with the enclosing shell. */
|
|
44
|
+
spatialElement: SpatialElementData;
|
|
45
|
+
/** Optional compact controls beside the action in both scroll and 3XL pane headers. */
|
|
46
|
+
headerDetails?: Snippet;
|
|
47
|
+
/** Shared header action icon. Use the same snippet as the summary actionIcon. */
|
|
48
|
+
actionIcon?: Snippet;
|
|
49
|
+
/** Detail sections; Section components automatically populate the tab navigation. */
|
|
50
|
+
children?: Snippet;
|
|
51
|
+
}
|
|
52
|
+
let { spatialElement: element, children, headerDetails, actionIcon }: Props = $props();
|
|
53
|
+
const readTheme = useSpatialTheme();
|
|
54
|
+
const brand = $derived(readTheme());
|
|
55
|
+
const spatialElement = $derived.by(() => {
|
|
56
|
+
const resolved = resolveSpatialElementData(element, brand.id);
|
|
57
|
+
return { ...resolved, media: resolveSpatialElementMedia(resolved.media) };
|
|
58
|
+
});
|
|
59
|
+
let mediaSelection = $state<{ elementId: string; mediaId: string }>();
|
|
60
|
+
const selectedMedia = $derived(spatialElement.media.find(media =>
|
|
61
|
+
mediaSelection?.elementId === spatialElement.id && media.id === mediaSelection.mediaId) ?? spatialElement.media[0]);
|
|
62
|
+
function selectMedia(media: SpatialElementMediaItem) {
|
|
63
|
+
mediaSelection = { elementId: spatialElement.id, mediaId: media.id };
|
|
64
|
+
}
|
|
65
|
+
$effect(() => { if (mediaSelection?.elementId !== element?.id) mediaSelection = undefined; });
|
|
66
|
+
// During route teardown Kit can clear the outgoing page's data before unmount.
|
|
67
|
+
// Read raw assets here, so the parent stage never evaluates outgoing DOM-derived content.
|
|
68
|
+
registerSpatialPage(() => element ? { kind: 'detail', element } : { kind: 'content', hdr: '' });
|
|
34
69
|
const endpoints = getContext<CatalogEndpointRegistry | undefined>(CATALOG_ENDPOINTS);
|
|
70
|
+
const stageContext = getContext<StageContext | undefined>(STAGE_CONTEXT_KEY);
|
|
35
71
|
let sections = $state<SpatialElementSectionNavigationItem[]>([]);
|
|
36
72
|
let activeSectionId = $state<string | undefined>(SPATIAL_ELEMENT_OVERVIEW_SECTION.id);
|
|
37
73
|
let mainElement: HTMLElement;
|
|
74
|
+
let tabList = $state<HTMLElement>();
|
|
75
|
+
let splitPane = $state(false);
|
|
76
|
+
let paneController = $state.raw<SpatialElementPaneController>();
|
|
77
|
+
const paneTint = $derived(typeof brand.panelTheme.tint === 'number'
|
|
78
|
+
? `#${brand.panelTheme.tint.toString(16).padStart(6, '0')}`
|
|
79
|
+
: typeof brand.panelTheme.tint === 'object' ? brand.panelTheme.tint.getStyle()
|
|
80
|
+
: brand.panelTheme.tint ?? '#ffffff');
|
|
38
81
|
let navigationTargetId: string | undefined;
|
|
39
82
|
let scrollSpyFrame = 0;
|
|
40
83
|
const navigationSections = $derived([SPATIAL_ELEMENT_OVERVIEW_SECTION, ...sections]);
|
|
@@ -49,23 +92,32 @@
|
|
|
49
92
|
activeSectionId = SPATIAL_ELEMENT_OVERVIEW_SECTION.id;
|
|
50
93
|
}
|
|
51
94
|
});
|
|
95
|
+
$effect(() => {
|
|
96
|
+
paneController?.setFocus(stageContext?.getZoomUiFocus?.() ?? stageContext?.getZoomFocus?.() ?? 0,
|
|
97
|
+
Boolean(stageContext?.isFullscreen?.()));
|
|
98
|
+
});
|
|
99
|
+
function invokePaneAction() {
|
|
100
|
+
mainElement.querySelector<HTMLElement>('[data-spatial-detail-pane-body] [data-catalog-rich-shared="primary-action"]')?.click();
|
|
101
|
+
}
|
|
52
102
|
|
|
53
103
|
function updateActiveSection() {
|
|
54
104
|
if (navigationTargetId || !mainElement?.isConnected) return;
|
|
55
|
-
const
|
|
105
|
+
const metrics = stageContext?.getLayoutMetrics?.('stable');
|
|
106
|
+
const pane = metrics ? resolveDetailLayout(metrics).pane : undefined;
|
|
107
|
+
const offset = pane?.body.y ?? (
|
|
56
108
|
Number.parseFloat(
|
|
57
109
|
getComputedStyle(mainElement).getPropertyValue('--spatial-element-section-scroll-offset')
|
|
58
|
-
) || 24;
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
110
|
+
) || 24);
|
|
111
|
+
const readingBottom = pane ? pane.body.y + pane.body.height : window.innerHeight;
|
|
112
|
+
const bounds = sections.flatMap(section => {
|
|
113
|
+
const rect = document.getElementById(section.id)?.getBoundingClientRect();
|
|
114
|
+
return rect ? [{ id: section.id, top: rect.top, bottom: rect.bottom }] : [];
|
|
115
|
+
});
|
|
116
|
+
const scrollOwner = document.scrollingElement ?? document.documentElement;
|
|
117
|
+
const nextActiveId = resolveActiveDetailSection(bounds, offset, readingBottom,
|
|
118
|
+
getStageVisualScrollPosition().scrollY,
|
|
119
|
+
Math.max(0, scrollOwner.scrollHeight - scrollOwner.clientHeight),
|
|
120
|
+
SPATIAL_ELEMENT_OVERVIEW_SECTION.id);
|
|
69
121
|
if (nextActiveId !== activeSectionId) activeSectionId = nextActiveId;
|
|
70
122
|
}
|
|
71
123
|
|
|
@@ -88,7 +140,15 @@
|
|
|
88
140
|
}
|
|
89
141
|
|
|
90
142
|
onMount(() => {
|
|
91
|
-
|
|
143
|
+
const orderSections = () => sectionRegistry.order([...mainElement.querySelectorAll<HTMLElement>('[data-ps-section]')].map(node => node.id));
|
|
144
|
+
const sectionOrder = new MutationObserver(orderSections);
|
|
145
|
+
sectionOrder.observe(mainElement, { childList: true, subtree: true });
|
|
146
|
+
orderSections();
|
|
147
|
+
const unregisterMedia = stageContext?.registerDetailMedia?.(() => element ? selectedMedia.kind : 'minimap');
|
|
148
|
+
paneController = new SpatialElementPaneController(mainElement,
|
|
149
|
+
() => stageContext?.getLayoutMetrics?.('stable'), (split) => { splitPane = split; });
|
|
150
|
+
paneController.start();
|
|
151
|
+
const dock = new SpatialElementDockController(mainElement, () => stageContext?.getLayoutMetrics?.('stable'), () => tabList);
|
|
92
152
|
dock.start();
|
|
93
153
|
const unregisterPresentation = endpoints?.registerPresentation(
|
|
94
154
|
{ brandId: brand.id, spatialElementId: spatialElement.id },
|
|
@@ -114,6 +174,9 @@
|
|
|
114
174
|
scheduleScrollSpy();
|
|
115
175
|
|
|
116
176
|
return () => {
|
|
177
|
+
sectionOrder.disconnect();
|
|
178
|
+
unregisterMedia?.();
|
|
179
|
+
paneController?.destroy();
|
|
117
180
|
cancelAnimationFrame(scrollSpyFrame);
|
|
118
181
|
window.removeEventListener(STAGE_ANCHOR_NAVIGATION_EVENT, handleAnchorNavigation);
|
|
119
182
|
window.removeEventListener(STAGE_ANCHOR_NAVIGATION_END_EVENT, handleAnchorNavigationEnd);
|
|
@@ -135,23 +198,40 @@
|
|
|
135
198
|
data-spatial-element-root
|
|
136
199
|
data-spatial-element-id={spatialElement.id}
|
|
137
200
|
data-brand-id={spatialElement.brandId}
|
|
201
|
+
data-spatial-selected-media={selectedMedia.kind}
|
|
202
|
+
style:--spatial-pane-tint={paneTint}
|
|
203
|
+
style:--spatial-pane-tint-opacity={`${Math.min(1, Math.max(0, brand.panelTheme.tintOpacity ?? 0.28)) * 100}%`}
|
|
204
|
+
style:--spatial-pane-blur={`${Math.min(100, Math.max(0, brand.panelTheme.backdropBlur ?? 5))}px`}
|
|
138
205
|
>
|
|
139
|
-
<
|
|
140
|
-
items={spatialElement.breadcrumbs
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
206
|
+
<div class="spatial-element-pane-heading" data-spatial-detail-pane-header data-spatial-detail-fixed>
|
|
207
|
+
<SpatialElementBreadcrumbs items={spatialElement.breadcrumbs} />
|
|
208
|
+
<div class="spatial-element-pane-title-row">
|
|
209
|
+
<p class="spatial-element-pane-title">{spatialElement.title}</p>
|
|
210
|
+
{#if spatialElement.eyebrow}<p class="spatial-element-pane-eyebrow">{spatialElement.eyebrow}</p>{/if}
|
|
211
|
+
{@render headerDetails?.()}
|
|
212
|
+
{#if spatialElement.action}
|
|
213
|
+
<button type="button" class="spatial-element-pane-action" onclick={invokePaneAction}
|
|
214
|
+
aria-label={spatialElement.action.ariaLabel ?? spatialElement.action.label}>
|
|
215
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart size={24} aria-hidden="true" />{/if}
|
|
216
|
+
</button>
|
|
217
|
+
{/if}
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
<SpatialElementStickyHeader {headerDetails} {actionIcon} {activeSectionId} {spatialElement} sections={navigationSections} />
|
|
221
|
+
<div class="spatial-element-pane-surface" data-spatial-detail-pane-surface data-spatial-detail-fixed aria-hidden="true"></div>
|
|
222
|
+
<div class="spatial-element-pane-cover spatial-element-pane-cover-top" data-spatial-detail-fixed aria-hidden="true"></div>
|
|
223
|
+
<div class="spatial-element-pane-cover spatial-element-pane-cover-bottom" data-spatial-detail-fixed aria-hidden="true"></div>
|
|
224
|
+
<div class="spatial-element-presentation">
|
|
147
225
|
<section
|
|
148
226
|
id={SPATIAL_ELEMENT_OVERVIEW_SECTION.id}
|
|
149
227
|
class="spatial-element-hero"
|
|
150
228
|
data-spatial-element-tab-target
|
|
151
229
|
data-stage-scroll-top
|
|
152
230
|
aria-labelledby="spatial-element-title"
|
|
231
|
+
data-spatial-detail-media-region
|
|
232
|
+
data-spatial-detail-fixed
|
|
153
233
|
>
|
|
154
|
-
<SpatialElementMediaRail {spatialElement} />
|
|
234
|
+
<SpatialElementMediaRail {spatialElement} selectedId={selectedMedia.id} onselect={selectMedia} />
|
|
155
235
|
|
|
156
236
|
<StageViewport
|
|
157
237
|
catalogEndpoint={{
|
|
@@ -164,54 +244,61 @@
|
|
|
164
244
|
data-catalog-geometry
|
|
165
245
|
data-spatial-element-id={spatialElement.id}
|
|
166
246
|
data-catalog-slot="detail.hero"
|
|
167
|
-
fallbackSrc={spatialElement.
|
|
247
|
+
fallbackSrc={selectedMedia.kind === 'minimap' ? spatialElement.fallbackImage : undefined}
|
|
168
248
|
fallbackAlt={`${brand.name} ${spatialElement.title}`}
|
|
169
|
-
aria-hidden={spatialElement.
|
|
170
|
-
|
|
249
|
+
aria-hidden={selectedMedia.kind === 'minimap' && !spatialElement.fallbackImage ? 'true' : undefined}
|
|
250
|
+
>
|
|
251
|
+
{#if selectedMedia.kind !== 'minimap'}
|
|
252
|
+
{#key `${spatialElement.id}:${selectedMedia.id}`}<SpatialElementNativeMedia media={selectedMedia} />{/key}
|
|
253
|
+
{/if}
|
|
254
|
+
</StageViewport>
|
|
171
255
|
|
|
172
|
-
<
|
|
256
|
+
{#key spatialElement.id}<SpatialElementHelp active={selectedMedia.kind === 'minimap'} />{/key}
|
|
173
257
|
</section>
|
|
174
|
-
|
|
258
|
+
<div class="spatial-element-pane-body" data-spatial-detail-pane-body data-stage-scroll-viewport>
|
|
259
|
+
{#key spatialElement.id}<SpatialElementSummaryPanel {spatialElement} nativeContent={splitPane} />{/key}
|
|
175
260
|
<div class="spatial-element-content">
|
|
176
|
-
<div class="spatial-element-section-list" data-catalog-transition-dom="enter">
|
|
177
|
-
{@render children?.()}
|
|
261
|
+
<div class="spatial-element-section-list spatial-content-width spatial-content-container" data-catalog-transition-dom="enter">
|
|
262
|
+
<SectionSurfaceGroup>{@render children?.()}</SectionSurfaceGroup>
|
|
178
263
|
</div>
|
|
179
264
|
<!-- Read after the section snippet has registered its metadata during SSR. -->
|
|
180
|
-
<SpatialElementTabs {activeSectionId} sections={[SPATIAL_ELEMENT_OVERVIEW_SECTION, ...sections]} />
|
|
265
|
+
<SpatialElementTabs bind:tabList {activeSectionId} sections={[SPATIAL_ELEMENT_OVERVIEW_SECTION, ...sections]} />
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
<div class="spatial-element-pane-submenu-shell" data-spatial-detail-pane-submenu-shell data-spatial-detail-fixed>
|
|
270
|
+
<div class="spatial-element-pane-submenu" data-spatial-detail-pane-submenu aria-hidden="true" inert></div>
|
|
181
271
|
</div>
|
|
182
272
|
</main>
|
|
183
273
|
|
|
184
274
|
<style>
|
|
185
275
|
.spatial-element-main {
|
|
186
276
|
--spatial-element-section-scroll-offset: 150px;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
width: min(1550px, calc(100vw - 120px), 100%);
|
|
190
|
-
margin: 0 auto;
|
|
277
|
+
width: 100%;
|
|
278
|
+
margin: 0;
|
|
191
279
|
}
|
|
280
|
+
.spatial-element-presentation { position: relative; }
|
|
281
|
+
.spatial-element-pane-heading { display: contents; }
|
|
282
|
+
.spatial-element-pane-title-row, .spatial-element-pane-surface,
|
|
283
|
+
.spatial-element-pane-cover, .spatial-element-pane-submenu-shell { display: none; }
|
|
192
284
|
|
|
193
285
|
.spatial-element-hero {
|
|
194
286
|
position: relative;
|
|
195
287
|
box-sizing: border-box;
|
|
196
|
-
display:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
align-items: start;
|
|
200
|
-
width: calc(100vw - var(--spatial-element-hero-edge-gap) - var(--spatial-element-hero-edge-gap));
|
|
201
|
-
min-height: clamp(610px, calc(100vh - 230px), 760px);
|
|
202
|
-
margin-left: calc(50% - 50vw + var(--spatial-element-hero-edge-gap));
|
|
203
|
-
padding-left: max(0px, calc(50vw - 50% - var(--spatial-element-hero-edge-gap)));
|
|
288
|
+
display: flex;
|
|
289
|
+
flex-direction: column;
|
|
290
|
+
width: 100%;
|
|
204
291
|
}
|
|
205
292
|
|
|
206
293
|
.spatial-element-content {
|
|
207
294
|
display: flex;
|
|
208
295
|
flex-direction: column;
|
|
209
|
-
width:
|
|
210
|
-
margin-left: calc(50% - 50vw + var(--spatial-element-content-inline-inset));
|
|
296
|
+
width: 100%;
|
|
211
297
|
}
|
|
212
298
|
|
|
213
299
|
.spatial-element-section-list {
|
|
214
300
|
order: 2;
|
|
301
|
+
margin-top: var(--spatial-detail-submenu-after-gap, 0px);
|
|
215
302
|
}
|
|
216
303
|
|
|
217
304
|
.spatial-element-content :global(.spatial-element-tabs-anchor) {
|
|
@@ -219,31 +306,29 @@
|
|
|
219
306
|
}
|
|
220
307
|
|
|
221
308
|
.spatial-element-section-list :global(.content-section:first-child) {
|
|
222
|
-
margin-top:
|
|
309
|
+
margin-top: 0;
|
|
223
310
|
}
|
|
224
311
|
|
|
225
|
-
:global(.spatial-element-visual) {
|
|
226
|
-
|
|
227
|
-
|
|
312
|
+
.spatial-element-hero :global(.spatial-element-visual) {
|
|
313
|
+
order: -1;
|
|
314
|
+
flex: none;
|
|
315
|
+
margin-left: var(--spatial-detail-fit-left);
|
|
316
|
+
width: calc(100% - var(--spatial-detail-fit-left) - var(--spatial-detail-fit-right));
|
|
317
|
+
height: var(--spatial-detail-fit-height);
|
|
318
|
+
min-height: 0;
|
|
228
319
|
background: transparent;
|
|
229
320
|
pointer-events: none;
|
|
230
321
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.spatial-element-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
.spatial-element-content {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.spatial-element-hero {
|
|
243
|
-
grid-template-columns: 1fr;
|
|
244
|
-
width: 100%;
|
|
245
|
-
margin-left: 0;
|
|
246
|
-
padding-left: 0;
|
|
247
|
-
}
|
|
322
|
+
@media (min-width: 840px) {
|
|
323
|
+
.spatial-element-hero { height: var(--spatial-detail-fit-height); }
|
|
324
|
+
.spatial-element-content { padding-top: 8px; }
|
|
325
|
+
.spatial-element-content :global(.spatial-element-tabs-anchor) { margin-left: 8px; max-width: calc(100% - 16px); }
|
|
326
|
+
}
|
|
327
|
+
@media (min-width: 1200px) {
|
|
328
|
+
.spatial-element-content :global(.spatial-element-tabs-anchor) { max-width: calc(100% - 32px); }
|
|
329
|
+
}
|
|
330
|
+
@media (min-width: 1600px) {
|
|
331
|
+
.spatial-element-content { padding-top: 12px; }
|
|
332
|
+
.spatial-element-content :global(.spatial-element-tabs-anchor) { margin-left: calc((100% - var(--spatial-detail-content-width)) / 2); max-width: var(--spatial-detail-content-width); }
|
|
248
333
|
}
|
|
249
334
|
</style>
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
+
import './layout.generated.css';
|
|
2
3
|
import type { SpatialElementData } from '@spatial-elements/core/spatial-element/types';
|
|
3
|
-
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Complete element document from this page's load function. Registers assets with the enclosing shell. */
|
|
4
6
|
spatialElement: SpatialElementData;
|
|
7
|
+
/** Optional compact controls beside the action in both scroll and 3XL pane headers. */
|
|
8
|
+
headerDetails?: Snippet;
|
|
9
|
+
/** Shared header action icon. Use the same snippet as the summary actionIcon. */
|
|
10
|
+
actionIcon?: Snippet;
|
|
11
|
+
/** Detail sections; Section components automatically populate the tab navigation. */
|
|
5
12
|
children?: Snippet;
|
|
6
|
-
}
|
|
7
|
-
declare const SpatialElementPage: import("svelte").Component
|
|
13
|
+
}
|
|
14
|
+
declare const SpatialElementPage: import("svelte").Component<Props, {}, "">;
|
|
8
15
|
type SpatialElementPage = ReturnType<typeof SpatialElementPage>;
|
|
9
16
|
export default SpatialElementPage;
|