@spatial-elements/sveltekit 1.0.0-beta.11 → 1.0.0-beta.13

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.
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { MenuItem } from '@page-sections/core';
3
3
  import type { Snippet } from 'svelte';
4
+ import { preventBrowserPinch } from '@spatial-elements/core/stage/browserPinch';
4
5
  import '@page-sections/svelte/styles.css';
5
6
  import { retainDeviceOrientationPermission } from '@spatial-elements/core/catalog/listDeviceOrientation';
6
7
  import Stage from '../stage/Stage.svelte';
@@ -54,9 +55,10 @@
54
55
  provideSpatialMessages(() => messages);
55
56
 
56
57
  const brandStyle = $derived(getSpatialThemeStyle(theme));
58
+ function attachPinchPolicy(node: HTMLElement) { return { destroy: preventBrowserPinch(node) }; }
57
59
  </script>
58
60
 
59
- <div class="brand-stage-shell" style={brandStyle} style:color-scheme={colorScheme} data-color-scheme={colorScheme}>
61
+ <div use:attachPinchPolicy class="brand-stage-shell" style={brandStyle} style:color-scheme={colorScheme} data-color-scheme={colorScheme}>
60
62
  <Stage
61
63
  {deviceOrientation}
62
64
  brandId={theme.id}
@@ -24,27 +24,36 @@
24
24
  let toast: HTMLDivElement;
25
25
  let failure = $state<'permission-required' | 'unavailable'>('unavailable');
26
26
  let requested = $state(false);
27
+ let toastMessage = $state('');
27
28
  let toastTimer: ReturnType<typeof setTimeout> | undefined;
29
+ function showToast(message: string) {
30
+ toastMessage = message;
31
+ toast.showPopover();
32
+ clearTimeout(toastTimer);
33
+ toastTimer = setTimeout(() => toast.hidePopover(), 3500);
34
+ }
28
35
 
29
36
  function connect() {
30
37
  dialog.close();
38
+ toast.hidePopover();
39
+ clearTimeout(toastTimer);
31
40
  requested = true;
32
41
  stage.setSpaceMouseEnabled?.(true);
33
42
  }
34
43
  function toggle() {
35
44
  if (connected || connecting) {
45
+ const cancelled = connecting;
36
46
  requested = false;
37
47
  toast.hidePopover();
38
48
  stage.setSpaceMouseEnabled?.(false);
49
+ if (cancelled) showToast(copy.spaceMouseCancelled);
39
50
  } else connect();
40
51
  }
41
52
  $effect(() => {
42
53
  if (!requested) return;
43
54
  if (connectionState === 'connected') {
44
55
  requested = false;
45
- toast.showPopover();
46
- clearTimeout(toastTimer);
47
- toastTimer = setTimeout(() => toast.hidePopover(), 3500);
56
+ showToast(copy.spaceMouseReady);
48
57
  } else if (connectionState === 'permission-required' || connectionState === 'unavailable') {
49
58
  requested = false;
50
59
  failure = connectionState;
@@ -101,7 +110,7 @@
101
110
  </div>
102
111
  </dialog>
103
112
  <div bind:this={toast} popover="manual" role="status" class="connection-toast">
104
- {copy.spaceMouseReady}
113
+ {toastMessage}
105
114
  </div>
106
115
 
107
116
  <style>
@@ -1,11 +1,35 @@
1
1
  <script lang="ts">
2
2
  import { resolve } from '$app/paths';
3
3
  import { Breadcrumbs } from '@page-sections/svelte';
4
+ import { getContext, onMount } from 'svelte';
5
+ import { STAGE_CONTEXT_KEY, type StageContext } from '@spatial-elements/core/stage/panelContext';
6
+ import { getPanelFocusProgress } from '@spatial-elements/core/stage/panelFocusMath';
4
7
  import type { SpatialElementBreadcrumb } from '@spatial-elements/core/spatial-element/types';
5
- let { items, transition = 'enter' }: { items: SpatialElementBreadcrumb[]; transition?: 'enter' | 'exit' } = $props();
8
+ let { items, transition = 'enter', focusReactive = true }: { items: SpatialElementBreadcrumb[]; transition?: 'enter' | 'exit'; focusReactive?: boolean } = $props();
9
+ const stage = getContext<StageContext | undefined>(STAGE_CONTEXT_KEY);
10
+ const focus = $derived(focusReactive ? getPanelFocusProgress(stage?.getZoomUiFocus?.() ?? 0) : 0);
11
+ let element: HTMLDivElement;
12
+ let menu = $state<HTMLElement>();
13
+ let menuSize = $state({ width: 0, height: 0 });
14
+ onMount(() => {
15
+ menu = element.closest('.stage')?.querySelector<HTMLElement>('[data-spatial-shell-menu]') ?? undefined;
16
+ if (!menu) return;
17
+ const measure = () => { menuSize = { width: menu!.offsetWidth, height: menu!.offsetHeight }; };
18
+ measure();
19
+ const observer = new ResizeObserver(measure); observer.observe(menu);
20
+ return () => observer.disconnect();
21
+ });
22
+ const travel = $derived.by(() => {
23
+ if (!focus) return '0px 0px';
24
+ if (!menu) return `0px ${-112 * focus}px`;
25
+ // The native shell receives the exact GPU projection in the same frame.
26
+ // Follow its lower-left corner, including perspective expansion.
27
+ const matrix = new DOMMatrixReadOnly(menu.style.transform || undefined);
28
+ return `${matrix.m41 - menuSize.width * (matrix.a - 1) / 2}px ${matrix.m42 + menuSize.height * (matrix.d - 1) / 2}px`;
29
+ });
6
30
  const resolved = $derived(items.map(item => ({ ...item, href: item.href ? resolve(...([item.href] as unknown as Parameters<typeof resolve>)) : undefined })));
7
31
  </script>
8
- <div class="breadcrumbs spatial-content-width" data-stage-dom-content data-catalog-transition-dom={transition}>
32
+ <div bind:this={element} class="breadcrumbs spatial-content-width" style:translate={travel} data-stage-dom-content data-catalog-transition-dom={transition}>
9
33
  <Breadcrumbs items={resolved} />
10
34
  </div>
11
35
  <style>
@@ -2,6 +2,7 @@ import type { SpatialElementBreadcrumb } from '@spatial-elements/core/spatial-el
2
2
  type $$ComponentProps = {
3
3
  items: SpatialElementBreadcrumb[];
4
4
  transition?: 'enter' | 'exit';
5
+ focusReactive?: boolean;
5
6
  };
6
7
  declare const SpatialElementBreadcrumbs: import("svelte").Component<$$ComponentProps, {}, "">;
7
8
  type SpatialElementBreadcrumbs = ReturnType<typeof SpatialElementBreadcrumbs>;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { getContext, onMount } from 'svelte';
3
3
  import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
4
+ import { getPanelFocusOpacity } from '@spatial-elements/core/stage/panelFocusMath';
4
5
  import { STAGE_CONTEXT_KEY, type StageContext } from '@spatial-elements/core/stage/panelContext';
5
6
  import Play from 'lucide-svelte/icons/play';
6
7
  import OverflowControls from './OverflowControls.svelte';
@@ -63,13 +64,15 @@
63
64
  });
64
65
  onMount(() => {
65
66
  const element = rail!;
66
- const minimapFrame = element.querySelector<HTMLElement>('[data-spatial-element-dock-minimap-anchor] .stage-panel-fallback');
67
- const updateDock = () => { minimapDocked = Number(minimapFrame?.dataset.stageMinimapDockProgress ?? 0) > 0; };
67
+ const root = element.closest('[data-spatial-element-root]');
68
+ const updateDock = () => { minimapDocked = root?.hasAttribute('data-spatial-element-dock-active') ?? false; };
68
69
  window.addEventListener(STAGE_PANEL_VISUAL_EVENT, updateDock);
70
+ window.addEventListener(STAGE_PANEL_LAYOUT_EVENT, updateDock);
69
71
  updateDock();
70
72
  element.addEventListener('scroll', refreshProjection, { passive: true });
71
73
  return () => {
72
74
  window.removeEventListener(STAGE_PANEL_VISUAL_EVENT, updateDock);
75
+ window.removeEventListener(STAGE_PANEL_LAYOUT_EVENT, updateDock);
73
76
  element.removeEventListener('scroll', refreshProjection);
74
77
  cancelAnimationFrame(refreshFrame);
75
78
  };
@@ -88,7 +91,9 @@
88
91
  <aside
89
92
  bind:this={rail}
90
93
  class="spatial-element-rail"
94
+ class:focused
91
95
  data-spatial-element-media-rail
96
+ inert={getPanelFocusOpacity(stage.getZoomUiFocus?.() ?? 0) < 0.12 || (stage.isFullscreen?.() ?? false)}
92
97
  aria-label="Product media"
93
98
  >
94
99
  {#each spatialElement.media as media (media.id)}
@@ -220,6 +225,11 @@
220
225
  .spatial-element-rail::-webkit-scrollbar {
221
226
  display: none;
222
227
  }
228
+ @media (width < 840px) {
229
+ /* Let the row travel down with the summary; keep off-rail thumbnails
230
+ * clipped horizontally while removing the stationary vertical cut-off. */
231
+ .spatial-element-rail.focused { overflow: visible; clip-path: inset(-100vh 0 -100vh 0); }
232
+ }
223
233
 
224
234
  .spatial-element-media-anchor {
225
235
  width: 100%;
@@ -2,6 +2,8 @@
2
2
  import { getContext, onMount, setContext } from 'svelte';
3
3
  import ShoppingCart from 'lucide-svelte/icons/shopping-cart';
4
4
  import { SpatialElementPaneController } from '@spatial-elements/core/spatial-element/SpatialElementPaneController';
5
+ import { SpatialElementHeaderFields } from '@spatial-elements/core/spatial-element/SpatialElementHeaderFields';
6
+ import './headerFields.css';
5
7
  import { resolveActiveDetailSection } from '@spatial-elements/core/spatial-element/activeDetailSection';
6
8
  import { resolveDetailLayout } from '@spatial-elements/core/spatial-element/responsiveLayout';
7
9
  import {
@@ -140,6 +142,8 @@
140
142
  }
141
143
 
142
144
  onMount(() => {
145
+ const headerFields = new SpatialElementHeaderFields(mainElement);
146
+ headerFields.start();
143
147
  const orderSections = () => sectionRegistry.order([...mainElement.querySelectorAll<HTMLElement>('[data-ps-section]')].map(node => node.id));
144
148
  const sectionOrder = new MutationObserver(orderSections);
145
149
  sectionOrder.observe(mainElement, { childList: true, subtree: true });
@@ -174,6 +178,7 @@
174
178
  scheduleScrollSpy();
175
179
 
176
180
  return () => {
181
+ headerFields.destroy();
177
182
  sectionOrder.disconnect();
178
183
  unregisterMedia?.();
179
184
  paneController?.destroy();
@@ -200,17 +205,19 @@
200
205
  data-brand-id={spatialElement.brandId}
201
206
  data-spatial-selected-media={selectedMedia.kind}
202
207
  style:--spatial-pane-tint={paneTint}
203
- style:--spatial-pane-tint-opacity={`${Math.min(1, Math.max(0, brand.panelTheme.tintOpacity ?? 0.28)) * 100}%`}
208
+ style:--spatial-pane-tint-opacity={`${Math.min(1, Math.max(0.8, brand.panelTheme.tintOpacity ?? 0.28)) * 100}%`}
204
209
  style:--spatial-pane-blur={`${Math.min(100, Math.max(0, brand.panelTheme.backdropBlur ?? 5))}px`}
205
210
  >
206
- <div class="spatial-element-pane-heading" data-spatial-detail-pane-header data-spatial-detail-fixed>
207
- <SpatialElementBreadcrumbs items={spatialElement.breadcrumbs} />
211
+ <div class="spatial-element-pane-heading" data-spatial-detail-pane-header data-spatial-detail-fixed data-spatial-element-handoff-header>
212
+ <SpatialElementBreadcrumbs items={spatialElement.breadcrumbs} focusReactive={!splitPane} />
208
213
  <div class="spatial-element-pane-title-row">
214
+ <div class="spatial-element-pane-copy">
209
215
  <p class="spatial-element-pane-title">{spatialElement.title}</p>
210
216
  {#if spatialElement.eyebrow}<p class="spatial-element-pane-eyebrow">{spatialElement.eyebrow}</p>{/if}
211
- {@render headerDetails?.()}
217
+ </div>
218
+ {#if headerDetails}<div class="spatial-element-pane-order">{@render headerDetails()}</div>{/if}
212
219
  {#if spatialElement.action}
213
- <button type="button" class="spatial-element-pane-action" onclick={invokePaneAction}
220
+ <button type="button" class="spatial-element-pane-action" data-spatial-element-dock-action onclick={invokePaneAction}
214
221
  aria-label={spatialElement.action.ariaLabel ?? spatialElement.action.label}>
215
222
  {#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart size={24} aria-hidden="true" />{/if}
216
223
  </button>
@@ -319,6 +326,7 @@
319
326
  background: transparent;
320
327
  pointer-events: none;
321
328
  }
329
+ @media (width < 840px) { .spatial-element-content { padding-top: 0; } }
322
330
  @media (min-width: 840px) {
323
331
  .spatial-element-hero { height: var(--spatial-detail-fit-height); }
324
332
  .spatial-element-content { padding-top: 8px; }
@@ -1,3 +1,4 @@
1
+ import './headerFields.css';
1
2
  import type { Snippet } from 'svelte';
2
3
  import './layout.generated.css';
3
4
  import type { SpatialElementData } from '@spatial-elements/core/spatial-element/types';
@@ -28,6 +28,7 @@
28
28
  <header
29
29
  class="spatial-element-sticky-header"
30
30
  data-spatial-element-sticky-header
31
+ data-spatial-element-handoff-header
31
32
  data-catalog-transition-dom="enter"
32
33
  aria-label="Current element"
33
34
  aria-hidden="true"
@@ -152,7 +153,7 @@
152
153
  width: 100%;
153
154
  height: var(--spatial-detail-dock-height);
154
155
  border: 0;
155
- border-radius: var(--spatial-element-panel-radius);
156
+ border-radius: 0;
156
157
  visibility: hidden;
157
158
  background: transparent;
158
159
  box-shadow: none;
@@ -272,7 +273,7 @@
272
273
  z-index: 1;
273
274
  }
274
275
 
275
- .sticky-header-content { display: flex; align-items: center; gap: 16px; min-width: 0; }
276
+ .sticky-header-content { container: spatial-header / inline-size; display: flex; align-items: center; gap: 16px; min-width: 0; }
276
277
  .sticky-header-details { flex: none; }
277
278
  .sticky-header-copy {
278
279
  flex: 1;
@@ -306,7 +307,6 @@
306
307
  }
307
308
 
308
309
  .sticky-header-action {
309
- visibility: hidden;
310
310
  display: grid;
311
311
  place-items: center;
312
312
  width: 54px;
@@ -319,12 +319,11 @@
319
319
  text-decoration: none;
320
320
  cursor: pointer;
321
321
  }
322
- .spatial-element-sticky-header:global([data-action-active]) .sticky-header-action { visibility: visible; }
323
322
 
323
+ @media (1600px <= width < 2300px) {
324
+ .spatial-element-sticky-header { border-radius: 0 0 var(--spatial-element-panel-radius) var(--spatial-element-panel-radius); }
325
+ }
324
326
  @media (width < 840px) {
325
- .sticky-header-content.has-details { display: grid; gap: 2px; }
326
- .has-details .sticky-header-kicker { display: none; }
327
- .has-details .sticky-header-title { font-size: 14px; line-height: 18px; }
328
327
  .sticky-header-layout {
329
328
  gap: 8px;
330
329
  padding-right: 8px;
@@ -332,4 +331,13 @@
332
331
  .sticky-header-title { font-size: 18px; line-height: 24px; }
333
332
  .spatial-element-sticky-tabs { display: none; }
334
333
  }
334
+ @container spatial-header (max-width: 479px) {
335
+ .sticky-header-details :global([data-spatial-element-header-field='quantity']) { display: none; }
336
+ }
337
+ @container spatial-header (max-width: 359px) {
338
+ .sticky-header-details { display: none; }
339
+ }
340
+ @media (width < 600px) {
341
+ .sticky-header-details { display: none; }
342
+ }
335
343
  </style>
@@ -19,7 +19,7 @@
19
19
  const catalogEndpoint = createCatalogEndpointAction();
20
20
  </script>
21
21
  <div bind:this={element} class="summary-presentation">
22
- {#if leading}<div use:catalogEndpoint={address('leading')}
22
+ {#if leading}<div class="summary-leading" use:catalogEndpoint={address('leading')}
23
23
  data-catalog-rich-shared="leading" data-catalog-semantic={spatialElement.id}>
24
24
  {@render leading()}
25
25
  </div>{/if}
@@ -62,6 +62,7 @@
62
62
  {/each}
63
63
  </ul>{/if}
64
64
 
65
+ {#if beforeAction || spatialElement.action}<div class="summary-commerce">
65
66
  {#if beforeAction}<div use:catalogEndpoint={address('action-details')}
66
67
  data-catalog-rich-shared="action-details" data-catalog-semantic={spatialElement.id}>
67
68
  {@render beforeAction()}
@@ -108,6 +109,7 @@
108
109
  </button>
109
110
  {/if}
110
111
  {/if}
112
+ </div>{/if}
111
113
  </div>
112
114
  <style>
113
115
  .summary-presentation {
@@ -127,6 +129,8 @@
127
129
  font-weight: 780;
128
130
  line-height: 1.16;
129
131
  }
132
+ .summary-commerce { display: grid; gap: 20px; min-width: 0; align-content: start; }
133
+ .summary-leading, .panel-copy { min-width: 0; }
130
134
 
131
135
  .panel-kicker {
132
136
  margin: 0;
@@ -194,5 +198,15 @@
194
198
  white-space: normal;
195
199
  }
196
200
  @container spatial-summary (min-width: 420px) { .summary-title { font-size: 32px; } }
201
+ @container spatial-summary (min-width: 500px) {
202
+ .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
203
+ .summary-commerce { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
204
+ }
205
+ @container spatial-summary (min-width: 900px) {
206
+ .summary-presentation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
207
+ .summary-leading, .panel-copy { grid-column: 1 / -1; }
208
+ .feature-list { grid-column: span 2; }
209
+ .summary-commerce { grid-column: 3; grid-template-columns: minmax(0, 1fr); }
210
+ }
197
211
 
198
212
  </style>
@@ -13,16 +13,19 @@
13
13
  const contentInset = $derived(theme.panelShape.contentInset ?? Math.max(16, Math.round(theme.panelShape.radius * 0.7)));
14
14
  let presentation = $state<HTMLDivElement>(null!);
15
15
  let panelHeight = $state<number>();
16
+ let viewportWidth = $state<number>();
16
17
 
17
18
  onMount(() => {
18
19
  // The stage reparents the rendered content. Keep its layout placeholder in
19
20
  // sync using untransformed content size, including wrapping and font loads.
20
21
  // Explicit ownership transfers finish their reflow before revealing pixels.
21
22
  // offsetHeight is untransformed, unlike the projected CSS3D bounding box.
22
- const measureTransfer = () => { panelHeight = presentation.offsetHeight + contentInset * 2; };
23
+ const measureTransfer = () => { if (!presentation.getClientRects().length) return; panelHeight = presentation.offsetHeight + contentInset * 2; };
23
24
  measureTransfer();
24
25
  presentation.addEventListener('spatial-summary-measure', measureTransfer);
25
26
  const observer = new ResizeObserver(([entry]) => {
27
+ // CSS3D culling sets display:none; this is not a content resize.
28
+ if (!presentation.getClientRects().length) return;
26
29
  const height = entry.borderBoxSize?.[0]?.blockSize ?? presentation.offsetHeight;
27
30
  panelHeight = Math.ceil(height + contentInset * 2);
28
31
  });
@@ -31,6 +34,8 @@
31
34
  });
32
35
  </script>
33
36
 
37
+ <svelte:window bind:innerWidth={viewportWidth} />
38
+
34
39
  <div class="spatial-element-aside" data-spatial-summary-aside style:--summary-panel-height={panelHeight === undefined ? undefined : `${panelHeight}px`}>
35
40
  <Panel
36
41
  {nativeContent}
@@ -45,7 +50,7 @@
45
50
  focusReactive={!nativeContent}
46
51
  transitionGroup="shared"
47
52
  class="spatial-element-panel"
48
- shape={{ ...theme.panelShape, radius: radii.panel, contentInset }}
53
+ shape={{ ...theme.panelShape, radius: radii.panel, squareBottom: viewportWidth !== undefined && viewportWidth < 840, contentInset }}
49
54
  theme={theme.panelTheme}
50
55
  contentClass="stage-panel-content spatial-element-content"
51
56
  aria-labelledby="spatial-element-title"
@@ -88,4 +93,9 @@
88
93
  @media (min-width: 840px) {
89
94
  .spatial-element-aside { position: absolute; top: 0; right: var(--spatial-detail-summary-right); margin: 0; }
90
95
  }
96
+ @media (width < 840px) {
97
+ :global(.spatial-element-panel .stage-panel-surface), :global(.spatial-element-panel) {
98
+ border-bottom-left-radius: 0; border-bottom-right-radius: 0;
99
+ }
100
+ }
91
101
  </style>
@@ -61,6 +61,13 @@
61
61
  background: color-mix(in srgb, var(--spatial-element-body) 8%, transparent);
62
62
  }
63
63
  .spatial-icon-button[aria-pressed="true"] { color: var(--spatial-element-accent); background: var(--ps-selection, var(--ps-section-muted, #eeeeee)); }
64
+ /* Busy remains operable so a pending device search can be cancelled. */
65
+ .spatial-icon-button[aria-busy="true"] { color: var(--spatial-element-accent); background: var(--ps-selection, var(--ps-section-muted, #eeeeee)); }
66
+ .spatial-icon-button[aria-busy="true"] :global(svg) { animation: searching 1.2s ease-in-out infinite; }
67
+ @keyframes searching { 50% { opacity: 0.35; } }
64
68
  .spatial-icon-button:focus-visible { outline: 2px solid var(--spatial-element-accent); outline-offset: 3px; }
65
- @media (prefers-reduced-motion: reduce) { .spatial-icon-button { transition: none; } }
69
+ @media (prefers-reduced-motion: reduce) {
70
+ .spatial-icon-button { transition: none; }
71
+ .spatial-icon-button[aria-busy="true"] :global(svg) { animation: none; opacity: 0.6; }
72
+ }
66
73
  </style>
@@ -15,13 +15,14 @@
15
15
  const stageContext = getContext<StageContext | undefined>(STAGE_CONTEXT_KEY);
16
16
  const readTheme = useSpatialTheme();
17
17
  const theme = $derived(readTheme());
18
- $effect(() => { void theme; void fixedDetail; stageContext?.updatePanelAppearance?.(); });
18
+ $effect(() => { void theme; void fixedDetail; void edgeToEdge; stageContext?.updatePanelAppearance?.(); });
19
19
  const radii = $derived(resolveSpatialThemeRadii(theme));
20
20
  let rack: HTMLDivElement;
21
21
  let stage: HTMLElement | undefined;
22
22
  let enhancedScroll = false;
23
23
  let satellitesVisible = false;
24
24
  let fixedDetail = $state(false);
25
+ let edgeToEdge = $state(true);
25
26
 
26
27
  function position(scrollY = getStageVisualScrollPosition().scrollY) {
27
28
  if (!rack) return;
@@ -36,6 +37,7 @@
36
37
  const previousMode = `${enhancedScroll}/${fixedDetail}`;
37
38
  enhancedScroll = stage.classList.contains('stage-virtual-scroll-active');
38
39
  satellitesVisible = window.innerWidth >= layoutTokens.layoutMinWidths.xl;
40
+ edgeToEdge = !satellitesVisible;
39
41
  fixedDetail = getComputedStyle(rack).getPropertyValue('--spatial-shell-fixed').trim() === '1';
40
42
  position();
41
43
  if (previousMode !== `${enhancedScroll}/${fixedDetail}`) window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
@@ -99,7 +101,7 @@
99
101
  getMinimapModelScale: () => 1, getMinimapModelTop: () => undefined,
100
102
  getSurface: () => theme.panelTheme.surface ?? 'frosted',
101
103
  getSurfaceOpacity: () => 1,
102
- getOptions: () => ({ ...theme.panelTheme, radius: role === 'menu' ? radii.panel : radii.control })
104
+ getOptions: () => ({ ...theme.panelTheme, radius: role === 'menu' ? (edgeToEdge ? 0 : radii.panel) : radii.control })
103
105
  });
104
106
  });
105
107
  const stop = subscribeStageScrollFrame(frame => position(frame.scrollY), STAGE_SCROLL_PRIORITY.virtualDocument + 1);
@@ -135,4 +137,5 @@
135
137
  .spatial-shell-rack :global(.satellite) { border-radius: var(--spatial-element-control-radius); }
136
138
  :global(.stage-virtual-scroll-active) .spatial-shell-rack { position: relative; transform: translateY(var(--spatial-shell-scroll-compensation, 0px)); }
137
139
  [data-spatial-navigation-glass] :global([data-stage-panel-bound]) { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
140
+ @media (width < 1600px) { .spatial-shell-rack :global(.header) { border-radius: 0; } }
138
141
  </style>
@@ -64,9 +64,9 @@
64
64
  .spatial-summary-surface[hidden] { display: none; }
65
65
  :global([data-carousel-glass-ready]) .spatial-summary-surface,
66
66
  :global([data-spatial-presentation-glass]) .spatial-summary-surface { visibility: hidden; }
67
- .compact-copy { position: relative; padding-right: 44px; }
67
+ .compact-copy { position: relative; box-sizing: border-box; padding: 8px 52px 8px 12px; }
68
68
  .compact-copy p { height: 26px; margin: 0; font-size: 12px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
69
- .compact-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; height: 40px; margin: 0; overflow: hidden; font-size: 18px; line-height: 20px; }
69
+ .compact-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 1; height: 24px; margin: 0; overflow: hidden; font-size: 18px; line-height: 24px; }
70
70
  .full-summary, .section-information { display: none; }
71
71
  .information { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 40px; height: 40px; margin: 0; color: var(--spatial-element-accent); pointer-events: auto; }
72
72
  .information svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@@ -0,0 +1,21 @@
1
+ /* Keep the space reserved so revealing order controls never shifts the title. */
2
+ [data-spatial-element-handoff-header] :is([data-spatial-element-header-field], [data-spatial-element-dock-action]) {
3
+ opacity: 0;
4
+ visibility: hidden;
5
+ transform: translateY(4px);
6
+ pointer-events: none;
7
+ transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
8
+ }
9
+ [data-spatial-element-handoff-header] :is([data-spatial-element-header-field], [data-spatial-element-dock-action])[data-header-field-visible] {
10
+ opacity: 1;
11
+ visibility: visible;
12
+ transform: none;
13
+ pointer-events: auto;
14
+ transition-delay: 0s;
15
+ }
16
+ @media (prefers-reduced-motion: reduce) {
17
+ [data-spatial-element-handoff-header] :is([data-spatial-element-header-field], [data-spatial-element-dock-action]) {
18
+ transition: none;
19
+ transform: none;
20
+ }
21
+ }
@@ -263,6 +263,18 @@
263
263
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-summary-query { max-height: none; overflow: visible; overscroll-behavior: auto; }
264
264
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel .stage-panel-surface::before,
265
265
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel .stage-panel-surface::after { display: none; }
266
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel .stage-panel-surface {
267
+ border-radius: 0;
268
+ background: color-mix(in srgb, var(--spatial-pane-tint) var(--spatial-pane-tint-opacity), transparent);
269
+ -webkit-backdrop-filter: none; backdrop-filter: none;
270
+ }
271
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .ps-section { --spatial-pane-section-color: var(--spatial-pane-tint); }
272
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .ps-section[data-background-color='standard'] { --spatial-pane-section-color: var(--ps-section-standard); }
273
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .ps-section[data-background-color='muted'] { --spatial-pane-section-color: var(--ps-section-muted); }
274
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .ps-section > .ps-section-surface {
275
+ background: color-mix(in srgb, var(--spatial-pane-section-color) var(--spatial-pane-tint-opacity), transparent) !important;
276
+ -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; box-shadow: none;
277
+ }
266
278
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .panel-copy {
267
279
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%);
268
280
  }
@@ -274,26 +286,32 @@
274
286
  display: block; position: fixed; z-index: 0; top: var(--spatial-pane-top); left: var(--spatial-pane-left);
275
287
  width: var(--spatial-pane-width); height: var(--spatial-pane-height);
276
288
  border-radius: var(--spatial-element-panel-radius); pointer-events: none;
277
- background: color-mix(in srgb, var(--spatial-pane-tint) var(--spatial-pane-tint-opacity), transparent);
278
- backdrop-filter: blur(var(--spatial-pane-blur)); box-shadow: var(--spatial-element-docked-panel-box-shadow);
289
+ background: transparent;
290
+ /* The scrolling body's clip-path is a Backdrop Root: child filters cannot
291
+ * sample the stage canvas. Blur once on this unclipped sibling, then paint
292
+ * the individual (at least 80% opaque) section colors above it. */
293
+ -webkit-backdrop-filter: blur(var(--spatial-pane-blur));
294
+ backdrop-filter: blur(var(--spatial-pane-blur));
295
+ box-shadow: var(--spatial-element-docked-panel-box-shadow);
279
296
  transform: translateY(var(--spatial-pane-fixed-compensation, 0px));
280
297
  }
281
298
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-heading {
282
- display: block; box-sizing: border-box; position: fixed; z-index: 3;
299
+ display: block; box-sizing: border-box; padding-block: 4px; position: fixed; z-index: 3;
283
300
  top: var(--spatial-pane-top); left: var(--spatial-pane-left); width: var(--spatial-pane-width); height: 86px;
284
301
  border-radius: var(--spatial-element-panel-radius) var(--spatial-element-panel-radius) 0 0;
285
302
  background: color-mix(in srgb, var(--spatial-pane-tint) var(--spatial-pane-tint-opacity), transparent);
286
- backdrop-filter: blur(var(--spatial-pane-blur)); pointer-events: auto;
303
+ -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: auto;
287
304
  border-bottom: 1px solid color-mix(in srgb, var(--spatial-element-ink) 14%, transparent);
288
305
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.08);
289
306
  transform: translateY(var(--spatial-pane-fixed-compensation, 0px));
290
307
  }
291
- .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-title-row { display: flex; align-items: center; gap: 16px; height: 46px; padding-inline: 16px; }
292
- .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-heading .breadcrumbs { width: 100%; }
293
- .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-title { min-width: 0; flex: 1; margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
294
- .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-eyebrow { margin: 0; font-size: 14px; line-height: 20px; white-space: nowrap; }
295
- .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-action { visibility: hidden; display: grid; place-items: center; flex: none; width: 54px; height: 54px; padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); color: var(--spatial-element-on-accent); background: var(--spatial-element-accent); cursor: pointer; }
296
- .stage [data-spatial-element-root]:not([data-spatial-detail-flow])[data-spatial-detail-pane-action] .spatial-element-pane-action { visibility: visible; }
308
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-title-row { display: flex; align-items: center; gap: 16px; height: 100%; margin-top: -24px; padding-inline: 16px; }
309
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-heading .breadcrumbs { width: 100%; height: 24px; --ps-breadcrumb-height: 24px; padding-inline: 16px; }
310
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-copy { padding-top: 24px; display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
311
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-order { flex: none; }
312
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-title { min-width: 0; flex: 0 1 auto; margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
313
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; margin: 0; font-size: 14px; line-height: 20px; white-space: nowrap; }
314
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-action { display: grid; place-items: center; flex: none; width: 54px; height: 54px; padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); color: var(--spatial-element-on-accent); background: var(--spatial-element-accent); cursor: pointer; }
297
315
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-cover { display: block; position: fixed; z-index: 2; left: var(--spatial-pane-left); width: var(--spatial-pane-width); background: var(--stage-page-background, var(--spatial-element-background)); pointer-events: none; transform: translateY(var(--spatial-pane-fixed-compensation, 0px)); }
298
316
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-cover-top { top: 0; height: var(--spatial-pane-body-top); }
299
317
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-cover-bottom { top: calc(100svh - var(--spatial-pane-bottom)); height: var(--spatial-pane-bottom); }
@@ -98,6 +98,7 @@
98
98
  getMinimapDockProgress,
99
99
  getMinimapModelScale,
100
100
  getMinimapModelTop,
101
+ getMinimapModelCenterY,
101
102
  getMinimapModelLeft,
102
103
  getSurface: () => resolvedSurface,
103
104
  getSurfaceOpacity,
@@ -142,7 +143,8 @@
142
143
  return {
143
144
  ...visualTheme,
144
145
  ...(pose ?? {}),
145
- radius: shape.radius
146
+ radius: shape.radius,
147
+ squareBottom: shape.squareBottom
146
148
  };
147
149
  }
148
150
 
@@ -177,6 +179,11 @@
177
179
  return Number.isFinite(value) ? value : undefined;
178
180
  }
179
181
 
182
+ function getMinimapModelCenterY() {
183
+ const value = Number.parseFloat(frameElement?.dataset.stageMinimapModelCenterY ?? "");
184
+ return Number.isFinite(value) ? value : undefined;
185
+ }
186
+
180
187
  function getMinimapModelLeft() {
181
188
  const value = Number.parseFloat(frameElement?.dataset.stageMinimapModelLeft ?? '');
182
189
  return Number.isFinite(value) ? value : undefined;
@@ -191,6 +198,7 @@
191
198
  const backdropBlur = Math.max(theme.backdropBlur ?? 5, 0);
192
199
  const style = [
193
200
  `--stage-panel-radius: ${shape.radius}px`,
201
+ `--stage-panel-bottom-radius: ${shape.squareBottom ? 0 : shape.radius}px`,
194
202
  `--stage-panel-content-inset: ${getContentInset()}px`,
195
203
  `--stage-panel-tint-rgb: ${getTintRgb()}`,
196
204
  `--stage-panel-tint-opacity: ${tintOpacity}`,
@@ -311,7 +319,7 @@
311
319
  .stage-panel-fallback {
312
320
  z-index: 2;
313
321
  box-sizing: border-box;
314
- border-radius: var(--stage-panel-radius);
322
+ border-radius: var(--stage-panel-radius) var(--stage-panel-radius) var(--stage-panel-bottom-radius, var(--stage-panel-radius)) var(--stage-panel-bottom-radius, var(--stage-panel-radius));
315
323
  }
316
324
 
317
325
  .stage-panel-posed {
@@ -329,7 +337,7 @@
329
337
  width: 100%;
330
338
  height: 100%;
331
339
  padding: var(--stage-panel-content-inset);
332
- border-radius: var(--stage-panel-radius);
340
+ border-radius: var(--stage-panel-radius) var(--stage-panel-radius) var(--stage-panel-bottom-radius, var(--stage-panel-radius)) var(--stage-panel-bottom-radius, var(--stage-panel-radius));
333
341
  /* Keep opacity/filter off the element that owns backdrop-filter. Chrome
334
342
  * otherwise creates a new Backdrop Root as soon as zoom starts. */
335
343
  opacity: 1;
@@ -7,6 +7,7 @@
7
7
  import {
8
8
  observeSpaceMousePermission,
9
9
  rememberSpaceMouseConnection,
10
+ rememberSpaceMouseDisabled,
10
11
  shouldReconnectSpaceMouse,
11
12
  type SpaceMousePermission
12
13
  } from '@spatial-elements/core/stage/spaceMousePermission';
@@ -260,6 +261,7 @@
260
261
  getSpaceMousePermission: () => spaceMousePermission,
261
262
  setSpaceMouseEnabled(enabled) {
262
263
  if (!spaceMouseDesktop) return;
264
+ if (!enabled) rememberSpaceMouseDisabled();
263
265
  experience?.setSpaceMouseEnabled(false);
264
266
  spaceMouseState = enabled ? 'connecting' : 'idle';
265
267
  spaceMouseDisabledByUser = !enabled;
@@ -808,6 +810,7 @@
808
810
  captureHeroPresentation: () => experience?.captureHeroPresentation() ?? false,
809
811
  getSpatialCapture: () => experience?.getSpatialCapture() ?? null,
810
812
  getDetailProjection: kind => experience?.getVisualTestDetailProjection(kind) ?? null,
813
+ getOutlinePose: () => experience?.getVisualTestOutlinePose() ?? null,
811
814
  releaseSpatialCapture: () => experience?.releaseSpatialCapture(),
812
815
  registerCatalogEndpoint: (address, element) => catalogEndpoints.register(address, element),
813
816
  getCatalogPresentation: () => experience?.getCatalogPresentation() ?? null,
@@ -899,6 +902,7 @@
899
902
  getMinimapDockProgress: panel.getMinimapDockProgress,
900
903
  getMinimapModelScale: panel.getMinimapModelScale,
901
904
  getMinimapModelTop: panel.getMinimapModelTop,
905
+ getMinimapModelCenterY: panel.getMinimapModelCenterY,
902
906
  getMinimapModelLeft: panel.getMinimapModelLeft,
903
907
  getSurfaceOpacity: panel.getSurfaceOpacity,
904
908
  getVisible: panel.getVisible,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spatial-elements/sveltekit",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.13",
4
4
  "description": "SvelteKit components and navigation for Spatial Elements.",
5
5
  "license": "MPL-2.0",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@page-sections/core": "0.4.1",
44
44
  "@page-sections/svelte": "0.4.1",
45
- "@spatial-elements/core": "1.0.0-beta.11",
45
+ "@spatial-elements/core": "1.0.0-beta.13",
46
46
  "lucide-svelte": "^1.0.1"
47
47
  },
48
48
  "peerDependencies": {