@c9up/orbit 0.1.0 → 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.
Files changed (77) hide show
  1. package/Cargo.lock +9 -16
  2. package/Cargo.toml +4 -0
  3. package/README.md +7 -1
  4. package/android/src/main/java/com/c9up/orbit/OrbitInput.kt +18 -2
  5. package/crates/orbit-host/Cargo.toml +1 -1
  6. package/crates/orbit-host/src/lib.rs +549 -115
  7. package/crates/orbit-host/src/vector.rs +312 -56
  8. package/dist/color.d.ts.map +1 -1
  9. package/dist/color.js +3 -3
  10. package/dist/color.js.map +1 -1
  11. package/dist/commit.d.ts +32 -0
  12. package/dist/commit.d.ts.map +1 -1
  13. package/dist/commit.js +142 -12
  14. package/dist/commit.js.map +1 -1
  15. package/dist/errors.d.ts +60 -26
  16. package/dist/errors.d.ts.map +1 -1
  17. package/dist/errors.js +85 -11
  18. package/dist/errors.js.map +1 -1
  19. package/dist/host.d.ts.map +1 -1
  20. package/dist/host.js +4 -2
  21. package/dist/host.js.map +1 -1
  22. package/dist/index.d.ts +4 -2
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +3 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/motion.d.ts.map +1 -1
  27. package/dist/motion.js +7 -6
  28. package/dist/motion.js.map +1 -1
  29. package/dist/pages.d.ts.map +1 -1
  30. package/dist/pages.js +3 -3
  31. package/dist/pages.js.map +1 -1
  32. package/dist/react-native/index.d.ts +9 -1
  33. package/dist/react-native/index.d.ts.map +1 -1
  34. package/dist/react-native/index.js +33 -5
  35. package/dist/react-native/index.js.map +1 -1
  36. package/dist/report.d.ts +13 -0
  37. package/dist/report.d.ts.map +1 -0
  38. package/dist/report.js +22 -0
  39. package/dist/report.js.map +1 -0
  40. package/dist/server.d.ts +27 -3
  41. package/dist/server.d.ts.map +1 -1
  42. package/dist/server.js +15 -7
  43. package/dist/server.js.map +1 -1
  44. package/dist/stack.d.ts.map +1 -1
  45. package/dist/stack.js +3 -3
  46. package/dist/stack.js.map +1 -1
  47. package/dist/styles.d.ts.map +1 -1
  48. package/dist/styles.js +2 -2
  49. package/dist/styles.js.map +1 -1
  50. package/dist/template.d.ts.map +1 -1
  51. package/dist/template.js +56 -12
  52. package/dist/template.js.map +1 -1
  53. package/dist/textDecoder.d.ts +29 -0
  54. package/dist/textDecoder.d.ts.map +1 -0
  55. package/dist/textDecoder.js +149 -0
  56. package/dist/textDecoder.js.map +1 -0
  57. package/dist/url.d.ts.map +1 -1
  58. package/dist/url.js +4 -3
  59. package/dist/url.js.map +1 -1
  60. package/package.json +13 -7
  61. package/scripts/build-android.sh +0 -0
  62. package/src/color.ts +5 -10
  63. package/src/commit.ts +184 -17
  64. package/src/errors.ts +174 -44
  65. package/src/host.ts +4 -5
  66. package/src/index.ts +5 -1
  67. package/src/motion.ts +8 -6
  68. package/src/pages.ts +3 -6
  69. package/src/react-native/index.ts +46 -7
  70. package/src/react-native/react-native.d.ts +8 -0
  71. package/src/report.ts +25 -0
  72. package/src/server.ts +50 -14
  73. package/src/stack.ts +3 -9
  74. package/src/styles.ts +2 -5
  75. package/src/template.ts +65 -41
  76. package/src/textDecoder.ts +162 -0
  77. package/src/url.ts +10 -3
package/dist/commit.js CHANGED
@@ -1,12 +1,88 @@
1
- import { OrbitError } from "./errors.js";
1
+ import { E_ORBIT_COMMIT_FAILED, E_ORBIT_SVG_VALUE, E_ORBIT_TREE_TOO_DEEP, } from "./errors.js";
2
2
  import { currentHost } from "./host.js";
3
3
  import { setDirtyListener } from "./node.js";
4
+ import { report } from "./report.js";
4
5
  import { viewportSize } from "./styles.js";
5
6
  function isReport(value) {
6
7
  return (typeof value === "object" &&
7
8
  value !== null &&
8
9
  Array.isArray(Reflect.get(value, "deleted")));
9
10
  }
11
+ /** The codes the host prefixes its messages with, as the errors orbit throws. */
12
+ const HOST_CODES = {
13
+ E_ORBIT_TREE_TOO_DEEP,
14
+ E_ORBIT_SVG_VALUE,
15
+ };
16
+ /** A coded host message (`E_ORBIT_X: what happened`) as orbit's error for it. */
17
+ function hostError(message, cause) {
18
+ const at = message.indexOf(": ");
19
+ const code = at < 0 ? "" : message.slice(0, at);
20
+ for (const [name, ErrorClass] of Object.entries(HOST_CODES)) {
21
+ if (name === code)
22
+ return new ErrorClass([message.slice(at + 2)], { cause });
23
+ }
24
+ return null;
25
+ }
26
+ /**
27
+ * Why the host refused a commit: its `{ "error": … }` report, thrown by the
28
+ * native module as the message of a JS error (or returned, by a host that
29
+ * does not throw).
30
+ */
31
+ function refusal(answer, cause) {
32
+ let detail = answer;
33
+ if (typeof answer === "string") {
34
+ try {
35
+ detail = JSON.parse(answer);
36
+ }
37
+ catch {
38
+ detail = answer;
39
+ }
40
+ }
41
+ const message = typeof detail === "object" && detail !== null
42
+ ? Reflect.get(detail, "error")
43
+ : undefined;
44
+ if (typeof message === "string") {
45
+ const coded = hostError(message, cause);
46
+ if (coded)
47
+ return coded;
48
+ }
49
+ return new E_ORBIT_COMMIT_FAILED([detail], { cause });
50
+ }
51
+ /**
52
+ * `text` with every unpaired surrogate replaced by U+FFFD, as
53
+ * `String.prototype.toWellFormed` does (Hermes has none). Half an emoji is
54
+ * ordinary content — `"Ana😀".slice(0, 4)` — and a browser shows it as U+FFFD.
55
+ */
56
+ export function toWellFormed(text) {
57
+ let out = "";
58
+ let from = 0;
59
+ for (let i = 0; i < text.length; i++) {
60
+ const unit = text.charCodeAt(i);
61
+ if (unit < 0xd800 || unit > 0xdfff)
62
+ continue;
63
+ if (unit <= 0xdbff && i + 1 < text.length) {
64
+ const next = text.charCodeAt(i + 1);
65
+ if (next >= 0xdc00 && next <= 0xdfff) {
66
+ i += 1;
67
+ continue;
68
+ }
69
+ }
70
+ out += `${text.slice(from, i)}\ufffd`;
71
+ from = i + 1;
72
+ }
73
+ return from === 0 ? text : out + text.slice(from);
74
+ }
75
+ const wellFormed = (_key, value) => typeof value === "string" ? toWellFormed(value) : value;
76
+ /**
77
+ * The batch as JSON the host reads. `JSON.stringify` writes an unpaired
78
+ * surrogate as a `\ud…` escape (lower-case, per ECMA-262 and Hermes), which
79
+ * the host's strict JSON reader refuses: one cut emoji would fail the whole
80
+ * commit. Only a batch holding such an escape pays for the second pass.
81
+ */
82
+ export function serialise(ops) {
83
+ const json = JSON.stringify(ops);
84
+ return json.includes("\\ud") ? JSON.stringify(ops, wellFormed) : json;
85
+ }
10
86
  const created = new WeakSet();
11
87
  const byTag = new Map();
12
88
  const lastChildren = new WeakMap();
@@ -42,16 +118,17 @@ function takeBytes(node, bytes) {
42
118
  node.pendingBytes = null;
43
119
  }
44
120
  }
45
- function visit(node, ops, bytes) {
121
+ function visit(node, ops, bytes, sent) {
46
122
  takeBytes(node, bytes);
47
123
  if (!created.has(node)) {
48
124
  ops.push(["c", node.tag, node.viewName, node.props]);
49
125
  created.add(node);
50
126
  byTag.set(node.tag, node);
127
+ sent.created.push(node);
51
128
  node.pendingProps = null;
52
129
  const kids = node.flatChildren();
53
130
  for (const kid of kids)
54
- visit(kid, ops, bytes);
131
+ visit(kid, ops, bytes, sent);
55
132
  const tags = kids.map((kid) => kid.tag);
56
133
  if (tags.length > 0)
57
134
  ops.push(["k", node.tag, tags]);
@@ -61,12 +138,14 @@ function visit(node, ops, bytes) {
61
138
  }
62
139
  if (node.pendingProps) {
63
140
  ops.push(["u", node.tag, node.pendingProps]);
141
+ sent.patched.push([node, node.pendingProps]);
64
142
  node.pendingProps = null;
65
143
  }
66
144
  if (node.childrenDirty) {
145
+ sent.walked.push(node);
67
146
  const kids = node.flatChildren();
68
147
  for (const kid of kids)
69
- visit(kid, ops, bytes);
148
+ visit(kid, ops, bytes, sent);
70
149
  const tags = kids.map((kid) => kid.tag);
71
150
  if (!sameTags(lastChildren.get(node), tags)) {
72
151
  ops.push(["k", node.tag, tags]);
@@ -75,6 +154,29 @@ function visit(node, ops, bytes) {
75
154
  node.childrenDirty = false;
76
155
  }
77
156
  }
157
+ /**
158
+ * The host refused the batch: nothing it carried counts as applied. Created
159
+ * nodes are created again, patches sent again, and every children list the
160
+ * batch walked is sent again whole — the host may have applied part of the
161
+ * batch before it refused, so a list it holds is not known any more.
162
+ */
163
+ function unsend(sent) {
164
+ for (const node of sent.created) {
165
+ created.delete(node);
166
+ byTag.delete(node.tag);
167
+ lastChildren.delete(node);
168
+ node.childrenDirty = true;
169
+ }
170
+ for (const [node, patch] of sent.patched) {
171
+ node.pendingProps = node.pendingProps
172
+ ? Object.assign(patch, node.pendingProps)
173
+ : patch;
174
+ }
175
+ for (const node of sent.walked) {
176
+ lastChildren.delete(node);
177
+ node.childrenDirty = true;
178
+ }
179
+ }
78
180
  export class Root {
79
181
  #host;
80
182
  #tree;
@@ -93,29 +195,54 @@ export class Root {
93
195
  void Promise.resolve().then(() => {
94
196
  // A synchronous flush() may already have committed this batch.
95
197
  if (this.#scheduled)
96
- this.commit();
198
+ this.commitOrReport();
97
199
  });
98
200
  }
99
201
  /** Commit what changed now, instead of at the end of the turn. */
100
202
  flush() {
101
203
  return this.commit();
102
204
  }
205
+ /**
206
+ * A commit nobody waits on (scheduled, or after the window resized): a
207
+ * refusal goes to `mount`'s `onError` instead of out of a microtask or a
208
+ * native event. What the batch carried is sent again with the next commit.
209
+ */
210
+ commitOrReport() {
211
+ try {
212
+ this.commit();
213
+ }
214
+ catch (error) {
215
+ report(error instanceof Error
216
+ ? error
217
+ : new E_ORBIT_COMMIT_FAILED([String(error)]));
218
+ }
219
+ }
103
220
  commit() {
104
221
  this.#scheduled = false;
105
222
  const ops = [];
106
223
  const bytes = [];
107
- visit(this.#tree, ops, bytes);
108
- if (!this.#rootSent) {
224
+ const sent = { created: [], patched: [], walked: [] };
225
+ visit(this.#tree, ops, bytes, sent);
226
+ const rootSent = this.#rootSent;
227
+ if (!rootSent)
109
228
  ops.push(["r", this.#tree.tag]);
110
- this.#rootSent = true;
111
- }
112
229
  // Before the ops that show them: the host reads them when it mounts.
230
+ // Bytes stay with the host once handed over, refused batch or not.
113
231
  for (const [tag, data] of bytes)
114
232
  this.#host.imageBytes(tag, data);
115
- const answer = JSON.parse(this.#host.commit(JSON.stringify(ops)));
233
+ let answer;
234
+ try {
235
+ answer = JSON.parse(this.#host.commit(serialise(ops)));
236
+ }
237
+ catch (error) {
238
+ unsend(sent);
239
+ throw refusal(error instanceof Error ? error.message : error, error);
240
+ }
116
241
  if (!isReport(answer)) {
117
- throw new OrbitError("E_ORBIT_COMMIT_FAILED", `[orbit] the host refused a commit: ${JSON.stringify(answer)}`);
242
+ unsend(sent);
243
+ throw refusal(answer);
118
244
  }
245
+ this.#rootSent = true;
119
246
  for (const tag of answer.deleted) {
120
247
  const node = byTag.get(tag);
121
248
  if (!node)
@@ -124,6 +251,9 @@ export class Root {
124
251
  created.delete(node);
125
252
  lastChildren.delete(node);
126
253
  }
254
+ for (const warning of answer.warnings ?? []) {
255
+ report(hostError(warning) ?? new E_ORBIT_SVG_VALUE([warning]));
256
+ }
127
257
  this.reports.push(answer);
128
258
  for (const hook of afterCommitHooks.splice(0))
129
259
  hook();
@@ -149,7 +279,7 @@ export function mountTree(tree, options) {
149
279
  // The window resized (the keyboard came or went): lay out again.
150
280
  host.setViewport(x, y);
151
281
  viewportSize({ width: x, height: y });
152
- root.commit();
282
+ root.commitOrReport();
153
283
  return;
154
284
  }
155
285
  const payload = {
@@ -1 +1 @@
1
- {"version":3,"file":"commit.js","sourceRoot":"","sources":["../src/commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAmB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAmB3C,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,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IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC5B,OAAO;YACR,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,EAAE,CAAC;IACd,OAAO,IAAI,CAAC;AACb,CAAC"}
package/dist/errors.d.ts CHANGED
@@ -1,42 +1,76 @@
1
+ /** `mount` ran before `useHost` gave orbit a native host, or the module is not orbit's host. */
2
+ export declare const E_ORBIT_NO_HOST: import("@c9up/flare").ErrorClass<[string]>;
3
+ /** The native host refused a commit; the message carries its report. */
4
+ export declare const E_ORBIT_COMMIT_FAILED: import("@c9up/flare").ErrorClass<[unknown]>;
1
5
  /**
2
- * Orbit's errors.
3
- *
4
- * Every failure carries a stable `code` (`E_ORBIT_<REASON>`), so a caller
5
- * branches on what went wrong rather than on a message.
6
+ * The views of a screen nest deeper than the host lays out (100 levels): the
7
+ * layout recurses once per level on the JS thread's stack, so the host refuses
8
+ * the commit instead of overflowing it.
6
9
  */
7
- export type OrbitErrorCode =
8
- /** `mount` ran before `useHost` gave orbit a native host. */
9
- "E_ORBIT_NO_HOST"
10
- /** The native host refused a commit; the message carries its report. */
11
- | "E_ORBIT_COMMIT_FAILED"
10
+ export declare const E_ORBIT_TREE_TOO_DEEP: import("@c9up/flare").ErrorClass<[string]>;
11
+ /**
12
+ * A value of an `<svg>` the host cannot read (a `NaN` length, unreadable path
13
+ * data, `points` or `transform`): that part of the drawing is left out and the
14
+ * rest drawn. Reported to `mount`'s `onError`, never thrown.
15
+ */
16
+ export declare const E_ORBIT_SVG_VALUE: import("@c9up/flare").ErrorClass<[string]>;
12
17
  /** An element with no native mapping yet (`<select>`, `<canvas>`, or `<text>` / a gradient inside an `<svg>`). */
13
- | "E_ORBIT_UNSUPPORTED_ELEMENT"
18
+ export declare const E_ORBIT_UNSUPPORTED_ELEMENT: import("@c9up/flare").ErrorClass<[string, string]>;
14
19
  /** A block element inside text: native text holds only inline runs. */
15
- | "E_ORBIT_BLOCK_IN_TEXT"
16
- /** `motion=${…}` was not an object of motion values. */
17
- | "E_ORBIT_INVALID_MOTION"
20
+ export declare const E_ORBIT_BLOCK_IN_TEXT: import("@c9up/flare").ErrorClass<[string]>;
21
+ /** `motion=${…}` was not an object of motion values. The message is aurora's. */
22
+ export declare const E_ORBIT_INVALID_MOTION: import("@c9up/flare").ErrorClass<[string]>;
18
23
  /** `scroll-y=${…}` was not a motion value. */
19
- | "E_ORBIT_INVALID_SCROLL_BINDING"
24
+ export declare const E_ORBIT_INVALID_SCROLL_BINDING: import("@c9up/flare").ErrorClass<never>;
20
25
  /** A colour orbit cannot read (named colours other than `transparent`, `hsl()`…). */
21
- | "E_ORBIT_INVALID_COLOR"
26
+ export declare const E_ORBIT_INVALID_COLOR: import("@c9up/flare").ErrorClass<[string]>;
22
27
  /** `<img src>` over plain http: images are fetched over https only. */
23
- | "E_ORBIT_INSECURE_IMAGE_URL"
28
+ export declare const E_ORBIT_INSECURE_IMAGE_URL: import("@c9up/flare").ErrorClass<[string]>;
24
29
  /** `<img src>` with a scheme that is not an image source (`data:`, `javascript:`…). */
25
- | "E_ORBIT_IMAGE_SOURCE"
30
+ export declare const E_ORBIT_IMAGE_SOURCE: import("@c9up/flare").ErrorClass<[string, string]>;
26
31
  /** Two elements of an `each` list share a key: a key names one row. */
27
- | "E_ORBIT_DUPLICATE_KEY"
32
+ export declare const E_ORBIT_DUPLICATE_KEY: import("@c9up/flare").ErrorClass<[string]>;
28
33
  /** `useScreen()` in a component no screen of a stack built. */
29
- | "E_ORBIT_NO_SCREEN"
34
+ export declare const E_ORBIT_NO_SCREEN: import("@c9up/flare").ErrorClass<never>;
30
35
  /** One stack put in two places: a stack is shown once. */
31
- | "E_ORBIT_STACK_SHOWN"
36
+ export declare const E_ORBIT_STACK_SHOWN: import("@c9up/flare").ErrorClass<never>;
32
37
  /** `useStyles` got something other than a table `ream css:compile` wrote. */
33
- | "E_ORBIT_STYLE_TABLE"
38
+ export declare const E_ORBIT_STYLE_TABLE: import("@c9up/flare").ErrorClass<never>;
34
39
  /** `serverPages({ server })` over plain http to a host that is not this machine or the emulator's. */
35
- | "E_ORBIT_INSECURE_SERVER"
40
+ export declare const E_ORBIT_INSECURE_SERVER: import("@c9up/flare").ErrorClass<[string]>;
36
41
  /** The server named a page the app does not have (`serverPages({ pages })`). */
37
- | "E_ORBIT_UNKNOWN_PAGE";
38
- export declare class OrbitError extends Error {
39
- readonly code: OrbitErrorCode;
40
- constructor(code: OrbitErrorCode, message: string, options?: ErrorOptions);
42
+ export declare const E_ORBIT_UNKNOWN_PAGE: import("@c9up/flare").ErrorClass<[string]>;
43
+ /** A server connection was asked for a path that resolves to another origin. */
44
+ export declare const E_ORBIT_FOREIGN_ORIGIN: import("@c9up/flare").ErrorClass<[string, string]>;
45
+ /** The server answered a JSON request with an empty non-2xx response. */
46
+ export declare const E_ORBIT_SERVER_REQUEST_FAILED: import("@c9up/flare").ErrorClass<[string, number]>;
47
+ /** Server events need an `XMLHttpRequest`, and the platform has none. */
48
+ export declare const E_ORBIT_NO_XHR: import("@c9up/flare").ErrorClass<never>;
49
+ /** An invariant inside orbit broke: a bug in orbit. The site says which one. */
50
+ export declare const E_ORBIT_INTERNAL: import("@c9up/flare").ErrorClass<[string]>;
51
+ /** `URL.createObjectURL` with no platform `URL` to make blob URLs. */
52
+ export declare class E_ORBIT_OBJECT_URL_UNAVAILABLE extends TypeError {
53
+ static readonly code = "E_ORBIT_OBJECT_URL_UNAVAILABLE";
54
+ readonly code = "E_ORBIT_OBJECT_URL_UNAVAILABLE";
55
+ }
56
+ /** A URL (or its base) that does not parse. */
57
+ export declare class E_ORBIT_INVALID_URL extends TypeError {
58
+ static readonly code = "E_ORBIT_INVALID_URL";
59
+ readonly code = "E_ORBIT_INVALID_URL";
60
+ }
61
+ /** `TextDecoder` given an encoding label other than UTF-8's. */
62
+ export declare class E_ORBIT_UNSUPPORTED_ENCODING extends RangeError {
63
+ static readonly code = "E_ORBIT_UNSUPPORTED_ENCODING";
64
+ readonly code = "E_ORBIT_UNSUPPORTED_ENCODING";
65
+ }
66
+ /** `TextDecoder.decode` given something that is not an `ArrayBuffer` or a view on one. */
67
+ export declare class E_ORBIT_INVALID_DECODER_INPUT extends TypeError {
68
+ static readonly code = "E_ORBIT_INVALID_DECODER_INPUT";
69
+ readonly code = "E_ORBIT_INVALID_DECODER_INPUT";
70
+ }
71
+ /** A `fatal` `TextDecoder` met bytes that are not valid UTF-8. */
72
+ export declare class E_ORBIT_INVALID_ENCODED_DATA extends TypeError {
73
+ static readonly code = "E_ORBIT_INVALID_ENCODED_DATA";
74
+ readonly code = "E_ORBIT_INVALID_ENCODED_DATA";
41
75
  }
42
76
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,cAAc;AACzB,6DAA6D;AAC3D,iBAAiB;AACnB,wEAAwE;GACtE,uBAAuB;AACzB,kHAAkH;GAChH,6BAA6B;AAC/B,uEAAuE;GACrE,uBAAuB;AACzB,wDAAwD;GACtD,wBAAwB;AAC1B,8CAA8C;GAC5C,gCAAgC;AAClC,qFAAqF;GACnF,uBAAuB;AACzB,uEAAuE;GACrE,4BAA4B;AAC9B,uFAAuF;GACrF,sBAAsB;AACxB,uEAAuE;GACrE,uBAAuB;AACzB,+DAA+D;GAC7D,mBAAmB;AACrB,0DAA0D;GACxD,qBAAqB;AACvB,6EAA6E;GAC3E,qBAAqB;AACvB,sGAAsG;GACpG,yBAAyB;AAC3B,gFAAgF;GAC9E,sBAAsB,CAAC;AAE1B,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;gBAElB,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKzE"}
1
+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sEAAsE;AACtE,qBAAa,8BAA+B,SAAQ,SAAS;IAC5D,MAAM,CAAC,QAAQ,CAAC,IAAI,oCAAoC;IACxD,QAAQ,CAAC,IAAI,oCAAoC;CACjD;AAED,+CAA+C;AAC/C,qBAAa,mBAAoB,SAAQ,SAAS;IACjD,MAAM,CAAC,QAAQ,CAAC,IAAI,yBAAyB;IAC7C,QAAQ,CAAC,IAAI,yBAAyB;CACtC;AAED,gEAAgE;AAChE,qBAAa,4BAA6B,SAAQ,UAAU;IAC3D,MAAM,CAAC,QAAQ,CAAC,IAAI,kCAAkC;IACtD,QAAQ,CAAC,IAAI,kCAAkC;CAC/C;AAED,0FAA0F;AAC1F,qBAAa,6BAA8B,SAAQ,SAAS;IAC3D,MAAM,CAAC,QAAQ,CAAC,IAAI,mCAAmC;IACvD,QAAQ,CAAC,IAAI,mCAAmC;CAChD;AAED,kEAAkE;AAClE,qBAAa,4BAA6B,SAAQ,SAAS;IAC1D,MAAM,CAAC,QAAQ,CAAC,IAAI,kCAAkC;IACtD,QAAQ,CAAC,IAAI,kCAAkC;CAC/C"}
package/dist/errors.js CHANGED
@@ -1,15 +1,89 @@
1
1
  /**
2
- * Orbit's errors.
3
- *
4
- * Every failure carries a stable `code` (`E_ORBIT_<REASON>`), so a caller
5
- * branches on what went wrong rather than on a message.
2
+ * Orbit's errors, one per code. Every failure carries a stable
3
+ * `E_ORBIT_<REASON>` code, so a caller branches on `error.code` or on
4
+ * `instanceof errors.E_ORBIT_…` rather than on a message.
6
5
  */
7
- export class OrbitError extends Error {
8
- code;
9
- constructor(code, message, options) {
10
- super(message, options);
11
- this.name = new.target.name;
12
- this.code = code;
13
- }
6
+ import { createError } from "@c9up/flare";
7
+ /** `mount` ran before `useHost` gave orbit a native host, or the module is not orbit's host. */
8
+ export const E_ORBIT_NO_HOST = createError("[orbit] %s", "E_ORBIT_NO_HOST");
9
+ /** The native host refused a commit; the message carries its report. */
10
+ export const E_ORBIT_COMMIT_FAILED = createError("[orbit] the host refused a commit: %j", "E_ORBIT_COMMIT_FAILED");
11
+ /**
12
+ * The views of a screen nest deeper than the host lays out (100 levels): the
13
+ * layout recurses once per level on the JS thread's stack, so the host refuses
14
+ * the commit instead of overflowing it.
15
+ */
16
+ export const E_ORBIT_TREE_TOO_DEEP = createError("[orbit] %s", "E_ORBIT_TREE_TOO_DEEP");
17
+ /**
18
+ * A value of an `<svg>` the host cannot read (a `NaN` length, unreadable path
19
+ * data, `points` or `transform`): that part of the drawing is left out and the
20
+ * rest drawn. Reported to `mount`'s `onError`, never thrown.
21
+ */
22
+ export const E_ORBIT_SVG_VALUE = createError("[orbit] %s", "E_ORBIT_SVG_VALUE");
23
+ /** An element with no native mapping yet (`<select>`, `<canvas>`, or `<text>` / a gradient inside an `<svg>`). */
24
+ export const E_ORBIT_UNSUPPORTED_ELEMENT = createError("[orbit] <%s> %s", "E_ORBIT_UNSUPPORTED_ELEMENT");
25
+ /** A block element inside text: native text holds only inline runs. */
26
+ export const E_ORBIT_BLOCK_IN_TEXT = createError("[orbit] <%s> cannot sit inside text on native", "E_ORBIT_BLOCK_IN_TEXT");
27
+ /** `motion=${…}` was not an object of motion values. The message is aurora's. */
28
+ export const E_ORBIT_INVALID_MOTION = createError("%s", "E_ORBIT_INVALID_MOTION");
29
+ /** `scroll-y=${…}` was not a motion value. */
30
+ export const E_ORBIT_INVALID_SCROLL_BINDING = createError("[orbit] scroll-y expects a motion value", "E_ORBIT_INVALID_SCROLL_BINDING");
31
+ /** A colour orbit cannot read (named colours other than `transparent`, `hsl()`…). */
32
+ export const E_ORBIT_INVALID_COLOR = createError('[orbit] cannot read the colour "%s"', "E_ORBIT_INVALID_COLOR");
33
+ /** `<img src>` over plain http: images are fetched over https only. */
34
+ export const E_ORBIT_INSECURE_IMAGE_URL = createError('[orbit] <img src="%s">: an image is fetched over https only', "E_ORBIT_INSECURE_IMAGE_URL");
35
+ /** `<img src>` with a scheme that is not an image source (`data:`, `javascript:`…). */
36
+ export const E_ORBIT_IMAGE_SOURCE = createError('[orbit] <img src="%s">: %s', "E_ORBIT_IMAGE_SOURCE");
37
+ /** Two elements of an `each` list share a key: a key names one row. */
38
+ export const E_ORBIT_DUPLICATE_KEY = createError("[orbit] each(): two elements share the key %s — a key names one row", "E_ORBIT_DUPLICATE_KEY");
39
+ /** `useScreen()` in a component no screen of a stack built. */
40
+ export const E_ORBIT_NO_SCREEN = createError("[orbit] useScreen() outside a screen: it reads the screen a stack shows, from a component that screen built", "E_ORBIT_NO_SCREEN");
41
+ /** One stack put in two places: a stack is shown once. */
42
+ export const E_ORBIT_STACK_SHOWN = createError("[orbit] a stack is shown in one place: this one is already in a template", "E_ORBIT_STACK_SHOWN");
43
+ /** `useStyles` got something other than a table `ream css:compile` wrote. */
44
+ export const E_ORBIT_STYLE_TABLE = createError("[orbit] not a style table orbit reads (version 1, from ream css:compile)", "E_ORBIT_STYLE_TABLE");
45
+ /** `serverPages({ server })` over plain http to a host that is not this machine or the emulator's. */
46
+ export const E_ORBIT_INSECURE_SERVER = createError("[orbit] the server %s is not https (plain http only reaches this machine or the emulator's host)", "E_ORBIT_INSECURE_SERVER");
47
+ /** The server named a page the app does not have (`serverPages({ pages })`). */
48
+ export const E_ORBIT_UNKNOWN_PAGE = createError('[orbit] the server named the page "%s", which this app does not have', "E_ORBIT_UNKNOWN_PAGE");
49
+ /** A server connection was asked for a path that resolves to another origin. */
50
+ export const E_ORBIT_FOREIGN_ORIGIN = createError("[orbit] the connection to %s does not reach %s", "E_ORBIT_FOREIGN_ORIGIN");
51
+ /** The server answered a JSON request with an empty non-2xx response. */
52
+ export const E_ORBIT_SERVER_REQUEST_FAILED = createError("[orbit] %s answered HTTP %d", "E_ORBIT_SERVER_REQUEST_FAILED");
53
+ /** Server events need an `XMLHttpRequest`, and the platform has none. */
54
+ export const E_ORBIT_NO_XHR = createError("[orbit] server events need XMLHttpRequest", "E_ORBIT_NO_XHR");
55
+ /** An invariant inside orbit broke: a bug in orbit. The site says which one. */
56
+ export const E_ORBIT_INTERNAL = createError("[orbit] %s", "E_ORBIT_INTERNAL");
57
+ // The errors below are raised by orbit's stand-ins for the platform's `URL`
58
+ // and `TextDecoder`, which Hermes lacks. Code written against those APIs
59
+ // expects what the WHATWG specs raise — `new URL("bad")` throws a `TypeError`,
60
+ // an unknown encoding label a `RangeError` — so these stay native error
61
+ // classes, named like the platform's own (`name` is `TypeError` /
62
+ // `RangeError`), with the code added. They are not flare exceptions on
63
+ // purpose: a polyfill must not change what the API it replaces throws.
64
+ /** `URL.createObjectURL` with no platform `URL` to make blob URLs. */
65
+ export class E_ORBIT_OBJECT_URL_UNAVAILABLE extends TypeError {
66
+ static code = "E_ORBIT_OBJECT_URL_UNAVAILABLE";
67
+ code = "E_ORBIT_OBJECT_URL_UNAVAILABLE";
68
+ }
69
+ /** A URL (or its base) that does not parse. */
70
+ export class E_ORBIT_INVALID_URL extends TypeError {
71
+ static code = "E_ORBIT_INVALID_URL";
72
+ code = "E_ORBIT_INVALID_URL";
73
+ }
74
+ /** `TextDecoder` given an encoding label other than UTF-8's. */
75
+ export class E_ORBIT_UNSUPPORTED_ENCODING extends RangeError {
76
+ static code = "E_ORBIT_UNSUPPORTED_ENCODING";
77
+ code = "E_ORBIT_UNSUPPORTED_ENCODING";
78
+ }
79
+ /** `TextDecoder.decode` given something that is not an `ArrayBuffer` or a view on one. */
80
+ export class E_ORBIT_INVALID_DECODER_INPUT extends TypeError {
81
+ static code = "E_ORBIT_INVALID_DECODER_INPUT";
82
+ code = "E_ORBIT_INVALID_DECODER_INPUT";
83
+ }
84
+ /** A `fatal` `TextDecoder` met bytes that are not valid UTF-8. */
85
+ export class E_ORBIT_INVALID_ENCODED_DATA extends TypeError {
86
+ static code = "E_ORBIT_INVALID_ENCODED_DATA";
87
+ code = "E_ORBIT_INVALID_ENCODED_DATA";
14
88
  }
15
89
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":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AE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CACX,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO,GACX,IAAI,CAAC;IACR,YAAY,CACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACV,IAAI,CAAC;IACR,8EAA8E;IAC9E,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,+EAA+E;IAC/E,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3D,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1D;AAED,sDAAsD;AACtD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAIhD,wDAAwD;AACxD,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAI7C;AAED,wBAAgB,WAAW,IAAI,SAAS,CAOvC"}
package/dist/host.js CHANGED
@@ -1,4 +1,4 @@
1
- import { OrbitError } from "./errors.js";
1
+ import { E_ORBIT_NO_HOST } from "./errors.js";
2
2
  import { useNativeMotion } from "./motion.js";
3
3
  /** The TurboModule name the native side registers. */
4
4
  export const NATIVE_MODULE_NAME = "NativeOrbit";
@@ -11,7 +11,9 @@ export function useHost(next) {
11
11
  }
12
12
  export function currentHost() {
13
13
  if (host === null) {
14
- throw new OrbitError("E_ORBIT_NO_HOST", `[orbit] no native host: call useHost(TurboModuleRegistry.getEnforcing("${NATIVE_MODULE_NAME}")) before mount()`);
14
+ throw new E_ORBIT_NO_HOST([
15
+ `no native host: call useHost(TurboModuleRegistry.getEnforcing("${NATIVE_MODULE_NAME}")) before mount()`,
16
+ ]);
15
17
  }
16
18
  return host;
17
19
  }
package/dist/host.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAsE9C,sDAAsD;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEhD,IAAI,IAAI,GAAqB,IAAI,CAAC;AAElC,wDAAwD;AACxD,MAAM,UAAU,OAAO,CAAC,IAAe;IACtC,IAAI,GAAG,IAAI,CAAC;IACZ,6DAA6D;IAC7D,eAAe,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,WAAW;IAC1B,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,UAAU,CACnB,iBAAiB,EACjB,0EAA0E,kBAAkB,oBAAoB,CAChH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAsE9C,sDAAsD;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEhD,IAAI,IAAI,GAAqB,IAAI,CAAC;AAElC,wDAAwD;AACxD,MAAM,UAAU,OAAO,CAAC,IAAe;IACtC,IAAI,GAAG,IAAI,CAAC;IACZ,6DAA6D;IAC7D,eAAe,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,WAAW;IAC1B,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,eAAe,CAAC;YACzB,kEAAkE,kBAAkB,oBAAoB;SACxG,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
package/dist/index.d.ts CHANGED
@@ -14,16 +14,18 @@
14
14
  */
15
15
  export { colorToArgb } from "./color.js";
16
16
  export { afterCommit, type MountOptions, type OrbitReport, type Root, } from "./commit.js";
17
- export { OrbitError, type OrbitErrorCode } from "./errors.js";
17
+ export * as errors from "./errors.js";
18
18
  export { NATIVE_MODULE_NAME, type OrbitHost, useHost } from "./host.js";
19
19
  export { bindMotion, bindScrollY, MotionNode, type MotionStyle, MotionValue, type SpringOptions, type TimingOptions, } from "./motion.js";
20
20
  /** The app's ream server, one connection for pages, comet and relay. */
21
- export { connectServer, type ServerConnection, type ServerEvent, ServerEventStream, } from "./server.js";
21
+ export { type ConnectOptions, connectServer, type ServerConnection, type ServerEvent, ServerEventStream, type TokenStore, } from "./server.js";
22
22
  export { createStack,
23
23
  /** What the back button does: pop the innermost shown stack (false: nothing to pop). */
24
24
  goBack, type Navigator, type Screen, type ScreenComponent, type Stack, type StackOptions, useScreen, } from "./stack.js";
25
25
  export { colorScheme, type StyleTable, unknownClasses, useStyles, } from "./styles.js";
26
26
  export { type GestureEvent, mount } from "./template.js";
27
+ /** A standard UTF-8 `TextDecoder` where the engine has none (Hermes). */
28
+ export { installTextDecoder, StandardTextDecoder } from "./textDecoder.js";
27
29
  /** A standard `URL` in place of the platform's, when it is not one (React Native's). */
28
30
  export { installStandardUrl, StandardURL } from "./url.js";
29
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACN,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,IAAI,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,KAAK,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,GAClB,MAAM,aAAa,CAAC;AACrB,wEAAwE;AACxE,OAAO,EACN,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,WAAW;AACX,wFAAwF;AACxF,MAAM,EACN,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,SAAS,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,cAAc,EACd,SAAS,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,wFAAwF;AACxF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACN,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,IAAI,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,KAAK,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,GAClB,MAAM,aAAa,CAAC;AACrB,wEAAwE;AACxE,OAAO,EACN,KAAK,cAAc,EACnB,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,UAAU,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,WAAW;AACX,wFAAwF;AACxF,MAAM,EACN,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,SAAS,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,cAAc,EACd,SAAS,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,yEAAyE;AACzE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,wFAAwF;AACxF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  */
15
15
  export { colorToArgb } from "./color.js";
16
16
  export { afterCommit, } from "./commit.js";
17
- export { OrbitError } from "./errors.js";
17
+ export * as errors from "./errors.js";
18
18
  export { NATIVE_MODULE_NAME, useHost } from "./host.js";
19
19
  export { bindMotion, bindScrollY, MotionNode, MotionValue, } from "./motion.js";
20
20
  /** The app's ream server, one connection for pages, comet and relay. */
@@ -24,6 +24,8 @@ export { createStack,
24
24
  goBack, useScreen, } from "./stack.js";
25
25
  export { colorScheme, unknownClasses, useStyles, } from "./styles.js";
26
26
  export { mount } from "./template.js";
27
+ /** A standard UTF-8 `TextDecoder` where the engine has none (Hermes). */
28
+ export { installTextDecoder, StandardTextDecoder } from "./textDecoder.js";
27
29
  /** A standard `URL` in place of the platform's, when it is not one (React Native's). */
28
30
  export { installStandardUrl, StandardURL } from "./url.js";
29
31
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACN,WAAW,GAIX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAkB,OAAO,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,UAAU,EACV,WAAW,EACX,UAAU,EAEV,WAAW,GAGX,MAAM,aAAa,CAAC;AACrB,wEAAwE;AACxE,OAAO,EACN,aAAa,EAGb,iBAAiB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,WAAW;AACX,wFAAwF;AACxF,MAAM,EAMN,SAAS,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,WAAW,EAEX,cAAc,EACd,SAAS,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqB,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,wFAAwF;AACxF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACN,WAAW,GAIX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAkB,OAAO,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,UAAU,EACV,WAAW,EACX,UAAU,EAEV,WAAW,GAGX,MAAM,aAAa,CAAC;AACrB,wEAAwE;AACxE,OAAO,EAEN,aAAa,EAGb,iBAAiB,GAEjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,WAAW;AACX,wFAAwF;AACxF,MAAM,EAMN,SAAS,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,WAAW,EAEX,cAAc,EACd,SAAS,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqB,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,yEAAyE;AACzE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,wFAAwF;AACxF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../src/motion.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,WAAW,EAGhB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACN,UAAU,EACV,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,GAClB,MAAM,mBAAmB,CAAC;AAgB3B,yFAAyF;AACzF,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAiBD,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAKpE;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAE3E;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAWtD"}
1
+ {"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../src/motion.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,WAAW,EAGhB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACN,UAAU,EACV,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,GAClB,MAAM,mBAAmB,CAAC;AAgB3B,yFAAyF;AACzF,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAiBD,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAKpE;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAE3E;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CActD"}
package/dist/motion.js CHANGED
@@ -5,8 +5,8 @@
5
5
  * browser, where aurora's DOM renderer hands the curves to the Web Animations
6
6
  * API.
7
7
  */
8
- import { AuroraError, readMotionStyle, setMotionDriver, } from "@c9up/aurora/core";
9
- import { OrbitError } from "./errors.js";
8
+ import { readMotionStyle, setMotionDriver, } from "@c9up/aurora/core";
9
+ import { E_ORBIT_INVALID_MOTION } from "./errors.js";
10
10
  import { currentHost } from "./host.js";
11
11
  export { MotionNode, MotionValue, } from "@c9up/aurora/core";
12
12
  /** aurora's motion values, held and played by orbit's native host. */
@@ -55,10 +55,11 @@ export function readMotion(value) {
55
55
  return readMotionStyle(value);
56
56
  }
57
57
  catch (error) {
58
- if (error instanceof AuroraError) {
59
- throw new OrbitError("E_ORBIT_INVALID_MOTION", error.message, {
60
- cause: error,
61
- });
58
+ // Matched by code, not by class: the code is aurora's contract, and it
59
+ // holds whichever aurora release the app resolves.
60
+ if (error instanceof Error &&
61
+ Reflect.get(error, "code") === "E_AURORA_INVALID_MOTION") {
62
+ throw new E_ORBIT_INVALID_MOTION([error.message], { cause: error });
62
63
  }
63
64
  throw error;
64
65
  }