@spatial-elements/sveltekit 0.1.0-beta.2 → 1.0.0-beta.4
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.
- package/README.md +11 -3
- package/dist/catalog/catalogNavigation.js +3 -2
- package/dist/spatial-element/BrandStageShell.svelte +17 -12
- package/dist/spatial-element/BrandStageShell.svelte.d.ts +11 -4
- package/dist/spatial-element/CarouselSection.svelte +184 -38
- package/dist/spatial-element/CarouselSection.svelte.d.ts +5 -0
- package/dist/spatial-element/CarouselSpatialElement.svelte +7 -3
- package/dist/spatial-element/ContentPage.svelte +11 -1
- package/dist/spatial-element/ContentPage.svelte.d.ts +7 -3
- package/dist/spatial-element/InteractionGesture.svelte +39 -0
- package/dist/spatial-element/InteractionGesture.svelte.d.ts +7 -0
- package/dist/spatial-element/ListSection.svelte +11 -3
- package/dist/spatial-element/ListSection.svelte.d.ts +5 -3
- package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +3 -1
- package/dist/spatial-element/SpatialElementCard.svelte +2 -2
- package/dist/spatial-element/SpatialElementHelp.svelte +277 -0
- package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +3 -0
- package/dist/spatial-element/SpatialElementMediaRail.svelte +1 -1
- package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +1 -1
- package/dist/spatial-element/SpatialElementPage.svelte +25 -8
- package/dist/spatial-element/SpatialElementPage.svelte.d.ts +5 -3
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +42 -37
- package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +2 -1
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +60 -55
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +1 -1
- package/dist/spatial-element/SpatialElementTabList.svelte +3 -1
- package/dist/spatial-element/SpatialIconButton.svelte +56 -0
- package/dist/spatial-element/SpatialIconButton.svelte.d.ts +14 -0
- package/dist/spatial-element/SpatialListPage.svelte +4 -1
- package/dist/spatial-element/SpatialListPage.svelte.d.ts +2 -0
- package/dist/spatial-element/index.d.ts +5 -1
- package/dist/spatial-element/index.js +3 -0
- package/dist/spatial-element/messagesContext.d.ts +3 -0
- package/dist/spatial-element/messagesContext.js +10 -0
- package/dist/spatial-element/spatialPageContext.d.ts +4 -0
- package/dist/spatial-element/spatialPageContext.js +9 -0
- package/dist/stage/Panel.svelte +30 -2
- package/dist/stage/Panel.svelte.d.ts +12 -2
- package/dist/stage/Stage.svelte +97 -17
- package/dist/stage/Stage.svelte.d.ts +5 -1
- package/package.json +4 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
3
|
+
import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
|
|
3
4
|
import { ShoppingCart } from 'lucide-svelte';
|
|
4
5
|
import Panel from '../stage/Panel.svelte';
|
|
5
6
|
import { useSpatialTheme } from './brandContext.js';
|
|
6
|
-
import type { SpatialElementData } from '@spatial-elements/core/spatial-element/
|
|
7
|
+
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
7
8
|
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
8
9
|
|
|
9
10
|
let { spatialElement }: { spatialElement: SpatialElementData } = $props();
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
data-shared-role="summary-surface"
|
|
30
31
|
data-spatial-element-id={spatialElement.id}
|
|
31
32
|
>
|
|
32
|
-
<div class="summary-presentation">
|
|
33
|
+
<div class="summary-presentation" use:mouseHover>
|
|
33
34
|
<div class="panel-copy">
|
|
34
35
|
<p
|
|
35
36
|
class="panel-kicker"
|
|
@@ -82,55 +83,57 @@
|
|
|
82
83
|
{/each}
|
|
83
84
|
</ul>
|
|
84
85
|
|
|
85
|
-
{#if spatialElement.action
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
86
|
+
{#if spatialElement.action}
|
|
87
|
+
{#if spatialElement.action.href}
|
|
88
|
+
<a
|
|
89
|
+
use:catalogEndpoint={{
|
|
90
|
+
brandId: theme.id,
|
|
91
|
+
spatialElementId: spatialElement.id,
|
|
92
|
+
slot: 'detail.summary',
|
|
93
|
+
role: 'primary-action'
|
|
94
|
+
}}
|
|
95
|
+
data-catalog-rich-shared="primary-action"
|
|
96
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
97
|
+
class="spatial-element-action spatial-element-action-expanded"
|
|
98
|
+
href={spatialElement.action.href}
|
|
99
|
+
rel="external"
|
|
100
|
+
aria-label={spatialElement.action.ariaLabel}
|
|
101
|
+
>
|
|
102
|
+
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
103
|
+
<ShoppingCart
|
|
104
|
+
class="spatial-element-action-icon"
|
|
105
|
+
size={27}
|
|
106
|
+
strokeWidth={2}
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
/>
|
|
109
|
+
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
110
|
+
</span>
|
|
111
|
+
</a>
|
|
112
|
+
{:else}
|
|
113
|
+
<button
|
|
114
|
+
use:catalogEndpoint={{
|
|
115
|
+
brandId: theme.id,
|
|
116
|
+
spatialElementId: spatialElement.id,
|
|
117
|
+
slot: 'detail.summary',
|
|
118
|
+
role: 'primary-action'
|
|
119
|
+
}}
|
|
120
|
+
data-catalog-rich-shared="primary-action"
|
|
121
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
122
|
+
class="spatial-element-action spatial-element-action-expanded"
|
|
123
|
+
type="button"
|
|
124
|
+
aria-label={spatialElement.action.ariaLabel}
|
|
125
|
+
>
|
|
126
|
+
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
127
|
+
<ShoppingCart
|
|
128
|
+
class="spatial-element-action-icon"
|
|
129
|
+
size={27}
|
|
130
|
+
strokeWidth={2}
|
|
131
|
+
aria-hidden="true"
|
|
132
|
+
/>
|
|
133
|
+
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
134
|
+
</span>
|
|
135
|
+
</button>
|
|
136
|
+
{/if}
|
|
134
137
|
{/if}
|
|
135
138
|
</div>
|
|
136
139
|
</Panel>
|
|
@@ -262,7 +265,7 @@
|
|
|
262
265
|
will-change: transform;
|
|
263
266
|
}
|
|
264
267
|
|
|
265
|
-
.feature-list li:hover .feature-content {
|
|
268
|
+
.summary-presentation:global([data-mouse-hover]) .feature-list li:hover .feature-content {
|
|
266
269
|
--summary-feature-hover-progress: 1;
|
|
267
270
|
}
|
|
268
271
|
|
|
@@ -285,7 +288,8 @@
|
|
|
285
288
|
transform-style: preserve-3d;
|
|
286
289
|
}
|
|
287
290
|
|
|
288
|
-
.spatial-element-action:
|
|
291
|
+
.summary-presentation:global([data-mouse-hover]) .spatial-element-action:hover .spatial-element-action-surface,
|
|
292
|
+
.spatial-element-action:focus-visible .spatial-element-action-surface {
|
|
289
293
|
--summary-action-hover-progress: 1;
|
|
290
294
|
}
|
|
291
295
|
|
|
@@ -406,9 +410,10 @@
|
|
|
406
410
|
}
|
|
407
411
|
|
|
408
412
|
.feature-content,
|
|
409
|
-
.feature-list li:hover .feature-content,
|
|
413
|
+
.summary-presentation:global([data-mouse-hover]) .feature-list li:hover .feature-content,
|
|
410
414
|
.spatial-element-action-surface,
|
|
411
|
-
.spatial-element-action:
|
|
415
|
+
.summary-presentation:global([data-mouse-hover]) .spatial-element-action:hover .spatial-element-action-surface,
|
|
416
|
+
.spatial-element-action:focus-visible .spatial-element-action-surface {
|
|
412
417
|
--summary-feature-hover-progress: 0;
|
|
413
418
|
--summary-action-hover-progress: 0;
|
|
414
419
|
transition: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SpatialElementData } from '@spatial-elements/core/spatial-element/
|
|
1
|
+
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
spatialElement: SpatialElementData;
|
|
4
4
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
+
import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
|
|
3
4
|
import {
|
|
4
5
|
STAGE_ANCHOR_SCROLL_DURATION_MS,
|
|
5
6
|
STAGE_ANCHOR_SCROLL_EASING
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
</script>
|
|
82
83
|
|
|
83
84
|
<nav
|
|
85
|
+
use:mouseHover
|
|
84
86
|
class="spatial-element-tab-list"
|
|
85
87
|
data-spatial-element-tab-list={variant}
|
|
86
88
|
aria-label="Elementbereiche"
|
|
@@ -218,7 +220,7 @@
|
|
|
218
220
|
visibility: hidden;
|
|
219
221
|
}
|
|
220
222
|
|
|
221
|
-
a:hover:not([aria-current='location']) {
|
|
223
|
+
.spatial-element-tab-list:global([data-mouse-hover]) a:hover:not([aria-current='location']) {
|
|
222
224
|
background: color-mix(in srgb, var(--spatial-element-body) 8%, transparent);
|
|
223
225
|
}
|
|
224
226
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
|
|
4
|
+
import Panel from '../stage/Panel.svelte';
|
|
5
|
+
import { useSpatialTheme } from './brandContext.js';
|
|
6
|
+
|
|
7
|
+
let { label, children, onclick, expanded, controls, focusAnchor, enabled = true, element = $bindable() }: {
|
|
8
|
+
label: string;
|
|
9
|
+
children: Snippet;
|
|
10
|
+
onclick: (event: MouseEvent) => void;
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
controls?: string;
|
|
13
|
+
focusAnchor?: HTMLElement;
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
element?: HTMLButtonElement;
|
|
16
|
+
} = $props();
|
|
17
|
+
const theme = useSpatialTheme();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class="icon-frame">
|
|
21
|
+
<Panel
|
|
22
|
+
class="spatial-icon-panel"
|
|
23
|
+
shape={{ radius: Math.min(12, theme.panelShape.radius), contentInset: 0 }}
|
|
24
|
+
theme={theme.panelTheme}
|
|
25
|
+
pointerReactive={false}
|
|
26
|
+
focusReactive="top-right"
|
|
27
|
+
{focusAnchor}
|
|
28
|
+
transitionGroup="enter"
|
|
29
|
+
>
|
|
30
|
+
<!-- Keep visibility on the button: Panel's content style also holds renderer positioning. -->
|
|
31
|
+
<button bind:this={element} use:mouseHover type="button" {onclick} aria-label={label} title={label}
|
|
32
|
+
disabled={!enabled}
|
|
33
|
+
style:visibility={enabled ? 'visible' : 'hidden'}
|
|
34
|
+
aria-expanded={expanded} aria-controls={controls} aria-haspopup={controls ? 'dialog' : undefined}
|
|
35
|
+
class="spatial-icon-button">
|
|
36
|
+
{@render children()}
|
|
37
|
+
</button>
|
|
38
|
+
</Panel>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
.icon-frame { width: 40px; height: 40px; flex: 0 0 40px; }
|
|
43
|
+
/* The renderer moves panel contents into its projection layer; retain the anchor size. */
|
|
44
|
+
.icon-frame :global(.spatial-icon-panel) { width: 40px; height: 40px; }
|
|
45
|
+
.spatial-icon-button {
|
|
46
|
+
box-sizing: border-box; display: grid; place-items: center; width: 40px; height: 40px;
|
|
47
|
+
padding: 0; border: 0; border-radius: min(12px, var(--spatial-element-panel-radius)); background: transparent;
|
|
48
|
+
color: var(--spatial-element-ink); cursor: pointer; touch-action: manipulation;
|
|
49
|
+
transition: background-color 180ms ease;
|
|
50
|
+
}
|
|
51
|
+
.spatial-icon-button:global([data-mouse-hover]):hover {
|
|
52
|
+
background: color-mix(in srgb, var(--spatial-element-body) 8%, transparent);
|
|
53
|
+
}
|
|
54
|
+
.spatial-icon-button:focus-visible { outline: 2px solid var(--spatial-element-accent); outline-offset: 3px; }
|
|
55
|
+
@media (prefers-reduced-motion: reduce) { .spatial-icon-button { transition: none; } }
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
onclick: (event: MouseEvent) => void;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
controls?: string;
|
|
8
|
+
focusAnchor?: HTMLElement;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
element?: HTMLButtonElement;
|
|
11
|
+
};
|
|
12
|
+
declare const SpatialIconButton: import("svelte").Component<$$ComponentProps, {}, "element">;
|
|
13
|
+
type SpatialIconButton = ReturnType<typeof SpatialIconButton>;
|
|
14
|
+
export default SpatialIconButton;
|
|
@@ -6,16 +6,19 @@
|
|
|
6
6
|
import type { SpatialListItem, ContentPageData } from '@spatial-elements/core/spatial-element/types';
|
|
7
7
|
let {
|
|
8
8
|
spatialElements,
|
|
9
|
+
hdr,
|
|
9
10
|
sectionLink,
|
|
10
11
|
...page
|
|
11
12
|
}: ContentPageData & {
|
|
13
|
+
/** Explicit environment for the collection. */
|
|
14
|
+
hdr: string;
|
|
12
15
|
spatialElements: SpatialListItem[];
|
|
13
16
|
sectionLink?: { href: string; label: string };
|
|
14
17
|
} = $props();
|
|
15
18
|
const { href } = useCatalogNavigation();
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
|
-
<ContentPage {page}>
|
|
21
|
+
<ContentPage {page} {hdr}>
|
|
19
22
|
<ListSection section={{ id: 'elements', title: 'Elements' }} list={spatialElements} />
|
|
20
23
|
{#if sectionLink}<Section section={{ id: 'more', title: 'More information' }}
|
|
21
24
|
><a href={href(sectionLink.href)}>{sectionLink.label}</a></Section
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { SpatialListItem, ContentPageData } from '@spatial-elements/core/spatial-element/types';
|
|
2
2
|
type $$ComponentProps = ContentPageData & {
|
|
3
|
+
/** Explicit environment for the collection. */
|
|
4
|
+
hdr: string;
|
|
3
5
|
spatialElements: SpatialListItem[];
|
|
4
6
|
sectionLink?: {
|
|
5
7
|
href: string;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export { default as BrandStageShell } from './BrandStageShell.svelte';
|
|
2
|
+
export { defaultSpatialMessages, resolveSpatialMessages, type SpatialMessages, type SpatialMessagesInput } from '@spatial-elements/core/spatial-element/messages';
|
|
2
3
|
export { default as SpatialElementPage } from './SpatialElementPage.svelte';
|
|
3
4
|
export { default as SpatialListPage } from './SpatialListPage.svelte';
|
|
4
5
|
export { default as Section } from './Section.svelte';
|
|
5
6
|
export { findSpatialElement, getSpatialListItems } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
6
|
-
export type { SpatialElementAction, SpatialTheme, SpatialElementBreadcrumb, SpatialElementData, SpatialDockedPanelTheme, SpatialElementFeature, SpatialElementMediaItem, SpatialMinimapTheme, SpatialListItem, SpatialElementSectionDefinition, SpatialElementSectionNavigationItem, SpatialElementSectionStyle, SpatialSectionTheme
|
|
7
|
+
export type { SpatialElementAction, SpatialTheme, SpatialElementBreadcrumb, SpatialElementData, SpatialDockedPanelTheme, SpatialElementFeature, SpatialElementMediaItem, SpatialMinimapTheme, SpatialListItem, SpatialElementSectionDefinition, SpatialElementSectionNavigationItem, SpatialElementSectionStyle, SpatialSectionTheme } from '@spatial-elements/core/spatial-element/types';
|
|
7
8
|
export { default as ContentPage } from './ContentPage.svelte';
|
|
8
9
|
export { default as CarouselSection } from './CarouselSection.svelte';
|
|
9
10
|
export { default as ListSection } from './ListSection.svelte';
|
|
10
11
|
export type { ContentPageData } from '@spatial-elements/core/spatial-element/types';
|
|
11
12
|
export type { CarouselPresentation } from '@spatial-elements/core/catalog/catalogPose';
|
|
13
|
+
export { createSpatialTheme, type SpatialThemeOptions } from '@spatial-elements/core/spatial-element/spatialTheme';
|
|
14
|
+
export type { StageRenderSettings, BackgroundSettings, StageModelSettings, StageCameraSettings } from '@spatial-elements/core/stage/stageTypes';
|
|
15
|
+
export { geometryFromLodPair, type SpatialElementGeometry } from '@spatial-elements/core/spatial-element/spatialElementGeometry';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as BrandStageShell } from './BrandStageShell.svelte';
|
|
2
|
+
export { defaultSpatialMessages, resolveSpatialMessages } from '@spatial-elements/core/spatial-element/messages';
|
|
2
3
|
export { default as SpatialElementPage } from './SpatialElementPage.svelte';
|
|
3
4
|
export { default as SpatialListPage } from './SpatialListPage.svelte';
|
|
4
5
|
export { default as Section } from './Section.svelte';
|
|
@@ -6,3 +7,5 @@ export { findSpatialElement, getSpatialListItems } from '@spatial-elements/core/
|
|
|
6
7
|
export { default as ContentPage } from './ContentPage.svelte';
|
|
7
8
|
export { default as CarouselSection } from './CarouselSection.svelte';
|
|
8
9
|
export { default as ListSection } from './ListSection.svelte';
|
|
10
|
+
export { createSpatialTheme } from '@spatial-elements/core/spatial-element/spatialTheme';
|
|
11
|
+
export { geometryFromLodPair } from '@spatial-elements/core/spatial-element/spatialElementGeometry';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type SpatialMessagesInput } from '@spatial-elements/core/spatial-element/messages';
|
|
2
|
+
export declare function provideSpatialMessages(read: () => SpatialMessagesInput | undefined): void;
|
|
3
|
+
export declare function useSpatialMessages(): () => import("@spatial-elements/core").SpatialMessages;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getContext, setContext } from 'svelte';
|
|
2
|
+
import { resolveSpatialMessages } from '@spatial-elements/core/spatial-element/messages';
|
|
3
|
+
const MESSAGES = Symbol('spatial-messages');
|
|
4
|
+
export function provideSpatialMessages(read) {
|
|
5
|
+
setContext(MESSAGES, read);
|
|
6
|
+
}
|
|
7
|
+
export function useSpatialMessages() {
|
|
8
|
+
const read = getContext(MESSAGES);
|
|
9
|
+
return () => resolveSpatialMessages(read?.());
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SpatialPage } from '@spatial-elements/core/catalog/SpatialPageRegistry';
|
|
2
|
+
export declare const SPATIAL_PAGE: unique symbol;
|
|
3
|
+
/** Register at mount: SSR renders the semantic page directly, GPU ownership starts in the browser. */
|
|
4
|
+
export declare function registerSpatialPage(read: () => SpatialPage): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getContext, onMount } from 'svelte';
|
|
2
|
+
export const SPATIAL_PAGE = Symbol('spatial-page');
|
|
3
|
+
/** Register at mount: SSR renders the semantic page directly, GPU ownership starts in the browser. */
|
|
4
|
+
export function registerSpatialPage(read) {
|
|
5
|
+
const pages = getContext(SPATIAL_PAGE);
|
|
6
|
+
if (!pages)
|
|
7
|
+
throw new Error('Spatial pages must be rendered inside BrandStageShell or Stage.');
|
|
8
|
+
onMount(() => pages.register(read));
|
|
9
|
+
}
|
package/dist/stage/Panel.svelte
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
6
|
import {
|
|
7
7
|
STAGE_CONTEXT_KEY,
|
|
8
|
+
STAGE_PANEL_LAYOUT_EVENT,
|
|
8
9
|
type StageContext,
|
|
9
10
|
|
|
10
11
|
type StagePanelMinimapOptions,
|
|
@@ -23,8 +24,18 @@
|
|
|
23
24
|
class?: string;
|
|
24
25
|
contentClass?: string;
|
|
25
26
|
minimap?: boolean | StagePanelMinimapOptions;
|
|
26
|
-
/**
|
|
27
|
-
pointerReactive?: boolean;
|
|
27
|
+
/** true: proximity lift and tilt; 'lift': a 2px mouse-hover lift without tilt; false: still. */
|
|
28
|
+
pointerReactive?: boolean | 'lift';
|
|
29
|
+
/** false keeps the pose; 'top-right' reaches the corner as the surrounding UI clears. */
|
|
30
|
+
focusReactive?: boolean | 'top-right';
|
|
31
|
+
/** Optional neighbouring panel frame whose top-left corner moves with a 'top-right' control. */
|
|
32
|
+
focusAnchor?: HTMLElement;
|
|
33
|
+
/** Retain native DOM layout, including popover semantics, while rendering the glass surface. */
|
|
34
|
+
nativeContent?: boolean;
|
|
35
|
+
/** Position native content in the stage render frame, after projected anchors have moved. */
|
|
36
|
+
nativeLayout?: () => void;
|
|
37
|
+
/** Visibility of an optional native-content panel. */
|
|
38
|
+
visible?: boolean;
|
|
28
39
|
pose?: StagePanelPose;
|
|
29
40
|
shape: StagePanelShape;
|
|
30
41
|
surface?: StagePanelSurface;
|
|
@@ -39,6 +50,11 @@
|
|
|
39
50
|
contentClass = '',
|
|
40
51
|
minimap = false,
|
|
41
52
|
pointerReactive = true,
|
|
53
|
+
focusReactive = true,
|
|
54
|
+
focusAnchor,
|
|
55
|
+
nativeContent = false,
|
|
56
|
+
nativeLayout,
|
|
57
|
+
visible = true,
|
|
42
58
|
pose,
|
|
43
59
|
shape,
|
|
44
60
|
style: contentStyle = '',
|
|
@@ -66,6 +82,11 @@
|
|
|
66
82
|
getFrameElement: () => frameElement,
|
|
67
83
|
getSurfaceElement: () => surfaceElement,
|
|
68
84
|
getPointerReactive: () => pointerReactive,
|
|
85
|
+
getFocusReactive: () => focusReactive,
|
|
86
|
+
getFocusAnchor: () => focusAnchor,
|
|
87
|
+
getNativeContent: () => nativeContent,
|
|
88
|
+
updateNativeLayout: () => nativeLayout?.(),
|
|
89
|
+
getVisible: () => visible,
|
|
69
90
|
getMinimapOptions: () => getMinimapOptions(),
|
|
70
91
|
getMinimapDockProgress,
|
|
71
92
|
getMinimapModelScale,
|
|
@@ -76,6 +97,12 @@
|
|
|
76
97
|
});
|
|
77
98
|
|
|
78
99
|
onDestroy(unregister);
|
|
100
|
+
$effect(() => {
|
|
101
|
+
if (nativeContent) {
|
|
102
|
+
void visible;
|
|
103
|
+
window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
|
|
104
|
+
}
|
|
105
|
+
});
|
|
79
106
|
|
|
80
107
|
onMount(() => {
|
|
81
108
|
if (!getMinimapOptions()) return;
|
|
@@ -220,6 +247,7 @@
|
|
|
220
247
|
<div
|
|
221
248
|
bind:this={frameElement}
|
|
222
249
|
data-stage-panel-fallback
|
|
250
|
+
data-stage-panel-native-content={nativeContent ? '' : undefined}
|
|
223
251
|
data-catalog-transition-group={transitionGroup}
|
|
224
252
|
data-stage-panel-minimap={minimap ? '' : undefined}
|
|
225
253
|
data-stage-minimap-docked-view-scale={getMinimapOptions()?.dockedView?.scale}
|
|
@@ -10,8 +10,18 @@ type Props = Omit<StagePanelAttributes, 'class'> & {
|
|
|
10
10
|
class?: string;
|
|
11
11
|
contentClass?: string;
|
|
12
12
|
minimap?: boolean | StagePanelMinimapOptions;
|
|
13
|
-
/**
|
|
14
|
-
pointerReactive?: boolean;
|
|
13
|
+
/** true: proximity lift and tilt; 'lift': a 2px mouse-hover lift without tilt; false: still. */
|
|
14
|
+
pointerReactive?: boolean | 'lift';
|
|
15
|
+
/** false keeps the pose; 'top-right' reaches the corner as the surrounding UI clears. */
|
|
16
|
+
focusReactive?: boolean | 'top-right';
|
|
17
|
+
/** Optional neighbouring panel frame whose top-left corner moves with a 'top-right' control. */
|
|
18
|
+
focusAnchor?: HTMLElement;
|
|
19
|
+
/** Retain native DOM layout, including popover semantics, while rendering the glass surface. */
|
|
20
|
+
nativeContent?: boolean;
|
|
21
|
+
/** Position native content in the stage render frame, after projected anchors have moved. */
|
|
22
|
+
nativeLayout?: () => void;
|
|
23
|
+
/** Visibility of an optional native-content panel. */
|
|
24
|
+
visible?: boolean;
|
|
15
25
|
pose?: StagePanelPose;
|
|
16
26
|
shape: StagePanelShape;
|
|
17
27
|
surface?: StagePanelSurface;
|