@spatial-elements/core 1.0.0-beta.5 → 1.0.0-beta.7
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/dist/catalog/CarouselDeviceCamera.d.ts +12 -0
- package/dist/catalog/CarouselDeviceCamera.d.ts.map +1 -0
- package/dist/catalog/CarouselDeviceCamera.js +44 -0
- package/dist/catalog/CarouselDeviceCamera.js.map +1 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts +7 -2
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
- package/dist/catalog/CarouselGlassCompositor.js +85 -24
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
- package/dist/catalog/CarouselGround.d.ts +21 -0
- package/dist/catalog/CarouselGround.d.ts.map +1 -0
- package/dist/catalog/CarouselGround.js +107 -0
- package/dist/catalog/CarouselGround.js.map +1 -0
- package/dist/catalog/CatalogDepthBlur.d.ts +26 -0
- package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
- package/dist/catalog/CatalogDepthBlur.js +87 -0
- package/dist/catalog/CatalogDepthBlur.js.map +1 -0
- package/dist/catalog/CatalogModelOutline.d.ts +31 -0
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
- package/dist/catalog/CatalogModelOutline.js +127 -0
- package/dist/catalog/CatalogModelOutline.js.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +44 -2
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +293 -88
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +62 -4
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/SpatialGeometryCapture.d.ts +9 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -1
- package/dist/catalog/SpatialGeometryCapture.js +11 -1
- package/dist/catalog/SpatialGeometryCapture.js.map +1 -1
- package/dist/catalog/cardModelFit.d.ts +7 -0
- package/dist/catalog/cardModelFit.d.ts.map +1 -0
- package/dist/catalog/cardModelFit.js +16 -0
- package/dist/catalog/cardModelFit.js.map +1 -0
- package/dist/catalog/cardProjection.d.ts +8 -0
- package/dist/catalog/cardProjection.d.ts.map +1 -0
- package/dist/catalog/cardProjection.js +51 -0
- package/dist/catalog/cardProjection.js.map +1 -0
- package/dist/catalog/carouselMotion.d.ts +35 -0
- package/dist/catalog/carouselMotion.d.ts.map +1 -1
- package/dist/catalog/carouselMotion.js +85 -4
- package/dist/catalog/carouselMotion.js.map +1 -1
- package/dist/catalog/carouselProximity.d.ts +11 -0
- package/dist/catalog/carouselProximity.d.ts.map +1 -0
- package/dist/catalog/carouselProximity.js +13 -0
- package/dist/catalog/carouselProximity.js.map +1 -0
- package/dist/catalog/carouselSupport.d.ts +4 -0
- package/dist/catalog/carouselSupport.d.ts.map +1 -0
- package/dist/catalog/carouselSupport.js +30 -0
- package/dist/catalog/carouselSupport.js.map +1 -0
- package/dist/catalog/catalogPose.d.ts +36 -6
- package/dist/catalog/catalogPose.d.ts.map +1 -1
- package/dist/catalog/catalogPose.js +79 -23
- package/dist/catalog/catalogPose.js.map +1 -1
- package/dist/catalog/deviceYaw.d.ts +21 -0
- package/dist/catalog/deviceYaw.d.ts.map +1 -0
- package/dist/catalog/deviceYaw.js +87 -0
- package/dist/catalog/deviceYaw.js.map +1 -0
- package/dist/catalog/listDeviceOrientation.d.ts +15 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
- package/dist/catalog/listDeviceOrientation.js +245 -0
- package/dist/catalog/listDeviceOrientation.js.map +1 -0
- package/dist/stage/DeviceGeometryMotion.d.ts +13 -0
- package/dist/stage/DeviceGeometryMotion.d.ts.map +1 -0
- package/dist/stage/DeviceGeometryMotion.js +37 -0
- package/dist/stage/DeviceGeometryMotion.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +2 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +8 -1
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +1 -0
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +7 -0
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +19 -7
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +56 -0
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +53 -17
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +14 -63
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/interactionOutline.d.ts +14 -0
- package/dist/stage/interactionOutline.d.ts.map +1 -0
- package/dist/stage/interactionOutline.js +81 -0
- package/dist/stage/interactionOutline.js.map +1 -0
- package/dist/stage/panelContext.d.ts +2 -0
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +1 -0
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { geometryEndpoint } from './catalogGeometryRequest.js';
|
|
|
2
2
|
import { resolveCatalogJourney, planCatalogParticipants } from './catalogJourney.js';
|
|
3
3
|
import { readCatalogViewContext } from './catalogViewLink.js';
|
|
4
4
|
import { captureCarouselElement } from './carouselPanelProjection.js';
|
|
5
|
+
import { captureCardElement } from './cardProjection.js';
|
|
5
6
|
import { PresentationLease } from './PresentationLease.js';
|
|
6
7
|
import { rebasePresentation } from './rebasePresentation.js';
|
|
7
8
|
import { getProjectiveCssMatrix3d } from '../stage/cssProjection.js';
|
|
@@ -144,6 +145,12 @@ function copyTypography(element, style) {
|
|
|
144
145
|
'white-space',
|
|
145
146
|
'overflow',
|
|
146
147
|
'text-overflow',
|
|
148
|
+
'overflow-wrap',
|
|
149
|
+
'word-break',
|
|
150
|
+
'display',
|
|
151
|
+
'-webkit-box-orient',
|
|
152
|
+
'-webkit-line-clamp',
|
|
153
|
+
'line-clamp',
|
|
147
154
|
'color',
|
|
148
155
|
'text-shadow'
|
|
149
156
|
])
|
|
@@ -342,6 +349,7 @@ export class CatalogTransition {
|
|
|
342
349
|
createActor(identity, source, role, reverse) {
|
|
343
350
|
const paint = role === 'summary-surface' && reverse ? this.hooks.captureSurface?.(source) : undefined;
|
|
344
351
|
const projection = captureCarouselElement(source) ??
|
|
352
|
+
captureCardElement(source) ??
|
|
345
353
|
(role !== 'summary-surface' && reverse ? this.hooks.captureElement?.(source) : undefined);
|
|
346
354
|
const bounds = paint?.bounds ?? (role === 'summary-surface' ? this.hooks.resolveSurface(source) : source);
|
|
347
355
|
const from = bounds.getBoundingClientRect();
|
|
@@ -598,7 +606,11 @@ export class CatalogTransition {
|
|
|
598
606
|
const sources = recipe.roles.map((role) => this.endpoints.resolve({ ...source, role }));
|
|
599
607
|
if (sources.some((element) => !element || !hasSize(element.getBoundingClientRect())))
|
|
600
608
|
return;
|
|
601
|
-
|
|
609
|
+
const carouselTarget = composition === 'carousel'
|
|
610
|
+
? card.querySelector('.spatial-element-target') : null;
|
|
611
|
+
if (!reverse && !(composition === 'carousel'
|
|
612
|
+
? visiblyPresented(card) || (carouselTarget && visiblyPresented(carouselTarget))
|
|
613
|
+
: fullyPresented(card)))
|
|
602
614
|
return;
|
|
603
615
|
if (reverse && sources.some((element) => element && !fullyPresented(element)))
|
|
604
616
|
return;
|
|
@@ -620,7 +632,6 @@ export class CatalogTransition {
|
|
|
620
632
|
host.style.pointerEvents = 'none';
|
|
621
633
|
const capture = {
|
|
622
634
|
view,
|
|
623
|
-
captureShell: !reverse && (intent?.history || intent?.target === 'section'),
|
|
624
635
|
elapsed: 0,
|
|
625
636
|
token,
|
|
626
637
|
identity,
|
|
@@ -694,7 +705,7 @@ export class CatalogTransition {
|
|
|
694
705
|
const sourcesToHide = [];
|
|
695
706
|
const selector = isReturnRecipe(capture.recipe)
|
|
696
707
|
? '[data-catalog-transition-dom="enter"], [data-catalog-transition-group="enter"], [data-catalog-secondary]'
|
|
697
|
-
:
|
|
708
|
+
: '[data-catalog-transition-dom="exit"], [data-catalog-shell]';
|
|
698
709
|
for (const source of this.root.querySelectorAll(selector)) {
|
|
699
710
|
if (source.parentElement?.closest(selector))
|
|
700
711
|
continue;
|
|
@@ -737,8 +748,10 @@ export class CatalogTransition {
|
|
|
737
748
|
}
|
|
738
749
|
copy.dataset.catalogExitCopy = '';
|
|
739
750
|
copy.dataset.catalogBaseOpacity = style.opacity;
|
|
740
|
-
if (source.hasAttribute('data-catalog-shell'))
|
|
751
|
+
if (source.hasAttribute('data-catalog-shell')) {
|
|
741
752
|
copy.dataset.catalogShellCopy = '';
|
|
753
|
+
(capture.shellCopies ??= new Map()).set(source, copy);
|
|
754
|
+
}
|
|
742
755
|
copy.setAttribute('aria-hidden', 'true');
|
|
743
756
|
copy.inert = true;
|
|
744
757
|
Object.assign(copy.style, {
|
|
@@ -829,6 +842,32 @@ export class CatalogTransition {
|
|
|
829
842
|
const capture = this.captureState;
|
|
830
843
|
if (!capture || !this.sequence.start(capture.token))
|
|
831
844
|
return;
|
|
845
|
+
// Persistent shell nodes survive route replacement; the exit copy owns their old pose.
|
|
846
|
+
for (const shell of this.root.querySelectorAll('[data-catalog-shell]'))
|
|
847
|
+
shell.style.removeProperty('visibility');
|
|
848
|
+
// A persistent header visible at both scroll positions is not entering or
|
|
849
|
+
// leaving the page. Hand its snapshot back without an opacity dip.
|
|
850
|
+
for (const [shell, copy] of capture.shellCopies ?? []) {
|
|
851
|
+
delete copy.dataset.catalogShellCopy;
|
|
852
|
+
const sourceRect = copy.getBoundingClientRect();
|
|
853
|
+
// A surface switch can move header text out of the captured surface into
|
|
854
|
+
// a native layer. Transfer continuity to its current shell nodes as well.
|
|
855
|
+
const candidates = new Set([shell, ...this.root.querySelectorAll('[data-catalog-shell]')]);
|
|
856
|
+
let continuous = false;
|
|
857
|
+
for (const current of candidates) {
|
|
858
|
+
if (!current.isConnected || !intersectsViewport(current))
|
|
859
|
+
continue;
|
|
860
|
+
const rect = current.getBoundingClientRect();
|
|
861
|
+
if (current !== shell && !(rect.left < sourceRect.right && rect.right > sourceRect.left &&
|
|
862
|
+
rect.top < sourceRect.bottom && rect.bottom > sourceRect.top))
|
|
863
|
+
continue;
|
|
864
|
+
current.setAttribute('data-catalog-shell-continuous', '');
|
|
865
|
+
capture.restore.push(() => current.removeAttribute('data-catalog-shell-continuous'));
|
|
866
|
+
continuous = true;
|
|
867
|
+
}
|
|
868
|
+
if (continuous)
|
|
869
|
+
copy.style.display = 'none';
|
|
870
|
+
}
|
|
832
871
|
try {
|
|
833
872
|
const reverse = Boolean(capture.view) || isReturnRecipe(capture.recipe);
|
|
834
873
|
if (capture.view) {
|
|
@@ -948,6 +987,17 @@ export class CatalogTransition {
|
|
|
948
987
|
this.hooks.flushFrame();
|
|
949
988
|
}
|
|
950
989
|
if (reverse) {
|
|
990
|
+
// Zoom can withdraw every summary actor. The transferred GPU model
|
|
991
|
+
// still owns geometry: never expose the destination's fallback poster.
|
|
992
|
+
const geometry = this.endpoints.resolve({
|
|
993
|
+
...capture.identity,
|
|
994
|
+
slot: capture.recipe.targetGeometry,
|
|
995
|
+
role: 'geometry'
|
|
996
|
+
});
|
|
997
|
+
if (geometry) {
|
|
998
|
+
preserveStyle(geometry, 'visibility', capture.restore);
|
|
999
|
+
geometry.style.setProperty('visibility', 'hidden', 'important');
|
|
1000
|
+
}
|
|
951
1001
|
const card = this.endpoints.resolve({
|
|
952
1002
|
...capture.identity,
|
|
953
1003
|
slot: capture.recipe.targetShared,
|
|
@@ -1134,6 +1184,14 @@ export class CatalogTransition {
|
|
|
1134
1184
|
return;
|
|
1135
1185
|
}
|
|
1136
1186
|
await new Promise((resolve) => {
|
|
1187
|
+
// Route binding and shader preparation have their own bounded wait above.
|
|
1188
|
+
// Give playback its full safety window instead of cancelling its first
|
|
1189
|
+
// frames when preparation consumed most of the capture deadline.
|
|
1190
|
+
clearTimeout(capture.timeout);
|
|
1191
|
+
capture.timeout = setTimeout(() => {
|
|
1192
|
+
if (this.captureState === capture)
|
|
1193
|
+
this.cancel();
|
|
1194
|
+
}, 5000);
|
|
1137
1195
|
const mode = capture.mode ?? (reverse ? 'synchronous' : this.hooks.beginMotion?.()) ?? 'asynchronous';
|
|
1138
1196
|
capture.mode = mode;
|
|
1139
1197
|
capture.backgroundPrepared ??= !reverse && Boolean(this.hooks.backgroundPrepared?.());
|