@dcl/shop 0.7.0 → 0.7.1
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/_assets/{Activity-Bfm7kRfv.js → Activity-Cnn-lMD9.js} +3 -3
- package/_assets/{AnimatedBackground-C-bhqVsp.js → AnimatedBackground-D9QjeeBa.js} +1 -1
- package/_assets/{Assets-B55dtQQJ.js → Assets-CRJDmBDB.js} +12 -12
- package/_assets/{Assets.styles-NQkvfYq_.js → Assets.styles-BjdmDuEG.js} +1 -1
- package/_assets/{Authorizations-CiQtw5K-.js → Authorizations-C-EUi_Ea.js} +1 -1
- package/_assets/{Cart-D7wbUiTa.js → Cart-B8YOGJmI.js} +9 -9
- package/_assets/{CircularProgress-ZsDKUKD2.js → CircularProgress-Db8orehr.js} +3 -3
- package/_assets/{Collection-DwFpgZbC.js → Collection-C2FumsGf.js} +6 -6
- package/_assets/{CollectionCarousel-DENDQYmz.js → CollectionCarousel-DL857EZk.js} +6 -6
- package/_assets/Creator-WSL6qgqX.js +306 -0
- package/_assets/{ErrorNotice-BEc3g8r8.js → ErrorNotice-MWF7JXST.js} +1 -1
- package/_assets/{ExchangeController-BCP2fWjj.js → ExchangeController-D0BUEGgM.js} +1 -1
- package/_assets/{GetCredits-Vnk46xfQ.js → GetCredits-VgVSObKH.js} +56 -40
- package/_assets/{Grow-DuBI26R-.js → Grow-DaJKbNKH.js} +1 -1
- package/_assets/{HelpersUtil-ClfhYE3l.js → HelpersUtil-Des1BKsb.js} +1 -1
- package/_assets/ItemDetail-DpbhFiHl.js +3497 -0
- package/_assets/LazyEmoteControls-COW8eJUD.js +2 -0
- package/_assets/{LoadMore-CC_UzQ34.js → LoadMore-CIWThu0V.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-BokPI2D_.js → ManaPricingBanner.styles-D7yh-OMv.js} +3 -3
- package/_assets/{MyAssets-Bo37jIwn.js → MyAssets-MBEHe0qY.js} +1 -1
- package/_assets/{MyFavorites-B2TJaZUB.js → MyFavorites-Cer-5MAy.js} +1 -1
- package/_assets/{NotFound-DLx8jzvN.js → NotFound-CuiJHtW_.js} +1 -1
- package/_assets/{NotificationsBell-BtCXxoM8.js → NotificationsBell-BneUIyzO.js} +1 -1
- package/_assets/OutfitDetail-B1WI3yDq.js +334 -0
- package/_assets/{OutfitPreview-D5_qH5Ln.js → OutfitPreview-C2-ueSaA.js} +2 -2
- package/_assets/{OutfitStudio-qONuf5K7.js → OutfitStudio-DYdoL9fR.js} +7 -7
- package/_assets/{StoreSettings-vN3UO986.js → StoreSettings-DuuOxmdV.js} +9 -9
- package/_assets/{Success-f5eJlnKx.js → Success-CEH1MUQt.js} +1 -1
- package/_assets/{SwapController-B9sRrkAK.js → SwapController-CIXsGZBK.js} +1 -1
- package/_assets/{Tooltip-D1ZBIqYA.js → Tooltip-jfo7edQn.js} +1 -1
- package/_assets/{TradeService-DvFVQpxx.js → TradeService-DiOUxFwj.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-mcKRqTfP.js → W3MFrameProviderSingleton-D_hwynnp.js} +3 -3
- package/_assets/{WebCryptoP256-B7MhXWuH.js → WebCryptoP256-DFE3V2WS.js} +1 -1
- package/_assets/{authorizations-D_1liO7d.js → authorizations-CboNrOcr.js} +1 -1
- package/_assets/{basic-CqEh5duU.js → basic-DvU1J3w8.js} +1 -1
- package/_assets/{biconomy-D_Y6_R5H.js → biconomy-DTTg16ds.js} +1 -1
- package/_assets/builder-C3uRVotE.js +1 -0
- package/_assets/{buy-D5A2EHRt.js → buy-BYu3r4d1.js} +1 -1
- package/_assets/{buy-gasless-DOjyxrOK.js → buy-gasless-BpGXC11T.js} +1 -1
- package/_assets/{categories-2VrlGaC_.js → categories-B-ttqFdP.js} +1 -1
- package/_assets/{ccip-BOQWcrsE.js → ccip-B5qgpEOa.js} +1 -1
- package/_assets/{ccip-Bmb04-XK.js → ccip-Chjvzuo3.js} +1 -1
- package/_assets/{collectionPage.styles-DaKP3DX-.js → collectionPage.styles-Cqc0qEsV.js} +4 -4
- package/_assets/{controller-BQ-e2rGO.js → controller-D65h4JHM.js} +2 -2
- package/_assets/{core-CTr2fRUy.js → core-DQrWR_KU.js} +4 -4
- package/_assets/{createSvgIcon-BhCc-35g.js → createSvgIcon-CIAc53Uf.js} +3 -3
- package/_assets/{custom-DG1qkiJE.js → custom-CXFEHrtn.js} +1 -1
- package/_assets/{data-capture-Ba2U2y5O.js → data-capture-CyNw1tR6.js} +1 -1
- package/_assets/disposePreview-8oEf57G7.js +1 -0
- package/_assets/{email-Wxqgx6Lj.js → email-BSFpn-mK.js} +1 -1
- package/_assets/{embedded-wallet-DR6Si6kV.js → embedded-wallet-DUt0q64F.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-Ce_kaTO_.js → emotion-styled.browser.esm-MB_ZnWA0.js} +1 -1
- package/_assets/{engine-CT5J10tT.js → engine-CWoVWkrK.js} +1 -1
- package/_assets/{errors-BQ78iy4c.js → errors-CspB8iK7.js} +1 -1
- package/_assets/{estimate-l1-fee-BWX6n2wW.js → estimate-l1-fee-CctWCWaJ.js} +1 -1
- package/_assets/{execute-C6tBpvgs.js → execute-CqdEBDWF.js} +2 -2
- package/_assets/{features-BmPELMhg.js → features-1-FLWkh7.js} +1 -1
- package/_assets/{fetchTokenMetadata-Mg3wjHG6.js → fetchTokenMetadata-BaQpNTHG.js} +2 -2
- package/_assets/{field.styles-5z9eWAwV.js → field.styles-O-FhYRsZ.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-Blc_71v0.js → get-ecosystem-wallet-info-efBvwCgh.js} +1 -1
- package/_assets/{getBalance-mM7D97ev.js → getBalance-B6jNJqou.js} +1 -1
- package/_assets/{getNFT-zt_0lqjp.js → getNFT-BLha6TEN.js} +1 -1
- package/_assets/{getNFT-CbZgRluJ.js → getNFT-CEFWuq38.js} +1 -1
- package/_assets/{grid.styles-B1gNJ9t8.js → grid.styles-9axjWKOh.js} +1 -1
- package/_assets/{hashTypedData-BmTdbBr7.js → hashTypedData-DRoLgz93.js} +1 -1
- package/_assets/{hashTypedData-xC0RrFzF.js → hashTypedData-DU5frjBz.js} +1 -1
- package/_assets/{in-app-D6xPBmdK.js → in-app-B7r-w8-I.js} +1 -1
- package/_assets/{in-app-wallet-calls-DRD1x_CO.js → in-app-wallet-calls-DikRiAsm.js} +1 -1
- package/_assets/{index-B9ZWePj8.js → index--d9L6VlZ.js} +3 -3
- package/_assets/{index-p6LU--BY.js → index-B7llCCrg.js} +3 -3
- package/_assets/{index-Dtczzkr-.js → index-BLcuFifQ.js} +1 -1
- package/_assets/{index-Cu7cZeif.js → index-BMoopm2-.js} +1 -1
- package/_assets/{index-C1UOaaoO.js → index-BReAWJ34.js} +1 -1
- package/_assets/{index-D-lT6ZHp.js → index-BTadlrEf.js} +1 -1
- package/_assets/{index-GiJ7q8m3.js → index-BVyKLj9g.js} +1 -1
- package/_assets/{index-8jpO9R0L.js → index-BWwETmQE.js} +1 -1
- package/_assets/{index-BnRijaO7.js → index-Bfbnmm19.js} +2 -2
- package/_assets/{index-dwg60Gnv.js → index-BgabQb2i.js} +1 -1
- package/_assets/{index-pNEW50qZ.js → index-Bggu5dcK.js} +1 -1
- package/_assets/{index-CFCPlMvn.js → index-BkzAB4dC.js} +1 -1
- package/_assets/{index-CrA-gT12.js → index-BlFmY0PY.js} +2 -2
- package/_assets/{index-Cx2Xs8TS.js → index-BvC5hvQr.js} +1 -1
- package/_assets/{index-CVRID3Zs.js → index-Bw8RegM3.js} +1 -1
- package/_assets/{index-DmJ1WEe8.js → index-ByXn6qsZ.js} +1 -1
- package/_assets/{index-BQt-UtVW.js → index-C2dqHPFe.js} +1 -1
- package/_assets/{index-Cqx_iE06.js → index-C2gCqG5-.js} +1 -1
- package/_assets/{index-CakvWn8X.js → index-C5Q9tbiE.js} +2 -2
- package/_assets/{index-BG_zxl6p.js → index-C7mQXKdO.js} +1 -1
- package/_assets/{index-Ds0nhWl1.js → index-CIuQobaT.js} +1 -1
- package/_assets/{index-DzF05fXw.js → index-CKY-zq6_.js} +1 -1
- package/_assets/{index-AUd3llLa.js → index-CMFFdWaD.js} +3 -3
- package/_assets/{index-B47z7qMq.js → index-COXs6Mhj.js} +1 -1
- package/_assets/{index-Qgfkcf-Z.js → index-CSMohmqH.js} +1 -1
- package/_assets/{index-D6orrgpK.js → index-CaO4BbgL.js} +1 -1
- package/_assets/{index-CxFaiS6B.js → index-Cgl5oOLN.js} +1 -1
- package/_assets/{index-CYAsq_LJ.js → index-D4Z2JmNT.js} +1 -1
- package/_assets/{index-HfSTYCId.js → index-DDKTVZmj.js} +1 -1
- package/_assets/{index-Cpx6YfS5.js → index-DLLktYWt.js} +1 -1
- package/_assets/{index-Db5yIiwQ.js → index-DPQIOv9u.js} +1 -1
- package/_assets/{index-By7h7Ees.js → index-DR68c_Xf.js} +1 -1
- package/_assets/{index-DUxAD7Ds.js → index-DZlNnXl_.js} +2 -2
- package/_assets/{index-B3IuheKM.js → index-D_FVnuvd.js} +1 -1
- package/_assets/{index-CXdifgIh.js → index-Dcv3uBNj.js} +1 -1
- package/_assets/{index-SH2zEbyV.js → index-DkxuiR0U.js} +1 -1
- package/_assets/{index-CdIpnfG_.js → index-DrK9O1Pz.js} +1 -1
- package/_assets/index-DvGpQtXK.js +3378 -0
- package/_assets/{index-D56APiYW.js → index-Iv9CW07E.js} +1 -1
- package/_assets/{index-4odeU1-q.js → index-KGamvf3R.js} +8 -8
- package/_assets/{index-C2GswxH6.js → index-KzbPGO4w.js} +1 -1
- package/_assets/{index-DqLl5DCg.js → index-LuVJpw9c.js} +1 -1
- package/_assets/{index-CRwuFsYT.js → index-XPa69X9v.js} +1 -1
- package/_assets/{index-GeaRFVYH.js → index-Y3M9UhW1.js} +3 -3
- package/_assets/{index-xhul-9iX.js → index-Zvh0r5Lt.js} +1 -1
- package/_assets/{index-nBe_oU0G.js → index-cPbHgYyr.js} +1 -1
- package/_assets/{index-CgAxepZC.js → index-fUWjTMSy.js} +1 -1
- package/_assets/{index--2hu34yL.js → index-kngovSRn.js} +1 -1
- package/_assets/{index-Dmg93p28.js → index-rSQnRqcs.js} +1 -1
- package/_assets/{index-Bmjy2mpL.js → index-uRRgUqn2.js} +1 -1
- package/_assets/{index-MmMSnATW.js → index-xqlURRt6.js} +1 -1
- package/_assets/{index-eU7Hyz9Z.js → index-z_VEn6An.js} +1 -1
- package/_assets/{index.es-DHidcgy5.js → index.es-ClGX6azd.js} +1 -1
- package/_assets/{index.es-Cn1zNa1z.js → index.es-DEd0yiWT.js} +4 -4
- package/_assets/{index.es-GVwle0q7.js → index.es-DUY_zrrQ.js} +1 -1
- package/_assets/{localBatchGatewayRequest-VWgW7Rrx.js → localBatchGatewayRequest-DN2xsMJ_.js} +1 -1
- package/_assets/{networks-CDvdXnK2.js → networks-CDFMzeLC.js} +1 -1
- package/_assets/{onramp-DLXpeqxV.js → onramp-BW3vCZnx.js} +1 -1
- package/_assets/{openzeppelin-F7uG1PQF.js → openzeppelin-CUcdj_sx.js} +1 -1
- package/_assets/{parseNft-D-HVZytL.js → parseNft-G6_xBphx.js} +2 -2
- package/_assets/{parseSignature-Ck0-hAYX.js → parseSignature-CIXTBJVX.js} +1 -1
- package/_assets/{parseSignature-Bajk-MJ2.js → parseSignature-DRZnwzny.js} +3 -3
- package/_assets/{passkeys-DTp9eXzY.js → passkeys-Kq30ZnPW.js} +1 -1
- package/_assets/{pay-with-exchange-B7T027Na.js → pay-with-exchange-wv1lVt88.js} +1 -1
- package/_assets/{qr-overlay-D24Rmf2y.js → qr-overlay-BNvjvuvd.js} +1 -1
- package/_assets/{receive-Dpi-pR18.js → receive-BU-20CjU.js} +1 -1
- package/_assets/{resolveImplementation-zRiJR6hj.js → resolveImplementation-C-p0Txrw.js} +1 -1
- package/_assets/{rpc-DBs1enVe.js → rpc-D0gBTa6Z.js} +1 -1
- package/_assets/{secp256k1-DlBFD_9l.js → secp256k1-B3k0VS5Y.js} +1 -1
- package/_assets/{secp256k1-CFlVBTcQ.js → secp256k1-C_-lAZcz.js} +1 -1
- package/_assets/{secp256k1-D988VQxR.js → secp256k1-YCpzKzUb.js} +1 -1
- package/_assets/{send-C--S0H3a.js → send-BRaIAbAO.js} +1 -1
- package/_assets/{send-batch-transaction-BsTouWWn.js → send-batch-transaction-Bab8Fd2d.js} +1 -1
- package/_assets/{send-eip712-transaction-CVPyso6U.js → send-eip712-transaction-CKAs5XET.js} +2 -2
- package/_assets/{send-gasless-transaction-B_ncM11b.js → send-gasless-transaction-CiFZmQQQ.js} +2 -2
- package/_assets/{send-transaction-CQNEiR4D.js → send-transaction-DOvrVTQH.js} +2 -2
- package/_assets/{sendMetaTransaction-BkMNQLKq.js → sendMetaTransaction-D69U0yOu.js} +1 -1
- package/_assets/{sendRawTransaction-eF-4-IOR.js → sendRawTransaction-Cnl8KhyZ.js} +3 -3
- package/_assets/{serializeTransaction-E8IX_hjf.js → serializeTransaction--73AW1zM.js} +1 -1
- package/_assets/{session-proposal-B5Vbxh9X.js → session-proposal-DYdwdKre.js} +1 -1
- package/_assets/{session-request-YtoGiiaC.js → session-request-Dme0ul41.js} +2 -2
- package/_assets/{signing-ChPpUSja.js → signing-Bd3rbnSj.js} +3 -3
- package/_assets/{socials-OPF-4Wmw.js → socials-VohiP86p.js} +1 -1
- package/_assets/{styled-CI0T6-yj.js → styled-CvsbVgfF.js} +2 -2
- package/_assets/{swaps-D9XgTxrT.js → swaps-DKu-ROps.js} +1 -1
- package/_assets/{thirdweb-CJavbJGB.js → thirdweb-BMXspv9l.js} +3 -3
- package/_assets/{to-serializable-transaction-Capw1hGa.js → to-serializable-transaction-CX8P98IC.js} +2 -2
- package/_assets/{trade-encoding-CS-l5HWK.js → trade-encoding-BD8tpz7m.js} +1 -1
- package/_assets/{transactionReceipt-DoRy-YCC.js → transactionReceipt-C3xmpECX.js} +1 -1
- package/_assets/{transactions-DlPEEm5e.js → transactions-8lwN2rpf.js} +1 -1
- package/_assets/{useCreditPacks-_PiP2Q_K.js → useCreditPacks-B-QtC7sA.js} +1 -1
- package/_assets/{useImportable-Dur9WNgJ.js → useImportable-zF3kPKFU.js} +1 -1
- package/_assets/{useInfiniteGrid-OWa5mJdJ.js → useInfiniteGrid-Drc6luef.js} +1 -1
- package/_assets/{useTheme-DpoJyopi.js → useTheme-BXrN5D9V.js} +1 -1
- package/_assets/{verifyHash-BZZQrCdK.js → verifyHash-B5Ov596i.js} +1 -1
- package/_assets/{w3m-modal-BurrNe_2.js → w3m-modal-BfUiYkFq.js} +1 -1
- package/_assets/{w3m-modal-DVcmDyvT.js → w3m-modal-BiPLqXgA.js} +1 -1
- package/_assets/{wait-for-tx-receipt-DABDEQLt.js → wait-for-tx-receipt-DZxMxn7p.js} +1 -1
- package/_assets/{wallets-DsQIZNUu.js → wallets-ZPwMzIt3.js} +5 -5
- package/_assets/{web-connector-CBr7K2EN.js → web-connector-Dsb7R1Dr.js} +3 -3
- package/_assets/{writeContract-Clw7zVob.js → writeContract-BLACgB36.js} +1 -1
- package/_assets/{zoraTestnet-Dofh77OY.js → zoraTestnet-BCAU7V7m.js} +1 -1
- package/index.html +22 -12
- package/package.json +2 -2
- package/sitemap.xml +7 -6
- package/_assets/Creator-CVJd5TOb.js +0 -306
- package/_assets/ItemDetail-CacEb2nn.js +0 -3392
- package/_assets/LazyEmoteControls-DOn7IxHq.js +0 -2
- package/_assets/OutfitDetail-CSx4d1E1.js +0 -334
- package/_assets/builder-dRN2Kgse.js +0 -1
- package/_assets/disposePreview-DIA1G1eQ.js +0 -1
- package/_assets/index-CpUnpBQ7.js +0 -3378
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as j,t as ie,G as se,H as ae,J as ne,B as w,K as oe,k as R,L as re,n as le,q as de,d as a,M as B,N,O as ce,P as pe,Q as he,R as me,S as ue,U as xe,V as ge,W as fe,X as be,Y as ye,Z as ve,$ as je,a0 as we,a1 as ke,a2 as Ie,a3 as $e,w as E,a4 as Ce,a5 as Ee,a6 as ze,a7 as Le,a8 as Oe,a9 as Se}from"./index-DvGpQtXK.js";import{E as _}from"./ErrorNotice-MWF7JXST.js";import{E as Ae}from"./LazyEmoteControls-COW8eJUD.js";import{O as Ne}from"./OutfitPreview-C2-ueSaA.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./disposePreview-8oEf57G7.js";const{colors:o,radius:Fe,media:d}=ie,H=t.div`
|
|
2
|
+
max-width: 1721px;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
`,Te=t.nav`
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
font-size: 13px;
|
|
9
|
+
color: ${o.muted};
|
|
10
|
+
margin-bottom: 18px;
|
|
11
|
+
`,F=t(k)`
|
|
12
|
+
color: ${o.muted};
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
color: ${o.text};
|
|
16
|
+
}
|
|
17
|
+
`,Pe=t.span`
|
|
18
|
+
color: ${o.text};
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
`,K=t.div`
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
|
|
26
|
+
gap: 40px;
|
|
27
|
+
align-items: stretch;
|
|
28
|
+
height: calc(100dvh - 240px);
|
|
29
|
+
min-height: 520px;
|
|
30
|
+
|
|
31
|
+
${d.maxWidth("mobile")} {
|
|
32
|
+
grid-template-columns: 1fr;
|
|
33
|
+
gap: 16px;
|
|
34
|
+
height: auto;
|
|
35
|
+
min-height: 0;
|
|
36
|
+
}
|
|
37
|
+
`,q=t.div`
|
|
38
|
+
position: relative;
|
|
39
|
+
border-radius: 24px;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
background: ${o.media};
|
|
42
|
+
|
|
43
|
+
${d.maxWidth("mobile")} {
|
|
44
|
+
aspect-ratio: 1 / 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
& iframe {
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
border: 0;
|
|
51
|
+
display: block;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-preview-viewport] {
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset: 0;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
}
|
|
59
|
+
`,We=t.div`
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset: 0;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
|
|
64
|
+
& [class*='MuiBox'] {
|
|
65
|
+
pointer-events: auto;
|
|
66
|
+
}
|
|
67
|
+
`,Me=t.img`
|
|
68
|
+
position: absolute;
|
|
69
|
+
inset: 0;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
object-fit: contain;
|
|
73
|
+
`,D=t.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: 15px;
|
|
77
|
+
min-height: 0;
|
|
78
|
+
`,Re=t.h1`
|
|
79
|
+
font-size: 28px;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
overflow-wrap: anywhere;
|
|
82
|
+
`,Be=t.p`
|
|
83
|
+
font-size: 12px;
|
|
84
|
+
font-weight: 500;
|
|
85
|
+
letter-spacing: 0.04em;
|
|
86
|
+
text-transform: uppercase;
|
|
87
|
+
color: ${o.muted1};
|
|
88
|
+
`,_e=t.div`
|
|
89
|
+
flex: 0 1 auto;
|
|
90
|
+
min-height: 0;
|
|
91
|
+
overflow-y: auto;
|
|
92
|
+
/* Breathing room INSIDE the scroller (with the matching negative margin re-aligning the cards):
|
|
93
|
+
the hover zoom + ring + glow would otherwise be cropped by the overflow clip. */
|
|
94
|
+
padding: 8px 10px;
|
|
95
|
+
margin: -8px -10px;
|
|
96
|
+
|
|
97
|
+
${d.maxWidth("mobile")} {
|
|
98
|
+
overflow: visible;
|
|
99
|
+
padding: 0;
|
|
100
|
+
margin: 0;
|
|
101
|
+
}
|
|
102
|
+
`,He=t.ul`
|
|
103
|
+
list-style: none;
|
|
104
|
+
margin: 0;
|
|
105
|
+
padding: 0;
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
gap: 10px;
|
|
109
|
+
`,Ke=t.li`
|
|
110
|
+
position: relative;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: stretch;
|
|
113
|
+
gap: 14px;
|
|
114
|
+
border-radius: 16px;
|
|
115
|
+
background: ${o.bg};
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
isolation: isolate;
|
|
118
|
+
transition:
|
|
119
|
+
box-shadow 0.35s ease,
|
|
120
|
+
transform 0.25s ease;
|
|
121
|
+
|
|
122
|
+
&::after {
|
|
123
|
+
${se};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&::before {
|
|
127
|
+
content: '';
|
|
128
|
+
position: absolute;
|
|
129
|
+
inset: 0;
|
|
130
|
+
z-index: 5;
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
border-radius: inherit;
|
|
133
|
+
${ae};
|
|
134
|
+
opacity: 0;
|
|
135
|
+
transition: opacity 0.3s ease;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@media (hover: hover) {
|
|
139
|
+
&:hover,
|
|
140
|
+
&:focus-within {
|
|
141
|
+
${ne};
|
|
142
|
+
transform: scale(1.015);
|
|
143
|
+
/* Above the neighbouring rows while zoomed, or the next card paints over the growth. */
|
|
144
|
+
z-index: 6;
|
|
145
|
+
}
|
|
146
|
+
&:hover::before,
|
|
147
|
+
&:focus-within::before {
|
|
148
|
+
opacity: 1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@media (prefers-reduced-motion: reduce) {
|
|
153
|
+
transition: none;
|
|
154
|
+
|
|
155
|
+
&:hover,
|
|
156
|
+
&:focus-within {
|
|
157
|
+
transform: none;
|
|
158
|
+
}
|
|
159
|
+
&::before {
|
|
160
|
+
transition: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&[data-state='unavailable'],
|
|
165
|
+
&[data-state='missing'] {
|
|
166
|
+
opacity: 0.55;
|
|
167
|
+
}
|
|
168
|
+
`,qe=t(k)`
|
|
169
|
+
position: absolute;
|
|
170
|
+
inset: 0;
|
|
171
|
+
z-index: 1;
|
|
172
|
+
`,De=t.img`
|
|
173
|
+
width: 96px;
|
|
174
|
+
height: 96px;
|
|
175
|
+
object-fit: cover;
|
|
176
|
+
background: ${o.panel};
|
|
177
|
+
flex-shrink: 0;
|
|
178
|
+
|
|
179
|
+
${d.maxWidth("mobile")} {
|
|
180
|
+
width: 88px;
|
|
181
|
+
height: 88px;
|
|
182
|
+
}
|
|
183
|
+
`,Ue=t.span`
|
|
184
|
+
width: 96px;
|
|
185
|
+
height: 96px;
|
|
186
|
+
background: ${o.panel};
|
|
187
|
+
flex-shrink: 0;
|
|
188
|
+
|
|
189
|
+
${d.maxWidth("mobile")} {
|
|
190
|
+
width: 88px;
|
|
191
|
+
height: 88px;
|
|
192
|
+
}
|
|
193
|
+
`,T=t.div`
|
|
194
|
+
flex: 1;
|
|
195
|
+
min-width: 0;
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
gap: 3px;
|
|
200
|
+
padding: 10px 14px 10px 0;
|
|
201
|
+
`,z=t.span`
|
|
202
|
+
font-size: 14px;
|
|
203
|
+
font-weight: 600;
|
|
204
|
+
white-space: nowrap;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
text-overflow: ellipsis;
|
|
207
|
+
`,Ve=t(k)`
|
|
208
|
+
position: relative;
|
|
209
|
+
z-index: 2;
|
|
210
|
+
align-self: flex-start;
|
|
211
|
+
font-size: 13px;
|
|
212
|
+
color: ${o.muted};
|
|
213
|
+
|
|
214
|
+
&:hover {
|
|
215
|
+
color: ${o.text};
|
|
216
|
+
text-decoration: underline;
|
|
217
|
+
}
|
|
218
|
+
`,P=t.span`
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
gap: 6px;
|
|
222
|
+
margin-top: 2px;
|
|
223
|
+
`,Ge=t.span`
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: 5px;
|
|
227
|
+
font-size: 16px;
|
|
228
|
+
font-weight: 600;
|
|
229
|
+
white-space: nowrap;
|
|
230
|
+
`,y=t.span`
|
|
231
|
+
font-size: 12px;
|
|
232
|
+
font-weight: 400;
|
|
233
|
+
padding: 2px 8px;
|
|
234
|
+
border-radius: ${Fe.chip};
|
|
235
|
+
background: ${o.chip};
|
|
236
|
+
color: ${o.text2};
|
|
237
|
+
white-space: nowrap;
|
|
238
|
+
`,Qe=t.span`
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: 3px;
|
|
242
|
+
margin-left: auto;
|
|
243
|
+
|
|
244
|
+
${d.maxWidth("mobile")} {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
247
|
+
`,v=t(oe)`
|
|
248
|
+
&[data-variant='smart'] {
|
|
249
|
+
gap: 2px;
|
|
250
|
+
background: ${o.chip};
|
|
251
|
+
color: ${o.text2};
|
|
252
|
+
text-transform: uppercase;
|
|
253
|
+
letter-spacing: 0.02em;
|
|
254
|
+
}
|
|
255
|
+
`,Je=t.p`
|
|
256
|
+
margin-top: 8px;
|
|
257
|
+
`,Xe=t.div`
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
align-items: flex-start;
|
|
261
|
+
gap: 12px;
|
|
262
|
+
padding: 8px 0;
|
|
263
|
+
`,Ye=t.div`
|
|
264
|
+
display: flex;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
gap: 12px;
|
|
267
|
+
padding-top: 12px;
|
|
268
|
+
border-top: 1px solid ${o.line};
|
|
269
|
+
|
|
270
|
+
${d.maxWidth("mobile")} {
|
|
271
|
+
/* Sticky, not fixed: it rides the viewport bottom while the list is longer than the screen,
|
|
272
|
+
then STOPS at the list's end (its natural place as the column's last child) when the user
|
|
273
|
+
scrolls on toward the footer. Negative margin restores the full-bleed bar inside the page's
|
|
274
|
+
16px gutter. */
|
|
275
|
+
position: sticky;
|
|
276
|
+
bottom: 0;
|
|
277
|
+
z-index: 5;
|
|
278
|
+
margin: 40px -16px 0;
|
|
279
|
+
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
|
|
280
|
+
border-top: 0;
|
|
281
|
+
background: ${o.softWhite};
|
|
282
|
+
box-shadow: 0 -4px 16px rgba(22, 21, 24, 0.12);
|
|
283
|
+
}
|
|
284
|
+
`,Ze=t.div`
|
|
285
|
+
display: flex;
|
|
286
|
+
align-items: center;
|
|
287
|
+
justify-content: space-between;
|
|
288
|
+
|
|
289
|
+
${d.maxWidth("mobile")} {
|
|
290
|
+
/* The phone CTA carries the price itself (the Figma bar). */
|
|
291
|
+
display: none;
|
|
292
|
+
}
|
|
293
|
+
`,et=t.span`
|
|
294
|
+
font-size: 14px;
|
|
295
|
+
font-weight: 600;
|
|
296
|
+
letter-spacing: 0.04em;
|
|
297
|
+
text-transform: uppercase;
|
|
298
|
+
color: ${o.muted1};
|
|
299
|
+
`,tt=t.span`
|
|
300
|
+
display: inline-flex;
|
|
301
|
+
align-items: center;
|
|
302
|
+
gap: 6px;
|
|
303
|
+
font-size: 26px;
|
|
304
|
+
font-weight: 800;
|
|
305
|
+
`,it=t(w)`
|
|
306
|
+
width: 100%;
|
|
307
|
+
min-height: 52px;
|
|
308
|
+
border-radius: 16px;
|
|
309
|
+
display: inline-flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
justify-content: center;
|
|
312
|
+
gap: 10px;
|
|
313
|
+
`,st=t.span`
|
|
314
|
+
display: none;
|
|
315
|
+
|
|
316
|
+
${d.maxWidth("mobile")} {
|
|
317
|
+
display: inline-flex;
|
|
318
|
+
align-items: center;
|
|
319
|
+
gap: 5px;
|
|
320
|
+
font-size: 16px;
|
|
321
|
+
}
|
|
322
|
+
`,W=t.div`
|
|
323
|
+
min-height: 52vh;
|
|
324
|
+
display: flex;
|
|
325
|
+
flex-direction: column;
|
|
326
|
+
align-items: center;
|
|
327
|
+
justify-content: center;
|
|
328
|
+
text-align: center;
|
|
329
|
+
gap: 14px;
|
|
330
|
+
`,at=t(j)`
|
|
331
|
+
opacity: 0.4;
|
|
332
|
+
`,nt=t.h1`
|
|
333
|
+
font-size: 24px;
|
|
334
|
+
`,M="outfit-detail-preview";function bt(){const{id:i}=te(),n=R(f=>f.session),c=re(),g=c==="creator",{data:r,isError:I,refetch:m}=le({queryKey:["outfit",i,g],enabled:N()&&!!i,staleTime:6e4,queryFn:()=>Se(i,g&&n?n.identity:void 0)}),l=!N()||!i||r===null&&c!=="pending";return de(l?{title:a("seo.outfit.notFoundTitle"),noindex:!0}:r?{title:r.name,image:B(r.thumbnailHash)??void 0}:{}),l?e.jsxs(W,{"data-testid":"outfit-notfound",children:[e.jsx(at,{name:"cart",size:44}),e.jsx(nt,{children:a("outfits.detail.notFoundTitle")}),e.jsx("p",{className:"muted",children:a("outfits.detail.notFoundBody")}),e.jsx(w,{as:k,to:"/items",variant:"purple",children:a("notFound.cta")})]}):I?e.jsxs(W,{"data-testid":"outfit-detail-error",children:[e.jsx(_,{message:a("outfits.errors.generic")}),e.jsx(w,{variant:"purple",onClick:()=>void m(),children:a("outfits.detail.retry")})]}):r?e.jsx(rt,{outfit:r}):e.jsx(H,{"aria-busy":"true","data-testid":"outfit-detail-loading",children:e.jsxs(K,{children:[e.jsx(q,{children:e.jsx("span",{className:"skeleton",style:{position:"absolute",inset:0},"aria-hidden":!0})}),e.jsxs(D,{children:[e.jsx("span",{className:"skeleton",style:{width:"60%",height:32},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"40%",height:16},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"100%",height:48},"aria-hidden":!0})]})]})})}function ot({item:i}){const n=Ce(i),c=Ee(i.gender);return e.jsxs(Qe,{children:[i.rarity?e.jsx(v,{"data-variant":"rarity",style:{background:Oe(i.rarity),color:Le(i.rarity)},title:ze(i.rarity),children:i.rarity}):null,i.isSmart?e.jsxs(v,{"data-variant":"smart",children:[e.jsx(j,{name:"smart",size:13}),a("assetCard.smart")]}):null,n?e.jsx(v,{"data-variant":"icon",children:e.jsx(j,{name:n})}):null,c?e.jsx(v,{"data-variant":"icon",children:e.jsx(j,{name:c})}):null]})}function rt({outfit:i}){const n=ce(i),{split:c,availableCount:g,totalCredits:r,addOutfit:I,isAdding:m}=pe(i,n),l=R(s=>{var x;return(x=s.session)==null?void 0:x.address}),f=he(s=>s.items),L=p.useMemo(()=>new Set(f.map(me)),[f]),O=B(i.thumbnailHash),S=p.useRef(null);p.useEffect(()=>{S.current!==i.id&&(S.current=i.id,ue("Shop Outfit Viewed",{outfit_id:i.id,item_count:i.items.length}))},[i.id,i.items.length]);const $=p.useMemo(()=>i.items.map(s=>{const x=xe(s),C=n.byKey.get(x)??null;return{key:x,item:C,state:C?ge(C,{address:l,cartKeys:L}):"missing"}}),[i,n.byKey,l,L]),{data:U,isFetched:V}=fe(l),G=!l||V,Q=!!l&&!!U,J=i.bodyShape==="female"?be:i.bodyShape==="male"?ye:void 0,u=p.useMemo(()=>$.map(s=>s.item).filter(s=>!!s),[$]),A=p.useMemo(()=>ve(u),[u]),X=p.useMemo(()=>!!je(u),[u]),Y=p.useMemo(()=>u.map(s=>we(s)??"").filter(Boolean),[u]),h=ke({address:l,tryOnUrns:A,tryOnCategories:Y}),Z=i.items.length,ee=!n.isLoading&&!n.isError,b=c.purchasable.length;return e.jsxs(H,{"data-testid":"outfit-detail",children:[e.jsxs(Te,{"aria-label":a("outfits.detail.breadcrumbAria"),children:[e.jsx(F,{to:"/overview",children:a("nav.overview")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(F,{to:"/overview",children:a("outfits.detail.breadcrumbLooks")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pe,{children:i.name})]}),e.jsxs(K,{children:[e.jsx(q,{"data-testid":"outfit-detail-preview",style:{background:Ie(i)},children:O&&!n.isLoading&&A.length===0?e.jsx(Me,{src:O,alt:i.name}):e.jsx(Ne,{id:M,profile:h.profile,bodyShape:h.bodyShape??(Q?void 0:J),urns:h.urns,skin:h.skin,hair:h.hair,eyes:h.eyes,enabled:G&&!h.isLoading&&!n.isLoading,controls:X?e.jsx(We,{"data-testid":"outfit-emote-controls",children:e.jsx(Ae,{wearablePreviewId:M,hideFrameInput:!0})}):null})}),e.jsxs(D,{children:[e.jsx(Re,{children:i.name}),e.jsx(Be,{"data-testid":"outfit-detail-meta",children:a("outfits.detail.itemsCount",{count:Z})}),n.isError?e.jsxs(Xe,{children:[e.jsx(_,{message:a("outfits.detail.resolveError"),testId:"outfit-detail-resolve-error"}),e.jsx(w,{variant:"outline","data-testid":"outfit-detail-retry",onClick:n.retry,children:a("outfits.detail.retry")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(_e,{children:[e.jsx(He,{children:$.map(s=>e.jsx(Ke,{"data-testid":"outfit-detail-item","data-state":s.state,children:s.item?e.jsxs(e.Fragment,{children:[e.jsx(qe,{to:`/item/${s.item.contractAddress}/${s.item.itemId}`,state:{item:s.item},"aria-label":s.item.name}),e.jsx(De,{src:s.item.thumbnail,alt:"",loading:"lazy"}),e.jsxs(T,{children:[e.jsx(z,{children:s.item.name}),s.item.creator?e.jsx(Ve,{to:`/items/creator/${s.item.creator}`,children:e.jsx($e,{address:s.item.creator})}):null,e.jsxs(P,{children:[s.state!=="unavailable"?e.jsxs(Ge,{children:[e.jsx(E,{size:15}),s.item.priceCredits.toLocaleString()]}):null,s.state==="unavailable"?e.jsx(y,{children:a("outfits.card.unavailable")}):s.state==="own_listing"?e.jsx(y,{children:a("outfits.detail.yourListing")}):s.state==="in_cart"?e.jsx(y,{children:a("outfits.detail.inCart")}):null,e.jsx(ot,{item:s.item})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{className:n.isLoading?"skeleton":void 0,"aria-hidden":!0}),e.jsx(T,{children:n.isLoading?e.jsx(z,{children:e.jsx("span",{className:"skeleton",style:{display:"block",width:"70%",height:14}})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"muted",children:a("outfits.card.unavailable")}),e.jsx(P,{children:e.jsx(y,{children:a("outfits.card.unavailable")})})]})})]})},s.key))}),ee&&c.ownListing.length>0?e.jsx(Je,{className:"muted small",children:a("outfits.detail.yourListingHint")}):null]}),e.jsxs(Ye,{"data-testid":"outfit-detail-ctabar",children:[e.jsxs(Ze,{children:[e.jsx(et,{children:a("outfits.detail.totalPrice")}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:64,height:26},"aria-hidden":!0}):e.jsxs(tt,{children:[e.jsx(E,{size:22}),r.toLocaleString()]})]}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:"100%",height:52,borderRadius:26},"aria-hidden":!0}):e.jsxs(it,{variant:"purple","data-testid":"outfit-detail-cta",onClick:I,disabled:m||b===0,"aria-busy":m||void 0,children:[m?a("outfits.card.adding"):b>0?a("outfits.detail.addCount",{count:b}):g>0?a("outfits.detail.nothingToAdd"):a("outfits.card.unavailable"),!m&&b>0?e.jsxs(st,{children:[e.jsx(E,{size:16}),r.toLocaleString()]}):null]})]})]})]})]})]})}export{bt as OutfitDetail,bt as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r,j as n}from"./react-DehiWSvs.js";import{d as v}from"./dcl-schemas-Dr9BTjb7.js";import{s as R,
|
|
1
|
+
import{r,j as n}from"./react-DehiWSvs.js";import{d as v}from"./dcl-schemas-Dr9BTjb7.js";import{s as R,Q as b,c as F,aa as O,d as S}from"./index-DvGpQtXK.js";import{u as B,d as W}from"./disposePreview-8oEf57G7.js";const H=R.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
inset: 0;
|
|
4
4
|
display: grid;
|
|
5
5
|
place-items: center;
|
|
6
|
-
`;function q({id:a,profile:i,bodyShape:g,urns:s,enabled:c=!0,skin:l,hair:f,eyes:d,controls:w}){const E=b(t=>t.fittingOpen),{ref:x,active:h}=B(),e=c&&s.length>0&&h&&!E,y=s.length>0?s[0].includes(":amoy:"):F.chainId===80002,[j,o]=r.useState(!1),A=s.join(",");r.useEffect(()=>{o(!1)},[A,i,l,f,d]),r.useEffect(()=>{e&&o(!1)},[e]);const[
|
|
6
|
+
`;function q({id:a,profile:i,bodyShape:g,urns:s,enabled:c=!0,skin:l,hair:f,eyes:d,controls:w}){const E=b(t=>t.fittingOpen),{ref:x,active:h}=B(),e=c&&s.length>0&&h&&!E,y=s.length>0?s[0].includes(":amoy:"):F.chainId===80002,[j,o]=r.useState(!1),A=s.join(",");r.useEffect(()=>{o(!1)},[A,i,l,f,d]),r.useEffect(()=>{e&&o(!1)},[e]);const[I,m]=r.useState(!1);r.useEffect(()=>{if(!e){m(!1);return}let t=0,P=0;const p=()=>{document.getElementById(a)?m(!0):P++<300&&(t=requestAnimationFrame(p))};return p(),()=>cancelAnimationFrame(t)},[e,a]);const u=r.useRef(null);return r.useEffect(()=>{if(e)return()=>{W(u.current),u.current=null}},[e]),n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:x,"data-preview-viewport":!0,"aria-hidden":!0}),e?n.jsx(O,{id:a,profile:i,bodyShape:g,urns:s,skin:l,hair:f,eyes:d,type:v.PreviewType.AVATAR,emote:v.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:y,onLoad:()=>{var t;o(!0),u.current=((t=document.getElementById(a))==null?void 0:t.contentWindow)??null}},i):null,I?w:null,c&&s.length===0?null:!e||!j?n.jsx(H,{"aria-busy":"true","aria-label":S("spinner.loading"),children:n.jsx("span",{className:"spinner","aria-hidden":!0})}):null]})}export{q as O};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";import{s as o,t as dt,I as K,
|
|
1
|
+
import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";import{s as o,t as dt,I as K,aB as Xt,d as e,w as st,B as x,af as kt,k as V,L as Yt,q as Zt,x as Ct,n as Tt,O as te,U as N,aC as Q,aD as ee,aE as ie,aF as J,Z as se,$ as oe,X as ae,Y as ne,M as It,a2 as re,aG as ot,aH as de,aI as le,aJ as ue,z as F,aK as Et,aL as Lt,aM as O,A as at,aN as nt,aO as ce,aP as pe,aQ as fe,S as me,aR as he,aS as xe,a9 as ge}from"./index-DvGpQtXK.js";import{E as H}from"./ErrorNotice-MWF7JXST.js";import{L as be}from"./LoadMore-CIWThu0V.js";import{u as ye}from"./useInfiniteGrid-Drc6luef.js";import{O as je}from"./OutfitPreview-C2-ueSaA.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./disposePreview-8oEf57G7.js";const{colors:h,radius:X,media:ve}=dt,we=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -102,7 +102,7 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
102
102
|
color: ${h.accent};
|
|
103
103
|
background: ${h.bg};
|
|
104
104
|
border-radius: 50%;
|
|
105
|
-
`,
|
|
105
|
+
`,Re=[{key:"wearable",labelKey:"categories.wearables"},{key:"emote",labelKey:"categories.emotes"}];function ze({selectedKeys:r,onPick:m,canPick:f}){const[c,y]=d.useState("wearable"),[j,b]=d.useState(""),[s,L]=d.useState("");d.useEffect(()=>{const l=setTimeout(()=>L(j.trim()),300);return()=>clearTimeout(l)},[j]);const{items:C,isLoading:T,isPlaceholderData:u,isError:S,hasNextPage:I,isFetchingNextPage:Y,fetchNextPage:$}=ye(["outfit-picker",c,s],l=>Xt({search:s||void 0,category:c,onSale:!0,listingType:"primary",first:24,skip:l,sortBy:"cheapest"})),g=e(c==="emote"?"outfits.studio.searchEmotes":"outfits.studio.searchWearables"),_=new Set,M=C.filter(l=>{if(!l.itemId)return!1;const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`;return _.has(v)?!1:(_.add(v),!0)});return t.jsxs(we,{"data-testid":"outfit-picker",children:[t.jsx(Se,{role:"group","aria-label":e("outfits.studio.pickerCategory"),"data-testid":"outfit-picker-category",children:Re.map(({key:l,labelKey:v})=>t.jsx(ke,{type:"button","data-category":l,"data-selected":c===l||void 0,"aria-pressed":c===l,onClick:()=>{y(l),b("")},children:e(v)},l))}),t.jsxs($e,{children:[t.jsx(K,{name:"search",color:dt.colors.muted}),t.jsx("input",{value:j,placeholder:g,"aria-label":g,onChange:l=>b(l.target.value),"data-testid":"outfit-picker-search"})]}),S?t.jsx("p",{className:"muted small",children:e("outfits.errors.generic")}):T||u?t.jsx(jt,{"aria-busy":"true",children:Array.from({length:8},(l,v)=>t.jsx(Ce,{className:"skeleton","aria-hidden":!0},v))}):M.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noResults")}):t.jsx(jt,{children:M.map(l=>{const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`,U=r.has(v);return t.jsxs(Te,{type:"button","data-testid":"outfit-picker-item","data-selected":U||void 0,disabled:!U&&!f(l),onClick:()=>m(l),title:l.name,children:[t.jsx(Ie,{src:l.thumbnail,alt:"",loading:"lazy"}),t.jsx(Ee,{children:l.name}),t.jsxs(Le,{children:[t.jsx(st,{size:12}),l.priceCredits.toLocaleString()]}),U?t.jsx(Ne,{name:"check-rounded",size:18}):null]},v)})}),!S&&!T&&!u?t.jsx(be,{auto:!1,hasNextPage:!!I,isFetching:Y,onLoadMore:()=>void $()}):null]})}const{colors:a,radius:w,media:B,z:Pe}=dt,Nt=o.div`
|
|
106
106
|
max-width: 1200px;
|
|
107
107
|
margin: 0 auto;
|
|
108
108
|
display: flex;
|
|
@@ -118,11 +118,11 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
118
118
|
gap: 14px;
|
|
119
119
|
`,vt=o.h1`
|
|
120
120
|
font-size: 24px;
|
|
121
|
-
`,
|
|
121
|
+
`,Rt=o.div`
|
|
122
122
|
display: flex;
|
|
123
123
|
align-items: center;
|
|
124
124
|
gap: 12px;
|
|
125
|
-
`,
|
|
125
|
+
`,zt=o.h1`
|
|
126
126
|
font-size: 24px;
|
|
127
127
|
font-weight: 800;
|
|
128
128
|
margin-right: auto;
|
|
@@ -314,11 +314,11 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
314
314
|
place-items: center;
|
|
315
315
|
padding: 24px;
|
|
316
316
|
text-align: center;
|
|
317
|
-
`,
|
|
317
|
+
`,R=o.div`
|
|
318
318
|
display: flex;
|
|
319
319
|
flex-direction: column;
|
|
320
320
|
gap: 8px;
|
|
321
|
-
`,
|
|
321
|
+
`,z=o.label`
|
|
322
322
|
font-size: 13px;
|
|
323
323
|
font-weight: 700;
|
|
324
324
|
letter-spacing: 0.04em;
|
|
@@ -534,4 +534,4 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
534
534
|
display: flex;
|
|
535
535
|
flex-wrap: wrap;
|
|
536
536
|
gap: 10px;
|
|
537
|
-
`;function Ui(){const{id:r}=Qt(),{pathname:m}=Jt(),f=V(b=>b.session),c=V(b=>b.signIn),y=Yt();Zt({title:e("outfits.studio.title"),noindex:!0});const j=m.endsWith("/new")?"new":r?"edit":"list";return y==="pending"?t.jsx(P,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?y!=="creator"?t.jsxs(P,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:A,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(ki,{}):t.jsx(Ii,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(P,{"data-testid":"outfit-studio-signin",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"purple",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function Si({outfit:r}){const m=It(r.thumbnailHash);return m?t.jsx(Be,{style:{background:le(r)},children:t.jsx("img",{src:m,alt:"",loading:"lazy"})}):t.jsx(Me,{"aria-hidden":!0})}function ki(){const r=V(u=>u.session),m=Ct(),[f,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:s,isError:L,refetch:C}=Tt({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>xe(r.identity)});async function T(u,S){if(r){j(u.id);try{S==="delete"?(await ue(u.id,r.identity),F.success(e("outfits.studio.deleted"))):(await Et({...rt(u),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Lt(m)}catch(I){I instanceof O||at(I,{flow:`outfit-${S}`}),F.error(e(I instanceof O?nt(I.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Nt,{"data-testid":"outfit-studio-list",children:[t.jsxs(zt,{children:[t.jsx(Rt,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:A,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:3},(u,S)=>t.jsx(Ae,{className:"skeleton","aria-hidden":!0},S))}):L?t.jsxs(P,{children:[t.jsx(H,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void C(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(wt,{children:b.map(u=>t.jsxs(Fe,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(Si,{outfit:u}),t.jsxs(Ue,{children:[t.jsx(De,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(He,{children:[t.jsx(Pt,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(Ke,{children:[u.published?t.jsx(x,{as:A,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:A,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(_e,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),f?t.jsxs(We,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ge,{onClick:()=>c(null)}),t.jsxs(qe,{children:[t.jsx(Qe,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Je,{children:[f.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===f.id,onClick:()=>void T(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===f.id,onClick:()=>void T(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const St=["image/png","image/jpeg","image/webp"];function Ci(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:ot.from,gradientTo:ot.to,published:!1}}function rt(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function Ti(r){try{const m=sessionStorage.getItem(r);return m?JSON.parse(m):null}catch{return null}}function Ii({outfitId:r}){const m=r===null,f=`outfit-draft:${r??"new"}`,c=V(i=>i.session),y=Ct(),j=Vt(),[b]=d.useState(()=>Ti(f)),[s,L]=d.useState(()=>b??(m?Ci():null)),[C,T]=d.useState(!!b),{data:u,isLoading:S,isError:I,refetch:Y}=Tt({queryKey:["outfit",r,!0],enabled:!m&&!!c,staleTime:0,queryFn:()=>ge(r,c.identity)});d.useEffect(()=>{u&&L(i=>i??rt(u))},[u]);function $(i){L(n=>n&&{...n,...i}),T(!0)}d.useEffect(()=>{if(!(!s||!C))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,C,f]),d.useEffect(()=>{if(!C)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[C]),d.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const g=te(s??void 0),_=d.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(N)),[s]),M=i=>he((s==null?void 0:s.items)??[],i,g.byKey),l=i=>!!i.itemId&&M(i).length<=J;function v(i){!s||!l(i)||$({items:M(i)})}const[U,lt]=d.useState(null),E=d.useRef(null),Z=d.useRef(!0);d.useEffect(()=>(Z.current=!0,()=>{Z.current=!1}),[]);const[W,ut]=d.useState(!1),[Ft,G]=d.useState(null),[tt,ct]=d.useState(""),[Bt,pt]=d.useState(null),[k,Mt]=d.useState();d.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ft(){const i=fe(tt);if(!i){pt(e("outfits.studio.importError"));return}pt(null),ct(""),Mt(i.colors),$({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Ut(i){if(!i||!c)return;if(G(null),!St.includes(i.type)){G(e("outfits.errors.unsupportedType"));return}if(i.size>ce){G(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,lt(n),ut(!0);try{const p=await pe(i,c.identity);$({thumbnailHash:p})}catch(p){p instanceof O||at(p,{flow:"outfit-thumbnail"}),G(e(p instanceof O?nt(p.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),lt(null)}finally{ut(!1)}}const[D,mt]=d.useState(!1),[Dt,ht]=d.useState(null),et=!!s&&s.name.trim().length>0&&s.name.length<=60,Ht=!!s&&Q(s.gradientFrom)&&Q(s.gradientTo),xt=!!s&&s.items.some(i=>{const n=g.byKey.get(N(i));return!n||ee(n)}),gt=!!s&&et&&!!s.thumbnailHash&&Ht&&xt&&s.items.length>=ie&&s.items.length<=J;async function it(i){if(!(!c||!s||D)){mt(!0),ht(null);try{const n=await Et({...s,published:i},c.identity,m?"create":"update");if(!Z.current)return;sessionStorage.removeItem(f),L(rt(n)),T(!1),Lt(y),i&&!s.published?(me("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),m&&(y.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof O||at(n,{flow:"outfit-save"}),ht(e(n instanceof O?nt(n.code):"outfits.errors.generic"))}finally{mt(!1)}}}const q=d.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>g.byKey.get(N(i))).filter(i=>!!i),[s,g.byKey]),bt=d.useMemo(()=>se(q),[q]),Kt=d.useMemo(()=>{const i=oe(q);return i!=null&&i.itemId?N({contractAddress:i.contractAddress,itemId:i.itemId}):null},[q]),_t=(s==null?void 0:s.bodyShape)==="female"?ae:(s==null?void 0:s.bodyShape)==="male"?ne:void 0;if(!c)return null;if(!s)return I?t.jsxs(P,{children:[t.jsx(H,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void Y(),children:e("outfits.detail.retry")})]}):!S&&u===null?t.jsxs(P,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(x,{as:A,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(P,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const yt=U??It(s.thumbnailHash),Wt={...s,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Gt=s.items.reduce((i,n)=>{var p;return i+(((p=g.byKey.get(N(n)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Nt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(zt,{children:[t.jsx(Oe,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(Rt,{children:m?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Pt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Ve,{children:[t.jsxs(Xe,{children:[t.jsxs(Ze,{"data-testid":"outfit-studio-preview",style:{background:re(s)},children:[t.jsx(je,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:_t,urns:bt,skin:k==null?void 0:k.skin,hair:k==null?void 0:k.hair,eyes:k==null?void 0:k.eyes,enabled:!g.isLoading}),bt.length===0&&!g.isLoading?t.jsx(ti,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(z,{children:[t.jsx(R,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(ei,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(ii,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>$({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(z,{children:[t.jsx(R,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(oi,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(ai,{children:[t.jsx(ni,{type:"color",value:Q(s[i])?s[i]:ot.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>$({[i]:n.target.value.toLowerCase()})}),t.jsxs(ri,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(di,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!Q(s[i])||void 0,onChange:n=>{const p=n.target.value.trim().toLowerCase();$({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(z,{children:[t.jsx(R,{as:"span",children:e("outfits.studio.thumbnail")}),yt?t.jsx(si,{"data-busy":W||void 0,children:t.jsx("img",{src:yt,alt:""})}):null,t.jsxs(ui,{as:"label",variant:"outline",size:"sm","data-busy":W||void 0,children:[W?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:St.join(","),hidden:!0,disabled:W,onChange:i=>{var n;return void Ut((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(H,{message:Ft,testId:"outfit-studio-thumb-error"})]}),t.jsxs(z,{children:[t.jsx(R,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(li,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(de,{outfit:Wt,resolution:g})})]})]}),t.jsxs(Ye,{children:[t.jsxs(z,{children:[t.jsx(R,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(ci,{children:[t.jsx($t,{id:"outfit-import",value:tt,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>ct(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:tt.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(H,{message:Bt,testId:"outfit-studio-import-error"})]}),t.jsxs(z,{children:[t.jsx(R,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx($t,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>$({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(z,{children:[t.jsxs(R,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",J,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(pi,{children:s.items.map(i=>{const n=N(i),p=g.byKey.get(n);return t.jsxs(fi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(mi,{src:p.thumbnail,alt:""}):t.jsx(hi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(xi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?"…":e("outfits.card.unavailable")}),n===Kt?t.jsx(gi,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(bi,{children:[t.jsx(st,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(vi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>$({items:s.items.filter(qt=>N(qt)!==n)}),children:t.jsx(K,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(yi,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ji,{children:[t.jsx(st,{size:14}),Gt.toLocaleString()]})]}):null,s.items.length>=J?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(Re,{selectedKeys:_,onPick:v,canPick:l})]})]}),t.jsxs(wi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(H,{message:Dt,testId:"outfit-studio-save-error"}),et?!gt&&!s.published?t.jsx("p",{className:"muted small","data-testid":"outfit-studio-publish-hint",children:!xt&&s.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs($i,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:D||!et,onClick:()=>void it(s.published),children:D?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:D,onClick:()=>void it(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"purple","data-testid":"outfit-studio-publish",disabled:D||!gt,onClick:()=>void it(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ui as OutfitStudio,Ui as default};
|
|
537
|
+
`;function Ui(){const{id:r}=Qt(),{pathname:m}=Jt(),f=V(b=>b.session),c=V(b=>b.signIn),y=Yt();Zt({title:e("outfits.studio.title"),noindex:!0});const j=m.endsWith("/new")?"new":r?"edit":"list";return y==="pending"?t.jsx(P,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?y!=="creator"?t.jsxs(P,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:A,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(ki,{}):t.jsx(Ii,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(P,{"data-testid":"outfit-studio-signin",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"purple",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function Si({outfit:r}){const m=It(r.thumbnailHash);return m?t.jsx(Be,{style:{background:le(r)},children:t.jsx("img",{src:m,alt:"",loading:"lazy"})}):t.jsx(Me,{"aria-hidden":!0})}function ki(){const r=V(u=>u.session),m=Ct(),[f,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:s,isError:L,refetch:C}=Tt({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>xe(r.identity)});async function T(u,S){if(r){j(u.id);try{S==="delete"?(await ue(u.id,r.identity),F.success(e("outfits.studio.deleted"))):(await Et({...rt(u),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Lt(m)}catch(I){I instanceof O||at(I,{flow:`outfit-${S}`}),F.error(e(I instanceof O?nt(I.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Nt,{"data-testid":"outfit-studio-list",children:[t.jsxs(Rt,{children:[t.jsx(zt,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:A,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:3},(u,S)=>t.jsx(Ae,{className:"skeleton","aria-hidden":!0},S))}):L?t.jsxs(P,{children:[t.jsx(H,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void C(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(wt,{children:b.map(u=>t.jsxs(Fe,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(Si,{outfit:u}),t.jsxs(Ue,{children:[t.jsx(De,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(He,{children:[t.jsx(Pt,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(Ke,{children:[u.published?t.jsx(x,{as:A,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:A,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(_e,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),f?t.jsxs(We,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ge,{onClick:()=>c(null)}),t.jsxs(qe,{children:[t.jsx(Qe,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Je,{children:[f.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===f.id,onClick:()=>void T(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===f.id,onClick:()=>void T(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const St=["image/png","image/jpeg","image/webp"];function Ci(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:ot.from,gradientTo:ot.to,published:!1}}function rt(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function Ti(r){try{const m=sessionStorage.getItem(r);return m?JSON.parse(m):null}catch{return null}}function Ii({outfitId:r}){const m=r===null,f=`outfit-draft:${r??"new"}`,c=V(i=>i.session),y=Ct(),j=Vt(),[b]=d.useState(()=>Ti(f)),[s,L]=d.useState(()=>b??(m?Ci():null)),[C,T]=d.useState(!!b),{data:u,isLoading:S,isError:I,refetch:Y}=Tt({queryKey:["outfit",r,!0],enabled:!m&&!!c,staleTime:0,queryFn:()=>ge(r,c.identity)});d.useEffect(()=>{u&&L(i=>i??rt(u))},[u]);function $(i){L(n=>n&&{...n,...i}),T(!0)}d.useEffect(()=>{if(!(!s||!C))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,C,f]),d.useEffect(()=>{if(!C)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[C]),d.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const g=te(s??void 0),_=d.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(N)),[s]),M=i=>he((s==null?void 0:s.items)??[],i,g.byKey),l=i=>!!i.itemId&&M(i).length<=J;function v(i){!s||!l(i)||$({items:M(i)})}const[U,lt]=d.useState(null),E=d.useRef(null),Z=d.useRef(!0);d.useEffect(()=>(Z.current=!0,()=>{Z.current=!1}),[]);const[W,ut]=d.useState(!1),[Ft,G]=d.useState(null),[tt,ct]=d.useState(""),[Bt,pt]=d.useState(null),[k,Mt]=d.useState();d.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ft(){const i=fe(tt);if(!i){pt(e("outfits.studio.importError"));return}pt(null),ct(""),Mt(i.colors),$({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Ut(i){if(!i||!c)return;if(G(null),!St.includes(i.type)){G(e("outfits.errors.unsupportedType"));return}if(i.size>ce){G(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,lt(n),ut(!0);try{const p=await pe(i,c.identity);$({thumbnailHash:p})}catch(p){p instanceof O||at(p,{flow:"outfit-thumbnail"}),G(e(p instanceof O?nt(p.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),lt(null)}finally{ut(!1)}}const[D,mt]=d.useState(!1),[Dt,ht]=d.useState(null),et=!!s&&s.name.trim().length>0&&s.name.length<=60,Ht=!!s&&Q(s.gradientFrom)&&Q(s.gradientTo),xt=!!s&&s.items.some(i=>{const n=g.byKey.get(N(i));return!n||ee(n)}),gt=!!s&&et&&!!s.thumbnailHash&&Ht&&xt&&s.items.length>=ie&&s.items.length<=J;async function it(i){if(!(!c||!s||D)){mt(!0),ht(null);try{const n=await Et({...s,published:i},c.identity,m?"create":"update");if(!Z.current)return;sessionStorage.removeItem(f),L(rt(n)),T(!1),Lt(y),i&&!s.published?(me("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),m&&(y.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof O||at(n,{flow:"outfit-save"}),ht(e(n instanceof O?nt(n.code):"outfits.errors.generic"))}finally{mt(!1)}}}const q=d.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>g.byKey.get(N(i))).filter(i=>!!i),[s,g.byKey]),bt=d.useMemo(()=>se(q),[q]),Kt=d.useMemo(()=>{const i=oe(q);return i!=null&&i.itemId?N({contractAddress:i.contractAddress,itemId:i.itemId}):null},[q]),_t=(s==null?void 0:s.bodyShape)==="female"?ae:(s==null?void 0:s.bodyShape)==="male"?ne:void 0;if(!c)return null;if(!s)return I?t.jsxs(P,{children:[t.jsx(H,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void Y(),children:e("outfits.detail.retry")})]}):!S&&u===null?t.jsxs(P,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(x,{as:A,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(P,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const yt=U??It(s.thumbnailHash),Wt={...s,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Gt=s.items.reduce((i,n)=>{var p;return i+(((p=g.byKey.get(N(n)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Nt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Rt,{children:[t.jsx(Oe,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(zt,{children:m?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Pt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Ve,{children:[t.jsxs(Xe,{children:[t.jsxs(Ze,{"data-testid":"outfit-studio-preview",style:{background:re(s)},children:[t.jsx(je,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:_t,urns:bt,skin:k==null?void 0:k.skin,hair:k==null?void 0:k.hair,eyes:k==null?void 0:k.eyes,enabled:!g.isLoading}),bt.length===0&&!g.isLoading?t.jsx(ti,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(ei,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(ii,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>$({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(oi,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(ai,{children:[t.jsx(ni,{type:"color",value:Q(s[i])?s[i]:ot.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>$({[i]:n.target.value.toLowerCase()})}),t.jsxs(ri,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(di,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!Q(s[i])||void 0,onChange:n=>{const p=n.target.value.trim().toLowerCase();$({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.thumbnail")}),yt?t.jsx(si,{"data-busy":W||void 0,children:t.jsx("img",{src:yt,alt:""})}):null,t.jsxs(ui,{as:"label",variant:"outline",size:"sm","data-busy":W||void 0,children:[W?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:St.join(","),hidden:!0,disabled:W,onChange:i=>{var n;return void Ut((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(H,{message:Ft,testId:"outfit-studio-thumb-error"})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(li,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(de,{outfit:Wt,resolution:g})})]})]}),t.jsxs(Ye,{children:[t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(ci,{children:[t.jsx($t,{id:"outfit-import",value:tt,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>ct(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:tt.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(H,{message:Bt,testId:"outfit-studio-import-error"})]}),t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx($t,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>$({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(R,{children:[t.jsxs(z,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",J,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(pi,{children:s.items.map(i=>{const n=N(i),p=g.byKey.get(n);return t.jsxs(fi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(mi,{src:p.thumbnail,alt:""}):t.jsx(hi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(xi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?"…":e("outfits.card.unavailable")}),n===Kt?t.jsx(gi,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(bi,{children:[t.jsx(st,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(vi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>$({items:s.items.filter(qt=>N(qt)!==n)}),children:t.jsx(K,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(yi,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ji,{children:[t.jsx(st,{size:14}),Gt.toLocaleString()]})]}):null,s.items.length>=J?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(ze,{selectedKeys:_,onPick:v,canPick:l})]})]}),t.jsxs(wi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(H,{message:Dt,testId:"outfit-studio-save-error"}),et?!gt&&!s.published?t.jsx("p",{className:"muted small","data-testid":"outfit-studio-publish-hint",children:!xt&&s.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs($i,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:D||!et,onClick:()=>void it(s.published),children:D?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:D,onClick:()=>void it(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"purple","data-testid":"outfit-studio-publish",disabled:D||!gt,onClick:()=>void it(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ui as OutfitStudio,Ui as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{d as s,t as
|
|
1
|
+
import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{d as s,t as j,s as a,o as ce,B as q,q as de,k as pe,x as ue,bm as ge,br as me,bs as xe,bt as he,bu as F,I as N,bv as f,bw as fe,z as A}from"./index-DvGpQtXK.js";import{E as M}from"./ErrorNotice-MWF7JXST.js";import{F as w}from"./field.styles-O-FhYRsZ.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const ve="https://cdn.decentraland.org/@dcl/shop/0.7.1/_assets/template-cover-1-BETekfHg.jpeg",be="https://cdn.decentraland.org/@dcl/shop/0.7.1/_assets/template-cover-2-Dni9s0i_.jpeg",we=Object.assign({"../assets/creator-covers/template-cover-1.jpeg":ve,"../assets/creator-covers/template-cover-2.jpeg":be}),v=Object.entries(we).sort(([r],[u])=>r.localeCompare(u)).map(([r,u])=>({name:r.split("/").pop(),url:u})),je=ce`
|
|
2
2
|
to {
|
|
3
3
|
transform: rotate(360deg);
|
|
4
4
|
}
|
|
@@ -7,7 +7,7 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{d as s,t a
|
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
gap: 12px;
|
|
10
|
-
color: ${
|
|
10
|
+
color: ${j.colors.muted};
|
|
11
11
|
|
|
12
12
|
&[data-direction='row'] {
|
|
13
13
|
flex-direction: row;
|
|
@@ -20,9 +20,9 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{d as s,t a
|
|
|
20
20
|
flex: none;
|
|
21
21
|
border-radius: 50%;
|
|
22
22
|
border-style: solid;
|
|
23
|
-
border-color: ${
|
|
24
|
-
border-top-color: ${
|
|
25
|
-
animation: ${
|
|
23
|
+
border-color: ${j.colors.line};
|
|
24
|
+
border-top-color: ${j.colors.accent};
|
|
25
|
+
animation: ${je} 0.8s linear infinite;
|
|
26
26
|
|
|
27
27
|
&[data-size='small'] {
|
|
28
28
|
width: 18px;
|
|
@@ -46,11 +46,11 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{d as s,t a
|
|
|
46
46
|
`,$e=a.span`
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
font-weight: 600;
|
|
49
|
-
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:n,radius:_e,media:G}=
|
|
49
|
+
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:n,radius:_e,media:G}=j,Ee=a(ye)`
|
|
50
50
|
display: grid;
|
|
51
51
|
place-items: center;
|
|
52
52
|
min-height: 60vh;
|
|
53
|
-
`,ze=a(
|
|
53
|
+
`,ze=a(q)`
|
|
54
54
|
align-self: center;
|
|
55
55
|
min-width: 200px;
|
|
56
56
|
margin-top: 8px;
|
|
@@ -230,10 +230,10 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{d as s,t a
|
|
|
230
230
|
justify-content: flex-end;
|
|
231
231
|
gap: 12px;
|
|
232
232
|
margin-top: 8px;
|
|
233
|
-
`,Fe=a(
|
|
233
|
+
`,Fe=a(q)`
|
|
234
234
|
min-width: 180px;
|
|
235
235
|
|
|
236
236
|
${G.maxWidth("mobile")} {
|
|
237
237
|
width: 100%;
|
|
238
238
|
}
|
|
239
|
-
`,
|
|
239
|
+
`,V=1e6,W={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function Y(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function Ge(){de({title:s("seo.storeSettings.title"),noindex:!0});const{session:r,signIn:u}=pe(),S=le(),k=ue(),p=r==null?void 0:r.address,{data:$,isLoading:K}=ge(p),[o,g]=l.useState(W),[L,H]=l.useState(W),[y,x]=l.useState(),[h,I]=l.useState(!1),[c,_]=l.useState(null),[b,J]=l.useState({}),T=l.useRef(null);l.useEffect(()=>{if($){const e=me($);g(e),H(e),x(void 0),_(e.cover?{url:e.cover,name:e.coverName,hash:e.coverHash}:null)}},[$]),l.useEffect(()=>{let e=!1;return Promise.all(v.map(async i=>[i.name,await xe(i.url)])).then(i=>{e||J(Object.fromEntries(i))}).catch(()=>{}),()=>{e=!0}},[]);const E=l.useMemo(()=>{const e=v.find(d=>o.coverName===`cover/${d.name}`);if(e)return e.name;const i=o.coverHash?v.find(d=>b[d.name]===o.coverHash):void 0;return i==null?void 0:i.name},[o.coverName,o.coverHash,b]);l.useEffect(()=>{c!=null&&c.hash&&v.some(e=>b[e.name]===c.hash)&&_(null)},[b,c]);const B=y!==void 0&&y>V,Q=l.useMemo(()=>he.filter(e=>!F(e,o.links[e])),[o.links]),U=B||Q.length>0,z=l.useMemo(()=>JSON.stringify(o)!==JSON.stringify(L),[o,L]),X=z&&!U&&!h;if(l.useEffect(()=>{if(!z)return;const e=i=>{i.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[z]),!r)return t.jsxs(O,{"data-signin":!0,"aria-label":s("storeSettings.title"),children:[t.jsx(D,{children:s("storeSettings.title")}),t.jsx("p",{className:"muted",children:s("storeSettings.signInPrompt")}),t.jsx(ze,{variant:"purple",onClick:u,children:s("storeSettings.signIn")})]});function Z(e,i){x(void 0),g(d=>({...d,cover:i,coverName:`cover/${e}`,coverHash:""}))}const ee=["image/png","image/jpeg","image/webp"];function te(e){var P;const i=(P=e.target.files)==null?void 0:P[0];if(!i||!ee.includes(i.type))return;x(i.size);const d=`cover/${i.name}`,m=new FileReader;m.onload=()=>{const R=m.result;_({url:R,name:d,hash:""}),g(re=>({...re,cover:R,coverName:d,coverHash:""}))},m.readAsDataURL(i)}function ie(){c&&(x(void 0),g(e=>({...e,cover:c.url,coverName:c.name,coverHash:c.hash})))}function se(e,i){const d=i?(f[e]+i).replace(/\s/g,""):"";g(m=>({...m,links:{...m.links,[e]:d}}))}function ne(e){const i=o.links[e];return e==="website"?i:i.replace(f[e],"")}async function ae(){if(!(!p||!r)){I(!0);try{await fe(p,o,r.identity),H(o),x(void 0),await k.invalidateQueries({queryKey:["store",p.toLowerCase()]}),A.success(s("storeSettings.saved")),S(`/items/creator/${p}`)}catch{A.error(s("storeSettings.saveError"))}finally{I(!1)}}}return t.jsxs(O,{"aria-label":s("storeSettings.title"),children:[t.jsxs(Ne,{children:[t.jsxs(Ce,{children:[p?t.jsx(Le,{to:`/items/creator/${p}`,title:s("storeSettings.back"),"aria-label":s("storeSettings.back"),children:t.jsx(N,{name:"arrow-left"})}):null,t.jsx(D,{children:s("storeSettings.title")})]}),p?t.jsxs(He,{href:`/items/creator/${p}`,target:"_blank",rel:"noopener noreferrer",children:[s("storeSettings.seeAsGuest"),t.jsx(N,{name:"external-link"})]}):null]}),K?t.jsx(Ee,{size:"large",label:s("storeSettings.loading")}):t.jsxs(t.Fragment,{children:[t.jsxs(w,{children:[t.jsx("span",{className:"field__label",children:s("storeSettings.cover")}),t.jsxs(Be,{role:"group","aria-label":s("storeSettings.cover"),children:[v.map(e=>{const i=E===e.name;return t.jsx(C,{type:"button","data-testid":"cover-picker-tile","data-selected":i,"aria-pressed":i,onClick:()=>Z(e.name,e.url),children:t.jsx("img",{src:e.url,alt:"",loading:"lazy"})},e.name)}),c?t.jsx(C,{type:"button","data-testid":"cover-picker-tile","data-variant":"custom","data-selected":!E,"aria-pressed":!E,onClick:ie,children:t.jsx("img",{src:c.url,alt:""})}):null,t.jsxs(C,{type:"button","data-testid":"cover-picker-tile","data-variant":"upload",onClick:()=>{var e;return(e=T.current)==null?void 0:e.click()},children:[t.jsx(N,{name:"upload"}),t.jsx("span",{children:s("storeSettings.upload")})]}),t.jsx(Pe,{ref:T,type:"file",accept:"image/png, image/jpeg, image/webp","data-testid":"cover-picker-input",onChange:te})]}),B?t.jsx(M,{message:s("storeSettings.sizeError",{max:Y(V),current:Y(y)})}):null]}),t.jsxs(w,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.description")}),t.jsx("textarea",{value:o.description,rows:4,disabled:h,onChange:e=>g(i=>({...i,description:e.target.value}))})]}),t.jsxs(w,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.website")}),t.jsx("input",{type:"url",value:o.links.website,placeholder:f.website,disabled:h,onChange:e=>g(i=>({...i,links:{...i.links,website:e.target.value.replace(/\s/g,"")}}))}),F("website",o.links.website)?null:t.jsx(M,{message:s("storeSettings.linkError",{value:f.website})})]}),["twitter","discord","facebook"].map(e=>t.jsxs(w,{as:"label",children:[t.jsx("span",{className:"field__label",children:s(`storeSettings.${e}`)}),t.jsxs(Ie,{children:[t.jsx(Te,{children:f[e]}),t.jsx("input",{type:"text",value:ne(e),disabled:h,onChange:i=>se(e,i.target.value)})]})]},e)),t.jsx(Re,{children:t.jsx(Fe,{variant:"purple","data-testid":"store-settings-save",onClick:()=>void ae(),disabled:!X,children:h?s("storeSettings.saving"):s("storeSettings.save")})})]})]})}export{Ge as StoreSettings,Ge as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-DQ3AciL_.js","_assets/react-DehiWSvs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as t,_ as I,t as F,w as _,
|
|
2
|
+
import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as t,_ as I,t as F,w as _,ay as O,af as W,k as D,q,d as n,v as U,e as V,az as H,c as B,B as J,aA as X}from"./index-DvGpQtXK.js";import{w as G,S as K}from"./buy-gasless-BpGXC11T.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./authorizations-CboNrOcr.js";import"./sendMetaTransaction-D69U0yOu.js";import"./trade-encoding-BD8tpz7m.js";const Q=t.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|