@7365admin1/layer-common 4.35.1-staging.395 → 4.35.1-staging.396

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.35.1-staging.395",
5
+ "version": "4.35.1-staging.396",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -249,9 +249,9 @@ export function alignFloor(shapes: TEditorShape[], f: TFrame, floorNo: number, r
249
249
  * about the plan's top-left corner - so the plan and the drawing stay
250
250
  * together. Null factor with a reason when it cannot be done.
251
251
  */
252
- export function measureScale(f: TFrame, measure: TEditorShape, realM: number, placement: TPlanPlacement | null) {
252
+ export function measureScale(f: TFrame, line: TEditorShape, realM: number, placement: TPlanPlacement | null) {
253
253
  if (!(realM > 0) || !Number.isFinite(realM)) return { error: "Enter the real length in metres (more than 0)." } as const;
254
- const [a, b] = measure.points.map((p) => shareToWorld(f, p));
254
+ const [a, b] = line.points.map((p) => shareToWorld(f, p));
255
255
  const drawn = Math.hypot(b!.x - a!.x, b!.y - a!.y);
256
256
  if (drawn < 0.05) return { error: "The two ends are too close together - measure a longer length." } as const;
257
257
  const k = realM / drawn;
@@ -134,7 +134,8 @@ export const DARK_PAIRS = () => {
134
134
  ].map((p) => ({ ...p, ratio: Math.round(contrast(p.fg, p.bg) * 100) / 100, passes: contrast(p.fg, p.bg) >= p.need }));
135
135
  };
136
136
 
137
- if (process.argv[1]?.endsWith("theme-aa-ledger.ts")) {
137
+ // Guarded: this file is auto-importable, and a browser has no `process` (an unguarded check crashed the robot pages in 4.50.0).
138
+ if (typeof process !== "undefined" && process.argv?.[1]?.endsWith("theme-aa-ledger.ts")) {
138
139
  const row = (r: { what: string; fg: string; bg: string; ratio: number; need: number; passes: boolean }) =>
139
140
  `${r.passes ? "PASS" : "FAIL"} ${String(r.ratio).padStart(5)}:1 / ${r.need} ${r.fg} on ${r.bg} ${r.what}`;
140
141
  console.log("LIGHT");