@40rty/ams-ui 0.3.2 → 0.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/agent.js +5 -5
- package/dist/{chunk-MHUEIBJ3.js → chunk-GQURT3IR.js} +3 -47
- package/dist/{chunk-BFZ3YCUY.js → chunk-H6MSAD5M.js} +1 -40
- package/dist/{chunk-ORIOBWTD.js → chunk-PHXP2SKS.js} +5 -1
- package/dist/{chunk-OKP7MC72.js → chunk-RKPDCXL4.js} +241 -195
- package/dist/{chunk-TEPH476O.js → chunk-RMJDSHLA.js} +6 -36
- package/dist/hooks.js +4 -4
- package/dist/index.js +172 -338
- package/dist/presence.js +3 -4
- package/dist/shell.js +419 -570
- package/dist/thread-panel.js +3 -3
- package/dist/types/agent/presence/AgentAsk.d.ts +13 -0
- package/dist/types/agent/presence/index.d.ts +3 -1
- package/dist/types/agent/presence/read-data.d.ts +5 -0
- package/dist/types/components/ecommerce/cart/CartFoot.d.ts +1 -2
- package/dist/types/components/ecommerce/cart/CartLineRow.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/labels.d.ts +6 -0
- package/dist/types/shell/Composer.d.ts +1 -1
- package/dist/types/shell/ShellScaffold.d.ts +2 -1
- package/dist/types/shell/TurnAsk.d.ts +14 -0
- package/dist/types/shell/composer/AttachmentStrip.d.ts +1 -1
- package/dist/types/shell/dock-context.d.ts +1 -1
- package/dist/types/shell/index.d.ts +2 -2
- package/dist/types/shell/mobile/IslandComposeGroup.d.ts +1 -1
- package/dist/types/shell/mobile/IslandInputBar.d.ts +1 -1
- package/dist/types/shell/mobile/MorphIsland.d.ts +1 -1
- package/dist/types/shell/mobile/RestIsland.d.ts +1 -1
- package/dist/types/shell/slots.d.ts +1 -5
- package/package.json +3 -4
- package/dist/types/agent/presence/use-forget-fact.d.ts +0 -56
- package/dist/types/components/ecommerce/cart/use-cart-view.d.ts +0 -50
- package/dist/types/hooks/use-projection.d.ts +0 -24
- package/dist/types/shell/composer/heic-convert.d.ts +0 -6
- package/dist/types/shell/composer/useComposerAttachments.d.ts +0 -37
- package/dist/types/shell/composer/usePromptComposer.d.ts +0 -51
- package/dist/types/shell/use-dock-state.d.ts +0 -54
- package/dist/types/utils/use-is-seed-home.d.ts +0 -13
- package/dist/types/utils/use-safe-cart.d.ts +0 -17
- package/dist/types/utils/use-safe-facts.d.ts +0 -9
- package/dist/types/utils/use-safe-fourty-session.d.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -41,12 +41,12 @@ import {
|
|
|
41
41
|
registerDefaultPresenceForms,
|
|
42
42
|
useLabels,
|
|
43
43
|
useMeasuredHeight
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-RKPDCXL4.js";
|
|
45
45
|
import {
|
|
46
46
|
readFacts,
|
|
47
47
|
readLabel,
|
|
48
48
|
useVisibleFacts
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-RMJDSHLA.js";
|
|
50
50
|
import {
|
|
51
51
|
AnimatePresence,
|
|
52
52
|
Reveal,
|
|
@@ -55,9 +55,8 @@ import {
|
|
|
55
55
|
} from "./chunk-432XYPDT.js";
|
|
56
56
|
import {
|
|
57
57
|
useContainerWidth,
|
|
58
|
-
useFocusTrap
|
|
59
|
-
|
|
60
|
-
} from "./chunk-MHUEIBJ3.js";
|
|
58
|
+
useFocusTrap
|
|
59
|
+
} from "./chunk-GQURT3IR.js";
|
|
61
60
|
|
|
62
61
|
// src/catalog.ts
|
|
63
62
|
import { adaptComponent, adaptCatalogComponent, buildComponentLibrary } from "@40rty/ams-sdk";
|
|
@@ -582,7 +581,7 @@ import React9 from "react";
|
|
|
582
581
|
// src/components/ecommerce/product/ProductCard.tsx
|
|
583
582
|
import React8 from "react";
|
|
584
583
|
import { Slot } from "@radix-ui/react-slot";
|
|
585
|
-
import { useAddToCart,
|
|
584
|
+
import { useAddToCart, useCommerceActions } from "@40rty/ams-sdk";
|
|
586
585
|
|
|
587
586
|
// src/components/ecommerce/product/ProductPrice.tsx
|
|
588
587
|
import React3 from "react";
|
|
@@ -1037,7 +1036,7 @@ var ProductCard = React8.forwardRef(
|
|
|
1037
1036
|
const resolvedVendor = vendor ?? product?.vendor;
|
|
1038
1037
|
const resolvedAvailable = availableForSale ?? product?.availableForSale ?? true;
|
|
1039
1038
|
const resolvedProductId = product?.id;
|
|
1040
|
-
const actions =
|
|
1039
|
+
const actions = useCommerceActions();
|
|
1041
1040
|
const labels = useLabels();
|
|
1042
1041
|
const { addToCart, added, available: cartAvailable } = useAddToCart(
|
|
1043
1042
|
product?.variants?.[0]?.id,
|
|
@@ -1441,52 +1440,8 @@ function Reviews(props) {
|
|
|
1441
1440
|
import { ProductSchema } from "@40rty/ams-sdk";
|
|
1442
1441
|
import { useAddToCart as useAddToCart2, useToggleWishlist, formatVariantValue, useOptimisticFactOverlay, PRESENCE_OPTIMISTIC_FACTS_FLOW, PRODUCT_SELECT_OPTION_SIGNAL, SELECTION_ORIGIN_VISITOR, buildOptimisticCartLine } from "@40rty/ams-sdk";
|
|
1443
1442
|
import { resolveProductVariant } from "@40rty/ams-sdk";
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
import { useFourtySession } from "@40rty/ams-sdk";
|
|
1447
|
-
import { useWishlist } from "@40rty/ams-sdk";
|
|
1448
|
-
var warnedSession = false;
|
|
1449
|
-
var warnedWishlist = false;
|
|
1450
|
-
function warnOnce(flag, err) {
|
|
1451
|
-
if (typeof window === "undefined") return;
|
|
1452
|
-
const fired = flag === "session" ? warnedSession : warnedWishlist;
|
|
1453
|
-
if (fired) return;
|
|
1454
|
-
if (flag === "session") warnedSession = true;
|
|
1455
|
-
else warnedWishlist = true;
|
|
1456
|
-
console.warn(
|
|
1457
|
-
`[fourty-ui] ${flag} hook called outside <FourtyProvider> \u2014 rendering null. Wrap the tree in a provider for live behavior.`,
|
|
1458
|
-
err
|
|
1459
|
-
);
|
|
1460
|
-
}
|
|
1461
|
-
function useSafeFourtySession() {
|
|
1462
|
-
try {
|
|
1463
|
-
return useFourtySession();
|
|
1464
|
-
} catch (err) {
|
|
1465
|
-
warnOnce("session", err);
|
|
1466
|
-
return null;
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
// src/utils/use-safe-facts.ts
|
|
1471
|
-
import { useFacts } from "@40rty/ams-sdk";
|
|
1472
|
-
var warned = false;
|
|
1473
|
-
function warnOnce2(err) {
|
|
1474
|
-
if (typeof window === "undefined") return;
|
|
1475
|
-
if (warned) return;
|
|
1476
|
-
warned = true;
|
|
1477
|
-
console.warn(
|
|
1478
|
-
"[fourty-ui] useFacts called outside <FourtyProvider> \u2014 returning {}. Wrap the tree in a provider for live visitor-fact reads.",
|
|
1479
|
-
err
|
|
1480
|
-
);
|
|
1481
|
-
}
|
|
1482
|
-
function useSafeFacts() {
|
|
1483
|
-
try {
|
|
1484
|
-
return useFacts();
|
|
1485
|
-
} catch (err) {
|
|
1486
|
-
warnOnce2(err);
|
|
1487
|
-
return {};
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1443
|
+
import { useProjection } from "@40rty/ams-sdk";
|
|
1444
|
+
import { useOptionalFourtySession, useSafeFacts } from "@40rty/ams-sdk";
|
|
1490
1445
|
|
|
1491
1446
|
// src/utils/sanitize-html.ts
|
|
1492
1447
|
import DOMPurify from "isomorphic-dompurify";
|
|
@@ -1551,7 +1506,7 @@ function ProductDetail(props) {
|
|
|
1551
1506
|
parsed = r.success ? r.data : void 0;
|
|
1552
1507
|
}
|
|
1553
1508
|
const facts = useSafeFacts();
|
|
1554
|
-
const session =
|
|
1509
|
+
const session = useOptionalFourtySession();
|
|
1555
1510
|
const optimisticFacts = useOptimisticFactOverlay(PRESENCE_OPTIMISTIC_FACTS_FLOW);
|
|
1556
1511
|
const variants3 = parsed !== void 0 ? parsed.variants : [];
|
|
1557
1512
|
const [variantSelection, setVariantSelection] = React11.useState(
|
|
@@ -1801,7 +1756,7 @@ function ProductDetail(props) {
|
|
|
1801
1756
|
|
|
1802
1757
|
// src/components/ecommerce/product/ComparisonTable.tsx
|
|
1803
1758
|
import React13 from "react";
|
|
1804
|
-
import { pickCartAddAction, useCanvasActions as
|
|
1759
|
+
import { pickCartAddAction, useCanvasActions, useCommerceActions as useCommerceActions2, useHydrationState as useHydrationState3, hasProse as hasProse4 } from "@40rty/ams-sdk";
|
|
1805
1760
|
|
|
1806
1761
|
// src/components/SkeletonSwap.tsx
|
|
1807
1762
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
@@ -1996,12 +1951,13 @@ var ComparisonTable = React13.forwardRef(
|
|
|
1996
1951
|
const products = Array.isArray(productsProp) ? productsProp.filter((p) => p !== null && p !== void 0 && typeof p === "object") : [];
|
|
1997
1952
|
const rows = Array.isArray(rowsProp) ? rowsProp : void 0;
|
|
1998
1953
|
const recommend = highlightedProductId !== void 0 ? products.findIndex((p) => p.id === highlightedProductId) : -1;
|
|
1999
|
-
const actions =
|
|
1954
|
+
const actions = useCanvasActions();
|
|
1955
|
+
const commerce = useCommerceActions2();
|
|
2000
1956
|
const { loading: showSkeleton } = useHydrationState3();
|
|
2001
1957
|
const onHeadClick = React13.useCallback((p) => {
|
|
2002
|
-
if (!
|
|
2003
|
-
|
|
2004
|
-
}, [
|
|
1958
|
+
if (!commerce || !p.id) return;
|
|
1959
|
+
commerce.navigateToProduct(p.id, p.title);
|
|
1960
|
+
}, [commerce]);
|
|
2005
1961
|
const onAddToBag = React13.useCallback((p) => {
|
|
2006
1962
|
if (!actions || !p.id) return;
|
|
2007
1963
|
actions.dispatchAction(pickCartAddAction(p, "visitor"));
|
|
@@ -2241,7 +2197,7 @@ UgcGallery.displayName = "UgcGallery";
|
|
|
2241
2197
|
|
|
2242
2198
|
// src/components/content/article/BlogPosts.tsx
|
|
2243
2199
|
import { motion as motion5 } from "framer-motion";
|
|
2244
|
-
import { useAction as useAction2,
|
|
2200
|
+
import { useAction as useAction2, useContentActions, hasProse as hasProse5 } from "@40rty/ams-sdk";
|
|
2245
2201
|
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2246
2202
|
function isHydratedArticle(item) {
|
|
2247
2203
|
if (typeof item !== "object" || item === null) return false;
|
|
@@ -2265,7 +2221,7 @@ function BlogPosts({
|
|
|
2265
2221
|
posts: postsProp
|
|
2266
2222
|
}) {
|
|
2267
2223
|
const onMore = useAction2(moreLabel, moreAction);
|
|
2268
|
-
const actions =
|
|
2224
|
+
const actions = useContentActions();
|
|
2269
2225
|
const onArticleClick = (article) => {
|
|
2270
2226
|
if (actions === null) return void 0;
|
|
2271
2227
|
return () => {
|
|
@@ -3290,7 +3246,7 @@ var componentMap = {
|
|
|
3290
3246
|
productGrid: adaptComponent(ProductGrid),
|
|
3291
3247
|
// Interaction contract (proof adoption): props are type-locked to
|
|
3292
3248
|
// `comparisonTableProps` — a callback prop would be a compile error. Actions
|
|
3293
|
-
// come from `useCanvasActions` inside the component, never a prop. See
|
|
3249
|
+
// come from `useCanvasActions` / `useCommerceActions` inside the component, never a prop. See
|
|
3294
3250
|
// docs/architecture-invariants.md §IV.5.
|
|
3295
3251
|
comparisonTable: adaptCatalogComponent(comparisonTableProps, ComparisonTable),
|
|
3296
3252
|
productDetail: ProductDetail,
|
|
@@ -3309,7 +3265,7 @@ var components = buildComponentLibrary(catalog, componentMap);
|
|
|
3309
3265
|
import * as React23 from "react";
|
|
3310
3266
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3311
3267
|
import { AnimatePresence as AnimatePresence3, motion as motion9 } from "framer-motion";
|
|
3312
|
-
import { useTurn, useStream, useDisplayedLayout, useFourtySession
|
|
3268
|
+
import { useTurn, useStream, useDisplayedLayout, useFourtySession, useReasoning, useShellRoot as useShellRoot2 } from "@40rty/ams-sdk";
|
|
3313
3269
|
|
|
3314
3270
|
// src/components/feedback/Thinking.tsx
|
|
3315
3271
|
import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
@@ -3388,7 +3344,7 @@ function PendingTurn() {
|
|
|
3388
3344
|
const prose = useStream("prose");
|
|
3389
3345
|
const layout = useDisplayedLayout();
|
|
3390
3346
|
const portalTarget = useActivePendingTarget();
|
|
3391
|
-
const { currentProgress } =
|
|
3347
|
+
const { currentProgress } = useFourtySession();
|
|
3392
3348
|
const reasoning = useReasoning();
|
|
3393
3349
|
const latestBeat = reasoning.length > 0 ? reasoning[reasoning.length - 1] : null;
|
|
3394
3350
|
const phaseLabel = defaultPhaseLabel(currentProgress);
|
|
@@ -3467,7 +3423,7 @@ function PendingTurn() {
|
|
|
3467
3423
|
}
|
|
3468
3424
|
|
|
3469
3425
|
// src/components/shell/ShellTop.tsx
|
|
3470
|
-
import * as
|
|
3426
|
+
import * as React29 from "react";
|
|
3471
3427
|
|
|
3472
3428
|
// src/components/shell/BaseMark.tsx
|
|
3473
3429
|
import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
@@ -3495,13 +3451,13 @@ function ShellMark({ name }) {
|
|
|
3495
3451
|
|
|
3496
3452
|
// src/components/shell/HistoryMenu.tsx
|
|
3497
3453
|
import * as React24 from "react";
|
|
3498
|
-
import { useConversationMessages, useCurrentMessageIndex, useSelectMessage, useFourtySession as
|
|
3454
|
+
import { useConversationMessages, useCurrentMessageIndex, useSelectMessage, useFourtySession as useFourtySession2 } from "@40rty/ams-sdk";
|
|
3499
3455
|
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3500
3456
|
function HistoryMenu() {
|
|
3501
3457
|
const messages = useConversationMessages();
|
|
3502
3458
|
const currentIndex = useCurrentMessageIndex();
|
|
3503
3459
|
const selectMessage = useSelectMessage();
|
|
3504
|
-
const { clearSession } =
|
|
3460
|
+
const { clearSession } = useFourtySession2();
|
|
3505
3461
|
const [open, setOpen] = React24.useState(false);
|
|
3506
3462
|
const containerRef = React24.useRef(null);
|
|
3507
3463
|
React24.useEffect(() => {
|
|
@@ -3694,43 +3650,12 @@ function MenuButton({ primary = [], secondary = [], bottomLink, legal = [], onSe
|
|
|
3694
3650
|
}
|
|
3695
3651
|
|
|
3696
3652
|
// src/components/shell/CartPill.tsx
|
|
3697
|
-
import * as
|
|
3653
|
+
import * as React28 from "react";
|
|
3698
3654
|
import { createPortal as createPortal3 } from "react-dom";
|
|
3699
|
-
import { useShellRoot as useShellRoot3 } from "@40rty/ams-sdk";
|
|
3700
|
-
|
|
3701
|
-
// src/utils/use-safe-cart.ts
|
|
3702
|
-
import { useCart } from "@40rty/ams-sdk";
|
|
3703
|
-
var warnedCart = false;
|
|
3704
|
-
function useSafeCart() {
|
|
3705
|
-
try {
|
|
3706
|
-
const c = useCart();
|
|
3707
|
-
return {
|
|
3708
|
-
cart: c.cart,
|
|
3709
|
-
totalQuantity: c.totalQuantity,
|
|
3710
|
-
updateLine: c.updateLine,
|
|
3711
|
-
// The SECOND place the drawer's actor is bound (the other is the SDK's
|
|
3712
|
-
// `use-cart-drawer`). A brand's dumb cart markup gets `removeLine` as a
|
|
3713
|
-
// one-argument callback — §IV.6: a catalog component takes DATA, never a
|
|
3714
|
-
// provenance argument it would have to invent — so the actor is bound here,
|
|
3715
|
-
// where "the visitor tapped remove in the drawer" is still known. The
|
|
3716
|
-
// facade's parameter stays REQUIRED, so a future caller that forgets it is
|
|
3717
|
-
// a compile error, not a silent "the agent did it".
|
|
3718
|
-
removeLine: (lineId) => c.removeLine(lineId, "visitor"),
|
|
3719
|
-
applyDiscountCode: c.applyDiscountCode,
|
|
3720
|
-
removeDiscountCode: c.removeDiscountCode,
|
|
3721
|
-
isDiscountPending: c.isDiscountPending
|
|
3722
|
-
};
|
|
3723
|
-
} catch (err) {
|
|
3724
|
-
if (typeof window !== "undefined" && !warnedCart) {
|
|
3725
|
-
warnedCart = true;
|
|
3726
|
-
console.warn("[fourty-ui] useCart called outside <CommerceProvider> \u2014 bag UI rendering disabled.", err);
|
|
3727
|
-
}
|
|
3728
|
-
return null;
|
|
3729
|
-
}
|
|
3730
|
-
}
|
|
3655
|
+
import { useSafeCart, useShellRoot as useShellRoot3 } from "@40rty/ams-sdk";
|
|
3731
3656
|
|
|
3732
3657
|
// src/components/ecommerce/cart/CartDrawer.tsx
|
|
3733
|
-
import
|
|
3658
|
+
import React27 from "react";
|
|
3734
3659
|
import { AnimatePresence as AnimatePresence6, motion as motion12 } from "framer-motion";
|
|
3735
3660
|
|
|
3736
3661
|
// src/components/ecommerce/cart/CartContent.tsx
|
|
@@ -4082,87 +4007,8 @@ function ExitSpinner() {
|
|
|
4082
4007
|
);
|
|
4083
4008
|
}
|
|
4084
4009
|
|
|
4085
|
-
// src/components/ecommerce/cart/use-cart-view.ts
|
|
4086
|
-
import React27 from "react";
|
|
4087
|
-
import {
|
|
4088
|
-
navigateToExternalCommerceUrl,
|
|
4089
|
-
recordVisitorCheckoutExit,
|
|
4090
|
-
isPendingCartLine
|
|
4091
|
-
} from "@40rty/ams-sdk";
|
|
4092
|
-
import { useOptionalAnalyticsSink } from "@40rty/ams-sdk";
|
|
4093
|
-
function useCartView(cart, onCheckout) {
|
|
4094
|
-
const analytics = useOptionalAnalyticsSink();
|
|
4095
|
-
const [exitPending, setExitPending] = React27.useState(null);
|
|
4096
|
-
const lines = cart === null ? [] : cart.lines;
|
|
4097
|
-
const count = lines.reduce((sum, l) => sum + l.quantity, 0);
|
|
4098
|
-
const totalsPending = lines.some((l) => isPendingCartLine(l));
|
|
4099
|
-
const subtotal = cart === null ? 0 : cart.subtotal.amount;
|
|
4100
|
-
const currency = cart === null ? "USD" : cart.subtotal.currencyCode;
|
|
4101
|
-
const discountCodes = cart === null ? [] : cart.discountCodes;
|
|
4102
|
-
const backendTotal = cart !== null && cart.total !== void 0 ? cart.total.amount : void 0;
|
|
4103
|
-
const discountAmount = backendTotal !== void 0 && backendTotal < subtotal ? subtotal - backendTotal : 0;
|
|
4104
|
-
const effectiveTotal = backendTotal !== void 0 ? backendTotal : subtotal;
|
|
4105
|
-
const navigateToExit = React27.useCallback((url, kind) => {
|
|
4106
|
-
const result = navigateToExternalCommerceUrl(url);
|
|
4107
|
-
if (kind === "checkout") recordVisitorCheckoutExit(analytics, result);
|
|
4108
|
-
if (result === "new-tab") {
|
|
4109
|
-
window.setTimeout(() => setExitPending(null), 600);
|
|
4110
|
-
return;
|
|
4111
|
-
}
|
|
4112
|
-
if (result === "blocked") {
|
|
4113
|
-
console.warn(`[useCartView] the browser blocked the ${kind} tab \u2014 the visitor stayed put`);
|
|
4114
|
-
setExitPending(null);
|
|
4115
|
-
return;
|
|
4116
|
-
}
|
|
4117
|
-
if (result === "no-url") {
|
|
4118
|
-
console.warn(`[useCartView] no ${kind} URL on cart \u2014 exit dropped`);
|
|
4119
|
-
setExitPending(null);
|
|
4120
|
-
}
|
|
4121
|
-
}, [analytics]);
|
|
4122
|
-
const handleCheckout = React27.useCallback(() => {
|
|
4123
|
-
if (lines.length === 0 || exitPending !== null) return;
|
|
4124
|
-
setExitPending("checkout");
|
|
4125
|
-
if (onCheckout) {
|
|
4126
|
-
try {
|
|
4127
|
-
const result = onCheckout();
|
|
4128
|
-
if (result instanceof Promise) {
|
|
4129
|
-
result.catch((err) => {
|
|
4130
|
-
console.warn("[useCartView] onCheckout failed:", err);
|
|
4131
|
-
setExitPending(null);
|
|
4132
|
-
});
|
|
4133
|
-
}
|
|
4134
|
-
} catch (err) {
|
|
4135
|
-
console.warn("[useCartView] onCheckout threw:", err);
|
|
4136
|
-
setExitPending(null);
|
|
4137
|
-
}
|
|
4138
|
-
return;
|
|
4139
|
-
}
|
|
4140
|
-
navigateToExit(cart?.checkoutUrl, "checkout");
|
|
4141
|
-
}, [lines.length, exitPending, onCheckout, cart, navigateToExit]);
|
|
4142
|
-
const handleGoToStore = React27.useCallback(() => {
|
|
4143
|
-
if (lines.length === 0 || exitPending !== null) return;
|
|
4144
|
-
setExitPending("store");
|
|
4145
|
-
navigateToExit(cart?.storeCartUrl, "store");
|
|
4146
|
-
}, [lines.length, exitPending, cart, navigateToExit]);
|
|
4147
|
-
const storeCartUrl = cart && typeof cart.storeCartUrl === "string" && cart.storeCartUrl.length > 0 ? cart.storeCartUrl : void 0;
|
|
4148
|
-
return {
|
|
4149
|
-
lines,
|
|
4150
|
-
count,
|
|
4151
|
-
subtotal,
|
|
4152
|
-
totalsPending,
|
|
4153
|
-
currency,
|
|
4154
|
-
discountCodes,
|
|
4155
|
-
backendTotal,
|
|
4156
|
-
discountAmount,
|
|
4157
|
-
effectiveTotal,
|
|
4158
|
-
exitPending,
|
|
4159
|
-
storeCartUrl,
|
|
4160
|
-
handleCheckout,
|
|
4161
|
-
handleGoToStore
|
|
4162
|
-
};
|
|
4163
|
-
}
|
|
4164
|
-
|
|
4165
4010
|
// src/components/ecommerce/cart/CartContent.tsx
|
|
4011
|
+
import { useCartView } from "@40rty/ams-sdk";
|
|
4166
4012
|
import { Fragment as Fragment7, jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4167
4013
|
function CartContent({
|
|
4168
4014
|
cart,
|
|
@@ -4261,7 +4107,7 @@ function CartDrawer({
|
|
|
4261
4107
|
discountPending,
|
|
4262
4108
|
renderContent
|
|
4263
4109
|
}) {
|
|
4264
|
-
const asideRef =
|
|
4110
|
+
const asideRef = React27.useRef(null);
|
|
4265
4111
|
useFocusTrap(asideRef, open);
|
|
4266
4112
|
const contentProps = {
|
|
4267
4113
|
cart,
|
|
@@ -4318,7 +4164,7 @@ function BagIcon() {
|
|
|
4318
4164
|
function CartPill() {
|
|
4319
4165
|
const cart = useSafeCart();
|
|
4320
4166
|
const shellRoot = useShellRoot3();
|
|
4321
|
-
const [open, setOpen] =
|
|
4167
|
+
const [open, setOpen] = React28.useState(false);
|
|
4322
4168
|
const drawer = cart ? /* @__PURE__ */ jsx51(
|
|
4323
4169
|
CartDrawer,
|
|
4324
4170
|
{
|
|
@@ -4354,7 +4200,7 @@ function CartPill() {
|
|
|
4354
4200
|
// src/components/shell/ShellTop.tsx
|
|
4355
4201
|
import { jsx as jsx52, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4356
4202
|
function ShellTop({ wordmark, mark, menuPrimary, menuSecondary, menuBottomLink, menuLegal, onLogoClick, onMenuItemSelect }) {
|
|
4357
|
-
const handleLogoClick =
|
|
4203
|
+
const handleLogoClick = React29.useCallback((e) => {
|
|
4358
4204
|
e.preventDefault();
|
|
4359
4205
|
onLogoClick();
|
|
4360
4206
|
}, [onLogoClick]);
|
|
@@ -4381,71 +4227,53 @@ function ShellTop({ wordmark, mark, menuPrimary, menuSecondary, menuBottomLink,
|
|
|
4381
4227
|
}
|
|
4382
4228
|
|
|
4383
4229
|
// src/components/shell/ComposerDock.tsx
|
|
4384
|
-
import * as
|
|
4230
|
+
import * as React31 from "react";
|
|
4385
4231
|
import { createPortal as createPortal4 } from "react-dom";
|
|
4386
4232
|
import { AnimatePresence as AnimatePresence7, motion as motion13 } from "framer-motion";
|
|
4387
|
-
import { useAgentDriven, useFourtySession as
|
|
4233
|
+
import { useAgentDriven, useComposerDraft, useFourtySession as useFourtySession3, useHistoryNav, useCanvasBack, useDisplayedLayout as useDisplayedLayout2, useConversationMessages as useConversationMessages2, usePendingMessage, useCurrentMessageIndex as useCurrentMessageIndex2, useSelectMessage as useSelectMessage2, useTurn as useTurn2, useStream as useStream2, useShellRoot as useShellRoot4, ThreadHeadroom, usePinTurnToTop, useThreadLanding, threadRowAttrs, useSafeCart as useSafeCart2 } from "@40rty/ams-sdk";
|
|
4388
4234
|
|
|
4389
4235
|
// src/utils/use-composer-mode.tsx
|
|
4390
|
-
import * as
|
|
4236
|
+
import * as React30 from "react";
|
|
4391
4237
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
4392
|
-
var ComposerModeContext =
|
|
4238
|
+
var ComposerModeContext = React30.createContext(null);
|
|
4393
4239
|
function ComposerModeProvider({
|
|
4394
4240
|
children,
|
|
4395
4241
|
defaultMode,
|
|
4396
4242
|
lock = false
|
|
4397
4243
|
}) {
|
|
4398
4244
|
const fallback = defaultMode !== void 0 ? defaultMode : "bottom";
|
|
4399
|
-
const [mode, setModeState] =
|
|
4245
|
+
const [mode, setModeState] = React30.useState(() => {
|
|
4400
4246
|
if (lock) return fallback;
|
|
4401
4247
|
if (typeof window === "undefined") return fallback;
|
|
4402
4248
|
const v = window.localStorage.getItem("fourty-composer-mode");
|
|
4403
4249
|
if (v === "side" || v === "bottom") return v;
|
|
4404
4250
|
return fallback;
|
|
4405
4251
|
});
|
|
4406
|
-
const setMode =
|
|
4252
|
+
const setMode = React30.useCallback((next) => {
|
|
4407
4253
|
if (lock) return;
|
|
4408
4254
|
setModeState(next);
|
|
4409
4255
|
if (typeof window !== "undefined") {
|
|
4410
4256
|
window.localStorage.setItem("fourty-composer-mode", next);
|
|
4411
4257
|
}
|
|
4412
4258
|
}, [lock]);
|
|
4413
|
-
const value =
|
|
4259
|
+
const value = React30.useMemo(() => ({ mode, setMode }), [mode, setMode]);
|
|
4414
4260
|
return /* @__PURE__ */ jsx53(ComposerModeContext.Provider, { value, children });
|
|
4415
4261
|
}
|
|
4416
4262
|
function useComposerMode() {
|
|
4417
|
-
const ctx =
|
|
4263
|
+
const ctx = React30.useContext(ComposerModeContext);
|
|
4418
4264
|
if (!ctx) {
|
|
4419
4265
|
throw new Error("useComposerMode() called outside <ComposerModeProvider>");
|
|
4420
4266
|
}
|
|
4421
4267
|
return ctx;
|
|
4422
4268
|
}
|
|
4423
4269
|
|
|
4424
|
-
// src/utils/use-is-seed-home.ts
|
|
4425
|
-
import * as React32 from "react";
|
|
4426
|
-
import { useDisplayedLayout as useDisplayedLayout2, useTurn as useTurn2, useSessionState } from "@40rty/ams-sdk";
|
|
4427
|
-
function useIsSeedHome() {
|
|
4428
|
-
const layout = useDisplayedLayout2();
|
|
4429
|
-
const turn = useTurn2();
|
|
4430
|
-
const sessionState = useSessionState();
|
|
4431
|
-
return React32.useMemo(() => {
|
|
4432
|
-
if (sessionState.seedLayout === null) return false;
|
|
4433
|
-
if (turn.index !== 0) return false;
|
|
4434
|
-
if (turn.userMessage !== "") return false;
|
|
4435
|
-
try {
|
|
4436
|
-
return JSON.stringify(layout) === JSON.stringify(sessionState.seedLayout);
|
|
4437
|
-
} catch {
|
|
4438
|
-
return false;
|
|
4439
|
-
}
|
|
4440
|
-
}, [layout, sessionState.seedLayout, turn.index, turn.userMessage]);
|
|
4441
|
-
}
|
|
4442
|
-
|
|
4443
4270
|
// src/components/shell/ComposerDock.tsx
|
|
4271
|
+
import { useIsSeedHome } from "@40rty/ams-sdk";
|
|
4444
4272
|
import { jsx as jsx54, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4445
4273
|
function useHeroSlot(active) {
|
|
4446
4274
|
const shellRoot = useShellRoot4();
|
|
4447
|
-
const [el, setEl] =
|
|
4448
|
-
|
|
4275
|
+
const [el, setEl] = React31.useState(null);
|
|
4276
|
+
React31.useEffect(() => {
|
|
4449
4277
|
if (!active) {
|
|
4450
4278
|
setEl(null);
|
|
4451
4279
|
return;
|
|
@@ -4465,10 +4293,10 @@ function useHeroSlot(active) {
|
|
|
4465
4293
|
}
|
|
4466
4294
|
function useScrollState({ agentDriven, autoOpen }) {
|
|
4467
4295
|
const shellRoot = useShellRoot4();
|
|
4468
|
-
const [collapsed, setCollapsed] =
|
|
4469
|
-
const [manualOpen, setManualOpen] =
|
|
4470
|
-
const [manualCollapsed, setManualCollapsed] =
|
|
4471
|
-
|
|
4296
|
+
const [collapsed, setCollapsed] = React31.useState(false);
|
|
4297
|
+
const [manualOpen, setManualOpen] = React31.useState(false);
|
|
4298
|
+
const [manualCollapsed, setManualCollapsed] = React31.useState(false);
|
|
4299
|
+
React31.useEffect(() => {
|
|
4472
4300
|
const scope = shellRoot !== null ? shellRoot : document;
|
|
4473
4301
|
const wrap = scope.querySelector(".canvas-wrap");
|
|
4474
4302
|
if (!wrap) return;
|
|
@@ -4490,11 +4318,11 @@ function useScrollState({ agentDriven, autoOpen }) {
|
|
|
4490
4318
|
if (raf) cancelAnimationFrame(raf);
|
|
4491
4319
|
};
|
|
4492
4320
|
}, [manualOpen, manualCollapsed, shellRoot]);
|
|
4493
|
-
const setManualOpenWrapped =
|
|
4321
|
+
const setManualOpenWrapped = React31.useCallback((v) => {
|
|
4494
4322
|
setManualOpen(v);
|
|
4495
4323
|
if (v) setManualCollapsed(false);
|
|
4496
4324
|
}, []);
|
|
4497
|
-
const collapseNow =
|
|
4325
|
+
const collapseNow = React31.useCallback(() => {
|
|
4498
4326
|
setManualCollapsed(true);
|
|
4499
4327
|
setManualOpen(false);
|
|
4500
4328
|
setCollapsed(true);
|
|
@@ -4523,15 +4351,15 @@ var OPTIMISTIC_CHIP_TYPES = /* @__PURE__ */ new Set([
|
|
|
4523
4351
|
"wishlist.toggle"
|
|
4524
4352
|
]);
|
|
4525
4353
|
function ComposerDock({ onChipSelect }) {
|
|
4526
|
-
const [value, setValue] =
|
|
4527
|
-
const session =
|
|
4354
|
+
const [value, setValue] = useComposerDraft();
|
|
4355
|
+
const session = useFourtySession3();
|
|
4528
4356
|
const { sendMessage, isRunning, stopGeneration } = session;
|
|
4529
4357
|
const { canGoBack, goBack } = useCanvasBack();
|
|
4530
4358
|
const { totalTurns } = useHistoryNav();
|
|
4531
|
-
const layout =
|
|
4359
|
+
const layout = useDisplayedLayout2();
|
|
4532
4360
|
const actions = useStream2("actions");
|
|
4533
|
-
const [pendingChipId, setPendingChipId] =
|
|
4534
|
-
const turn =
|
|
4361
|
+
const [pendingChipId, setPendingChipId] = React31.useState(null);
|
|
4362
|
+
const turn = useTurn2();
|
|
4535
4363
|
const pageEl = layout?.root ? layout.elements?.[layout.root] : void 0;
|
|
4536
4364
|
const layoutPlacement = (() => {
|
|
4537
4365
|
const v = pageEl?.props?.composerPlacement;
|
|
@@ -4549,21 +4377,21 @@ function ComposerDock({ onChipSelect }) {
|
|
|
4549
4377
|
else placement = "docked";
|
|
4550
4378
|
const isHero = placement === "hero";
|
|
4551
4379
|
const heroSlot = useHeroSlot(isHero);
|
|
4552
|
-
|
|
4380
|
+
React31.useEffect(() => {
|
|
4553
4381
|
setPendingChipId(null);
|
|
4554
4382
|
}, [turn.index]);
|
|
4555
4383
|
const autoOpen = isRunning && !agentDriven || value.length > 0;
|
|
4556
4384
|
const { collapsed, setManualOpen, collapseNow } = useScrollState({ agentDriven, autoOpen });
|
|
4557
|
-
const inputRef =
|
|
4558
|
-
const [hoverOpen, setHoverOpen] =
|
|
4559
|
-
const hoverTimerRef =
|
|
4560
|
-
const clearHoverTimer =
|
|
4385
|
+
const inputRef = React31.useRef(null);
|
|
4386
|
+
const [hoverOpen, setHoverOpen] = React31.useState(false);
|
|
4387
|
+
const hoverTimerRef = React31.useRef(null);
|
|
4388
|
+
const clearHoverTimer = React31.useCallback(() => {
|
|
4561
4389
|
if (hoverTimerRef.current !== null) {
|
|
4562
4390
|
clearTimeout(hoverTimerRef.current);
|
|
4563
4391
|
hoverTimerRef.current = null;
|
|
4564
4392
|
}
|
|
4565
4393
|
}, []);
|
|
4566
|
-
const onHoverEnter =
|
|
4394
|
+
const onHoverEnter = React31.useCallback(() => {
|
|
4567
4395
|
if (mode !== "bottom" || isHero) return;
|
|
4568
4396
|
clearHoverTimer();
|
|
4569
4397
|
hoverTimerRef.current = setTimeout(() => {
|
|
@@ -4571,19 +4399,19 @@ function ComposerDock({ onChipSelect }) {
|
|
|
4571
4399
|
setHoverOpen(true);
|
|
4572
4400
|
}, 80);
|
|
4573
4401
|
}, [mode, isHero, clearHoverTimer]);
|
|
4574
|
-
const onHoverLeave =
|
|
4402
|
+
const onHoverLeave = React31.useCallback(() => {
|
|
4575
4403
|
clearHoverTimer();
|
|
4576
4404
|
hoverTimerRef.current = setTimeout(() => {
|
|
4577
4405
|
hoverTimerRef.current = null;
|
|
4578
4406
|
setHoverOpen(false);
|
|
4579
4407
|
}, 140);
|
|
4580
4408
|
}, [clearHoverTimer]);
|
|
4581
|
-
|
|
4409
|
+
React31.useEffect(() => () => {
|
|
4582
4410
|
clearHoverTimer();
|
|
4583
4411
|
}, [clearHoverTimer]);
|
|
4584
4412
|
const effectiveCollapsed = collapsed && !hoverOpen;
|
|
4585
4413
|
const foldedToBubble = effectiveCollapsed && !isHero && (mode === "bottom" || agentDriven);
|
|
4586
|
-
const onSubmit =
|
|
4414
|
+
const onSubmit = React31.useCallback(
|
|
4587
4415
|
(e) => {
|
|
4588
4416
|
e.preventDefault();
|
|
4589
4417
|
const text = value.trim();
|
|
@@ -4591,7 +4419,7 @@ function ComposerDock({ onChipSelect }) {
|
|
|
4591
4419
|
sendMessage(text);
|
|
4592
4420
|
setValue("");
|
|
4593
4421
|
},
|
|
4594
|
-
[value, sendMessage]
|
|
4422
|
+
[value, sendMessage, setValue]
|
|
4595
4423
|
);
|
|
4596
4424
|
const labels = useLabels();
|
|
4597
4425
|
const placeholder = totalTurns === 0 ? labels.chat.placeholder : labels.chat.placeholderFollowUp;
|
|
@@ -4741,16 +4569,16 @@ function SideChatHistory({ onClose }) {
|
|
|
4741
4569
|
const pending = usePendingMessage();
|
|
4742
4570
|
const currentIndex = useCurrentMessageIndex2();
|
|
4743
4571
|
const selectMessage = useSelectMessage2();
|
|
4744
|
-
const liveLayout =
|
|
4745
|
-
const scrollerRef =
|
|
4746
|
-
const pendingRowRef =
|
|
4572
|
+
const liveLayout = useDisplayedLayout2();
|
|
4573
|
+
const scrollerRef = React31.useRef(null);
|
|
4574
|
+
const pendingRowRef = React31.useRef(null);
|
|
4747
4575
|
usePinTurnToTop({
|
|
4748
4576
|
scrollerRef,
|
|
4749
4577
|
turnRef: pendingRowRef,
|
|
4750
4578
|
turnId: pending === null ? null : pending.messageId
|
|
4751
4579
|
});
|
|
4752
|
-
const [scrollerEl, setScrollerEl] =
|
|
4753
|
-
const attachScroller =
|
|
4580
|
+
const [scrollerEl, setScrollerEl] = React31.useState(null);
|
|
4581
|
+
const attachScroller = React31.useCallback((el) => {
|
|
4754
4582
|
scrollerRef.current = el;
|
|
4755
4583
|
setScrollerEl(el);
|
|
4756
4584
|
}, []);
|
|
@@ -4779,8 +4607,8 @@ function SideChatHistoryView({
|
|
|
4779
4607
|
attachScroller,
|
|
4780
4608
|
pendingRowRef
|
|
4781
4609
|
}) {
|
|
4782
|
-
const [view, setView] =
|
|
4783
|
-
const cart =
|
|
4610
|
+
const [view, setView] = React31.useState("chat");
|
|
4611
|
+
const cart = useSafeCart2();
|
|
4784
4612
|
return /* @__PURE__ */ jsxs41("div", { className: "composer-side-wrap", children: [
|
|
4785
4613
|
/* @__PURE__ */ jsxs41("div", { className: "composer-side-header", children: [
|
|
4786
4614
|
/* @__PURE__ */ jsx54(
|
|
@@ -4908,7 +4736,7 @@ function extractAgentText(layout) {
|
|
|
4908
4736
|
}
|
|
4909
4737
|
return last.trim();
|
|
4910
4738
|
}
|
|
4911
|
-
var SideTurnRow =
|
|
4739
|
+
var SideTurnRow = React31.forwardRef(function SideTurnRow2({
|
|
4912
4740
|
rowKey,
|
|
4913
4741
|
userMessage,
|
|
4914
4742
|
prose,
|
|
@@ -4983,7 +4811,7 @@ function StopIcon() {
|
|
|
4983
4811
|
// src/components/shell/ErrorBanner.tsx
|
|
4984
4812
|
import { useEffect as useEffect6, useState as useState13 } from "react";
|
|
4985
4813
|
import { motion as motion14, AnimatePresence as AnimatePresence8 } from "framer-motion";
|
|
4986
|
-
import { useSessionState
|
|
4814
|
+
import { useSessionState, useFourtySession as useFourtySession4 } from "@40rty/ams-sdk";
|
|
4987
4815
|
import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4988
4816
|
var RECONNECT_CUE_DELAY_MS = 500;
|
|
4989
4817
|
function friendlyMessage(raw) {
|
|
@@ -4998,8 +4826,8 @@ function friendlyMessage(raw) {
|
|
|
4998
4826
|
return "Something went wrong on our end. Try again?";
|
|
4999
4827
|
}
|
|
5000
4828
|
function ErrorBanner() {
|
|
5001
|
-
const sessionState =
|
|
5002
|
-
const session =
|
|
4829
|
+
const sessionState = useSessionState();
|
|
4830
|
+
const session = useFourtySession4();
|
|
5003
4831
|
const error = sessionState.error;
|
|
5004
4832
|
const reconnecting = sessionState.reconnecting;
|
|
5005
4833
|
const lastUserMessage = (() => {
|
|
@@ -5098,6 +4926,9 @@ function parseBaseShell(raw) {
|
|
|
5098
4926
|
return parsed.data;
|
|
5099
4927
|
}
|
|
5100
4928
|
|
|
4929
|
+
// src/index.ts
|
|
4930
|
+
import { useIsSeedHome as useIsSeedHome2 } from "@40rty/ams-sdk";
|
|
4931
|
+
|
|
5101
4932
|
// src/utils/html-to-text.ts
|
|
5102
4933
|
import DOMPurify2 from "isomorphic-dompurify";
|
|
5103
4934
|
function htmlToText(html) {
|
|
@@ -5113,7 +4944,7 @@ function useReducedMotion2() {
|
|
|
5113
4944
|
}
|
|
5114
4945
|
|
|
5115
4946
|
// src/primitives/Button/index.tsx
|
|
5116
|
-
import
|
|
4947
|
+
import React32 from "react";
|
|
5117
4948
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
5118
4949
|
import { jsx as jsx56, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5119
4950
|
var variants2 = {
|
|
@@ -5153,7 +4984,7 @@ var hoverEffectOverrides = {
|
|
|
5153
4984
|
darken: { "--fourty-btn-hover-fill": "rgba(0, 0, 0, 0.15)", "--fourty-btn-hover-rest-y": "0%", "--fourty-btn-hover-rest-opacity": "0" },
|
|
5154
4985
|
wipeUp: { "--fourty-btn-hover-fill": "rgba(0, 0, 0, 0.15)", "--fourty-btn-hover-rest-y": "100%", "--fourty-btn-hover-rest-opacity": "1" }
|
|
5155
4986
|
};
|
|
5156
|
-
var Button =
|
|
4987
|
+
var Button = React32.forwardRef(
|
|
5157
4988
|
({ className, variant = "primary", size = "md", hoverEffect, asChild = false, children, style, ...props }, ref) => {
|
|
5158
4989
|
const sharedClassName = cn(
|
|
5159
4990
|
"group relative inline-flex items-center justify-center overflow-hidden font-medium",
|
|
@@ -5183,9 +5014,9 @@ var Button = React34.forwardRef(
|
|
|
5183
5014
|
Button.displayName = "Button";
|
|
5184
5015
|
|
|
5185
5016
|
// src/primitives/Skeleton/index.tsx
|
|
5186
|
-
import
|
|
5017
|
+
import React33 from "react";
|
|
5187
5018
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5188
|
-
var Skeleton2 =
|
|
5019
|
+
var Skeleton2 = React33.forwardRef(
|
|
5189
5020
|
({ className, ...props }, ref) => {
|
|
5190
5021
|
return /* @__PURE__ */ jsx57(
|
|
5191
5022
|
"div",
|
|
@@ -5203,9 +5034,9 @@ var Skeleton2 = React35.forwardRef(
|
|
|
5203
5034
|
Skeleton2.displayName = "Skeleton";
|
|
5204
5035
|
|
|
5205
5036
|
// src/primitives/Money/index.tsx
|
|
5206
|
-
import
|
|
5037
|
+
import React34 from "react";
|
|
5207
5038
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
5208
|
-
var Money =
|
|
5039
|
+
var Money = React34.forwardRef(
|
|
5209
5040
|
({ className, money, amount, currency = "USD", locale, ...props }, ref) => {
|
|
5210
5041
|
const moneyObj = money ?? { amount: amount ?? 0, currencyCode: currency };
|
|
5211
5042
|
return /* @__PURE__ */ jsx58("span", { ref, className: cn(className), ...props, children: formatMoney(moneyObj, locale) });
|
|
@@ -5214,9 +5045,9 @@ var Money = React36.forwardRef(
|
|
|
5214
5045
|
Money.displayName = "Money";
|
|
5215
5046
|
|
|
5216
5047
|
// src/primitives/Input/index.tsx
|
|
5217
|
-
import
|
|
5048
|
+
import React35 from "react";
|
|
5218
5049
|
import { jsx as jsx59, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
5219
|
-
var Input =
|
|
5050
|
+
var Input = React35.forwardRef(
|
|
5220
5051
|
({ className, label, required, id, ...props }, ref) => {
|
|
5221
5052
|
return /* @__PURE__ */ jsxs44("div", { className: "space-y-1.5", children: [
|
|
5222
5053
|
/* @__PURE__ */ jsxs44(
|
|
@@ -5254,9 +5085,9 @@ var Input = React37.forwardRef(
|
|
|
5254
5085
|
Input.displayName = "Input";
|
|
5255
5086
|
|
|
5256
5087
|
// src/primitives/Select/index.tsx
|
|
5257
|
-
import
|
|
5088
|
+
import React36 from "react";
|
|
5258
5089
|
import { jsx as jsx60, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
5259
|
-
var Select =
|
|
5090
|
+
var Select = React36.forwardRef(
|
|
5260
5091
|
({ className, label, required, id, children, ...props }, ref) => {
|
|
5261
5092
|
return /* @__PURE__ */ jsxs45("div", { className: "space-y-1.5", children: [
|
|
5262
5093
|
/* @__PURE__ */ jsxs45(
|
|
@@ -5294,7 +5125,7 @@ var Select = React38.forwardRef(
|
|
|
5294
5125
|
Select.displayName = "Select";
|
|
5295
5126
|
|
|
5296
5127
|
// src/components/layout/Grid.tsx
|
|
5297
|
-
import
|
|
5128
|
+
import React37 from "react";
|
|
5298
5129
|
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
5299
5130
|
var columnClasses = {
|
|
5300
5131
|
1: "grid-cols-1",
|
|
@@ -5310,7 +5141,7 @@ var gapClasses = {
|
|
|
5310
5141
|
md: "gap-4 md:gap-6",
|
|
5311
5142
|
lg: "gap-6 md:gap-8"
|
|
5312
5143
|
};
|
|
5313
|
-
var Grid =
|
|
5144
|
+
var Grid = React37.forwardRef(
|
|
5314
5145
|
({ className, columns = 4, gap = "md", ...props }, ref) => {
|
|
5315
5146
|
return /* @__PURE__ */ jsx61(
|
|
5316
5147
|
"div",
|
|
@@ -5325,7 +5156,7 @@ var Grid = React39.forwardRef(
|
|
|
5325
5156
|
Grid.displayName = "Grid";
|
|
5326
5157
|
|
|
5327
5158
|
// src/components/layout/Stack.tsx
|
|
5328
|
-
import
|
|
5159
|
+
import React38 from "react";
|
|
5329
5160
|
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5330
5161
|
var gapClasses2 = {
|
|
5331
5162
|
none: "gap-0",
|
|
@@ -5340,7 +5171,7 @@ var alignClasses2 = {
|
|
|
5340
5171
|
end: "items-end",
|
|
5341
5172
|
stretch: "items-stretch"
|
|
5342
5173
|
};
|
|
5343
|
-
var Stack =
|
|
5174
|
+
var Stack = React38.forwardRef(
|
|
5344
5175
|
({ className, direction = "vertical", gap = "md", align = "stretch", ...props }, ref) => {
|
|
5345
5176
|
return /* @__PURE__ */ jsx62(
|
|
5346
5177
|
"div",
|
|
@@ -5361,9 +5192,9 @@ var Stack = React40.forwardRef(
|
|
|
5361
5192
|
Stack.displayName = "Stack";
|
|
5362
5193
|
|
|
5363
5194
|
// src/components/layout/Divider.tsx
|
|
5364
|
-
import
|
|
5195
|
+
import React39 from "react";
|
|
5365
5196
|
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
5366
|
-
var Divider =
|
|
5197
|
+
var Divider = React39.forwardRef(
|
|
5367
5198
|
({ className, orientation = "horizontal", ...props }, ref) => {
|
|
5368
5199
|
return /* @__PURE__ */ jsx63(
|
|
5369
5200
|
"hr",
|
|
@@ -5382,9 +5213,9 @@ var Divider = React41.forwardRef(
|
|
|
5382
5213
|
Divider.displayName = "Divider";
|
|
5383
5214
|
|
|
5384
5215
|
// src/components/layout/AspectRatio.tsx
|
|
5385
|
-
import
|
|
5216
|
+
import React40 from "react";
|
|
5386
5217
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
5387
|
-
var AspectRatio =
|
|
5218
|
+
var AspectRatio = React40.forwardRef(
|
|
5388
5219
|
({ className, ratio = 1, style, children, ...props }, ref) => {
|
|
5389
5220
|
return /* @__PURE__ */ jsx64(
|
|
5390
5221
|
"div",
|
|
@@ -5401,10 +5232,10 @@ var AspectRatio = React42.forwardRef(
|
|
|
5401
5232
|
AspectRatio.displayName = "AspectRatio";
|
|
5402
5233
|
|
|
5403
5234
|
// src/components/layout/Drawer.tsx
|
|
5404
|
-
import
|
|
5235
|
+
import React41, { useEffect as useEffect7, useCallback as useCallback7 } from "react";
|
|
5405
5236
|
import { motion as motion15, AnimatePresence as AnimatePresence9 } from "framer-motion";
|
|
5406
5237
|
import { Fragment as Fragment10, jsx as jsx65, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5407
|
-
var Drawer =
|
|
5238
|
+
var Drawer = React41.forwardRef(
|
|
5408
5239
|
({ open, onClose, side = "right", className, children }, ref) => {
|
|
5409
5240
|
const handleKeyDown = useCallback7(
|
|
5410
5241
|
(e) => {
|
|
@@ -5467,7 +5298,7 @@ var Drawer = React43.forwardRef(
|
|
|
5467
5298
|
Drawer.displayName = "Drawer";
|
|
5468
5299
|
|
|
5469
5300
|
// src/components/layout/DrawerDockSlot.tsx
|
|
5470
|
-
import
|
|
5301
|
+
import React42 from "react";
|
|
5471
5302
|
import { useFormFactor } from "@40rty/ams-sdk";
|
|
5472
5303
|
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
5473
5304
|
function DrawerDockSlot({
|
|
@@ -5477,7 +5308,7 @@ function DrawerDockSlot({
|
|
|
5477
5308
|
zIndex = 60,
|
|
5478
5309
|
children
|
|
5479
5310
|
}) {
|
|
5480
|
-
const slotRef =
|
|
5311
|
+
const slotRef = React42.useRef(null);
|
|
5481
5312
|
useScrollLock(open, slotRef);
|
|
5482
5313
|
const { isMobile } = useFormFactor();
|
|
5483
5314
|
return /* @__PURE__ */ jsx66(
|
|
@@ -5501,7 +5332,7 @@ function DrawerDockSlot({
|
|
|
5501
5332
|
}
|
|
5502
5333
|
|
|
5503
5334
|
// src/components/layout/Modal.tsx
|
|
5504
|
-
import * as
|
|
5335
|
+
import * as React43 from "react";
|
|
5505
5336
|
import { createPortal as createPortal5 } from "react-dom";
|
|
5506
5337
|
import { motion as motion16, AnimatePresence as AnimatePresence10 } from "framer-motion";
|
|
5507
5338
|
import { useShellRoot as useShellRoot5, useFormFactor as useFormFactor2 } from "@40rty/ams-sdk";
|
|
@@ -5511,7 +5342,7 @@ var PANEL_CLASS = "fourty-modal-panel";
|
|
|
5511
5342
|
function Modal({ open, onClose, label, className, children }) {
|
|
5512
5343
|
const { isMobile } = useFormFactor2();
|
|
5513
5344
|
const shellRoot = useShellRoot5();
|
|
5514
|
-
const panelRef =
|
|
5345
|
+
const panelRef = React43.useRef(null);
|
|
5515
5346
|
useFocusTrap(panelRef, open && !isMobile);
|
|
5516
5347
|
if (isMobile) {
|
|
5517
5348
|
return /* @__PURE__ */ jsx67(DragSheet, { open, onClose, label, fit: true, className, children });
|
|
@@ -5570,8 +5401,8 @@ function AgentContinuationFoot() {
|
|
|
5570
5401
|
}
|
|
5571
5402
|
|
|
5572
5403
|
// src/components/browse/canvas-booting.ts
|
|
5573
|
-
import * as
|
|
5574
|
-
import { useDisplayedLayout as
|
|
5404
|
+
import * as React44 from "react";
|
|
5405
|
+
import { useDisplayedLayout as useDisplayedLayout3, useTurn as useTurn3, useFourtySession as useFourtySession5 } from "@40rty/ams-sdk";
|
|
5575
5406
|
function turnHasLanded(turn, layout) {
|
|
5576
5407
|
if (turn.turnId === void 0) return false;
|
|
5577
5408
|
return Object.values(layout.elements).some((el) => el.__turnId === turn.turnId);
|
|
@@ -5582,15 +5413,15 @@ function isCanvasBooting(turn, layout, isOpeningTurn) {
|
|
|
5582
5413
|
return !turnHasLanded(turn, layout);
|
|
5583
5414
|
}
|
|
5584
5415
|
function useCanvasBooting() {
|
|
5585
|
-
const layout =
|
|
5586
|
-
const turn =
|
|
5587
|
-
const { openingPrompt } =
|
|
5588
|
-
const openingTurnIndex =
|
|
5416
|
+
const layout = useDisplayedLayout3();
|
|
5417
|
+
const turn = useTurn3();
|
|
5418
|
+
const { openingPrompt } = useFourtySession5();
|
|
5419
|
+
const openingTurnIndex = React44.useRef(null);
|
|
5589
5420
|
if (openingTurnIndex.current === null && openingPrompt !== null && turn.status === "streaming" && turn.userMessage === openingPrompt) {
|
|
5590
5421
|
openingTurnIndex.current = turn.index;
|
|
5591
5422
|
}
|
|
5592
5423
|
const isOpeningTurn = openingTurnIndex.current === turn.index;
|
|
5593
|
-
return
|
|
5424
|
+
return React44.useMemo(
|
|
5594
5425
|
() => isCanvasBooting(turn, layout, isOpeningTurn),
|
|
5595
5426
|
[turn, layout, isOpeningTurn]
|
|
5596
5427
|
);
|
|
@@ -5708,9 +5539,9 @@ function HydratedProductRail({ entityIds, tileHeight = 52 }) {
|
|
|
5708
5539
|
}
|
|
5709
5540
|
|
|
5710
5541
|
// src/components/ecommerce/product/ProductOption.tsx
|
|
5711
|
-
import
|
|
5542
|
+
import React45 from "react";
|
|
5712
5543
|
import { jsx as jsx71, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5713
|
-
var ProductOption =
|
|
5544
|
+
var ProductOption = React45.forwardRef(
|
|
5714
5545
|
({ className, name, values: valuesProp, selected, required, onSelect, ...props }, ref) => {
|
|
5715
5546
|
const values = Array.isArray(valuesProp) ? valuesProp : [];
|
|
5716
5547
|
return /* @__PURE__ */ jsxs48("fieldset", { ref, className: cn("space-y-2", className), ...props, children: [
|
|
@@ -5737,9 +5568,9 @@ var ProductOption = React47.forwardRef(
|
|
|
5737
5568
|
ProductOption.displayName = "ProductOption";
|
|
5738
5569
|
|
|
5739
5570
|
// src/components/ecommerce/product/AddToRegistry.tsx
|
|
5740
|
-
import
|
|
5571
|
+
import React46 from "react";
|
|
5741
5572
|
import { motion as motion17, AnimatePresence as AnimatePresence11 } from "framer-motion";
|
|
5742
|
-
import { useOptionalAnalyticsSink
|
|
5573
|
+
import { useOptionalAnalyticsSink } from "@40rty/ams-sdk";
|
|
5743
5574
|
import { REGISTRY_CLICKED } from "@40rty/ams-sdk";
|
|
5744
5575
|
import { mintId } from "@40rty/ams-sdk";
|
|
5745
5576
|
|
|
@@ -5766,8 +5597,8 @@ function RegistryLogo({ id, label }) {
|
|
|
5766
5597
|
);
|
|
5767
5598
|
}
|
|
5768
5599
|
function AddToRegistry({ title = "Add to Registry", providers, productId }) {
|
|
5769
|
-
const [open, setOpen] =
|
|
5770
|
-
const analytics =
|
|
5600
|
+
const [open, setOpen] = React46.useState(false);
|
|
5601
|
+
const analytics = useOptionalAnalyticsSink();
|
|
5771
5602
|
const onProviderClick = (partnerId) => {
|
|
5772
5603
|
if (analytics === null) return;
|
|
5773
5604
|
analytics.emit(REGISTRY_CLICKED, {
|
|
@@ -5836,11 +5667,11 @@ function AddToRegistry({ title = "Add to Registry", providers, productId }) {
|
|
|
5836
5667
|
}
|
|
5837
5668
|
|
|
5838
5669
|
// src/components/ecommerce/cart/AddToCartButton.tsx
|
|
5839
|
-
import
|
|
5670
|
+
import React47, { useEffect as useEffect8, useRef as useRef8, useState as useState14, useCallback as useCallback8 } from "react";
|
|
5840
5671
|
import { AnimatePresence as AnimatePresence12, motion as motion18 } from "framer-motion";
|
|
5841
5672
|
import { Check as Check2, Loader2 } from "lucide-react";
|
|
5842
5673
|
import { jsx as jsx73, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5843
|
-
var AddToCartButton =
|
|
5674
|
+
var AddToCartButton = React47.forwardRef(
|
|
5844
5675
|
({ className, onAddToCart, addedLabel = "Added", addedDurationMs = 2e3, children = "Add to cart", disabled, ...props }, ref) => {
|
|
5845
5676
|
const [state, setState] = useState14("idle");
|
|
5846
5677
|
const revertTimerRef = useRef8(null);
|
|
@@ -5915,12 +5746,12 @@ var AddToCartButton = React49.forwardRef(
|
|
|
5915
5746
|
AddToCartButton.displayName = "AddToCartButton";
|
|
5916
5747
|
|
|
5917
5748
|
// src/components/ecommerce/cart/CartLineItem.tsx
|
|
5918
|
-
import
|
|
5749
|
+
import React48 from "react";
|
|
5919
5750
|
import { motion as motion19 } from "framer-motion";
|
|
5920
5751
|
import { Minus as Minus2, Plus as Plus3, Trash2 as Trash22 } from "lucide-react";
|
|
5921
5752
|
import { useCartLineRow as useCartLineRow2 } from "@40rty/ams-sdk";
|
|
5922
5753
|
import { jsx as jsx74, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5923
|
-
var CartLineItem =
|
|
5754
|
+
var CartLineItem = React48.forwardRef(
|
|
5924
5755
|
({ className, line, onUpdateQuantity, onRemove, onNavigate, ...props }, ref) => {
|
|
5925
5756
|
const labels = useLabels().cart;
|
|
5926
5757
|
const decDisabled = line.quantity <= 1;
|
|
@@ -6038,9 +5869,9 @@ var CartLineItem = React50.forwardRef(
|
|
|
6038
5869
|
CartLineItem.displayName = "CartLineItem";
|
|
6039
5870
|
|
|
6040
5871
|
// src/components/ecommerce/cart/CartSummary.tsx
|
|
6041
|
-
import
|
|
5872
|
+
import React49 from "react";
|
|
6042
5873
|
import { jsx as jsx75, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
6043
|
-
var CartSummary =
|
|
5874
|
+
var CartSummary = React49.forwardRef(
|
|
6044
5875
|
({ className, cart, onCheckout, ...props }, ref) => {
|
|
6045
5876
|
return /* @__PURE__ */ jsxs52(
|
|
6046
5877
|
"div",
|
|
@@ -6062,19 +5893,22 @@ var CartSummary = React51.forwardRef(
|
|
|
6062
5893
|
);
|
|
6063
5894
|
CartSummary.displayName = "CartSummary";
|
|
6064
5895
|
|
|
5896
|
+
// src/index.ts
|
|
5897
|
+
import { useCartView as useCartView2 } from "@40rty/ams-sdk";
|
|
5898
|
+
|
|
6065
5899
|
// src/components/ecommerce/cart/CartWidget.tsx
|
|
6066
|
-
import * as
|
|
5900
|
+
import * as React50 from "react";
|
|
6067
5901
|
import { createPortal as createPortal6 } from "react-dom";
|
|
6068
5902
|
import { ShoppingBag } from "lucide-react";
|
|
6069
|
-
import { useShellRoot as useShellRoot6 } from "@40rty/ams-sdk";
|
|
5903
|
+
import { useSafeCart as useSafeCart3, useShellRoot as useShellRoot6 } from "@40rty/ams-sdk";
|
|
6070
5904
|
import { Fragment as Fragment11, jsx as jsx76, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
6071
5905
|
function CartWidget() {
|
|
6072
|
-
const cart =
|
|
5906
|
+
const cart = useSafeCart3();
|
|
6073
5907
|
const shellRoot = useShellRoot6();
|
|
6074
|
-
const [open, setOpen] =
|
|
6075
|
-
const [bump, setBump] =
|
|
6076
|
-
const prevQtyRef =
|
|
6077
|
-
|
|
5908
|
+
const [open, setOpen] = React50.useState(false);
|
|
5909
|
+
const [bump, setBump] = React50.useState(false);
|
|
5910
|
+
const prevQtyRef = React50.useRef(0);
|
|
5911
|
+
React50.useEffect(() => {
|
|
6078
5912
|
if (!cart) return;
|
|
6079
5913
|
if (cart.totalQuantity > prevQtyRef.current) {
|
|
6080
5914
|
setBump(true);
|
|
@@ -6158,8 +5992,8 @@ function CartWidget() {
|
|
|
6158
5992
|
}
|
|
6159
5993
|
|
|
6160
5994
|
// src/components/ecommerce/cart/VariantPickerModal.tsx
|
|
6161
|
-
import * as
|
|
6162
|
-
import { CART_ADD_SIGNAL, useFourtySession as
|
|
5995
|
+
import * as React51 from "react";
|
|
5996
|
+
import { CART_ADD_SIGNAL, useFourtySession as useFourtySession6, useFacts } from "@40rty/ams-sdk";
|
|
6163
5997
|
import { usePendingVariantChoice, clearVariantChoice, PRODUCT_SELECT_OPTION_SIGNAL as PRODUCT_SELECT_OPTION_SIGNAL2, SELECTION_ORIGIN_VISITOR as SELECTION_ORIGIN_VISITOR2 } from "@40rty/ams-sdk";
|
|
6164
5998
|
import { resolveProductVariant as resolveProductVariant2, preselectFromFacts } from "@40rty/ams-sdk";
|
|
6165
5999
|
import { formatVariantValue as formatVariantValue2 } from "@40rty/ams-sdk";
|
|
@@ -6178,13 +6012,13 @@ function deriveHeader(choice) {
|
|
|
6178
6012
|
}
|
|
6179
6013
|
function VariantPickerModal() {
|
|
6180
6014
|
const labels = useLabels();
|
|
6181
|
-
const session =
|
|
6015
|
+
const session = useFourtySession6();
|
|
6182
6016
|
const choice = usePendingVariantChoice();
|
|
6183
|
-
const facts =
|
|
6184
|
-
const [selections, setSelections] =
|
|
6017
|
+
const facts = useFacts();
|
|
6018
|
+
const [selections, setSelections] = React51.useState({});
|
|
6185
6019
|
const productId = choice !== null ? choice.product.id : null;
|
|
6186
|
-
const touchedForProductRef =
|
|
6187
|
-
|
|
6020
|
+
const touchedForProductRef = React51.useRef(null);
|
|
6021
|
+
React51.useEffect(() => {
|
|
6188
6022
|
if (choice === null) {
|
|
6189
6023
|
setSelections({});
|
|
6190
6024
|
return;
|
|
@@ -6271,16 +6105,16 @@ function VariantPickerModal() {
|
|
|
6271
6105
|
}
|
|
6272
6106
|
|
|
6273
6107
|
// src/components/ecommerce/wishlist/WishlistDrawer.tsx
|
|
6274
|
-
import * as
|
|
6108
|
+
import * as React52 from "react";
|
|
6275
6109
|
import { AnimatePresence as AnimatePresence13, motion as motion20 } from "framer-motion";
|
|
6276
|
-
import { useProducts as useProducts2,
|
|
6110
|
+
import { useProducts as useProducts2, useCommerceActions as useCommerceActions3 } from "@40rty/ams-sdk";
|
|
6277
6111
|
import { Fragment as Fragment13, jsx as jsx78, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
6278
6112
|
function WishlistDrawer({ open, onClose, productIds, onRemove }) {
|
|
6279
|
-
const actions =
|
|
6113
|
+
const actions = useCommerceActions3();
|
|
6280
6114
|
const productsQuery = useProducts2(open ? productIds : []);
|
|
6281
6115
|
const products = productsQuery.data;
|
|
6282
6116
|
const count = productIds.length;
|
|
6283
|
-
const handleViewProduct =
|
|
6117
|
+
const handleViewProduct = React52.useCallback((productId, title) => {
|
|
6284
6118
|
if (!actions) return;
|
|
6285
6119
|
onClose();
|
|
6286
6120
|
actions.navigateToProduct(productId, title);
|
|
@@ -6370,7 +6204,7 @@ function WishlistRow({ product, onView, onRemove }) {
|
|
|
6370
6204
|
const brand = product.vendor;
|
|
6371
6205
|
const price = product.price;
|
|
6372
6206
|
const priceLabel = price && price.amount > 0 ? formatPrice2(price.amount, price.currencyCode) : "";
|
|
6373
|
-
const handleRemove =
|
|
6207
|
+
const handleRemove = React52.useCallback((e) => {
|
|
6374
6208
|
e.stopPropagation();
|
|
6375
6209
|
onRemove();
|
|
6376
6210
|
}, [onRemove]);
|
|
@@ -6447,28 +6281,28 @@ function formatPrice2(amount, currency) {
|
|
|
6447
6281
|
}
|
|
6448
6282
|
|
|
6449
6283
|
// src/components/ecommerce/collection/CollectionCard.tsx
|
|
6450
|
-
import
|
|
6284
|
+
import React53 from "react";
|
|
6451
6285
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
6452
|
-
import {
|
|
6286
|
+
import { useCommerceActions as useCommerceActions4 } from "@40rty/ams-sdk";
|
|
6453
6287
|
import { jsx as jsx79, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
6454
|
-
var CollectionCard =
|
|
6288
|
+
var CollectionCard = React53.forwardRef(
|
|
6455
6289
|
({ className, collection, title, imageSrc, imageAlt, asChild = false, onClick: onClickProp, ...props }, ref) => {
|
|
6456
6290
|
const resolvedTitle = title ? title : collection ? collection.title : "";
|
|
6457
6291
|
const resolvedImageSrc = imageSrc ? imageSrc : collection?.image?.url;
|
|
6458
6292
|
const resolvedImageAlt = imageAlt ? imageAlt : collection?.image?.altText ? collection.image.altText : resolvedTitle;
|
|
6459
|
-
const actions =
|
|
6460
|
-
const dispatchCollection =
|
|
6293
|
+
const actions = useCommerceActions4();
|
|
6294
|
+
const dispatchCollection = React53.useCallback(() => {
|
|
6461
6295
|
if (!actions || !resolvedTitle) return;
|
|
6462
6296
|
actions.showCollection(resolvedTitle);
|
|
6463
6297
|
}, [actions, resolvedTitle]);
|
|
6464
|
-
const handleClick =
|
|
6298
|
+
const handleClick = React53.useCallback((e) => {
|
|
6465
6299
|
if (onClickProp) onClickProp(e);
|
|
6466
6300
|
if (e.defaultPrevented) return;
|
|
6467
6301
|
dispatchCollection();
|
|
6468
6302
|
}, [onClickProp, dispatchCollection]);
|
|
6469
6303
|
const Comp = asChild ? Slot3 : "div";
|
|
6470
6304
|
const isClickable = !!actions && !!resolvedTitle;
|
|
6471
|
-
const handleKeyDown =
|
|
6305
|
+
const handleKeyDown = React53.useCallback((e) => {
|
|
6472
6306
|
if (!isClickable) return;
|
|
6473
6307
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
6474
6308
|
e.preventDefault();
|
|
@@ -6503,9 +6337,9 @@ var CollectionCard = React55.forwardRef(
|
|
|
6503
6337
|
CollectionCard.displayName = "CollectionCard";
|
|
6504
6338
|
|
|
6505
6339
|
// src/components/ecommerce/collection/CollectionGrid.tsx
|
|
6506
|
-
import
|
|
6340
|
+
import React54 from "react";
|
|
6507
6341
|
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
6508
|
-
var CollectionGrid =
|
|
6342
|
+
var CollectionGrid = React54.forwardRef(
|
|
6509
6343
|
({ className, collections, onCollectionClick, columns = 3, ...props }, ref) => {
|
|
6510
6344
|
return /* @__PURE__ */ jsx80(Grid, { ref, columns, className: cn(className), ...props, children: collections.map((collection) => /* @__PURE__ */ jsx80(
|
|
6511
6345
|
CollectionCard,
|
|
@@ -6521,7 +6355,7 @@ var CollectionGrid = React56.forwardRef(
|
|
|
6521
6355
|
CollectionGrid.displayName = "CollectionGrid";
|
|
6522
6356
|
|
|
6523
6357
|
// src/components/marketing/AnnouncementBar.tsx
|
|
6524
|
-
import
|
|
6358
|
+
import React55, { useState as useState17 } from "react";
|
|
6525
6359
|
|
|
6526
6360
|
// src/components/marketing/internal/AnnouncementMessage.tsx
|
|
6527
6361
|
import { useAction as useAction4 } from "@40rty/ams-sdk";
|
|
@@ -6566,7 +6400,7 @@ function AnnouncementLink({
|
|
|
6566
6400
|
|
|
6567
6401
|
// src/components/marketing/AnnouncementBar.tsx
|
|
6568
6402
|
import { Fragment as Fragment14, jsx as jsx83, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
6569
|
-
var AnnouncementBar =
|
|
6403
|
+
var AnnouncementBar = React55.forwardRef(
|
|
6570
6404
|
({ className, messages = [], links, dismissible = false, onDismiss, ...props }, ref) => {
|
|
6571
6405
|
const [activeIndex, setActiveIndex] = useState17(0);
|
|
6572
6406
|
const activeMessage = messages.length > 0 ? messages[activeIndex % messages.length] : void 0;
|
|
@@ -6630,10 +6464,10 @@ var AnnouncementBar = React57.forwardRef(
|
|
|
6630
6464
|
AnnouncementBar.displayName = "AnnouncementBar";
|
|
6631
6465
|
|
|
6632
6466
|
// src/components/marketing/PromoBanner.tsx
|
|
6633
|
-
import
|
|
6467
|
+
import React56 from "react";
|
|
6634
6468
|
import { useAction as useAction6 } from "@40rty/ams-sdk";
|
|
6635
6469
|
import { jsx as jsx84, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
6636
|
-
var PromoBanner =
|
|
6470
|
+
var PromoBanner = React56.forwardRef(
|
|
6637
6471
|
({ className, title, description, imageSrc, ctaLabel, ctaAction, layout = "horizontal", ...props }, ref) => {
|
|
6638
6472
|
const onCta = useAction6(ctaLabel ? ctaLabel : "", ctaAction);
|
|
6639
6473
|
return /* @__PURE__ */ jsxs58(
|
|
@@ -6674,7 +6508,7 @@ var PromoBanner = React58.forwardRef(
|
|
|
6674
6508
|
PromoBanner.displayName = "PromoBanner";
|
|
6675
6509
|
|
|
6676
6510
|
// src/components/social/ReviewCard.tsx
|
|
6677
|
-
import
|
|
6511
|
+
import React57 from "react";
|
|
6678
6512
|
import { jsx as jsx85, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6679
6513
|
function StarRating2({ rating }) {
|
|
6680
6514
|
return /* @__PURE__ */ jsx85("div", { className: "flex gap-0.5", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx85(
|
|
@@ -6688,7 +6522,7 @@ function StarRating2({ rating }) {
|
|
|
6688
6522
|
i
|
|
6689
6523
|
)) });
|
|
6690
6524
|
}
|
|
6691
|
-
var ReviewCard =
|
|
6525
|
+
var ReviewCard = React57.forwardRef(
|
|
6692
6526
|
({ className, author, rating, text, date, verified = false, ...props }, ref) => {
|
|
6693
6527
|
return /* @__PURE__ */ jsxs59(
|
|
6694
6528
|
"div",
|
|
@@ -6717,9 +6551,9 @@ var ReviewCard = React59.forwardRef(
|
|
|
6717
6551
|
ReviewCard.displayName = "ReviewCard";
|
|
6718
6552
|
|
|
6719
6553
|
// src/components/social/ReviewSummary.tsx
|
|
6720
|
-
import
|
|
6554
|
+
import React58 from "react";
|
|
6721
6555
|
import { jsx as jsx86, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
6722
|
-
var ReviewSummary =
|
|
6556
|
+
var ReviewSummary = React58.forwardRef(
|
|
6723
6557
|
({ className, averageRating, totalReviews, distribution, ...props }, ref) => {
|
|
6724
6558
|
return /* @__PURE__ */ jsxs60("div", { ref, className: cn("flex gap-8", className), ...props, children: [
|
|
6725
6559
|
/* @__PURE__ */ jsxs60("div", { className: "text-center", children: [
|
|
@@ -6760,10 +6594,10 @@ var ReviewSummary = React60.forwardRef(
|
|
|
6760
6594
|
ReviewSummary.displayName = "ReviewSummary";
|
|
6761
6595
|
|
|
6762
6596
|
// src/components/content/article/BlogCard.tsx
|
|
6763
|
-
import
|
|
6597
|
+
import React59 from "react";
|
|
6764
6598
|
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
6765
6599
|
import { jsx as jsx87, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6766
|
-
var BlogCard =
|
|
6600
|
+
var BlogCard = React59.forwardRef(
|
|
6767
6601
|
({ className, title, excerpt, imageSrc, imageAlt, date, author, asChild = false, ...props }, ref) => {
|
|
6768
6602
|
const Comp = asChild ? Slot4 : "div";
|
|
6769
6603
|
return /* @__PURE__ */ jsxs61(Comp, { ref, className: cn("group", className), ...props, children: [
|
|
@@ -6791,9 +6625,9 @@ var BlogCard = React61.forwardRef(
|
|
|
6791
6625
|
BlogCard.displayName = "BlogCard";
|
|
6792
6626
|
|
|
6793
6627
|
// src/components/content/RichText.tsx
|
|
6794
|
-
import
|
|
6628
|
+
import React60 from "react";
|
|
6795
6629
|
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
6796
|
-
var RichText =
|
|
6630
|
+
var RichText = React60.forwardRef(
|
|
6797
6631
|
({ className, html, ...props }, ref) => {
|
|
6798
6632
|
const clean = sanitizeHtml(html);
|
|
6799
6633
|
return /* @__PURE__ */ jsx88(
|
|
@@ -6817,9 +6651,9 @@ var RichText = React62.forwardRef(
|
|
|
6817
6651
|
RichText.displayName = "RichText";
|
|
6818
6652
|
|
|
6819
6653
|
// src/components/content/FeatureGrid.tsx
|
|
6820
|
-
import
|
|
6654
|
+
import React61 from "react";
|
|
6821
6655
|
import { jsx as jsx89, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6822
|
-
var FeatureGrid =
|
|
6656
|
+
var FeatureGrid = React61.forwardRef(
|
|
6823
6657
|
({ className, features: featuresProp, columns = 3, ...props }, ref) => {
|
|
6824
6658
|
const features = Array.isArray(featuresProp) ? featuresProp : [];
|
|
6825
6659
|
return /* @__PURE__ */ jsx89(Grid, { ref, columns, gap: "lg", className: cn(className), ...props, children: features.map((feature, i) => /* @__PURE__ */ jsxs62("div", { className: "text-center", children: [
|
|
@@ -6832,7 +6666,7 @@ var FeatureGrid = React63.forwardRef(
|
|
|
6832
6666
|
FeatureGrid.displayName = "FeatureGrid";
|
|
6833
6667
|
|
|
6834
6668
|
// src/components/navigation/Header.tsx
|
|
6835
|
-
import
|
|
6669
|
+
import React62 from "react";
|
|
6836
6670
|
|
|
6837
6671
|
// src/components/navigation/internal/HeaderLink.tsx
|
|
6838
6672
|
import { useAction as useAction7 } from "@40rty/ams-sdk";
|
|
@@ -6855,7 +6689,7 @@ function HeaderLink({
|
|
|
6855
6689
|
|
|
6856
6690
|
// src/components/navigation/Header.tsx
|
|
6857
6691
|
import { jsx as jsx91, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6858
|
-
var Header =
|
|
6692
|
+
var Header = React62.forwardRef(
|
|
6859
6693
|
({ className, logo, links: linksProp, cartCount = 0, onCartClick, onSearchClick, ...props }, ref) => {
|
|
6860
6694
|
const links = Array.isArray(linksProp) ? linksProp : [];
|
|
6861
6695
|
return /* @__PURE__ */ jsx91(
|
|
@@ -6903,7 +6737,7 @@ var Header = React64.forwardRef(
|
|
|
6903
6737
|
Header.displayName = "Header";
|
|
6904
6738
|
|
|
6905
6739
|
// src/components/navigation/Footer.tsx
|
|
6906
|
-
import
|
|
6740
|
+
import React63 from "react";
|
|
6907
6741
|
|
|
6908
6742
|
// src/components/navigation/internal/FooterLink.tsx
|
|
6909
6743
|
import { useAction as useAction8 } from "@40rty/ams-sdk";
|
|
@@ -6926,7 +6760,7 @@ function FooterLink({
|
|
|
6926
6760
|
|
|
6927
6761
|
// src/components/navigation/Footer.tsx
|
|
6928
6762
|
import { jsx as jsx93, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6929
|
-
var Footer =
|
|
6763
|
+
var Footer = React63.forwardRef(
|
|
6930
6764
|
({ className, columns: columnsProp, copyright, logo, ...props }, ref) => {
|
|
6931
6765
|
const columns = Array.isArray(columnsProp) ? columnsProp : [];
|
|
6932
6766
|
return /* @__PURE__ */ jsx93(
|
|
@@ -6958,7 +6792,7 @@ var Footer = React65.forwardRef(
|
|
|
6958
6792
|
Footer.displayName = "Footer";
|
|
6959
6793
|
|
|
6960
6794
|
// src/components/navigation/Breadcrumbs.tsx
|
|
6961
|
-
import
|
|
6795
|
+
import React64 from "react";
|
|
6962
6796
|
|
|
6963
6797
|
// src/components/navigation/internal/BreadcrumbLink.tsx
|
|
6964
6798
|
import { useAction as useAction9 } from "@40rty/ams-sdk";
|
|
@@ -6981,7 +6815,7 @@ function BreadcrumbLink({
|
|
|
6981
6815
|
|
|
6982
6816
|
// src/components/navigation/Breadcrumbs.tsx
|
|
6983
6817
|
import { jsx as jsx95, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6984
|
-
var Breadcrumbs =
|
|
6818
|
+
var Breadcrumbs = React64.forwardRef(
|
|
6985
6819
|
({ className, items: itemsProp, ...props }, ref) => {
|
|
6986
6820
|
const items = Array.isArray(itemsProp) ? itemsProp : [];
|
|
6987
6821
|
return /* @__PURE__ */ jsx95("nav", { ref, className: cn(className), "aria-label": "Breadcrumb", ...props, children: /* @__PURE__ */ jsx95("ol", { className: "flex items-center gap-1.5 text-sm", children: items.map((item, index) => /* @__PURE__ */ jsxs65("li", { className: "flex items-center gap-1.5", children: [
|
|
@@ -7154,10 +6988,10 @@ export {
|
|
|
7154
6988
|
rowWinnerIndex,
|
|
7155
6989
|
sanitizeHtml,
|
|
7156
6990
|
useBackdropPresence,
|
|
7157
|
-
useCartView,
|
|
6991
|
+
useCartView2 as useCartView,
|
|
7158
6992
|
useComposerMode,
|
|
7159
6993
|
useContainerWidth,
|
|
7160
|
-
useIsSeedHome,
|
|
6994
|
+
useIsSeedHome2 as useIsSeedHome,
|
|
7161
6995
|
useLabels,
|
|
7162
6996
|
useMeasuredHeight,
|
|
7163
6997
|
useMediaQuery,
|