@spatial-elements/sveltekit 1.0.0-beta.15 → 1.0.0-beta.18

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/catalog/ScrollNavigationBridge.svelte +5 -1
  3. package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +1 -1
  4. package/dist/catalog/stagedCatalogNavigation.d.ts +1 -1
  5. package/dist/spatial-element/BrandStageShell.svelte +27 -2
  6. package/dist/spatial-element/BrandStageShell.svelte.d.ts +2 -0
  7. package/dist/spatial-element/CarouselSpatialElement.svelte +7 -7
  8. package/dist/spatial-element/ContentPage.svelte +5 -2
  9. package/dist/spatial-element/ContentPage.svelte.d.ts +3 -0
  10. package/dist/spatial-element/OverflowControls.svelte +6 -6
  11. package/dist/spatial-element/PointerHint.svelte +5 -4
  12. package/dist/spatial-element/Section.svelte +1 -1
  13. package/dist/spatial-element/SpaceMouseControl.svelte +4 -4
  14. package/dist/spatial-element/SpatialCardGridSection.svelte +6 -9
  15. package/dist/spatial-element/SpatialCardPresentation.svelte +129 -33
  16. package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +2 -2
  17. package/dist/spatial-element/SpatialCardSlot.svelte +1 -1
  18. package/dist/spatial-element/SpatialCarouselSection.svelte +10 -2
  19. package/dist/spatial-element/SpatialElementCard.svelte +7 -13
  20. package/dist/spatial-element/SpatialElementCard.svelte.d.ts +2 -2
  21. package/dist/spatial-element/SpatialElementHelp.svelte +7 -5
  22. package/dist/spatial-element/SpatialElementMediaRail.svelte +2 -1
  23. package/dist/spatial-element/SpatialElementPage.svelte +1 -1
  24. package/dist/spatial-element/SpatialElementStickyHeader.svelte +29 -5
  25. package/dist/spatial-element/SpatialElementSummaryContent.svelte +16 -8
  26. package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +4 -0
  27. package/dist/spatial-element/SpatialElementSummaryPanel.svelte +2 -1
  28. package/dist/spatial-element/SpatialElementTabList.svelte +32 -10
  29. package/dist/spatial-element/SpatialIconButton.svelte +2 -0
  30. package/dist/spatial-element/SpatialListPage.svelte +2 -2
  31. package/dist/spatial-element/SpatialNavigationShell.svelte +10 -44
  32. package/dist/spatial-element/SpatialSummaryHost.svelte +1 -1
  33. package/dist/spatial-element/SpatialSummaryRoot.svelte +33 -10
  34. package/dist/spatial-element/SpatialSummarySlot.svelte +1 -1
  35. package/dist/spatial-element/cardAppearanceFreeze.js +1 -1
  36. package/dist/spatial-element/carouselTextHit.js +2 -1
  37. package/dist/spatial-element/contentSidebars.js +15 -7
  38. package/dist/spatial-element/index.d.ts +1 -2
  39. package/dist/spatial-element/layout.generated.css +41 -17
  40. package/dist/spatial-element/spatialCardGrid.d.ts +3 -3
  41. package/dist/spatial-element/spatialSummary.d.ts +4 -2
  42. package/dist/spatial-element/spatialThemeStyle.js +4 -4
  43. package/dist/stage/ButtonGroup.svelte +2 -0
  44. package/dist/stage/Panel.svelte +11 -3
  45. package/dist/stage/Panel.svelte.d.ts +2 -0
  46. package/dist/stage/Stage.svelte +6 -3
  47. package/dist/stage/panelShadowStyle.d.ts +3 -0
  48. package/dist/stage/panelShadowStyle.js +11 -0
  49. package/package.json +9 -9
@@ -4,6 +4,7 @@
4
4
  import SpatialCardPresentation from './SpatialCardPresentation.svelte';
5
5
  import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
6
6
  import { useCatalogNavigation } from '../catalog/catalogNavigation.js';
7
+ import { focusCatalogLink } from '@spatial-elements/core/catalog/catalogActivationFocus';
7
8
  import { catalogViewLink } from '@spatial-elements/core/catalog/catalogViewLink';
8
9
  import { CATALOG_ENDPOINTS, type CatalogEndpointRegistry } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
9
10
  import { CATALOG_SECTIONS, type CatalogSections } from '@spatial-elements/core/catalog/CatalogSections';
@@ -14,25 +15,41 @@
14
15
  const endpoints = getContext<CatalogEndpointRegistry | undefined>(CATALOG_ENDPOINTS);
15
16
  const sections = getContext<CatalogSections | undefined>(CATALOG_SECTIONS);
16
17
  const { href, prepare } = useCatalogNavigation();
17
- function activate(event: MouseEvent) {
18
+ function activate(event: MouseEvent, anchor = event.currentTarget as HTMLAnchorElement) {
18
19
  if (!model.active || !context || !carousel) { event.preventDefault(); return; }
19
20
  endpoints?.prefer(context.spatialElement.brandId, context.spatialElement.id, carousel.occurrence, 'carousel.front');
20
21
  sections?.activate({ brandId: context.spatialElement.brandId, spatialElementId: context.spatialElement.id, occurrence: carousel.occurrence, slot: 'carousel.front' });
21
- (event.currentTarget as HTMLElement).focus({ preventScroll: true });
22
+ focusCatalogLink(anchor, event);
22
23
  }
23
- function prepareCarousel() { if (model.active && carousel) prepare(carousel.item); }
24
+ function summaryLinks(node: HTMLElement) {
25
+ const click = (event: MouseEvent) => {
26
+ const selection = window.getSelection();
27
+ // A text-selection release still produces a click on an anchor. Keep it from
28
+ // focusing/navigating before the native selection can be copied.
29
+ if (event.detail > 0 && selection && !selection.isCollapsed && node.contains(selection.anchorNode) && node.contains(selection.focusNode)) {
30
+ event.preventDefault(); event.stopImmediatePropagation(); return;
31
+ }
32
+ if (context?.mode === 'carousel' && event.target instanceof Element && event.target.closest('[data-spatial-summary-link]')) activate(event, event.target.closest<HTMLAnchorElement>('[data-spatial-summary-link]')!);
33
+ };
34
+ node.addEventListener('click', click, true); node.addEventListener('pointerenter', prepareCarousel); node.addEventListener('focusin', prepareCarousel);
35
+ return { destroy() { node.removeEventListener('click', click, true); node.removeEventListener('pointerenter', prepareCarousel); node.removeEventListener('focusin', prepareCarousel); } };
36
+ }
37
+ function prepareCarousel(event?: Event) { if (event?.target instanceof Element && event.target.closest('[data-catalog-restoring-focus]')) return; if (model.active && carousel) prepare(carousel.item); }
24
38
  </script>
25
39
  {#if model.kind === 'card'}
26
40
  <SpatialCardPresentation {...model.current} active={model.active} />
27
41
  {:else}
28
42
  <div class="spatial-summary-surface" hidden={model.current.mode !== 'carousel'} aria-hidden="true"></div>
29
43
  {#if model.current.carousel}
30
- <div class="compact-copy" hidden={model.current.mode !== 'carousel'}>
44
+ <a use:summaryLinks draggable="false" class="compact-copy" hidden={model.current.mode !== 'carousel'} href={href(model.current.carousel.item.href)} onclick={activate} onpointerenter={prepareCarousel} onfocus={prepareCarousel} onpointerdown={prepareCarousel}
45
+ use:catalogViewLink={{ spatialElementId: model.current.spatialElement.id, targetPresentation: model.current.carousel.item.targetPresentation }}
46
+ aria-label={`More information: ${model.current.spatialElement.title}`} data-catalog-focus-key={`catalog-compact:${model.current.carousel.occurrence}`}>
31
47
  {#if model.current.spatialElement.eyebrow}<p use:catalogEndpoint={model.active && carousel?.compact ? model.current.address('eyebrow') : undefined}>{model.current.spatialElement.eyebrow}</p>{/if}
32
48
  <h3 use:catalogEndpoint={model.active && carousel?.compact ? model.current.address('title') : undefined}>{model.current.spatialElement.title}</h3>
33
- </div>
49
+ <svg class="compact-arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="M7 17 17 7M7 7h10v10" /></svg>
50
+ </a>
34
51
  {/if}
35
- <div data-spatial-summary-root class="spatial-summary-query" class:full-summary={model.current.mode === 'carousel'}>
52
+ <div use:summaryLinks data-spatial-summary-root class="spatial-summary-query" class:full-summary={model.current.mode === 'carousel'}>
36
53
  {@render content(model.active && !carousel?.compact ? model.current : { ...model.current, address: () => undefined })}
37
54
  </div>
38
55
  {#if model.current.carousel}
@@ -59,16 +76,22 @@
59
76
  :global(.spatial-summary-island[data-presentation-mode='carousel']) > * { opacity: var(--carousel-panel-opacity, 1); filter: var(--carousel-focus-blur, none); }
60
77
  .spatial-summary-surface {
61
78
  position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--carousel-panel-tint, white) var(--carousel-panel-tint-opacity, 65%), transparent);
62
- border: 1px solid color-mix(in srgb, var(--spatial-element-accent) 12%, transparent); backdrop-filter: var(--carousel-panel-backdrop, blur(5px)); box-shadow: var(--carousel-panel-shadow); pointer-events: none;
79
+ border: 1px solid var(--ps-panel-border); backdrop-filter: var(--carousel-panel-backdrop, blur(5px)); box-shadow: var(--carousel-panel-shadow); pointer-events: none;
63
80
  }
64
81
  .spatial-summary-surface[hidden] { display: none; }
65
82
  :global([data-carousel-glass-ready]) .spatial-summary-surface,
66
83
  :global([data-spatial-presentation-glass]) .spatial-summary-surface { visibility: hidden; }
67
- .compact-copy { position: relative; box-sizing: border-box; padding: 8px 52px 8px 12px; }
84
+ .compact-copy { user-select: text; position: relative; display: flex; flex-direction: column; justify-content: center; height: 100%; box-sizing: border-box; padding: 8px 40px 8px 12px; color: inherit; text-decoration: none; }
85
+ .compact-copy:hover { text-decoration: none; }
86
+ .compact-arrow { position: absolute; right: 10px; top: 10px; width: 20px; height: 20px; fill: none; stroke: var(--spatial-element-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
87
+ .compact-copy:focus-visible { outline: 2px solid var(--spatial-element-accent); outline-offset: -2px; border-radius: inherit; }
88
+ .compact-copy[hidden] { display: none; }
68
89
  .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: 1; height: 24px; margin: 0; overflow: hidden; font-size: 18px; line-height: 24px; }
90
+ .compact-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; height: 24px; margin: 0; overflow: hidden; font-size: 18px; line-height: 24px; }
70
91
  .full-summary, .section-information { display: none; }
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; }
92
+ .information { display: none; }
93
+ @media (min-width: 840px) { .information { display: grid; } }
94
+ .information { position: absolute; top: 0; right: 0; place-items: center; width: 40px; height: 40px; margin: 0; color: var(--spatial-element-accent); pointer-events: auto; }
72
95
  .information svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
73
96
  @media (min-width: 840px) {
74
97
  :global(.spatial-summary-island[data-presentation-mode='carousel']) { height: auto; padding: var(--spatial-summary-content-inset); }
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { browser } from '$app/environment';
2
+ import { browser } from '$app/env';
3
3
  import { createRawSnippet, getContext, onMount, untrack } from 'svelte';
4
4
  import { render } from 'svelte/server';
5
5
  import { SpatialSummaryHostController, SPATIAL_SUMMARY_HOST } from './spatialSummaryHost.svelte.js';
@@ -16,7 +16,7 @@ export function freezeCardAppearance(card) {
16
16
  }
17
17
  if (surface)
18
18
  targets.push({ element: surface,
19
- properties: ['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'] });
19
+ properties: ['box-shadow', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'] });
20
20
  const poster = card.querySelector('[data-catalog-poster]');
21
21
  if (poster)
22
22
  targets.push({ element: poster, properties: ['transform', 'opacity'] });
@@ -1,7 +1,8 @@
1
1
  /** Test rendered text fragments, not the full width of their block container. */
2
2
  export function carouselTextHit(target, x, y) {
3
3
  if (!(target instanceof HTMLElement) || !target.closest('.summary') ||
4
- target.closest('a, button, input, textarea, select, [contenteditable]'))
4
+ target.closest('button, input, textarea, select, [contenteditable]') ||
5
+ (target.closest('a') && !target.closest('[data-spatial-summary-link], .compact-copy')))
5
6
  return;
6
7
  const walker = document.createTreeWalker(target, NodeFilter.SHOW_TEXT);
7
8
  const range = document.createRange();
@@ -5,17 +5,20 @@ import { layoutTokens } from '@page-sections/core';
5
5
  export function attachContentSidebars(host) {
6
6
  const stage = host.closest('.stage');
7
7
  const offsets = new Map();
8
+ const body = host.querySelector('.ps-page-content .page-body');
9
+ let menu = host.querySelector('.ps-content-menu-slot');
8
10
  const reset = (node) => {
9
11
  node.style.removeProperty('translate');
10
12
  node.removeAttribute('data-spatial-sticky-sidebar');
11
13
  offsets.delete(node);
12
14
  };
13
15
  const update = () => {
16
+ menu = host.querySelector('.ps-content-menu-slot');
14
17
  const enhanced = stage?.classList.contains('stage-virtual-scroll-active');
15
18
  const desktop = window.innerWidth >= layoutTokens.layoutMinWidths.xl;
16
19
  const selector = desktop
17
20
  ? '.ps-left-sidebar > .sidebar-panel, .ps-content-menu-slot > .desktop'
18
- : '.ps-content-menu-slot';
21
+ : '.ps-content-menu-slot > .mobile';
19
22
  const nodes = new Set(enhanced ? host.querySelectorAll(selector) : []);
20
23
  for (const node of offsets.keys())
21
24
  if (!nodes.has(node))
@@ -23,23 +26,28 @@ export function attachContentSidebars(host) {
23
26
  if (!nodes.size)
24
27
  return;
25
28
  const boundary = host.querySelector('.ps-page-frame')?.getBoundingClientRect().bottom ?? Infinity;
29
+ const contentBottom = body?.getBoundingClientRect().bottom ?? boundary;
26
30
  for (const node of nodes) {
27
31
  node.setAttribute('data-spatial-sticky-sidebar', '');
28
32
  const rect = node.getBoundingClientRect();
29
33
  const top = rect.top - (offsets.get(node) ?? 0);
30
- const inset = parseFloat(getComputedStyle(node).getPropertyValue('--ps-sidebar-sticky-top')) || 16;
31
- const height = desktop ? rect.height : 40;
32
- const offset = Math.max(0, Math.min(inset - top, boundary - top - height));
33
- node.style.translate = `0 ${offset}px`;
34
+ const inset = desktop ? parseFloat(getComputedStyle(node).getPropertyValue('--ps-sidebar-sticky-top')) || 16 : 12;
35
+ const isContentMenu = menu?.contains(node);
36
+ const bottom = isContentMenu ? contentBottom - (desktop ? parseFloat(getComputedStyle(menu).paddingBottom) || 0 : 0) : boundary;
37
+ const offset = Math.max(0, Math.min(inset - top, bottom - top - rect.height));
38
+ if (offsets.get(node) !== offset)
39
+ node.style.translate = `0 ${offset}px`;
34
40
  offsets.set(node, offset);
35
41
  if (desktop)
36
42
  node.style.setProperty('--ps-sidebar-available-height', `${Math.max(0, innerHeight - Math.max(inset, top + offset) - inset)}px`);
37
43
  }
38
44
  };
39
45
  const stop = subscribeStageScrollFrame(update, STAGE_SCROLL_PRIORITY.virtualDocument + 2);
40
- const resize = new ResizeObserver(update);
46
+ const resize = new ResizeObserver(() => { update(); });
41
47
  resize.observe(host);
42
- const observer = new MutationObserver(update);
48
+ if (body)
49
+ resize.observe(body);
50
+ const observer = new MutationObserver(() => { update(); });
43
51
  observer.observe(host, { childList: true, subtree: true });
44
52
  if (stage)
45
53
  observer.observe(stage, { attributes: true, attributeFilter: ['class'] });
@@ -6,7 +6,7 @@ export { default as SpatialElementPage } from './SpatialElementPage.svelte';
6
6
  export { default as SpatialListPage } from './SpatialListPage.svelte';
7
7
  export { default as Section } from './Section.svelte';
8
8
  export { findSpatialElement, getSpatialListItems } from '@spatial-elements/core/spatial-element/spatialElement';
9
- export type { SpatialElementAction, SpatialTheme, SpatialThemeRadii, SpatialSectionBackgrounds, SectionBackground, SectionBackgroundColor, SpatialElementBreadcrumb, SpatialElementData, SpatialDockedPanelTheme, SpatialElementFeature, SpatialElementMediaItem, SpatialMinimapTheme, SpatialListItem, SpatialElementSectionDefinition, SpatialElementSectionNavigationItem, SpatialElementSectionStyle, SpatialSectionTheme } from '@spatial-elements/core/spatial-element/types';
9
+ export type { SpatialElementAction, SpatialTheme, SpatialThemeRadii, SpatialSectionBackgrounds, SectionBackground, SectionBackgroundColor, SpatialElementBreadcrumb, SpatialElementData, SpatialCollectionPose, SpatialDockedPanelTheme, SpatialElementFeature, SpatialElementMediaItem, SpatialMinimapTheme, SpatialListItem, SpatialElementSectionDefinition, SpatialElementSectionNavigationItem, SpatialElementSectionStyle, SpatialSectionTheme } from '@spatial-elements/core/spatial-element/types';
10
10
  export { default as ContentPage } from './ContentPage.svelte';
11
11
  export { default as ContentGrid } from './ContentGrid.svelte';
12
12
  export { default as ContentBlock } from './ContentBlock.svelte';
@@ -24,4 +24,3 @@ export { default as ListSection } from './SpatialCardGridSection.svelte';
24
24
  /** @deprecated Use SpatialCarouselSection. */
25
25
  export { default as CarouselSection } from './SpatialCarouselSection.svelte';
26
26
  export type { SpatialCardGridOptions } from './spatialCardGrid.js';
27
- export type { CardVariant } from '@page-sections/core';
@@ -1,5 +1,10 @@
1
1
  /* Generated from @page-sections/core plus spatial-only layoutTokens.json. Run npm run layout:generate. */
2
2
 
3
+ /* Per-frame paint values must not invalidate the descendants of the whole page. */
4
+ @property --spatial-pane-fixed-compensation { syntax: '<length>'; inherits: false; initial-value: 0px; }
5
+ @property --spatial-pane-focus-origin-y { syntax: '<length-percentage>'; inherits: false; initial-value: 50%; }
6
+ @property --spatial-shell-scroll-compensation { syntax: '<length>'; inherits: false; initial-value: 0px; }
7
+
3
8
  .spatial-content-width { width: min(100%, 1536px); margin-inline: auto; }
4
9
 
5
10
  .spatial-content-container { container: ps-content / inline-size; min-width: 0; }
@@ -147,12 +152,15 @@
147
152
  }
148
153
 
149
154
  .carousel-drag-section {
150
- --spatial-carousel-fit-height: clamp(150px, calc(100svh - 240px - var(--spatial-carousel-headline-budget, 0px)), 300px);
151
- --spatial-carousel-fit-left: 36px;
152
- --spatial-carousel-fit-width: calc(100% - 72px);
153
- --spatial-carousel-summary-left: 36px;
154
- --spatial-carousel-summary-width: calc(100% - 72px);
155
- --spatial-carousel-title-reserve: 66px;
155
+ --spatial-carousel-fit-height: clamp(96px, calc(100svh - 320px - var(--spatial-carousel-headline-budget, 0px)), 260px);
156
+ --spatial-carousel-fit-left: 0px;
157
+ --spatial-carousel-fit-width: 100%;
158
+ --spatial-carousel-summary-left: 52px;
159
+ --spatial-carousel-summary-width: calc(100% - 104px);
160
+ --spatial-carousel-title-reserve: 0px;
161
+ --spatial-carousel-panel-reserve: 50px;
162
+ --spatial-carousel-compact-height: 66px;
163
+ --spatial-carousel-compact-overlap: 16px;
156
164
  --spatial-carousel-dots-gap: 0px;
157
165
  --spatial-carousel-dots-height: 32px;
158
166
  --spatial-detail-summary-max-height: var(--spatial-carousel-fit-height);
@@ -161,12 +169,15 @@
161
169
 
162
170
  @media (min-width: 600px) {
163
171
  .carousel-drag-section {
164
- --spatial-carousel-fit-height: clamp(150px, calc(100svh - 248px - var(--spatial-carousel-headline-budget, 0px)), 400px);
165
- --spatial-carousel-fit-left: 72px;
166
- --spatial-carousel-fit-width: calc(100% - 144px);
167
- --spatial-carousel-summary-left: 72px;
168
- --spatial-carousel-summary-width: calc(100% - 144px);
169
- --spatial-carousel-title-reserve: 66px;
172
+ --spatial-carousel-fit-height: clamp(96px, calc(100svh - 336px - var(--spatial-carousel-headline-budget, 0px)), 340px);
173
+ --spatial-carousel-fit-left: 0px;
174
+ --spatial-carousel-fit-width: 100%;
175
+ --spatial-carousel-summary-left: 52px;
176
+ --spatial-carousel-summary-width: calc(100% - 104px);
177
+ --spatial-carousel-title-reserve: 0px;
178
+ --spatial-carousel-panel-reserve: 50px;
179
+ --spatial-carousel-compact-height: 66px;
180
+ --spatial-carousel-compact-overlap: 16px;
170
181
  --spatial-carousel-dots-gap: 0px;
171
182
  --spatial-carousel-dots-height: 32px;
172
183
  --spatial-detail-summary-max-height: var(--spatial-carousel-fit-height);
@@ -176,12 +187,15 @@
176
187
 
177
188
  @media (min-width: 840px) {
178
189
  .carousel-drag-section {
179
- --spatial-carousel-fit-height: clamp(300px, calc(100svh - 200px - var(--spatial-carousel-headline-budget, 0px)), 500px);
190
+ --spatial-carousel-fit-height: clamp(160px, calc(100svh - 276px - var(--spatial-carousel-headline-budget, 0px)), 540px);
180
191
  --spatial-carousel-fit-left: calc((((100% - 112px) / 8) + 16px) * 1);
181
192
  --spatial-carousel-fit-width: calc(((100% - 112px) / 8) * 3 + 32px);
182
193
  --spatial-carousel-summary-left: calc((((100% - 112px) / 8) + 16px) * 4);
183
194
  --spatial-carousel-summary-width: calc(((100% - 112px) / 8) * 3 + 32px);
184
195
  --spatial-carousel-title-reserve: 0px;
196
+ --spatial-carousel-panel-reserve: 0px;
197
+ --spatial-carousel-compact-height: 66px;
198
+ --spatial-carousel-compact-overlap: 16px;
185
199
  --spatial-carousel-dots-gap: 12px;
186
200
  --spatial-carousel-dots-height: 32px;
187
201
  --spatial-detail-summary-max-height: var(--spatial-carousel-fit-height);
@@ -191,12 +205,15 @@
191
205
 
192
206
  @media (min-width: 1200px) {
193
207
  .carousel-drag-section {
194
- --spatial-carousel-fit-height: clamp(340px, calc(100svh - 230px - var(--spatial-carousel-headline-budget, 0px)), 600px);
208
+ --spatial-carousel-fit-height: clamp(160px, calc(100svh - 330px - var(--spatial-carousel-headline-budget, 0px)), 560px);
195
209
  --spatial-carousel-fit-left: calc((((100% - 264px) / 12) + 24px) * 2);
196
210
  --spatial-carousel-fit-width: calc(((100% - 264px) / 12) * 5 + 96px);
197
211
  --spatial-carousel-summary-left: calc((((100% - 264px) / 12) + 24px) * 7);
198
212
  --spatial-carousel-summary-width: calc(((100% - 264px) / 12) * 4 + 72px);
199
213
  --spatial-carousel-title-reserve: 0px;
214
+ --spatial-carousel-panel-reserve: 0px;
215
+ --spatial-carousel-compact-height: 66px;
216
+ --spatial-carousel-compact-overlap: 16px;
200
217
  --spatial-carousel-dots-gap: 16px;
201
218
  --spatial-carousel-dots-height: 32px;
202
219
  --spatial-detail-summary-max-height: var(--spatial-carousel-fit-height);
@@ -206,12 +223,15 @@
206
223
 
207
224
  @media (min-width: 1600px) {
208
225
  .carousel-drag-section {
209
- --spatial-carousel-fit-height: clamp(400px, calc(100svh - 244px - var(--spatial-carousel-headline-budget, 0px)), 700px);
226
+ --spatial-carousel-fit-height: clamp(160px, calc(100svh - 344px - var(--spatial-carousel-headline-budget, 0px)), 600px);
210
227
  --spatial-carousel-fit-left: calc((((100% - 264px) / 12) + 24px) * 1);
211
228
  --spatial-carousel-fit-width: calc(((100% - 264px) / 12) * 5 + 96px);
212
229
  --spatial-carousel-summary-left: calc((((100% - 264px) / 12) + 24px) * 6);
213
230
  --spatial-carousel-summary-width: calc(((100% - 264px) / 12) * 4 + 72px);
214
231
  --spatial-carousel-title-reserve: 0px;
232
+ --spatial-carousel-panel-reserve: 0px;
233
+ --spatial-carousel-compact-height: 66px;
234
+ --spatial-carousel-compact-overlap: 16px;
215
235
  --spatial-carousel-dots-gap: 16px;
216
236
  --spatial-carousel-dots-height: 32px;
217
237
  --spatial-detail-summary-max-height: var(--spatial-carousel-fit-height);
@@ -221,12 +241,15 @@
221
241
 
222
242
  @media (min-width: 1809px) {
223
243
  .carousel-drag-section {
224
- --spatial-carousel-fit-height: clamp(400px, calc(100svh - 244px - var(--spatial-carousel-headline-budget, 0px)), 800px);
244
+ --spatial-carousel-fit-height: clamp(160px, calc(100svh - 344px - var(--spatial-carousel-headline-budget, 0px)), 640px);
225
245
  --spatial-carousel-fit-left: calc((((100% - 264px) / 12) + 24px) * 1);
226
246
  --spatial-carousel-fit-width: calc(((100% - 264px) / 12) * 6 + 120px);
227
247
  --spatial-carousel-summary-left: calc((((100% - 264px) / 12) + 24px) * 7);
228
248
  --spatial-carousel-summary-width: calc(((100% - 264px) / 12) * 4 + 72px);
229
249
  --spatial-carousel-title-reserve: 0px;
250
+ --spatial-carousel-panel-reserve: 0px;
251
+ --spatial-carousel-compact-height: 66px;
252
+ --spatial-carousel-compact-overlap: 16px;
230
253
  --spatial-carousel-dots-gap: 16px;
231
254
  --spatial-carousel-dots-height: 32px;
232
255
  --spatial-detail-summary-max-height: var(--spatial-carousel-fit-height);
@@ -271,7 +294,8 @@
271
294
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body [data-spatial-summary-aside] {
272
295
  position: relative; top: auto; right: auto; width: 100%; margin: 0;
273
296
  }
274
- .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel { max-height: none; }
297
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel { max-height: none; border-radius: 0; }
298
+ .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel > .stage-panel-surface > [data-stage-panel-content] > .panel-edge { border-block-width: 0; border-radius: 0 !important; }
275
299
  .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; }
276
300
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel .stage-panel-surface::before,
277
301
  .stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-body .spatial-element-panel .stage-panel-surface::after { display: none; }
@@ -1,12 +1,12 @@
1
- import type { CardSize, CardVariant, CardMediaAspect, CardMediaFit, ContentSpan, SurfaceTone } from '@page-sections/core';
1
+ import type { CardSize, CardMediaAspect, CardMediaFit, ContentSpan, SurfaceTone } from '@page-sections/core';
2
2
  /** Page Sections card layout options; spatial media defaults to square/contain. */
3
3
  export interface SpatialCardGridOptions {
4
4
  cardSize?: CardSize;
5
- cardVariant?: CardVariant;
5
+ cardShadow?: boolean;
6
6
  cardTone?: SurfaceTone;
7
7
  textAlign?: 'start' | 'center';
8
8
  mediaAspect?: CardMediaAspect;
9
9
  mediaFit?: CardMediaFit;
10
- /** Grid span for editorial cards. Catalog cards use the responsive cardSize allocation. */
10
+ /** Optional explicit grid span. Omit to use the responsive cardSize allocation. */
11
11
  itemSpan?: ContentSpan;
12
12
  }
@@ -1,4 +1,4 @@
1
- import type { CardMediaAspect, CardMediaFit, CardVariant, SurfaceTone } from '@page-sections/core';
1
+ import type { CardMediaAspect, CardMediaFit, SurfaceTone } from '@page-sections/core';
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
4
4
  import type { ResolvedSpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
@@ -6,6 +6,8 @@ import type { SpatialListItem } from '@spatial-elements/core/spatial-element/typ
6
6
  import type { SpatialCardSize } from '@spatial-elements/core/spatial-element/responsiveLayout';
7
7
  export interface SpatialSummaryContext {
8
8
  spatialElement: Pick<ResolvedSpatialElementData, 'id' | 'brandId' | 'title' | 'eyebrow' | 'features' | 'action'>;
9
+ /** Canonical detail link, retained when the live summary moves between placements. */
10
+ detailHref?: string;
9
11
  mode: 'detail' | 'carousel';
10
12
  heading: 'h1' | 'h3';
11
13
  contentInset: number;
@@ -30,7 +32,7 @@ export interface SpatialCardContext {
30
32
  mediaFit?: CardMediaFit;
31
33
  reserveEyebrow?: boolean;
32
34
  cardTone?: SurfaceTone;
33
- cardVariant?: CardVariant;
35
+ cardShadow?: boolean;
34
36
  }
35
37
  export type SpatialPresentationModel = {
36
38
  kind: 'summary';
@@ -1,5 +1,5 @@
1
1
  import { resolveSpatialSectionBackgrounds, resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
2
- import { getCssPanelBoxShadow, resolvePanelShadowStrength } from '@spatial-elements/core/stage/panelShadow';
2
+ import { resolvePanelShadowStrength } from '@spatial-elements/core/stage/panelShadow';
3
3
  /** CSS declarations shared by the shell and optional server-rendered theme previews. */
4
4
  export function getSpatialThemeStyle(theme) {
5
5
  const radii = resolveSpatialThemeRadii(theme);
@@ -14,7 +14,9 @@ export function getSpatialThemeStyle(theme) {
14
14
  `--ps-section-muted: ${sectionBackgrounds.muted}`,
15
15
  `--ps-radius: ${radii.panel}px`,
16
16
  `--ps-font-family: Inter, ui-sans-serif, system-ui, sans-serif`,
17
- `--ps-border: color-mix(in srgb, ${theme.colors.ink} 18%, transparent)`,
17
+ `--ps-border: ${theme.colors.border ?? `color-mix(in srgb, ${theme.colors.ink} 18%, transparent)`}`,
18
+ `--ps-panel-border: ${theme.colors.panelBorder ?? `color-mix(in srgb, ${theme.colors.ink} 12%, transparent)`}`,
19
+ `--ps-selection: ${theme.colors.tabBackground}`,
18
20
  `--ps-scroll-offset: var(--spatial-element-section-scroll-offset, 150px)`,
19
21
  `--spatial-element-background: ${theme.background}`,
20
22
  `--spatial-element-ink: ${theme.colors.ink}`,
@@ -32,12 +34,10 @@ export function getSpatialThemeStyle(theme) {
32
34
  `--spatial-element-panel-tint-rgb: ${getDockedPanelTintRgb(theme.panelTheme.tint ?? '#ffffff')}`,
33
35
  `--spatial-element-panel-tint-opacity: ${clamp(theme.panelTheme.tintOpacity ?? 0.65, 0, 1)}`,
34
36
  `--spatial-element-panel-backdrop-blur: ${clamp(theme.panelTheme.backdropBlur ?? 8, 0, 100)}px`,
35
- `--spatial-element-panel-box-shadow: ${getCssPanelBoxShadow(theme.panelTheme.shadowIntensity ?? 0.2)}`,
36
37
  `--spatial-element-docked-panel-tint-rgb: ${getDockedPanelTintRgb(theme.dockedPanelTheme.tint)}`,
37
38
  `--spatial-element-docked-panel-tint-opacity: ${clamp(theme.dockedPanelTheme.tintOpacity, 0, 1)}`,
38
39
  `--spatial-element-docked-panel-shadow-intensity: ${clamp(theme.dockedPanelTheme.shadowIntensity, 0, 1)}`,
39
40
  `--spatial-element-docked-panel-shadow-strength: ${resolvePanelShadowStrength(theme.dockedPanelTheme.shadowIntensity)}`,
40
- `--spatial-element-docked-panel-box-shadow: ${getCssPanelBoxShadow(theme.dockedPanelTheme.shadowIntensity)}`,
41
41
  `--spatial-element-docked-panel-backdrop-blur: ${clamp(theme.dockedPanelTheme.backdropBlur, 0, 100)}px`
42
42
  ].join('; ');
43
43
  }
@@ -57,6 +57,7 @@
57
57
  <div class="button-group-frame" style:width>
58
58
  <Panel
59
59
  class="button-group-panel"
60
+ borderColor="transparent"
60
61
  shape={{ ...shape, radius, contentInset: 0 }}
61
62
  {theme}
62
63
  pointerReactive={false}
@@ -102,6 +103,7 @@
102
103
  height: 40px;
103
104
  }
104
105
  .button-group {
106
+ outline: 1px solid var(--ps-border); outline-offset: -1px;
105
107
  display: flex;
106
108
  width: max-content;
107
109
  height: 40px;
@@ -14,7 +14,7 @@
14
14
  type StagePanelShape,
15
15
  type StagePanelTheme
16
16
  } from '@spatial-elements/core/stage/panelContext';
17
- import { getCssPanelBoxShadow, resolvePanelShadowStrength } from '@spatial-elements/core/stage/panelShadow';
17
+ import { getSharedPanelBoxShadow, resolvePanelShadowStrength } from '@spatial-elements/core/stage/panelShadow';
18
18
  import type { StagePanelSurface } from '@spatial-elements/core/stage/stageTypes';
19
19
  import type { CatalogTransitionGroup } from '@spatial-elements/core/catalog/catalogPresentation';
20
20
  import type { CatalogEndpointAddress } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
@@ -24,6 +24,8 @@
24
24
  children?: Snippet;
25
25
  class?: string;
26
26
  contentClass?: string;
27
+ /** CSS outline color; transparent disables the panel edge without changing geometry. */
28
+ borderColor?: string;
27
29
  minimap?: boolean | StagePanelMinimapOptions;
28
30
  /** true: proximity lift and tilt; 'lift': a 2px mouse-hover lift without tilt; false: still. */
29
31
  pointerReactive?: boolean | 'lift';
@@ -51,6 +53,7 @@
51
53
  children,
52
54
  class: frameClass = '',
53
55
  contentClass = '',
56
+ borderColor = 'var(--ps-panel-border, transparent)',
54
57
  minimap = false,
55
58
  pointerReactive = true,
56
59
  focusReactive = true,
@@ -204,7 +207,7 @@
204
207
  `--stage-panel-tint-opacity: ${tintOpacity}`,
205
208
  `--stage-panel-shadow-intensity: ${shadowIntensity}`,
206
209
  `--stage-panel-shadow-strength: ${resolvePanelShadowStrength(shadowIntensity)}`,
207
- `--stage-panel-box-shadow: ${getCssPanelBoxShadow(shadowIntensity)}`,
210
+ `--stage-panel-box-shadow: ${getSharedPanelBoxShadow(shadowIntensity, theme.shadowColor)}`,
208
211
  `--stage-panel-specular-opacity: ${specularOpacity}`,
209
212
  `--stage-panel-thickness: ${thickness}`,
210
213
  `--stage-panel-bezel: ${bezel}px`,
@@ -311,11 +314,16 @@
311
314
  use:authoredStyle={getContentThemeStyle()}
312
315
  >
313
316
  {@render children?.()}
317
+ <span class="panel-edge" aria-hidden="true"
318
+ style:inset={`${-getContentInset()}px`}
319
+ style:border-color={borderColor}
320
+ style:border-radius={`${shape.radius}px ${shape.radius}px ${shape.squareBottom ? 0 : shape.radius}px ${shape.squareBottom ? 0 : shape.radius}px`}></span>
314
321
  </div>
315
322
  </div>
316
323
  </div>
317
324
 
318
325
  <style>
326
+ .panel-edge { position: absolute; border: 1px solid; box-sizing: border-box; pointer-events: none; z-index: 2; }
319
327
  .stage-panel-fallback {
320
328
  z-index: 2;
321
329
  box-sizing: border-box;
@@ -381,7 +389,7 @@
381
389
  .stage-panel-surface::before {
382
390
  background: rgb(var(--stage-panel-tint-rgb) / var(--stage-panel-tint-opacity));
383
391
  box-shadow:
384
- var(--stage-panel-box-shadow),
392
+ var(--ps-panel-shadow, var(--stage-panel-box-shadow)),
385
393
  inset 0 0 var(--stage-panel-bezel) rgb(16 24 32 / calc(var(--stage-panel-thickness) * 0.12));
386
394
  -webkit-backdrop-filter: blur(var(--stage-panel-css-blur));
387
395
  backdrop-filter: blur(var(--stage-panel-css-blur));
@@ -9,6 +9,8 @@ type Props = Omit<StagePanelAttributes, 'class'> & {
9
9
  children?: Snippet;
10
10
  class?: string;
11
11
  contentClass?: string;
12
+ /** CSS outline color; transparent disables the panel edge without changing geometry. */
13
+ borderColor?: string;
12
14
  minimap?: boolean | StagePanelMinimapOptions;
13
15
  /** true: proximity lift and tilt; 'lift': a 2px mouse-hover lift without tilt; false: still. */
14
16
  pointerReactive?: boolean | 'lift';
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import { withSharedPanelShadow, observePanelShadowStyles } from './panelShadowStyle.js';
2
3
  import { isSpaceMouseDesktop, type SpaceMouseState } from '@spatial-elements/core/stage/spaceMousePlatform';
3
4
  import { hasUsableWebGPU } from '@spatial-elements/core/stage/webgpuSupport';
4
5
  import type { SpatialElementLodPair } from '@spatial-elements/core/catalog/spatialElementLodPair';
@@ -62,7 +63,7 @@
62
63
  hasSpatialElementScene
63
64
  } from '@spatial-elements/core/spatial-element/spatialElementScene';
64
65
  import { SPATIAL_PAGE } from '../spatial-element/spatialPageContext.js';
65
- import type { BeforeNavigate, OnNavigate } from '@sveltejs/kit';
66
+ import type { BeforeNavigate, OnNavigate } from '$app/navigation';
66
67
  import {
67
68
  STAGE_CONTEXT_KEY,
68
69
  STAGE_PANEL_LAYOUT_EVENT,
@@ -495,6 +496,7 @@
495
496
  Object.values(interactionTheme ?? {});
496
497
  scheduleAppearanceUpdate();
497
498
  });
499
+ onMount(() => observePanelShadowStyles(stage, scheduleAppearanceUpdate));
498
500
  let appearanceUpdatePending = false;
499
501
  function scheduleAppearanceUpdate() {
500
502
  if (appearanceUpdatePending) return;
@@ -911,7 +913,7 @@
911
913
  updateNativeLayout: panel.updateNativeLayout,
912
914
  nativeContent: panel.getNativeContent?.() ?? false,
913
915
  minimap: panel.getMinimapOptions(),
914
- options: panel.getOptions(),
916
+ options: panel.getSurface() === 'glass' ? withSharedPanelShadow(surfaceElement, panel.getOptions()) : panel.getOptions(),
915
917
  surface: panel.getSurface(),
916
918
  surfaceElement,
917
919
  pointerReactive: panel.getPointerReactive(),
@@ -924,8 +926,9 @@
924
926
  </script>
925
927
 
926
928
  {#if catalog}
929
+ <!-- Activate history/focus subscriptions once the controller has started. -->
927
930
  <ScrollNavigationBridge
928
- controller={virtualScroll}
931
+ controller={isEnhanced ? virtualScroll : undefined}
929
932
  onEarlyStart={startEarlyNavigation}
930
933
  onStart={() => { if (isEnhanced) navigationFeedback?.begin(); }}
931
934
  onCapture={captureNavigation}
@@ -0,0 +1,3 @@
1
+ export { withSharedPanelShadow } from '@spatial-elements/core/stage/panelShadowStyle';
2
+ /** Theme edits and responsive styles update GPU materials without per-frame CSS reads. */
3
+ export declare function observePanelShadowStyles(stage: HTMLElement, update: () => void): () => void;
@@ -0,0 +1,11 @@
1
+ export { withSharedPanelShadow } from '@spatial-elements/core/stage/panelShadowStyle';
2
+ /** Theme edits and responsive styles update GPU materials without per-frame CSS reads. */
3
+ export function observePanelShadowStyles(stage, update) {
4
+ const observer = new MutationObserver(update);
5
+ for (let ancestor = stage.parentElement; ancestor; ancestor = ancestor.parentElement) {
6
+ observer.observe(ancestor, { attributes: true, attributeFilter: ['style', 'class', 'data-ps-theme', 'data-color-scheme'] });
7
+ }
8
+ observer.observe(document.head, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ['href', 'media', 'disabled'] });
9
+ window.addEventListener('resize', update, { passive: true });
10
+ return () => { observer.disconnect(); window.removeEventListener('resize', update); };
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spatial-elements/sveltekit",
3
- "version": "1.0.0-beta.15",
3
+ "version": "1.0.0-beta.18",
4
4
  "description": "SvelteKit components and navigation for Spatial Elements.",
5
5
  "license": "MPL-2.0",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "**/*.css"
32
32
  ],
33
33
  "engines": {
34
- "node": ">=22.12.0"
34
+ "node": ">=22.17.0"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "node ../../scripts/clean-package.mjs sveltekit && svelte-package -i src -o dist",
@@ -40,15 +40,15 @@
40
40
  "prepack": "npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@page-sections/core": "0.4.1",
44
- "@page-sections/svelte": "0.4.1",
45
- "@spatial-elements/core": "1.0.0-beta.15",
46
- "lucide-svelte": "^1.0.1"
43
+ "@lucide/svelte": "1.77.0",
44
+ "@page-sections/core": "0.6.0",
45
+ "@page-sections/svelte": "0.6.0",
46
+ "@spatial-elements/core": "1.0.0-beta.18"
47
47
  },
48
48
  "peerDependencies": {
49
- "@sveltejs/kit": "^2.70.3",
50
- "svelte": "^5.56.4",
51
- "three": "^0.186.1"
49
+ "@sveltejs/kit": "^3.4.0",
50
+ "svelte": "^5.59.1",
51
+ "three": "^0.187.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public",