@metron-labs/quote-react 0.1.30 → 0.1.32

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.
@@ -116,8 +116,10 @@ export function getCartSubtotal(items, options) {
116
116
  }
117
117
  export function getPricingBreakdown(item, options) {
118
118
  const requestedAmount = item.qty;
119
- const requestedUnit = canonicalUnit(item.unit) || "-";
120
119
  const sellUnit = canonicalUnit(item.saleUnit ?? item.salesUnitSizeUom ?? item.uoi ?? item.salesUomNormalised) || "-";
120
+ // A counted request such as "100 concrete blocks" may have a missing source
121
+ // unit even though the selected product is sold as a discrete unit.
122
+ const requestedUnit = canonicalUnit(item.unit) || (requestedAmount > 0 && discreteSellUnits.has(sellUnit) ? sellUnit : "-");
121
123
  const salesUnitSize = item.saleUnitQuantity ?? item.salesUnitSize ?? item.uoiCount ?? 1;
122
124
  const wasteFactor = options?.wasteFactorEnabled === false ? 0 : (options?.wasteFactorOverride ?? item.wasteFactorOverride ?? item.wasteFactorDefault ?? 0);
123
125
  const hasOverride = item.sellUnitsOverride != null && Number.isFinite(item.sellUnitsOverride) && item.sellUnitsOverride > 0;
@@ -38,6 +38,9 @@ export interface CartItem {
38
38
  conversionConfidence?: string | null;
39
39
  conversionNotes?: string | null;
40
40
  linkedContext?: Array<{
41
+ line_id?: string;
42
+ product_id?: string | null;
43
+ measurements_mm?: number[];
41
44
  description: string;
42
45
  qty: number | null;
43
46
  unit: string | null;
@@ -82,6 +85,7 @@ export interface LineItem {
82
85
  subheading: string;
83
86
  description_original: string;
84
87
  customer_display_label?: string | null;
88
+ instructions?: string | null;
85
89
  procurement_intent: string;
86
90
  procurement_aliases: string[];
87
91
  compatibility_note?: string | null;
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "@metron-labs/quote-react",
3
- "version": "0.1.30",
4
- "description": "Metron Labs quote and estimating calculator components for React",
5
- "license": "UNLICENSED",
6
- "sideEffects": [
7
- "*.css"
8
- ],
9
- "main": "./dist/index.js",
10
- "types": "./dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "types": "./dist/index.d.ts",
14
- "default": "./dist/index.js"
15
- },
16
- "./styles.css": "./dist/styles.css",
17
- "./*": {
18
- "types": "./dist/*.d.ts",
19
- "default": "./dist/*.js"
20
- }
21
- },
22
- "files": [
23
- "dist"
24
- ],
25
- "publishConfig": {
26
- "access": "restricted"
27
- },
28
- "scripts": {
29
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && node scripts/copyStatic.mjs && node scripts/buildEmbed.mjs",
30
- "typecheck": "tsc --noEmit",
31
- "test": "vitest run",
32
- "prepublishOnly": "npm run typecheck && npm run build",
33
- "check:embed": "node scripts/checkEmbed.mjs"
34
- },
35
- "peerDependencies": {
36
- "react": "^18.3.0 || ^19.0.0",
37
- "react-dom": "^18.3.0 || ^19.0.0"
38
- },
39
- "dependencies": {
40
- "xlsx": "^0.18.5"
41
- },
42
- "devDependencies": {
43
- "@types/node": "^20",
44
- "@types/react": "^19",
45
- "@types/react-dom": "^19",
46
- "esbuild": "^0.28.2",
47
- "react": "19.2.3",
48
- "react-dom": "19.2.3",
49
- "tsx": "^4",
50
- "typescript": "^5",
51
- "vitest": "^3"
52
- }
53
- }
1
+ {
2
+ "name": "@metron-labs/quote-react",
3
+ "version": "0.1.32",
4
+ "description": "Metron Labs quote and estimating calculator components for React",
5
+ "license": "UNLICENSED",
6
+ "sideEffects": [
7
+ "*.css"
8
+ ],
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./styles.css": "./dist/styles.css",
17
+ "./*": {
18
+ "types": "./dist/*.d.ts",
19
+ "default": "./dist/*.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "restricted"
27
+ },
28
+ "scripts": {
29
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && node scripts/copyStatic.mjs && node scripts/buildEmbed.mjs",
30
+ "typecheck": "tsc --noEmit",
31
+ "test": "vitest run",
32
+ "prepublishOnly": "npm run typecheck && npm run build",
33
+ "check:embed": "node scripts/checkEmbed.mjs"
34
+ },
35
+ "peerDependencies": {
36
+ "react": "^18.3.0 || ^19.0.0",
37
+ "react-dom": "^18.3.0 || ^19.0.0"
38
+ },
39
+ "dependencies": {
40
+ "xlsx": "^0.18.5"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^20",
44
+ "@types/react": "^19",
45
+ "@types/react-dom": "^19",
46
+ "esbuild": "^0.28.2",
47
+ "react": "19.2.3",
48
+ "react-dom": "19.2.3",
49
+ "tsx": "^4",
50
+ "typescript": "^5",
51
+ "vitest": "^3"
52
+ }
53
+ }