@lotics/app-sdk 0.131.0 → 0.131.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 (2) hide show
  1. package/dist/index.js +18 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7918,8 +7918,20 @@ var formulaOnlyFunctions = {
7918
7918
  const declared = names ?? {};
7919
7919
  for (const key of held2) if (typeof key !== "string" || !Object.hasOwn(declared, key)) throw new UndeclaredOptionError(field);
7920
7920
  return Object.entries(declared).filter(([key]) => held2.has(key)).map(([, name]) => name).join(", ");
7921
- }
7921
+ },
7922
+ // A lookup through a link holding several rows reaches a formula as its one value while it holds one row, so a
7923
+ // list helper reads a single value as a list of it.
7924
+ join: (list2, separator) => join(asList(list2), separator),
7925
+ sum: (list2) => sum(asList(list2)),
7926
+ mean: (list2) => mean(asList(list2)),
7927
+ first: (list2) => first(asList(list2)),
7928
+ last: (list2) => last(asList(list2)),
7929
+ unique: (list2) => unique(asList(list2)),
7930
+ compact: (list2) => compact(asList(list2))
7922
7931
  };
7932
+ function asList(value) {
7933
+ return value === null || value === void 0 || Array.isArray(value) ? value : [value];
7934
+ }
7923
7935
  var MAX_HELD_TIMEZONES = 512;
7924
7936
  var functionsByTimezone = /* @__PURE__ */ new Map();
7925
7937
  function timezoneAwareFunctions(defaultTimezone) {
@@ -10244,14 +10256,14 @@ function asIds(ids) {
10244
10256
  if (!Array.isArray(ids) || !ids.every((id) => typeof id === "string")) return null;
10245
10257
  return ids;
10246
10258
  }
10247
- function asList(cell) {
10259
+ function asList2(cell) {
10248
10260
  if (Array.isArray(cell)) return cell;
10249
10261
  return cell === null || cell === void 0 ? [] : [cell];
10250
10262
  }
10251
10263
  function adjusted(current, items, op) {
10252
10264
  const keyOf2 = (item) => item !== null && typeof item === "object" && "id" in item ? item.id : item;
10253
- const held2 = asList(current);
10254
- const given = asList(items);
10265
+ const held2 = asList2(current);
10266
+ const given = asList2(items);
10255
10267
  if (op === "add_to") {
10256
10268
  const have = new Set(held2.map(keyOf2));
10257
10269
  return [...held2, ...given.filter((item) => !have.has(keyOf2(item)))];
@@ -10260,8 +10272,8 @@ function adjusted(current, items, op) {
10260
10272
  return held2.filter((item) => !gone.has(keyOf2(item)));
10261
10273
  }
10262
10274
  function withoutMade(current, templates) {
10263
- const gone = new Set(asList(templates));
10264
- return asList(current).filter((item) => !(item !== null && typeof item === "object" && "document_template_id" in item && gone.has(item.document_template_id)));
10275
+ const gone = new Set(asList2(templates));
10276
+ return asList2(current).filter((item) => !(item !== null && typeof item === "object" && "document_template_id" in item && gone.has(item.document_template_id)));
10265
10277
  }
10266
10278
  function note(walk, effect) {
10267
10279
  if (walk.unsure && effect.kind !== "unknown") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.131.0",
3
+ "version": "0.131.1",
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": {