@spatial-elements/sveltekit 1.0.0-beta.7 → 1.0.0-beta.8

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 (86) hide show
  1. package/dist/catalog/ScrollNavigationBridge.svelte +170 -45
  2. package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +9 -2
  3. package/dist/catalog/catalogSummaryTransfer.d.ts +16 -0
  4. package/dist/catalog/catalogSummaryTransfer.js +79 -0
  5. package/dist/catalog/catalogTransition.css +46 -3
  6. package/dist/catalog/interruptedPresentation.d.ts +10 -0
  7. package/dist/catalog/interruptedPresentation.js +29 -0
  8. package/dist/catalog/presentationCleanup.d.ts +4 -0
  9. package/dist/catalog/presentationCleanup.js +20 -0
  10. package/dist/catalog/stagedCatalogNavigation.d.ts +44 -0
  11. package/dist/catalog/stagedCatalogNavigation.js +403 -0
  12. package/dist/catalog/stagedDomReveal.d.ts +8 -0
  13. package/dist/catalog/stagedDomReveal.js +76 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +1 -0
  16. package/dist/spatial-element/BrandStageShell.svelte +13 -2
  17. package/dist/spatial-element/BrandStageShell.svelte.d.ts +8 -0
  18. package/dist/spatial-element/CarouselSection.svelte +35 -21
  19. package/dist/spatial-element/CarouselSpatialElement.svelte +49 -115
  20. package/dist/spatial-element/ContentBlock.svelte +53 -0
  21. package/dist/spatial-element/ContentBlock.svelte.d.ts +11 -0
  22. package/dist/spatial-element/ContentGrid.svelte +28 -0
  23. package/dist/spatial-element/ContentGrid.svelte.d.ts +10 -0
  24. package/dist/spatial-element/ContentPage.svelte +28 -20
  25. package/dist/spatial-element/ContentPage.svelte.d.ts +3 -0
  26. package/dist/spatial-element/ListSection.svelte +11 -5
  27. package/dist/spatial-element/ListSection.svelte.d.ts +5 -0
  28. package/dist/spatial-element/PointerHint.svelte +3 -1
  29. package/dist/spatial-element/Section.svelte +51 -40
  30. package/dist/spatial-element/Section.svelte.d.ts +1 -0
  31. package/dist/spatial-element/SectionSurfaceGroup.svelte +34 -0
  32. package/dist/spatial-element/SectionSurfaceGroup.svelte.d.ts +7 -0
  33. package/dist/spatial-element/SpatialCardPresentation.svelte +378 -0
  34. package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +13 -0
  35. package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
  36. package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
  37. package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +20 -12
  38. package/dist/spatial-element/SpatialElementBreadcrumbs.svelte.d.ts +1 -0
  39. package/dist/spatial-element/SpatialElementCard.svelte +19 -318
  40. package/dist/spatial-element/SpatialElementCard.svelte.d.ts +3 -0
  41. package/dist/spatial-element/SpatialElementHelp.svelte +21 -15
  42. package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +4 -1
  43. package/dist/spatial-element/SpatialElementMediaRail.svelte +75 -21
  44. package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +3 -0
  45. package/dist/spatial-element/SpatialElementNativeMedia.svelte +36 -0
  46. package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
  47. package/dist/spatial-element/SpatialElementPage.svelte +127 -68
  48. package/dist/spatial-element/SpatialElementPage.svelte.d.ts +1 -0
  49. package/dist/spatial-element/SpatialElementStickyHeader.svelte +36 -69
  50. package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +1 -0
  51. package/dist/spatial-element/SpatialElementSummaryContent.svelte +14 -11
  52. package/dist/spatial-element/SpatialElementSummaryPanel.svelte +29 -20
  53. package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +1 -0
  54. package/dist/spatial-element/SpatialElementTabList.svelte +19 -3
  55. package/dist/spatial-element/SpatialElementTabs.svelte +56 -16
  56. package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +1 -0
  57. package/dist/spatial-element/SpatialElementViewToggle.svelte +5 -4
  58. package/dist/spatial-element/SpatialIconButton.svelte +4 -2
  59. package/dist/spatial-element/SpatialNavigationShell.svelte +129 -0
  60. package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +10 -0
  61. package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
  62. package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
  63. package/dist/spatial-element/SpatialSummaryRoot.svelte +78 -0
  64. package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
  65. package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
  66. package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
  67. package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
  68. package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
  69. package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
  70. package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
  71. package/dist/spatial-element/index.d.ts +6 -2
  72. package/dist/spatial-element/index.js +3 -1
  73. package/dist/spatial-element/layout.generated.css +455 -0
  74. package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
  75. package/dist/spatial-element/presentationBoxFreeze.js +35 -0
  76. package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
  77. package/dist/spatial-element/spatialPresentationOwner.js +2 -0
  78. package/dist/spatial-element/spatialSummary.d.ts +37 -0
  79. package/dist/spatial-element/spatialSummary.js +1 -0
  80. package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
  81. package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
  82. package/dist/spatial-element/spatialThemeStyle.js +10 -4
  83. package/dist/stage/ButtonGroup.svelte +1 -1
  84. package/dist/stage/Panel.svelte +16 -4
  85. package/dist/stage/Stage.svelte +180 -26
  86. package/package.json +2 -2
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
+ import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
2
3
  import { getContext } from 'svelte';
3
- import { PanelsTopLeft, Maximize } from 'lucide-svelte';
4
+ import SpatialViewIcon from './SpatialViewIcon.svelte';
4
5
  import { STAGE_CONTEXT_KEY, type StageContext } from '@spatial-elements/core/stage/panelContext';
5
6
  import ButtonGroup from '../stage/ButtonGroup.svelte';
6
7
  import { useSpatialTheme } from './brandContext.js';
@@ -13,6 +14,7 @@
13
14
  const stage = getContext<StageContext>(STAGE_CONTEXT_KEY);
14
15
  const readTheme = useSpatialTheme();
15
16
  const theme = $derived(readTheme());
17
+ const radii = $derived(resolveSpatialThemeRadii(theme));
16
18
  const readMessages = useSpatialMessages();
17
19
  const messages = $derived(readMessages());
18
20
  const fullscreen = $derived(stage.isFullscreen?.() ?? false);
@@ -40,14 +42,13 @@
40
42
  onchange={select}
41
43
  disabled={!enabled}
42
44
  visible={enabled}
43
- shape={theme.panelShape}
45
+ shape={{ ...theme.panelShape, radius: radii.control }}
44
46
  theme={theme.panelTheme}
45
47
  focusReactive="top-right"
46
48
  {focusAnchor}
47
49
  transitionGroup="enter"
48
50
  >
49
51
  {#snippet content(item)}
50
- {#if item.value === 'detail'}<PanelsTopLeft size={21} strokeWidth={1.8} aria-hidden="true" />
51
- {:else}<Maximize size={21} strokeWidth={1.8} aria-hidden="true" />{/if}
52
+ <SpatialViewIcon kind={item.value === 'detail' ? 'detail' : 'fullscreen'} />
52
53
  {/snippet}
53
54
  </ButtonGroup>
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
2
3
  import type { Snippet } from 'svelte';
3
4
  import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
4
5
  import Panel from '../stage/Panel.svelte';
@@ -16,12 +17,13 @@
16
17
  } = $props();
17
18
  const readTheme = useSpatialTheme();
18
19
  const theme = $derived(readTheme());
20
+ const radii = $derived(resolveSpatialThemeRadii(theme));
19
21
  </script>
20
22
 
21
23
  <div class="icon-frame">
22
24
  <Panel
23
25
  class="spatial-icon-panel"
24
- shape={{ radius: Math.min(12, theme.panelShape.radius), contentInset: 0 }}
26
+ shape={{ radius: radii.control, contentInset: 0 }}
25
27
  theme={theme.panelTheme}
26
28
  pointerReactive={false}
27
29
  focusReactive="top-right"
@@ -45,7 +47,7 @@
45
47
  .icon-frame :global(.spatial-icon-panel) { width: 40px; height: 40px; }
46
48
  .spatial-icon-button {
47
49
  box-sizing: border-box; display: grid; place-items: center; width: 40px; height: 40px;
48
- padding: 0; border: 0; border-radius: min(12px, var(--spatial-element-panel-radius)); background: transparent;
50
+ padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); background: transparent;
49
51
  color: var(--spatial-element-ink); cursor: pointer; touch-action: manipulation;
50
52
  transition: background-color 180ms ease;
51
53
  }
@@ -0,0 +1,129 @@
1
+ <script lang="ts">
2
+ import { onMount, tick, type Snippet } from 'svelte';
3
+ import { afterNavigate, beforeNavigate } from '$app/navigation';
4
+ import { resolveMenuOffset } from '@spatial-elements/core/spatial-element/responsiveLayout';
5
+ import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
6
+ import { getStageVisualScrollPosition, STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame } from '@spatial-elements/core/stage/scrollFrame';
7
+ import { STAGE_PANEL_LAYOUT_EVENT } from '@spatial-elements/core/stage/panelContext';
8
+ import Panel from '../stage/Panel.svelte';
9
+ import { useSpatialTheme } from './brandContext.js';
10
+ import './layout.generated.css';
11
+
12
+ let { menu, left, right }: { menu?: Snippet; left?: Snippet; right?: Snippet } = $props();
13
+ const readTheme = useSpatialTheme();
14
+ const theme = $derived(readTheme());
15
+ const radii = $derived(resolveSpatialThemeRadii(theme));
16
+ let rack: HTMLDivElement;
17
+ let stage: HTMLElement | undefined;
18
+ let enhancedScroll = false;
19
+ let fixedDetail = $state(false);
20
+
21
+ function position(scrollY = getStageVisualScrollPosition().scrollY) {
22
+ if (!rack) return;
23
+ const compensation = enhancedScroll ? Math.max(0, scrollY) + resolveMenuOffset(scrollY, fixedDetail) : 0;
24
+ rack.style.setProperty('--spatial-shell-scroll-compensation', `${compensation}px`);
25
+ // PageBinding removes precisely this DOM compensation before caching document coordinates.
26
+ rack.dataset.stageScrollCompensation = String(compensation);
27
+ rack.toggleAttribute('data-stage-scroll-shell-fixed', fixedDetail);
28
+ }
29
+ function updateMode() {
30
+ if (!rack || !stage) return;
31
+ const previousMode = `${enhancedScroll}/${fixedDetail}`;
32
+ enhancedScroll = stage.classList.contains('stage-virtual-scroll-active');
33
+ fixedDetail = getComputedStyle(rack).getPropertyValue('--spatial-shell-fixed').trim() === '1';
34
+ position();
35
+ if (previousMode !== `${enhancedScroll}/${fixedDetail}`) window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
36
+ }
37
+ function closePopovers() {
38
+ for (const element of rack?.querySelectorAll<HTMLElement>(':popover-open') ?? []) element.hidePopover();
39
+ for (const details of rack?.querySelectorAll<HTMLDetailsElement>('details[open]') ?? []) details.open = false;
40
+ }
41
+ afterNavigate(() => { void tick().then(updateMode); });
42
+ beforeNavigate(closePopovers);
43
+
44
+ onMount(() => {
45
+ stage = rack.closest<HTMLElement>('.stage') ?? undefined;
46
+ updateMode();
47
+ const observer = new MutationObserver(updateMode);
48
+ if (stage) observer.observe(stage, { attributes: true, attributeFilter: ['class'] });
49
+ const stop = subscribeStageScrollFrame(frame => position(frame.scrollY), STAGE_SCROLL_PRIORITY.virtualDocument + 1);
50
+ window.addEventListener('resize', updateMode, { passive: true });
51
+ return () => { stop(); observer.disconnect(); window.removeEventListener('resize', updateMode); };
52
+ });
53
+ </script>
54
+
55
+ <div class="spatial-shell-track" data-spatial-navigation-shell>
56
+ <div bind:this={rack} class="spatial-shell-rack" data-stage-scroll-shell data-catalog-shell>
57
+ {#if menu}
58
+ <Panel class="spatial-shell-menu spatial-content-width" nativeContent pointerReactive={false}
59
+ surface={fixedDetail ? theme.panelTheme.surface : 'frosted'}
60
+ shape={{ radius: radii.panel, contentInset: 0 }} theme={theme.panelTheme}
61
+ contentClass="spatial-shell-menu-content" data-spatial-shell-menu>
62
+ {@render menu()}
63
+ </Panel>
64
+ {/if}
65
+ {#if left}
66
+ <Panel class="spatial-shell-satellite spatial-shell-left" nativeContent pointerReactive={false}
67
+ surface={fixedDetail ? theme.panelTheme.surface : 'frosted'}
68
+ shape={{ radius: radii.control, contentInset: 0 }} theme={theme.panelTheme}
69
+ contentClass="spatial-shell-satellite-content" data-spatial-shell-left>
70
+ {@render left()}
71
+ </Panel>
72
+ {/if}
73
+ {#if right}
74
+ <Panel class="spatial-shell-satellite spatial-shell-right" nativeContent pointerReactive={false}
75
+ surface={fixedDetail ? theme.panelTheme.surface : 'frosted'}
76
+ shape={{ radius: radii.control, contentInset: 0 }} theme={theme.panelTheme}
77
+ contentClass="spatial-shell-satellite-content" data-spatial-shell-right>
78
+ {@render right()}
79
+ </Panel>
80
+ {/if}
81
+ </div>
82
+ </div>
83
+
84
+ <style>
85
+ .spatial-shell-track {
86
+ position: relative;
87
+ z-index: 30;
88
+ height: calc(var(--spatial-shell-reserve) + var(--spatial-shell-sticky-range));
89
+ margin-bottom: calc(-1 * var(--spatial-shell-sticky-range));
90
+ pointer-events: none;
91
+ }
92
+ .spatial-shell-rack {
93
+ position: sticky;
94
+ top: 0;
95
+ width: 100%;
96
+ height: var(--spatial-shell-reserve);
97
+ pointer-events: none;
98
+ }
99
+ :global(.stage-virtual-scroll-active) .spatial-shell-rack {
100
+ position: relative;
101
+ transform: translateY(var(--spatial-shell-scroll-compensation, 0px));
102
+ }
103
+ :global(.spatial-shell-menu) {
104
+ position: absolute;
105
+ top: var(--spatial-shell-menu-top);
106
+ left: 0;
107
+ right: 0;
108
+ height: var(--spatial-shell-menu-height);
109
+ pointer-events: auto;
110
+ }
111
+ :global(.spatial-shell-menu-content) {
112
+ box-sizing: border-box;
113
+ display: flex;
114
+ align-items: center;
115
+ width: 100%;
116
+ height: 100%;
117
+ padding: 0 12px;
118
+ }
119
+ :global(.spatial-shell-satellite) {
120
+ position: absolute;
121
+ top: var(--spatial-shell-satellite-top);
122
+ width: var(--spatial-shell-satellite-width);
123
+ height: var(--spatial-shell-satellite-height);
124
+ pointer-events: auto;
125
+ }
126
+ :global(.spatial-shell-left) { left: var(--spatial-shell-satellite-inset); }
127
+ :global(.spatial-shell-right) { right: var(--spatial-shell-satellite-inset); }
128
+ :global(.spatial-shell-satellite-content) { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
129
+ </style>
@@ -0,0 +1,10 @@
1
+ import { type Snippet } from 'svelte';
2
+ import './layout.generated.css';
3
+ type $$ComponentProps = {
4
+ menu?: Snippet;
5
+ left?: Snippet;
6
+ right?: Snippet;
7
+ };
8
+ declare const SpatialNavigationShell: import("svelte").Component<$$ComponentProps, {}, "">;
9
+ type SpatialNavigationShell = ReturnType<typeof SpatialNavigationShell>;
10
+ export default SpatialNavigationShell;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { getAllContexts, getContext, onDestroy, onMount, setContext, type Snippet } from 'svelte';
3
+ import { SpatialSummaryHostController, SPATIAL_SUMMARY_HOST } from './spatialSummaryHost.svelte.js';
4
+ import type { SpatialSummaryContext, SpatialSummarySnippet } from './spatialSummary.js';
5
+ import SpatialElementSummaryContent from './SpatialElementSummaryContent.svelte';
6
+ import { SPATIAL_PRESENTATION_OWNER, type SpatialPresentationOwner } from './spatialPresentationOwner.js';
7
+ let { summary, children }: { summary?: SpatialSummarySnippet; children?: Snippet } = $props();
8
+ const controller = new SpatialSummaryHostController(() => renderSummary, getAllContexts());
9
+ setContext(SPATIAL_SUMMARY_HOST, controller);
10
+ const owner = getContext<SpatialPresentationOwner | undefined>(SPATIAL_PRESENTATION_OWNER);
11
+ onMount(() => owner?.register(controller));
12
+ onDestroy(() => controller.destroy());
13
+ </script>
14
+ {#snippet renderSummary(context: SpatialSummaryContext)}
15
+ {#if summary}{@render summary(context)}{:else}
16
+ <SpatialElementSummaryContent spatialElement={context.spatialElement} address={context.address} heading={context.heading} contentInset={context.contentInset} />
17
+ {/if}
18
+ {/snippet}
19
+ {@render children?.()}
@@ -0,0 +1,9 @@
1
+ import { type Snippet } from 'svelte';
2
+ import type { SpatialSummarySnippet } from './spatialSummary.js';
3
+ type $$ComponentProps = {
4
+ summary?: SpatialSummarySnippet;
5
+ children?: Snippet;
6
+ };
7
+ declare const SpatialSummaryHost: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type SpatialSummaryHost = ReturnType<typeof SpatialSummaryHost>;
9
+ export default SpatialSummaryHost;
@@ -0,0 +1,78 @@
1
+ <script lang="ts">
2
+ import { getContext } from 'svelte';
3
+ import type { SpatialPresentationModel, SpatialSummarySnippet } from './spatialSummary.js';
4
+ import SpatialCardPresentation from './SpatialCardPresentation.svelte';
5
+ import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
6
+ import { useCatalogNavigation } from '../catalog/catalogNavigation.js';
7
+ import { catalogViewLink } from '@spatial-elements/core/catalog/catalogViewLink';
8
+ import { CATALOG_ENDPOINTS, type CatalogEndpointRegistry } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
9
+ import { CATALOG_SECTIONS, type CatalogSections } from '@spatial-elements/core/catalog/CatalogSections';
10
+ let { content, model }: { content: SpatialSummarySnippet; model: SpatialPresentationModel } = $props();
11
+ const context = $derived(model.kind === 'summary' ? model.current : undefined);
12
+ const carousel = $derived(context?.carousel);
13
+ const catalogEndpoint = createCatalogEndpointAction();
14
+ const endpoints = getContext<CatalogEndpointRegistry | undefined>(CATALOG_ENDPOINTS);
15
+ const sections = getContext<CatalogSections | undefined>(CATALOG_SECTIONS);
16
+ const { href, prepare } = useCatalogNavigation();
17
+ function activate(event: MouseEvent) {
18
+ if (!model.active || !context || !carousel) { event.preventDefault(); return; }
19
+ endpoints?.prefer(context.spatialElement.brandId, context.spatialElement.id, carousel.occurrence, 'carousel.front');
20
+ 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
+ }
23
+ function prepareCarousel() { if (model.active && carousel) prepare(carousel.item); }
24
+ </script>
25
+ {#if model.kind === 'card'}
26
+ <SpatialCardPresentation {...model.current} active={model.active} />
27
+ {:else}
28
+ <div class="spatial-summary-surface" hidden={model.current.mode !== 'carousel'} aria-hidden="true"></div>
29
+ {#if model.current.carousel}
30
+ <div class="compact-copy" hidden={model.current.mode !== 'carousel'}>
31
+ {#if model.current.spatialElement.eyebrow}<p use:catalogEndpoint={model.active && carousel?.compact ? model.current.address('eyebrow') : undefined}>{model.current.spatialElement.eyebrow}</p>{/if}
32
+ <h3 use:catalogEndpoint={model.active && carousel?.compact ? model.current.address('title') : undefined}>{model.current.spatialElement.title}</h3>
33
+ </div>
34
+ {/if}
35
+ <div data-spatial-summary-root class="spatial-summary-query" class:full-summary={model.current.mode === 'carousel'}>
36
+ {@render content(model.active && !carousel?.compact ? model.current : { ...model.current, address: () => undefined })}
37
+ </div>
38
+ {#if model.current.carousel}
39
+ {#if model.current.carousel.item.summary?.sectionLink}<a class="section-information" href={href(model.current.carousel.item.summary.sectionLink.href)} onclick={activate}
40
+ use:catalogViewLink={{ spatialElementId: model.current.spatialElement.id, targetPresentation: model.current.carousel.item.summary.sectionLink.targetPresentation }}
41
+ data-catalog-focus-key={`catalog-section:${model.current.carousel.occurrence}`}>{model.current.carousel.item.summary.sectionLink.label}</a>{/if}
42
+ <a class="information" href={href(model.current.carousel.item.href)} onclick={activate} onpointerenter={prepareCarousel} onfocus={prepareCarousel} onpointerdown={prepareCarousel}
43
+ use:catalogViewLink={{ spatialElementId: model.current.spatialElement.id, targetPresentation: model.current.carousel.item.targetPresentation }}
44
+ aria-label={`More information: ${model.current.spatialElement.title}`}
45
+ data-catalog-focus-key={`catalog:${JSON.stringify([model.current.spatialElement.brandId, model.current.spatialElement.id, model.current.carousel.occurrence, 'carousel.front'])}`}>
46
+ <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 17 17 7M7 7h10v10" /></svg>
47
+ </a>
48
+ {/if}
49
+ {/if}
50
+ <style>
51
+ :global(.spatial-summary-island) { position: relative; width: 100%; min-width: 0; box-sizing: border-box; }
52
+ .spatial-summary-query {
53
+ container: spatial-summary / inline-size; width: 100%; min-width: 0; pointer-events: auto;
54
+ max-height: max(0px, calc(var(--spatial-detail-summary-max-height, 100000px) - var(--spatial-summary-content-inset, 0px) * 2 - var(--spatial-summary-height-reserve, 0px)));
55
+ overflow: auto; overscroll-behavior: auto;
56
+ }
57
+ :global(.spatial-summary-island[data-presentation-mode='carousel']) { height: 100%; border-radius: var(--carousel-panel-radius, 14px); opacity: var(--carousel-panel-opacity, 1); }
58
+ .spatial-summary-surface {
59
+ position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--carousel-panel-tint, white) var(--carousel-panel-tint-opacity, 65%), transparent);
60
+ border: 1px solid color-mix(in srgb, var(--spatial-element-accent) 12%, transparent); backdrop-filter: blur(var(--carousel-panel-blur, 5px)); box-shadow: var(--carousel-panel-shadow); pointer-events: none;
61
+ }
62
+ .spatial-summary-surface[hidden] { display: none; }
63
+ :global([data-carousel-glass-ready]) .spatial-summary-surface,
64
+ :global([data-spatial-presentation-glass]) .spatial-summary-surface { visibility: hidden; }
65
+ .compact-copy { position: relative; padding-right: 44px; }
66
+ .compact-copy p { height: 26px; margin: 0; font-size: 12px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
67
+ .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; }
68
+ .full-summary, .section-information { display: none; }
69
+ .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; }
70
+ .information svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
71
+ @media (min-width: 840px) {
72
+ :global(.spatial-summary-island[data-presentation-mode='carousel']) { height: auto; padding: var(--spatial-summary-content-inset); }
73
+ .compact-copy { display: none; }
74
+ .full-summary { display: block; position: relative; }
75
+ /* Optional section navigation belongs outside the shared property surface. */
76
+ .section-information { display: block; position: absolute; top: calc(100% + 8px); left: 0; right: 0; height: 32px; line-height: 32px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--spatial-element-accent); }
77
+ }
78
+ </style>
@@ -0,0 +1,8 @@
1
+ import type { SpatialPresentationModel, SpatialSummarySnippet } from './spatialSummary.js';
2
+ type $$ComponentProps = {
3
+ content: SpatialSummarySnippet;
4
+ model: SpatialPresentationModel;
5
+ };
6
+ declare const SpatialSummaryRoot: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type SpatialSummaryRoot = ReturnType<typeof SpatialSummaryRoot>;
8
+ export default SpatialSummaryRoot;
@@ -0,0 +1,39 @@
1
+ <script lang="ts">
2
+ import { browser } from '$app/environment';
3
+ import { createRawSnippet, getContext, onMount, untrack } from 'svelte';
4
+ import { render } from 'svelte/server';
5
+ import { SpatialSummaryHostController, SPATIAL_SUMMARY_HOST } from './spatialSummaryHost.svelte.js';
6
+ import SpatialSummaryRoot from './SpatialSummaryRoot.svelte';
7
+ import type { SpatialSummaryContext } from './spatialSummary.js';
8
+ let { instanceKey, context, element = $bindable() }: {
9
+ instanceKey: string;
10
+ context: SpatialSummaryContext;
11
+ element?: HTMLDivElement;
12
+ } = $props();
13
+ const host = getContext<SpatialSummaryHostController | undefined>(SPATIAL_SUMMARY_HOST);
14
+ if (!host) throw new Error('Spatial summary slots require a BrandStageShell');
15
+ const key = untrack(() => instanceKey);
16
+ let mounted = $state(false);
17
+ const raw = createRawSnippet(() => ({
18
+ render: () => {
19
+ if (browser) return '<div data-spatial-summary-slot></div>';
20
+ const output = render(SpatialSummaryRoot, {
21
+ props: { content: host.content(), model: { kind: 'summary', current: context, active: true } }, context: host.contexts,
22
+ idPrefix: `summary-${encodeURIComponent(key).replaceAll('-', '%2D')}`
23
+ });
24
+ const body = output.body;
25
+ if (output.head) throw new Error('A persistent summary must render synchronous content without svelte:head');
26
+ return `<div data-spatial-summary-slot><div data-spatial-presentation-root class="spatial-summary-island" data-presentation-mode="${context.mode}" style="--spatial-summary-content-inset:${context.contentInset}px">${body}</div></div>`;
27
+ },
28
+ setup: (slot) => {
29
+ element = slot as HTMLDivElement;
30
+ return host.attach(element, key, context);
31
+ }
32
+ }));
33
+ onMount(() => { mounted = true; });
34
+ $effect(() => { if (mounted) host.update(key, context); });
35
+ </script>
36
+ {@render raw()}
37
+ <style>
38
+ :global([data-spatial-summary-slot]) { min-width: 0; }
39
+ </style>
@@ -0,0 +1,9 @@
1
+ import type { SpatialSummaryContext } from './spatialSummary.js';
2
+ type $$ComponentProps = {
3
+ instanceKey: string;
4
+ context: SpatialSummaryContext;
5
+ element?: HTMLDivElement;
6
+ };
7
+ declare const SpatialSummarySlot: import("svelte").Component<$$ComponentProps, {}, "element">;
8
+ type SpatialSummarySlot = ReturnType<typeof SpatialSummarySlot>;
9
+ export default SpatialSummarySlot;
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ let { kind }: { kind: 'detail' | 'fullscreen' } = $props();
3
+ // Authored layout icons: assets/box-details.svg and assets/box-fullscreen.svg.
4
+ const detail = [
5
+ 'M10.504 19.23 L13.504 17.49', 'M10.505 8.771 A2 2 0 0 0 8.613 8.707',
6
+ 'M13.504 17.49 A2 2 0 0 0 14.5 15.76', 'M13.505 10.513 L10.505 8.771',
7
+ 'M14.5 12.243 A2 2 0 0 0 13.505 10.513', 'M14.5 15.76 L14.5 12.243',
8
+ 'M19.5 17.5 L19.5 8.5', 'M2 5 L22 5', 'M4.5 12.244 L4.5 15.76',
9
+ 'M4.5 15.76 A2 2 0 0 0 5.496 17.49', 'M4.764 11.252 L9.5 14',
10
+ 'M5.495 10.514 A2 2 0 0 0 4.5 12.244', 'M5.496 17.49 L8.496 19.23',
11
+ 'M8.496 19.23 A2 2 0 0 0 10.504 19.23', 'M8.613 8.707 L5.495 10.514',
12
+ 'M9.5 14 L14.237 11.252', 'M9.5 14 L9.5 19.5'
13
+ ];
14
+ const fullscreen = [
15
+ 'M11.333 18.819 A1.33 1.33 0 0 0 12.667 18.819', 'M11.333 5.846 L6.667 8.513',
16
+ 'M12 12.333 L17.8 9', 'M12 19 L12 12.333', 'M12.667 18.819 L17.333 16.153',
17
+ 'M12.667 5.846 A1.33 1.33 0 0 0 11.333 5.846', 'M17.333 16.153 A1.33 1.33 0 0 0 18 15',
18
+ 'M17.333 8.513 L12.667 5.846', 'M18 15 L18 9.666',
19
+ 'M18 9.666 A1.33 1.33 0 0 0 17.333 8.513', 'M6 15 A1.33 1.33 0 0 0 6.667 16.153',
20
+ 'M6 9.666 L6 15', 'M6.2 9 L12 12.333', 'M6.667 16.153 L11.333 18.819',
21
+ 'M6.667 8.513 A1.33 1.33 0 0 0 6 9.666'
22
+ ];
23
+ </script>
24
+
25
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
26
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-spatial-view-icon={kind}>
27
+ {#each kind === 'detail' ? detail : fullscreen as path}<path d={path} />{/each}
28
+ <rect x="1" y="2" width="22" height="20" rx="2" />
29
+ </svg>
@@ -0,0 +1,6 @@
1
+ type $$ComponentProps = {
2
+ kind: 'detail' | 'fullscreen';
3
+ };
4
+ declare const SpatialViewIcon: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type SpatialViewIcon = ReturnType<typeof SpatialViewIcon>;
6
+ export default SpatialViewIcon;
@@ -0,0 +1,5 @@
1
+ /** Freeze the displayed (possibly interpolated) appearance, not the hover state.
2
+ * Read all known paint owners before any write. Motion may subsequently own an
3
+ * actor's transform; restore its motion first, then this appearance snapshot.
4
+ */
5
+ export declare function freezeCardAppearance(card: HTMLElement): () => void;
@@ -0,0 +1,72 @@
1
+ const FROZEN = 'data-spatial-card-appearance-frozen';
2
+ const AFTER_OPACITY = '--spatial-card-frozen-after-opacity';
3
+ const TRANSITION = 'transition-property';
4
+ const TRANSITION_LONGHANDS = ['transition-duration', 'transition-timing-function', 'transition-delay', 'transition-behavior'];
5
+ /** Freeze the displayed (possibly interpolated) appearance, not the hover state.
6
+ * Read all known paint owners before any write. Motion may subsequently own an
7
+ * actor's transform; restore its motion first, then this appearance snapshot.
8
+ */
9
+ export function freezeCardAppearance(card) {
10
+ const surface = card.querySelector('.spatial-element-card-surface');
11
+ const targets = [
12
+ { element: card, properties: ['outline-color', 'outline-style', 'outline-width', 'outline-offset'] }
13
+ ];
14
+ for (const element of card.querySelectorAll('[data-shared-role="title"], [data-shared-role="eyebrow"]')) {
15
+ targets.push({ element, properties: ['transform', 'text-shadow'] });
16
+ }
17
+ if (surface)
18
+ targets.push({ element: surface,
19
+ properties: ['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'] });
20
+ const poster = card.querySelector('[data-catalog-poster]');
21
+ if (poster)
22
+ targets.push({ element: poster, properties: ['transform', 'opacity'] });
23
+ const writes = [];
24
+ const snapshot = (element, name, frozen) => writes.push({ element, name, frozen,
25
+ original: element.style.getPropertyValue(name), priority: element.style.getPropertyPriority(name) });
26
+ for (const { element, properties } of targets) {
27
+ const computed = getComputedStyle(element);
28
+ for (const name of properties)
29
+ snapshot(element, name, computed.getPropertyValue(name));
30
+ // Suppressing the transition alone would jump to its final cascade value.
31
+ // Pin its current value first, and leave unrelated authored longhands alone.
32
+ if (element !== card) {
33
+ snapshot(element, TRANSITION, 'none');
34
+ // Motion saves/restores the shorthand on Dock actors. Retain these
35
+ // authored longhands too, even if that shorthand cannot serialize.
36
+ for (const name of TRANSITION_LONGHANDS)
37
+ snapshot(element, name);
38
+ }
39
+ }
40
+ const previousMarker = surface?.getAttribute(FROZEN);
41
+ if (surface)
42
+ snapshot(surface, AFTER_OPACITY, getComputedStyle(surface, '::after').opacity);
43
+ let restored = false;
44
+ const restore = () => {
45
+ if (restored)
46
+ return;
47
+ restored = true;
48
+ for (const { element, name, original, priority } of writes) {
49
+ if (original)
50
+ element.style.setProperty(name, original, priority);
51
+ else
52
+ element.style.removeProperty(name);
53
+ }
54
+ if (surface) {
55
+ if (previousMarker === null)
56
+ surface.removeAttribute(FROZEN);
57
+ else if (previousMarker !== undefined)
58
+ surface.setAttribute(FROZEN, previousMarker);
59
+ }
60
+ };
61
+ try {
62
+ for (const { element, name, frozen } of writes)
63
+ if (frozen !== undefined)
64
+ element.style.setProperty(name, frozen, 'important');
65
+ surface?.setAttribute(FROZEN, '');
66
+ }
67
+ catch (error) {
68
+ restore();
69
+ throw error;
70
+ }
71
+ return restore;
72
+ }
@@ -1,15 +1,19 @@
1
1
  export { default as BrandStageShell } from './BrandStageShell.svelte';
2
+ export type { SpatialSummaryContext, SpatialSummarySnippet } from './spatialSummary.js';
2
3
  export { defaultSpatialMessages, resolveSpatialMessages, type SpatialMessages, type SpatialMessagesInput } from '@spatial-elements/core/spatial-element/messages';
3
4
  export { default as SpatialElementPage } from './SpatialElementPage.svelte';
4
5
  export { default as SpatialListPage } from './SpatialListPage.svelte';
5
6
  export { default as Section } from './Section.svelte';
6
7
  export { findSpatialElement, getSpatialListItems } from '@spatial-elements/core/spatial-element/spatialElement';
7
- export type { SpatialElementAction, SpatialTheme, SpatialElementBreadcrumb, SpatialElementData, SpatialDockedPanelTheme, SpatialElementFeature, SpatialElementMediaItem, SpatialMinimapTheme, SpatialListItem, SpatialElementSectionDefinition, SpatialElementSectionNavigationItem, SpatialElementSectionStyle, SpatialSectionTheme } from '@spatial-elements/core/spatial-element/types';
8
+ 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';
8
9
  export { default as ContentPage } from './ContentPage.svelte';
10
+ export { default as ContentGrid } from './ContentGrid.svelte';
11
+ export { default as ContentBlock } from './ContentBlock.svelte';
12
+ export type { ContentGridSize, ContentSpan, SpatialCardSize } from '@spatial-elements/core/spatial-element/responsiveLayout';
9
13
  export { default as CarouselSection } from './CarouselSection.svelte';
10
14
  export { default as ListSection } from './ListSection.svelte';
11
15
  export type { ContentPageData } from '@spatial-elements/core/spatial-element/types';
12
16
  export type { CarouselPresentation } from '@spatial-elements/core/catalog/catalogPose';
13
- export { createSpatialTheme, type SpatialThemeOptions } from '@spatial-elements/core/spatial-element/spatialTheme';
17
+ export { createSpatialTheme, resolveSpatialThemeRadii, resolveSpatialSectionBackgrounds, type SpatialThemeOptions } from '@spatial-elements/core/spatial-element/spatialTheme';
14
18
  export type { StageRenderSettings, BackgroundSettings, StageModelSettings, StageCameraSettings } from '@spatial-elements/core/stage/stageTypes';
15
19
  export { geometryFromLodPair, type SpatialElementGeometry } from '@spatial-elements/core/spatial-element/spatialElementGeometry';
@@ -5,7 +5,9 @@ export { default as SpatialListPage } from './SpatialListPage.svelte';
5
5
  export { default as Section } from './Section.svelte';
6
6
  export { findSpatialElement, getSpatialListItems } from '@spatial-elements/core/spatial-element/spatialElement';
7
7
  export { default as ContentPage } from './ContentPage.svelte';
8
+ export { default as ContentGrid } from './ContentGrid.svelte';
9
+ export { default as ContentBlock } from './ContentBlock.svelte';
8
10
  export { default as CarouselSection } from './CarouselSection.svelte';
9
11
  export { default as ListSection } from './ListSection.svelte';
10
- export { createSpatialTheme } from '@spatial-elements/core/spatial-element/spatialTheme';
12
+ export { createSpatialTheme, resolveSpatialThemeRadii, resolveSpatialSectionBackgrounds } from '@spatial-elements/core/spatial-element/spatialTheme';
11
13
  export { geometryFromLodPair } from '@spatial-elements/core/spatial-element/spatialElementGeometry';