@reekon-tools/boldr-utils 1.4.0 → 1.4.2
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 +1 -0
- package/dist/index.js +1 -0
- package/dist/types/firestore.d.ts +29 -1
- package/dist/types/firestore.js +12 -0
- package/dist/types/layout.d.ts +6 -4
- package/dist/utils/micrometersToUnit.js +18 -6
- package/package.json +1 -1
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';
|
|
@@ -90,12 +90,26 @@ export interface Folder extends FirestoreDoc {
|
|
|
90
90
|
projectId: string | null;
|
|
91
91
|
type: FolderType;
|
|
92
92
|
}
|
|
93
|
+
export declare enum JobType {
|
|
94
|
+
DEFAULT = "default",
|
|
95
|
+
CUTLIST = "cutlist"
|
|
96
|
+
}
|
|
93
97
|
export interface Job extends FirestoreDoc, Timestamps {
|
|
94
98
|
name: string;
|
|
95
99
|
folderId: string;
|
|
96
100
|
progress: number;
|
|
97
101
|
projectId: string;
|
|
98
102
|
totalTasks: string;
|
|
103
|
+
toleranceConfig?: {
|
|
104
|
+
thresholds: {
|
|
105
|
+
id: string;
|
|
106
|
+
percentage: number;
|
|
107
|
+
color: string;
|
|
108
|
+
}[];
|
|
109
|
+
updatedAt: Date;
|
|
110
|
+
};
|
|
111
|
+
areaMapFileId?: string;
|
|
112
|
+
type?: JobType;
|
|
99
113
|
}
|
|
100
114
|
export interface Section {
|
|
101
115
|
id: string;
|
|
@@ -131,7 +145,9 @@ export declare enum ColumnType {
|
|
|
131
145
|
Boolean = "boolean",
|
|
132
146
|
Formula = "formula",
|
|
133
147
|
SingleSelect = "singleSelect",
|
|
134
|
-
MultiSelect = "multiSelect"
|
|
148
|
+
MultiSelect = "multiSelect",
|
|
149
|
+
Angle = "angle",
|
|
150
|
+
ConversionTable = "conversionTable"
|
|
135
151
|
}
|
|
136
152
|
export interface Formula extends FirestoreDoc, Timestamps {
|
|
137
153
|
expression: string;
|
|
@@ -146,10 +162,19 @@ export interface ColumnConfig {
|
|
|
146
162
|
mappings?: Record<string, string>;
|
|
147
163
|
withTolerance?: boolean;
|
|
148
164
|
options?: string[];
|
|
165
|
+
conversions?: Conversion[];
|
|
166
|
+
}
|
|
167
|
+
export interface Conversion {
|
|
168
|
+
label: string;
|
|
169
|
+
value: string;
|
|
149
170
|
}
|
|
150
171
|
export interface Row {
|
|
151
172
|
[key: string]: any;
|
|
152
173
|
}
|
|
174
|
+
export declare enum MeasurementType {
|
|
175
|
+
Angle = "angle",
|
|
176
|
+
Length = "length"
|
|
177
|
+
}
|
|
153
178
|
export interface Measurement extends FirestoreDoc, Timestamps, CreatedBy {
|
|
154
179
|
projectId: string;
|
|
155
180
|
jobId: string;
|
|
@@ -164,6 +189,9 @@ export interface Measurement extends FirestoreDoc, Timestamps, CreatedBy {
|
|
|
164
189
|
relative?: boolean;
|
|
165
190
|
measureBack?: boolean;
|
|
166
191
|
centerFinding?: boolean;
|
|
192
|
+
isCompleted?: boolean;
|
|
193
|
+
type?: MeasurementType;
|
|
194
|
+
note?: string;
|
|
167
195
|
}
|
|
168
196
|
export declare enum Units {
|
|
169
197
|
Centimeters = "cm",
|
package/dist/types/firestore.js
CHANGED
|
@@ -15,6 +15,11 @@ export var FolderType;
|
|
|
15
15
|
FolderType["Project"] = "project";
|
|
16
16
|
FolderType["Job"] = "job";
|
|
17
17
|
})(FolderType || (FolderType = {}));
|
|
18
|
+
export var JobType;
|
|
19
|
+
(function (JobType) {
|
|
20
|
+
JobType["DEFAULT"] = "default";
|
|
21
|
+
JobType["CUTLIST"] = "cutlist";
|
|
22
|
+
})(JobType || (JobType = {}));
|
|
18
23
|
export var ColumnType;
|
|
19
24
|
(function (ColumnType) {
|
|
20
25
|
ColumnType["Text"] = "text";
|
|
@@ -24,7 +29,14 @@ export var ColumnType;
|
|
|
24
29
|
ColumnType["Formula"] = "formula";
|
|
25
30
|
ColumnType["SingleSelect"] = "singleSelect";
|
|
26
31
|
ColumnType["MultiSelect"] = "multiSelect";
|
|
32
|
+
ColumnType["Angle"] = "angle";
|
|
33
|
+
ColumnType["ConversionTable"] = "conversionTable";
|
|
27
34
|
})(ColumnType || (ColumnType = {}));
|
|
35
|
+
export var MeasurementType;
|
|
36
|
+
(function (MeasurementType) {
|
|
37
|
+
MeasurementType["Angle"] = "angle";
|
|
38
|
+
MeasurementType["Length"] = "length";
|
|
39
|
+
})(MeasurementType || (MeasurementType = {}));
|
|
28
40
|
export var Units;
|
|
29
41
|
(function (Units) {
|
|
30
42
|
Units["Centimeters"] = "cm";
|
package/dist/types/layout.d.ts
CHANGED
|
@@ -40,13 +40,15 @@ export interface Layout {
|
|
|
40
40
|
faces: Record<string, Face>;
|
|
41
41
|
backgroundImage?: {
|
|
42
42
|
fileId: string;
|
|
43
|
-
|
|
43
|
+
opacity: number;
|
|
44
|
+
centerWorld: {
|
|
44
45
|
x: number;
|
|
45
46
|
y: number;
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
pixelSizeWorld: number;
|
|
49
|
+
widthPx: number;
|
|
50
|
+
heightPx: number;
|
|
51
|
+
rotationRad: number;
|
|
50
52
|
};
|
|
51
53
|
metadata?: {
|
|
52
54
|
projectId?: 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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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);
|