@swiftbrowser/react 0.18.1 → 0.18.3
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 +137 -5
- package/dist/appleSignIn.d.ts +53 -0
- package/dist/appleSignIn.d.ts.map +1 -0
- package/dist/components/controls.d.ts +6 -1
- package/dist/components/controls.d.ts.map +1 -1
- package/dist/components/geometry.d.ts +6 -1
- package/dist/components/geometry.d.ts.map +1 -1
- package/dist/components/menus.d.ts.map +1 -1
- package/dist/components/text.d.ts.map +1 -1
- package/dist/environment.d.ts +16 -2
- package/dist/environment.d.ts.map +1 -1
- package/dist/fileExporter.d.ts +31 -0
- package/dist/fileExporter.d.ts.map +1 -0
- package/dist/fileManager.d.ts +17 -2
- package/dist/fileManager.d.ts.map +1 -1
- package/dist/fileStorage.d.ts +25 -0
- package/dist/fileStorage.d.ts.map +1 -0
- package/dist/geolocation.d.ts +44 -0
- package/dist/geolocation.d.ts.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +742 -309
- package/dist/index.js.map +1 -1
- package/dist/modifiers.d.ts +19 -1
- package/dist/modifiers.d.ts.map +1 -1
- package/dist/mount.d.ts +2 -1
- package/dist/mount.d.ts.map +1 -1
- package/dist/speech.d.ts +52 -0
- package/dist/speech.d.ts.map +1 -0
- package/dist/wakeLock.d.ts +11 -0
- package/dist/wakeLock.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -341,7 +341,10 @@ away with the content and the bar shows `navigationTitle` once it has.
|
|
|
341
341
|
`placement="keyboard"` is the bar above the keyboard while a text input of
|
|
342
342
|
the screen is being edited (a formatting bar, a Done button), its items in
|
|
343
343
|
a row from the leading edge, a `Spacer` pushing the rest to the trailing
|
|
344
|
-
edge; it is hidden while nothing in the screen is being edited.
|
|
344
|
+
edge; it is hidden while nothing in the screen is being edited. A `Label`
|
|
345
|
+
in a bar shows its icon alone, its title the icon's accessible name, as iOS
|
|
346
|
+
draws a bar's labels; `labelStyle="titleAndIcon"` on it shows both, and a
|
|
347
|
+
`Menu`'s items keep their labels' title and icon.
|
|
345
348
|
|
|
346
349
|
```tsx
|
|
347
350
|
<List
|
|
@@ -400,6 +403,75 @@ titles when regular and the first column when compact.
|
|
|
400
403
|
/>
|
|
401
404
|
```
|
|
402
405
|
|
|
406
|
+
### Scene phase
|
|
407
|
+
|
|
408
|
+
`useScenePhase()` is `@Environment(\.scenePhase)`: `active` while the app is
|
|
409
|
+
in front and takes input, `inactive` while it shows but does not, and
|
|
410
|
+
`background` while it is not shown. A page follows the document's visibility
|
|
411
|
+
(hidden is `background`) and the window's focus (`mount` and `SwiftUIView`
|
|
412
|
+
watch them); the native app follows its scene. Refresh what time moved on
|
|
413
|
+
when it turns `active`: timers may not have run in the background.
|
|
414
|
+
|
|
415
|
+
```tsx
|
|
416
|
+
const phase = useScenePhase();
|
|
417
|
+
useEffect(() => {
|
|
418
|
+
if (phase === 'active') setToday(dayKey(new Date()));
|
|
419
|
+
}, [phase]);
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Wake lock
|
|
423
|
+
|
|
424
|
+
`useWakeLock(active)` keeps the screen awake while `active` (a recording
|
|
425
|
+
under way, a recipe being followed), through the Screen Wake Lock API: the
|
|
426
|
+
browser's on a page, the runtime's `navigator.wakeLock` over the idle timer
|
|
427
|
+
in a native app. It returns whether a lock is held, and takes the lock
|
|
428
|
+
again when the browser let it go as the document hid and it shows again.
|
|
429
|
+
Where there is no `navigator.wakeLock`, nothing happens.
|
|
430
|
+
|
|
431
|
+
```tsx
|
|
432
|
+
useWakeLock(recorder.status !== 'idle');
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Location
|
|
436
|
+
|
|
437
|
+
`useGeolocation(options)` is the viewer's position through the Geolocation
|
|
438
|
+
API: the browser's on a page, the runtime's `navigator.geolocation` over
|
|
439
|
+
`CLLocationManager` in a native app (the app's Info.plist names
|
|
440
|
+
`NSLocationWhenInUseUsageDescription`). Nothing is asked until `request()`
|
|
441
|
+
(the first ask prompts the viewer) unless `immediate` is set; `watch` keeps
|
|
442
|
+
following the position until `stop()` or the view goes. The state carries
|
|
443
|
+
`available`, `status` (`idle`, `locating`, `located`, `denied`, `failed`),
|
|
444
|
+
the latest `position` (`latitude`, `longitude`, `accuracy`, `altitude`,
|
|
445
|
+
`heading`, `speed`, `timestamp`) and `error`.
|
|
446
|
+
|
|
447
|
+
```tsx
|
|
448
|
+
const location = useGeolocation({ enableHighAccuracy: true });
|
|
449
|
+
<Button title="Use My Location" action={location.request} />
|
|
450
|
+
{location.position && <Text>{`${location.position.latitude}, ${location.position.longitude}`}</Text>}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Speech
|
|
454
|
+
|
|
455
|
+
`useSpeechSynthesis()` reads text aloud through the Web Speech API (the
|
|
456
|
+
browser's voices on a page, `AVSpeechSynthesizer` in a native app):
|
|
457
|
+
`speak(text, { lang, rate, pitch, volume })` queues an utterance, `cancel()`
|
|
458
|
+
stops and empties the queue, `pause()` and `resume()` hold it, and
|
|
459
|
+
`speaking` and `paused` follow; what a view was reading stops when it goes.
|
|
460
|
+
`useSpeechRecognition({ lang, continuous, interimResults })` turns the
|
|
461
|
+
viewer's speech into text (the browser's recognizer, `SFSpeechRecognizer`
|
|
462
|
+
natively; the app's Info.plist names `NSSpeechRecognitionUsageDescription`
|
|
463
|
+
and `NSMicrophoneUsageDescription`): `start()` listens, `transcript` is the
|
|
464
|
+
final words of the session so far and `interim` what is being heard,
|
|
465
|
+
`stop()` lets the last words arrive and `abort()` does not; `error` names
|
|
466
|
+
`not-allowed`, `audio-capture`, `no-speech` or `network`. Both read
|
|
467
|
+
`available` where the environment lacks the API, and the Showcase's Books
|
|
468
|
+
reads a chapter aloud and its Notes takes dictation with them.
|
|
469
|
+
|
|
470
|
+
```tsx
|
|
471
|
+
const speech = useSpeechSynthesis();
|
|
472
|
+
<Button title={speech.speaking ? 'Stop' : 'Read Aloud'} action={() => (speech.speaking ? speech.cancel() : speech.speak(chapterText))} />
|
|
473
|
+
```
|
|
474
|
+
|
|
403
475
|
### Scrolling
|
|
404
476
|
|
|
405
477
|
`List`, `LazyVStack` and `LazyHStack` build a long `ForEach` a batch of
|
|
@@ -427,7 +499,9 @@ Name a coordinate space with `coordinateSpace="page"` on the `ScrollView`
|
|
|
427
499
|
`proxy.frame({ named: 'page' })`, updated as the page scrolls.
|
|
428
500
|
`onGeometryChange={{ of: (proxy) => proxy.size, action: setSize }}` is
|
|
429
501
|
`.onGeometryChange(for:of:action:)`: the action hears the transform's
|
|
430
|
-
answer when it changes, after the render
|
|
502
|
+
answer when it changes, after the render and before anything is painted
|
|
503
|
+
(state it sets lays out in the same frame, so a view sized from its own
|
|
504
|
+
measurement settles at once), without a reader or a child
|
|
431
505
|
that reports in an effect.
|
|
432
506
|
|
|
433
507
|
`onScrollGeometryChange` on a `ScrollView` is `.onScrollGeometryChange`:
|
|
@@ -558,6 +632,39 @@ chooser calls `onCancellation`:
|
|
|
558
632
|
onCompletion: ([file]) => upload(file) }} />
|
|
559
633
|
```
|
|
560
634
|
|
|
635
|
+
`fileExporter` is the other way: the document goes where the viewer chooses,
|
|
636
|
+
a save dialog where the browser has one (Chromium's File System Access API),
|
|
637
|
+
a download elsewhere, and the Files app in a native app. The document is
|
|
638
|
+
text, bytes or a `Blob`, named by `defaultFilename` (the type's extension
|
|
639
|
+
added when it has none); `onCompletion` gets where it went (`saved` or
|
|
640
|
+
`downloaded`), and a dismissed dialog calls `onCancellation`. The Showcase's
|
|
641
|
+
Pages exports a document as text and Numbers a sheet as CSV with it.
|
|
642
|
+
|
|
643
|
+
```tsx
|
|
644
|
+
<VStack fileExporter={{ isPresented: [exporting, setExporting], document: csv, contentType: 'text/csv', defaultFilename: `${title}.csv` }}>
|
|
645
|
+
<Button title="Export as CSV" action={() => setExporting(true)} />
|
|
646
|
+
</VStack>
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
### Sign in with Apple
|
|
650
|
+
|
|
651
|
+
`SignInWithAppleButton` is SwiftUI's button (`label`: `signIn`, `signUp` or
|
|
652
|
+
`continue`; `style`: `black`, `white` or `whiteOutline`); `onCompletion` gets
|
|
653
|
+
the credential (`user`, the stable identifier; `email` and `fullName`, shared
|
|
654
|
+
the first time only; `identityToken` and `authorizationCode` for your server)
|
|
655
|
+
or the error (`cancelled: …` when the viewer dismissed the sheet).
|
|
656
|
+
`signInWithApple({ scopes, nonce, state })` is the same without the button,
|
|
657
|
+
`appleCredentialState(user)` asks what the credential is now (`unknown` on a
|
|
658
|
+
page), and `canSignInWithApple()` says whether it works here. Natively the
|
|
659
|
+
system sheet answers, in an app with the entitlement (`swiftbrowser native
|
|
660
|
+
init --sign-in-with-apple`). On a page Apple's JS does, once the app named
|
|
661
|
+
the Services ID and return URL it registered with Apple for the domain:
|
|
662
|
+
|
|
663
|
+
```tsx
|
|
664
|
+
configureSignInWithApple({ clientId: 'com.example.app.web', redirectURI: 'https://example.com/app/' });
|
|
665
|
+
<SignInWithAppleButton onCompletion={({ credential, error }) => credential && signedIn(credential)} padding={16} />
|
|
666
|
+
```
|
|
667
|
+
|
|
561
668
|
### Gestures
|
|
562
669
|
|
|
563
670
|
`onTapGesture`, `dragGesture`, `magnifyGesture`, `rotateGesture` and
|
|
@@ -577,7 +684,10 @@ without the item's own space moving along. `onTapGesture={{ count: 2, action
|
|
|
577
684
|
the double tap is inside), the single tap waits for the double-tap interval
|
|
578
685
|
to pass, as on iOS. `contentShape="rectangle"` makes the whole frame take
|
|
579
686
|
taps and gestures, which, as in SwiftUI, only what a view draws does
|
|
580
|
-
otherwise: a 44 pt box around a 14 pt handle, a clear slide.
|
|
687
|
+
otherwise: a 44 pt box around a 14 pt handle, a clear slide. `onTouches={(touches, phase) => …}` is a SwiftBrowser
|
|
688
|
+
addition for chords and glissandi: every pointer down on the view, in its
|
|
689
|
+
coordinates, with `began`, `changed`, `ended` or `cancelled`; the view owns
|
|
690
|
+
its pointers, so nothing above it scrolls or swipes with them.
|
|
581
691
|
|
|
582
692
|
### Mouse, keyboard and effects
|
|
583
693
|
|
|
@@ -666,7 +776,8 @@ Native app they are the app's sandbox. Paths are `file:` URLs, made with
|
|
|
666
776
|
`url(directory, path)`. The calls are Swift's, asynchronous on both sides
|
|
667
777
|
since the page's storage is: `contents`, `text`, `write` (bytes, a Blob or
|
|
668
778
|
text; the directory must exist), `contentsOfDirectory`, `createDirectory`
|
|
669
|
-
(with its parents), `fileExists`, `attributesOfItem
|
|
779
|
+
(with its parents), `fileExists`, `attributesOfItem` (size, the modification
|
|
780
|
+
and creation times, the MIME type the extension names), `moveItem`,
|
|
670
781
|
`copyItem`, `removeItem`. Failures say what went wrong first: `notFound:`,
|
|
671
782
|
`exists:`, `isDirectory:`, `notDirectory:`, `unsupported:` (a URL outside
|
|
672
783
|
the app's directories, or a page that keeps no files: `available`).
|
|
@@ -684,6 +795,26 @@ A `VideoPlayer`, `AudioPlayer` or `Image` given a `file:` URL loads the file
|
|
|
684
795
|
answers; natively the URL as it is). `mount`'s `app` option names the
|
|
685
796
|
database on a page (`sb-files:<app>`).
|
|
686
797
|
|
|
798
|
+
`iCloudDirectory()` is the app's folder in iCloud Drive, where the native
|
|
799
|
+
app has the iCloud entitlement (`swiftbrowser native init --icloud`) and the
|
|
800
|
+
viewer iCloud Drive: files there follow the viewer to their other devices
|
|
801
|
+
and show in the Files app, a file another device wrote is downloaded when
|
|
802
|
+
read, and `watch(listener)` reports the URLs that changed (what this app
|
|
803
|
+
wrote too, so two readers of a file agree). It is null on a page and in an
|
|
804
|
+
app without the entitlement, so an app keeps its documents in
|
|
805
|
+
`iCloudDirectory() ?? documentsDirectory` and is the same code everywhere.
|
|
806
|
+
`useFileStorage(url, default)` keeps a value as a JSON file the way
|
|
807
|
+
`useAppStorage` keeps one under a key, reading it again when it changes:
|
|
808
|
+
|
|
809
|
+
```tsx
|
|
810
|
+
const [folder, setFolder] = useState<string | null>(null);
|
|
811
|
+
useEffect(() => { void fileManager.iCloudDirectory().then((cloud) => setFolder(cloud ?? fileManager.documentsDirectory)); }, []);
|
|
812
|
+
const [memos, setMemos, status] = useFileStorage<Memo[]>(folder && fileManager.url(folder, 'memos.json'), []);
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
The Showcase's Voice Memos keeps its recordings and their index this way,
|
|
816
|
+
so a memo recorded on one device plays on the next.
|
|
817
|
+
|
|
687
818
|
### Animation
|
|
688
819
|
|
|
689
820
|
`withAnimation(animation, () => …)` animates the pass a state change makes,
|
|
@@ -771,7 +902,8 @@ SwiftUI row shows the count, and the row grows with the text.
|
|
|
771
902
|
selection, scrolling inside the host and native controls work; the row
|
|
772
903
|
around it still swipes when the pan starts outside the host.
|
|
773
904
|
- **Hooks.** The content can use this package's hooks: `useDismiss()` from a
|
|
774
|
-
sheet or a pushed screen, `useNavigation()` to push, `useColorScheme()
|
|
905
|
+
sheet or a pushed screen, `useNavigation()` to push, `useColorScheme()`,
|
|
906
|
+
`useScenePhase()`.
|
|
775
907
|
|
|
776
908
|
A host is a React root of its own, so it needs the `react-dom` peer
|
|
777
909
|
dependency, and React context does not cross into it by itself; see below.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sign in with Apple: `signInWithApple()` asks the viewer and resolves with
|
|
3
|
+
* the credential (`ASAuthorizationAppleIDCredential`'s fields: the stable
|
|
4
|
+
* `user`, the name and email shared the first time, the identity token and
|
|
5
|
+
* authorization code for the app's server), `appleCredentialState(user)` asks
|
|
6
|
+
* what the credential is now, and `SignInWithAppleButton` is SwiftUI's
|
|
7
|
+
* button, drawn from a button, the Apple logo and the label in the black,
|
|
8
|
+
* white or white-outline style. Natively the system sheet answers; on a page
|
|
9
|
+
* Apple's JS does, once the app named its Services ID and return URL with
|
|
10
|
+
* `configureSignInWithApple` (both registered with Apple for the domain), and
|
|
11
|
+
* without that the request fails `unsupported:`.
|
|
12
|
+
*/
|
|
13
|
+
import type { AppleCredentialState, AppleIDCredential } from '@swiftbrowser/web/src/hostRequests';
|
|
14
|
+
import { configureSignInWithApple } from '@swiftbrowser/web/src/appleSignIn';
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
import { type ViewModifiers } from './modifiers';
|
|
17
|
+
export type { AppleCredentialState, AppleIDCredential };
|
|
18
|
+
export { configureSignInWithApple };
|
|
19
|
+
export interface SignInWithAppleOptions {
|
|
20
|
+
/** What to ask the viewer to share; both by default. Shared the first time only, as on iOS. */
|
|
21
|
+
scopes?: ('fullName' | 'email')[];
|
|
22
|
+
/** A nonce the identity token carries, for the app's server to check. */
|
|
23
|
+
nonce?: string;
|
|
24
|
+
/** Echoed back in the credential. */
|
|
25
|
+
state?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Whether this page or app can sign in with Apple (natively always; on a page once configured). */
|
|
28
|
+
export declare function canSignInWithApple(): boolean;
|
|
29
|
+
export declare function signInWithApple(options?: SignInWithAppleOptions): Promise<AppleIDCredential>;
|
|
30
|
+
/** `ASAuthorizationAppleIDProvider.credentialState(forUserID:)`; `unknown` where the host cannot ask (a page). */
|
|
31
|
+
export declare function appleCredentialState(user: string): Promise<AppleCredentialState>;
|
|
32
|
+
export type SignInWithAppleLabel = 'signIn' | 'signUp' | 'continue';
|
|
33
|
+
export type SignInWithAppleStyle = 'black' | 'white' | 'whiteOutline';
|
|
34
|
+
export interface SignInWithAppleButtonProps extends ViewModifiers {
|
|
35
|
+
/** `.signIn` ("Sign in with Apple"), `.signUp` or `.continue`. */
|
|
36
|
+
label?: SignInWithAppleLabel;
|
|
37
|
+
/** `.signInWithAppleButtonStyle`: `black` by default. */
|
|
38
|
+
style?: SignInWithAppleStyle;
|
|
39
|
+
/** What to ask for: `onRequest` on iOS. Both scopes by default. */
|
|
40
|
+
scopes?: ('fullName' | 'email')[];
|
|
41
|
+
nonce?: string;
|
|
42
|
+
state?: string;
|
|
43
|
+
/** The credential, or the error (`cancelled: …` when the viewer dismissed the sheet). */
|
|
44
|
+
onCompletion: (result: {
|
|
45
|
+
credential: AppleIDCredential;
|
|
46
|
+
error?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
credential?: undefined;
|
|
49
|
+
error: Error;
|
|
50
|
+
}) => void;
|
|
51
|
+
}
|
|
52
|
+
export declare function SignInWithAppleButton(props: SignInWithAppleButtonProps): ReactNode;
|
|
53
|
+
//# sourceMappingURL=appleSignIn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appleSignIn.d.ts","sourceRoot":"","sources":["../src/appleSignIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAElG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAO7D,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAEpC,MAAM,WAAW,sBAAsB;IACrC,+FAA+F;IAC/F,MAAM,CAAC,EAAE,CAAC,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC;IAClC,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,oGAAoG;AACpG,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAItG;AAED,kHAAkH;AAClH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAItF;AAED,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,cAAc,CAAC;AAEtE,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,kEAAkE;IAClE,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,yDAAyD;IACzD,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,mEAAmE;IACnE,MAAM,CAAC,EAAE,CAAC,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,YAAY,EAAE,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,iBAAiB,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG;QAAE,UAAU,CAAC,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI,CAAC;CACjI;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,SAAS,CA0BlF"}
|
|
@@ -139,7 +139,12 @@ export interface ToolbarItemProps {
|
|
|
139
139
|
sharedBackgroundVisibility?: 'automatic' | 'visible' | 'hidden';
|
|
140
140
|
children?: ReactNode;
|
|
141
141
|
}
|
|
142
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* `ToolbarItem(placement:) { }`, inside a `toolbar` modifier. A `Label` in
|
|
144
|
+
* it shows its icon alone, its title the icon's accessible name, as iOS
|
|
145
|
+
* draws a bar's labels (and as the Swift shim's bars do); a `Label` given
|
|
146
|
+
* `labelStyle="titleAndIcon"` shows both, and a `Menu`'s items keep theirs.
|
|
147
|
+
*/
|
|
143
148
|
export declare function ToolbarItem(props: ToolbarItemProps): ReactNode;
|
|
144
149
|
export declare const ToolbarItemGroup: typeof ToolbarItem;
|
|
145
150
|
export interface ToolbarSpacerProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,qFAAqF;AACrF,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,IAAI,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAC3C;AAED,iFAAiF;AACjF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAEpI;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe,GAAG,SAAS,CAAC;AACrF,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,oBAAoB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAC/G,wBAAgB,UAAU,CAAC,KAAK,EAAE,yBAAyB,GAAG,eAAe,GAAG,SAAS,CAAC;AAC1F,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,yBAAyB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC"}
|
|
@@ -90,7 +90,12 @@ export interface GeometryChangeSpec<T> {
|
|
|
90
90
|
* reports its size (and its frame on screen once the transform reads it,
|
|
91
91
|
* kept current as the page scrolls) without changing its layout; the
|
|
92
92
|
* action runs after the render that heard a change, as SwiftUI's does, so it
|
|
93
|
-
* may set state.
|
|
93
|
+
* may set state. It runs in the commit (a layout effect), before anything is
|
|
94
|
+
* painted: state it sets renders and lays out synchronously, so a layout
|
|
95
|
+
* that depends on its own measurement settles within the frame, as a
|
|
96
|
+
* `GeometryReader`'s does in SwiftUI, instead of one round per frame with
|
|
97
|
+
* the page painting each. A function form is called with the proxy on
|
|
98
|
+
* every change.
|
|
94
99
|
*/
|
|
95
100
|
export declare function GeometryChangeView({ handler, children }: {
|
|
96
101
|
handler: GeometryChangeHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/components/geometry.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAa,aAAa,EAAE,sBAAsB,EAAsC,MAAM,gCAAgC,CAAC;AAC3I,OAAO,
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/components/geometry.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAa,aAAa,EAAE,sBAAsB,EAAsC,MAAM,gCAAgC,CAAC;AAC3I,OAAO,EAAmE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExG,OAAO,EAAgD,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAI3D,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAK,SAAQ,IAAI;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX;;;;;OAKG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC5D;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CA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C;CACpC;AAeD,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,KAAK,EAChC,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,EAC3B,MAAM,EAAE,YAAY,EACpB,MAAM,GAAE,SAAS,aAAa,EAAO,GACpC;IACD,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,EAAE;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC;IAC7D,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9C,CAsDA;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,SAAS,CA2C5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/components/menus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/components/menus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAI9E,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,SAAS,CAAC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AE,UAAU,GAAG,SAAS,CAgClD;AAED,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,2GAA2G;AAC3G,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CAapE;AAED,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,oFAAoF;AACpF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAIhD"}
|
package/dist/environment.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Environment values: what a modifier on a container passes to the views
|
|
3
3
|
* below it (`.buttonStyle`, `.controlSize`…), and the device environment the
|
|
4
|
-
* page sets (color scheme, Dynamic Type size).
|
|
4
|
+
* page sets (color scheme, Dynamic Type size, size class, scene phase).
|
|
5
5
|
*/
|
|
6
|
-
import type { ButtonStyle, ColorScheme, DynamicTypeSize, PickerStyle, ToggleStyle } from '@swiftbrowser/web/src/protocol';
|
|
6
|
+
import type { ButtonStyle, ColorScheme, DynamicTypeSize, PickerStyle, ScenePhase, ToggleStyle } from '@swiftbrowser/web/src/protocol';
|
|
7
7
|
import { type ReactNode } from 'react';
|
|
8
8
|
export type ControlSize = 'mini' | 'small' | 'regular' | 'large' | 'extraLarge';
|
|
9
9
|
/** `.symbolRenderingMode(_:)`: `palette` draws a symbol's layers in the foreground styles' levels. */
|
|
@@ -52,7 +52,15 @@ export interface Environment {
|
|
|
52
52
|
dynamicTypeSize: DynamicTypeSize;
|
|
53
53
|
/** `compact` below 700 points of width (an iPhone), `regular` from it (an iPad, a desktop window). */
|
|
54
54
|
horizontalSizeClass: HorizontalSizeClass;
|
|
55
|
+
/**
|
|
56
|
+
* `active` while the app is in front and takes input, `inactive` while it
|
|
57
|
+
* shows but does not (the app switcher, a system sheet over it, a page
|
|
58
|
+
* whose window lost focus), `background` while it is not shown (a hidden
|
|
59
|
+
* tab, an app the viewer left). `active` where nothing says otherwise.
|
|
60
|
+
*/
|
|
61
|
+
scenePhase: ScenePhase;
|
|
55
62
|
}
|
|
63
|
+
export type { ScenePhase };
|
|
56
64
|
export declare const EnvironmentContext: import("react").Context<Environment>;
|
|
57
65
|
export declare function EnvironmentProvider({ value, children }: {
|
|
58
66
|
value: Environment;
|
|
@@ -67,6 +75,12 @@ export declare const DismissContext: import("react").Context<(() => void) | null
|
|
|
67
75
|
export declare function useDismiss(): () => void;
|
|
68
76
|
/** `@Environment(\.horizontalSizeClass)` */
|
|
69
77
|
export declare function useHorizontalSizeClass(): HorizontalSizeClass;
|
|
78
|
+
/**
|
|
79
|
+
* `@Environment(\.scenePhase)`: `active`, `inactive` or `background`. A
|
|
80
|
+
* page follows the document's visibility and the window's focus; the native
|
|
81
|
+
* app follows its scene. Refresh what time moved on when it turns `active`.
|
|
82
|
+
*/
|
|
83
|
+
export declare function useScenePhase(): ScenePhase;
|
|
70
84
|
/** `@Environment(\.redactionReasons)`: whether the views below are placeholders. */
|
|
71
85
|
export declare function useRedacted(): boolean;
|
|
72
86
|
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAA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AAI,eAAe,CAEpD;AAED,mEAAmE;AACnE,eAAO,MAAM,cAAc,iCAAwB,IAAI,SAAe,CAAC;AAEvE,wBAAgB,UAAU,IAAI,MAAM,IAAI,CAGvC;AAED,4CAA4C;AAC5C,wBAAgB,sBAAsB,IAAI,mBAAmB,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED,oFAAoF;AACpF,wBAAgB,WAAW,IAAI,OAAO,CAErC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.fileExporter(isPresented:document:contentType:defaultFilename:…)`: the
|
|
3
|
+
* document goes where the viewer chooses. A page shows a save dialog where
|
|
4
|
+
* the browser has one (the File System Access API) and downloads the file
|
|
5
|
+
* elsewhere; the native app shows the document picker (the Files app). Set
|
|
6
|
+
* `isPresented` from a button's action, as a dialog opens only within a tap.
|
|
7
|
+
* `onCompletion` gets where it went (`saved` or `downloaded`, with the
|
|
8
|
+
* host's URLs where it knows them); a dismissed dialog calls `onCancellation`.
|
|
9
|
+
*/
|
|
10
|
+
import { type ExportFilesResult } from '@swiftbrowser/web/src/hostRequests';
|
|
11
|
+
import { type ReactNode } from 'react';
|
|
12
|
+
import { type BindingValue } from './binding';
|
|
13
|
+
export type { ExportFilesResult };
|
|
14
|
+
/** What a `fileExporter` writes: text, bytes or a Blob; a `File` brings its own name and type. */
|
|
15
|
+
export type ExportDocument = string | Uint8Array | ArrayBuffer | Blob;
|
|
16
|
+
export interface FileExporterModifier {
|
|
17
|
+
isPresented: BindingValue<boolean>;
|
|
18
|
+
/** The document, or several; `null` presents nothing (the exporter closes at once). */
|
|
19
|
+
document: ExportDocument | ExportDocument[] | null;
|
|
20
|
+
/** The MIME type (`text/plain`), for a document that is not a typed Blob. */
|
|
21
|
+
contentType?: string;
|
|
22
|
+
/** The name offered (`Notes.txt`); the type's extension is added when the name has none. `Untitled` by default. */
|
|
23
|
+
defaultFilename?: string;
|
|
24
|
+
onCompletion?: (result: ExportFilesResult) => void;
|
|
25
|
+
onCancellation?: () => void;
|
|
26
|
+
onError?: (error: unknown) => void;
|
|
27
|
+
}
|
|
28
|
+
/** The file a document is exported as: named, typed, with the type's extension when the name has none. */
|
|
29
|
+
export declare function exportFile(document: ExportDocument, contentType: string | undefined, defaultFilename: string | undefined, index?: number): File;
|
|
30
|
+
export declare function FileExporterPresenter(spec: FileExporterModifier): ReactNode;
|
|
31
|
+
//# sourceMappingURL=fileExporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileExporter.d.ts","sourceRoot":"","sources":["../src/fileExporter.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAE3D,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,uFAAuF;IACvF,QAAQ,EAAE,cAAc,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC;IACnD,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mHAAmH;IACnH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACnD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAgBD,0GAA0G;AAC1G,wBAAgB,UAAU,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,SAAI,GAAG,IAAI,CAS1I;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,SAAS,CA+B3E"}
|
package/dist/fileManager.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface FileManager {
|
|
|
40
40
|
createDirectory(url: string): Promise<void>;
|
|
41
41
|
/** `fileExists(atPath:)`. */
|
|
42
42
|
fileExists(url: string): Promise<boolean>;
|
|
43
|
-
/** `attributesOfItem(atPath:)`: the size, the modification
|
|
43
|
+
/** `attributesOfItem(atPath:)`: the size, the modification and creation times where known, whether it is a directory, and the MIME type its extension names; fails `notFound: …`. */
|
|
44
44
|
attributesOfItem(url: string): Promise<FileAttributes>;
|
|
45
45
|
/** `moveItem(at:to:)`: to a URL nothing is at, in a directory that exists. */
|
|
46
46
|
moveItem(from: string, to: string): Promise<void>;
|
|
@@ -48,8 +48,23 @@ export interface FileManager {
|
|
|
48
48
|
copyItem(from: string, to: string): Promise<void>;
|
|
49
49
|
/** `removeItem(at:)`: a file, or a directory and all it holds. */
|
|
50
50
|
removeItem(url: string): Promise<void>;
|
|
51
|
-
/** A URL the page can load the file at (an object URL of its bytes; natively the URL itself). */
|
|
51
|
+
/** A URL the page can load the file at (an object URL of its bytes; natively the URL itself, downloaded from iCloud Drive first). */
|
|
52
52
|
loadURL(url: string): Promise<string>;
|
|
53
|
+
/**
|
|
54
|
+
* `FileManager.url(forUbiquityContainerIdentifier:)`, then `Documents`: the
|
|
55
|
+
* app's folder in iCloud Drive, where the app has the iCloud entitlement
|
|
56
|
+
* (`swiftbrowser native init --icloud`) and the viewer iCloud Drive. The
|
|
57
|
+
* files there follow the viewer to their other devices and show in the
|
|
58
|
+
* Files app. Null without it, and on a page. Reading a file another device
|
|
59
|
+
* wrote downloads it first.
|
|
60
|
+
*/
|
|
61
|
+
iCloudDirectory(): Promise<string | null>;
|
|
62
|
+
/**
|
|
63
|
+
* Calls `listener` with the URLs that changed: what this app wrote, and
|
|
64
|
+
* natively what another device wrote to iCloud Drive. Returns a function
|
|
65
|
+
* that stops listening. `useFileStorage` reads a file again on it.
|
|
66
|
+
*/
|
|
67
|
+
watch(listener: (urls: string[]) => void): () => void;
|
|
53
68
|
}
|
|
54
69
|
/** A file manager over the host `host` answers (the environment's, looked up at each call, for the default). */
|
|
55
70
|
export declare function createFileManager(host: () => FilesHost | undefined): FileManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileManager.d.ts","sourceRoot":"","sources":["../src/fileManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAI9F,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAEhD,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,qGAAqG;IACrG,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,mFAAmF;IACnF,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAC7C,qDAAqD;IACrD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,2EAA2E;IAC3E,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7C,6CAA6C;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,qDAAqD;IACrD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,O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AC,IAAI,EAAE,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,CA0ChF;AAED,sFAAsF;AACtF,eAAO,MAAM,WAAW,EAAE,WAA+D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useFileStorage(url, default)`: a value kept as a JSON file through
|
|
3
|
+
* `fileManager`, the way `useAppStorage` keeps one under a key. The file is
|
|
4
|
+
* read when the URL is given (the default stands in until then, and where
|
|
5
|
+
* there is no file yet), written on each set, and read again when
|
|
6
|
+
* `fileManager.watch` says it changed: another view wrote it, or another
|
|
7
|
+
* device did, in iCloud Drive. A document app keeps its documents this way:
|
|
8
|
+
* put the file in `iCloudDirectory()` where there is one, in
|
|
9
|
+
* `documentsDirectory` elsewhere, and it is the same code on both.
|
|
10
|
+
*/
|
|
11
|
+
import { type FileManager } from './fileManager';
|
|
12
|
+
export interface FileStorageOptions<T> {
|
|
13
|
+
/** What a stored value becomes on load: a migration from what an older version wrote. A throw falls back to the default. */
|
|
14
|
+
decode?: (stored: unknown) => T;
|
|
15
|
+
/** A read or write that failed (the file could not be downloaded, the storage is full). */
|
|
16
|
+
onError?: (error: unknown) => void;
|
|
17
|
+
/** The file manager; `fileManager` by default. */
|
|
18
|
+
manager?: FileManager;
|
|
19
|
+
}
|
|
20
|
+
/** The new value, or a function of the current one, as `useState`'s setter takes. */
|
|
21
|
+
export type FileStorageSetter<T> = (value: T | ((current: T) => T)) => void;
|
|
22
|
+
/** `loading` until the file was read (or found missing); `ready` after; `error` when the read failed (the default stands). */
|
|
23
|
+
export type FileStorageStatus = 'loading' | 'ready' | 'error';
|
|
24
|
+
export declare function useFileStorage<T>(url: string | null, defaultValue: T | (() => T), options?: FileStorageOptions<T>): [T, FileStorageSetter<T>, FileStorageStatus];
|
|
25
|
+
//# sourceMappingURL=fileStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileStorage.d.ts","sourceRoot":"","sources":["../src/fileStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,4HAA4H;IAC5H,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,CAAC,CAAC;IAChC,2FAA2F;IAC3F,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,kDAAkD;IAClD,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,qFAAqF;AACrF,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;AAE5E,8HAA8H;AAC9H,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,GAAE,kBAAkB,CAAC,CAAC,CAAM,GAAG,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAqFpK"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useGeolocation(options)`: the viewer's position through the Geolocation
|
|
3
|
+
* API, which a page has from the browser and a native app from the runtime
|
|
4
|
+
* (`navigator.geolocation` over `CLLocationManager`; the app's Info.plist
|
|
5
|
+
* names `NSLocationWhenInUseUsageDescription`). Nothing is asked until
|
|
6
|
+
* `request()` (the first ask prompts the viewer), unless `immediate` is set;
|
|
7
|
+
* `watch` keeps following the position until the view goes.
|
|
8
|
+
*/
|
|
9
|
+
export interface GeolocationFix {
|
|
10
|
+
latitude: number;
|
|
11
|
+
longitude: number;
|
|
12
|
+
/** Meters. */
|
|
13
|
+
accuracy: number;
|
|
14
|
+
altitude: number | null;
|
|
15
|
+
heading: number | null;
|
|
16
|
+
speed: number | null;
|
|
17
|
+
/** Milliseconds since the epoch. */
|
|
18
|
+
timestamp: number;
|
|
19
|
+
}
|
|
20
|
+
export type GeolocationStatus = 'idle' | 'locating' | 'located' | 'denied' | 'failed';
|
|
21
|
+
export interface GeolocationOptions {
|
|
22
|
+
/** Keep following the position (`watchPosition`) instead of asking once. */
|
|
23
|
+
watch?: boolean;
|
|
24
|
+
/** Ask as soon as the view appears. */
|
|
25
|
+
immediate?: boolean;
|
|
26
|
+
enableHighAccuracy?: boolean;
|
|
27
|
+
/** Milliseconds to wait for a fix. */
|
|
28
|
+
timeout?: number;
|
|
29
|
+
maximumAge?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface GeolocationState {
|
|
32
|
+
/** Whether the environment has `navigator.geolocation`. */
|
|
33
|
+
available: boolean;
|
|
34
|
+
status: GeolocationStatus;
|
|
35
|
+
/** The latest fix, kept across a later failure. */
|
|
36
|
+
position: GeolocationFix | null;
|
|
37
|
+
error: string | null;
|
|
38
|
+
/** Asks (again); with `watch`, starts following. */
|
|
39
|
+
request(): void;
|
|
40
|
+
/** Stops a watch; the position stays. */
|
|
41
|
+
stop(): void;
|
|
42
|
+
}
|
|
43
|
+
export declare function useGeolocation(options?: GeolocationOptions): GeolocationState;
|
|
44
|
+
//# sourceMappingURL=geolocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../src/geolocation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtF,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oDAAoD;IACpD,OAAO,IAAI,IAAI,CAAC;IAChB,yCAAyC;IACzC,IAAI,IAAI,IAAI,CAAC;CACd;AAqBD,wBAAgB,cAAc,CAAC,OAAO,GAAE,kBAAuB,GAAG,gBAAgB,CA6DjF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export { SwiftUIView, type SwiftUIViewProps } from './island';
|
|
|
9
9
|
export { useContextBridge } from './bridge';
|
|
10
10
|
export type { Binding, BindingValue } from './binding';
|
|
11
11
|
export { readBinding } from './binding';
|
|
12
|
-
export { useColorScheme, useDynamicTypeSize, useHorizontalSizeClass, useRedacted, type HorizontalSizeClass, useDismiss, useViewEnvironment, type ControlSize, type SymbolRenderingMode, type KeyboardType, type TextContentType, type TextInputHints, type Environment, type ViewEnvironment, } from './environment';
|
|
12
|
+
export { useColorScheme, useDynamicTypeSize, useHorizontalSizeClass, useScenePhase, useRedacted, type HorizontalSizeClass, type ScenePhase, useDismiss, useViewEnvironment, type ControlSize, type SymbolRenderingMode, type KeyboardType, type TextContentType, type TextInputHints, type Environment, type ViewEnvironment, } from './environment';
|
|
13
13
|
export { useNavigation } from './navigation-context';
|
|
14
|
-
export type { ViewModifiers, ForegroundLayers, BackgroundValue, SearchableModifier, ToolbarItemPlacementName, ToolbarRole, CoordinateSpaceValue, DragGestureModifier, DragValue, GestureValue, TapGestureModifier, MagnifyGestureModifier, RotateGestureModifier, PinchValue, SwipeActionsModifier, AlignmentGuideName, DropDestinationModifier, InspectorModifier, ContainerAxes, ContainerRelativeFrameValue, } from './modifiers';
|
|
14
|
+
export type { ViewModifiers, ForegroundLayers, BackgroundValue, SearchableModifier, ToolbarItemPlacementName, ToolbarRole, CoordinateSpaceValue, DragGestureModifier, DragValue, GestureValue, TapGestureModifier, MagnifyGestureModifier, RotateGestureModifier, PinchValue, TouchPoint, TouchesPhase, TouchesHandler, SwipeActionsModifier, AlignmentGuideName, DropDestinationModifier, InspectorModifier, ContainerAxes, ContainerRelativeFrameValue, } from './modifiers';
|
|
15
15
|
export { VisualEffect, type ScrollTransitionClosure, type ScrollTransitionPhase, type ScrollTransitionSpec, type VisualEffectClosure, } from './visualEffect';
|
|
16
16
|
export type { ContentMarginsValue, ScrollEdgeEffectHiddenValue, ScrollEdgeEffectStyle, ScrollEdgeEffectStyleValue, ScrollEdges } from './scrollEnvironment';
|
|
17
17
|
export type { SheetModifier, AlertModifier, DetentValue } from './presentation';
|
|
18
18
|
export type { FileImporterModifier } from './fileImporter';
|
|
19
|
+
export { exportFile, type ExportDocument, type ExportFilesResult, type FileExporterModifier } from './fileExporter';
|
|
19
20
|
export * from './values';
|
|
20
21
|
export { Path, type CGRect, type Point } from './path';
|
|
21
22
|
export { AttributedText, type AttributedRun, type RunFont, type TextAttributes, type TextSelection } from './attributedText';
|
|
@@ -23,7 +24,12 @@ export { measureText, canMeasureText, installTextMeasurer, type TextMeasurement,
|
|
|
23
24
|
export { ScrollViewReader, type ScrollPoint, type ScrollPositionBinding, type ScrollViewProxy, type ScrollPositionValue } from './scrollReader';
|
|
24
25
|
export { useAudioRecorder, type AudioRange, type AudioRecorder, type AudioRecorderOptions, type AudioRecorderStatus, type AudioRecording } from './audioRecorder';
|
|
25
26
|
export { useCoordinateSpaces } from './coordinateSpace';
|
|
27
|
+
export { useWakeLock } from './wakeLock';
|
|
28
|
+
export { SignInWithAppleButton, signInWithApple, appleCredentialState, canSignInWithApple, configureSignInWithApple, type AppleCredentialState, type AppleIDCredential, type SignInWithAppleButtonProps, type SignInWithAppleLabel, type SignInWithAppleOptions, type SignInWithAppleStyle, } from './appleSignIn';
|
|
29
|
+
export { useGeolocation, type GeolocationFix, type GeolocationOptions, type GeolocationState, type GeolocationStatus } from './geolocation';
|
|
30
|
+
export { useSpeechSynthesis, useSpeechRecognition, type SpeakOptions, type SpeechSynthesisState, type SpeechRecognitionOptions, type SpeechRecognitionState } from './speech';
|
|
26
31
|
export { useAppStorage, appStorage, type AppStorageOptions, type AppStorageSetter, type AppStorageStore } from './appStorage';
|
|
32
|
+
export { useFileStorage, type FileStorageOptions, type FileStorageSetter, type FileStorageStatus } from './fileStorage';
|
|
27
33
|
export { fileManager, createFileManager, type FileAttributes, type FileContents, type FileDirectories, type FileManager } from './fileManager';
|
|
28
34
|
export { UndoManager, UndoManagerContext, useUndoManager, type UndoHost, type UndoManagerOptions, type UndoOptions, type UndoState } from './undo';
|
|
29
35
|
export * from './components/stacks';
|