@reekon-tools/boldr-utils 1.4.0 → 1.4.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/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export { convertMicrometers } from './utils/micrometersToUnit.js';
3
3
  export { parseMeasurement } from './utils/parseMeasurement.js';
4
4
  export { useParseMeasurement } from './hooks/useParseMeasurement.js';
5
5
  export * from './types/firestore.js';
6
+ export * from './types/layout.js';
6
7
  export { getToleranceColor, calculateDeviationPercentage, isWithinTolerance, generateToleranceGradient, createDefaultToleranceThresholds, DEFAULT_TOLERANCE_COLORS, type ToleranceThreshold, type ToleranceConfig, } from './utils/tolerance.js';
package/dist/index.js CHANGED
@@ -3,4 +3,5 @@ export { convertMicrometers } from './utils/micrometersToUnit.js';
3
3
  export { parseMeasurement } from './utils/parseMeasurement.js';
4
4
  export { useParseMeasurement } from './hooks/useParseMeasurement.js';
5
5
  export * from './types/firestore.js';
6
+ export * from './types/layout.js';
6
7
  export { getToleranceColor, calculateDeviationPercentage, isWithinTolerance, generateToleranceGradient, createDefaultToleranceThresholds, DEFAULT_TOLERANCE_COLORS, } from './utils/tolerance.js';
@@ -96,6 +96,15 @@ export interface Job extends FirestoreDoc, Timestamps {
96
96
  progress: number;
97
97
  projectId: string;
98
98
  totalTasks: string;
99
+ toleranceConfig?: {
100
+ thresholds: {
101
+ id: string;
102
+ percentage: number;
103
+ color: string;
104
+ }[];
105
+ updatedAt: Date;
106
+ };
107
+ areaMapFileId?: string;
99
108
  }
100
109
  export interface Section {
101
110
  id: string;
@@ -15,8 +15,15 @@ export const convertMicrometers = (micrometers, unit, fractionalTolerance, decim
15
15
  const whole = Math.floor(inches);
16
16
  const fractional = inches - whole;
17
17
  const numerator = Math.round(fractional * denominator);
18
- value =
19
- numerator === 0 ? `${whole}` : `${whole} ${numerator}/${denominator}`;
18
+ if (numerator === denominator) {
19
+ value = `${whole + 1}`;
20
+ }
21
+ else {
22
+ value =
23
+ numerator === 0
24
+ ? `${whole}`
25
+ : `${whole} ${numerator}/${denominator}`;
26
+ }
20
27
  }
21
28
  else {
22
29
  value = inches.toFixed(decimalTolerance.length - 2); // Match decimal places to tolerance
@@ -36,10 +43,15 @@ export const convertMicrometers = (micrometers, unit, fractionalTolerance, decim
36
43
  const fractional = inches - wholeInches;
37
44
  const denominator = parseInt(fractionalTolerance, 10);
38
45
  const numerator = Math.round(fractional * denominator);
39
- value =
40
- numerator === 0
41
- ? `${wholeFeet}' ${wholeInches}"`
42
- : `${wholeFeet}' ${wholeInches} ${numerator}/${denominator}"`;
46
+ if (numerator === denominator) {
47
+ value = `${wholeFeet}' ${wholeInches + 1}"`;
48
+ }
49
+ else {
50
+ value =
51
+ numerator === 0
52
+ ? `${wholeFeet}' ${wholeInches}"`
53
+ : `${wholeFeet}' ${wholeInches} ${numerator}/${denominator}"`;
54
+ }
43
55
  }
44
56
  else if (unit === Units.FeetInchesDecimal) {
45
57
  const inches = (fractionalFeet * 12).toFixed(decimalTolerance.length - 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reekon-tools/boldr-utils",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Shared utilities for formulas and measurement conversion used in Reekon apps",
5
5
  "author": "REEKON Tools",
6
6
  "license": "MIT",