@tscircuit/runframe 0.0.413 → 0.0.415
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.
|
@@ -1092,7 +1092,7 @@ var RenderLogViewer = ({
|
|
|
1092
1092
|
};
|
|
1093
1093
|
|
|
1094
1094
|
// package.json
|
|
1095
|
-
var version = "0.0.
|
|
1095
|
+
var version = "0.0.414";
|
|
1096
1096
|
|
|
1097
1097
|
// lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
|
|
1098
1098
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -1726,8 +1726,8 @@ function VendorQuoteCard({
|
|
|
1726
1726
|
vendor,
|
|
1727
1727
|
isActive,
|
|
1728
1728
|
onSelect,
|
|
1729
|
-
|
|
1730
|
-
|
|
1729
|
+
selectedShippingCarrier,
|
|
1730
|
+
onSelectShippingCarrier
|
|
1731
1731
|
}) {
|
|
1732
1732
|
return /* @__PURE__ */ jsxs14(
|
|
1733
1733
|
"div",
|
|
@@ -1761,11 +1761,11 @@ function VendorQuoteCard({
|
|
|
1761
1761
|
type: "button",
|
|
1762
1762
|
className: cn(
|
|
1763
1763
|
"rf-flex rf-items-center rf-gap-2 rf-px-4 rf-py-2 rf-rounded-lg rf-border rf-shadow rf-min-w-[148px] rf-transition-colors",
|
|
1764
|
-
|
|
1764
|
+
selectedShippingCarrier === ship.carrier ? "rf-border-blue-600 rf-bg-blue-50 rf-ring-2 rf-ring-blue-500" : "rf-border-gray-300 rf-bg-gray-50 hover:rf-border-blue-300"
|
|
1765
1765
|
),
|
|
1766
1766
|
onClick: (e) => {
|
|
1767
1767
|
e.stopPropagation();
|
|
1768
|
-
|
|
1768
|
+
onSelectShippingCarrier(ship.carrier);
|
|
1769
1769
|
},
|
|
1770
1770
|
children: [
|
|
1771
1771
|
/* @__PURE__ */ jsx18(Truck, { className: "rf-w-5 rf-h-5 rf-text-yellow-500" }),
|
|
@@ -1779,14 +1779,14 @@ function VendorQuoteCard({
|
|
|
1779
1779
|
)) })
|
|
1780
1780
|
] })
|
|
1781
1781
|
] }),
|
|
1782
|
-
isActive &&
|
|
1782
|
+
isActive && selectedShippingCarrier !== null && /* @__PURE__ */ jsx18("div", { className: "rf-px-6 rf-pb-3", children: /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-justify-between rf-items-center rf-mt-2", children: [
|
|
1783
1783
|
/* @__PURE__ */ jsx18("span", { className: "rf-text-gray-800 rf-font-medium rf-text-sm", children: "Total (incl. shipping):" }),
|
|
1784
1784
|
/* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
|
|
1785
1785
|
/* @__PURE__ */ jsxs14("span", { className: "rf-text-gray-400 rf-line-through rf-text-sm rf-mr-2", children: [
|
|
1786
1786
|
"($",
|
|
1787
1787
|
vendor.total_cost_without_shipping.toFixed(2),
|
|
1788
1788
|
" + $",
|
|
1789
|
-
vendor.shipping_options
|
|
1789
|
+
vendor.shipping_options.find((ship) => ship.carrier === selectedShippingCarrier)?.cost.toFixed(2),
|
|
1790
1790
|
")"
|
|
1791
1791
|
] }),
|
|
1792
1792
|
/* @__PURE__ */ jsx18("span", { className: "rf-font-bold rf-text-xl rf-text-blue-600", children: "$50.00" })
|
|
@@ -1908,9 +1908,7 @@ var InitialOrderScreen = ({
|
|
|
1908
1908
|
const [selectedVendorIdx, setSelectedVendorIdx] = useState6(
|
|
1909
1909
|
null
|
|
1910
1910
|
);
|
|
1911
|
-
const [
|
|
1912
|
-
null
|
|
1913
|
-
);
|
|
1911
|
+
const [selectedShippingCarrier, setSelectedShippingCarrier] = useState6(null);
|
|
1914
1912
|
const {
|
|
1915
1913
|
mutate: createOrderQuote2,
|
|
1916
1914
|
data: orderQuoteId,
|
|
@@ -1922,10 +1920,10 @@ var InitialOrderScreen = ({
|
|
|
1922
1920
|
const stripeCheckoutBaseUrl = getWindowVar(
|
|
1923
1921
|
"TSCIRCUIT_STRIPE_CHECKOUT_BASE_URL"
|
|
1924
1922
|
);
|
|
1925
|
-
window.location.href = `${stripeCheckoutBaseUrl}?client_reference_id=${orderQuoteId2}`;
|
|
1923
|
+
window.location.href = `${stripeCheckoutBaseUrl}?client_reference_id=${orderQuoteId2}&shipping_option=${selectedShippingCarrier}`;
|
|
1926
1924
|
};
|
|
1927
1925
|
useEffect3(() => {
|
|
1928
|
-
|
|
1926
|
+
setSelectedShippingCarrier(null);
|
|
1929
1927
|
}, [selectedVendorIdx]);
|
|
1930
1928
|
useEffect3(() => {
|
|
1931
1929
|
createOrderQuote2();
|
|
@@ -1933,8 +1931,8 @@ var InitialOrderScreen = ({
|
|
|
1933
1931
|
return /* @__PURE__ */ jsxs15("div", { className: "rf-max-w-lg rf-mx-auto rf-bg-white rf-rounded-2xl rf-p-8 rf-flex rf-flex-col rf-gap-3", children: [
|
|
1934
1932
|
/* @__PURE__ */ jsx19("h2", { className: "rf-text-3xl rf-font-bold rf-text-center rf-mb-8", children: "Order PCB" }),
|
|
1935
1933
|
/* @__PURE__ */ jsx19("div", { className: "rf-mb-4 rf-text-gray-700 rf-text-center", children: "Select a quote from below, then pick a shipping method." }),
|
|
1936
|
-
!orderQuoteId && !isError && /* @__PURE__ */ jsx19(LoadingMessage, { message: "Fetching quotes..." }),
|
|
1937
|
-
(createOrderQuoteError || orderQuote?.error) && /* @__PURE__ */ jsx19(
|
|
1934
|
+
(!orderQuoteId || !orderQuote || !orderQuote?.is_completed) && !isError && /* @__PURE__ */ jsx19(LoadingMessage, { message: "Fetching quotes..." }),
|
|
1935
|
+
(createOrderQuoteError || orderQuote?.error || isError) && /* @__PURE__ */ jsx19(
|
|
1938
1936
|
ErrorMessage,
|
|
1939
1937
|
{
|
|
1940
1938
|
message: createOrderQuoteError?.message || orderQuote?.error?.message || "Failed to fetch quotes"
|
|
@@ -1946,8 +1944,8 @@ var InitialOrderScreen = ({
|
|
|
1946
1944
|
vendor: orderQuote,
|
|
1947
1945
|
isActive: selectedVendorIdx === 0,
|
|
1948
1946
|
onSelect: () => setSelectedVendorIdx(0),
|
|
1949
|
-
|
|
1950
|
-
|
|
1947
|
+
selectedShippingCarrier: selectedVendorIdx === 0 ? selectedShippingCarrier : null,
|
|
1948
|
+
onSelectShippingCarrier: setSelectedShippingCarrier
|
|
1951
1949
|
},
|
|
1952
1950
|
orderQuote?.order_quote_id
|
|
1953
1951
|
),
|
package/dist/preview.js
CHANGED
package/dist/runner.js
CHANGED