@7365admin1/layer-common 4.51.0 → 4.51.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.51.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 39cbe08: Fix the robot pages crashing in the browser on 4.50.0/4.51.0 ("process is not defined" / "Couldn't resolve component default"). A parameter named `measure` in `utils/rmf-editor.ts` was picked up by Nuxt auto-imports as the `measure` export of `utils/theme-aa-ledger.ts`, whose top-level command-line check read `process.argv`. The parameter is renamed and the ledger's check is guarded; a new test evaluates every util in a browser-like scope with the auto-imports injected.
8
+
3
9
  ## 4.51.0
4
10
 
5
11
  ### Minor Changes
@@ -1545,11 +1551,11 @@
1545
1551
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1546
1552
  own rule from two endpoints the console already calls, unprojected:
1547
1553
 
1548
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1549
- GET /api/roles/id/:role that membership's role document
1554
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1555
+ GET /api/roles/id/:role that membership's role document
1550
1556
 
1551
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1552
- staff = member.type === "admin" && role.type === "admin"
1557
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1558
+ staff = member.type === "admin" && role.type === "admin"
1553
1559
 
1554
1560
  `role.default` is the marker because it is the only property of a platform
1555
1561
  staff role no API caller can set - `role.controller.ts` validates create and
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.51.0",
5
+ "version": "4.51.1",
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");