@spatial-elements/sveltekit 0.1.0-beta.1 → 1.0.0-beta.10
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 +19 -9
- 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 +150 -197
- 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 +125 -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/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 +752 -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 +292 -0
- package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
- package/dist/spatial-element/SpatialElementMediaRail.svelte +321 -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 +150 -70
- package/dist/spatial-element/SpatialElementPage.svelte.d.ts +6 -3
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +76 -104
- package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +3 -1
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +185 -0
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +18 -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 +59 -0
- package/dist/spatial-element/SpatialIconButton.svelte.d.ts +14 -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 +136 -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 +78 -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 +18 -3
- package/dist/spatial-element/index.js +11 -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 +151 -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 +405 -48
- 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 +188 -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
package/dist/stage/Stage.svelte
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SpatialElementLodPair } from '@spatial-elements/core/catalog/spatialElementLodPair';
|
|
3
|
+
import { DEFAULT_BACKGROUND } from '@spatial-elements/core/stage/stageConstants';
|
|
3
4
|
import { onMount, setContext, tick } from 'svelte';
|
|
5
|
+
import { ResponsiveViewportMetrics } from '@spatial-elements/core/spatial-element/ResponsiveViewportMetrics';
|
|
6
|
+
import { SPATIAL_PRESENTATION_OWNER, type SpatialPresentationOwner } from '../spatial-element/spatialPresentationOwner.js';
|
|
7
|
+
import type { SpatialSummaryHostController } from '../spatial-element/spatialSummaryHost.svelte.js';
|
|
4
8
|
import type { Snippet } from 'svelte';
|
|
5
9
|
import type {
|
|
6
10
|
BackgroundSettings,
|
|
@@ -9,33 +13,65 @@
|
|
|
9
13
|
StageInteractionTheme,
|
|
10
14
|
StageModelSettings,
|
|
11
15
|
StagePanelTarget,
|
|
16
|
+
StageRenderSettings,
|
|
12
17
|
StageVisualTestView,
|
|
13
18
|
StageViewportTarget,
|
|
14
19
|
StageZoomFocusState
|
|
15
20
|
} from '@spatial-elements/core/stage/StageExperience';
|
|
16
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
isStageVisualTestMode,
|
|
23
|
+
type StageVisualTestController
|
|
24
|
+
} from '@spatial-elements/core/stage/stageVisualTest';
|
|
25
|
+
import { resolveStageRenderSettings } from '@spatial-elements/core/stage/renderSettings';
|
|
17
26
|
import { VirtualScrollController } from '@spatial-elements/core/stage/VirtualScrollController';
|
|
27
|
+
import { StageFullscreenController } from '@spatial-elements/core/stage/StageFullscreenController';
|
|
18
28
|
import ScrollNavigationBridge from '../catalog/ScrollNavigationBridge.svelte';
|
|
29
|
+
import { startStagedCatalogNavigation, type InterruptedCatalogPresentation } from '../catalog/stagedCatalogNavigation.js';
|
|
30
|
+
import { prepareCatalogSummaryTransfer } from '../catalog/catalogSummaryTransfer.js';
|
|
31
|
+
import type { EarlyNavigationCancelReason } from '@spatial-elements/core/catalog/EarlyNavigationCoordinator';
|
|
32
|
+
import { NavigationFeedback } from '@spatial-elements/core/catalog/NavigationFeedback';
|
|
19
33
|
import { CatalogTransition } from '@spatial-elements/core/catalog/CatalogTransition';
|
|
20
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
CATALOG_ENDPOINTS,
|
|
36
|
+
CatalogEndpointRegistry
|
|
37
|
+
} from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
21
38
|
import '../catalog/catalogTransition.css';
|
|
22
39
|
import { createStageSpatialElementAssetManifest } from '@spatial-elements/core/catalog/spatialElementAssets';
|
|
23
40
|
import { CATALOG_ITEMS, CatalogItems } from '@spatial-elements/core/catalog/catalogItems';
|
|
24
|
-
import {
|
|
25
|
-
|
|
41
|
+
import {
|
|
42
|
+
CATALOG_SECTIONS,
|
|
43
|
+
CatalogSections
|
|
44
|
+
} from '@spatial-elements/core/catalog/CatalogSections';
|
|
45
|
+
import type { SpatialListItem, SpatialElementMediaItem } from '@spatial-elements/core/spatial-element/types';
|
|
26
46
|
import type { CatalogPage } from '@spatial-elements/core/catalog/catalogPage';
|
|
27
|
-
import
|
|
47
|
+
import {
|
|
48
|
+
SpatialPageRegistry,
|
|
49
|
+
type SpatialPage
|
|
50
|
+
} from '@spatial-elements/core/catalog/SpatialPageRegistry';
|
|
51
|
+
import {
|
|
52
|
+
getSpatialElementScene,
|
|
53
|
+
hasSpatialElementScene
|
|
54
|
+
} from '@spatial-elements/core/spatial-element/spatialElementScene';
|
|
55
|
+
import { SPATIAL_PAGE } from '../spatial-element/spatialPageContext.js';
|
|
56
|
+
import type { BeforeNavigate, OnNavigate } from '@sveltejs/kit';
|
|
28
57
|
import {
|
|
29
58
|
STAGE_CONTEXT_KEY,
|
|
59
|
+
STAGE_PANEL_LAYOUT_EVENT,
|
|
30
60
|
type StageContext,
|
|
31
61
|
type StagePanelRegistration,
|
|
32
62
|
type StageViewportRegistration
|
|
33
63
|
} from '@spatial-elements/core/stage/panelContext';
|
|
34
64
|
|
|
35
65
|
interface Props {
|
|
66
|
+
deviceOrientation?: boolean;
|
|
67
|
+
/** Namespace for automatic ContentPage/SpatialElementPage registration. Supplied by BrandStageShell. */
|
|
68
|
+
brandId?: string;
|
|
69
|
+
renderSettings?: StageRenderSettings;
|
|
36
70
|
dracoDecoderPath?: string;
|
|
37
71
|
ariaLabel?: string;
|
|
38
72
|
background?: BackgroundSettings;
|
|
73
|
+
/** Theme overrides applied after each element's HDR background settings. */
|
|
74
|
+
sceneBackground?: Partial<BackgroundSettings>;
|
|
39
75
|
pageBackground?: string;
|
|
40
76
|
hdr?: string;
|
|
41
77
|
glb?: string;
|
|
@@ -43,31 +79,67 @@
|
|
|
43
79
|
model?: StageModelSettings;
|
|
44
80
|
camera?: StageCameraSettings;
|
|
45
81
|
interactionTheme?: Partial<StageInteractionTheme>;
|
|
82
|
+
/** @deprecated Low-level manual adapter. BrandStageShell manages catalog state from its pages. */
|
|
46
83
|
catalog?: CatalogPage;
|
|
47
84
|
children?: Snippet;
|
|
48
85
|
}
|
|
49
86
|
|
|
50
87
|
let {
|
|
88
|
+
deviceOrientation = false,
|
|
89
|
+
brandId,
|
|
51
90
|
ariaLabel = 'WebGPU 3D stage',
|
|
91
|
+
renderSettings,
|
|
52
92
|
dracoDecoderPath,
|
|
53
93
|
pageBackground = '#ffffff',
|
|
54
|
-
background,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
94
|
+
background: standaloneBackground,
|
|
95
|
+
sceneBackground,
|
|
96
|
+
hdr: standaloneHdr,
|
|
97
|
+
glb: standaloneGlb,
|
|
98
|
+
lodPair: standaloneLodPair,
|
|
99
|
+
model: standaloneModel,
|
|
100
|
+
camera: standaloneCamera,
|
|
60
101
|
interactionTheme,
|
|
61
|
-
catalog,
|
|
102
|
+
catalog: explicitCatalog,
|
|
62
103
|
children
|
|
63
104
|
}: Props = $props();
|
|
64
105
|
|
|
106
|
+
let readPage = $state.raw<(() => SpatialPage) | undefined>();
|
|
107
|
+
setContext(
|
|
108
|
+
SPATIAL_PAGE,
|
|
109
|
+
new SpatialPageRegistry((read) => {
|
|
110
|
+
readPage = read;
|
|
111
|
+
})
|
|
112
|
+
);
|
|
113
|
+
const activePage = $derived(readPage?.());
|
|
114
|
+
const resolvedPageBackground = $derived(activePage?.kind === 'content' ? activePage.background ?? pageBackground : pageBackground);
|
|
115
|
+
const activeElement = $derived(activePage?.kind === 'detail' ? activePage.element : undefined);
|
|
116
|
+
const activeScene = $derived(activeElement ? getSpatialElementScene(activeElement) : undefined);
|
|
117
|
+
const catalog = $derived<CatalogPage | undefined>(
|
|
118
|
+
brandId
|
|
119
|
+
? {
|
|
120
|
+
brandId,
|
|
121
|
+
view: activeElement ? 'detail' : 'content',
|
|
122
|
+
spatialElementId: activeElement?.id,
|
|
123
|
+
spatialElementStage: activeScene,
|
|
124
|
+
spatialElements: []
|
|
125
|
+
}
|
|
126
|
+
: explicitCatalog
|
|
127
|
+
);
|
|
65
128
|
let displayedSpatialElements = $state<SpatialListItem[]>([]);
|
|
66
129
|
setContext(CATALOG_ITEMS, new CatalogItems((items) => (displayedSpatialElements = items)));
|
|
67
130
|
setContext(CATALOG_SECTIONS, new CatalogSections());
|
|
68
131
|
const catalogSpatialElements = $derived(
|
|
69
132
|
displayedSpatialElements.length ? displayedSpatialElements : (catalog?.spatialElements ?? [])
|
|
70
133
|
);
|
|
134
|
+
const background = $derived({ ...DEFAULT_BACKGROUND, ...(brandId ? activeElement?.background : standaloneBackground), ...sceneBackground });
|
|
135
|
+
const hdr = $derived(brandId
|
|
136
|
+
? (activePage?.kind === 'content' ? activePage.hdr : activeScene?.hdr ?? '')
|
|
137
|
+
: standaloneHdr);
|
|
138
|
+
const glb = $derived(brandId ? (activeScene?.glb ?? '') : standaloneGlb);
|
|
139
|
+
const lodPair = $derived(brandId ? activeScene?.lodPair : standaloneLodPair);
|
|
140
|
+
const model = $derived(brandId ? activeElement?.model : standaloneModel);
|
|
141
|
+
const camera = $derived(brandId ? activeElement?.camera : standaloneCamera);
|
|
142
|
+
|
|
71
143
|
const registeredPanels: StagePanelRegistration[] = [];
|
|
72
144
|
const catalogEndpoints = new CatalogEndpointRegistry();
|
|
73
145
|
setContext(CATALOG_ENDPOINTS, catalogEndpoints);
|
|
@@ -76,12 +148,28 @@
|
|
|
76
148
|
let virtualScrollSpacer: HTMLDivElement;
|
|
77
149
|
let domLayer: HTMLDivElement;
|
|
78
150
|
let status = $state('Loading stage');
|
|
79
|
-
let showStatus = $state(
|
|
151
|
+
let showStatus = $state(false);
|
|
80
152
|
let isEnhanced = $state(false);
|
|
153
|
+
// The device survives navigation; the destination still needs its own first
|
|
154
|
+
// submitted frame before its detail and minimap posters can fade away.
|
|
155
|
+
let isPageReady = $state(false);
|
|
156
|
+
let fullscreen = $state(false);
|
|
157
|
+
let fullscreenController: StageFullscreenController | undefined;
|
|
81
158
|
let isFallback = $state(true);
|
|
82
159
|
let domLayerHidden = $state(false);
|
|
83
160
|
let domLayerOpacity = $state(1);
|
|
84
161
|
let experience = $state<StageExperience | null>(null);
|
|
162
|
+
let layoutMetrics: ResponsiveViewportMetrics | undefined;
|
|
163
|
+
let presentationHost: SpatialSummaryHostController | undefined;
|
|
164
|
+
setContext<SpatialPresentationOwner>(SPATIAL_PRESENTATION_OWNER, {
|
|
165
|
+
register(host) {
|
|
166
|
+
presentationHost = host;
|
|
167
|
+
return () => { if (presentationHost === host) presentationHost = undefined; };
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
let readDetailMedia = $state.raw<(() => SpatialElementMediaItem['kind']) | undefined>();
|
|
171
|
+
let detailMediaOwner: symbol | undefined;
|
|
172
|
+
const detailMedia = $derived(readDetailMedia?.() ?? 'minimap');
|
|
85
173
|
let stageState = $state<'loading' | 'enhanced' | 'fallback'>('loading');
|
|
86
174
|
let zoomFocusState = $state<StageZoomFocusState>({
|
|
87
175
|
focus: 0,
|
|
@@ -92,8 +180,13 @@
|
|
|
92
180
|
let visualTestController: StageVisualTestController | undefined;
|
|
93
181
|
let virtualScroll = $state<VirtualScrollController>();
|
|
94
182
|
let transition: CatalogTransition | undefined;
|
|
183
|
+
let earlyTransition: ReturnType<typeof startStagedCatalogNavigation>;
|
|
184
|
+
let interruptedPresentation: InterruptedCatalogPresentation | undefined;
|
|
185
|
+
let summaryTransfer: ReturnType<typeof prepareCatalogSummaryTransfer>;
|
|
186
|
+
let lastEarlyTimings: NonNullable<typeof earlyTransition>['timings'] | undefined;
|
|
95
187
|
let initialized: Promise<void> | undefined;
|
|
96
188
|
let navigationGeneration = 0;
|
|
189
|
+
let navigationFeedback: NavigationFeedback | undefined;
|
|
97
190
|
let destroyed = false;
|
|
98
191
|
let nextPageBinding: Promise<void> | undefined;
|
|
99
192
|
let releasePageBinding: (() => void) | undefined;
|
|
@@ -102,7 +195,8 @@
|
|
|
102
195
|
let retainedPageSignature: string | undefined;
|
|
103
196
|
const pageSignature = () =>
|
|
104
197
|
JSON.stringify([
|
|
105
|
-
|
|
198
|
+
renderSettings,
|
|
199
|
+
resolvedPageBackground,
|
|
106
200
|
background,
|
|
107
201
|
hdr,
|
|
108
202
|
glb,
|
|
@@ -119,6 +213,13 @@
|
|
|
119
213
|
};
|
|
120
214
|
|
|
121
215
|
setContext<StageContext>(STAGE_CONTEXT_KEY, {
|
|
216
|
+
registerDetailMedia(read) {
|
|
217
|
+
const owner = Symbol(); detailMediaOwner = owner; readDetailMedia = read;
|
|
218
|
+
return () => { if (detailMediaOwner === owner) { detailMediaOwner = undefined; readDetailMedia = undefined; } };
|
|
219
|
+
},
|
|
220
|
+
getLayoutMetrics: (mode) => layoutMetrics?.read(mode),
|
|
221
|
+
isEnhanced: () => isEnhanced,
|
|
222
|
+
updatePanelAppearance: scheduleAppearanceUpdate,
|
|
122
223
|
prefetchSpatialElement: (config) => experience?.prefetchSpatialElement(config),
|
|
123
224
|
registerPanel(panel) {
|
|
124
225
|
registeredPanels.push(panel);
|
|
@@ -137,15 +238,32 @@
|
|
|
137
238
|
},
|
|
138
239
|
resetView() {
|
|
139
240
|
experience?.resetView();
|
|
140
|
-
}
|
|
241
|
+
},
|
|
242
|
+
isFullscreen: () => fullscreen,
|
|
243
|
+
getZoomFocus: () => zoomFocusState.focus,
|
|
244
|
+
getZoomUiFocus: () => zoomFocusState.uiFocus,
|
|
245
|
+
setFullscreen: (active) => fullscreenController?.setFullscreen(active)
|
|
141
246
|
});
|
|
142
247
|
|
|
143
248
|
onMount(() => {
|
|
249
|
+
layoutMetrics = new ResponsiveViewportMetrics(stage);
|
|
250
|
+
layoutMetrics.start();
|
|
251
|
+
// The semantic page is already usable. Only announce unusually slow enhancement.
|
|
252
|
+
const statusTimer = window.setTimeout(() => {
|
|
253
|
+
if (stageState === 'loading') showStatus = true;
|
|
254
|
+
}, 1000);
|
|
255
|
+
fullscreenController = new StageFullscreenController(stage, (active) => {
|
|
256
|
+
fullscreen = active;
|
|
257
|
+
experience?.setFullscreen(active);
|
|
258
|
+
});
|
|
144
259
|
document.documentElement.classList.add('stage-route');
|
|
145
260
|
document.body.classList.add('stage-route');
|
|
146
261
|
virtualScroll = new VirtualScrollController(stage, domLayer, virtualScrollSpacer);
|
|
147
|
-
|
|
262
|
+
// Native fallback pages keep native document scrolling and browser anchor behavior.
|
|
263
|
+
if (navigator.gpu) virtualScroll.start();
|
|
264
|
+
navigationFeedback = new NavigationFeedback(stage);
|
|
148
265
|
transition = new CatalogTransition(stage, catalogEndpoints, {
|
|
266
|
+
diagnose: reason => { if (visualTestController) stage.dataset.catalogTransitionDecision = reason; },
|
|
149
267
|
captureContentGeometry: (endpoint, secondary) =>
|
|
150
268
|
experience?.captureContentGeometry(endpoint.spatialElementId, secondary) ?? false,
|
|
151
269
|
prepareContentParticipants: (pairs) => experience?.prepareContentParticipants(pairs),
|
|
@@ -159,7 +277,10 @@
|
|
|
159
277
|
prepareDestination: (destination) =>
|
|
160
278
|
experience?.prepareGeometryDestination(destination) ?? false,
|
|
161
279
|
setGeometryProgress: (progress) => experience?.setCatalogGeometryProgress(progress),
|
|
162
|
-
flushFrame: () =>
|
|
280
|
+
flushFrame: () => {
|
|
281
|
+
if (stage.dataset.catalogTransition === 'animating') navigationFeedback?.end();
|
|
282
|
+
experience?.flushCatalogFrame();
|
|
283
|
+
},
|
|
163
284
|
finishGeometry: () => {
|
|
164
285
|
try {
|
|
165
286
|
experience?.finishCatalogGeometry();
|
|
@@ -190,6 +311,10 @@
|
|
|
190
311
|
const panels = getPanelTargets();
|
|
191
312
|
const viewport = getViewportTarget();
|
|
192
313
|
const instance = new StageExperience(stage, {
|
|
314
|
+
detailMedia,
|
|
315
|
+
readLayoutMetrics: (mode) => layoutMetrics?.read(mode),
|
|
316
|
+
deviceOrientation,
|
|
317
|
+
renderSettings,
|
|
193
318
|
dracoDecoderPath,
|
|
194
319
|
catalog: Boolean(catalog),
|
|
195
320
|
heroIsPresented: () =>
|
|
@@ -199,7 +324,7 @@
|
|
|
199
324
|
spatialElementId: catalog.spatialElementId
|
|
200
325
|
}) !== 'dock',
|
|
201
326
|
background,
|
|
202
|
-
pageBackground,
|
|
327
|
+
pageBackground: resolvedPageBackground,
|
|
203
328
|
hdr,
|
|
204
329
|
glb,
|
|
205
330
|
lodPair,
|
|
@@ -211,7 +336,10 @@
|
|
|
211
336
|
enableSpaceMouse: !isStageVisualTestMode(),
|
|
212
337
|
onDeviceLost: () => {
|
|
213
338
|
if (disposed || experience !== instance) return;
|
|
339
|
+
fullscreenController?.setFullscreen(false);
|
|
340
|
+
navigationFeedback?.end();
|
|
214
341
|
navigationGeneration += 1;
|
|
342
|
+
earlyTransition?.cancel('error');
|
|
215
343
|
transition?.cancel();
|
|
216
344
|
experience = null;
|
|
217
345
|
try {
|
|
@@ -220,6 +348,7 @@
|
|
|
220
348
|
setZoomFocusState(restingZoomFocus);
|
|
221
349
|
isEnhanced = false;
|
|
222
350
|
isFallback = true;
|
|
351
|
+
virtualScroll?.destroy();
|
|
223
352
|
stageState = 'fallback';
|
|
224
353
|
showStatus = false;
|
|
225
354
|
}
|
|
@@ -237,6 +366,9 @@
|
|
|
237
366
|
return;
|
|
238
367
|
}
|
|
239
368
|
|
|
369
|
+
// Paint the prepared scene before posters and fallback surfaces start fading.
|
|
370
|
+
instance.flushCatalogFrame();
|
|
371
|
+
isPageReady = true;
|
|
240
372
|
isEnhanced = true;
|
|
241
373
|
isFallback = false;
|
|
242
374
|
showStatus = false;
|
|
@@ -256,6 +388,7 @@
|
|
|
256
388
|
experience?.dispose();
|
|
257
389
|
experience = null;
|
|
258
390
|
status = error instanceof Error ? error.message : 'Unable to initialize WebGPU stage';
|
|
391
|
+
virtualScroll?.destroy();
|
|
259
392
|
isEnhanced = false;
|
|
260
393
|
isFallback = true;
|
|
261
394
|
stageState = 'fallback';
|
|
@@ -264,11 +397,20 @@
|
|
|
264
397
|
});
|
|
265
398
|
|
|
266
399
|
return () => {
|
|
400
|
+
window.clearTimeout(statusTimer);
|
|
401
|
+
layoutMetrics?.destroy();
|
|
402
|
+
layoutMetrics = undefined;
|
|
403
|
+
fullscreenController?.dispose();
|
|
404
|
+
fullscreenController = undefined;
|
|
267
405
|
virtualScroll?.destroy();
|
|
268
406
|
virtualScroll = undefined;
|
|
269
407
|
destroyed = true;
|
|
270
408
|
releasePageBinding?.();
|
|
271
409
|
navigationGeneration += 1;
|
|
410
|
+
navigationFeedback?.end();
|
|
411
|
+
earlyTransition?.cancel('destroyed');
|
|
412
|
+
interruptedPresentation?.cancel(); interruptedPresentation = undefined;
|
|
413
|
+
summaryTransfer?.cancel(); summaryTransfer = undefined;
|
|
272
414
|
transition?.dispose();
|
|
273
415
|
document.documentElement.classList.remove('stage-route');
|
|
274
416
|
document.body.classList.remove('stage-route');
|
|
@@ -282,6 +424,23 @@
|
|
|
282
424
|
};
|
|
283
425
|
});
|
|
284
426
|
|
|
427
|
+
$effect(() => { experience?.setDetailMedia(detailMedia); });
|
|
428
|
+
$effect(() => {
|
|
429
|
+
void resolvedPageBackground; void background; void isEnhanced;
|
|
430
|
+
Object.values(interactionTheme ?? {});
|
|
431
|
+
scheduleAppearanceUpdate();
|
|
432
|
+
});
|
|
433
|
+
let appearanceUpdatePending = false;
|
|
434
|
+
function scheduleAppearanceUpdate() {
|
|
435
|
+
if (appearanceUpdatePending) return;
|
|
436
|
+
appearanceUpdatePending = true;
|
|
437
|
+
void tick().then(() => {
|
|
438
|
+
appearanceUpdatePending = false;
|
|
439
|
+
if (!destroyed && isEnhanced) experience?.updateAppearance({
|
|
440
|
+
pageBackground: resolvedPageBackground, background, interactionTheme, panels: getPanelTargets()
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
}
|
|
285
444
|
$effect(() => {
|
|
286
445
|
const spatialElements = catalogSpatialElements;
|
|
287
446
|
if (experience && catalog && isEnhanced) {
|
|
@@ -292,52 +451,154 @@
|
|
|
292
451
|
function registerSpatialElements() {
|
|
293
452
|
if (!catalog || !experience) return;
|
|
294
453
|
for (const spatialElement of catalogSpatialElements) {
|
|
295
|
-
if (spatialElement
|
|
454
|
+
if (hasSpatialElementScene(spatialElement))
|
|
296
455
|
experience.spatialElements.setManifest(
|
|
297
|
-
createStageSpatialElementAssetManifest(
|
|
456
|
+
createStageSpatialElementAssetManifest(
|
|
457
|
+
catalog.brandId,
|
|
458
|
+
spatialElement.id,
|
|
459
|
+
getSpatialElementScene(spatialElement)
|
|
460
|
+
)
|
|
298
461
|
);
|
|
299
462
|
}
|
|
300
463
|
if (catalog.spatialElementId && catalog.spatialElementStage) {
|
|
301
464
|
experience.spatialElements.setManifest(
|
|
302
|
-
createStageSpatialElementAssetManifest(
|
|
465
|
+
createStageSpatialElementAssetManifest(
|
|
466
|
+
catalog.brandId,
|
|
467
|
+
catalog.spatialElementId,
|
|
468
|
+
catalog.spatialElementStage
|
|
469
|
+
)
|
|
303
470
|
);
|
|
304
471
|
}
|
|
305
472
|
}
|
|
306
473
|
|
|
307
474
|
function interruptNavigation() {
|
|
475
|
+
earlyTransition?.cancel('cancelled');
|
|
476
|
+
interruptedPresentation?.cancel(); interruptedPresentation = undefined;
|
|
477
|
+
navigationFeedback?.end();
|
|
308
478
|
navigationGeneration += 1;
|
|
309
479
|
reuseCatalogPage = false;
|
|
310
480
|
transition?.cancel();
|
|
311
481
|
if (pageBindingConsumed) releasePageBinding?.();
|
|
312
482
|
}
|
|
313
483
|
|
|
484
|
+
function interruptCommittedNavigation(reason: EarlyNavigationCancelReason) {
|
|
485
|
+
if (!earlyTransition) return false;
|
|
486
|
+
// The destination owns the route already. Release only the visual source;
|
|
487
|
+
// restoreNavigation must keep its generation and finish updatePage normally.
|
|
488
|
+
interruptedPresentation = earlyTransition.cancelCommitted(reason);
|
|
489
|
+
navigationFeedback?.end();
|
|
490
|
+
if (pageBindingConsumed) releasePageBinding?.();
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
|
|
314
494
|
function supersedeNavigation(destination: URL) {
|
|
495
|
+
if (earlyTransition?.destination !== destination.href) earlyTransition?.cancel('superseded');
|
|
496
|
+
interruptedPresentation?.cancel(); interruptedPresentation = undefined;
|
|
497
|
+
summaryTransfer?.cancel(); summaryTransfer = undefined;
|
|
498
|
+
navigationFeedback?.end();
|
|
315
499
|
navigationGeneration += 1;
|
|
316
500
|
transition?.supersede(destination);
|
|
317
501
|
if (pageBindingConsumed) releasePageBinding?.();
|
|
318
502
|
}
|
|
319
503
|
|
|
320
504
|
let navigationTimings = { dataReady: 0, captured: 0, restoring: 0, bound: 0 };
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
505
|
+
function startEarlyNavigation(navigation: BeforeNavigate) {
|
|
506
|
+
if (navigation.from) recordNavigationPage(navigation.from.url);
|
|
507
|
+
// The opt-in is temporary while production frame/ownership gates are verified.
|
|
508
|
+
if (visualTestController) stage.dataset.catalogStagedDecision = `gate:${isEnhanced}:${Boolean(experience)}:${Boolean(presentationHost)}`;
|
|
509
|
+
if (!new URL(location.href).searchParams.has('stagedNavigation') || !isEnhanced || !experience || !presentationHost) return;
|
|
510
|
+
const metrics = layoutMetrics?.read();
|
|
511
|
+
if (!metrics) return;
|
|
512
|
+
earlyTransition?.cancel('superseded');
|
|
513
|
+
const candidate = startStagedCatalogNavigation({ root: stage, navigation, endpoints: catalogEndpoints,
|
|
514
|
+
host: presentationHost, experience, metrics, items: catalogSpatialElements, diagnostics: Boolean(visualTestController),
|
|
515
|
+
onFinish() {
|
|
516
|
+
if (earlyTransition) lastEarlyTimings = earlyTransition.timings;
|
|
517
|
+
earlyTransition = undefined;
|
|
518
|
+
navigationFeedback?.end();
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
earlyTransition = candidate;
|
|
522
|
+
return candidate?.handle;
|
|
523
|
+
}
|
|
524
|
+
function captureNavigation(navigation: OnNavigate): undefined {
|
|
525
|
+
try {
|
|
526
|
+
if (navigation.from && !destroyed) recordNavigationPage(navigation.from.url);
|
|
527
|
+
navigationTimings = { dataReady: performance.now(), captured: 0, restoring: 0, bound: 0 };
|
|
528
|
+
const generation = ++navigationGeneration;
|
|
529
|
+
if (earlyTransition?.phase === 'held' && navigation.to?.url.href === earlyTransition.destination) {
|
|
530
|
+
earlyTransition.commit();
|
|
531
|
+
reuseCatalogPage = false;
|
|
532
|
+
navigationTimings.captured = performance.now();
|
|
533
|
+
experience?.releasePage();
|
|
534
|
+
setZoomFocusState(restingZoomFocus);
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
// Snapshot the still-mounted source synchronously. Waiting for feedback to
|
|
538
|
+
// paint here would hold Kit after its URL update but before its DOM commit.
|
|
539
|
+
// Feedback stays nonblocking; destination/GPU preparation follows commit.
|
|
540
|
+
if (destroyed || generation !== navigationGeneration) return;
|
|
541
|
+
summaryTransfer?.cancel();
|
|
542
|
+
summaryTransfer = navigation.from && navigation.to && presentationHost
|
|
543
|
+
? prepareCatalogSummaryTransfer({ from: navigation.from.url, to: navigation.to.url,
|
|
544
|
+
type: navigation.type, endpoints: catalogEndpoints, host: presentationHost }) : undefined;
|
|
545
|
+
reuseCatalogPage = Boolean(
|
|
546
|
+
navigation.from &&
|
|
547
|
+
navigation.to &&
|
|
548
|
+
transition?.capture(navigation.from.url, navigation.to.url, navigation.type)
|
|
549
|
+
);
|
|
550
|
+
navigationTimings.captured = performance.now();
|
|
551
|
+
if (reuseCatalogPage) {
|
|
552
|
+
summaryTransfer?.cancel(); summaryTransfer = undefined;
|
|
553
|
+
retainedPageSignature = pageSignature();
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
summaryTransfer?.hold();
|
|
557
|
+
experience?.releasePage();
|
|
558
|
+
setZoomFocusState(restingZoomFocus);
|
|
559
|
+
} finally {
|
|
560
|
+
if (!reuseCatalogPage) isPageReady = false;
|
|
561
|
+
// Leaving fullscreen refits the live camera and restores source DOM/scroll.
|
|
562
|
+
// Retain its visible pose and release page bindings before that mutation.
|
|
563
|
+
fullscreenController?.setFullscreen(false);
|
|
333
564
|
}
|
|
334
|
-
|
|
335
|
-
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
async function settleInterruptedPresentation(generation: number, rebind = false) {
|
|
568
|
+
const pending = interruptedPresentation;
|
|
569
|
+
if (!pending) return;
|
|
570
|
+
await pending.finished;
|
|
571
|
+
if (interruptedPresentation === pending) interruptedPresentation = undefined;
|
|
572
|
+
if (destroyed || generation !== navigationGeneration || !rebind) return;
|
|
573
|
+
experience?.updateAppearance({ pageBackground: resolvedPageBackground, background, interactionTheme, panels: getPanelTargets() });
|
|
574
|
+
window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
|
|
575
|
+
experience?.flushCatalogFrame();
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
function recordNavigationPage(url: URL) {
|
|
579
|
+
const current = catalog;
|
|
580
|
+
const items = catalogSpatialElements;
|
|
581
|
+
catalogEndpoints.navigation.record(url,
|
|
582
|
+
current?.spatialElementId ? { kind: 'detail', brandId: current.brandId, spatialElementId: current.spatialElementId } :
|
|
583
|
+
current && items.length ? { kind: 'content', brandId: current.brandId, elements: items.map(item => item.id) } : { kind: 'ordinary' },
|
|
584
|
+
current ? items.map(item => ({ brandId: current.brandId, spatialElementId: item.id, href: item.href })) : []);
|
|
336
585
|
}
|
|
337
586
|
|
|
338
587
|
async function restoreNavigation() {
|
|
339
588
|
navigationTimings.restoring = performance.now();
|
|
340
589
|
const generation = navigationGeneration;
|
|
590
|
+
await tick();
|
|
591
|
+
if (destroyed || generation !== navigationGeneration) return;
|
|
592
|
+
recordNavigationPage(new URL(location.href));
|
|
593
|
+
// Preserve the real Svelte instance before page binding measures the new
|
|
594
|
+
// summary. This also applies when GPU motion is disabled or declined.
|
|
595
|
+
const transferredSlot = summaryTransfer?.adopt(); summaryTransfer = undefined;
|
|
596
|
+
if (transferredSlot) {
|
|
597
|
+
await tick();
|
|
598
|
+
if (destroyed || generation !== navigationGeneration) return;
|
|
599
|
+
transferredSlot.dispatchEvent(new Event('spatial-summary-measure'));
|
|
600
|
+
await tick();
|
|
601
|
+
}
|
|
341
602
|
await initialized;
|
|
342
603
|
await tick();
|
|
343
604
|
if (destroyed || generation !== navigationGeneration || !experience) return;
|
|
@@ -348,6 +609,7 @@
|
|
|
348
609
|
await transition?.play();
|
|
349
610
|
return;
|
|
350
611
|
}
|
|
612
|
+
isPageReady = false;
|
|
351
613
|
transition?.cancel();
|
|
352
614
|
}
|
|
353
615
|
if (nextPageBinding) {
|
|
@@ -357,11 +619,14 @@
|
|
|
357
619
|
await pending;
|
|
358
620
|
if (destroyed || generation !== navigationGeneration) return;
|
|
359
621
|
}
|
|
622
|
+
if (interruptedPresentation) await settleInterruptedPresentation(generation);
|
|
623
|
+
if (destroyed || generation !== navigationGeneration) return;
|
|
360
624
|
registerSpatialElements();
|
|
361
625
|
const catalogReady = catalog
|
|
362
626
|
? experience.setCatalogSpatialElements(catalog.brandId, catalogSpatialElements)
|
|
363
627
|
: undefined;
|
|
364
628
|
await experience.updatePage({
|
|
629
|
+
renderSettings,
|
|
365
630
|
catalog: Boolean(catalog),
|
|
366
631
|
heroIsPresented: () =>
|
|
367
632
|
!catalog?.spatialElementId ||
|
|
@@ -377,7 +642,7 @@
|
|
|
377
642
|
}) === 'dock'
|
|
378
643
|
),
|
|
379
644
|
background,
|
|
380
|
-
pageBackground,
|
|
645
|
+
pageBackground: resolvedPageBackground,
|
|
381
646
|
hdr,
|
|
382
647
|
glb,
|
|
383
648
|
lodPair,
|
|
@@ -388,6 +653,8 @@
|
|
|
388
653
|
viewport: getViewportTarget()
|
|
389
654
|
});
|
|
390
655
|
if (destroyed || generation !== navigationGeneration) return;
|
|
656
|
+
if (interruptedPresentation) await settleInterruptedPresentation(generation, true);
|
|
657
|
+
if (destroyed || generation !== navigationGeneration) return;
|
|
391
658
|
if (experience.getSpatialCapture()) {
|
|
392
659
|
await Promise.race([
|
|
393
660
|
catalogReady,
|
|
@@ -395,14 +662,22 @@
|
|
|
395
662
|
]);
|
|
396
663
|
if (destroyed || generation !== navigationGeneration) return;
|
|
397
664
|
}
|
|
665
|
+
isPageReady = true;
|
|
398
666
|
isEnhanced = true;
|
|
399
667
|
isFallback = false;
|
|
400
668
|
stageState = 'enhanced';
|
|
401
669
|
navigationTimings.bound = performance.now();
|
|
402
|
-
|
|
670
|
+
if (earlyTransition?.phase === 'held') {
|
|
671
|
+
await earlyTransition.reveal(() => experience?.updateAppearance({
|
|
672
|
+
pageBackground: resolvedPageBackground, background, interactionTheme, panels: getPanelTargets()
|
|
673
|
+
}));
|
|
674
|
+
} else await transition?.play();
|
|
675
|
+
if (interruptedPresentation) await settleInterruptedPresentation(generation, true);
|
|
403
676
|
} catch (error) {
|
|
404
677
|
if (destroyed || generation !== navigationGeneration) return;
|
|
678
|
+
interruptedPresentation?.cancel(); interruptedPresentation = undefined;
|
|
405
679
|
transition?.cancel();
|
|
680
|
+
earlyTransition?.cancel('error');
|
|
406
681
|
try {
|
|
407
682
|
experience.discardFailedPage();
|
|
408
683
|
} catch (cleanupError) {
|
|
@@ -414,6 +689,8 @@
|
|
|
414
689
|
isEnhanced = false;
|
|
415
690
|
isFallback = true;
|
|
416
691
|
stageState = 'fallback';
|
|
692
|
+
} finally {
|
|
693
|
+
if (generation === navigationGeneration) navigationFeedback?.end();
|
|
417
694
|
}
|
|
418
695
|
}
|
|
419
696
|
|
|
@@ -440,9 +717,9 @@
|
|
|
440
717
|
await Promise.resolve();
|
|
441
718
|
};
|
|
442
719
|
|
|
443
|
-
const setView = async (view: StageVisualTestView) => {
|
|
720
|
+
const setView = async (view: StageVisualTestView, frames = 18) => {
|
|
444
721
|
experience?.setVisualTestView(view);
|
|
445
|
-
await settle(
|
|
722
|
+
await settle(frames);
|
|
446
723
|
};
|
|
447
724
|
const setSpaceMouseZoom = async (zoom: number) => {
|
|
448
725
|
experience?.setVisualTestSpaceMouseZoom(zoom);
|
|
@@ -461,11 +738,13 @@
|
|
|
461
738
|
loseDevice: () => experience?.loseDeviceForTest(),
|
|
462
739
|
getCarouselStats: () => experience?.getCarouselStats() ?? null,
|
|
463
740
|
getCatalogStats: () => experience?.assets.getStats() ?? null,
|
|
741
|
+
getRenderActivity: () => experience?.getVisualTestRenderActivity() ?? null,
|
|
464
742
|
getCatalogEndpoints: () => catalogEndpoints.getSnapshot(),
|
|
465
743
|
getCatalogOwnership: () => transition?.getOwnership() ?? null,
|
|
466
|
-
getNavigationTimings: () => ({ ...navigationTimings }),
|
|
744
|
+
getNavigationTimings: () => ({ ...navigationTimings, early: earlyTransition?.timings ?? lastEarlyTimings }),
|
|
467
745
|
captureHeroPresentation: () => experience?.captureHeroPresentation() ?? false,
|
|
468
746
|
getSpatialCapture: () => experience?.getSpatialCapture() ?? null,
|
|
747
|
+
getDetailProjection: kind => experience?.getVisualTestDetailProjection(kind) ?? null,
|
|
469
748
|
releaseSpatialCapture: () => experience?.releaseSpatialCapture(),
|
|
470
749
|
registerCatalogEndpoint: (address, element) => catalogEndpoints.register(address, element),
|
|
471
750
|
getCatalogPresentation: () => experience?.getCatalogPresentation() ?? null,
|
|
@@ -487,8 +766,10 @@
|
|
|
487
766
|
driveSpaceMouseZoom,
|
|
488
767
|
stopSpaceMouse,
|
|
489
768
|
getMinimapRect: () => experience?.getVisualTestMinimapRect() ?? null,
|
|
769
|
+
getPanelRect: (frame) => experience?.getVisualTestPanelRect(frame) ?? null,
|
|
490
770
|
getModelRect: () => experience?.getVisualTestModelRect() ?? null,
|
|
491
771
|
getMinimapModelRect: () => experience?.getVisualTestMinimapModelRect() ?? null,
|
|
772
|
+
getMinimapViewportRect: () => experience?.getVisualTestMinimapViewportRect() ?? null,
|
|
492
773
|
getMinimapOrientation: () => experience?.getVisualTestMinimapOrientation() ?? null,
|
|
493
774
|
getMinimapRenderStats: () =>
|
|
494
775
|
experience?.getVisualTestMinimapRenderStats() ?? {
|
|
@@ -499,12 +780,20 @@
|
|
|
499
780
|
},
|
|
500
781
|
getRenderTargetStats: () =>
|
|
501
782
|
experience?.getVisualTestRenderTargetStats() ?? {
|
|
783
|
+
pixelRatio: 0,
|
|
784
|
+
renderSettings: resolveStageRenderSettings(renderSettings),
|
|
502
785
|
liveTargets: 0,
|
|
503
786
|
targets: [],
|
|
504
787
|
canvases: [],
|
|
505
788
|
creations: 0,
|
|
506
789
|
resizes: 0,
|
|
507
790
|
warmups: 0,
|
|
791
|
+
inactiveScrollWarmups: 0,
|
|
792
|
+
backgroundOutput: {
|
|
793
|
+
requested: false, initialized: false, mode: 'legacy', held: false,
|
|
794
|
+
targetTextureId: null, implicitBackgroundTarget: null,
|
|
795
|
+
catalogProfile: null, catalogProfileCurrent: false
|
|
796
|
+
},
|
|
508
797
|
activeScale: 0
|
|
509
798
|
},
|
|
510
799
|
getVisibilityStats: () =>
|
|
@@ -547,12 +836,19 @@
|
|
|
547
836
|
getMinimapDockProgress: panel.getMinimapDockProgress,
|
|
548
837
|
getMinimapModelScale: panel.getMinimapModelScale,
|
|
549
838
|
getMinimapModelTop: panel.getMinimapModelTop,
|
|
839
|
+
getMinimapModelLeft: panel.getMinimapModelLeft,
|
|
550
840
|
getSurfaceOpacity: panel.getSurfaceOpacity,
|
|
841
|
+
getVisible: panel.getVisible,
|
|
842
|
+
getMinimapSelected: panel.getMinimapSelected,
|
|
843
|
+
getFocusAnchor: panel.getFocusAnchor,
|
|
844
|
+
updateNativeLayout: panel.updateNativeLayout,
|
|
845
|
+
nativeContent: panel.getNativeContent?.() ?? false,
|
|
551
846
|
minimap: panel.getMinimapOptions(),
|
|
552
847
|
options: panel.getOptions(),
|
|
553
848
|
surface: panel.getSurface(),
|
|
554
849
|
surfaceElement,
|
|
555
|
-
pointerReactive: panel.getPointerReactive()
|
|
850
|
+
pointerReactive: panel.getPointerReactive(),
|
|
851
|
+
focusReactive: panel.getFocusReactive?.() ?? true
|
|
556
852
|
});
|
|
557
853
|
});
|
|
558
854
|
|
|
@@ -563,21 +859,25 @@
|
|
|
563
859
|
{#if catalog}
|
|
564
860
|
<ScrollNavigationBridge
|
|
565
861
|
controller={virtualScroll}
|
|
862
|
+
onEarlyStart={startEarlyNavigation}
|
|
863
|
+
onStart={() => { if (isEnhanced) navigationFeedback?.begin(); }}
|
|
566
864
|
onCapture={captureNavigation}
|
|
567
865
|
onSupersede={supersedeNavigation}
|
|
568
866
|
onInterrupt={interruptNavigation}
|
|
867
|
+
onInterruptCommitted={interruptCommittedNavigation}
|
|
569
868
|
onRestored={restoreNavigation}
|
|
570
869
|
/>
|
|
571
870
|
{/if}
|
|
572
871
|
|
|
573
872
|
<div
|
|
574
873
|
bind:this={stage}
|
|
575
|
-
style:--stage-page-background={
|
|
874
|
+
style:--stage-page-background={resolvedPageBackground}
|
|
576
875
|
class="stage"
|
|
577
876
|
class:stage-enhanced={isEnhanced}
|
|
578
877
|
class:stage-fallback={isFallback}
|
|
579
878
|
style:--stage-dom-opacity={domLayerOpacity}
|
|
580
879
|
data-stage-state={stageState}
|
|
880
|
+
data-stage-page-ready={isEnhanced && isPageReady ? '' : undefined}
|
|
581
881
|
data-stage-focus={zoomFocusState.focus.toFixed(3)}
|
|
582
882
|
data-stage-ui-focus={zoomFocusState.uiFocus.toFixed(3)}
|
|
583
883
|
data-stage-minimap-focus={zoomFocusState.minimapFocus.toFixed(3)}
|
|
@@ -586,7 +886,7 @@
|
|
|
586
886
|
>
|
|
587
887
|
<div bind:this={virtualScrollSpacer} class="stage-virtual-scroll-spacer" aria-hidden="true"></div>
|
|
588
888
|
|
|
589
|
-
<div class="stage-virtual-viewport">
|
|
889
|
+
<div class="stage-virtual-viewport" inert={fullscreen}>
|
|
590
890
|
<div
|
|
591
891
|
bind:this={domLayer}
|
|
592
892
|
class="stage-dom-layer"
|
|
@@ -603,6 +903,10 @@
|
|
|
603
903
|
</div>
|
|
604
904
|
|
|
605
905
|
<style>
|
|
906
|
+
/* Apply the same document metrics before hydration; the class remains useful
|
|
907
|
+
* to hosts that do not support :has(). */
|
|
908
|
+
:global(html:has(.stage)),
|
|
909
|
+
:global(body:has(.stage)),
|
|
606
910
|
:global(html.stage-route),
|
|
607
911
|
:global(body.stage-route) {
|
|
608
912
|
margin: 0;
|
|
@@ -611,6 +915,7 @@
|
|
|
611
915
|
background: #ffffff;
|
|
612
916
|
}
|
|
613
917
|
|
|
918
|
+
:global(body:has(.stage)),
|
|
614
919
|
:global(body.stage-route) {
|
|
615
920
|
overflow-x: hidden;
|
|
616
921
|
}
|
|
@@ -623,6 +928,19 @@
|
|
|
623
928
|
background: var(--stage-page-background, #ffffff);
|
|
624
929
|
}
|
|
625
930
|
|
|
931
|
+
.stage:global([data-stage-fullscreen]) {
|
|
932
|
+
z-index: 2147483000;
|
|
933
|
+
isolation: isolate;
|
|
934
|
+
}
|
|
935
|
+
.stage:global([data-stage-fullscreen]) .stage-virtual-viewport {
|
|
936
|
+
visibility: hidden;
|
|
937
|
+
pointer-events: none;
|
|
938
|
+
}
|
|
939
|
+
.stage:global([data-stage-fullscreen]) .stage-virtual-viewport :global(*) {
|
|
940
|
+
visibility: hidden !important;
|
|
941
|
+
pointer-events: none !important;
|
|
942
|
+
}
|
|
943
|
+
|
|
626
944
|
.stage-virtual-scroll-spacer {
|
|
627
945
|
display: none;
|
|
628
946
|
width: 1px;
|
|
@@ -632,7 +950,7 @@
|
|
|
632
950
|
|
|
633
951
|
.stage-virtual-viewport {
|
|
634
952
|
position: relative;
|
|
635
|
-
z-index:
|
|
953
|
+
z-index: 3;
|
|
636
954
|
}
|
|
637
955
|
|
|
638
956
|
.stage:global(.stage-virtual-scroll-active) .stage-virtual-scroll-spacer {
|
|
@@ -663,10 +981,23 @@
|
|
|
663
981
|
}
|
|
664
982
|
|
|
665
983
|
.stage :global(.stage-webgpu-carousel-rear) {
|
|
666
|
-
z-index:
|
|
984
|
+
z-index: 2;
|
|
667
985
|
pointer-events: none;
|
|
668
986
|
}
|
|
669
987
|
|
|
988
|
+
.stage :global(.stage-webgpu-background),
|
|
989
|
+
.stage :global(.stage-webgpu-carousel-rear),
|
|
990
|
+
.stage :global(.stage-webgpu-foreground) {
|
|
991
|
+
opacity: 0;
|
|
992
|
+
transition: opacity 240ms ease;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.stage.stage-enhanced :global(.stage-webgpu-background),
|
|
996
|
+
.stage.stage-enhanced :global(.stage-webgpu-carousel-rear),
|
|
997
|
+
.stage.stage-enhanced :global(.stage-webgpu-foreground) {
|
|
998
|
+
opacity: 1;
|
|
999
|
+
}
|
|
1000
|
+
|
|
670
1001
|
.stage :global(.stage-webgpu-foreground) {
|
|
671
1002
|
/* Keep rendered minimaps above the fixed element header (z-index 20). */
|
|
672
1003
|
z-index: 21;
|
|
@@ -675,13 +1006,26 @@
|
|
|
675
1006
|
|
|
676
1007
|
.stage :global(.stage-css3d),
|
|
677
1008
|
.stage :global(.stage-css3d-flat) {
|
|
678
|
-
z-index:
|
|
1009
|
+
z-index: 5;
|
|
679
1010
|
}
|
|
680
1011
|
|
|
681
1012
|
.stage :global(.stage-panel-native) {
|
|
682
|
-
z-index:
|
|
1013
|
+
z-index: 4;
|
|
683
1014
|
}
|
|
684
1015
|
|
|
1016
|
+
/* Carousel surfaces must be below the rear canvas while live summaries stay above it. */
|
|
1017
|
+
.stage :global(.stage-carousel-surface) {
|
|
1018
|
+
position: fixed;
|
|
1019
|
+
left: 0;
|
|
1020
|
+
top: 0;
|
|
1021
|
+
z-index: 1;
|
|
1022
|
+
pointer-events: none;
|
|
1023
|
+
visibility: hidden;
|
|
1024
|
+
}
|
|
1025
|
+
.stage.stage-enhanced :global(.stage-carousel-surface) { visibility: visible; }
|
|
1026
|
+
.stage.stage-enhanced :global([data-carousel-surface-projected]) { visibility: hidden; }
|
|
1027
|
+
.stage:global([data-stage-fullscreen]) :global(.stage-carousel-surface) { visibility: hidden; }
|
|
1028
|
+
|
|
685
1029
|
.stage-dom-layer {
|
|
686
1030
|
position: relative;
|
|
687
1031
|
z-index: 1;
|
|
@@ -715,12 +1059,17 @@
|
|
|
715
1059
|
pointer-events: none !important;
|
|
716
1060
|
}
|
|
717
1061
|
|
|
718
|
-
:global(.stage.stage-enhanced [data-stage-panel-fallback][data-stage-panel-bound]) {
|
|
1062
|
+
:global(.stage.stage-enhanced [data-stage-panel-fallback][data-stage-panel-bound]:not([data-stage-panel-native-content])) {
|
|
719
1063
|
visibility: hidden !important;
|
|
720
1064
|
opacity: 0 !important;
|
|
721
1065
|
pointer-events: none !important;
|
|
722
1066
|
}
|
|
723
1067
|
|
|
1068
|
+
:global(.stage.stage-enhanced [data-stage-panel-native-content][data-stage-panel-bound][data-stage-panel-surface='glass'] > .stage-panel-surface::before),
|
|
1069
|
+
:global(.stage.stage-enhanced [data-stage-panel-native-content][data-stage-panel-bound][data-stage-panel-surface='glass'] > .stage-panel-surface::after) {
|
|
1070
|
+
display: none;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
724
1073
|
/* A failed binding may leave pixels in either canvas; the poster owns fallback paint. */
|
|
725
1074
|
.stage.stage-fallback :global(.stage-webgpu-background),
|
|
726
1075
|
.stage.stage-fallback :global(.stage-webgpu-carousel-rear),
|
|
@@ -744,4 +1093,12 @@
|
|
|
744
1093
|
13px/1.35 system-ui,
|
|
745
1094
|
sans-serif;
|
|
746
1095
|
}
|
|
1096
|
+
|
|
1097
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1098
|
+
.stage :global(.stage-webgpu-background),
|
|
1099
|
+
.stage :global(.stage-webgpu-carousel-rear),
|
|
1100
|
+
.stage :global(.stage-webgpu-foreground) {
|
|
1101
|
+
transition: none;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
747
1104
|
</style>
|