@lotics/app-sdk 0.115.1 → 0.115.2

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 +25 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21918,20 +21918,31 @@ function sameReading(a, b) {
21918
21918
  function readingWords(reading) {
21919
21919
  return reading === "link" ? "a link" : JSON.stringify(reading);
21920
21920
  }
21921
- function settledReading(written, stored) {
21922
- const held2 = stored === void 0 ? void 0 : stored.byKeys ?? stored.stated;
21923
- const { stated, byKeys } = written;
21924
- const parted = partedReadings(written);
21925
- if (parted === void 0) return checkedReading(stated ?? byKeys ?? held2, held2);
21926
- const changed2 = stored === void 0 ? void 0 : sameReading(stated, stored.stated) ? byKeys : sameReading(byKeys, stored.byKeys) ? stated : void 0;
21927
- return changed2 === void 0 ? { refusal: parted } : checkedReading(changed2, held2);
21928
- }
21929
- function partedReadings(written) {
21930
- const { stated, byKeys } = written;
21931
- if (stated === void 0 || byKeys === void 0 || sameReading(stated, byKeys)) return void 0;
21932
- const key = stated === "link" ? "link" : "notation";
21921
+ function heldReading(stored) {
21922
+ return stored.byKeys ?? stored.stated;
21923
+ }
21924
+ function leftReading(written, stored) {
21925
+ if (stored === void 0) return { changed: written.stated, left: written.stated };
21926
+ const changed2 = sameReading(written.stated, stored.stated) ? void 0 : written.stated;
21927
+ return { changed: changed2, left: changed2 ?? heldReading(stored) ?? written.stated };
21928
+ }
21929
+ function keysRefusal(written, stored) {
21930
+ const { byKeys } = written;
21931
+ if (byKeys === void 0 || stored !== void 0 && sameReading(byKeys, stored.byKeys)) return void 0;
21932
+ const { changed: changed2, left } = leftReading(written, stored);
21933
+ if (sameReading(byKeys, left ?? DECIMAL)) return void 0;
21933
21934
  const keys2 = KEYS_BEFORE_NOTATION.flatMap((name) => written.keys[name] ? [`${name} ${JSON.stringify(written.keys[name])}`] : []);
21934
- return `"${key}" says ${readingWords(stated)} and ${keys2.join(", ")} say ${readingWords(byKeys)} \u2014 state "${key}" alone`;
21935
+ if (changed2 !== void 0) {
21936
+ const key = changed2 === "link" ? "link" : "notation";
21937
+ return `"${key}" says ${readingWords(changed2)} and ${keys2.join(", ")} ${keys2.length === 1 ? "says" : "say"} ${readingWords(byKeys)}, and the keys before "notation" are no longer read \u2014 state "${key}" alone`;
21938
+ }
21939
+ const state = byKeys === "link" ? '"link": true' : `"notation": ${JSON.stringify(byKeys)}`;
21940
+ return `${keys2.join(", ")} ${keys2.length === 1 ? "is" : "are"} no longer read \u2014 state ${state}`;
21941
+ }
21942
+ function settledReading(written, stored) {
21943
+ const refused = keysRefusal(written, stored);
21944
+ if (refused !== void 0) return { refusal: refused };
21945
+ return checkedReading(leftReading(written, stored).left ?? written.byKeys, stored === void 0 ? void 0 : heldReading(stored));
21935
21946
  }
21936
21947
  function checkedReading(reading, held2) {
21937
21948
  const refused = changedCurrencyRefusal(reading, held2);
@@ -24900,7 +24911,7 @@ function figureIssue(path) {
24900
24911
  for (const { key, message: message2 } of figureKeysRefusals(value)) ctx.addIssue({ code: "custom", message: message2, path: [...path, key] });
24901
24912
  };
24902
24913
  }
24903
- var BEFORE_NOTATION = 'Before "notation", and read as it: state "notation" instead.';
24914
+ var BEFORE_NOTATION = 'Replaced by "notation", and never read: naming another reading in it is refused.';
24904
24915
  function notationStatedIssue(path) {
24905
24916
  return (value, ctx) => {
24906
24917
  if (value.notation === void 0) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.115.1",
3
+ "version": "0.115.2",
4
4
  "description": "The SDK a Lotics custom-code app reads and writes through \u2014 typed hooks over the host bridge, cell readers, mount() and AppRouter",
5
5
  "type": "module",
6
6
  "exports": {