@freeappstore/sdk 0.16.16 → 0.16.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +7 -1
  2. package/dist/logger.d.ts +1 -1
  3. package/dist/logger.js +1 -1
  4. package/dist/persist/capability.d.ts +20 -0
  5. package/dist/persist/capability.d.ts.map +1 -0
  6. package/dist/persist/capability.js +36 -0
  7. package/dist/persist/capability.js.map +1 -0
  8. package/dist/persist/database.d.ts +21 -0
  9. package/dist/persist/database.d.ts.map +1 -0
  10. package/dist/persist/database.js +48 -0
  11. package/dist/persist/database.js.map +1 -0
  12. package/dist/persist/file-store.d.ts +41 -0
  13. package/dist/persist/file-store.d.ts.map +1 -0
  14. package/dist/persist/file-store.js +142 -0
  15. package/dist/persist/file-store.js.map +1 -0
  16. package/dist/persist/idb-store.d.ts +38 -0
  17. package/dist/persist/idb-store.d.ts.map +1 -0
  18. package/dist/persist/idb-store.js +116 -0
  19. package/dist/persist/idb-store.js.map +1 -0
  20. package/dist/persist/index.d.ts +27 -0
  21. package/dist/persist/index.d.ts.map +1 -0
  22. package/dist/persist/index.js +22 -0
  23. package/dist/persist/index.js.map +1 -0
  24. package/dist/persist/prefs.d.ts +32 -0
  25. package/dist/persist/prefs.d.ts.map +1 -0
  26. package/dist/persist/prefs.js +168 -0
  27. package/dist/persist/prefs.js.map +1 -0
  28. package/dist/persist/status.d.ts +29 -0
  29. package/dist/persist/status.d.ts.map +1 -0
  30. package/dist/persist/status.js +53 -0
  31. package/dist/persist/status.js.map +1 -0
  32. package/dist/ui/fixtures/fixture-account-settings.d.ts +6 -0
  33. package/dist/ui/fixtures/fixture-account-settings.d.ts.map +1 -0
  34. package/dist/ui/fixtures/fixture-account-settings.js +11 -0
  35. package/dist/ui/fixtures/fixture-account-settings.js.map +1 -0
  36. package/dist/ui/fixtures/fixture-bottom-nav.d.ts +6 -0
  37. package/dist/ui/fixtures/fixture-bottom-nav.d.ts.map +1 -0
  38. package/dist/ui/fixtures/fixture-bottom-nav.js +22 -0
  39. package/dist/ui/fixtures/fixture-bottom-nav.js.map +1 -0
  40. package/dist/ui/fixtures/fixture-canvas-reader.d.ts +6 -0
  41. package/dist/ui/fixtures/fixture-canvas-reader.d.ts.map +1 -0
  42. package/dist/ui/fixtures/fixture-canvas-reader.js +10 -0
  43. package/dist/ui/fixtures/fixture-canvas-reader.js.map +1 -0
  44. package/dist/ui/fixtures/fixture-default-frame.d.ts +6 -0
  45. package/dist/ui/fixtures/fixture-default-frame.d.ts.map +1 -0
  46. package/dist/ui/fixtures/fixture-default-frame.js +12 -0
  47. package/dist/ui/fixtures/fixture-default-frame.js.map +1 -0
  48. package/dist/ui/fixtures/fixture-sidebar-nav.d.ts +6 -0
  49. package/dist/ui/fixtures/fixture-sidebar-nav.d.ts.map +1 -0
  50. package/dist/ui/fixtures/fixture-sidebar-nav.js +22 -0
  51. package/dist/ui/fixtures/fixture-sidebar-nav.js.map +1 -0
  52. package/dist/ui/fixtures/router.d.ts +7 -0
  53. package/dist/ui/fixtures/router.d.ts.map +1 -0
  54. package/dist/ui/fixtures/router.js +22 -0
  55. package/dist/ui/fixtures/router.js.map +1 -0
  56. package/dist/ui/index.d.ts +5 -4
  57. package/dist/ui/index.d.ts.map +1 -1
  58. package/dist/ui/index.js +3 -2
  59. package/dist/ui/index.js.map +1 -1
  60. package/dist/ui/layout.d.ts +9 -3
  61. package/dist/ui/layout.d.ts.map +1 -1
  62. package/dist/ui/layout.js +3 -3
  63. package/dist/ui/layout.js.map +1 -1
  64. package/dist/ui/profile.d.ts +23 -1
  65. package/dist/ui/profile.d.ts.map +1 -1
  66. package/dist/ui/profile.js +36 -4
  67. package/dist/ui/profile.js.map +1 -1
  68. package/dist/ui/shell-resilience.d.ts +11 -9
  69. package/dist/ui/shell-resilience.d.ts.map +1 -1
  70. package/dist/ui/shell-resilience.js +7 -6
  71. package/dist/ui/shell-resilience.js.map +1 -1
  72. package/package.json +10 -2
@@ -0,0 +1,32 @@
1
+ import { type StorageResult, type Validator } from './status.js';
2
+ /**
3
+ * Safe preference storage on `localStorage`.
4
+ *
5
+ * Keys are `fas:<namespace>:<key>`. Values are JSON. A validator rejects a
6
+ * value without deleting the stored bytes. Cross-tab `watchPreference` events
7
+ * are notifications that a key changed. They are not a merge and not conflict
8
+ * resolution: the app reads the key and applies its own policy.
9
+ *
10
+ * Device-only. This is not `fas.kv` and not an account backup.
11
+ */
12
+ export interface PreferenceNotice {
13
+ namespace: string;
14
+ key: string;
15
+ kind: 'set' | 'remove';
16
+ /** Always this literal. The notice carries no merged value. */
17
+ notification: 'storage-changed';
18
+ }
19
+ export declare function preferenceKey(namespace: string, key: string): StorageResult<string>;
20
+ export declare function getPreference<T>(namespace: string, key: string, validate?: Validator<T>): StorageResult<T | undefined>;
21
+ export declare function setPreference<T>(namespace: string, key: string, value: T, validate?: Validator<T>): StorageResult<T>;
22
+ export declare function removePreference(namespace: string, key: string): StorageResult<true>;
23
+ /**
24
+ * Subscribe to preference changes.
25
+ *
26
+ * The `storage` event covers other tabs. `BroadcastChannel` covers other
27
+ * listeners, including this tab, after a successful write. Neither path
28
+ * merges values or picks a winner. Read the key again and apply an app-owned
29
+ * policy if two tabs disagree.
30
+ */
31
+ export declare function watchPreference(namespace: string, key: string, listener: (notice: PreferenceNotice) => void): () => void;
32
+ //# sourceMappingURL=prefs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefs.d.ts","sourceRoot":"","sources":["../../src/persist/prefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAErB;;;;;;;;;GASG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC;IACvB,+DAA+D;IAC/D,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAMnF;AAuBD,wBAAgB,aAAa,CAAC,CAAC,EAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GACtB,aAAa,CAAC,CAAC,GAAG,SAAS,CAAC,CA0B9B;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GACtB,aAAa,CAAC,CAAC,CAAC,CAuBlB;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAYpF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAC3C,MAAM,IAAI,CA4CZ"}
@@ -0,0 +1,168 @@
1
+ import { checkSegment, classifyStorageError, errorMessage, failure, } from './status.js';
2
+ export function preferenceKey(namespace, key) {
3
+ const ns = checkSegment(namespace, 'Namespace');
4
+ if (!ns.ok)
5
+ return ns;
6
+ const segment = checkSegment(key, 'Key');
7
+ if (!segment.ok)
8
+ return segment;
9
+ return { ok: true, value: `fas:${ns.value}:${segment.value}` };
10
+ }
11
+ function storageArea() {
12
+ try {
13
+ if (typeof window === 'undefined' || window.localStorage == null)
14
+ return null;
15
+ return window.localStorage;
16
+ }
17
+ catch {
18
+ return null;
19
+ }
20
+ }
21
+ function notify(namespace, key, kind) {
22
+ if (typeof BroadcastChannel === 'undefined')
23
+ return;
24
+ const notice = { namespace, key, kind, notification: 'storage-changed' };
25
+ try {
26
+ const channel = new BroadcastChannel(`fas:prefs:${namespace}`);
27
+ channel.postMessage(notice);
28
+ channel.close();
29
+ }
30
+ catch {
31
+ // The write already committed. A missing channel does not undo it.
32
+ }
33
+ }
34
+ export function getPreference(namespace, key, validate) {
35
+ const storageKey = preferenceKey(namespace, key);
36
+ if (!storageKey.ok)
37
+ return storageKey;
38
+ const area = storageArea();
39
+ if (!area)
40
+ return failure('unavailable', 'localStorage is not available.');
41
+ let raw;
42
+ try {
43
+ raw = area.getItem(storageKey.value);
44
+ }
45
+ catch (error) {
46
+ return failure(classifyStorageError(error), errorMessage(error));
47
+ }
48
+ if (raw === null)
49
+ return { ok: true, value: undefined };
50
+ let parsed;
51
+ try {
52
+ parsed = JSON.parse(raw);
53
+ }
54
+ catch {
55
+ // Leave the unreadable bytes in place. Callers decide whether to overwrite.
56
+ return failure('corrupt', 'Stored value is not valid JSON.');
57
+ }
58
+ if (validate) {
59
+ if (!validate(parsed)) {
60
+ return failure('validation', 'Stored value did not match the validator.');
61
+ }
62
+ return { ok: true, value: parsed };
63
+ }
64
+ return { ok: true, value: parsed };
65
+ }
66
+ export function setPreference(namespace, key, value, validate) {
67
+ const storageKey = preferenceKey(namespace, key);
68
+ if (!storageKey.ok)
69
+ return storageKey;
70
+ if (validate && !validate(value)) {
71
+ return failure('validation', 'Value did not match the validator.');
72
+ }
73
+ let encoded;
74
+ try {
75
+ const json = JSON.stringify(value);
76
+ if (typeof json !== 'string')
77
+ return failure('validation', 'Value is not JSON.');
78
+ encoded = json;
79
+ }
80
+ catch {
81
+ return failure('validation', 'Value is not JSON.');
82
+ }
83
+ const area = storageArea();
84
+ if (!area)
85
+ return failure('unavailable', 'localStorage is not available.');
86
+ try {
87
+ area.setItem(storageKey.value, encoded);
88
+ }
89
+ catch (error) {
90
+ return failure(classifyStorageError(error), errorMessage(error));
91
+ }
92
+ notify(namespace, key, 'set');
93
+ return { ok: true, value };
94
+ }
95
+ export function removePreference(namespace, key) {
96
+ const storageKey = preferenceKey(namespace, key);
97
+ if (!storageKey.ok)
98
+ return storageKey;
99
+ const area = storageArea();
100
+ if (!area)
101
+ return failure('unavailable', 'localStorage is not available.');
102
+ try {
103
+ area.removeItem(storageKey.value);
104
+ }
105
+ catch (error) {
106
+ return failure(classifyStorageError(error), errorMessage(error));
107
+ }
108
+ notify(namespace, key, 'remove');
109
+ return { ok: true, value: true };
110
+ }
111
+ /**
112
+ * Subscribe to preference changes.
113
+ *
114
+ * The `storage` event covers other tabs. `BroadcastChannel` covers other
115
+ * listeners, including this tab, after a successful write. Neither path
116
+ * merges values or picks a winner. Read the key again and apply an app-owned
117
+ * policy if two tabs disagree.
118
+ */
119
+ export function watchPreference(namespace, key, listener) {
120
+ const storageKey = preferenceKey(namespace, key);
121
+ if (!storageKey.ok || typeof window === 'undefined')
122
+ return () => undefined;
123
+ const onStorage = (event) => {
124
+ if (event.key !== null && event.key !== storageKey.value)
125
+ return;
126
+ try {
127
+ if (event.storageArea && event.storageArea !== window.localStorage)
128
+ return;
129
+ }
130
+ catch {
131
+ return;
132
+ }
133
+ listener({
134
+ namespace,
135
+ key,
136
+ kind: event.key !== null && event.newValue !== null ? 'set' : 'remove',
137
+ notification: 'storage-changed',
138
+ });
139
+ };
140
+ window.addEventListener('storage', onStorage);
141
+ let channel;
142
+ try {
143
+ if (typeof BroadcastChannel !== 'undefined') {
144
+ channel = new BroadcastChannel(`fas:prefs:${namespace}`);
145
+ channel.onmessage = (event) => {
146
+ const notice = event.data;
147
+ if (!notice || notice.namespace !== namespace || notice.key !== key)
148
+ return;
149
+ if (notice.notification !== 'storage-changed')
150
+ return;
151
+ listener({
152
+ namespace,
153
+ key,
154
+ kind: notice.kind === 'remove' ? 'remove' : 'set',
155
+ notification: 'storage-changed',
156
+ });
157
+ };
158
+ }
159
+ }
160
+ catch {
161
+ channel = undefined;
162
+ }
163
+ return () => {
164
+ window.removeEventListener('storage', onStorage);
165
+ channel?.close();
166
+ };
167
+ }
168
+ //# sourceMappingURL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4
+ * These helpers never report success before the write is committed, and they
5
+ * never delete unreadable data. Account-backed data is a different API:
6
+ * `fas.kv` stores the signed-in user's keys on the server. Public documents
7
+ * use `fas.collections`. Room messages are ephemeral. None of those are
8
+ * replaced by this module.
9
+ */
10
+ export type StorageFailure = 'unavailable' | 'corrupt' | 'quota' | 'validation' | 'aborted' | 'conflict' | 'not-installed';
11
+ export type StorageResult<T> = {
12
+ ok: true;
13
+ value: T;
14
+ } | {
15
+ ok: false;
16
+ reason: StorageFailure;
17
+ detail?: string;
18
+ };
19
+ export type Validator<T> = (value: unknown) => value is T;
20
+ export declare function failure(reason: StorageFailure, detail?: string): StorageResult<never>;
21
+ export declare function checkSegment(value: string, label: string): StorageResult<string>;
22
+ export declare function classifyStorageError(error: unknown): StorageFailure;
23
+ export declare function errorMessage(error: unknown): string | undefined;
24
+ /**
25
+ * Run `work`, then wait until `done` settles. Success is returned only after
26
+ * `done`. A rejection aborts the transaction and does not report success.
27
+ */
28
+ export declare function settleTransaction<T>(done: Promise<void>, abort: () => void, work: () => Promise<T>): Promise<StorageResult<T>>;
29
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/persist/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,SAAS,GACT,OAAO,GACP,YAAY,GACZ,SAAS,GACT,UAAU,GACV,eAAe,CAAC;AAEpB,MAAM,MAAM,aAAa,CAAC,CAAC,IACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,cAAc,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC;AAI1D,wBAAgB,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAGrF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAQhF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAUnE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG/D;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EACvC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EACnB,KAAK,EAAE,MAAM,IAAI,EACjB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAc3B"}
@@ -0,0 +1,53 @@
1
+ const SEGMENT = /^[A-Za-z0-9._-]{1,64}$/;
2
+ export function failure(reason, detail) {
3
+ if (detail)
4
+ return { ok: false, reason, detail };
5
+ return { ok: false, reason };
6
+ }
7
+ export function checkSegment(value, label) {
8
+ if (!SEGMENT.test(value)) {
9
+ return failure('validation', `${label} must be 1-64 characters: letters, digits, ".", "_" or "-".`);
10
+ }
11
+ return { ok: true, value };
12
+ }
13
+ export function classifyStorageError(error) {
14
+ const name = error instanceof Error ? error.name : '';
15
+ const code = error instanceof DOMException ? error.code : 0;
16
+ if (name === 'QuotaExceededError' || name === 'NS_ERROR_DOM_QUOTA_REACHED' || code === 22) {
17
+ return 'quota';
18
+ }
19
+ if (name === 'AbortError' || name === 'TransactionInactiveError')
20
+ return 'aborted';
21
+ if (name === 'DataCloneError')
22
+ return 'validation';
23
+ if (name === 'DataError')
24
+ return 'corrupt';
25
+ return 'unavailable';
26
+ }
27
+ export function errorMessage(error) {
28
+ if (error instanceof Error && error.message)
29
+ return error.message;
30
+ return undefined;
31
+ }
32
+ /**
33
+ * Run `work`, then wait until `done` settles. Success is returned only after
34
+ * `done`. A rejection aborts the transaction and does not report success.
35
+ */
36
+ export async function settleTransaction(done, abort, work) {
37
+ try {
38
+ const value = await work();
39
+ await done;
40
+ return { ok: true, value };
41
+ }
42
+ catch (error) {
43
+ try {
44
+ abort();
45
+ }
46
+ catch {
47
+ // Already aborting or finished.
48
+ }
49
+ done.catch(() => undefined);
50
+ return failure(classifyStorageError(error), errorMessage(error));
51
+ }
52
+ }
53
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/persist/status.ts"],"names":[],"mappings":"AAwBA,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAEzC,MAAM,UAAU,OAAO,CAAC,MAAsB,EAAE,MAAe;IAC7D,IAAI,MAAM;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,KAAa;IACvD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,OAAO,CACZ,YAAY,EACZ,GAAG,KAAK,6DAA6D,CACtE,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACtD,MAAM,IAAI,GAAG,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,IAAI,KAAK,oBAAoB,IAAI,IAAI,KAAK,4BAA4B,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAC1F,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,0BAA0B;QAAE,OAAO,SAAS,CAAC;IACnF,IAAI,IAAI,KAAK,gBAAgB;QAAE,OAAO,YAAY,CAAC;IACnD,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAClE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAmB,EACnB,KAAiB,EACjB,IAAsB;IAEtB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,IAAI,EAAE,CAAC;QAC3B,MAAM,IAAI,CAAC;QACX,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC;YACH,KAAK,EAAE,CAAC;QACV,CAAC;QAAC,MAAM,CAAC;YACP,gCAAgC;QAClC,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC5B,OAAO,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;AACH,CAAC"}
@@ -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,aAA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C,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,EACrB,4BAAgB,MAAM,EAAC,SAAS,EAAC,oDAAoD,YAClF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixture-sidebar-nav.js","sourceRoot":"","sources":["../../../src/ui/fixtures/fixture-sidebar-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,QAA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AQ,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"}
@@ -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
@@ -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,iBA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ACZ,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
@@ -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;AAQhF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAOzD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,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"}
@@ -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