@floless/app 0.101.0 → 0.101.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.
@@ -50770,7 +50770,7 @@ var require_dist6 = __commonJS({
50770
50770
 
50771
50771
  // install-path.mjs
50772
50772
  var import_node_fs = require("node:fs");
50773
- function resolveRealInstallExePure(execPath, localAppData, exists, readdir3, realpath2) {
50773
+ function resolveRealInstallExePure(execPath, localAppData, exists, readdir4, realpath2) {
50774
50774
  if (!execPath) return execPath;
50775
50775
  let resolved = execPath;
50776
50776
  try {
@@ -50789,7 +50789,7 @@ function resolveRealInstallExePure(execPath, localAppData, exists, readdir3, rea
50789
50789
  const packagesDir2 = `${laRoot}\\Packages`;
50790
50790
  let packages;
50791
50791
  try {
50792
- packages = readdir3(packagesDir2);
50792
+ packages = readdir4(packagesDir2);
50793
50793
  } catch {
50794
50794
  return execPath;
50795
50795
  }
@@ -53106,7 +53106,7 @@ function appVersion() {
53106
53106
  return resolveVersion({
53107
53107
  isSea: isSea2(),
53108
53108
  sqVersionXml: readSqVersionXml(),
53109
- define: true ? "0.101.0" : void 0,
53109
+ define: true ? "0.101.2" : void 0,
53110
53110
  pkgVersion: readPkgVersion()
53111
53111
  });
53112
53112
  }
@@ -53116,7 +53116,7 @@ function resolveChannel(s) {
53116
53116
  return "dev";
53117
53117
  }
53118
53118
  function appChannel() {
53119
- return resolveChannel({ isSea: isSea2(), define: true ? "0.101.0" : void 0 });
53119
+ return resolveChannel({ isSea: isSea2(), define: true ? "0.101.2" : void 0 });
53120
53120
  }
53121
53121
 
53122
53122
  // workflow-update.ts
@@ -54266,6 +54266,10 @@ function walk(value, node, root, path, errors) {
54266
54266
  if (typeof node.exclusiveMinimum === "number" && value <= node.exclusiveMinimum) errors.push({ path, message: `must be > ${node.exclusiveMinimum}` });
54267
54267
  if (typeof node.exclusiveMaximum === "number" && value >= node.exclusiveMaximum) errors.push({ path, message: `must be < ${node.exclusiveMaximum}` });
54268
54268
  }
54269
+ if (typeof value === "string" && typeof node.maxLength === "number") {
54270
+ const length = Array.from(value).length;
54271
+ if (length > node.maxLength) errors.push({ path, message: `expected at most ${node.maxLength} characters, got ${length}` });
54272
+ }
54269
54273
  if (isPlainObject(value)) {
54270
54274
  for (const r of node.required ?? []) {
54271
54275
  if (!Object.hasOwn(value, r)) errors.push({ path: `${path}.${r}`, message: "required" });
@@ -54397,6 +54401,7 @@ function readContractForApp(appId, readAppFn = readApp) {
54397
54401
 
54398
54402
  // projects-store.ts
54399
54403
  var import_node_fs20 = require("node:fs");
54404
+ var import_promises = require("node:fs/promises");
54400
54405
  var import_node_path18 = require("node:path");
54401
54406
  var import_node_os13 = require("node:os");
54402
54407
  var import_node_crypto6 = require("node:crypto");
@@ -55351,19 +55356,6 @@ function deflateSync(data, opts) {
55351
55356
  function inflateSync(data, opts) {
55352
55357
  return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
55353
55358
  }
55354
- var fltn = function(d, p, t, o) {
55355
- for (var k in d) {
55356
- var val = d[k], n = p + k, op = o;
55357
- if (Array.isArray(val))
55358
- op = mrg(o, val[1]), val = val[0];
55359
- if (ArrayBuffer.isView(val))
55360
- t[n] = [val, op];
55361
- else {
55362
- t[n += "/"] = [new u8(0), op];
55363
- fltn(val, n, t, o);
55364
- }
55365
- }
55366
- };
55367
55359
  var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder();
55368
55360
  var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder();
55369
55361
  var tds = 0;
@@ -55714,49 +55706,6 @@ var Zip = /* @__PURE__ */ (function() {
55714
55706
  };
55715
55707
  return Zip2;
55716
55708
  })();
55717
- function zipSync(data, opts) {
55718
- if (!opts)
55719
- opts = {};
55720
- var r = {};
55721
- var files2 = [];
55722
- fltn(data, "", r, opts);
55723
- var o = 0;
55724
- var tot = 0;
55725
- for (var fn in r) {
55726
- var _a2 = r[fn], file = _a2[0], p = _a2[1];
55727
- var compression = p.level == 0 ? 0 : 8;
55728
- var f = strToU8(fn), s = f.length;
55729
- var com = p.comment, m = com && strToU8(com), ms = m && m.length;
55730
- var exl = exfl(p.extra);
55731
- if (s > 65535)
55732
- err(11);
55733
- var d = compression ? deflateSync(file, p) : file, l = d.length;
55734
- var c = crc();
55735
- c.p(file);
55736
- files2.push(mrg(p, {
55737
- size: file.length,
55738
- crc: c.d(),
55739
- c: d,
55740
- f,
55741
- m,
55742
- u: s != fn.length || m && com.length != ms,
55743
- o,
55744
- compression
55745
- }));
55746
- o += 30 + s + exl + l;
55747
- tot += 76 + 2 * (s + exl) + (ms || 0) + l;
55748
- }
55749
- var out = new u8(tot + 22), oe = o, cdl = tot - o;
55750
- for (var i = 0; i < files2.length; ++i) {
55751
- var f = files2[i];
55752
- wzh(out, f.o, f, f.f, f.u, f.c.length);
55753
- var badd = 30 + f.f.length + exfl(f.extra);
55754
- out.set(f.c, f.o + badd);
55755
- wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
55756
- }
55757
- wzf(out, o, files2.length, cdl, oe);
55758
- return out;
55759
- }
55760
55709
  function unzipSync(data, opts) {
55761
55710
  var files2 = {};
55762
55711
  var e = data.length - 22;
@@ -55872,9 +55821,27 @@ function renameProject(id, name) {
55872
55821
  const meta = readMeta(safeProjectId(id));
55873
55822
  if (!meta) throw new ProjectError(`unknown project: ${id}`);
55874
55823
  if (typeof name !== "string" || !name.trim()) throw new ProjectError("project name required");
55875
- const next = { ...meta, name: name.trim(), updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
55876
- writeMeta(next);
55877
- return next;
55824
+ const nextName = name.trim();
55825
+ if (nextName === meta.name) return meta;
55826
+ let newId = `${slugify(nextName)}-${(0, import_node_crypto6.randomBytes)(3).toString("hex")}`;
55827
+ while ((0, import_node_fs20.existsSync)(projectDir(newId)) || (0, import_node_fs20.existsSync)((0, import_node_path18.join)(ARCHIVE, newId))) newId = `${slugify(nextName)}-${(0, import_node_crypto6.randomBytes)(3).toString("hex")}`;
55828
+ const from = projectDir(id), to = projectDir(newId);
55829
+ try {
55830
+ (0, import_node_fs20.renameSync)(from, to);
55831
+ } catch {
55832
+ throw new ProjectError("couldn\u2019t rename the project folder \u2014 it may be open or in use. Close the project and try again.");
55833
+ }
55834
+ try {
55835
+ const next = { ...meta, id: newId, name: nextName, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
55836
+ writeMeta(next);
55837
+ return next;
55838
+ } catch (e) {
55839
+ try {
55840
+ (0, import_node_fs20.renameSync)(to, from);
55841
+ } catch {
55842
+ }
55843
+ throw e;
55844
+ }
55878
55845
  }
55879
55846
  function markApproved(id) {
55880
55847
  const meta = readMeta(safeProjectId(id));
@@ -55942,21 +55909,50 @@ function exportFilename(name) {
55942
55909
  const clean = name.replace(/[^a-z0-9\-_. ]+/gi, " ").replace(/\s+/g, " ").trim().slice(0, 60);
55943
55910
  return clean || "project";
55944
55911
  }
55945
- function exportProjectZip(id) {
55912
+ var ZIP_SLICE = 1024 * 1024;
55913
+ var yieldToLoop = () => new Promise((r) => setImmediate(r));
55914
+ async function zipYielding(files2, level) {
55915
+ const parts = [];
55916
+ let failed = null;
55917
+ const zipper = new Zip((err2, chunk) => {
55918
+ if (err2) failed = err2;
55919
+ else parts.push(chunk);
55920
+ });
55921
+ for (const [name, bytes] of Object.entries(files2)) {
55922
+ if (failed) break;
55923
+ const file = new ZipDeflate(name, { level });
55924
+ zipper.add(file);
55925
+ if (bytes.length === 0) {
55926
+ file.push(new Uint8Array(0), true);
55927
+ continue;
55928
+ }
55929
+ for (let off = 0; off < bytes.length && !failed; off += ZIP_SLICE) {
55930
+ const end = Math.min(off + ZIP_SLICE, bytes.length);
55931
+ file.push(bytes.subarray(off, end), end >= bytes.length);
55932
+ await yieldToLoop();
55933
+ }
55934
+ }
55935
+ zipper.end();
55936
+ if (failed) throw failed;
55937
+ return Buffer.concat(parts);
55938
+ }
55939
+ async function exportProjectZip(id) {
55946
55940
  const meta = readMeta(safeProjectId(id));
55947
55941
  if (!meta) throw new ProjectError(`unknown project: ${id}`);
55948
55942
  const root = projectDir(id);
55949
55943
  const files2 = {};
55950
- const walk2 = (abs, rel) => {
55951
- for (const e of (0, import_node_fs20.readdirSync)(abs, { withFileTypes: true })) {
55944
+ const walk2 = async (abs, rel) => {
55945
+ const entries = await (0, import_promises.readdir)(abs, { withFileTypes: true });
55946
+ await Promise.all(entries.map(async (e) => {
55952
55947
  const childAbs = (0, import_node_path18.join)(abs, e.name);
55953
55948
  const childRel = rel ? `${rel}/${e.name}` : e.name;
55954
- if (e.isDirectory()) walk2(childAbs, childRel);
55955
- else if (e.isFile()) files2[`${id}/${childRel}`] = (0, import_node_fs20.readFileSync)(childAbs);
55956
- }
55949
+ if (e.isDirectory()) await walk2(childAbs, childRel);
55950
+ else if (e.isFile()) files2[`${id}/${childRel}`] = await (0, import_promises.readFile)(childAbs);
55951
+ }));
55957
55952
  };
55958
- walk2(root, "");
55959
- return { data: zipSync(files2, { level: 6 }), filename: `${exportFilename(meta.name)}.zip` };
55953
+ await walk2(root, "");
55954
+ const data = await zipYielding(files2, 6);
55955
+ return { data, filename: `${exportFilename(meta.name)}.zip` };
55960
55956
  }
55961
55957
  var IMPORT_MAX_FILES = 1e4;
55962
55958
  var IMPORT_MAX_UNCOMPRESSED = 2 * 1024 * 1024 * 1024;
@@ -55988,7 +55984,10 @@ function importProjectZip(data) {
55988
55984
  } catch {
55989
55985
  throw new ProjectError("archive project.json is unreadable");
55990
55986
  }
55991
- const name = typeof srcMeta.name === "string" && srcMeta.name.trim() ? srcMeta.name.trim() : "Imported project";
55987
+ const rawName = typeof srcMeta.name === "string" && srcMeta.name.trim() ? srcMeta.name.trim() : "Imported project";
55988
+ const takenNames = new Set(listProjects().map((p) => p.name));
55989
+ let name = rawName;
55990
+ for (let n = 1; takenNames.has(name); n++) name = n === 1 ? `${rawName} (imported)` : `${rawName} (imported ${n})`;
55992
55991
  const app = typeof srcMeta.app === "string" ? srcMeta.app.trim() : "";
55993
55992
  if (!/^[a-z0-9][a-z0-9._-]*$/i.test(app)) throw new ProjectError(`archive names an invalid app id: ${app || "(empty)"}`);
55994
55993
  let id = `${slugify(name)}-${(0, import_node_crypto6.randomBytes)(3).toString("hex")}`;
@@ -58684,6 +58683,7 @@ function bakeContractIntoApp(sourcePath, contract) {
58684
58683
  if (p && typeof p === "object") {
58685
58684
  const clone = { ...p };
58686
58685
  delete clone.dims;
58686
+ delete clone.grid;
58687
58687
  return clone;
58688
58688
  }
58689
58689
  return p;
@@ -61869,7 +61869,7 @@ function generateXlsxFileContents(arg1, arg2, arg3) {
61869
61869
  sheetsOptions = setConditionalFormattingRulesGlobalIndexes(sheetsOptions);
61870
61870
  var features = getFeatures(options.features);
61871
61871
  var files2 = {};
61872
- var readFile = function readFile2(path) {
61872
+ var readFile2 = function readFile3(path) {
61873
61873
  return files2[path];
61874
61874
  };
61875
61875
  var writeFiles = function writeFiles2(filesToWrite) {
@@ -61936,7 +61936,7 @@ function generateXlsxFileContents(arg1, arg2, arg3) {
61936
61936
  sheetIndex++;
61937
61937
  }
61938
61938
  writeFiles(getWrittenFiles(features, sheetsOptions, {
61939
- read: readFile
61939
+ read: readFile2
61940
61940
  }));
61941
61941
  files2["xl/styles.xml"] = generateStylesXml(getCellStyles(), sheetsOptions, features);
61942
61942
  files2["xl/sharedStrings.xml"] = generateSharedStringsXml(getSharedStrings());
@@ -63955,7 +63955,7 @@ var import_node_child_process6 = require("node:child_process");
63955
63955
  var import_node_crypto11 = require("node:crypto");
63956
63956
  var import_node_fs36 = require("node:fs");
63957
63957
  var import_node_stream3 = require("node:stream");
63958
- var import_promises = require("node:stream/promises");
63958
+ var import_promises2 = require("node:stream/promises");
63959
63959
  var import_node_path32 = require("node:path");
63960
63960
 
63961
63961
  // post-update-marker.mjs
@@ -64112,7 +64112,7 @@ async function checkForUpdate() {
64112
64112
  }
64113
64113
  async function sha1OfFile(path) {
64114
64114
  const hash = (0, import_node_crypto11.createHash)("sha1");
64115
- await (0, import_promises.pipeline)((0, import_node_fs36.createReadStream)(path), hash);
64115
+ await (0, import_promises2.pipeline)((0, import_node_fs36.createReadStream)(path), hash);
64116
64116
  return hash.digest("hex").toUpperCase();
64117
64117
  }
64118
64118
  async function downloadPackage(asset) {
@@ -64127,7 +64127,7 @@ async function downloadPackage(asset) {
64127
64127
  signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS)
64128
64128
  });
64129
64129
  if (!res.ok || !res.body) throw new Error(`download failed: HTTP ${res.status} for ${asset.FileName}`);
64130
- await (0, import_promises.pipeline)(import_node_stream3.Readable.fromWeb(res.body), (0, import_node_fs36.createWriteStream)(dest));
64130
+ await (0, import_promises2.pipeline)(import_node_stream3.Readable.fromWeb(res.body), (0, import_node_fs36.createWriteStream)(dest));
64131
64131
  const got = await sha1OfFile(dest);
64132
64132
  if (got !== want) throw new Error(`SHA1 mismatch for ${asset.FileName}: feed=${want} got=${got}`);
64133
64133
  return dest;
@@ -65026,12 +65026,12 @@ var import_node_fs39 = require("node:fs");
65026
65026
 
65027
65027
  // node_modules/chokidar/esm/index.js
65028
65028
  var import_fs2 = require("fs");
65029
- var import_promises4 = require("fs/promises");
65029
+ var import_promises5 = require("fs/promises");
65030
65030
  var import_events = require("events");
65031
65031
  var sysPath2 = __toESM(require("path"), 1);
65032
65032
 
65033
65033
  // node_modules/readdirp/esm/index.js
65034
- var import_promises2 = require("node:fs/promises");
65034
+ var import_promises3 = require("node:fs/promises");
65035
65035
  var import_node_stream4 = require("node:stream");
65036
65036
  var import_node_path35 = require("node:path");
65037
65037
  var EntryTypes = {
@@ -65098,7 +65098,7 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
65098
65098
  const { root, type } = opts;
65099
65099
  this._fileFilter = normalizeFilter(opts.fileFilter);
65100
65100
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
65101
- const statMethod = opts.lstat ? import_promises2.lstat : import_promises2.stat;
65101
+ const statMethod = opts.lstat ? import_promises3.lstat : import_promises3.stat;
65102
65102
  if (wantBigintFsStats) {
65103
65103
  this._stat = (path) => statMethod(path, { bigint: true });
65104
65104
  } else {
@@ -65169,7 +65169,7 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
65169
65169
  async _exploreDir(path, depth) {
65170
65170
  let files2;
65171
65171
  try {
65172
- files2 = await (0, import_promises2.readdir)(path, this._rdOptions);
65172
+ files2 = await (0, import_promises3.readdir)(path, this._rdOptions);
65173
65173
  } catch (error) {
65174
65174
  this._onError(error);
65175
65175
  }
@@ -65207,8 +65207,8 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
65207
65207
  if (stats && stats.isSymbolicLink()) {
65208
65208
  const full = entry2.fullPath;
65209
65209
  try {
65210
- const entryRealPath = await (0, import_promises2.realpath)(full);
65211
- const entryRealPathStats = await (0, import_promises2.lstat)(entryRealPath);
65210
+ const entryRealPath = await (0, import_promises3.realpath)(full);
65211
+ const entryRealPathStats = await (0, import_promises3.lstat)(entryRealPath);
65212
65212
  if (entryRealPathStats.isFile()) {
65213
65213
  return "file";
65214
65214
  }
@@ -65251,7 +65251,7 @@ function readdirp(root, options = {}) {
65251
65251
 
65252
65252
  // node_modules/chokidar/esm/handler.js
65253
65253
  var import_fs = require("fs");
65254
- var import_promises3 = require("fs/promises");
65254
+ var import_promises4 = require("fs/promises");
65255
65255
  var sysPath = __toESM(require("path"), 1);
65256
65256
  var import_os = require("os");
65257
65257
  var STR_DATA = "data";
@@ -65278,7 +65278,7 @@ var EVENTS = {
65278
65278
  };
65279
65279
  var EV = EVENTS;
65280
65280
  var THROTTLE_MODE_WATCH = "watch";
65281
- var statMethods = { lstat: import_promises3.lstat, stat: import_promises3.stat };
65281
+ var statMethods = { lstat: import_promises4.lstat, stat: import_promises4.stat };
65282
65282
  var KEY_LISTENERS = "listeners";
65283
65283
  var KEY_ERR = "errHandlers";
65284
65284
  var KEY_RAW = "rawEmitters";
@@ -65635,7 +65635,7 @@ var setFsWatchListener = (path, fullPath, options, handlers) => {
65635
65635
  cont.watcherUnusable = true;
65636
65636
  if (isWindows && error.code === "EPERM") {
65637
65637
  try {
65638
- const fd2 = await (0, import_promises3.open)(path, "r");
65638
+ const fd2 = await (0, import_promises4.open)(path, "r");
65639
65639
  await fd2.close();
65640
65640
  broadcastErr(error);
65641
65641
  } catch (err2) {
@@ -65764,7 +65764,7 @@ var NodeFsHandler = class {
65764
65764
  return;
65765
65765
  if (!newStats || newStats.mtimeMs === 0) {
65766
65766
  try {
65767
- const newStats2 = await (0, import_promises3.stat)(file);
65767
+ const newStats2 = await (0, import_promises4.stat)(file);
65768
65768
  if (this.fsw.closed)
65769
65769
  return;
65770
65770
  const at = newStats2.atimeMs;
@@ -65819,7 +65819,7 @@ var NodeFsHandler = class {
65819
65819
  this.fsw._incrReadyCount();
65820
65820
  let linkPath;
65821
65821
  try {
65822
- linkPath = await (0, import_promises3.realpath)(path);
65822
+ linkPath = await (0, import_promises4.realpath)(path);
65823
65823
  } catch (e) {
65824
65824
  this.fsw._emitReady();
65825
65825
  return true;
@@ -65967,7 +65967,7 @@ var NodeFsHandler = class {
65967
65967
  let closer;
65968
65968
  if (stats.isDirectory()) {
65969
65969
  const absPath = sysPath.resolve(path);
65970
- const targetPath = follow ? await (0, import_promises3.realpath)(path) : path;
65970
+ const targetPath = follow ? await (0, import_promises4.realpath)(path) : path;
65971
65971
  if (this.fsw.closed)
65972
65972
  return;
65973
65973
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -65977,7 +65977,7 @@ var NodeFsHandler = class {
65977
65977
  this.fsw._symlinkPaths.set(absPath, targetPath);
65978
65978
  }
65979
65979
  } else if (stats.isSymbolicLink()) {
65980
- const targetPath = follow ? await (0, import_promises3.realpath)(path) : path;
65980
+ const targetPath = follow ? await (0, import_promises4.realpath)(path) : path;
65981
65981
  if (this.fsw.closed)
65982
65982
  return;
65983
65983
  const parent = sysPath.dirname(wh.watchPath);
@@ -66138,7 +66138,7 @@ var DirEntry = class {
66138
66138
  return;
66139
66139
  const dir = this.path;
66140
66140
  try {
66141
- await (0, import_promises4.readdir)(dir);
66141
+ await (0, import_promises5.readdir)(dir);
66142
66142
  } catch (err2) {
66143
66143
  if (this._removeWatcher) {
66144
66144
  this._removeWatcher(sysPath2.dirname(dir), sysPath2.basename(dir));
@@ -66463,7 +66463,7 @@ var FSWatcher = class extends import_events.EventEmitter {
66463
66463
  const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path) : path;
66464
66464
  let stats2;
66465
66465
  try {
66466
- stats2 = await (0, import_promises4.stat)(fullPath);
66466
+ stats2 = await (0, import_promises5.stat)(fullPath);
66467
66467
  } catch (err2) {
66468
66468
  }
66469
66469
  if (!stats2 || this.closed)
@@ -67362,7 +67362,7 @@ async function startServer() {
67362
67362
  });
67363
67363
  app.get("/api/projects/:id/export.zip", async (req, reply) => {
67364
67364
  try {
67365
- const { data, filename } = exportProjectZip(req.params.id);
67365
+ const { data, filename } = await exportProjectZip(req.params.id);
67366
67366
  return reply.header("content-type", "application/zip").header("content-disposition", `attachment; filename="${filename.replace(/["\r\n]/g, "")}"`).send(Buffer.from(data));
67367
67367
  } catch (e) {
67368
67368
  if (e instanceof ProjectError) return reply.status(404).send({ ok: false, error: e.message });
@@ -95,15 +95,16 @@
95
95
  "type": ["object", "null"],
96
96
  "required": ["origin"],
97
97
  "additionalProperties": true,
98
- "description": "Structural grid: X/Y are RELATIVE spacing strings (compact bay syntax — \"0 3*25' 20'-6\\\"\", n*d repeats a bay; tokens accept ft-in / inches / m / bare mm), Z is ABSOLUTE elevations. X entries space lines along +X (lines vertical on the plan, auto-labels 1,2,3…); Y entries march UP the sheet (lines horizontal, auto-labels A,B,C…). web/grid-core.js is the parser/geometry source of truth.",
98
+ "description": "Structural grid: X/Y are RELATIVE comma-separated spacing strings (for example \"0'-0\\\", 3*25'-0\\\", 20'-6 1/2\\\"\"; n*d repeats a bay), while Z is a comma-separated list of ABSOLUTE elevations. Spaces may occur inside a mixed fraction, so commas are required for fractional multi-value lists. web/grid-core.js is the parser/geometry source of truth.",
99
99
  "properties": {
100
100
  "on": { "type": "boolean", "description": "Grid visible (2D + 3D). Default true." },
101
101
  "origin": { "$ref": "#/$defs/point2", "description": "The [1,A] corner, display space (same space as member wp)." },
102
- "x": { "type": "string", "description": "Relative spacings along +X, e.g. \"0 3*25'\"." },
103
- "y": { "type": "string", "description": "Relative spacings up the sheet, e.g. \"0 4*30'\"." },
104
- "z": { "type": "string", "description": "Absolute level elevations, e.g. \"0 16'-6\\\"\"." },
102
+ "x": { "type": "string", "description": "Relative spacings along +X, comma-separated, e.g. \"0'-0\\\", 3*25'-0\\\"\"." },
103
+ "y": { "type": "string", "description": "Relative spacings up the sheet, comma-separated, e.g. \"0'-0\\\", 4*30'-0\\\"\"." },
104
+ "z": { "type": "string", "description": "Absolute level elevations, comma-separated, e.g. \"0'-0\\\", 16'-6\\\"\"." },
105
105
  "labels_x": { "type": "string", "description": "Whitespace-separated label overrides for X lines; blank = auto 1,2,3…" },
106
106
  "labels_y": { "type": "string", "description": "Whitespace-separated label overrides for Y lines; blank = auto A,B,C…" },
107
+ "labels_z": { "type": "array", "items": { "type": "string", "maxLength": 40 }, "description": "Editable level labels aligned to the authored Z entries. Blank entries fall back to the canonical elevation." },
107
108
  "ext": { "type": "number", "description": "How far lines run past the outermost line, in mm. Default 5'." },
108
109
  "ends_x": { "type": "object", "description": "Per-line extent overrides for X lines: { \"<line index>\": [lo, hi] } display px along the line (a partial line like a 5.1 insert covering one wing). null / absent element = the auto full span. Set by dragging a bubble along its line." },
109
110
  "ends_y": { "type": "object", "description": "Per-line extent overrides for Y lines — same shape as ends_x." },
@@ -260,9 +260,11 @@ text layer. You CAN read them: you already have vision on the sheet. So:
260
260
 
261
261
  1. Derive the line positions (or let the user press "From drawing" later — same result).
262
262
  2. **Vision-read each bubble's mark** from the sheet render, in line order.
263
- 3. Write `plan.grid = { on:true, origin:[x,y], x:"0 3*25' …", y:"…", z:"0", labels_x:"K J H …",
263
+ 3. Write `plan.grid = { on:true, origin:[x,y], x:"0'-0\", 3*25'-0\", …", y:"…", z:"0'-0\", …", labels_x:"K J H …",
264
264
  labels_y:"0.5 1 1.1 …", ext:<mm> }` — origin = the left-most × bottom-most line crossing,
265
- spacings are RELATIVE ft-in tokens (`n*d` repeats a bay), labels are whitespace-separated
265
+ spacings are RELATIVE ft-in tokens (`n*d` repeats a bay) separated by **commas**. A space may
266
+ belong to one mixed fraction (`8'-3 15/16\"`), so never use whitespace alone to separate
267
+ fractional values. Labels remain whitespace-separated
266
268
  overrides in line order (X: left→right; Y: bottom→up). Sanity-check a bay or two against the
267
269
  printed dimension strings between grid lines — a mismatch means the sheet scale (`pt_per_ft`) is
268
270
  wrong, which corrupts the whole takeoff, not just the grid. **Then PUT the contract again** —