@0xsequence/marketplace-sdk 1.2.0 → 2.0.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/.storybook/preview.tsx +4 -7
- package/CHANGELOG.md +192 -1
- package/compile-tailwind.js +1 -1
- package/dist/BellIcon.js +48 -0
- package/dist/BellIcon.js.map +1 -0
- package/dist/Card.js +831 -0
- package/dist/Card.js.map +1 -0
- package/dist/ShopCard.d.ts +83 -0
- package/dist/_internal.js +78 -0
- package/dist/_internal.js.map +1 -0
- package/dist/abi.js +157 -0
- package/dist/abi.js.map +1 -0
- package/dist/alertMessage.js +29 -0
- package/dist/alertMessage.js.map +1 -0
- package/dist/alien_swap.js +6 -0
- package/dist/alien_swap.js.map +1 -0
- package/dist/api.js +187 -0
- package/dist/api.js.map +1 -0
- package/dist/aqua-xyz.js +6 -0
- package/dist/aqua-xyz.js.map +1 -0
- package/dist/aura.js +6 -0
- package/dist/aura.js.map +1 -0
- package/dist/blur.js +6 -0
- package/dist/blur.js.map +1 -0
- package/dist/builder-api.js +41 -0
- package/dist/builder-api.js.map +1 -0
- package/dist/calendar.js +51 -0
- package/dist/calendar.js.map +1 -0
- package/dist/checkout.js +52 -0
- package/dist/checkout.js.map +1 -0
- package/dist/coinbase.js +6 -0
- package/dist/coinbase.js.map +1 -0
- package/dist/collectible.js +620 -0
- package/dist/collectible.js.map +1 -0
- package/dist/collection.js +396 -0
- package/dist/collection.js.map +1 -0
- package/dist/config.js +75 -0
- package/dist/config.js.map +1 -0
- package/dist/consts.d.ts +7 -0
- package/dist/consts.js +8 -0
- package/dist/consts.js.map +1 -0
- package/dist/contracts.js +116 -0
- package/dist/contracts.js.map +1 -0
- package/dist/create-config.d.ts +12255 -0
- package/dist/create-config.js +170 -0
- package/dist/create-config.js.map +1 -0
- package/dist/currency.js +186 -0
- package/dist/currency.js.map +1 -0
- package/dist/currencyImage.js +28 -0
- package/dist/currencyImage.js.map +1 -0
- package/dist/dist.js +2771 -0
- package/dist/dist.js.map +1 -0
- package/dist/element.js +6 -0
- package/dist/element.js.map +1 -0
- package/dist/expirationDateSelect.js +245 -0
- package/dist/expirationDateSelect.js.map +1 -0
- package/dist/filter-state.d.ts +153 -0
- package/dist/filters.d.ts +29 -0
- package/dist/foundation.js +6 -0
- package/dist/foundation.js.map +1 -0
- package/dist/hooks.js +26 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hooks2.js +24 -0
- package/dist/hooks2.js.map +1 -0
- package/dist/index.d.ts +12 -8
- package/dist/index.js +13 -16
- package/dist/index10.d.ts +61 -0
- package/dist/index11.d.ts +639 -0
- package/dist/index12.d.ts +563 -0
- package/dist/index13.d.ts +19 -0
- package/dist/index14.d.ts +19 -0
- package/dist/index15.d.ts +25 -0
- package/dist/index16.d.ts +8 -0
- package/dist/index17.d.ts +853 -0
- package/dist/index18.d.ts +552 -0
- package/dist/index19.d.ts +338 -0
- package/dist/index2.d.ts +2174 -0
- package/dist/index21.d.ts +319 -0
- package/dist/index22.d.ts +230 -0
- package/dist/index23.d.ts +516 -0
- package/dist/index24.d.ts +24 -0
- package/dist/index26.d.ts +27 -0
- package/dist/index27.d.ts +25 -0
- package/dist/index28.d.ts +115 -0
- package/dist/index3.d.ts +2216 -0
- package/dist/index31.d.ts +48 -0
- package/dist/index32.d.ts +1 -0
- package/dist/index33.d.ts +56 -0
- package/dist/index34.d.ts +99 -0
- package/dist/index35.d.ts +171 -0
- package/dist/index36.d.ts +131 -0
- package/dist/index37.d.ts +135 -0
- package/dist/index38.d.ts +85 -0
- package/dist/index39.d.ts +91 -0
- package/dist/index4.d.ts +3426 -0
- package/dist/index40.d.ts +46 -0
- package/dist/index5.d.ts +809 -0
- package/dist/index6.d.ts +2541 -0
- package/dist/index7.d.ts +1803 -0
- package/dist/index8.d.ts +121 -0
- package/dist/index9.d.ts +47 -0
- package/dist/inventory.d.ts +46 -0
- package/dist/inventory.js +91 -0
- package/dist/inventory.js.map +1 -0
- package/dist/looks-rare.js +6 -0
- package/dist/looks-rare.js.map +1 -0
- package/dist/magic-eden.js +6 -0
- package/dist/magic-eden.js.map +1 -0
- package/dist/manifold.js +6 -0
- package/dist/manifold.js.map +1 -0
- package/dist/marketplace-logos.js +50 -0
- package/dist/marketplace-logos.js.map +1 -0
- package/dist/marketplace.js +1913 -0
- package/dist/marketplace.js.map +1 -0
- package/dist/marketplace2.js +70 -0
- package/dist/marketplace2.js.map +1 -0
- package/dist/metadata.d.ts +733 -0
- package/dist/mintify.js +6 -0
- package/dist/mintify.js.map +1 -0
- package/dist/network.js +15 -0
- package/dist/network.js.map +1 -0
- package/dist/networkconfigToWagmiChain.js +16 -0
- package/dist/networkconfigToWagmiChain.js.map +1 -0
- package/dist/nftx.js +6 -0
- package/dist/nftx.js.map +1 -0
- package/dist/okx.js +6 -0
- package/dist/okx.js.map +1 -0
- package/dist/open-sea.js +6 -0
- package/dist/open-sea.js.map +1 -0
- package/dist/primary-sale-checkout-options.d.ts +29 -0
- package/dist/primary-sale.js +3048 -0
- package/dist/primary-sale.js.map +1 -0
- package/dist/quantityInput.js +93 -0
- package/dist/quantityInput.js.map +1 -0
- package/dist/ranges.d.ts +125 -0
- package/dist/rarible.js +6 -0
- package/dist/rarible.js.map +1 -0
- package/dist/react/_internal/api/index.d.ts +5 -2
- package/dist/react/_internal/api/index.js +4 -7
- package/dist/react/_internal/databeat/index.d.ts +4 -1
- package/dist/react/_internal/databeat/index.js +4 -37
- package/dist/react/_internal/index.d.ts +5 -2
- package/dist/react/_internal/index.js +6 -11
- package/dist/react/_internal/wagmi/index.d.ts +4 -1
- package/dist/react/_internal/wagmi/index.js +2 -5
- package/dist/react/hooks/_deprecated/index.d.ts +47 -0
- package/dist/react/hooks/_deprecated/index.js +4 -0
- package/dist/react/hooks/checkout/index.d.ts +7 -0
- package/dist/react/hooks/checkout/index.js +7 -0
- package/dist/react/hooks/collectible/index.d.ts +7 -0
- package/dist/react/hooks/collectible/index.js +7 -0
- package/dist/react/hooks/collection/index.d.ts +11 -0
- package/dist/react/hooks/collection/index.js +7 -0
- package/dist/react/hooks/config/index.d.ts +9 -8
- package/dist/react/hooks/config/index.js +4 -37
- package/dist/react/hooks/contracts/index.d.ts +4 -7
- package/dist/react/hooks/contracts/index.js +3 -16
- package/dist/react/hooks/currency/index.d.ts +47 -0
- package/dist/react/hooks/currency/index.js +7 -0
- package/dist/react/hooks/index.d.ts +47 -37
- package/dist/react/hooks/index.js +14 -38
- package/dist/react/hooks/inventory/index.d.ts +7 -0
- package/dist/react/hooks/inventory/index.js +4 -0
- package/dist/react/hooks/token/index.d.ts +7 -0
- package/dist/react/hooks/token/index.js +7 -0
- package/dist/react/hooks/transactions/index.d.ts +6 -3
- package/dist/react/hooks/transactions/index.js +5 -38
- package/dist/react/hooks/ui/card-data/index.d.ts +8 -0
- package/dist/react/hooks/ui/card-data/index.js +4 -0
- package/dist/react/hooks/ui/index.d.ts +11 -5
- package/dist/react/hooks/ui/index.js +8 -38
- package/dist/react/hooks/ui/url-state/index.d.ts +7 -0
- package/dist/react/hooks/ui/url-state/index.js +4 -0
- package/dist/react/hooks/utils/index.d.ts +6 -37
- package/dist/react/hooks/utils/index.js +5 -38
- package/dist/react/index.d.ts +47 -37
- package/dist/react/index.js +20 -38
- package/dist/react/providers/index.d.ts +6 -0
- package/dist/react/providers/index.js +6 -0
- package/dist/react/queries/checkout/index.d.ts +7 -0
- package/dist/react/queries/checkout/index.js +4 -0
- package/dist/react/queries/collectible/index.d.ts +7 -0
- package/dist/react/queries/collectible/index.js +5 -0
- package/dist/react/queries/collection/index.d.ts +11 -0
- package/dist/react/queries/collection/index.js +4 -0
- package/dist/react/queries/currency/index.d.ts +6 -0
- package/dist/react/queries/currency/index.js +4 -0
- package/dist/react/queries/index.d.ts +23 -24
- package/dist/react/queries/index.js +11 -30
- package/dist/react/queries/inventory/index.d.ts +7 -3
- package/dist/react/queries/inventory/index.js +3 -21
- package/dist/react/queries/marketplace/index.d.ts +7 -0
- package/dist/react/queries/marketplace/index.js +5 -0
- package/dist/react/queries/token/index.d.ts +7 -0
- package/dist/react/queries/token/index.js +4 -0
- package/dist/react/ssr/index.d.ts +13 -25
- package/dist/react/ssr/index.js +13 -36
- package/dist/react/ui/components/marketplace-collectible-card/ActionButton/index.d.ts +6 -0
- package/dist/react/ui/components/marketplace-collectible-card/ActionButton/index.js +6 -0
- package/dist/react/ui/components/marketplace-collectible-card/Card/index.d.ts +10 -0
- package/dist/react/ui/components/marketplace-collectible-card/Card/index.js +6 -0
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +45 -5
- package/dist/react/ui/components/marketplace-collectible-card/index.js +6 -38
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +6 -3
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +3 -12
- package/dist/react/ui/components/marketplace-logos/index.d.ts +23 -22
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/hooks/index.d.ts +47 -0
- package/dist/react/ui/hooks/index.js +15 -0
- package/dist/react/ui/icons/index.d.ts +3 -1
- package/dist/react/ui/icons/index.js +3 -14
- package/dist/react/ui/index.d.ts +47 -5
- package/dist/react/ui/index.js +6 -38
- package/dist/react/ui/modals/BuyModal/index.d.ts +47 -0
- package/dist/react/ui/modals/BuyModal/index.js +4 -0
- package/dist/react/ui/modals/CreateListingModal/index.d.ts +4 -0
- package/dist/react/ui/modals/CreateListingModal/index.js +6 -0
- package/dist/react/ui/modals/CreateListingModal/internal/hooks/index.d.ts +190 -0
- package/dist/react/ui/modals/CreateListingModal/internal/hooks/index.js +4 -0
- package/dist/react/ui/modals/MakeOfferModal/index.d.ts +4 -0
- package/dist/react/ui/modals/MakeOfferModal/index.js +4 -0
- package/dist/react/ui/modals/MakeOfferModal/internal/hooks/index.d.ts +188 -0
- package/dist/react/ui/modals/MakeOfferModal/internal/hooks/index.js +3 -0
- package/dist/react/ui/modals/SellModal/index.d.ts +6 -0
- package/dist/react/ui/modals/SellModal/index.js +6 -0
- package/dist/react/ui/modals/TransferModal/index.d.ts +47 -0
- package/dist/react/ui/modals/TransferModal/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/alertMessage/index.d.ts +14 -0
- package/dist/react/ui/modals/_internal/components/alertMessage/index.js +3 -0
- package/dist/react/ui/modals/_internal/components/baseModal/index.d.ts +144 -0
- package/dist/react/ui/modals/_internal/components/baseModal/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/calendar/index.d.ts +73 -0
- package/dist/react/ui/modals/_internal/components/calendar/index.js +5 -0
- package/dist/react/ui/modals/_internal/components/calendarDropdown/index.d.ts +21 -0
- package/dist/react/ui/modals/_internal/components/calendarDropdown/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/currencyImage/index.d.ts +15 -0
- package/dist/react/ui/modals/_internal/components/currencyImage/index.js +5 -0
- package/dist/react/ui/modals/_internal/components/currencyOptionsSelect/index.d.ts +30 -0
- package/dist/react/ui/modals/_internal/components/currencyOptionsSelect/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/expirationDateSelect/index.d.ts +2 -0
- package/dist/react/ui/modals/_internal/components/expirationDateSelect/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/floorPriceText/index.d.ts +24 -0
- package/dist/react/ui/modals/_internal/components/floorPriceText/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/priceInput/index.d.ts +45 -0
- package/dist/react/ui/modals/_internal/components/priceInput/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/quantityInput/index.d.ts +24 -0
- package/dist/react/ui/modals/_internal/components/quantityInput/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/selectWaasFeeOptions/index.d.ts +18 -0
- package/dist/react/ui/modals/_internal/components/selectWaasFeeOptions/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/switchChainErrorModal/index.d.ts +14 -0
- package/dist/react/ui/modals/_internal/components/switchChainErrorModal/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/timeAgo/index.d.ts +12 -0
- package/dist/react/ui/modals/_internal/components/timeAgo/index.js +5 -0
- package/dist/react/ui/modals/_internal/components/tokenPreview/index.d.ts +19 -0
- package/dist/react/ui/modals/_internal/components/tokenPreview/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/transaction-footer/index.d.ts +26 -0
- package/dist/react/ui/modals/_internal/components/transaction-footer/index.js +4 -0
- package/dist/react/ui/modals/_internal/components/transactionDetails/index.d.ts +28 -0
- package/dist/react/ui/modals/_internal/components/transactionDetails/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/transactionHeader/index.d.ts +16 -0
- package/dist/react/ui/modals/_internal/components/transactionHeader/index.js +3 -0
- package/dist/react/ui/modals/_internal/components/transactionPreview/index.d.ts +36 -0
- package/dist/react/ui/modals/_internal/components/transactionPreview/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/transactionStatusModal/index.d.ts +27 -0
- package/dist/react/ui/modals/_internal/components/transactionStatusModal/index.js +6 -0
- package/dist/react/utils/index.d.ts +6 -19
- package/dist/react/utils/index.js +3 -8
- package/dist/react.js +16224 -0
- package/dist/react.js.map +1 -0
- package/dist/sequence.js +6 -0
- package/dist/sequence.js.map +1 -0
- package/dist/ssr.js +26 -0
- package/dist/ssr.js.map +1 -0
- package/dist/steps.d.ts +85 -0
- package/dist/styles/index.css +2040 -375
- package/dist/sudo-swap.js +6 -0
- package/dist/sudo-swap.js.map +1 -0
- package/dist/super-rare.js +6 -0
- package/dist/super-rare.js.map +1 -0
- package/dist/switchChainErrorModal.js +97 -0
- package/dist/switchChainErrorModal.js.map +1 -0
- package/dist/timeAgo.js +29 -0
- package/dist/timeAgo.js.map +1 -0
- package/dist/token-balances.d.ts +359 -0
- package/dist/token-balances.js +62 -0
- package/dist/token-balances.js.map +1 -0
- package/dist/token.js +2091 -0
- package/dist/token.js.map +1 -0
- package/dist/token2.js +247 -0
- package/dist/token2.js.map +1 -0
- package/dist/transaction-footer.js +45 -0
- package/dist/transaction-footer.js.map +1 -0
- package/dist/transaction.js +70 -0
- package/dist/transaction.js.map +1 -0
- package/dist/transactionHeader.js +32 -0
- package/dist/transactionHeader.js.map +1 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/index.js +3 -4
- package/dist/types.d.ts +88 -0
- package/dist/types.js +41 -0
- package/dist/types.js.map +1 -0
- package/dist/url-state.js +170 -0
- package/dist/url-state.js.map +1 -0
- package/dist/utils/abi/index.d.ts +6 -5
- package/dist/utils/abi/index.js +5 -5
- package/dist/utils/abi/marketplace/index.d.ts +1 -1
- package/dist/utils/abi/marketplace/index.js +1 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1 -1
- package/dist/utils/abi/primary-sale/index.js +1 -1
- package/dist/utils/abi/token/index.d.ts +1 -1
- package/dist/utils/abi/token/index.js +1 -1
- package/dist/utils/index.d.ts +9 -7
- package/dist/utils/index.js +9 -13
- package/dist/utils.js +230 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils2.js +76 -0
- package/dist/utils2.js.map +1 -0
- package/dist/waas-types.d.ts +19 -0
- package/dist/wagmi.js +0 -0
- package/dist/x2y2.js +6 -0
- package/dist/x2y2.js.map +1 -0
- package/dist/xstate-store.cjs.d.ts +18 -0
- package/dist/zora.js +6 -0
- package/dist/zora.js.map +1 -0
- package/eslint/sequence-types.js +1069 -0
- package/eslint.config.mjs +337 -9
- package/image.d.ts +5 -0
- package/package.json +52 -50
- package/postcss.config.mjs +1 -1
- package/preserve-directives.ts +235 -0
- package/public/mockServiceWorker.js +0 -1
- package/src/react/_internal/api/builder-api.ts +26 -4
- package/src/react/_internal/api/index.ts +1 -2
- package/src/react/_internal/api/marketplace-api.ts +57 -25
- package/src/react/_internal/api/services.ts +56 -4
- package/src/react/_internal/api-mocks.ts +8 -0
- package/src/react/_internal/databeat/index.ts +4 -0
- package/src/react/_internal/databeat/types.ts +24 -28
- package/src/react/_internal/index.ts +70 -0
- package/src/react/_internal/query-builder.ts +203 -0
- package/src/react/_internal/types.ts +88 -18
- package/src/react/_internal/utils.ts +34 -52
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +11 -5
- package/src/react/_internal/wagmi/create-config.ts +2 -2
- package/src/react/_internal/wagmi/get-connectors.ts +22 -7
- package/src/react/hooks/_deprecated/index.ts +61 -0
- package/src/react/hooks/checkout/index.ts +1 -0
- package/src/react/hooks/checkout/primary-sale-checkout-options.test.tsx +206 -0
- package/src/react/hooks/checkout/primary-sale-checkout-options.tsx +111 -0
- package/src/react/hooks/collectible/balance.test.tsx +149 -0
- package/src/react/hooks/collectible/balance.tsx +39 -0
- package/src/react/hooks/collectible/erc721-sale-details.tsx +184 -0
- package/src/react/hooks/collectible/index.ts +16 -0
- package/src/react/hooks/collectible/market-count.test.tsx +133 -0
- package/src/react/hooks/collectible/market-count.tsx +75 -0
- package/src/react/hooks/collectible/market-highest-offer.test.tsx +112 -0
- package/src/react/hooks/collectible/market-highest-offer.tsx +74 -0
- package/src/react/hooks/collectible/market-list-paginated.test.tsx +211 -0
- package/src/react/hooks/collectible/market-list-paginated.tsx +109 -0
- package/src/react/hooks/collectible/market-list.test.tsx +243 -0
- package/src/react/hooks/collectible/market-list.tsx +79 -0
- package/src/react/hooks/collectible/market-listings-count.test.tsx +110 -0
- package/src/react/hooks/collectible/market-listings-count.tsx +75 -0
- package/src/react/hooks/collectible/market-listings.test.tsx +140 -0
- package/src/react/hooks/collectible/market-listings.tsx +99 -0
- package/src/react/hooks/collectible/market-lowest-listing.test.tsx +157 -0
- package/src/react/hooks/collectible/market-lowest-listing.tsx +74 -0
- package/src/react/hooks/collectible/market-offers-count.test.tsx +110 -0
- package/src/react/hooks/collectible/market-offers-count.tsx +75 -0
- package/src/react/hooks/collectible/market-offers.test.tsx +139 -0
- package/src/react/hooks/collectible/market-offers.tsx +79 -0
- package/src/react/hooks/collectible/metadata.test.tsx +119 -0
- package/src/react/hooks/collectible/metadata.tsx +72 -0
- package/src/react/hooks/collectible/primary-sale-item.test.tsx +503 -0
- package/src/react/hooks/collectible/primary-sale-item.tsx +69 -0
- package/src/react/hooks/collectible/primary-sale-items-count.test.tsx +154 -0
- package/src/react/hooks/collectible/primary-sale-items-count.tsx +22 -0
- package/src/react/hooks/collectible/primary-sale-items.test.tsx +259 -0
- package/src/react/hooks/collectible/primary-sale-items.tsx +66 -0
- package/src/react/hooks/collectible/token-balances.test.tsx +175 -0
- package/src/react/hooks/collectible/token-balances.tsx +38 -0
- package/src/react/hooks/collection/__snapshots__/list.test.tsx.snap +303 -0
- package/src/react/hooks/collection/balance-details.test.tsx +163 -0
- package/src/react/hooks/collection/balance-details.tsx +106 -0
- package/src/react/hooks/collection/index.ts +11 -0
- package/src/react/hooks/collection/list.test.tsx +111 -0
- package/src/react/hooks/collection/list.tsx +80 -0
- package/src/react/hooks/collection/market-detail-polling.test.tsx +146 -0
- package/src/react/hooks/collection/market-detail-polling.tsx +65 -0
- package/src/react/hooks/collection/market-filtered-count.test.tsx +121 -0
- package/src/react/hooks/collection/market-filtered-count.tsx +39 -0
- package/src/react/hooks/collection/market-floor.test.tsx +104 -0
- package/src/react/hooks/collection/market-floor.tsx +74 -0
- package/src/react/hooks/collection/market-items-count.test.tsx +121 -0
- package/src/react/hooks/collection/market-items-count.tsx +90 -0
- package/src/react/hooks/collection/market-items-paginated.test.tsx +142 -0
- package/src/react/hooks/collection/market-items-paginated.tsx +110 -0
- package/src/react/hooks/collection/market-items.test.tsx +184 -0
- package/src/react/hooks/collection/market-items.tsx +95 -0
- package/src/react/hooks/collection/metadata.test.tsx +103 -0
- package/src/react/hooks/collection/metadata.tsx +75 -0
- package/src/react/hooks/collection/useCollectionActiveListingsCurrencies.test.tsx +150 -0
- package/src/react/hooks/collection/useCollectionActiveListingsCurrencies.tsx +74 -0
- package/src/react/hooks/collection/useCollectionActiveOffersCurrencies.test.tsx +150 -0
- package/src/react/hooks/collection/useCollectionActiveOffersCurrencies.tsx +74 -0
- package/src/react/hooks/config/__snapshots__/useMarketplaceConfig.test.tsx.snap +12 -11
- package/src/react/hooks/config/useConnectorMetadata.tsx +1 -1
- package/src/react/hooks/config/useMarketplaceConfig.test.tsx +3 -1
- package/src/react/hooks/config/useMarketplaceConfig.tsx +1 -1
- package/src/react/hooks/contracts/index.ts +1 -0
- package/src/react/hooks/contracts/useERC721Owner.test.tsx +82 -0
- package/src/react/hooks/contracts/useERC721Owner.tsx +47 -0
- package/src/react/hooks/contracts/useSalesContractABI.ts +2 -2
- package/src/react/hooks/currency/compare-prices.test.tsx +221 -0
- package/src/react/hooks/currency/compare-prices.tsx +104 -0
- package/src/react/hooks/currency/convert-to-usd.test.tsx +173 -0
- package/src/react/hooks/currency/convert-to-usd.tsx +96 -0
- package/src/react/hooks/currency/currency.test.tsx +131 -0
- package/src/react/hooks/currency/currency.tsx +65 -0
- package/src/react/hooks/currency/index.ts +4 -0
- package/src/react/hooks/currency/list.test.tsx +191 -0
- package/src/react/hooks/currency/list.tsx +65 -0
- package/src/react/hooks/data/orders/useOrders.test.tsx +143 -0
- package/src/react/hooks/data/orders/useOrders.tsx +73 -0
- package/src/react/hooks/data/tokens/useCurrencyBalance.tsx +1 -1
- package/src/react/hooks/index.ts +9 -12
- package/src/react/hooks/inventory/index.ts +1 -0
- package/src/react/hooks/inventory/inventory.test.tsx +160 -0
- package/src/react/hooks/inventory/inventory.tsx +17 -0
- package/src/react/hooks/token/balances.test.tsx +111 -0
- package/src/react/hooks/token/balances.tsx +59 -0
- package/src/react/hooks/token/currency-balance.test.tsx +83 -0
- package/src/react/hooks/token/currency-balance.tsx +151 -0
- package/src/react/hooks/token/index.ts +5 -0
- package/src/react/hooks/token/metadata-search.test.tsx +292 -0
- package/src/react/hooks/token/metadata-search.tsx +192 -0
- package/src/react/hooks/token/metadata.test.tsx +140 -0
- package/src/react/hooks/token/metadata.tsx +73 -0
- package/src/react/hooks/token/ranges.test.tsx +112 -0
- package/src/react/hooks/token/ranges.tsx +93 -0
- package/src/react/hooks/transactions/index.ts +5 -0
- package/src/react/hooks/transactions/useBuyTransaction.tsx +95 -0
- package/src/react/hooks/transactions/useCancelOrder.test.tsx +15 -35
- package/src/react/hooks/transactions/useCancelOrder.tsx +3 -9
- package/src/react/hooks/transactions/useCancelTransactionSteps.tsx +3 -9
- package/src/react/hooks/transactions/useGenerateCancelTransaction.test.tsx +23 -12
- package/src/react/hooks/transactions/useGenerateCancelTransaction.tsx +16 -11
- package/src/react/hooks/transactions/useGenerateListingTransaction.test.tsx +17 -57
- package/src/react/hooks/transactions/useGenerateListingTransaction.tsx +17 -12
- package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +14 -15
- package/src/react/hooks/transactions/useGenerateOfferTransaction.tsx +11 -11
- package/src/react/hooks/transactions/useGenerateSellTransaction.test.tsx +28 -38
- package/src/react/hooks/transactions/useGenerateSellTransaction.tsx +16 -15
- package/src/react/hooks/transactions/useMarketTransactionSteps.test.tsx +105 -0
- package/src/react/hooks/transactions/useMarketTransactionSteps.tsx +89 -0
- package/src/react/hooks/transactions/useOrderSteps.tsx +23 -36
- package/src/react/hooks/transactions/usePrimarySaleTransactionSteps.ts +196 -0
- package/src/react/hooks/transactions/useProcessStep.test.tsx +63 -59
- package/src/react/hooks/transactions/useProcessStep.ts +52 -54
- package/src/react/hooks/transactions/useTransactionExecution.test.tsx +99 -0
- package/src/react/hooks/transactions/useTransactionExecution.ts +31 -0
- package/src/react/hooks/transactions/useTransactionType.ts +20 -0
- package/src/react/hooks/transactions/useTransferTokens.test.tsx +16 -16
- package/src/react/hooks/transactions/useTransferTokens.tsx +17 -5
- package/src/react/hooks/ui/card-data/index.ts +4 -0
- package/src/react/hooks/ui/card-data/market-card-data-paged.test.tsx +375 -0
- package/src/react/hooks/ui/card-data/market-card-data-paged.tsx +265 -0
- package/src/react/hooks/ui/card-data/market-card-data.test.tsx +299 -0
- package/src/react/hooks/ui/card-data/market-card-data.tsx +178 -0
- package/src/react/hooks/ui/card-data/primary-sale-1155-card-data.tsx +89 -0
- package/src/react/hooks/ui/card-data/primary-sale-721-card-data.tsx +227 -0
- package/src/react/hooks/ui/index.ts +3 -1
- package/src/react/hooks/ui/url-state/filter-state.test.tsx +569 -0
- package/src/react/hooks/ui/url-state/filter-state.tsx +264 -0
- package/src/react/hooks/ui/url-state/index.ts +1 -0
- package/src/react/hooks/ui/useCollectibleCardOfferState.test.tsx +75 -0
- package/src/react/hooks/ui/useCollectibleCardOfferState.ts +47 -0
- package/src/react/hooks/ui/useFilters.test.tsx +4 -1
- package/src/react/hooks/ui/useFilters.tsx +2 -2
- package/src/react/hooks/util/optimisticCancelUpdates.test.ts +489 -0
- package/src/react/hooks/util/optimisticCancelUpdates.ts +21 -22
- package/src/react/hooks/utils/index.ts +0 -4
- package/src/react/hooks/utils/useAutoSelectFeeOption.test.tsx +8 -5
- package/src/react/hooks/utils/useAutoSelectFeeOption.tsx +33 -17
- package/src/react/hooks/utils/useRoyalty.test.tsx +1 -1
- package/src/react/hooks/utils/useRoyalty.tsx +99 -34
- package/src/react/hooks/utils/useWaasFeeOptions.tsx +234 -0
- package/src/react/hooks/utils/waasFeeOptionsStore.ts +141 -0
- package/src/react/index.ts +3 -0
- package/src/react/providers/index.tsx +3 -3
- package/src/react/providers/modal-provider.tsx +6 -17
- package/src/react/providers/provider.test.tsx +1 -1
- package/src/react/providers/shadow-root.tsx +1 -1
- package/src/react/providers/theme-provider.tsx +1 -1
- package/src/react/queries/checkout/index.ts +1 -0
- package/src/react/queries/checkout/primary-sale-checkout-options.ts +118 -0
- package/src/react/queries/collectible/balance.ts +113 -0
- package/src/react/queries/collectible/index.ts +15 -0
- package/src/react/queries/collectible/market-count.ts +91 -0
- package/src/react/queries/collectible/market-highest-offer.ts +74 -0
- package/src/react/queries/collectible/market-list-paginated.ts +110 -0
- package/src/react/queries/collectible/market-list.ts +116 -0
- package/src/react/queries/collectible/market-listings-count.ts +70 -0
- package/src/react/queries/collectible/market-listings.ts +71 -0
- package/src/react/queries/collectible/market-lowest-listing.ts +74 -0
- package/src/react/queries/collectible/market-offers-count.ts +70 -0
- package/src/react/queries/collectible/market-offers.ts +90 -0
- package/src/react/queries/collectible/metadata.ts +84 -0
- package/src/react/queries/collectible/primary-sale-item.ts +79 -0
- package/src/react/queries/collectible/primary-sale-items-count.ts +67 -0
- package/src/react/queries/collectible/primary-sale-items.ts +96 -0
- package/src/react/queries/collectible/queryKeys.ts +12 -0
- package/src/react/queries/collectible/token-balances.ts +83 -0
- package/src/react/queries/collection/activeListingsCurrencies.ts +74 -0
- package/src/react/queries/collection/activeOffersCurrencies.ts +74 -0
- package/src/react/queries/collection/balance-details.ts +103 -0
- package/src/react/queries/collection/index.ts +9 -0
- package/src/react/queries/collection/list.ts +195 -0
- package/src/react/queries/collection/market-detail.ts +60 -0
- package/src/react/queries/collection/market-filtered-count.ts +67 -0
- package/src/react/queries/collection/market-floor.ts +58 -0
- package/src/react/queries/collection/market-items-count.ts +69 -0
- package/src/react/queries/collection/market-items-paginated.ts +84 -0
- package/src/react/queries/collection/market-items.ts +72 -0
- package/src/react/queries/collection/metadata.ts +60 -0
- package/src/react/queries/collection/queryKeys.ts +12 -0
- package/src/react/queries/currency/compare-prices.ts +122 -0
- package/src/react/queries/currency/convert-to-usd.ts +99 -0
- package/src/react/queries/currency/currency.ts +82 -0
- package/src/react/queries/currency/index.ts +4 -0
- package/src/react/queries/currency/list.ts +100 -0
- package/src/react/queries/index.ts +6 -7
- package/src/react/queries/inventory/inventory.ts +139 -91
- package/src/react/queries/marketplace/config.ts +85 -0
- package/src/react/queries/marketplace/filters.ts +139 -0
- package/src/react/queries/marketplace/index.ts +2 -0
- package/src/react/queries/marketplace/queryKeys.ts +12 -0
- package/src/react/queries/orders.ts +48 -0
- package/src/react/queries/token/balances.ts +107 -0
- package/src/react/queries/token/index.ts +5 -0
- package/src/react/queries/token/metadata-search.ts +95 -0
- package/src/react/queries/token/metadata.ts +80 -0
- package/src/react/queries/token/queryKeys.ts +12 -0
- package/src/react/queries/token/ranges.ts +74 -0
- package/src/react/queries/token/supplies.ts +86 -0
- package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +11 -10
- package/src/react/ssr/create-ssr-client.ts +1 -1
- package/src/react/ssr/index.ts +5 -0
- package/src/react/types/query.ts +8 -7
- package/src/react/ui/components/_internals/ErrorDisplay.tsx +87 -0
- package/src/react/ui/components/_internals/ErrorLogBox.tsx +8 -1
- package/src/react/ui/components/_internals/custom-select/CustomSelect.tsx +13 -14
- package/src/react/ui/components/_internals/pill/__tests__/Pill.test.tsx +9 -5
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/ActionButton.stories.tsx +293 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/ActionButton.tsx +114 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/__tests__/ActionButtonBody.test.tsx +106 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/__tests__/NonOwnerActions.test.tsx +70 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/__tests__/OwnerActions.test.tsx +68 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/__tests__/useActionButtonLogic.test.tsx +101 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/components/ActionButtonBody.tsx +57 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/components/NonOwnerActions.tsx +136 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/components/OwnerActions.tsx +91 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/hooks/useActionButtonLogic.ts +97 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/index.ts +1 -0
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/store.ts +85 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-badge.tsx +37 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-content.tsx +27 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-footer.tsx +38 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-media.tsx +69 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-price.tsx +44 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-sale-details.tsx +37 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-skeleton.tsx +39 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-title.tsx +109 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card.tsx +51 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/index.ts +30 -0
- package/src/react/ui/components/marketplace-collectible-card/CollectibleCardSkeleton.tsx +1 -1
- package/src/react/ui/components/marketplace-collectible-card/_internals/PriceDisplay.tsx +87 -0
- package/src/react/ui/components/marketplace-collectible-card/constants.ts +20 -0
- package/src/react/ui/components/marketplace-collectible-card/index.ts +6 -0
- package/src/react/ui/components/marketplace-collectible-card/types.ts +31 -16
- package/src/react/ui/components/marketplace-collectible-card/utils/determineCardAction.ts +63 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/formatPrice.ts +71 -2
- package/src/react/ui/components/marketplace-collectible-card/utils/index.ts +3 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/renderSkeleton.tsx +44 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/shopCardState.ts +83 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/supplyStatus.ts +5 -5
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +63 -78
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCardPresentation.tsx +170 -0
- package/src/react/ui/components/marketplace-collectible-card/variants/NonTradableInventoryCard.tsx +56 -38
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +55 -65
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCardPresentation.tsx +144 -0
- package/src/react/ui/components/marketplace-logos/marketplace-logos.tsx +1 -5
- package/src/react/ui/components/media/Media.tsx +1 -1
- package/src/react/ui/components/media/MediaSkeleton.tsx +1 -1
- package/src/react/ui/hooks/index.ts +2 -0
- package/src/react/ui/icons/BellIcon.tsx +7 -3
- package/src/react/ui/icons/iconVariants.ts +11 -0
- package/src/react/ui/icons/index.ts +0 -3
- package/src/react/ui/index.ts +37 -8
- package/src/react/ui/modals/BuyModal/components/BuyModalContent.tsx +161 -0
- package/src/react/ui/modals/BuyModal/components/CollectibleMetadataSummary.tsx +141 -0
- package/src/react/ui/modals/BuyModal/components/CryptoPaymentModal.tsx +177 -0
- package/src/react/ui/modals/BuyModal/components/CryptoPaymentModalSkeleton.tsx +48 -0
- package/src/react/ui/modals/BuyModal/components/Modal.tsx +2 -2
- package/src/react/ui/modals/BuyModal/components/TrailsCss.ts +216 -0
- package/src/react/ui/modals/BuyModal/components/sequence-checkout/ERC1155QuantityModal.tsx +197 -0
- package/src/react/ui/modals/BuyModal/components/sequence-checkout/SequenceCheckoutNew.tsx +161 -0
- package/src/react/ui/modals/BuyModal/components/sequence-checkout/usePaymentModalParams.ts +204 -0
- package/src/react/ui/modals/BuyModal/components/types.ts +6 -5
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155SalePaymentParams.test.tsx +369 -0
- package/src/react/ui/modals/BuyModal/hooks/useBuyModalData.ts +151 -0
- package/src/react/ui/modals/BuyModal/hooks/useERC1155SalePaymentParams.ts +244 -0
- package/src/react/ui/modals/BuyModal/hooks/useExecuteBundledTransactions.ts +167 -0
- package/src/react/ui/modals/BuyModal/hooks/useHasSufficientBalance.ts +30 -0
- package/src/react/ui/modals/BuyModal/hooks/useMarketPlatformFee.ts +2 -2
- package/src/react/ui/modals/BuyModal/index.tsx +6 -3
- package/src/react/ui/modals/BuyModal/internal/__tests__/determineCheckoutMode.test.ts +119 -0
- package/src/react/ui/modals/BuyModal/internal/buyModalContext.ts +146 -0
- package/src/react/ui/modals/BuyModal/internal/cryptoPaymentModalContext.tsx +399 -0
- package/src/react/ui/modals/BuyModal/internal/determineCheckoutMode.ts +49 -0
- package/src/react/ui/modals/BuyModal/store.ts +25 -94
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +141 -308
- package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +35 -61
- package/src/react/ui/modals/CreateListingModal/index.tsx +16 -9
- package/src/react/ui/modals/CreateListingModal/internal/context.ts +416 -0
- package/src/react/ui/modals/CreateListingModal/internal/helpers/validation.ts +79 -0
- package/src/react/ui/modals/CreateListingModal/internal/hooks/index.ts +1 -0
- package/src/react/ui/modals/CreateListingModal/internal/hooks/use-collectible-approval.ts +49 -0
- package/src/react/ui/modals/CreateListingModal/internal/listing-mutations.ts +267 -0
- package/src/react/ui/modals/CreateListingModal/internal/store.ts +150 -0
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +130 -348
- package/src/react/ui/modals/MakeOfferModal/__stories__/MakeOfferModal.mock-data.ts +494 -0
- package/src/react/ui/modals/MakeOfferModal/__stories__/MakeOfferModal.stories.tsx +699 -0
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +28 -155
- package/src/react/ui/modals/MakeOfferModal/index.tsx +17 -11
- package/src/react/ui/modals/MakeOfferModal/internal/context.ts +453 -0
- package/src/react/ui/modals/MakeOfferModal/internal/helpers/validation.ts +99 -0
- package/src/react/ui/modals/MakeOfferModal/internal/hooks/index.ts +1 -0
- package/src/react/ui/modals/MakeOfferModal/internal/hooks/use-erc20-allowance.ts +43 -0
- package/src/react/ui/modals/MakeOfferModal/internal/offer-mutations.ts +231 -0
- package/src/react/ui/modals/MakeOfferModal/internal/store.ts +150 -0
- package/src/react/ui/modals/SellModal/Modal.tsx +74 -213
- package/src/react/ui/modals/SellModal/index.tsx +5 -11
- package/src/react/ui/modals/SellModal/internal/context.ts +284 -0
- package/src/react/ui/modals/SellModal/internal/sell-mutations.ts +163 -0
- package/src/react/ui/modals/SellModal/internal/store.ts +76 -0
- package/src/react/ui/modals/SellModal/internal/use-generate-sell-transaction.ts +93 -0
- package/src/react/ui/modals/TransferModal/__tests__/store.test.ts +51 -345
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TokenQuantityInput.tsx +36 -34
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/WalletAddressInput.tsx +19 -28
- package/src/react/ui/modals/TransferModal/index.tsx +98 -97
- package/src/react/ui/modals/TransferModal/internal/context.ts +404 -0
- package/src/react/ui/modals/TransferModal/internal/store.ts +118 -0
- package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +2 -3
- package/src/react/ui/modals/_internal/components/baseModal/ActionModal.tsx +338 -0
- package/src/react/ui/modals/_internal/components/baseModal/BaseModal.tsx +51 -0
- package/src/react/ui/modals/_internal/components/baseModal/ErrorBoundary.tsx +83 -0
- package/src/react/ui/modals/_internal/components/baseModal/ErrorModal.tsx +51 -0
- package/src/react/ui/modals/_internal/components/baseModal/LoadingModal.tsx +35 -0
- package/src/react/ui/modals/_internal/components/baseModal/SmartErrorHandler.tsx +31 -0
- package/src/react/ui/modals/_internal/components/baseModal/__tests__/ErrorBoundary.test.tsx +390 -0
- package/src/react/ui/modals/_internal/components/baseModal/errors/ModalInitializationError.tsx +91 -0
- package/src/react/ui/modals/_internal/components/baseModal/errors/errorActionType.ts +5 -0
- package/src/react/ui/modals/_internal/components/baseModal/index.ts +13 -0
- package/src/react/ui/modals/_internal/components/calendarDropdown/TimeSelector.tsx +1 -1
- package/src/react/ui/modals/_internal/components/calendarDropdown/index.tsx +14 -9
- package/src/react/ui/modals/_internal/components/consts.ts +19 -5
- package/src/react/ui/modals/_internal/components/currencyImage/index.tsx +5 -7
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +6 -14
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +17 -24
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/floorPriceText/__tests__/FloorPriceText.test.tsx +61 -40
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +23 -19
- package/src/react/ui/modals/_internal/components/priceInput/__tests__/PriceInput.test.tsx +3 -3
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +66 -66
- package/src/react/ui/modals/_internal/components/quantityInput/__tests__/index.test.tsx +22 -137
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +84 -131
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +14 -31
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/_components/ActionButtons.tsx +37 -25
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +13 -6
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/store.ts +9 -26
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +27 -29
- package/src/react/ui/modals/_internal/components/switchChainErrorModal/store.ts +2 -2
- package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +10 -9
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +11 -7
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +8 -7
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +3 -5
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +3 -3
- package/src/react/ui/modals/_internal/components/transactionStatusModal/hooks/useTransactionStatus.ts +4 -15
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +14 -15
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +8 -11
- package/src/react/ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect.tsx +65 -10
- package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +484 -0
- package/src/react/ui/modals/_internal/helpers/currency.ts +56 -0
- package/src/react/ui/modals/_internal/helpers/dnum-utils.ts +40 -0
- package/src/react/ui/modals/_internal/helpers/flow-state.ts +269 -0
- package/src/react/ui/modals/_internal/helpers/step-guards.ts +131 -0
- package/src/react/ui/modals/_internal/types/steps.ts +145 -0
- package/src/react/ui/modals/_internal/types.ts +2 -9
- package/src/react/utils/index.ts +2 -0
- package/src/react/utils/normalize-attributes.test.ts +94 -0
- package/src/react/utils/normalize-attributes.ts +89 -0
- package/src/react/utils/normalize-properties.test.ts +77 -0
- package/src/react/utils/normalize-properties.ts +60 -0
- package/src/react/utils/normalizePriceFilters.ts +25 -0
- package/src/react/utils/waitForTransactionReceipt.ts +2 -2
- package/src/styles/index.css +2 -0
- package/src/styles/styles.ts +2036 -374
- package/src/types/api-types.ts +6 -14
- package/src/types/buyModalErrors.ts +24 -30
- package/src/types/index.ts +4 -2
- package/src/types/sdk-config.ts +14 -1
- package/src/types/transactions.ts +10 -0
- package/src/types/types.ts +93 -14
- package/src/utils/__tests__/getMarketplaceDetails.test.ts +1 -1
- package/src/utils/_internal/error/base.ts +1 -1
- package/src/utils/_internal/error/transaction.ts +4 -5
- package/src/utils/abi/helpers.ts +38 -0
- package/src/utils/abi/index.ts +1 -0
- package/src/utils/decode/erc20.ts +2 -2
- package/src/utils/errors.ts +527 -0
- package/src/utils/getConduitAddressForOrderbook.ts +38 -0
- package/src/utils/getErrorMessage.ts +37 -0
- package/src/utils/getMarketplaceDetails.ts +1 -1
- package/src/utils/getSequenceMarketRequestId.ts +3 -7
- package/src/utils/getWagmiErrorMessage.ts +241 -0
- package/src/utils/getWebRPCErrorMessage.ts +63 -0
- package/src/utils/networkconfigToWagmiChain.ts +2 -1
- package/src/utils/price.ts +12 -10
- package/test/const.ts +3 -3
- package/test/globalSetup.ts +4 -5
- package/test/handlers.ts +2 -2
- package/test/server-setup.ts +8 -8
- package/test/setup.ts +11 -0
- package/test/test-utils.tsx +23 -6
- package/tsconfig.json +8 -1
- package/tsdown.config.ts +13 -3
- package/dist/BellIcon-DMKEumAz.js +0 -45
- package/dist/BellIcon-DMKEumAz.js.map +0 -1
- package/dist/CartIcon-UyB4NYKt.js +0 -102
- package/dist/CartIcon-UyB4NYKt.js.map +0 -1
- package/dist/CollectibleCard-z05qWzKE.d.ts +0 -8
- package/dist/_internal-DkS2VUn5.js +0 -22
- package/dist/_internal-DkS2VUn5.js.map +0 -1
- package/dist/abi-fa-o9gH3.js +0 -134
- package/dist/abi-fa-o9gH3.js.map +0 -1
- package/dist/alien_swap-Cq8LuElo.js +0 -6
- package/dist/alien_swap-Cq8LuElo.js.map +0 -1
- package/dist/api-GwTR0dBA.js +0 -210
- package/dist/api-GwTR0dBA.js.map +0 -1
- package/dist/aqua-xyz-0yye_c-Z.js +0 -6
- package/dist/aqua-xyz-0yye_c-Z.js.map +0 -1
- package/dist/aura-TaxFvTFQ.js +0 -6
- package/dist/aura-TaxFvTFQ.js.map +0 -1
- package/dist/blur-BupOTobO.js +0 -6
- package/dist/blur-BupOTobO.js.map +0 -1
- package/dist/builder-api-m4JAA6ee.js +0 -28
- package/dist/builder-api-m4JAA6ee.js.map +0 -1
- package/dist/builder.gen--XD71cNL.js +0 -303
- package/dist/builder.gen--XD71cNL.js.map +0 -1
- package/dist/coinbase-DTgZ4wDT.js +0 -6
- package/dist/coinbase-DTgZ4wDT.js.map +0 -1
- package/dist/collectibles-CZ6i8sXK.js +0 -324
- package/dist/collectibles-CZ6i8sXK.js.map +0 -1
- package/dist/collections-5NcU-7ZR.js +0 -331
- package/dist/collections-5NcU-7ZR.js.map +0 -1
- package/dist/components-CY8kx2kb.js +0 -123
- package/dist/components-CY8kx2kb.js.map +0 -1
- package/dist/contracts-DRJHF89h.js +0 -97
- package/dist/contracts-DRJHF89h.js.map +0 -1
- package/dist/create-config-BxyfYCEk.js +0 -172
- package/dist/create-config-BxyfYCEk.js.map +0 -1
- package/dist/create-config-CFBeD8CB.d.ts +0 -2019
- package/dist/element-D4dDznlu.js +0 -6
- package/dist/element-D4dDznlu.js.map +0 -1
- package/dist/filters-B5niI_fX.d.ts +0 -60
- package/dist/foundation-GHZOKAzN.js +0 -6
- package/dist/foundation-GHZOKAzN.js.map +0 -1
- package/dist/index-8scPf0CS.d.ts +0 -55
- package/dist/index-9qsplZ8r.d.ts +0 -18
- package/dist/index-BIuYTMc2.d.ts +0 -122
- package/dist/index-BNrz99xy.d.ts +0 -24
- package/dist/index-BYQOPS8e.d.ts +0 -1003
- package/dist/index-BkZ7SPLc.d.ts +0 -288
- package/dist/index-BnUku_aF.d.ts +0 -808
- package/dist/index-BtDAHMW_.d.ts +0 -50
- package/dist/index-C-c_M_sE.d.ts +0 -107
- package/dist/index-CNIiC8Z_.d.ts +0 -67
- package/dist/index-CbERNN3s.d.ts +0 -505
- package/dist/index-CsfxsN0t.d.ts +0 -61
- package/dist/index-DASjaiJL.d.ts +0 -406
- package/dist/index-DD7Vc4cE.d.ts +0 -809
- package/dist/index-DIc8OqWV.d.ts +0 -152
- package/dist/index-DVI_vggD.d.ts +0 -171
- package/dist/index-DqxQeYT2.d.ts +0 -450
- package/dist/index-Dsf9FRtr.d.ts +0 -121
- package/dist/index-DxAReMEO.d.ts +0 -357
- package/dist/index-UXRoZmd_.d.ts +0 -70
- package/dist/index-isFvc5gd.d.ts +0 -2541
- package/dist/index-j3nuJWyJ.d.ts +0 -139
- package/dist/index-nVb7o0hc.d.ts +0 -7
- package/dist/index-pbE88Tt7.d.ts +0 -1803
- package/dist/inventory--t6Zu55O.js +0 -75
- package/dist/inventory--t6Zu55O.js.map +0 -1
- package/dist/listCollectiblesPaginated-BlE5mSzh.d.ts +0 -327
- package/dist/listCollections-DWyqFSQ3.d.ts +0 -828
- package/dist/looks-rare-2HBhMpOf.js +0 -6
- package/dist/looks-rare-2HBhMpOf.js.map +0 -1
- package/dist/lowestListing-DsunDO1c.d.ts +0 -475
- package/dist/magic-eden-BYdTp-uk.js +0 -6
- package/dist/magic-eden-BYdTp-uk.js.map +0 -1
- package/dist/manifold-yE0x6ZmO.js +0 -6
- package/dist/manifold-yE0x6ZmO.js.map +0 -1
- package/dist/market-DuBpFsDg.js +0 -219
- package/dist/market-DuBpFsDg.js.map +0 -1
- package/dist/marketCurrencies-BgwmbGFk.d.ts +0 -164
- package/dist/marketCurrencies-Bolonndy.js +0 -59
- package/dist/marketCurrencies-Bolonndy.js.map +0 -1
- package/dist/marketplace-NQB-sEQL.js +0 -1913
- package/dist/marketplace-NQB-sEQL.js.map +0 -1
- package/dist/marketplace-logos-Cz9RrtQo.js +0 -50
- package/dist/marketplace-logos-Cz9RrtQo.js.map +0 -1
- package/dist/marketplace.gen-906FrJQJ.js +0 -1147
- package/dist/marketplace.gen-906FrJQJ.js.map +0 -1
- package/dist/marketplaceConfig-Bqjo7NYO.js +0 -85
- package/dist/marketplaceConfig-Bqjo7NYO.js.map +0 -1
- package/dist/mintify-BXQx3mZB.js +0 -6
- package/dist/mintify-BXQx3mZB.js.map +0 -1
- package/dist/network-DwdZ_5-7.js +0 -15
- package/dist/network-DwdZ_5-7.js.map +0 -1
- package/dist/networkconfigToWagmiChain-Ct-hGq8M.js +0 -16
- package/dist/networkconfigToWagmiChain-Ct-hGq8M.js.map +0 -1
- package/dist/nftx-B929_3Ce.js +0 -6
- package/dist/nftx-B929_3Ce.js.map +0 -1
- package/dist/okx-sZ0-Udny.js +0 -6
- package/dist/okx-sZ0-Udny.js.map +0 -1
- package/dist/open-sea-DO9PhTrz.js +0 -6
- package/dist/open-sea-DO9PhTrz.js.map +0 -1
- package/dist/orders-DH76ym2e.js +0 -469
- package/dist/orders-DH76ym2e.js.map +0 -1
- package/dist/primary-sale-1u4QlPdA.js +0 -3048
- package/dist/primary-sale-1u4QlPdA.js.map +0 -1
- package/dist/primary-sales-CECrqatg.js +0 -156
- package/dist/primary-sales-CECrqatg.js.map +0 -1
- package/dist/query-brXxOcH0.d.ts +0 -31
- package/dist/rarible-Ccb2hs7y.js +0 -6
- package/dist/rarible-Ccb2hs7y.js.map +0 -1
- package/dist/react/hooks/data/collectibles/index.d.ts +0 -11
- package/dist/react/hooks/data/collectibles/index.js +0 -39
- package/dist/react/hooks/data/collections/index.d.ts +0 -11
- package/dist/react/hooks/data/collections/index.js +0 -39
- package/dist/react/hooks/data/index.d.ts +0 -37
- package/dist/react/hooks/data/index.js +0 -39
- package/dist/react/hooks/data/inventory/index.d.ts +0 -37
- package/dist/react/hooks/data/inventory/index.js +0 -39
- package/dist/react/hooks/data/market/index.d.ts +0 -12
- package/dist/react/hooks/data/market/index.js +0 -39
- package/dist/react/hooks/data/orders/index.d.ts +0 -11
- package/dist/react/hooks/data/orders/index.js +0 -39
- package/dist/react/hooks/data/primary-sales/index.d.ts +0 -37
- package/dist/react/hooks/data/primary-sales/index.js +0 -39
- package/dist/react/hooks/data/tokens/index.d.ts +0 -5
- package/dist/react/hooks/data/tokens/index.js +0 -39
- package/dist/react/queries/collectibles/index.d.ts +0 -11
- package/dist/react/queries/collectibles/index.js +0 -22
- package/dist/react/queries/collections/index.d.ts +0 -11
- package/dist/react/queries/collections/index.js +0 -20
- package/dist/react/queries/market/index.d.ts +0 -6
- package/dist/react/queries/market/index.js +0 -22
- package/dist/react/queries/orders/index.d.ts +0 -11
- package/dist/react/queries/orders/index.js +0 -13
- package/dist/react/queries/primary-sales/index.d.ts +0 -4
- package/dist/react/queries/primary-sales/index.js +0 -13
- package/dist/react/queries/tokens/index.d.ts +0 -5
- package/dist/react/queries/tokens/index.js +0 -13
- package/dist/react/queries/utils/index.d.ts +0 -4
- package/dist/react/queries/utils/index.js +0 -22
- package/dist/react/ssr/index.js.map +0 -1
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +0 -3
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +0 -22
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +0 -51
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +0 -39
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +0 -40
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +0 -39
- package/dist/react-CBsgOdVP.js +0 -13476
- package/dist/react-CBsgOdVP.js.map +0 -1
- package/dist/sequence-CRdb1yEs.js +0 -6
- package/dist/sequence-CRdb1yEs.js.map +0 -1
- package/dist/src-Dz2CfBL0.js +0 -8
- package/dist/src-Dz2CfBL0.js.map +0 -1
- package/dist/sudo-swap-BIklG2gq.js +0 -6
- package/dist/sudo-swap-BIklG2gq.js.map +0 -1
- package/dist/super-rare-h8645_5E.js +0 -6
- package/dist/super-rare-h8645_5E.js.map +0 -1
- package/dist/token-Cv7l2ZaL.js +0 -2091
- package/dist/token-Cv7l2ZaL.js.map +0 -1
- package/dist/tokenBalances-CouzNX4j.js +0 -57
- package/dist/tokenBalances-CouzNX4j.js.map +0 -1
- package/dist/tokenSupplies-C3zJll0M.d.ts +0 -265
- package/dist/tokens-BvIRUCGG.js +0 -225
- package/dist/tokens-BvIRUCGG.js.map +0 -1
- package/dist/transaction-DZUW5RHu.js +0 -76
- package/dist/transaction-DZUW5RHu.js.map +0 -1
- package/dist/types-B_-cnkcP.js +0 -13
- package/dist/types-B_-cnkcP.js.map +0 -1
- package/dist/types-CMDwfhfR.d.ts +0 -78
- package/dist/utils-9ToOvt-c.js +0 -235
- package/dist/utils-9ToOvt-c.js.map +0 -1
- package/dist/utils-B6di6O-C.js +0 -43
- package/dist/utils-B6di6O-C.js.map +0 -1
- package/dist/utils-BCYTEOvy.js +0 -122
- package/dist/utils-BCYTEOvy.js.map +0 -1
- package/dist/waitForTransactionReceipt-CbSeUSXe.js +0 -26
- package/dist/waitForTransactionReceipt-CbSeUSXe.js.map +0 -1
- package/dist/x2y2-OvF__ugj.js +0 -6
- package/dist/x2y2-OvF__ugj.js.map +0 -1
- package/dist/zora-DzCeu-eE.js +0 -6
- package/dist/zora-DzCeu-eE.js.map +0 -1
- package/src/react/_internal/api/__mocks__/builder.msw.ts +0 -239
- package/src/react/_internal/api/__mocks__/indexer.msw.ts +0 -216
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +0 -402
- package/src/react/_internal/api/__mocks__/metadata.msw.ts +0 -195
- package/src/react/_internal/api/builder.gen.ts +0 -773
- package/src/react/_internal/api/marketplace.gen.ts +0 -2718
- package/src/react/_internal/api/query-keys.ts +0 -124
- package/src/react/hooks/data/collectibles/index.ts +0 -6
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.test.tsx +0 -141
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.tsx +0 -39
- package/src/react/hooks/data/collectibles/useCollectible.test.tsx +0 -117
- package/src/react/hooks/data/collectibles/useCollectible.tsx +0 -69
- package/src/react/hooks/data/collectibles/useCountOfCollectables.test.tsx +0 -128
- package/src/react/hooks/data/collectibles/useCountOfCollectables.tsx +0 -70
- package/src/react/hooks/data/collectibles/useListCollectibleActivities.test.tsx +0 -192
- package/src/react/hooks/data/collectibles/useListCollectibleActivities.tsx +0 -98
- package/src/react/hooks/data/collectibles/useListCollectibles.test.tsx +0 -231
- package/src/react/hooks/data/collectibles/useListCollectibles.tsx +0 -78
- package/src/react/hooks/data/collectibles/useListCollectiblesPaginated.test.tsx +0 -211
- package/src/react/hooks/data/collectibles/useListCollectiblesPaginated.tsx +0 -107
- package/src/react/hooks/data/collectibles/useTokenBalances.test.tsx +0 -151
- package/src/react/hooks/data/collectibles/useTokenBalances.tsx +0 -38
- package/src/react/hooks/data/collections/__snapshots__/useListCollections.test.tsx.snap +0 -303
- package/src/react/hooks/data/collections/index.ts +0 -8
- package/src/react/hooks/data/collections/useCollection.test.tsx +0 -98
- package/src/react/hooks/data/collections/useCollection.tsx +0 -66
- package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.test.tsx +0 -112
- package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.tsx +0 -74
- package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.test.tsx +0 -110
- package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.tsx +0 -74
- package/src/react/hooks/data/collections/useCollectionBalanceDetails.test.tsx +0 -158
- package/src/react/hooks/data/collections/useCollectionBalanceDetails.tsx +0 -106
- package/src/react/hooks/data/collections/useCollectionDetails.test.tsx +0 -83
- package/src/react/hooks/data/collections/useCollectionDetails.ts +0 -69
- package/src/react/hooks/data/collections/useCollectionDetailsPolling.test.tsx +0 -137
- package/src/react/hooks/data/collections/useCollectionDetailsPolling.tsx +0 -64
- package/src/react/hooks/data/collections/useListCollectionActivities.test.tsx +0 -227
- package/src/react/hooks/data/collections/useListCollectionActivities.tsx +0 -93
- package/src/react/hooks/data/collections/useListCollections.test.tsx +0 -110
- package/src/react/hooks/data/collections/useListCollections.tsx +0 -80
- package/src/react/hooks/data/index.ts +0 -6
- package/src/react/hooks/data/inventory/index.ts +0 -1
- package/src/react/hooks/data/inventory/useInventory.test.tsx +0 -162
- package/src/react/hooks/data/inventory/useInventory.tsx +0 -12
- package/src/react/hooks/data/market/index.ts +0 -3
- package/src/react/hooks/data/market/useCurrency.test.tsx +0 -127
- package/src/react/hooks/data/market/useCurrency.tsx +0 -65
- package/src/react/hooks/data/market/useListMarketCardData.test.tsx +0 -297
- package/src/react/hooks/data/market/useListMarketCardData.tsx +0 -165
- package/src/react/hooks/data/market/useMarketCurrencies.test.tsx +0 -216
- package/src/react/hooks/data/market/useMarketCurrencies.tsx +0 -65
- package/src/react/hooks/data/orders/index.ts +0 -11
- package/src/react/hooks/data/orders/useCountItemsOrdersForCollection.tsx +0 -90
- package/src/react/hooks/data/orders/useCountListingsForCollectible.test.tsx +0 -107
- package/src/react/hooks/data/orders/useCountListingsForCollectible.tsx +0 -75
- package/src/react/hooks/data/orders/useCountOffersForCollectible.test.tsx +0 -107
- package/src/react/hooks/data/orders/useCountOffersForCollectible.tsx +0 -75
- package/src/react/hooks/data/orders/useFloorOrder.test.tsx +0 -100
- package/src/react/hooks/data/orders/useFloorOrder.tsx +0 -70
- package/src/react/hooks/data/orders/useGetCountOfFilteredOrders.tsx +0 -39
- package/src/react/hooks/data/orders/useHighestOffer.test.tsx +0 -101
- package/src/react/hooks/data/orders/useHighestOffer.tsx +0 -72
- package/src/react/hooks/data/orders/useListItemsOrdersForCollection.tsx +0 -93
- package/src/react/hooks/data/orders/useListItemsOrdersForCollectionPaginated.tsx +0 -108
- package/src/react/hooks/data/orders/useListListingsForCollectible.test.tsx +0 -140
- package/src/react/hooks/data/orders/useListListingsForCollectible.tsx +0 -101
- package/src/react/hooks/data/orders/useListOffersForCollectible.test.tsx +0 -139
- package/src/react/hooks/data/orders/useListOffersForCollectible.tsx +0 -80
- package/src/react/hooks/data/orders/useLowestListing.test.tsx +0 -146
- package/src/react/hooks/data/orders/useLowestListing.tsx +0 -72
- package/src/react/hooks/data/primary-sales/index.ts +0 -7
- package/src/react/hooks/data/primary-sales/useCountOfPrimarySaleItems.tsx +0 -13
- package/src/react/hooks/data/primary-sales/useErc721SalesData.tsx +0 -184
- package/src/react/hooks/data/primary-sales/useGetCountOfPrimarySaleItems.tsx +0 -48
- package/src/react/hooks/data/primary-sales/useList1155ShopCardData.tsx +0 -96
- package/src/react/hooks/data/primary-sales/useList721ShopCardData.tsx +0 -194
- package/src/react/hooks/data/primary-sales/useListPrimarySaleItems.tsx +0 -66
- package/src/react/hooks/data/primary-sales/usePrimarySaleItem.tsx +0 -71
- package/src/react/hooks/data/tokens/index.ts +0 -5
- package/src/react/hooks/data/tokens/useCurrencyBalance.test.tsx +0 -83
- package/src/react/hooks/data/tokens/useGetTokenRanges.test.tsx +0 -111
- package/src/react/hooks/data/tokens/useGetTokenRanges.tsx +0 -94
- package/src/react/hooks/data/tokens/useListBalances.test.tsx +0 -100
- package/src/react/hooks/data/tokens/useListBalances.tsx +0 -29
- package/src/react/hooks/data/tokens/useListTokenMetadata.test.tsx +0 -137
- package/src/react/hooks/data/tokens/useListTokenMetadata.tsx +0 -73
- package/src/react/hooks/data/tokens/useSearchTokenMetadata.test.tsx +0 -284
- package/src/react/hooks/data/tokens/useSearchTokenMetadata.tsx +0 -189
- package/src/react/hooks/data/tokens/useTokenSupplies.ts +0 -69
- package/src/react/hooks/ui/useFilterState.tsx +0 -250
- package/src/react/hooks/utils/useCheckoutOptions.test.tsx +0 -162
- package/src/react/hooks/utils/useCheckoutOptions.tsx +0 -98
- package/src/react/hooks/utils/useCheckoutOptionsSalesContract.test.tsx +0 -206
- package/src/react/hooks/utils/useCheckoutOptionsSalesContract.tsx +0 -108
- package/src/react/hooks/utils/useComparePrices.test.tsx +0 -215
- package/src/react/hooks/utils/useComparePrices.tsx +0 -102
- package/src/react/hooks/utils/useConvertPriceToUSD.test.tsx +0 -172
- package/src/react/hooks/utils/useConvertPriceToUSD.tsx +0 -96
- package/src/react/queries/collectibles/balanceOfCollectible.ts +0 -90
- package/src/react/queries/collectibles/collectible.ts +0 -81
- package/src/react/queries/collectibles/countOfCollectables.ts +0 -109
- package/src/react/queries/collectibles/index.ts +0 -7
- package/src/react/queries/collectibles/listCollectibleActivities.ts +0 -121
- package/src/react/queries/collectibles/listCollectibles.ts +0 -115
- package/src/react/queries/collectibles/listCollectiblesPaginated.ts +0 -104
- package/src/react/queries/collectibles/tokenBalances.ts +0 -89
- package/src/react/queries/collections/activeListingsCurrencies.ts +0 -84
- package/src/react/queries/collections/activeOffersCurrencies.ts +0 -84
- package/src/react/queries/collections/collection.ts +0 -69
- package/src/react/queries/collections/collectionBalanceDetails.ts +0 -107
- package/src/react/queries/collections/collectionDetails.ts +0 -79
- package/src/react/queries/collections/index.ts +0 -7
- package/src/react/queries/collections/listCollectionActivities.ts +0 -117
- package/src/react/queries/collections/listCollections.ts +0 -175
- package/src/react/queries/market/checkoutOptions.ts +0 -107
- package/src/react/queries/market/checkoutOptionsSalesContract.ts +0 -108
- package/src/react/queries/market/currency.ts +0 -92
- package/src/react/queries/market/filters.ts +0 -152
- package/src/react/queries/market/index.ts +0 -6
- package/src/react/queries/market/marketCurrencies.ts +0 -120
- package/src/react/queries/market/marketplaceConfig.ts +0 -117
- package/src/react/queries/orders/countItemsOrdersForCollection.ts +0 -86
- package/src/react/queries/orders/countListingsForCollectible.ts +0 -90
- package/src/react/queries/orders/countOffersForCollectible.ts +0 -90
- package/src/react/queries/orders/floorOrder.ts +0 -74
- package/src/react/queries/orders/getCountOfFilteredOrders.ts +0 -88
- package/src/react/queries/orders/highestOffer.ts +0 -78
- package/src/react/queries/orders/index.ts +0 -11
- package/src/react/queries/orders/listItemsOrdersForCollection.ts +0 -90
- package/src/react/queries/orders/listItemsOrdersForCollectionPaginated.ts +0 -90
- package/src/react/queries/orders/listListingsForCollectible.ts +0 -97
- package/src/react/queries/orders/listOffersForCollectible.ts +0 -116
- package/src/react/queries/orders/lowestListing.ts +0 -81
- package/src/react/queries/primary-sales/countOfPrimarySaleItems.ts +0 -62
- package/src/react/queries/primary-sales/index.ts +0 -4
- package/src/react/queries/primary-sales/primarySaleItem.ts +0 -80
- package/src/react/queries/primary-sales/primarySaleItems.ts +0 -94
- package/src/react/queries/primary-sales/primarySaleItemsCount.ts +0 -79
- package/src/react/queries/tokens/getTokenRanges.ts +0 -75
- package/src/react/queries/tokens/index.ts +0 -5
- package/src/react/queries/tokens/listBalances.ts +0 -71
- package/src/react/queries/tokens/listTokenMetadata.ts +0 -81
- package/src/react/queries/tokens/searchTokenMetadata.ts +0 -101
- package/src/react/queries/tokens/tokenSupplies.ts +0 -84
- package/src/react/queries/utils/comparePrices.ts +0 -132
- package/src/react/queries/utils/convertPriceToUSD.ts +0 -105
- package/src/react/queries/utils/index.ts +0 -2
- package/src/react/ui/components/_internals/action-button/ActionButton.stories.tsx +0 -298
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +0 -108
- package/src/react/ui/components/_internals/action-button/__tests__/ActionButtonBody.test.tsx +0 -104
- package/src/react/ui/components/_internals/action-button/__tests__/NonOwnerActions.test.tsx +0 -65
- package/src/react/ui/components/_internals/action-button/__tests__/OwnerActions.test.tsx +0 -66
- package/src/react/ui/components/_internals/action-button/__tests__/useActionButtonLogic.test.tsx +0 -99
- package/src/react/ui/components/_internals/action-button/components/ActionButtonBody.tsx +0 -52
- package/src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx +0 -145
- package/src/react/ui/components/_internals/action-button/components/OwnerActions.tsx +0 -83
- package/src/react/ui/components/_internals/action-button/hooks/useActionButtonLogic.ts +0 -97
- package/src/react/ui/components/_internals/action-button/store.ts +0 -85
- package/src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx +0 -79
- package/src/react/ui/components/marketplace-collectible-card/components/BaseCard.tsx +0 -68
- package/src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx +0 -165
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/FooterName.tsx +0 -103
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/PriceDisplay.tsx +0 -80
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/SaleDetailsPill.tsx +0 -29
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/TokenTypeBalancePill.tsx +0 -30
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/index.ts +0 -4
- package/src/react/ui/components/marketplace-collectible-card/components/footer/index.ts +0 -2
- package/src/react/ui/icons/CalendarIcon.tsx +0 -37
- package/src/react/ui/icons/CartIcon.tsx +0 -52
- package/src/react/ui/icons/InfoIcon.tsx +0 -44
- package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +0 -557
- package/src/react/ui/modals/BuyModal/__tests__/ERC1155ShopModal.test.tsx +0 -398
- package/src/react/ui/modals/BuyModal/__tests__/ERC721ShopModal.test.tsx +0 -272
- package/src/react/ui/modals/BuyModal/__tests__/Modal.test.tsx.bak +0 -112
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +0 -251
- package/src/react/ui/modals/BuyModal/__tests__/store.test.ts +0 -105
- package/src/react/ui/modals/BuyModal/components/BuyModalRouter.tsx +0 -157
- package/src/react/ui/modals/BuyModal/components/ERC1155BuyModal.tsx +0 -198
- package/src/react/ui/modals/BuyModal/components/ERC1155QuantityModal.tsx +0 -208
- package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +0 -124
- package/src/react/ui/modals/BuyModal/components/ERC721BuyModal.tsx +0 -116
- package/src/react/ui/modals/BuyModal/components/ERC721ShopModal.tsx +0 -86
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useCheckoutOptions.test.tsx +0 -115
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155Checkout.test.tsx +0 -395
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC721SalePaymentParams.test.tsx +0 -283
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useMarketPlatformFee.test.tsx +0 -145
- package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +0 -86
- package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +0 -103
- package/src/react/ui/modals/BuyModal/hooks/useERC721SalePaymentParams.ts +0 -216
- package/src/react/ui/modals/BuyModal/hooks/useLoadData.ts +0 -120
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +0 -243
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +0 -98
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +0 -87
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +0 -246
- package/src/react/ui/modals/CreateListingModal/store.ts +0 -99
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +0 -90
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +0 -71
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +0 -241
- package/src/react/ui/modals/MakeOfferModal/store.ts +0 -94
- package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +0 -85
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +0 -79
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +0 -77
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +0 -242
- package/src/react/ui/modals/SellModal/store.ts +0 -62
- package/src/react/ui/modals/SellModal/utils.ts +0 -38
- package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +0 -157
- package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +0 -154
- package/src/react/ui/modals/SuccessfulPurchaseModal/store.ts +0 -71
- package/src/react/ui/modals/TransferModal/__tests__/__snapshots__/store.test.ts.snap +0 -17
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/__tests__/useHandleTransfer.test.tsx +0 -412
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TransferButton.tsx +0 -66
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +0 -137
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +0 -97
- package/src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx +0 -31
- package/src/react/ui/modals/TransferModal/messages.ts +0 -14
- package/src/react/ui/modals/TransferModal/store.ts +0 -122
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.test.tsx +0 -281
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +0 -113
- package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +0 -35
- package/src/react/ui/modals/_internal/components/actionModal/LoadingModal.tsx +0 -32
- package/src/react/ui/modals/_internal/components/actionModal/index.ts +0 -1
- package/src/types/custom.d.ts +0 -1
- package/src/types/messages.ts +0 -43
- package/src/types/new-marketplace-types.ts +0 -95
- /package/dist/{index-CCggO_hw.d.ts → index20.d.ts} +0 -0
- /package/dist/{index-CKefEBrI.d.ts → index25.d.ts} +0 -0
- /package/dist/{index-DgsCqh_P.d.ts → index29.d.ts} +0 -0
- /package/dist/{index-xpO4AQyS.d.ts → index30.d.ts} +0 -0
- /package/dist/{queries-CyajGg_O.js → queries.js} +0 -0
- /package/dist/{wagmi-Bseovd6Q.js → src.js} +0 -0
- /package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/types.ts +0 -0
- /package/src/react/ui/modals/_internal/hooks/{useSelectWaasFeeOptions.ts → useSelectWaasFeeOptions.tsx} +0 -0
package/dist/index3.d.ts
ADDED
|
@@ -0,0 +1,2216 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React$1, { CSSProperties, JSX as JSX$1, ReactNode, useEffect } from "react";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region ../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts
|
|
6
|
+
type ClassValue$1 = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
|
|
7
|
+
type ClassDictionary = Record<string, any>;
|
|
8
|
+
type ClassArray = ClassValue$1[];
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/types.d.ts
|
|
11
|
+
|
|
12
|
+
type ClassValue = ClassValue$1;
|
|
13
|
+
type ClassProp = {
|
|
14
|
+
class: ClassValue;
|
|
15
|
+
className?: never;
|
|
16
|
+
} | {
|
|
17
|
+
class?: never;
|
|
18
|
+
className: ClassValue;
|
|
19
|
+
} | {
|
|
20
|
+
class?: never;
|
|
21
|
+
className?: never;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region ../node_modules/.pnpm/motion-utils@12.23.6/node_modules/motion-utils/dist/index.d.ts
|
|
25
|
+
|
|
26
|
+
type EasingFunction = (v: number) => number;
|
|
27
|
+
type BezierDefinition = readonly [number, number, number, number];
|
|
28
|
+
type EasingDefinition = BezierDefinition | "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate";
|
|
29
|
+
/**
|
|
30
|
+
* The easing function to use. Set as one of:
|
|
31
|
+
*
|
|
32
|
+
* - The name of an in-built easing function.
|
|
33
|
+
* - An array of four numbers to define a cubic bezier curve.
|
|
34
|
+
* - An easing function, that accepts and returns a progress value between `0` and `1`.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
type Easing = EasingDefinition | EasingFunction;
|
|
39
|
+
interface Point {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
}
|
|
43
|
+
interface Axis {
|
|
44
|
+
min: number;
|
|
45
|
+
max: number;
|
|
46
|
+
}
|
|
47
|
+
interface Box {
|
|
48
|
+
x: Axis;
|
|
49
|
+
y: Axis;
|
|
50
|
+
}
|
|
51
|
+
interface BoundingBox {
|
|
52
|
+
top: number;
|
|
53
|
+
right: number;
|
|
54
|
+
bottom: number;
|
|
55
|
+
left: number;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region ../node_modules/.pnpm/motion-dom@12.23.23/node_modules/motion-dom/dist/index.d.ts
|
|
59
|
+
interface SVGAttributes$1 {
|
|
60
|
+
accentHeight?: AnyResolvedKeyframe | undefined;
|
|
61
|
+
accumulate?: "none" | "sum" | undefined;
|
|
62
|
+
additive?: "replace" | "sum" | undefined;
|
|
63
|
+
alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit" | undefined;
|
|
64
|
+
allowReorder?: "no" | "yes" | undefined;
|
|
65
|
+
alphabetic?: AnyResolvedKeyframe | undefined;
|
|
66
|
+
amplitude?: AnyResolvedKeyframe | undefined;
|
|
67
|
+
arabicForm?: "initial" | "medial" | "terminal" | "isolated" | undefined;
|
|
68
|
+
ascent?: AnyResolvedKeyframe | undefined;
|
|
69
|
+
attributeName?: string | undefined;
|
|
70
|
+
attributeType?: string | undefined;
|
|
71
|
+
autoReverse?: boolean | undefined;
|
|
72
|
+
azimuth?: AnyResolvedKeyframe | undefined;
|
|
73
|
+
baseFrequency?: AnyResolvedKeyframe | undefined;
|
|
74
|
+
baselineShift?: AnyResolvedKeyframe | undefined;
|
|
75
|
+
baseProfile?: AnyResolvedKeyframe | undefined;
|
|
76
|
+
bbox?: AnyResolvedKeyframe | undefined;
|
|
77
|
+
begin?: AnyResolvedKeyframe | undefined;
|
|
78
|
+
bias?: AnyResolvedKeyframe | undefined;
|
|
79
|
+
by?: AnyResolvedKeyframe | undefined;
|
|
80
|
+
calcMode?: AnyResolvedKeyframe | undefined;
|
|
81
|
+
capHeight?: AnyResolvedKeyframe | undefined;
|
|
82
|
+
clip?: AnyResolvedKeyframe | undefined;
|
|
83
|
+
clipPath?: string | undefined;
|
|
84
|
+
clipPathUnits?: AnyResolvedKeyframe | undefined;
|
|
85
|
+
clipRule?: AnyResolvedKeyframe | undefined;
|
|
86
|
+
colorInterpolation?: AnyResolvedKeyframe | undefined;
|
|
87
|
+
colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit" | undefined;
|
|
88
|
+
colorProfile?: AnyResolvedKeyframe | undefined;
|
|
89
|
+
colorRendering?: AnyResolvedKeyframe | undefined;
|
|
90
|
+
contentScriptType?: AnyResolvedKeyframe | undefined;
|
|
91
|
+
contentStyleType?: AnyResolvedKeyframe | undefined;
|
|
92
|
+
cursor?: AnyResolvedKeyframe | undefined;
|
|
93
|
+
cx?: AnyResolvedKeyframe | undefined;
|
|
94
|
+
cy?: AnyResolvedKeyframe | undefined;
|
|
95
|
+
d?: string | undefined;
|
|
96
|
+
decelerate?: AnyResolvedKeyframe | undefined;
|
|
97
|
+
descent?: AnyResolvedKeyframe | undefined;
|
|
98
|
+
diffuseConstant?: AnyResolvedKeyframe | undefined;
|
|
99
|
+
direction?: AnyResolvedKeyframe | undefined;
|
|
100
|
+
display?: AnyResolvedKeyframe | undefined;
|
|
101
|
+
divisor?: AnyResolvedKeyframe | undefined;
|
|
102
|
+
dominantBaseline?: AnyResolvedKeyframe | undefined;
|
|
103
|
+
dur?: AnyResolvedKeyframe | undefined;
|
|
104
|
+
dx?: AnyResolvedKeyframe | undefined;
|
|
105
|
+
dy?: AnyResolvedKeyframe | undefined;
|
|
106
|
+
edgeMode?: AnyResolvedKeyframe | undefined;
|
|
107
|
+
elevation?: AnyResolvedKeyframe | undefined;
|
|
108
|
+
enableBackground?: AnyResolvedKeyframe | undefined;
|
|
109
|
+
end?: AnyResolvedKeyframe | undefined;
|
|
110
|
+
exponent?: AnyResolvedKeyframe | undefined;
|
|
111
|
+
externalResourcesRequired?: boolean | undefined;
|
|
112
|
+
fill?: string | undefined;
|
|
113
|
+
fillOpacity?: AnyResolvedKeyframe | undefined;
|
|
114
|
+
fillRule?: "nonzero" | "evenodd" | "inherit" | undefined;
|
|
115
|
+
filter?: string | undefined;
|
|
116
|
+
filterRes?: AnyResolvedKeyframe | undefined;
|
|
117
|
+
filterUnits?: AnyResolvedKeyframe | undefined;
|
|
118
|
+
floodColor?: AnyResolvedKeyframe | undefined;
|
|
119
|
+
floodOpacity?: AnyResolvedKeyframe | undefined;
|
|
120
|
+
focusable?: boolean | "auto" | undefined;
|
|
121
|
+
fontFamily?: string | undefined;
|
|
122
|
+
fontSize?: AnyResolvedKeyframe | undefined;
|
|
123
|
+
fontSizeAdjust?: AnyResolvedKeyframe | undefined;
|
|
124
|
+
fontStretch?: AnyResolvedKeyframe | undefined;
|
|
125
|
+
fontStyle?: AnyResolvedKeyframe | undefined;
|
|
126
|
+
fontVariant?: AnyResolvedKeyframe | undefined;
|
|
127
|
+
fontWeight?: AnyResolvedKeyframe | undefined;
|
|
128
|
+
format?: AnyResolvedKeyframe | undefined;
|
|
129
|
+
fr?: AnyResolvedKeyframe | undefined;
|
|
130
|
+
from?: AnyResolvedKeyframe | undefined;
|
|
131
|
+
fx?: AnyResolvedKeyframe | undefined;
|
|
132
|
+
fy?: AnyResolvedKeyframe | undefined;
|
|
133
|
+
g1?: AnyResolvedKeyframe | undefined;
|
|
134
|
+
g2?: AnyResolvedKeyframe | undefined;
|
|
135
|
+
glyphName?: AnyResolvedKeyframe | undefined;
|
|
136
|
+
glyphOrientationHorizontal?: AnyResolvedKeyframe | undefined;
|
|
137
|
+
glyphOrientationVertical?: AnyResolvedKeyframe | undefined;
|
|
138
|
+
glyphRef?: AnyResolvedKeyframe | undefined;
|
|
139
|
+
gradientTransform?: string | undefined;
|
|
140
|
+
gradientUnits?: string | undefined;
|
|
141
|
+
hanging?: AnyResolvedKeyframe | undefined;
|
|
142
|
+
horizAdvX?: AnyResolvedKeyframe | undefined;
|
|
143
|
+
horizOriginX?: AnyResolvedKeyframe | undefined;
|
|
144
|
+
href?: string | undefined;
|
|
145
|
+
ideographic?: AnyResolvedKeyframe | undefined;
|
|
146
|
+
imageRendering?: AnyResolvedKeyframe | undefined;
|
|
147
|
+
in2?: AnyResolvedKeyframe | undefined;
|
|
148
|
+
in?: string | undefined;
|
|
149
|
+
intercept?: AnyResolvedKeyframe | undefined;
|
|
150
|
+
k1?: AnyResolvedKeyframe | undefined;
|
|
151
|
+
k2?: AnyResolvedKeyframe | undefined;
|
|
152
|
+
k3?: AnyResolvedKeyframe | undefined;
|
|
153
|
+
k4?: AnyResolvedKeyframe | undefined;
|
|
154
|
+
k?: AnyResolvedKeyframe | undefined;
|
|
155
|
+
kernelMatrix?: AnyResolvedKeyframe | undefined;
|
|
156
|
+
kernelUnitLength?: AnyResolvedKeyframe | undefined;
|
|
157
|
+
kerning?: AnyResolvedKeyframe | undefined;
|
|
158
|
+
keyPoints?: AnyResolvedKeyframe | undefined;
|
|
159
|
+
keySplines?: AnyResolvedKeyframe | undefined;
|
|
160
|
+
keyTimes?: AnyResolvedKeyframe | undefined;
|
|
161
|
+
lengthAdjust?: AnyResolvedKeyframe | undefined;
|
|
162
|
+
letterSpacing?: AnyResolvedKeyframe | undefined;
|
|
163
|
+
lightingColor?: AnyResolvedKeyframe | undefined;
|
|
164
|
+
limitingConeAngle?: AnyResolvedKeyframe | undefined;
|
|
165
|
+
local?: AnyResolvedKeyframe | undefined;
|
|
166
|
+
markerEnd?: string | undefined;
|
|
167
|
+
markerHeight?: AnyResolvedKeyframe | undefined;
|
|
168
|
+
markerMid?: string | undefined;
|
|
169
|
+
markerStart?: string | undefined;
|
|
170
|
+
markerUnits?: AnyResolvedKeyframe | undefined;
|
|
171
|
+
markerWidth?: AnyResolvedKeyframe | undefined;
|
|
172
|
+
mask?: string | undefined;
|
|
173
|
+
maskContentUnits?: AnyResolvedKeyframe | undefined;
|
|
174
|
+
maskUnits?: AnyResolvedKeyframe | undefined;
|
|
175
|
+
mathematical?: AnyResolvedKeyframe | undefined;
|
|
176
|
+
mode?: AnyResolvedKeyframe | undefined;
|
|
177
|
+
numOctaves?: AnyResolvedKeyframe | undefined;
|
|
178
|
+
offset?: AnyResolvedKeyframe | undefined;
|
|
179
|
+
opacity?: AnyResolvedKeyframe | undefined;
|
|
180
|
+
operator?: AnyResolvedKeyframe | undefined;
|
|
181
|
+
order?: AnyResolvedKeyframe | undefined;
|
|
182
|
+
orient?: AnyResolvedKeyframe | undefined;
|
|
183
|
+
orientation?: AnyResolvedKeyframe | undefined;
|
|
184
|
+
origin?: AnyResolvedKeyframe | undefined;
|
|
185
|
+
overflow?: AnyResolvedKeyframe | undefined;
|
|
186
|
+
overlinePosition?: AnyResolvedKeyframe | undefined;
|
|
187
|
+
overlineThickness?: AnyResolvedKeyframe | undefined;
|
|
188
|
+
paintOrder?: AnyResolvedKeyframe | undefined;
|
|
189
|
+
panose1?: AnyResolvedKeyframe | undefined;
|
|
190
|
+
path?: string | undefined;
|
|
191
|
+
pathLength?: AnyResolvedKeyframe | undefined;
|
|
192
|
+
patternContentUnits?: string | undefined;
|
|
193
|
+
patternTransform?: AnyResolvedKeyframe | undefined;
|
|
194
|
+
patternUnits?: string | undefined;
|
|
195
|
+
pointerEvents?: AnyResolvedKeyframe | undefined;
|
|
196
|
+
points?: string | undefined;
|
|
197
|
+
pointsAtX?: AnyResolvedKeyframe | undefined;
|
|
198
|
+
pointsAtY?: AnyResolvedKeyframe | undefined;
|
|
199
|
+
pointsAtZ?: AnyResolvedKeyframe | undefined;
|
|
200
|
+
preserveAlpha?: boolean | undefined;
|
|
201
|
+
preserveAspectRatio?: string | undefined;
|
|
202
|
+
primitiveUnits?: AnyResolvedKeyframe | undefined;
|
|
203
|
+
r?: AnyResolvedKeyframe | undefined;
|
|
204
|
+
radius?: AnyResolvedKeyframe | undefined;
|
|
205
|
+
refX?: AnyResolvedKeyframe | undefined;
|
|
206
|
+
refY?: AnyResolvedKeyframe | undefined;
|
|
207
|
+
renderingIntent?: AnyResolvedKeyframe | undefined;
|
|
208
|
+
repeatCount?: AnyResolvedKeyframe | undefined;
|
|
209
|
+
repeatDur?: AnyResolvedKeyframe | undefined;
|
|
210
|
+
requiredExtensions?: AnyResolvedKeyframe | undefined;
|
|
211
|
+
requiredFeatures?: AnyResolvedKeyframe | undefined;
|
|
212
|
+
restart?: AnyResolvedKeyframe | undefined;
|
|
213
|
+
result?: string | undefined;
|
|
214
|
+
rotate?: AnyResolvedKeyframe | undefined;
|
|
215
|
+
rx?: AnyResolvedKeyframe | undefined;
|
|
216
|
+
ry?: AnyResolvedKeyframe | undefined;
|
|
217
|
+
scale?: AnyResolvedKeyframe | undefined;
|
|
218
|
+
seed?: AnyResolvedKeyframe | undefined;
|
|
219
|
+
shapeRendering?: AnyResolvedKeyframe | undefined;
|
|
220
|
+
slope?: AnyResolvedKeyframe | undefined;
|
|
221
|
+
spacing?: AnyResolvedKeyframe | undefined;
|
|
222
|
+
specularConstant?: AnyResolvedKeyframe | undefined;
|
|
223
|
+
specularExponent?: AnyResolvedKeyframe | undefined;
|
|
224
|
+
speed?: AnyResolvedKeyframe | undefined;
|
|
225
|
+
spreadMethod?: string | undefined;
|
|
226
|
+
startOffset?: AnyResolvedKeyframe | undefined;
|
|
227
|
+
stdDeviation?: AnyResolvedKeyframe | undefined;
|
|
228
|
+
stemh?: AnyResolvedKeyframe | undefined;
|
|
229
|
+
stemv?: AnyResolvedKeyframe | undefined;
|
|
230
|
+
stitchTiles?: AnyResolvedKeyframe | undefined;
|
|
231
|
+
stopColor?: string | undefined;
|
|
232
|
+
stopOpacity?: AnyResolvedKeyframe | undefined;
|
|
233
|
+
strikethroughPosition?: AnyResolvedKeyframe | undefined;
|
|
234
|
+
strikethroughThickness?: AnyResolvedKeyframe | undefined;
|
|
235
|
+
string?: AnyResolvedKeyframe | undefined;
|
|
236
|
+
stroke?: string | undefined;
|
|
237
|
+
strokeDasharray?: AnyResolvedKeyframe | undefined;
|
|
238
|
+
strokeDashoffset?: AnyResolvedKeyframe | undefined;
|
|
239
|
+
strokeLinecap?: "butt" | "round" | "square" | "inherit" | undefined;
|
|
240
|
+
strokeLinejoin?: "miter" | "round" | "bevel" | "inherit" | undefined;
|
|
241
|
+
strokeMiterlimit?: AnyResolvedKeyframe | undefined;
|
|
242
|
+
strokeOpacity?: AnyResolvedKeyframe | undefined;
|
|
243
|
+
strokeWidth?: AnyResolvedKeyframe | undefined;
|
|
244
|
+
surfaceScale?: AnyResolvedKeyframe | undefined;
|
|
245
|
+
systemLanguage?: AnyResolvedKeyframe | undefined;
|
|
246
|
+
tableValues?: AnyResolvedKeyframe | undefined;
|
|
247
|
+
targetX?: AnyResolvedKeyframe | undefined;
|
|
248
|
+
targetY?: AnyResolvedKeyframe | undefined;
|
|
249
|
+
textAnchor?: string | undefined;
|
|
250
|
+
textDecoration?: AnyResolvedKeyframe | undefined;
|
|
251
|
+
textLength?: AnyResolvedKeyframe | undefined;
|
|
252
|
+
textRendering?: AnyResolvedKeyframe | undefined;
|
|
253
|
+
to?: AnyResolvedKeyframe | undefined;
|
|
254
|
+
transform?: string | undefined;
|
|
255
|
+
u1?: AnyResolvedKeyframe | undefined;
|
|
256
|
+
u2?: AnyResolvedKeyframe | undefined;
|
|
257
|
+
underlinePosition?: AnyResolvedKeyframe | undefined;
|
|
258
|
+
underlineThickness?: AnyResolvedKeyframe | undefined;
|
|
259
|
+
unicode?: AnyResolvedKeyframe | undefined;
|
|
260
|
+
unicodeBidi?: AnyResolvedKeyframe | undefined;
|
|
261
|
+
unicodeRange?: AnyResolvedKeyframe | undefined;
|
|
262
|
+
unitsPerEm?: AnyResolvedKeyframe | undefined;
|
|
263
|
+
vAlphabetic?: AnyResolvedKeyframe | undefined;
|
|
264
|
+
values?: string | undefined;
|
|
265
|
+
vectorEffect?: AnyResolvedKeyframe | undefined;
|
|
266
|
+
version?: string | undefined;
|
|
267
|
+
vertAdvY?: AnyResolvedKeyframe | undefined;
|
|
268
|
+
vertOriginX?: AnyResolvedKeyframe | undefined;
|
|
269
|
+
vertOriginY?: AnyResolvedKeyframe | undefined;
|
|
270
|
+
vHanging?: AnyResolvedKeyframe | undefined;
|
|
271
|
+
vIdeographic?: AnyResolvedKeyframe | undefined;
|
|
272
|
+
viewBox?: string | undefined;
|
|
273
|
+
viewTarget?: AnyResolvedKeyframe | undefined;
|
|
274
|
+
visibility?: AnyResolvedKeyframe | undefined;
|
|
275
|
+
vMathematical?: AnyResolvedKeyframe | undefined;
|
|
276
|
+
widths?: AnyResolvedKeyframe | undefined;
|
|
277
|
+
wordSpacing?: AnyResolvedKeyframe | undefined;
|
|
278
|
+
writingMode?: AnyResolvedKeyframe | undefined;
|
|
279
|
+
x1?: AnyResolvedKeyframe | undefined;
|
|
280
|
+
x2?: AnyResolvedKeyframe | undefined;
|
|
281
|
+
x?: AnyResolvedKeyframe | undefined;
|
|
282
|
+
xChannelSelector?: string | undefined;
|
|
283
|
+
xHeight?: AnyResolvedKeyframe | undefined;
|
|
284
|
+
xlinkActuate?: string | undefined;
|
|
285
|
+
xlinkArcrole?: string | undefined;
|
|
286
|
+
xlinkHref?: string | undefined;
|
|
287
|
+
xlinkRole?: string | undefined;
|
|
288
|
+
xlinkShow?: string | undefined;
|
|
289
|
+
xlinkTitle?: string | undefined;
|
|
290
|
+
xlinkType?: string | undefined;
|
|
291
|
+
xmlBase?: string | undefined;
|
|
292
|
+
xmlLang?: string | undefined;
|
|
293
|
+
xmlns?: string | undefined;
|
|
294
|
+
xmlnsXlink?: string | undefined;
|
|
295
|
+
xmlSpace?: string | undefined;
|
|
296
|
+
y1?: AnyResolvedKeyframe | undefined;
|
|
297
|
+
y2?: AnyResolvedKeyframe | undefined;
|
|
298
|
+
y?: AnyResolvedKeyframe | undefined;
|
|
299
|
+
yChannelSelector?: string | undefined;
|
|
300
|
+
z?: AnyResolvedKeyframe | undefined;
|
|
301
|
+
zoomAndPan?: string | undefined;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* An update function. It accepts a timestamp used to advance the animation.
|
|
306
|
+
*/
|
|
307
|
+
type Update$1 = (timestamp: number) => void;
|
|
308
|
+
/**
|
|
309
|
+
* Drivers accept a update function and call it at an interval. This interval
|
|
310
|
+
* could be a synchronous loop, a setInterval, or tied to the device's framerate.
|
|
311
|
+
*/
|
|
312
|
+
interface DriverControls {
|
|
313
|
+
start: (keepAlive?: boolean) => void;
|
|
314
|
+
stop: () => void;
|
|
315
|
+
now: () => number;
|
|
316
|
+
}
|
|
317
|
+
type Driver = (update: Update$1) => DriverControls;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Temporary subset of VisualElement until VisualElement is
|
|
321
|
+
* moved to motion-dom
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
type AnyResolvedKeyframe = string | number;
|
|
325
|
+
interface ProgressTimeline {
|
|
326
|
+
currentTime: null | {
|
|
327
|
+
value: number;
|
|
328
|
+
};
|
|
329
|
+
cancel?: VoidFunction;
|
|
330
|
+
}
|
|
331
|
+
interface TimelineWithFallback {
|
|
332
|
+
timeline?: ProgressTimeline;
|
|
333
|
+
observe: (animation: AnimationPlaybackControls) => VoidFunction;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Methods to control an animation.
|
|
337
|
+
*/
|
|
338
|
+
interface AnimationPlaybackControls {
|
|
339
|
+
/**
|
|
340
|
+
* The current time of the animation, in seconds.
|
|
341
|
+
*/
|
|
342
|
+
time: number;
|
|
343
|
+
/**
|
|
344
|
+
* The playback speed of the animation.
|
|
345
|
+
* 1 = normal speed, 2 = double speed, 0.5 = half speed.
|
|
346
|
+
*/
|
|
347
|
+
speed: number;
|
|
348
|
+
/**
|
|
349
|
+
* The start time of the animation, in milliseconds.
|
|
350
|
+
*/
|
|
351
|
+
startTime: number | null;
|
|
352
|
+
/**
|
|
353
|
+
* The state of the animation.
|
|
354
|
+
*
|
|
355
|
+
* This is currently for internal use only.
|
|
356
|
+
*/
|
|
357
|
+
state: AnimationPlayState;
|
|
358
|
+
duration: number;
|
|
359
|
+
/**
|
|
360
|
+
* The duration of the animation, including any delay.
|
|
361
|
+
*/
|
|
362
|
+
iterationDuration: number;
|
|
363
|
+
/**
|
|
364
|
+
* Stops the animation at its current state, and prevents it from
|
|
365
|
+
* resuming when the animation is played again.
|
|
366
|
+
*/
|
|
367
|
+
stop: () => void;
|
|
368
|
+
/**
|
|
369
|
+
* Plays the animation.
|
|
370
|
+
*/
|
|
371
|
+
play: () => void;
|
|
372
|
+
/**
|
|
373
|
+
* Pauses the animation.
|
|
374
|
+
*/
|
|
375
|
+
pause: () => void;
|
|
376
|
+
/**
|
|
377
|
+
* Completes the animation and applies the final state.
|
|
378
|
+
*/
|
|
379
|
+
complete: () => void;
|
|
380
|
+
/**
|
|
381
|
+
* Cancels the animation and applies the initial state.
|
|
382
|
+
*/
|
|
383
|
+
cancel: () => void;
|
|
384
|
+
/**
|
|
385
|
+
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
386
|
+
*
|
|
387
|
+
* This is currently for internal use only.
|
|
388
|
+
*/
|
|
389
|
+
attachTimeline: (timeline: TimelineWithFallback) => VoidFunction;
|
|
390
|
+
finished: Promise<any>;
|
|
391
|
+
}
|
|
392
|
+
type AnimationPlaybackControlsWithThen = AnimationPlaybackControls & {
|
|
393
|
+
then: (onResolve: VoidFunction, onReject?: VoidFunction) => Promise<void>;
|
|
394
|
+
};
|
|
395
|
+
interface AnimationState<V$1> {
|
|
396
|
+
value: V$1;
|
|
397
|
+
done: boolean;
|
|
398
|
+
}
|
|
399
|
+
interface KeyframeGenerator<V$1> {
|
|
400
|
+
calculatedDuration: null | number;
|
|
401
|
+
next: (t: number) => AnimationState<V$1>;
|
|
402
|
+
toString: () => string;
|
|
403
|
+
}
|
|
404
|
+
interface ValueAnimationOptions<V$1 extends AnyResolvedKeyframe = number> extends ValueAnimationTransition {
|
|
405
|
+
keyframes: V$1[];
|
|
406
|
+
element?: any;
|
|
407
|
+
name?: string;
|
|
408
|
+
motionValue?: MotionValue<V$1>;
|
|
409
|
+
from?: any;
|
|
410
|
+
isHandoff?: boolean;
|
|
411
|
+
allowFlatten?: boolean;
|
|
412
|
+
finalKeyframe?: V$1;
|
|
413
|
+
}
|
|
414
|
+
type GeneratorFactoryFunction = (options: ValueAnimationOptions<any>) => KeyframeGenerator<any>;
|
|
415
|
+
interface GeneratorFactory extends GeneratorFactoryFunction {
|
|
416
|
+
applyToOptions?: (options: Transition) => Transition;
|
|
417
|
+
}
|
|
418
|
+
type AnimationGeneratorName = "decay" | "spring" | "keyframes" | "tween" | "inertia";
|
|
419
|
+
type AnimationGeneratorType = GeneratorFactory | AnimationGeneratorName | false;
|
|
420
|
+
interface AnimationPlaybackLifecycles<V$1> {
|
|
421
|
+
onUpdate?: (latest: V$1) => void;
|
|
422
|
+
onPlay?: () => void;
|
|
423
|
+
onComplete?: () => void;
|
|
424
|
+
onRepeat?: () => void;
|
|
425
|
+
onStop?: () => void;
|
|
426
|
+
}
|
|
427
|
+
interface ValueAnimationTransition<V$1 = any> extends ValueTransition, AnimationPlaybackLifecycles<V$1> {
|
|
428
|
+
isSync?: boolean;
|
|
429
|
+
}
|
|
430
|
+
type RepeatType = "loop" | "reverse" | "mirror";
|
|
431
|
+
interface AnimationPlaybackOptions {
|
|
432
|
+
/**
|
|
433
|
+
* The number of times to repeat the transition. Set to `Infinity` for perpetual repeating.
|
|
434
|
+
*
|
|
435
|
+
* Without setting `repeatType`, this will loop the animation.
|
|
436
|
+
*
|
|
437
|
+
* @public
|
|
438
|
+
*/
|
|
439
|
+
repeat?: number;
|
|
440
|
+
/**
|
|
441
|
+
* How to repeat the animation. This can be either:
|
|
442
|
+
*
|
|
443
|
+
* "loop": Repeats the animation from the start
|
|
444
|
+
*
|
|
445
|
+
* "reverse": Alternates between forward and backwards playback
|
|
446
|
+
*
|
|
447
|
+
* "mirror": Switches `from` and `to` alternately
|
|
448
|
+
*
|
|
449
|
+
* @public
|
|
450
|
+
*/
|
|
451
|
+
repeatType?: RepeatType;
|
|
452
|
+
/**
|
|
453
|
+
* When repeating an animation, `repeatDelay` will set the
|
|
454
|
+
* duration of the time to wait, in seconds, between each repetition.
|
|
455
|
+
*
|
|
456
|
+
* @public
|
|
457
|
+
*/
|
|
458
|
+
repeatDelay?: number;
|
|
459
|
+
}
|
|
460
|
+
interface VelocityOptions {
|
|
461
|
+
velocity?: number;
|
|
462
|
+
/**
|
|
463
|
+
* End animation if absolute speed (in units per second) drops below this
|
|
464
|
+
* value and delta is smaller than `restDelta`. Set to `0.01` by default.
|
|
465
|
+
*
|
|
466
|
+
* @public
|
|
467
|
+
*/
|
|
468
|
+
restSpeed?: number;
|
|
469
|
+
/**
|
|
470
|
+
* End animation if distance is below this value and speed is below
|
|
471
|
+
* `restSpeed`. When animation ends, spring gets "snapped" to. Set to
|
|
472
|
+
* `0.01` by default.
|
|
473
|
+
*
|
|
474
|
+
* @public
|
|
475
|
+
*/
|
|
476
|
+
restDelta?: number;
|
|
477
|
+
}
|
|
478
|
+
interface DurationSpringOptions {
|
|
479
|
+
/**
|
|
480
|
+
* The total duration of the animation. Set to `0.3` by default.
|
|
481
|
+
*
|
|
482
|
+
* @public
|
|
483
|
+
*/
|
|
484
|
+
duration?: number;
|
|
485
|
+
/**
|
|
486
|
+
* If visualDuration is set, this will override duration.
|
|
487
|
+
*
|
|
488
|
+
* The visual duration is a time, set in seconds, that the animation will take to visually appear to reach its target.
|
|
489
|
+
*
|
|
490
|
+
* In other words, the bulk of the transition will occur before this time, and the "bouncy bit" will mostly happen after.
|
|
491
|
+
*
|
|
492
|
+
* This makes it easier to edit a spring, as well as visually coordinate it with other time-based animations.
|
|
493
|
+
*
|
|
494
|
+
* @public
|
|
495
|
+
*/
|
|
496
|
+
visualDuration?: number;
|
|
497
|
+
/**
|
|
498
|
+
* `bounce` determines the "bounciness" of a spring animation.
|
|
499
|
+
*
|
|
500
|
+
* `0` is no bounce, and `1` is extremely bouncy.
|
|
501
|
+
*
|
|
502
|
+
* If `duration` is set, this defaults to `0.25`.
|
|
503
|
+
*
|
|
504
|
+
* Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set.
|
|
505
|
+
*
|
|
506
|
+
* @public
|
|
507
|
+
*/
|
|
508
|
+
bounce?: number;
|
|
509
|
+
}
|
|
510
|
+
interface SpringOptions extends DurationSpringOptions, VelocityOptions {
|
|
511
|
+
/**
|
|
512
|
+
* Stiffness of the spring. Higher values will create more sudden movement.
|
|
513
|
+
* Set to `100` by default.
|
|
514
|
+
*
|
|
515
|
+
* @public
|
|
516
|
+
*/
|
|
517
|
+
stiffness?: number;
|
|
518
|
+
/**
|
|
519
|
+
* Strength of opposing force. If set to 0, spring will oscillate
|
|
520
|
+
* indefinitely. Set to `10` by default.
|
|
521
|
+
*
|
|
522
|
+
* @public
|
|
523
|
+
*/
|
|
524
|
+
damping?: number;
|
|
525
|
+
/**
|
|
526
|
+
* Mass of the moving object. Higher values will result in more lethargic
|
|
527
|
+
* movement. Set to `1` by default.
|
|
528
|
+
*
|
|
529
|
+
* @public
|
|
530
|
+
*/
|
|
531
|
+
mass?: number;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* @deprecated Use SpringOptions instead
|
|
535
|
+
*/
|
|
536
|
+
|
|
537
|
+
interface DecayOptions extends VelocityOptions {
|
|
538
|
+
keyframes?: number[];
|
|
539
|
+
/**
|
|
540
|
+
* A higher power value equals a further target. Set to `0.8` by default.
|
|
541
|
+
*
|
|
542
|
+
* @public
|
|
543
|
+
*/
|
|
544
|
+
power?: number;
|
|
545
|
+
/**
|
|
546
|
+
* Adjusting the time constant will change the duration of the
|
|
547
|
+
* deceleration, thereby affecting its feel. Set to `700` by default.
|
|
548
|
+
*
|
|
549
|
+
* @public
|
|
550
|
+
*/
|
|
551
|
+
timeConstant?: number;
|
|
552
|
+
/**
|
|
553
|
+
* A function that receives the automatically-calculated target and returns a new one. Useful for snapping the target to a grid.
|
|
554
|
+
*
|
|
555
|
+
* @public
|
|
556
|
+
*/
|
|
557
|
+
modifyTarget?: (v: number) => number;
|
|
558
|
+
}
|
|
559
|
+
interface InertiaOptions extends DecayOptions {
|
|
560
|
+
/**
|
|
561
|
+
* If `min` or `max` is set, this affects the stiffness of the bounce
|
|
562
|
+
* spring. Higher values will create more sudden movement. Set to `500` by
|
|
563
|
+
* default.
|
|
564
|
+
*
|
|
565
|
+
* @public
|
|
566
|
+
*/
|
|
567
|
+
bounceStiffness?: number;
|
|
568
|
+
/**
|
|
569
|
+
* If `min` or `max` is set, this affects the damping of the bounce spring.
|
|
570
|
+
* If set to `0`, spring will oscillate indefinitely. Set to `10` by
|
|
571
|
+
* default.
|
|
572
|
+
*
|
|
573
|
+
* @public
|
|
574
|
+
*/
|
|
575
|
+
bounceDamping?: number;
|
|
576
|
+
/**
|
|
577
|
+
* Minimum constraint. If set, the value will "bump" against this value (or immediately spring to it if the animation starts as less than this value).
|
|
578
|
+
*
|
|
579
|
+
* @public
|
|
580
|
+
*/
|
|
581
|
+
min?: number;
|
|
582
|
+
/**
|
|
583
|
+
* Maximum constraint. If set, the value will "bump" against this value (or immediately snap to it, if the initial animation value exceeds this value).
|
|
584
|
+
*
|
|
585
|
+
* @public
|
|
586
|
+
*/
|
|
587
|
+
max?: number;
|
|
588
|
+
}
|
|
589
|
+
interface AnimationOrchestrationOptions {
|
|
590
|
+
/**
|
|
591
|
+
* Delay the animation by this duration (in seconds). Defaults to `0`.
|
|
592
|
+
*
|
|
593
|
+
* @public
|
|
594
|
+
*/
|
|
595
|
+
delay?: number;
|
|
596
|
+
/**
|
|
597
|
+
* Describes the relationship between the transition and its children. Set
|
|
598
|
+
* to `false` by default.
|
|
599
|
+
*
|
|
600
|
+
* @remarks
|
|
601
|
+
* When using variants, the transition can be scheduled in relation to its
|
|
602
|
+
* children with either `"beforeChildren"` to finish this transition before
|
|
603
|
+
* starting children transitions, `"afterChildren"` to finish children
|
|
604
|
+
* transitions before starting this transition.
|
|
605
|
+
*
|
|
606
|
+
* @public
|
|
607
|
+
*/
|
|
608
|
+
when?: false | "beforeChildren" | "afterChildren" | string;
|
|
609
|
+
/**
|
|
610
|
+
* When using variants, children animations will start after this duration
|
|
611
|
+
* (in seconds). You can add the `transition` property to both the `motion.div` and the
|
|
612
|
+
* `variant` directly. Adding it to the `variant` generally offers more flexibility,
|
|
613
|
+
* as it allows you to customize the delay per visual state.
|
|
614
|
+
*
|
|
615
|
+
* @public
|
|
616
|
+
*/
|
|
617
|
+
delayChildren?: number | DynamicOption<number>;
|
|
618
|
+
/**
|
|
619
|
+
* When using variants, animations of child components can be staggered by this
|
|
620
|
+
* duration (in seconds).
|
|
621
|
+
*
|
|
622
|
+
* For instance, if `staggerChildren` is `0.01`, the first child will be
|
|
623
|
+
* delayed by `0` seconds, the second by `0.01`, the third by `0.02` and so
|
|
624
|
+
* on.
|
|
625
|
+
*
|
|
626
|
+
* The calculated stagger delay will be added to `delayChildren`.
|
|
627
|
+
*
|
|
628
|
+
* @deprecated - Use `delayChildren: stagger(interval)` instead.
|
|
629
|
+
*/
|
|
630
|
+
staggerChildren?: number;
|
|
631
|
+
/**
|
|
632
|
+
* The direction in which to stagger children.
|
|
633
|
+
*
|
|
634
|
+
* A value of `1` staggers from the first to the last while `-1`
|
|
635
|
+
* staggers from the last to the first.
|
|
636
|
+
*
|
|
637
|
+
* @deprecated - Use `delayChildren: stagger(interval, { from: "last" })` instead.
|
|
638
|
+
*/
|
|
639
|
+
staggerDirection?: number;
|
|
640
|
+
}
|
|
641
|
+
interface KeyframeOptions {
|
|
642
|
+
/**
|
|
643
|
+
* The total duration of the animation. Set to `0.3` by default.
|
|
644
|
+
*
|
|
645
|
+
* @public
|
|
646
|
+
*/
|
|
647
|
+
duration?: number;
|
|
648
|
+
ease?: Easing | Easing[];
|
|
649
|
+
times?: number[];
|
|
650
|
+
}
|
|
651
|
+
interface ValueTransition extends AnimationOrchestrationOptions, AnimationPlaybackOptions, Omit<SpringOptions, "keyframes">, Omit<InertiaOptions, "keyframes">, KeyframeOptions {
|
|
652
|
+
/**
|
|
653
|
+
* Delay the animation by this duration (in seconds). Defaults to `0`.
|
|
654
|
+
*
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
delay?: number;
|
|
658
|
+
/**
|
|
659
|
+
* The duration of time already elapsed in the animation. Set to `0` by
|
|
660
|
+
* default.
|
|
661
|
+
*/
|
|
662
|
+
elapsed?: number;
|
|
663
|
+
driver?: Driver;
|
|
664
|
+
/**
|
|
665
|
+
* Type of animation to use.
|
|
666
|
+
*
|
|
667
|
+
* - "tween": Duration-based animation with ease curve
|
|
668
|
+
* - "spring": Physics or duration-based spring animation
|
|
669
|
+
* - false: Use an instant animation
|
|
670
|
+
*/
|
|
671
|
+
type?: AnimationGeneratorType;
|
|
672
|
+
/**
|
|
673
|
+
* The duration of the tween animation. Set to `0.3` by default, 0r `0.8` if animating a series of keyframes.
|
|
674
|
+
*
|
|
675
|
+
* @public
|
|
676
|
+
*/
|
|
677
|
+
duration?: number;
|
|
678
|
+
autoplay?: boolean;
|
|
679
|
+
startTime?: number;
|
|
680
|
+
from?: any;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* @deprecated Use KeyframeOptions instead
|
|
684
|
+
*/
|
|
685
|
+
|
|
686
|
+
type SVGForcedAttrTransitions = { [K in keyof SVGForcedAttrProperties]: ValueTransition };
|
|
687
|
+
type SVGPathTransitions = { [K in keyof SVGPathProperties]: ValueTransition };
|
|
688
|
+
type SVGTransitions = { [K in keyof Omit<SVGAttributes$1, "from">]: ValueTransition };
|
|
689
|
+
interface VariableTransitions {
|
|
690
|
+
[key: `--${string}`]: ValueTransition;
|
|
691
|
+
}
|
|
692
|
+
type StyleTransitions = { [K in keyof CSSStyleDeclarationWithTransform]?: ValueTransition };
|
|
693
|
+
type ValueKeyframe<T extends AnyResolvedKeyframe = AnyResolvedKeyframe> = T;
|
|
694
|
+
type UnresolvedValueKeyframe<T extends AnyResolvedKeyframe = AnyResolvedKeyframe> = ValueKeyframe<T> | null;
|
|
695
|
+
type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[];
|
|
696
|
+
type StyleKeyframesDefinition = { [K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition };
|
|
697
|
+
type SVGKeyframesDefinition = { [K in keyof Omit<SVGAttributes$1, "from">]?: ValueKeyframesDefinition };
|
|
698
|
+
interface VariableKeyframesDefinition {
|
|
699
|
+
[key: `--${string}`]: ValueKeyframesDefinition;
|
|
700
|
+
}
|
|
701
|
+
type SVGForcedAttrKeyframesDefinition = { [K in keyof SVGForcedAttrProperties]?: ValueKeyframesDefinition };
|
|
702
|
+
type SVGPathKeyframesDefinition = { [K in keyof SVGPathProperties]?: ValueKeyframesDefinition };
|
|
703
|
+
type DOMKeyframesDefinition = StyleKeyframesDefinition & SVGKeyframesDefinition & SVGPathKeyframesDefinition & SVGForcedAttrKeyframesDefinition & VariableKeyframesDefinition;
|
|
704
|
+
interface Target extends DOMKeyframesDefinition {}
|
|
705
|
+
type CSSPropertyKeys = { [K in keyof CSSStyleDeclaration as K extends string ? CSSStyleDeclaration[K] extends AnyResolvedKeyframe ? K : never : never]: CSSStyleDeclaration[K] };
|
|
706
|
+
interface CSSStyleDeclarationWithTransform extends Omit<CSSPropertyKeys, "direction" | "transition" | "x" | "y" | "z"> {
|
|
707
|
+
x: number | string;
|
|
708
|
+
y: number | string;
|
|
709
|
+
z: number | string;
|
|
710
|
+
originX: number;
|
|
711
|
+
originY: number;
|
|
712
|
+
originZ: number;
|
|
713
|
+
translateX: number | string;
|
|
714
|
+
translateY: number | string;
|
|
715
|
+
translateZ: number | string;
|
|
716
|
+
rotateX: number | string;
|
|
717
|
+
rotateY: number | string;
|
|
718
|
+
rotateZ: number | string;
|
|
719
|
+
scaleX: number;
|
|
720
|
+
scaleY: number;
|
|
721
|
+
scaleZ: number;
|
|
722
|
+
skewX: number | string;
|
|
723
|
+
skewY: number | string;
|
|
724
|
+
transformPerspective: number;
|
|
725
|
+
}
|
|
726
|
+
type TransitionWithValueOverrides<V$1> = ValueAnimationTransition<V$1> & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & {
|
|
727
|
+
default?: ValueTransition;
|
|
728
|
+
layout?: ValueTransition;
|
|
729
|
+
};
|
|
730
|
+
type Transition<V$1 = any> = ValueAnimationTransition<V$1> | TransitionWithValueOverrides<V$1>;
|
|
731
|
+
type DynamicOption<T> = (i: number, total: number) => T;
|
|
732
|
+
interface TransformProperties {
|
|
733
|
+
x?: AnyResolvedKeyframe;
|
|
734
|
+
y?: AnyResolvedKeyframe;
|
|
735
|
+
z?: AnyResolvedKeyframe;
|
|
736
|
+
translateX?: AnyResolvedKeyframe;
|
|
737
|
+
translateY?: AnyResolvedKeyframe;
|
|
738
|
+
translateZ?: AnyResolvedKeyframe;
|
|
739
|
+
rotate?: AnyResolvedKeyframe;
|
|
740
|
+
rotateX?: AnyResolvedKeyframe;
|
|
741
|
+
rotateY?: AnyResolvedKeyframe;
|
|
742
|
+
rotateZ?: AnyResolvedKeyframe;
|
|
743
|
+
scale?: AnyResolvedKeyframe;
|
|
744
|
+
scaleX?: AnyResolvedKeyframe;
|
|
745
|
+
scaleY?: AnyResolvedKeyframe;
|
|
746
|
+
scaleZ?: AnyResolvedKeyframe;
|
|
747
|
+
skew?: AnyResolvedKeyframe;
|
|
748
|
+
skewX?: AnyResolvedKeyframe;
|
|
749
|
+
skewY?: AnyResolvedKeyframe;
|
|
750
|
+
originX?: AnyResolvedKeyframe;
|
|
751
|
+
originY?: AnyResolvedKeyframe;
|
|
752
|
+
originZ?: AnyResolvedKeyframe;
|
|
753
|
+
perspective?: AnyResolvedKeyframe;
|
|
754
|
+
transformPerspective?: AnyResolvedKeyframe;
|
|
755
|
+
}
|
|
756
|
+
interface SVGForcedAttrProperties {
|
|
757
|
+
attrX?: number;
|
|
758
|
+
attrY?: number;
|
|
759
|
+
attrScale?: number;
|
|
760
|
+
}
|
|
761
|
+
interface SVGPathProperties {
|
|
762
|
+
pathLength?: number;
|
|
763
|
+
pathOffset?: number;
|
|
764
|
+
pathSpacing?: number;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* @public
|
|
769
|
+
*/
|
|
770
|
+
type Subscriber<T> = (v: T) => void;
|
|
771
|
+
/**
|
|
772
|
+
* @public
|
|
773
|
+
*/
|
|
774
|
+
type PassiveEffect<T> = (v: T, safeSetter: (v: T) => void) => void;
|
|
775
|
+
type StartAnimation = (complete: () => void) => AnimationPlaybackControlsWithThen | undefined;
|
|
776
|
+
interface MotionValueEventCallbacks<V$1> {
|
|
777
|
+
animationStart: () => void;
|
|
778
|
+
animationComplete: () => void;
|
|
779
|
+
animationCancel: () => void;
|
|
780
|
+
change: (latestValue: V$1) => void;
|
|
781
|
+
destroy: () => void;
|
|
782
|
+
}
|
|
783
|
+
interface ResolvedValues$1 {
|
|
784
|
+
[key: string]: AnyResolvedKeyframe;
|
|
785
|
+
}
|
|
786
|
+
interface Owner {
|
|
787
|
+
current: HTMLElement | unknown;
|
|
788
|
+
getProps: () => {
|
|
789
|
+
onUpdate?: (latest: ResolvedValues$1) => void;
|
|
790
|
+
transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string;
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
interface MotionValueOptions {
|
|
794
|
+
owner?: Owner;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* `MotionValue` is used to track the state and velocity of motion values.
|
|
798
|
+
*
|
|
799
|
+
* @public
|
|
800
|
+
*/
|
|
801
|
+
declare class MotionValue<V$1 = any> {
|
|
802
|
+
/**
|
|
803
|
+
* If a MotionValue has an owner, it was created internally within Motion
|
|
804
|
+
* and therefore has no external listeners. It is therefore safe to animate via WAAPI.
|
|
805
|
+
*/
|
|
806
|
+
owner?: Owner;
|
|
807
|
+
/**
|
|
808
|
+
* The current state of the `MotionValue`.
|
|
809
|
+
*/
|
|
810
|
+
private current;
|
|
811
|
+
/**
|
|
812
|
+
* The previous state of the `MotionValue`.
|
|
813
|
+
*/
|
|
814
|
+
private prev;
|
|
815
|
+
/**
|
|
816
|
+
* The previous state of the `MotionValue` at the end of the previous frame.
|
|
817
|
+
*/
|
|
818
|
+
private prevFrameValue;
|
|
819
|
+
/**
|
|
820
|
+
* The last time the `MotionValue` was updated.
|
|
821
|
+
*/
|
|
822
|
+
updatedAt: number;
|
|
823
|
+
/**
|
|
824
|
+
* The time `prevFrameValue` was updated.
|
|
825
|
+
*/
|
|
826
|
+
prevUpdatedAt: number | undefined;
|
|
827
|
+
private stopPassiveEffect?;
|
|
828
|
+
/**
|
|
829
|
+
* Whether the passive effect is active.
|
|
830
|
+
*/
|
|
831
|
+
isEffectActive?: boolean;
|
|
832
|
+
/**
|
|
833
|
+
* A reference to the currently-controlling animation.
|
|
834
|
+
*/
|
|
835
|
+
animation?: AnimationPlaybackControlsWithThen;
|
|
836
|
+
/**
|
|
837
|
+
* A list of MotionValues whose values are computed from this one.
|
|
838
|
+
* This is a rough start to a proper signal-like dirtying system.
|
|
839
|
+
*/
|
|
840
|
+
private dependents;
|
|
841
|
+
/**
|
|
842
|
+
* Tracks whether this value should be removed
|
|
843
|
+
*/
|
|
844
|
+
liveStyle?: boolean;
|
|
845
|
+
/**
|
|
846
|
+
* @param init - The initiating value
|
|
847
|
+
* @param config - Optional configuration options
|
|
848
|
+
*
|
|
849
|
+
* - `transformer`: A function to transform incoming values with.
|
|
850
|
+
*/
|
|
851
|
+
constructor(init: V$1, options?: MotionValueOptions);
|
|
852
|
+
setCurrent(current: V$1): void;
|
|
853
|
+
setPrevFrameValue(prevFrameValue?: V$1 | undefined): void;
|
|
854
|
+
/**
|
|
855
|
+
* Adds a function that will be notified when the `MotionValue` is updated.
|
|
856
|
+
*
|
|
857
|
+
* It returns a function that, when called, will cancel the subscription.
|
|
858
|
+
*
|
|
859
|
+
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
860
|
+
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
861
|
+
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
862
|
+
*
|
|
863
|
+
* ```jsx
|
|
864
|
+
* export const MyComponent = () => {
|
|
865
|
+
* const x = useMotionValue(0)
|
|
866
|
+
* const y = useMotionValue(0)
|
|
867
|
+
* const opacity = useMotionValue(1)
|
|
868
|
+
*
|
|
869
|
+
* useEffect(() => {
|
|
870
|
+
* function updateOpacity() {
|
|
871
|
+
* const maxXY = Math.max(x.get(), y.get())
|
|
872
|
+
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
873
|
+
* opacity.set(newOpacity)
|
|
874
|
+
* }
|
|
875
|
+
*
|
|
876
|
+
* const unsubscribeX = x.on("change", updateOpacity)
|
|
877
|
+
* const unsubscribeY = y.on("change", updateOpacity)
|
|
878
|
+
*
|
|
879
|
+
* return () => {
|
|
880
|
+
* unsubscribeX()
|
|
881
|
+
* unsubscribeY()
|
|
882
|
+
* }
|
|
883
|
+
* }, [])
|
|
884
|
+
*
|
|
885
|
+
* return <motion.div style={{ x }} />
|
|
886
|
+
* }
|
|
887
|
+
* ```
|
|
888
|
+
*
|
|
889
|
+
* @param subscriber - A function that receives the latest value.
|
|
890
|
+
* @returns A function that, when called, will cancel this subscription.
|
|
891
|
+
*
|
|
892
|
+
* @deprecated
|
|
893
|
+
*/
|
|
894
|
+
onChange(subscription: Subscriber<V$1>): () => void;
|
|
895
|
+
/**
|
|
896
|
+
* An object containing a SubscriptionManager for each active event.
|
|
897
|
+
*/
|
|
898
|
+
private events;
|
|
899
|
+
on<EventName extends keyof MotionValueEventCallbacks<V$1>>(eventName: EventName, callback: MotionValueEventCallbacks<V$1>[EventName]): VoidFunction;
|
|
900
|
+
clearListeners(): void;
|
|
901
|
+
/**
|
|
902
|
+
* Attaches a passive effect to the `MotionValue`.
|
|
903
|
+
*/
|
|
904
|
+
attach(passiveEffect: PassiveEffect<V$1>, stopPassiveEffect: VoidFunction): void;
|
|
905
|
+
/**
|
|
906
|
+
* Sets the state of the `MotionValue`.
|
|
907
|
+
*
|
|
908
|
+
* @remarks
|
|
909
|
+
*
|
|
910
|
+
* ```jsx
|
|
911
|
+
* const x = useMotionValue(0)
|
|
912
|
+
* x.set(10)
|
|
913
|
+
* ```
|
|
914
|
+
*
|
|
915
|
+
* @param latest - Latest value to set.
|
|
916
|
+
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
917
|
+
*
|
|
918
|
+
* @public
|
|
919
|
+
*/
|
|
920
|
+
set(v: V$1): void;
|
|
921
|
+
setWithVelocity(prev: V$1, current: V$1, delta: number): void;
|
|
922
|
+
/**
|
|
923
|
+
* Set the state of the `MotionValue`, stopping any active animations,
|
|
924
|
+
* effects, and resets velocity to `0`.
|
|
925
|
+
*/
|
|
926
|
+
jump(v: V$1, endAnimation?: boolean): void;
|
|
927
|
+
dirty(): void;
|
|
928
|
+
addDependent(dependent: MotionValue): void;
|
|
929
|
+
removeDependent(dependent: MotionValue): void;
|
|
930
|
+
updateAndNotify: (v: V$1) => void;
|
|
931
|
+
/**
|
|
932
|
+
* Returns the latest state of `MotionValue`
|
|
933
|
+
*
|
|
934
|
+
* @returns - The latest state of `MotionValue`
|
|
935
|
+
*
|
|
936
|
+
* @public
|
|
937
|
+
*/
|
|
938
|
+
get(): NonNullable<V$1>;
|
|
939
|
+
/**
|
|
940
|
+
* @public
|
|
941
|
+
*/
|
|
942
|
+
getPrevious(): V$1 | undefined;
|
|
943
|
+
/**
|
|
944
|
+
* Returns the latest velocity of `MotionValue`
|
|
945
|
+
*
|
|
946
|
+
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
|
|
947
|
+
*
|
|
948
|
+
* @public
|
|
949
|
+
*/
|
|
950
|
+
getVelocity(): number;
|
|
951
|
+
hasAnimated: boolean;
|
|
952
|
+
/**
|
|
953
|
+
* Registers a new animation to control this `MotionValue`. Only one
|
|
954
|
+
* animation can drive a `MotionValue` at one time.
|
|
955
|
+
*
|
|
956
|
+
* ```jsx
|
|
957
|
+
* value.start()
|
|
958
|
+
* ```
|
|
959
|
+
*
|
|
960
|
+
* @param animation - A function that starts the provided animation
|
|
961
|
+
*/
|
|
962
|
+
start(startAnimation: StartAnimation): Promise<void>;
|
|
963
|
+
/**
|
|
964
|
+
* Stop the currently active animation.
|
|
965
|
+
*
|
|
966
|
+
* @public
|
|
967
|
+
*/
|
|
968
|
+
stop(): void;
|
|
969
|
+
/**
|
|
970
|
+
* Returns `true` if this value is currently animating.
|
|
971
|
+
*
|
|
972
|
+
* @public
|
|
973
|
+
*/
|
|
974
|
+
isAnimating(): boolean;
|
|
975
|
+
private clearAnimation;
|
|
976
|
+
/**
|
|
977
|
+
* Destroy and clean up subscribers to this `MotionValue`.
|
|
978
|
+
*
|
|
979
|
+
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
980
|
+
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
981
|
+
* created a `MotionValue` via the `motionValue` function.
|
|
982
|
+
*
|
|
983
|
+
* @public
|
|
984
|
+
*/
|
|
985
|
+
destroy(): void;
|
|
986
|
+
}
|
|
987
|
+
type Process = (data: FrameData) => void;
|
|
988
|
+
type Schedule = (process: Process, keepAlive?: boolean, immediate?: boolean) => Process;
|
|
989
|
+
type StepId = "setup" | "read" | "resolveKeyframes" | "preUpdate" | "update" | "preRender" | "render" | "postRender";
|
|
990
|
+
type Batcher = { [key in StepId]: Schedule };
|
|
991
|
+
interface FrameData {
|
|
992
|
+
delta: number;
|
|
993
|
+
timestamp: number;
|
|
994
|
+
isProcessing: boolean;
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Passed in to pan event handlers like `onPan` the `PanInfo` object contains
|
|
998
|
+
* information about the current state of the tap gesture such as its
|
|
999
|
+
* `point`, `delta`, `offset` and `velocity`.
|
|
1000
|
+
*
|
|
1001
|
+
* ```jsx
|
|
1002
|
+
* <motion.div onPan={(event, info) => {
|
|
1003
|
+
* console.log(info.point.x, info.point.y)
|
|
1004
|
+
* }} />
|
|
1005
|
+
* ```
|
|
1006
|
+
*
|
|
1007
|
+
* @public
|
|
1008
|
+
*/
|
|
1009
|
+
interface PanInfo {
|
|
1010
|
+
/**
|
|
1011
|
+
* Contains `x` and `y` values for the current pan position relative
|
|
1012
|
+
* to the device or page.
|
|
1013
|
+
*
|
|
1014
|
+
* ```jsx
|
|
1015
|
+
* function onPan(event, info) {
|
|
1016
|
+
* console.log(info.point.x, info.point.y)
|
|
1017
|
+
* }
|
|
1018
|
+
*
|
|
1019
|
+
* <motion.div onPan={onPan} />
|
|
1020
|
+
* ```
|
|
1021
|
+
*
|
|
1022
|
+
* @public
|
|
1023
|
+
*/
|
|
1024
|
+
point: Point;
|
|
1025
|
+
/**
|
|
1026
|
+
* Contains `x` and `y` values for the distance moved since
|
|
1027
|
+
* the last event.
|
|
1028
|
+
*
|
|
1029
|
+
* ```jsx
|
|
1030
|
+
* function onPan(event, info) {
|
|
1031
|
+
* console.log(info.delta.x, info.delta.y)
|
|
1032
|
+
* }
|
|
1033
|
+
*
|
|
1034
|
+
* <motion.div onPan={onPan} />
|
|
1035
|
+
* ```
|
|
1036
|
+
*
|
|
1037
|
+
* @public
|
|
1038
|
+
*/
|
|
1039
|
+
delta: Point;
|
|
1040
|
+
/**
|
|
1041
|
+
* Contains `x` and `y` values for the distance moved from
|
|
1042
|
+
* the first pan event.
|
|
1043
|
+
*
|
|
1044
|
+
* ```jsx
|
|
1045
|
+
* function onPan(event, info) {
|
|
1046
|
+
* console.log(info.offset.x, info.offset.y)
|
|
1047
|
+
* }
|
|
1048
|
+
*
|
|
1049
|
+
* <motion.div onPan={onPan} />
|
|
1050
|
+
* ```
|
|
1051
|
+
*
|
|
1052
|
+
* @public
|
|
1053
|
+
*/
|
|
1054
|
+
offset: Point;
|
|
1055
|
+
/**
|
|
1056
|
+
* Contains `x` and `y` values for the current velocity of the pointer, in px/ms.
|
|
1057
|
+
*
|
|
1058
|
+
* ```jsx
|
|
1059
|
+
* function onPan(event, info) {
|
|
1060
|
+
* console.log(info.velocity.x, info.velocity.y)
|
|
1061
|
+
* }
|
|
1062
|
+
*
|
|
1063
|
+
* <motion.div onPan={onPan} />
|
|
1064
|
+
* ```
|
|
1065
|
+
*
|
|
1066
|
+
* @public
|
|
1067
|
+
*/
|
|
1068
|
+
velocity: Point;
|
|
1069
|
+
}
|
|
1070
|
+
type DragElastic = boolean | number | Partial<BoundingBox>;
|
|
1071
|
+
interface EventInfo {
|
|
1072
|
+
point: Point;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* A generic set of string/number values
|
|
1076
|
+
*/
|
|
1077
|
+
interface ResolvedValues$2 {
|
|
1078
|
+
[key: string]: AnyResolvedKeyframe;
|
|
1079
|
+
}
|
|
1080
|
+
type AnimationDefinition = VariantLabels$1 | TargetAndTransition | TargetResolver;
|
|
1081
|
+
/**
|
|
1082
|
+
* An object that specifies values to animate to. Each value may be set either as
|
|
1083
|
+
* a single value, or an array of values.
|
|
1084
|
+
*
|
|
1085
|
+
* It may also option contain these properties:
|
|
1086
|
+
*
|
|
1087
|
+
* - `transition`: Specifies transitions for all or individual values.
|
|
1088
|
+
* - `transitionEnd`: Specifies values to set when the animation finishes.
|
|
1089
|
+
*
|
|
1090
|
+
* ```jsx
|
|
1091
|
+
* const target = {
|
|
1092
|
+
* x: "0%",
|
|
1093
|
+
* opacity: 0,
|
|
1094
|
+
* transition: { duration: 1 },
|
|
1095
|
+
* transitionEnd: { display: "none" }
|
|
1096
|
+
* }
|
|
1097
|
+
* ```
|
|
1098
|
+
*
|
|
1099
|
+
* @public
|
|
1100
|
+
*/
|
|
1101
|
+
type TargetAndTransition = Target & {
|
|
1102
|
+
transition?: Transition;
|
|
1103
|
+
transitionEnd?: ResolvedValues$2;
|
|
1104
|
+
};
|
|
1105
|
+
type TargetResolver = (custom: any, current: ResolvedValues$2, velocity: ResolvedValues$2) => TargetAndTransition | string;
|
|
1106
|
+
/**
|
|
1107
|
+
* Either a string, or array of strings, that reference variants defined via the `variants` prop.
|
|
1108
|
+
* @public
|
|
1109
|
+
*/
|
|
1110
|
+
type VariantLabels$1 = string | string[];
|
|
1111
|
+
type Variant = TargetAndTransition | TargetResolver;
|
|
1112
|
+
interface Variants {
|
|
1113
|
+
[key: string]: Variant;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* @deprecated
|
|
1117
|
+
*/
|
|
1118
|
+
type LegacyAnimationControls = {
|
|
1119
|
+
/**
|
|
1120
|
+
* Subscribes a component's animation controls to this.
|
|
1121
|
+
*
|
|
1122
|
+
* @param controls - The controls to subscribe
|
|
1123
|
+
* @returns An unsubscribe function.
|
|
1124
|
+
*/
|
|
1125
|
+
subscribe(visualElement: any): () => void;
|
|
1126
|
+
/**
|
|
1127
|
+
* Starts an animation on all linked components.
|
|
1128
|
+
*
|
|
1129
|
+
* @remarks
|
|
1130
|
+
*
|
|
1131
|
+
* ```jsx
|
|
1132
|
+
* controls.start("variantLabel")
|
|
1133
|
+
* controls.start({
|
|
1134
|
+
* x: 0,
|
|
1135
|
+
* transition: { duration: 1 }
|
|
1136
|
+
* })
|
|
1137
|
+
* ```
|
|
1138
|
+
*
|
|
1139
|
+
* @param definition - Properties or variant label to animate to
|
|
1140
|
+
* @param transition - Optional `transition` to apply to a variant
|
|
1141
|
+
* @returns - A `Promise` that resolves when all animations have completed.
|
|
1142
|
+
*
|
|
1143
|
+
* @public
|
|
1144
|
+
*/
|
|
1145
|
+
start(definition: AnimationDefinition, transitionOverride?: Transition): Promise<any>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Instantly set to a set of properties or a variant.
|
|
1148
|
+
*
|
|
1149
|
+
* ```jsx
|
|
1150
|
+
* // With properties
|
|
1151
|
+
* controls.set({ opacity: 0 })
|
|
1152
|
+
*
|
|
1153
|
+
* // With variants
|
|
1154
|
+
* controls.set("hidden")
|
|
1155
|
+
* ```
|
|
1156
|
+
*
|
|
1157
|
+
* @privateRemarks
|
|
1158
|
+
* We could perform a similar trick to `.start` where this can be called before mount
|
|
1159
|
+
* and we maintain a list of of pending actions that get applied on mount. But the
|
|
1160
|
+
* expectation of `set` is that it happens synchronously and this would be difficult
|
|
1161
|
+
* to do before any children have even attached themselves. It's also poor practise
|
|
1162
|
+
* and we should discourage render-synchronous `.start` calls rather than lean into this.
|
|
1163
|
+
*
|
|
1164
|
+
* @public
|
|
1165
|
+
*/
|
|
1166
|
+
set(definition: AnimationDefinition): void;
|
|
1167
|
+
/**
|
|
1168
|
+
* Stops animations on all linked components.
|
|
1169
|
+
*
|
|
1170
|
+
* ```jsx
|
|
1171
|
+
* controls.stop()
|
|
1172
|
+
* ```
|
|
1173
|
+
*
|
|
1174
|
+
* @public
|
|
1175
|
+
*/
|
|
1176
|
+
stop(): void;
|
|
1177
|
+
mount(): () => void;
|
|
1178
|
+
};
|
|
1179
|
+
interface MotionNodeAnimationOptions {
|
|
1180
|
+
/**
|
|
1181
|
+
* Properties, variant label or array of variant labels to start in.
|
|
1182
|
+
*
|
|
1183
|
+
* Set to `false` to initialise with the values in `animate` (disabling the mount animation)
|
|
1184
|
+
*
|
|
1185
|
+
* ```jsx
|
|
1186
|
+
* // As values
|
|
1187
|
+
* <motion.div initial={{ opacity: 1 }} />
|
|
1188
|
+
*
|
|
1189
|
+
* // As variant
|
|
1190
|
+
* <motion.div initial="visible" variants={variants} />
|
|
1191
|
+
*
|
|
1192
|
+
* // Multiple variants
|
|
1193
|
+
* <motion.div initial={["visible", "active"]} variants={variants} />
|
|
1194
|
+
*
|
|
1195
|
+
* // As false (disable mount animation)
|
|
1196
|
+
* <motion.div initial={false} animate={{ opacity: 0 }} />
|
|
1197
|
+
* ```
|
|
1198
|
+
*/
|
|
1199
|
+
initial?: TargetAndTransition | VariantLabels$1 | boolean;
|
|
1200
|
+
/**
|
|
1201
|
+
* Values to animate to, variant label(s), or `LegacyAnimationControls`.
|
|
1202
|
+
*
|
|
1203
|
+
* ```jsx
|
|
1204
|
+
* // As values
|
|
1205
|
+
* <motion.div animate={{ opacity: 1 }} />
|
|
1206
|
+
*
|
|
1207
|
+
* // As variant
|
|
1208
|
+
* <motion.div animate="visible" variants={variants} />
|
|
1209
|
+
*
|
|
1210
|
+
* // Multiple variants
|
|
1211
|
+
* <motion.div animate={["visible", "active"]} variants={variants} />
|
|
1212
|
+
*
|
|
1213
|
+
* // LegacyAnimationControls
|
|
1214
|
+
* <motion.div animate={animation} />
|
|
1215
|
+
* ```
|
|
1216
|
+
*/
|
|
1217
|
+
animate?: TargetAndTransition | VariantLabels$1 | boolean | LegacyAnimationControls;
|
|
1218
|
+
/**
|
|
1219
|
+
* A target to animate to when this component is removed from the tree.
|
|
1220
|
+
*
|
|
1221
|
+
* This component **must** be the first animatable child of an `AnimatePresence` to enable this exit animation.
|
|
1222
|
+
*
|
|
1223
|
+
* This limitation exists because React doesn't allow components to defer unmounting until after
|
|
1224
|
+
* an animation is complete. Once this limitation is fixed, the `AnimatePresence` component will be unnecessary.
|
|
1225
|
+
*
|
|
1226
|
+
* ```jsx
|
|
1227
|
+
* import { AnimatePresence, motion } from 'framer-motion'
|
|
1228
|
+
*
|
|
1229
|
+
* export const MyComponent = ({ isVisible }) => {
|
|
1230
|
+
* return (
|
|
1231
|
+
* <AnimatePresence>
|
|
1232
|
+
* {isVisible && (
|
|
1233
|
+
* <motion.div
|
|
1234
|
+
* initial={{ opacity: 0 }}
|
|
1235
|
+
* animate={{ opacity: 1 }}
|
|
1236
|
+
* exit={{ opacity: 0 }}
|
|
1237
|
+
* />
|
|
1238
|
+
* )}
|
|
1239
|
+
* </AnimatePresence>
|
|
1240
|
+
* )
|
|
1241
|
+
* }
|
|
1242
|
+
* ```
|
|
1243
|
+
*/
|
|
1244
|
+
exit?: TargetAndTransition | VariantLabels$1;
|
|
1245
|
+
/**
|
|
1246
|
+
* Variants allow you to define animation states and organise them by name. They allow
|
|
1247
|
+
* you to control animations throughout a component tree by switching a single `animate` prop.
|
|
1248
|
+
*
|
|
1249
|
+
* Using `transition` options like `delayChildren` and `when`, you can orchestrate
|
|
1250
|
+
* when children animations play relative to their parent.
|
|
1251
|
+
*
|
|
1252
|
+
* After passing variants to one or more `motion` component's `variants` prop, these variants
|
|
1253
|
+
* can be used in place of values on the `animate`, `initial`, `whileFocus`, `whileTap` and `whileHover` props.
|
|
1254
|
+
*
|
|
1255
|
+
* ```jsx
|
|
1256
|
+
* const variants = {
|
|
1257
|
+
* active: {
|
|
1258
|
+
* backgroundColor: "#f00"
|
|
1259
|
+
* },
|
|
1260
|
+
* inactive: {
|
|
1261
|
+
* backgroundColor: "#fff",
|
|
1262
|
+
* transition: { duration: 2 }
|
|
1263
|
+
* }
|
|
1264
|
+
* }
|
|
1265
|
+
*
|
|
1266
|
+
* <motion.div variants={variants} animate="active" />
|
|
1267
|
+
* ```
|
|
1268
|
+
*/
|
|
1269
|
+
variants?: Variants;
|
|
1270
|
+
/**
|
|
1271
|
+
* Default transition. If no `transition` is defined in `animate`, it will use the transition defined here.
|
|
1272
|
+
* ```jsx
|
|
1273
|
+
* const spring = {
|
|
1274
|
+
* type: "spring",
|
|
1275
|
+
* damping: 10,
|
|
1276
|
+
* stiffness: 100
|
|
1277
|
+
* }
|
|
1278
|
+
*
|
|
1279
|
+
* <motion.div transition={spring} animate={{ scale: 1.2 }} />
|
|
1280
|
+
* ```
|
|
1281
|
+
*/
|
|
1282
|
+
transition?: Transition;
|
|
1283
|
+
}
|
|
1284
|
+
interface MotionNodeEventOptions {
|
|
1285
|
+
/**
|
|
1286
|
+
* Callback with latest motion values, fired max once per frame.
|
|
1287
|
+
*
|
|
1288
|
+
* ```jsx
|
|
1289
|
+
* function onUpdate(latest) {
|
|
1290
|
+
* console.log(latest.x, latest.opacity)
|
|
1291
|
+
* }
|
|
1292
|
+
*
|
|
1293
|
+
* <motion.div animate={{ x: 100, opacity: 0 }} onUpdate={onUpdate} />
|
|
1294
|
+
* ```
|
|
1295
|
+
*/
|
|
1296
|
+
onUpdate?(latest: ResolvedValues$2): void;
|
|
1297
|
+
/**
|
|
1298
|
+
* Callback when animation defined in `animate` begins.
|
|
1299
|
+
*
|
|
1300
|
+
* The provided callback will be called with the triggering animation definition.
|
|
1301
|
+
* If this is a variant, it'll be the variant name, and if a target object
|
|
1302
|
+
* then it'll be the target object.
|
|
1303
|
+
*
|
|
1304
|
+
* This way, it's possible to figure out which animation has started.
|
|
1305
|
+
*
|
|
1306
|
+
* ```jsx
|
|
1307
|
+
* function onStart() {
|
|
1308
|
+
* console.log("Animation started")
|
|
1309
|
+
* }
|
|
1310
|
+
*
|
|
1311
|
+
* <motion.div animate={{ x: 100 }} onAnimationStart={onStart} />
|
|
1312
|
+
* ```
|
|
1313
|
+
*/
|
|
1314
|
+
onAnimationStart?(definition: AnimationDefinition): void;
|
|
1315
|
+
/**
|
|
1316
|
+
* Callback when animation defined in `animate` is complete.
|
|
1317
|
+
*
|
|
1318
|
+
* The provided callback will be called with the triggering animation definition.
|
|
1319
|
+
* If this is a variant, it'll be the variant name, and if a target object
|
|
1320
|
+
* then it'll be the target object.
|
|
1321
|
+
*
|
|
1322
|
+
* This way, it's possible to figure out which animation has completed.
|
|
1323
|
+
*
|
|
1324
|
+
* ```jsx
|
|
1325
|
+
* function onComplete() {
|
|
1326
|
+
* console.log("Animation completed")
|
|
1327
|
+
* }
|
|
1328
|
+
*
|
|
1329
|
+
* <motion.div
|
|
1330
|
+
* animate={{ x: 100 }}
|
|
1331
|
+
* onAnimationComplete={definition => {
|
|
1332
|
+
* console.log('Completed animating', definition)
|
|
1333
|
+
* }}
|
|
1334
|
+
* />
|
|
1335
|
+
* ```
|
|
1336
|
+
*/
|
|
1337
|
+
onAnimationComplete?(definition: AnimationDefinition): void;
|
|
1338
|
+
onBeforeLayoutMeasure?(box: Box): void;
|
|
1339
|
+
onLayoutMeasure?(box: Box, prevBox: Box): void;
|
|
1340
|
+
onLayoutAnimationStart?(): void;
|
|
1341
|
+
onLayoutAnimationComplete?(): void;
|
|
1342
|
+
}
|
|
1343
|
+
interface MotionNodePanHandlers {
|
|
1344
|
+
/**
|
|
1345
|
+
* Callback function that fires when the pan gesture is recognised on this element.
|
|
1346
|
+
*
|
|
1347
|
+
* **Note:** For pan gestures to work correctly with touch input, the element needs
|
|
1348
|
+
* touch scrolling to be disabled on either x/y or both axis with the
|
|
1349
|
+
* [touch-action](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) CSS rule.
|
|
1350
|
+
*
|
|
1351
|
+
* ```jsx
|
|
1352
|
+
* function onPan(event, info) {
|
|
1353
|
+
* console.log(info.point.x, info.point.y)
|
|
1354
|
+
* }
|
|
1355
|
+
*
|
|
1356
|
+
* <motion.div onPan={onPan} />
|
|
1357
|
+
* ```
|
|
1358
|
+
*
|
|
1359
|
+
* @param event - The originating pointer event.
|
|
1360
|
+
* @param info - A {@link PanInfo} object containing `x` and `y` values for:
|
|
1361
|
+
*
|
|
1362
|
+
* - `point`: Relative to the device or page.
|
|
1363
|
+
* - `delta`: Distance moved since the last event.
|
|
1364
|
+
* - `offset`: Offset from the original pan event.
|
|
1365
|
+
* - `velocity`: Current velocity of the pointer.
|
|
1366
|
+
*/
|
|
1367
|
+
onPan?(event: PointerEvent, info: PanInfo): void;
|
|
1368
|
+
/**
|
|
1369
|
+
* Callback function that fires when the pan gesture begins on this element.
|
|
1370
|
+
*
|
|
1371
|
+
* ```jsx
|
|
1372
|
+
* function onPanStart(event, info) {
|
|
1373
|
+
* console.log(info.point.x, info.point.y)
|
|
1374
|
+
* }
|
|
1375
|
+
*
|
|
1376
|
+
* <motion.div onPanStart={onPanStart} />
|
|
1377
|
+
* ```
|
|
1378
|
+
*
|
|
1379
|
+
* @param event - The originating pointer event.
|
|
1380
|
+
* @param info - A {@link PanInfo} object containing `x`/`y` values for:
|
|
1381
|
+
*
|
|
1382
|
+
* - `point`: Relative to the device or page.
|
|
1383
|
+
* - `delta`: Distance moved since the last event.
|
|
1384
|
+
* - `offset`: Offset from the original pan event.
|
|
1385
|
+
* - `velocity`: Current velocity of the pointer.
|
|
1386
|
+
*/
|
|
1387
|
+
onPanStart?(event: PointerEvent, info: PanInfo): void;
|
|
1388
|
+
/**
|
|
1389
|
+
* Callback function that fires when we begin detecting a pan gesture. This
|
|
1390
|
+
* is analogous to `onMouseStart` or `onTouchStart`.
|
|
1391
|
+
*
|
|
1392
|
+
* ```jsx
|
|
1393
|
+
* function onPanSessionStart(event, info) {
|
|
1394
|
+
* console.log(info.point.x, info.point.y)
|
|
1395
|
+
* }
|
|
1396
|
+
*
|
|
1397
|
+
* <motion.div onPanSessionStart={onPanSessionStart} />
|
|
1398
|
+
* ```
|
|
1399
|
+
*
|
|
1400
|
+
* @param event - The originating pointer event.
|
|
1401
|
+
* @param info - An {@link EventInfo} object containing `x`/`y` values for:
|
|
1402
|
+
*
|
|
1403
|
+
* - `point`: Relative to the device or page.
|
|
1404
|
+
*/
|
|
1405
|
+
onPanSessionStart?(event: PointerEvent, info: EventInfo): void;
|
|
1406
|
+
/**
|
|
1407
|
+
* Callback function that fires when the pan gesture ends on this element.
|
|
1408
|
+
*
|
|
1409
|
+
* ```jsx
|
|
1410
|
+
* function onPanEnd(event, info) {
|
|
1411
|
+
* console.log(info.point.x, info.point.y)
|
|
1412
|
+
* }
|
|
1413
|
+
*
|
|
1414
|
+
* <motion.div onPanEnd={onPanEnd} />
|
|
1415
|
+
* ```
|
|
1416
|
+
*
|
|
1417
|
+
* @param event - The originating pointer event.
|
|
1418
|
+
* @param info - A {@link PanInfo} object containing `x`/`y` values for:
|
|
1419
|
+
*
|
|
1420
|
+
* - `point`: Relative to the device or page.
|
|
1421
|
+
* - `delta`: Distance moved since the last event.
|
|
1422
|
+
* - `offset`: Offset from the original pan event.
|
|
1423
|
+
* - `velocity`: Current velocity of the pointer.
|
|
1424
|
+
*/
|
|
1425
|
+
onPanEnd?(event: PointerEvent, info: PanInfo): void;
|
|
1426
|
+
}
|
|
1427
|
+
interface MotionNodeHoverHandlers {
|
|
1428
|
+
/**
|
|
1429
|
+
* Properties or variant label to animate to while the hover gesture is recognised.
|
|
1430
|
+
*
|
|
1431
|
+
* ```jsx
|
|
1432
|
+
* <motion.div whileHover={{ scale: 1.2 }} />
|
|
1433
|
+
* ```
|
|
1434
|
+
*/
|
|
1435
|
+
whileHover?: VariantLabels$1 | TargetAndTransition;
|
|
1436
|
+
/**
|
|
1437
|
+
* Callback function that fires when pointer starts hovering over the component.
|
|
1438
|
+
*
|
|
1439
|
+
* ```jsx
|
|
1440
|
+
* <motion.div onHoverStart={() => console.log('Hover starts')} />
|
|
1441
|
+
* ```
|
|
1442
|
+
*/
|
|
1443
|
+
onHoverStart?(event: MouseEvent, info: EventInfo): void;
|
|
1444
|
+
/**
|
|
1445
|
+
* Callback function that fires when pointer stops hovering over the component.
|
|
1446
|
+
*
|
|
1447
|
+
* ```jsx
|
|
1448
|
+
* <motion.div onHoverEnd={() => console.log("Hover ends")} />
|
|
1449
|
+
* ```
|
|
1450
|
+
*/
|
|
1451
|
+
onHoverEnd?(event: MouseEvent, info: EventInfo): void;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Passed in to tap event handlers like `onTap` the `TapInfo` object contains
|
|
1455
|
+
* information about the tap gesture such as it‘s location.
|
|
1456
|
+
*
|
|
1457
|
+
* ```jsx
|
|
1458
|
+
* function onTap(event, info) {
|
|
1459
|
+
* console.log(info.point.x, info.point.y)
|
|
1460
|
+
* }
|
|
1461
|
+
*
|
|
1462
|
+
* <motion.div onTap={onTap} />
|
|
1463
|
+
* ```
|
|
1464
|
+
*
|
|
1465
|
+
* @public
|
|
1466
|
+
*/
|
|
1467
|
+
interface TapInfo {
|
|
1468
|
+
/**
|
|
1469
|
+
* Contains `x` and `y` values for the tap gesture relative to the
|
|
1470
|
+
* device or page.
|
|
1471
|
+
*
|
|
1472
|
+
* ```jsx
|
|
1473
|
+
* function onTapStart(event, info) {
|
|
1474
|
+
* console.log(info.point.x, info.point.y)
|
|
1475
|
+
* }
|
|
1476
|
+
*
|
|
1477
|
+
* <motion.div onTapStart={onTapStart} />
|
|
1478
|
+
* ```
|
|
1479
|
+
*
|
|
1480
|
+
* @public
|
|
1481
|
+
*/
|
|
1482
|
+
point: Point;
|
|
1483
|
+
}
|
|
1484
|
+
interface MotionNodeTapHandlers {
|
|
1485
|
+
/**
|
|
1486
|
+
* Callback when the tap gesture successfully ends on this element.
|
|
1487
|
+
*
|
|
1488
|
+
* ```jsx
|
|
1489
|
+
* function onTap(event, info) {
|
|
1490
|
+
* console.log(info.point.x, info.point.y)
|
|
1491
|
+
* }
|
|
1492
|
+
*
|
|
1493
|
+
* <motion.div onTap={onTap} />
|
|
1494
|
+
* ```
|
|
1495
|
+
*
|
|
1496
|
+
* @param event - The originating pointer event.
|
|
1497
|
+
* @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page.
|
|
1498
|
+
*/
|
|
1499
|
+
onTap?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void;
|
|
1500
|
+
/**
|
|
1501
|
+
* Callback when the tap gesture starts on this element.
|
|
1502
|
+
*
|
|
1503
|
+
* ```jsx
|
|
1504
|
+
* function onTapStart(event, info) {
|
|
1505
|
+
* console.log(info.point.x, info.point.y)
|
|
1506
|
+
* }
|
|
1507
|
+
*
|
|
1508
|
+
* <motion.div onTapStart={onTapStart} />
|
|
1509
|
+
* ```
|
|
1510
|
+
*
|
|
1511
|
+
* @param event - The originating pointer event.
|
|
1512
|
+
* @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page.
|
|
1513
|
+
*/
|
|
1514
|
+
onTapStart?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void;
|
|
1515
|
+
/**
|
|
1516
|
+
* Callback when the tap gesture ends outside this element.
|
|
1517
|
+
*
|
|
1518
|
+
* ```jsx
|
|
1519
|
+
* function onTapCancel(event, info) {
|
|
1520
|
+
* console.log(info.point.x, info.point.y)
|
|
1521
|
+
* }
|
|
1522
|
+
*
|
|
1523
|
+
* <motion.div onTapCancel={onTapCancel} />
|
|
1524
|
+
* ```
|
|
1525
|
+
*
|
|
1526
|
+
* @param event - The originating pointer event.
|
|
1527
|
+
* @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page.
|
|
1528
|
+
*/
|
|
1529
|
+
onTapCancel?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void;
|
|
1530
|
+
/**
|
|
1531
|
+
* Properties or variant label to animate to while the component is pressed.
|
|
1532
|
+
*
|
|
1533
|
+
* ```jsx
|
|
1534
|
+
* <motion.div whileTap={{ scale: 0.8 }} />
|
|
1535
|
+
* ```
|
|
1536
|
+
*/
|
|
1537
|
+
whileTap?: VariantLabels$1 | TargetAndTransition;
|
|
1538
|
+
/**
|
|
1539
|
+
* If `true`, the tap gesture will attach its start listener to window.
|
|
1540
|
+
*
|
|
1541
|
+
* Note: This is not supported publically.
|
|
1542
|
+
*/
|
|
1543
|
+
globalTapTarget?: boolean;
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* @deprecated - Use MotionNodeTapHandlers
|
|
1547
|
+
*/
|
|
1548
|
+
|
|
1549
|
+
interface MotionNodeFocusHandlers {
|
|
1550
|
+
/**
|
|
1551
|
+
* Properties or variant label to animate to while the focus gesture is recognised.
|
|
1552
|
+
*
|
|
1553
|
+
* ```jsx
|
|
1554
|
+
* <motion.input whileFocus={{ scale: 1.2 }} />
|
|
1555
|
+
* ```
|
|
1556
|
+
*/
|
|
1557
|
+
whileFocus?: VariantLabels$1 | TargetAndTransition;
|
|
1558
|
+
}
|
|
1559
|
+
/**
|
|
1560
|
+
* TODO: Replace with types from inView()
|
|
1561
|
+
*/
|
|
1562
|
+
type ViewportEventHandler = (entry: IntersectionObserverEntry | null) => void;
|
|
1563
|
+
interface ViewportOptions {
|
|
1564
|
+
root?: {
|
|
1565
|
+
current: Element | null;
|
|
1566
|
+
};
|
|
1567
|
+
once?: boolean;
|
|
1568
|
+
margin?: string;
|
|
1569
|
+
amount?: "some" | "all" | number;
|
|
1570
|
+
}
|
|
1571
|
+
interface MotionNodeViewportOptions {
|
|
1572
|
+
whileInView?: VariantLabels$1 | TargetAndTransition;
|
|
1573
|
+
onViewportEnter?: ViewportEventHandler;
|
|
1574
|
+
onViewportLeave?: ViewportEventHandler;
|
|
1575
|
+
viewport?: ViewportOptions;
|
|
1576
|
+
}
|
|
1577
|
+
interface MotionNodeDraggableOptions {
|
|
1578
|
+
/**
|
|
1579
|
+
* Enable dragging for this element. Set to `false` by default.
|
|
1580
|
+
* Set `true` to drag in both directions.
|
|
1581
|
+
* Set `"x"` or `"y"` to only drag in a specific direction.
|
|
1582
|
+
*
|
|
1583
|
+
* ```jsx
|
|
1584
|
+
* <motion.div drag="x" />
|
|
1585
|
+
* ```
|
|
1586
|
+
*/
|
|
1587
|
+
drag?: boolean | "x" | "y";
|
|
1588
|
+
/**
|
|
1589
|
+
* Properties or variant label to animate to while the drag gesture is recognised.
|
|
1590
|
+
*
|
|
1591
|
+
* ```jsx
|
|
1592
|
+
* <motion.div whileDrag={{ scale: 1.2 }} />
|
|
1593
|
+
* ```
|
|
1594
|
+
*/
|
|
1595
|
+
whileDrag?: VariantLabels$1 | TargetAndTransition;
|
|
1596
|
+
/**
|
|
1597
|
+
* If `true`, this will lock dragging to the initially-detected direction. Defaults to `false`.
|
|
1598
|
+
*
|
|
1599
|
+
* ```jsx
|
|
1600
|
+
* <motion.div drag dragDirectionLock />
|
|
1601
|
+
* ```
|
|
1602
|
+
*/
|
|
1603
|
+
dragDirectionLock?: boolean;
|
|
1604
|
+
/**
|
|
1605
|
+
* Allows drag gesture propagation to child components. Set to `false` by
|
|
1606
|
+
* default.
|
|
1607
|
+
*
|
|
1608
|
+
* ```jsx
|
|
1609
|
+
* <motion.div drag="x" dragPropagation />
|
|
1610
|
+
* ```
|
|
1611
|
+
*/
|
|
1612
|
+
dragPropagation?: boolean;
|
|
1613
|
+
/**
|
|
1614
|
+
* Applies constraints on the permitted draggable area.
|
|
1615
|
+
*
|
|
1616
|
+
* It can accept an object of optional `top`, `left`, `right`, and `bottom` values, measured in pixels.
|
|
1617
|
+
* This will define a distance from the named edge of the draggable component.
|
|
1618
|
+
*
|
|
1619
|
+
* Alternatively, it can accept a `ref` to another component created with React's `useRef` hook.
|
|
1620
|
+
* This `ref` should be passed both to the draggable component's `dragConstraints` prop, and the `ref`
|
|
1621
|
+
* of the component you want to use as constraints.
|
|
1622
|
+
*
|
|
1623
|
+
* ```jsx
|
|
1624
|
+
* // In pixels
|
|
1625
|
+
* <motion.div
|
|
1626
|
+
* drag="x"
|
|
1627
|
+
* dragConstraints={{ left: 0, right: 300 }}
|
|
1628
|
+
* />
|
|
1629
|
+
*
|
|
1630
|
+
* // As a ref to another component
|
|
1631
|
+
* const MyComponent = () => {
|
|
1632
|
+
* const constraintsRef = useRef(null)
|
|
1633
|
+
*
|
|
1634
|
+
* return (
|
|
1635
|
+
* <motion.div ref={constraintsRef}>
|
|
1636
|
+
* <motion.div drag dragConstraints={constraintsRef} />
|
|
1637
|
+
* </motion.div>
|
|
1638
|
+
* )
|
|
1639
|
+
* }
|
|
1640
|
+
* ```
|
|
1641
|
+
*/
|
|
1642
|
+
dragConstraints?: false | Partial<BoundingBox> | {
|
|
1643
|
+
current: Element | null;
|
|
1644
|
+
};
|
|
1645
|
+
/**
|
|
1646
|
+
* The degree of movement allowed outside constraints. 0 = no movement, 1 =
|
|
1647
|
+
* full movement.
|
|
1648
|
+
*
|
|
1649
|
+
* Set to `0.5` by default. Can also be set as `false` to disable movement.
|
|
1650
|
+
*
|
|
1651
|
+
* By passing an object of `top`/`right`/`bottom`/`left`, individual values can be set
|
|
1652
|
+
* per constraint. Any missing values will be set to `0`.
|
|
1653
|
+
*
|
|
1654
|
+
* ```jsx
|
|
1655
|
+
* <motion.div
|
|
1656
|
+
* drag
|
|
1657
|
+
* dragConstraints={{ left: 0, right: 300 }}
|
|
1658
|
+
* dragElastic={0.2}
|
|
1659
|
+
* />
|
|
1660
|
+
* ```
|
|
1661
|
+
*/
|
|
1662
|
+
dragElastic?: DragElastic;
|
|
1663
|
+
/**
|
|
1664
|
+
* Apply momentum from the pan gesture to the component when dragging
|
|
1665
|
+
* finishes. Set to `true` by default.
|
|
1666
|
+
*
|
|
1667
|
+
* ```jsx
|
|
1668
|
+
* <motion.div
|
|
1669
|
+
* drag
|
|
1670
|
+
* dragConstraints={{ left: 0, right: 300 }}
|
|
1671
|
+
* dragMomentum={false}
|
|
1672
|
+
* />
|
|
1673
|
+
* ```
|
|
1674
|
+
*/
|
|
1675
|
+
dragMomentum?: boolean;
|
|
1676
|
+
/**
|
|
1677
|
+
* Allows you to change dragging inertia parameters.
|
|
1678
|
+
* When releasing a draggable Frame, an animation with type `inertia` starts. The animation is based on your dragging velocity. This property allows you to customize it.
|
|
1679
|
+
* See {@link https://motion.dev/docs/react-motion-component#dragtransition | Inertia} for all properties you can use.
|
|
1680
|
+
*
|
|
1681
|
+
* ```jsx
|
|
1682
|
+
* <motion.div
|
|
1683
|
+
* drag
|
|
1684
|
+
* dragTransition={{ bounceStiffness: 600, bounceDamping: 10 }}
|
|
1685
|
+
* />
|
|
1686
|
+
* ```
|
|
1687
|
+
*/
|
|
1688
|
+
dragTransition?: InertiaOptions;
|
|
1689
|
+
/**
|
|
1690
|
+
* Usually, dragging is initiated by pressing down on a component and moving it. For some
|
|
1691
|
+
* use-cases, for instance clicking at an arbitrary point on a video scrubber, we
|
|
1692
|
+
* might want to initiate dragging from a different component than the draggable one.
|
|
1693
|
+
*
|
|
1694
|
+
* By creating a `dragControls` using the `useDragControls` hook, we can pass this into
|
|
1695
|
+
* the draggable component's `dragControls` prop. It exposes a `start` method
|
|
1696
|
+
* that can start dragging from pointer events on other components.
|
|
1697
|
+
*
|
|
1698
|
+
* ```jsx
|
|
1699
|
+
* const dragControls = useDragControls()
|
|
1700
|
+
*
|
|
1701
|
+
* function startDrag(event) {
|
|
1702
|
+
* dragControls.start(event, { snapToCursor: true })
|
|
1703
|
+
* }
|
|
1704
|
+
*
|
|
1705
|
+
* return (
|
|
1706
|
+
* <>
|
|
1707
|
+
* <div onPointerDown={startDrag} />
|
|
1708
|
+
* <motion.div drag="x" dragControls={dragControls} />
|
|
1709
|
+
* </>
|
|
1710
|
+
* )
|
|
1711
|
+
* ```
|
|
1712
|
+
*/
|
|
1713
|
+
dragControls?: any;
|
|
1714
|
+
/**
|
|
1715
|
+
* If true, element will snap back to its origin when dragging ends.
|
|
1716
|
+
*
|
|
1717
|
+
* Enabling this is the equivalent of setting all `dragConstraints` axes to `0`
|
|
1718
|
+
* with `dragElastic={1}`, but when used together `dragConstraints` can define
|
|
1719
|
+
* a wider draggable area and `dragSnapToOrigin` will ensure the element
|
|
1720
|
+
* animates back to its origin on release.
|
|
1721
|
+
*/
|
|
1722
|
+
dragSnapToOrigin?: boolean;
|
|
1723
|
+
/**
|
|
1724
|
+
* By default, if `drag` is defined on a component then an event listener will be attached
|
|
1725
|
+
* to automatically initiate dragging when a user presses down on it.
|
|
1726
|
+
*
|
|
1727
|
+
* By setting `dragListener` to `false`, this event listener will not be created.
|
|
1728
|
+
*
|
|
1729
|
+
* ```jsx
|
|
1730
|
+
* const dragControls = useDragControls()
|
|
1731
|
+
*
|
|
1732
|
+
* function startDrag(event) {
|
|
1733
|
+
* dragControls.start(event, { snapToCursor: true })
|
|
1734
|
+
* }
|
|
1735
|
+
*
|
|
1736
|
+
* return (
|
|
1737
|
+
* <>
|
|
1738
|
+
* <div onPointerDown={startDrag} />
|
|
1739
|
+
* <motion.div
|
|
1740
|
+
* drag="x"
|
|
1741
|
+
* dragControls={dragControls}
|
|
1742
|
+
* dragListener={false}
|
|
1743
|
+
* />
|
|
1744
|
+
* </>
|
|
1745
|
+
* )
|
|
1746
|
+
* ```
|
|
1747
|
+
*/
|
|
1748
|
+
dragListener?: boolean;
|
|
1749
|
+
/**
|
|
1750
|
+
* If `dragConstraints` is set to a React ref, this callback will call with the measured drag constraints.
|
|
1751
|
+
*
|
|
1752
|
+
* @public
|
|
1753
|
+
*/
|
|
1754
|
+
onMeasureDragConstraints?: (constraints: BoundingBox) => BoundingBox | void;
|
|
1755
|
+
/**
|
|
1756
|
+
* Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement.
|
|
1757
|
+
* Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values.
|
|
1758
|
+
* This allows you to manually control how updates from a drag gesture on an element is applied.
|
|
1759
|
+
*
|
|
1760
|
+
* @public
|
|
1761
|
+
*/
|
|
1762
|
+
_dragX?: MotionValue<number>;
|
|
1763
|
+
/**
|
|
1764
|
+
* Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement.
|
|
1765
|
+
* Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values.
|
|
1766
|
+
* This allows you to manually control how updates from a drag gesture on an element is applied.
|
|
1767
|
+
*
|
|
1768
|
+
* @public
|
|
1769
|
+
*/
|
|
1770
|
+
_dragY?: MotionValue<number>;
|
|
1771
|
+
}
|
|
1772
|
+
interface MotionNodeDragHandlers {
|
|
1773
|
+
/**
|
|
1774
|
+
* Callback function that fires when dragging starts.
|
|
1775
|
+
*
|
|
1776
|
+
* ```jsx
|
|
1777
|
+
* <motion.div
|
|
1778
|
+
* drag
|
|
1779
|
+
* onDragStart={
|
|
1780
|
+
* (event, info) => console.log(info.point.x, info.point.y)
|
|
1781
|
+
* }
|
|
1782
|
+
* />
|
|
1783
|
+
* ```
|
|
1784
|
+
*
|
|
1785
|
+
* @public
|
|
1786
|
+
*/
|
|
1787
|
+
onDragStart?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void;
|
|
1788
|
+
/**
|
|
1789
|
+
* Callback function that fires when dragging ends.
|
|
1790
|
+
*
|
|
1791
|
+
* ```jsx
|
|
1792
|
+
* <motion.div
|
|
1793
|
+
* drag
|
|
1794
|
+
* onDragEnd={
|
|
1795
|
+
* (event, info) => console.log(info.point.x, info.point.y)
|
|
1796
|
+
* }
|
|
1797
|
+
* />
|
|
1798
|
+
* ```
|
|
1799
|
+
*
|
|
1800
|
+
* @public
|
|
1801
|
+
*/
|
|
1802
|
+
onDragEnd?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void;
|
|
1803
|
+
/**
|
|
1804
|
+
* Callback function that fires when the component is dragged.
|
|
1805
|
+
*
|
|
1806
|
+
* ```jsx
|
|
1807
|
+
* <motion.div
|
|
1808
|
+
* drag
|
|
1809
|
+
* onDrag={
|
|
1810
|
+
* (event, info) => console.log(info.point.x, info.point.y)
|
|
1811
|
+
* }
|
|
1812
|
+
* />
|
|
1813
|
+
* ```
|
|
1814
|
+
*
|
|
1815
|
+
* @public
|
|
1816
|
+
*/
|
|
1817
|
+
onDrag?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void;
|
|
1818
|
+
/**
|
|
1819
|
+
* Callback function that fires a drag direction is determined.
|
|
1820
|
+
*
|
|
1821
|
+
* ```jsx
|
|
1822
|
+
* <motion.div
|
|
1823
|
+
* drag
|
|
1824
|
+
* dragDirectionLock
|
|
1825
|
+
* onDirectionLock={axis => console.log(axis)}
|
|
1826
|
+
* />
|
|
1827
|
+
* ```
|
|
1828
|
+
*
|
|
1829
|
+
* @public
|
|
1830
|
+
*/
|
|
1831
|
+
onDirectionLock?(axis: "x" | "y"): void;
|
|
1832
|
+
/**
|
|
1833
|
+
* Callback function that fires when drag momentum/bounce transition finishes.
|
|
1834
|
+
*
|
|
1835
|
+
* ```jsx
|
|
1836
|
+
* <motion.div
|
|
1837
|
+
* drag
|
|
1838
|
+
* onDragTransitionEnd={() => console.log('Drag transition complete')}
|
|
1839
|
+
* />
|
|
1840
|
+
* ```
|
|
1841
|
+
*
|
|
1842
|
+
* @public
|
|
1843
|
+
*/
|
|
1844
|
+
onDragTransitionEnd?(): void;
|
|
1845
|
+
}
|
|
1846
|
+
interface MotionNodeLayoutOptions {
|
|
1847
|
+
/**
|
|
1848
|
+
* If `true`, this component will automatically animate to its new position when
|
|
1849
|
+
* its layout changes.
|
|
1850
|
+
*
|
|
1851
|
+
* ```jsx
|
|
1852
|
+
* <motion.div layout />
|
|
1853
|
+
* ```
|
|
1854
|
+
*
|
|
1855
|
+
* This will perform a layout animation using performant transforms. Part of this technique
|
|
1856
|
+
* involved animating an element's scale. This can introduce visual distortions on children,
|
|
1857
|
+
* `boxShadow` and `borderRadius`.
|
|
1858
|
+
*
|
|
1859
|
+
* To correct distortion on immediate children, add `layout` to those too.
|
|
1860
|
+
*
|
|
1861
|
+
* `boxShadow` and `borderRadius` will automatically be corrected if they are already being
|
|
1862
|
+
* animated on this component. Otherwise, set them directly via the `initial` prop.
|
|
1863
|
+
*
|
|
1864
|
+
* If `layout` is set to `"position"`, the size of the component will change instantly and
|
|
1865
|
+
* only its position will animate.
|
|
1866
|
+
*
|
|
1867
|
+
* If `layout` is set to `"size"`, the position of the component will change instantly and
|
|
1868
|
+
* only its size will animate.
|
|
1869
|
+
*
|
|
1870
|
+
* If `layout` is set to `"preserve-aspect"`, the component will animate size & position if
|
|
1871
|
+
* the aspect ratio remains the same between renders, and just position if the ratio changes.
|
|
1872
|
+
*
|
|
1873
|
+
* @public
|
|
1874
|
+
*/
|
|
1875
|
+
layout?: boolean | "position" | "size" | "preserve-aspect";
|
|
1876
|
+
/**
|
|
1877
|
+
* Enable shared layout transitions between different components with the same `layoutId`.
|
|
1878
|
+
*
|
|
1879
|
+
* When a component with a layoutId is removed from the React tree, and then
|
|
1880
|
+
* added elsewhere, it will visually animate from the previous component's bounding box
|
|
1881
|
+
* and its latest animated values.
|
|
1882
|
+
*
|
|
1883
|
+
* ```jsx
|
|
1884
|
+
* {items.map(item => (
|
|
1885
|
+
* <motion.li layout>
|
|
1886
|
+
* {item.name}
|
|
1887
|
+
* {item.isSelected && <motion.div layoutId="underline" />}
|
|
1888
|
+
* </motion.li>
|
|
1889
|
+
* ))}
|
|
1890
|
+
* ```
|
|
1891
|
+
*
|
|
1892
|
+
* If the previous component remains in the tree it will crossfade with the new component.
|
|
1893
|
+
*
|
|
1894
|
+
* @public
|
|
1895
|
+
*/
|
|
1896
|
+
layoutId?: string;
|
|
1897
|
+
/**
|
|
1898
|
+
* A callback that will fire when a layout animation on this component starts.
|
|
1899
|
+
*
|
|
1900
|
+
* @public
|
|
1901
|
+
*/
|
|
1902
|
+
onLayoutAnimationStart?(): void;
|
|
1903
|
+
/**
|
|
1904
|
+
* A callback that will fire when a layout animation on this component completes.
|
|
1905
|
+
*
|
|
1906
|
+
* @public
|
|
1907
|
+
*/
|
|
1908
|
+
onLayoutAnimationComplete?(): void;
|
|
1909
|
+
/**
|
|
1910
|
+
* @public
|
|
1911
|
+
*/
|
|
1912
|
+
layoutDependency?: any;
|
|
1913
|
+
/**
|
|
1914
|
+
* Whether a projection node should measure its scroll when it or its descendants update their layout.
|
|
1915
|
+
*
|
|
1916
|
+
* @public
|
|
1917
|
+
*/
|
|
1918
|
+
layoutScroll?: boolean;
|
|
1919
|
+
/**
|
|
1920
|
+
* Whether an element should be considered a "layout root", where
|
|
1921
|
+
* all children will be forced to resolve relatively to it.
|
|
1922
|
+
* Currently used for `position: sticky` elements in Framer.
|
|
1923
|
+
*/
|
|
1924
|
+
layoutRoot?: boolean;
|
|
1925
|
+
/**
|
|
1926
|
+
* Attached to a portal root to ensure we attach the child to the document root and don't
|
|
1927
|
+
* perform scale correction on it.
|
|
1928
|
+
*/
|
|
1929
|
+
"data-framer-portal-id"?: string;
|
|
1930
|
+
/**
|
|
1931
|
+
* By default, shared layout elements will crossfade. By setting this
|
|
1932
|
+
* to `false`, this element will take its default opacity throughout the animation.
|
|
1933
|
+
*/
|
|
1934
|
+
layoutCrossfade?: boolean;
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* @deprecated - Use MotionNodeDragHandlers/MotionNodeDraggableOptions
|
|
1938
|
+
*/
|
|
1939
|
+
|
|
1940
|
+
type TransformTemplate = (transform: TransformProperties, generatedTransform: string) => string;
|
|
1941
|
+
interface MotionNodeAdvancedOptions {
|
|
1942
|
+
/**
|
|
1943
|
+
* Custom data to use to resolve dynamic variants differently for each animating component.
|
|
1944
|
+
*
|
|
1945
|
+
* ```jsx
|
|
1946
|
+
* const variants = {
|
|
1947
|
+
* visible: (custom) => ({
|
|
1948
|
+
* opacity: 1,
|
|
1949
|
+
* transition: { delay: custom * 0.2 }
|
|
1950
|
+
* })
|
|
1951
|
+
* }
|
|
1952
|
+
*
|
|
1953
|
+
* <motion.div custom={0} animate="visible" variants={variants} />
|
|
1954
|
+
* <motion.div custom={1} animate="visible" variants={variants} />
|
|
1955
|
+
* <motion.div custom={2} animate="visible" variants={variants} />
|
|
1956
|
+
* ```
|
|
1957
|
+
*
|
|
1958
|
+
* @public
|
|
1959
|
+
*/
|
|
1960
|
+
custom?: any;
|
|
1961
|
+
/**
|
|
1962
|
+
* @public
|
|
1963
|
+
* Set to `false` to prevent inheriting variant changes from its parent.
|
|
1964
|
+
*/
|
|
1965
|
+
inherit?: boolean;
|
|
1966
|
+
/**
|
|
1967
|
+
* @public
|
|
1968
|
+
* Set to `false` to prevent throwing an error when a `motion` component is used within a `LazyMotion` set to strict.
|
|
1969
|
+
*/
|
|
1970
|
+
ignoreStrict?: boolean;
|
|
1971
|
+
/**
|
|
1972
|
+
* Provide a set of motion values to perform animations on.
|
|
1973
|
+
*/
|
|
1974
|
+
values?: {
|
|
1975
|
+
[key: string]: MotionValue<number> | MotionValue<string>;
|
|
1976
|
+
};
|
|
1977
|
+
/**
|
|
1978
|
+
* By default, Motion generates a `transform` property with a sensible transform order. `transformTemplate`
|
|
1979
|
+
* can be used to create a different order, or to append/preprend the automatically generated `transform` property.
|
|
1980
|
+
*
|
|
1981
|
+
* ```jsx
|
|
1982
|
+
* <motion.div
|
|
1983
|
+
* style={{ x: 0, rotate: 180 }}
|
|
1984
|
+
* transformTemplate={
|
|
1985
|
+
* ({ x, rotate }) => `rotate(${rotate}deg) translateX(${x}px)`
|
|
1986
|
+
* }
|
|
1987
|
+
* />
|
|
1988
|
+
* ```
|
|
1989
|
+
*
|
|
1990
|
+
* @param transform - The latest animated transform props.
|
|
1991
|
+
* @param generatedTransform - The transform string as automatically generated by Motion
|
|
1992
|
+
*
|
|
1993
|
+
* @public
|
|
1994
|
+
*/
|
|
1995
|
+
transformTemplate?: TransformTemplate;
|
|
1996
|
+
"data-framer-appear-id"?: string;
|
|
1997
|
+
}
|
|
1998
|
+
interface MotionNodeOptions extends MotionNodeAnimationOptions, MotionNodeEventOptions, MotionNodePanHandlers, MotionNodeTapHandlers, MotionNodeHoverHandlers, MotionNodeFocusHandlers, MotionNodeViewportOptions, MotionNodeDragHandlers, MotionNodeDraggableOptions, MotionNodeLayoutOptions, MotionNodeAdvancedOptions {}
|
|
1999
|
+
declare global {
|
|
2000
|
+
interface Window {
|
|
2001
|
+
ScrollTimeline: ScrollTimeline;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
declare class ScrollTimeline implements ProgressTimeline {
|
|
2005
|
+
constructor(options: ScrollOptions);
|
|
2006
|
+
currentTime: null | {
|
|
2007
|
+
value: number;
|
|
2008
|
+
};
|
|
2009
|
+
cancel?: VoidFunction;
|
|
2010
|
+
}
|
|
2011
|
+
//#endregion
|
|
2012
|
+
//#region ../node_modules/.pnpm/framer-motion@12.23.26_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/types.d-DagZKalS.d.ts
|
|
2013
|
+
type MotionValueString = MotionValue<string>;
|
|
2014
|
+
type MotionValueNumber = MotionValue<number>;
|
|
2015
|
+
type MotionValueAny = MotionValue<any>;
|
|
2016
|
+
type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny;
|
|
2017
|
+
type MotionValueHelper<T> = T | AnyMotionValue;
|
|
2018
|
+
type MakeMotionHelper<T> = { [K in keyof T]: MotionValueHelper<T[K]> };
|
|
2019
|
+
type MakeCustomValueTypeHelper<T> = MakeMotionHelper<T>;
|
|
2020
|
+
type MakeMotion<T> = MakeCustomValueTypeHelper<T>;
|
|
2021
|
+
type MotionCSS = MakeMotion<Omit<CSSProperties, "rotate" | "scale" | "perspective">>;
|
|
2022
|
+
/**
|
|
2023
|
+
* @public
|
|
2024
|
+
*/
|
|
2025
|
+
type MotionTransform = MakeMotion<TransformProperties>;
|
|
2026
|
+
type MotionSVGProps = MakeMotion<SVGPathProperties>;
|
|
2027
|
+
/**
|
|
2028
|
+
* @public
|
|
2029
|
+
*/
|
|
2030
|
+
interface MotionStyle extends MotionCSS, MotionTransform, MotionSVGProps {}
|
|
2031
|
+
/**
|
|
2032
|
+
* Props for `motion` components.
|
|
2033
|
+
*
|
|
2034
|
+
* @public
|
|
2035
|
+
*/
|
|
2036
|
+
interface MotionProps extends MotionNodeOptions {
|
|
2037
|
+
/**
|
|
2038
|
+
*
|
|
2039
|
+
* The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values.
|
|
2040
|
+
*
|
|
2041
|
+
* ```jsx
|
|
2042
|
+
* export const MyComponent = () => {
|
|
2043
|
+
* const x = useMotionValue(0)
|
|
2044
|
+
*
|
|
2045
|
+
* return <motion.div style={{ x, opacity: 1, scale: 0.5 }} />
|
|
2046
|
+
* }
|
|
2047
|
+
* ```
|
|
2048
|
+
*/
|
|
2049
|
+
style?: MotionStyle;
|
|
2050
|
+
children?: React.ReactNode | MotionValueNumber | MotionValueString;
|
|
2051
|
+
}
|
|
2052
|
+
interface HTMLElements {
|
|
2053
|
+
a: HTMLAnchorElement;
|
|
2054
|
+
abbr: HTMLElement;
|
|
2055
|
+
address: HTMLElement;
|
|
2056
|
+
area: HTMLAreaElement;
|
|
2057
|
+
article: HTMLElement;
|
|
2058
|
+
aside: HTMLElement;
|
|
2059
|
+
audio: HTMLAudioElement;
|
|
2060
|
+
b: HTMLElement;
|
|
2061
|
+
base: HTMLBaseElement;
|
|
2062
|
+
bdi: HTMLElement;
|
|
2063
|
+
bdo: HTMLElement;
|
|
2064
|
+
big: HTMLElement;
|
|
2065
|
+
blockquote: HTMLQuoteElement;
|
|
2066
|
+
body: HTMLBodyElement;
|
|
2067
|
+
br: HTMLBRElement;
|
|
2068
|
+
button: HTMLButtonElement;
|
|
2069
|
+
canvas: HTMLCanvasElement;
|
|
2070
|
+
caption: HTMLElement;
|
|
2071
|
+
center: HTMLElement;
|
|
2072
|
+
cite: HTMLElement;
|
|
2073
|
+
code: HTMLElement;
|
|
2074
|
+
col: HTMLTableColElement;
|
|
2075
|
+
colgroup: HTMLTableColElement;
|
|
2076
|
+
data: HTMLDataElement;
|
|
2077
|
+
datalist: HTMLDataListElement;
|
|
2078
|
+
dd: HTMLElement;
|
|
2079
|
+
del: HTMLModElement;
|
|
2080
|
+
details: HTMLDetailsElement;
|
|
2081
|
+
dfn: HTMLElement;
|
|
2082
|
+
dialog: HTMLDialogElement;
|
|
2083
|
+
div: HTMLDivElement;
|
|
2084
|
+
dl: HTMLDListElement;
|
|
2085
|
+
dt: HTMLElement;
|
|
2086
|
+
em: HTMLElement;
|
|
2087
|
+
embed: HTMLEmbedElement;
|
|
2088
|
+
fieldset: HTMLFieldSetElement;
|
|
2089
|
+
figcaption: HTMLElement;
|
|
2090
|
+
figure: HTMLElement;
|
|
2091
|
+
footer: HTMLElement;
|
|
2092
|
+
form: HTMLFormElement;
|
|
2093
|
+
h1: HTMLHeadingElement;
|
|
2094
|
+
h2: HTMLHeadingElement;
|
|
2095
|
+
h3: HTMLHeadingElement;
|
|
2096
|
+
h4: HTMLHeadingElement;
|
|
2097
|
+
h5: HTMLHeadingElement;
|
|
2098
|
+
h6: HTMLHeadingElement;
|
|
2099
|
+
head: HTMLHeadElement;
|
|
2100
|
+
header: HTMLElement;
|
|
2101
|
+
hgroup: HTMLElement;
|
|
2102
|
+
hr: HTMLHRElement;
|
|
2103
|
+
html: HTMLHtmlElement;
|
|
2104
|
+
i: HTMLElement;
|
|
2105
|
+
iframe: HTMLIFrameElement;
|
|
2106
|
+
img: HTMLImageElement;
|
|
2107
|
+
input: HTMLInputElement;
|
|
2108
|
+
ins: HTMLModElement;
|
|
2109
|
+
kbd: HTMLElement;
|
|
2110
|
+
keygen: HTMLElement;
|
|
2111
|
+
label: HTMLLabelElement;
|
|
2112
|
+
legend: HTMLLegendElement;
|
|
2113
|
+
li: HTMLLIElement;
|
|
2114
|
+
link: HTMLLinkElement;
|
|
2115
|
+
main: HTMLElement;
|
|
2116
|
+
map: HTMLMapElement;
|
|
2117
|
+
mark: HTMLElement;
|
|
2118
|
+
menu: HTMLElement;
|
|
2119
|
+
menuitem: HTMLElement;
|
|
2120
|
+
meta: HTMLMetaElement;
|
|
2121
|
+
meter: HTMLMeterElement;
|
|
2122
|
+
nav: HTMLElement;
|
|
2123
|
+
noindex: HTMLElement;
|
|
2124
|
+
noscript: HTMLElement;
|
|
2125
|
+
object: HTMLObjectElement;
|
|
2126
|
+
ol: HTMLOListElement;
|
|
2127
|
+
optgroup: HTMLOptGroupElement;
|
|
2128
|
+
option: HTMLOptionElement;
|
|
2129
|
+
output: HTMLOutputElement;
|
|
2130
|
+
p: HTMLParagraphElement;
|
|
2131
|
+
param: HTMLParamElement;
|
|
2132
|
+
picture: HTMLElement;
|
|
2133
|
+
pre: HTMLPreElement;
|
|
2134
|
+
progress: HTMLProgressElement;
|
|
2135
|
+
q: HTMLQuoteElement;
|
|
2136
|
+
rp: HTMLElement;
|
|
2137
|
+
rt: HTMLElement;
|
|
2138
|
+
ruby: HTMLElement;
|
|
2139
|
+
s: HTMLElement;
|
|
2140
|
+
samp: HTMLElement;
|
|
2141
|
+
search: HTMLElement;
|
|
2142
|
+
slot: HTMLSlotElement;
|
|
2143
|
+
script: HTMLScriptElement;
|
|
2144
|
+
section: HTMLElement;
|
|
2145
|
+
select: HTMLSelectElement;
|
|
2146
|
+
small: HTMLElement;
|
|
2147
|
+
source: HTMLSourceElement;
|
|
2148
|
+
span: HTMLSpanElement;
|
|
2149
|
+
strong: HTMLElement;
|
|
2150
|
+
style: HTMLStyleElement;
|
|
2151
|
+
sub: HTMLElement;
|
|
2152
|
+
summary: HTMLElement;
|
|
2153
|
+
sup: HTMLElement;
|
|
2154
|
+
table: HTMLTableElement;
|
|
2155
|
+
template: HTMLTemplateElement;
|
|
2156
|
+
tbody: HTMLTableSectionElement;
|
|
2157
|
+
td: HTMLTableDataCellElement;
|
|
2158
|
+
textarea: HTMLTextAreaElement;
|
|
2159
|
+
tfoot: HTMLTableSectionElement;
|
|
2160
|
+
th: HTMLTableHeaderCellElement;
|
|
2161
|
+
thead: HTMLTableSectionElement;
|
|
2162
|
+
time: HTMLTimeElement;
|
|
2163
|
+
title: HTMLTitleElement;
|
|
2164
|
+
tr: HTMLTableRowElement;
|
|
2165
|
+
track: HTMLTrackElement;
|
|
2166
|
+
u: HTMLElement;
|
|
2167
|
+
ul: HTMLUListElement;
|
|
2168
|
+
var: HTMLElement;
|
|
2169
|
+
video: HTMLVideoElement;
|
|
2170
|
+
wbr: HTMLElement;
|
|
2171
|
+
webview: HTMLWebViewElement;
|
|
2172
|
+
}
|
|
2173
|
+
type AttributesWithoutMotionProps<Attributes> = { [K in Exclude<keyof Attributes, keyof MotionProps>]?: Attributes[K] };
|
|
2174
|
+
/**
|
|
2175
|
+
* @public
|
|
2176
|
+
*/
|
|
2177
|
+
type HTMLMotionProps<Tag extends keyof HTMLElements> = AttributesWithoutMotionProps<JSX$1.IntrinsicElements[Tag]> & MotionProps;
|
|
2178
|
+
/**
|
|
2179
|
+
* Motion-optimised versions of React's HTML components.
|
|
2180
|
+
*
|
|
2181
|
+
* @public
|
|
2182
|
+
*/
|
|
2183
|
+
|
|
2184
|
+
declare const optimizedAppearDataAttribute: "data-framer-appear-id";
|
|
2185
|
+
|
|
2186
|
+
/**
|
|
2187
|
+
* Expose only the needed part of the VisualElement interface to
|
|
2188
|
+
* ensure React types don't end up in the generic DOM bundle.
|
|
2189
|
+
*/
|
|
2190
|
+
interface WithAppearProps {
|
|
2191
|
+
props: {
|
|
2192
|
+
[optimizedAppearDataAttribute]?: string;
|
|
2193
|
+
values?: {
|
|
2194
|
+
[key: string]: MotionValue<number> | MotionValue<string>;
|
|
2195
|
+
};
|
|
2196
|
+
};
|
|
2197
|
+
}
|
|
2198
|
+
type HandoffFunction = (storeId: string, valueName: string, frame: Batcher) => number | null;
|
|
2199
|
+
/**
|
|
2200
|
+
* The window global object acts as a bridge between our inline script
|
|
2201
|
+
* triggering the optimized appear animations, and Motion.
|
|
2202
|
+
*/
|
|
2203
|
+
declare global {
|
|
2204
|
+
interface Window {
|
|
2205
|
+
MotionHandoffAnimation?: HandoffFunction;
|
|
2206
|
+
MotionHandoffMarkAsComplete?: (elementId: string) => void;
|
|
2207
|
+
MotionHandoffIsComplete?: (elementId: string) => boolean;
|
|
2208
|
+
MotionHasOptimisedAnimation?: (elementId?: string, valueName?: string) => boolean;
|
|
2209
|
+
MotionCancelOptimisedAnimation?: (elementId?: string, valueName?: string, frame?: Batcher, canResume?: boolean) => void;
|
|
2210
|
+
MotionCheckAppearSync?: (visualElement: WithAppearProps, valueName: string, value: MotionValue) => VoidFunction | void;
|
|
2211
|
+
MotionIsMounted?: boolean;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
//#endregion
|
|
2215
|
+
export { type ClassProp as n, ClassValue$1 as r, HTMLMotionProps as t };
|
|
2216
|
+
//# sourceMappingURL=index3.d.ts.map
|