@metron-labs/quote-react 0.1.66 → 0.1.67

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.
Files changed (63) hide show
  1. package/dist/app/EstimatingTools.js +5 -5
  2. package/dist/app/QuickQuote.js +7 -7
  3. package/dist/app/stages/BasketStage.js +8 -8
  4. package/dist/app/stages/EntryStage.js +5 -5
  5. package/dist/app/stages/ScheduleResultsStage.js +8 -8
  6. package/dist/components/estimators/ArchitraveEstimator.js +1 -1
  7. package/dist/components/estimators/DeckingEstimator.js +2 -2
  8. package/dist/components/estimators/EstimatorResults.d.ts +1 -1
  9. package/dist/components/estimators/EstimatorResults.js +6 -6
  10. package/dist/components/estimators/EstimatorReviewStage.d.ts +1 -1
  11. package/dist/components/estimators/EstimatorReviewStage.js +1 -1
  12. package/dist/components/estimators/FencingEstimator.js +2 -2
  13. package/dist/components/estimators/PaintEstimator.js +1 -1
  14. package/dist/components/estimators/RoofTrussEstimator.js +1 -1
  15. package/dist/components/estimators/registry.d.ts +1 -1
  16. package/dist/components/estimators/useFixedBasket.js +3 -3
  17. package/dist/embed/quote.js +1 -1
  18. package/dist/index.d.ts +5 -5
  19. package/dist/index.js +3 -3
  20. package/dist/{lib → util}/api/fetchSchedule.d.ts +1 -1
  21. package/dist/{lib → util}/cart/CartContext.d.ts +1 -2
  22. package/dist/{lib/boq → util/cart}/toCartItem.d.ts +1 -1
  23. package/dist/{lib → util}/estimators/requestUnit.d.ts +1 -1
  24. package/dist/{lib → util}/estimators/resolveProducts.d.ts +1 -1
  25. package/dist/util/exportScheduleExcel.js +17 -3
  26. package/package.json +1 -1
  27. /package/dist/{app/components → components/unit}/UnitDisplay.d.ts +0 -0
  28. /package/dist/{app/components → components/unit}/UnitDisplay.js +0 -0
  29. /package/dist/{app/components → components/unit}/UnitLabel.d.ts +0 -0
  30. /package/dist/{app/components → components/unit}/UnitLabel.js +0 -0
  31. /package/dist/{lib → util}/ProductImage.d.ts +0 -0
  32. /package/dist/{lib → util}/ProductImage.js +0 -0
  33. /package/dist/{lib → util}/QuoteProvider.d.ts +0 -0
  34. /package/dist/{lib → util}/QuoteProvider.js +0 -0
  35. /package/dist/{lib → util}/analytics.d.ts +0 -0
  36. /package/dist/{lib → util}/analytics.js +0 -0
  37. /package/dist/{lib → util}/api/boqClient.d.ts +0 -0
  38. /package/dist/{lib → util}/api/boqClient.js +0 -0
  39. /package/dist/{lib → util}/api/boqSession.d.ts +0 -0
  40. /package/dist/{lib → util}/api/boqSession.js +0 -0
  41. /package/dist/{lib → util}/api/fetchSchedule.js +0 -0
  42. /package/dist/{lib → util}/api/pollJob.d.ts +0 -0
  43. /package/dist/{lib → util}/api/pollJob.js +0 -0
  44. /package/dist/{lib → util}/assets.d.ts +0 -0
  45. /package/dist/{lib → util}/assets.js +0 -0
  46. /package/dist/{lib → util}/cart/CartContext.js +0 -0
  47. /package/dist/{lib/boq → util/cart}/toCartItem.js +0 -0
  48. /package/dist/{lib → util}/config.d.ts +0 -0
  49. /package/dist/{lib → util}/config.js +0 -0
  50. /package/dist/{lib → util}/estimators/fixedProducts.d.ts +0 -0
  51. /package/dist/{lib → util}/estimators/fixedProducts.js +0 -0
  52. /package/dist/{lib → util}/estimators/requestUnit.js +0 -0
  53. /package/dist/{lib → util}/estimators/resolveProducts.js +0 -0
  54. /package/dist/{lib → util}/estimators/types.d.ts +0 -0
  55. /package/dist/{lib → util}/estimators/types.js +0 -0
  56. /package/dist/{lib → util}/formatters.d.ts +0 -0
  57. /package/dist/{lib → util}/formatters.js +0 -0
  58. /package/dist/{lib/boq → util}/inputLimits.d.ts +0 -0
  59. /package/dist/{lib/boq → util}/inputLimits.js +0 -0
  60. /package/dist/{lib → util}/quoteHistory.d.ts +0 -0
  61. /package/dist/{lib → util}/quoteHistory.js +0 -0
  62. /package/dist/{lib → util}/useEscapeKey.d.ts +0 -0
  63. /package/dist/{lib → util}/useEscapeKey.js +0 -0
package/dist/index.d.ts CHANGED
@@ -2,10 +2,10 @@ export { default as QuickQuote } from "./app/QuickQuote";
2
2
  export type { QuickQuoteProps } from "./app/QuickQuote";
3
3
  export { default as EstimatingTools } from "./app/EstimatingTools";
4
4
  export type { EstimatingToolsProps } from "./app/EstimatingTools";
5
- export { QuoteProvider } from "./lib/QuoteProvider";
6
- export type { QuoteConfig } from "./lib/config";
7
- export { STEP_EVENT, DATALAYER_EVENT } from "./lib/analytics";
8
- export type { Step, WidgetEvent, WidgetName } from "./lib/analytics";
5
+ export { QuoteProvider } from "./util/QuoteProvider";
6
+ export type { QuoteConfig } from "./util/config";
7
+ export { STEP_EVENT, DATALAYER_EVENT } from "./util/analytics";
8
+ export type { Step, WidgetEvent, WidgetName } from "./util/analytics";
9
9
  export { ESTIMATOR_TOOLS } from "./components/estimators/registry";
10
10
  export type { EstimatorToolId } from "./components/estimators/registry";
11
- export type { EstimatorRequirement } from "./lib/estimators/types";
11
+ export type { EstimatorRequirement } from "./util/estimators/types";
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // Public surface of @metron-labs/quote-react.
2
2
  //
3
3
  // Metron's own staff screens also deep-import internals such as
4
- // "@metron-labs/quote-react/lib/formatters" through the "./*" export in package.json.
4
+ // "@metron-labs/quote-react/util/formatters" through the "./*" export in package.json.
5
5
  export { default as QuickQuote } from "./app/QuickQuote";
6
6
  export { default as EstimatingTools } from "./app/EstimatingTools";
7
- export { QuoteProvider } from "./lib/QuoteProvider";
8
- export { STEP_EVENT, DATALAYER_EVENT } from "./lib/analytics";
7
+ export { QuoteProvider } from "./util/QuoteProvider";
8
+ export { STEP_EVENT, DATALAYER_EVENT } from "./util/analytics";
9
9
  export { ESTIMATOR_TOOLS } from "./components/estimators/registry";
@@ -1,4 +1,4 @@
1
- import type { PhotoExtractedLine, ScheduleResult } from "../../util/types";
1
+ import type { PhotoExtractedLine, ScheduleResult } from "../types";
2
2
  export interface ScheduleJobStatus {
3
3
  status: "pending" | "processing" | "completed" | "failed";
4
4
  result: ScheduleResult | null;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import type { CartItem } from "../../util/types";
2
+ import type { CartItem } from "../types";
3
3
  interface CartApi {
4
4
  cart: Record<string, CartItem>;
5
5
  count: number;
@@ -10,7 +10,6 @@ interface CartApi {
10
10
  updateCartSellUnits: (lineId: string, sellUnitsOverride: number) => void;
11
11
  updateCartConversions: (conversions: Record<string, Partial<CartItem>>) => void;
12
12
  clearCart: () => void;
13
- /** Show the basket. Each app decides what that means for its own navigation. */
14
13
  openBasket: () => void;
15
14
  }
16
15
  /** The inputs that can change a conversion, including the selected parent of a dependent line. */
@@ -1,4 +1,4 @@
1
- import type { CartItem, MatchCandidate } from "../../util/types";
1
+ import type { CartItem, MatchCandidate } from "../types";
2
2
  /**
3
3
  * Flattens a catalogue candidate's nested `conversion` block onto a CartItem, which
4
4
  * util/pricing.ts reads to derive sell units. Extracted from ScheduleResultsStage so
@@ -1,4 +1,4 @@
1
- import type { MatchCandidate } from "../../util/types";
1
+ import type { MatchCandidate } from "../types";
2
2
  /**
3
3
  * The unit to ask the basket for, given the product chosen for an estimator line. Only for
4
4
  * estimator lines: a customer's "3 rolls" matched to a 2-roll pack is a different question.
@@ -1,4 +1,4 @@
1
- import type { MatchCandidate } from "../../util/types";
1
+ import type { MatchCandidate } from "../types";
2
2
  import type { EstimatorToolId } from "../../components/estimators/registry";
3
3
  import type { EstimatorRequirement } from "./types";
4
4
  export interface ResolvedRequirement {
@@ -1,4 +1,4 @@
1
- import { unitDisplayText } from "../app/components/UnitDisplay";
1
+ import { unitDisplayText } from "../components/unit/UnitDisplay";
2
2
  import { getPricingBreakdown } from "./pricing";
3
3
  // xlsx is several hundred KB and only needed on download, so it loads on first use.
4
4
  const loadXlsx = () => import("xlsx");
@@ -95,7 +95,10 @@ export async function exportScheduleExcel(rows) {
95
95
  totalRow[0] = "Estimated total";
96
96
  totalRow[TOTAL_COL] = grandTotal;
97
97
  wsData.push(totalRow);
98
- wsData.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.", ...Array(HEADER.length - 1).fill(null)]);
98
+ wsData.push([
99
+ "DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",
100
+ ...Array(HEADER.length - 1).fill(null),
101
+ ]);
99
102
  const ws = XLSX.utils.aoa_to_sheet(wsData);
100
103
  ws["!cols"] = [
101
104
  { wch: 12 },
@@ -130,7 +133,18 @@ export async function exportScheduleExcel(rows) {
130
133
  XLSX.utils.book_append_sheet(wb, ws, "Schedule match");
131
134
  XLSX.writeFile(wb, `schedule-quote-${dateStr}.xlsx`);
132
135
  }
133
- const BASKET_HEADER = ["Product ID", "Description", "Costing mode", "Required amount", "Req unit", "Sell unit size", "Sell unit", "Required sell units", "Unit price", "Line total"];
136
+ const BASKET_HEADER = [
137
+ "Product ID",
138
+ "Description",
139
+ "Costing mode",
140
+ "Required amount",
141
+ "Req unit",
142
+ "Sell unit size",
143
+ "Sell unit",
144
+ "Required sell units",
145
+ "Unit price",
146
+ "Line total",
147
+ ];
134
148
  /** Basket has its own (much smaller) row shape than the full schedule match, so it gets its own export rather than forcing CartItem into ScheduleExportRow. */
135
149
  export async function exportBasketExcel(items, account) {
136
150
  const XLSX = await loadXlsx();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metron-labs/quote-react",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "description": "Metron Labs quote and estimating calculator components for React",
5
5
  "license": "UNLICENSED",
6
6
  "sideEffects": [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes