@lotics/app-sdk 0.133.6 → 0.133.7

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.
@@ -522,6 +522,13 @@ var ID_ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy
522
522
  var ID_LENGTH = 12;
523
523
  var nanoid = customAlphabet(ID_ALPHABET, ID_LENGTH);
524
524
  var RECORD_ID_PATTERN = new RegExp(`^rec_[${ID_ALPHABET}]{${ID_LENGTH}}$`);
525
+ var STORED_RECORD_ID_PATTERN = new RegExp(
526
+ `^rec_[${ID_ALPHABET}]{${ID_LENGTH}}$|^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`,
527
+ "i"
528
+ );
529
+ function isStoredRecordId(value) {
530
+ return STORED_RECORD_ID_PATTERN.test(value);
531
+ }
525
532
  var FILE_ID_PATTERN = new RegExp(`^fil_[${ID_ALPHABET}]{${ID_LENGTH}}$`);
526
533
  var TABLE_ID_PATTERN = new RegExp(
527
534
  `^tbl_[${ID_ALPHABET}]+$|^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`,
@@ -2292,6 +2299,7 @@ export {
2292
2299
  keepAccentsForm,
2293
2300
  searchWords,
2294
2301
  customAlphabet,
2302
+ isStoredRecordId,
2295
2303
  isTableId,
2296
2304
  isFieldKey,
2297
2305
  COMPARE_KEYS,
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  isEmbedded,
30
30
  isFieldKey,
31
31
  isRecordBound,
32
+ isStoredRecordId,
32
33
  isTableId,
33
34
  keepAccentsForm,
34
35
  moduloDecimal,
@@ -61,7 +62,7 @@ import {
61
62
  subtractDecimal,
62
63
  sumDecimal,
63
64
  urlParam
64
- } from "./chunk-FAT4EYLS.js";
65
+ } from "./chunk-DRX4M4FJ.js";
65
66
 
66
67
  // src/mount.tsx
67
68
  import { createRoot } from "react-dom/client";
@@ -9817,7 +9818,7 @@ async function coerceMemberDisplay(value, ctx) {
9817
9818
  return shown;
9818
9819
  }
9819
9820
  async function coerceRecordLinkDisplay(value, field, ctx) {
9820
- if (typeof value === "string" && value.startsWith("rec_")) {
9821
+ if (typeof value === "string" && isStoredRecordId(value)) {
9821
9822
  const [text2] = await coerceRecordLinkDisplay([value], field, ctx);
9822
9823
  return text2;
9823
9824
  }
@@ -9855,7 +9856,7 @@ function walkSegment(value, segment, ctx) {
9855
9856
  case "field": {
9856
9857
  if (value === null || value === void 0) return void 0;
9857
9858
  if (typeof value === "string") {
9858
- if (value.startsWith("rec_")) {
9859
+ if (isStoredRecordId(value)) {
9859
9860
  if (segment.key === "id") return value;
9860
9861
  throw new WorkflowEvalError(
9861
9862
  `Cannot read "${segment.key}" off "${value}" \u2014 it is a record id, not a record. A link cell holds record ids; fetch the rows with linked(...) (e.g. linked(record["fld_link"])[0]["fld_x"]), or get_record({ table_id, record_id }) this id.`,
@@ -9933,7 +9934,7 @@ async function walkLinked(value, segment, ctx) {
9933
9934
  }
9934
9935
  function linkIds(value, via) {
9935
9936
  if (value === void 0 || value === null) return [];
9936
- if (typeof value === "string" && value.startsWith("rec_")) return [value];
9937
+ if (typeof value === "string" && isStoredRecordId(value)) return [value];
9937
9938
  if (!Array.isArray(value)) {
9938
9939
  throw new WorkflowEvalError(
9939
9940
  `Linked field "${via}" must be an array of record IDs (string[]), got ${typeof value}`,
package/dist/router.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  setUrlParams,
7
7
  settleOpen,
8
8
  subscribeOpen
9
- } from "./chunk-FAT4EYLS.js";
9
+ } from "./chunk-DRX4M4FJ.js";
10
10
 
11
11
  // src/router.tsx
12
12
  import { useEffect, useLayoutEffect, useRef } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.133.6",
3
+ "version": "0.133.7",
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": {