@medialane/ui 0.403.0 → 0.406.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/account-page.cjs +3 -1
- package/dist/components/account-page.cjs.map +1 -1
- package/dist/components/account-page.d.cts +2 -2
- package/dist/components/account-page.d.ts +2 -2
- package/dist/components/account-page.js +3 -1
- package/dist/components/account-page.js.map +1 -1
- package/dist/components/asset-page.cjs +5 -9
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.d.cts +3 -4
- package/dist/components/asset-page.d.ts +3 -4
- package/dist/components/asset-page.js +3 -7
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/claim/claim-collection-panel.cjs +210 -0
- package/dist/components/claim/claim-collection-panel.cjs.map +1 -0
- package/dist/components/claim/claim-collection-panel.d.cts +8 -0
- package/dist/components/claim/claim-collection-panel.d.ts +8 -0
- package/dist/components/claim/claim-collection-panel.js +176 -0
- package/dist/components/claim/claim-collection-panel.js.map +1 -0
- package/dist/components/collection-page.cjs +5 -2
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.d.cts +2 -2
- package/dist/components/collection-page.d.ts +2 -2
- package/dist/components/collection-page.js +5 -2
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/collection-showcase.cjs +3 -3
- package/dist/components/collection-showcase.cjs.map +1 -1
- package/dist/components/collection-showcase.js +4 -4
- package/dist/components/collection-showcase.js.map +1 -1
- package/dist/components/collections-page.cjs +1 -1
- package/dist/components/collections-page.cjs.map +1 -1
- package/dist/components/collections-page.js +1 -1
- package/dist/components/collections-page.js.map +1 -1
- package/dist/components/creator-page.cjs +3 -1
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.d.cts +2 -2
- package/dist/components/creator-page.d.ts +2 -2
- package/dist/components/creator-page.js +3 -1
- package/dist/components/creator-page.js.map +1 -1
- package/dist/components/discover-page.cjs +2 -1
- package/dist/components/discover-page.cjs.map +1 -1
- package/dist/components/discover-page.d.cts +1 -1
- package/dist/components/discover-page.d.ts +1 -1
- package/dist/components/discover-page.js +2 -1
- package/dist/components/discover-page.js.map +1 -1
- package/dist/components/external-link-field.cjs.map +1 -1
- package/dist/components/external-link-field.d.cts +1 -2
- package/dist/components/external-link-field.d.ts +1 -2
- package/dist/components/external-link-field.js.map +1 -1
- package/dist/components/floating-comments-button.cjs +2 -2
- package/dist/components/floating-comments-button.cjs.map +1 -1
- package/dist/components/floating-comments-button.js +3 -3
- package/dist/components/floating-comments-button.js.map +1 -1
- package/dist/components/home-page.cjs +2 -1
- package/dist/components/home-page.cjs.map +1 -1
- package/dist/components/home-page.d.cts +1 -1
- package/dist/components/home-page.d.ts +1 -1
- package/dist/components/home-page.js +2 -1
- package/dist/components/home-page.js.map +1 -1
- package/dist/components/ip-type-page.cjs +2 -1
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.d.cts +1 -1
- package/dist/components/ip-type-page.d.ts +1 -1
- package/dist/components/ip-type-page.js +2 -1
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.cjs +1 -1
- package/dist/components/launchpad/edition-mint-schema.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +31 -35
- package/dist/components/launchpad/edition-mint-schema.d.ts +31 -35
- package/dist/components/launchpad/edition-mint-schema.js +1 -1
- package/dist/components/launchpad/edition-mint-schema.js.map +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-fields.d.cts +3 -3
- package/dist/components/launchpad/pop-create-fields.d.ts +3 -3
- package/dist/components/launchpad/pop-create-fields.js.map +1 -1
- package/dist/components/launchpad/pop-create-schema.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-schema.d.cts +6 -32
- package/dist/components/launchpad/pop-create-schema.d.ts +6 -32
- package/dist/components/launchpad/pop-create-schema.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/single-edition-mint.js +1 -1
- package/dist/components/launchpad/single-edition-mint.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +1 -1
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad-services.cjs +2 -2
- package/dist/components/launchpad-services.cjs.map +1 -1
- package/dist/components/launchpad-services.js +3 -3
- package/dist/components/launchpad-services.js.map +1 -1
- package/dist/components/lazy-panel.cjs +60 -0
- package/dist/components/lazy-panel.cjs.map +1 -0
- package/dist/components/lazy-panel.d.cts +14 -0
- package/dist/components/lazy-panel.d.ts +14 -0
- package/dist/components/lazy-panel.js +26 -0
- package/dist/components/lazy-panel.js.map +1 -0
- package/dist/components/listings-grid.cjs +9 -1
- package/dist/components/listings-grid.cjs.map +1 -1
- package/dist/components/listings-grid.d.cts +3 -2
- package/dist/components/listings-grid.d.ts +3 -2
- package/dist/components/listings-grid.js +9 -1
- package/dist/components/listings-grid.js.map +1 -1
- package/dist/components/markdown-renderer.cjs +49 -0
- package/dist/components/markdown-renderer.cjs.map +1 -0
- package/dist/components/markdown-renderer.d.cts +7 -0
- package/dist/components/markdown-renderer.d.ts +7 -0
- package/dist/components/markdown-renderer.js +19 -0
- package/dist/components/markdown-renderer.js.map +1 -0
- package/dist/components/markdown-text.cjs +3 -11
- package/dist/components/markdown-text.cjs.map +1 -1
- package/dist/components/markdown-text.js +3 -11
- package/dist/components/markdown-text.js.map +1 -1
- package/dist/components/marketplace/accept-offer-dialog.cjs +180 -0
- package/dist/components/marketplace/accept-offer-dialog.cjs.map +1 -0
- package/dist/components/marketplace/accept-offer-dialog.d.cts +17 -0
- package/dist/components/marketplace/accept-offer-dialog.d.ts +17 -0
- package/dist/components/marketplace/accept-offer-dialog.js +156 -0
- package/dist/components/marketplace/accept-offer-dialog.js.map +1 -0
- package/dist/components/marketplace/approve-mint-flow.cjs +85 -0
- package/dist/components/marketplace/approve-mint-flow.cjs.map +1 -0
- package/dist/components/marketplace/approve-mint-flow.d.cts +12 -0
- package/dist/components/marketplace/approve-mint-flow.d.ts +12 -0
- package/dist/components/marketplace/approve-mint-flow.js +61 -0
- package/dist/components/marketplace/approve-mint-flow.js.map +1 -0
- package/dist/components/marketplace/asset-market-actions.cjs +175 -0
- package/dist/components/marketplace/asset-market-actions.cjs.map +1 -0
- package/dist/components/marketplace/asset-market-actions.d.cts +9 -0
- package/dist/components/marketplace/asset-market-actions.d.ts +9 -0
- package/dist/components/marketplace/asset-market-actions.js +151 -0
- package/dist/components/marketplace/asset-market-actions.js.map +1 -0
- package/dist/components/marketplace/cancel-order-dialog.cjs +82 -0
- package/dist/components/marketplace/cancel-order-dialog.cjs.map +1 -0
- package/dist/components/marketplace/cancel-order-dialog.d.cts +17 -0
- package/dist/components/marketplace/cancel-order-dialog.d.ts +17 -0
- package/dist/components/marketplace/cancel-order-dialog.js +58 -0
- package/dist/components/marketplace/cancel-order-dialog.js.map +1 -0
- package/dist/components/marketplace/counter-offer-dialog.cjs +236 -0
- package/dist/components/marketplace/counter-offer-dialog.cjs.map +1 -0
- package/dist/components/marketplace/counter-offer-dialog.d.cts +16 -0
- package/dist/components/marketplace/counter-offer-dialog.d.ts +16 -0
- package/dist/components/marketplace/counter-offer-dialog.js +212 -0
- package/dist/components/marketplace/counter-offer-dialog.js.map +1 -0
- package/dist/components/marketplace/dialog-frame.cjs +65 -0
- package/dist/components/marketplace/dialog-frame.cjs.map +1 -0
- package/dist/components/marketplace/dialog-frame.d.cts +22 -0
- package/dist/components/marketplace/dialog-frame.d.ts +22 -0
- package/dist/components/marketplace/dialog-frame.js +38 -0
- package/dist/components/marketplace/dialog-frame.js.map +1 -0
- package/dist/components/marketplace/lazy-dialogs.cjs +66 -0
- package/dist/components/marketplace/lazy-dialogs.cjs.map +1 -0
- package/dist/components/marketplace/lazy-dialogs.d.cts +25 -0
- package/dist/components/marketplace/lazy-dialogs.d.ts +25 -0
- package/dist/components/marketplace/lazy-dialogs.js +26 -0
- package/dist/components/marketplace/lazy-dialogs.js.map +1 -0
- package/dist/components/marketplace/listing-dialog.cjs +183 -0
- package/dist/components/marketplace/listing-dialog.cjs.map +1 -0
- package/dist/components/marketplace/listing-dialog.d.cts +16 -0
- package/dist/components/marketplace/listing-dialog.d.ts +16 -0
- package/dist/components/marketplace/listing-dialog.js +159 -0
- package/dist/components/marketplace/listing-dialog.js.map +1 -0
- package/dist/components/marketplace/market-actions.cjs +59 -0
- package/dist/components/marketplace/market-actions.cjs.map +1 -0
- package/dist/components/marketplace/market-actions.d.cts +9 -0
- package/dist/components/marketplace/market-actions.d.ts +9 -0
- package/dist/components/marketplace/market-actions.js +35 -0
- package/dist/components/marketplace/market-actions.js.map +1 -0
- package/dist/components/marketplace/offer-dialog.cjs +194 -0
- package/dist/components/marketplace/offer-dialog.cjs.map +1 -0
- package/dist/components/marketplace/offer-dialog.d.cts +14 -0
- package/dist/components/marketplace/offer-dialog.d.ts +14 -0
- package/dist/components/marketplace/offer-dialog.js +170 -0
- package/dist/components/marketplace/offer-dialog.js.map +1 -0
- package/dist/components/marketplace/portfolio-actions.cjs +287 -0
- package/dist/components/marketplace/portfolio-actions.cjs.map +1 -0
- package/dist/components/marketplace/portfolio-actions.d.cts +16 -0
- package/dist/components/marketplace/portfolio-actions.d.ts +16 -0
- package/dist/components/marketplace/portfolio-actions.js +249 -0
- package/dist/components/marketplace/portfolio-actions.js.map +1 -0
- package/dist/components/marketplace/purchase-dialog.cjs +174 -0
- package/dist/components/marketplace/purchase-dialog.cjs.map +1 -0
- package/dist/components/marketplace/purchase-dialog.d.cts +12 -0
- package/dist/components/marketplace/purchase-dialog.d.ts +12 -0
- package/dist/components/marketplace/purchase-dialog.js +150 -0
- package/dist/components/marketplace/purchase-dialog.js.map +1 -0
- package/dist/components/marketplace/transfer-asset-dialog.cjs +74 -0
- package/dist/components/marketplace/transfer-asset-dialog.cjs.map +1 -0
- package/dist/components/marketplace/transfer-asset-dialog.d.cts +16 -0
- package/dist/components/marketplace/transfer-asset-dialog.d.ts +16 -0
- package/dist/components/marketplace/transfer-asset-dialog.js +50 -0
- package/dist/components/marketplace/transfer-asset-dialog.js.map +1 -0
- package/dist/components/marketplace-dialog-primitives.cjs +2 -2
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.d.cts +9 -4
- package/dist/components/marketplace-dialog-primitives.d.ts +9 -4
- package/dist/components/marketplace-dialog-primitives.js +2 -2
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-overlay.cjs +3 -64
- package/dist/components/media-wallet/media-wallet-overlay.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-overlay.js +4 -65
- package/dist/components/media-wallet/media-wallet-overlay.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-panel.cjs +102 -0
- package/dist/components/media-wallet/media-wallet-panel.cjs.map +1 -0
- package/dist/components/media-wallet/media-wallet-panel.d.cts +14 -0
- package/dist/components/media-wallet/media-wallet-panel.d.ts +14 -0
- package/dist/components/media-wallet/media-wallet-panel.js +72 -0
- package/dist/components/media-wallet/media-wallet-panel.js.map +1 -0
- package/dist/components/media-wallet/success-dialog.cjs +1 -1
- package/dist/components/media-wallet/success-dialog.cjs.map +1 -1
- package/dist/components/media-wallet/success-dialog.js +1 -1
- package/dist/components/media-wallet/success-dialog.js.map +1 -1
- package/dist/components/medialane-app.cjs +24 -1
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +7 -1
- package/dist/components/medialane-app.d.ts +7 -1
- package/dist/components/medialane-app.js +13 -1
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/motion-features.cjs +26 -0
- package/dist/components/motion-features.cjs.map +1 -0
- package/dist/components/motion-features.d.cts +2 -0
- package/dist/components/motion-features.d.ts +2 -0
- package/dist/components/motion-features.js +6 -0
- package/dist/components/motion-features.js.map +1 -0
- package/dist/components/motion-primitives.cjs +6 -6
- package/dist/components/motion-primitives.cjs.map +1 -1
- package/dist/components/motion-primitives.js +7 -7
- package/dist/components/motion-primitives.js.map +1 -1
- package/dist/components/nav-account-panel.cjs +75 -0
- package/dist/components/nav-account-panel.cjs.map +1 -0
- package/dist/components/nav-account-panel.d.cts +11 -0
- package/dist/components/nav-account-panel.d.ts +11 -0
- package/dist/components/nav-account-panel.js +55 -0
- package/dist/components/nav-account-panel.js.map +1 -0
- package/dist/components/nav-command-dialog.cjs +325 -0
- package/dist/components/nav-command-dialog.cjs.map +1 -0
- package/dist/components/nav-command-dialog.d.cts +11 -0
- package/dist/components/nav-command-dialog.d.ts +11 -0
- package/dist/components/nav-command-dialog.js +295 -0
- package/dist/components/nav-command-dialog.js.map +1 -0
- package/dist/components/nav-command-match.cjs +46 -0
- package/dist/components/nav-command-match.cjs.map +1 -0
- package/dist/components/nav-command-match.d.cts +9 -0
- package/dist/components/nav-command-match.d.ts +9 -0
- package/dist/components/nav-command-match.js +20 -0
- package/dist/components/nav-command-match.js.map +1 -0
- package/dist/components/nav-command-menu.cjs +5 -302
- package/dist/components/nav-command-menu.cjs.map +1 -1
- package/dist/components/nav-command-menu.d.cts +2 -4
- package/dist/components/nav-command-menu.d.ts +2 -4
- package/dist/components/nav-command-menu.js +5 -300
- package/dist/components/nav-command-menu.js.map +1 -1
- package/dist/components/nav-shell.cjs +3 -46
- package/dist/components/nav-shell.cjs.map +1 -1
- package/dist/components/nav-shell.js +4 -47
- package/dist/components/nav-shell.js.map +1 -1
- package/dist/components/portfolio-assets.cjs +2 -1
- package/dist/components/portfolio-assets.cjs.map +1 -1
- package/dist/components/portfolio-assets.d.cts +1 -1
- package/dist/components/portfolio-assets.d.ts +1 -1
- package/dist/components/portfolio-assets.js +2 -1
- package/dist/components/portfolio-assets.js.map +1 -1
- package/dist/components/portfolio-licensing-page.cjs +166 -0
- package/dist/components/portfolio-licensing-page.cjs.map +1 -0
- package/dist/components/portfolio-licensing-page.d.cts +5 -0
- package/dist/components/portfolio-licensing-page.d.ts +5 -0
- package/dist/components/portfolio-licensing-page.js +132 -0
- package/dist/components/portfolio-licensing-page.js.map +1 -0
- package/dist/components/portfolio-orders.cjs +8 -1
- package/dist/components/portfolio-orders.cjs.map +1 -1
- package/dist/components/portfolio-orders.d.cts +1 -1
- package/dist/components/portfolio-orders.d.ts +1 -1
- package/dist/components/portfolio-orders.js +8 -1
- package/dist/components/portfolio-orders.js.map +1 -1
- package/dist/components/token-card.cjs +5 -1
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +5 -1
- package/dist/components/token-card.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +89 -1
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +89 -1
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/index.cjs +121 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +82 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/app-client.cjs +60 -0
- package/dist/utils/app-client.cjs.map +1 -0
- package/dist/utils/app-client.d.cts +19 -0
- package/dist/utils/app-client.d.ts +19 -0
- package/dist/utils/app-client.js +38 -0
- package/dist/utils/app-client.js.map +1 -0
- package/dist/utils/duration-options.cjs +46 -0
- package/dist/utils/duration-options.cjs.map +1 -0
- package/dist/utils/duration-options.d.cts +40 -0
- package/dist/utils/duration-options.d.ts +40 -0
- package/dist/utils/duration-options.js +21 -0
- package/dist/utils/duration-options.js.map +1 -0
- package/dist/utils/launchpad-rules.d.cts +1 -1
- package/dist/utils/launchpad-rules.d.ts +1 -1
- package/dist/utils/marketplace/intents.cjs +178 -0
- package/dist/utils/marketplace/intents.cjs.map +1 -0
- package/dist/utils/marketplace/intents.d.cts +74 -0
- package/dist/utils/marketplace/intents.d.ts +74 -0
- package/dist/utils/marketplace/intents.js +148 -0
- package/dist/utils/marketplace/intents.js.map +1 -0
- package/dist/utils/marketplace/remix-approval.cjs +93 -0
- package/dist/utils/marketplace/remix-approval.cjs.map +1 -0
- package/dist/utils/marketplace/remix-approval.d.cts +26 -0
- package/dist/utils/marketplace/remix-approval.d.ts +26 -0
- package/dist/utils/marketplace/remix-approval.js +69 -0
- package/dist/utils/marketplace/remix-approval.js.map +1 -0
- package/dist/utils/marketplace/swap-intent.cjs +46 -0
- package/dist/utils/marketplace/swap-intent.cjs.map +1 -0
- package/dist/utils/marketplace/swap-intent.d.cts +18 -0
- package/dist/utils/marketplace/swap-intent.d.ts +18 -0
- package/dist/utils/marketplace/swap-intent.js +22 -0
- package/dist/utils/marketplace/swap-intent.js.map +1 -0
- package/dist/utils/marketplace/token-standard.cjs +46 -0
- package/dist/utils/marketplace/token-standard.cjs.map +1 -0
- package/dist/utils/marketplace/token-standard.d.cts +13 -0
- package/dist/utils/marketplace/token-standard.d.ts +13 -0
- package/dist/utils/marketplace/token-standard.js +20 -0
- package/dist/utils/marketplace/token-standard.js.map +1 -0
- package/dist/utils/marketplace/use-accept-offer.cjs +103 -0
- package/dist/utils/marketplace/use-accept-offer.cjs.map +1 -0
- package/dist/utils/marketplace/use-accept-offer.d.cts +132 -0
- package/dist/utils/marketplace/use-accept-offer.d.ts +132 -0
- package/dist/utils/marketplace/use-accept-offer.js +79 -0
- package/dist/utils/marketplace/use-accept-offer.js.map +1 -0
- package/dist/utils/marketplace/use-cancel-order.cjs +67 -0
- package/dist/utils/marketplace/use-cancel-order.cjs.map +1 -0
- package/dist/utils/marketplace/use-cancel-order.d.cts +74 -0
- package/dist/utils/marketplace/use-cancel-order.d.ts +74 -0
- package/dist/utils/marketplace/use-cancel-order.js +43 -0
- package/dist/utils/marketplace/use-cancel-order.js.map +1 -0
- package/dist/utils/marketplace/use-marketplace-transaction.cjs +80 -0
- package/dist/utils/marketplace/use-marketplace-transaction.cjs.map +1 -0
- package/dist/utils/marketplace/use-marketplace-transaction.d.cts +21 -0
- package/dist/utils/marketplace/use-marketplace-transaction.d.ts +21 -0
- package/dist/utils/marketplace/use-marketplace-transaction.js +55 -0
- package/dist/utils/marketplace/use-marketplace-transaction.js.map +1 -0
- package/dist/utils/marketplace/use-resolved-token-standard.cjs +40 -0
- package/dist/utils/marketplace/use-resolved-token-standard.cjs.map +1 -0
- package/dist/utils/marketplace/use-resolved-token-standard.d.cts +9 -0
- package/dist/utils/marketplace/use-resolved-token-standard.d.ts +9 -0
- package/dist/utils/marketplace/use-resolved-token-standard.js +16 -0
- package/dist/utils/marketplace/use-resolved-token-standard.js.map +1 -0
- package/dist/utils/media-wallet/confetti.cjs +6 -6
- package/dist/utils/media-wallet/confetti.cjs.map +1 -1
- package/dist/utils/media-wallet/confetti.d.cts +1 -1
- package/dist/utils/media-wallet/confetti.d.ts +1 -1
- package/dist/utils/media-wallet/confetti.js +2 -2
- package/dist/utils/media-wallet/confetti.js.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.cjs +0 -1
- package/dist/utils/media-wallet/use-erc20-balance.cjs.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.js +0 -1
- package/dist/utils/media-wallet/use-erc20-balance.js.map +1 -1
- package/dist/utils/order-form.d.cts +5 -23
- package/dist/utils/order-form.d.ts +5 -23
- package/dist/utils/security-headers.cjs +58 -0
- package/dist/utils/security-headers.cjs.map +1 -0
- package/dist/utils/security-headers.d.cts +16 -0
- package/dist/utils/security-headers.d.ts +16 -0
- package/dist/utils/security-headers.js +34 -0
- package/dist/utils/security-headers.js.map +1 -0
- package/dist/utils/seo.cjs +100 -0
- package/dist/utils/seo.cjs.map +1 -0
- package/dist/utils/seo.d.cts +55 -0
- package/dist/utils/seo.d.ts +55 -0
- package/dist/utils/seo.js +75 -0
- package/dist/utils/seo.js.map +1 -0
- package/dist/utils/server-reads.d.cts +1 -0
- package/dist/utils/server-reads.d.ts +1 -0
- package/dist/utils/token-kind.cjs +45 -0
- package/dist/utils/token-kind.cjs.map +1 -0
- package/dist/utils/token-kind.d.cts +8 -0
- package/dist/utils/token-kind.d.ts +8 -0
- package/dist/utils/token-kind.js +19 -0
- package/dist/utils/token-kind.js.map +1 -0
- package/dist/utils/use-accounts.cjs +1 -1
- package/dist/utils/use-accounts.cjs.map +1 -1
- package/dist/utils/use-accounts.js +1 -1
- package/dist/utils/use-accounts.js.map +1 -1
- package/dist/utils/use-activities.cjs +2 -4
- package/dist/utils/use-activities.cjs.map +1 -1
- package/dist/utils/use-activities.js +2 -4
- package/dist/utils/use-activities.js.map +1 -1
- package/dist/utils/use-coin-guarantees.cjs +1 -1
- package/dist/utils/use-coin-guarantees.cjs.map +1 -1
- package/dist/utils/use-coin-guarantees.js +1 -1
- package/dist/utils/use-coin-guarantees.js.map +1 -1
- package/dist/utils/use-coin-price.cjs +1 -1
- package/dist/utils/use-coin-price.cjs.map +1 -1
- package/dist/utils/use-coin-price.js +1 -1
- package/dist/utils/use-coin-price.js.map +1 -1
- package/dist/utils/use-coin-supply.cjs +1 -1
- package/dist/utils/use-coin-supply.cjs.map +1 -1
- package/dist/utils/use-coin-supply.js +1 -1
- package/dist/utils/use-coin-supply.js.map +1 -1
- package/dist/utils/use-collections.cjs +3 -6
- package/dist/utils/use-collections.cjs.map +1 -1
- package/dist/utils/use-collections.d.cts +3 -0
- package/dist/utils/use-collections.d.ts +3 -0
- package/dist/utils/use-collections.js +3 -6
- package/dist/utils/use-collections.js.map +1 -1
- package/dist/utils/use-comments.cjs +1 -1
- package/dist/utils/use-comments.cjs.map +1 -1
- package/dist/utils/use-comments.js +1 -1
- package/dist/utils/use-comments.js.map +1 -1
- package/dist/utils/use-confetti.cjs +1 -1
- package/dist/utils/use-confetti.cjs.map +1 -1
- package/dist/utils/use-confetti.js +1 -1
- package/dist/utils/use-confetti.js.map +1 -1
- package/dist/utils/use-drops.cjs +2 -2
- package/dist/utils/use-drops.cjs.map +1 -1
- package/dist/utils/use-drops.js +2 -2
- package/dist/utils/use-drops.js.map +1 -1
- package/dist/utils/use-full-token-data.cjs +1 -1
- package/dist/utils/use-full-token-data.cjs.map +1 -1
- package/dist/utils/use-full-token-data.js +1 -1
- package/dist/utils/use-full-token-data.js.map +1 -1
- package/dist/utils/use-gated-content.cjs +56 -0
- package/dist/utils/use-gated-content.cjs.map +1 -0
- package/dist/utils/use-gated-content.d.cts +7 -0
- package/dist/utils/use-gated-content.d.ts +7 -0
- package/dist/utils/use-gated-content.js +22 -0
- package/dist/utils/use-gated-content.js.map +1 -0
- package/dist/utils/use-my-remix-offers.cjs +0 -1
- package/dist/utils/use-my-remix-offers.cjs.map +1 -1
- package/dist/utils/use-my-remix-offers.js +0 -1
- package/dist/utils/use-my-remix-offers.js.map +1 -1
- package/dist/utils/use-my-username-claim.cjs +52 -0
- package/dist/utils/use-my-username-claim.cjs.map +1 -0
- package/dist/utils/use-my-username-claim.d.cts +15 -0
- package/dist/utils/use-my-username-claim.d.ts +15 -0
- package/dist/utils/use-my-username-claim.js +18 -0
- package/dist/utils/use-my-username-claim.js.map +1 -0
- package/dist/utils/use-orders.cjs +7 -9
- package/dist/utils/use-orders.cjs.map +1 -1
- package/dist/utils/use-orders.js +7 -9
- package/dist/utils/use-orders.js.map +1 -1
- package/dist/utils/use-platform-stats.cjs +1 -1
- package/dist/utils/use-platform-stats.cjs.map +1 -1
- package/dist/utils/use-platform-stats.js +1 -1
- package/dist/utils/use-platform-stats.js.map +1 -1
- package/dist/utils/use-pop.cjs +3 -5
- package/dist/utils/use-pop.cjs.map +1 -1
- package/dist/utils/use-pop.js +3 -5
- package/dist/utils/use-pop.js.map +1 -1
- package/dist/utils/use-profiles.cjs +3 -4
- package/dist/utils/use-profiles.cjs.map +1 -1
- package/dist/utils/use-profiles.js +3 -4
- package/dist/utils/use-profiles.js.map +1 -1
- package/dist/utils/use-remix-offers.cjs +1 -2
- package/dist/utils/use-remix-offers.cjs.map +1 -1
- package/dist/utils/use-remix-offers.js +1 -2
- package/dist/utils/use-remix-offers.js.map +1 -1
- package/dist/utils/use-rewards.cjs +5 -5
- package/dist/utils/use-rewards.cjs.map +1 -1
- package/dist/utils/use-rewards.js +5 -5
- package/dist/utils/use-rewards.js.map +1 -1
- package/dist/utils/use-search.cjs +1 -1
- package/dist/utils/use-search.cjs.map +1 -1
- package/dist/utils/use-search.js +1 -1
- package/dist/utils/use-search.js.map +1 -1
- package/dist/utils/use-sponsorship.cjs +6 -12
- package/dist/utils/use-sponsorship.cjs.map +1 -1
- package/dist/utils/use-sponsorship.js +6 -12
- package/dist/utils/use-sponsorship.js.map +1 -1
- package/dist/utils/use-swap-quote.cjs +0 -1
- package/dist/utils/use-swap-quote.cjs.map +1 -1
- package/dist/utils/use-swap-quote.js +0 -1
- package/dist/utils/use-swap-quote.js.map +1 -1
- package/dist/utils/use-tiers.cjs +6 -7
- package/dist/utils/use-tiers.cjs.map +1 -1
- package/dist/utils/use-tiers.js +6 -7
- package/dist/utils/use-tiers.js.map +1 -1
- package/dist/utils/use-tokens-by-ip-type.cjs +1 -2
- package/dist/utils/use-tokens-by-ip-type.cjs.map +1 -1
- package/dist/utils/use-tokens-by-ip-type.d.cts +2 -0
- package/dist/utils/use-tokens-by-ip-type.d.ts +2 -0
- package/dist/utils/use-tokens-by-ip-type.js +1 -2
- package/dist/utils/use-tokens-by-ip-type.js.map +1 -1
- package/dist/utils/use-tokens.cjs +4 -7
- package/dist/utils/use-tokens.cjs.map +1 -1
- package/dist/utils/use-tokens.d.cts +6 -0
- package/dist/utils/use-tokens.d.ts +6 -0
- package/dist/utils/use-tokens.js +4 -7
- package/dist/utils/use-tokens.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var counter_offer_dialog_exports = {};
|
|
21
|
+
__export(counter_offer_dialog_exports, {
|
|
22
|
+
CounterOfferDialog: () => CounterOfferDialog
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(counter_offer_dialog_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_react_hook_form = require("react-hook-form");
|
|
28
|
+
var import_use_usd_prices = require("../../utils/use-usd-prices.js");
|
|
29
|
+
var import_zod = require("@hookform/resolvers/zod");
|
|
30
|
+
var import_lucide_react = require("lucide-react");
|
|
31
|
+
var import_form = require("../form.js");
|
|
32
|
+
var import_button = require("../button.js");
|
|
33
|
+
var import_input = require("../input.js");
|
|
34
|
+
var import_textarea = require("../textarea.js");
|
|
35
|
+
var import_dialog_frame = require("./dialog-frame.js");
|
|
36
|
+
var import_badge = require("../badge.js");
|
|
37
|
+
var import_marketplace_dialog_primitives = require("../marketplace-dialog-primitives.js");
|
|
38
|
+
var import_transaction_dialog_states = require("../transaction-dialog-states.js");
|
|
39
|
+
var import_success_messages = require("../../utils/success-messages.js");
|
|
40
|
+
var import_use_usd_prices2 = require("../../utils/use-usd-prices.js");
|
|
41
|
+
var import_order_form = require("../../utils/order-form.js");
|
|
42
|
+
var import_use_marketplace_transaction = require("../../utils/marketplace/use-marketplace-transaction.js");
|
|
43
|
+
var import_intents = require("../../utils/marketplace/intents.js");
|
|
44
|
+
var import_medialane_app = require("../medialane-app.js");
|
|
45
|
+
var import_currency_icon = require("../currency-icon.js");
|
|
46
|
+
var import_duration_options = require("../../utils/duration-options.js");
|
|
47
|
+
var import_i18n = require("../../i18n/index.js");
|
|
48
|
+
function toRawWei(humanAmount, decimals) {
|
|
49
|
+
const parts = humanAmount.replace(/,/g, "").split(".");
|
|
50
|
+
const integer = BigInt(parts[0] || "0");
|
|
51
|
+
const fraction = (parts[1] || "").padEnd(decimals, "0").slice(0, decimals);
|
|
52
|
+
return (integer * BigInt(10 ** decimals) + BigInt(fraction)).toString();
|
|
53
|
+
}
|
|
54
|
+
function CounterOfferDialog({
|
|
55
|
+
open,
|
|
56
|
+
onOpenChange,
|
|
57
|
+
originalOrderHash,
|
|
58
|
+
tokenName,
|
|
59
|
+
tokenImage,
|
|
60
|
+
tokenId,
|
|
61
|
+
currentBid,
|
|
62
|
+
currencySymbol,
|
|
63
|
+
currencyDecimals
|
|
64
|
+
}) {
|
|
65
|
+
const t = (0, import_i18n.useT)();
|
|
66
|
+
const durationOptions = (0, import_duration_options.useDurationOptions)();
|
|
67
|
+
const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
|
|
68
|
+
const hasWallet = walletAddress !== null;
|
|
69
|
+
const { phase, busy: isProcessing, txHash, error, start, reset } = (0, import_use_marketplace_transaction.useMarketplaceTransaction)();
|
|
70
|
+
const [pendingValues, setPendingValues] = (0, import_react.useState)(null);
|
|
71
|
+
const form = (0, import_react_hook_form.useForm)({
|
|
72
|
+
resolver: (0, import_zod.zodResolver)(import_order_form.counterOfferFormSchema),
|
|
73
|
+
defaultValues: { price: "", durationSeconds: 604800, message: "" }
|
|
74
|
+
});
|
|
75
|
+
const usdPrices = (0, import_use_usd_prices.useUsdPrices)();
|
|
76
|
+
const watchedPrice = form.watch("price");
|
|
77
|
+
const usdEquivalent = (0, import_use_usd_prices2.usdValueFor)(watchedPrice || void 0, currencySymbol, usdPrices);
|
|
78
|
+
const onSubmit = (values) => {
|
|
79
|
+
if (!hasWallet) return;
|
|
80
|
+
setPendingValues(values);
|
|
81
|
+
void start((ctx) => (0, import_intents.makeCounterOffer)(ctx, {
|
|
82
|
+
originalOrderHash,
|
|
83
|
+
counterPriceRaw: toRawWei(values.price, currencyDecimals),
|
|
84
|
+
durationSeconds: values.durationSeconds,
|
|
85
|
+
message: values.message || void 0
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
const handleClose = (v) => {
|
|
89
|
+
if (!isProcessing) {
|
|
90
|
+
form.reset();
|
|
91
|
+
reset();
|
|
92
|
+
setPendingValues(null);
|
|
93
|
+
onOpenChange(v);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const name = tokenName || "this token";
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
import_dialog_frame.MarketplaceDialog,
|
|
99
|
+
{
|
|
100
|
+
open,
|
|
101
|
+
onOpenChange: handleClose,
|
|
102
|
+
title: t("Send a counter-offer"),
|
|
103
|
+
description: t("Propose a different price to the buyer."),
|
|
104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
import_transaction_dialog_states.TransactionDialogStates,
|
|
106
|
+
{
|
|
107
|
+
phase,
|
|
108
|
+
asset: { name, image: tokenImage },
|
|
109
|
+
txHash,
|
|
110
|
+
error,
|
|
111
|
+
success: import_success_messages.successMessages.countered({ name, price: `${pendingValues?.price} ${currencySymbol}` }, t),
|
|
112
|
+
errorTitle: t("Counter-offer failed"),
|
|
113
|
+
errorDescription: t("The counter-offer did not complete."),
|
|
114
|
+
onRetry: reset,
|
|
115
|
+
onDone: () => handleClose(false),
|
|
116
|
+
children: !hasWallet ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
+
import_dialog_frame.DialogSignInGate,
|
|
118
|
+
{
|
|
119
|
+
title: t("Secure your account to send a counter-offer"),
|
|
120
|
+
description: t("You need an account to counter bids.")
|
|
121
|
+
}
|
|
122
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
|
+
import_marketplace_dialog_primitives.MarketplaceDialogHero,
|
|
125
|
+
{
|
|
126
|
+
tokenImage,
|
|
127
|
+
tokenName,
|
|
128
|
+
tokenId: tokenId ?? "",
|
|
129
|
+
fallbackIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowLeftRight, { className: "h-12 w-12 text-brand-blue/30" })
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-5 pb-5 pt-3 space-y-4", children: [
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-bold text-base leading-tight truncate", children: name }),
|
|
135
|
+
currentBid && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-1 flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("Current bid") }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_badge.Badge, { variant: "secondary", children: currentBid })
|
|
138
|
+
] })
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
import_form.FormField,
|
|
143
|
+
{
|
|
144
|
+
control: form.control,
|
|
145
|
+
name: "price",
|
|
146
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: t("Your counter price") }),
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
150
|
+
import_input.Input,
|
|
151
|
+
{
|
|
152
|
+
type: "number",
|
|
153
|
+
step: "any",
|
|
154
|
+
placeholder: "0.00",
|
|
155
|
+
className: "pr-20",
|
|
156
|
+
disabled: isProcessing,
|
|
157
|
+
...field
|
|
158
|
+
}
|
|
159
|
+
) }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1 pointer-events-none", children: [
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: currencySymbol, size: 14 }),
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs font-bold", children: currencySymbol })
|
|
163
|
+
] })
|
|
164
|
+
] }),
|
|
165
|
+
usdEquivalent && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
166
|
+
"\u2248 ",
|
|
167
|
+
usdEquivalent
|
|
168
|
+
] }),
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
170
|
+
] })
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
174
|
+
import_form.FormField,
|
|
175
|
+
{
|
|
176
|
+
control: form.control,
|
|
177
|
+
name: "durationSeconds",
|
|
178
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: t("Valid for") }),
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
181
|
+
import_marketplace_dialog_primitives.DurationPicker,
|
|
182
|
+
{
|
|
183
|
+
options: durationOptions,
|
|
184
|
+
value: field.value,
|
|
185
|
+
onChange: field.onChange,
|
|
186
|
+
disabled: isProcessing
|
|
187
|
+
}
|
|
188
|
+
) })
|
|
189
|
+
] })
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
193
|
+
import_form.FormField,
|
|
194
|
+
{
|
|
195
|
+
control: form.control,
|
|
196
|
+
name: "message",
|
|
197
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { className: "flex items-center gap-1", children: [
|
|
199
|
+
t("Message"),
|
|
200
|
+
" ",
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground text-xs", children: t("(optional)") })
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
204
|
+
import_textarea.Textarea,
|
|
205
|
+
{
|
|
206
|
+
placeholder: t("Explain your counter price to the buyer\u2026"),
|
|
207
|
+
className: "resize-none",
|
|
208
|
+
rows: 2,
|
|
209
|
+
maxLength: 500,
|
|
210
|
+
disabled: isProcessing,
|
|
211
|
+
...field
|
|
212
|
+
}
|
|
213
|
+
) }),
|
|
214
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
215
|
+
] })
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog_frame.DialogErrorAlert, { error }),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { type: "submit", className: "w-full h-11", disabled: isProcessing, children: [
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowLeftRight, { className: "h-4 w-4 mr-2" }),
|
|
221
|
+
t("Send counter-offer")
|
|
222
|
+
] }),
|
|
223
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog_frame.DialogNote, { children: t("This offer will be recorded onchain.") })
|
|
224
|
+
] }) })
|
|
225
|
+
] })
|
|
226
|
+
] })
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
233
|
+
0 && (module.exports = {
|
|
234
|
+
CounterOfferDialog
|
|
235
|
+
});
|
|
236
|
+
//# sourceMappingURL=counter-offer-dialog.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketplace/counter-offer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { useUsdPrices } from \"../../utils/use-usd-prices.js\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport type { z } from \"zod\";\nimport { ArrowLeftRight } from \"lucide-react\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form.js\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { MarketplaceDialog, DialogErrorAlert, DialogNote, DialogSignInGate } from \"./dialog-frame.js\";\nimport { Badge } from \"../badge.js\";\nimport { MarketplaceDialogHero, DurationPicker } from \"../marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"../transaction-dialog-states.js\";\nimport { successMessages } from \"../../utils/success-messages.js\";\nimport { usdValueFor } from \"../../utils/use-usd-prices.js\";\nimport { counterOfferFormSchema } from \"../../utils/order-form.js\";\nimport { useMarketplaceTransaction } from \"../../utils/marketplace/use-marketplace-transaction.js\";\nimport { makeCounterOffer } from \"../../utils/marketplace/intents.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { CurrencyIcon } from \"../currency-icon.js\";\nimport { useDurationOptions } from \"../../utils/duration-options.js\";\nimport { useT } from \"../../i18n/index.js\";\n\nfunction toRawWei(humanAmount: string, decimals: number): string {\n const parts = humanAmount.replace(/,/g, \"\").split(\".\");\n const integer = BigInt(parts[0] || \"0\");\n const fraction = (parts[1] || \"\").padEnd(decimals, \"0\").slice(0, decimals);\n return (integer * BigInt(10 ** decimals) + BigInt(fraction)).toString();\n}\n\ntype FormValues = z.infer<typeof counterOfferFormSchema>;\n\nexport interface CounterOfferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n originalOrderHash: string;\n tokenName?: string;\n tokenImage?: string | null;\n tokenId?: string;\n currentBid?: string;\n currencySymbol: string;\n currencyDecimals: number;\n}\n\nexport function CounterOfferDialog({\n open,\n onOpenChange,\n originalOrderHash,\n tokenName,\n tokenImage,\n tokenId,\n currentBid,\n currencySymbol,\n currencyDecimals,\n}: CounterOfferDialogProps) {\n const t = useT();\n const durationOptions = useDurationOptions();\n const { walletAddress } = useMedialaneApp();\n const hasWallet = walletAddress !== null;\n const { phase, busy: isProcessing, txHash, error, start, reset } = useMarketplaceTransaction();\n const [pendingValues, setPendingValues] = useState<FormValues | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(counterOfferFormSchema),\n defaultValues: { price: \"\", durationSeconds: 604800, message: \"\" },\n });\n\n const usdPrices = useUsdPrices();\n const watchedPrice = form.watch(\"price\");\n const usdEquivalent = usdValueFor(watchedPrice || undefined, currencySymbol, usdPrices);\n\n const onSubmit = (values: FormValues) => {\n if (!hasWallet) return;\n setPendingValues(values);\n void start((ctx) => makeCounterOffer(ctx, {\n originalOrderHash,\n counterPriceRaw: toRawWei(values.price, currencyDecimals),\n durationSeconds: values.durationSeconds,\n message: values.message || undefined,\n }));\n };\n\n const handleClose = (v: boolean) => {\n if (!isProcessing) {\n form.reset();\n reset();\n setPendingValues(null);\n onOpenChange(v);\n }\n };\n\n const name = tokenName || \"this token\";\n\n return (\n <MarketplaceDialog\n open={open}\n onOpenChange={handleClose}\n title={t(\"Send a counter-offer\")}\n description={t(\"Propose a different price to the buyer.\")}\n >\n <TransactionDialogStates\n phase={phase}\n asset={{ name, image: tokenImage }}\n txHash={txHash}\n error={error}\n success={successMessages.countered({ name, price: `${pendingValues?.price} ${currencySymbol}` }, t)}\n errorTitle={t(\"Counter-offer failed\")}\n errorDescription={t(\"The counter-offer did not complete.\")}\n onRetry={reset}\n onDone={() => handleClose(false)}\n >\n {!hasWallet ? (\n <DialogSignInGate\n title={t(\"Secure your account to send a counter-offer\")}\n description={t(\"You need an account to counter bids.\")}\n />\n ) : (\n <>\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId ?? \"\"}\n fallbackIcon={<ArrowLeftRight className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n <div className=\"px-5 pb-5 pt-3 space-y-4\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-base leading-tight truncate\">{name}</p>\n {currentBid && (\n <div className=\"mt-1 flex items-center gap-2 text-xs text-muted-foreground\">\n <span>{t(\"Current bid\")}</span>\n <Badge variant=\"secondary\">{currentBid}</Badge>\n </div>\n )}\n </div>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-4\">\n <FormField\n control={form.control}\n name=\"price\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>{t(\"Your counter price\")}</FormLabel>\n <div className=\"relative\">\n <FormControl>\n <Input\n type=\"number\"\n step=\"any\"\n placeholder=\"0.00\"\n className=\"pr-20\"\n disabled={isProcessing}\n {...field}\n />\n </FormControl>\n <div className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1 pointer-events-none\">\n <CurrencyIcon symbol={currencySymbol} size={14} />\n <span className=\"text-xs font-bold\">{currencySymbol}</span>\n </div>\n </div>\n {usdEquivalent && (\n <p className=\"text-xs text-muted-foreground\">≈ {usdEquivalent}</p>\n )}\n <FormMessage />\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"durationSeconds\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>{t(\"Valid for\")}</FormLabel>\n <FormControl>\n <DurationPicker\n options={durationOptions}\n value={field.value}\n onChange={field.onChange}\n disabled={isProcessing}\n />\n </FormControl>\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"message\"\n render={({ field }) => (\n <FormItem>\n <FormLabel className=\"flex items-center gap-1\">\n {t(\"Message\")} <span className=\"text-muted-foreground text-xs\">{t(\"(optional)\")}</span>\n </FormLabel>\n <FormControl>\n <Textarea\n placeholder={t(\"Explain your counter price to the buyer…\")}\n className=\"resize-none\"\n rows={2}\n maxLength={500}\n disabled={isProcessing}\n {...field}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n <DialogErrorAlert error={error} />\n\n <Button type=\"submit\" className=\"w-full h-11\" disabled={isProcessing}>\n <ArrowLeftRight className=\"h-4 w-4 mr-2\" />\n {t(\"Send counter-offer\")}\n </Button>\n <DialogNote>{t(\"This offer will be recorded onchain.\")}</DialogNote>\n </form>\n </Form>\n </div>\n </>\n )}\n </TransactionDialogStates>\n </Marketpla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AAA,kEAAC,yBAAW,YAAE,WAAW,GAAE;AAAA,sBAC3B,4CAAC,2BACC;AAAA,wBAAC;AAAA;AAAA,0BACC,SAAS;AAAA,0BACT,OAAO,MAAM;AAAA,0BACb,UAAU,MAAM;AAAA,0BAChB,UAAU;AAAA;AAAA,sBACZ,GACF;AAAA,uBACF;AAAA;AAAA,gBAEJ;AAAA,gBAEA;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAS,KAAK;AAAA,oBACd,MAAK;AAAA,oBACL,QAAQ,CAAC,EAAE,MAAM,MACf,6CAAC,wBACC;AAAA,mEAAC,yBAAU,WAAU,2BAClB;AAAA,0BAAE,SAAS;AAAA,wBAAE;AAAA,wBAAC,4CAAC,UAAK,WAAU,iCAAiC,YAAE,YAAY,GAAE;AAAA,yBAClF;AAAA,sBACA,4CAAC,2BACC;AAAA,wBAAC;AAAA;AAAA,0BACC,aAAa,EAAE,+CAA0C;AAAA,0BACzD,WAAU;AAAA,0BACV,MAAM;AAAA,0BACN,WAAW;AAAA,0BACX,UAAU;AAAA,0BACT,GAAG;AAAA;AAAA,sBACN,GACF;AAAA,sBACA,4CAAC,2BAAY;AAAA,uBACf;AAAA;AAAA,gBAEJ;AAAA,gBAEA,4CAAC,wCAAiB,OAAc;AAAA,gBAEhC,6CAAC,wBAAO,MAAK,UAAS,WAAU,eAAc,UAAU,cACtD;AAAA,8DAAC,sCAAe,WAAU,gBAAe;AAAA,kBACxC,EAAE,oBAAoB;AAAA,mBACzB;AAAA,gBACA,4CAAC,kCAAY,YAAE,sCAAsC,GAAE;AAAA,iBACzD,GACF;AAAA,eACF;AAAA,aACF;AAAA;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;","names":["import_use_usd_prices"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CounterOfferDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
originalOrderHash: string;
|
|
7
|
+
tokenName?: string;
|
|
8
|
+
tokenImage?: string | null;
|
|
9
|
+
tokenId?: string;
|
|
10
|
+
currentBid?: string;
|
|
11
|
+
currencySymbol: string;
|
|
12
|
+
currencyDecimals: number;
|
|
13
|
+
}
|
|
14
|
+
declare function CounterOfferDialog({ open, onOpenChange, originalOrderHash, tokenName, tokenImage, tokenId, currentBid, currencySymbol, currencyDecimals, }: CounterOfferDialogProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { CounterOfferDialog, type CounterOfferDialogProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CounterOfferDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
originalOrderHash: string;
|
|
7
|
+
tokenName?: string;
|
|
8
|
+
tokenImage?: string | null;
|
|
9
|
+
tokenId?: string;
|
|
10
|
+
currentBid?: string;
|
|
11
|
+
currencySymbol: string;
|
|
12
|
+
currencyDecimals: number;
|
|
13
|
+
}
|
|
14
|
+
declare function CounterOfferDialog({ open, onOpenChange, originalOrderHash, tokenName, tokenImage, tokenId, currentBid, currencySymbol, currencyDecimals, }: CounterOfferDialogProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { CounterOfferDialog, type CounterOfferDialogProps };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
import { useUsdPrices } from "../../utils/use-usd-prices.js";
|
|
6
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
7
|
+
import { ArrowLeftRight } from "lucide-react";
|
|
8
|
+
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "../form.js";
|
|
9
|
+
import { Button } from "../button.js";
|
|
10
|
+
import { Input } from "../input.js";
|
|
11
|
+
import { Textarea } from "../textarea.js";
|
|
12
|
+
import { MarketplaceDialog, DialogErrorAlert, DialogNote, DialogSignInGate } from "./dialog-frame.js";
|
|
13
|
+
import { Badge } from "../badge.js";
|
|
14
|
+
import { MarketplaceDialogHero, DurationPicker } from "../marketplace-dialog-primitives.js";
|
|
15
|
+
import { TransactionDialogStates } from "../transaction-dialog-states.js";
|
|
16
|
+
import { successMessages } from "../../utils/success-messages.js";
|
|
17
|
+
import { usdValueFor } from "../../utils/use-usd-prices.js";
|
|
18
|
+
import { counterOfferFormSchema } from "../../utils/order-form.js";
|
|
19
|
+
import { useMarketplaceTransaction } from "../../utils/marketplace/use-marketplace-transaction.js";
|
|
20
|
+
import { makeCounterOffer } from "../../utils/marketplace/intents.js";
|
|
21
|
+
import { useMedialaneApp } from "../medialane-app.js";
|
|
22
|
+
import { CurrencyIcon } from "../currency-icon.js";
|
|
23
|
+
import { useDurationOptions } from "../../utils/duration-options.js";
|
|
24
|
+
import { useT } from "../../i18n/index.js";
|
|
25
|
+
function toRawWei(humanAmount, decimals) {
|
|
26
|
+
const parts = humanAmount.replace(/,/g, "").split(".");
|
|
27
|
+
const integer = BigInt(parts[0] || "0");
|
|
28
|
+
const fraction = (parts[1] || "").padEnd(decimals, "0").slice(0, decimals);
|
|
29
|
+
return (integer * BigInt(10 ** decimals) + BigInt(fraction)).toString();
|
|
30
|
+
}
|
|
31
|
+
function CounterOfferDialog({
|
|
32
|
+
open,
|
|
33
|
+
onOpenChange,
|
|
34
|
+
originalOrderHash,
|
|
35
|
+
tokenName,
|
|
36
|
+
tokenImage,
|
|
37
|
+
tokenId,
|
|
38
|
+
currentBid,
|
|
39
|
+
currencySymbol,
|
|
40
|
+
currencyDecimals
|
|
41
|
+
}) {
|
|
42
|
+
const t = useT();
|
|
43
|
+
const durationOptions = useDurationOptions();
|
|
44
|
+
const { walletAddress } = useMedialaneApp();
|
|
45
|
+
const hasWallet = walletAddress !== null;
|
|
46
|
+
const { phase, busy: isProcessing, txHash, error, start, reset } = useMarketplaceTransaction();
|
|
47
|
+
const [pendingValues, setPendingValues] = useState(null);
|
|
48
|
+
const form = useForm({
|
|
49
|
+
resolver: zodResolver(counterOfferFormSchema),
|
|
50
|
+
defaultValues: { price: "", durationSeconds: 604800, message: "" }
|
|
51
|
+
});
|
|
52
|
+
const usdPrices = useUsdPrices();
|
|
53
|
+
const watchedPrice = form.watch("price");
|
|
54
|
+
const usdEquivalent = usdValueFor(watchedPrice || void 0, currencySymbol, usdPrices);
|
|
55
|
+
const onSubmit = (values) => {
|
|
56
|
+
if (!hasWallet) return;
|
|
57
|
+
setPendingValues(values);
|
|
58
|
+
void start((ctx) => makeCounterOffer(ctx, {
|
|
59
|
+
originalOrderHash,
|
|
60
|
+
counterPriceRaw: toRawWei(values.price, currencyDecimals),
|
|
61
|
+
durationSeconds: values.durationSeconds,
|
|
62
|
+
message: values.message || void 0
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
const handleClose = (v) => {
|
|
66
|
+
if (!isProcessing) {
|
|
67
|
+
form.reset();
|
|
68
|
+
reset();
|
|
69
|
+
setPendingValues(null);
|
|
70
|
+
onOpenChange(v);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const name = tokenName || "this token";
|
|
74
|
+
return /* @__PURE__ */ jsx(
|
|
75
|
+
MarketplaceDialog,
|
|
76
|
+
{
|
|
77
|
+
open,
|
|
78
|
+
onOpenChange: handleClose,
|
|
79
|
+
title: t("Send a counter-offer"),
|
|
80
|
+
description: t("Propose a different price to the buyer."),
|
|
81
|
+
children: /* @__PURE__ */ jsx(
|
|
82
|
+
TransactionDialogStates,
|
|
83
|
+
{
|
|
84
|
+
phase,
|
|
85
|
+
asset: { name, image: tokenImage },
|
|
86
|
+
txHash,
|
|
87
|
+
error,
|
|
88
|
+
success: successMessages.countered({ name, price: `${pendingValues?.price} ${currencySymbol}` }, t),
|
|
89
|
+
errorTitle: t("Counter-offer failed"),
|
|
90
|
+
errorDescription: t("The counter-offer did not complete."),
|
|
91
|
+
onRetry: reset,
|
|
92
|
+
onDone: () => handleClose(false),
|
|
93
|
+
children: !hasWallet ? /* @__PURE__ */ jsx(
|
|
94
|
+
DialogSignInGate,
|
|
95
|
+
{
|
|
96
|
+
title: t("Secure your account to send a counter-offer"),
|
|
97
|
+
description: t("You need an account to counter bids.")
|
|
98
|
+
}
|
|
99
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
MarketplaceDialogHero,
|
|
102
|
+
{
|
|
103
|
+
tokenImage,
|
|
104
|
+
tokenName,
|
|
105
|
+
tokenId: tokenId ?? "",
|
|
106
|
+
fallbackIcon: /* @__PURE__ */ jsx(ArrowLeftRight, { className: "h-12 w-12 text-brand-blue/30" })
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "px-5 pb-5 pt-3 space-y-4", children: [
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
111
|
+
/* @__PURE__ */ jsx("p", { className: "font-bold text-base leading-tight truncate", children: name }),
|
|
112
|
+
currentBid && /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
113
|
+
/* @__PURE__ */ jsx("span", { children: t("Current bid") }),
|
|
114
|
+
/* @__PURE__ */ jsx(Badge, { variant: "secondary", children: currentBid })
|
|
115
|
+
] })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
FormField,
|
|
120
|
+
{
|
|
121
|
+
control: form.control,
|
|
122
|
+
name: "price",
|
|
123
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
|
|
124
|
+
/* @__PURE__ */ jsx(FormLabel, { children: t("Your counter price") }),
|
|
125
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
126
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
127
|
+
Input,
|
|
128
|
+
{
|
|
129
|
+
type: "number",
|
|
130
|
+
step: "any",
|
|
131
|
+
placeholder: "0.00",
|
|
132
|
+
className: "pr-20",
|
|
133
|
+
disabled: isProcessing,
|
|
134
|
+
...field
|
|
135
|
+
}
|
|
136
|
+
) }),
|
|
137
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1 pointer-events-none", children: [
|
|
138
|
+
/* @__PURE__ */ jsx(CurrencyIcon, { symbol: currencySymbol, size: 14 }),
|
|
139
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-bold", children: currencySymbol })
|
|
140
|
+
] })
|
|
141
|
+
] }),
|
|
142
|
+
usdEquivalent && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
143
|
+
"\u2248 ",
|
|
144
|
+
usdEquivalent
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
147
|
+
] })
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
FormField,
|
|
152
|
+
{
|
|
153
|
+
control: form.control,
|
|
154
|
+
name: "durationSeconds",
|
|
155
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
|
|
156
|
+
/* @__PURE__ */ jsx(FormLabel, { children: t("Valid for") }),
|
|
157
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
158
|
+
DurationPicker,
|
|
159
|
+
{
|
|
160
|
+
options: durationOptions,
|
|
161
|
+
value: field.value,
|
|
162
|
+
onChange: field.onChange,
|
|
163
|
+
disabled: isProcessing
|
|
164
|
+
}
|
|
165
|
+
) })
|
|
166
|
+
] })
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
/* @__PURE__ */ jsx(
|
|
170
|
+
FormField,
|
|
171
|
+
{
|
|
172
|
+
control: form.control,
|
|
173
|
+
name: "message",
|
|
174
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
|
|
175
|
+
/* @__PURE__ */ jsxs(FormLabel, { className: "flex items-center gap-1", children: [
|
|
176
|
+
t("Message"),
|
|
177
|
+
" ",
|
|
178
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: t("(optional)") })
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
181
|
+
Textarea,
|
|
182
|
+
{
|
|
183
|
+
placeholder: t("Explain your counter price to the buyer\u2026"),
|
|
184
|
+
className: "resize-none",
|
|
185
|
+
rows: 2,
|
|
186
|
+
maxLength: 500,
|
|
187
|
+
disabled: isProcessing,
|
|
188
|
+
...field
|
|
189
|
+
}
|
|
190
|
+
) }),
|
|
191
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
192
|
+
] })
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ jsx(DialogErrorAlert, { error }),
|
|
196
|
+
/* @__PURE__ */ jsxs(Button, { type: "submit", className: "w-full h-11", disabled: isProcessing, children: [
|
|
197
|
+
/* @__PURE__ */ jsx(ArrowLeftRight, { className: "h-4 w-4 mr-2" }),
|
|
198
|
+
t("Send counter-offer")
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ jsx(DialogNote, { children: t("This offer will be recorded onchain.") })
|
|
201
|
+
] }) })
|
|
202
|
+
] })
|
|
203
|
+
] })
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
CounterOfferDialog
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=counter-offer-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketplace/counter-offer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { useUsdPrices } from \"../../utils/use-usd-prices.js\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport type { z } from \"zod\";\nimport { ArrowLeftRight } from \"lucide-react\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form.js\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { MarketplaceDialog, DialogErrorAlert, DialogNote, DialogSignInGate } from \"./dialog-frame.js\";\nimport { Badge } from \"../badge.js\";\nimport { MarketplaceDialogHero, DurationPicker } from \"../marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"../transaction-dialog-states.js\";\nimport { successMessages } from \"../../utils/success-messages.js\";\nimport { usdValueFor } from \"../../utils/use-usd-prices.js\";\nimport { counterOfferFormSchema } from \"../../utils/order-form.js\";\nimport { useMarketplaceTransaction } from \"../../utils/marketplace/use-marketplace-transaction.js\";\nimport { makeCounterOffer } from \"../../utils/marketplace/intents.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { CurrencyIcon } from \"../currency-icon.js\";\nimport { useDurationOptions } from \"../../utils/duration-options.js\";\nimport { useT } from \"../../i18n/index.js\";\n\nfunction toRawWei(humanAmount: string, decimals: number): string {\n const parts = humanAmount.replace(/,/g, \"\").split(\".\");\n const integer = BigInt(parts[0] || \"0\");\n const fraction = (parts[1] || \"\").padEnd(decimals, \"0\").slice(0, decimals);\n return (integer * BigInt(10 ** decimals) + BigInt(fraction)).toString();\n}\n\ntype FormValues = z.infer<typeof counterOfferFormSchema>;\n\nexport interface CounterOfferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n originalOrderHash: string;\n tokenName?: string;\n tokenImage?: string | null;\n tokenId?: string;\n currentBid?: string;\n currencySymbol: string;\n currencyDecimals: number;\n}\n\nexport function CounterOfferDialog({\n open,\n onOpenChange,\n originalOrderHash,\n tokenName,\n tokenImage,\n tokenId,\n currentBid,\n currencySymbol,\n currencyDecimals,\n}: CounterOfferDialogProps) {\n const t = useT();\n const durationOptions = useDurationOptions();\n const { walletAddress } = useMedialaneApp();\n const hasWallet = walletAddress !== null;\n const { phase, busy: isProcessing, txHash, error, start, reset } = useMarketplaceTransaction();\n const [pendingValues, setPendingValues] = useState<FormValues | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(counterOfferFormSchema),\n defaultValues: { price: \"\", durationSeconds: 604800, message: \"\" },\n });\n\n const usdPrices = useUsdPrices();\n const watchedPrice = form.watch(\"price\");\n const usdEquivalent = usdValueFor(watchedPrice || undefined, currencySymbol, usdPrices);\n\n const onSubmit = (values: FormValues) => {\n if (!hasWallet) return;\n setPendingValues(values);\n void start((ctx) => makeCounterOffer(ctx, {\n originalOrderHash,\n counterPriceRaw: toRawWei(values.price, currencyDecimals),\n durationSeconds: values.durationSeconds,\n message: values.message || undefined,\n }));\n };\n\n const handleClose = (v: boolean) => {\n if (!isProcessing) {\n form.reset();\n reset();\n setPendingValues(null);\n onOpenChange(v);\n }\n };\n\n const name = tokenName || \"this token\";\n\n return (\n <MarketplaceDialog\n open={open}\n onOpenChange={handleClose}\n title={t(\"Send a counter-offer\")}\n description={t(\"Propose a different price to the buyer.\")}\n >\n <TransactionDialogStates\n phase={phase}\n asset={{ name, image: tokenImage }}\n txHash={txHash}\n error={error}\n success={successMessages.countered({ name, price: `${pendingValues?.price} ${currencySymbol}` }, t)}\n errorTitle={t(\"Counter-offer failed\")}\n errorDescription={t(\"The counter-offer did not complete.\")}\n onRetry={reset}\n onDone={() => handleClose(false)}\n >\n {!hasWallet ? (\n <DialogSignInGate\n title={t(\"Secure your account to send a counter-offer\")}\n description={t(\"You need an account to counter bids.\")}\n />\n ) : (\n <>\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId ?? \"\"}\n fallbackIcon={<ArrowLeftRight className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n <div className=\"px-5 pb-5 pt-3 space-y-4\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-base leading-tight truncate\">{name}</p>\n {currentBid && (\n <div className=\"mt-1 flex items-center gap-2 text-xs text-muted-foreground\">\n <span>{t(\"Current bid\")}</span>\n <Badge variant=\"secondary\">{currentBid}</Badge>\n </div>\n )}\n </div>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-4\">\n <FormField\n control={form.control}\n name=\"price\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>{t(\"Your counter price\")}</FormLabel>\n <div className=\"relative\">\n <FormControl>\n <Input\n type=\"number\"\n step=\"any\"\n placeholder=\"0.00\"\n className=\"pr-20\"\n disabled={isProcessing}\n {...field}\n />\n </FormControl>\n <div className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1 pointer-events-none\">\n <CurrencyIcon symbol={currencySymbol} size={14} />\n <span className=\"text-xs font-bold\">{currencySymbol}</span>\n </div>\n </div>\n {usdEquivalent && (\n <p className=\"text-xs text-muted-foreground\">≈ {usdEquivalent}</p>\n )}\n <FormMessage />\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"durationSeconds\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>{t(\"Valid for\")}</FormLabel>\n <FormControl>\n <DurationPicker\n options={durationOptions}\n value={field.value}\n onChange={field.onChange}\n disabled={isProcessing}\n />\n </FormControl>\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"message\"\n render={({ field }) => (\n <FormItem>\n <FormLabel className=\"flex items-center gap-1\">\n {t(\"Message\")} <span className=\"text-muted-foreground text-xs\">{t(\"(optional)\")}</span>\n </FormLabel>\n <FormControl>\n <Textarea\n placeholder={t(\"Explain your counter price to the buyer…\")}\n className=\"resize-none\"\n rows={2}\n maxLength={500}\n disabled={isProcessing}\n {...field}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n <DialogErrorAlert error={error} />\n\n <Button type=\"submit\" className=\"w-full h-11\" disabled={isProcessing}>\n <ArrowLeftRight className=\"h-4 w-4 mr-2\" />\n {t(\"Send counter-offer\")}\n </Button>\n <DialogNote>{t(\"This offer will be recorded onchain.\")}</DialogNote>\n </form>\n </Form>\n </div>\n </>\n )}\n </TransactionDialogStates>\n </MarketplaceDialog>\n );\n}\n"],"mappings":";AAmHU,SAKA,UALA,KAgBQ,YAhBR;AAjHV,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAE5B,SAAS,sBAAsB;AAC/B,SAAS,MAAM,aAAa,WAAW,UAAU,WAAW,mBAAmB;AAC/E,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,mBAAmB,kBAAkB,YAAY,wBAAwB;AAClF,SAAS,aAAa;AACtB,SAAS,uBAAuB,sBAAsB;AACtD,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAC1C,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,YAAY;AAErB,SAAS,SAAS,aAAqB,UAA0B;AAC/D,QAAM,QAAQ,YAAY,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG;AACrD,QAAM,UAAU,OAAO,MAAM,CAAC,KAAK,GAAG;AACtC,QAAM,YAAY,MAAM,CAAC,KAAK,IAAI,OAAO,UAAU,GAAG,EAAE,MAAM,GAAG,QAAQ;AACzE,UAAQ,UAAU,OAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ,GAAG,SAAS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J;AAAA,gBAEA,oBAAC,oBAAiB,OAAc;AAAA,gBAEhC,qBAAC,UAAO,MAAK,UAAS,WAAU,eAAc,UAAU,cACtD;AAAA,sCAAC,kBAAe,WAAU,gBAAe;AAAA,kBACxC,EAAE,oBAAoB;AAAA,mBACzB;AAAA,gBACA,oBAAC,cAAY,YAAE,sCAAsC,GAAE;AAAA,iBACzD,GACF;AAAA,eACF;AAAA,aACF;AAAA;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var dialog_frame_exports = {};
|
|
21
|
+
__export(dialog_frame_exports, {
|
|
22
|
+
DialogErrorAlert: () => DialogErrorAlert,
|
|
23
|
+
DialogNote: () => DialogNote,
|
|
24
|
+
DialogSignInGate: () => DialogSignInGate,
|
|
25
|
+
MarketplaceDialog: () => MarketplaceDialog
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(dialog_frame_exports);
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
var import_lucide_react = require("lucide-react");
|
|
30
|
+
var import_dialog = require("../dialog.js");
|
|
31
|
+
var import_alert = require("../alert.js");
|
|
32
|
+
var import_marketplace_dialog_primitives = require("../marketplace-dialog-primitives.js");
|
|
33
|
+
var import_medialane_app = require("../medialane-app.js");
|
|
34
|
+
function MarketplaceDialog({ open, onOpenChange, title, description, children }) {
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, { className: "sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col", children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { className: "sr-only", children: title }),
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, { className: "sr-only", children: description }),
|
|
38
|
+
children
|
|
39
|
+
] }) });
|
|
40
|
+
}
|
|
41
|
+
function DialogErrorAlert({ error }) {
|
|
42
|
+
if (!error) return null;
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { variant: "destructive", children: [
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { children: error })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
function DialogNote({ children }) {
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start justify-center gap-1.5", children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShieldCheck, { className: "h-3 w-3 text-muted-foreground shrink-0 mt-0.5" }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-center text-muted-foreground", children })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
function DialogSignInGate({ title, description }) {
|
|
55
|
+
const { onRequireWallet } = (0, import_medialane_app.useMedialaneApp)();
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_marketplace_dialog_primitives.MarketplaceSignInGate, { title, description, onClick: onRequireWallet });
|
|
57
|
+
}
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
DialogErrorAlert,
|
|
61
|
+
DialogNote,
|
|
62
|
+
DialogSignInGate,
|
|
63
|
+
MarketplaceDialog
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=dialog-frame.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketplace/dialog-frame.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertCircle, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../dialog.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { MarketplaceSignInGate } from \"../marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\n\ninterface MarketplaceDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description: string;\n children: React.ReactNode;\n}\n\nexport function MarketplaceDialog({ open, onOpenChange, title, description, children }: MarketplaceDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col\">\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\nexport function DialogErrorAlert({ error }: { error: string | null }) {\n if (!error) return null;\n return (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n );\n}\n\nexport function DialogNote({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{children}</p>\n </div>\n );\n}\n\nexport function DialogSignInGate({ title, description }: { title: string; description: string }) {\n const { onRequireWallet } = useMedialaneApp();\n return <MarketplaceSignInGate title={title} description={description} onClick={onRequireWallet} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBM;AAjBN,0BAAyC;AACzC,oBAAsE;AACtE,mBAAwC;AACxC,2CAAsC;AACtC,2BAAgC;AAUzB,SAAS,kBAAkB,EAAE,MAAM,cAAc,OAAO,aAAa,SAAS,GAA2B;AAC9G,SACE,4CAAC,wBAAO,MAAY,cAClB,uDAAC,+BAAc,WAAU,mEACvB;AAAA,gDAAC,6BAAY,WAAU,WAAW,iBAAM;AAAA,IACxC,4CAAC,mCAAkB,WAAU,WAAW,uBAAY;AAAA,IACnD;AAAA,KACH,GACF;AAEJ;AAEO,SAAS,iBAAiB,EAAE,MAAM,GAA6B;AACpE,MAAI,CAAC,MAAO,QAAO;AACnB,SACE,6CAAC,sBAAM,SAAQ,eACb;AAAA,gDAAC,mCAAY,WAAU,WAAU;AAAA,IACjC,4CAAC,iCAAkB,iBAAM;AAAA,KAC3B;AAEJ;AAEO,SAAS,WAAW,EAAE,SAAS,GAAkC;AACtE,SACE,6CAAC,SAAI,WAAU,2CACb;AAAA,gDAAC,mCAAY,WAAU,iDAAgD;AAAA,IACvE,4CAAC,OAAE,WAAU,8CAA8C,UAAS;AAAA,KACtE;AAEJ;AAEO,SAAS,iBAAiB,EAAE,OAAO,YAAY,GAA2C;AAC/F,QAAM,EAAE,gBAAgB,QAAI,sCAAgB;AAC5C,SAAO,4CAAC,8DAAsB,OAAc,aAA0B,SAAS,iBAAiB;AAClG;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface MarketplaceDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function MarketplaceDialog({ open, onOpenChange, title, description, children }: MarketplaceDialogProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare function DialogErrorAlert({ error }: {
|
|
12
|
+
error: string | null;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
14
|
+
declare function DialogNote({ children }: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function DialogSignInGate({ title, description }: {
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
}): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { DialogErrorAlert, DialogNote, DialogSignInGate, MarketplaceDialog };
|