@lotics/app-sdk 0.123.9 → 0.123.11

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/dist/index.js CHANGED
@@ -12650,27 +12650,33 @@ function innermostLists(value) {
12650
12650
  }
12651
12651
 
12652
12652
  // ../shared/src/interpolate.ts
12653
+ function findInterpolations(text2) {
12654
+ return [...text2.matchAll(/\{\{.*?\}\}/g)].map((match2) => ({
12655
+ start: match2.index,
12656
+ end: match2.index + match2[0].length,
12657
+ source: match2[0],
12658
+ expression: match2[0].slice(2, -2).trim()
12659
+ }));
12660
+ }
12653
12661
  function interpolateObject(obj, context) {
12654
12662
  if (obj === null || obj === void 0) {
12655
12663
  return obj;
12656
12664
  }
12657
12665
  if (typeof obj === "string") {
12658
- const expressionMatches = obj.match(/\{\{.*?\}\}/g);
12659
- if (expressionMatches && expressionMatches.length > 0) {
12660
- if (expressionMatches.length === 1 && obj === expressionMatches[0]) {
12661
- const expression = obj.slice(2, -2).trim();
12662
- return evaluateJsExpression(expression, context);
12663
- }
12664
- const parts = obj.split(/(\{\{.*?\}\})/g);
12665
- const evaluatedParts = parts.map((part) => {
12666
- if (part.startsWith("{{") && part.endsWith("}}")) {
12667
- const expression = part.slice(2, -2).trim();
12668
- const result = evaluateJsExpression(expression, context);
12669
- return result != null ? String(result) : "";
12670
- }
12671
- return part;
12672
- });
12673
- return evaluatedParts.join("");
12666
+ const interpolations = findInterpolations(obj);
12667
+ const [only] = interpolations;
12668
+ if (only) {
12669
+ if (interpolations.length === 1 && obj === only.source) {
12670
+ return evaluateJsExpression(only.expression, context);
12671
+ }
12672
+ let out = "";
12673
+ let cursor = 0;
12674
+ for (const interpolation of interpolations) {
12675
+ const result = evaluateJsExpression(interpolation.expression, context);
12676
+ out += obj.slice(cursor, interpolation.start) + (result != null ? String(result) : "");
12677
+ cursor = interpolation.end;
12678
+ }
12679
+ return out + obj.slice(cursor);
12674
12680
  }
12675
12681
  return obj;
12676
12682
  }
@@ -159,7 +159,9 @@ write it as `{ node_type: "condition", type: "record_id", operator, value }`.
159
159
  § A write shows from the press.
160
160
  - **Realtime push keeps an already-open screen current.** When a table one of your queries reads
161
161
  changes — another member, a workflow, the chat agent, or an external agent writing over the CLI or
162
- MCP — that query refetches within about a second. Nothing to wire: it follows from the query's own
162
+ MCP — that query refetches within about a second; a screen out of sight (a hidden tab, or an app
163
+ the host keeps while another is shown) refetches once, when shown, for every query that moved
164
+ meanwhile. Nothing to wire: it follows from the query's own
163
165
  declaration, and only the aliases whose tables actually moved refetch. The queries one push names
164
166
  re-render together — each answer held until all have landed, never past a second — so a screen never
165
167
  shows one change in pieces and a slow query never holds the rest. It carries RECORD
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.123.9",
3
+ "version": "0.123.11",
4
4
  "description": "The SDK a Lotics custom-code app reads and writes through — typed hooks over the host bridge, cell readers, mount() and AppRouter",
5
5
  "type": "module",
6
6
  "exports": {