@c9up/orbit 0.0.0-stage → 0.1.1
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/Cargo.lock +139 -0
- package/Cargo.toml +20 -0
- package/LICENSE +21 -0
- package/README.md +320 -2
- package/android/orbit.cmake +31 -0
- package/android/src/main/cpp/NativeOrbit.cpp +309 -0
- package/android/src/main/cpp/NativeOrbit.h +35 -0
- package/android/src/main/cpp/orbit_host.h +34 -0
- package/android/src/main/java/com/c9up/orbit/OrbitEffects.kt +286 -0
- package/android/src/main/java/com/c9up/orbit/OrbitHost.kt +258 -0
- package/android/src/main/java/com/c9up/orbit/OrbitImage.kt +346 -0
- package/android/src/main/java/com/c9up/orbit/OrbitInput.kt +161 -0
- package/android/src/main/java/com/c9up/orbit/OrbitPress.kt +110 -0
- package/android/src/main/java/com/c9up/orbit/OrbitVector.kt +115 -0
- package/android/src/main/java/com/c9up/orbit/OrbitViews.kt +362 -0
- package/crates/orbit-host/Cargo.toml +14 -0
- package/crates/orbit-host/src/gesture.rs +561 -0
- package/crates/orbit-host/src/lib.rs +2042 -0
- package/crates/orbit-host/src/motion.rs +328 -0
- package/crates/orbit-host/src/vector.rs +1173 -0
- package/dist/color.d.ts +10 -0
- package/dist/color.d.ts.map +1 -0
- package/dist/color.js +62 -0
- package/dist/color.js.map +1 -0
- package/dist/commit.d.ts +77 -0
- package/dist/commit.d.ts.map +1 -0
- package/dist/commit.js +302 -0
- package/dist/commit.js.map +1 -0
- package/dist/errors.d.ts +76 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +89 -0
- package/dist/errors.js.map +1 -0
- package/dist/host.d.ts +49 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +20 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/motion.d.ts +18 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +67 -0
- package/dist/motion.js.map +1 -0
- package/dist/node.d.ts +46 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +110 -0
- package/dist/node.js.map +1 -0
- package/dist/pages.d.ts +56 -0
- package/dist/pages.d.ts.map +1 -0
- package/dist/pages.js +157 -0
- package/dist/pages.js.map +1 -0
- package/dist/react-native/index.d.ts +33 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +71 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/report.d.ts +13 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +22 -0
- package/dist/report.js.map +1 -0
- package/dist/server.d.ts +109 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +290 -0
- package/dist/server.js.map +1 -0
- package/dist/stack.d.ts +117 -0
- package/dist/stack.d.ts.map +1 -0
- package/dist/stack.js +299 -0
- package/dist/stack.js.map +1 -0
- package/dist/styles.d.ts +138 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +920 -0
- package/dist/styles.js.map +1 -0
- package/dist/template.d.ts +27 -0
- package/dist/template.d.ts.map +1 -0
- package/dist/template.js +1436 -0
- package/dist/template.js.map +1 -0
- package/dist/textDecoder.d.ts +29 -0
- package/dist/textDecoder.d.ts.map +1 -0
- package/dist/textDecoder.js +149 -0
- package/dist/textDecoder.js.map +1 -0
- package/dist/url.d.ts +45 -0
- package/dist/url.d.ts.map +1 -0
- package/dist/url.js +303 -0
- package/dist/url.js.map +1 -0
- package/package.json +96 -3
- package/scripts/build-android.sh +27 -0
- package/scripts/test-styles.mjs +31 -0
- package/specs/NativeOrbit.ts +34 -0
- package/src/color.ts +68 -0
- package/src/commit.ts +373 -0
- package/src/errors.ts +178 -0
- package/src/host.ts +91 -0
- package/src/index.ts +64 -0
- package/src/motion.ts +88 -0
- package/src/node.ts +133 -0
- package/src/pages.ts +207 -0
- package/src/react-native/index.ts +115 -0
- package/src/react-native/react-native.d.ts +39 -0
- package/src/report.ts +25 -0
- package/src/server.ts +395 -0
- package/src/stack.ts +428 -0
- package/src/styles.ts +1021 -0
- package/src/template.ts +1681 -0
- package/src/textDecoder.ts +162 -0
- package/src/url.ts +333 -0
package/dist/pages.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@c9up/orbit/pages` — pages the ream server drives, on the phone.
|
|
3
|
+
*
|
|
4
|
+
* The server stays the router: a link or a visit asks it for the next page
|
|
5
|
+
* object (photon's protocol, the one the browser speaks after `visits: true`)
|
|
6
|
+
* and the app shows the page it names — an aurora component bundled with the
|
|
7
|
+
* app — as a screen of a stack. The same controller answers the browser and
|
|
8
|
+
* the phone.
|
|
9
|
+
*
|
|
10
|
+
* run(() => html`${serverPages({
|
|
11
|
+
* server: 'https://app.example',
|
|
12
|
+
* pages: { Home, Orders, Order },
|
|
13
|
+
* })}`)
|
|
14
|
+
*
|
|
15
|
+
* photon's router does the protocol — visits, partial reloads, deferred
|
|
16
|
+
* props, the version check, history — and this is where it runs: requests to
|
|
17
|
+
* the server, a back stack in memory mirrored by the screens, the back button
|
|
18
|
+
* going through photon's history. A covered page keeps its state; going back
|
|
19
|
+
* shows it as it was, without a request.
|
|
20
|
+
*/
|
|
21
|
+
import { html } from "@c9up/aurora/core";
|
|
22
|
+
import { bootPage, router, } from "@c9up/photon/client/core";
|
|
23
|
+
import { E_ORBIT_INTERNAL, E_ORBIT_UNKNOWN_PAGE } from "./errors.js";
|
|
24
|
+
import { connectServer } from "./server.js";
|
|
25
|
+
import { createStack } from "./stack.js";
|
|
26
|
+
import { setLinkHandler } from "./template.js";
|
|
27
|
+
/** What photon hands back from `resolveComponent`: one of `pages`, a function. */
|
|
28
|
+
function isPage(value) {
|
|
29
|
+
return typeof value === "function";
|
|
30
|
+
}
|
|
31
|
+
const Loading = () => html `<div class="flex-1"></div>`;
|
|
32
|
+
const Failed = (error, retry) => html `<div class="flex-1 items-center justify-center gap-4 p-6">
|
|
33
|
+
<p class="text-center">${error instanceof Error ? error.message : String(error)}</p>
|
|
34
|
+
<button class="rounded-md border px-4 py-2" @click=${retry}>Retry</button>
|
|
35
|
+
</div>`;
|
|
36
|
+
/** The stack the server's pages are shown in; put it in a template. */
|
|
37
|
+
export function serverPages(options) {
|
|
38
|
+
const server = typeof options.server === "string"
|
|
39
|
+
? connectServer(options.server)
|
|
40
|
+
: options.server;
|
|
41
|
+
const origin = server.origin;
|
|
42
|
+
const first = server.url(options.url ?? "/");
|
|
43
|
+
const failed = options.failed ?? Failed;
|
|
44
|
+
let entries = [{ state: null, url: first }];
|
|
45
|
+
let restore;
|
|
46
|
+
/** The page a visit rendered, waiting for photon to say how it goes in history. */
|
|
47
|
+
let pending = null;
|
|
48
|
+
/** The back button asked photon for the previous entry. */
|
|
49
|
+
let popping = false;
|
|
50
|
+
const current = () => {
|
|
51
|
+
const entry = entries.at(-1);
|
|
52
|
+
if (entry === undefined)
|
|
53
|
+
throw new E_ORBIT_INTERNAL(["server pages: empty history"]);
|
|
54
|
+
return entry;
|
|
55
|
+
};
|
|
56
|
+
const absolute = (url) => new URL(url, current().url).href;
|
|
57
|
+
const stack = createStack(options.loading ?? Loading, {
|
|
58
|
+
...options.stack,
|
|
59
|
+
back: () => {
|
|
60
|
+
if (entries.length < 2 || restore === undefined)
|
|
61
|
+
return false;
|
|
62
|
+
entries.pop();
|
|
63
|
+
popping = true;
|
|
64
|
+
restore(current().state);
|
|
65
|
+
return true;
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
/** The visit's page goes in as photon wrote it in history. */
|
|
69
|
+
const place = (how) => {
|
|
70
|
+
const next = pending;
|
|
71
|
+
pending = null;
|
|
72
|
+
if (next === null)
|
|
73
|
+
return;
|
|
74
|
+
if (how === "push")
|
|
75
|
+
stack.push(next.page, next.props);
|
|
76
|
+
else
|
|
77
|
+
stack.replaceInPlace(next.page, next.props);
|
|
78
|
+
};
|
|
79
|
+
const host = {
|
|
80
|
+
href: () => current().url,
|
|
81
|
+
baseUri: () => current().url,
|
|
82
|
+
// The connection refuses another origin, sends the session cookie and
|
|
83
|
+
// keeps the XSRF token the server sets.
|
|
84
|
+
fetch: (url, init) => server.fetch(absolute(url), init),
|
|
85
|
+
state: () => current().state,
|
|
86
|
+
push: (state, url) => {
|
|
87
|
+
entries.push({ state, url: absolute(url) });
|
|
88
|
+
place("push");
|
|
89
|
+
},
|
|
90
|
+
replace: (state, url) => {
|
|
91
|
+
entries[entries.length - 1] = { state, url: absolute(url) };
|
|
92
|
+
place("replace");
|
|
93
|
+
},
|
|
94
|
+
load: (url) => start(absolute(url)),
|
|
95
|
+
reload: () => start(current().url),
|
|
96
|
+
emit: () => { },
|
|
97
|
+
cookie: (name) => (name === "XSRF-TOKEN" ? server.xsrf() : undefined),
|
|
98
|
+
memoryHistory: true,
|
|
99
|
+
listen: (wire) => {
|
|
100
|
+
restore = wire.restore;
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
const adapter = {
|
|
104
|
+
update(page, props) {
|
|
105
|
+
if (!isPage(page))
|
|
106
|
+
return;
|
|
107
|
+
if (popping) {
|
|
108
|
+
// The covered screen is the page coming back, as it was left.
|
|
109
|
+
popping = false;
|
|
110
|
+
stack.pop();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
pending = { page, props };
|
|
114
|
+
},
|
|
115
|
+
unmount() { },
|
|
116
|
+
};
|
|
117
|
+
const resolveComponent = async (name) => {
|
|
118
|
+
const page = Object.hasOwn(options.pages, name)
|
|
119
|
+
? options.pages[name]
|
|
120
|
+
: undefined;
|
|
121
|
+
if (page === undefined) {
|
|
122
|
+
throw new E_ORBIT_UNKNOWN_PAGE([name]);
|
|
123
|
+
}
|
|
124
|
+
return { default: page };
|
|
125
|
+
};
|
|
126
|
+
/** A first load of `url`: the history starts again from its page. */
|
|
127
|
+
function start(url) {
|
|
128
|
+
entries = [{ state: null, url }];
|
|
129
|
+
pending = null;
|
|
130
|
+
popping = false;
|
|
131
|
+
bootPage({
|
|
132
|
+
host,
|
|
133
|
+
url,
|
|
134
|
+
resolveComponent,
|
|
135
|
+
mount: async (_target, page, data) => {
|
|
136
|
+
if (isPage(page))
|
|
137
|
+
stack.reset(page, data.props);
|
|
138
|
+
return adapter;
|
|
139
|
+
},
|
|
140
|
+
}).catch((error) => {
|
|
141
|
+
stack.reset(() => failed(error, () => start(url)), undefined);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
setLinkHandler((href) => {
|
|
145
|
+
const url = absolute(href);
|
|
146
|
+
if (new URL(url).origin === origin) {
|
|
147
|
+
const target = new URL(url);
|
|
148
|
+
void router.visit(target.pathname + target.search + target.hash);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
options.open?.(url);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
start(first);
|
|
155
|
+
return stack;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../src/pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EACN,QAAQ,EAGR,MAAM,GACN,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,aAAa,EAAyB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,WAAW,EAAiC,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA+B/C,kFAAkF;AAClF,SAAS,MAAM,CAAC,KAAc;IAC7B,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACpC,CAAC;AAED,MAAM,OAAO,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA,4BAA4B,CAAC;AAEvE,MAAM,MAAM,GAAG,C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,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAC5B,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClE,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACF,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,KAAK,CAAC,CAAC;IACb,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@c9up/orbit/react-native` — an app's entry on a phone.
|
|
3
|
+
*
|
|
4
|
+
* import { run } from "@c9up/orbit/react-native";
|
|
5
|
+
* import { App } from "./App.js";
|
|
6
|
+
* run(App);
|
|
7
|
+
*
|
|
8
|
+
* React Native supplies the JS engine, the JSI module registry and the
|
|
9
|
+
* activity; nothing of React is used. `run` registers the app under the name
|
|
10
|
+
* the activity `ream android:*` generates starts, gives orbit its native host
|
|
11
|
+
* and the app's style table, and mounts the root component with the launch
|
|
12
|
+
* props (intent extras). The
|
|
13
|
+
* back button and the back gesture pop the innermost shown stack; with none
|
|
14
|
+
* to pop, the app goes back as any Android app does. React Native's `URL` is
|
|
15
|
+
* replaced by a standard one when it is not one (see `url.ts`).
|
|
16
|
+
*/
|
|
17
|
+
import type { TemplateResult } from "@c9up/aurora/renderer";
|
|
18
|
+
/** The name the generated activity starts the app by. */
|
|
19
|
+
export declare const APP_NAME = "main";
|
|
20
|
+
export type LaunchProps = {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
export interface RunOptions {
|
|
24
|
+
/**
|
|
25
|
+
* `system` (default): `dark:` follows the phone's setting, as a browser's
|
|
26
|
+
* `prefers-color-scheme` — until the app sets `colorScheme(…)` itself.
|
|
27
|
+
* `light` / `dark`: that one, whatever the phone says.
|
|
28
|
+
*/
|
|
29
|
+
colorScheme?: "system" | "light" | "dark";
|
|
30
|
+
}
|
|
31
|
+
/** Register `root` as the app and mount it when the activity starts. */
|
|
32
|
+
export declare function run(root: (props: LaunchProps) => TemplateResult, options?: RunOptions): void;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-native/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA2B5D,yDAAyD;AACzD,eAAO,MAAM,QAAQ,SAAS,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAmBrD,MAAM,WAAW,UAAU;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;CAC1C;AAsBD,wEAAwE;AACxE,wBAAgB,GAAG,CAClB,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,cAAc,EAC5C,OAAO,GAAE,UAAe,GACtB,IAAI,CAgBN"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// The app's style table: `ream android:*` compiles the app's Tailwind build
|
|
2
|
+
// into it and Metro serves it under this name.
|
|
3
|
+
import styles from "@c9up/orbit-styles";
|
|
4
|
+
import { Appearance, AppRegistry, BackHandler, Dimensions, TurboModuleRegistry, } from "react-native";
|
|
5
|
+
import { E_ORBIT_NO_HOST } from "../errors.js";
|
|
6
|
+
import { NATIVE_MODULE_NAME, useHost } from "../host.js";
|
|
7
|
+
import { goBack } from "../stack.js";
|
|
8
|
+
import { colorScheme, useStyles } from "../styles.js";
|
|
9
|
+
import { mount } from "../template.js";
|
|
10
|
+
import { installTextDecoder } from "../textDecoder.js";
|
|
11
|
+
import { installStandardUrl } from "../url.js";
|
|
12
|
+
// Before the app's own modules run: React Native's URL resolves a relative
|
|
13
|
+
// reference by appending it to the base, and photon's router (and any code
|
|
14
|
+
// shared with the browser) needs the standard one.
|
|
15
|
+
installStandardUrl();
|
|
16
|
+
// Hermes has TextEncoder but no TextDecoder: libraries shared with the web
|
|
17
|
+
// (msgpack, protobuf…) would die at load.
|
|
18
|
+
installTextDecoder();
|
|
19
|
+
/** The name the generated activity starts the app by. */
|
|
20
|
+
export const APP_NAME = "main";
|
|
21
|
+
const METHODS = [
|
|
22
|
+
"setViewport",
|
|
23
|
+
"commit",
|
|
24
|
+
"imageBytes",
|
|
25
|
+
"layout",
|
|
26
|
+
"scroll",
|
|
27
|
+
"setEventHandler",
|
|
28
|
+
];
|
|
29
|
+
function isOrbitHost(value) {
|
|
30
|
+
return (typeof value === "object" &&
|
|
31
|
+
value !== null &&
|
|
32
|
+
METHODS.every((name) => typeof Reflect.get(value, name) === "function"));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Follow the phone's light / dark setting into `colorScheme`, as long as the
|
|
36
|
+
* app has not chosen one itself (a value set by anything else stops it).
|
|
37
|
+
*/
|
|
38
|
+
function followSystemScheme() {
|
|
39
|
+
const read = (value) => (value === "dark" ? "dark" : "light");
|
|
40
|
+
let set = read(Appearance.getColorScheme());
|
|
41
|
+
colorScheme(set);
|
|
42
|
+
const subscription = Appearance.addChangeListener(({ colorScheme: next }) => {
|
|
43
|
+
if (colorScheme() !== set) {
|
|
44
|
+
subscription.remove();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
set = read(next);
|
|
48
|
+
colorScheme(set);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** Register `root` as the app and mount it when the activity starts. */
|
|
52
|
+
export function run(root, options = {}) {
|
|
53
|
+
AppRegistry.registerRunnable(APP_NAME, ({ initialProps }) => {
|
|
54
|
+
const host = TurboModuleRegistry.getEnforcing(NATIVE_MODULE_NAME);
|
|
55
|
+
if (!isOrbitHost(host)) {
|
|
56
|
+
throw new E_ORBIT_NO_HOST([
|
|
57
|
+
`the ${NATIVE_MODULE_NAME} module is not orbit's native host: is the app built by ream android:build?`,
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
useHost(host);
|
|
61
|
+
useStyles(styles);
|
|
62
|
+
const scheme = options.colorScheme ?? "system";
|
|
63
|
+
if (scheme === "system")
|
|
64
|
+
followSystemScheme();
|
|
65
|
+
else
|
|
66
|
+
colorScheme(scheme);
|
|
67
|
+
BackHandler.addEventListener("hardwareBackPress", goBack);
|
|
68
|
+
mount(root(initialProps ?? {}), { viewport: Dimensions.get("window") });
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-native/index.ts"],"names":[],"mappings":"AAiBA,4EAA4E;AAC5E,+CAA+C;AAC/C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACN,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,mBAAmB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAkB,OAAO,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,2EAA2E;AAC3E,2EAA2E;AAC3E,mDAAmD;AACnD,kBAAkB,EAAE,CAAC;AACrB,2EAA2E;AAC3E,0CAA0C;AAC1C,kBAAkB,EAAE,CAAC;AAErB,yDAAyD;AACzD,MAAM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,CAAC;QAClE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,eAAe,CAAC;gBACzB,OAAO,kBAAkB,6EAA6E;aACtG,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,SAAS,CAAC,MAAM,CAAC,CAAC;QAClB,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,IAAI,QAAQ,CAAC;QAC/C,IAAI,MAAM,KAAK,QAAQ;YAAE,kBAAkB,EAAE,CAAC;;YACzC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzB,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;QAC1D,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/report.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where orbit tells the app about a failure it recovered from instead of
|
|
3
|
+
* throwing: a commit the host refused while nobody was waiting on it (a
|
|
4
|
+
* scheduled commit), an image address from data orbit will not load, a value
|
|
5
|
+
* in a drawing the host left out. `mount({ onError })` sets the listener; with
|
|
6
|
+
* none, a development build (React Native's `__DEV__`) logs it with
|
|
7
|
+
* `console.warn` and a production build says nothing.
|
|
8
|
+
*/
|
|
9
|
+
export type ErrorListener = (error: Error) => void;
|
|
10
|
+
/** The listener `mount` was given (null: the default described above). */
|
|
11
|
+
export declare function setErrorListener(next: ErrorListener | null): void;
|
|
12
|
+
export declare function report(error: Error): void;
|
|
13
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAInD,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAEjE;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAMzC"}
|
package/dist/report.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where orbit tells the app about a failure it recovered from instead of
|
|
3
|
+
* throwing: a commit the host refused while nobody was waiting on it (a
|
|
4
|
+
* scheduled commit), an image address from data orbit will not load, a value
|
|
5
|
+
* in a drawing the host left out. `mount({ onError })` sets the listener; with
|
|
6
|
+
* none, a development build (React Native's `__DEV__`) logs it with
|
|
7
|
+
* `console.warn` and a production build says nothing.
|
|
8
|
+
*/
|
|
9
|
+
let listener = null;
|
|
10
|
+
/** The listener `mount` was given (null: the default described above). */
|
|
11
|
+
export function setErrorListener(next) {
|
|
12
|
+
listener = next;
|
|
13
|
+
}
|
|
14
|
+
export function report(error) {
|
|
15
|
+
if (listener) {
|
|
16
|
+
listener(error);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (Reflect.get(globalThis, "__DEV__") === true)
|
|
20
|
+
console.warn(error);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,IAAI,QAAQ,GAAyB,IAAI,CAAC;AAE1C,0EAA0E;AAC1E,MAAM,UAAU,gBAAgB,CAAC,IAA0B;IAC1D,QAAQ,GAAG,IAAI,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAY;IAClC,IAAI,QAAQ,EAAE,CAAC;QACd,QAAQ,CAAC,KAAK,CAAC,CAAC;QAChB,OAAO;IACR,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app's ream server, as one connection: what pages, comet calls and relay
|
|
3
|
+
* subscriptions all go through on the phone.
|
|
4
|
+
*
|
|
5
|
+
* const server = connectServer('https://app.example')
|
|
6
|
+
* serverPages({ server, pages })
|
|
7
|
+
* const rpc = createRpcClient({ url: server.url('/rpc'), transport: server.json })
|
|
8
|
+
* configureRelay({
|
|
9
|
+
* sseUrl: server.url('/__relay/events'),
|
|
10
|
+
* subscribeUrl: server.url('/__relay/subscribe'),
|
|
11
|
+
* unsubscribeUrl: server.url('/__relay/unsubscribe'),
|
|
12
|
+
* stream: server.stream,
|
|
13
|
+
* fetch: server.fetch,
|
|
14
|
+
* })
|
|
15
|
+
*
|
|
16
|
+
* A browser gets this from the page for free: one origin, its cookies sent
|
|
17
|
+
* along, the `XSRF-TOKEN` cookie readable by the page, an `EventSource`. An
|
|
18
|
+
* app has none of it, so the connection gives each: requests to the server's
|
|
19
|
+
* origin only, with the session cookie (React Native sends cookies only with
|
|
20
|
+
* `credentials: 'include'`), the `XSRF-TOKEN` the server set echoed on every
|
|
21
|
+
* mutation, and server-sent events read from React Native's streaming XHR.
|
|
22
|
+
*/
|
|
23
|
+
export interface ServerConnection {
|
|
24
|
+
/** The server's origin (`https://app.example`). */
|
|
25
|
+
readonly origin: string;
|
|
26
|
+
/** `path` on the server, absolute. */
|
|
27
|
+
url(path: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* A request to the server: refused for another origin, carrying the
|
|
30
|
+
* session cookie and, on a mutation, the `X-XSRF-TOKEN` the server's
|
|
31
|
+
* `XSRF-TOKEN` cookie set.
|
|
32
|
+
*/
|
|
33
|
+
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
34
|
+
/**
|
|
35
|
+
* POST `body` as JSON and resolve the JSON answer (nothing for a 204): the
|
|
36
|
+
* shape of comet's `RpcTransport`.
|
|
37
|
+
*/
|
|
38
|
+
json(url: string, body: unknown, options?: {
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}): Promise<unknown>;
|
|
41
|
+
/** A server-sent event stream at `url`: what relay's `stream` option takes. */
|
|
42
|
+
stream(url: string): ServerEventStream;
|
|
43
|
+
/** The `XSRF-TOKEN` the server set last, if any. */
|
|
44
|
+
xsrf(): string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Send `Authorization: Bearer <token>` with every request and stream from
|
|
47
|
+
* now on (`null` stops): an API's token, which — unlike a browser's
|
|
48
|
+
* `EventSource` — the phone can send on server-sent events too. With a
|
|
49
|
+
* `tokenStore`, the token is kept there too (and forgotten on `null`);
|
|
50
|
+
* the promise settles once it is.
|
|
51
|
+
*/
|
|
52
|
+
authorize(token: string | null): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Authorize again with the token the `tokenStore` kept, as when the app
|
|
55
|
+
* starts: true when there was one. Without a store, false.
|
|
56
|
+
*/
|
|
57
|
+
restore(): Promise<boolean>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Where a connection keeps its API token between launches — on a phone,
|
|
61
|
+
* `@c9up/orbit-secure-store`'s getItem / setItem / deleteItem under a key:
|
|
62
|
+
*
|
|
63
|
+
* connectServer(origin, { tokenStore: {
|
|
64
|
+
* get: () => getItem('session'),
|
|
65
|
+
* set: (token) => token === null ? deleteItem('session') : setItem('session', token),
|
|
66
|
+
* } })
|
|
67
|
+
*/
|
|
68
|
+
export interface TokenStore {
|
|
69
|
+
get(): Promise<string | null>;
|
|
70
|
+
set(token: string | null): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
export interface ConnectOptions {
|
|
73
|
+
/** Keeps the token `authorize` sets, so `restore` finds it at the next launch. */
|
|
74
|
+
tokenStore?: TokenStore;
|
|
75
|
+
}
|
|
76
|
+
/** Connect to the app's ream server: https, or http to this machine or the emulator's host. */
|
|
77
|
+
export declare function connectServer(server: string, options?: ConnectOptions): ServerConnection;
|
|
78
|
+
/** A server-sent event: its type, data and id, as an `EventSource`'s `MessageEvent` carries them. */
|
|
79
|
+
export interface ServerEvent {
|
|
80
|
+
readonly type: string;
|
|
81
|
+
readonly data?: string;
|
|
82
|
+
readonly lastEventId?: string;
|
|
83
|
+
}
|
|
84
|
+
type Listener = (event: ServerEvent) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Server-sent events over XHR — what `EventSource` does, where there is
|
|
87
|
+
* none (React Native): the stream is read as it arrives, parsed as the
|
|
88
|
+
* HTML standard says (`event:`, `data:`, `id:`, `retry:`, comments), each
|
|
89
|
+
* event dispatched under its type; a dropped connection dispatches `error`
|
|
90
|
+
* and reconnects after `retry` ms with `Last-Event-ID`. An answer that is
|
|
91
|
+
* not a 200 `text/event-stream` fails the stream for good (`error`, no
|
|
92
|
+
* reconnect), as `EventSource` does.
|
|
93
|
+
*/
|
|
94
|
+
export declare class ServerEventStream {
|
|
95
|
+
#private;
|
|
96
|
+
static readonly CONNECTING = 0;
|
|
97
|
+
static readonly OPEN = 1;
|
|
98
|
+
static readonly CLOSED = 2;
|
|
99
|
+
readonly url: string;
|
|
100
|
+
readyState: number;
|
|
101
|
+
constructor(url: string, headers?: () => Record<string, string>, options?: {
|
|
102
|
+
credentials?: boolean;
|
|
103
|
+
});
|
|
104
|
+
addEventListener(type: string, listener: Listener): void;
|
|
105
|
+
removeEventListener(type: string, listener: Listener): void;
|
|
106
|
+
close(): void;
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH,MAAM,WAAW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