@spatial-elements/sveltekit 0.1.0-beta.2 → 1.0.0-beta.10

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 (129) hide show
  1. package/README.md +18 -13
  2. package/dist/catalog/ScrollNavigationBridge.svelte +172 -47
  3. package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +9 -2
  4. package/dist/catalog/catalogNavigation.js +3 -2
  5. package/dist/catalog/catalogSummaryTransfer.d.ts +16 -0
  6. package/dist/catalog/catalogSummaryTransfer.js +79 -0
  7. package/dist/catalog/catalogTransition.css +58 -3
  8. package/dist/catalog/interruptedPresentation.d.ts +10 -0
  9. package/dist/catalog/interruptedPresentation.js +29 -0
  10. package/dist/catalog/presentationCleanup.d.ts +4 -0
  11. package/dist/catalog/presentationCleanup.js +20 -0
  12. package/dist/catalog/stagedCatalogNavigation.d.ts +44 -0
  13. package/dist/catalog/stagedCatalogNavigation.js +403 -0
  14. package/dist/catalog/stagedDomReveal.d.ts +8 -0
  15. package/dist/catalog/stagedDomReveal.js +76 -0
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.js +3 -0
  18. package/dist/spatial-element/BrandStageShell.svelte +52 -71
  19. package/dist/spatial-element/BrandStageShell.svelte.d.ts +31 -4
  20. package/dist/spatial-element/CarouselSpatialElement.svelte +150 -197
  21. package/dist/spatial-element/CarouselSpatialElement.svelte.d.ts +5 -1
  22. package/dist/spatial-element/ContentBlock.svelte +7 -0
  23. package/dist/spatial-element/ContentBlock.svelte.d.ts +9 -0
  24. package/dist/spatial-element/ContentGrid.svelte +7 -0
  25. package/dist/spatial-element/ContentGrid.svelte.d.ts +8 -0
  26. package/dist/spatial-element/ContentPage.svelte +51 -55
  27. package/dist/spatial-element/ContentPage.svelte.d.ts +14 -3
  28. package/dist/spatial-element/InteractionGesture.svelte +39 -0
  29. package/dist/spatial-element/InteractionGesture.svelte.d.ts +7 -0
  30. package/dist/spatial-element/OverflowControls.svelte +125 -0
  31. package/dist/spatial-element/OverflowControls.svelte.d.ts +9 -0
  32. package/dist/spatial-element/PointerHint.svelte +80 -0
  33. package/dist/spatial-element/PointerHint.svelte.d.ts +3 -0
  34. package/dist/spatial-element/Section.svelte +25 -106
  35. package/dist/spatial-element/Section.svelte.d.ts +1 -0
  36. package/dist/spatial-element/SectionSurfaceGroup.svelte +8 -0
  37. package/dist/spatial-element/SectionSurfaceGroup.svelte.d.ts +8 -0
  38. package/dist/spatial-element/SpatialCardGridSection.svelte +79 -0
  39. package/dist/spatial-element/SpatialCardGridSection.svelte.d.ts +11 -0
  40. package/dist/spatial-element/SpatialCardPresentation.svelte +311 -0
  41. package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +19 -0
  42. package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
  43. package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
  44. package/dist/spatial-element/SpatialCarouselSection.svelte +752 -0
  45. package/dist/spatial-element/{CarouselSection.svelte.d.ts → SpatialCarouselSection.svelte.d.ts} +5 -5
  46. package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +12 -65
  47. package/dist/spatial-element/SpatialElementCard.svelte +54 -238
  48. package/dist/spatial-element/SpatialElementCard.svelte.d.ts +9 -0
  49. package/dist/spatial-element/SpatialElementHelp.svelte +292 -0
  50. package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
  51. package/dist/spatial-element/SpatialElementMediaRail.svelte +321 -52
  52. package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +4 -1
  53. package/dist/spatial-element/SpatialElementNativeMedia.svelte +101 -0
  54. package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
  55. package/dist/spatial-element/SpatialElementPage.svelte +150 -70
  56. package/dist/spatial-element/SpatialElementPage.svelte.d.ts +6 -3
  57. package/dist/spatial-element/SpatialElementStickyHeader.svelte +76 -104
  58. package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +3 -1
  59. package/dist/spatial-element/SpatialElementSummaryContent.svelte +185 -0
  60. package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +18 -0
  61. package/dist/spatial-element/SpatialElementSummaryPanel.svelte +48 -380
  62. package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +2 -1
  63. package/dist/spatial-element/SpatialElementTabList.svelte +40 -17
  64. package/dist/spatial-element/SpatialElementTabList.svelte.d.ts +2 -1
  65. package/dist/spatial-element/SpatialElementTabs.svelte +61 -18
  66. package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +3 -1
  67. package/dist/spatial-element/SpatialElementViewToggle.svelte +54 -0
  68. package/dist/spatial-element/SpatialElementViewToggle.svelte.d.ts +8 -0
  69. package/dist/spatial-element/SpatialIconButton.svelte +59 -0
  70. package/dist/spatial-element/SpatialIconButton.svelte.d.ts +14 -0
  71. package/dist/spatial-element/SpatialListPage.svelte +37 -8
  72. package/dist/spatial-element/SpatialListPage.svelte.d.ts +4 -1
  73. package/dist/spatial-element/SpatialMediaIndicator.svelte +16 -0
  74. package/dist/spatial-element/SpatialMediaIndicator.svelte.d.ts +26 -0
  75. package/dist/spatial-element/SpatialNavigationShell.svelte +136 -0
  76. package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +15 -0
  77. package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
  78. package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
  79. package/dist/spatial-element/SpatialSummaryRoot.svelte +78 -0
  80. package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
  81. package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
  82. package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
  83. package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
  84. package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
  85. package/dist/spatial-element/brandContext.d.ts +1 -1
  86. package/dist/spatial-element/brandContext.js +1 -1
  87. package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
  88. package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
  89. package/dist/spatial-element/carouselTextHit.d.ts +2 -0
  90. package/dist/spatial-element/carouselTextHit.js +17 -0
  91. package/dist/spatial-element/contentSidebars.d.ts +3 -0
  92. package/dist/spatial-element/contentSidebars.js +56 -0
  93. package/dist/spatial-element/index.d.ts +18 -3
  94. package/dist/spatial-element/index.js +11 -2
  95. package/dist/spatial-element/layout.generated.css +363 -0
  96. package/dist/spatial-element/messagesContext.d.ts +3 -0
  97. package/dist/spatial-element/messagesContext.js +10 -0
  98. package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
  99. package/dist/spatial-element/presentationBoxFreeze.js +35 -0
  100. package/dist/spatial-element/spatialCardGrid.d.ts +12 -0
  101. package/dist/spatial-element/spatialCardGrid.js +1 -0
  102. package/dist/spatial-element/spatialPageContext.d.ts +4 -0
  103. package/dist/spatial-element/spatialPageContext.js +9 -0
  104. package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
  105. package/dist/spatial-element/spatialPresentationOwner.js +2 -0
  106. package/dist/spatial-element/spatialSummary.d.ts +43 -0
  107. package/dist/spatial-element/spatialSummary.js +1 -0
  108. package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
  109. package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
  110. package/dist/spatial-element/spatialThemeStyle.d.ts +3 -0
  111. package/dist/spatial-element/spatialThemeStyle.js +69 -0
  112. package/dist/spatial-element/truncatedTitle.d.ts +5 -0
  113. package/dist/spatial-element/truncatedTitle.js +28 -0
  114. package/dist/stage/ButtonGroup.svelte +151 -0
  115. package/dist/stage/ButtonGroup.svelte.d.ts +24 -0
  116. package/dist/stage/Panel.svelte +72 -14
  117. package/dist/stage/Panel.svelte.d.ts +14 -2
  118. package/dist/stage/Stage.svelte +405 -48
  119. package/dist/stage/Stage.svelte.d.ts +8 -1
  120. package/dist/stage/StageViewport.svelte +15 -2
  121. package/dist/stage/authoredStyle.d.ts +4 -0
  122. package/dist/stage/authoredStyle.js +17 -0
  123. package/dist/stage/buttonGroup.d.ts +9 -0
  124. package/dist/stage/buttonGroup.js +1 -0
  125. package/logo.svg +188 -0
  126. package/package.json +9 -6
  127. package/dist/spatial-element/CarouselSection.svelte +0 -350
  128. package/dist/spatial-element/ListSection.svelte +0 -30
  129. package/dist/spatial-element/ListSection.svelte.d.ts +0 -8
@@ -0,0 +1,292 @@
1
+ <script lang="ts">
2
+ import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
3
+ import { getContext, onMount, tick } from 'svelte';
4
+ import CircleHelp from 'lucide-svelte/icons/circle-help';
5
+ import X from 'lucide-svelte/icons/x';
6
+ import InteractionGesture from './InteractionGesture.svelte';
7
+ import { getCssPanelBoxShadow } from '@spatial-elements/core/stage/panelShadow';
8
+ import { getInteractionGuidance, MODEL_INPUT_EVENT, type ModelInputState, type InteractionGuidance } from '@spatial-elements/core/stage/interactionGuidance';
9
+ import { STAGE_SCROLL_PRIORITY, subscribeStageScrollFrame } from '@spatial-elements/core/stage/scrollFrame';
10
+ import { STAGE_CONTEXT_KEY, STAGE_PANEL_LAYOUT_EVENT, type StageContext } from '@spatial-elements/core/stage/panelContext';
11
+ import SpatialElementViewToggle from './SpatialElementViewToggle.svelte';
12
+ import Panel from '../stage/Panel.svelte';
13
+ import SpatialIconButton from './SpatialIconButton.svelte';
14
+ import { useSpatialTheme } from './brandContext.js';
15
+ import { useSpatialMessages } from './messagesContext.js';
16
+
17
+ const readTheme = useSpatialTheme();
18
+ const theme = $derived(readTheme());
19
+ const radii = $derived(resolveSpatialThemeRadii(theme));
20
+ const stageContext = getContext<StageContext>(STAGE_CONTEXT_KEY);
21
+ const fullscreen = $derived(stageContext.isFullscreen?.() ?? false);
22
+ const readMessages = useSpatialMessages();
23
+ const messages = $derived(readMessages());
24
+ const help = $derived(messages.interactionHelp);
25
+ const id = $props.id();
26
+ let { active = true }: { active?: boolean } = $props();
27
+ let root: HTMLDivElement;
28
+ let focusAnchor = $state<HTMLElement>();
29
+ let button = $state<HTMLButtonElement>(null!);
30
+ let popover: HTMLDivElement;
31
+ let closeButton: HTMLButtonElement;
32
+ let open = $state(false);
33
+ $effect(() => { if (!active) close(); });
34
+ let enhanced = $state(false);
35
+ let visible = false;
36
+ let interacted = $state(false);
37
+ let touchInput = $state(false);
38
+ let guidance: InteractionGuidance | undefined;
39
+ let delay: ReturnType<typeof setTimeout> | undefined;
40
+ let hideDelay: ReturnType<typeof setTimeout> | undefined;
41
+ let manual = false;
42
+ let helpHovered = false;
43
+ let buttonHovered = false;
44
+ let modelInput: ModelInputState = { hovered: false, active: false };
45
+ const surfaceStyle = $derived([
46
+ `--help-tint: ${typeof theme.panelTheme.tint === 'number' ? '#' + theme.panelTheme.tint.toString(16).padStart(6, '0') : theme.panelTheme.tint ?? '#ffffff'}`,
47
+ `--help-tint-opacity: ${(theme.panelTheme.tintOpacity ?? 0.65) * 100}%`,
48
+ `--help-blur: ${Math.min(100, Math.max(0, theme.panelTheme.backdropBlur ?? 8))}px`,
49
+ `--help-shadow: ${getCssPanelBoxShadow(theme.panelTheme.shadowIntensity ?? 0.2)}`,
50
+ `--help-radius: ${radii.panel}px`
51
+ ].join(';'));
52
+
53
+ function clearDelay() { clearTimeout(delay); delay = undefined; }
54
+ function clearHideDelay() { clearTimeout(hideDelay); hideDelay = undefined; }
55
+ function close(returnFocus = false) {
56
+ clearDelay(); clearHideDelay();
57
+ if (!open) return;
58
+ const restoreFocus = returnFocus && popover.contains(document.activeElement);
59
+ popover.hidePopover();
60
+ open = false;
61
+ manual = false;
62
+ helpHovered = false;
63
+ if (restoreFocus) button.focus({ preventScroll: true });
64
+ }
65
+ function position() {
66
+ if (!open) return;
67
+ const rect = button.getBoundingClientRect();
68
+ const viewport = window.visualViewport;
69
+ const leftEdge = (viewport?.offsetLeft ?? 0) + 16;
70
+ const topEdge = (viewport?.offsetTop ?? 0) + 16;
71
+ const width = Math.min(viewport?.width ?? window.innerWidth, document.documentElement.clientWidth);
72
+ const height = Math.min(viewport?.height ?? window.innerHeight, document.documentElement.clientHeight);
73
+ popover.style.maxWidth = `${Math.max(0, width - 32)}px`;
74
+ popover.style.maxHeight = `${Math.max(0, height - 32)}px`;
75
+ popover.style.setProperty('--help-max-height', `${Math.max(0, height - 32)}px`);
76
+ const box = popover.getBoundingClientRect();
77
+ const left = Math.max(leftEdge, Math.min(rect.right - box.width, leftEdge + width - 32 - box.width));
78
+ const below = rect.bottom + 12;
79
+ const top = below + box.height <= topEdge + height - 32 ? below : Math.max(topEdge, rect.top - box.height - 12);
80
+ const nextLeft = `${left}px`, nextTop = `${top}px`;
81
+ if (popover.style.left !== nextLeft || popover.style.top !== nextTop) {
82
+ popover.style.left = nextLeft;
83
+ popover.style.top = nextTop;
84
+ }
85
+ }
86
+ function requestPosition() {
87
+ if (open) window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
88
+ }
89
+ async function show(keyboard = false) {
90
+ if (!active || !enhanced || (!visible && !fullscreen)) return;
91
+ clearDelay(); clearHideDelay();
92
+ popover.showPopover();
93
+ open = true;
94
+ await tick();
95
+ if (!open || !enhanced) return;
96
+ requestPosition();
97
+ if (keyboard) closeButton.focus({ preventScroll: true });
98
+ }
99
+ function toggleHelp(event: MouseEvent) {
100
+ if (open) close();
101
+ else {
102
+ manual = true;
103
+ void show(event.detail === 0);
104
+ }
105
+ }
106
+ function schedule() {
107
+ clearDelay(); clearHideDelay();
108
+ if (!active || manual || !enhanced || !visible || modelInput.active || touchInput || guidance?.snapshot.interacted) return;
109
+ if (modelInput.hovered) {
110
+ if (!open) delay = setTimeout(() => { void show(); }, 600);
111
+ } else if (open && !helpHovered && !buttonHovered && !popover.contains(document.activeElement)) {
112
+ hideDelay = setTimeout(() => close(), 350);
113
+ }
114
+ }
115
+
116
+ onMount(() => {
117
+ // The child component can clear bind:element before this mount cleanup runs.
118
+ // Remove listeners from the same node they were registered on.
119
+ const helpButton = button;
120
+ guidance = getInteractionGuidance();
121
+ touchInput = window.matchMedia('(pointer: coarse)').matches;
122
+ const stopGuidance = guidance.subscribe((state) => {
123
+ interacted = state.interacted;
124
+ if (state.interacted) close();
125
+ });
126
+ const stage = root.closest<HTMLElement>('.stage')!;
127
+ // The summary shares the detail page with the media but lives in the
128
+ // neighbouring pane body, including the regular single-column layout.
129
+ focusAnchor = root.closest('[data-spatial-element-root]')?.querySelector<HTMLElement>('.spatial-element-panel') ?? undefined;
130
+ // Keep the non-modal help accessible when close-up hides the ordinary DOM layer.
131
+ stage.appendChild(popover);
132
+ // Measure the nearest wide panel above the hero, without relying on a host CSS class.
133
+ const top = root.getBoundingClientRect().top;
134
+ const header = Array.from(stage.querySelectorAll<HTMLElement>('[data-stage-panel-fallback]'))
135
+ .filter((node) => { const rect = node.getBoundingClientRect(); return rect.width > innerWidth * 0.4 && rect.bottom <= top && rect.height > 0; })
136
+ .sort((a, b) => b.getBoundingClientRect().bottom - a.getBoundingClientRect().bottom)[0];
137
+ const measureSpacing = () => {
138
+ if (header && !fullscreen) {
139
+ const gap = Math.max(16, root.getBoundingClientRect().top - header.getBoundingClientRect().bottom - 12);
140
+ root.style.setProperty('--model-tools-gap', `${gap}px`);
141
+ }
142
+ requestPosition();
143
+ };
144
+ measureSpacing();
145
+ const headerSize = new ResizeObserver(measureSpacing);
146
+ if (header) headerSize.observe(header);
147
+ const stageChanged = () => {
148
+ enhanced = stage.dataset.stageState === 'enhanced' && !stage.hasAttribute('data-catalog-transition');
149
+ if (!enhanced) close();
150
+ };
151
+ stageChanged();
152
+ const mutation = new MutationObserver(stageChanged);
153
+ mutation.observe(stage, { attributes: true, attributeFilter: ['data-stage-state', 'data-catalog-transition'] });
154
+ const observer = new IntersectionObserver(([entry]) => {
155
+ visible = entry.isIntersecting;
156
+ if (!visible) close();
157
+ });
158
+ observer.observe(root);
159
+ const size = new ResizeObserver(requestPosition);
160
+ size.observe(popover);
161
+ const modelChanged = (event: Event) => {
162
+ modelInput = (event as CustomEvent<ModelInputState>).detail;
163
+ if (modelInput.active) close();
164
+ schedule();
165
+ };
166
+ const inputChanged = (event: PointerEvent) => {
167
+ if (!event.isTrusted) return;
168
+ const next = event.pointerType !== 'mouse';
169
+ if (next !== touchInput) { touchInput = next; if (next) { clearDelay(); clearHideDelay(); if (!manual) close(); } }
170
+ };
171
+ const buttonEnter = (event: PointerEvent) => { buttonHovered = event.pointerType === 'mouse'; schedule(); };
172
+ const buttonLeave = () => { buttonHovered = false; schedule(); };
173
+ const keydown = (event: KeyboardEvent) => {
174
+ if (event.key === 'Escape' && open) { event.preventDefault(); close(true); }
175
+ };
176
+ const stopScroll = subscribeStageScrollFrame(() => {
177
+ if (!open) return;
178
+ const rect = helpButton.getBoundingClientRect();
179
+ if (rect.bottom < 0 || rect.top > innerHeight) close();
180
+ else requestPosition();
181
+ }, STAGE_SCROLL_PRIORITY.stage + 1);
182
+ stage.addEventListener(MODEL_INPUT_EVENT, modelChanged);
183
+ helpButton.addEventListener('pointerenter', buttonEnter);
184
+ helpButton.addEventListener('pointerleave', buttonLeave);
185
+ window.addEventListener('pointerdown', inputChanged, { capture: true, passive: true });
186
+ window.addEventListener('pointermove', inputChanged, { capture: true, passive: true });
187
+ window.addEventListener('keydown', keydown);
188
+ window.addEventListener('resize', measureSpacing, { passive: true });
189
+ window.visualViewport?.addEventListener('resize', requestPosition, { passive: true });
190
+ window.visualViewport?.addEventListener('scroll', requestPosition, { passive: true });
191
+ return () => {
192
+ // A queued focusout microtask must not restart the hover timer after teardown.
193
+ enhanced = false; visible = false;
194
+ close(); stopGuidance(); stopScroll(); mutation.disconnect(); observer.disconnect(); size.disconnect(); headerSize.disconnect();
195
+ root.appendChild(popover);
196
+ stage.removeEventListener(MODEL_INPUT_EVENT, modelChanged);
197
+ helpButton.removeEventListener('pointerenter', buttonEnter);
198
+ helpButton.removeEventListener('pointerleave', buttonLeave);
199
+ window.removeEventListener('pointerdown', inputChanged, true);
200
+ window.removeEventListener('pointermove', inputChanged, true);
201
+ window.removeEventListener('keydown', keydown);
202
+ window.removeEventListener('resize', measureSpacing);
203
+ window.visualViewport?.removeEventListener('resize', requestPosition);
204
+ window.visualViewport?.removeEventListener('scroll', requestPosition);
205
+ };
206
+ });
207
+ </script>
208
+
209
+ <div bind:this={root} class="model-tools" class:enhanced style={surfaceStyle} style:visibility={active ? undefined : 'hidden'} inert={!active} data-spatial-element-tools data-spatial-model-controls>
210
+ <div class="model-tools-buttons">
211
+ <SpatialIconButton bind:element={button} {focusAnchor} label={messages.controls.help} onclick={toggleHelp} expanded={open} controls={id} enabled={enhanced && active}>
212
+ <CircleHelp size={21} strokeWidth={1.8} aria-hidden="true" />
213
+ </SpatialIconButton>
214
+ <SpatialElementViewToggle enabled={enhanced && active} {focusAnchor} onchange={() => close()} />
215
+ </div>
216
+ {#if active && enhanced && touchInput && !interacted && !open && !fullscreen}
217
+ <p class="touch-hint" data-spatial-element-touch-hint>{help.touchHint}</p>
218
+ {/if}
219
+ <div bind:this={popover} {id} popover="auto" role="dialog" tabindex="-1" aria-modal="false" aria-labelledby={`${id}-title`}
220
+ style={surfaceStyle}
221
+ class="interaction-help" data-spatial-element-help data-surface={theme.panelTheme.surface ?? 'glass'}
222
+ onpointerenter={(event) => { helpHovered = event.pointerType === 'mouse'; schedule(); }}
223
+ onpointerleave={() => { helpHovered = false; schedule(); }}
224
+ onfocusin={clearHideDelay} onfocusout={() => { queueMicrotask(schedule); }}
225
+ ontoggle={(event) => { open = event.newState === 'open'; if (!open) { manual = false; clearHideDelay(); } }}>
226
+ <Panel class="interaction-help-panel" data-stage-fullscreen-visible nativeContent nativeLayout={position} visible={open} pointerReactive={false} focusReactive={false}
227
+ shape={{ ...theme.panelShape, radius: radii.panel, contentInset: 0 }} theme={theme.panelTheme}>
228
+ <div class="help-copy">
229
+ <div class="help-heading">
230
+ <h2 id={`${id}-title`}>{help.title}</h2>
231
+ <button bind:this={closeButton} type="button" class="close-help" onclick={() => close(true)}
232
+ aria-label={messages.controls.closeHelp} title={messages.controls.closeHelp}>
233
+ <X size={19} aria-hidden="true" />
234
+ </button>
235
+ </div>
236
+ <dl>
237
+ <div><InteractionGesture action="rotate" touch={touchInput} /><dt>{help.rotate}</dt><dd>{touchInput ? help.touchRotate : help.mouseRotate}</dd></div>
238
+ <div><InteractionGesture action="zoom" touch={touchInput} /><dt>{help.zoom}</dt><dd>{touchInput ? help.touchZoom : help.mouseZoom}</dd></div>
239
+ <div><InteractionGesture action="pan" touch={touchInput} /><dt>{help.pan}</dt><dd>{touchInput ? help.touchPan : help.mousePan}</dd></div>
240
+ </dl>
241
+ <p class="navigation-hint">
242
+ {#if touchInput}
243
+ {#if !fullscreen}{help.touchScrollHint}{/if}
244
+ {:else}
245
+ {#each help.mouseNavigationHint.split('{spacemouse}') as part, index}{#if index > 0}<a href="https://3dconnexion.com/" target="_blank" rel="noopener noreferrer">SpaceMouse</a>{/if}{part}{/each}
246
+ {/if}
247
+ </p>
248
+ </div>
249
+ </Panel>
250
+ </div>
251
+ </div>
252
+
253
+ <style>
254
+ .model-tools {
255
+ position: absolute; top: 0; right: var(--spatial-detail-fit-right);
256
+ margin: 0;
257
+ width: 128px; height: 40px; z-index: 6; visibility: hidden; pointer-events: none;
258
+ }
259
+ .model-tools.enhanced { visibility: visible; pointer-events: auto; }
260
+ .model-tools-buttons { display: flex; gap: 8px; justify-content: flex-end; }
261
+ .touch-hint {
262
+ position: absolute; right: 0; top: 48px; width: max-content; max-width: min(260px, calc(100vw - 48px));
263
+ margin: 0; padding: 8px 12px; border-radius: var(--spatial-element-control-radius); font-size: 12px; line-height: 1.45;
264
+ color: var(--spatial-element-ink); pointer-events: none;
265
+ background: color-mix(in srgb, var(--help-tint) var(--help-tint-opacity), transparent);
266
+ backdrop-filter: blur(var(--help-blur)); box-shadow: var(--help-shadow);
267
+ }
268
+ .interaction-help {
269
+ position: fixed; inset: auto; box-sizing: border-box; width: 248px;
270
+ margin: 0; padding: 0; overflow: visible;
271
+ border: 0; border-radius: var(--help-radius); color: var(--spatial-element-ink);
272
+ background: transparent;
273
+ font: inherit; font-size: 14px; line-height: 1.45; touch-action: manipulation;
274
+ }
275
+ .help-copy { box-sizing: border-box; padding: 12px 16px 16px; max-height: var(--help-max-height); overflow: auto; border-radius: var(--help-radius); }
276
+ .interaction-help::backdrop { background: transparent; pointer-events: none; }
277
+ .help-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
278
+ h2 { margin: 0; font-size: 15px; font-weight: 650; }
279
+ .close-help {
280
+ width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
281
+ padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); color: inherit; background: transparent; cursor: pointer;
282
+ }
283
+ .close-help:focus-visible { outline: 2px solid var(--spatial-element-accent); }
284
+ dl { display: grid; gap: 8px; margin: 8px 0 0; }
285
+ dl > div { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; align-items: center; }
286
+ dt { font-weight: 650; }
287
+ /* Keep complete host-localized instructions available to assistive technology. */
288
+ dd { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
289
+ .navigation-hint { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid currentColor; font-size: 12px; }
290
+ .navigation-hint a { color: var(--spatial-element-accent); text-decoration: underline; text-underline-offset: 2px; }
291
+ .navigation-hint a:focus-visible { outline: 2px solid var(--spatial-element-accent); outline-offset: 3px; border-radius: 2px; }
292
+ </style>
@@ -0,0 +1,6 @@
1
+ type $$ComponentProps = {
2
+ active?: boolean;
3
+ };
4
+ declare const SpatialElementHelp: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type SpatialElementHelp = ReturnType<typeof SpatialElementHelp>;
6
+ export default SpatialElementHelp;