fix(dn): keep the unit list out of the browser's node imports
Co-Authored-By: MiniMax (Pinchy)
This commit is contained in:
parent
7464879c02
commit
3e4b9d0fb0
3 changed files with 11 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"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.
|
* The unit on a slip line, and the conversion it needs.
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,9 @@ export interface LineRow {
|
||||||
ready: boolean; posted: boolean; problem: string | null;
|
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;
|
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. */
|
/** A factor has to be a real conversion: above zero and no bigger than a roll of 10000. */
|
||||||
|
|
|
||||||
7
src/lib/inbox-three/units.ts
Normal file
7
src/lib/inbox-three/units.ts
Normal file
|
|
@ -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;
|
||||||
Loading…
Reference in a new issue