@0xsequence/marketplace-sdk 0.8.9 → 0.8.10

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 (108) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/{chunk-FMEEJFAF.js → chunk-5C6ZZ6WX.js} +1 -1
  3. package/dist/{chunk-YEGD7PWE.js → chunk-5O44EPXZ.js} +2 -2
  4. package/dist/chunk-6CTFVBKU.js +1 -0
  5. package/dist/{chunk-KGM2WLSP.js → chunk-7F27CJZW.js} +14 -2
  6. package/dist/{chunk-KGM2WLSP.js.map → chunk-7F27CJZW.js.map} +1 -1
  7. package/dist/{chunk-MAD64DLJ.js → chunk-A7BVFBWB.js} +2 -2
  8. package/dist/{chunk-YBOFRP65.js → chunk-FGM57QUU.js} +2 -2
  9. package/dist/{chunk-HHYNOPPI.js → chunk-KTST7ORH.js} +2 -2
  10. package/dist/{chunk-35WWD5V6.js → chunk-M6NJ73Y5.js} +3 -3
  11. package/dist/chunk-Q3ECVC4F.js +811 -0
  12. package/dist/chunk-Q3ECVC4F.js.map +1 -0
  13. package/dist/{chunk-EODKQL6Y.js → chunk-RVIUUJTP.js} +2 -2
  14. package/dist/{chunk-G3447GIP.js → chunk-SXVUTSMT.js} +24 -9
  15. package/dist/chunk-SXVUTSMT.js.map +1 -0
  16. package/dist/{chunk-I2BYHDFE.js → chunk-UJSF7PSC.js} +159 -106
  17. package/dist/chunk-UJSF7PSC.js.map +1 -0
  18. package/dist/{chunk-YALXP2PW.js → chunk-WH5BZC7W.js} +2 -2
  19. package/dist/{chunk-4XLXOEXQ.js → chunk-Y2HJO2VY.js} +25 -4
  20. package/dist/chunk-Y2HJO2VY.js.map +1 -0
  21. package/dist/{create-config-DwrnzwpM.d.ts → create-config-CAQcvjl6.d.ts} +2 -2
  22. package/dist/{index-DGsVBflk.d.ts → index-MlUK9AQE.d.ts} +2 -2
  23. package/dist/index.css +7 -7
  24. package/dist/index.css.map +1 -1
  25. package/dist/index.d.ts +4 -3
  26. package/dist/index.js +10 -4
  27. package/dist/{lowestListing-BQHIuvNF.d.ts → listTokenMetadata-DO4ChDjn.d.ts} +20 -2
  28. package/dist/{marketplaceConfig-B4Fdsmxu.d.ts → marketplaceConfig-D0MXemEl.d.ts} +1 -1
  29. package/dist/react/_internal/api/index.d.ts +3 -2
  30. package/dist/react/_internal/api/index.js +5 -1
  31. package/dist/react/_internal/databeat/index.js +11 -10
  32. package/dist/react/_internal/index.d.ts +6 -5
  33. package/dist/react/_internal/index.js +5 -1
  34. package/dist/react/_internal/wagmi/index.d.ts +3 -3
  35. package/dist/react/hooks/index.d.ts +11 -8
  36. package/dist/react/hooks/index.js +12 -9
  37. package/dist/react/hooks/options/index.d.ts +3 -3
  38. package/dist/react/hooks/options/index.js +3 -3
  39. package/dist/react/index.css +7 -7
  40. package/dist/react/index.css.map +1 -1
  41. package/dist/react/index.d.ts +11 -10
  42. package/dist/react/index.js +18 -15
  43. package/dist/react/queries/index.d.ts +3 -2
  44. package/dist/react/queries/index.js +6 -4
  45. package/dist/react/ssr/index.d.ts +2 -2
  46. package/dist/react/ssr/index.js +2 -2
  47. package/dist/react/ui/components/collectible-card/index.css +7 -7
  48. package/dist/react/ui/components/collectible-card/index.css.map +1 -1
  49. package/dist/react/ui/components/collectible-card/index.d.ts +7 -5
  50. package/dist/react/ui/components/collectible-card/index.js +18 -17
  51. package/dist/react/ui/components/marketplace-logos/index.js +1 -1
  52. package/dist/react/ui/icons/index.js +7 -6
  53. package/dist/react/ui/index.css +7 -7
  54. package/dist/react/ui/index.css.map +1 -1
  55. package/dist/react/ui/index.d.ts +1 -1
  56. package/dist/react/ui/index.js +16 -15
  57. package/dist/react/ui/modals/_internal/components/actionModal/index.js +11 -10
  58. package/dist/{sdk-config-txlivEKe.d.ts → sdk-config-onSPBxJj.d.ts} +1 -0
  59. package/dist/{services-BI_w8Eq4.d.ts → services-CMSb9ipU.d.ts} +5 -2
  60. package/dist/types/index.d.ts +2 -2
  61. package/dist/types/index.js +1 -1
  62. package/dist/{types-isjvwapz.d.ts → types-B8xzPEKX.d.ts} +2 -2
  63. package/dist/utils/abi/index.d.ts +1 -0
  64. package/dist/utils/abi/index.js +7 -1
  65. package/dist/utils/abi/primary-sale/index.d.ts +1054 -0
  66. package/dist/utils/abi/primary-sale/index.js +9 -0
  67. package/dist/utils/abi/primary-sale/index.js.map +1 -0
  68. package/dist/utils/index.d.ts +1 -0
  69. package/dist/utils/index.js +10 -4
  70. package/package.json +30 -30
  71. package/src/react/_internal/api/services.ts +12 -1
  72. package/src/react/hooks/index.ts +1 -0
  73. package/src/react/hooks/useList1155SaleSupplies.tsx +62 -0
  74. package/src/react/hooks/useListTokenMetadata.ts +19 -0
  75. package/src/react/queries/index.ts +1 -0
  76. package/src/react/queries/listTokenMetadata.ts +38 -0
  77. package/src/react/ui/components/collectible-card/CollectibleCard.tsx +2 -2
  78. package/src/react/ui/components/collectible-card/__tests__/{CollectibleAsset.test.tsx → Media.test.tsx} +7 -13
  79. package/src/react/ui/components/collectible-card/index.ts +1 -1
  80. package/src/react/ui/components/collectible-card/media/Media.tsx +206 -0
  81. package/src/react/ui/components/collectible-card/{collectible-asset/CollectibleAssetSkeleton.tsx → media/MediaSkeleton.tsx} +1 -1
  82. package/src/react/ui/components/collectible-card/media/types.ts +17 -0
  83. package/src/react/ui/components/collectible-card/{collectible-asset → media}/utils.ts +8 -3
  84. package/src/react/ui/index.ts +1 -1
  85. package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +28 -3
  86. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/WalletAddressInput.tsx +1 -1
  87. package/src/types/sdk-config.ts +1 -0
  88. package/src/utils/abi/index.ts +1 -0
  89. package/src/utils/abi/primary-sale/index.ts +2 -0
  90. package/src/utils/abi/primary-sale/sequence-1155-sales-contract.ts +450 -0
  91. package/src/utils/abi/primary-sale/sequence-721-sales-contract.ts +352 -0
  92. package/src/utils/abi/token/sequence-erc1155-items.ts +454 -0
  93. package/src/utils/fetchContentType.ts +5 -1
  94. package/tsconfig.tsbuildinfo +1 -1
  95. package/dist/chunk-4XLXOEXQ.js.map +0 -1
  96. package/dist/chunk-G3447GIP.js.map +0 -1
  97. package/dist/chunk-I2BYHDFE.js.map +0 -1
  98. package/dist/chunk-UISBTKFF.js +0 -1
  99. package/src/react/ui/components/collectible-card/collectible-asset/CollectibleAsset.tsx +0 -174
  100. /package/dist/{chunk-FMEEJFAF.js.map → chunk-5C6ZZ6WX.js.map} +0 -0
  101. /package/dist/{chunk-YEGD7PWE.js.map → chunk-5O44EPXZ.js.map} +0 -0
  102. /package/dist/{chunk-UISBTKFF.js.map → chunk-6CTFVBKU.js.map} +0 -0
  103. /package/dist/{chunk-MAD64DLJ.js.map → chunk-A7BVFBWB.js.map} +0 -0
  104. /package/dist/{chunk-YBOFRP65.js.map → chunk-FGM57QUU.js.map} +0 -0
  105. /package/dist/{chunk-HHYNOPPI.js.map → chunk-KTST7ORH.js.map} +0 -0
  106. /package/dist/{chunk-35WWD5V6.js.map → chunk-M6NJ73Y5.js.map} +0 -0
  107. /package/dist/{chunk-EODKQL6Y.js.map → chunk-RVIUUJTP.js.map} +0 -0
  108. /package/dist/{chunk-YALXP2PW.js.map → chunk-WH5BZC7W.js.map} +0 -0
@@ -2,15 +2,15 @@
2
2
 
3
3
  import {
4
4
  ActionModal
5
- } from "./chunk-YBOFRP65.js";
5
+ } from "./chunk-FGM57QUU.js";
6
6
  import {
7
7
  useAnalytics
8
- } from "./chunk-HHYNOPPI.js";
8
+ } from "./chunk-KTST7ORH.js";
9
9
  import {
10
10
  BellIcon_default,
11
11
  CalendarIcon_default,
12
12
  CartIcon_default
13
- } from "./chunk-35WWD5V6.js";
13
+ } from "./chunk-M6NJ73Y5.js";
14
14
  import {
15
15
  AlertMessage,
16
16
  MODAL_OVERLAY_PROPS,
@@ -33,7 +33,7 @@ import {
33
33
  useSwitchChainModal,
34
34
  useTransferTokens,
35
35
  useWallet
36
- } from "./chunk-G3447GIP.js";
36
+ } from "./chunk-SXVUTSMT.js";
37
37
  import {
38
38
  DEFAULT_MARKETPLACE_FEE_PERCENTAGE
39
39
  } from "./chunk-Y63BOO6M.js";
@@ -43,7 +43,7 @@ import {
43
43
  compareAddress,
44
44
  formatPriceWithFee,
45
45
  truncateMiddle
46
- } from "./chunk-YEGD7PWE.js";
46
+ } from "./chunk-5O44EPXZ.js";
47
47
  import {
48
48
  SequenceMarketplaceV1_ABI
49
49
  } from "./chunk-XX4EVWBF.js";
@@ -51,8 +51,9 @@ import {
51
51
  balanceQueries,
52
52
  collectableKeys,
53
53
  getMarketplaceClient,
54
- getQueryClient
55
- } from "./chunk-KGM2WLSP.js";
54
+ getQueryClient,
55
+ getSequenceApiClient
56
+ } from "./chunk-7F27CJZW.js";
56
57
  import {
57
58
  InvalidContractTypeError,
58
59
  InvalidStepError
@@ -580,6 +581,19 @@ var getBuyCollectableParams = async ({
580
581
  if (!buyStep) {
581
582
  throw new Error("Buy step not found");
582
583
  }
584
+ const creditCardProviders = customCreditCardProviderCallback ? ["custom"] : checkoutOptions.nftCheckout || [];
585
+ const isTransakSupported = creditCardProviders.includes("transak");
586
+ let transakContractId;
587
+ if (isTransakSupported) {
588
+ const sequenceApiClient = getSequenceApiClient(config);
589
+ const transakContractIdResponse = await sequenceApiClient.checkoutOptionsGetTransakContractID({
590
+ chainId,
591
+ contractAddress: buyStep.to
592
+ });
593
+ if (transakContractIdResponse.contractId !== "") {
594
+ transakContractId = transakContractIdResponse.contractId;
595
+ }
596
+ }
583
597
  return {
584
598
  chain: chainId,
585
599
  collectibles: [
@@ -598,7 +612,7 @@ var getBuyCollectableParams = async ({
598
612
  recipientAddress: await wallet.address(),
599
613
  enableMainCurrencyPayment: true,
600
614
  enableSwapPayments: !!checkoutOptions.swap,
601
- creditCardProviders: customCreditCardProviderCallback ? ["custom"] : checkoutOptions.nftCheckout || [],
615
+ creditCardProviders,
602
616
  onSuccess: (hash) => {
603
617
  callbacks?.onSuccess?.({ hash });
604
618
  },
@@ -619,6 +633,11 @@ var getBuyCollectableParams = async ({
619
633
  customCreditCardProviderCallback(buyStep);
620
634
  buyModalStore.send({ type: "close" });
621
635
  }
636
+ },
637
+ ...transakContractId && {
638
+ transakConfig: {
639
+ contractId: transakContractId
640
+ }
622
641
  }
623
642
  };
624
643
  };
@@ -4501,7 +4520,7 @@ var WalletAddressInput = observer13(() => {
4501
4520
  const handleChangeWalletAddress = (event) => {
4502
4521
  transferModal$.state.receiverAddress.set(event.target.value);
4503
4522
  };
4504
- return /* @__PURE__ */ jsxs24("div", { className: "[&>label>div>>span]:text-sm [&>label>div>span]:text-text-80 [&>label]:gap-1", children: [
4523
+ return /* @__PURE__ */ jsxs24("div", { className: "[&>label>div>span]:text-sm [&>label>div>span]:text-text-80 [&>label]:gap-1", children: [
4505
4524
  /* @__PURE__ */ jsx31(
4506
4525
  TextInput,
4507
4526
  {
@@ -5247,7 +5266,7 @@ var TokenTypeBalancePill = ({
5247
5266
  return /* @__PURE__ */ jsx40(Text21, { className: "rounded-lg bg-background-secondary px-2 py-1 text-left font-medium text-text-80 text-xs", children: displayText });
5248
5267
  };
5249
5268
 
5250
- // src/react/ui/components/collectible-card/collectible-asset/CollectibleAsset.tsx
5269
+ // src/react/ui/components/collectible-card/media/Media.tsx
5251
5270
  import { useEffect as useEffect12, useRef as useRef3, useState as useState10 } from "react";
5252
5271
 
5253
5272
  // src/utils/fetchContentType.ts
@@ -5257,6 +5276,9 @@ function fetchContentType(url) {
5257
5276
  reject(new Error("XMLHttpRequest is not supported in this environment."));
5258
5277
  return;
5259
5278
  }
5279
+ if (!url) {
5280
+ return;
5281
+ }
5260
5282
  const client = new XMLHttpRequest();
5261
5283
  let settled = false;
5262
5284
  const settle = (value) => {
@@ -5371,10 +5393,10 @@ var ModelViewer = (props) => {
5371
5393
  };
5372
5394
  var ModelViewer_default = ModelViewer;
5373
5395
 
5374
- // src/react/ui/components/collectible-card/collectible-asset/CollectibleAssetSkeleton.tsx
5396
+ // src/react/ui/components/collectible-card/media/MediaSkeleton.tsx
5375
5397
  import { Skeleton as Skeleton11 } from "@0xsequence/design-system";
5376
5398
  import { jsx as jsx42 } from "react/jsx-runtime";
5377
- function CollectibleAssetSkeleton() {
5399
+ function MediaSkeleton() {
5378
5400
  return /* @__PURE__ */ jsx42(
5379
5401
  Skeleton11,
5380
5402
  {
@@ -5388,7 +5410,7 @@ function CollectibleAssetSkeleton() {
5388
5410
  );
5389
5411
  }
5390
5412
 
5391
- // src/react/ui/components/collectible-card/collectible-asset/utils.ts
5413
+ // src/react/ui/components/collectible-card/media/utils.ts
5392
5414
  var isImage = (fileName) => {
5393
5415
  const isImage2 = /.*\.(png|jpg|jpeg|gif|svg|webp)$/.test(
5394
5416
  fileName?.toLowerCase() || ""
@@ -5410,53 +5432,92 @@ var is3dModel = (fileName) => {
5410
5432
  return is3dFile;
5411
5433
  };
5412
5434
  var getContentType = (url) => {
5413
- return new Promise((resolve) => {
5435
+ return new Promise((resolve, reject) => {
5414
5436
  const type = isHtml(url) ? "html" : isVideo(url) ? "video" : isImage(url) ? "image" : is3dModel(url) ? "3d-model" : null;
5415
- resolve(type);
5437
+ if (type) {
5438
+ resolve(type);
5439
+ } else {
5440
+ reject(new Error("Unsupported file type"));
5441
+ }
5416
5442
  });
5417
5443
  };
5418
5444
 
5419
- // src/react/ui/components/collectible-card/collectible-asset/CollectibleAsset.tsx
5445
+ // src/react/ui/components/collectible-card/media/Media.tsx
5420
5446
  import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
5421
- function CollectibleAsset({
5447
+ function Media({
5422
5448
  name,
5423
5449
  assets,
5424
5450
  assetSrcPrefixUrl,
5425
- className
5451
+ className,
5452
+ supply
5426
5453
  }) {
5427
5454
  const [assetLoadFailed, setAssetLoadFailed] = useState10(false);
5428
5455
  const [assetLoading, setAssetLoading] = useState10(true);
5429
- const [contentType, setContentType] = useState10({ type: null, loading: true, failed: false });
5456
+ const [contentType, setContentType] = useState10({
5457
+ type: null,
5458
+ loading: true,
5459
+ failed: false
5460
+ });
5430
5461
  const videoRef = useRef3(null);
5431
5462
  const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5432
5463
  const placeholderImage = chess_tile_default;
5433
- const assetUrl = assets?.find((asset) => asset) || placeholderImage;
5434
- const proxiedAssetUrl = assetSrcPrefixUrl ? `${assetSrcPrefixUrl}${assetUrl}` : assetUrl;
5464
+ const assetUrl = assets.find((asset) => !!asset);
5465
+ const proxiedAssetUrl = assetUrl ? assetSrcPrefixUrl ? `${assetSrcPrefixUrl}${assetUrl}` : assetUrl : "";
5466
+ const classNames = cn(
5467
+ "relative aspect-square overflow-hidden bg-background-secondary",
5468
+ supply !== void 0 && supply === 0 && "opacity-50",
5469
+ className
5470
+ );
5435
5471
  useEffect12(() => {
5436
- getContentType(proxiedAssetUrl).then((contentType2) => {
5437
- setContentType({ type: contentType2, loading: false, failed: false });
5438
- }).catch(() => {
5439
- fetchContentType(proxiedAssetUrl).then((contentType2) => {
5440
- setContentType({
5441
- type: contentType2,
5442
- loading: false,
5443
- failed: false
5444
- });
5445
- }).catch(() => {
5446
- setContentType({ type: null, loading: false, failed: true });
5447
- });
5448
- });
5449
- }, [proxiedAssetUrl]);
5472
+ if (!assetUrl) {
5473
+ setContentType({ type: null, loading: false, failed: true });
5474
+ return;
5475
+ }
5476
+ const determineContentType = async () => {
5477
+ try {
5478
+ const type = await getContentType(proxiedAssetUrl);
5479
+ setContentType({ type, loading: false, failed: false });
5480
+ } catch {
5481
+ try {
5482
+ const type = await fetchContentType(proxiedAssetUrl);
5483
+ setContentType({ type, loading: false, failed: false });
5484
+ } catch {
5485
+ setContentType({ type: null, loading: false, failed: true });
5486
+ }
5487
+ }
5488
+ };
5489
+ determineContentType();
5490
+ }, [proxiedAssetUrl, assetUrl]);
5491
+ const handleAssetError = () => {
5492
+ setAssetLoadFailed(true);
5493
+ };
5494
+ const handleAssetLoad = () => {
5495
+ setAssetLoading(false);
5496
+ };
5497
+ if (contentType.failed && !assetLoadFailed || !assetUrl) {
5498
+ return /* @__PURE__ */ jsx43("div", { className: cn("h-full w-full", classNames), children: /* @__PURE__ */ jsx43(
5499
+ "img",
5500
+ {
5501
+ src: placeholderImage,
5502
+ alt: name || "Collectible",
5503
+ className: "h-full w-full object-cover",
5504
+ onError: (e) => {
5505
+ console.error("Failed to load placeholder image");
5506
+ e.currentTarget.style.display = "none";
5507
+ }
5508
+ }
5509
+ ) });
5510
+ }
5450
5511
  if (contentType.type === "html" && !assetLoadFailed) {
5451
5512
  return /* @__PURE__ */ jsxs30(
5452
5513
  "div",
5453
5514
  {
5454
5515
  className: cn(
5455
- "flex aspect-square w-full items-center justify-center overflow-hidden rounded-lg bg-background-secondary",
5456
- className
5516
+ "flex w-full items-center justify-center rounded-lg",
5517
+ classNames
5457
5518
  ),
5458
5519
  children: [
5459
- (assetLoading || contentType.loading) && /* @__PURE__ */ jsx43(CollectibleAssetSkeleton, {}),
5520
+ (assetLoading || contentType.loading) && /* @__PURE__ */ jsx43(MediaSkeleton, {}),
5460
5521
  /* @__PURE__ */ jsx43(
5461
5522
  "iframe",
5462
5523
  {
@@ -5465,11 +5526,9 @@ function CollectibleAsset({
5465
5526
  src: proxiedAssetUrl,
5466
5527
  allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
5467
5528
  sandbox: "allow-scripts",
5468
- style: {
5469
- border: "0px"
5470
- },
5471
- onError: () => setAssetLoadFailed(true),
5472
- onLoad: () => setAssetLoading(false)
5529
+ style: { border: "0px" },
5530
+ onError: handleAssetError,
5531
+ onLoad: handleAssetLoad
5473
5532
  }
5474
5533
  )
5475
5534
  ]
@@ -5477,77 +5536,71 @@ function CollectibleAsset({
5477
5536
  );
5478
5537
  }
5479
5538
  if (contentType.type === "3d-model" && !assetLoadFailed) {
5480
- return /* @__PURE__ */ jsx43("div", { className: "h-full w-full", children: /* @__PURE__ */ jsx43(
5539
+ return /* @__PURE__ */ jsx43("div", { className: cn("h-full w-full", classNames), children: /* @__PURE__ */ jsx43(
5481
5540
  ModelViewer_default,
5482
5541
  {
5483
5542
  src: proxiedAssetUrl,
5484
5543
  posterSrc: placeholderImage,
5485
- onLoad: () => setAssetLoading(false),
5486
- onError: () => setAssetLoadFailed(true)
5544
+ onLoad: handleAssetLoad,
5545
+ onError: handleAssetError
5487
5546
  }
5488
5547
  ) });
5489
5548
  }
5490
5549
  if (contentType.type === "video" && !assetLoadFailed) {
5491
- return /* @__PURE__ */ jsxs30(
5492
- "div",
5493
- {
5494
- className: cn(
5495
- "relative flex aspect-square w-full items-center justify-center overflow-hidden rounded-lg bg-background-secondary",
5496
- className
5497
- ),
5498
- children: [
5499
- (assetLoading || contentType.loading) && /* @__PURE__ */ jsx43(CollectibleAssetSkeleton, {}),
5500
- /* @__PURE__ */ jsx43(
5501
- "video",
5502
- {
5503
- ref: videoRef,
5504
- className: cn(
5505
- `absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover ${assetLoading ? "invisible" : "visible"}`,
5506
- // we can't hide the video controls in safari, when user hovers over the video they show up. `pointer-events-none` is the only way to hide them on hover
5507
- isSafari && "pointer-events-none"
5508
- ),
5509
- autoPlay: true,
5510
- loop: true,
5511
- controls: true,
5512
- playsInline: true,
5513
- muted: true,
5514
- controlsList: "nodownload noremoteplayback nofullscreen ",
5515
- onError: () => {
5516
- setAssetLoadFailed(true);
5517
- },
5518
- onLoadedMetadata: () => {
5519
- setAssetLoading(false);
5520
- },
5521
- "data-testid": "collectible-asset-video",
5522
- children: /* @__PURE__ */ jsx43("source", { src: proxiedAssetUrl })
5523
- }
5524
- )
5525
- ]
5526
- }
5550
+ const videoClassNames = cn(
5551
+ "absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover",
5552
+ assetLoading ? "invisible" : "visible",
5553
+ // we can't hide the video controls in safari, when user hovers over the video they show up.
5554
+ // `pointer-events-none` is the only way to hide them on hover
5555
+ isSafari && "pointer-events-none"
5527
5556
  );
5557
+ return /* @__PURE__ */ jsxs30("div", { className: classNames, children: [
5558
+ (assetLoading || contentType.loading) && /* @__PURE__ */ jsx43(MediaSkeleton, {}),
5559
+ /* @__PURE__ */ jsx43(
5560
+ "video",
5561
+ {
5562
+ ref: videoRef,
5563
+ className: videoClassNames,
5564
+ autoPlay: true,
5565
+ loop: true,
5566
+ controls: true,
5567
+ playsInline: true,
5568
+ muted: true,
5569
+ controlsList: "nodownload noremoteplayback nofullscreen",
5570
+ onError: handleAssetError,
5571
+ onLoadedMetadata: handleAssetLoad,
5572
+ "data-testid": "collectible-asset-video",
5573
+ children: /* @__PURE__ */ jsx43("source", { src: proxiedAssetUrl })
5574
+ }
5575
+ )
5576
+ ] });
5528
5577
  }
5529
- return /* @__PURE__ */ jsxs30(
5530
- "div",
5531
- {
5532
- className: cn(
5533
- "relative aspect-square overflow-hidden bg-background-secondary",
5534
- className
5535
- ),
5536
- children: [
5537
- (assetLoading || contentType.loading) && /* @__PURE__ */ jsx43(CollectibleAssetSkeleton, {}),
5538
- /* @__PURE__ */ jsx43(
5539
- "img",
5540
- {
5541
- src: assetLoadFailed || contentType.failed ? placeholderImage : proxiedAssetUrl,
5542
- alt: name || "Collectible",
5543
- className: `absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover ${assetLoading || contentType.loading ? "invisible" : "visible"}`,
5544
- onError: () => setAssetLoadFailed(true),
5545
- onLoad: () => setAssetLoading(false)
5546
- }
5547
- )
5548
- ]
5549
- }
5578
+ const imgSrc = assetLoadFailed || contentType.failed ? placeholderImage : proxiedAssetUrl;
5579
+ const imgClassNames = cn(
5580
+ "absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover",
5581
+ assetLoading || contentType.loading ? "invisible" : "visible"
5550
5582
  );
5583
+ return /* @__PURE__ */ jsxs30("div", { className: classNames, children: [
5584
+ (assetLoading || contentType.loading) && /* @__PURE__ */ jsx43(MediaSkeleton, {}),
5585
+ /* @__PURE__ */ jsx43(
5586
+ "img",
5587
+ {
5588
+ src: imgSrc,
5589
+ alt: name || "Collectible",
5590
+ className: imgClassNames,
5591
+ onError: (e) => {
5592
+ if (contentType.type === "image") {
5593
+ setAssetLoadFailed(true);
5594
+ }
5595
+ if (e.currentTarget.src === placeholderImage) {
5596
+ console.error("Failed to load placeholder image");
5597
+ e.currentTarget.style.display = "none";
5598
+ }
5599
+ },
5600
+ onLoad: handleAssetLoad
5601
+ }
5602
+ )
5603
+ ] });
5551
5604
  }
5552
5605
 
5553
5606
  // src/react/ui/components/collectible-card/CollectibleCard.tsx
@@ -5618,7 +5671,7 @@ function CollectibleCard({
5618
5671
  },
5619
5672
  children: /* @__PURE__ */ jsx44("div", { className: "group relative z-10 flex h-full w-full cursor-pointer flex-col items-start overflow-hidden rounded-xl border-none bg-none p-0 focus:outline-none [&:focus]:rounded-[10px] [&:focus]:outline-[3px] [&:focus]:outline-black [&:focus]:outline-offset-[-3px]", children: /* @__PURE__ */ jsxs31("article", { className: "w-full rounded-xl", children: [
5620
5673
  /* @__PURE__ */ jsx44(
5621
- CollectibleAsset,
5674
+ Media,
5622
5675
  {
5623
5676
  name: collectibleMetadata?.name || "",
5624
5677
  assets: [
@@ -5669,7 +5722,7 @@ export {
5669
5722
  useCreateListingModal,
5670
5723
  useMakeOfferModal,
5671
5724
  useSellModal,
5672
- CollectibleAsset,
5725
+ Media,
5673
5726
  CollectibleCard
5674
5727
  };
5675
- //# sourceMappingURL=chunk-I2BYHDFE.js.map
5728
+ //# sourceMappingURL=chunk-UJSF7PSC.js.map