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

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 (133) 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 +152 -200
  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 +129 -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/SpaceMouseControl.svelte +159 -0
  39. package/dist/spatial-element/SpaceMouseControl.svelte.d.ts +7 -0
  40. package/dist/spatial-element/SpaceMouseIcon.svelte +12 -0
  41. package/dist/spatial-element/SpaceMouseIcon.svelte.d.ts +26 -0
  42. package/dist/spatial-element/SpatialCardGridSection.svelte +79 -0
  43. package/dist/spatial-element/SpatialCardGridSection.svelte.d.ts +11 -0
  44. package/dist/spatial-element/SpatialCardPresentation.svelte +311 -0
  45. package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +19 -0
  46. package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
  47. package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
  48. package/dist/spatial-element/SpatialCarouselSection.svelte +754 -0
  49. package/dist/spatial-element/{CarouselSection.svelte.d.ts → SpatialCarouselSection.svelte.d.ts} +5 -5
  50. package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +12 -65
  51. package/dist/spatial-element/SpatialElementCard.svelte +54 -238
  52. package/dist/spatial-element/SpatialElementCard.svelte.d.ts +9 -0
  53. package/dist/spatial-element/SpatialElementHelp.svelte +300 -0
  54. package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
  55. package/dist/spatial-element/SpatialElementMediaRail.svelte +322 -52
  56. package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +4 -1
  57. package/dist/spatial-element/SpatialElementNativeMedia.svelte +101 -0
  58. package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
  59. package/dist/spatial-element/SpatialElementPage.svelte +156 -71
  60. package/dist/spatial-element/SpatialElementPage.svelte.d.ts +10 -3
  61. package/dist/spatial-element/SpatialElementStickyHeader.svelte +89 -105
  62. package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +6 -1
  63. package/dist/spatial-element/SpatialElementSummaryContent.svelte +198 -0
  64. package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +23 -0
  65. package/dist/spatial-element/SpatialElementSummaryPanel.svelte +48 -380
  66. package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +2 -1
  67. package/dist/spatial-element/SpatialElementTabList.svelte +40 -17
  68. package/dist/spatial-element/SpatialElementTabList.svelte.d.ts +2 -1
  69. package/dist/spatial-element/SpatialElementTabs.svelte +61 -18
  70. package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +3 -1
  71. package/dist/spatial-element/SpatialElementViewToggle.svelte +54 -0
  72. package/dist/spatial-element/SpatialElementViewToggle.svelte.d.ts +8 -0
  73. package/dist/spatial-element/SpatialIconButton.svelte +66 -0
  74. package/dist/spatial-element/SpatialIconButton.svelte.d.ts +17 -0
  75. package/dist/spatial-element/SpatialListPage.svelte +37 -8
  76. package/dist/spatial-element/SpatialListPage.svelte.d.ts +4 -1
  77. package/dist/spatial-element/SpatialMediaIndicator.svelte +16 -0
  78. package/dist/spatial-element/SpatialMediaIndicator.svelte.d.ts +26 -0
  79. package/dist/spatial-element/SpatialNavigationShell.svelte +138 -0
  80. package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +15 -0
  81. package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
  82. package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
  83. package/dist/spatial-element/SpatialSummaryRoot.svelte +80 -0
  84. package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
  85. package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
  86. package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
  87. package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
  88. package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
  89. package/dist/spatial-element/brandContext.d.ts +1 -1
  90. package/dist/spatial-element/brandContext.js +1 -1
  91. package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
  92. package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
  93. package/dist/spatial-element/carouselTextHit.d.ts +2 -0
  94. package/dist/spatial-element/carouselTextHit.js +17 -0
  95. package/dist/spatial-element/contentSidebars.d.ts +3 -0
  96. package/dist/spatial-element/contentSidebars.js +56 -0
  97. package/dist/spatial-element/index.d.ts +19 -3
  98. package/dist/spatial-element/index.js +12 -2
  99. package/dist/spatial-element/layout.generated.css +363 -0
  100. package/dist/spatial-element/messagesContext.d.ts +3 -0
  101. package/dist/spatial-element/messagesContext.js +10 -0
  102. package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
  103. package/dist/spatial-element/presentationBoxFreeze.js +35 -0
  104. package/dist/spatial-element/spatialCardGrid.d.ts +12 -0
  105. package/dist/spatial-element/spatialCardGrid.js +1 -0
  106. package/dist/spatial-element/spatialPageContext.d.ts +4 -0
  107. package/dist/spatial-element/spatialPageContext.js +9 -0
  108. package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
  109. package/dist/spatial-element/spatialPresentationOwner.js +2 -0
  110. package/dist/spatial-element/spatialSummary.d.ts +43 -0
  111. package/dist/spatial-element/spatialSummary.js +1 -0
  112. package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
  113. package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
  114. package/dist/spatial-element/spatialThemeStyle.d.ts +3 -0
  115. package/dist/spatial-element/spatialThemeStyle.js +69 -0
  116. package/dist/spatial-element/truncatedTitle.d.ts +5 -0
  117. package/dist/spatial-element/truncatedTitle.js +28 -0
  118. package/dist/stage/ButtonGroup.svelte +152 -0
  119. package/dist/stage/ButtonGroup.svelte.d.ts +24 -0
  120. package/dist/stage/Panel.svelte +72 -14
  121. package/dist/stage/Panel.svelte.d.ts +14 -2
  122. package/dist/stage/Stage.svelte +471 -51
  123. package/dist/stage/Stage.svelte.d.ts +8 -1
  124. package/dist/stage/StageViewport.svelte +15 -2
  125. package/dist/stage/authoredStyle.d.ts +4 -0
  126. package/dist/stage/authoredStyle.js +17 -0
  127. package/dist/stage/buttonGroup.d.ts +9 -0
  128. package/dist/stage/buttonGroup.js +1 -0
  129. package/logo.svg +225 -0
  130. package/package.json +9 -6
  131. package/dist/spatial-element/CarouselSection.svelte +0 -350
  132. package/dist/spatial-element/ListSection.svelte +0 -30
  133. package/dist/spatial-element/ListSection.svelte.d.ts +0 -8
@@ -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
- /** Enables proximity lift and pointer-driven tilt. Defaults to true. */
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
- contentElement.addEventListener('click', resetView);
89
- return () => contentElement.removeEventListener('click', resetView);
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={getFallbackStyle()}
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={getFallbackStyle()}
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={getContentThemeStyle()}
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
- /** Enables proximity lift and pointer-driven tilt. Defaults to true. */
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;