@sima-land/moleculas 16.0.0-alpha.2 → 16.0.0-alpha.21
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/README.md +23 -0
- package/common/components/badge/badge.d.ts +8 -0
- package/common/components/badge/badge.js +55 -0
- package/common/components/badge/badge.js.map +1 -0
- package/common/components/badge/badge.m.scss +81 -0
- package/common/components/badge/index.d.ts +2 -19
- package/common/components/badge/index.js +3 -80
- package/common/components/badge/index.js.map +1 -0
- package/common/components/badge/types.d.ts +26 -0
- package/common/components/{intractive-image → badge}/types.js +1 -0
- package/common/components/badge/types.js.map +1 -0
- package/common/components/badge-list/badge-list.d.ts +29 -0
- package/common/components/badge-list/badge-list.js +38 -0
- package/common/components/badge-list/badge-list.js.map +1 -0
- package/common/components/badge-list/index.d.ts +1 -29
- package/common/components/badge-list/index.js +3 -56
- package/common/components/badge-list/index.js.map +1 -0
- package/common/components/breadcrumbs/breadcrumbs.d.ts +46 -0
- package/common/components/breadcrumbs/breadcrumbs.js +83 -0
- package/common/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/common/components/breadcrumbs/breadcrumbs.m.scss +113 -0
- package/common/components/breadcrumbs/index.d.ts +2 -0
- package/common/components/breadcrumbs/index.js +7 -0
- package/common/components/breadcrumbs/index.js.map +1 -0
- package/common/components/breadcrumbs/types.d.ts +8 -0
- package/common/{types.js → components/breadcrumbs/types.js} +1 -0
- package/common/components/breadcrumbs/types.js.map +1 -0
- package/common/components/img-stub/img-stub.d.ts +14 -0
- package/common/components/img-stub/img-stub.js +21 -0
- package/common/components/img-stub/img-stub.js.map +1 -0
- package/common/components/img-stub/img-stub.m.scss +36 -0
- package/common/components/img-stub/index.d.ts +1 -0
- package/common/components/img-stub/index.js +6 -0
- package/common/components/img-stub/index.js.map +1 -0
- package/common/components/{intractive-image → interactive-image}/index.js +1 -0
- package/common/components/interactive-image/index.js.map +1 -0
- package/common/components/interactive-image/interactive-image.d.ts +15 -0
- package/common/components/interactive-image/interactive-image.js +56 -0
- package/common/components/interactive-image/interactive-image.js.map +1 -0
- package/common/components/{intractive-image → interactive-image}/types.d.ts +4 -4
- package/common/components/interactive-image/types.js +3 -0
- package/common/components/interactive-image/types.js.map +1 -0
- package/common/components/media-gallery/index.d.ts +2 -0
- package/common/components/media-gallery/index.js +7 -0
- package/common/components/media-gallery/index.js.map +1 -0
- package/common/components/media-gallery/media-gallery.d.ts +16 -0
- package/common/components/media-gallery/media-gallery.js +90 -0
- package/common/components/media-gallery/media-gallery.js.map +1 -0
- package/common/components/media-gallery/media-gallery.m.scss +35 -0
- package/common/components/media-gallery/types.d.ts +12 -0
- package/common/components/media-gallery/types.js +3 -0
- package/common/components/media-gallery/types.js.map +1 -0
- package/common/components/media-gallery/utils.d.ts +38 -0
- package/common/components/media-gallery/utils.js +102 -0
- package/common/components/media-gallery/utils.js.map +1 -0
- package/common/components/media-modal/__mocks__/images/armchair.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/cup.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/plant.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/stump.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/table.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/vase.jpg +0 -0
- package/common/components/media-modal/__mocks__/index.d.ts +3 -0
- package/common/components/media-modal/__mocks__/index.js +251 -0
- package/common/components/media-modal/__mocks__/index.js.map +1 -0
- package/common/components/media-modal/__mocks__/thumbnails/armchair.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/cup.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/plant.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/stump.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/table.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/vase.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video3404953.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video3619217.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video4093038.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video6907296.jpg +0 -0
- package/common/components/media-modal/index.d.ts +11 -0
- package/common/components/media-modal/index.js +29 -0
- package/common/components/media-modal/index.js.map +1 -0
- package/common/components/media-modal/layout.d.ts +36 -0
- package/common/components/media-modal/layout.js +81 -0
- package/common/components/media-modal/layout.js.map +1 -0
- package/common/components/media-modal/layout.m.scss +78 -0
- package/common/components/media-modal/parts/all-round-view.d.ts +7 -0
- package/common/components/media-modal/parts/all-round-view.js +42 -0
- package/common/components/media-modal/parts/all-round-view.js.map +1 -0
- package/common/components/media-modal/parts/all-round-view.m.scss +30 -0
- package/common/components/media-modal/parts/index.d.ts +36 -0
- package/common/components/media-modal/parts/index.js +65 -0
- package/common/components/media-modal/parts/index.js.map +1 -0
- package/common/components/media-modal/parts/media-area.d.ts +25 -0
- package/common/components/media-modal/parts/media-area.js +61 -0
- package/common/components/media-modal/parts/media-area.js.map +1 -0
- package/common/components/media-modal/parts/media-area.m.scss +21 -0
- package/common/components/media-modal/parts/media-view.d.ts +20 -0
- package/common/components/media-modal/parts/media-view.js +46 -0
- package/common/components/media-modal/parts/media-view.js.map +1 -0
- package/common/components/media-modal/parts/media-view.m.scss +34 -0
- package/common/components/media-modal/parts/parts.m.scss +21 -0
- package/common/components/media-modal/parts/product-brief.d.ts +20 -0
- package/common/components/media-modal/parts/product-brief.js +40 -0
- package/common/components/media-modal/parts/product-brief.js.map +1 -0
- package/common/components/media-modal/parts/product-brief.m.scss +149 -0
- package/common/components/media-modal/parts/review.d.ts +15 -0
- package/common/components/media-modal/parts/review.js +32 -0
- package/common/components/media-modal/parts/review.js.map +1 -0
- package/common/components/media-modal/parts/review.m.scss +86 -0
- package/common/components/media-modal/parts/scroll-section.d.ts +11 -0
- package/common/components/media-modal/parts/scroll-section.js +20 -0
- package/common/components/media-modal/parts/scroll-section.js.map +1 -0
- package/common/components/media-modal/parts/scroll-section.m.scss +32 -0
- package/common/components/media-modal/parts/thumbnail.d.ts +22 -0
- package/common/components/media-modal/parts/thumbnail.js +36 -0
- package/common/components/media-modal/parts/thumbnail.js.map +1 -0
- package/common/components/media-modal/parts/thumbnail.m.scss +156 -0
- package/common/components/media-modal/parts/thumbnails.d.ts +13 -0
- package/common/components/media-modal/parts/thumbnails.js +60 -0
- package/common/components/media-modal/parts/thumbnails.js.map +1 -0
- package/common/components/media-modal/parts/thumbnails.m.scss +16 -0
- package/common/components/media-modal/types.d.ts +18 -0
- package/common/components/media-modal/types.js +3 -0
- package/common/components/media-modal/types.js.map +1 -0
- package/common/components/media-modal/utils.d.ts +42 -0
- package/common/components/media-modal/utils.js +110 -0
- package/common/components/media-modal/utils.js.map +1 -0
- package/common/components/modifier/index.d.ts +2 -46
- package/common/components/modifier/index.js +4 -99
- package/common/components/modifier/index.js.map +1 -0
- package/common/components/modifier/modifier.d.ts +13 -0
- package/common/components/modifier/modifier.js +74 -0
- package/common/components/modifier/modifier.js.map +1 -0
- package/common/components/modifier/{modifiers.module.scss → modifier.m.scss} +61 -0
- package/common/components/modifier/types.d.ts +35 -0
- package/common/components/modifier/types.js +3 -0
- package/common/components/modifier/types.js.map +1 -0
- package/common/components/pagination-controls/index.d.ts +2 -0
- package/common/components/pagination-controls/index.js +9 -0
- package/common/components/pagination-controls/index.js.map +1 -0
- package/common/components/pagination-controls/pagination-controls.d.ts +30 -0
- package/common/components/pagination-controls/pagination-controls.js +72 -0
- package/common/components/pagination-controls/pagination-controls.js.map +1 -0
- package/common/components/pagination-controls/pagination-controls.m.scss +70 -0
- package/common/components/pagination-controls/types.d.ts +20 -0
- package/common/components/pagination-controls/types.js +3 -0
- package/common/components/pagination-controls/types.js.map +1 -0
- package/common/components/product-info/index.d.ts +1 -16
- package/common/components/product-info/index.js +5 -41
- package/common/components/product-info/index.js.map +1 -0
- package/common/components/product-info/parts.d.ts +22 -21
- package/common/components/product-info/parts.js +35 -83
- package/common/components/product-info/parts.js.map +1 -0
- package/common/components/product-info/product-info.d.ts +15 -0
- package/common/components/product-info/product-info.js +33 -0
- package/common/components/product-info/product-info.js.map +1 -0
- package/common/components/product-info/{product-info.module.scss → product-info.m.scss} +9 -0
- package/common/components/product-info/types.d.ts +2 -2
- package/common/components/product-info/types.js +1 -0
- package/common/components/product-info/types.js.map +1 -0
- package/common/components/product-info/utils.js +1 -0
- package/common/components/product-info/utils.js.map +1 -0
- package/common/components/rating-counter/index.d.ts +1 -25
- package/common/components/rating-counter/index.js +3 -35
- package/common/components/rating-counter/index.js.map +1 -0
- package/common/components/rating-counter/rating-counter-util.scss +1 -1
- package/common/components/rating-counter/rating-counter.d.ts +35 -0
- package/common/components/rating-counter/rating-counter.js +24 -0
- package/common/components/rating-counter/rating-counter.js.map +1 -0
- package/common/hooks/index.d.ts +19 -0
- package/common/hooks/index.js +39 -0
- package/common/hooks/index.js.map +1 -0
- package/desktop/components/breadcrumbs/breadcrumbs.d.ts +31 -0
- package/desktop/components/breadcrumbs/breadcrumbs.js +56 -0
- package/desktop/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/desktop/components/breadcrumbs/{breadcrumbs.module.scss → breadcrumbs.m.scss} +36 -1
- package/desktop/components/breadcrumbs/index.d.ts +1 -28
- package/desktop/components/breadcrumbs/index.js +3 -80
- package/desktop/components/breadcrumbs/index.js.map +1 -0
- package/desktop/components/gallery-modal/__mocks__/index.js +1 -0
- package/desktop/components/gallery-modal/__mocks__/index.js.map +1 -0
- package/desktop/components/gallery-modal/components/all-round-view.d.ts +5 -2
- package/desktop/components/gallery-modal/components/all-round-view.js +47 -62
- package/desktop/components/gallery-modal/components/all-round-view.js.map +1 -0
- package/desktop/components/gallery-modal/components/{all-round-view.module.scss → all-round-view.m.scss} +5 -0
- package/desktop/components/gallery-modal/components/gallery-modal.d.ts +4 -5
- package/desktop/components/gallery-modal/components/gallery-modal.js +16 -66
- package/desktop/components/gallery-modal/components/gallery-modal.js.map +1 -0
- package/desktop/components/gallery-modal/components/{gallery-modal.module.scss → gallery-modal.m.scss} +5 -3
- package/desktop/components/gallery-modal/components/image-overlay.d.ts +3 -3
- package/desktop/components/gallery-modal/components/image-overlay.js +4 -17
- package/desktop/components/gallery-modal/components/image-overlay.js.map +1 -0
- package/desktop/components/gallery-modal/components/{image-overlay.module.scss → image-overlay.m.scss} +1 -0
- package/desktop/components/gallery-modal/components/review-info.d.ts +1 -1
- package/desktop/components/gallery-modal/components/review-info.js +11 -52
- package/desktop/components/gallery-modal/components/review-info.js.map +1 -0
- package/desktop/components/gallery-modal/components/thumbnail.d.ts +3 -3
- package/desktop/components/gallery-modal/components/thumbnail.js +7 -10
- package/desktop/components/gallery-modal/components/thumbnail.js.map +1 -0
- package/desktop/components/gallery-modal/index.js +1 -0
- package/desktop/components/gallery-modal/index.js.map +1 -0
- package/desktop/components/gallery-modal/types.js +1 -0
- package/desktop/components/gallery-modal/types.js.map +1 -0
- package/desktop/components/gallery-modal/utils.d.ts +5 -3
- package/desktop/components/gallery-modal/utils.js +18 -8
- package/desktop/components/gallery-modal/utils.js.map +1 -0
- package/desktop/components/person-info/index.d.ts +1 -41
- package/desktop/components/person-info/index.js +3 -43
- package/desktop/components/person-info/index.js.map +1 -0
- package/desktop/components/person-info/person-info.d.ts +42 -0
- package/desktop/components/person-info/person-info.js +24 -0
- package/desktop/components/person-info/person-info.js.map +1 -0
- package/desktop/components/person-info/{person-info.module.scss → person-info.m.scss} +1 -1
- package/desktop/components/product-card/index.d.ts +2 -26
- package/desktop/components/product-card/index.js +7 -103
- package/desktop/components/product-card/index.js.map +1 -0
- package/desktop/components/product-card/product-card.d.ts +23 -0
- package/desktop/components/product-card/product-card.js +94 -0
- package/desktop/components/product-card/product-card.js.map +1 -0
- package/desktop/components/product-card/types.d.ts +19 -0
- package/desktop/components/product-card/types.js +3 -0
- package/desktop/components/product-card/types.js.map +1 -0
- package/desktop/components/product-carousel/hover-card.d.ts +2 -7
- package/desktop/components/product-carousel/hover-card.js +13 -49
- package/desktop/components/product-carousel/hover-card.js.map +1 -0
- package/desktop/components/product-carousel/{hover-card.module.scss → hover-card.m.scss} +2 -2
- package/desktop/components/product-carousel/index.d.ts +2 -31
- package/desktop/components/product-carousel/index.js +3 -133
- package/desktop/components/product-carousel/index.js.map +1 -0
- package/desktop/components/product-carousel/product-carousel.d.ts +7 -0
- package/desktop/components/product-carousel/product-carousel.js +95 -0
- package/desktop/components/product-carousel/product-carousel.js.map +1 -0
- package/desktop/components/product-carousel/{product-carousel.module.scss → product-carousel.m.scss} +1 -1
- package/desktop/components/product-carousel/types.d.ts +33 -0
- package/desktop/components/product-carousel/types.js +3 -0
- package/desktop/components/product-carousel/types.js.map +1 -0
- package/desktop/components/product-carousel/utils.d.ts +4 -4
- package/desktop/components/product-carousel/utils.js +8 -7
- package/desktop/components/product-carousel/utils.js.map +1 -0
- package/desktop/components/promotion-card/banner-title.d.ts +2 -3
- package/desktop/components/promotion-card/banner-title.js +9 -19
- package/desktop/components/promotion-card/banner-title.js.map +1 -0
- package/desktop/components/promotion-card/estimate.d.ts +1 -2
- package/desktop/components/promotion-card/estimate.js +3 -5
- package/desktop/components/promotion-card/estimate.js.map +1 -0
- package/desktop/components/promotion-card/index.d.ts +4 -31
- package/desktop/components/promotion-card/index.js +10 -83
- package/desktop/components/promotion-card/index.js.map +1 -0
- package/desktop/components/promotion-card/placeholder.d.ts +4 -2
- package/desktop/components/promotion-card/placeholder.js +4 -6
- package/desktop/components/promotion-card/placeholder.js.map +1 -0
- package/desktop/components/promotion-card/promotion-card.d.ts +32 -0
- package/desktop/components/promotion-card/promotion-card.js +39 -0
- package/desktop/components/promotion-card/promotion-card.js.map +1 -0
- package/desktop/components/promotion-card/{index.module.scss → promotion-card.m.scss} +8 -6
- package/desktop/components/promotion-card/types.js +1 -0
- package/desktop/components/promotion-card/types.js.map +1 -0
- package/mobile/components/action-circles/action-circles.d.ts +22 -0
- package/mobile/components/action-circles/action-circles.js +31 -0
- package/mobile/components/action-circles/action-circles.js.map +1 -0
- package/mobile/components/action-circles/index.d.ts +1 -22
- package/mobile/components/action-circles/index.js +3 -29
- package/mobile/components/action-circles/index.js.map +1 -0
- package/mobile/components/action-list/action-list.d.ts +29 -0
- package/mobile/components/action-list/action-list.js +40 -0
- package/mobile/components/action-list/action-list.js.map +1 -0
- package/mobile/components/action-list/index.d.ts +1 -23
- package/mobile/components/action-list/index.js +5 -34
- package/mobile/components/action-list/index.js.map +1 -0
- package/mobile/components/breadcrumbs/breadcrumbs.d.ts +12 -0
- package/mobile/components/breadcrumbs/breadcrumbs.js +17 -0
- package/mobile/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/mobile/components/breadcrumbs/index.d.ts +1 -13
- package/mobile/components/breadcrumbs/index.js +3 -13
- package/mobile/components/breadcrumbs/index.js.map +1 -0
- package/mobile/components/person-info/index.d.ts +1 -44
- package/mobile/components/person-info/index.js +4 -55
- package/mobile/components/person-info/index.js.map +1 -0
- package/mobile/components/person-info/person-info.d.ts +46 -0
- package/mobile/components/person-info/person-info.js +41 -0
- package/mobile/components/person-info/person-info.js.map +1 -0
- package/mobile/components/person-info/{person-info.module.scss → person-info.m.scss} +9 -16
- package/mobile/components/product-row/index.d.ts +1 -41
- package/mobile/components/product-row/index.js +3 -56
- package/mobile/components/product-row/index.js.map +1 -0
- package/mobile/components/product-row/product-row.d.ts +40 -0
- package/mobile/components/product-row/product-row.js +29 -0
- package/mobile/components/product-row/product-row.js.map +1 -0
- package/mobile/components/product-slider/index.d.ts +1 -17
- package/mobile/components/product-slider/index.js +3 -57
- package/mobile/components/product-slider/index.js.map +1 -0
- package/mobile/components/product-slider/product-slider.d.ts +17 -0
- package/mobile/components/product-slider/product-slider.js +37 -0
- package/mobile/components/product-slider/product-slider.js.map +1 -0
- package/mobile/components/search-bar/index.d.ts +1 -39
- package/mobile/components/search-bar/index.js +4 -104
- package/mobile/components/search-bar/index.js.map +1 -0
- package/mobile/components/search-bar/search-bar.d.ts +39 -0
- package/mobile/components/search-bar/search-bar.js +64 -0
- package/mobile/components/search-bar/search-bar.js.map +1 -0
- package/mobile/components/search-bar/{search-bar.module.scss → search-bar.m.scss} +6 -6
- package/mobile/components/select-screen/index.d.ts +1 -20
- package/mobile/components/select-screen/index.js +4 -65
- package/mobile/components/select-screen/index.js.map +1 -0
- package/mobile/components/select-screen/select-screen.d.ts +20 -0
- package/mobile/components/select-screen/select-screen.js +31 -0
- package/mobile/components/select-screen/select-screen.js.map +1 -0
- package/package.json +40 -52
- package/common/components/badge/badge.module.scss +0 -40
- package/common/components/intractive-image/interactive-image.d.ts +0 -15
- package/common/components/intractive-image/interactive-image.js +0 -96
- package/common/components/rating-counter/star.svg +0 -5
- package/common/constants.d.ts +0 -2
- package/common/constants.js +0 -8
- package/common/icons/eighteen-plus.svg +0 -5
- package/common/types.d.ts +0 -1
- package/desktop/components/breadcrumbs/square-arrow-down.svg +0 -8
- package/desktop/components/gallery-modal/icons/360.svg +0 -3
- package/desktop/components/gallery-modal/icons/pause.svg +0 -3
- package/desktop/components/gallery-modal/icons/turn-left.svg +0 -10
- package/desktop/components/gallery-modal/icons/turn-right.svg +0 -10
- package/desktop/components/modifiers/button/index.d.ts +0 -22
- package/desktop/components/modifiers/button/index.js +0 -48
- package/desktop/components/modifiers/button/modifier-button.module.scss +0 -85
- package/desktop/components/modifiers/group/index.d.ts +0 -15
- package/desktop/components/modifiers/group/index.js +0 -70
- package/desktop/components/modifiers/group/modifiers-group.module.scss +0 -33
- package/desktop/components/modifiers/group/utils.d.ts +0 -20
- package/desktop/components/modifiers/group/utils.js +0 -73
- package/desktop/components/modifiers/modifiers.scss +0 -8
- package/mobile/components/modifiers-list/index.d.ts +0 -22
- package/mobile/components/modifiers-list/index.js +0 -25
- package/mobile/components/modifiers-list/modifier-item/index.d.ts +0 -29
- package/mobile/components/modifiers-list/modifier-item/index.js +0 -38
- package/mobile/components/modifiers-list/modifier-item/modifier-item.module.scss +0 -70
- package/mobile/components/modifiers-list/modifiers-list.module.scss +0 -21
- package/mobile/components/pseudo-input/index.d.ts +0 -11
- package/mobile/components/pseudo-input/index.js +0 -34
- package/mobile/components/pseudo-input/pseudo-input.module.scss +0 -24
- /package/common/components/badge-list/{badge-list.module.scss → badge-list.m.scss} +0 -0
- /package/common/components/{intractive-image → interactive-image}/index.d.ts +0 -0
- /package/common/components/{intractive-image → interactive-image}/interactive-image-util.scss +0 -0
- /package/common/components/{intractive-image/interactive-image.module.scss → interactive-image/interactive-image.m.scss} +0 -0
- /package/common/components/rating-counter/{rating-counter.module.scss → rating-counter.m.scss} +0 -0
- /package/desktop/components/gallery-modal/components/{review-info.module.scss → review-info.m.scss} +0 -0
- /package/desktop/components/gallery-modal/components/{thumbnail.module.scss → thumbnail.m.scss} +0 -0
- /package/desktop/components/product-card/{product-card.module.scss → product-card.m.scss} +0 -0
- /package/desktop/components/promotion-card/{banner-title.module.scss → banner-title.m.scss} +0 -0
- /package/desktop/components/promotion-card/{placeholder.module.scss → placeholder.m.scss} +0 -0
- /package/mobile/components/action-circles/{action-circles.module.scss → action-circles.m.scss} +0 -0
- /package/mobile/components/action-list/{action-list.module.scss → action-list.m.scss} +0 -0
- /package/mobile/components/breadcrumbs/{breadcrumbs.module.scss → breadcrumbs.m.scss} +0 -0
- /package/mobile/components/product-row/{product-row.module.scss → product-row.m.scss} +0 -0
- /package/mobile/components/product-slider/{product-slider.module.scss → product-slider.m.scss} +0 -0
- /package/mobile/components/select-screen/{select-screen.module.scss → select-screen.m.scss} +0 -0
|
@@ -1,89 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.AllRoundView = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const hooks_1 = require("@sima-land/ui-nucleons/hooks");
|
|
10
|
+
const helpers_1 = require("@sima-land/ui-nucleons/helpers");
|
|
34
11
|
const utils_1 = require("../utils");
|
|
35
12
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
13
|
+
const all_round_view_m_scss_1 = __importDefault(require("./all-round-view.m.scss"));
|
|
14
|
+
const Viewing360Perspective_1 = __importDefault(require("@sima-land/ui-quarks/icons/40x40/Filled/Viewing360Perspective"));
|
|
15
|
+
const Pause_1 = __importDefault(require("@sima-land/ui-quarks/icons/40x40/Filled/Pause"));
|
|
16
|
+
const ArrowTurnLeft_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/ArrowTurnLeft"));
|
|
17
|
+
const ArrowTurnRight_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/ArrowTurnRight"));
|
|
18
|
+
const img_stub_1 = require("../../../../common/components/img-stub");
|
|
19
|
+
const hint_1 = require("@sima-land/ui-nucleons/hint");
|
|
20
|
+
const cx = bind_1.default.bind(all_round_view_m_scss_1.default);
|
|
42
21
|
/**
|
|
43
22
|
* 3д-просмотр.
|
|
44
23
|
* @param props Свойства.
|
|
45
24
|
* @return Элемент.
|
|
46
25
|
*/
|
|
47
|
-
const AllRoundView = ({ photos }) => {
|
|
26
|
+
const AllRoundView = ({ photos, controls = true, state: stateProp = 'autoplay', onStateChange, }) => {
|
|
48
27
|
const imageRef = (0, react_1.useRef)(null);
|
|
49
28
|
const dragStartRef = (0, react_1.useRef)(null);
|
|
50
|
-
const [state, setState] = (0, react_1.useState)(
|
|
29
|
+
const [state, setState] = (0, react_1.useState)(stateProp);
|
|
30
|
+
(0, react_1.useEffect)(() => onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(state), [state]);
|
|
31
|
+
(0, react_1.useEffect)(() => setState(stateProp), [stateProp]);
|
|
51
32
|
const autoplay = state === 'autoplay';
|
|
52
33
|
// eslint-disable-next-line require-jsdoc
|
|
53
34
|
const ChangeState = (bindState) => () => setState(bindState);
|
|
54
35
|
const [index, setIndex] = (0, react_1.useState)(0);
|
|
55
|
-
const indexRef = (0,
|
|
56
|
-
const
|
|
36
|
+
const indexRef = (0, hooks_1.useIdentityRef)(index);
|
|
37
|
+
const imagesStatus = (0, utils_1.useImagesLoad)(photos);
|
|
38
|
+
const ready = imagesStatus === 'done';
|
|
39
|
+
const failed = imagesStatus === 'fail';
|
|
57
40
|
// запуск/остановка вращения
|
|
58
41
|
(0, react_1.useEffect)(() => {
|
|
59
|
-
if (state !== 'default' &&
|
|
42
|
+
if (state !== 'default' && ready) {
|
|
60
43
|
const timerId = window.setInterval(() => {
|
|
61
44
|
const increment = state === 'turn-left' ? -1 : 1;
|
|
62
45
|
setIndex((photos.length + (indexRef.current + increment)) % photos.length);
|
|
63
46
|
}, 1000 / 30);
|
|
64
47
|
return () => window.clearInterval(timerId);
|
|
65
48
|
}
|
|
66
|
-
}, [state,
|
|
49
|
+
}, [state, ready]);
|
|
67
50
|
// перетаскивание
|
|
68
51
|
(0, react_1.useEffect)(() => {
|
|
69
52
|
// переданное число всегда замениться на такое, которое будет в промежутке от 0 до количества фото
|
|
70
53
|
// eslint-disable-next-line require-jsdoc
|
|
71
54
|
const wrap = (value) => (photos.length + value) % photos.length;
|
|
72
55
|
const image = imageRef.current;
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
if (!image) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
75
59
|
const offList = [
|
|
76
|
-
(0,
|
|
60
|
+
(0, helpers_1.on)(image, 'pointerdown', e => {
|
|
77
61
|
e.preventDefault();
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
// ВАЖНО: preventDefault предотвращает расфокусировку полей ввода - форсируем
|
|
64
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
65
|
+
document.activeElement.blur();
|
|
66
|
+
}
|
|
78
67
|
setState('default');
|
|
68
|
+
const imageLeft = image.getBoundingClientRect().left;
|
|
79
69
|
image.style.touchAction = 'none';
|
|
80
70
|
dragStartRef.current = {
|
|
81
71
|
position: e.clientX - imageLeft,
|
|
82
72
|
index: indexRef.current,
|
|
83
73
|
};
|
|
84
74
|
}),
|
|
85
|
-
(0,
|
|
75
|
+
(0, helpers_1.on)(window, 'pointermove', e => {
|
|
86
76
|
if (dragStartRef.current !== null) {
|
|
77
|
+
const imageWidth = image.clientWidth;
|
|
78
|
+
const imageLeft = image.getBoundingClientRect().left;
|
|
87
79
|
const startX = dragStartRef.current.position;
|
|
88
80
|
const currentX = e.clientX - imageLeft;
|
|
89
81
|
const startPos = wrap(Math.round((startX * photos.length) / imageWidth));
|
|
@@ -92,29 +84,22 @@ const AllRoundView = ({ photos }) => {
|
|
|
92
84
|
setIndex(nextIndex);
|
|
93
85
|
}
|
|
94
86
|
}),
|
|
95
|
-
(0,
|
|
87
|
+
(0, helpers_1.on)(window, 'pointerup', () => {
|
|
96
88
|
dragStartRef.current = null;
|
|
97
89
|
image.style.touchAction = '';
|
|
98
90
|
}),
|
|
99
91
|
];
|
|
100
92
|
return () => offList.forEach(fn => fn());
|
|
101
|
-
}, [photos.length]);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
react_1.default.createElement("button", { className: cx('control', 'turn'), disabled: autoplay, onPointerDown: ChangeState('turn-left'), onPointerUp: ChangeState('default'), onPointerLeave: ChangeState('default'), "data-testid": 'gallery-modal:360-turn-left-button' },
|
|
112
|
-
react_1.default.createElement(turn_right_svg_1.default, null)),
|
|
113
|
-
react_1.default.createElement(with_hint_1.WithHint, { hint: HINT }, (ref, toggleHint) => (react_1.default.createElement("button", { ref: ref, className: cx('control', 'primary', autoplay && 'pause'), onClick: () => {
|
|
114
|
-
setState(s => (s === 'autoplay' ? 'default' : 'autoplay'));
|
|
115
|
-
toggleHint(false);
|
|
116
|
-
}, onMouseEnter: () => autoplay && toggleHint(true), onMouseLeave: () => toggleHint(false), "data-testid": 'gallery-modal:toggle-autoplay-button' }, autoplay ? react_1.default.createElement(pause_svg_1.default, null) : react_1.default.createElement(_360_svg_1.default, null)))),
|
|
117
|
-
react_1.default.createElement("button", { className: cx('control', 'turn'), disabled: autoplay, onPointerDown: ChangeState('turn-right'), onPointerUp: ChangeState('default'), onPointerLeave: ChangeState('default'), "data-testid": 'gallery-modal:360-turn-right-button' },
|
|
118
|
-
react_1.default.createElement(turn_left_svg_1.default, null)))));
|
|
93
|
+
}, [photos.length, failed]);
|
|
94
|
+
// состояние
|
|
95
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
96
|
+
// позиционирование
|
|
97
|
+
const { refs, ...floating } = (0, hint_1.useHintFloating)({ open, onOpenChange: setOpen });
|
|
98
|
+
// пользовательское взаимодействие
|
|
99
|
+
const { getReferenceProps, getFloatingProps } = (0, hint_1.useHintOnHover)(floating);
|
|
100
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cx('root'), children: [failed && (0, jsx_runtime_1.jsx)(img_stub_1.ImgStub, { className: cx('stub') }), !failed && ((0, jsx_runtime_1.jsx)("img", { "data-testid": 'gallery-modal:360-current-photo', ref: imageRef, src: photos[index] })), !failed && controls && ((0, jsx_runtime_1.jsxs)("div", { className: cx('controls'), children: [(0, jsx_runtime_1.jsx)("button", { className: cx('control', 'turn'), disabled: autoplay, onPointerDown: ChangeState('turn-left'), onPointerUp: ChangeState('default'), onPointerLeave: ChangeState('default'), "data-testid": 'gallery-modal:360-turn-left-button', children: (0, jsx_runtime_1.jsx)(ArrowTurnRight_1.default, {}) }), (0, jsx_runtime_1.jsx)("button", { ref: refs.setReference, ...getReferenceProps(), className: cx('control', 'primary', autoplay && 'pause'), onClick: () => {
|
|
101
|
+
setState(s => (s === 'autoplay' ? 'default' : 'autoplay'));
|
|
102
|
+
}, "data-testid": 'gallery-modal:toggle-autoplay-button', children: autoplay ? (0, jsx_runtime_1.jsx)(Pause_1.default, {}) : (0, jsx_runtime_1.jsx)(Viewing360Perspective_1.default, {}) }), autoplay && ((0, jsx_runtime_1.jsx)(hint_1.Hint, { open: open, hintRef: refs.setFloating, arrowRef: refs.setArrow, ...getFloatingProps(), children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\u0440\u0430\u0449\u0430\u0442\u044C \u0442\u043E\u0432\u0430\u0440,", (0, jsx_runtime_1.jsx)("br", {}), "\u0437\u0430\u0436\u0430\u0432 \u043B\u0435\u0432\u0443\u044E \u043A\u043D\u043E\u043F\u043A\u0443", (0, jsx_runtime_1.jsx)("br", {}), "\u043C\u044B\u0448\u0438 \u043D\u0430 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438"] }) })), (0, jsx_runtime_1.jsx)("button", { className: cx('control', 'turn'), disabled: autoplay, onPointerDown: ChangeState('turn-right'), onPointerUp: ChangeState('default'), onPointerLeave: ChangeState('default'), "data-testid": 'gallery-modal:360-turn-right-button', children: (0, jsx_runtime_1.jsx)(ArrowTurnLeft_1.default, {}) })] }))] }));
|
|
119
103
|
};
|
|
120
104
|
exports.AllRoundView = AllRoundView;
|
|
105
|
+
//# sourceMappingURL=all-round-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all-round-view.js","sourceRoot":"","sources":["../../../../../src/desktop/components/gallery-modal/components/all-round-view.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAAoD;AACpD,wDAA8D;AAC9D,4DAAoD;AACpD,oCAAyC;AACzC,2DAAyC;AACzC,oFAA6C;AAC7C,0HAAwF;AACxF,0FAAqE;AACrE,2GAAiF;AACjF,6GAAmF;AACnF,qEAAiE;AACjE,sDAAoF;AAWpF,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,+BAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,KAAK,EAAE,SAAS,GAAG,UAAU,EAC7B,aAAa,GACK,EAAE,EAAE;IACtB,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,IAAA,cAAM,EAA6C,IAAI,CAAC,CAAC;IAE9E,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAY,SAAS,CAAC,CAAC;IAEzD,IAAA,iBAAS,EAAC,GAAG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AI,CAAC,QAAQ,KACnB,gBAAgB,EAAE,YAEtB,6LAEE,gCAAM,wGAEN,gCAAM,0GAEL,GACE,CACR,EAED,mCACE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,EAChC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,WAAW,CAAC,YAAY,CAAC,EACxC,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,EACnC,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,iBAC1B,qCAAqC,YAEjD,uBAAC,uBAAW,KAAG,GACR,IACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAvKW,QAAA,YAAY,gBAuKvB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { MediaData } from '../types';
|
|
3
|
-
import { ModalProps } from '@sima-land/ui-nucleons/modal';
|
|
4
3
|
import { ReviewInfoProps } from './review-info';
|
|
5
|
-
export interface GalleryModalProps
|
|
4
|
+
export interface GalleryModalProps {
|
|
6
5
|
/** Список медиа. */
|
|
7
6
|
media: MediaData[];
|
|
8
7
|
/** Индекс начального выбранного элемента из списка медиа. */
|
|
@@ -16,11 +15,11 @@ export interface GalleryModalProps extends Pick<ModalProps, 'withScrollDisable'
|
|
|
16
15
|
/** Будет вызвана при закрытии. */
|
|
17
16
|
onClose?: () => void;
|
|
18
17
|
/** Будет вызвана при событиях проигрывания видео. */
|
|
19
|
-
onVideoEvent?: (event:
|
|
18
|
+
onVideoEvent?: (event: SyntheticEvent<HTMLVideoElement>) => void;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
21
|
* Полноэкранное модальное окно галереи фото/видео.
|
|
23
22
|
* @param props Свойства.
|
|
24
23
|
* @return Элемент.
|
|
25
24
|
*/
|
|
26
|
-
export declare const GalleryModal: ({ media, defaultMediaIndex, review, onClose, onGoToReview, onMediaChange,
|
|
25
|
+
export declare const GalleryModal: ({ media, defaultMediaIndex, review, onClose, onGoToReview, onMediaChange, onVideoEvent, }: GalleryModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,72 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
4
|
};
|
|
39
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
6
|
exports.GalleryModal = void 0;
|
|
41
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
42
9
|
const layout_1 = require("@sima-land/ui-nucleons/layout");
|
|
43
|
-
const
|
|
10
|
+
const helpers_1 = require("@sima-land/ui-nucleons/helpers");
|
|
44
11
|
const modal_1 = require("@sima-land/ui-nucleons/modal");
|
|
45
12
|
const arrow_button_1 = require("@sima-land/ui-nucleons/arrow-button");
|
|
46
13
|
const all_round_view_1 = require("./all-round-view");
|
|
47
14
|
const review_info_1 = require("./review-info");
|
|
48
15
|
const image_overlay_1 = require("./image-overlay");
|
|
49
16
|
const thumbnail_1 = require("./thumbnail");
|
|
50
|
-
const
|
|
17
|
+
const hooks_1 = require("@sima-land/ui-nucleons/hooks");
|
|
51
18
|
const utils_1 = require("../utils");
|
|
52
19
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
53
|
-
const
|
|
54
|
-
const
|
|
20
|
+
const gallery_modal_m_scss_1 = __importDefault(require("./gallery-modal.m.scss"));
|
|
21
|
+
const top_bar_1 = require("@sima-land/ui-nucleons/top-bar");
|
|
22
|
+
const cx = bind_1.default.bind(gallery_modal_m_scss_1.default);
|
|
55
23
|
/**
|
|
56
24
|
* Полноэкранное модальное окно галереи фото/видео.
|
|
57
25
|
* @param props Свойства.
|
|
58
26
|
* @return Элемент.
|
|
59
27
|
*/
|
|
60
|
-
const GalleryModal = ({ media, defaultMediaIndex = 0, review, onClose, onGoToReview, onMediaChange,
|
|
28
|
+
const GalleryModal = ({ media, defaultMediaIndex = 0, review, onClose, onGoToReview, onMediaChange, onVideoEvent, }) => {
|
|
61
29
|
const [currentIndex, setCurrent] = (0, react_1.useState)(defaultMediaIndex);
|
|
62
30
|
const rootRef = (0, react_1.useRef)(null);
|
|
63
|
-
const handlerRef = (0,
|
|
31
|
+
const handlerRef = (0, hooks_1.useIdentityRef)(onMediaChange);
|
|
64
32
|
const thumbnailsRef = (0, react_1.useRef)(null);
|
|
65
33
|
(0, react_1.useEffect)(() => {
|
|
66
34
|
var _a;
|
|
67
35
|
(_a = handlerRef.current) === null || _a === void 0 ? void 0 : _a.call(handlerRef, media[currentIndex], currentIndex);
|
|
68
36
|
thumbnailsRef.current &&
|
|
69
|
-
(0,
|
|
37
|
+
(0, helpers_1.scrollToChild)(thumbnailsRef.current, thumbnailsRef.current.children[currentIndex]);
|
|
70
38
|
}, [currentIndex]);
|
|
71
39
|
const size = (0, utils_1.useSquareFit)(rootRef, { hasReview: Boolean(review) });
|
|
72
40
|
const style = size
|
|
@@ -75,21 +43,10 @@ const GalleryModal = ({ media, defaultMediaIndex = 0, review, onClose, onGoToRev
|
|
|
75
43
|
'--all-round-view-size': `${size}px`,
|
|
76
44
|
}
|
|
77
45
|
: {};
|
|
78
|
-
return (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
react_1.default.createElement("div", { className: cx('main') },
|
|
83
|
-
react_1.default.createElement("div", { className: cx('thumbnails'), ref: thumbnailsRef }, media.map((item, index) => (react_1.default.createElement(thumbnail_1.Thumbnail, Object.assign({ key: index, className: cx('thumbnail'), type: item.type, checked: index === currentIndex, onClick: () => setCurrent(index) }, (item.type === 'image' && {
|
|
84
|
-
src: item.data.thumbnailSrc,
|
|
85
|
-
alt: item.data.alt || '',
|
|
86
|
-
})))))),
|
|
87
|
-
react_1.default.createElement("div", { className: cx('square') },
|
|
88
|
-
react_1.default.createElement(Media, Object.assign({}, media[currentIndex], { onVideoEvent: onVideoEvent })),
|
|
89
|
-
media.length > 1 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
90
|
-
react_1.default.createElement(arrow_button_1.ArrowButton, { direction: 'left', className: cx('button', 'left'), onClick: () => setCurrent((media.length + currentIndex - 1) % media.length), "data-testid": 'gallery-modal:prev-media-button' }),
|
|
91
|
-
react_1.default.createElement(arrow_button_1.ArrowButton, { direction: 'right', className: cx('button', 'right'), onClick: () => setCurrent((currentIndex + 1) % media.length), "data-testid": 'gallery-modal:next-media-button' })))))),
|
|
92
|
-
size !== null && (react_1.default.createElement("div", { className: cx('footer'), style: style }, review && react_1.default.createElement(review_info_1.ReviewInfo, Object.assign({}, review, { onGoToReview: onGoToReview })))))));
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(modal_1.Modal, { size: 'fullscreen', onClose: onClose, children: [(0, jsx_runtime_1.jsx)(top_bar_1.TopBar, { buttons: (0, top_bar_1.navigationButtons)({ onClose }) }), (0, jsx_runtime_1.jsxs)(modal_1.ModalBody, { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)(layout_1.DesktopLayout, { className: cx('root'), ref: rootRef, style: style, children: (0, jsx_runtime_1.jsxs)("div", { className: cx('main'), children: [(0, jsx_runtime_1.jsx)("div", { className: cx('thumbnails'), ref: thumbnailsRef, children: media.map((item, index) => ((0, jsx_runtime_1.jsx)(thumbnail_1.Thumbnail, { className: cx('thumbnail'), type: item.type, checked: index === currentIndex, onClick: () => setCurrent(index), ...(item.type === 'image' && {
|
|
47
|
+
src: item.data.thumbnailSrc,
|
|
48
|
+
alt: item.data.alt || '',
|
|
49
|
+
}) }, index))) }), (0, jsx_runtime_1.jsxs)("div", { className: cx('square'), children: [(0, jsx_runtime_1.jsx)(Media, { ...media[currentIndex], onVideoEvent: onVideoEvent }), media.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(arrow_button_1.ArrowButton, { direction: 'left', className: cx('button', 'left'), onClick: () => setCurrent((media.length + currentIndex - 1) % media.length), "data-testid": 'gallery-modal:prev-media-button' }), (0, jsx_runtime_1.jsx)(arrow_button_1.ArrowButton, { direction: 'right', className: cx('button', 'right'), onClick: () => setCurrent((currentIndex + 1) % media.length), "data-testid": 'gallery-modal:next-media-button' })] }))] })] }) }), size !== null && ((0, jsx_runtime_1.jsx)("div", { className: cx('footer'), style: style, children: review && (0, jsx_runtime_1.jsx)(review_info_1.ReviewInfo, { ...review, onGoToReview: onGoToReview }) }))] })] }));
|
|
93
50
|
};
|
|
94
51
|
exports.GalleryModal = GalleryModal;
|
|
95
52
|
/**
|
|
@@ -97,12 +54,5 @@ exports.GalleryModal = GalleryModal;
|
|
|
97
54
|
* @param props Свойства.
|
|
98
55
|
* @return Элемент.
|
|
99
56
|
*/
|
|
100
|
-
const Media = (
|
|
101
|
-
|
|
102
|
-
return (react_1.default.createElement("div", { className: cx('media') },
|
|
103
|
-
media.type === 'image' && (react_1.default.createElement(image_overlay_1.ImageOverlay, { className: cx('media-image-wrap') },
|
|
104
|
-
react_1.default.createElement("img", { src: media.data.src, alt: media.data.alt || '' }))),
|
|
105
|
-
media.type === 'video' && (react_1.default.createElement("video", { autoPlay: true, controls: true, controlsList: 'nodownload', onPlay: onVideoEvent, onPause: onVideoEvent, onEnded: onVideoEvent },
|
|
106
|
-
react_1.default.createElement("source", { src: media.data.src }))),
|
|
107
|
-
media.type === '360' && react_1.default.createElement(all_round_view_1.AllRoundView, { photos: media.data.photos })));
|
|
108
|
-
};
|
|
57
|
+
const Media = ({ onVideoEvent, ...media }) => ((0, jsx_runtime_1.jsxs)("div", { className: cx('media'), children: [media.type === 'image' && ((0, jsx_runtime_1.jsx)(image_overlay_1.ImageOverlay, { className: cx('media-image-wrap'), children: (0, jsx_runtime_1.jsx)("img", { src: media.data.src, alt: media.data.alt || '' }) })), media.type === 'video' && ((0, jsx_runtime_1.jsx)("video", { autoPlay: true, controls: true, controlsList: 'nodownload', onPlay: onVideoEvent, onPause: onVideoEvent, onEnded: onVideoEvent, children: (0, jsx_runtime_1.jsx)("source", { src: media.data.src }) })), media.type === '360' && (0, jsx_runtime_1.jsx)(all_round_view_1.AllRoundView, { photos: media.data.photos })] }));
|
|
58
|
+
//# sourceMappingURL=gallery-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery-modal.js","sourceRoot":"","sources":["../../../../../src/desktop/components/gallery-modal/components/gallery-modal.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAAmF;AAEnF,0DAA8D;AAC9D,4DAA+D;AAC/D,wDAAgE;AAChE,sEAAkE;AAClE,qDAAgD;AAChD,+CAA4D;AAC5D,mDAA+C;AAC/C,2CAAwC;AACxC,wDAA8D;AAC9D,oCAAwC;AACxC,2DAAyC;AACzC,kFAA4C;AAC5C,4DAA2E;AA8B3E,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,8BAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,iBAAiB,GAAG,CAAC,EACrB,MAAM,EACN,OAAO,EACP,YAAY,EACZ,aAAa,EACb,YAAY,GACM,EAAE,EAAE;IACtB,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAS,iBAAiB,CAAC,CAAC;IAEvE,MAAM,OAAO,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,sBAAc,EAAC,aAAa,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAEnD,IAAA,iBAAS,EAAC,GAAG,EAAE;;QACb,MAAA,UAAU,CAAC,OAAO,2DAAG,KAAK,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC;QAExD,aAAa,CAAC,OAAO;YACnB,IAAA,uBAAa,EACX,aAAa,CAAC,OAAO,EACrB,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB,CAC5D,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AC,kBAAkB,CAAC,YAC7C,gCAAK,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,GAAI,GAC1C,CAChB,EACA,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,CACzB,kCACE,QAAQ,QACR,QAAQ,QACR,YAAY,EAAC,YAAY,EACzB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,YAErB,mCAAQ,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,GAAI,GACzB,CACT,EACA,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,uBAAC,6BAAY,IAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,GAAI,IAChE,CACP,CAAC"}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
@use 'node_modules/@sima-land/ui-nucleons/utils';
|
|
3
3
|
|
|
4
4
|
.root {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
right: 0;
|
|
8
10
|
display: flex;
|
|
9
11
|
flex-direction: column;
|
|
10
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type ImageOverlayProps =
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type ImageOverlayProps = HTMLAttributes<HTMLDivElement>;
|
|
3
3
|
/**
|
|
4
4
|
* Полупрозрачный слой над картинкой по дизайн-гайдам.
|
|
5
5
|
* @param props Свойства.
|
|
6
6
|
* @return Элемент.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ImageOverlay: ({ className, children, ...restProps }: ImageOverlayProps) => JSX.Element;
|
|
8
|
+
export declare const ImageOverlay: ({ className, children, ...restProps }: ImageOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
6
|
exports.ImageOverlay = void 0;
|
|
18
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
8
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
const
|
|
9
|
+
const image_overlay_m_scss_1 = __importDefault(require("./image-overlay.m.scss"));
|
|
21
10
|
/**
|
|
22
11
|
* Полупрозрачный слой над картинкой по дизайн-гайдам.
|
|
23
12
|
* @param props Свойства.
|
|
24
13
|
* @return Элемент.
|
|
25
14
|
*/
|
|
26
|
-
const ImageOverlay = (
|
|
27
|
-
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
28
|
-
return (react_1.default.createElement("div", Object.assign({ className: (0, classnames_1.default)(image_overlay_module_scss_1.default.root, className) }, restProps), children));
|
|
29
|
-
};
|
|
15
|
+
const ImageOverlay = ({ className, children, ...restProps }) => ((0, jsx_runtime_1.jsx)("span", { className: (0, classnames_1.default)(image_overlay_m_scss_1.default.root, className), ...restProps, children: children }));
|
|
30
16
|
exports.ImageOverlay = ImageOverlay;
|
|
17
|
+
//# sourceMappingURL=image-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-overlay.js","sourceRoot":"","sources":["../../../../../src/desktop/components/gallery-modal/components/image-overlay.tsx"],"names":[],"mappings":";;;;;;;AACA,4DAA4B;AAC5B,kFAA4C;AAI5C;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAqB,EAAE,EAAE,CAAC,CACxF,iCAAM,SAAS,EAAE,IAAA,oBAAE,EAAC,8BAAM,CAAC,IAAI,EAAE,SAAS,CAAC,KAAM,SAAS,YACvD,QAAQ,GACJ,CACR,CAAC;AAJW,QAAA,YAAY,gBAIvB"}
|
|
@@ -13,4 +13,4 @@ export interface ReviewInfoProps {
|
|
|
13
13
|
* @param props Свойства.
|
|
14
14
|
* @return Элемент.
|
|
15
15
|
*/
|
|
16
|
-
export declare const ReviewInfo: ({ rating, author, onGoToReview, content, className, notAffectRating, loading, }: ReviewInfoProps) => JSX.Element;
|
|
16
|
+
export declare const ReviewInfo: ({ rating, author, onGoToReview, content, className, notAffectRating, loading, }: ReviewInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,41 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.ReviewInfo = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const link_1 = require("@sima-land/ui-nucleons/link");
|
|
32
10
|
const rating_1 = require("@sima-land/ui-nucleons/rating");
|
|
33
11
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
12
|
+
const review_info_m_scss_1 = __importDefault(require("./review-info.m.scss"));
|
|
13
|
+
const helpers_1 = require("@sima-land/ui-nucleons/helpers");
|
|
14
|
+
const styling_1 = require("@sima-land/ui-nucleons/styling");
|
|
37
15
|
const custom_scrollbar_1 = require("@sima-land/ui-nucleons/_internal/custom-scrollbar");
|
|
38
|
-
const cx = bind_1.default.bind(
|
|
16
|
+
const cx = bind_1.default.bind(review_info_m_scss_1.default);
|
|
39
17
|
/**
|
|
40
18
|
* Отзыв.
|
|
41
19
|
* @param props Свойства.
|
|
@@ -57,23 +35,8 @@ const ReviewInfo = ({ rating, author, onGoToReview, content, className, notAffec
|
|
|
57
35
|
}, [content, author]);
|
|
58
36
|
(0, react_1.useEffect)(checkClamp, [content, opened]);
|
|
59
37
|
// @todo что делать если при изменении размеров изменилось состояние обрезания?
|
|
60
|
-
(0, react_1.useEffect)(() => (0,
|
|
61
|
-
return (
|
|
62
|
-
loading && (react_1.default.createElement(Layout, null,
|
|
63
|
-
react_1.default.createElement(LoadingView, null))),
|
|
64
|
-
!loading && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
65
|
-
react_1.default.createElement(Layout, { className: cx('header') },
|
|
66
|
-
react_1.default.createElement("div", { className: cx('rating') }, notAffectRating ? 'Не влияет на рейтинг' : react_1.default.createElement(rating_1.Rating, { value: rating })),
|
|
67
|
-
react_1.default.createElement("div", { className: cx('author') }, author),
|
|
68
|
-
onGoToReview && (react_1.default.createElement(link_1.Link, { className: cx('link'), pseudo: true, onClick: onGoToReview, "data-testid": 'gallery-modal:go-to-review-link' }, "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u0442\u0437\u044B\u0432\u0443"))),
|
|
69
|
-
content && !opened && (react_1.default.createElement(Layout, null,
|
|
70
|
-
react_1.default.createElement("div", { ref: contentRef, className: cx('content'), "data-testid": 'review-info:collapsed-content' }, content))),
|
|
71
|
-
content && opened && (react_1.default.createElement(custom_scrollbar_1.CustomScrollbar, { className: cx('content', 'opened') },
|
|
72
|
-
react_1.default.createElement(Layout, null,
|
|
73
|
-
react_1.default.createElement("div", { "data-testid": 'review-info:expanded-content' }, content),
|
|
74
|
-
react_1.default.createElement(link_1.Link, { pseudo: true, onClick: () => setOpened(false), "data-testid": 'review-info:collapse' }, "\u0421\u043A\u0440\u044B\u0442\u044C \u043E\u0442\u0437\u044B\u0432")))),
|
|
75
|
-
content && !opened && clamped && (react_1.default.createElement(Layout, null,
|
|
76
|
-
react_1.default.createElement(link_1.Link, { pseudo: true, onClick: () => setOpened(true), "data-testid": 'review-info:expand' }, "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E")))))));
|
|
38
|
+
(0, react_1.useEffect)(() => (0, helpers_1.on)(window, 'resize', checkClamp), [content, checkClamp]);
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cx('root', className, opened && styling_1.BoxShadow.z2straight), children: [loading && ((0, jsx_runtime_1.jsx)(Layout, { children: (0, jsx_runtime_1.jsx)(LoadingView, {}) })), !loading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Layout, { className: cx('header'), children: [(0, jsx_runtime_1.jsx)("div", { className: cx('rating'), children: notAffectRating ? 'Не влияет на рейтинг' : (0, jsx_runtime_1.jsx)(rating_1.Rating, { value: rating }) }), (0, jsx_runtime_1.jsx)("div", { className: cx('author'), children: author }), onGoToReview && ((0, jsx_runtime_1.jsx)(link_1.Link, { className: cx('link'), pseudo: true, onClick: onGoToReview, "data-testid": 'gallery-modal:go-to-review-link', children: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u0442\u0437\u044B\u0432\u0443" }))] }), content && !opened && ((0, jsx_runtime_1.jsx)(Layout, { children: (0, jsx_runtime_1.jsx)("div", { ref: contentRef, className: cx('content'), "data-testid": 'review-info:collapsed-content', children: content }) })), content && opened && ((0, jsx_runtime_1.jsx)(custom_scrollbar_1.CustomScrollbar, { className: cx('content', 'opened'), children: (0, jsx_runtime_1.jsxs)(Layout, { children: [(0, jsx_runtime_1.jsx)("div", { "data-testid": 'review-info:expanded-content', children: content }), (0, jsx_runtime_1.jsx)(link_1.Link, { pseudo: true, onClick: () => setOpened(false), "data-testid": 'review-info:collapse', children: "\u0421\u043A\u0440\u044B\u0442\u044C \u043E\u0442\u0437\u044B\u0432" })] }) })), content && !opened && clamped && ((0, jsx_runtime_1.jsx)(Layout, { children: (0, jsx_runtime_1.jsx)(link_1.Link, { pseudo: true, onClick: () => setOpened(true), "data-testid": 'review-info:expand', children: "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E" }) }))] }))] }));
|
|
77
40
|
};
|
|
78
41
|
exports.ReviewInfo = ReviewInfo;
|
|
79
42
|
/**
|
|
@@ -82,17 +45,13 @@ exports.ReviewInfo = ReviewInfo;
|
|
|
82
45
|
* @return Элемент.
|
|
83
46
|
*/
|
|
84
47
|
function Layout({ className, children }) {
|
|
85
|
-
return
|
|
48
|
+
return (0, jsx_runtime_1.jsx)("div", { className: cx(className, 'layout'), children: children });
|
|
86
49
|
}
|
|
87
50
|
/**
|
|
88
51
|
* Отображение загрузки данных отзыва.
|
|
89
52
|
* @return Элемент.
|
|
90
53
|
*/
|
|
91
54
|
function LoadingView() {
|
|
92
|
-
return (
|
|
93
|
-
react_1.default.createElement("div", { className: cx('head') },
|
|
94
|
-
react_1.default.createElement("div", { className: cx('text', 'name') }),
|
|
95
|
-
react_1.default.createElement(link_1.Link, { pseudo: true, disabled: true, className: cx('button') }, "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u0442\u0437\u044B\u0432\u0443")),
|
|
96
|
-
react_1.default.createElement("div", { className: cx('text') }),
|
|
97
|
-
react_1.default.createElement("div", { className: cx('text') })));
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cx('loading'), children: [(0, jsx_runtime_1.jsxs)("div", { className: cx('head'), children: [(0, jsx_runtime_1.jsx)("div", { className: cx('text', 'name') }), (0, jsx_runtime_1.jsx)(link_1.Link, { pseudo: true, disabled: true, className: cx('button'), children: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u0442\u0437\u044B\u0432\u0443" })] }), (0, jsx_runtime_1.jsx)("div", { className: cx('text') }), (0, jsx_runtime_1.jsx)("div", { className: cx('text') })] }));
|
|
98
56
|
}
|
|
57
|
+
//# sourceMappingURL=review-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-info.js","source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C,MAAM,IAAI,OAAO,IAAI,CAChC,uBAAC,MAAM,cACL,uBAAC,WAAI,IAAC,MAAM,QAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAc,oBAAoB,wHAEtE,GACA,CACV,IACA,CACJ,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AA/FW,QAAA,UAAU,cA+FrB;AAEF;;;;GAIG;AACH,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAA+C;IAClF,OAAO,gCAAK,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,YAAG,QAAQ,GAAO,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW;IAClB,OAAO,CACL,iCAAK,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,aAC3B,iCAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aACxB,gCAAK,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAQ,EAC1C,uBAAC,WAAI,IAAC,MAAM,QAAC,QAAQ,QAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,uGAEtC,IACH,EACN,gCAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,GAAQ,EAClC,gCAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,GAAQ,IAC9B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { MouseEventHandler } from 'react';
|
|
2
2
|
import { MediaType } from '../types';
|
|
3
3
|
export interface ThumbnailProps {
|
|
4
4
|
type: MediaType;
|
|
5
5
|
src?: string;
|
|
6
6
|
alt?: string;
|
|
7
7
|
checked?: boolean;
|
|
8
|
-
onClick?:
|
|
8
|
+
onClick?: MouseEventHandler;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -13,4 +13,4 @@ export interface ThumbnailProps {
|
|
|
13
13
|
* @param props Свойства.
|
|
14
14
|
* @return Элемент.
|
|
15
15
|
*/
|
|
16
|
-
export declare const Thumbnail: ({ type, src, alt, checked, onClick, className }: ThumbnailProps) => JSX.Element;
|
|
16
|
+
export declare const Thumbnail: ({ type, src, alt, checked, onClick, className }: ThumbnailProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,21 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Thumbnail = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const image_overlay_1 = require("./image-overlay");
|
|
9
|
-
const
|
|
9
|
+
const Play_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Filled/Play"));
|
|
10
10
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const cx = bind_1.default.bind(
|
|
11
|
+
const thumbnail_m_scss_1 = __importDefault(require("./thumbnail.m.scss"));
|
|
12
|
+
const Viewing360Perspective_1 = __importDefault(require("@sima-land/ui-quarks/icons/40x40/Filled/Viewing360Perspective"));
|
|
13
|
+
const cx = bind_1.default.bind(thumbnail_m_scss_1.default);
|
|
14
14
|
/**
|
|
15
15
|
* Превью медиа.
|
|
16
16
|
* @param props Свойства.
|
|
17
17
|
* @return Элемент.
|
|
18
18
|
*/
|
|
19
|
-
const Thumbnail = ({ type, src, alt, checked, onClick, className }) => (
|
|
20
|
-
type === '360' && react_1.default.createElement(_360_svg_1.default, { fill: 'currentColor' }),
|
|
21
|
-
type === 'video' && react_1.default.createElement(play_1.default, { width: 32, height: 32, fill: 'currentColor' }),
|
|
22
|
-
src && (react_1.default.createElement(image_overlay_1.ImageOverlay, { className: cx('image-overlay') },
|
|
23
|
-
react_1.default.createElement("img", { src: src, alt: alt })))));
|
|
19
|
+
const Thumbnail = ({ type, src, alt, checked, onClick, className }) => ((0, jsx_runtime_1.jsxs)("button", { className: cx('root', type !== 'image' && 'iconic', { checked }, className), onClick: onClick, "data-testid": 'gallery-modal:thumbnail', children: [type === '360' && (0, jsx_runtime_1.jsx)(Viewing360Perspective_1.default, { fill: 'currentColor' }), type === 'video' && (0, jsx_runtime_1.jsx)(Play_1.default, { width: 32, height: 32, fill: 'currentColor' }), src && ((0, jsx_runtime_1.jsx)(image_overlay_1.ImageOverlay, { className: cx('image-overlay'), children: (0, jsx_runtime_1.jsx)("img", { src: src, alt: alt }) }))] }));
|
|
24
20
|
exports.Thumbnail = Thumbnail;
|
|
21
|
+
//# sourceMappingURL=thumbnail.js.map
|