@metron-labs/quote-react 0.1.50 → 0.1.52
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/app/EstimatingTools.js +1 -1
- package/dist/app/stages/ScheduleResultsStage.js +3 -3
- package/dist/embed/quote.js +188 -21
- package/dist/styles.css +176 -9
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ function EstimatingToolsInner({ fullPage = false, hideHeader = false, internal =
|
|
|
46
46
|
else
|
|
47
47
|
setReview(requirements);
|
|
48
48
|
};
|
|
49
|
-
return (_jsx(TrackContext.Provider, { value: track, children: _jsx("div", { ref: rootRef, className: `app-wrapper${fullPage ? "" : " app-wrapper--embedded"}${hideHeader ? " app-wrapper--no-header" : ""}`, style: getQuoteConfig().theme, children: _jsx("main", { className: "main-content", children: showBasket ? (_jsx(BasketStage, { cart: cart, onUpdateQty: updateCartQty, onUpdateSellUnits: updateCartSellUnits, onResolveConversions: updateCartConversions, onRemove: removeFromCart, onBack: () => onShowBasket(false), onStartNewQuote: () => {
|
|
49
|
+
return (_jsx(TrackContext.Provider, { value: track, children: _jsx("div", { ref: rootRef, className: `app-wrapper${fullPage ? "" : " app-wrapper--embedded"}${hideHeader ? " app-wrapper--no-header" : ""}${internal ? "" : " estimating-tools--customer"}`, style: getQuoteConfig().theme, children: _jsx("main", { className: "main-content", children: showBasket ? (_jsx(BasketStage, { cart: cart, onUpdateQty: updateCartQty, onUpdateSellUnits: updateCartSellUnits, onResolveConversions: updateCartConversions, onRemove: removeFromCart, onBack: () => onShowBasket(false), onStartNewQuote: () => {
|
|
50
50
|
clearCart();
|
|
51
51
|
setActiveEstimatorId(null);
|
|
52
52
|
setReview(null);
|
|
@@ -290,7 +290,7 @@ function AdjudicationDebugBlock({ result }) {
|
|
|
290
290
|
function DetailedDecision({ item, decision, result, showRetrievalDebug, reviewOnly = false, linkedGroupMeta, }) {
|
|
291
291
|
if (!decision)
|
|
292
292
|
return null;
|
|
293
|
-
const reviewLabel = decision.technical_classification === "no_suitable_candidate" ? "
|
|
293
|
+
const reviewLabel = decision.technical_classification === "no_suitable_candidate" ? "No automatic match:" : `AI review (${decision.confidence ?? "confidence not stated"}):`;
|
|
294
294
|
if (reviewOnly) {
|
|
295
295
|
return decision.reason ? (_jsxs("div", { className: "results-detail-block", children: [_jsxs("p", { className: `basket-calc-text basket-calc-text--review`, children: [_jsx("strong", { children: reviewLabel }), "\u00A0", decision.reason] }), hasVisibleLinkedGroup(item) ? (_jsxs("p", { className: "results-row-meta", style: { marginTop: 8 }, children: ["Linked context: ", linkedGroupMeta ? `Link ${linkedGroupMeta.token} - ` : "", linkedGroupSummary(item)] })) : null] })) : null;
|
|
296
296
|
}
|
|
@@ -717,9 +717,9 @@ export default function ScheduleResultsStage({ scheduleResult, onStartOver, cart
|
|
|
717
717
|
saveSearchCandidate(activeReviewRow.item.line_id, activeReviewRow.best);
|
|
718
718
|
onAddToCart(toCartItem(activeReviewRow));
|
|
719
719
|
}
|
|
720
|
-
}, disabled: !activeReviewRow.best, "aria-label": cart[activeReviewRow.item.line_id] ? (internal ? "Remove from selection" : `Remove from ${customerCollection}`) : internal ? "Add to selection" : `Add to ${customerCollection}`, children: cart[activeReviewRow.item.line_id] ? "✓ Added" : internal ? "+ Add to selection" : `Add to ${customerCollection}` }) })] })] }), catalogueSearchLoading ? _jsx("div", { className: "results-empty-card", children: "Searching catalogue\u2026" }) : null, !catalogueSearchLoading && catalogueSearchError ? _jsx("div", { className: "results-empty-card", children: catalogueSearchError }) : null, !catalogueSearchLoading && !catalogueSearchError && reviewQuery && reviewCandidates.length === 0 ? (_jsx("div", { className: "results-empty-card", children: "No candidate products match this database search." })) : !catalogueSearchLoading && !catalogueSearchError ? (_jsx(CandidateBreakdown, { item: activeReviewRow.item, candidates: reviewCandidates, result: activeReviewRow.result, decision: activeReviewRow.decision, unmatchable: activeReviewRow.unmatchable, selectedProductId: activeReviewRow.best?.product_id ?? null, detailMode: detailMode, linkedGroupMeta: hasVisibleLinkedGroup(activeReviewRow.item) ? linkedGroupMetaById.get(activeReviewRow.item.linked_group_id) : undefined, onPick: (candidate) => handlePickProduct(activeReviewRow.item.line_id, candidate), onClear: () => clearPickedProduct(activeReviewRow.item.line_id), showAll: internal || debugEnabled || reviewQuery.length > 0, internal: internal, debugEnabled: debugEnabled, forceReviewNote: true })) : null] })) : (_jsxs(_Fragment, { children: [_jsxs("section", { className: "customer-review-request", children: [_jsx("span", { className: "customer-review-eyebrow", children: "Original request" }), _jsx("strong", { children: displayLineLabel(activeReviewRow.item, lineItems) || "Original request" })] }), activeReviewReason ? (_jsxs("section", { className: "customer-review-ai", children: [_jsx("strong", { children: hasNoSuitableCandidate ? "
|
|
720
|
+
}, disabled: !activeReviewRow.best, "aria-label": cart[activeReviewRow.item.line_id] ? (internal ? "Remove from selection" : `Remove from ${customerCollection}`) : internal ? "Add to selection" : `Add to ${customerCollection}`, children: cart[activeReviewRow.item.line_id] ? "✓ Added" : internal ? "+ Add to selection" : `Add to ${customerCollection}` }) })] })] }), catalogueSearchLoading ? _jsx("div", { className: "results-empty-card", children: "Searching catalogue\u2026" }) : null, !catalogueSearchLoading && catalogueSearchError ? _jsx("div", { className: "results-empty-card", children: catalogueSearchError }) : null, !catalogueSearchLoading && !catalogueSearchError && reviewQuery && reviewCandidates.length === 0 ? (_jsx("div", { className: "results-empty-card", children: "No candidate products match this database search." })) : !catalogueSearchLoading && !catalogueSearchError ? (_jsx(CandidateBreakdown, { item: activeReviewRow.item, candidates: reviewCandidates, result: activeReviewRow.result, decision: activeReviewRow.decision, unmatchable: activeReviewRow.unmatchable, selectedProductId: activeReviewRow.best?.product_id ?? null, detailMode: detailMode, linkedGroupMeta: hasVisibleLinkedGroup(activeReviewRow.item) ? linkedGroupMetaById.get(activeReviewRow.item.linked_group_id) : undefined, onPick: (candidate) => handlePickProduct(activeReviewRow.item.line_id, candidate), onClear: () => clearPickedProduct(activeReviewRow.item.line_id), showAll: internal || debugEnabled || reviewQuery.length > 0, internal: internal, debugEnabled: debugEnabled, forceReviewNote: true })) : null] })) : (_jsxs(_Fragment, { children: [_jsxs("section", { className: "customer-review-request", children: [_jsx("span", { className: "customer-review-eyebrow", children: "Original request" }), _jsx("strong", { children: displayLineLabel(activeReviewRow.item, lineItems) || "Original request" })] }), activeReviewReason ? (_jsxs("section", { className: "customer-review-ai", children: [_jsx("strong", { children: hasNoSuitableCandidate ? "No automatic match:" : "AI review:" }), " ", activeReviewReason] })) : null, _jsxs("section", { className: "customer-review-options", children: [_jsx("div", { className: "customer-review-options__head", children: _jsxs("div", { children: [_jsx("h2", { children: hasNoSuitableCandidate ? (llmReviewCandidates.length > 0 ? "Choose a product" : "No suitable product found") : hasAiVerdict ? "Choose a product" : "We couldn't review this item" }), _jsx("p", { children: hasNoSuitableCandidate
|
|
721
721
|
? llmReviewCandidates.length > 0
|
|
722
|
-
? "
|
|
722
|
+
? "No product was selected automatically. Review these related options before adding one."
|
|
723
723
|
: "Search the catalogue to choose an alternative."
|
|
724
724
|
: hasAiVerdict
|
|
725
725
|
? `Select the option you want to add to your ${customerCollection}.`
|