@hanzo/app 0.2.35 → 0.2.36

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/dist/Chrome.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * hanzo.ai's /join does. Log out is the account menu's own (lib/signout). The
15
15
  * session is IAM's: the host mounts `IamProvider`.
16
16
  */
17
- import type { ReactNode } from 'react';
17
+ import { type ReactNode } from 'react';
18
18
  export declare function Chrome({ back }: {
19
19
  back?: ReactNode;
20
20
  }): import("react").JSX.Element;
package/dist/Chrome.js CHANGED
@@ -1,5 +1,22 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * The bar over a focused page: the organization chooser, the way in, the way to
5
+ * pay, a beta application. One bar for all of them, so none draws its own.
6
+ *
7
+ * The brand at the start (`HanzoWordmark`: `brand()` in words, as the site's own bar sets it), going to this
8
+ * host's root; then the host's `back`, where the page has a step to go back to.
9
+ * At the end, once someone is signed in, who it is: the face, the name and the
10
+ * address, with Use another account and Log out. Signed out, nothing but the
11
+ * brand. Under gui's `md` the account folds into its face, a menu of the address
12
+ * and the same two ways out.
13
+ *
14
+ * Use another account writes this page down first (destination.ts
15
+ * `rememberDestination`), so the sign-in that follows comes back to it, as
16
+ * hanzo.ai's /join does. Log out is the account menu's own (lib/signout). The
17
+ * session is IAM's: the host mounts `IamProvider`.
18
+ */
19
+ import { useEffect, useState } from 'react';
3
20
  import { useI18n } from '@hanzo/i18n/react';
4
21
  import { useIam } from '@hanzo/iam/react';
5
22
  import { Text, View, XStack, YStack } from '@hanzo/gui';
@@ -12,6 +29,22 @@ import { brand, site } from './where.js';
12
29
  import { dragWindow, toggleWindowMaximize, WindowControls } from './WindowControls.js';
13
30
  /** The bar's height under the notch: hanzo.ai's masthead's. */
14
31
  const HEIGHT = 60;
32
+ /** The bar's ground once the page has moved under it: the page's own, frosted. At rest it has none. */
33
+ const GLASS = '$background/72';
34
+ const BLUR = 'blur(20px) saturate(1.8)';
35
+ /** How far the page moves before the bar takes a ground: a flick is not a scroll. */
36
+ const MOVED = 8;
37
+ /** Whether the page has scrolled past `MOVED`. */
38
+ function useMoved() {
39
+ const [moved, setMoved] = useState(false);
40
+ useEffect(() => {
41
+ const read = () => setMoved((window.scrollY || document.documentElement.scrollTop || 0) > MOVED);
42
+ read();
43
+ window.addEventListener('scroll', read, { passive: true });
44
+ return () => window.removeEventListener('scroll', read);
45
+ }, []);
46
+ return moved;
47
+ }
15
48
  /** The notch's inset. gui carries a CSS function to the page unchanged; its types only name custom properties. */
16
49
  const NOTCH = 'env(safe-area-inset-top)';
17
50
  export function Chrome({ back }) {
@@ -30,7 +63,8 @@ export function Chrome({ back }) {
30
63
  };
31
64
  const out = () => void signOut();
32
65
  const signed = isAuthenticated && Boolean(who);
33
- return (_jsxs(XStack, { render: "header", "data-slot": "masthead", "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, position: "sticky", t: 0, z: "var(--z-header)", shrink: 0, boxSizing: "content-box", height: HEIGHT, pt: NOTCH, px: 20, gap: 12, items: "center", bg: "var(--background)", borderBottomWidth: 1, borderColor: "var(--border)", children: [_jsx(Text, { render: _jsx("a", { href: "/", "aria-label": t('{brand} home', { brand: brand() }), "data-tauri-drag-region": "deep", onClick: (e) => {
66
+ const moved = useMoved();
67
+ return (_jsxs(XStack, { render: "header", "data-slot": "masthead", "data-scrolled": moved ? 'true' : 'false', "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, position: "sticky", t: 0, z: "var(--z-header)", shrink: 0, boxSizing: "content-box", height: HEIGHT, pt: NOTCH, px: 20, gap: 12, items: "center", bg: moved ? GLASS : 'transparent', backdropFilter: moved ? BLUR : 'none', transition: "quickest", borderBottomWidth: 0, children: [_jsx(Text, { render: _jsx("a", { href: "/", "aria-label": t('{brand} home', { brand: brand() }), "data-tauri-drag-region": "deep", onClick: (e) => {
34
68
  if (typeof document !== 'undefined' && document.documentElement.getAttribute('data-desktop') === 'true') {
35
69
  e.preventDefault();
36
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",