@freeappstore/sdk 0.16.15 → 0.16.17
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 +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/ui/fixtures/fixture-account-settings.d.ts +6 -0
- package/dist/ui/fixtures/fixture-account-settings.d.ts.map +1 -0
- package/dist/ui/fixtures/fixture-account-settings.js +11 -0
- package/dist/ui/fixtures/fixture-account-settings.js.map +1 -0
- package/dist/ui/fixtures/fixture-bottom-nav.d.ts +6 -0
- package/dist/ui/fixtures/fixture-bottom-nav.d.ts.map +1 -0
- package/dist/ui/fixtures/fixture-bottom-nav.js +22 -0
- package/dist/ui/fixtures/fixture-bottom-nav.js.map +1 -0
- package/dist/ui/fixtures/fixture-canvas-reader.d.ts +6 -0
- package/dist/ui/fixtures/fixture-canvas-reader.d.ts.map +1 -0
- package/dist/ui/fixtures/fixture-canvas-reader.js +10 -0
- package/dist/ui/fixtures/fixture-canvas-reader.js.map +1 -0
- package/dist/ui/fixtures/fixture-default-frame.d.ts +6 -0
- package/dist/ui/fixtures/fixture-default-frame.d.ts.map +1 -0
- package/dist/ui/fixtures/fixture-default-frame.js +12 -0
- package/dist/ui/fixtures/fixture-default-frame.js.map +1 -0
- package/dist/ui/fixtures/fixture-sidebar-nav.d.ts +6 -0
- package/dist/ui/fixtures/fixture-sidebar-nav.d.ts.map +1 -0
- package/dist/ui/fixtures/fixture-sidebar-nav.js +22 -0
- package/dist/ui/fixtures/fixture-sidebar-nav.js.map +1 -0
- package/dist/ui/fixtures/router.d.ts +7 -0
- package/dist/ui/fixtures/router.d.ts.map +1 -0
- package/dist/ui/fixtures/router.js +22 -0
- package/dist/ui/fixtures/router.js.map +1 -0
- package/dist/ui/index.d.ts +5 -4
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +3 -2
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/layout.d.ts +9 -3
- package/dist/ui/layout.d.ts.map +1 -1
- package/dist/ui/layout.js +3 -3
- package/dist/ui/layout.js.map +1 -1
- package/dist/ui/profile.d.ts +23 -1
- package/dist/ui/profile.d.ts.map +1 -1
- package/dist/ui/profile.js +36 -4
- package/dist/ui/profile.js.map +1 -1
- package/dist/ui/shell-resilience.d.ts +11 -9
- package/dist/ui/shell-resilience.d.ts.map +1 -1
- package/dist/ui/shell-resilience.js +7 -6
- package/dist/ui/shell-resilience.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -232,7 +232,7 @@ const toast = useToast(); toast.show('Saved', { variant: 'success' });
|
|
|
232
232
|
|
|
233
233
|
`onNavigate` makes nav clicks client-side (scroll and focus are handled on route changes); without it the items are ordinary links. `FasShell` is the same component under its older name. Full reference: [docs/ui.md](../../docs/ui.md#shell-the-standard-app-frame).
|
|
234
234
|
|
|
235
|
-
Omit `profileHref` and the avatar opens the built-in `/profile` page (`ProfilePage`) in both auth states. Set `profileHref` for an app-owned route and render both states yourself. `ProfileMenu` is a legacy dropdown. `Shell` does not mount it. Layout ownership: [composable starter contract](../../docs/composable-starter-contract.md).
|
|
235
|
+
Omit `profileHref` and the avatar opens the built-in `/profile` page (`ProfilePage`) in both auth states. Set `profileHref` for an app-owned route and render both states yourself. `headerActions` is the header control slot. A custom frame uses `ToastProvider`, `AccountSection`, and the router helpers instead of patching the Shell DOM. `ProfileMenu` is a legacy dropdown. `Shell` does not mount it. Layout ownership: [composable starter contract](../../docs/composable-starter-contract.md). Migration: [Migrating from DOM overrides](../../docs/ui.md#migrating-from-dom-overrides).
|
|
236
236
|
|
|
237
237
|
### UI Components
|
|
238
238
|
|
package/dist/logger.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface BuildMeta {
|
|
|
35
35
|
viewport: string;
|
|
36
36
|
theme?: string | undefined;
|
|
37
37
|
}
|
|
38
|
-
export declare const SDK_VERSION = "0.16.
|
|
38
|
+
export declare const SDK_VERSION = "0.16.16";
|
|
39
39
|
export declare class Logger {
|
|
40
40
|
private readonly appId;
|
|
41
41
|
private readonly apiBase;
|
package/dist/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Must track package.json version — bumped on release. Guarded by version.test.ts
|
|
2
2
|
// so a forgotten bump fails CI instead of silently misattributing telemetry.
|
|
3
|
-
export const SDK_VERSION = '0.16.
|
|
3
|
+
export const SDK_VERSION = '0.16.16';
|
|
4
4
|
const MEMORY_LIMIT = 200;
|
|
5
5
|
const STORAGE_LIMIT = 500;
|
|
6
6
|
const STORAGE_KEY_PREFIX = 'fas_logs:';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FreeAppStore } from '../../index.js';
|
|
2
|
+
/** Settings page that embeds the account block and an app-owned field. */
|
|
3
|
+
export declare function AccountSettingsFixture({ app }: {
|
|
4
|
+
app: FreeAppStore;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=fixture-account-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-account-settings.d.ts","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-account-settings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,0EAA0E;AAC1E,wBAAgB,sBAAsB,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,YAAY,CAAA;CAAE,+BAyBpE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { PageHeader } from '../page.js';
|
|
4
|
+
import { AccountSection } from '../profile.js';
|
|
5
|
+
import { SkipLink, ToastProvider } from '../shell-resilience.js';
|
|
6
|
+
/** Settings page that embeds the account block and an app-owned field. */
|
|
7
|
+
export function AccountSettingsFixture({ app }) {
|
|
8
|
+
const mainRef = useRef(null);
|
|
9
|
+
return (_jsx(ToastProvider, { children: _jsxs("div", { className: "flex min-h-[100dvh] flex-col", children: [_jsx(SkipLink, { mainRef: mainRef }), _jsx("header", { className: "border-b border-line px-4 py-3", children: _jsx("span", { className: "font-semibold text-ink", children: "Notes" }) }), _jsxs("main", { id: "main", ref: mainRef, tabIndex: -1, className: "flex-1 px-4", children: [_jsx(PageHeader, { title: "Settings" }), _jsx(AccountSection, { app: app, children: _jsxs("label", { className: "flex flex-col gap-1 text-sm text-ink", children: ["Notebook name", _jsx("input", { "aria-label": "Notebook name", defaultValue: "Field notes", className: "rounded-sm border border-line bg-panel p-2" })] }) })] })] }) }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=fixture-account-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-account-settings.js","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-account-settings.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjE,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB,CAAC,EAAE,GAAG,EAAyB;IACnE,MAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC1C,OAAO,CACL,KAAC,aAAa,cACZ,eAAK,SAAS,EAAC,8BAA8B,aAC3C,KAAC,QAAQ,IAAC,OAAO,EAAE,OAAO,GAAI,EAC9B,iBAAQ,SAAS,EAAC,gCAAgC,YAChD,eAAM,SAAS,EAAC,wBAAwB,sBAAa,GAC9C,EACT,gBAAM,EAAE,EAAC,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,EAAC,aAAa,aACjE,KAAC,UAAU,IAAC,KAAK,EAAC,UAAU,GAAG,EAC/B,KAAC,cAAc,IAAC,GAAG,EAAE,GAAG,YACtB,iBAAO,SAAS,EAAC,sCAAsC,8BAErD,8BACa,eAAe,EAC1B,YAAY,EAAC,aAAa,EAC1B,SAAS,EAAC,4CAA4C,GACtD,IACI,GACO,IACZ,IACH,GACQ,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FreeAppStore } from '../../index.js';
|
|
2
|
+
/** Custom frame with the primary nav along the bottom. Detail routes add no item. */
|
|
3
|
+
export declare function BottomNavFixture({ app }: {
|
|
4
|
+
app: FreeAppStore;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=fixture-bottom-nav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-bottom-nav.d.ts","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-bottom-nav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAYnD,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,YAAY,CAAA;CAAE,+BAmC9D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { canFollowLink } from '../navigation.js';
|
|
3
|
+
import { PageHeader } from '../page.js';
|
|
4
|
+
import { AccountSection } from '../profile.js';
|
|
5
|
+
import { ShellErrorBoundary, SkipLink, ToastProvider } from '../shell-resilience.js';
|
|
6
|
+
import { useInAppNavigate } from './router.js';
|
|
7
|
+
const ITEMS = [
|
|
8
|
+
{ label: 'Notes', href: '/' },
|
|
9
|
+
{ label: 'Tags', href: '/tags' },
|
|
10
|
+
];
|
|
11
|
+
/** Custom frame with the primary nav along the bottom. Detail routes add no item. */
|
|
12
|
+
export function BottomNavFixture({ app }) {
|
|
13
|
+
const { location, mainRef, navigate } = useInAppNavigate();
|
|
14
|
+
const follow = (event, href) => {
|
|
15
|
+
if (!canFollowLink(event, href))
|
|
16
|
+
return;
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
navigate(href);
|
|
19
|
+
};
|
|
20
|
+
return (_jsx(ToastProvider, { children: _jsxs("div", { className: "flex min-h-[100dvh] flex-col pb-[env(safe-area-inset-bottom,0px)]", children: [_jsx(SkipLink, { mainRef: mainRef }), _jsxs("header", { className: "flex items-center justify-between gap-3 border-b border-line px-4 py-2", children: [_jsx("span", { className: "truncate font-semibold text-ink", children: "Notes" }), _jsx(AccountSection, { app: app, location: location, onNavigate: navigate })] }), _jsx(ShellErrorBoundary, { app: app, resetKey: location, children: _jsx("main", { id: "main", ref: mainRef, tabIndex: -1, className: "flex-1", children: _jsx(PageHeader, { title: location.startsWith('/tags') ? 'Tags' : 'Notes' }) }) }), _jsx("nav", { "aria-label": "Main", className: "sticky bottom-0 flex border-t border-line bg-panel", children: ITEMS.map((item) => (_jsx("a", { href: item.href, className: "inline-flex min-h-11 flex-1 items-center justify-center text-ink no-underline", onClick: (event) => follow(event, item.href), children: item.label }, item.href))) })] }) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=fixture-bottom-nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-bottom-nav.js","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-bottom-nav.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MA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AE,CAAC,CACnB,YAEE,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAC,+EAA+E,EACzF,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,YAE3C,IAAI,CAAC,KAAK,IALN,IAAI,CAAC,IAAI,CAMZ,CACL,CAAC,GACE,IACF,GACQ,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FreeAppStore } from '../../index.js';
|
|
2
|
+
/** Focused canvas. Gesture locking stays on the canvas, and there is no nav item. */
|
|
3
|
+
export declare function CanvasReaderFixture({ app }: {
|
|
4
|
+
app: FreeAppStore;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=fixture-canvas-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-canvas-reader.d.ts","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-canvas-reader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,YAAY,CAAA;CAAE,+BAkBjE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { AccountSection } from '../profile.js';
|
|
4
|
+
import { ShellErrorBoundary, SkipLink, ToastProvider } from '../shell-resilience.js';
|
|
5
|
+
/** Focused canvas. Gesture locking stays on the canvas, and there is no nav item. */
|
|
6
|
+
export function CanvasReaderFixture({ app }) {
|
|
7
|
+
const mainRef = useRef(null);
|
|
8
|
+
return (_jsx(ToastProvider, { children: _jsxs("div", { className: "flex min-h-[100dvh] flex-col", children: [_jsx(SkipLink, { mainRef: mainRef }), _jsxs("header", { className: "flex items-center justify-between gap-3 border-b border-line px-4 py-2", children: [_jsx("span", { className: "truncate font-semibold text-ink", children: "Sketch" }), _jsx(AccountSection, { app: app })] }), _jsx(ShellErrorBoundary, { app: app, resetKey: "/", children: _jsx("main", { id: "main", ref: mainRef, tabIndex: -1, className: "flex flex-1 flex-col", children: _jsx("canvas", { "aria-label": "Drawing canvas", className: "touch-none h-[70dvh] w-full" }) }) })] }) }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=fixture-canvas-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-canvas-reader.js","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-canvas-reader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAErF,qFAAqF;AACrF,MAAM,UAAU,mBAAmB,CAAC,EAAE,GAAG,EAAyB;IAChE,MAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC1C,OAAO,CACL,KAAC,aAAa,cACZ,eAAK,SAAS,EAAC,8BAA8B,aAC3C,KAAC,QAAQ,IAAC,OAAO,EAAE,OAAO,GAAI,EAC9B,kBAAQ,SAAS,EAAC,wEAAwE,aACxF,eAAM,SAAS,EAAC,iCAAiC,uBAAc,EAC/D,KAAC,cAAc,IAAC,GAAG,EAAE,GAAG,GAAI,IACrB,EACT,KAAC,kBAAkB,IAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAC,GAAG,YACxC,eAAM,EAAE,EAAC,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,EAAC,sBAAsB,YAC1E,+BAAmB,gBAAgB,EAAC,SAAS,EAAC,6BAA6B,GAAG,GACzE,GACY,IACjB,GACQ,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FreeAppStore } from '../../index.js';
|
|
2
|
+
/** Default Shell with an app button in the header control slot. */
|
|
3
|
+
export declare function DefaultFrameFixture({ app }: {
|
|
4
|
+
app: FreeAppStore;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=fixture-default-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-default-frame.d.ts","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-default-frame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAUnD,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,YAAY,CAAA;CAAE,+BAejE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Shell } from '../layout.js';
|
|
3
|
+
import { PageHeader } from '../page.js';
|
|
4
|
+
const NAV = [
|
|
5
|
+
{ label: 'Notes', href: '/', title: 'Notes' },
|
|
6
|
+
{ label: 'Tags', href: '/tags', title: 'Tags — Notes' },
|
|
7
|
+
];
|
|
8
|
+
/** Default Shell with an app button in the header control slot. */
|
|
9
|
+
export function DefaultFrameFixture({ app }) {
|
|
10
|
+
return (_jsx(Shell, { app: app, appName: "Notes", nav: NAV, headerActions: _jsx("button", { type: "button", className: "inline-flex min-h-11 items-center px-3", children: "New" }), children: _jsx(PageHeader, { title: "Notes" }) }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=fixture-default-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-default-frame.js","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-default-frame.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,GAAG,GAAc;IACrB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7C,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;CACxD,CAAC;AAEF,mEAAmE;AACnE,MAAM,UAAU,mBAAmB,CAAC,EAAE,GAAG,EAAyB;IAChE,OAAO,CACL,KAAC,KAAK,IACJ,GAAG,EAAE,GAAG,EACR,OAAO,EAAC,OAAO,EACf,GAAG,EAAE,GAAG,EACR,aAAa,EACX,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,wCAAwC,oBAE/D,YAGX,KAAC,UAAU,IAAC,KAAK,EAAC,OAAO,GAAG,GACtB,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FreeAppStore } from '../../index.js';
|
|
2
|
+
/** Custom frame: one header, a sidebar nav, and the shared account block. */
|
|
3
|
+
export declare function SidebarNavFixture({ app }: {
|
|
4
|
+
app: FreeAppStore;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=fixture-sidebar-nav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-sidebar-nav.d.ts","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-sidebar-nav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAYnD,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,YAAY,CAAA;CAAE,+BAwC/D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { canFollowLink } from '../navigation.js';
|
|
3
|
+
import { PageHeader } from '../page.js';
|
|
4
|
+
import { AccountSection } from '../profile.js';
|
|
5
|
+
import { ShellErrorBoundary, SkipLink, ToastProvider } from '../shell-resilience.js';
|
|
6
|
+
import { useInAppNavigate } from './router.js';
|
|
7
|
+
const ITEMS = [
|
|
8
|
+
{ label: 'Notes', href: '/' },
|
|
9
|
+
{ label: 'Tags', href: '/tags' },
|
|
10
|
+
];
|
|
11
|
+
/** Custom frame: one header, a sidebar nav, and the shared account block. */
|
|
12
|
+
export function SidebarNavFixture({ app }) {
|
|
13
|
+
const { location, mainRef, navigate } = useInAppNavigate();
|
|
14
|
+
const follow = (event, href) => {
|
|
15
|
+
if (!canFollowLink(event, href))
|
|
16
|
+
return;
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
navigate(href);
|
|
19
|
+
};
|
|
20
|
+
return (_jsx(ToastProvider, { children: _jsxs("div", { className: "flex min-h-[100dvh]", children: [_jsx(SkipLink, { mainRef: mainRef }), _jsx("nav", { "aria-label": "Main", className: "flex w-56 shrink-0 flex-col gap-1 border-r border-line p-3", children: ITEMS.map((item) => (_jsx("a", { href: item.href, className: "inline-flex min-h-11 items-center rounded-sm px-3 text-ink no-underline", onClick: (event) => follow(event, item.href), children: item.label }, item.href))) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsxs("header", { className: "flex items-center justify-between gap-3 border-b border-line px-4 py-2", children: [_jsx("span", { className: "truncate font-semibold text-ink", children: "Notes" }), _jsx(AccountSection, { app: app, location: location, onNavigate: navigate })] }), _jsx(ShellErrorBoundary, { app: app, resetKey: location, children: _jsx("main", { id: "main", ref: mainRef, tabIndex: -1, className: "flex-1", children: _jsx(PageHeader, { title: location.startsWith('/tags') ? 'Tags' : 'Notes' }) }) })] })] }) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=fixture-sidebar-nav.js.map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,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,YAE3C,IAAI,CAAC,KAAK,IALN,IAAI,CAAC,IAAI,CAMZ,CACL,CAAC,GACE,EACN,eAAK,SAAS,EAAC,8BAA8B,aAC3C,kBAAQ,SAAS,EAAC,wEAAwE,aACxF,eAAM,SAAS,EAAC,iCAAiC,sBAAa,EAC9D,KAAC,cAAc,IAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,GAAI,IAC/D,EACT,KAAC,kBAAkB,IAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,YAC9C,eAAM,EAAE,EAAC,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,EAAC,QAAQ,YAC5D,KAAC,UAAU,IAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,GAAI,GACjE,GACY,IACjB,IACF,GACQ,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Client-side history helper shared by the custom-frame fixtures. */
|
|
2
|
+
export declare function useInAppNavigate(): {
|
|
3
|
+
location: string;
|
|
4
|
+
mainRef: import("react").RefObject<HTMLElement | null>;
|
|
5
|
+
navigate: (href: string) => void;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/ui/fixtures/router.tsx"],"names":[],"mappings":"AAIA,sEAAsE;AACtE,wBAAgB,gBAAgB;;;qBAIN,MAAM;EAY/B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { isLocalRoute, routeHref, routeUrl, useCurrentLocation } from '../navigation.js';
|
|
3
|
+
import { useRouteChangeEffects } from '../shell-resilience.js';
|
|
4
|
+
/** Client-side history helper shared by the custom-frame fixtures. */
|
|
5
|
+
export function useInAppNavigate() {
|
|
6
|
+
const mainRef = useRef(null);
|
|
7
|
+
const [location, setLocation] = useCurrentLocation();
|
|
8
|
+
const beforeNavigate = useRouteChangeEffects(location, mainRef, true);
|
|
9
|
+
const navigate = (href) => {
|
|
10
|
+
const destination = routeUrl(href);
|
|
11
|
+
if (!destination || !isLocalRoute(destination)) {
|
|
12
|
+
window.location.assign(href);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
beforeNavigate();
|
|
16
|
+
const next = routeHref(destination);
|
|
17
|
+
window.history.pushState(null, '', next);
|
|
18
|
+
setLocation(next);
|
|
19
|
+
};
|
|
20
|
+
return { location, mainRef, navigate };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../src/ui/fixtures/router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,sEAAsE;AACtE,MAAM,UAAU,gBAAgB;IAC9B,MAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,kBAAkB,EAAE,CAAC;IACrD,MAAM,cAAc,GAAG,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACtE,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE;QAChC,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC7B,OAAO;QACT,CAAC;QACD,cAAc,EAAE,CAAC;QACjB,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;QACpC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACzC,CAAC"}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -4,14 +4,15 @@ export type { AvatarProps, SignInButtonProps } from './core.js';
|
|
|
4
4
|
export { Avatar, SignInButton, TextSizeToggle, ThemeToggle, useTextSize } from './core.js';
|
|
5
5
|
export type { AddFriendButtonProps, FriendRequestBadgeProps, FriendsListProps } from './friends.js';
|
|
6
6
|
export { AddFriendButton, FriendRequestBadge, FriendsList } from './friends.js';
|
|
7
|
-
export type { ProfileMenuProps, ProfilePageProps, ShellNavContext, ShellProps, ShellProps as FasShellProps, } from './layout.js';
|
|
8
|
-
export { ProfileMenu, ProfilePage, Shell, Shell as FasShell } from './layout.js';
|
|
7
|
+
export type { AccountSectionProps, ProfileMenuProps, ProfilePageProps, ShellNavContext, ShellProps, ShellProps as FasShellProps, } from './layout.js';
|
|
8
|
+
export { AccountSection, ProfileMenu, ProfilePage, Shell, Shell as FasShell } from './layout.js';
|
|
9
9
|
export type { NavBarProps, NavItem } from './navbar.js';
|
|
10
10
|
export { activeHref, NavBar, useCurrentPath } from './navbar.js';
|
|
11
|
+
export { canFollowLink, isLocalRoute, profileReturnHref, routeHref, routeUrl, useCurrentLocation, } from './navigation.js';
|
|
11
12
|
export type { PageHeaderProps } from './page.js';
|
|
12
13
|
export { PageHeader, useDocumentTitle } from './page.js';
|
|
13
|
-
export type { ShellErrorContext, ToastApi, ToastOptions, ToastVariant, } from './shell-resilience.js';
|
|
14
|
-
export { OfflineBanner, useOnline, useToast } from './shell-resilience.js';
|
|
14
|
+
export type { ShellErrorBoundaryProps, ShellErrorContext, ToastApi, ToastOptions, ToastVariant, } from './shell-resilience.js';
|
|
15
|
+
export { OfflineBanner, ShellErrorBoundary, SkipLink, ToastProvider, useOnline, useRouteChangeEffects, useToast, } from './shell-resilience.js';
|
|
15
16
|
export type { VoiceButtonProps, VoiceTextAreaProps } from './voice.js';
|
|
16
17
|
export { VoiceButton, VoiceTextArea } from './voice.js';
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,aAAa,EACb,UAAU,EACV,aAAa,EACb,MAAM,EACN,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,WAAW,EACX,OAAO,EACP,IAAI,EACJ,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3F,YAAY,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpG,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WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjG,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/ui/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { Badge, BuildInfo, Card, ConfirmDialog, EmptyState, ErrorBoundary, Footer, KeyPrompt, ListRow, Modal, ProgressBar, SearchInput, Spinner, Tabs, useStandalone, } from './components.js';
|
|
2
2
|
export { Avatar, SignInButton, TextSizeToggle, ThemeToggle, useTextSize } from './core.js';
|
|
3
3
|
export { AddFriendButton, FriendRequestBadge, FriendsList } from './friends.js';
|
|
4
|
-
export { ProfileMenu, ProfilePage, Shell, Shell as FasShell } from './layout.js';
|
|
4
|
+
export { AccountSection, ProfileMenu, ProfilePage, Shell, Shell as FasShell } from './layout.js';
|
|
5
5
|
export { activeHref, NavBar, useCurrentPath } from './navbar.js';
|
|
6
|
+
export { canFollowLink, isLocalRoute, profileReturnHref, routeHref, routeUrl, useCurrentLocation, } from './navigation.js';
|
|
6
7
|
export { PageHeader, useDocumentTitle } from './page.js';
|
|
7
|
-
export { OfflineBanner, useOnline, useToast } from './shell-resilience.js';
|
|
8
|
+
export { OfflineBanner, ShellErrorBoundary, SkipLink, ToastProvider, useOnline, useRouteChangeEffects, useToast, } from './shell-resilience.js';
|
|
8
9
|
export { VoiceButton, VoiceTextArea } from './voice.js';
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,aAAa,EACb,UAAU,EACV,aAAa,EACb,MAAM,EACN,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,WAAW,EACX,OAAO,EACP,IAAI,EACJ,aAAa,GACd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE3F,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,aAAa,EACb,UAAU,EACV,aAAa,EACb,MAAM,EACN,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,WAAW,EACX,OAAO,EACP,IAAI,EACJ,aAAa,GACd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE3F,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAShF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAQzD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/ui/layout.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import type { FreeAppStore } from '../index.js';
|
|
3
3
|
import { type NavItem } from './navbar.js';
|
|
4
4
|
import { type ShellErrorContext } from './shell-resilience.js';
|
|
5
|
-
export type { ProfileMenuProps, ProfilePageProps } from './profile.js';
|
|
6
|
-
export { ProfileMenu, ProfilePage } from './profile.js';
|
|
5
|
+
export type { AccountSectionProps, ProfileMenuProps, ProfilePageProps } from './profile.js';
|
|
6
|
+
export { AccountSection, ProfileMenu, ProfilePage } from './profile.js';
|
|
7
7
|
export interface ShellNavContext {
|
|
8
8
|
items: NavItem[];
|
|
9
9
|
/** The path the shell considers current (pathname, query and hash, following back/forward). */
|
|
@@ -27,6 +27,12 @@ export interface ShellProps {
|
|
|
27
27
|
nav?: NavItem[];
|
|
28
28
|
/** Replace the built-in NavBar (still placed in the topbar) with your own. */
|
|
29
29
|
renderNav?: (ctx: ShellNavContext) => ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Header control slot. Rendered in the topbar beside the profile avatar,
|
|
32
|
+
* inside `[data-fas-header-actions]`. Put app buttons here instead of
|
|
33
|
+
* patching the header DOM. The avatar stays a profile link.
|
|
34
|
+
*/
|
|
35
|
+
headerActions?: ReactNode;
|
|
30
36
|
/**
|
|
31
37
|
* Client-side navigation for nav clicks (e.g. your router's `navigate`).
|
|
32
38
|
* Without it, nav items are ordinary links (full page load).
|
|
@@ -50,5 +56,5 @@ export interface ShellProps {
|
|
|
50
56
|
* gate. On client-side navigation (`onNavigate`) it scrolls to the top (or back
|
|
51
57
|
* to where the route was left) and moves focus to the new screen's heading.
|
|
52
58
|
*/
|
|
53
|
-
export declare function Shell({ app, children, appName, nav, renderNav, onNavigate, profileHref, renderError, renderLoading, requireAuth, showThemeToggle, }: ShellProps): import("react").JSX.Element;
|
|
59
|
+
export declare function Shell({ app, children, appName, nav, renderNav, headerActions, onNavigate, profileHref, renderError, renderLoading, requireAuth, showThemeToggle, }: ShellProps): import("react").JSX.Element;
|
|
54
60
|
//# sourceMappingURL=layout.d.ts.map
|
package/dist/ui/layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/ui/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAW/D,OAAO,EAGL,KAAK,iBAAiB,EAIvB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/ui/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SA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AAgB,KAAK,CAAC,EACpB,GAAG,EACH,QAAQ,EACR,OAAO,EACP,GAAG,EACH,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAmB,EACnB,eAAsB,GACvB,EAAE,UAAU,+BA2JZ"}
|
package/dist/ui/layout.js
CHANGED
|
@@ -7,7 +7,7 @@ import { activeHref, NavBar } from './navbar.js';
|
|
|
7
7
|
import { canFollowLink, isLocalRoute, profileReturnHref, routeHref, routePath, routeUrl, useCurrentLocation, } from './navigation.js';
|
|
8
8
|
import { ProfilePage } from './profile.js';
|
|
9
9
|
import { OfflineBanner, ShellErrorBoundary, SkipLink, ToastProvider, useRouteChangeEffects, } from './shell-resilience.js';
|
|
10
|
-
export { ProfileMenu, ProfilePage } from './profile.js';
|
|
10
|
+
export { AccountSection, ProfileMenu, ProfilePage } from './profile.js';
|
|
11
11
|
function normalizeShellAppName(appName) {
|
|
12
12
|
return appName === 'AppStore' ? 'FreeAppStore' : appName;
|
|
13
13
|
}
|
|
@@ -17,7 +17,7 @@ function normalizeShellAppName(appName) {
|
|
|
17
17
|
* gate. On client-side navigation (`onNavigate`) it scrolls to the top (or back
|
|
18
18
|
* to where the route was left) and moves focus to the new screen's heading.
|
|
19
19
|
*/
|
|
20
|
-
export function Shell({ app, children, appName, nav, renderNav, onNavigate, profileHref, renderError, renderLoading, requireAuth = false, showThemeToggle = true, }) {
|
|
20
|
+
export function Shell({ app, children, appName, nav, renderNav, headerActions, onNavigate, profileHref, renderError, renderLoading, requireAuth = false, showThemeToggle = true, }) {
|
|
21
21
|
const { user, loading } = useAuth(app);
|
|
22
22
|
const [currentLocation, setCurrentLocation] = useCurrentLocation();
|
|
23
23
|
const currentPath = routeUrl(currentLocation)?.pathname ?? '/';
|
|
@@ -82,7 +82,7 @@ export function Shell({ app, children, appName, nav, renderNav, onNavigate, prof
|
|
|
82
82
|
onNavigate: navigate ?? ((href) => window.location.assign(href)),
|
|
83
83
|
})) : (_jsx(NavBar, { items: navItems, currentPath: currentLocation, ...(navigate ? { onNavigate: navigate } : {}) }));
|
|
84
84
|
const loadingNode = renderLoading ? (renderLoading()) : (_jsx("div", { className: "fas-shell-loading flex flex-1 items-center justify-center px-4 py-12", children: _jsx(Spinner, { size: 28 }) }));
|
|
85
|
-
return (_jsx(ToastProvider, { children: _jsxs("div", { className: "min-h-[100dvh] flex flex-col pb-[env(safe-area-inset-bottom,0px)]", children: [_jsx(SkipLink, { mainRef: mainRef }), _jsxs("header", { className: "flex items-center justify-between p-[0.5rem_1rem] border-b border-line bg-panel sticky top-0 z-[50]", children: [_jsx("div", { className: "min-w-0", children: appName && (_jsx("span", { className: "block truncate text-[1rem] font-semibold text-ink", children: appName })) }), navNode, _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(TextSizeToggle, {}), showThemeToggle && !user && _jsx(ThemeToggle, {}), _jsx("a", { href: profileLink, "aria-label": "Profile", "aria-current": isProfile ? 'page' : undefined, className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-full text-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent", onClick: openProfile, children: _jsx(Avatar, { user: user, size: user ? 32 : 24 }) })] })] }), _jsx(OfflineBanner, {}), _jsx("main", { id: "main", ref: mainRef, tabIndex: -1, className: "fas-main flex-1 flex flex-col", children: _jsx(ShellErrorBoundary, { app: app, renderError: renderError, resetKey: currentLocation, children: _jsx(Suspense, { fallback: loadingNode, children: builtInProfile ? (_jsxs(_Fragment, { children: [_jsx("a", { href: returnHref, className: "self-start m-4 text-accent underline", onClick: (event) => {
|
|
85
|
+
return (_jsx(ToastProvider, { children: _jsxs("div", { className: "min-h-[100dvh] flex flex-col pb-[env(safe-area-inset-bottom,0px)]", children: [_jsx(SkipLink, { mainRef: mainRef }), _jsxs("header", { className: "flex items-center justify-between p-[0.5rem_1rem] border-b border-line bg-panel sticky top-0 z-[50]", children: [_jsx("div", { className: "min-w-0", children: appName && (_jsx("span", { className: "block truncate text-[1rem] font-semibold text-ink", children: appName })) }), navNode, _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(TextSizeToggle, {}), showThemeToggle && !user && _jsx(ThemeToggle, {}), headerActions ? (_jsx("div", { "data-fas-header-actions": "", className: "flex items-center gap-2", children: headerActions })) : null, _jsx("a", { href: profileLink, "aria-label": "Profile", "aria-current": isProfile ? 'page' : undefined, className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-full text-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent", onClick: openProfile, children: _jsx(Avatar, { user: user, size: user ? 32 : 24 }) })] })] }), _jsx(OfflineBanner, {}), _jsx("main", { id: "main", ref: mainRef, tabIndex: -1, className: "fas-main flex-1 flex flex-col", children: _jsx(ShellErrorBoundary, { app: app, renderError: renderError, resetKey: currentLocation, children: _jsx(Suspense, { fallback: loadingNode, children: builtInProfile ? (_jsxs(_Fragment, { children: [_jsx("a", { href: returnHref, className: "self-start m-4 text-accent underline", onClick: (event) => {
|
|
86
86
|
if (!navigate || !canFollowLink(event, returnHref))
|
|
87
87
|
return;
|
|
88
88
|
event.preventDefault();
|
package/dist/ui/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/ui/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,QAAQ,EACR,eAAe,EACf,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,kBAAkB,GACnB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CAAC,CAChB,8BACE,YACE,IAAI,EAAE,UAAU,EAChB,SAAS,EAAC,sCAAsC,EAChD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4CACjB,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC;gDAAE,OAAO;4CAC3D,KAAK,CAAC,cAAc,EAAE,CAAC;4CACvB,QAAQ,CAAC,UAAU,CAAC,CAAC;wCACvB,CAAC,4BAGC,EACJ,KAAC,WAAW,IAAC,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,eAAe,GAAI,IAC1D,CACJ,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CACvC,eAAK,SAAS,EAAC,kEAAkE,aAC/E,aAAI,SAAS,EAAC,kCAAkC,YAC7C,cAAc,IAAI,SAAS,GACzB,EACL,YAAG,SAAS,EAAC,iBAAiB,qCAAyB,EACvD,YAAG,IAAI,EAAE,WAAW,EAAE,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAE,WAAW,wCAExE,IACA,CACP,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,GACQ,GACQ,GAChB,IACH,GACQ,CACjB,CAAC;AACJ,CAAC"}
|
package/dist/ui/profile.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { FreeAppStore } from '../index.js';
|
|
3
|
+
export interface AccountSectionProps {
|
|
4
|
+
app: FreeAppStore;
|
|
5
|
+
/** In-app profile route. Default `/profile`, which keeps a safe `returnTo`. */
|
|
6
|
+
profileHref?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Client-side navigation for the avatar. Without it the avatar is an ordinary
|
|
9
|
+
* link. The avatar never starts sign-in.
|
|
10
|
+
*/
|
|
11
|
+
onNavigate?: (href: string) => void;
|
|
12
|
+
/** Current in-app URL when the app owns the router. Omit to follow the browser. */
|
|
13
|
+
location?: string;
|
|
14
|
+
/** App-specific settings, rendered after the identity block. */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Embeddable account block for a custom sidebar, settings page, or header.
|
|
19
|
+
* Signed out, it offers GitHub and Google and an avatar link to the profile.
|
|
20
|
+
* Signed in, the avatar and name link to the profile. The avatar never signs in.
|
|
21
|
+
*/
|
|
22
|
+
export declare function AccountSection({ app, profileHref, onNavigate, location, children, }: AccountSectionProps): import("react").JSX.Element;
|
|
3
23
|
export interface ProfileMenuProps {
|
|
4
24
|
app: FreeAppStore;
|
|
5
25
|
showThemeToggle?: boolean;
|
|
@@ -10,7 +30,9 @@ export declare function ProfileMenu({ app, showThemeToggle, children }: ProfileM
|
|
|
10
30
|
export interface ProfilePageProps {
|
|
11
31
|
app: FreeAppStore;
|
|
12
32
|
showThemeToggle?: boolean;
|
|
33
|
+
/** App-specific settings, rendered after the built-in account sections. */
|
|
34
|
+
children?: ReactNode;
|
|
13
35
|
}
|
|
14
36
|
/** Full-page profile & preferences: avatar, theme, text size, friends, sign out, delete. */
|
|
15
|
-
export declare function ProfilePage({ app, showThemeToggle }: ProfilePageProps): import("react").JSX.Element;
|
|
37
|
+
export declare function ProfilePage({ app, showThemeToggle, children }: ProfilePageProps): import("react").JSX.Element;
|
|
16
38
|
//# sourceMappingURL=profile.d.ts.map
|
package/dist/ui/profile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/ui/profile.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/ui/profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgDhD,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,YAAY,CAAC;IAClB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,WAAwB,EACxB,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,EAAE,mBAAmB,+BA+CrB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,YAAY,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,EAAE,GAAG,EAAE,eAAsB,EAAE,QAAQ,EAAE,EAAE,gBAAgB,sCAkHtF;AAMD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,YAAY,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,EAAE,GAAG,EAAE,eAAsB,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAwJtF"}
|
package/dist/ui/profile.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
3
3
|
import { useAuth, useTheme } from '../hooks.js';
|
|
4
4
|
import { Modal } from './components.js';
|
|
5
5
|
import { Avatar, SignInButton, ThemeToggle, useTextSize } from './core.js';
|
|
6
6
|
import { FriendRequestBadge, FriendsList } from './friends.js';
|
|
7
|
+
import { canFollowLink, isLocalRoute, routeHref, routePath, routeUrl, useCurrentLocation, } from './navigation.js';
|
|
7
8
|
import { PageHeader } from './page.js';
|
|
8
9
|
/** Shared by both public profile surfaces so failures and duplicate clicks behave alike. */
|
|
9
10
|
function useAccountDeletion(deleteAccount, onDeleted) {
|
|
@@ -34,6 +35,37 @@ function useAccountDeletion(deleteAccount, onDeleted) {
|
|
|
34
35
|
};
|
|
35
36
|
return { pending: deletePending, error: deleteError, remove };
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Embeddable account block for a custom sidebar, settings page, or header.
|
|
40
|
+
* Signed out, it offers GitHub and Google and an avatar link to the profile.
|
|
41
|
+
* Signed in, the avatar and name link to the profile. The avatar never signs in.
|
|
42
|
+
*/
|
|
43
|
+
export function AccountSection({ app, profileHref = '/profile', onNavigate, location, children, }) {
|
|
44
|
+
const { user, loading } = useAuth(app);
|
|
45
|
+
const [currentLocation] = useCurrentLocation(location);
|
|
46
|
+
const target = routeUrl(profileHref);
|
|
47
|
+
const onProfile = isLocalRoute(target) &&
|
|
48
|
+
routePath(currentLocation) === routePath(target.pathname) &&
|
|
49
|
+
(!target.search || routeUrl(currentLocation)?.search === target.search) &&
|
|
50
|
+
(!target.hash || routeUrl(currentLocation)?.hash === target.hash);
|
|
51
|
+
const profileLink = profileHref === '/profile'
|
|
52
|
+
? onProfile
|
|
53
|
+
? currentLocation
|
|
54
|
+
: `/profile?returnTo=${encodeURIComponent(currentLocation)}`
|
|
55
|
+
: target && isLocalRoute(target)
|
|
56
|
+
? routeHref(target)
|
|
57
|
+
: profileHref;
|
|
58
|
+
const openProfile = (event) => {
|
|
59
|
+
if (!onNavigate || !canFollowLink(event, profileLink))
|
|
60
|
+
return;
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
const destination = routeUrl(profileLink);
|
|
63
|
+
if (!destination || destination.href === routeUrl(currentLocation)?.href)
|
|
64
|
+
return;
|
|
65
|
+
onNavigate(routeHref(destination));
|
|
66
|
+
};
|
|
67
|
+
return (_jsxs("section", { "aria-label": "Account", className: "flex flex-col gap-3", children: [_jsxs("a", { href: profileLink, "aria-label": "Profile", className: "inline-flex min-h-11 min-w-11 items-center gap-3 self-start rounded-full text-ink no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent", onClick: openProfile, children: [_jsx(Avatar, { user: user, size: user ? 32 : 24 }), user ? (_jsx("span", { className: "[overflow-wrap:anywhere] font-semibold text-ink", children: user.login })) : null] }), !loading && !user ? (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(SignInButton, { app: app, provider: "github" }), _jsx(SignInButton, { app: app, provider: "google" })] })) : null, children] }));
|
|
68
|
+
}
|
|
37
69
|
/** Avatar button that opens dropdown: username, theme toggle, sign out, delete account. */
|
|
38
70
|
export function ProfileMenu({ app, showThemeToggle = true, children }) {
|
|
39
71
|
const { user, signOut, deleteAccount } = useAuth(app);
|
|
@@ -77,7 +109,7 @@ export function ProfileMenu({ app, showThemeToggle = true, children }) {
|
|
|
77
109
|
}, className: "flex w-full p-[0.5rem_1rem] bg-transparent border-0 text-left text-[0.85rem] cursor-pointer text-ink font-[inherit] items-center justify-between", children: ["Friends ", _jsx(FriendRequestBadge, { app: app })] }), children, _jsx("button", { type: "button", onClick: handleSignOut, className: "block w-full p-[0.5rem_1rem] bg-transparent border-0 text-left text-[0.85rem] cursor-pointer text-ink font-[inherit]", children: "Sign out" }), _jsx("button", { type: "button", disabled: deletePending, onClick: handleDelete, className: "block w-full p-[0.5rem_1rem] bg-transparent border-0 text-left text-[0.85rem] cursor-pointer text-danger font-[inherit]", children: deletePending ? 'Deleting...' : 'Delete account' }), deleteError && (_jsx("p", { role: "alert", className: "px-4 py-2 text-sm text-danger", children: deleteError }))] })), _jsx(Modal, { open: friendsOpen, onClose: () => setFriendsOpen(false), title: "Friends", maxWidth: 420, children: _jsx(FriendsList, { app: app }) })] }));
|
|
78
110
|
}
|
|
79
111
|
/** Full-page profile & preferences: avatar, theme, text size, friends, sign out, delete. */
|
|
80
|
-
export function ProfilePage({ app, showThemeToggle = true }) {
|
|
112
|
+
export function ProfilePage({ app, showThemeToggle = true, children }) {
|
|
81
113
|
const { user, loading, signOut, deleteAccount } = useAuth(app);
|
|
82
114
|
const { preference, setPreference } = useTheme();
|
|
83
115
|
const { size: textSize, setSize: setTextSize } = useTextSize();
|
|
@@ -87,7 +119,7 @@ export function ProfilePage({ app, showThemeToggle = true }) {
|
|
|
87
119
|
return _jsx("div", { className: "p-8 text-center text-muted", children: "Loading..." });
|
|
88
120
|
}
|
|
89
121
|
if (!user) {
|
|
90
|
-
return (_jsxs("div", { className: "mx-auto w-full max-w-120 px-4 py-8", children: [_jsx(PageHeader, { title: "Profile" }), _jsx("p", { className: "text-muted mb-6", children: "Sign in to manage your profile and account." }), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(SignInButton, { app: app, provider: "github" }), _jsx(SignInButton, { app: app, provider: "google" })] })] }));
|
|
122
|
+
return (_jsxs("div", { className: "mx-auto w-full max-w-120 px-4 py-8", children: [_jsx(PageHeader, { title: "Profile" }), _jsx("p", { className: "text-muted mb-6", children: "Sign in to manage your profile and account." }), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(SignInButton, { app: app, provider: "github" }), _jsx(SignInButton, { app: app, provider: "google" })] }), children] }));
|
|
91
123
|
}
|
|
92
124
|
const themeOptions = [
|
|
93
125
|
{ value: 'system', label: 'System' },
|
|
@@ -99,7 +131,7 @@ export function ProfilePage({ app, showThemeToggle = true }) {
|
|
|
99
131
|
{ value: 'default', label: 'Default' },
|
|
100
132
|
{ value: 'lg', label: 'Large' },
|
|
101
133
|
];
|
|
102
|
-
return (_jsxs("div", { className: "w-full max-w-120 m-[0_auto] p-[2rem_1rem]", children: [_jsx(PageHeader, { title: "Profile" }), _jsxs("div", { className: "flex items-center gap-4 mb-8", children: [_jsx("div", { className: "shrink-0", children: _jsx(Avatar, { user: user, size: 64 }) }), _jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "[overflow-wrap:anywhere] text-[1.25rem] font-bold text-ink-strong", children: user.login }), _jsx("div", { className: "text-[0.85rem] text-muted", children: "FreeAppStore account" })] })] }), _jsxs(ProfileSection, { title: "Appearance", children: [showThemeToggle && (_jsxs(_Fragment, { children: [_jsx(ProfileLabel, { children: "Theme" }), _jsx("div", { className: "flex gap-2 mb-4", children: themeOptions.map((opt) => (_jsx(ToggleButton, { active: preference === opt.value, onClick: () => setPreference(opt.value), children: opt.label }, opt.value))) })] })), _jsx(ProfileLabel, { children: "Text Size" }), _jsx("div", { className: "flex gap-2", children: textSizeOptions.map((opt) => (_jsx(ToggleButton, { active: textSize === opt.value, onClick: () => setTextSize(opt.value), children: opt.label }, opt.value))) })] }), _jsx(ProfileSection, { title: "Friends", children: _jsxs("button", { type: "button", onClick: () => setFriendsOpen(true), className: "w-full p-3 rounded border border-line bg-panel text-ink text-[0.9rem] font-semibold cursor-pointer font-[inherit] flex items-center justify-between", children: ["Manage Friends ", _jsx(FriendRequestBadge, { app: app })] }) }), _jsx(ProfileSection, { title: "API Keys", children: _jsx("button", { type: "button", onClick: () => app.keys.manage(), className: "w-full p-3 rounded border border-line bg-panel text-ink text-[0.9rem] font-semibold cursor-pointer font-[inherit]", children: "Manage API Keys" }) }), _jsx("button", { type: "button", onClick: signOut, className: "w-full p-3 rounded border border-line bg-panel text-ink text-[0.9rem] font-semibold cursor-pointer font-[inherit] mb-6", children: "Sign out" }), _jsxs("div", { className: "border border-danger rounded p-5", children: [_jsx("div", { className: "text-[0.9rem] font-bold text-danger mb-2", children: "Danger zone" }), _jsx("p", { className: "text-[0.85rem] text-muted mb-3", children: "Permanently delete your account and all data across all apps." }), _jsx("button", { type: "button", disabled: deletePending, onClick: handleDelete, className: "p-[0.5rem_1rem] rounded-sm border border-danger bg-transparent text-danger text-[0.85rem] font-semibold cursor-pointer font-[inherit]", children: deletePending ? 'Deleting...' : 'Delete account' }), deleteError && (_jsx("p", { role: "alert", className: "mt-3 text-danger", children: deleteError }))] }), _jsx(Modal, { open: friendsOpen, onClose: () => setFriendsOpen(false), title: "Friends", maxWidth: 420, children: _jsx(FriendsList, { app: app }) })] }));
|
|
134
|
+
return (_jsxs("div", { className: "w-full max-w-120 m-[0_auto] p-[2rem_1rem]", children: [_jsx(PageHeader, { title: "Profile" }), _jsxs("div", { className: "flex items-center gap-4 mb-8", children: [_jsx("div", { className: "shrink-0", children: _jsx(Avatar, { user: user, size: 64 }) }), _jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "[overflow-wrap:anywhere] text-[1.25rem] font-bold text-ink-strong", children: user.login }), _jsx("div", { className: "text-[0.85rem] text-muted", children: "FreeAppStore account" })] })] }), _jsxs(ProfileSection, { title: "Appearance", children: [showThemeToggle && (_jsxs(_Fragment, { children: [_jsx(ProfileLabel, { children: "Theme" }), _jsx("div", { className: "flex gap-2 mb-4", children: themeOptions.map((opt) => (_jsx(ToggleButton, { active: preference === opt.value, onClick: () => setPreference(opt.value), children: opt.label }, opt.value))) })] })), _jsx(ProfileLabel, { children: "Text Size" }), _jsx("div", { className: "flex gap-2", children: textSizeOptions.map((opt) => (_jsx(ToggleButton, { active: textSize === opt.value, onClick: () => setTextSize(opt.value), children: opt.label }, opt.value))) })] }), _jsx(ProfileSection, { title: "Friends", children: _jsxs("button", { type: "button", onClick: () => setFriendsOpen(true), className: "w-full p-3 rounded border border-line bg-panel text-ink text-[0.9rem] font-semibold cursor-pointer font-[inherit] flex items-center justify-between", children: ["Manage Friends ", _jsx(FriendRequestBadge, { app: app })] }) }), _jsx(ProfileSection, { title: "API Keys", children: _jsx("button", { type: "button", onClick: () => app.keys.manage(), className: "w-full p-3 rounded border border-line bg-panel text-ink text-[0.9rem] font-semibold cursor-pointer font-[inherit]", children: "Manage API Keys" }) }), _jsx("button", { type: "button", onClick: signOut, className: "w-full p-3 rounded border border-line bg-panel text-ink text-[0.9rem] font-semibold cursor-pointer font-[inherit] mb-6", children: "Sign out" }), _jsxs("div", { className: "border border-danger rounded p-5", children: [_jsx("div", { className: "text-[0.9rem] font-bold text-danger mb-2", children: "Danger zone" }), _jsx("p", { className: "text-[0.85rem] text-muted mb-3", children: "Permanently delete your account and all data across all apps." }), _jsx("button", { type: "button", disabled: deletePending, onClick: handleDelete, className: "p-[0.5rem_1rem] rounded-sm border border-danger bg-transparent text-danger text-[0.85rem] font-semibold cursor-pointer font-[inherit]", children: deletePending ? 'Deleting...' : 'Delete account' }), deleteError && (_jsx("p", { role: "alert", className: "mt-3 text-danger", children: deleteError }))] }), children, _jsx(Modal, { open: friendsOpen, onClose: () => setFriendsOpen(false), title: "Friends", maxWidth: 420, children: _jsx(FriendsList, { app: app }) })] }));
|
|
103
135
|
}
|
|
104
136
|
function ProfileSection({ title, children }) {
|
|
105
137
|
return (_jsxs("div", { className: "bg-panel border border-line rounded p-5 mb-4", children: [_jsx("div", { className: "text-[0.9rem] font-bold mb-3 text-ink", children: title }), children] }));
|
package/dist/ui/profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/ui/profile.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/ui/profile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,kBAAkB,GACnB,MAAM,i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|
|
7
7
|
}
|
|
8
|
-
interface
|
|
8
|
+
export interface ShellErrorBoundaryProps {
|
|
9
9
|
app: FreeAppStore;
|
|
10
|
-
|
|
10
|
+
/** Replace the fallback. The error is already recorded via `app.log`. */
|
|
11
|
+
renderError?: ((ctx: ShellErrorContext) => ReactNode) | undefined;
|
|
11
12
|
/** A change (the current route) clears a caught error, so navigating away recovers. */
|
|
12
13
|
resetKey: string;
|
|
13
14
|
children: ReactNode;
|
|
@@ -22,10 +23,10 @@ interface BoundaryState {
|
|
|
22
23
|
* error React catches never reaches `window.onerror`, so the logger's automatic
|
|
23
24
|
* capture would miss it.
|
|
24
25
|
*/
|
|
25
|
-
export declare class ShellErrorBoundary extends Component<
|
|
26
|
+
export declare class ShellErrorBoundary extends Component<ShellErrorBoundaryProps, BoundaryState> {
|
|
26
27
|
state: BoundaryState;
|
|
27
28
|
static getDerivedStateFromError(error: unknown): Partial<BoundaryState>;
|
|
28
|
-
static getDerivedStateFromProps(props:
|
|
29
|
+
static getDerivedStateFromProps(props: ShellErrorBoundaryProps, state: BoundaryState): Partial<BoundaryState> | null;
|
|
29
30
|
componentDidCatch(error: unknown, info: ErrorInfo): void;
|
|
30
31
|
reset: () => void;
|
|
31
32
|
render(): ReactNode;
|
|
@@ -42,8 +43,8 @@ export interface ToastApi {
|
|
|
42
43
|
dismiss: (id: number) => void;
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
|
-
* Raise a message from any screen inside Shell
|
|
46
|
-
* single polite live region.
|
|
46
|
+
* Raise a message from any screen inside `Shell` or `ToastProvider`. Messages
|
|
47
|
+
* appear in that provider's single polite live region.
|
|
47
48
|
*
|
|
48
49
|
* ```tsx
|
|
49
50
|
* const toast = useToast()
|
|
@@ -52,9 +53,10 @@ export interface ToastApi {
|
|
|
52
53
|
*/
|
|
53
54
|
export declare function useToast(): ToastApi;
|
|
54
55
|
/**
|
|
55
|
-
*
|
|
56
|
-
* the accessibility tree when a message
|
|
57
|
-
* with its first message is often not
|
|
56
|
+
* Toast queue for a custom frame. `Shell` already mounts one. The region is
|
|
57
|
+
* always rendered, so it's already in the accessibility tree when a message
|
|
58
|
+
* arrives (a live region created together with its first message is often not
|
|
59
|
+
* announced). Items have no live role.
|
|
58
60
|
*/
|
|
59
61
|
export declare function ToastProvider({ children }: {
|
|
60
62
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-resilience.d.ts","sourceRoot":"","sources":["../../src/ui/shell-resilience.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,mDAAmD;IACnD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,
|
|
1
|
+
{"version":3,"file":"shell-resilience.d.ts","sourceRoot":"","sources":["../../src/ui/shell-resilience.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,mDAAmD;IACnD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,YAAY,CAAC;IAClB,yEAAyE;IACzE,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,iBAAiB,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;IAClE,uFAAuF;IACvF,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,KAAK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AE;IAAE,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAAE,+BAgB/E;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACtC,OAAO,EAAE,OAAO,GACf,MAAM,IAAI,CAwDZ"}
|
|
@@ -36,8 +36,8 @@ export class ShellErrorBoundary extends Component {
|
|
|
36
36
|
const MAX_TOASTS = 4;
|
|
37
37
|
const ToastContext = createContext(null);
|
|
38
38
|
/**
|
|
39
|
-
* Raise a message from any screen inside Shell
|
|
40
|
-
* single polite live region.
|
|
39
|
+
* Raise a message from any screen inside `Shell` or `ToastProvider`. Messages
|
|
40
|
+
* appear in that provider's single polite live region.
|
|
41
41
|
*
|
|
42
42
|
* ```tsx
|
|
43
43
|
* const toast = useToast()
|
|
@@ -47,7 +47,7 @@ const ToastContext = createContext(null);
|
|
|
47
47
|
export function useToast() {
|
|
48
48
|
const api = useContext(ToastContext);
|
|
49
49
|
if (!api)
|
|
50
|
-
throw new Error('useToast must be used inside <Shell>');
|
|
50
|
+
throw new Error('useToast must be used inside <Shell> or <ToastProvider>');
|
|
51
51
|
return api;
|
|
52
52
|
}
|
|
53
53
|
function ToastItem({ toast, onDismiss }) {
|
|
@@ -60,9 +60,10 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
60
60
|
return (_jsxs("div", { className: "fas-toast pointer-events-auto flex items-center gap-3 rounded border-l-[3px] border-accent bg-popover py-1 pl-4 pr-1 text-sm text-ink shadow-lg data-[variant=success]:border-success data-[variant=error]:border-danger", "data-variant": toast.variant, children: [_jsx("span", { children: toast.message }), _jsx("button", { type: "button", className: "fas-dismiss inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 text-[1.1rem] leading-none text-inherit opacity-75 hover:opacity-100 focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2", "aria-label": "Dismiss", onClick: () => onDismiss(toast.id), children: "\u00D7" })] }));
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
|
-
* the accessibility tree when a message
|
|
65
|
-
* with its first message is often not
|
|
63
|
+
* Toast queue for a custom frame. `Shell` already mounts one. The region is
|
|
64
|
+
* always rendered, so it's already in the accessibility tree when a message
|
|
65
|
+
* arrives (a live region created together with its first message is often not
|
|
66
|
+
* announced). Items have no live role.
|
|
66
67
|
*/
|
|
67
68
|
export function ToastProvider({ children }) {
|
|
68
69
|
const [toasts, setToasts] = useState([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-resilience.js","sourceRoot":"","sources":["../../src/ui/shell-resilience.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,aAAa,EAIb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"shell-resilience.js","sourceRoot":"","sources":["../../src/ui/shell-resilience.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,aAAa,EAIb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AA4Bf;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAiD;IAC9E,KAAK,GAAkB,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAE/E,MAAM,CAAC,wBAAwB,CAAC,KAAc;QAC5C,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;IAC9E,CAAC;IAED,MAAM,CAAC,wBAAwB,CAC7B,KAA8B,E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,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7B,OAAO,WAAW,CAAC,GAAG,EAAE;QACtB,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freeappstore/sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.17",
|
|
4
4
|
"description": "Browser SDK for FreeAppStore — auth, KV, collections, counters, rooms, proxy, encrypted user keys, roles, friends, email, push reminders, React hooks, and UI components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|