From 3e4b9d0fb0cd5cb5d3764b533e9633d5752b1520 Mon Sep 17 00:00:00 2001 From: DEls Date: Mon, 26 Oct 2026 19:43:36 +0200 Subject: [PATCH] fix(dn): keep the unit list out of the browser's node imports Co-Authored-By: MiniMax (Pinchy) --- .../financial/delivery-notes/inbox-3/unit-input.tsx | 2 +- src/lib/inbox-three/line-rows.ts | 4 +++- src/lib/inbox-three/units.ts | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/lib/inbox-three/units.ts diff --git a/src/app/dashboard/financial/delivery-notes/inbox-3/unit-input.tsx b/src/app/dashboard/financial/delivery-notes/inbox-3/unit-input.tsx index 911c31b..5d157e8 100644 --- a/src/app/dashboard/financial/delivery-notes/inbox-3/unit-input.tsx +++ b/src/app/dashboard/financial/delivery-notes/inbox-3/unit-input.tsx @@ -1,6 +1,6 @@ "use client"; -import { UNIT_SUGGESTIONS } from "@/lib/inbox-three/line-rows"; +import { UNIT_SUGGESTIONS } from "@/lib/inbox-three/units"; /** * The unit on a slip line, and the conversion it needs. diff --git a/src/lib/inbox-three/line-rows.ts b/src/lib/inbox-three/line-rows.ts index 6746313..3080a0f 100644 --- a/src/lib/inbox-three/line-rows.ts +++ b/src/lib/inbox-three/line-rows.ts @@ -66,7 +66,9 @@ export interface LineRow { ready: boolean; posted: boolean; problem: string | null; } -export const UNIT_SUGGESTIONS = ["each", "roll", "m", "m²", "m³", "kg", "5kg bag", "ton", "length", "box", "pack"] as const; +// Re-exported so the plan's import path keeps working; the list itself +// lives in a module the browser can load. +export { UNIT_SUGGESTIONS } from "./units"; const round2 = (n: number) => Math.round((n + Number.EPSILON) * 100) / 100; /** A factor has to be a real conversion: above zero and no bigger than a roll of 10000. */ diff --git a/src/lib/inbox-three/units.ts b/src/lib/inbox-three/units.ts new file mode 100644 index 0000000..71bb086 --- /dev/null +++ b/src/lib/inbox-three/units.ts @@ -0,0 +1,7 @@ +/** + * The units a slip is likely to use. + * + * Kept on its own, free of any Node-only import, so the office's screen can + * offer them without dragging the matching engine into the browser. + */ +export const UNIT_SUGGESTIONS = ["each", "roll", "m", "m²", "m³", "kg", "5kg bag", "ton", "length", "box", "pack"] as const;