@voyant-travel/inventory-react 0.1.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/LICENSE +201 -0
- package/dist/admin/index.d.ts +91 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +132 -0
- package/dist/admin/pages/product-detail-page.d.ts +18 -0
- package/dist/admin/pages/product-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/product-detail-page.js +63 -0
- package/dist/admin/product-categories-host.d.ts +7 -0
- package/dist/admin/product-categories-host.d.ts.map +1 -0
- package/dist/admin/product-categories-host.js +11 -0
- package/dist/admin/product-detail-api.d.ts +22 -0
- package/dist/admin/product-detail-api.d.ts.map +1 -0
- package/dist/admin/product-detail-api.js +58 -0
- package/dist/admin/products-host.d.ts +11 -0
- package/dist/admin/products-host.d.ts.map +1 -0
- package/dist/admin/products-host.js +17 -0
- package/dist/admin/products-list-skeleton.d.ts +10 -0
- package/dist/admin/products-list-skeleton.d.ts.map +1 -0
- package/dist/admin/products-list-skeleton.js +23 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +79 -0
- package/dist/components/option-unit-dialog.d.ts +11 -0
- package/dist/components/option-unit-dialog.d.ts.map +1 -0
- package/dist/components/option-unit-dialog.js +17 -0
- package/dist/components/option-unit-form.d.ts +17 -0
- package/dist/components/option-unit-form.d.ts.map +1 -0
- package/dist/components/option-unit-form.js +123 -0
- package/dist/components/product-action-ledger-card.d.ts +17 -0
- package/dist/components/product-action-ledger-card.d.ts.map +1 -0
- package/dist/components/product-action-ledger-card.js +73 -0
- package/dist/components/product-catalog-card.d.ts +14 -0
- package/dist/components/product-catalog-card.d.ts.map +1 -0
- package/dist/components/product-catalog-card.js +44 -0
- package/dist/components/product-categories-page.d.ts +7 -0
- package/dist/components/product-categories-page.d.ts.map +1 -0
- package/dist/components/product-categories-page.js +9 -0
- package/dist/components/product-category-combobox.d.ts +10 -0
- package/dist/components/product-category-combobox.d.ts.map +1 -0
- package/dist/components/product-category-combobox.js +47 -0
- package/dist/components/product-category-dialog.d.ts +9 -0
- package/dist/components/product-category-dialog.d.ts.map +1 -0
- package/dist/components/product-category-dialog.js +17 -0
- package/dist/components/product-category-form.d.ts +15 -0
- package/dist/components/product-category-form.d.ts.map +1 -0
- package/dist/components/product-category-form.js +82 -0
- package/dist/components/product-category-list.d.ts +5 -0
- package/dist/components/product-category-list.d.ts.map +1 -0
- package/dist/components/product-category-list.js +48 -0
- package/dist/components/product-combobox.d.ts +13 -0
- package/dist/components/product-combobox.d.ts.map +1 -0
- package/dist/components/product-combobox.js +23 -0
- package/dist/components/product-contract-template-combobox.d.ts +9 -0
- package/dist/components/product-contract-template-combobox.d.ts.map +1 -0
- package/dist/components/product-contract-template-combobox.js +97 -0
- package/dist/components/product-day-dialog.d.ts +20 -0
- package/dist/components/product-day-dialog.d.ts.map +1 -0
- package/dist/components/product-day-dialog.js +20 -0
- package/dist/components/product-day-form.d.ts +19 -0
- package/dist/components/product-day-form.d.ts.map +1 -0
- package/dist/components/product-day-form.js +77 -0
- package/dist/components/product-day-media-tray.d.ts +11 -0
- package/dist/components/product-day-media-tray.d.ts.map +1 -0
- package/dist/components/product-day-media-tray.js +74 -0
- package/dist/components/product-day-service-dialog.d.ts +14 -0
- package/dist/components/product-day-service-dialog.d.ts.map +1 -0
- package/dist/components/product-day-service-dialog.js +19 -0
- package/dist/components/product-day-service-form.d.ts +44 -0
- package/dist/components/product-day-service-form.d.ts.map +1 -0
- package/dist/components/product-day-service-form.js +152 -0
- package/dist/components/product-detail/commerce-client.d.ts +314 -0
- package/dist/components/product-detail/commerce-client.d.ts.map +1 -0
- package/dist/components/product-detail/commerce-client.js +261 -0
- package/dist/components/product-detail/host.d.ts +54 -0
- package/dist/components/product-detail/host.d.ts.map +1 -0
- package/dist/components/product-detail/host.js +27 -0
- package/dist/components/product-detail/index.d.ts +6 -0
- package/dist/components/product-detail/index.d.ts.map +1 -0
- package/dist/components/product-detail/index.js +5 -0
- package/dist/components/product-detail/product-activity-section.d.ts +4 -0
- package/dist/components/product-detail/product-activity-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-activity-section.js +37 -0
- package/dist/components/product-detail/product-day-sheet.d.ts +14 -0
- package/dist/components/product-detail/product-day-sheet.d.ts.map +1 -0
- package/dist/components/product-detail/product-day-sheet.js +75 -0
- package/dist/components/product-detail/product-day-translation.d.ts +41 -0
- package/dist/components/product-detail/product-day-translation.d.ts.map +1 -0
- package/dist/components/product-detail/product-day-translation.js +111 -0
- package/dist/components/product-detail/product-departure-dialog.d.ts +11 -0
- package/dist/components/product-detail/product-departure-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-departure-dialog.js +10 -0
- package/dist/components/product-detail/product-departure-form.d.ts +25 -0
- package/dist/components/product-detail/product-departure-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-departure-form.js +241 -0
- package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts +8 -0
- package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-departure-pricing-override-dialog.js +126 -0
- package/dist/components/product-detail/product-detail-availability-sections.d.ts +19 -0
- package/dist/components/product-detail/product-detail-availability-sections.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-availability-sections.js +29 -0
- package/dist/components/product-detail/product-detail-channel-section.d.ts +8 -0
- package/dist/components/product-detail/product-detail-channel-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-channel-section.js +16 -0
- package/dist/components/product-detail/product-detail-day-row.d.ts +14 -0
- package/dist/components/product-detail/product-detail-day-row.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-day-row.js +43 -0
- package/dist/components/product-detail/product-detail-dialog.d.ts +10 -0
- package/dist/components/product-detail/product-detail-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-dialog.js +10 -0
- package/dist/components/product-detail/product-detail-form.d.ts +22 -0
- package/dist/components/product-detail/product-detail-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-form.js +205 -0
- package/dist/components/product-detail/product-detail-header.d.ts +12 -0
- package/dist/components/product-detail/product-detail-header.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-header.js +19 -0
- package/dist/components/product-detail/product-detail-itinerary-section.d.ts +4 -0
- package/dist/components/product-detail/product-detail-itinerary-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-itinerary-section.js +201 -0
- package/dist/components/product-detail/product-detail-media-sections.d.ts +15 -0
- package/dist/components/product-detail/product-detail-media-sections.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-media-sections.js +19 -0
- package/dist/components/product-detail/product-detail-organize-section.d.ts +6 -0
- package/dist/components/product-detail/product-detail-organize-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-organize-section.js +18 -0
- package/dist/components/product-detail/product-detail-page.d.ts +4 -0
- package/dist/components/product-detail/product-detail-page.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-page.js +95 -0
- package/dist/components/product-detail/product-detail-section-shell.d.ts +19 -0
- package/dist/components/product-detail/product-detail-section-shell.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-section-shell.js +23 -0
- package/dist/components/product-detail/product-detail-sections.d.ts +7 -0
- package/dist/components/product-detail/product-detail-sections.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-sections.js +6 -0
- package/dist/components/product-detail/product-detail-shared.d.ts +264 -0
- package/dist/components/product-detail/product-detail-shared.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-shared.js +157 -0
- package/dist/components/product-detail/product-detail-skeleton.d.ts +9 -0
- package/dist/components/product-detail/product-detail-skeleton.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-skeleton.js +53 -0
- package/dist/components/product-detail/product-detail-summary-section.d.ts +6 -0
- package/dist/components/product-detail/product-detail-summary-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-summary-section.js +66 -0
- package/dist/components/product-detail/product-extra-dialog.d.ts +21 -0
- package/dist/components/product-detail/product-extra-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-extra-dialog.js +131 -0
- package/dist/components/product-detail/product-itinerary-form.d.ts +16 -0
- package/dist/components/product-detail/product-itinerary-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-itinerary-form.js +38 -0
- package/dist/components/product-detail/product-market-rules-section.d.ts +6 -0
- package/dist/components/product-detail/product-market-rules-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-market-rules-section.js +81 -0
- package/dist/components/product-detail/product-media-gallery.d.ts +19 -0
- package/dist/components/product-detail/product-media-gallery.d.ts.map +1 -0
- package/dist/components/product-detail/product-media-gallery.js +114 -0
- package/dist/components/product-detail/product-option-price-rule-dialog.d.ts +12 -0
- package/dist/components/product-detail/product-option-price-rule-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-option-price-rule-dialog.js +10 -0
- package/dist/components/product-detail/product-option-price-rule-form.d.ts +29 -0
- package/dist/components/product-detail/product-option-price-rule-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-option-price-rule-form.js +122 -0
- package/dist/components/product-detail/product-option-pricing-grid.d.ts +16 -0
- package/dist/components/product-detail/product-option-pricing-grid.d.ts.map +1 -0
- package/dist/components/product-detail/product-option-pricing-grid.js +236 -0
- package/dist/components/product-detail/product-options-extra-price-rules.d.ts +8 -0
- package/dist/components/product-detail/product-options-extra-price-rules.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-extra-price-rules.js +123 -0
- package/dist/components/product-detail/product-options-pricing-helpers.d.ts +14 -0
- package/dist/components/product-detail/product-options-pricing-helpers.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-pricing-helpers.js +49 -0
- package/dist/components/product-detail/product-options-pricing-panel.d.ts +17 -0
- package/dist/components/product-detail/product-options-pricing-panel.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-pricing-panel.js +88 -0
- package/dist/components/product-detail/product-options-pricing.d.ts +5 -0
- package/dist/components/product-detail/product-options-pricing.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-pricing.js +4 -0
- package/dist/components/product-detail/product-options-shared.d.ts +236 -0
- package/dist/components/product-detail/product-options-shared.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-shared.js +57 -0
- package/dist/components/product-detail/product-options-traveler-category-dialog.d.ts +12 -0
- package/dist/components/product-detail/product-options-traveler-category-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-traveler-category-dialog.js +132 -0
- package/dist/components/product-detail/product-options-unit-price-matrix.d.ts +10 -0
- package/dist/components/product-detail/product-options-unit-price-matrix.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-unit-price-matrix.js +103 -0
- package/dist/components/product-detail/product-payment-policy-section.d.ts +17 -0
- package/dist/components/product-detail/product-payment-policy-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-payment-policy-section.js +58 -0
- package/dist/components/product-detail/product-schedule-dialog.d.ts +11 -0
- package/dist/components/product-detail/product-schedule-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-schedule-dialog.js +10 -0
- package/dist/components/product-detail/product-schedule-form.d.ts +17 -0
- package/dist/components/product-detail/product-schedule-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-schedule-form.js +223 -0
- package/dist/components/product-detail/product-service-dialog.d.ts +12 -0
- package/dist/components/product-detail/product-service-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-service-dialog.js +10 -0
- package/dist/components/product-detail/product-service-form.d.ts +22 -0
- package/dist/components/product-detail/product-service-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-service-form.js +154 -0
- package/dist/components/product-detail/product-translation-popover.d.ts +94 -0
- package/dist/components/product-detail/product-translation-popover.d.ts.map +1 -0
- package/dist/components/product-detail/product-translation-popover.js +238 -0
- package/dist/components/product-detail/product-unit-dialog.d.ts +14 -0
- package/dist/components/product-detail/product-unit-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-dialog.js +10 -0
- package/dist/components/product-detail/product-unit-form.d.ts +34 -0
- package/dist/components/product-detail/product-unit-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-form.js +139 -0
- package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts +17 -0
- package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-price-rule-dialog.js +10 -0
- package/dist/components/product-detail/product-unit-price-rule-form.d.ts +29 -0
- package/dist/components/product-detail/product-unit-price-rule-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-price-rule-form.js +144 -0
- package/dist/components/product-detail/rrule-labels.d.ts +2 -0
- package/dist/components/product-detail/rrule-labels.d.ts.map +1 -0
- package/dist/components/product-detail/rrule-labels.js +65 -0
- package/dist/components/product-detail/timezone-options.d.ts +9 -0
- package/dist/components/product-detail/timezone-options.d.ts.map +1 -0
- package/dist/components/product-detail/timezone-options.js +28 -0
- package/dist/components/product-detail/use-product-detail-data.d.ts +41 -0
- package/dist/components/product-detail/use-product-detail-data.d.ts.map +1 -0
- package/dist/components/product-detail/use-product-detail-data.js +143 -0
- package/dist/components/product-detail/use-product-detail-dialogs.d.ts +24 -0
- package/dist/components/product-detail/use-product-detail-dialogs.d.ts.map +1 -0
- package/dist/components/product-detail/use-product-detail-dialogs.js +40 -0
- package/dist/components/product-detail/zod-resolver.d.ts +4 -0
- package/dist/components/product-detail/zod-resolver.d.ts.map +1 -0
- package/dist/components/product-detail/zod-resolver.js +39 -0
- package/dist/components/product-detail-page.d.ts +57 -0
- package/dist/components/product-detail-page.d.ts.map +1 -0
- package/dist/components/product-detail-page.js +118 -0
- package/dist/components/product-detail.d.ts +2 -0
- package/dist/components/product-detail.d.ts.map +1 -0
- package/dist/components/product-detail.js +1 -0
- package/dist/components/product-dialog.d.ts +9 -0
- package/dist/components/product-dialog.d.ts.map +1 -0
- package/dist/components/product-dialog.js +13 -0
- package/dist/components/product-facility-combobox.d.ts +9 -0
- package/dist/components/product-facility-combobox.d.ts.map +1 -0
- package/dist/components/product-facility-combobox.js +94 -0
- package/dist/components/product-form.d.ts +14 -0
- package/dist/components/product-form.d.ts.map +1 -0
- package/dist/components/product-form.js +191 -0
- package/dist/components/product-itinerary-day-row.d.ts +22 -0
- package/dist/components/product-itinerary-day-row.d.ts.map +1 -0
- package/dist/components/product-itinerary-day-row.js +17 -0
- package/dist/components/product-itinerary-dialog.d.ts +16 -0
- package/dist/components/product-itinerary-dialog.d.ts.map +1 -0
- package/dist/components/product-itinerary-dialog.js +85 -0
- package/dist/components/product-itinerary-section.d.ts +16 -0
- package/dist/components/product-itinerary-section.d.ts.map +1 -0
- package/dist/components/product-itinerary-section.js +105 -0
- package/dist/components/product-list.d.ts +7 -0
- package/dist/components/product-list.d.ts.map +1 -0
- package/dist/components/product-list.js +155 -0
- package/dist/components/product-media-dialog.d.ts +11 -0
- package/dist/components/product-media-dialog.d.ts.map +1 -0
- package/dist/components/product-media-dialog.js +17 -0
- package/dist/components/product-media-form.d.ts +17 -0
- package/dist/components/product-media-form.d.ts.map +1 -0
- package/dist/components/product-media-form.js +101 -0
- package/dist/components/product-media-lightbox.d.ts +7 -0
- package/dist/components/product-media-lightbox.d.ts.map +1 -0
- package/dist/components/product-media-lightbox.js +31 -0
- package/dist/components/product-media-section.d.ts +27 -0
- package/dist/components/product-media-section.d.ts.map +1 -0
- package/dist/components/product-media-section.js +130 -0
- package/dist/components/product-media-tile.d.ts +17 -0
- package/dist/components/product-media-tile.d.ts.map +1 -0
- package/dist/components/product-media-tile.js +16 -0
- package/dist/components/product-option-dialog.d.ts +11 -0
- package/dist/components/product-option-dialog.d.ts.map +1 -0
- package/dist/components/product-option-dialog.js +17 -0
- package/dist/components/product-option-form.d.ts +17 -0
- package/dist/components/product-option-form.d.ts.map +1 -0
- package/dist/components/product-option-form.js +91 -0
- package/dist/components/product-options-section.d.ts +13 -0
- package/dist/components/product-options-section.d.ts.map +1 -0
- package/dist/components/product-options-section.js +200 -0
- package/dist/components/product-quick-view-sheet.d.ts +23 -0
- package/dist/components/product-quick-view-sheet.d.ts.map +1 -0
- package/dist/components/product-quick-view-sheet.js +65 -0
- package/dist/components/product-tag-dialog.d.ts +9 -0
- package/dist/components/product-tag-dialog.d.ts.map +1 -0
- package/dist/components/product-tag-dialog.js +17 -0
- package/dist/components/product-tag-form.d.ts +15 -0
- package/dist/components/product-tag-form.d.ts.map +1 -0
- package/dist/components/product-tag-form.js +48 -0
- package/dist/components/product-tag-list.d.ts +5 -0
- package/dist/components/product-tag-list.d.ts.map +1 -0
- package/dist/components/product-tag-list.js +44 -0
- package/dist/components/product-tags-page.d.ts +7 -0
- package/dist/components/product-tags-page.d.ts.map +1 -0
- package/dist/components/product-tags-page.js +9 -0
- package/dist/components/product-tax-class-combobox.d.ts +9 -0
- package/dist/components/product-tax-class-combobox.d.ts.map +1 -0
- package/dist/components/product-tax-class-combobox.js +100 -0
- package/dist/components/product-translations-card.d.ts +7 -0
- package/dist/components/product-translations-card.d.ts.map +1 -0
- package/dist/components/product-translations-card.js +188 -0
- package/dist/components/product-type-combobox.d.ts +9 -0
- package/dist/components/product-type-combobox.d.ts.map +1 -0
- package/dist/components/product-type-combobox.js +48 -0
- package/dist/components/product-types-page.d.ts +6 -0
- package/dist/components/product-types-page.d.ts.map +1 -0
- package/dist/components/product-types-page.js +103 -0
- package/dist/components/product-version-dialog.d.ts +8 -0
- package/dist/components/product-version-dialog.d.ts.map +1 -0
- package/dist/components/product-version-dialog.js +39 -0
- package/dist/components/product-versions-section.d.ts +7 -0
- package/dist/components/product-versions-section.d.ts.map +1 -0
- package/dist/components/product-versions-section.js +19 -0
- package/dist/components/products-page.d.ts +8 -0
- package/dist/components/products-page.d.ts.map +1 -0
- package/dist/components/products-page.js +8 -0
- package/dist/extras/client.d.ts +14 -0
- package/dist/extras/client.d.ts.map +1 -0
- package/dist/extras/client.js +58 -0
- package/dist/extras/components/extra-catalog-card.d.ts +13 -0
- package/dist/extras/components/extra-catalog-card.d.ts.map +1 -0
- package/dist/extras/components/extra-catalog-card.js +52 -0
- package/dist/extras/components/product-combobox.d.ts +9 -0
- package/dist/extras/components/product-combobox.d.ts.map +1 -0
- package/dist/extras/components/product-combobox.js +46 -0
- package/dist/extras/hooks/index.d.ts +4 -0
- package/dist/extras/hooks/index.d.ts.map +1 -0
- package/dist/extras/hooks/index.js +3 -0
- package/dist/extras/hooks/use-product-extra-mutation.d.ts +70 -0
- package/dist/extras/hooks/use-product-extra-mutation.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extra-mutation.js +38 -0
- package/dist/extras/hooks/use-product-extra.d.ts +24 -0
- package/dist/extras/hooks/use-product-extra.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extra.js +12 -0
- package/dist/extras/hooks/use-product-extras.d.ts +30 -0
- package/dist/extras/hooks/use-product-extras.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extras.js +12 -0
- package/dist/extras/i18n/en.d.ts +52 -0
- package/dist/extras/i18n/en.d.ts.map +1 -0
- package/dist/extras/i18n/en.js +51 -0
- package/dist/extras/i18n/index.d.ts +5 -0
- package/dist/extras/i18n/index.d.ts.map +1 -0
- package/dist/extras/i18n/index.js +3 -0
- package/dist/extras/i18n/messages.d.ts +37 -0
- package/dist/extras/i18n/messages.d.ts.map +1 -0
- package/dist/extras/i18n/messages.js +1 -0
- package/dist/extras/i18n/provider.d.ts +126 -0
- package/dist/extras/i18n/provider.d.ts.map +1 -0
- package/dist/extras/i18n/provider.js +44 -0
- package/dist/extras/i18n/ro.d.ts +52 -0
- package/dist/extras/i18n/ro.d.ts.map +1 -0
- package/dist/extras/i18n/ro.js +51 -0
- package/dist/extras/index.d.ts +7 -0
- package/dist/extras/index.d.ts.map +1 -0
- package/dist/extras/index.js +6 -0
- package/dist/extras/provider.d.ts +2 -0
- package/dist/extras/provider.d.ts.map +1 -0
- package/dist/extras/provider.js +1 -0
- package/dist/extras/query-keys.d.ts +16 -0
- package/dist/extras/query-keys.d.ts.map +1 -0
- package/dist/extras/query-keys.js +8 -0
- package/dist/extras/query-options.d.ts +455 -0
- package/dist/extras/query-options.d.ts.map +1 -0
- package/dist/extras/query-options.js +44 -0
- package/dist/extras/schemas.d.ts +416 -0
- package/dist/extras/schemas.d.ts.map +1 -0
- package/dist/extras/schemas.js +89 -0
- package/dist/extras/ui.d.ts +3 -0
- package/dist/extras/ui.d.ts.map +1 -0
- package/dist/extras/ui.js +2 -0
- package/dist/extras-compat.d.ts +3 -0
- package/dist/extras-compat.d.ts.map +1 -0
- package/dist/extras-compat.js +1 -0
- package/dist/extras.d.ts +10 -0
- package/dist/extras.d.ts.map +1 -0
- package/dist/extras.js +9 -0
- package/dist/hooks/index.d.ts +36 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +35 -0
- package/dist/hooks/use-duplicate-product-option-mutation.d.ts +19 -0
- package/dist/hooks/use-duplicate-product-option-mutation.d.ts.map +1 -0
- package/dist/hooks/use-duplicate-product-option-mutation.js +65 -0
- package/dist/hooks/use-option-unit-mutation.d.ts +60 -0
- package/dist/hooks/use-option-unit-mutation.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-mutation.js +41 -0
- package/dist/hooks/use-option-unit.d.ts +21 -0
- package/dist/hooks/use-option-unit.d.ts.map +1 -0
- package/dist/hooks/use-option-unit.js +12 -0
- package/dist/hooks/use-option-units.d.ts +27 -0
- package/dist/hooks/use-option-units.d.ts.map +1 -0
- package/dist/hooks/use-option-units.js +12 -0
- package/dist/hooks/use-product-action-ledger.d.ts +48 -0
- package/dist/hooks/use-product-action-ledger.d.ts.map +1 -0
- package/dist/hooks/use-product-action-ledger.js +12 -0
- package/dist/hooks/use-product-categories.d.ts +32 -0
- package/dist/hooks/use-product-categories.d.ts.map +1 -0
- package/dist/hooks/use-product-categories.js +29 -0
- package/dist/hooks/use-product-category-mutation.d.ts +65 -0
- package/dist/hooks/use-product-category-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-category-mutation.js +39 -0
- package/dist/hooks/use-product-category.d.ts +26 -0
- package/dist/hooks/use-product-category.d.ts.map +1 -0
- package/dist/hooks/use-product-category.js +18 -0
- package/dist/hooks/use-product-day-mutation.d.ts +43 -0
- package/dist/hooks/use-product-day-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-day-mutation.js +54 -0
- package/dist/hooks/use-product-day-service-mutation.d.ts +66 -0
- package/dist/hooks/use-product-day-service-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-day-service-mutation.js +41 -0
- package/dist/hooks/use-product-day-services.d.ts +21 -0
- package/dist/hooks/use-product-day-services.d.ts.map +1 -0
- package/dist/hooks/use-product-day-services.js +12 -0
- package/dist/hooks/use-product-day-translation-mutation.d.ts +49 -0
- package/dist/hooks/use-product-day-translation-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-day-translation-mutation.js +38 -0
- package/dist/hooks/use-product-day-translations.d.ts +19 -0
- package/dist/hooks/use-product-day-translations.d.ts.map +1 -0
- package/dist/hooks/use-product-day-translations.js +20 -0
- package/dist/hooks/use-product-days.d.ts +16 -0
- package/dist/hooks/use-product-days.d.ts.map +1 -0
- package/dist/hooks/use-product-days.js +12 -0
- package/dist/hooks/use-product-itineraries.d.ts +15 -0
- package/dist/hooks/use-product-itineraries.d.ts.map +1 -0
- package/dist/hooks/use-product-itineraries.js +12 -0
- package/dist/hooks/use-product-itinerary-days.d.ts +16 -0
- package/dist/hooks/use-product-itinerary-days.d.ts.map +1 -0
- package/dist/hooks/use-product-itinerary-days.js +12 -0
- package/dist/hooks/use-product-itinerary-mutation.d.ts +54 -0
- package/dist/hooks/use-product-itinerary-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-itinerary-mutation.js +63 -0
- package/dist/hooks/use-product-media-mutation.d.ts +101 -0
- package/dist/hooks/use-product-media-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-media-mutation.js +69 -0
- package/dist/hooks/use-product-media.d.ts +26 -0
- package/dist/hooks/use-product-media.d.ts.map +1 -0
- package/dist/hooks/use-product-media.js +12 -0
- package/dist/hooks/use-product-mutation.d.ts +121 -0
- package/dist/hooks/use-product-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-mutation.js +44 -0
- package/dist/hooks/use-product-option-mutation.d.ts +49 -0
- package/dist/hooks/use-product-option-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-option-mutation.js +39 -0
- package/dist/hooks/use-product-option.d.ts +18 -0
- package/dist/hooks/use-product-option.d.ts.map +1 -0
- package/dist/hooks/use-product-option.js +12 -0
- package/dist/hooks/use-product-options.d.ts +24 -0
- package/dist/hooks/use-product-options.d.ts.map +1 -0
- package/dist/hooks/use-product-options.js +12 -0
- package/dist/hooks/use-product-tag-mutation.d.ts +25 -0
- package/dist/hooks/use-product-tag-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-tag-mutation.js +39 -0
- package/dist/hooks/use-product-tag.d.ts +10 -0
- package/dist/hooks/use-product-tag.d.ts.map +1 -0
- package/dist/hooks/use-product-tag.js +18 -0
- package/dist/hooks/use-product-tags.d.ts +16 -0
- package/dist/hooks/use-product-tags.d.ts.map +1 -0
- package/dist/hooks/use-product-tags.js +25 -0
- package/dist/hooks/use-product-translation-mutation.d.ts +52 -0
- package/dist/hooks/use-product-translation-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-translation-mutation.js +47 -0
- package/dist/hooks/use-product-translations.d.ts +28 -0
- package/dist/hooks/use-product-translations.d.ts.map +1 -0
- package/dist/hooks/use-product-translations.js +24 -0
- package/dist/hooks/use-product-type-mutation.d.ts +50 -0
- package/dist/hooks/use-product-type-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-type-mutation.js +47 -0
- package/dist/hooks/use-product-type.d.ts +15 -0
- package/dist/hooks/use-product-type.d.ts.map +1 -0
- package/dist/hooks/use-product-type.js +12 -0
- package/dist/hooks/use-product-types.d.ts +21 -0
- package/dist/hooks/use-product-types.d.ts.map +1 -0
- package/dist/hooks/use-product-types.js +9 -0
- package/dist/hooks/use-product-version-mutation.d.ts +16 -0
- package/dist/hooks/use-product-version-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-version-mutation.js +22 -0
- package/dist/hooks/use-product-versions.d.ts +15 -0
- package/dist/hooks/use-product-versions.d.ts.map +1 -0
- package/dist/hooks/use-product-versions.js +12 -0
- package/dist/hooks/use-product.d.ts +45 -0
- package/dist/hooks/use-product.d.ts.map +1 -0
- package/dist/hooks/use-product.js +23 -0
- package/dist/hooks/use-products.d.ts +51 -0
- package/dist/hooks/use-products.d.ts.map +1 -0
- package/dist/hooks/use-products.js +38 -0
- package/dist/i18n/en-catalog.d.ts +199 -0
- package/dist/i18n/en-catalog.d.ts.map +1 -0
- package/dist/i18n/en-catalog.js +198 -0
- package/dist/i18n/en-core.d.ts +323 -0
- package/dist/i18n/en-core.d.ts.map +1 -0
- package/dist/i18n/en-core.js +322 -0
- package/dist/i18n/en-operations.d.ts +287 -0
- package/dist/i18n/en-operations.d.ts.map +1 -0
- package/dist/i18n/en-operations.js +286 -0
- package/dist/i18n/en.d.ts +803 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +8 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/message-shared.d.ts +6 -0
- package/dist/i18n/message-shared.d.ts.map +1 -0
- package/dist/i18n/message-shared.js +1 -0
- package/dist/i18n/messages-catalog.d.ts +199 -0
- package/dist/i18n/messages-catalog.d.ts.map +1 -0
- package/dist/i18n/messages-catalog.js +1 -0
- package/dist/i18n/messages-core.d.ts +304 -0
- package/dist/i18n/messages-core.d.ts.map +1 -0
- package/dist/i18n/messages-core.js +1 -0
- package/dist/i18n/messages-operations.d.ts +287 -0
- package/dist/i18n/messages-operations.d.ts.map +1 -0
- package/dist/i18n/messages-operations.js +1 -0
- package/dist/i18n/messages.d.ts +6 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +1628 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro-catalog.d.ts +199 -0
- package/dist/i18n/ro-catalog.d.ts.map +1 -0
- package/dist/i18n/ro-catalog.js +198 -0
- package/dist/i18n/ro-core.d.ts +323 -0
- package/dist/i18n/ro-core.d.ts.map +1 -0
- package/dist/i18n/ro-core.js +322 -0
- package/dist/i18n/ro-operations.d.ts +287 -0
- package/dist/i18n/ro-operations.d.ts.map +1 -0
- package/dist/i18n/ro-operations.js +286 -0
- package/dist/i18n/ro.d.ts +803 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +8 -0
- package/dist/i18n-en.d.ts +2 -0
- package/dist/i18n-en.d.ts.map +1 -0
- package/dist/i18n-en.js +1 -0
- package/dist/i18n-ro.d.ts +2 -0
- package/dist/i18n-ro.d.ts.map +1 -0
- package/dist/i18n-ro.js +1 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/operations.d.ts +53 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +13 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +114 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +34 -0
- package/dist/query-options-action-ledger.d.ts +194 -0
- package/dist/query-options-action-ledger.d.ts.map +1 -0
- package/dist/query-options-action-ledger.js +20 -0
- package/dist/query-options.d.ts +1313 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +281 -0
- package/dist/schemas.d.ts +1098 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +320 -0
- package/dist/ui.d.ts +44 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +42 -0
- package/package.json +159 -0
- package/src/styles.css +12 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { formatMessage } from "@voyant-travel/i18n";
|
|
4
|
+
import { Badge, Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@voyant-travel/ui/components";
|
|
5
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@voyant-travel/ui/components/alert-dialog";
|
|
6
|
+
import { Copy, MoreHorizontal, Pencil, Plus, Star, Trash2 } from "lucide-react";
|
|
7
|
+
import { useEffect, useMemo, useState } from "react";
|
|
8
|
+
import { productsQueryKeys, useProductDayMutation, useProductItineraries, useProductItineraryDays, useProductItineraryMutation, } from "../../index.js";
|
|
9
|
+
import { ProductItineraryDialog } from "../product-itinerary-dialog.js";
|
|
10
|
+
import { useProductDetailApi, useProductDetailMessages } from "./host.js";
|
|
11
|
+
import { ProductDaySheet } from "./product-day-sheet.js";
|
|
12
|
+
import { ProductDetailDayRow } from "./product-detail-day-row.js";
|
|
13
|
+
import { ActionMenu, EmptyState, Section } from "./product-detail-sections.js";
|
|
14
|
+
import { ServiceDialog } from "./product-service-dialog.js";
|
|
15
|
+
/**
|
|
16
|
+
* Storage-only upload handler for the day media tray. The tray does its
|
|
17
|
+
* own DB insert via `useProductMediaMutation.create` after this returns,
|
|
18
|
+
* so this handler must NOT call the products API — only the R2 upload
|
|
19
|
+
* endpoint — otherwise we'd write two media rows per file.
|
|
20
|
+
*/
|
|
21
|
+
const uploadDayMediaToStorage = async (file) => {
|
|
22
|
+
const formData = new FormData();
|
|
23
|
+
formData.append("file", file);
|
|
24
|
+
const res = await fetch("/api/v1/uploads", {
|
|
25
|
+
method: "POST",
|
|
26
|
+
body: formData,
|
|
27
|
+
credentials: "include",
|
|
28
|
+
});
|
|
29
|
+
if (!res.ok)
|
|
30
|
+
throw new Error(`Upload failed (${res.status})`);
|
|
31
|
+
const upload = (await res.json());
|
|
32
|
+
const mediaType = upload.mimeType.startsWith("video/")
|
|
33
|
+
? "video"
|
|
34
|
+
: upload.mimeType.startsWith("image/")
|
|
35
|
+
? "image"
|
|
36
|
+
: "document";
|
|
37
|
+
return {
|
|
38
|
+
url: upload.url,
|
|
39
|
+
name: file.name,
|
|
40
|
+
storageKey: upload.key,
|
|
41
|
+
mimeType: upload.mimeType,
|
|
42
|
+
fileSize: upload.size,
|
|
43
|
+
mediaType,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export function ProductDetailItinerarySection({ productId }) {
|
|
47
|
+
const messages = useProductDetailMessages();
|
|
48
|
+
const api = useProductDetailApi();
|
|
49
|
+
const productMessages = messages.products.core;
|
|
50
|
+
const queryClient = useQueryClient();
|
|
51
|
+
const itineraryQuery = useProductItineraries(productId);
|
|
52
|
+
const itineraryMutation = useProductItineraryMutation();
|
|
53
|
+
const dayMutation = useProductDayMutation();
|
|
54
|
+
const productActionLedgerQueryKey = [...productsQueryKeys.product(productId), "action-ledger"];
|
|
55
|
+
const invalidateProductActionLedger = () => queryClient.invalidateQueries({ queryKey: productActionLedgerQueryKey });
|
|
56
|
+
const [expandedDayId, setExpandedDayId] = useState(null);
|
|
57
|
+
const [selectedItineraryId, setSelectedItineraryId] = useState(null);
|
|
58
|
+
const [dayDialogOpen, setDayDialogOpen] = useState(false);
|
|
59
|
+
const [editingDay, setEditingDay] = useState();
|
|
60
|
+
const [serviceDialogOpen, setServiceDialogOpen] = useState(false);
|
|
61
|
+
const [serviceDialogDayId, setServiceDialogDayId] = useState("");
|
|
62
|
+
const [editingService, setEditingService] = useState();
|
|
63
|
+
const [itineraryDialogOpen, setItineraryDialogOpen] = useState(false);
|
|
64
|
+
const [editingItinerary, setEditingItinerary] = useState();
|
|
65
|
+
const [deleteItineraryTarget, setDeleteItineraryTarget] = useState(null);
|
|
66
|
+
const itineraries = useMemo(() => itineraryQuery.data?.data ?? [], [itineraryQuery.data?.data]);
|
|
67
|
+
const hasMultiple = itineraries.length > 1;
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (itineraries.length === 0) {
|
|
70
|
+
setSelectedItineraryId(null);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
setSelectedItineraryId((current) => {
|
|
74
|
+
if (current && itineraries.some((itinerary) => itinerary.id === current)) {
|
|
75
|
+
return current;
|
|
76
|
+
}
|
|
77
|
+
return itineraries.find((itinerary) => itinerary.isDefault)?.id ?? itineraries[0]?.id ?? null;
|
|
78
|
+
});
|
|
79
|
+
}, [itineraries]);
|
|
80
|
+
const selectedItinerary = useMemo(() => itineraries.find((itinerary) => itinerary.id === selectedItineraryId), [itineraries, selectedItineraryId]);
|
|
81
|
+
const daysQuery = useProductItineraryDays(productId, selectedItineraryId, {
|
|
82
|
+
enabled: Boolean(selectedItineraryId),
|
|
83
|
+
});
|
|
84
|
+
const days = useMemo(() => (daysQuery.data?.data ?? []).slice().sort((left, right) => left.dayNumber - right.dayNumber), [daysQuery.data?.data]);
|
|
85
|
+
const nextDayNumber = days.length > 0 ? Math.max(...days.map((day) => day.dayNumber)) + 1 : 1;
|
|
86
|
+
const openCreateItinerary = () => {
|
|
87
|
+
setEditingItinerary(undefined);
|
|
88
|
+
setItineraryDialogOpen(true);
|
|
89
|
+
};
|
|
90
|
+
const openRenameItinerary = (itinerary) => {
|
|
91
|
+
setEditingItinerary(itinerary);
|
|
92
|
+
setItineraryDialogOpen(true);
|
|
93
|
+
};
|
|
94
|
+
const handleSetDefault = async (itinerary) => {
|
|
95
|
+
if (itinerary.isDefault)
|
|
96
|
+
return;
|
|
97
|
+
await itineraryMutation.update.mutateAsync({
|
|
98
|
+
productId,
|
|
99
|
+
itineraryId: itinerary.id,
|
|
100
|
+
input: { isDefault: true },
|
|
101
|
+
});
|
|
102
|
+
void invalidateProductActionLedger();
|
|
103
|
+
};
|
|
104
|
+
const handleDuplicate = async (itinerary) => {
|
|
105
|
+
const result = await itineraryMutation.duplicate.mutateAsync({
|
|
106
|
+
productId,
|
|
107
|
+
itineraryId: itinerary.id,
|
|
108
|
+
});
|
|
109
|
+
setExpandedDayId(null);
|
|
110
|
+
setSelectedItineraryId(result.itinerary.id);
|
|
111
|
+
void invalidateProductActionLedger();
|
|
112
|
+
};
|
|
113
|
+
const handleConfirmDelete = async () => {
|
|
114
|
+
if (!deleteItineraryTarget)
|
|
115
|
+
return;
|
|
116
|
+
await itineraryMutation.remove.mutateAsync({
|
|
117
|
+
productId,
|
|
118
|
+
itineraryId: deleteItineraryTarget.id,
|
|
119
|
+
});
|
|
120
|
+
setDeleteItineraryTarget(null);
|
|
121
|
+
void invalidateProductActionLedger();
|
|
122
|
+
};
|
|
123
|
+
const sectionTitle = hasMultiple
|
|
124
|
+
? productMessages.itinerariesTitle
|
|
125
|
+
: productMessages.itineraryTitle;
|
|
126
|
+
return (_jsxs(_Fragment, { children: [_jsx(Section, { title: sectionTitle, actions: _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { size: "sm", disabled: !selectedItinerary, onClick: () => {
|
|
127
|
+
setEditingDay(undefined);
|
|
128
|
+
setDayDialogOpen(true);
|
|
129
|
+
}, children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), productMessages.addDay] }), _jsxs(ActionMenu, { children: [_jsxs(DropdownMenuItem, { onClick: openCreateItinerary, children: [_jsx(Plus, { className: "h-4 w-4" }), productMessages.newItinerary] }), selectedItinerary && !hasMultiple ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { onClick: () => openRenameItinerary(selectedItinerary), children: [_jsx(Pencil, { className: "h-4 w-4" }), productMessages.renameItinerary] }), _jsxs(DropdownMenuItem, { onClick: () => void handleDuplicate(selectedItinerary), children: [_jsx(Copy, { className: "h-4 w-4" }), productMessages.duplicateItinerary] })] })) : null] })] }), children: itineraryQuery.isPending ? (_jsx(EmptyState, { message: "\u2026" })) : itineraryQuery.isError ? (_jsx("p", { className: "py-6 text-center text-sm text-destructive", children: "Failed to load itineraries." })) : itineraries.length === 0 ? (_jsxs("div", { className: "flex flex-col items-start gap-3 rounded-md border border-dashed p-6", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: productMessages.noItinerariesYet }), _jsxs(Button, { variant: "outline", size: "sm", onClick: openCreateItinerary, children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), productMessages.newItinerary] })] })) : (_jsxs("div", { className: "flex flex-col gap-4", children: [hasMultiple ? (_jsx("div", { className: "flex flex-wrap items-center gap-1 rounded-md border bg-muted/30 p-1", children: itineraries.map((itinerary) => {
|
|
130
|
+
const isSelected = itinerary.id === selectedItineraryId;
|
|
131
|
+
return (_jsxs("div", { className: `flex items-center gap-1 rounded-sm pl-2 pr-1 transition-colors ${isSelected ? "bg-background shadow-sm" : "hover:bg-background/60"}`, children: [_jsxs("button", { type: "button", onClick: () => {
|
|
132
|
+
setExpandedDayId(null);
|
|
133
|
+
setSelectedItineraryId(itinerary.id);
|
|
134
|
+
}, className: "flex items-center gap-2 py-1.5 text-sm", children: [_jsx("span", { className: isSelected ? "font-medium" : "text-muted-foreground", children: itinerary.name }), itinerary.isDefault ? (_jsx(Badge, { variant: "secondary", className: "h-5 px-1.5 text-[10px]", children: productMessages.defaultBadge })) : null] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": formatMessage(productMessages.itineraryRowOptionsLabel, {
|
|
135
|
+
name: itinerary.name,
|
|
136
|
+
}), className: "h-6 w-6 text-muted-foreground", children: _jsx(MoreHorizontal, { className: "h-3.5 w-3.5" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onClick: () => openRenameItinerary(itinerary), children: [_jsx(Pencil, { className: "h-4 w-4" }), productMessages.renameItinerary] }), _jsxs(DropdownMenuItem, { onClick: () => void handleDuplicate(itinerary), children: [_jsx(Copy, { className: "h-4 w-4" }), productMessages.duplicateItinerary] }), _jsxs(DropdownMenuItem, { disabled: itinerary.isDefault, onClick: () => handleSetDefault(itinerary), children: [_jsx(Star, { className: "h-4 w-4" }), productMessages.setDefaultItinerary] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { variant: "destructive", disabled: itinerary.isDefault && itineraries.length > 1, onClick: () => setDeleteItineraryTarget(itinerary), children: [_jsx(Trash2, { className: "h-4 w-4" }), productMessages.deleteItinerary] })] })] })] }, itinerary.id));
|
|
137
|
+
}) })) : null, daysQuery.isPending ? (_jsx(EmptyState, { message: "\u2026" })) : daysQuery.isError ? (_jsx("p", { className: "py-6 text-center text-sm text-destructive", children: messages.products.operations.itineraries.daysLoadFailed })) : days.length === 0 ? (_jsx(EmptyState, { message: productMessages.itineraryEmpty })) : (_jsx("div", { className: "flex flex-col gap-2", children: days.map((day) => (_jsx(ProductDetailDayRow, { day: day, productId: productId, expanded: expandedDayId === day.id, onToggle: () => setExpandedDayId((current) => (current === day.id ? null : day.id)), onEdit: () => {
|
|
138
|
+
setEditingDay(day);
|
|
139
|
+
setDayDialogOpen(true);
|
|
140
|
+
}, onDelete: () => {
|
|
141
|
+
if (window.confirm(productMessages.deleteDayConfirm)) {
|
|
142
|
+
dayMutation.remove.mutate({
|
|
143
|
+
productId,
|
|
144
|
+
itineraryId: selectedItineraryId ?? undefined,
|
|
145
|
+
dayId: day.id,
|
|
146
|
+
}, {
|
|
147
|
+
onSuccess: () => void invalidateProductActionLedger(),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}, onAddService: () => {
|
|
151
|
+
setServiceDialogDayId(day.id);
|
|
152
|
+
setEditingService(undefined);
|
|
153
|
+
setServiceDialogOpen(true);
|
|
154
|
+
}, onEditService: (service) => {
|
|
155
|
+
setServiceDialogDayId(day.id);
|
|
156
|
+
setEditingService(service);
|
|
157
|
+
setServiceDialogOpen(true);
|
|
158
|
+
}, onDeleteService: (serviceId) => {
|
|
159
|
+
if (window.confirm(productMessages.deleteServiceConfirm)) {
|
|
160
|
+
void api
|
|
161
|
+
.delete(`/v1/products/${productId}/days/${day.id}/services/${serviceId}`)
|
|
162
|
+
.then(async () => {
|
|
163
|
+
await queryClient.invalidateQueries({
|
|
164
|
+
queryKey: ["product-day-services", productId, day.id],
|
|
165
|
+
});
|
|
166
|
+
await invalidateProductActionLedger();
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
} }, day.id))) }))] })) }), _jsx(ProductDaySheet, { open: dayDialogOpen, onOpenChange: setDayDialogOpen, productId: productId, itineraryId: selectedItineraryId ?? "", day: editingDay, nextDayNumber: nextDayNumber, uploadMedia: uploadDayMediaToStorage, onSuccess: () => {
|
|
170
|
+
setDayDialogOpen(false);
|
|
171
|
+
setEditingDay(undefined);
|
|
172
|
+
if (selectedItineraryId) {
|
|
173
|
+
void queryClient.invalidateQueries({
|
|
174
|
+
queryKey: ["products", productId, "itineraries", selectedItineraryId, "days"],
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
void invalidateProductActionLedger();
|
|
178
|
+
} }), _jsx(ServiceDialog, { open: serviceDialogOpen, onOpenChange: setServiceDialogOpen, productId: productId, dayId: serviceDialogDayId, service: editingService, onSuccess: () => {
|
|
179
|
+
setServiceDialogOpen(false);
|
|
180
|
+
setEditingService(undefined);
|
|
181
|
+
void queryClient.invalidateQueries({
|
|
182
|
+
queryKey: ["product-day-services", productId, serviceDialogDayId],
|
|
183
|
+
});
|
|
184
|
+
void invalidateProductActionLedger();
|
|
185
|
+
} }), _jsx(ProductItineraryDialog, { open: itineraryDialogOpen, onOpenChange: (open) => {
|
|
186
|
+
setItineraryDialogOpen(open);
|
|
187
|
+
if (!open)
|
|
188
|
+
setEditingItinerary(undefined);
|
|
189
|
+
}, productId: productId, itinerary: editingItinerary, itineraryCount: itineraries.length, onSuccess: (itineraryId) => {
|
|
190
|
+
if (!editingItinerary)
|
|
191
|
+
setSelectedItineraryId(itineraryId);
|
|
192
|
+
void invalidateProductActionLedger();
|
|
193
|
+
} }), _jsx(AlertDialog, { open: !!deleteItineraryTarget, onOpenChange: (open) => {
|
|
194
|
+
if (!open)
|
|
195
|
+
setDeleteItineraryTarget(null);
|
|
196
|
+
}, children: _jsxs(AlertDialogContent, { size: "sm", children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: productMessages.deleteItineraryTitle }), _jsx(AlertDialogDescription, { children: deleteItineraryTarget
|
|
197
|
+
? formatMessage(productMessages.deleteItineraryDescription, {
|
|
198
|
+
name: deleteItineraryTarget.name,
|
|
199
|
+
})
|
|
200
|
+
: null })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: productMessages.cancel }), _jsx(AlertDialogAction, { variant: "destructive", onClick: () => void handleConfirmDelete(), children: productMessages.confirmDelete })] })] }) })] }));
|
|
201
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ProductMediaItem } from "./product-detail-shared.js";
|
|
2
|
+
export declare function ProductBrochureSection({ brochure, isGenerating, onGenerate, }: {
|
|
3
|
+
brochure: ProductMediaItem | null;
|
|
4
|
+
isGenerating: boolean;
|
|
5
|
+
onGenerate: () => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function ProductMediaSection({ productId, media, isUploading, onUpload, onSetCover, onDelete, }: {
|
|
8
|
+
productId: string;
|
|
9
|
+
media: ProductMediaItem[];
|
|
10
|
+
isUploading: boolean;
|
|
11
|
+
onUpload: (file: File) => void;
|
|
12
|
+
onSetCover: (mediaId: string) => void;
|
|
13
|
+
onDelete: (mediaId: string) => void;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=product-detail-media-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-media-sections.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-media-sections.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAGlE,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACjC,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB,2CAmDA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC,2CAgBA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { formatMessage } from "@voyant-travel/i18n";
|
|
3
|
+
import { Button } from "@voyant-travel/ui/components";
|
|
4
|
+
import { Download, FileText, RefreshCw } from "lucide-react";
|
|
5
|
+
import { useProductDetailMessages } from "./host.js";
|
|
6
|
+
import { formatFileSize, Section } from "./product-detail-section-shell.js";
|
|
7
|
+
import { ProductMediaGallery } from "./product-media-gallery.js";
|
|
8
|
+
export function ProductBrochureSection({ brochure, isGenerating, onGenerate, }) {
|
|
9
|
+
const messages = useProductDetailMessages();
|
|
10
|
+
const productMessages = messages.products.core;
|
|
11
|
+
return (_jsx(Section, { title: productMessages.brochureTitle, children: _jsxs("div", { className: "flex flex-col gap-3", children: [brochure ? (_jsxs("div", { className: "flex items-start gap-3 rounded-md border bg-muted/20 p-3", children: [_jsx("div", { className: "mt-0.5 rounded-md bg-background p-2 text-muted-foreground", children: _jsx(FileText, { className: "h-4 w-4" }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-sm font-medium", children: brochure.name }), _jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: formatMessage(productMessages.brochureMeta, {
|
|
12
|
+
version: brochure.brochureVersion ?? 1,
|
|
13
|
+
size: formatFileSize(brochure.fileSize),
|
|
14
|
+
}) })] })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: productMessages.brochureEmpty })), _jsxs("div", { className: "flex gap-2", children: [brochure ? (_jsx("a", { href: brochure.url, target: "_blank", rel: "noreferrer", className: "flex-1", children: _jsxs(Button, { variant: "outline", size: "sm", className: "w-full", children: [_jsx(Download, { className: "mr-1.5 h-3.5 w-3.5" }), productMessages.downloadBrochure] }) })) : null, _jsxs(Button, { variant: brochure ? "secondary" : "default", size: "sm", className: "flex-1", disabled: isGenerating, onClick: onGenerate, children: [_jsx(RefreshCw, { className: `mr-1.5 h-3.5 w-3.5 ${isGenerating ? "animate-spin" : ""}` }), brochure ? productMessages.regenerateBrochure : productMessages.generateBrochure] })] }), _jsx("p", { className: "text-xs text-muted-foreground", children: productMessages.brochureSizeHint })] }) }));
|
|
15
|
+
}
|
|
16
|
+
export function ProductMediaSection({ productId, media, isUploading, onUpload, onSetCover, onDelete, }) {
|
|
17
|
+
const messages = useProductDetailMessages();
|
|
18
|
+
return (_jsx(Section, { title: messages.products.core.mediaTitle, children: _jsx("div", { className: "flex flex-col gap-4", children: _jsx(ProductMediaGallery, { productId: productId, media: media, isUploading: isUploading, onUpload: onUpload, onSetCover: onSetCover, onDelete: onDelete }) }) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ProductRecord } from "./product-detail-shared.js";
|
|
2
|
+
export declare function ProductOrganizeSection({ product, onEdit, }: {
|
|
3
|
+
product: ProductRecord;
|
|
4
|
+
onEdit: () => void;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=product-detail-organize-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-organize-section.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-organize-section.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAO3F,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,MAAM,GACP,EAAE;IACD,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB,2CAsDA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { Badge, DropdownMenuItem } from "@voyant-travel/ui/components";
|
|
4
|
+
import { Pencil } from "lucide-react";
|
|
5
|
+
import { useProductDetailApi, useProductDetailMessages } from "./host.js";
|
|
6
|
+
import { ActionMenu, DetailRow, Section } from "./product-detail-section-shell.js";
|
|
7
|
+
import { getProductBookingModeLabel } from "./product-detail-shared.js";
|
|
8
|
+
export function ProductOrganizeSection({ product, onEdit, }) {
|
|
9
|
+
const api = useProductDetailApi();
|
|
10
|
+
const messages = useProductDetailMessages();
|
|
11
|
+
const productMessages = messages.products.core;
|
|
12
|
+
const taxClassQuery = useQuery({
|
|
13
|
+
queryKey: ["tax-class", product.taxClassId],
|
|
14
|
+
enabled: !!product.taxClassId,
|
|
15
|
+
queryFn: () => api.get(`/v1/admin/finance/tax-classes/${product.taxClassId}`),
|
|
16
|
+
});
|
|
17
|
+
return (_jsxs(Section, { title: productMessages.organizeTitle, actions: _jsx(ActionMenu, { children: _jsxs(DropdownMenuItem, { onClick: onEdit, children: [_jsx(Pencil, { className: "h-4 w-4" }), productMessages.edit] }) }), children: [_jsx(DetailRow, { label: productMessages.tagsLabel, value: product.tags.length > 0 ? (_jsx("div", { className: "flex flex-wrap justify-end gap-1", children: product.tags.map((tag) => (_jsx(Badge, { variant: "secondary", className: "text-xs", children: tag }, tag))) })) : (_jsx("span", { className: "text-muted-foreground", children: productMessages.noValue })) }), _jsx(DetailRow, { label: productMessages.typeLabel, value: _jsx("span", { children: getProductBookingModeLabel(product.bookingMode, messages) }) }), _jsx(DetailRow, { label: productMessages.taxClassLabel, value: taxClassQuery.data?.data.label ? (_jsx("span", { children: taxClassQuery.data.data.label })) : (_jsx("span", { className: "text-muted-foreground", children: productMessages.taxClassNone })) })] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-page.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-page.tsx"],"names":[],"mappings":"AAsCA,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,2CA8MvD"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useQueries } from "@tanstack/react-query";
|
|
3
|
+
import { Button } from "@voyant-travel/ui/components";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { ProductsUiMessagesProvider } from "../../i18n/index.js";
|
|
6
|
+
import { ProductOptionsSection } from "../product-options-section.js";
|
|
7
|
+
import { useProductDetailApi, useProductDetailHost, useProductDetailMessages, useProductLocale, } from "./host.js";
|
|
8
|
+
import { ProductActivitySection } from "./product-activity-section.js";
|
|
9
|
+
import { DepartureDialog } from "./product-departure-dialog.js";
|
|
10
|
+
import { DeparturePricingOverrideDialog } from "./product-departure-pricing-override-dialog.js";
|
|
11
|
+
import { ProductDialog } from "./product-detail-dialog.js";
|
|
12
|
+
import { ProductDetailHeader } from "./product-detail-header.js";
|
|
13
|
+
import { ProductDetailItinerarySection } from "./product-detail-itinerary-section.js";
|
|
14
|
+
import { ProductBrochureSection, ProductChannelsSection, ProductDeparturesSection, ProductDetailsSection, ProductMediaSection, ProductOrganizeSection, ProductSchedulesSection, } from "./product-detail-sections.js";
|
|
15
|
+
import { ProductDetailSkeleton } from "./product-detail-skeleton.js";
|
|
16
|
+
import { ProductMarketRulesSection } from "./product-market-rules-section.js";
|
|
17
|
+
import { PricingPanel } from "./product-options-pricing.js";
|
|
18
|
+
import { deriveOptionPricingLayout, getDeparturePriceOverridesQueryOptions, } from "./product-options-shared.js";
|
|
19
|
+
import { ProductPaymentPolicySection } from "./product-payment-policy-section.js";
|
|
20
|
+
import { ScheduleDialog } from "./product-schedule-dialog.js";
|
|
21
|
+
import { useProductDetailData } from "./use-product-detail-data.js";
|
|
22
|
+
import { useProductDetailDialogs } from "./use-product-detail-dialogs.js";
|
|
23
|
+
export function ProductDetailPage({ id }) {
|
|
24
|
+
const messages = useProductDetailMessages();
|
|
25
|
+
const productMessages = messages.products.core;
|
|
26
|
+
const { navigate, renderOptionExtras } = useProductDetailHost();
|
|
27
|
+
const resolvedLocale = useProductLocale();
|
|
28
|
+
const api = useProductDetailApi();
|
|
29
|
+
const data = useProductDetailData(id);
|
|
30
|
+
const dialogs = useProductDetailDialogs();
|
|
31
|
+
const { product, isPending, slots, rules, channels, mappings, media, itineraryNameById } = data;
|
|
32
|
+
const { mutations, refetch, invalidateProduct } = data;
|
|
33
|
+
const overrideQueries = useQueries({
|
|
34
|
+
queries: slots.map((slot) => ({
|
|
35
|
+
...getDeparturePriceOverridesQueryOptions(api, slot.id),
|
|
36
|
+
enabled: !!slot.id,
|
|
37
|
+
})),
|
|
38
|
+
});
|
|
39
|
+
const slotIdsWithOverrides = useMemo(() => {
|
|
40
|
+
const set = new Set();
|
|
41
|
+
slots.forEach((slot, index) => {
|
|
42
|
+
const result = overrideQueries[index];
|
|
43
|
+
const items = result?.data?.data ?? [];
|
|
44
|
+
if (items.some((o) => o.active))
|
|
45
|
+
set.add(slot.id);
|
|
46
|
+
});
|
|
47
|
+
return set;
|
|
48
|
+
}, [slots, overrideQueries]);
|
|
49
|
+
const brochure = media.find((item) => item.isBrochure && item.isBrochureCurrent) ??
|
|
50
|
+
media.find((item) => item.isBrochure) ??
|
|
51
|
+
null;
|
|
52
|
+
const galleryMedia = media.filter((item) => !item.isBrochure);
|
|
53
|
+
if (isPending) {
|
|
54
|
+
return _jsx(ProductDetailSkeleton, {});
|
|
55
|
+
}
|
|
56
|
+
if (!product) {
|
|
57
|
+
return (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-12", children: [_jsx("p", { className: "text-muted-foreground", children: productMessages.detailNotFound }), _jsx(Button, { variant: "outline", onClick: () => navigate.toProducts(), children: productMessages.backToProducts })] }));
|
|
58
|
+
}
|
|
59
|
+
return (_jsxs("div", { className: "flex flex-col gap-6 p-6", children: [_jsx(ProductDetailHeader, { product: product, isDuplicating: mutations.duplicateProduct.isPending, isDeleting: mutations.deleteProduct.isPending, onEdit: dialogs.edit.openNow, onAddBooking: () => navigate.toNewBooking(id), onDuplicate: () => {
|
|
60
|
+
mutations.duplicateProduct.mutate(undefined, {
|
|
61
|
+
onSuccess: (result) => {
|
|
62
|
+
navigate.toProduct(result.data.id);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}, onDelete: () => {
|
|
66
|
+
if (confirm(productMessages.deleteConfirm)) {
|
|
67
|
+
mutations.deleteProduct.mutate(undefined, {
|
|
68
|
+
onSuccess: () => navigate.toProducts(),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
} }), _jsxs("div", { className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_320px]", children: [_jsxs("div", { className: "flex min-w-0 flex-col gap-6", children: [_jsx(ProductDetailsSection, { product: product, onEdit: dialogs.edit.openNow }), _jsx(ProductMediaSection, { productId: id, media: galleryMedia, isUploading: mutations.uploadMedia.isPending, onUpload: (file) => mutations.uploadMedia.mutate({ file }), onSetCover: (mediaId) => mutations.setCover.mutate(mediaId), onDelete: (mediaId) => {
|
|
72
|
+
if (confirm(productMessages.deleteMediaConfirm)) {
|
|
73
|
+
mutations.deleteMedia.mutate(mediaId);
|
|
74
|
+
}
|
|
75
|
+
} }), _jsx(ProductDeparturesSection, { slots: slots, itineraryNameById: itineraryNameById, slotIdsWithOverrides: slotIdsWithOverrides, onCreate: dialogs.departure.openNew, onEdit: dialogs.departure.openEdit, onOverridePrice: dialogs.departureOverride.openEdit, onManageAvailability: (slot) => navigate.toAvailability(slot.id), onDelete: (slotId) => {
|
|
76
|
+
if (confirm(productMessages.deleteDepartureConfirm)) {
|
|
77
|
+
mutations.deleteSlot.mutate(slotId);
|
|
78
|
+
}
|
|
79
|
+
} }), _jsx(ProductSchedulesSection, { rules: rules, onCreate: dialogs.schedule.openNew, onEdit: dialogs.schedule.openEdit, onDelete: (ruleId) => {
|
|
80
|
+
if (confirm(productMessages.deleteScheduleConfirm)) {
|
|
81
|
+
mutations.deleteRule.mutate(ruleId);
|
|
82
|
+
}
|
|
83
|
+
} }), _jsx(ProductDetailItinerarySection, { productId: id }), _jsx(ProductsUiMessagesProvider, { locale: resolvedLocale, children: _jsx(ProductOptionsSection, { productId: id, renderOptionDetails: (option) => (_jsx(PricingPanel, { productId: id, optionId: option.id, optionName: option.name, productCurrency: product.sellCurrency, layout: deriveOptionPricingLayout(product.bookingMode), extras: renderOptionExtras?.(id, option.id) })) }) }), _jsx(ProductPaymentPolicySection, { product: product, onSuccess: invalidateProduct }), _jsx(ProductMarketRulesSection, { productId: id })] }), _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx(ProductChannelsSection, { allChannels: channels, mappings: mappings, onAddChannel: (channelId) => mutations.addChannelMapping.mutate(channelId), onRemoveChannel: (mappingId) => mutations.removeChannelMapping.mutate(mappingId) }), _jsx(ProductOrganizeSection, { product: product, onEdit: dialogs.edit.openNow }), _jsx(ProductBrochureSection, { brochure: brochure, isGenerating: mutations.generateBrochure.isPending, onGenerate: () => mutations.generateBrochure.mutate() }), _jsx(ProductActivitySection, { productId: id })] })] }), _jsx(ProductDialog, { open: dialogs.edit.open, onOpenChange: dialogs.edit.setOpen, product: product, onSuccess: () => {
|
|
84
|
+
dialogs.edit.close();
|
|
85
|
+
invalidateProduct();
|
|
86
|
+
} }), _jsx(DepartureDialog, { open: dialogs.departure.open, onOpenChange: dialogs.departure.setOpen, productId: id, slot: dialogs.departure.editing, onSuccess: () => {
|
|
87
|
+
dialogs.departure.close();
|
|
88
|
+
refetch.slots();
|
|
89
|
+
} }), _jsx(ScheduleDialog, { open: dialogs.schedule.open, onOpenChange: dialogs.schedule.setOpen, productId: id, rule: dialogs.schedule.editing, onSuccess: () => {
|
|
90
|
+
dialogs.schedule.close();
|
|
91
|
+
refetch.rules();
|
|
92
|
+
} }), _jsx(DeparturePricingOverrideDialog, { open: dialogs.departureOverride.open, onOpenChange: dialogs.departureOverride.setOpen, departureId: dialogs.departureOverride.editing?.id ?? null, optionId: dialogs.departureOverride.editing?.optionId ?? null, onSuccess: () => {
|
|
93
|
+
dialogs.departureOverride.close();
|
|
94
|
+
} })] }));
|
|
95
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function Section({ title, actions, children, contentClassName, }: {
|
|
3
|
+
title: string;
|
|
4
|
+
actions?: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
contentClassName?: string;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function DetailRow({ label, value }: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: ReactNode;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function ActionMenu({ children }: {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function EmptyState({ message }: {
|
|
16
|
+
message: string;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function formatFileSize(value: number | null): string;
|
|
19
|
+
//# sourceMappingURL=product-detail-section-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-section-shell.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-section-shell.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,QAAQ,EAAE,SAAS,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,2CAWA;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,2CAO9E;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAW/D;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,2CAE1D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAI3D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuTrigger, } from "@voyant-travel/ui/components";
|
|
3
|
+
import { Separator } from "@voyant-travel/ui/components/separator";
|
|
4
|
+
import { MoreHorizontal } from "lucide-react";
|
|
5
|
+
export function Section({ title, actions, children, contentClassName, }) {
|
|
6
|
+
return (_jsxs("div", { className: "rounded-lg border bg-card text-card-foreground shadow-sm", children: [_jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [_jsx("h2", { className: "font-semibold leading-none tracking-tight", children: title }), actions] }), _jsx(Separator, {}), _jsx("div", { className: contentClassName ?? "px-6 py-4", children: children })] }));
|
|
7
|
+
}
|
|
8
|
+
export function DetailRow({ label, value }) {
|
|
9
|
+
return (_jsxs("div", { className: "flex items-center justify-between py-3 text-sm [&:not(:last-child)]:border-b", children: [_jsx("span", { className: "text-muted-foreground", children: label }), _jsx("span", { children: value })] }));
|
|
10
|
+
}
|
|
11
|
+
export function ActionMenu({ children }) {
|
|
12
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted-foreground", children: _jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }), _jsx(DropdownMenuContent, { align: "end", children: children })] }));
|
|
13
|
+
}
|
|
14
|
+
export function EmptyState({ message }) {
|
|
15
|
+
return _jsx("p", { className: "py-6 text-center text-sm text-muted-foreground", children: message });
|
|
16
|
+
}
|
|
17
|
+
export function formatFileSize(value) {
|
|
18
|
+
if (value == null)
|
|
19
|
+
return "-";
|
|
20
|
+
if (value < 1024 * 1024)
|
|
21
|
+
return `${Math.max(1, Math.round(value / 1024))} KB`;
|
|
22
|
+
return `${(value / (1024 * 1024)).toFixed(1)} MB`;
|
|
23
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ProductDeparturesSection, ProductSchedulesSection, } from "./product-detail-availability-sections.js";
|
|
2
|
+
export { ProductChannelsSection } from "./product-detail-channel-section.js";
|
|
3
|
+
export { ProductBrochureSection, ProductMediaSection } from "./product-detail-media-sections.js";
|
|
4
|
+
export { ProductOrganizeSection } from "./product-detail-organize-section.js";
|
|
5
|
+
export { ActionMenu, DetailRow, EmptyState, Section, } from "./product-detail-section-shell.js";
|
|
6
|
+
export { ProductDetailsSection } from "./product-detail-summary-section.js";
|
|
7
|
+
//# sourceMappingURL=product-detail-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-sections.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-sections.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,OAAO,GACR,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ProductDeparturesSection, ProductSchedulesSection, } from "./product-detail-availability-sections.js";
|
|
2
|
+
export { ProductChannelsSection } from "./product-detail-channel-section.js";
|
|
3
|
+
export { ProductBrochureSection, ProductMediaSection } from "./product-detail-media-sections.js";
|
|
4
|
+
export { ProductOrganizeSection } from "./product-detail-organize-section.js";
|
|
5
|
+
export { ActionMenu, DetailRow, EmptyState, Section, } from "./product-detail-section-shell.js";
|
|
6
|
+
export { ProductDetailsSection } from "./product-detail-summary-section.js";
|