Feat v0.6.10 viewport foundation (#45)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #45.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
/**
|
||||
/** @deprecated v0.6.10 — No surface imports AppShell. Layout root is <body> in base.html.
|
||||
* Kept for reference; will be removed in a future version.
|
||||
*
|
||||
* AppShell — Layer 1 layout scaffold
|
||||
*
|
||||
* ┌─────────────────────────────────┐ ← fixed banner (top, optional)
|
||||
@@ -22,20 +24,10 @@
|
||||
const { html } = window;
|
||||
const { useState, useEffect, useRef, useReducer } = hooks;
|
||||
|
||||
/** @deprecated v0.6.10 — Banner height is measured by template scripts in base.html. */
|
||||
function ShellBanner({ position, text, variant = 'info' }) {
|
||||
const ref = useRef(null);
|
||||
const prop = position === 'top' ? '--banner-top-height' : '--banner-bottom-height';
|
||||
|
||||
useEffect(() => {
|
||||
if (ref.current) {
|
||||
const h = ref.current.offsetHeight + 'px';
|
||||
document.documentElement.style.setProperty(prop, h);
|
||||
}
|
||||
return () => document.documentElement.style.setProperty(prop, '0px');
|
||||
}, [text, prop]);
|
||||
|
||||
return html`
|
||||
<div class="sw-shell__banner sw-shell__banner--${position} sw-shell__banner--${variant}" ref=${ref}>
|
||||
<div class="sw-shell__banner sw-shell__banner--${position} sw-shell__banner--${variant}">
|
||||
<span class="sw-shell__banner-text">${text}</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/**
|
||||
/** @deprecated v0.6.10 — No surface imports App. Layout root is <body> in base.html.
|
||||
* Kept for reference; will be removed in a future version.
|
||||
*
|
||||
* App — root component composing the full shell tree
|
||||
*
|
||||
* ┌───────────────────────────────┐
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
/** @deprecated v0.6.10 — No surface imports SurfaceViewport. Layout root is <body> in base.html.
|
||||
*
|
||||
* SurfaceViewport — container where the active surface renders
|
||||
*
|
||||
* Deliberately thin. Error boundaries and
|
||||
|
||||
Reference in New Issue
Block a user