@spatial-elements/sveltekit 0.1.0-beta.1 → 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.
- package/README.md +19 -9
- package/dist/catalog/ScrollNavigationBridge.svelte +172 -47
- package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +9 -2
- package/dist/catalog/catalogNavigation.js +3 -2
- package/dist/catalog/catalogSummaryTransfer.d.ts +16 -0
- package/dist/catalog/catalogSummaryTransfer.js +79 -0
- package/dist/catalog/catalogTransition.css +58 -3
- package/dist/catalog/interruptedPresentation.d.ts +10 -0
- package/dist/catalog/interruptedPresentation.js +29 -0
- package/dist/catalog/presentationCleanup.d.ts +4 -0
- package/dist/catalog/presentationCleanup.js +20 -0
- package/dist/catalog/stagedCatalogNavigation.d.ts +44 -0
- package/dist/catalog/stagedCatalogNavigation.js +403 -0
- package/dist/catalog/stagedDomReveal.d.ts +8 -0
- package/dist/catalog/stagedDomReveal.js +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/spatial-element/BrandStageShell.svelte +52 -71
- package/dist/spatial-element/BrandStageShell.svelte.d.ts +31 -4
- package/dist/spatial-element/CarouselSpatialElement.svelte +150 -197
- package/dist/spatial-element/CarouselSpatialElement.svelte.d.ts +5 -1
- package/dist/spatial-element/ContentBlock.svelte +7 -0
- package/dist/spatial-element/ContentBlock.svelte.d.ts +9 -0
- package/dist/spatial-element/ContentGrid.svelte +7 -0
- package/dist/spatial-element/ContentGrid.svelte.d.ts +8 -0
- package/dist/spatial-element/ContentPage.svelte +51 -55
- package/dist/spatial-element/ContentPage.svelte.d.ts +14 -3
- package/dist/spatial-element/InteractionGesture.svelte +39 -0
- package/dist/spatial-element/InteractionGesture.svelte.d.ts +7 -0
- package/dist/spatial-element/OverflowControls.svelte +125 -0
- package/dist/spatial-element/OverflowControls.svelte.d.ts +9 -0
- package/dist/spatial-element/PointerHint.svelte +80 -0
- package/dist/spatial-element/PointerHint.svelte.d.ts +3 -0
- package/dist/spatial-element/Section.svelte +25 -106
- package/dist/spatial-element/Section.svelte.d.ts +1 -0
- package/dist/spatial-element/SectionSurfaceGroup.svelte +8 -0
- package/dist/spatial-element/SectionSurfaceGroup.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialCardGridSection.svelte +79 -0
- package/dist/spatial-element/SpatialCardGridSection.svelte.d.ts +11 -0
- package/dist/spatial-element/SpatialCardPresentation.svelte +311 -0
- package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +19 -0
- package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
- package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialCarouselSection.svelte +752 -0
- package/dist/spatial-element/{CarouselSection.svelte.d.ts → SpatialCarouselSection.svelte.d.ts} +5 -5
- package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +12 -65
- package/dist/spatial-element/SpatialElementCard.svelte +54 -238
- package/dist/spatial-element/SpatialElementCard.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialElementHelp.svelte +292 -0
- package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
- package/dist/spatial-element/SpatialElementMediaRail.svelte +321 -52
- package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +4 -1
- package/dist/spatial-element/SpatialElementNativeMedia.svelte +101 -0
- package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialElementPage.svelte +150 -70
- package/dist/spatial-element/SpatialElementPage.svelte.d.ts +6 -3
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +76 -104
- package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +3 -1
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +185 -0
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +18 -0
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +48 -380
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +2 -1
- package/dist/spatial-element/SpatialElementTabList.svelte +40 -17
- package/dist/spatial-element/SpatialElementTabList.svelte.d.ts +2 -1
- package/dist/spatial-element/SpatialElementTabs.svelte +61 -18
- package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +3 -1
- package/dist/spatial-element/SpatialElementViewToggle.svelte +54 -0
- package/dist/spatial-element/SpatialElementViewToggle.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialIconButton.svelte +59 -0
- package/dist/spatial-element/SpatialIconButton.svelte.d.ts +14 -0
- package/dist/spatial-element/SpatialListPage.svelte +37 -8
- package/dist/spatial-element/SpatialListPage.svelte.d.ts +4 -1
- package/dist/spatial-element/SpatialMediaIndicator.svelte +16 -0
- package/dist/spatial-element/SpatialMediaIndicator.svelte.d.ts +26 -0
- package/dist/spatial-element/SpatialNavigationShell.svelte +136 -0
- package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +15 -0
- package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
- package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialSummaryRoot.svelte +78 -0
- package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
- package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
- package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
- package/dist/spatial-element/brandContext.d.ts +1 -1
- package/dist/spatial-element/brandContext.js +1 -1
- package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
- package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
- package/dist/spatial-element/carouselTextHit.d.ts +2 -0
- package/dist/spatial-element/carouselTextHit.js +17 -0
- package/dist/spatial-element/contentSidebars.d.ts +3 -0
- package/dist/spatial-element/contentSidebars.js +56 -0
- package/dist/spatial-element/index.d.ts +18 -3
- package/dist/spatial-element/index.js +11 -2
- package/dist/spatial-element/layout.generated.css +363 -0
- package/dist/spatial-element/messagesContext.d.ts +3 -0
- package/dist/spatial-element/messagesContext.js +10 -0
- package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
- package/dist/spatial-element/presentationBoxFreeze.js +35 -0
- package/dist/spatial-element/spatialCardGrid.d.ts +12 -0
- package/dist/spatial-element/spatialCardGrid.js +1 -0
- package/dist/spatial-element/spatialPageContext.d.ts +4 -0
- package/dist/spatial-element/spatialPageContext.js +9 -0
- package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
- package/dist/spatial-element/spatialPresentationOwner.js +2 -0
- package/dist/spatial-element/spatialSummary.d.ts +43 -0
- package/dist/spatial-element/spatialSummary.js +1 -0
- package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
- package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
- package/dist/spatial-element/spatialThemeStyle.d.ts +3 -0
- package/dist/spatial-element/spatialThemeStyle.js +69 -0
- package/dist/spatial-element/truncatedTitle.d.ts +5 -0
- package/dist/spatial-element/truncatedTitle.js +28 -0
- package/dist/stage/ButtonGroup.svelte +151 -0
- package/dist/stage/ButtonGroup.svelte.d.ts +24 -0
- package/dist/stage/Panel.svelte +72 -14
- package/dist/stage/Panel.svelte.d.ts +14 -2
- package/dist/stage/Stage.svelte +405 -48
- package/dist/stage/Stage.svelte.d.ts +8 -1
- package/dist/stage/StageViewport.svelte +15 -2
- package/dist/stage/authoredStyle.d.ts +4 -0
- package/dist/stage/authoredStyle.js +17 -0
- package/dist/stage/buttonGroup.d.ts +9 -0
- package/dist/stage/buttonGroup.js +1 -0
- package/logo.svg +188 -0
- package/package.json +9 -6
- package/dist/spatial-element/CarouselSection.svelte +0 -350
- package/dist/spatial-element/ListSection.svelte +0 -30
- package/dist/spatial-element/ListSection.svelte.d.ts +0 -8
package/dist/stage/Panel.svelte
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
type StagePanelAttributes = HTMLAttributes<HTMLDivElement>;
|
|
4
|
-
import { getContext, onDestroy, onMount } from 'svelte';
|
|
4
|
+
import { getContext, onDestroy, onMount, untrack } from 'svelte';
|
|
5
|
+
import { authoredStyle } from './authoredStyle.js';
|
|
5
6
|
import type { Snippet } from 'svelte';
|
|
6
7
|
import {
|
|
7
8
|
STAGE_CONTEXT_KEY,
|
|
9
|
+
STAGE_PANEL_LAYOUT_EVENT,
|
|
8
10
|
type StageContext,
|
|
9
11
|
|
|
10
12
|
type StagePanelMinimapOptions,
|
|
@@ -23,8 +25,20 @@
|
|
|
23
25
|
class?: string;
|
|
24
26
|
contentClass?: string;
|
|
25
27
|
minimap?: boolean | StagePanelMinimapOptions;
|
|
26
|
-
/**
|
|
27
|
-
pointerReactive?: boolean;
|
|
28
|
+
/** true: proximity lift and tilt; 'lift': a 2px mouse-hover lift without tilt; false: still. */
|
|
29
|
+
pointerReactive?: boolean | 'lift';
|
|
30
|
+
/** false keeps the pose; 'top-right' reaches the corner as the surrounding UI clears. */
|
|
31
|
+
focusReactive?: boolean | 'top-right';
|
|
32
|
+
/** Optional neighbouring panel frame whose top-left corner moves with a 'top-right' control. */
|
|
33
|
+
focusAnchor?: HTMLElement;
|
|
34
|
+
/** Retain native DOM layout, including popover semantics, while rendering the glass surface. */
|
|
35
|
+
nativeContent?: boolean;
|
|
36
|
+
/** Position native content in the stage render frame, after projected anchors have moved. */
|
|
37
|
+
nativeLayout?: () => void;
|
|
38
|
+
/** Visibility of an optional native-content panel. */
|
|
39
|
+
visible?: boolean;
|
|
40
|
+
/** Controls the minimap selection outline, preserving its live model. */
|
|
41
|
+
minimapSelected?: boolean;
|
|
28
42
|
pose?: StagePanelPose;
|
|
29
43
|
shape: StagePanelShape;
|
|
30
44
|
surface?: StagePanelSurface;
|
|
@@ -39,6 +53,12 @@
|
|
|
39
53
|
contentClass = '',
|
|
40
54
|
minimap = false,
|
|
41
55
|
pointerReactive = true,
|
|
56
|
+
focusReactive = true,
|
|
57
|
+
focusAnchor,
|
|
58
|
+
nativeContent = false,
|
|
59
|
+
nativeLayout,
|
|
60
|
+
visible = true,
|
|
61
|
+
minimapSelected = true,
|
|
42
62
|
pose,
|
|
43
63
|
shape,
|
|
44
64
|
style: contentStyle = '',
|
|
@@ -66,27 +86,50 @@
|
|
|
66
86
|
getFrameElement: () => frameElement,
|
|
67
87
|
getSurfaceElement: () => surfaceElement,
|
|
68
88
|
getPointerReactive: () => pointerReactive,
|
|
89
|
+
getFocusReactive: () => focusReactive,
|
|
90
|
+
getFocusAnchor: () => focusAnchor,
|
|
91
|
+
getNativeContent: () => nativeContent,
|
|
92
|
+
// Absence matters: only an actively positioned popover needs a fresh
|
|
93
|
+
// native measurement on every render; ordinary panels use the layout cache.
|
|
94
|
+
get updateNativeLayout() { return nativeLayout; },
|
|
95
|
+
getVisible: () => visible,
|
|
96
|
+
getMinimapSelected: () => minimapSelected,
|
|
69
97
|
getMinimapOptions: () => getMinimapOptions(),
|
|
70
98
|
getMinimapDockProgress,
|
|
71
99
|
getMinimapModelScale,
|
|
72
100
|
getMinimapModelTop,
|
|
101
|
+
getMinimapModelLeft,
|
|
73
102
|
getSurface: () => resolvedSurface,
|
|
74
103
|
getSurfaceOpacity,
|
|
75
104
|
getOptions: getPanelOptions
|
|
76
105
|
});
|
|
77
106
|
|
|
78
107
|
onDestroy(unregister);
|
|
108
|
+
$effect(() => {
|
|
109
|
+
getPanelOptions();
|
|
110
|
+
getContentInset();
|
|
111
|
+
Object.values(getMinimapOptions() ?? {});
|
|
112
|
+
void resolvedSurface;
|
|
113
|
+
void nativeContent;
|
|
114
|
+
stage.updatePanelAppearance?.();
|
|
115
|
+
});
|
|
116
|
+
$effect(() => {
|
|
117
|
+
void visible;
|
|
118
|
+
void minimapSelected;
|
|
119
|
+
window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
|
|
120
|
+
});
|
|
79
121
|
|
|
80
122
|
onMount(() => {
|
|
81
123
|
if (!getMinimapOptions()) return;
|
|
124
|
+
const minimapContent = contentElement;
|
|
82
125
|
|
|
83
126
|
const resetView = (event: MouseEvent) => {
|
|
84
127
|
if (event.defaultPrevented || event.button !== 0) return;
|
|
85
128
|
stage.resetView();
|
|
86
129
|
};
|
|
87
130
|
|
|
88
|
-
|
|
89
|
-
return () =>
|
|
131
|
+
minimapContent.addEventListener('click', resetView);
|
|
132
|
+
return () => minimapContent.removeEventListener('click', resetView);
|
|
90
133
|
});
|
|
91
134
|
|
|
92
135
|
function getContentInset() {
|
|
@@ -134,6 +177,11 @@
|
|
|
134
177
|
return Number.isFinite(value) ? value : undefined;
|
|
135
178
|
}
|
|
136
179
|
|
|
180
|
+
function getMinimapModelLeft() {
|
|
181
|
+
const value = Number.parseFloat(frameElement?.dataset.stageMinimapModelLeft ?? '');
|
|
182
|
+
return Number.isFinite(value) ? value : undefined;
|
|
183
|
+
}
|
|
184
|
+
|
|
137
185
|
function getFallbackStyle() {
|
|
138
186
|
const tintOpacity = clamp(theme.tintOpacity ?? 0.28, 0, 1);
|
|
139
187
|
const shadowIntensity = getShadowIntensity();
|
|
@@ -153,9 +201,6 @@
|
|
|
153
201
|
`--stage-panel-thickness: ${thickness}`,
|
|
154
202
|
`--stage-panel-bezel: ${bezel}px`,
|
|
155
203
|
`--stage-panel-opacity: ${clamp(theme.opacity ?? 1, 0, 1)}`,
|
|
156
|
-
'--stage-panel-surface-opacity: 1',
|
|
157
|
-
'--stage-panel-focus-opacity: 1',
|
|
158
|
-
'--stage-panel-content-opacity: 1',
|
|
159
204
|
`--stage-panel-css-blur: ${Math.min(backdropBlur, 100)}px`
|
|
160
205
|
];
|
|
161
206
|
|
|
@@ -215,11 +260,15 @@
|
|
|
215
260
|
function clamp(value: number, min: number, max: number) {
|
|
216
261
|
return Math.min(Math.max(value, min), max);
|
|
217
262
|
}
|
|
263
|
+
// SSR styles are static; the action patches only authored properties after hydration.
|
|
264
|
+
const initialFallbackStyle = untrack(getFallbackStyle);
|
|
265
|
+
const initialContentStyle = untrack(getContentThemeStyle);
|
|
218
266
|
</script>
|
|
219
267
|
|
|
220
268
|
<div
|
|
221
269
|
bind:this={frameElement}
|
|
222
270
|
data-stage-panel-fallback
|
|
271
|
+
data-stage-panel-native-content={nativeContent ? '' : undefined}
|
|
223
272
|
data-catalog-transition-group={transitionGroup}
|
|
224
273
|
data-stage-panel-minimap={minimap ? '' : undefined}
|
|
225
274
|
data-stage-minimap-docked-view-scale={getMinimapOptions()?.dockedView?.scale}
|
|
@@ -227,7 +276,8 @@
|
|
|
227
276
|
class={[frameClass, 'stage-panel-fallback', pose ? 'stage-panel-posed' : '']
|
|
228
277
|
.filter(Boolean)
|
|
229
278
|
.join(' ')}
|
|
230
|
-
style={
|
|
279
|
+
style={initialFallbackStyle}
|
|
280
|
+
use:authoredStyle={getFallbackStyle()}
|
|
231
281
|
>
|
|
232
282
|
<div
|
|
233
283
|
bind:this={surfaceElement}
|
|
@@ -236,16 +286,21 @@
|
|
|
236
286
|
data-stage-panel-minimap={minimap ? '' : undefined}
|
|
237
287
|
data-stage-panel-surface={resolvedSurface}
|
|
238
288
|
class="stage-panel-surface"
|
|
239
|
-
style={
|
|
289
|
+
style={initialFallbackStyle}
|
|
290
|
+
data-stage-panel-authored-style={getFallbackStyle()}
|
|
291
|
+
use:authoredStyle={getFallbackStyle()}
|
|
240
292
|
>
|
|
241
293
|
<div
|
|
242
294
|
{...rest}
|
|
243
295
|
bind:this={contentElement}
|
|
244
296
|
use:registerEndpoint={catalogEndpoint}
|
|
245
297
|
data-stage-panel-content
|
|
298
|
+
data-stage-corner-control={focusReactive === 'top-right' ? '' : undefined}
|
|
246
299
|
data-catalog-transition-group={transitionGroup}
|
|
247
300
|
class={contentClass}
|
|
248
|
-
style={
|
|
301
|
+
style={initialContentStyle}
|
|
302
|
+
data-stage-panel-authored-style={getContentThemeStyle()}
|
|
303
|
+
use:authoredStyle={getContentThemeStyle()}
|
|
249
304
|
>
|
|
250
305
|
{@render children?.()}
|
|
251
306
|
</div>
|
|
@@ -287,7 +342,7 @@
|
|
|
287
342
|
/* Content can leave its CSS surface when glass uses the DOM projection layer. */
|
|
288
343
|
opacity: calc(
|
|
289
344
|
var(--stage-panel-opacity, 1) * var(--stage-panel-content-opacity, 1) *
|
|
290
|
-
var(--stage-transition-opacity, 1)
|
|
345
|
+
var(--catalog-reveal-opacity, var(--stage-transition-opacity, 1))
|
|
291
346
|
);
|
|
292
347
|
}
|
|
293
348
|
|
|
@@ -301,6 +356,9 @@
|
|
|
301
356
|
|
|
302
357
|
.stage-panel-surface::before,
|
|
303
358
|
.stage-panel-surface::after {
|
|
359
|
+
/* These two paint owners share their surface's local reveal value. Ordinary
|
|
360
|
+
* descendants do not inherit it; the content has its own existing factor. */
|
|
361
|
+
--catalog-reveal-opacity: inherit;
|
|
304
362
|
position: absolute;
|
|
305
363
|
inset: 0;
|
|
306
364
|
border-radius: inherit;
|
|
@@ -308,7 +366,7 @@
|
|
|
308
366
|
content: '';
|
|
309
367
|
opacity: calc(
|
|
310
368
|
var(--stage-panel-opacity) * var(--stage-panel-surface-opacity, 1) *
|
|
311
|
-
var(--stage-panel-focus-opacity, 1) * var(--stage-transition-opacity, 1)
|
|
369
|
+
var(--stage-panel-focus-opacity, 1) * var(--catalog-reveal-opacity, var(--stage-transition-opacity, 1))
|
|
312
370
|
);
|
|
313
371
|
}
|
|
314
372
|
|
|
@@ -336,7 +394,7 @@
|
|
|
336
394
|
opacity: calc(
|
|
337
395
|
var(--stage-panel-opacity) * var(--stage-panel-surface-opacity, 1) *
|
|
338
396
|
var(--stage-panel-focus-opacity, 1) * var(--stage-panel-specular-opacity) *
|
|
339
|
-
var(--stage-transition-opacity, 1)
|
|
397
|
+
var(--catalog-reveal-opacity, var(--stage-transition-opacity, 1))
|
|
340
398
|
);
|
|
341
399
|
}
|
|
342
400
|
|
|
@@ -10,8 +10,20 @@ 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;
|
|
25
|
+
/** Controls the minimap selection outline, preserving its live model. */
|
|
26
|
+
minimapSelected?: boolean;
|
|
15
27
|
pose?: StagePanelPose;
|
|
16
28
|
shape: StagePanelShape;
|
|
17
29
|
surface?: StagePanelSurface;
|