@spatial-elements/sveltekit 1.0.0-beta.15 → 1.0.0-beta.19
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 +1 -1
- package/dist/catalog/ScrollNavigationBridge.svelte +5 -1
- package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +1 -1
- package/dist/catalog/stagedCatalogNavigation.d.ts +1 -1
- package/dist/spatial-element/BrandStageShell.svelte +27 -2
- package/dist/spatial-element/BrandStageShell.svelte.d.ts +2 -0
- package/dist/spatial-element/CarouselSpatialElement.svelte +7 -7
- package/dist/spatial-element/ContentPage.svelte +11 -2
- package/dist/spatial-element/ContentPage.svelte.d.ts +7 -0
- package/dist/spatial-element/OverflowControls.svelte +6 -6
- package/dist/spatial-element/PointerHint.svelte +5 -4
- package/dist/spatial-element/Section.svelte +1 -1
- package/dist/spatial-element/SpaceMouseControl.svelte +4 -4
- package/dist/spatial-element/SpatialCardGridSection.svelte +6 -9
- package/dist/spatial-element/SpatialCardPresentation.svelte +139 -32
- package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +2 -2
- package/dist/spatial-element/SpatialCardSlot.svelte +1 -1
- package/dist/spatial-element/SpatialCarouselSection.svelte +10 -2
- package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +1 -1
- package/dist/spatial-element/SpatialElementCard.svelte +7 -13
- package/dist/spatial-element/SpatialElementCard.svelte.d.ts +2 -2
- package/dist/spatial-element/SpatialElementHelp.svelte +7 -5
- package/dist/spatial-element/SpatialElementMediaRail.svelte +2 -1
- package/dist/spatial-element/SpatialElementPage.svelte +1 -1
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +29 -5
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +16 -8
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +4 -0
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +17 -2
- package/dist/spatial-element/SpatialElementTabList.svelte +32 -10
- package/dist/spatial-element/SpatialIconButton.svelte +2 -0
- package/dist/spatial-element/SpatialListPage.svelte +2 -2
- package/dist/spatial-element/SpatialNavigationShell.svelte +12 -45
- package/dist/spatial-element/SpatialSummaryHost.svelte +1 -1
- package/dist/spatial-element/SpatialSummaryRoot.svelte +33 -10
- package/dist/spatial-element/SpatialSummarySlot.svelte +1 -1
- package/dist/spatial-element/cardAppearanceFreeze.js +11 -8
- package/dist/spatial-element/carouselTextHit.js +2 -1
- package/dist/spatial-element/contentSidebars.js +15 -7
- package/dist/spatial-element/index.d.ts +2 -2
- package/dist/spatial-element/layout.generated.css +41 -17
- package/dist/spatial-element/spatialCardGrid.d.ts +3 -3
- package/dist/spatial-element/spatialSummary.d.ts +8 -2
- package/dist/spatial-element/spatialThemeStyle.js +7 -4
- package/dist/stage/ButtonGroup.svelte +2 -0
- package/dist/stage/Panel.svelte +11 -3
- package/dist/stage/Panel.svelte.d.ts +2 -0
- package/dist/stage/Stage.svelte +14 -4
- package/dist/stage/panelShadowStyle.d.ts +3 -0
- package/dist/stage/panelShadowStyle.js +11 -0
- package/package.json +9 -9
|
@@ -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(
|
|
151
|
-
--spatial-carousel-fit-left:
|
|
152
|
-
--spatial-carousel-fit-width:
|
|
153
|
-
--spatial-carousel-summary-left:
|
|
154
|
-
--spatial-carousel-summary-width: calc(100% -
|
|
155
|
-
--spatial-carousel-title-reserve:
|
|
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(
|
|
165
|
-
--spatial-carousel-fit-left:
|
|
166
|
-
--spatial-carousel-fit-width:
|
|
167
|
-
--spatial-carousel-summary-left:
|
|
168
|
-
--spatial-carousel-summary-width: calc(100% -
|
|
169
|
-
--spatial-carousel-title-reserve:
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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,
|
|
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
|
-
|
|
5
|
+
cardShadow?: boolean;
|
|
6
6
|
cardTone?: SurfaceTone;
|
|
7
7
|
textAlign?: 'start' | 'center';
|
|
8
8
|
mediaAspect?: CardMediaAspect;
|
|
9
9
|
mediaFit?: CardMediaFit;
|
|
10
|
-
/**
|
|
10
|
+
/** Optional explicit grid span. Omit to use the responsive cardSize allocation. */
|
|
11
11
|
itemSpan?: ContentSpan;
|
|
12
12
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import type { CardMediaAspect, CardMediaFit,
|
|
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';
|
|
5
5
|
import type { SpatialListItem } from '@spatial-elements/core/spatial-element/types';
|
|
6
6
|
import type { SpatialCardSize } from '@spatial-elements/core/spatial-element/responsiveLayout';
|
|
7
7
|
export interface SpatialSummaryContext {
|
|
8
|
+
/** Optional controls for this detail instance. Not supplied in collections. */
|
|
9
|
+
model?: {
|
|
10
|
+
sequence: import('@spatial-elements/core').SpatialModelSequenceControls;
|
|
11
|
+
};
|
|
8
12
|
spatialElement: Pick<ResolvedSpatialElementData, 'id' | 'brandId' | 'title' | 'eyebrow' | 'features' | 'action'>;
|
|
13
|
+
/** Canonical detail link, retained when the live summary moves between placements. */
|
|
14
|
+
detailHref?: string;
|
|
9
15
|
mode: 'detail' | 'carousel';
|
|
10
16
|
heading: 'h1' | 'h3';
|
|
11
17
|
contentInset: number;
|
|
@@ -30,7 +36,7 @@ export interface SpatialCardContext {
|
|
|
30
36
|
mediaFit?: CardMediaFit;
|
|
31
37
|
reserveEyebrow?: boolean;
|
|
32
38
|
cardTone?: SurfaceTone;
|
|
33
|
-
|
|
39
|
+
cardShadow?: boolean;
|
|
34
40
|
}
|
|
35
41
|
export type SpatialPresentationModel = {
|
|
36
42
|
kind: 'summary';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveSpatialSectionBackgrounds, resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
|
|
2
|
-
import {
|
|
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,12 @@ 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-panel-background: rgb(${getDockedPanelTintRgb(theme.panelTheme.tint ?? '#ffffff')})`,
|
|
20
|
+
`--ps-panel-tint-opacity: ${clamp(theme.panelTheme.tintOpacity ?? 0.65, 0, 1)}`,
|
|
21
|
+
`--ps-panel-backdrop-blur: ${clamp(theme.panelTheme.backdropBlur ?? 8, 0, 100)}px`,
|
|
22
|
+
`--ps-selection: ${theme.colors.tabBackground}`,
|
|
18
23
|
`--ps-scroll-offset: var(--spatial-element-section-scroll-offset, 150px)`,
|
|
19
24
|
`--spatial-element-background: ${theme.background}`,
|
|
20
25
|
`--spatial-element-ink: ${theme.colors.ink}`,
|
|
@@ -32,12 +37,10 @@ export function getSpatialThemeStyle(theme) {
|
|
|
32
37
|
`--spatial-element-panel-tint-rgb: ${getDockedPanelTintRgb(theme.panelTheme.tint ?? '#ffffff')}`,
|
|
33
38
|
`--spatial-element-panel-tint-opacity: ${clamp(theme.panelTheme.tintOpacity ?? 0.65, 0, 1)}`,
|
|
34
39
|
`--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
40
|
`--spatial-element-docked-panel-tint-rgb: ${getDockedPanelTintRgb(theme.dockedPanelTheme.tint)}`,
|
|
37
41
|
`--spatial-element-docked-panel-tint-opacity: ${clamp(theme.dockedPanelTheme.tintOpacity, 0, 1)}`,
|
|
38
42
|
`--spatial-element-docked-panel-shadow-intensity: ${clamp(theme.dockedPanelTheme.shadowIntensity, 0, 1)}`,
|
|
39
43
|
`--spatial-element-docked-panel-shadow-strength: ${resolvePanelShadowStrength(theme.dockedPanelTheme.shadowIntensity)}`,
|
|
40
|
-
`--spatial-element-docked-panel-box-shadow: ${getCssPanelBoxShadow(theme.dockedPanelTheme.shadowIntensity)}`,
|
|
41
44
|
`--spatial-element-docked-panel-backdrop-blur: ${clamp(theme.dockedPanelTheme.backdropBlur, 0, 100)}px`
|
|
42
45
|
].join('; ');
|
|
43
46
|
}
|
|
@@ -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;
|
package/dist/stage/Panel.svelte
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
type StagePanelShape,
|
|
15
15
|
type StagePanelTheme
|
|
16
16
|
} from '@spatial-elements/core/stage/panelContext';
|
|
17
|
-
import {
|
|
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: ${
|
|
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';
|
package/dist/stage/Stage.svelte
CHANGED
|
@@ -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 '
|
|
66
|
+
import type { BeforeNavigate, OnNavigate } from '$app/navigation';
|
|
66
67
|
import {
|
|
67
68
|
STAGE_CONTEXT_KEY,
|
|
68
69
|
STAGE_PANEL_LAYOUT_EVENT,
|
|
@@ -248,7 +249,11 @@
|
|
|
248
249
|
minimapFocus: 0
|
|
249
250
|
};
|
|
250
251
|
|
|
252
|
+
let modelSequenceState = $state<{ key?: string; state?: import('@spatial-elements/core').SpatialModelSequenceState }>({});
|
|
253
|
+
const sequenceOptions = () => activeElement?.modelSequence ? { ...activeElement.modelSequence, key: `${catalog?.brandId}:${activeElement.id}` } : undefined;
|
|
251
254
|
setContext<StageContext>(STAGE_CONTEXT_KEY, {
|
|
255
|
+
getModelSequence: (key) => modelSequenceState.key === key ? modelSequenceState.state : undefined,
|
|
256
|
+
setModelSequenceStep: (key, step) => experience?.setModelSequenceStep(key, step) ?? false,
|
|
252
257
|
registerDetailMedia(read) {
|
|
253
258
|
const owner = Symbol(); detailMediaOwner = owner; readDetailMedia = read;
|
|
254
259
|
return () => { if (detailMediaOwner === owner) { detailMediaOwner = undefined; readDetailMedia = undefined; } };
|
|
@@ -383,6 +388,7 @@
|
|
|
383
388
|
hdr,
|
|
384
389
|
glb,
|
|
385
390
|
lodPair,
|
|
391
|
+
modelSequence: sequenceOptions(),
|
|
386
392
|
model,
|
|
387
393
|
camera,
|
|
388
394
|
interactionTheme,
|
|
@@ -420,7 +426,8 @@
|
|
|
420
426
|
},
|
|
421
427
|
onZoomFocusChange: (focusState) => {
|
|
422
428
|
setZoomFocusState(focusState);
|
|
423
|
-
}
|
|
429
|
+
},
|
|
430
|
+
onModelSequenceChange: (key, state) => { modelSequenceState = { key, state }; }
|
|
424
431
|
});
|
|
425
432
|
experience = instance;
|
|
426
433
|
await instance.init();
|
|
@@ -495,6 +502,7 @@
|
|
|
495
502
|
Object.values(interactionTheme ?? {});
|
|
496
503
|
scheduleAppearanceUpdate();
|
|
497
504
|
});
|
|
505
|
+
onMount(() => observePanelShadowStyles(stage, scheduleAppearanceUpdate));
|
|
498
506
|
let appearanceUpdatePending = false;
|
|
499
507
|
function scheduleAppearanceUpdate() {
|
|
500
508
|
if (appearanceUpdatePending) return;
|
|
@@ -711,6 +719,7 @@
|
|
|
711
719
|
hdr,
|
|
712
720
|
glb,
|
|
713
721
|
lodPair,
|
|
722
|
+
modelSequence: sequenceOptions(),
|
|
714
723
|
model,
|
|
715
724
|
camera,
|
|
716
725
|
interactionTheme,
|
|
@@ -911,7 +920,7 @@
|
|
|
911
920
|
updateNativeLayout: panel.updateNativeLayout,
|
|
912
921
|
nativeContent: panel.getNativeContent?.() ?? false,
|
|
913
922
|
minimap: panel.getMinimapOptions(),
|
|
914
|
-
options: panel.getOptions(),
|
|
923
|
+
options: panel.getSurface() === 'glass' ? withSharedPanelShadow(surfaceElement, panel.getOptions()) : panel.getOptions(),
|
|
915
924
|
surface: panel.getSurface(),
|
|
916
925
|
surfaceElement,
|
|
917
926
|
pointerReactive: panel.getPointerReactive(),
|
|
@@ -924,8 +933,9 @@
|
|
|
924
933
|
</script>
|
|
925
934
|
|
|
926
935
|
{#if catalog}
|
|
936
|
+
<!-- Activate history/focus subscriptions once the controller has started. -->
|
|
927
937
|
<ScrollNavigationBridge
|
|
928
|
-
controller={virtualScroll}
|
|
938
|
+
controller={isEnhanced ? virtualScroll : undefined}
|
|
929
939
|
onEarlyStart={startEarlyNavigation}
|
|
930
940
|
onStart={() => { if (isEnhanced) navigationFeedback?.begin(); }}
|
|
931
941
|
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.
|
|
3
|
+
"version": "1.0.0-beta.19",
|
|
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.
|
|
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
|
-
"@
|
|
44
|
-
"@page-sections/
|
|
45
|
-
"@
|
|
46
|
-
"
|
|
43
|
+
"@lucide/svelte": "1.77.0",
|
|
44
|
+
"@page-sections/core": "0.9.3",
|
|
45
|
+
"@page-sections/svelte": "0.9.3",
|
|
46
|
+
"@spatial-elements/core": "1.0.0-beta.19"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@sveltejs/kit": "^
|
|
50
|
-
"svelte": "^5.
|
|
51
|
-
"three": "^0.
|
|
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",
|