@spatial-elements/core 1.0.0-beta.5 → 1.0.0-beta.6

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.
Files changed (73) hide show
  1. package/dist/catalog/CarouselGlassCompositor.d.ts +7 -2
  2. package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
  3. package/dist/catalog/CarouselGlassCompositor.js +85 -24
  4. package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
  5. package/dist/catalog/CarouselGround.d.ts +21 -0
  6. package/dist/catalog/CarouselGround.d.ts.map +1 -0
  7. package/dist/catalog/CarouselGround.js +107 -0
  8. package/dist/catalog/CarouselGround.js.map +1 -0
  9. package/dist/catalog/CatalogDepthBlur.d.ts +26 -0
  10. package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
  11. package/dist/catalog/CatalogDepthBlur.js +87 -0
  12. package/dist/catalog/CatalogDepthBlur.js.map +1 -0
  13. package/dist/catalog/CatalogModelOutline.d.ts +31 -0
  14. package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
  15. package/dist/catalog/CatalogModelOutline.js +127 -0
  16. package/dist/catalog/CatalogModelOutline.js.map +1 -0
  17. package/dist/catalog/CatalogSpatialElementLayer.d.ts +29 -2
  18. package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
  19. package/dist/catalog/CatalogSpatialElementLayer.js +170 -41
  20. package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
  21. package/dist/catalog/CatalogTransition.d.ts.map +1 -1
  22. package/dist/catalog/CatalogTransition.js +49 -4
  23. package/dist/catalog/CatalogTransition.js.map +1 -1
  24. package/dist/catalog/SpatialGeometryCapture.d.ts +9 -0
  25. package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -1
  26. package/dist/catalog/SpatialGeometryCapture.js +11 -1
  27. package/dist/catalog/SpatialGeometryCapture.js.map +1 -1
  28. package/dist/catalog/cardModelFit.d.ts +7 -0
  29. package/dist/catalog/cardModelFit.d.ts.map +1 -0
  30. package/dist/catalog/cardModelFit.js +16 -0
  31. package/dist/catalog/cardModelFit.js.map +1 -0
  32. package/dist/catalog/cardProjection.d.ts +8 -0
  33. package/dist/catalog/cardProjection.d.ts.map +1 -0
  34. package/dist/catalog/cardProjection.js +51 -0
  35. package/dist/catalog/cardProjection.js.map +1 -0
  36. package/dist/catalog/carouselMotion.d.ts +35 -0
  37. package/dist/catalog/carouselMotion.d.ts.map +1 -1
  38. package/dist/catalog/carouselMotion.js +85 -4
  39. package/dist/catalog/carouselMotion.js.map +1 -1
  40. package/dist/catalog/carouselProximity.d.ts +11 -0
  41. package/dist/catalog/carouselProximity.d.ts.map +1 -0
  42. package/dist/catalog/carouselProximity.js +13 -0
  43. package/dist/catalog/carouselProximity.js.map +1 -0
  44. package/dist/catalog/carouselSupport.d.ts +4 -0
  45. package/dist/catalog/carouselSupport.d.ts.map +1 -0
  46. package/dist/catalog/carouselSupport.js +30 -0
  47. package/dist/catalog/carouselSupport.js.map +1 -0
  48. package/dist/catalog/catalogPose.d.ts +36 -6
  49. package/dist/catalog/catalogPose.d.ts.map +1 -1
  50. package/dist/catalog/catalogPose.js +79 -23
  51. package/dist/catalog/catalogPose.js.map +1 -1
  52. package/dist/stage/LiquidGlassPanel.d.ts +2 -0
  53. package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
  54. package/dist/stage/LiquidGlassPanel.js +8 -1
  55. package/dist/stage/LiquidGlassPanel.js.map +1 -1
  56. package/dist/stage/PanelPresentationController.d.ts.map +1 -1
  57. package/dist/stage/PanelPresentationController.js +7 -0
  58. package/dist/stage/PanelPresentationController.js.map +1 -1
  59. package/dist/stage/StageExperience.d.ts +40 -0
  60. package/dist/stage/StageExperience.d.ts.map +1 -1
  61. package/dist/stage/StageExperience.js +11 -13
  62. package/dist/stage/StageExperience.js.map +1 -1
  63. package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
  64. package/dist/stage/StageRenderPipeline.js +11 -62
  65. package/dist/stage/StageRenderPipeline.js.map +1 -1
  66. package/dist/stage/interactionOutline.d.ts +14 -0
  67. package/dist/stage/interactionOutline.d.ts.map +1 -0
  68. package/dist/stage/interactionOutline.js +81 -0
  69. package/dist/stage/interactionOutline.js.map +1 -0
  70. package/dist/stage/panelContext.d.ts +2 -0
  71. package/dist/stage/panelContext.d.ts.map +1 -1
  72. package/dist/stage/panelContext.js.map +1 -1
  73. 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
- if (!reverse && !(composition === 'carousel' ? visiblyPresented(card) : fullyPresented(card)))
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
- : `[data-catalog-transition-dom="exit"]${capture.captureShell ? ', [data-catalog-shell]' : ''}`;
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,19 @@ 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
+ if (!shell.isConnected || !intersectsViewport(shell))
853
+ continue;
854
+ shell.setAttribute('data-catalog-shell-continuous', '');
855
+ capture.restore.push(() => shell.removeAttribute('data-catalog-shell-continuous'));
856
+ copy.style.display = 'none';
857
+ }
832
858
  try {
833
859
  const reverse = Boolean(capture.view) || isReturnRecipe(capture.recipe);
834
860
  if (capture.view) {
@@ -948,6 +974,17 @@ export class CatalogTransition {
948
974
  this.hooks.flushFrame();
949
975
  }
950
976
  if (reverse) {
977
+ // Zoom can withdraw every summary actor. The transferred GPU model
978
+ // still owns geometry: never expose the destination's fallback poster.
979
+ const geometry = this.endpoints.resolve({
980
+ ...capture.identity,
981
+ slot: capture.recipe.targetGeometry,
982
+ role: 'geometry'
983
+ });
984
+ if (geometry) {
985
+ preserveStyle(geometry, 'visibility', capture.restore);
986
+ geometry.style.setProperty('visibility', 'hidden', 'important');
987
+ }
951
988
  const card = this.endpoints.resolve({
952
989
  ...capture.identity,
953
990
  slot: capture.recipe.targetShared,
@@ -1134,6 +1171,14 @@ export class CatalogTransition {
1134
1171
  return;
1135
1172
  }
1136
1173
  await new Promise((resolve) => {
1174
+ // Route binding and shader preparation have their own bounded wait above.
1175
+ // Give playback its full safety window instead of cancelling its first
1176
+ // frames when preparation consumed most of the capture deadline.
1177
+ clearTimeout(capture.timeout);
1178
+ capture.timeout = setTimeout(() => {
1179
+ if (this.captureState === capture)
1180
+ this.cancel();
1181
+ }, 5000);
1137
1182
  const mode = capture.mode ?? (reverse ? 'synchronous' : this.hooks.beginMotion?.()) ?? 'asynchronous';
1138
1183
  capture.mode = mode;
1139
1184
  capture.backgroundPrepared ??= !reverse && Boolean(this.hooks.backgroundPrepared?.());