@spatial-elements/core 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 +9 -3
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -1
- package/dist/catalog/CatalogGeometryFade.js +6 -2
- package/dist/catalog/CatalogGeometryFade.js.map +1 -1
- package/dist/catalog/CatalogPreparation.d.ts +3 -3
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -1
- package/dist/catalog/CatalogPreparation.js +2 -1
- package/dist/catalog/CatalogPreparation.js.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +46 -18
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +25 -7
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/SpatialPageRegistry.d.ts +17 -0
- package/dist/catalog/SpatialPageRegistry.d.ts.map +1 -0
- package/dist/catalog/SpatialPageRegistry.js +21 -0
- package/dist/catalog/SpatialPageRegistry.js.map +1 -0
- package/dist/catalog/carouselMotion.d.ts +39 -0
- package/dist/catalog/carouselMotion.d.ts.map +1 -0
- package/dist/catalog/carouselMotion.js +104 -0
- package/dist/catalog/carouselMotion.js.map +1 -0
- package/dist/catalog/catalogPage.d.ts +7 -3
- package/dist/catalog/catalogPage.d.ts.map +1 -1
- package/dist/catalog/catalogPage.js.map +1 -1
- package/dist/catalog/spatialElementAssets.d.ts +5 -5
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -1
- package/dist/catalog/spatialElementAssets.js.map +1 -1
- package/dist/catalog/spatialElementLodPair.d.ts +2 -1
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -1
- package/dist/catalog/spatialElementLodPair.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +4 -3
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/messages.d.ts +32 -0
- package/dist/spatial-element/messages.d.ts.map +1 -0
- package/dist/spatial-element/messages.js +34 -0
- package/dist/spatial-element/messages.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +16 -12
- package/dist/spatial-element/spatialElement.d.ts.map +1 -1
- package/dist/spatial-element/spatialElement.js +32 -6
- package/dist/spatial-element/spatialElement.js.map +1 -1
- package/dist/spatial-element/spatialElementGeometry.d.ts +22 -0
- package/dist/spatial-element/spatialElementGeometry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementGeometry.js +40 -0
- package/dist/spatial-element/spatialElementGeometry.js.map +1 -0
- package/dist/spatial-element/spatialElementScene.d.ts +16 -0
- package/dist/spatial-element/spatialElementScene.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementScene.js +22 -0
- package/dist/spatial-element/spatialElementScene.js.map +1 -0
- package/dist/spatial-element/spatialTheme.d.ts +16 -0
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -0
- package/dist/spatial-element/spatialTheme.js +53 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -0
- package/dist/spatial-element/types.d.ts +63 -33
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/LiquidGlassPanel.d.ts +2 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +11 -2
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.js +1 -1
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/ModelPointerPreview.d.ts +22 -0
- package/dist/stage/ModelPointerPreview.d.ts.map +1 -0
- package/dist/stage/ModelPointerPreview.js +71 -0
- package/dist/stage/ModelPointerPreview.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +3 -1
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +3 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +69 -12
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +10 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +104 -10
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +22 -4
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +131 -57
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StagePanelRuntime.d.ts +2 -1
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -1
- package/dist/stage/StagePanelRuntime.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +8 -1
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +24 -7
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +0 -2
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/interactionGuidance.d.ts +22 -0
- package/dist/stage/interactionGuidance.d.ts.map +1 -0
- package/dist/stage/interactionGuidance.js +53 -0
- package/dist/stage/interactionGuidance.js.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapGeometry.js +29 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -1
- package/dist/stage/mouseHover.d.ts +9 -0
- package/dist/stage/mouseHover.d.ts.map +1 -0
- package/dist/stage/mouseHover.js +55 -0
- package/dist/stage/mouseHover.js.map +1 -0
- package/dist/stage/panelContext.d.ts +9 -2
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/renderSettings.d.ts +10 -0
- package/dist/stage/renderSettings.d.ts.map +1 -0
- package/dist/stage/renderSettings.js +27 -0
- package/dist/stage/renderSettings.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +1 -1
- package/dist/stage/renderTargetInventory.js +1 -1
- package/dist/stage/renderTargetInventory.js.map +1 -1
- package/dist/stage/scrollFrame.d.ts +2 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -1
- package/dist/stage/scrollFrame.js +18 -5
- package/dist/stage/scrollFrame.js.map +1 -1
- package/dist/stage/spatialElementFrame.d.ts.map +1 -1
- package/dist/stage/spatialElementFrame.js +5 -1
- package/dist/stage/spatialElementFrame.js.map +1 -1
- package/dist/stage/stageConstants.d.ts +3 -3
- package/dist/stage/stageConstants.d.ts.map +1 -1
- package/dist/stage/stageConstants.js +3 -3
- package/dist/stage/stageConstants.js.map +1 -1
- package/dist/stage/stageMath.d.ts +6 -7
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +12 -11
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +21 -2
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +3 -1
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { resolveSpatialElementGeometry } from './spatialElementGeometry.js';
|
|
2
|
+
/** @internal Content and runtime pose callbacks never participate in asset identity. */
|
|
3
|
+
export function getSpatialElementScene(element) {
|
|
4
|
+
const { hdr, background, model, camera, assetManifest, fallbackImage, fallbackImageSize } = element;
|
|
5
|
+
const lodPair = resolveSpatialElementGeometry(element.geometry);
|
|
6
|
+
return {
|
|
7
|
+
glb: lodPair.sourceUrl,
|
|
8
|
+
lodPair,
|
|
9
|
+
hdr,
|
|
10
|
+
background,
|
|
11
|
+
model,
|
|
12
|
+
camera,
|
|
13
|
+
assetManifest,
|
|
14
|
+
fallbackImage,
|
|
15
|
+
fallbackImageSize
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** @internal Text-only cards intentionally have no geometry. */
|
|
19
|
+
export function hasSpatialElementScene(element) {
|
|
20
|
+
return Boolean(element.geometry && element.hdr);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=spatialElementScene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatialElementScene.js","sourceRoot":"","sources":["../../src/spatial-element/spatialElementScene.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAoB5E,wFAAwF;AACxF,MAAM,UAAU,sBAAsB,CAAC,OAAkC;IACxE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,GACxF,OAAO,CAAC;IACT,MAAM,OAAO,GAAG,6BAA6B,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChE,OAAO;QACN,GAAG,EAAE,OAAO,CAAC,SAAS;QACtB,OAAO;QACP,GAAG;QACH,UAAU;QACV,KAAK;QACL,MAAM;QACN,aAAa;QACb,aAAa;QACb,iBAAiB;KACjB,CAAC;AACH,CAAC;AACD,gEAAgE;AAChE,MAAM,UAAU,sBAAsB,CACrC,OAAwB;IAExB,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { SpatialElementData, SpatialListItem } from './types.js';\nimport type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport { resolveSpatialElementGeometry } from './spatialElementGeometry.js';\n\ntype ElementAppearance = Pick<\n\tSpatialElementData,\n\t| 'hdr'\n\t| 'background'\n\t| 'model'\n\t| 'camera'\n\t| 'assetManifest'\n\t| 'fallbackImage'\n\t| 'fallbackImageSize'\n>;\n/** @internal Legacy renderer projection, derived from the single public geometry field. */\nexport interface SpatialElementScene extends ElementAppearance {\n\tglb: string;\n\tlodPair?: SpatialElementLodPair;\n}\n/** @internal Authoring inputs; never pass a renderer projection back through this boundary. */\nexport type SpatialElementSceneSource = ElementAppearance & Pick<SpatialElementData, 'geometry'>;\n\n/** @internal Content and runtime pose callbacks never participate in asset identity. */\nexport function getSpatialElementScene(element: SpatialElementSceneSource): SpatialElementScene {\n\tconst { hdr, background, model, camera, assetManifest, fallbackImage, fallbackImageSize } =\n\t\telement;\n\tconst lodPair = resolveSpatialElementGeometry(element.geometry);\n\treturn {\n\t\tglb: lodPair.sourceUrl,\n\t\tlodPair,\n\t\thdr,\n\t\tbackground,\n\t\tmodel,\n\t\tcamera,\n\t\tassetManifest,\n\t\tfallbackImage,\n\t\tfallbackImageSize\n\t};\n}\n/** @internal Text-only cards intentionally have no geometry. */\nexport function hasSpatialElementScene(\n\telement: SpatialListItem\n): element is SpatialListItem & SpatialElementSceneSource {\n\treturn Boolean(element.geometry && element.hdr);\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SpatialTheme } from './types.js';
|
|
2
|
+
/** Input for createSpatialTheme. Every appearance group merges with the library defaults. */
|
|
3
|
+
export type SpatialThemeOptions = Pick<SpatialTheme, 'id' | 'name'> & {
|
|
4
|
+
/** Flat page color, independent of each element's HDR background. Default: #eef1f4. */
|
|
5
|
+
background?: string;
|
|
6
|
+
} & {
|
|
7
|
+
[K in Exclude<keyof SpatialTheme, 'id' | 'name' | 'background'>]?: Partial<SpatialTheme[K]>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Creates a complete theme from a brand identity and optional appearance overrides.
|
|
11
|
+
* Nested groups merge field-by-field; returned objects are independent between calls.
|
|
12
|
+
* @example
|
|
13
|
+
* const theme = createSpatialTheme({ id: 'shop', name: 'My shop', colors: { accent: '#285c89' } });
|
|
14
|
+
*/
|
|
15
|
+
export declare function createSpatialTheme(options: SpatialThemeOptions): SpatialTheme;
|
|
16
|
+
//# sourceMappingURL=spatialTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatialTheme.d.ts","sourceRoot":"","sources":["../../src/spatial-element/spatialTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,6FAA6F;AAC7F,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IACrE,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,YAAY,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEpG;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CA6C7E"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a complete theme from a brand identity and optional appearance overrides.
|
|
3
|
+
* Nested groups merge field-by-field; returned objects are independent between calls.
|
|
4
|
+
* @example
|
|
5
|
+
* const theme = createSpatialTheme({ id: 'shop', name: 'My shop', colors: { accent: '#285c89' } });
|
|
6
|
+
*/
|
|
7
|
+
export function createSpatialTheme(options) {
|
|
8
|
+
return {
|
|
9
|
+
id: options.id,
|
|
10
|
+
name: options.name,
|
|
11
|
+
background: options.background ?? '#eef1f4',
|
|
12
|
+
minimapTheme: {
|
|
13
|
+
expandedHeight: 240,
|
|
14
|
+
overlayColor: '#000000',
|
|
15
|
+
overlayOpacity: 0.35,
|
|
16
|
+
overlayBlur: 5,
|
|
17
|
+
contextOpacity: 0,
|
|
18
|
+
viewportColor: options.colors?.accent ?? '#285c89',
|
|
19
|
+
...options.minimapTheme
|
|
20
|
+
},
|
|
21
|
+
interactionTheme: {
|
|
22
|
+
outlineColor: options.colors?.accent ?? '#285c89',
|
|
23
|
+
...options.interactionTheme
|
|
24
|
+
},
|
|
25
|
+
panelShape: { radius: 16, contentInset: 26, ...options.panelShape },
|
|
26
|
+
panelTheme: {
|
|
27
|
+
surface: 'frosted',
|
|
28
|
+
tint: '#ffffff',
|
|
29
|
+
tintOpacity: 0.65,
|
|
30
|
+
backdropBlur: 8,
|
|
31
|
+
shadowIntensity: 0.2,
|
|
32
|
+
opacity: 1,
|
|
33
|
+
...options.panelTheme
|
|
34
|
+
},
|
|
35
|
+
dockedPanelTheme: {
|
|
36
|
+
tint: '#ffffff',
|
|
37
|
+
tintOpacity: 0.92,
|
|
38
|
+
backdropBlur: 5,
|
|
39
|
+
shadowIntensity: 0.2,
|
|
40
|
+
...options.dockedPanelTheme
|
|
41
|
+
},
|
|
42
|
+
sectionTheme: { tint: '#ffffff', tintOpacity: 0.8, backdropBlur: 8, ...options.sectionTheme },
|
|
43
|
+
colors: {
|
|
44
|
+
ink: '#173047',
|
|
45
|
+
body: '#263c4d',
|
|
46
|
+
accent: '#285c89',
|
|
47
|
+
onAccent: '#ffffff',
|
|
48
|
+
tabBackground: '#e4ebf1',
|
|
49
|
+
...options.colors
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=spatialTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatialTheme.js","sourceRoot":"","sources":["../../src/spatial-element/spatialTheme.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA4B;IAC9D,OAAO;QACN,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,E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createSpatialTheme. Every appearance group merges with the library defaults. */\nexport type SpatialThemeOptions = Pick<SpatialTheme, 'id' | 'name'> & {\n\t/** Flat page color, independent of each element's HDR background. Default: #eef1f4. */\n\tbackground?: string;\n} & { [K in Exclude<keyof SpatialTheme, 'id' | 'name' | 'background'>]?: Partial<SpatialTheme[K]> };\n\n/**\n * Creates a complete theme from a brand identity and optional appearance overrides.\n * Nested groups merge field-by-field; returned objects are independent between calls.\n * @example\n * const theme = createSpatialTheme({ id: 'shop', name: 'My shop', colors: { accent: '#285c89' } });\n */\nexport function createSpatialTheme(options: SpatialThemeOptions): SpatialTheme {\n\treturn {\n\t\tid: options.id,\n\t\tname: options.name,\n\t\tbackground: options.background ?? '#eef1f4',\n\t\tminimapTheme: {\n\t\t\texpandedHeight: 240,\n\t\t\toverlayColor: '#000000',\n\t\t\toverlayOpacity: 0.35,\n\t\t\toverlayBlur: 5,\n\t\t\tcontextOpacity: 0,\n\t\t\tviewportColor: options.colors?.accent ?? '#285c89',\n\t\t\t...options.minimapTheme\n\t\t},\n\t\tinteractionTheme: {\n\t\t\toutlineColor: options.colors?.accent ?? '#285c89',\n\t\t\t...options.interactionTheme\n\t\t},\n\t\tpanelShape: { radius: 16, contentInset: 26, ...options.panelShape },\n\t\tpanelTheme: {\n\t\t\tsurface: 'frosted',\n\t\t\ttint: '#ffffff',\n\t\t\ttintOpacity: 0.65,\n\t\t\tbackdropBlur: 8,\n\t\t\tshadowIntensity: 0.2,\n\t\t\topacity: 1,\n\t\t\t...options.panelTheme\n\t\t},\n\t\tdockedPanelTheme: {\n\t\t\ttint: '#ffffff',\n\t\t\ttintOpacity: 0.92,\n\t\t\tbackdropBlur: 5,\n\t\t\tshadowIntensity: 0.2,\n\t\t\t...options.dockedPanelTheme\n\t\t},\n\t\tsectionTheme: { tint: '#ffffff', tintOpacity: 0.8, backdropBlur: 8, ...options.sectionTheme },\n\t\tcolors: {\n\t\t\tink: '#173047',\n\t\t\tbody: '#263c4d',\n\t\t\taccent: '#285c89',\n\t\t\tonAccent: '#ffffff',\n\t\t\ttabBackground: '#e4ebf1',\n\t\t\t...options.colors\n\t\t}\n\t};\n}\n"]}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
import type { VerifiedSpatialElementAssetManifest } from '../catalog/spatialElementAssets.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SpatialElementGeometry } from './spatialElementGeometry.js';
|
|
3
3
|
import type { BackgroundSettings, StageCameraSettings, StageInteractionTheme, StageModelSettings } from '../stage/stageTypes.js';
|
|
4
4
|
import type { StagePanelMinimapOptions, StagePanelShape, StagePanelTheme } from '../stage/panelContext.js';
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
glb: string;
|
|
13
|
-
/** SpatialElement pose and non-spatial-element geometry exclusions applied after loading the GLB. */
|
|
14
|
-
model?: StageModelSettings;
|
|
15
|
-
/** Initial camera orbit; distance and element framing remain automatic. */
|
|
16
|
-
camera?: StageCameraSettings;
|
|
17
|
-
/** Accessible fallback image shown before enhancement or without JavaScript. */
|
|
18
|
-
fallbackImage?: string;
|
|
19
|
-
/** Actual pixel dimensions of the fallback asset, independent of element dimensions. */
|
|
20
|
-
fallbackImageSize?: readonly [number, number];
|
|
21
|
-
}
|
|
22
|
-
/** Compact element data used by a brand catalog without loading a detail document in the layout. */
|
|
23
|
-
export interface SpatialListItem {
|
|
24
|
-
/** Runtime-only pose provider installed by a spatial section, never serialized in route data. */
|
|
5
|
+
/**
|
|
6
|
+
* Category-card projection created by {@link getSpatialListItems}.
|
|
7
|
+
* Includes the element's assets automatically; pass these items to ListSection or CarouselSection.
|
|
8
|
+
* Detail-only media and breadcrumbs are omitted. No catalog data belongs in the layout.
|
|
9
|
+
*/
|
|
10
|
+
export interface SpatialListItem extends Partial<Pick<SpatialElementData, 'geometry' | 'hdr' | 'background' | 'model' | 'camera' | 'assetManifest' | 'fallbackImage' | 'fallbackImageSize'>> {
|
|
11
|
+
/** @internal Runtime-only pose provider installed by a section, never serialized in route data. */
|
|
25
12
|
pose?: import('../catalog/catalogPose.js').CatalogPoseProvider;
|
|
26
13
|
/** Optional full summary projection, sourced from the same document as the DETAIL. */
|
|
27
14
|
summary?: {
|
|
@@ -35,15 +22,18 @@ export interface SpatialListItem {
|
|
|
35
22
|
};
|
|
36
23
|
/** Stable optional key when the same element occurs twice within a section. */
|
|
37
24
|
itemKey?: string;
|
|
38
|
-
/**
|
|
25
|
+
/** @internal Presentation identity assigned by a section; assets retain element identity. */
|
|
39
26
|
occurrence?: string;
|
|
27
|
+
/** Stable element identity, shared with the detail document. */
|
|
40
28
|
id: string;
|
|
29
|
+
/** Ordinary link to the detail page. */
|
|
41
30
|
href: string;
|
|
31
|
+
/** Short label above the title; the helper supplies an empty string when omitted. */
|
|
42
32
|
eyebrow: string;
|
|
33
|
+
/** Visible card title. */
|
|
43
34
|
title: string;
|
|
35
|
+
/** Plain-text feature labels for compact card presentation. */
|
|
44
36
|
features: string[];
|
|
45
|
-
/** Temporary asset metadata for the catalog renderer while manifests are introduced. */
|
|
46
|
-
stage?: SpatialStageConfig;
|
|
47
37
|
}
|
|
48
38
|
/** Shared CSS-glass controls for regular element sections. */
|
|
49
39
|
export interface SpatialSectionTheme {
|
|
@@ -66,16 +56,25 @@ export interface SpatialDockedPanelTheme {
|
|
|
66
56
|
}
|
|
67
57
|
/** Shared visual language supplied by a brand layout to element pages beneath it. */
|
|
68
58
|
export interface SpatialTheme {
|
|
59
|
+
/** Stable namespace shared by pages and transitions, e.g. `shop`. Not an element ID. */
|
|
69
60
|
id: string;
|
|
61
|
+
/** Human-readable brand name used in accessible labels. */
|
|
70
62
|
name: string;
|
|
71
63
|
/** Opaque CSS/Three.js color behind content and the independently revealed HDR stage. */
|
|
72
64
|
background: string;
|
|
65
|
+
/** Shared minimap appearance; element-specific framing belongs in SpatialElementData.minimap. */
|
|
73
66
|
minimapTheme: SpatialMinimapTheme;
|
|
67
|
+
/** Hover/selection outline appearance. */
|
|
74
68
|
interactionTheme: Partial<StageInteractionTheme>;
|
|
69
|
+
/** Panel corner radius and content padding, in CSS pixels. */
|
|
75
70
|
panelShape: StagePanelShape;
|
|
71
|
+
/** Default panel material. `frosted` uses CSS blur; `glass` also uses GPU refraction. */
|
|
76
72
|
panelTheme: StagePanelTheme;
|
|
73
|
+
/** Appearance of the compact header and tabs shown after scrolling past the hero. */
|
|
77
74
|
dockedPanelTheme: SpatialDockedPanelTheme;
|
|
75
|
+
/** Appearance of ordinary HTML content sections. */
|
|
78
76
|
sectionTheme: SpatialSectionTheme;
|
|
77
|
+
/** Semantic text, action and navigation colors. */
|
|
79
78
|
colors: {
|
|
80
79
|
ink: string;
|
|
81
80
|
body: string;
|
|
@@ -139,23 +138,54 @@ export interface SpatialElementSectionDefinition {
|
|
|
139
138
|
}
|
|
140
139
|
/** Minimal section metadata consumed by generated element navigation. */
|
|
141
140
|
export type SpatialElementSectionNavigationItem = Pick<SpatialElementSectionDefinition, 'id' | 'title'>;
|
|
142
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Serializable element content AND its 3D presentation. Supply the same source data to
|
|
143
|
+
* getSpatialListItems on a category page and SpatialElementPage on the detail page.
|
|
144
|
+
* Only id, title, geometry and hdr are required. Layout-wide appearance belongs in SpatialTheme.
|
|
145
|
+
*/
|
|
143
146
|
export interface SpatialElementData {
|
|
147
|
+
/** Stable element identity within the shell's theme namespace; also used by findSpatialElement. */
|
|
144
148
|
id: string;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
149
|
+
/** Optional identity assertion. When supplied, must match the enclosing theme.id. */
|
|
150
|
+
brandId?: string;
|
|
151
|
+
/** Document title. Defaults to title. */
|
|
152
|
+
pageTitle?: string;
|
|
153
|
+
/** Short category/series label displayed above the title. Defaults to an empty string. */
|
|
154
|
+
eyebrow?: string;
|
|
155
|
+
/** Visible element name. */
|
|
148
156
|
title: string;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
/** Summary bullets. Defaults to an empty list. */
|
|
158
|
+
features?: SpatialElementFeature[];
|
|
159
|
+
/** Optional primary action; omitted actions render no button. */
|
|
160
|
+
action?: SpatialElementAction;
|
|
161
|
+
/** Required Low/High model sources. Identical URLs share one load; both exports must share coordinates. */
|
|
162
|
+
geometry: SpatialElementGeometry;
|
|
163
|
+
/** Detail lighting and background HDR. Category lighting is explicitly set on ContentPage.hdr. */
|
|
164
|
+
hdr: string;
|
|
165
|
+
/** HDR background blur/tint. Does not change the theme's flat page background or model lighting. */
|
|
166
|
+
background?: BackgroundSettings;
|
|
167
|
+
/** Imported model pose, excluded meshes and material replacements. Rotations are in radians. */
|
|
168
|
+
model?: StageModelSettings;
|
|
169
|
+
/** Initial orbit in degrees and optional fit controls. Distance is fitted automatically. */
|
|
170
|
+
camera?: StageCameraSettings;
|
|
171
|
+
/** Advanced verified resource manifest. Omit for the normal GLB/LOD workflow. */
|
|
172
|
+
assetManifest?: VerifiedSpatialElementAssetManifest;
|
|
173
|
+
/** Poster URL displayed during loading, without JavaScript, or when WebGPU is unavailable. */
|
|
174
|
+
fallbackImage?: string;
|
|
175
|
+
/** Actual poster pixel dimensions [width, height], not physical model dimensions. */
|
|
176
|
+
fallbackImageSize?: readonly [number, number];
|
|
177
|
+
/** Navigation trail. Entries without href are plain text; defaults to an empty list. */
|
|
178
|
+
breadcrumbs?: SpatialElementBreadcrumb[];
|
|
179
|
+
/** Media rail entries. Defaults to one interactive 3D minimap; [] hides the rail's entries. */
|
|
180
|
+
media?: SpatialElementMediaItem[];
|
|
181
|
+
/** Element-specific minimap fit/hover/docked pose. Colors come from the theme. */
|
|
154
182
|
minimap?: Omit<StagePanelMinimapOptions, keyof SpatialMinimapTheme>;
|
|
155
183
|
}
|
|
156
184
|
/** Brand-wide minimap appearance; framing and model pose remain spatial-element-specific. */
|
|
157
185
|
export type SpatialMinimapTheme = Pick<StagePanelMinimapOptions, 'expandedHeight' | 'overlayColor' | 'overlayOpacity' | 'overlayBlur' | 'contextColor' | 'contextOpacity' | 'viewportColor'>;
|
|
186
|
+
/** Category/content page metadata; only title is required. */
|
|
158
187
|
export interface ContentPageData {
|
|
188
|
+
/** Browser document title; defaults to title. */
|
|
159
189
|
pageTitle?: string;
|
|
160
190
|
title: string;
|
|
161
191
|
eyebrow?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EACX,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACX,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,MAAM,0BAA0B,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,OAAO,CAC/C,IAAI,CACH,kBAAkB,EAChB,UAAU,GACV,KAAK,GACL,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,eAAe,GACf,eAAe,GACf,mBAAmB,CACrB,CACD;IACA,mGAAmG;IACnG,IAAI,CAAC,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAC/D,sFAAsF;IACtF,OAAO,CAAC,EAAE;QACT,QAAQ,EAAE,qBAAqB,EAAE,CAAC;QAClC,MAAM,CAAC,EAAE,oBAAoB,CAAC;QAC9B,qEAAqE;QACrE,WAAW,CAAC,EAAE;YAAE,IAAI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,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,wFAAwF;IACxF,WAAW,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACzC,+FAA+F;IAC/F,KAAK,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAClC,kFAAkF;IAClF,OAAO,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,mBAAmB,CAAC,CAAC;CACpE;AAED,6FAA6F;AAC7F,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACrC,wBAAwB,EACtB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,eAAe,CACjB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,WAAW,eAAe;IAC/B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { VerifiedSpatialElementAssetManifest } from '../catalog/spatialElementAssets.js';\nimport type {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/spatial-element/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { VerifiedSpatialElementAssetManifest } from '../catalog/spatialElementAssets.js';\nimport type { SpatialElementGeometry } from './spatialElementGeometry.js';\nimport type {\n\tBackgroundSettings,\n\tStageCameraSettings,\n\tStageInteractionTheme,\n\tStageModelSettings\n} from '../stage/stageTypes.js';\nimport type {\n\tStagePanelMinimapOptions,\n\tStagePanelShape,\n\tStagePanelTheme\n} from '../stage/panelContext.js';\n\n/**\n * Category-card projection created by {@link getSpatialListItems}.\n * Includes the element's assets automatically; pass these items to ListSection or CarouselSection.\n * Detail-only media and breadcrumbs are omitted. No catalog data belongs in the layout.\n */\nexport interface SpatialListItem extends Partial<\n\tPick<\n\t\tSpatialElementData,\n\t\t| 'geometry'\n\t\t| 'hdr'\n\t\t| 'background'\n\t\t| 'model'\n\t\t| 'camera'\n\t\t| 'assetManifest'\n\t\t| 'fallbackImage'\n\t\t| 'fallbackImageSize'\n\t>\n> {\n\t/** @internal Runtime-only pose provider installed by a section, never serialized in route data. */\n\tpose?: import('../catalog/catalogPose.js').CatalogPoseProvider;\n\t/** Optional full summary projection, sourced from the same document as the DETAIL. */\n\tsummary?: {\n\t\tfeatures: SpatialElementFeature[];\n\t\taction?: SpatialElementAction;\n\t\t/** Optional authored link to an existing element content section. */\n\t\tsectionLink?: { href: string; label: string };\n\t};\n\t/** Stable optional key when the same element occurs twice within a section. */\n\titemKey?: string;\n\t/** @internal Presentation identity assigned by a section; assets retain element identity. */\n\toccurrence?: string;\n\t/** Stable element identity, shared with the detail document. */\n\tid: string;\n\t/** Ordinary link to the detail page. */\n\thref: string;\n\t/** Short label above the title; the helper supplies an empty string when omitted. */\n\teyebrow: string;\n\t/** Visible card title. */\n\ttitle: string;\n\t/** Plain-text feature labels for compact card presentation. */\n\tfeatures: string[];\n}\n\n/** Shared CSS-glass controls for regular element sections. */\nexport interface SpatialSectionTheme {\n\ttint: string;\n\t/** Direct tint opacity from zero to one. */\n\ttintOpacity: number;\n\t/** CSS backdrop blur radius in pixels. */\n\tbackdropBlur: number;\n}\n\n/** CSS material used only by the fixed element header and its docked subnavigation. */\nexport interface SpatialDockedPanelTheme {\n\t/** Gaussian CSS backdrop blur radius in pixels. */\n\tbackdropBlur: number;\n\t/** Surface tint, using the same color representation as a stage panel. */\n\ttint: NonNullable<StagePanelTheme['tint']>;\n\t/** Direct tint opacity from zero to one. */\n\ttintOpacity: number;\n\t/** Normalized shadow intensity from zero to one. */\n\tshadowIntensity: number;\n}\n\n/** Shared visual language supplied by a brand layout to element pages beneath it. */\nexport interface SpatialTheme {\n\t/** Stable namespace shared by pages and transitions, e.g. `shop`. Not an element ID. */\n\tid: string;\n\t/** Human-readable brand name used in accessible labels. */\n\tname: string;\n\t/** Opaque CSS/Three.js color behind content and the independently revealed HDR stage. */\n\tbackground: string;\n\t/** Shared minimap appearance; element-specific framing belongs in SpatialElementData.minimap. */\n\tminimapTheme: SpatialMinimapTheme;\n\t/** Hover/selection outline appearance. */\n\tinteractionTheme: Partial<StageInteractionTheme>;\n\t/** Panel corner radius and content padding, in CSS pixels. */\n\tpanelShape: StagePanelShape;\n\t/** Default panel material. `frosted` uses CSS blur; `glass` also uses GPU refraction. */\n\tpanelTheme: StagePanelTheme;\n\t/** Appearance of the compact header and tabs shown after scrolling past the hero. */\n\tdockedPanelTheme: SpatialDockedPanelTheme;\n\t/** Appearance of ordinary HTML content sections. */\n\tsectionTheme: SpatialSectionTheme;\n\t/** Semantic text, action and navigation colors. */\n\tcolors: {\n\t\tink: string;\n\t\tbody: string;\n\t\taccent: string;\n\t\tonAccent: string;\n\t\ttabBackground: string;\n\t};\n}\n\n/** A single line in the spatial-element-summary feature list. */\nexport interface SpatialElementFeature {\n\tlabel: string;\n\t/** Optional short marker displayed before the feature text. */\n\tmarker?: string;\n}\n\n/** Primary conversion action displayed in the element summary panel. */\nexport interface SpatialElementAction {\n\tlabel: string;\n\t/** Stable behavior identity for shared presentation; never supplies an event handler. */\n\tsemanticId?: string;\n\thref?: string;\n\tariaLabel?: string;\n}\n\n/** A breadcrumb link or terminal breadcrumb label. */\nexport interface SpatialElementBreadcrumb {\n\tlabel: string;\n\thref?: string;\n}\n\n/** Media entries rendered in the element rail. */\nexport type SpatialElementMediaItem =\n\t| { id: string; kind: 'minimap'; label: string }\n\t| { id: string; kind: 'drawing'; label: string }\n\t| { id: string; kind: 'image'; label: string; src: string; alt: string };\n\n/** Optional CSS presentation for a regular HTML element section. */\nexport interface SpatialElementSectionStyle {\n\t/** Overrides the brand section tint. */\n\ttint?: string;\n\t/** Overrides the brand section tint opacity from zero to one. */\n\ttintOpacity?: number;\n\t/** Overrides the brand section backdrop blur radius in pixels. */\n\tbackdropBlur?: number;\n\ttextColor?: string;\n\t/** CSS max-width such as `920px`, `72rem`, or `100%`. */\n\twidth?: string;\n}\n\n/** Metadata supplied to a composable spatial-element `Section`. */\nexport interface SpatialElementSectionDefinition {\n\tid: string;\n\ttitle: string;\n\tstyle?: SpatialElementSectionStyle;\n}\n\n/** Minimal section metadata consumed by generated element navigation. */\nexport type SpatialElementSectionNavigationItem = Pick<\n\tSpatialElementSectionDefinition,\n\t'id' | 'title'\n>;\n\n/**\n * Serializable element content AND its 3D presentation. Supply the same source data to\n * getSpatialListItems on a category page and SpatialElementPage on the detail page.\n * Only id, title, geometry and hdr are required. Layout-wide appearance belongs in SpatialTheme.\n */\nexport interface SpatialElementData {\n\t/** Stable element identity within the shell's theme namespace; also used by findSpatialElement. */\n\tid: string;\n\t/** Optional identity assertion. When supplied, must match the enclosing theme.id. */\n\tbrandId?: string;\n\t/** Document title. Defaults to title. */\n\tpageTitle?: string;\n\t/** Short category/series label displayed above the title. Defaults to an empty string. */\n\teyebrow?: string;\n\t/** Visible element name. */\n\ttitle: string;\n\t/** Summary bullets. Defaults to an empty list. */\n\tfeatures?: SpatialElementFeature[];\n\t/** Optional primary action; omitted actions render no button. */\n\taction?: SpatialElementAction;\n\t/** Required Low/High model sources. Identical URLs share one load; both exports must share coordinates. */\n\tgeometry: SpatialElementGeometry;\n\t/** Detail lighting and background HDR. Category lighting is explicitly set on ContentPage.hdr. */\n\thdr: string;\n\t/** HDR background blur/tint. Does not change the theme's flat page background or model lighting. */\n\tbackground?: BackgroundSettings;\n\t/** Imported model pose, excluded meshes and material replacements. Rotations are in radians. */\n\tmodel?: StageModelSettings;\n\t/** Initial orbit in degrees and optional fit controls. Distance is fitted automatically. */\n\tcamera?: StageCameraSettings;\n\t/** Advanced verified resource manifest. Omit for the normal GLB/LOD workflow. */\n\tassetManifest?: VerifiedSpatialElementAssetManifest;\n\t/** Poster URL displayed during loading, without JavaScript, or when WebGPU is unavailable. */\n\tfallbackImage?: string;\n\t/** Actual poster pixel dimensions [width, height], not physical model dimensions. */\n\tfallbackImageSize?: readonly [number, number];\n\t/** Navigation trail. Entries without href are plain text; defaults to an empty list. */\n\tbreadcrumbs?: SpatialElementBreadcrumb[];\n\t/** Media rail entries. Defaults to one interactive 3D minimap; [] hides the rail's entries. */\n\tmedia?: SpatialElementMediaItem[];\n\t/** Element-specific minimap fit/hover/docked pose. Colors come from the theme. */\n\tminimap?: Omit<StagePanelMinimapOptions, keyof SpatialMinimapTheme>;\n}\n\n/** Brand-wide minimap appearance; framing and model pose remain spatial-element-specific. */\nexport type SpatialMinimapTheme = Pick<\n\tStagePanelMinimapOptions,\n\t| 'expandedHeight'\n\t| 'overlayColor'\n\t| 'overlayOpacity'\n\t| 'overlayBlur'\n\t| 'contextColor'\n\t| 'contextOpacity'\n\t| 'viewportColor'\n>;\n\n/** Category/content page metadata; only title is required. */\nexport interface ContentPageData {\n\t/** Browser document title; defaults to title. */\n\tpageTitle?: string;\n\ttitle: string;\n\teyebrow?: string;\n\tintro?: string;\n\tbreadcrumbs?: SpatialElementBreadcrumb[];\n}\n"]}
|
|
@@ -33,6 +33,8 @@ export declare class LiquidGlassPanel {
|
|
|
33
33
|
readonly group: THREE.Group<THREE.Object3DEventMap>;
|
|
34
34
|
readonly options: Required<LiquidGlassPanelOptions>;
|
|
35
35
|
private readonly geometryOptions;
|
|
36
|
+
private readonly authoredBezel;
|
|
37
|
+
private readonly authoredRadius;
|
|
36
38
|
private readonly backdropGeometry;
|
|
37
39
|
private readonly bezelGeometry;
|
|
38
40
|
private readonly shadowLayers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiquidGlassPanel.d.ts","sourceRoot":"","sources":["../../src/stage/LiquidGlassPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AA6BtC,OAAO,KAAK,EAAE,mBA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;
|
|
63
|
+
authoredRadius;
|
|
62
64
|
backdropGeometry;
|
|
63
65
|
bezelGeometry;
|
|
64
66
|
shadowLayers;
|
|
@@ -69,6 +71,10 @@ export class LiquidGlassPanel {
|
|
|
69
71
|
backdropProjection;
|
|
70
72
|
constructor(backdropTexture, options = {}) {
|
|
71
73
|
this.options = resolveLiquidGlassPanelOptions(options);
|
|
74
|
+
// Hidden native popovers initially measure 1px. Keep the authored optical
|
|
75
|
+
// dimensions so opening/resizing does not permanently flatten their glass edge.
|
|
76
|
+
this.authoredBezel = Math.max(0, finiteOr(options.bezel ?? DEFAULT_OPTIONS.bezel, DEFAULT_OPTIONS.bezel));
|
|
77
|
+
this.authoredRadius = Math.max(0, finiteOr(options.radius ?? DEFAULT_OPTIONS.radius, DEFAULT_OPTIONS.radius));
|
|
72
78
|
this.geometryOptions = {
|
|
73
79
|
...this.options,
|
|
74
80
|
position: { ...this.options.position }
|
|
@@ -122,10 +128,11 @@ export class LiquidGlassPanel {
|
|
|
122
128
|
return;
|
|
123
129
|
this.backdropTextureNode.value = backdropTexture;
|
|
124
130
|
}
|
|
125
|
-
setVisualSize(width, height, radius = this.
|
|
131
|
+
setVisualSize(width, height, radius = this.authoredRadius) {
|
|
126
132
|
const nextWidth = Math.max(width, 1);
|
|
127
133
|
const nextHeight = Math.max(height, 1);
|
|
128
134
|
const nextRadius = Math.min(Math.max(radius, 0), nextWidth * 0.5, nextHeight * 0.5);
|
|
135
|
+
const nextBezel = Math.min(this.authoredBezel, nextWidth * 0.5, nextHeight * 0.5);
|
|
129
136
|
if (Math.abs(this.geometryOptions.width - nextWidth) < 0.01 &&
|
|
130
137
|
Math.abs(this.geometryOptions.height - nextHeight) < 0.01 &&
|
|
131
138
|
Math.abs(this.geometryOptions.radius - nextRadius) < 0.01) {
|
|
@@ -134,10 +141,12 @@ export class LiquidGlassPanel {
|
|
|
134
141
|
this.geometryOptions.width = nextWidth;
|
|
135
142
|
this.geometryOptions.height = nextHeight;
|
|
136
143
|
this.geometryOptions.radius = nextRadius;
|
|
144
|
+
this.geometryOptions.bezel = nextBezel;
|
|
137
145
|
this.backdropProjection.panelSize.value.set(nextWidth, nextHeight);
|
|
138
146
|
this.backdropProjection.radius.value = nextRadius;
|
|
147
|
+
this.backdropProjection.bezel.value = nextBezel;
|
|
139
148
|
createRoundedGridGeometry(nextWidth, nextHeight, nextRadius, 128, 82, this.backdropGeometry);
|
|
140
|
-
copyGeometry(this.bezelGeometry, createRoundedBandGeometry(nextWidth, nextHeight, nextRadius, -
|
|
149
|
+
copyGeometry(this.bezelGeometry, createRoundedBandGeometry(nextWidth, nextHeight, nextRadius, -nextBezel, 14, 1.7));
|
|
141
150
|
this.shadowLayers.forEach(({ geometry }, index) => {
|
|
142
151
|
const layer = PANEL_SHADOW_RECIPE[index];
|
|
143
152
|
copyGeometry(geometry, createRoundedBandGeometry(nextWidth, nextHeight, nextRadius, layer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR, Math.max(8, Math.round(layer.blur)), 2.1));
|