@mohasinac/appkit 4.52.4 โ 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 +12 -3
- package/dist/features/layout/AppLayoutShell.js +65 -13
- 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.d.ts +1 -3
- package/dist/features/layout/TitleBarLayout.js +3 -4
- 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/design-ux__header-controls-and-messages.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/design-ux__header-controls-and-messages.js +85 -0
- package/dist/features/tester/seed-data/authored/index.js +10 -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 +235 -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
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/*
|
|
4
|
+
* WHY: The studio tunes a scan entirely in the tab โ no upload, no Storage
|
|
5
|
+
* object, no Function invocation. That is the whole reason the codec is a
|
|
6
|
+
* port. This is the deliberate moment the operator decides those
|
|
7
|
+
* parameters are worth spending quota on.
|
|
8
|
+
* WHAT: Name the attempt, pick a real tier, upload the scan, start the run.
|
|
9
|
+
*
|
|
10
|
+
* ๐ THE NAME IS MANDATORY AND THE BUTTON STAYS DISABLED WITHOUT ONE. The
|
|
11
|
+
* server rejects an empty name and so does this; the requirement is that every
|
|
12
|
+
* attempt is something you can tell apart from the other seven later, and
|
|
13
|
+
* "Untitled (3)" defeats it exactly when it matters.
|
|
14
|
+
*
|
|
15
|
+
* ๐ The tier here is NOT the studio's. The studio is draft-only because it
|
|
16
|
+
* runs on the main thread and draft's 1200px cap is what keeps a trace near a
|
|
17
|
+
* second. A committed run is a server run, so the heavy tiers become available
|
|
18
|
+
* for the first time โ which is the point of committing at all.
|
|
19
|
+
*
|
|
20
|
+
* ๐ The upload is three hops and the ROW IS CREATED FIRST. The object path
|
|
21
|
+
* contains the sheet id, so a signed upload before the row exists has nowhere
|
|
22
|
+
* to go โ and an object with no document pointing at it is unreachable AND
|
|
23
|
+
* unmeterable. See `createStickerSheet` for the full argument.
|
|
24
|
+
*
|
|
25
|
+
* EXPORTS: StickerCommitPanel, StickerCommitResult
|
|
26
|
+
*
|
|
27
|
+
* @tag domain:sticker-trace
|
|
28
|
+
* @tag layer:feature
|
|
29
|
+
* @tag pattern:none
|
|
30
|
+
* @tag access:client
|
|
31
|
+
* @tag consumers:tools/sticker-tracer
|
|
32
|
+
* @tag sideEffects:none
|
|
33
|
+
*/
|
|
34
|
+
import { useCallback, useMemo, useState } from "react";
|
|
35
|
+
import { normalizeError } from "../../../errors/normalize.js";
|
|
36
|
+
import { Alert, Button, Card, Form, Heading, Stack, Text } from "../../../ui/index.js";
|
|
37
|
+
import { FieldInput } from "../../../ui/forms/FieldInput.js";
|
|
38
|
+
import { FieldSelect } from "../../../ui/forms/FieldSelect.js";
|
|
39
|
+
import { TIER_HELP } from "../constants/help-content.js";
|
|
40
|
+
/** Every tier, unlike the studio โ see the header. */
|
|
41
|
+
const TIERS = ["draft", "standard", "precise", "max"];
|
|
42
|
+
export function StickerCommitPanel({ file, dimensions, onCommit, onCommitted, }) {
|
|
43
|
+
const [title, setTitle] = useState("");
|
|
44
|
+
const [tier, setTier] = useState("standard");
|
|
45
|
+
const [pending, setPending] = useState(false);
|
|
46
|
+
const [error, setError] = useState(null);
|
|
47
|
+
/*
|
|
48
|
+
* The file's size in MB, shown rather than hidden. A scan is stored AS
|
|
49
|
+
* UPLOADED โ no re-encode, because compression artefacts measured the same
|
|
50
|
+
* magnitude as the cut-line signal on the halftone sample โ so what an
|
|
51
|
+
* operator picks here is what the storage meter will report forever.
|
|
52
|
+
*/
|
|
53
|
+
const sizeMb = useMemo(() => (file ? Math.round((file.size / (1024 * 1024)) * 10) / 10 : 0), [file]);
|
|
54
|
+
const ready = Boolean(file && dimensions && title.trim().length > 0 && !pending);
|
|
55
|
+
const submit = useCallback(async () => {
|
|
56
|
+
if (!file || !dimensions)
|
|
57
|
+
return;
|
|
58
|
+
setPending(true);
|
|
59
|
+
setError(null);
|
|
60
|
+
try {
|
|
61
|
+
const result = await onCommit({
|
|
62
|
+
file,
|
|
63
|
+
title: title.trim(),
|
|
64
|
+
tier,
|
|
65
|
+
widthPx: dimensions.widthPx,
|
|
66
|
+
heightPx: dimensions.heightPx,
|
|
67
|
+
});
|
|
68
|
+
onCommitted?.(result);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
const n = normalizeError(err);
|
|
72
|
+
/*
|
|
73
|
+
* normalizeError FIRST โ the project-wide rule, and the explanation goes
|
|
74
|
+
* after the call rather than between it and the catch, because
|
|
75
|
+
* audit-catch-normalize checks the first STATEMENT and a long comment in
|
|
76
|
+
* between pushes the call outside its window.
|
|
77
|
+
*
|
|
78
|
+
* The message reaches an admin uploading their own scan, so the real text
|
|
79
|
+
* is useful here. Root Cause #86 is about SERVER internals reaching a
|
|
80
|
+
* buyer, which this is not โ and the routes already map their own
|
|
81
|
+
* failures to user-safe text.
|
|
82
|
+
*/
|
|
83
|
+
setError(n.message);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
setPending(false);
|
|
87
|
+
}
|
|
88
|
+
}, [file, dimensions, title, tier, onCommit, onCommitted]);
|
|
89
|
+
if (!file) {
|
|
90
|
+
return (_jsx(Card, { variant: "default", children: _jsx(Text, { color: "muted", children: "Pick a scan and tune it above. Nothing is uploaded until you commit a run \u2014 the trace you are watching runs entirely in this tab." }) }));
|
|
91
|
+
}
|
|
92
|
+
return (_jsx(Card, { variant: "default", children: _jsx(Form, { onSubmit: (e) => e.preventDefault(), children: _jsxs(Stack, { gap: "comfortable", children: [_jsx(Heading, { level: 3, children: "Commit this as a run" }), _jsxs(Text, { size: "sm", color: "muted", children: ["Uploads ", _jsx(Text, { as: "span", weight: "semibold", children: file.name }), " (", sizeMb, " MB) and traces it at full resolution on the server. The parameters you tuned above are the starting point; a run keeps its own copy, so later edits here never change what an earlier run recorded."] }), error ? _jsx(Alert, { variant: "error", children: error }) : null, _jsx(FieldInput, { name: "title", label: "Name this sheet", required: true, value: title, onChange: setTitle }), _jsx(Text, { size: "xs", color: "muted", children: "Required \u2014 nothing processes without one. Name it so you recognise it next to the others: \u201CDriger G, matte scan 600dpi\u201D." }), _jsx(FieldSelect, { name: "tier", label: "Tier", value: tier, options: TIERS.map((t) => ({ value: t, label: TIER_HELP[t].title })), onChange: (v) => setTier(v) }), _jsx(Text, { size: "xs", color: "muted", children: TIER_HELP[tier].body }), tier === "max" ? (_jsx(Alert, { variant: "warning", children: "Max is expensive in both time and quota, and its finer simplify can push a busy sheet past Design Space's node ceiling. Try precise first unless a halftone scan is merging two stickers." })) : null, !dimensions ? (_jsx(Text, { size: "xs", color: "muted", children: "Waiting for the scan to finish decoding\u2026" })) : null, _jsx(Button, { type: "submit", variant: "primary", isLoading: pending, disabled: !ready, onClick: submit, children: pending ? "Uploading and startingโฆ" : "Upload and run" })] }) }) }));
|
|
93
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Mirrors the export route's response. Kept structural โ no appkit internals. */
|
|
2
|
+
export interface ExportReport {
|
|
3
|
+
unfit: Array<{
|
|
4
|
+
ordinal: number;
|
|
5
|
+
name: string;
|
|
6
|
+
widthMm: number;
|
|
7
|
+
heightMm: number;
|
|
8
|
+
verdict: {
|
|
9
|
+
reasons: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
unplaceable: Array<{
|
|
13
|
+
ordinal: number;
|
|
14
|
+
name: string;
|
|
15
|
+
}>;
|
|
16
|
+
nodesBefore: number;
|
|
17
|
+
nodesAfter: number;
|
|
18
|
+
maxDeviationMm: number;
|
|
19
|
+
overBudget: boolean;
|
|
20
|
+
pageCount: number;
|
|
21
|
+
}
|
|
22
|
+
export interface StickerPrintPanelProps {
|
|
23
|
+
/** Fetches the report for a profile/page pair. Injected โ appkit owns no transport. */
|
|
24
|
+
loadReport: (profile: string, page: string) => Promise<{
|
|
25
|
+
report: ExportReport;
|
|
26
|
+
refusedReason: string | null;
|
|
27
|
+
}>;
|
|
28
|
+
/** Resolve and open the cut file's signed URL. */
|
|
29
|
+
onDownloadCutFile?: () => void;
|
|
30
|
+
/** Resolve and open the PDF mosaic. */
|
|
31
|
+
onDownloadMosaic?: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function StickerPrintPanel({ loadReport, onDownloadCutFile, onDownloadMosaic, }: StickerPrintPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/*
|
|
4
|
+
* WHY: Every irreversible thing about an export is decided before the file is
|
|
5
|
+
* produced โ which machine, which page, and which parts that machine
|
|
6
|
+
* simply cannot cut. Those answers exist in the export report and had
|
|
7
|
+
* nowhere to be shown, so the only way to discover a part was too wide
|
|
8
|
+
* was to cut it and watch it run off the material.
|
|
9
|
+
* WHAT: Pick a profile and a page, see what will actually happen, then export.
|
|
10
|
+
*
|
|
11
|
+
* ๐ IT SHOWS THE REFUSALS BEFORE THE DOWNLOAD, and that ordering is the whole
|
|
12
|
+
* design. An oversized part is NAMED here โ never scaled to fit, because a
|
|
13
|
+
* scaled part produces a cut file that looks correct and yields stickers the
|
|
14
|
+
* wrong physical size, which is only discoverable against the real object.
|
|
15
|
+
*
|
|
16
|
+
* ๐ The preview fetches a REPORT, never the file. The whole point is trying
|
|
17
|
+
* three machines and two pages before committing, and each of those would
|
|
18
|
+
* otherwise be a few hundred KB of SVG through a Vercel function โ the egress
|
|
19
|
+
* shape `audit-sticker-trace-egress` exists to refuse. The bytes come from a
|
|
20
|
+
* signed GCS URL only once, when the operator actually exports.
|
|
21
|
+
*
|
|
22
|
+
* EXPORTS: StickerPrintPanel
|
|
23
|
+
*
|
|
24
|
+
* @tag domain:sticker-trace
|
|
25
|
+
* @tag layer:feature
|
|
26
|
+
* @tag pattern:none
|
|
27
|
+
* @tag access:client
|
|
28
|
+
* @tag consumers:tools/sticker-tracer
|
|
29
|
+
* @tag sideEffects:none
|
|
30
|
+
*/
|
|
31
|
+
import { useCallback, useEffect, useState } from "react";
|
|
32
|
+
import { normalizeError } from "../../../errors/normalize.js";
|
|
33
|
+
import { Alert, Badge, Button, Card, Heading, Row, Span, Stack, Text, } from "../../../ui/index.js";
|
|
34
|
+
import { FieldSelect } from "../../../ui/forms/FieldSelect.js";
|
|
35
|
+
const PROFILES = [
|
|
36
|
+
{ value: "print-shop", label: "Print shop (Roland / Graphtec)" },
|
|
37
|
+
{ value: "cricut-cut", label: "Cricut Joy 2 โ cut only" },
|
|
38
|
+
{ value: "cricut-ptc", label: "Cricut Joy 2 โ Print Then Cut" },
|
|
39
|
+
];
|
|
40
|
+
const PAGES = [
|
|
41
|
+
{ value: "a4", label: "A4" },
|
|
42
|
+
{ value: "a3", label: "A3" },
|
|
43
|
+
{ value: "a5", label: "A5" },
|
|
44
|
+
{ value: "letter", label: "Letter" },
|
|
45
|
+
{ value: "legal", label: "Legal" },
|
|
46
|
+
{ value: "tabloid", label: "Tabloid" },
|
|
47
|
+
{ value: "joy-mat-standard", label: 'Joy mat 4.5 ร 6.5"' },
|
|
48
|
+
{ value: "joy-mat-long", label: 'Joy mat 4.5 ร 12"' },
|
|
49
|
+
{ value: "joy-mat-card", label: 'Joy card mat 4.5 ร 6.25"' },
|
|
50
|
+
{ value: "joy-smart-material", label: 'Joy Smart Material 4.5 ร 48"' },
|
|
51
|
+
];
|
|
52
|
+
/*
|
|
53
|
+
* The report, rendered.
|
|
54
|
+
*
|
|
55
|
+
* ๐ NOT exported. It was, "so the retry and review surfaces can reuse it" โ
|
|
56
|
+
* which is a consumer that does not exist, and audit-orphan-view-component
|
|
57
|
+
* caught it as reachable only through a barrel. Split out for readability
|
|
58
|
+
* inside this file; export it the day something actually imports it.
|
|
59
|
+
*/
|
|
60
|
+
function ExportReportView({ report }) {
|
|
61
|
+
return (_jsxs(Stack, { gap: "dense", children: [_jsxs(Row, { gap: "sm", wrap: true, align: "center", children: [_jsxs(Badge, { variant: "info", children: [report.pageCount, " page", report.pageCount === 1 ? "" : "s"] }), _jsxs(Badge, { variant: report.overBudget ? "danger" : "success", children: [report.nodesAfter.toLocaleString(), " nodes"] }), report.maxDeviationMm > 0 ? (_jsxs(Badge, { variant: "warning", children: ["\u00B1", report.maxDeviationMm, "mm"] })) : null] }), report.nodesAfter < report.nodesBefore ? (_jsxs(Text, { size: "sm", color: "muted", children: ["Simplified from ", report.nodesBefore.toLocaleString(), " nodes to fit this machine's budget. Worst-case deviation from the traced outline:", " ", _jsxs(Span, { weight: "semibold", children: [report.maxDeviationMm, "mm"] }), "."] })) : null, report.overBudget ? (_jsx(Alert, { variant: "error", children: "Still over this machine's node budget after simplification. Design Space may refuse to open the file \u2014 try the print-shop profile, which has no ceiling, or split the sheet." })) : null, report.unfit.length > 0 ? (_jsx(Alert, { variant: "warning", children: _jsxs(Stack, { gap: "dense", children: [_jsxs(Text, { weight: "semibold", children: [report.unfit.length, " part", report.unfit.length === 1 ? "" : "s", " this machine cannot cut:"] }), report.unfit.map((u) => (_jsxs(Text, { size: "sm", children: [_jsx(Span, { weight: "semibold", children: u.name }), " (", u.widthMm.toFixed(1), " \u00D7 ", u.heightMm.toFixed(1), "mm) \u2014", " ", u.verdict.reasons.join(" ")] }, u.ordinal)))] }) })) : null, report.unplaceable.length > 0 ? (_jsxs(Alert, { variant: "warning", children: [report.unplaceable.length, " part", report.unplaceable.length === 1 ? "" : "s", " would not fit on this page at any rotation:", " ", report.unplaceable.map((u) => u.name).join(", "), ". A larger page, or the print-shop profile, will take them."] })) : null] }));
|
|
62
|
+
}
|
|
63
|
+
export function StickerPrintPanel({ loadReport, onDownloadCutFile, onDownloadMosaic, }) {
|
|
64
|
+
const [profile, setProfile] = useState("print-shop");
|
|
65
|
+
const [page, setPage] = useState("a4");
|
|
66
|
+
const [report, setReport] = useState(null);
|
|
67
|
+
const [refusedReason, setRefusedReason] = useState(null);
|
|
68
|
+
const [loading, setLoading] = useState(false);
|
|
69
|
+
const [error, setError] = useState(null);
|
|
70
|
+
const refresh = useCallback(async () => {
|
|
71
|
+
setLoading(true);
|
|
72
|
+
setError(null);
|
|
73
|
+
try {
|
|
74
|
+
const res = await loadReport(profile, page);
|
|
75
|
+
setReport(res.report);
|
|
76
|
+
setRefusedReason(res.refusedReason);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
const n = normalizeError(err);
|
|
80
|
+
/*
|
|
81
|
+
* Kept distinct from `refusedReason`. A refusal is a true answer about
|
|
82
|
+
* this sheet โ "no confirmed DPI" โ while this is the request failing.
|
|
83
|
+
* Rendering both the same way would have an operator confirming a DPI to
|
|
84
|
+
* fix a lapsed session.
|
|
85
|
+
*/
|
|
86
|
+
setError(n.message);
|
|
87
|
+
setReport(null);
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
setLoading(false);
|
|
91
|
+
}
|
|
92
|
+
}, [loadReport, profile, page]);
|
|
93
|
+
// Re-report on every change: the point of the panel is comparing options.
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
void refresh();
|
|
96
|
+
}, [refresh]);
|
|
97
|
+
/*
|
|
98
|
+
* ๐ Downloads stay enabled while a REFUSAL is showing only when there is
|
|
99
|
+
* something to download. A refusal means no file exists, so offering the
|
|
100
|
+
* button would hand the operator a 404 for a reason the panel just explained.
|
|
101
|
+
*/
|
|
102
|
+
const canDownload = report !== null && refusedReason === null && report.pageCount > 0;
|
|
103
|
+
return (_jsx(Card, { variant: "default", children: _jsxs(Stack, { gap: "comfortable", children: [_jsx(Heading, { level: 3, children: "Print & export" }), _jsx(FieldSelect, { name: "profile", label: "Machine", value: profile, options: PROFILES, onChange: setProfile }), _jsx(FieldSelect, { name: "page", label: "Page / material", value: page, options: PAGES, onChange: setPage }), error ? _jsx(Alert, { variant: "error", children: error }) : null, refusedReason ? _jsx(Alert, { variant: "warning", children: refusedReason }) : null, loading ? (_jsx(Text, { color: "muted", children: "Checking what this machine can do\u2026" })) : report && !refusedReason ? (_jsx(ExportReportView, { report: report })) : null, _jsxs(Row, { gap: "sm", wrap: true, children: [_jsx(Button, { variant: "primary", disabled: !canDownload, onClick: () => onDownloadCutFile?.(), children: "Download cut file" }), _jsx(Button, { variant: "secondary", disabled: !canDownload, onClick: () => onDownloadMosaic?.(), children: "Download PDF mosaic" })] }), _jsx(Text, { size: "xs", color: "muted", children: "Print the mosaic at 100% \u2014 never \u201Cfit to page\u201D, or the stickers come out the wrong size." })] }) }));
|
|
104
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PrecisionTier, TraceParams, TraceStage } from "../../../_internal/shared/features/sticker-trace/types";
|
|
2
|
+
export interface StickerRetryPanelProps {
|
|
3
|
+
/** The run being retried โ its name and params seed the form. */
|
|
4
|
+
source: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
tier: PrecisionTier;
|
|
8
|
+
params?: TraceParams;
|
|
9
|
+
};
|
|
10
|
+
/** True once the source run's light artifacts have been pruned. */
|
|
11
|
+
artifactsPruned?: boolean;
|
|
12
|
+
onSubmit: (input: {
|
|
13
|
+
name: string;
|
|
14
|
+
tier: PrecisionTier;
|
|
15
|
+
requestedResumeStage: TraceStage;
|
|
16
|
+
paramOverrides?: Record<string, number>;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
onCancel?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function StickerRetryPanel({ source, artifactsPruned, onSubmit, onCancel, }: StickerRetryPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/*
|
|
4
|
+
* WHY: A retry is where the resume clamp becomes visible or invisible, and
|
|
5
|
+
* invisible is the dangerous one. The server may move the resume point
|
|
6
|
+
* EARLIER than asked; an operator who requested a fast resume and silently
|
|
7
|
+
* got a full re-trace concludes the tool is broken.
|
|
8
|
+
* WHAT: Name the new attempt, pick a tier and a resume point, see what the
|
|
9
|
+
* server will actually do before committing to it.
|
|
10
|
+
*
|
|
11
|
+
* ๐ THE CLAMP IS SHOWN, NEVER SWALLOWED. `explainResume()` already returns the
|
|
12
|
+
* sentence; this panel's entire reason for existing is that something renders
|
|
13
|
+
* it. Without the clamp a run resumed from `parts` with a changed ridge
|
|
14
|
+
* threshold would carry artifacts generated under DIFFERENT parameters than the
|
|
15
|
+
* run records โ and nothing anywhere would contradict it. That is Root Cause
|
|
16
|
+
* #42's shape, which is why the parameter-to-stage grouping is structural
|
|
17
|
+
* rather than a convention.
|
|
18
|
+
*
|
|
19
|
+
* ๐ The panel PREDICTS the clamp client-side so the operator sees it before
|
|
20
|
+
* submitting, and the server computes it again independently. Those are not
|
|
21
|
+
* redundant: the prediction is an affordance, the server's is the decision.
|
|
22
|
+
* Both call `resolveResumeStage`, so they cannot disagree about which parameter
|
|
23
|
+
* belongs to which stage.
|
|
24
|
+
*
|
|
25
|
+
* ๐ Built on `<SectionForm>`, not a hand-rolled `<Form>`. Three controls is
|
|
26
|
+
* where a form stops being trivial, and sectionising is what buys the error
|
|
27
|
+
* summary, the jump-to-field link and the pinned mobile action bar for free โ
|
|
28
|
+
* audit-form-sectionised is strict-zero on exactly this, and its grandfather
|
|
29
|
+
* list is empty and closed.
|
|
30
|
+
*
|
|
31
|
+
* EXPORTS: StickerRetryPanel
|
|
32
|
+
*
|
|
33
|
+
* @tag domain:sticker-trace
|
|
34
|
+
* @tag layer:feature
|
|
35
|
+
* @tag pattern:none
|
|
36
|
+
* @tag access:client
|
|
37
|
+
* @tag consumers:tools/sticker-tracer
|
|
38
|
+
* @tag sideEffects:none
|
|
39
|
+
*/
|
|
40
|
+
import { useCallback, useMemo, useState } from "react";
|
|
41
|
+
import { z } from "zod";
|
|
42
|
+
import { normalizeError } from "../../../errors/normalize.js";
|
|
43
|
+
import { Alert, Card, Stack, Text } from "../../../ui/index.js";
|
|
44
|
+
import { FieldInput } from "../../../ui/forms/FieldInput.js";
|
|
45
|
+
import { FieldSelect } from "../../../ui/forms/FieldSelect.js";
|
|
46
|
+
import { SectionForm } from "../../shell/SectionForm.js";
|
|
47
|
+
import { TRACE_STAGES } from "../../../_internal/shared/features/sticker-trace/types.js";
|
|
48
|
+
import { resolveResumeStage, explainResume, } from "../../../_internal/shared/features/sticker-trace/resume.js";
|
|
49
|
+
import { paramsForTier } from "../../../_internal/shared/features/sticker-trace/config.js";
|
|
50
|
+
import { TIER_HELP } from "../constants/help-content.js";
|
|
51
|
+
const TIERS = ["draft", "standard", "precise", "max"];
|
|
52
|
+
/**
|
|
53
|
+
* ๐ `.min(1)` on the name, mirroring `requireName` on the server.
|
|
54
|
+
*
|
|
55
|
+
* Validated in both places deliberately rather than redundantly: the schema
|
|
56
|
+
* guards THIS form, `requireName` guards every caller including a future server
|
|
57
|
+
* action. A rule enforced only at the edge is the one the next caller bypasses.
|
|
58
|
+
*/
|
|
59
|
+
const retrySchema = z.object({
|
|
60
|
+
name: z.string().min(1, "Name this attempt so you can tell it apart later."),
|
|
61
|
+
tier: z.enum(["draft", "standard", "precise", "max"]),
|
|
62
|
+
requested: z.string().min(1),
|
|
63
|
+
});
|
|
64
|
+
export function StickerRetryPanel({ source, artifactsPruned = false, onSubmit, onCancel, }) {
|
|
65
|
+
/*
|
|
66
|
+
* Seeded with the source's name plus a marker rather than left blank. A name
|
|
67
|
+
* is MANDATORY and the server rejects an empty one, so an empty field is a
|
|
68
|
+
* guaranteed round-trip failure on the most common action in the tool.
|
|
69
|
+
*/
|
|
70
|
+
const [values, setValues] = useState({
|
|
71
|
+
name: `${source.name} โ retry`,
|
|
72
|
+
tier: source.tier,
|
|
73
|
+
requested: "decode",
|
|
74
|
+
});
|
|
75
|
+
const [pending, setPending] = useState(false);
|
|
76
|
+
const [error, setError] = useState(null);
|
|
77
|
+
const onChange = useCallback((partial) => setValues((v) => ({ ...v, ...partial })), []);
|
|
78
|
+
/*
|
|
79
|
+
* The next run's parameters, resolved exactly as the server will resolve
|
|
80
|
+
* them: tier defaults first, overrides second. Comparing anything else would
|
|
81
|
+
* predict a clamp the server does not apply, or miss one it does.
|
|
82
|
+
*/
|
|
83
|
+
const nextParams = useMemo(() => paramsForTier(values.tier), [values.tier]);
|
|
84
|
+
const notice = useMemo(() => {
|
|
85
|
+
if (!source.params)
|
|
86
|
+
return "";
|
|
87
|
+
return explainResume(resolveResumeStage(values.requested, source.params, nextParams));
|
|
88
|
+
}, [source.params, nextParams, values.requested]);
|
|
89
|
+
const submit = useCallback(async () => {
|
|
90
|
+
setPending(true);
|
|
91
|
+
setError(null);
|
|
92
|
+
try {
|
|
93
|
+
await onSubmit({
|
|
94
|
+
name: values.name.trim(),
|
|
95
|
+
tier: values.tier,
|
|
96
|
+
requestedResumeStage: values.requested,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
const n = normalizeError(err);
|
|
101
|
+
/*
|
|
102
|
+
* Shown rather than thrown away. A retry that fails silently leaves the
|
|
103
|
+
* operator looking at a form that did nothing โ and the likeliest causes,
|
|
104
|
+
* a lapsed session or a rejected name, are both named by the message.
|
|
105
|
+
*/
|
|
106
|
+
setError(n.message);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
setPending(false);
|
|
110
|
+
}
|
|
111
|
+
}, [values, onSubmit]);
|
|
112
|
+
const sections = useMemo(() => [
|
|
113
|
+
{
|
|
114
|
+
id: "attempt",
|
|
115
|
+
label: "This attempt",
|
|
116
|
+
required: true,
|
|
117
|
+
fields: ["name", "tier"],
|
|
118
|
+
render: ({ values: v, onChange: set, errors }) => (_jsxs(Stack, { gap: "comfortable", children: [_jsxs(Text, { size: "sm", color: "muted", children: ["This never edits", " ", _jsx(Text, { as: "span", weight: "semibold", children: source.name }), " ", "\u2014 it creates a new attempt beside it, so both stay comparable."] }), _jsx(FieldInput, { name: "name", label: "Name this attempt", required: true, value: v.name, error: errors.name, onChange: (next) => set({ name: next }) }), _jsx(FieldSelect, { name: "tier", label: "Tier", value: v.tier, options: TIERS.map((t) => ({ value: t, label: TIER_HELP[t].title })), onChange: (next) => set({ tier: next }) }), _jsx(Text, { size: "xs", color: "muted", children: TIER_HELP[v.tier].body })] })),
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "resume",
|
|
122
|
+
label: "Where it restarts",
|
|
123
|
+
fields: ["requested"],
|
|
124
|
+
render: ({ values: v, onChange: set }) => (_jsxs(Stack, { gap: "comfortable", children: [_jsx(FieldSelect, { name: "requested", label: "Resume from", value: v.requested, options: TRACE_STAGES.map((s) => ({ value: s, label: s })), onChange: (next) => set({ requested: next }) }), notice ? _jsx(Alert, { variant: "warning", children: notice }) : null, artifactsPruned ? (_jsx(Alert, { variant: "warning", children: "This run's artifacts have been cleared, so the retry starts from the beginning whatever you pick here." })) : null, !source.params ? (_jsx(Text, { size: "xs", color: "muted", children: "This run predates parameter recording, so the resume point cannot be checked ahead of time \u2014 the server will decide and tell you." })) : null] })),
|
|
125
|
+
},
|
|
126
|
+
], [source.name, source.params, notice, artifactsPruned]);
|
|
127
|
+
return (_jsx(Card, { variant: "default", children: _jsxs(Stack, { gap: "comfortable", children: [error ? _jsx(Alert, { variant: "error", children: error }) : null, _jsx(SectionForm, { sections: sections, values: values, onChange: onChange, onSubmit: submit, schema: retrySchema, submitLabel: "Start retry", isLoading: pending, onCancel: onCancel, cancelLabel: "Cancel" })] }) }));
|
|
128
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** One attempt. Mirrors the route's projection โ booleans, never paths. */
|
|
2
|
+
export interface StickerRunRow {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
tier: string;
|
|
6
|
+
status: string;
|
|
7
|
+
stage: string | null;
|
|
8
|
+
partCount: number;
|
|
9
|
+
groupCount: number;
|
|
10
|
+
durationMs: number | null;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
finishedAt: string | null;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
isPromoted: boolean;
|
|
15
|
+
has: {
|
|
16
|
+
preview: boolean;
|
|
17
|
+
overlay: boolean;
|
|
18
|
+
geometry: boolean;
|
|
19
|
+
cutSvg: boolean;
|
|
20
|
+
thumbAtlas: boolean;
|
|
21
|
+
};
|
|
22
|
+
error?: {
|
|
23
|
+
stage: string;
|
|
24
|
+
code: string;
|
|
25
|
+
message: string;
|
|
26
|
+
partOrdinal?: number;
|
|
27
|
+
} | null;
|
|
28
|
+
}
|
|
29
|
+
export interface StickerRunHistoryPanelProps {
|
|
30
|
+
runs: readonly StickerRunRow[];
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
/** Open a run's overlay or preview. Resolves a signed URL; the panel never holds one. */
|
|
33
|
+
onOpenAsset?: (runId: string, kind: "preview" | "overlay" | "cutSvg") => void;
|
|
34
|
+
/** Start a retry from this run โ the retry panel takes it from here. */
|
|
35
|
+
onRetry?: (run: StickerRunRow) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Accept this run as the sheet's result and render its parts full-size.
|
|
38
|
+
*
|
|
39
|
+
* ๐ Offered only on a SUCCEEDED run that is not already active. Promoting a
|
|
40
|
+
* failed run would copy a partial result onto the sheet, and re-promoting the
|
|
41
|
+
* active one spends the whole render budget to reach the state it is in.
|
|
42
|
+
*/
|
|
43
|
+
onPromote?: (run: StickerRunRow) => void;
|
|
44
|
+
}
|
|
45
|
+
export declare function StickerRunHistoryPanel({ runs, loading, onOpenAsset, onRetry, onPromote, }: StickerRunHistoryPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/*
|
|
4
|
+
* WHY: Tuning a halftone scan takes several attempts, and the attempts ARE the
|
|
5
|
+
* deliverable โ "run 2 died at ridge, run 1's parts are still the accepted
|
|
6
|
+
* set" is the question this feature exists to answer. Until now the runs
|
|
7
|
+
* existed in Firestore with nothing able to list them.
|
|
8
|
+
* WHAT: Every attempt on one sheet, newest first, with what each produced.
|
|
9
|
+
*
|
|
10
|
+
* ๐ A run is NEVER overwritten. A retry is a new named run, so this list only
|
|
11
|
+
* grows โ which is why each row leads with the NAME the operator typed rather
|
|
12
|
+
* than an id. "Untitled (3)" would defeat the whole point at the moment it
|
|
13
|
+
* matters most.
|
|
14
|
+
*
|
|
15
|
+
* ๐ It renders `has.*` BOOLEANS, never paths. The list action returns a
|
|
16
|
+
* projection with no `*Path` fields at all: an artifact's existence is all a
|
|
17
|
+
* list needs in order to offer "open overlay", and the path would be a private
|
|
18
|
+
* Storage location that must not reach a client
|
|
19
|
+
* (PRIVATE_TRACE_RUN_FIELDS, audit-public-projection-parity).
|
|
20
|
+
*
|
|
21
|
+
* EXPORTS: StickerRunHistoryPanel, StickerRunRow
|
|
22
|
+
*
|
|
23
|
+
* @tag domain:sticker-trace
|
|
24
|
+
* @tag layer:feature
|
|
25
|
+
* @tag pattern:none
|
|
26
|
+
* @tag access:client
|
|
27
|
+
* @tag consumers:tools/sticker-tracer
|
|
28
|
+
* @tag sideEffects:none
|
|
29
|
+
*/
|
|
30
|
+
import { useCallback, useMemo } from "react";
|
|
31
|
+
import { Badge, Button, Card, Heading, Row, Span, Stack, Text, } from "../../../ui/index.js";
|
|
32
|
+
import { TIER_HELP } from "../constants/help-content.js";
|
|
33
|
+
/**
|
|
34
|
+
* ๐ `succeeded` is NOT the same as `isActive`, and the badges keep them apart.
|
|
35
|
+
*
|
|
36
|
+
* A run can succeed and still not be the sheet's accepted result โ that is the
|
|
37
|
+
* normal case once you have tried three tiers. Collapsing the two would make
|
|
38
|
+
* "which parts does this sheet actually show" unanswerable from the list, which
|
|
39
|
+
* is most of what the list is for.
|
|
40
|
+
*/
|
|
41
|
+
function statusTone(status) {
|
|
42
|
+
if (status === "succeeded")
|
|
43
|
+
return "success";
|
|
44
|
+
if (status === "failed")
|
|
45
|
+
return "danger";
|
|
46
|
+
if (status === "cancelled")
|
|
47
|
+
return "warning";
|
|
48
|
+
return "info";
|
|
49
|
+
}
|
|
50
|
+
function formatDuration(ms) {
|
|
51
|
+
if (ms === null)
|
|
52
|
+
return "โ";
|
|
53
|
+
if (ms < 1000)
|
|
54
|
+
return `${ms} ms`;
|
|
55
|
+
const s = Math.round(ms / 100) / 10;
|
|
56
|
+
return s < 60 ? `${s}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Dates are formatted with an EXPLICIT locale and options.
|
|
60
|
+
*
|
|
61
|
+
* A bare `toLocaleString()` renders differently on the server and in the
|
|
62
|
+
* browser, which React reports as a hydration mismatch on a component whose
|
|
63
|
+
* only job is to be read.
|
|
64
|
+
*/
|
|
65
|
+
const STAMP = {
|
|
66
|
+
day: "2-digit",
|
|
67
|
+
month: "short",
|
|
68
|
+
hour: "2-digit",
|
|
69
|
+
minute: "2-digit",
|
|
70
|
+
hour12: false,
|
|
71
|
+
};
|
|
72
|
+
export function StickerRunHistoryPanel({ runs, loading = false, onOpenAsset, onRetry, onPromote, }) {
|
|
73
|
+
const open = useCallback((runId, kind) => () => onOpenAsset?.(runId, kind), [onOpenAsset]);
|
|
74
|
+
const sorted = useMemo(() => [...runs].sort((a, b) => b.createdAt.localeCompare(a.createdAt)), [runs]);
|
|
75
|
+
if (loading) {
|
|
76
|
+
return (_jsx(Card, { variant: "default", children: _jsx(Text, { color: "muted", children: "Loading attempts\u2026" }) }));
|
|
77
|
+
}
|
|
78
|
+
if (sorted.length === 0) {
|
|
79
|
+
return (_jsx(Card, { variant: "default", children: _jsxs(Stack, { gap: "dense", children: [_jsx(Heading, { level: 3, children: "Attempts" }), _jsx(Text, { color: "muted", children: "No runs yet. Tune the parameters above, give the attempt a name, and commit it \u2014 every attempt is kept so you can compare them later." })] }) }));
|
|
80
|
+
}
|
|
81
|
+
return (_jsxs(Stack, { gap: "comfortable", children: [_jsxs(Heading, { level: 3, children: ["Attempts (", sorted.length, ")"] }), sorted.map((run) => (_jsx(Card, { variant: "default", children: _jsxs(Stack, { gap: "dense", children: [_jsxs(Row, { align: "center", justify: "between", gap: "sm", wrap: true, children: [_jsxs(Row, { align: "center", gap: "sm", wrap: true, children: [_jsx(Text, { weight: "bold", children: run.name }), _jsx(Badge, { variant: statusTone(run.status), children: run.status }), run.isActive ? _jsx(Badge, { variant: "info", children: "accepted" }) : null, run.isPromoted ? _jsx(Badge, { variant: "success", children: "promoted" }) : null] }), _jsx(Text, { size: "xs", color: "muted", children: new Date(run.createdAt).toLocaleString("en-GB", STAMP) })] }), _jsxs(Text, { size: "sm", color: "muted", children: [TIER_HELP[run.tier]?.title ?? run.tier, " ยท ", run.partCount, " part", run.partCount === 1 ? "" : "s", run.groupCount > 1 ? ` in ${run.groupCount} sheets` : "", " ยท ", formatDuration(run.durationMs)] }), run.status === "failed" && run.error ? (_jsxs(Text, { size: "sm", color: "error", role: "alert", children: ["Failed at ", _jsx(Span, { weight: "semibold", children: run.error.stage }), typeof run.error.partOrdinal === "number"
|
|
82
|
+
? ` on part ${run.error.partOrdinal}`
|
|
83
|
+
: "", ": ", run.error.message] })) : null, run.status === "running" && run.stage ? (_jsxs(Text, { size: "sm", color: "muted", children: ["Currently in ", _jsx(Span, { weight: "semibold", children: run.stage }), "."] })) : null, _jsxs(Row, { gap: "sm", wrap: true, children: [run.has.preview ? (_jsx(Button, { size: "sm", variant: "secondary", onClick: open(run.id, "preview"), children: "Preview" })) : null, run.has.overlay ? (_jsx(Button, { size: "sm", variant: "secondary", onClick: open(run.id, "overlay"), children: "Overlay" })) : null, run.has.cutSvg ? (_jsx(Button, { size: "sm", variant: "secondary", onClick: open(run.id, "cutSvg"), children: "Cut file" })) : null, onRetry ? (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => onRetry(run), children: "Retry from this" })) : null, onPromote && run.status === "succeeded" && !run.isActive ? (_jsx(Button, { size: "sm", variant: "primary", onClick: () => onPromote(run), children: "Accept & render" })) : null] })] }) }, run.id)))] }));
|
|
84
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TraceParams } from "../../../_internal/shared/features/sticker-trace/types";
|
|
2
|
+
export interface StickerTraceStudioProps {
|
|
3
|
+
/**
|
|
4
|
+
* Rendered under the canvas โ where a parent puts "commit this as a run".
|
|
5
|
+
*
|
|
6
|
+
* ๐ `dimensions` are the scan's NATURAL size, from `codec.probe` โ NOT the
|
|
7
|
+
* raster's. The working raster is capped at the tier's `workingLongEdge`
|
|
8
|
+
* (1200 at draft), so handing over `raster.width` would record the draft
|
|
9
|
+
* size as the scan's true size on the sheet document, and every millimetre
|
|
10
|
+
* derived from it afterwards would be wrong by the downscale factor.
|
|
11
|
+
*
|
|
12
|
+
* The browser is the only party that can measure this at all: appkit cannot
|
|
13
|
+
* probe an image (the codec is injected, Root Cause #24) and reading the
|
|
14
|
+
* header server-side would mean pulling up to 100 MB into a function, which
|
|
15
|
+
* is the egress mistake this feature exists to avoid. Null until the probe
|
|
16
|
+
* lands.
|
|
17
|
+
*/
|
|
18
|
+
renderCommit?: (ctx: {
|
|
19
|
+
params: TraceParams;
|
|
20
|
+
file: File | null;
|
|
21
|
+
dimensions: {
|
|
22
|
+
widthPx: number;
|
|
23
|
+
heightPx: number;
|
|
24
|
+
} | null;
|
|
25
|
+
}) => React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function StickerTraceStudio({ renderCommit }: StickerTraceStudioProps): import("react").JSX.Element;
|