@alfalab/core-components 47.12.1-beta.1 → 47.13.0-beta.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/gallery/Component.js +12 -29
- package/gallery/components/header/Component.js +13 -0
- package/gallery/components/header-mobile/Component.js +3 -6
- package/gallery/components/header-mobile/index.d.ts +1 -1
- package/gallery/components/header-mobile/index.js +6 -0
- package/gallery/components/image-preview/Component.js +44 -17
- package/gallery/components/image-preview/index.css +0 -2
- package/gallery/components/image-viewer/component.js +3 -2
- package/gallery/components/image-viewer/index.css +0 -2
- package/gallery/components/image-viewer/slide.js +1 -1
- package/gallery/components/image-viewer/video/index.css +4 -4
- package/gallery/components/image-viewer/video/index.d.ts +2 -1
- package/gallery/components/image-viewer/video/index.js +28 -23
- package/gallery/components/index.d.ts +2 -0
- package/gallery/components/index.js +4 -0
- package/gallery/components/info-bar/Component.js +18 -7
- package/gallery/components/info-bar/index.css +4 -4
- package/gallery/components/info-bar/index.d.ts +1 -1
- package/gallery/components/info-bar/index.js +6 -0
- package/gallery/components/navigation-bar/Component.js +3 -4
- package/gallery/cssm/Component.js +12 -29
- package/gallery/cssm/components/header/Component.js +13 -0
- package/gallery/cssm/components/header-mobile/Component.js +3 -12
- package/gallery/cssm/components/header-mobile/index.d.ts +1 -1
- package/gallery/cssm/components/header-mobile/index.js +6 -0
- package/gallery/cssm/components/image-preview/Component.js +44 -17
- package/gallery/cssm/components/image-preview/index.module.css +0 -2
- package/gallery/cssm/components/image-viewer/component.js +2 -1
- package/gallery/cssm/components/image-viewer/index.module.css +0 -2
- package/gallery/cssm/components/image-viewer/slide.js +1 -1
- package/gallery/cssm/components/image-viewer/video/index.d.ts +2 -1
- package/gallery/cssm/components/image-viewer/video/index.js +27 -22
- package/gallery/cssm/components/image-viewer/video/index.module.css +4 -4
- package/gallery/cssm/components/index.d.ts +2 -0
- package/gallery/cssm/components/index.js +4 -0
- package/gallery/cssm/components/info-bar/Component.js +18 -13
- package/gallery/cssm/components/info-bar/index.d.ts +1 -1
- package/gallery/cssm/components/info-bar/index.js +6 -0
- package/gallery/cssm/components/info-bar/index.module.css +4 -4
- package/gallery/cssm/components/navigation-bar/Component.js +3 -4
- package/gallery/cssm/index.d.ts +1 -1
- package/gallery/cssm/index.js +1 -9
- package/gallery/cssm/utils/constants.d.ts +12 -1
- package/gallery/cssm/utils/constants.js +17 -0
- package/gallery/cssm/utils/index.js +6 -0
- package/gallery/esm/Component.js +19 -37
- package/gallery/esm/components/header/Component.js +14 -1
- package/gallery/esm/components/header-mobile/Component.js +3 -18
- package/gallery/esm/components/header-mobile/index.d.ts +1 -1
- package/gallery/esm/components/header-mobile/index.js +20 -1
- package/gallery/esm/components/image-preview/Component.js +44 -17
- package/gallery/esm/components/image-preview/index.css +0 -2
- package/gallery/esm/components/image-preview/index.js +1 -0
- package/gallery/esm/components/image-viewer/component.js +3 -4
- package/gallery/esm/components/image-viewer/index.css +0 -2
- package/gallery/esm/components/image-viewer/index.js +1 -3
- package/gallery/esm/components/image-viewer/slide.js +2 -4
- package/gallery/esm/components/image-viewer/video/index.css +4 -4
- package/gallery/esm/components/image-viewer/video/index.d.ts +2 -1
- package/gallery/esm/components/image-viewer/video/index.js +28 -22
- package/gallery/esm/components/index.d.ts +2 -0
- package/gallery/esm/components/index.js +4 -3
- package/gallery/esm/components/info-bar/Component.js +19 -20
- package/gallery/esm/components/info-bar/index.css +4 -4
- package/gallery/esm/components/info-bar/index.d.ts +1 -1
- package/gallery/esm/components/info-bar/index.js +20 -1
- package/gallery/esm/components/navigation-bar/Component.js +4 -3
- package/gallery/esm/components/navigation-bar/index.js +1 -1
- package/gallery/esm/index.d.ts +1 -1
- package/gallery/esm/index.js +11 -12
- package/gallery/esm/{slide-ca7119fa.js → slide-da05984b.js} +1 -3
- package/gallery/esm/utils/constants.d.ts +12 -1
- package/gallery/esm/utils/constants.js +12 -1
- package/gallery/esm/utils/index.js +1 -1
- package/gallery/index.d.ts +1 -1
- package/gallery/index.js +1 -9
- package/gallery/modern/Component.js +19 -37
- package/gallery/modern/components/header/Component.js +13 -1
- package/gallery/modern/components/header-mobile/Component.js +3 -18
- package/gallery/modern/components/header-mobile/index.d.ts +1 -1
- package/gallery/modern/components/header-mobile/index.js +19 -1
- package/gallery/modern/components/image-preview/Component.js +39 -13
- package/gallery/modern/components/image-preview/index.css +0 -2
- package/gallery/modern/components/image-preview/index.js +1 -0
- package/gallery/modern/components/image-viewer/component.js +3 -4
- package/gallery/modern/components/image-viewer/index.css +0 -2
- package/gallery/modern/components/image-viewer/index.js +1 -3
- package/gallery/modern/components/image-viewer/slide.js +2 -4
- package/gallery/modern/components/image-viewer/video/index.css +4 -4
- package/gallery/modern/components/image-viewer/video/index.d.ts +2 -1
- package/gallery/modern/components/image-viewer/video/index.js +28 -22
- package/gallery/modern/components/index.d.ts +2 -0
- package/gallery/modern/components/index.js +4 -3
- package/gallery/modern/components/info-bar/Component.js +18 -20
- package/gallery/modern/components/info-bar/index.css +4 -4
- package/gallery/modern/components/info-bar/index.d.ts +1 -1
- package/gallery/modern/components/info-bar/index.js +19 -1
- package/gallery/modern/components/navigation-bar/Component.js +4 -3
- package/gallery/modern/components/navigation-bar/index.js +1 -1
- package/gallery/modern/index.d.ts +1 -1
- package/gallery/modern/index.js +11 -12
- package/gallery/modern/{slide-e2bd02f9.js → slide-dac6462d.js} +1 -3
- package/gallery/modern/utils/constants.d.ts +12 -1
- package/gallery/modern/utils/constants.js +12 -1
- package/gallery/modern/utils/index.js +1 -1
- package/gallery/{slide-ebea0c09.js → slide-387e9068.js} +1 -1
- package/gallery/utils/constants.d.ts +12 -1
- package/gallery/utils/constants.js +17 -0
- package/gallery/utils/index.js +6 -0
- package/modal/components/controls/Component.js +1 -1
- package/modal/components/footer/Component.js +1 -1
- package/modal/esm/Component.responsive.js +1 -1
- package/modal/esm/components/controls/Component.js +1 -1
- package/modal/esm/components/controls/index.js +1 -1
- package/modal/esm/components/footer/Component.js +1 -1
- package/modal/esm/desktop/Component.desktop.js +1 -1
- package/modal/esm/desktop/index.js +1 -1
- package/modal/esm/index.js +1 -1
- package/modal/esm/mobile/Component.mobile.js +1 -1
- package/modal/esm/mobile/index.js +1 -1
- package/modal/modern/Component.responsive.js +1 -1
- package/modal/modern/components/controls/Component.js +1 -1
- package/modal/modern/components/controls/index.js +1 -1
- package/modal/modern/components/footer/Component.js +1 -1
- package/modal/modern/desktop/Component.desktop.js +1 -1
- package/modal/modern/desktop/index.js +1 -1
- package/modal/modern/index.js +1 -1
- package/modal/modern/mobile/Component.mobile.js +1 -1
- package/modal/modern/mobile/index.js +1 -1
- package/package.json +1 -1
- package/select/components/base-select/Component.js +2 -2
- package/select/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/select/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/select/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/select/esm/Component.responsive.js +3 -3
- package/select/esm/components/base-select/Component.js +2 -2
- package/select/esm/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/select/esm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/select/esm/components/base-select/components/list-mobile/list-mobile.js +1 -1
- package/select/esm/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/select/esm/components/base-select/index.js +2 -2
- package/select/esm/components/index.js +2 -2
- package/select/esm/desktop/Component.desktop.js +2 -2
- package/select/esm/desktop/index.js +2 -2
- package/select/esm/index.js +3 -3
- package/select/esm/mobile/Component.mobile.js +3 -3
- package/select/esm/mobile/Component.modal.mobile.js +3 -3
- package/select/esm/mobile/index.js +3 -3
- package/select/esm/presets/index.js +1 -1
- package/select/esm/presets/useSelectWithApply/hook.js +1 -1
- package/select/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/select/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/select/esm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/select/esm/shared/index.js +3 -3
- package/select/mobile/Component.mobile.js +1 -1
- package/select/modern/Component.responsive.js +3 -3
- package/select/modern/components/base-select/Component.js +2 -2
- package/select/modern/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/select/modern/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/select/modern/components/base-select/components/list-mobile/list-mobile.js +1 -1
- package/select/modern/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/select/modern/components/base-select/index.js +2 -2
- package/select/modern/components/index.js +2 -2
- package/select/modern/desktop/Component.desktop.js +2 -2
- package/select/modern/desktop/index.js +2 -2
- package/select/modern/index.js +3 -3
- package/select/modern/mobile/Component.mobile.js +3 -3
- package/select/modern/mobile/Component.modal.mobile.js +3 -3
- package/select/modern/mobile/index.js +3 -3
- package/select/modern/presets/index.js +1 -1
- package/select/modern/presets/useSelectWithApply/hook.js +1 -1
- package/select/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/select/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/select/modern/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/select/modern/shared/index.js +3 -3
- package/select/presets/index.js +1 -1
- package/select/presets/useSelectWithApply/hook.js +1 -1
- package/select/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/select/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/select/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/select/shared/index.js +1 -1
- package/side-panel/components/controls/Component.js +1 -1
- package/side-panel/components/footer/Component.js +1 -1
- package/side-panel/esm/Component.responsive.js +1 -1
- package/side-panel/esm/components/controls/Component.js +1 -1
- package/side-panel/esm/components/controls/index.js +1 -1
- package/side-panel/esm/components/footer/Component.desktop.js +1 -1
- package/side-panel/esm/components/footer/Component.js +1 -1
- package/side-panel/esm/components/footer/Component.mobile.js +1 -1
- package/side-panel/esm/desktop/Component.desktop.js +1 -1
- package/side-panel/esm/desktop/index.js +1 -1
- package/side-panel/esm/index.js +1 -1
- package/side-panel/esm/mobile/Component.mobile.js +1 -1
- package/side-panel/esm/mobile/index.js +1 -1
- package/side-panel/modern/Component.responsive.js +1 -1
- package/side-panel/modern/components/controls/Component.js +1 -1
- package/side-panel/modern/components/controls/index.js +1 -1
- package/side-panel/modern/components/footer/Component.desktop.js +1 -1
- package/side-panel/modern/components/footer/Component.js +1 -1
- package/side-panel/modern/components/footer/Component.mobile.js +1 -1
- package/side-panel/modern/desktop/Component.desktop.js +1 -1
- package/side-panel/modern/desktop/index.js +1 -1
- package/side-panel/modern/index.js +1 -1
- package/side-panel/modern/mobile/Component.mobile.js +1 -1
- package/side-panel/modern/mobile/index.js +1 -1
- package/themes/compiled/mobile-dark-bluetint.css +5 -5
- package/toast-plate/components/base-toast-plate/component.js +2 -2
- package/toast-plate/components/base-toast-plate/hooks/useDeprecatedBadge.js +1 -1
- package/toast-plate/components/base-toast-plate/utils/getBaseToastPlateTestIds.js +2 -2
- package/toast-plate/esm/Component.responsive.js +2 -2
- package/toast-plate/esm/components/base-toast-plate/component.js +2 -2
- package/toast-plate/esm/components/base-toast-plate/hooks/useDeprecatedBadge.js +1 -1
- package/toast-plate/esm/components/base-toast-plate/index.js +2 -2
- package/toast-plate/esm/components/base-toast-plate/utils/getBaseToastPlateTestIds.js +2 -2
- package/toast-plate/esm/desktop/Component.desktop.js +2 -2
- package/toast-plate/esm/desktop/index.js +2 -2
- package/toast-plate/esm/index-2f466837.d.ts +2 -2
- package/toast-plate/esm/index.js +2 -2
- package/toast-plate/esm/mobile/Component.mobile.js +2 -2
- package/toast-plate/esm/mobile/index.js +2 -2
- package/toast-plate/index-2f466837.d.ts +2 -2
- package/toast-plate/modern/Component.responsive.js +2 -2
- package/toast-plate/modern/components/base-toast-plate/component.js +2 -2
- package/toast-plate/modern/components/base-toast-plate/hooks/useDeprecatedBadge.js +1 -1
- package/toast-plate/modern/components/base-toast-plate/index.js +2 -2
- package/toast-plate/modern/components/base-toast-plate/utils/getBaseToastPlateTestIds.js +2 -2
- package/toast-plate/modern/desktop/Component.desktop.js +2 -2
- package/toast-plate/modern/desktop/index.js +2 -2
- package/toast-plate/modern/index-2f466837.d.ts +2 -2
- package/toast-plate/modern/index.js +2 -2
- package/toast-plate/modern/mobile/Component.mobile.js +2 -2
- package/toast-plate/modern/mobile/index.js +2 -2
- package/typography/esm/component.js +2 -2
- package/typography/esm/index.js +2 -2
- package/typography/esm/text/component.js +1 -1
- package/typography/esm/text/index.js +1 -1
- package/typography/esm/title/component.js +1 -1
- package/typography/esm/title/index.js +2 -2
- package/typography/esm/title-mobile/component.js +2 -2
- package/typography/esm/title-mobile/index.js +2 -2
- package/typography/esm/title-responsive/component.js +2 -2
- package/typography/esm/title-responsive/index.js +2 -2
- package/typography/modern/component.js +2 -2
- package/typography/modern/index.js +2 -2
- package/typography/modern/text/component.js +1 -1
- package/typography/modern/text/index.js +1 -1
- package/typography/modern/title/component.js +1 -1
- package/typography/modern/title/index.js +2 -2
- package/typography/modern/title-mobile/component.js +2 -2
- package/typography/modern/title-mobile/index.js +2 -2
- package/typography/modern/title-responsive/component.js +2 -2
- package/typography/modern/title-responsive/index.js +2 -2
- package/typography/text/component.js +1 -1
- package/typography/title/component.js +1 -1
- package/typography/title/index.js +1 -1
- package/typography/title-mobile/component.js +1 -1
- package/typography/title-responsive/component.js +1 -1
- /package/gallery/esm/{slide-ca7119fa.d.ts → slide-da05984b.d.ts} +0 -0
- /package/gallery/modern/{slide-e2bd02f9.d.ts → slide-dac6462d.d.ts} +0 -0
- /package/gallery/{slide-ebea0c09.d.ts → slide-387e9068.d.ts} +0 -0
- /package/modal/esm/{layout.module-6361424d.js → layout.module-94caa56e.js} +0 -0
- /package/modal/{layout.module-3fc11792.js → layout.module-4c01904f.js} +0 -0
- /package/modal/modern/{layout.module-e0e30502.js → layout.module-db207304.js} +0 -0
- /package/select/esm/{hook-3b730828.d.ts → hook-2ac6d7d4.d.ts} +0 -0
- /package/select/esm/{hook-3b730828.js → hook-2ac6d7d4.js} +0 -0
- /package/select/esm/{list-popover-desktop-aec914e9.d.ts → list-popover-desktop-20c87b82.d.ts} +0 -0
- /package/select/esm/{list-popover-desktop-aec914e9.js → list-popover-desktop-20c87b82.js} +0 -0
- /package/select/esm/{mobile.module-ae380d17.js → mobile.module-6dbbc4d9.js} +0 -0
- /package/select/{hook-20696959.d.ts → hook-3b0516fb.d.ts} +0 -0
- /package/select/{hook-20696959.js → hook-3b0516fb.js} +0 -0
- /package/select/{list-popover-desktop-ba96cd50.d.ts → list-popover-desktop-447ef64d.d.ts} +0 -0
- /package/select/{list-popover-desktop-ba96cd50.js → list-popover-desktop-447ef64d.js} +0 -0
- /package/select/{mobile.module-c6e0a17d.js → mobile.module-0f5968f6.js} +0 -0
- /package/select/modern/{hook-08cacbab.d.ts → hook-587f20b6.d.ts} +0 -0
- /package/select/modern/{hook-08cacbab.js → hook-587f20b6.js} +0 -0
- /package/select/modern/{list-popover-desktop-65d415ed.d.ts → list-popover-desktop-d2b7aabc.d.ts} +0 -0
- /package/select/modern/{list-popover-desktop-65d415ed.js → list-popover-desktop-d2b7aabc.js} +0 -0
- /package/select/modern/{mobile.module-c16635d6.js → mobile.module-7d3202b8.js} +0 -0
- /package/side-panel/esm/{layout.module-8f998738.js → layout.module-b79af139.js} +0 -0
- /package/side-panel/{layout.module-2364c729.js → layout.module-6e8d2296.js} +0 -0
- /package/side-panel/modern/{layout.module-c793f704.js → layout.module-549d23fa.js} +0 -0
- /package/toast-plate/{PortalContext-5d1c35c9.d.ts → PortalContext-812e773a.d.ts} +0 -0
- /package/toast-plate/{PortalContext-5d1c35c9.js → PortalContext-812e773a.js} +0 -0
- /package/toast-plate/esm/{PortalContext-76e29fb0.d.ts → PortalContext-b4370e67.d.ts} +0 -0
- /package/toast-plate/esm/{PortalContext-76e29fb0.js → PortalContext-b4370e67.js} +0 -0
- /package/toast-plate/esm/{getDataTestId-9959edc4.d.ts → getDataTestId-11a376e0.d.ts} +0 -0
- /package/toast-plate/esm/{getDataTestId-9959edc4.js → getDataTestId-11a376e0.js} +0 -0
- /package/toast-plate/{getDataTestId-bf909aba.d.ts → getDataTestId-316e89c4.d.ts} +0 -0
- /package/toast-plate/{getDataTestId-bf909aba.js → getDataTestId-316e89c4.js} +0 -0
- /package/toast-plate/modern/{PortalContext-de359614.d.ts → PortalContext-6bf9a525.d.ts} +0 -0
- /package/toast-plate/modern/{PortalContext-de359614.js → PortalContext-6bf9a525.js} +0 -0
- /package/toast-plate/modern/{getDataTestId-0f89d772.d.ts → getDataTestId-56b815bf.d.ts} +0 -0
- /package/toast-plate/modern/{getDataTestId-0f89d772.js → getDataTestId-56b815bf.js} +0 -0
- /package/typography/{colors.module-111c5bd6.js → colors.module-bf04f1dc.js} +0 -0
- /package/typography/{common.module-62a6f23d.js → common.module-4c00fa0c.js} +0 -0
- /package/typography/esm/{colors.module-1525a6cf.js → colors.module-d44fc8b3.js} +0 -0
- /package/typography/esm/{common.module-1cba9ba8.js → common.module-598e0956.js} +0 -0
- /package/typography/modern/{colors.module-ffa65232.js → colors.module-09161417.js} +0 -0
- /package/typography/modern/{common.module-a97de0bb.js → common.module-7bad8215.js} +0 -0
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
/* Up */
|
|
11
11
|
|
|
12
12
|
/* Hard up */
|
|
13
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
14
|
-
--border-radius-3xl: 24px; /* deprecated */
|
|
13
|
+
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
15
14
|
|
|
16
15
|
/* новые значения, используйте их */
|
|
16
|
+
--border-radius-24: 24px;
|
|
17
17
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
18
18
|
|
|
19
19
|
/* новые значения, используйте их */
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
} .gallery__video_1kmz9 {
|
|
29
29
|
max-width: 100%;
|
|
30
30
|
max-height: 100%;
|
|
31
|
-
border-radius: var(--border-radius-
|
|
31
|
+
border-radius: var(--border-radius-24);
|
|
32
32
|
} .gallery__mobile_1kmz9 {
|
|
33
33
|
border-radius: 0;
|
|
34
34
|
} .gallery__videoButton_1kmz9 {
|
|
35
|
+
|
|
35
36
|
position: absolute;
|
|
36
37
|
top: 50%;
|
|
37
38
|
left: 50%;
|
|
38
39
|
transform: translate(-50%, -50%);
|
|
39
40
|
z-index: 1;
|
|
40
|
-
} .gallery__videoButtonIcon_1kmz9 {
|
|
41
41
|
}
|
|
@@ -3,7 +3,8 @@ import React from 'react';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
url: string;
|
|
5
5
|
index: number;
|
|
6
|
+
isActive: boolean;
|
|
6
7
|
className?: string;
|
|
7
8
|
};
|
|
8
|
-
declare const Video: ({ url, index, className }: Props) => React.JSX.Element;
|
|
9
|
+
declare const Video: ({ url, index, className, isActive }: Props) => React.JSX.Element;
|
|
9
10
|
export { Video };
|
|
@@ -2,24 +2,18 @@ import React, { useRef, useContext, useEffect } from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import Hls from 'hls.js';
|
|
4
4
|
import { Circle } from '@alfalab/core-components/icon-view/circle';
|
|
5
|
-
import { Button } from '../../../../../button/esm';
|
|
6
|
-
import PauseCompactMIcon from '@alfalab/icons-glyph/PauseCompactMIcon';
|
|
7
5
|
import PlayCompactMIcon from '@alfalab/icons-glyph/PlayCompactMIcon';
|
|
8
6
|
import { GalleryContext } from '../../../context.js';
|
|
7
|
+
import { GALLERY_EVENTS } from '../../../utils/constants.js';
|
|
9
8
|
|
|
10
|
-
var styles = {"videoWrapper":"gallery__videoWrapper_1kmz9","video":"gallery__video_1kmz9","mobile":"gallery__mobile_1kmz9","videoButton":"gallery__videoButton_1kmz9"
|
|
9
|
+
var styles = {"videoWrapper":"gallery__videoWrapper_1kmz9","video":"gallery__video_1kmz9","mobile":"gallery__mobile_1kmz9","videoButton":"gallery__videoButton_1kmz9"};
|
|
11
10
|
require('./index.css');
|
|
12
11
|
|
|
13
12
|
var Video = function (_a) {
|
|
14
13
|
var _b;
|
|
15
|
-
var url = _a.url, index = _a.index, className = _a.className;
|
|
14
|
+
var url = _a.url, index = _a.index, className = _a.className, isActive = _a.isActive;
|
|
16
15
|
var playerRef = useRef(null);
|
|
17
16
|
var _c = useContext(GalleryContext), setImageMeta = _c.setImageMeta, mutedVideo = _c.mutedVideo, view = _c.view, playingVideo = _c.playingVideo, setPlayingVideo = _c.setPlayingVideo, setHideNavigation = _c.setHideNavigation;
|
|
18
|
-
useEffect(function () {
|
|
19
|
-
if (playerRef.current) {
|
|
20
|
-
playerRef.current.muted = mutedVideo;
|
|
21
|
-
}
|
|
22
|
-
}, [mutedVideo]);
|
|
23
17
|
useEffect(function () {
|
|
24
18
|
setImageMeta({ player: playerRef }, index);
|
|
25
19
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
@@ -35,9 +29,6 @@ var Video = function (_a) {
|
|
|
35
29
|
hls.attachMedia(playerRef.current);
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
|
-
else if (playerRef.current) {
|
|
39
|
-
playerRef.current.src = url;
|
|
40
|
-
}
|
|
41
32
|
return function () {
|
|
42
33
|
if (hls) {
|
|
43
34
|
hls.destroy();
|
|
@@ -45,15 +36,13 @@ var Video = function (_a) {
|
|
|
45
36
|
};
|
|
46
37
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
47
38
|
}, [url, index]);
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
setPlayingVideo(!playingVideo);
|
|
51
|
-
};
|
|
52
|
-
var handleWrapperClick = function () {
|
|
39
|
+
var handleWrapperClick = function (e) {
|
|
40
|
+
e.stopPropagation();
|
|
53
41
|
setHideNavigation(false);
|
|
42
|
+
setPlayingVideo(!playingVideo);
|
|
54
43
|
};
|
|
55
44
|
useEffect(function () {
|
|
56
|
-
if (playerRef.current) {
|
|
45
|
+
if (playerRef.current && isActive) {
|
|
57
46
|
if (playingVideo) {
|
|
58
47
|
playerRef.current.play();
|
|
59
48
|
}
|
|
@@ -61,14 +50,31 @@ var Video = function (_a) {
|
|
|
61
50
|
playerRef.current.pause();
|
|
62
51
|
}
|
|
63
52
|
}
|
|
64
|
-
|
|
53
|
+
if (playerRef.current && !isActive) {
|
|
54
|
+
playerRef.current.pause();
|
|
55
|
+
playerRef.current.currentTime = 0;
|
|
56
|
+
}
|
|
57
|
+
}, [isActive, playingVideo]);
|
|
58
|
+
var onPlay = function (e) {
|
|
59
|
+
var customEvent = new CustomEvent(GALLERY_EVENTS.ON_PLAY, {
|
|
60
|
+
detail: { player: e.target },
|
|
61
|
+
});
|
|
62
|
+
dispatchEvent(customEvent);
|
|
63
|
+
};
|
|
64
|
+
var onPause = function (e) {
|
|
65
|
+
var customEvent = new CustomEvent(GALLERY_EVENTS.ON_PAUSE, {
|
|
66
|
+
detail: { player: e.target },
|
|
67
|
+
});
|
|
68
|
+
dispatchEvent(customEvent);
|
|
69
|
+
};
|
|
65
70
|
return (
|
|
66
71
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
67
72
|
React.createElement("div", { onClick: handleWrapperClick, className: styles.videoWrapper },
|
|
68
|
-
React.createElement("video", { ref: playerRef, className: cn(styles.video, (_b = {}, _b[styles.mobile] = view === 'mobile', _b), className) },
|
|
73
|
+
React.createElement("video", { onPlay: onPlay, onPause: onPause, ref: playerRef, playsInline: true, muted: mutedVideo, src: Hls.isSupported() ? undefined : url, className: cn(styles.video, (_b = {}, _b[styles.mobile] = view === 'mobile', _b), className) },
|
|
69
74
|
React.createElement("track", { kind: 'captions' })),
|
|
70
|
-
view === 'desktop' && (React.createElement(
|
|
71
|
-
React.createElement(Circle, {
|
|
75
|
+
view === 'desktop' && !playingVideo && (React.createElement("div", { className: styles.videoButton },
|
|
76
|
+
React.createElement(Circle, { size: 64 },
|
|
77
|
+
React.createElement(PlayCompactMIcon, null))))));
|
|
72
78
|
};
|
|
73
79
|
|
|
74
80
|
export { Video };
|
|
@@ -2,11 +2,13 @@ export { NavigationBar } from './navigation-bar/Component.js';
|
|
|
2
2
|
export { Header } from './header/Component.js';
|
|
3
3
|
export { ImagePreview } from './image-preview/Component.js';
|
|
4
4
|
export { ImageViewer } from './image-viewer/component.js';
|
|
5
|
+
export { InfoBar } from './info-bar/Component.js';
|
|
6
|
+
export { HeaderMobile } from './header-mobile/Component.js';
|
|
5
7
|
import 'react';
|
|
6
|
-
import 'classnames';
|
|
7
8
|
import '../context.js';
|
|
8
9
|
import '../utils/utils.js';
|
|
9
10
|
import '../utils/constants.js';
|
|
11
|
+
import 'classnames';
|
|
10
12
|
import '@alfalab/hooks';
|
|
11
13
|
import './image-preview/paths.js';
|
|
12
14
|
import './buttons/index.js';
|
|
@@ -30,10 +32,9 @@ import 'swiper';
|
|
|
30
32
|
import 'swiper/react';
|
|
31
33
|
import '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
|
|
32
34
|
import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
|
|
33
|
-
import '../slide-
|
|
35
|
+
import '../slide-da05984b.js';
|
|
34
36
|
import './image-viewer/paths.js';
|
|
35
37
|
import './image-viewer/video/index.js';
|
|
36
38
|
import 'hls.js';
|
|
37
39
|
import '@alfalab/core-components/icon-view/circle';
|
|
38
|
-
import '../../../button/esm';
|
|
39
40
|
import 'swiper/swiper.min.css';
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React, { useContext, useCallback } from 'react';
|
|
2
|
-
import 'classnames';
|
|
3
|
-
import '../../../../base-modal/esm';
|
|
4
|
-
import '@alfalab/hooks';
|
|
5
2
|
import { Typography } from '../../../../typography/esm';
|
|
6
3
|
import { GalleryContext } from '../../context.js';
|
|
7
|
-
import { Pause, Play, UnmuteVideo, MuteVideo } from '../buttons/index.js';
|
|
8
4
|
import { isVideo } from '../../utils/utils.js';
|
|
9
|
-
import '
|
|
5
|
+
import { GALLERY_EVENTS } from '../../utils/constants.js';
|
|
6
|
+
import { Pause, Play, UnmuteVideo, MuteVideo } from '../buttons/index.js';
|
|
10
7
|
import 'tslib';
|
|
8
|
+
import 'classnames';
|
|
11
9
|
import '../../../../icon-button/esm';
|
|
12
10
|
import '../../../../tooltip/esm/desktop';
|
|
13
11
|
import '@alfalab/icons-glyph/ArrowLeftMIcon';
|
|
@@ -19,29 +17,30 @@ import '@alfalab/icons-glyph/PlayCompactMIcon';
|
|
|
19
17
|
import '@alfalab/icons-glyph/PointerDownMIcon';
|
|
20
18
|
import '@alfalab/icons-glyph/SoundCrossMIcon';
|
|
21
19
|
import '@alfalab/icons-glyph/SoundMIcon';
|
|
22
|
-
import 'element-closest';
|
|
23
|
-
import 'swiper';
|
|
24
|
-
import 'swiper/react';
|
|
25
|
-
import '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
|
|
26
|
-
import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
|
|
27
|
-
import '../../utils/constants.js';
|
|
28
|
-
import '../../slide-ca7119fa.js';
|
|
29
|
-
import '../image-viewer/paths.js';
|
|
30
|
-
import '../image-viewer/video/index.js';
|
|
31
|
-
import 'hls.js';
|
|
32
|
-
import '@alfalab/core-components/icon-view/circle';
|
|
33
|
-
import '../../../../button/esm';
|
|
34
|
-
import 'swiper/swiper.min.css';
|
|
35
20
|
|
|
36
21
|
var styles = {"description":"gallery__description_elo98","videoButtons":"gallery__videoButtons_elo98","center":"gallery__center_elo98","right":"gallery__right_elo98"};
|
|
37
22
|
require('./index.css');
|
|
38
23
|
|
|
39
24
|
var InfoBar = function () {
|
|
40
|
-
var _a = useContext(GalleryContext), getCurrentImage = _a.getCurrentImage, mutedVideo = _a.mutedVideo, setMutedVideo = _a.setMutedVideo, playingVideo = _a.playingVideo, setPlayingVideo = _a.setPlayingVideo;
|
|
25
|
+
var _a = useContext(GalleryContext), getCurrentImage = _a.getCurrentImage, mutedVideo = _a.mutedVideo, setMutedVideo = _a.setMutedVideo, playingVideo = _a.playingVideo, setPlayingVideo = _a.setPlayingVideo, getCurrentImageMeta = _a.getCurrentImageMeta;
|
|
41
26
|
var image = getCurrentImage();
|
|
27
|
+
var meta = getCurrentImageMeta();
|
|
42
28
|
var handleMuteVideo = useCallback(function () {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
if (mutedVideo) {
|
|
31
|
+
var customEvent = new CustomEvent(GALLERY_EVENTS.ON_UNMUTE, {
|
|
32
|
+
detail: { player: (_a = meta === null || meta === void 0 ? void 0 : meta.player) === null || _a === void 0 ? void 0 : _a.current },
|
|
33
|
+
});
|
|
34
|
+
dispatchEvent(customEvent);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
var customEvent = new CustomEvent(GALLERY_EVENTS.ON_MUTE, {
|
|
38
|
+
detail: { player: (_b = meta === null || meta === void 0 ? void 0 : meta.player) === null || _b === void 0 ? void 0 : _b.current },
|
|
39
|
+
});
|
|
40
|
+
dispatchEvent(customEvent);
|
|
41
|
+
}
|
|
43
42
|
setMutedVideo(!mutedVideo);
|
|
44
|
-
}, [mutedVideo, setMutedVideo]);
|
|
43
|
+
}, [meta === null || meta === void 0 ? void 0 : meta.player, mutedVideo, setMutedVideo]);
|
|
45
44
|
var handlePlayVideo = useCallback(function () {
|
|
46
45
|
setPlayingVideo(!playingVideo);
|
|
47
46
|
}, [playingVideo, setPlayingVideo]);
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
14
14
|
|
|
15
15
|
/* новые значения, используйте их */
|
|
16
|
-
} :root { /* deprecated */ /* deprecated */
|
|
17
|
-
--gap-xs: 8px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
16
|
+
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
18
17
|
|
|
19
18
|
/* новые значения, используйте их */
|
|
19
|
+
--gap-8: 8px;
|
|
20
20
|
} :root {
|
|
21
21
|
} :root {
|
|
22
22
|
} .gallery__description_elo98 {
|
|
23
23
|
text-align: center;
|
|
24
|
-
margin-bottom: var(--gap-
|
|
24
|
+
margin-bottom: var(--gap-8);
|
|
25
25
|
} .gallery__videoButtons_elo98 {
|
|
26
|
-
padding: 0 var(--gap-
|
|
26
|
+
padding: 0 var(--gap-8);
|
|
27
27
|
position: relative;
|
|
28
28
|
height: 48px;
|
|
29
29
|
} .gallery__center_elo98 {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { InfoBar } from "./Component";
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
export { InfoBar } from './Component.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../../../../typography/esm';
|
|
4
|
+
import '../../context.js';
|
|
5
|
+
import '../../utils/utils.js';
|
|
6
|
+
import '../../utils/constants.js';
|
|
7
|
+
import '../buttons/index.js';
|
|
8
|
+
import 'tslib';
|
|
9
|
+
import 'classnames';
|
|
10
|
+
import '../../../../icon-button/esm';
|
|
11
|
+
import '../../../../tooltip/esm/desktop';
|
|
12
|
+
import '@alfalab/icons-glyph/ArrowLeftMIcon';
|
|
13
|
+
import '@alfalab/icons-glyph/ArrowsInwardMIcon';
|
|
14
|
+
import '@alfalab/icons-glyph/ArrowsOutwardMIcon';
|
|
15
|
+
import '@alfalab/icons-glyph/CrossMIcon';
|
|
16
|
+
import '@alfalab/icons-glyph/PauseCompactMIcon';
|
|
17
|
+
import '@alfalab/icons-glyph/PlayCompactMIcon';
|
|
18
|
+
import '@alfalab/icons-glyph/PointerDownMIcon';
|
|
19
|
+
import '@alfalab/icons-glyph/SoundCrossMIcon';
|
|
20
|
+
import '@alfalab/icons-glyph/SoundMIcon';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useRef, useContext, useCallback, useEffect } from 'react';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
import { GalleryContext } from '../../context.js';
|
|
4
3
|
import { getImageKey } from '../../utils/utils.js';
|
|
5
4
|
import { TestIds } from '../../utils/constants.js';
|
|
6
5
|
import { ImagePreview } from '../image-preview/Component.js';
|
|
6
|
+
import 'classnames';
|
|
7
7
|
import '@alfalab/hooks';
|
|
8
8
|
import '../image-preview/paths.js';
|
|
9
9
|
|
|
@@ -13,11 +13,12 @@ require('./index.css');
|
|
|
13
13
|
var MIN_SCROLL_STEP = 24;
|
|
14
14
|
var NavigationBar = function () {
|
|
15
15
|
var containerRef = useRef(null);
|
|
16
|
-
var _a = useContext(GalleryContext), images = _a.images, currentSlideIndex = _a.currentSlideIndex, setCurrentSlideIndex = _a.setCurrentSlideIndex, getSwiper = _a.getSwiper;
|
|
16
|
+
var _a = useContext(GalleryContext), images = _a.images, currentSlideIndex = _a.currentSlideIndex, setCurrentSlideIndex = _a.setCurrentSlideIndex, getSwiper = _a.getSwiper, setPlayingVideo = _a.setPlayingVideo;
|
|
17
17
|
var swiper = getSwiper();
|
|
18
18
|
var handlePreviewSelect = function (index) {
|
|
19
19
|
setCurrentSlideIndex === null || setCurrentSlideIndex === void 0 ? void 0 : setCurrentSlideIndex(index);
|
|
20
20
|
if (swiper) {
|
|
21
|
+
setPlayingVideo(true);
|
|
21
22
|
swiper.slideTo(index);
|
|
22
23
|
}
|
|
23
24
|
};
|
|
@@ -59,7 +60,7 @@ var NavigationBar = function () {
|
|
|
59
60
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
60
61
|
React.createElement("div", { className: styles.component, ref: containerRef, onKeyDown: handleKeyDown, "data-test-id": TestIds.NAVIGATION_BAR }, images.map(function (image, index) {
|
|
61
62
|
var active = index === currentSlideIndex;
|
|
62
|
-
return (React.createElement(ImagePreview, { key: getImageKey(image, index), image: image, active: active, index: index, onSelect: handlePreviewSelect, className:
|
|
63
|
+
return (React.createElement(ImagePreview, { key: getImageKey(image, index), image: image, active: active, index: index, onSelect: handlePreviewSelect, className: styles.preview }));
|
|
63
64
|
})));
|
|
64
65
|
};
|
|
65
66
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { NavigationBar } from './Component.js';
|
|
2
2
|
import 'react';
|
|
3
|
-
import 'classnames';
|
|
4
3
|
import '../../context.js';
|
|
5
4
|
import '../../utils/utils.js';
|
|
6
5
|
import '../../utils/constants.js';
|
|
7
6
|
import '../image-preview/Component.js';
|
|
7
|
+
import 'classnames';
|
|
8
8
|
import '@alfalab/hooks';
|
|
9
9
|
import '../image-preview/paths.js';
|
package/gallery/esm/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./Component";
|
|
2
|
-
export
|
|
2
|
+
export { GALLERY_EVENTS, TestIds } from "./utils/index";
|
package/gallery/esm/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export { Gallery } from './Component.js';
|
|
2
|
-
export {
|
|
3
|
-
export { PLACEHOLDER_HEIGHT, PLACEHOLDER_WIDTH, getImageAlt, getImageKey, isSmallImage, isVideo } from './utils/utils.js';
|
|
4
|
-
export { TestIds } from './utils/constants.js';
|
|
2
|
+
export { GALLERY_EVENTS, TestIds } from './utils/constants.js';
|
|
5
3
|
import 'react';
|
|
6
4
|
import 'classnames';
|
|
7
5
|
import '../../base-modal/esm';
|
|
8
6
|
import '@alfalab/hooks';
|
|
9
|
-
import './components/
|
|
10
|
-
import '../../typography/esm';
|
|
7
|
+
import './components/navigation-bar/Component.js';
|
|
11
8
|
import './context.js';
|
|
9
|
+
import './utils/utils.js';
|
|
10
|
+
import './components/image-preview/Component.js';
|
|
11
|
+
import './components/image-preview/paths.js';
|
|
12
|
+
import './components/header/Component.js';
|
|
12
13
|
import './components/buttons/index.js';
|
|
13
14
|
import 'tslib';
|
|
14
15
|
import '../../icon-button/esm';
|
|
@@ -22,22 +23,20 @@ import '@alfalab/icons-glyph/PlayCompactMIcon';
|
|
|
22
23
|
import '@alfalab/icons-glyph/PointerDownMIcon';
|
|
23
24
|
import '@alfalab/icons-glyph/SoundCrossMIcon';
|
|
24
25
|
import '@alfalab/icons-glyph/SoundMIcon';
|
|
26
|
+
import './components/header-info-block/Component.js';
|
|
27
|
+
import '../../typography/esm';
|
|
28
|
+
import './utils/split-filename.js';
|
|
25
29
|
import './components/image-viewer/component.js';
|
|
26
30
|
import 'element-closest';
|
|
27
31
|
import 'swiper';
|
|
28
32
|
import 'swiper/react';
|
|
29
33
|
import '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
|
|
30
34
|
import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
|
|
31
|
-
import './slide-
|
|
35
|
+
import './slide-da05984b.js';
|
|
32
36
|
import './components/image-viewer/paths.js';
|
|
33
37
|
import './components/image-viewer/video/index.js';
|
|
34
38
|
import 'hls.js';
|
|
35
39
|
import '@alfalab/core-components/icon-view/circle';
|
|
36
|
-
import '../../button/esm';
|
|
37
40
|
import 'swiper/swiper.min.css';
|
|
38
41
|
import './components/info-bar/Component.js';
|
|
39
|
-
import './components/
|
|
40
|
-
import './components/image-preview/Component.js';
|
|
41
|
-
import './components/image-preview/paths.js';
|
|
42
|
-
import './components/header/Component.js';
|
|
43
|
-
import './components/header-info-block/Component.js';
|
|
42
|
+
import './components/header-mobile/Component.js';
|
|
@@ -8,8 +8,6 @@ import { NoImagePaths } from './components/image-viewer/paths.js';
|
|
|
8
8
|
import { Video } from './components/image-viewer/video/index.js';
|
|
9
9
|
import 'hls.js';
|
|
10
10
|
import '@alfalab/core-components/icon-view/circle';
|
|
11
|
-
import '../../button/esm';
|
|
12
|
-
import '@alfalab/icons-glyph/PauseCompactMIcon';
|
|
13
11
|
import '@alfalab/icons-glyph/PlayCompactMIcon';
|
|
14
12
|
|
|
15
13
|
var styles = {"component":"gallery__component_1rc6z","swiper":"gallery__swiper_1rc6z","mobile":"gallery__mobile_1rc6z","mobileVideo":"gallery__mobileVideo_1rc6z","singleSlide":"gallery__singleSlide_1rc6z","hidden":"gallery__hidden_1rc6z","slide":"gallery__slide_1rc6z","slideLoading":"gallery__slideLoading_1rc6z","image":"gallery__image_1rc6z","smallImage":"gallery__smallImage_1rc6z","verticalImageFit":"gallery__verticalImageFit_1rc6z","horizontalImageFit":"gallery__horizontalImageFit_1rc6z","arrow":"gallery__arrow_1rc6z","focused":"gallery__focused_1rc6z","placeholder":"gallery__placeholder_1rc6z","brokenImgWrapper":"gallery__brokenImgWrapper_1rc6z","brokenImgIcon":"gallery__brokenImgIcon_1rc6z","fullScreenImage":"gallery__fullScreenImage_1rc6z","fullScreenVideo":"gallery__fullScreenVideo_1rc6z"};
|
|
@@ -39,7 +37,7 @@ var Slide = function (_a) {
|
|
|
39
37
|
var horizontalImageFit = !small && swiperAspectRatio <= imageAspectRatio;
|
|
40
38
|
if (isVideo(image.src)) {
|
|
41
39
|
return (React.createElement(SlideInner, { isVideoView: true, active: isActive, broken: broken, withPlaceholder: broken, loading: !meta },
|
|
42
|
-
React.createElement(Video, { url: image.src, index: index })));
|
|
40
|
+
React.createElement(Video, { url: image.src, index: index, isActive: isActive })));
|
|
43
41
|
}
|
|
44
42
|
return (React.createElement(SlideInner, { active: isActive, broken: broken, loading: !meta, withPlaceholder: small || broken },
|
|
45
43
|
React.createElement("img", { src: image.src, alt: getImageAlt(image, index), className: cn((_b = {},
|
|
@@ -10,4 +10,15 @@ declare const TestIds: {
|
|
|
10
10
|
MUTE_BUTTON: string;
|
|
11
11
|
UNMUTE_BUTTON: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
declare const PREVIEW_WIDTH_MOBILE = 36;
|
|
14
|
+
declare const PREVIEW_HEIGHT_MOBILE = 46;
|
|
15
|
+
declare const PREVIEW_WIDTH_DESKTOP = 56;
|
|
16
|
+
declare const PREVIEW_HEIGHT_DESKTOP = 56;
|
|
17
|
+
declare const PREVIEW_VIDEO_MULTIPLIER = 12;
|
|
18
|
+
declare const GALLERY_EVENTS: {
|
|
19
|
+
ON_PLAY: string;
|
|
20
|
+
ON_PAUSE: string;
|
|
21
|
+
ON_MUTE: string;
|
|
22
|
+
ON_UNMUTE: string;
|
|
23
|
+
};
|
|
24
|
+
export { TestIds, PREVIEW_WIDTH_MOBILE, PREVIEW_HEIGHT_MOBILE, PREVIEW_WIDTH_DESKTOP, PREVIEW_HEIGHT_DESKTOP, PREVIEW_VIDEO_MULTIPLIER, GALLERY_EVENTS };
|
|
@@ -10,5 +10,16 @@ var TestIds = {
|
|
|
10
10
|
MUTE_BUTTON: 'mute-button',
|
|
11
11
|
UNMUTE_BUTTON: 'unmute-button',
|
|
12
12
|
};
|
|
13
|
+
var PREVIEW_WIDTH_MOBILE = 36;
|
|
14
|
+
var PREVIEW_HEIGHT_MOBILE = 46;
|
|
15
|
+
var PREVIEW_WIDTH_DESKTOP = 56;
|
|
16
|
+
var PREVIEW_HEIGHT_DESKTOP = 56;
|
|
17
|
+
var PREVIEW_VIDEO_MULTIPLIER = 12;
|
|
18
|
+
var GALLERY_EVENTS = {
|
|
19
|
+
ON_PLAY: 'Gallery:OnPlay',
|
|
20
|
+
ON_PAUSE: 'Gallery:OnPause',
|
|
21
|
+
ON_MUTE: 'Gallery:OnMute',
|
|
22
|
+
ON_UNMUTE: 'Gallery:OnUnmute',
|
|
23
|
+
};
|
|
13
24
|
|
|
14
|
-
export { TestIds };
|
|
25
|
+
export { GALLERY_EVENTS, PREVIEW_HEIGHT_DESKTOP, PREVIEW_HEIGHT_MOBILE, PREVIEW_VIDEO_MULTIPLIER, PREVIEW_WIDTH_DESKTOP, PREVIEW_WIDTH_MOBILE, TestIds };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { splitFilename } from './split-filename.js';
|
|
2
2
|
export { PLACEHOLDER_HEIGHT, PLACEHOLDER_WIDTH, getImageAlt, getImageKey, isSmallImage, isVideo } from './utils.js';
|
|
3
|
-
export { TestIds } from './constants.js';
|
|
3
|
+
export { GALLERY_EVENTS, PREVIEW_HEIGHT_DESKTOP, PREVIEW_HEIGHT_MOBILE, PREVIEW_VIDEO_MULTIPLIER, PREVIEW_WIDTH_DESKTOP, PREVIEW_WIDTH_MOBILE, TestIds } from './constants.js';
|
package/gallery/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./Component";
|
|
2
|
-
export
|
|
2
|
+
export { GALLERY_EVENTS, TestIds } from "./utils/index";
|
package/gallery/index.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
3
|
var Component = require('./Component.js');
|
|
4
|
-
var utils_splitFilename = require('./utils/split-filename.js');
|
|
5
|
-
var utils_utils = require('./utils/utils.js');
|
|
6
4
|
var utils_constants = require('./utils/constants.js');
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
exports.Gallery = Component.Gallery;
|
|
11
|
-
exports.
|
|
12
|
-
exports.PLACEHOLDER_HEIGHT = utils_utils.PLACEHOLDER_HEIGHT;
|
|
13
|
-
exports.PLACEHOLDER_WIDTH = utils_utils.PLACEHOLDER_WIDTH;
|
|
14
|
-
exports.getImageAlt = utils_utils.getImageAlt;
|
|
15
|
-
exports.getImageKey = utils_utils.getImageKey;
|
|
16
|
-
exports.isSmallImage = utils_utils.isSmallImage;
|
|
17
|
-
exports.isVideo = utils_utils.isVideo;
|
|
9
|
+
exports.GALLERY_EVENTS = utils_constants.GALLERY_EVENTS;
|
|
18
10
|
exports.TestIds = utils_constants.TestIds;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import React, { useState, useRef, useCallback, useEffect
|
|
1
|
+
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { BaseModal } from '../../base-modal/modern';
|
|
4
4
|
import { useMedia } from '@alfalab/hooks';
|
|
5
|
-
import { HeaderMobile } from './components/header-mobile/Component.js';
|
|
6
|
-
import { InfoBar } from './components/info-bar/Component.js';
|
|
7
5
|
import { NavigationBar } from './components/navigation-bar/Component.js';
|
|
8
6
|
import { Header } from './components/header/Component.js';
|
|
9
7
|
import { GalleryContext } from './context.js';
|
|
10
8
|
import { ImageViewer } from './components/image-viewer/component.js';
|
|
11
|
-
import '
|
|
9
|
+
import { InfoBar } from './components/info-bar/Component.js';
|
|
10
|
+
import { HeaderMobile } from './components/header-mobile/Component.js';
|
|
11
|
+
import './utils/utils.js';
|
|
12
|
+
import './utils/constants.js';
|
|
13
|
+
import './components/image-preview/Component.js';
|
|
14
|
+
import './components/image-preview/paths.js';
|
|
12
15
|
import './components/buttons/index.js';
|
|
13
16
|
import '../../icon-button/modern';
|
|
14
17
|
import '../../tooltip/modern/desktop';
|
|
@@ -21,23 +24,19 @@ import '@alfalab/icons-glyph/PlayCompactMIcon';
|
|
|
21
24
|
import '@alfalab/icons-glyph/PointerDownMIcon';
|
|
22
25
|
import '@alfalab/icons-glyph/SoundCrossMIcon';
|
|
23
26
|
import '@alfalab/icons-glyph/SoundMIcon';
|
|
24
|
-
import './utils/utils.js';
|
|
25
|
-
import './utils/constants.js';
|
|
26
|
-
import './components/image-preview/Component.js';
|
|
27
|
-
import './components/image-preview/paths.js';
|
|
28
27
|
import './components/header-info-block/Component.js';
|
|
28
|
+
import '../../typography/modern';
|
|
29
29
|
import './utils/split-filename.js';
|
|
30
30
|
import 'element-closest';
|
|
31
31
|
import 'swiper';
|
|
32
32
|
import 'swiper/react';
|
|
33
33
|
import '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
|
|
34
34
|
import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
|
|
35
|
-
import './slide-
|
|
35
|
+
import './slide-dac6462d.js';
|
|
36
36
|
import './components/image-viewer/paths.js';
|
|
37
37
|
import './components/image-viewer/video/index.js';
|
|
38
38
|
import 'hls.js';
|
|
39
39
|
import '@alfalab/core-components/icon-view/circle';
|
|
40
|
-
import '../../button/modern';
|
|
41
40
|
import 'swiper/swiper.min.css';
|
|
42
41
|
|
|
43
42
|
const styles = {"container":"gallery__container_1ukr0","modal":"gallery__modal_1ukr0","navigationVideo":"gallery__navigationVideo_1ukr0","hideNavigation":"gallery__hideNavigation_1ukr0"};
|
|
@@ -54,18 +53,20 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
|
|
|
54
53
|
const [imagesMeta, setImagesMeta] = useState([]);
|
|
55
54
|
const [fullScreen, setFullScreen] = useState(false);
|
|
56
55
|
const [mutedVideo, setMutedVideo] = useState(false);
|
|
57
|
-
const [playingVideo, setPlayingVideo] = useState(
|
|
56
|
+
const [playingVideo, setPlayingVideo] = useState(true);
|
|
58
57
|
const [hideNavigation, setHideNavigation] = useState(false);
|
|
59
58
|
const timer = useRef();
|
|
60
59
|
const [view] = useMedia([
|
|
61
60
|
['mobile', '(max-width: 1023px)'],
|
|
62
61
|
['desktop', '(min-width: 1024px)'],
|
|
63
62
|
], 'desktop');
|
|
63
|
+
const isMobile = view === 'mobile';
|
|
64
64
|
const isCurrentVideo = !!imagesMeta[currentSlideIndex]?.player?.current;
|
|
65
65
|
const slideTo = useCallback((index) => {
|
|
66
66
|
if (images[index]) {
|
|
67
67
|
setCurrentSlideIndex?.(index);
|
|
68
68
|
if (swiper) {
|
|
69
|
+
setPlayingVideo(true);
|
|
69
70
|
swiper.slideTo(index);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -119,10 +120,9 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
|
|
|
119
120
|
}
|
|
120
121
|
}, [fullScreen, open, slideNext, slidePrev]);
|
|
121
122
|
useEffect(() => {
|
|
122
|
-
if (timer.current) {
|
|
123
|
-
clearTimeout(timer.current);
|
|
124
|
-
}
|
|
125
123
|
if (isCurrentVideo && !hideNavigation) {
|
|
124
|
+
if (timer.current)
|
|
125
|
+
clearTimeout(timer.current);
|
|
126
126
|
timer.current = setTimeout(() => {
|
|
127
127
|
setHideNavigation(true);
|
|
128
128
|
}, 2000);
|
|
@@ -149,7 +149,8 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
|
|
|
149
149
|
}, [handleKeyDown]);
|
|
150
150
|
const singleSlide = images.length === 1;
|
|
151
151
|
const showNavigationBar = !singleSlide && !fullScreen;
|
|
152
|
-
|
|
152
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
153
|
+
const galleryContext = {
|
|
153
154
|
view,
|
|
154
155
|
singleSlide,
|
|
155
156
|
currentSlideIndex,
|
|
@@ -174,34 +175,15 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
|
|
|
174
175
|
setCurrentSlideIndex,
|
|
175
176
|
getCurrentImage: () => images[currentSlideIndex],
|
|
176
177
|
getCurrentImageMeta: () => imagesMeta[currentSlideIndex],
|
|
177
|
-
}
|
|
178
|
-
currentSlideIndex,
|
|
179
|
-
fullScreen,
|
|
180
|
-
handleClose,
|
|
181
|
-
hideNavigation,
|
|
182
|
-
images,
|
|
183
|
-
imagesMeta,
|
|
184
|
-
initialSlide,
|
|
185
|
-
mutedVideo,
|
|
186
|
-
playingVideo,
|
|
187
|
-
setCurrentSlideIndex,
|
|
188
|
-
setImageMeta,
|
|
189
|
-
singleSlide,
|
|
190
|
-
slideNext,
|
|
191
|
-
slidePrev,
|
|
192
|
-
slideTo,
|
|
193
|
-
swiper,
|
|
194
|
-
uncontrolled,
|
|
195
|
-
view,
|
|
196
|
-
]);
|
|
178
|
+
};
|
|
197
179
|
return (React.createElement(GalleryContext.Provider, { value: galleryContext },
|
|
198
180
|
React.createElement(BaseModal, { open: open, className: styles.modal, onEscapeKeyDown: handleEscapeKeyDown, Backdrop: Backdrop },
|
|
199
181
|
React.createElement("div", { className: styles.container },
|
|
200
182
|
view === 'desktop' ? React.createElement(Header, null) : React.createElement(HeaderMobile, null),
|
|
201
183
|
React.createElement(ImageViewer, null),
|
|
202
184
|
React.createElement("nav", { className: cn({
|
|
203
|
-
[styles.navigationVideo]: isCurrentVideo &&
|
|
204
|
-
[styles.hideNavigation]: hideNavigation &&
|
|
185
|
+
[styles.navigationVideo]: isCurrentVideo && isMobile,
|
|
186
|
+
[styles.hideNavigation]: hideNavigation && isMobile,
|
|
205
187
|
}) },
|
|
206
188
|
showNavigationBar && React.createElement(NavigationBar, null),
|
|
207
189
|
view === 'mobile' && React.createElement(InfoBar, null))))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext, useRef, useEffect } from 'react';
|
|
2
2
|
import { GalleryContext } from '../../context.js';
|
|
3
3
|
import { isSmallImage, isVideo } from '../../utils/utils.js';
|
|
4
|
-
import { TestIds } from '../../utils/constants.js';
|
|
4
|
+
import { TestIds, GALLERY_EVENTS } from '../../utils/constants.js';
|
|
5
5
|
import { Download, Exit, ExitFullscreen, Fullscreen, UnmuteVideo, MuteVideo } from '../buttons/index.js';
|
|
6
6
|
import { HeaderInfoBlock } from '../header-info-block/Component.js';
|
|
7
7
|
import 'classnames';
|
|
@@ -28,6 +28,18 @@ const Header = () => {
|
|
|
28
28
|
const meta = getCurrentImageMeta();
|
|
29
29
|
const toggleFullScreenButton = useRef(null);
|
|
30
30
|
const onMuteButtonClick = () => {
|
|
31
|
+
if (mutedVideo) {
|
|
32
|
+
const customEvent = new CustomEvent(GALLERY_EVENTS.ON_UNMUTE, {
|
|
33
|
+
detail: { player: meta?.player?.current },
|
|
34
|
+
});
|
|
35
|
+
dispatchEvent(customEvent);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const customEvent = new CustomEvent(GALLERY_EVENTS.ON_MUTE, {
|
|
39
|
+
detail: { player: meta?.player?.current },
|
|
40
|
+
});
|
|
41
|
+
dispatchEvent(customEvent);
|
|
42
|
+
}
|
|
31
43
|
setMutedVideo(!mutedVideo);
|
|
32
44
|
};
|
|
33
45
|
const closeFullScreen = () => {
|