@mohasinac/appkit 4.52.5 → 4.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +4 -4
- package/dist/_internal/client/features/sticker-trace/canvas-codec.d.ts +2 -0
- package/dist/_internal/client/features/sticker-trace/canvas-codec.js +148 -0
- package/dist/_internal/server/features/auctions/actions.js +1 -1
- package/dist/_internal/server/features/categories/data.js +23 -7
- package/dist/_internal/server/features/checkout/actions.js +10 -3
- package/dist/_internal/server/features/checkout/data.d.ts +15 -0
- package/dist/_internal/server/features/checkout/data.js +20 -3
- package/dist/_internal/server/features/lottery/actions.js +9 -1
- package/dist/_internal/server/features/lottery/og.d.ts +40 -0
- package/dist/_internal/server/features/lottery/og.js +79 -0
- package/dist/_internal/server/features/messages/actions.js +4 -0
- package/dist/_internal/server/features/offers/adapters.js +17 -3
- package/dist/_internal/server/features/orders/actions.js +7 -2
- package/dist/_internal/server/features/raffle/actions.d.ts +19 -0
- package/dist/_internal/server/features/raffle/actions.js +25 -0
- package/dist/_internal/server/features/reviews/actions.js +1 -1
- package/dist/_internal/server/features/reviews/data.d.ts +1 -1
- package/dist/_internal/server/features/search/index-build/artifact-store.d.ts +89 -0
- package/dist/_internal/server/features/search/index-build/artifact-store.js +208 -0
- package/dist/_internal/server/features/search/index-build/build.d.ts +57 -0
- package/dist/_internal/server/features/search/index-build/build.js +285 -0
- package/dist/_internal/server/features/search/index-build/sources.d.ts +53 -0
- package/dist/_internal/server/features/search/index-build/sources.js +385 -0
- package/dist/_internal/server/features/search/search-sources.d.ts +0 -15
- package/dist/_internal/server/features/search/search-sources.js +142 -7
- package/dist/_internal/server/features/seo/robots.js +21 -1
- package/dist/_internal/server/features/seo/sitemap.js +1 -1
- package/dist/_internal/server/features/shared/listing-data-factory.js +16 -4
- package/dist/_internal/server/features/site-settings/adapters.d.ts +1 -1
- package/dist/_internal/server/features/site-settings/adapters.js +26 -0
- package/dist/_internal/server/features/sticker-trace/actions.d.ts +109 -0
- package/dist/_internal/server/features/sticker-trace/actions.js +172 -0
- package/dist/_internal/server/features/sticker-trace/adapters.d.ts +80 -0
- package/dist/_internal/server/features/sticker-trace/adapters.js +174 -0
- package/dist/_internal/server/features/sticker-trace/build-cut-file.d.ts +26 -0
- package/dist/_internal/server/features/sticker-trace/build-cut-file.js +127 -0
- package/dist/_internal/server/features/sticker-trace/coordinator.d.ts +27 -0
- package/dist/_internal/server/features/sticker-trace/coordinator.js +169 -0
- package/dist/_internal/server/features/sticker-trace/fanout.d.ts +43 -0
- package/dist/_internal/server/features/sticker-trace/fanout.js +180 -0
- package/dist/_internal/server/features/sticker-trace/finalizer.d.ts +25 -0
- package/dist/_internal/server/features/sticker-trace/finalizer.js +123 -0
- package/dist/_internal/server/features/sticker-trace/mosaic-inputs.d.ts +30 -0
- package/dist/_internal/server/features/sticker-trace/mosaic-inputs.js +112 -0
- package/dist/_internal/server/features/sticker-trace/progress.d.ts +81 -0
- package/dist/_internal/server/features/sticker-trace/progress.js +198 -0
- package/dist/_internal/server/features/sticker-trace/promote.d.ts +23 -0
- package/dist/_internal/server/features/sticker-trace/promote.js +193 -0
- package/dist/_internal/server/features/sticker-trace/shard.d.ts +50 -0
- package/dist/_internal/server/features/sticker-trace/shard.js +174 -0
- package/dist/_internal/server/features/sticker-trace/sheet-actions.d.ts +141 -0
- package/dist/_internal/server/features/sticker-trace/sheet-actions.js +279 -0
- package/dist/_internal/server/features/sticker-trace/storage.d.ts +135 -0
- package/dist/_internal/server/features/sticker-trace/storage.js +282 -0
- package/dist/_internal/server/functions/scheduled.d.ts +2 -1
- package/dist/_internal/server/functions/scheduled.js +25 -1
- package/dist/_internal/server/jobs/core/_event-ref.d.ts +51 -0
- package/dist/_internal/server/jobs/core/_event-ref.js +63 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.d.ts +18 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.js +77 -16
- package/dist/_internal/server/jobs/core/auctionSettlement.js +13 -4
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +44 -15
- package/dist/_internal/server/jobs/core/bundleStockSync.js +3 -4
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +44 -0
- package/dist/_internal/server/jobs/core/event-draw-reasons.d.ts +78 -0
- package/dist/_internal/server/jobs/core/event-draw-reasons.js +133 -0
- package/dist/_internal/server/jobs/core/listingProcessor.js +28 -8
- package/dist/_internal/server/jobs/core/onOrderCreate.js +12 -1
- package/dist/_internal/server/jobs/core/onScamReportCreate.js +13 -2
- package/dist/_internal/server/jobs/core/onScamReportRejected.js +8 -2
- package/dist/_internal/server/jobs/core/onScamReportVerified.js +8 -2
- package/dist/_internal/server/jobs/core/onStoreWrite.js +11 -4
- package/dist/_internal/server/jobs/core/prizeDrawAssignWinner.js +5 -4
- package/dist/_internal/server/jobs/core/prizeDrawExpiryReveal.js +1 -4
- package/dist/_internal/server/jobs/core/prizeDrawSoldOutReveal.js +1 -2
- package/dist/_internal/server/jobs/core/promotions.js +7 -4
- package/dist/_internal/server/jobs/core/searchIndexBuild.d.ts +7 -0
- package/dist/_internal/server/jobs/core/searchIndexBuild.js +211 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.d.ts +35 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +213 -31
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +20 -14
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +8 -0
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +15 -15
- package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
- package/dist/_internal/server/jobs/handlers/index.js +1 -0
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/onProductWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/onReviewWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/onScamReportUpdate.js +18 -0
- package/dist/_internal/server/jobs/handlers/onStoreWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/searchIndexBuild.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/searchIndexBuild.js +2 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +8 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +15 -6
- package/dist/_internal/shared/actions/action-registry.js +29 -0
- package/dist/_internal/shared/cache/revalidate-targets.d.ts +0 -1
- package/dist/_internal/shared/cache/revalidate-targets.js +10 -8
- package/dist/_internal/shared/features/events/config.d.ts +14 -0
- package/dist/_internal/shared/features/events/config.js +14 -0
- package/dist/_internal/shared/features/notifications/action-url.js +8 -0
- package/dist/_internal/shared/features/site-settings/types.d.ts +11 -0
- package/dist/_internal/shared/features/sticker-trace/codec.d.ts +81 -0
- package/dist/_internal/shared/features/sticker-trace/codec.js +30 -0
- package/dist/_internal/shared/features/sticker-trace/config.d.ts +81 -0
- package/dist/_internal/shared/features/sticker-trace/config.js +177 -0
- package/dist/_internal/shared/features/sticker-trace/cut-contour.d.ts +20 -0
- package/dist/_internal/shared/features/sticker-trace/cut-contour.js +60 -0
- package/dist/_internal/shared/features/sticker-trace/export/build-export-set.d.ts +65 -0
- package/dist/_internal/shared/features/sticker-trace/export/build-export-set.js +176 -0
- package/dist/_internal/shared/features/sticker-trace/export/cut-svg.d.ts +56 -0
- package/dist/_internal/shared/features/sticker-trace/export/cut-svg.js +120 -0
- package/dist/_internal/shared/features/sticker-trace/export/machine-profiles.d.ts +92 -0
- package/dist/_internal/shared/features/sticker-trace/export/machine-profiles.js +153 -0
- package/dist/_internal/shared/features/sticker-trace/export/nesting.d.ts +51 -0
- package/dist/_internal/shared/features/sticker-trace/export/nesting.js +110 -0
- package/dist/_internal/shared/features/sticker-trace/export/page-sizes.d.ts +68 -0
- package/dist/_internal/shared/features/sticker-trace/export/page-sizes.js +223 -0
- package/dist/_internal/shared/features/sticker-trace/export/part-tiling.d.ts +51 -0
- package/dist/_internal/shared/features/sticker-trace/export/part-tiling.js +178 -0
- package/dist/_internal/shared/features/sticker-trace/export/simplify-budget.d.ts +26 -0
- package/dist/_internal/shared/features/sticker-trace/export/simplify-budget.js +134 -0
- package/dist/_internal/shared/features/sticker-trace/export/vectorise-art.d.ts +40 -0
- package/dist/_internal/shared/features/sticker-trace/export/vectorise-art.js +195 -0
- package/dist/_internal/shared/features/sticker-trace/index.d.ts +2 -0
- package/dist/_internal/shared/features/sticker-trace/index.js +59 -0
- package/dist/_internal/shared/features/sticker-trace/math/catmull-rom.d.ts +11 -0
- package/dist/_internal/shared/features/sticker-trace/math/catmull-rom.js +66 -0
- package/dist/_internal/shared/features/sticker-trace/math/edt.d.ts +27 -0
- package/dist/_internal/shared/features/sticker-trace/math/edt.js +165 -0
- package/dist/_internal/shared/features/sticker-trace/math/label.d.ts +15 -0
- package/dist/_internal/shared/features/sticker-trace/math/label.js +156 -0
- package/dist/_internal/shared/features/sticker-trace/math/marching-squares.d.ts +16 -0
- package/dist/_internal/shared/features/sticker-trace/math/marching-squares.js +242 -0
- package/dist/_internal/shared/features/sticker-trace/math/morphology.d.ts +46 -0
- package/dist/_internal/shared/features/sticker-trace/math/morphology.js +168 -0
- package/dist/_internal/shared/features/sticker-trace/math/rasterize-path.d.ts +88 -0
- package/dist/_internal/shared/features/sticker-trace/math/rasterize-path.js +286 -0
- package/dist/_internal/shared/features/sticker-trace/math/rdp.d.ts +10 -0
- package/dist/_internal/shared/features/sticker-trace/math/rdp.js +74 -0
- package/dist/_internal/shared/features/sticker-trace/resume.d.ts +50 -0
- package/dist/_internal/shared/features/sticker-trace/resume.js +160 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cluster.d.ts +20 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cluster.js +132 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cross-profile.d.ts +28 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cross-profile.js +120 -0
- package/dist/_internal/shared/features/sticker-trace/trace/flood.d.ts +21 -0
- package/dist/_internal/shared/features/sticker-trace/trace/flood.js +104 -0
- package/dist/_internal/shared/features/sticker-trace/trace/geometry.d.ts +3 -0
- package/dist/_internal/shared/features/sticker-trace/trace/geometry.js +140 -0
- package/dist/_internal/shared/features/sticker-trace/trace/line-filter.d.ts +15 -0
- package/dist/_internal/shared/features/sticker-trace/trace/line-filter.js +138 -0
- package/dist/_internal/shared/features/sticker-trace/trace/merge.d.ts +27 -0
- package/dist/_internal/shared/features/sticker-trace/trace/merge.js +187 -0
- package/dist/_internal/shared/features/sticker-trace/trace/paper.d.ts +32 -0
- package/dist/_internal/shared/features/sticker-trace/trace/paper.js +147 -0
- package/dist/_internal/shared/features/sticker-trace/trace/prefilter.d.ts +30 -0
- package/dist/_internal/shared/features/sticker-trace/trace/prefilter.js +125 -0
- package/dist/_internal/shared/features/sticker-trace/trace/quantise.d.ts +10 -0
- package/dist/_internal/shared/features/sticker-trace/trace/quantise.js +153 -0
- package/dist/_internal/shared/features/sticker-trace/trace/ridge.d.ts +88 -0
- package/dist/_internal/shared/features/sticker-trace/trace/ridge.js +344 -0
- package/dist/_internal/shared/features/sticker-trace/trace/segment.d.ts +10 -0
- package/dist/_internal/shared/features/sticker-trace/trace/segment.js +251 -0
- package/dist/_internal/shared/features/sticker-trace/types.d.ts +197 -0
- package/dist/_internal/shared/features/sticker-trace/types.js +49 -0
- package/dist/_internal/shared/listing-types/_registry.d.ts +11 -0
- package/dist/_internal/shared/listing-types/art/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/config.js +1 -0
- package/dist/_internal/shared/listing-types/auction/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/auction/config.js +1 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/config.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +1 -0
- package/dist/_internal/shared/listing-types/feature-flags.d.ts +7 -0
- package/dist/_internal/shared/listing-types/feature-flags.js +9 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/config.js +1 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.js +1 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/config.js +1 -0
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/config.js +1 -0
- package/dist/_internal/shared/media/limits.d.ts +12 -2
- package/dist/_internal/shared/media/limits.js +12 -2
- package/dist/_internal/shared/search/artifact-url.d.ts +35 -0
- package/dist/_internal/shared/search/artifact-url.js +119 -0
- package/dist/_internal/shared/search/index-record.d.ts +68 -0
- package/dist/_internal/shared/search/index-record.js +96 -0
- package/dist/_internal/shared/search/match.d.ts +65 -0
- package/dist/_internal/shared/search/match.js +263 -0
- package/dist/client.d.ts +8 -7
- package/dist/client.js +12 -5
- package/dist/configs/eslint.js +22 -2
- package/dist/constants/api-endpoints.d.ts +68 -0
- package/dist/constants/api-endpoints.js +32 -0
- package/dist/constants/field-names.d.ts +7 -1
- package/dist/constants/field-names.js +36 -1
- package/dist/contracts/repository.d.ts +8 -7
- package/dist/contracts/search.d.ts +2 -2
- package/dist/contracts/table.d.ts +3 -3
- package/dist/contracts/table.js +3 -3
- package/dist/core/contact-submissions.repository.js +2 -2
- package/dist/core/integration-keys.js +7 -1
- package/dist/core/newsletter.repository.js +2 -2
- package/dist/core/site-config.js +1 -1
- package/dist/errors/error-codes.d.ts +30 -0
- package/dist/errors/error-codes.js +30 -0
- package/dist/errors/error-display-map.js +40 -1
- package/dist/features/account/api/[userId]/addresses/route.js +1 -1
- package/dist/features/account/components/UserBidsView.js +1 -1
- package/dist/features/account/components/index.d.ts +0 -8
- package/dist/features/account/components/index.js +0 -4
- package/dist/features/addresses/repository/addresses.repository.d.ts +17 -6
- package/dist/features/addresses/repository/addresses.repository.js +65 -9
- package/dist/features/addresses/schemas/firestore.d.ts +17 -6
- package/dist/features/admin/actions/notification-actions.js +15 -6
- package/dist/features/admin/api/bids/route.js +1 -1
- package/dist/features/admin/api/coupons/route.js +1 -1
- package/dist/features/admin/api/products/route.js +1 -1
- package/dist/features/admin/api/reviews/route.js +1 -1
- package/dist/features/admin/components/AdminAdEditorView.js +19 -5
- package/dist/features/admin/components/AdminAuditLogView.js +1 -1
- package/dist/features/admin/components/AdminBlogEditorView.js +0 -1
- package/dist/features/admin/components/AdminBlogView.js +1 -1
- package/dist/features/admin/components/AdminBrandsView.js +17 -1
- package/dist/features/admin/components/AdminCategoryEditorView.js +0 -1
- package/dist/features/admin/components/AdminContactView.js +1 -1
- package/dist/features/admin/components/AdminEmployeeEditorView.js +1 -3
- package/dist/features/admin/components/AdminNewsletterView.js +1 -1
- package/dist/features/admin/components/AdminOrdersView.js +9 -2
- package/dist/features/admin/components/AdminPayoutsView.js +1 -1
- package/dist/features/admin/components/AdminPrizeDrawsView.js +11 -0
- package/dist/features/admin/components/AdminProductEditorView.d.ts +10 -1
- package/dist/features/admin/components/AdminProductEditorView.js +24 -37
- package/dist/features/admin/components/AdminProductsView.js +10 -3
- package/dist/features/admin/components/AdminScammersView.js +1 -1
- package/dist/features/admin/components/AdminSectionsView.js +21 -5
- package/dist/features/admin/components/AdminSessionsView.js +1 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +22 -1
- package/dist/features/admin/components/AdminTeamView.js +1 -1
- package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +0 -1
- package/dist/features/admin/components/AdminUsersView.js +1 -1
- package/dist/features/admin/components/DataListingView.d.ts +2 -1
- package/dist/features/admin/components/DataListingView.js +9 -4
- package/dist/features/admin/components/analytics/AdminPageViewsReportView.js +0 -2
- package/dist/features/admin/hooks/useAdminListing.d.ts +1 -1
- package/dist/features/admin/repository/site-settings.repository.js +8 -3
- package/dist/features/admin/schemas/firestore.d.ts +62 -1
- package/dist/features/admin/schemas/firestore.js +32 -0
- package/dist/features/admin/types/index.d.ts +1 -1
- package/dist/features/auctions/actions/bid-actions.d.ts +2 -2
- package/dist/features/auctions/actions/bid-actions.js +16 -4
- package/dist/features/auctions/api/route.js +1 -1
- package/dist/features/auctions/components/AuctionBottomActions.js +4 -0
- package/dist/features/auctions/repository/bid.repository.d.ts +46 -4
- package/dist/features/auctions/repository/bid.repository.js +114 -13
- package/dist/features/auctions/schemas/firestore.d.ts +24 -4
- package/dist/features/auctions/schemas/firestore.js +1 -0
- package/dist/features/auth/actions/profile-actions.js +30 -4
- package/dist/features/auth/components/index.d.ts +0 -1
- package/dist/features/auth/components/index.js +0 -1
- package/dist/features/auth/repository/session.repository.d.ts +17 -3
- package/dist/features/auth/repository/session.repository.js +46 -5
- package/dist/features/auth/repository/token.repository.d.ts +27 -4
- package/dist/features/auth/repository/token.repository.js +65 -11
- package/dist/features/auth/repository/user.repository.d.ts +33 -7
- package/dist/features/auth/repository/user.repository.js +100 -15
- package/dist/features/auth/schemas/firestore.d.ts +63 -12
- package/dist/features/auth/schemas/firestore.js +11 -0
- package/dist/features/before-after/api/route.js +1 -1
- package/dist/features/blog/components/BlogListView.js +16 -3
- package/dist/features/blog/components/BlogPostView.js +1 -1
- package/dist/features/blog/schemas/index.d.ts +2 -2
- package/dist/features/cart/api/route.js +1 -1
- package/dist/features/catalogue/repository/catalogue.repository.d.ts +7 -7
- package/dist/features/catalogue/repository/catalogue.repository.js +28 -10
- package/dist/features/catalogue/schemas/firestore.d.ts +11 -0
- package/dist/features/categories/api/route.js +10 -10
- package/dist/features/categories/components/CategoryDetailPageView.js +35 -5
- package/dist/features/categories/components/CategorySelectorCreate.js +0 -1
- package/dist/features/categories/components/index.d.ts +0 -2
- package/dist/features/categories/components/index.js +0 -1
- package/dist/features/categories/repository/categories.repository.d.ts +1 -0
- package/dist/features/categories/repository/categories.repository.js +31 -1
- package/dist/features/categories/schemas/index.d.ts +2 -2
- package/dist/features/categories/utils/taxonomy-visual.d.ts +21 -0
- package/dist/features/categories/utils/taxonomy-visual.js +58 -0
- package/dist/features/checkout/actions/checkout-value-otp-actions.js +8 -1
- package/dist/features/collections/api/[slug]/route.js +3 -3
- package/dist/features/collections/api/route.js +1 -1
- package/dist/features/consultation/api/route.js +1 -1
- package/dist/features/consultation/repository/consultations.repository.js +1 -1
- package/dist/features/consultation/types/index.d.ts +1 -1
- package/dist/features/contact/components/ContactForm.js +1 -3
- package/dist/features/corporate/api/route.js +1 -1
- package/dist/features/corporate/repository/corporate.repository.js +1 -1
- package/dist/features/corporate/types/index.d.ts +1 -1
- package/dist/features/cron/jobs/auction-expiry.job.js +1 -1
- package/dist/features/cron/jobs/preorder-reminder.job.js +1 -1
- package/dist/features/events/actions/event-actions.d.ts +14 -0
- package/dist/features/events/actions/event-actions.js +82 -3
- package/dist/features/events/api/[id]/route.js +2 -2
- package/dist/features/events/components/AdminEventEditorView.js +22 -3
- package/dist/features/events/components/AdminEventsView.js +32 -8
- package/dist/features/events/components/EventRafflesSection.d.ts +34 -1
- package/dist/features/events/components/EventRafflesSection.js +52 -3
- package/dist/features/events/components/SpinWheelView.d.ts +2 -2
- package/dist/features/events/components/SpinWheelView.js +41 -4
- package/dist/features/events/repository/event-entry.repository.d.ts +14 -2
- package/dist/features/events/repository/event-entry.repository.js +41 -7
- package/dist/features/events/schemas/firestore.d.ts +17 -4
- package/dist/features/events/types/index.d.ts +37 -0
- package/dist/features/faq/repository/faqs.repository.js +1 -1
- package/dist/features/faq/schemas/index.d.ts +5 -2
- package/dist/features/faq/schemas/index.js +6 -0
- package/dist/features/faq/types/index.d.ts +0 -1
- package/dist/features/grouped/components/GroupedListingEditorView.js +17 -2
- package/dist/features/homepage/api/carousel/[id]/route.js +1 -1
- package/dist/features/homepage/api/carousel/route.js +4 -4
- package/dist/features/homepage/api/route.js +2 -2
- package/dist/features/homepage/api/sections/route.js +1 -1
- package/dist/features/homepage/components/AnnouncementBar.d.ts +1 -9
- package/dist/features/homepage/components/AnnouncementBar.js +13 -19
- package/dist/features/homepage/components/MarketplaceHomepageView.js +6 -1
- package/dist/features/homepage/components/index.d.ts +0 -2
- package/dist/features/homepage/components/index.js +0 -1
- package/dist/features/homepage/repository/homepage.repository.js +1 -1
- package/dist/features/homepage/schemas/firestore.d.ts +6 -0
- package/dist/features/homepage/schemas/index.d.ts +10 -10
- package/dist/features/layout/AppLayoutShell.d.ts +11 -0
- package/dist/features/layout/AppLayoutShell.js +64 -12
- package/dist/features/layout/BottomActionsContext.d.ts +16 -0
- package/dist/features/layout/BottomActionsContext.js +5 -0
- package/dist/features/layout/BottomChrome.js +48 -9
- package/dist/features/layout/BottomNavbar.d.ts +14 -0
- package/dist/features/layout/BottomNavbar.js +43 -3
- package/dist/features/layout/MainNavbar.d.ts +11 -0
- package/dist/features/layout/NavbarLayout.d.ts +3 -0
- package/dist/features/layout/NavbarLayout.js +88 -11
- package/dist/features/layout/SideActionDock.d.ts +1 -0
- package/dist/features/layout/SideActionDock.js +219 -0
- package/dist/features/layout/TitleBarLayout.js +1 -1
- package/dist/features/layout/cta-anchor.d.ts +31 -0
- package/dist/features/layout/cta-anchor.js +31 -0
- package/dist/features/layout/hooks/useBottomActions.d.ts +7 -0
- package/dist/features/layout/hooks/useBottomActions.js +6 -1
- package/dist/features/layout/index.d.ts +9 -1
- package/dist/features/layout/index.js +9 -1
- package/dist/features/layout/useCtaReveal.d.ts +24 -0
- package/dist/features/layout/useCtaReveal.js +82 -0
- package/dist/features/layout/useHoldToOpen.d.ts +41 -0
- package/dist/features/layout/useHoldToOpen.js +84 -0
- package/dist/features/lottery/repository/lottery-entry.repository.d.ts +18 -3
- package/dist/features/lottery/repository/lottery-entry.repository.js +48 -6
- package/dist/features/lottery/schemas/firestore.d.ts +33 -5
- package/dist/features/loyalty/api/balance/route.js +1 -1
- package/dist/features/loyalty/api/history/route.js +1 -1
- package/dist/features/media/MediaImage.js +0 -1
- package/dist/features/media/MediaPickerModal.js +7 -1
- package/dist/features/media/modals/ImageEditor.js +5 -1
- package/dist/features/media/modals/VideoThumbnailSelector.js +17 -1
- package/dist/features/media/repository/media-assets.repository.d.ts +19 -0
- package/dist/features/media/upload/CameraCapture.js +16 -1
- package/dist/features/media/upload/ImageUpload.js +42 -4
- package/dist/features/media/upload/MediaUploadField.js +69 -13
- package/dist/features/media/upload/downscale-image.d.ts +56 -0
- package/dist/features/media/upload/downscale-image.js +150 -0
- package/dist/features/messages/components/ConversationThreadView.js +45 -2
- package/dist/features/messages/components/MessageSellerButton.d.ts +15 -1
- package/dist/features/messages/components/MessageSellerButton.js +10 -2
- package/dist/features/messages/schemas/firestore.d.ts +15 -0
- package/dist/features/orders/hooks/useOrders.js +4 -2
- package/dist/features/orders/repository/orders.repository.d.ts +15 -4
- package/dist/features/orders/repository/orders.repository.js +52 -20
- package/dist/features/orders/schemas/firestore.d.ts +15 -4
- package/dist/features/orders/schemas/index.d.ts +8 -8
- package/dist/features/orders/types/index.d.ts +2 -2
- package/dist/features/payments/repository/payments.repository.js +2 -2
- package/dist/features/payments/repository/payout.repository.d.ts +23 -6
- package/dist/features/payments/repository/payout.repository.js +63 -23
- package/dist/features/payments/repository/saved-payment-methods.repository.d.ts +17 -6
- package/dist/features/payments/repository/saved-payment-methods.repository.js +59 -11
- package/dist/features/payments/schemas/firestore.d.ts +14 -3
- package/dist/features/payments/schemas/saved-methods-firestore.d.ts +12 -1
- package/dist/features/pre-orders/api/[slug]/route.js +1 -1
- package/dist/features/pre-orders/api/admin/route.js +1 -1
- package/dist/features/pre-orders/api/route.js +1 -1
- package/dist/features/pre-orders/repository/pre-orders.repository.d.ts +3 -3
- package/dist/features/pre-orders/repository/pre-orders.repository.js +6 -6
- package/dist/features/products/api/[id]/route.js +1 -1
- package/dist/features/products/components/ListingBottomActions.js +4 -0
- package/dist/features/products/components/ProductDetailPageView.js +2 -1
- package/dist/features/products/components/ProductGalleryClient.js +2 -2
- package/dist/features/products/components/ProductGrid.js +12 -1
- package/dist/features/products/components/index.d.ts +0 -2
- package/dist/features/products/components/index.js +0 -1
- package/dist/features/products/config/listing-type-listing-config.d.ts +0 -3
- package/dist/features/products/config/listing-type-listing-config.js +27 -2
- package/dist/features/products/constants/listing-tabs.d.ts +9 -0
- package/dist/features/products/constants/listing-tabs.js +3 -2
- package/dist/features/products/hooks/useProducts.js +2 -2
- package/dist/features/products/repository/products.repository.js +13 -1
- package/dist/features/products/schemas/index.d.ts +2 -2
- package/dist/features/products/types/index.d.ts +1 -1
- package/dist/features/promotions/api/route.js +1 -1
- package/dist/features/reviews/actions/review-actions.d.ts +6 -6
- package/dist/features/reviews/actions/review-actions.js +22 -8
- package/dist/features/reviews/components/ReviewDetailPageView.js +13 -1
- package/dist/features/reviews/components/ReviewsIndexPageView.js +21 -4
- package/dist/features/reviews/repository/reviews.repository.d.ts +19 -7
- package/dist/features/reviews/repository/reviews.repository.js +63 -12
- package/dist/features/reviews/schemas/firestore.d.ts +13 -2
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/scams/actions/scam-actions.js +16 -4
- package/dist/features/search/components/SearchResultsPageView.js +2 -1
- package/dist/features/search/hooks/useSearchIndex.d.ts +34 -0
- package/dist/features/search/hooks/useSearchIndex.js +172 -0
- package/dist/features/search/repository/search.repository.js +2 -2
- package/dist/features/seller/actions/offer-actions.d.ts +5 -5
- package/dist/features/seller/actions/offer-actions.js +38 -8
- package/dist/features/seller/actions/seller-actions.js +34 -7
- package/dist/features/seller/api/coupons/route.js +1 -1
- package/dist/features/seller/api/products/route.js +1 -1
- package/dist/features/seller/api/store/route.js +1 -1
- package/dist/features/seller/components/SellerBidsView.js +1 -1
- package/dist/features/seller/components/SellerCouponsView.js +1 -1
- package/dist/features/seller/components/SellerListingTypeView.js +9 -1
- package/dist/features/seller/components/SellerOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +0 -1
- package/dist/features/seller/components/SellerPayoutsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.js +0 -1
- package/dist/features/seller/components/SellerProductsView.js +1 -1
- package/dist/features/seller/components/SellerShippingView.js +0 -1
- package/dist/features/seller/components/SellerStorefrontView.js +0 -1
- package/dist/features/seller/components/index.d.ts +0 -4
- package/dist/features/seller/components/index.js +0 -2
- package/dist/features/seller/repository/offer.repository.d.ts +15 -3
- package/dist/features/seller/repository/offer.repository.js +43 -7
- package/dist/features/seller/schemas/firestore.d.ts +14 -3
- package/dist/features/seller/schemas/index.d.ts +4 -4
- package/dist/features/seller/schemas/order-forms.d.ts +39 -0
- package/dist/features/seller/schemas/order-forms.js +37 -0
- package/dist/features/shell/FormShell.js +6 -2
- package/dist/features/shell/QuickFormDrawer.js +15 -1
- package/dist/features/shipments/components/AdminShipmentEditorView.js +0 -1
- package/dist/features/shipments/components/AdminShipmentsView.js +1 -1
- package/dist/features/sticker-trace/components/StickerCommitPanel.d.ts +30 -0
- package/dist/features/sticker-trace/components/StickerCommitPanel.js +93 -0
- package/dist/features/sticker-trace/components/StickerPrintPanel.d.ts +33 -0
- package/dist/features/sticker-trace/components/StickerPrintPanel.js +104 -0
- package/dist/features/sticker-trace/components/StickerRetryPanel.d.ts +20 -0
- package/dist/features/sticker-trace/components/StickerRetryPanel.js +128 -0
- package/dist/features/sticker-trace/components/StickerRunHistoryPanel.d.ts +45 -0
- package/dist/features/sticker-trace/components/StickerRunHistoryPanel.js +84 -0
- package/dist/features/sticker-trace/components/StickerTraceStudio.d.ts +27 -0
- package/dist/features/sticker-trace/components/StickerTraceStudio.js +171 -0
- package/dist/features/sticker-trace/constants/help-content.d.ts +23 -0
- package/dist/features/sticker-trace/constants/help-content.js +172 -0
- package/dist/features/sticker-trace/hooks/useLiveTrace.d.ts +27 -0
- package/dist/features/sticker-trace/hooks/useLiveTrace.js +160 -0
- package/dist/features/sticker-trace/hooks/useStickerTraceProgress.d.ts +22 -0
- package/dist/features/sticker-trace/hooks/useStickerTraceProgress.js +106 -0
- package/dist/features/sticker-trace/repository/sticker-sheets.repository.d.ts +113 -0
- package/dist/features/sticker-trace/repository/sticker-sheets.repository.js +146 -0
- package/dist/features/sticker-trace/repository/sticker-trace-runs.repository.d.ts +132 -0
- package/dist/features/sticker-trace/repository/sticker-trace-runs.repository.js +174 -0
- package/dist/features/sticker-trace/schemas/firestore.d.ts +248 -0
- package/dist/features/sticker-trace/schemas/firestore.js +79 -0
- package/dist/features/sticker-trace/server.d.ts +8 -0
- package/dist/features/sticker-trace/server.js +51 -0
- package/dist/features/stores/actions/store-query-actions.d.ts +2 -2
- package/dist/features/stores/actions/store-query-actions.js +7 -2
- package/dist/features/stores/api/[storeSlug]/auctions/route.js +3 -3
- package/dist/features/stores/api/[storeSlug]/products/route.js +3 -3
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +1 -1
- package/dist/features/stores/api/[storeSlug]/route.js +1 -1
- package/dist/features/stores/components/StoreNavTabs.js +17 -2
- package/dist/features/stores/manifest.js +8 -4
- package/dist/features/support/repository/support.repository.d.ts +14 -3
- package/dist/features/support/repository/support.repository.js +93 -13
- package/dist/features/support/schemas/firestore.d.ts +16 -5
- package/dist/features/tester/seed-data/authored/admin__events-raffles-spin.js +61 -19
- package/dist/features/tester/seed-data/authored/buying__browsing-search.js +19 -3
- package/dist/features/tester/seed-data/authored/content-discovery__authenticity-checker.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__authenticity-checker.js +243 -0
- package/dist/features/tester/seed-data/authored/content-discovery__events.js +36 -10
- package/dist/features/tester/seed-data/authored/content-discovery__overflowing-pill-rows.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__overflowing-pill-rows.js +209 -0
- package/dist/features/tester/seed-data/authored/design-ux__header-brand-mark-centring.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/design-ux__header-brand-mark-centring.js +90 -0
- package/dist/features/tester/seed-data/authored/index.js +8 -0
- package/dist/features/tester/seed-data/authored/selling__media-limits.js +19 -17
- package/dist/features/tester/seed-data/authored/selling__product-upload-details.js +10 -5
- package/dist/features/tester/seed-data/authored/tools__sticker-tracer.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/tools__sticker-tracer.js +283 -0
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +192 -22
- package/dist/index.d.ts +10 -23
- package/dist/index.js +27 -19
- package/dist/next/api/routeHandler.js +9 -0
- package/dist/next/routing/require-record.d.ts +13 -0
- package/dist/next/routing/require-record.js +62 -0
- package/dist/next/routing/route-map.d.ts +4 -4
- package/dist/next/routing/route-map.js +25 -3
- package/dist/providers/db-firebase/base.d.ts +4 -2
- package/dist/providers/db-firebase/base.js +21 -5
- package/dist/providers/db-firebase/base.repository.d.ts +11 -9
- package/dist/providers/db-firebase/base.repository.js +19 -0
- package/dist/providers/db-firebase/rtdb-paths.d.ts +12 -0
- package/dist/providers/db-firebase/rtdb-paths.js +12 -0
- package/dist/react/ErrorBoundary.js +6 -1
- package/dist/react/hooks/realtime-event-constants.d.ts +1 -0
- package/dist/react/hooks/realtime-event-constants.js +8 -0
- package/dist/react/hooks/useEntityDelete.js +5 -1
- package/dist/react/hooks/useMessage.js +5 -1
- package/dist/repositories/index.d.ts +2 -2
- package/dist/repositories/index.js +6 -1
- package/dist/schemas/registry.d.ts +13 -20
- package/dist/schemas/registry.js +31 -14
- package/dist/schemas/webhooks/google-oauth.d.ts +2 -2
- package/dist/security/encrypted.d.ts +117 -0
- package/dist/security/encrypted.js +100 -0
- package/dist/security/index.d.ts +5 -2
- package/dist/security/index.js +16 -2
- package/dist/security/pii-accessors.d.ts +71 -0
- package/dist/security/pii-accessors.js +150 -0
- package/dist/security/pii-encrypt.d.ts +0 -8
- package/dist/security/pii-encrypt.js +22 -15
- package/dist/security/pii-mask.d.ts +18 -0
- package/dist/security/pii-mask.js +27 -0
- package/dist/seed/_helpers/search-txt-wrappers.d.ts +6 -6
- package/dist/seed/_helpers/search-txt-wrappers.js +22 -0
- package/dist/seed/addresses-seed-data.d.ts +2 -2
- package/dist/seed/authenticity-knowledge-seed-data.d.ts +34 -0
- package/dist/seed/authenticity-knowledge-seed-data.js +1277 -0
- package/dist/seed/bids-seed-data.d.ts +2 -2
- package/dist/seed/bids-seed-data.js +23 -2
- package/dist/seed/events-seed-data.d.ts +2 -2
- package/dist/seed/events-seed-data.js +5 -0
- package/dist/seed/faq-seed-data.js +175 -5
- package/dist/seed/homepage-sections-seed-data.js +39 -23
- package/dist/seed/index.d.ts +1 -0
- package/dist/seed/index.js +1 -0
- package/dist/seed/lottery-entries-seed-data.d.ts +2 -2
- package/dist/seed/offers-seed-data.d.ts +2 -2
- package/dist/seed/offers-seed-data.js +1 -1
- package/dist/seed/orders-seed-data.d.ts +2 -2
- package/dist/seed/payouts-seed-data.d.ts +2 -2
- package/dist/seed/payouts-seed-data.js +1 -1
- package/dist/seed/reviews-seed-data.d.ts +1 -2
- package/dist/seed/seed-purpose.js +7 -0
- package/dist/seed/sessions-seed-data.d.ts +2 -2
- package/dist/seed/sessions-seed-data.js +5 -0
- package/dist/seed/site-settings-seed-data.js +1 -1
- package/dist/seed/support-tickets-seed-data.d.ts +2 -2
- package/dist/seed/support-tickets-seed-data.js +1 -1
- package/dist/seed/users-seed-data.d.ts +2 -2
- package/dist/seed/users-seed-data.js +1 -1
- package/dist/seo/json-ld.js +5 -1
- package/dist/server.d.ts +18 -3
- package/dist/server.js +59 -3
- package/dist/styles.css +237 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Button.js +7 -1
- package/dist/ui/components/FilterChipGroup.d.ts +11 -0
- package/dist/ui/components/FilterChipGroup.js +1 -1
- package/dist/ui/components/ImageGallery.js +6 -1
- package/dist/ui/components/ListingLayout.js +14 -8
- package/dist/ui/components/OverflowRow.d.ts +92 -0
- package/dist/ui/components/OverflowRow.js +203 -0
- package/dist/ui/components/OverflowRow.style.css +235 -0
- package/dist/ui/components/RecordDetailModal.js +14 -1
- package/dist/ui/components/RowActionMenu.js +5 -1
- package/dist/ui/components/SideDrawer.js +5 -1
- package/dist/ui/components/SideModal.js +9 -1
- package/dist/ui/components/TabBarShell.d.ts +12 -1
- package/dist/ui/components/TabBarShell.js +3 -2
- package/dist/ui/components/Tabs.js +36 -24
- package/dist/ui/components/Toast.d.ts +3 -24
- package/dist/ui/components/Toast.js +2 -19
- package/dist/ui/components/TopBannerPortal.d.ts +15 -0
- package/dist/ui/components/TopBannerPortal.js +19 -0
- package/dist/ui/components/UnsavedChangesModal.js +5 -1
- package/dist/ui/components/index.style.css +1 -0
- package/dist/ui/components/row-collapse.d.ts +15 -0
- package/dist/ui/components/row-collapse.js +127 -0
- package/dist/ui/components/toast-context.d.ts +63 -0
- package/dist/ui/components/toast-context.js +48 -0
- package/dist/ui/components/top-banner-slot.d.ts +37 -0
- package/dist/ui/components/top-banner-slot.js +45 -0
- package/dist/ui/icons/icon-registry.d.ts +6 -0
- package/dist/ui/icons/icon-registry.js +17 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -0
- package/dist/utils/array.helper.d.ts +2 -2
- package/dist/utils/array.helper.js +5 -5
- package/dist/utils/id-generators.d.ts +6 -0
- package/dist/utils/id-generators.js +10 -0
- package/dist/utils/media-url.js +0 -2
- package/dist/utils/search-txt-builders.d.ts +28 -4
- package/dist/utils/search-txt-builders.js +41 -1
- package/dist/validation/schemas.d.ts +8 -8
- package/package.json +6 -2
- package/scripts/seed-cli.mjs +3 -0
- package/dist/features/account/components/UserAddressesView.d.ts +0 -13
- package/dist/features/account/components/UserAddressesView.js +0 -5
- package/dist/features/account/components/UserNotificationsView.d.ts +0 -15
- package/dist/features/account/components/UserNotificationsView.js +0 -12
- package/dist/features/account/components/UserSettingsView.d.ts +0 -16
- package/dist/features/account/components/UserSettingsView.js +0 -13
- package/dist/features/account/components/UserSupportView.d.ts +0 -3
- package/dist/features/account/components/UserSupportView.js +0 -166
- package/dist/features/admin/components/DemoSeedView.d.ts +0 -11
- package/dist/features/admin/components/DemoSeedView.js +0 -5
- package/dist/features/auth/components/AuthStatusPanel.d.ts +0 -10
- package/dist/features/auth/components/AuthStatusPanel.js +0 -22
- package/dist/features/categories/components/CategoryProductsView.d.ts +0 -45
- package/dist/features/categories/components/CategoryProductsView.js +0 -21
- package/dist/features/homepage/components/HowItWorksInfoView.d.ts +0 -36
- package/dist/features/homepage/components/HowItWorksInfoView.js +0 -10
- package/dist/features/layout/BottomActions.d.ts +0 -1
- package/dist/features/layout/BottomActions.js +0 -311
- package/dist/features/products/components/ProductsView.d.ts +0 -6
- package/dist/features/products/components/ProductsView.js +0 -5
- package/dist/features/seller/components/SellerStoreView.d.ts +0 -8
- package/dist/features/seller/components/SellerStoreView.js +0 -8
|
@@ -7,7 +7,11 @@ import { Button } from "./Button.js";
|
|
|
7
7
|
import { ActionRow } from "./ActionRow.js";
|
|
8
8
|
import { Row } from "./Layout.js";
|
|
9
9
|
import { Heading, Span } from "./Typography.js";
|
|
10
|
-
|
|
10
|
+
// Defining modules, not the sibling barrel — Root Cause #18. `ui/index.ts` and
|
|
11
|
+
// `react/index.ts` re-exported into each other, which is the whole of
|
|
12
|
+
// `audit-import-cycles` component 1: an 18-module knot held together entirely
|
|
13
|
+
// by barrel hops, none of which needed the barrel.
|
|
14
|
+
import { useSwipe } from "../../react/hooks/useSwipe.js";
|
|
11
15
|
import { Text } from "./Typography.js";
|
|
12
16
|
import { SPRING_SNAPPY } from "../../tokens/motion.js";
|
|
13
17
|
import { useHandMode } from "../../_internal/client/hand-mode/index.js";
|
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { motion, AnimatePresence, useReducedMotion } from "motion/react";
|
|
5
|
-
|
|
5
|
+
/*
|
|
6
|
+
* 🛑 This was `from ".."` — a component importing its own barrel, which is the
|
|
7
|
+
* tightest possible cycle: `ui/index.ts` exports `SideModal`, so the module
|
|
8
|
+
* depended on the file that depends on it. Nothing needed the barrel; all
|
|
9
|
+
* three symbols are one directory away.
|
|
10
|
+
*/
|
|
11
|
+
import { Button } from "./Button.js";
|
|
12
|
+
import { Div } from "./Div.js";
|
|
13
|
+
import { Heading } from "./Typography.js";
|
|
6
14
|
import { ActionRow } from "./ActionRow.js";
|
|
7
15
|
import { SPRING_SNAPPY } from "../../tokens/motion.js";
|
|
8
16
|
import { useHandMode } from "../../_internal/client/hand-mode/index.js";
|
|
@@ -25,6 +25,17 @@ export interface TabBarShellProps {
|
|
|
25
25
|
* and the arrows work regardless.
|
|
26
26
|
*/
|
|
27
27
|
activeKey?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional external ref onto the `role="tablist"` element itself.
|
|
30
|
+
*
|
|
31
|
+
* Exists so a caller can MEASURE the real tab row without wrapping
|
|
32
|
+
* `{children}` in a box of its own — a wrapper between the tablist and its
|
|
33
|
+
* tabs breaks the accessibility tree, since a `role="tablist"` may only
|
|
34
|
+
* contain `role="tab"` elements. `TabsList` uses this to decide whether the
|
|
35
|
+
* row fits; the shell keeps driving its own scroll arrows from the same
|
|
36
|
+
* node.
|
|
37
|
+
*/
|
|
38
|
+
listRef?: React.RefObject<HTMLDivElement | null>;
|
|
28
39
|
children?: React.ReactNode;
|
|
29
40
|
}
|
|
30
41
|
/**
|
|
@@ -34,7 +45,7 @@ export interface TabBarShellProps {
|
|
|
34
45
|
* -tree children stay exactly the `role="tab"` elements — no `aria-owns`, no
|
|
35
46
|
* invalid-child warnings.
|
|
36
47
|
*/
|
|
37
|
-
export declare function TabBarShell({ className, ariaLabel, leading, activeKey, children, }: TabBarShellProps): React.JSX.Element;
|
|
48
|
+
export declare function TabBarShell({ className, ariaLabel, leading, activeKey, listRef: externalListRef, children, }: TabBarShellProps): React.JSX.Element;
|
|
38
49
|
export interface TabBarButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "role" | "aria-selected"> {
|
|
39
50
|
selected: boolean;
|
|
40
51
|
}
|
|
@@ -44,8 +44,9 @@ const UI_TAB_BAR = {
|
|
|
44
44
|
* -tree children stay exactly the `role="tab"` elements — no `aria-owns`, no
|
|
45
45
|
* invalid-child warnings.
|
|
46
46
|
*/
|
|
47
|
-
export function TabBarShell({ className = "", ariaLabel = "Tabs", leading, activeKey = "", children, }) {
|
|
48
|
-
const
|
|
47
|
+
export function TabBarShell({ className = "", ariaLabel = "Tabs", leading, activeKey = "", listRef: externalListRef, children, }) {
|
|
48
|
+
const internalListRef = useRef(null);
|
|
49
|
+
const listRef = externalListRef ?? internalListRef;
|
|
49
50
|
const { hasArrows, atStart, atEnd, scrollByPage } = useTabsOverflow(listRef, activeKey);
|
|
50
51
|
/*
|
|
51
52
|
* The arrows are aria-hidden + tabIndex={-1} deliberately. They duplicate
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React, { createContext, useContext, useMemo, useState } from "react";
|
|
4
|
-
import { TabBarShell
|
|
3
|
+
import React, { createContext, useContext, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { TabBarShell } from "./TabBarShell.js";
|
|
5
|
+
import { OverflowRow } from "./OverflowRow.js";
|
|
6
|
+
import { useRowCollapse } from "./row-collapse.js";
|
|
5
7
|
const UI_TABS = {
|
|
6
8
|
trigger: "appkit-tabs-trigger",
|
|
7
9
|
content: "appkit-tabs-content",
|
|
8
10
|
badge: "appkit-tabs-trigger__badge",
|
|
9
11
|
};
|
|
10
|
-
/** Past this many items, TabsList renders a dropdown instead of a horizontal
|
|
11
|
-
* row — a scrollable row of 6+ tabs is unreadable/unreachable on mobile
|
|
12
|
-
* widths.
|
|
13
|
-
*
|
|
14
|
-
* The dropdown is styled as NAVIGATION, not as a form field: see
|
|
15
|
-
* `TabsNavSelect` and the `.appkit-tabs-dropdown` rules in Tabs.style.css. It
|
|
16
|
-
* used to render a raw `<Select bare>`, which carried the full
|
|
17
|
-
* `.appkit-select__trigger` input chrome (bordered, rounded, surface-filled,
|
|
18
|
-
* 40px tall) — which is exactly why a tab bar read as an input. */
|
|
19
|
-
const TABS_DROPDOWN_THRESHOLD = 5;
|
|
20
12
|
const TabsContext = createContext({
|
|
21
13
|
active: "",
|
|
22
14
|
setActive: () => { },
|
|
@@ -37,20 +29,40 @@ export function Tabs({ defaultValue = "", value, onChange, className = "", child
|
|
|
37
29
|
}
|
|
38
30
|
export function TabsList({ className = "", children }) {
|
|
39
31
|
const { active, setActive } = useContext(TabsContext);
|
|
32
|
+
const shellRef = useRef(null);
|
|
33
|
+
const rowRef = useRef(null);
|
|
40
34
|
const items = React.Children.toArray(children).filter((child) => React.isValidElement(child));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
/*
|
|
36
|
+
* The collapsed label must be PLAIN TEXT: `children` may render a badge
|
|
37
|
+
* pill, and a ReactNode cannot be searched, measured as a signature, or put
|
|
38
|
+
* in an option's accessible name. `label` is the explicit escape hatch for
|
|
39
|
+
* that case; `value` is the last resort.
|
|
40
|
+
*/
|
|
41
|
+
const overflowItems = items.map((item) => ({
|
|
42
|
+
id: item.props.value,
|
|
43
|
+
label: item.props.label ??
|
|
44
|
+
(typeof item.props.children === "string" ? item.props.children : item.props.value),
|
|
45
|
+
count: item.props.badge,
|
|
46
|
+
disabled: item.props.disabled,
|
|
47
|
+
onSelect: () => setActive(item.props.value),
|
|
48
|
+
}));
|
|
49
|
+
const signature = overflowItems.map((i) => `${i.id}:${i.label}:${i.count ?? ""}`).join("|");
|
|
50
|
+
const collapsed = useRowCollapse(shellRef, rowRef, signature);
|
|
51
|
+
/*
|
|
52
|
+
* Collapsed renders `OverflowRow` in its already-collapsed state rather than
|
|
53
|
+
* the old `TabsNavSelect`, which was a native `<select>` — so the collapsed
|
|
54
|
+
* tab bar is now SEARCHABLE and keyboard-navigable. That matters most
|
|
55
|
+
* exactly where it collapses: a 30-tab bar on a phone was a 30-row native
|
|
56
|
+
* picker with no way to type at it.
|
|
57
|
+
*
|
|
58
|
+
* The EXPANDED state deliberately stays `TabBarShell`, so the underline rail
|
|
59
|
+
* every tab surface in the app shares is untouched. Only the overflow
|
|
60
|
+
* behaviour changed, never the resting appearance.
|
|
61
|
+
*/
|
|
62
|
+
if (collapsed) {
|
|
63
|
+
return (_jsx("div", { ref: shellRef, className: className, children: _jsx(OverflowRow, { items: overflowItems, ariaLabel: "Tabs", activeId: active, alwaysCollapsed: true, searchPlaceholder: "Search tabs\u2026" }) }));
|
|
52
64
|
}
|
|
53
|
-
return (_jsx(TabBarShell, { className: className, ariaLabel: "Tabs", activeKey: active, children: children }));
|
|
65
|
+
return (_jsx("div", { ref: shellRef, children: _jsx(TabBarShell, { className: className, ariaLabel: "Tabs", activeKey: active, listRef: rowRef, children: children }) }));
|
|
54
66
|
}
|
|
55
67
|
export function TabsTrigger({ value, disabled, className = "", children, badge, }) {
|
|
56
68
|
const { active, setActive } = useContext(TabsContext);
|
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Show a toast. Returns the `dismissId` so long-running ops can later finalize
|
|
7
|
-
* via `updateToast(id, "success" | "error", finalMessage)`. For the "loading"
|
|
8
|
-
* variant pass `duration: 0` to keep it pinned until finalized.
|
|
9
|
-
*/
|
|
10
|
-
showToast: (message: string, variant?: ToastVariant, duration?: number, action?: {
|
|
11
|
-
label: string;
|
|
12
|
-
onClick: () => void;
|
|
13
|
-
}) => string;
|
|
14
|
-
hideToast: (id: string) => void;
|
|
15
|
-
/** Replace an existing toast's variant + message (used to finalize loading toasts). */
|
|
16
|
-
updateToast: (id: string, variant: ToastVariant, message?: string, duration?: number) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare function useToast(): ToastContextValue;
|
|
19
|
-
/**
|
|
20
|
-
* Like `useToast` but returns `undefined` when no `ToastProvider` is mounted
|
|
21
|
-
* instead of throwing. Use in primitives (e.g. `Button`) that must be safe to
|
|
22
|
-
* render outside a toast context.
|
|
23
|
-
*/
|
|
24
|
-
export declare function useToastSafe(): ToastContextValue | undefined;
|
|
2
|
+
import { type ToastPosition } from "./toast-context";
|
|
3
|
+
export type { ToastVariant, ToastPosition, ToastItem, ToastContextValue, } from "./toast-context";
|
|
4
|
+
export { useToast, useToastSafe } from "./toast-context";
|
|
25
5
|
export interface ToastProviderProps {
|
|
26
6
|
children: React.ReactNode;
|
|
27
7
|
position?: ToastPosition;
|
|
28
8
|
}
|
|
29
9
|
export declare function ToastProvider({ children, position, }: ToastProviderProps): React.JSX.Element;
|
|
30
|
-
export {};
|
|
@@ -4,26 +4,9 @@ import React from "react";
|
|
|
4
4
|
import { motion, AnimatePresence, useReducedMotion } from "motion/react";
|
|
5
5
|
import { Button } from "./Button.js";
|
|
6
6
|
import { Text } from "./Typography.js";
|
|
7
|
+
import { ToastContext, buildToastId, } from "./toast-context.js";
|
|
7
8
|
import { SPRING_SNAPPY } from "../../tokens/motion.js";
|
|
8
|
-
|
|
9
|
-
function buildToastId() {
|
|
10
|
-
return `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
11
|
-
}
|
|
12
|
-
export function useToast() {
|
|
13
|
-
const context = React.useContext(ToastContext);
|
|
14
|
-
if (!context) {
|
|
15
|
-
throw new Error("useToast must be used within ToastProvider");
|
|
16
|
-
}
|
|
17
|
-
return context;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Like `useToast` but returns `undefined` when no `ToastProvider` is mounted
|
|
21
|
-
* instead of throwing. Use in primitives (e.g. `Button`) that must be safe to
|
|
22
|
-
* render outside a toast context.
|
|
23
|
-
*/
|
|
24
|
-
export function useToastSafe() {
|
|
25
|
-
return React.useContext(ToastContext);
|
|
26
|
-
}
|
|
9
|
+
export { useToast, useToastSafe } from "./toast-context.js";
|
|
27
10
|
const UI_TOAST = {
|
|
28
11
|
container: "appkit-toast-container",
|
|
29
12
|
positions: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TopBannerPortalProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Renders `children` into the layout's top-banner slot — the band above the
|
|
7
|
+
* sticky header. See `top-banner-slot.ts` for why that slot exists and why it
|
|
8
|
+
* sits outside the measured header wrapper.
|
|
9
|
+
*
|
|
10
|
+
* Renders nothing until the slot resolves after mount. That is not a loading
|
|
11
|
+
* state to paper over: the banner is dismissible and server-rendering it into
|
|
12
|
+
* a layout that may already have a dismissal recorded would flash it at someone
|
|
13
|
+
* who closed it last week.
|
|
14
|
+
*/
|
|
15
|
+
export declare function TopBannerPortal({ children }: TopBannerPortalProps): React.ReactPortal | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { useTopBannerSlot } from "./top-banner-slot.js";
|
|
4
|
+
/**
|
|
5
|
+
* Renders `children` into the layout's top-banner slot — the band above the
|
|
6
|
+
* sticky header. See `top-banner-slot.ts` for why that slot exists and why it
|
|
7
|
+
* sits outside the measured header wrapper.
|
|
8
|
+
*
|
|
9
|
+
* Renders nothing until the slot resolves after mount. That is not a loading
|
|
10
|
+
* state to paper over: the banner is dismissible and server-rendering it into
|
|
11
|
+
* a layout that may already have a dismissal recorded would flash it at someone
|
|
12
|
+
* who closed it last week.
|
|
13
|
+
*/
|
|
14
|
+
export function TopBannerPortal({ children }) {
|
|
15
|
+
const slot = useTopBannerSlot();
|
|
16
|
+
if (!slot)
|
|
17
|
+
return null;
|
|
18
|
+
return createPortal(children, slot);
|
|
19
|
+
}
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { eventBus } from "../../core/EventBus.js";
|
|
5
|
-
|
|
5
|
+
// Defining modules, not the sibling barrel — Root Cause #18. `ui/index.ts` and
|
|
6
|
+
// `react/index.ts` re-exported into each other, which is the whole of
|
|
7
|
+
// `audit-import-cycles` component 1: an 18-module knot held together entirely
|
|
8
|
+
// by barrel hops, none of which needed the barrel.
|
|
9
|
+
import { UNSAVED_CHANGES_EVENT } from "../../react/hooks/useUnsavedChanges.js";
|
|
6
10
|
import { Button } from "./Button.js";
|
|
7
11
|
import { Card } from "./Card.js";
|
|
8
12
|
import { Heading, Text } from "./Typography.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface UseRowCollapseOptions {
|
|
2
|
+
/** Skip measurement entirely and pin the result. */
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
/** Start collapsed. The server never measures, so this must match the SSR markup. */
|
|
5
|
+
initial?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* True when `rowRef`'s content is wider than `shellRef`'s box.
|
|
9
|
+
*
|
|
10
|
+
* `signature` must change whenever the row's content changes (item ids,
|
|
11
|
+
* labels, counts). A new item set has a different natural width, so the
|
|
12
|
+
* cached one becomes a lie and has to be discarded — without this a row that
|
|
13
|
+
* grew from 3 items to 30 would stay expanded against a stale measurement.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useRowCollapse(shellRef: React.RefObject<HTMLElement | null>, rowRef: React.RefObject<HTMLElement | null>, signature: string, { disabled, initial }?: UseRowCollapseOptions): boolean;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*
|
|
3
|
+
* WHY: Deciding "does this row fit" by COUNTING items is wrong in both
|
|
4
|
+
* directions, and this codebase shipped that mistake for a long time:
|
|
5
|
+
* `TabsList` collapsed past five tabs, so four long labels still
|
|
6
|
+
* overflowed a phone and eight short ones collapsed a desktop that had
|
|
7
|
+
* room to spare. Width is the only input that answers the question.
|
|
8
|
+
*
|
|
9
|
+
* The hard part is that collapsing DESTROYS the evidence. Once the row is
|
|
10
|
+
* replaced by a trigger there is no row left to measure, so a naive
|
|
11
|
+
* implementation can never expand again on a wider viewport — it is a
|
|
12
|
+
* one-way door. This caches the row's natural width while it is still
|
|
13
|
+
* rendered, which is what makes the decision reversible.
|
|
14
|
+
*
|
|
15
|
+
* WHAT: Measures whether a row's content is wider than its container, and
|
|
16
|
+
* stays correct across resizes in BOTH directions. Consumed by
|
|
17
|
+
* <OverflowRow> and <TabsList>.
|
|
18
|
+
*
|
|
19
|
+
* EXPORTS: useRowCollapse
|
|
20
|
+
*
|
|
21
|
+
* @tag domain:ui
|
|
22
|
+
* @tag layer:ui
|
|
23
|
+
* @tag pattern:hook
|
|
24
|
+
* @tag access:client
|
|
25
|
+
* @tag consumers:OverflowRow,TabsList
|
|
26
|
+
* @tag sideEffects:dom-measurement
|
|
27
|
+
*/
|
|
28
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
29
|
+
/** Sub-pixel tolerance — scrollWidth/clientWidth differ by <1px at some zoom levels. */
|
|
30
|
+
const EPSILON = 1;
|
|
31
|
+
/**
|
|
32
|
+
* Extra room required to EXPAND again, in px.
|
|
33
|
+
*
|
|
34
|
+
* 🛑 Deliberately not symmetric with the collapse threshold, and must not be
|
|
35
|
+
* made so. Collapsing removes the row, so the only width left to compare
|
|
36
|
+
* against is the cached natural width — which makes the two states adjacent:
|
|
37
|
+
* at exactly the boundary the row collapses, the shell reflows a few px wider
|
|
38
|
+
* without the row's own padding, the cached width now "fits", it expands, the
|
|
39
|
+
* padding returns, it overflows, it collapses… forever.
|
|
40
|
+
*
|
|
41
|
+
* Requiring a clear margin to come back makes the rule provably stable. This
|
|
42
|
+
* is the same hysteresis `tabs-overflow.ts` needs for its in-flow arrows, for
|
|
43
|
+
* the same underlying reason.
|
|
44
|
+
*/
|
|
45
|
+
const EXPAND_SLACK_PX = 48;
|
|
46
|
+
/**
|
|
47
|
+
* True when `rowRef`'s content is wider than `shellRef`'s box.
|
|
48
|
+
*
|
|
49
|
+
* `signature` must change whenever the row's content changes (item ids,
|
|
50
|
+
* labels, counts). A new item set has a different natural width, so the
|
|
51
|
+
* cached one becomes a lie and has to be discarded — without this a row that
|
|
52
|
+
* grew from 3 items to 30 would stay expanded against a stale measurement.
|
|
53
|
+
*/
|
|
54
|
+
export function useRowCollapse(shellRef, rowRef, signature, { disabled = false, initial = false } = {}) {
|
|
55
|
+
// Starts at `initial` and can only change inside an effect, so the server
|
|
56
|
+
// HTML and the first client render always agree.
|
|
57
|
+
const [collapsed, setCollapsed] = useState(initial);
|
|
58
|
+
const naturalWidthRef = useRef(null);
|
|
59
|
+
const lastSignatureRef = useRef(signature);
|
|
60
|
+
if (lastSignatureRef.current !== signature) {
|
|
61
|
+
lastSignatureRef.current = signature;
|
|
62
|
+
naturalWidthRef.current = null;
|
|
63
|
+
}
|
|
64
|
+
const measure = useCallback(() => {
|
|
65
|
+
if (disabled)
|
|
66
|
+
return;
|
|
67
|
+
const shell = shellRef.current;
|
|
68
|
+
if (!shell)
|
|
69
|
+
return;
|
|
70
|
+
const available = shell.clientWidth;
|
|
71
|
+
// A zero-width container means "not laid out yet" (display:none, a closed
|
|
72
|
+
// drawer). Measuring it would collapse every row on the page.
|
|
73
|
+
if (available <= 0)
|
|
74
|
+
return;
|
|
75
|
+
const row = rowRef.current;
|
|
76
|
+
if (row) {
|
|
77
|
+
const natural = row.scrollWidth;
|
|
78
|
+
naturalWidthRef.current = natural;
|
|
79
|
+
if (natural > available + EPSILON)
|
|
80
|
+
setCollapsed(true);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
// Collapsed: the row is gone. The cached width is the only evidence of
|
|
84
|
+
// what expanding would cost.
|
|
85
|
+
const natural = naturalWidthRef.current;
|
|
86
|
+
if (natural == null)
|
|
87
|
+
return;
|
|
88
|
+
if (available >= natural + EXPAND_SLACK_PX)
|
|
89
|
+
setCollapsed(false);
|
|
90
|
+
}, [disabled, shellRef, rowRef]);
|
|
91
|
+
/*
|
|
92
|
+
* Content width — a count appearing, a locale swapping every label.
|
|
93
|
+
* Dependency-free so it runs after every render: none of those is
|
|
94
|
+
* expressible as a dep, and a ResizeObserver on the shell fires for its own
|
|
95
|
+
* box, never for its content. Safe because `measure` only calls setState on
|
|
96
|
+
* an actual change, so there is no render loop. Two layout READS per render,
|
|
97
|
+
* no writes, so no forced reflow.
|
|
98
|
+
*/
|
|
99
|
+
useLayoutEffect(() => {
|
|
100
|
+
measure();
|
|
101
|
+
});
|
|
102
|
+
// Container width: viewport resize, sidebar collapse, drawer open.
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
const shell = shellRef.current;
|
|
105
|
+
// jsdom does not implement ResizeObserver; guard so the hook is safe in
|
|
106
|
+
// any non-DOM runtime.
|
|
107
|
+
if (!shell || typeof ResizeObserver === "undefined")
|
|
108
|
+
return;
|
|
109
|
+
const observer = new ResizeObserver(() => measure());
|
|
110
|
+
observer.observe(shell);
|
|
111
|
+
return () => observer.disconnect();
|
|
112
|
+
}, [shellRef, measure]);
|
|
113
|
+
// A web-font swap changes every label's width after first paint; without
|
|
114
|
+
// this the initial measurement is taken against the fallback font.
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
let cancelled = false;
|
|
117
|
+
const fonts = document.fonts;
|
|
118
|
+
fonts?.ready?.then(() => {
|
|
119
|
+
if (!cancelled)
|
|
120
|
+
measure();
|
|
121
|
+
});
|
|
122
|
+
return () => {
|
|
123
|
+
cancelled = true;
|
|
124
|
+
};
|
|
125
|
+
}, [measure]);
|
|
126
|
+
return disabled ? initial : collapsed;
|
|
127
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The toast CONTEXT, split out of `Toast.tsx`.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this module exists
|
|
5
|
+
*
|
|
6
|
+
* `Button` reads `useToastSafe()` so a `<Button action={…}>` with a
|
|
7
|
+
* confirmation can report the outcome, and `Toast` renders a `<Button>` as its
|
|
8
|
+
* dismiss control. Both edges are real VALUE imports, so `Button.tsx` and
|
|
9
|
+
* `Toast.tsx` formed a genuine two-module import cycle — not a type-only one
|
|
10
|
+
* that the compiler erases. `audit-import-cycles` carried it as component 3.
|
|
11
|
+
*
|
|
12
|
+
* A cycle between two primitives is worse than untidy: module initialisation
|
|
13
|
+
* order becomes whichever one the bundler happens to reach first, so a future
|
|
14
|
+
* top-level `const` in either file could read the other's export before it is
|
|
15
|
+
* initialised. Splitting the context out gives both a single direction to
|
|
16
|
+
* depend in — `Button → toast-context` and `Toast → toast-context + Button`.
|
|
17
|
+
*
|
|
18
|
+
* 🛑 `"use client"` must stay the FIRST line: this file creates a React
|
|
19
|
+
* context and exports hooks, and without the directive Next treats it as a
|
|
20
|
+
* Server Component and the recovery render crashes (Root Cause #12).
|
|
21
|
+
*
|
|
22
|
+
* 🛑 ONE `createContext` call, in this file only. The provider and both hooks
|
|
23
|
+
* must resolve to the same object or `useContext` reads an empty context —
|
|
24
|
+
* which is the dual-instance failure mode of Root Cause #19, reachable here by
|
|
25
|
+
* copy-paste rather than by a duplicated package.
|
|
26
|
+
*/
|
|
27
|
+
import React from "react";
|
|
28
|
+
export type ToastVariant = "success" | "error" | "warning" | "info" | "loading";
|
|
29
|
+
export type ToastPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left" | "top-center" | "bottom-center";
|
|
30
|
+
export interface ToastItem {
|
|
31
|
+
id: string;
|
|
32
|
+
message: string;
|
|
33
|
+
variant: ToastVariant;
|
|
34
|
+
duration: number;
|
|
35
|
+
action?: {
|
|
36
|
+
label: string;
|
|
37
|
+
onClick: () => void;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface ToastContextValue {
|
|
41
|
+
/**
|
|
42
|
+
* Show a toast. Returns the `dismissId` so long-running ops can later finalize
|
|
43
|
+
* via `updateToast(id, "success" | "error", finalMessage)`. For the "loading"
|
|
44
|
+
* variant pass `duration: 0` to keep it pinned until finalized.
|
|
45
|
+
*/
|
|
46
|
+
showToast: (message: string, variant?: ToastVariant, duration?: number, action?: {
|
|
47
|
+
label: string;
|
|
48
|
+
onClick: () => void;
|
|
49
|
+
}) => string;
|
|
50
|
+
hideToast: (id: string) => void;
|
|
51
|
+
/** Replace an existing toast's variant + message (used to finalize loading toasts). */
|
|
52
|
+
updateToast: (id: string, variant: ToastVariant, message?: string, duration?: number) => void;
|
|
53
|
+
}
|
|
54
|
+
export declare const ToastContext: React.Context<ToastContextValue | undefined>;
|
|
55
|
+
export declare function buildToastId(): string;
|
|
56
|
+
export declare function useToast(): ToastContextValue;
|
|
57
|
+
/**
|
|
58
|
+
* Like `useToast` but returns `undefined` when no `ToastProvider` is mounted
|
|
59
|
+
* instead of throwing. Use in primitives (e.g. `Button`) that must be safe to
|
|
60
|
+
* render outside a toast context — library code that adjusts for its
|
|
61
|
+
* surroundings must not require a provider (Root Cause #20).
|
|
62
|
+
*/
|
|
63
|
+
export declare function useToastSafe(): ToastContextValue | undefined;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* The toast CONTEXT, split out of `Toast.tsx`.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this module exists
|
|
6
|
+
*
|
|
7
|
+
* `Button` reads `useToastSafe()` so a `<Button action={…}>` with a
|
|
8
|
+
* confirmation can report the outcome, and `Toast` renders a `<Button>` as its
|
|
9
|
+
* dismiss control. Both edges are real VALUE imports, so `Button.tsx` and
|
|
10
|
+
* `Toast.tsx` formed a genuine two-module import cycle — not a type-only one
|
|
11
|
+
* that the compiler erases. `audit-import-cycles` carried it as component 3.
|
|
12
|
+
*
|
|
13
|
+
* A cycle between two primitives is worse than untidy: module initialisation
|
|
14
|
+
* order becomes whichever one the bundler happens to reach first, so a future
|
|
15
|
+
* top-level `const` in either file could read the other's export before it is
|
|
16
|
+
* initialised. Splitting the context out gives both a single direction to
|
|
17
|
+
* depend in — `Button → toast-context` and `Toast → toast-context + Button`.
|
|
18
|
+
*
|
|
19
|
+
* 🛑 `"use client"` must stay the FIRST line: this file creates a React
|
|
20
|
+
* context and exports hooks, and without the directive Next treats it as a
|
|
21
|
+
* Server Component and the recovery render crashes (Root Cause #12).
|
|
22
|
+
*
|
|
23
|
+
* 🛑 ONE `createContext` call, in this file only. The provider and both hooks
|
|
24
|
+
* must resolve to the same object or `useContext` reads an empty context —
|
|
25
|
+
* which is the dual-instance failure mode of Root Cause #19, reachable here by
|
|
26
|
+
* copy-paste rather than by a duplicated package.
|
|
27
|
+
*/
|
|
28
|
+
import React from "react";
|
|
29
|
+
export const ToastContext = React.createContext(undefined);
|
|
30
|
+
export function buildToastId() {
|
|
31
|
+
return `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
32
|
+
}
|
|
33
|
+
export function useToast() {
|
|
34
|
+
const context = React.useContext(ToastContext);
|
|
35
|
+
if (!context) {
|
|
36
|
+
throw new Error("useToast must be used within ToastProvider");
|
|
37
|
+
}
|
|
38
|
+
return context;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Like `useToast` but returns `undefined` when no `ToastProvider` is mounted
|
|
42
|
+
* instead of throwing. Use in primitives (e.g. `Button`) that must be safe to
|
|
43
|
+
* render outside a toast context — library code that adjusts for its
|
|
44
|
+
* surroundings must not require a provider (Root Cause #20).
|
|
45
|
+
*/
|
|
46
|
+
export function useToastSafe() {
|
|
47
|
+
return React.useContext(ToastContext);
|
|
48
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The portal target ABOVE the sticky header, published by `AppLayoutShell`.
|
|
3
|
+
*
|
|
4
|
+
* This is the page's topmost band: a dismissible announcement or promo strip
|
|
5
|
+
* that a PAGE owns but that must render above the title bar, which only the
|
|
6
|
+
* layout can place. A page cannot render into the layout's header by returning
|
|
7
|
+
* JSX, so it portals here instead.
|
|
8
|
+
*
|
|
9
|
+
* ── 🛑 Why this exists rather than an `overlay` prop ───────────────────────
|
|
10
|
+
*
|
|
11
|
+
* `AnnouncementBar` used to take `overlay`, which positioned it `absolute
|
|
12
|
+
* inset-x-0 top-0` over the homepage's first section. That reserves no space
|
|
13
|
+
* by design, so the banner painted ON TOP of the hero — the whole reason the
|
|
14
|
+
* component carried a measured-overlap comment about phone widths. Moving it
|
|
15
|
+
* into the real document flow above the header removes the overlap as a class
|
|
16
|
+
* of bug rather than tuning the breakpoint it happens at.
|
|
17
|
+
*
|
|
18
|
+
* ── 🛑 The slot is deliberately OUTSIDE the sticky wrapper ────────────────
|
|
19
|
+
*
|
|
20
|
+
* `AppLayoutShell` measures its sticky header into `--header-height`, and every
|
|
21
|
+
* `StickyToolbar offset="header"` in the app reads that. A banner placed inside
|
|
22
|
+
* that wrapper would inflate the number for as long as it is on screen and
|
|
23
|
+
* shrink it the moment someone dismisses it — so every sticky toolbar on the
|
|
24
|
+
* page would jump. Outside the wrapper, the banner scrolls away with the page,
|
|
25
|
+
* `--header-height` never changes, and dismissal costs no relayout below.
|
|
26
|
+
*
|
|
27
|
+
* Lives in `ui/` for the same reason as `bottom-chrome-slot`: `features/layout`
|
|
28
|
+
* imports from `ui`, so the reverse would close an import cycle through the
|
|
29
|
+
* `ui` barrel. Nothing here imports anything but React.
|
|
30
|
+
*/
|
|
31
|
+
export declare const TOP_BANNER_SLOT_ID = "appkit-top-banner-slot";
|
|
32
|
+
/**
|
|
33
|
+
* Resolves the top-banner portal target. Returns `null` until after mount, so a
|
|
34
|
+
* consumer never touches the DOM during render — render nothing while it is
|
|
35
|
+
* null, and portal into it once it resolves.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useTopBannerSlot(): HTMLElement | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The portal target ABOVE the sticky header, published by `AppLayoutShell`.
|
|
5
|
+
*
|
|
6
|
+
* This is the page's topmost band: a dismissible announcement or promo strip
|
|
7
|
+
* that a PAGE owns but that must render above the title bar, which only the
|
|
8
|
+
* layout can place. A page cannot render into the layout's header by returning
|
|
9
|
+
* JSX, so it portals here instead.
|
|
10
|
+
*
|
|
11
|
+
* ── 🛑 Why this exists rather than an `overlay` prop ───────────────────────
|
|
12
|
+
*
|
|
13
|
+
* `AnnouncementBar` used to take `overlay`, which positioned it `absolute
|
|
14
|
+
* inset-x-0 top-0` over the homepage's first section. That reserves no space
|
|
15
|
+
* by design, so the banner painted ON TOP of the hero — the whole reason the
|
|
16
|
+
* component carried a measured-overlap comment about phone widths. Moving it
|
|
17
|
+
* into the real document flow above the header removes the overlap as a class
|
|
18
|
+
* of bug rather than tuning the breakpoint it happens at.
|
|
19
|
+
*
|
|
20
|
+
* ── 🛑 The slot is deliberately OUTSIDE the sticky wrapper ────────────────
|
|
21
|
+
*
|
|
22
|
+
* `AppLayoutShell` measures its sticky header into `--header-height`, and every
|
|
23
|
+
* `StickyToolbar offset="header"` in the app reads that. A banner placed inside
|
|
24
|
+
* that wrapper would inflate the number for as long as it is on screen and
|
|
25
|
+
* shrink it the moment someone dismisses it — so every sticky toolbar on the
|
|
26
|
+
* page would jump. Outside the wrapper, the banner scrolls away with the page,
|
|
27
|
+
* `--header-height` never changes, and dismissal costs no relayout below.
|
|
28
|
+
*
|
|
29
|
+
* Lives in `ui/` for the same reason as `bottom-chrome-slot`: `features/layout`
|
|
30
|
+
* imports from `ui`, so the reverse would close an import cycle through the
|
|
31
|
+
* `ui` barrel. Nothing here imports anything but React.
|
|
32
|
+
*/
|
|
33
|
+
export const TOP_BANNER_SLOT_ID = "appkit-top-banner-slot";
|
|
34
|
+
/**
|
|
35
|
+
* Resolves the top-banner portal target. Returns `null` until after mount, so a
|
|
36
|
+
* consumer never touches the DOM during render — render nothing while it is
|
|
37
|
+
* null, and portal into it once it resolves.
|
|
38
|
+
*/
|
|
39
|
+
export function useTopBannerSlot() {
|
|
40
|
+
const [slot, setSlot] = useState(null);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setSlot(document.getElementById(TOP_BANNER_SLOT_ID));
|
|
43
|
+
}, []);
|
|
44
|
+
return slot;
|
|
45
|
+
}
|
|
@@ -58,6 +58,12 @@ export declare const ICONS: {
|
|
|
58
58
|
readonly themeLight: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
59
59
|
readonly themeDark: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
60
60
|
readonly deals: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
61
|
+
readonly preOrder: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
62
|
+
readonly prizeDraw: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
63
|
+
readonly digitalCode: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
64
|
+
readonly art: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
65
|
+
readonly stickers: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
66
|
+
readonly live: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
61
67
|
};
|
|
62
68
|
/** Every valid `iconKey`. A typo is a compile error, not a silent blank. */
|
|
63
69
|
export type IconKey = keyof typeof ICONS;
|