snapback4 0.0.12 → 0.0.13

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.
@@ -60,6 +60,8 @@ export declare class Interpreter {
60
60
  private beyondHorizon;
61
61
  /** The program's page had more rows and no cursor to continue on. */
62
62
  private pageOverflow;
63
+ /** A field of a pending row was read while building an object. */
64
+ private pendingTouched;
63
65
  private page;
64
66
  private pageDepth;
65
67
  private created;
@@ -137,6 +137,8 @@ export class Interpreter {
137
137
  beyondHorizon = false;
138
138
  /** The program's page had more rows and no cursor to continue on. */
139
139
  pageOverflow = false;
140
+ /** A field of a pending row was read while building an object. */
141
+ pendingTouched = false;
140
142
  page = null;
141
143
  pageDepth = 0;
142
144
  created = new Set();
@@ -361,6 +363,8 @@ export class Interpreter {
361
363
  return null;
362
364
  if (typeof base !== "object")
363
365
  throw new Refused({ code: "E_FIELD", family: "input", message: `no field ${b.name}` });
366
+ if (base.pending === true)
367
+ this.pendingTouched = true;
364
368
  return base[b.name] ?? null;
365
369
  }
366
370
  case "Array": {
@@ -370,9 +374,16 @@ export class Interpreter {
370
374
  return out;
371
375
  }
372
376
  case "Object": {
377
+ // A shape over a pending row is pending: the card's word survives
378
+ // the field selection, so a screen shows "Sending…" on shaped rows too.
379
+ const outer = this.pendingTouched;
380
+ this.pendingTouched = false;
373
381
  const out = {};
374
382
  for (const [k, v] of Object.entries(body))
375
383
  out[k] = await this.expr(v);
384
+ if (this.pendingTouched && !("pending" in out))
385
+ out.pending = true;
386
+ this.pendingTouched = outer || this.pendingTouched;
376
387
  return out;
377
388
  }
378
389
  case "Binary": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snapback4",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "description": "Snapback 4: the card (contract), the online and local-first clients (IndexedDB, SQLite), React hooks, sign-in, a labelled mock, and the `snapback4` CLI. LLP 3000.",
6
6
  "bin": {
@@ -42,7 +42,7 @@
42
42
  "README.md"
43
43
  ],
44
44
  "optionalDependencies": {
45
- "snapback4-darwin-arm64": "0.0.12"
45
+ "snapback4-darwin-arm64": "0.0.13"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsc -p tsconfig.build.json",