@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 +22 -16
- package/docs/data_fetching.md +3 -1
- package/package.json +1 -1
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
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12662
|
-
return evaluateJsExpression(expression, context);
|
|
12663
|
-
}
|
|
12664
|
-
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12668
|
-
|
|
12669
|
-
|
|
12670
|
-
|
|
12671
|
-
|
|
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
|
}
|
package/docs/data_fetching.md
CHANGED
|
@@ -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
|
|
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