lightgallery 2.9.0 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +690 -0
- package/README.md +31 -21
- package/dist/README.md +229 -0
- package/{css → dist/css}/lg-autoplay.css +7 -4
- package/{css → dist/css}/lg-autoplay.css.map +1 -1
- package/{css → dist/css}/lg-comments.css +0 -6
- package/{css → dist/css}/lg-comments.css.map +1 -1
- package/dist/css/lg-fullscreen.css +11 -0
- package/dist/css/lg-fullscreen.css.map +1 -0
- package/dist/css/lg-justified.css +37 -0
- package/dist/css/lg-justified.css.map +1 -0
- package/{css → dist/css}/lg-pager.css.map +1 -1
- package/{css → dist/css}/lg-rotate.css +0 -16
- package/{css → dist/css}/lg-rotate.css.map +1 -1
- package/dist/css/lg-rtl.css +94 -0
- package/dist/css/lg-rtl.css.map +1 -0
- package/{css → dist/css}/lg-share.css +4 -32
- package/dist/css/lg-share.css.map +1 -0
- package/{css → dist/css}/lg-thumbnail.css +7 -3
- package/dist/css/lg-thumbnail.css.map +1 -0
- package/{css → dist/css}/lg-transitions.css +10 -0
- package/dist/css/lg-transitions.css.map +1 -0
- package/{css → dist/css}/lg-zoom.css +20 -9
- package/dist/css/lg-zoom.css.map +1 -0
- package/{css → dist/css}/lightgallery-bundle.css +150 -118
- package/dist/css/lightgallery-bundle.css.map +1 -0
- package/dist/css/lightgallery-bundle.min.css +1 -0
- package/{css → dist/css}/lightgallery-core.css +49 -7
- package/dist/css/lightgallery-core.css.map +1 -0
- package/{css → dist/css}/lightgallery.css +105 -44
- package/dist/css/lightgallery.css.map +1 -0
- package/dist/lightgallery.es5.js +3848 -0
- package/dist/lightgallery.es5.js.map +1 -0
- package/dist/lightgallery.min.js +1 -0
- package/dist/lightgallery.umd.js +3851 -0
- package/dist/lightgallery.umd.js.map +1 -0
- package/dist/package.json +33 -0
- package/dist/plugins/autoplay/lg-autoplay.es5.js +193 -0
- package/dist/plugins/autoplay/lg-autoplay.es5.js.map +1 -0
- package/dist/plugins/autoplay/lg-autoplay.min.js +1 -0
- package/dist/plugins/autoplay/lg-autoplay.umd.js +196 -0
- package/dist/plugins/autoplay/lg-autoplay.umd.js.map +1 -0
- package/dist/plugins/autoplay/package.json +7 -0
- package/dist/plugins/comment/lg-comment.es5.js +136 -0
- package/dist/plugins/comment/lg-comment.es5.js.map +1 -0
- package/dist/plugins/comment/lg-comment.min.js +1 -0
- package/dist/plugins/comment/lg-comment.umd.js +139 -0
- package/dist/plugins/comment/lg-comment.umd.js.map +1 -0
- package/dist/plugins/comment/package.json +7 -0
- package/dist/plugins/fullscreen/lg-fullscreen.es5.js +114 -0
- package/dist/plugins/fullscreen/lg-fullscreen.es5.js.map +1 -0
- package/dist/plugins/fullscreen/lg-fullscreen.min.js +1 -0
- package/dist/plugins/fullscreen/lg-fullscreen.umd.js +117 -0
- package/dist/plugins/fullscreen/lg-fullscreen.umd.js.map +1 -0
- package/dist/plugins/fullscreen/package.json +7 -0
- package/dist/plugins/hash/lg-hash.es5.js +207 -0
- package/dist/plugins/hash/lg-hash.es5.js.map +1 -0
- package/dist/plugins/hash/lg-hash.min.js +1 -0
- package/dist/plugins/hash/lg-hash.umd.js +210 -0
- package/dist/plugins/hash/lg-hash.umd.js.map +1 -0
- package/dist/plugins/hash/package.json +7 -0
- package/dist/plugins/justified/lg-justified.es5.js +415 -0
- package/dist/plugins/justified/lg-justified.es5.js.map +1 -0
- package/dist/plugins/justified/lg-justified.min.js +1 -0
- package/dist/plugins/justified/lg-justified.umd.js +418 -0
- package/dist/plugins/justified/lg-justified.umd.js.map +1 -0
- package/dist/plugins/justified/package.json +7 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.es5.js +95 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.es5.js.map +1 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.min.js +1 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.umd.js +98 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.umd.js.map +1 -0
- package/dist/plugins/mediumZoom/package.json +7 -0
- package/dist/plugins/originCrop/lg-origin-crop.es5.js +622 -0
- package/dist/plugins/originCrop/lg-origin-crop.es5.js.map +1 -0
- package/dist/plugins/originCrop/lg-origin-crop.min.js +1 -0
- package/dist/plugins/originCrop/lg-origin-crop.umd.js +625 -0
- package/dist/plugins/originCrop/lg-origin-crop.umd.js.map +1 -0
- package/dist/plugins/pager/lg-pager.es5.js +96 -0
- package/dist/plugins/pager/lg-pager.es5.js.map +1 -0
- package/dist/plugins/pager/lg-pager.min.js +1 -0
- package/dist/plugins/pager/lg-pager.umd.js +99 -0
- package/dist/plugins/pager/lg-pager.umd.js.map +1 -0
- package/dist/plugins/pager/package.json +7 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.es5.js +98 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.es5.js.map +1 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.min.js +1 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.umd.js +101 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.umd.js.map +1 -0
- package/dist/plugins/relativeCaption/package.json +7 -0
- package/dist/plugins/rotate/lg-rotate.es5.js +226 -0
- package/dist/plugins/rotate/lg-rotate.es5.js.map +1 -0
- package/dist/plugins/rotate/lg-rotate.min.js +1 -0
- package/dist/plugins/rotate/lg-rotate.umd.js +229 -0
- package/dist/plugins/rotate/lg-rotate.umd.js.map +1 -0
- package/dist/plugins/rotate/package.json +7 -0
- package/dist/plugins/share/lg-share.es5.js +309 -0
- package/dist/plugins/share/lg-share.es5.js.map +1 -0
- package/dist/plugins/share/lg-share.min.js +1 -0
- package/dist/plugins/share/lg-share.umd.js +312 -0
- package/dist/plugins/share/lg-share.umd.js.map +1 -0
- package/dist/plugins/share/package.json +7 -0
- package/dist/plugins/thumbnail/lg-thumbnail.es5.js +792 -0
- package/dist/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -0
- package/dist/plugins/thumbnail/lg-thumbnail.min.js +1 -0
- package/dist/plugins/thumbnail/lg-thumbnail.umd.js +795 -0
- package/dist/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -0
- package/dist/plugins/thumbnail/package.json +7 -0
- package/dist/plugins/video/lg-video.es5.js +518 -0
- package/dist/plugins/video/lg-video.es5.js.map +1 -0
- package/dist/plugins/video/lg-video.min.js +1 -0
- package/dist/plugins/video/lg-video.umd.js +521 -0
- package/dist/plugins/video/lg-video.umd.js.map +1 -0
- package/dist/plugins/video/package.json +7 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +72 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +1 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +1 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +75 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +1 -0
- package/dist/plugins/vimeoThumbnail/package.json +7 -0
- package/dist/plugins/zoom/lg-zoom.es5.js +1412 -0
- package/dist/plugins/zoom/lg-zoom.es5.js.map +1 -0
- package/dist/plugins/zoom/lg-zoom.min.js +1 -0
- package/dist/plugins/zoom/lg-zoom.umd.js +1415 -0
- package/dist/plugins/zoom/lg-zoom.umd.js.map +1 -0
- package/dist/plugins/zoom/package.json +7 -0
- package/{scss → dist/scss}/_lg-theme-default.scss +68 -18
- package/{scss → dist/scss}/_lg-variables.scss +0 -1
- package/{scss → dist/scss}/lg-autoplay.scss +10 -4
- package/{scss → dist/scss}/lg-comments.scss +0 -8
- package/dist/scss/lg-fullscreen.scss +15 -0
- package/dist/scss/lg-justified.scss +63 -0
- package/{scss → dist/scss}/lg-rotate.scss +0 -24
- package/dist/scss/lg-rtl.scss +145 -0
- package/{scss → dist/scss}/lg-share.scss +6 -33
- package/{scss → dist/scss}/lg-thumbnail.scss +16 -5
- package/{scss → dist/scss}/lg-zoom.scss +46 -9
- package/{scss → dist/scss}/lightgallery-bundle.scss +0 -1
- package/{scss → dist/scss}/lightgallery-core.scss +73 -6
- package/{scss → dist/scss}/lightgallery.scss +0 -1
- package/{scss → dist/scss}/transitions/_lg-scale-up.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-slide-circular-vertical.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-slide-circular.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-soft-zoom.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-in-big.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-in-out.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-in.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-out-big.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-out-in.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-out.scss +6 -0
- package/{index.d.ts → dist/types/index.d.ts} +8 -4
- package/{lg-events.d.ts → dist/types/lg-events.d.ts} +300 -300
- package/dist/types/lg-icons.d.ts +27 -0
- package/{lg-plugin.d.ts → dist/types/lg-plugin.d.ts} +7 -7
- package/{lg-settings.d.ts → dist/types/lg-settings.d.ts} +555 -425
- package/dist/types/lg-spring-runner.d.ts +14 -0
- package/dist/types/lg-toolbar-overflow.d.ts +36 -0
- package/{lg-utils.d.ts → dist/types/lg-utils.d.ts} +236 -228
- package/{lgQuery.d.ts → dist/types/lgQuery.d.ts} +56 -56
- package/{lightgallery.d.ts → dist/types/lightgallery.d.ts} +385 -305
- package/{plugins → dist/types/plugins}/autoplay/lg-autoplay-settings.d.ts +41 -38
- package/{plugins → dist/types/plugins}/autoplay/lg-autoplay.d.ts +22 -22
- package/{plugins → dist/types/plugins}/comment/lg-comment-settings.d.ts +36 -33
- package/{plugins → dist/types/plugins}/comment/lg-comment.d.ts +25 -25
- package/{plugins → dist/types/plugins}/fullscreen/lg-fullscreen-settings.d.ts +17 -14
- package/{plugins → dist/types/plugins}/fullscreen/lg-fullscreen.d.ts +16 -16
- package/dist/types/plugins/hash/lg-hash-settings.d.ts +28 -0
- package/{plugins → dist/types/plugins}/hash/lg-hash.d.ts +25 -23
- package/dist/types/plugins/justified/lg-justified-settings.d.ts +42 -0
- package/dist/types/plugins/justified/lg-justified.d.ts +55 -0
- package/{plugins → dist/types/plugins}/mediumZoom/lg-medium-zoom-settings.d.ts +16 -16
- package/{plugins → dist/types/plugins}/mediumZoom/lg-medium-zoom.d.ts +12 -12
- package/dist/types/plugins/originCrop/lg-origin-crop-settings.d.ts +12 -0
- package/dist/types/plugins/originCrop/lg-origin-crop.d.ts +79 -0
- package/{plugins → dist/types/plugins}/pager/lg-pager-settings.d.ts +7 -7
- package/{plugins → dist/types/plugins}/pager/lg-pager.d.ts +13 -13
- package/{plugins → dist/types/plugins}/relativeCaption/lg-relative-caption-settings.d.ts +7 -7
- package/{plugins → dist/types/plugins}/relativeCaption/lg-relative-caption.d.ts +14 -14
- package/{plugins → dist/types/plugins}/rotate/lg-rotate-settings.d.ts +47 -45
- package/{plugins → dist/types/plugins}/rotate/lg-rotate.d.ts +25 -24
- package/{plugins → dist/types/plugins}/share/lg-fb-share-utils.d.ts +2 -2
- package/{plugins → dist/types/plugins}/share/lg-pinterest-share-utils.d.ts +2 -2
- package/{plugins → dist/types/plugins}/share/lg-share-settings.d.ts +71 -56
- package/dist/types/plugins/share/lg-share.d.ts +33 -0
- package/dist/types/plugins/share/lg-twitter-share-utils.d.ts +4 -0
- package/{plugins → dist/types/plugins}/share/types.d.ts +6 -6
- package/{plugins → dist/types/plugins}/thumbnail/lg-thumbnail-settings.d.ts +85 -70
- package/dist/types/plugins/thumbnail/lg-thumbnail.d.ts +88 -0
- package/{plugins → dist/types/plugins}/video/lg-video-settings.d.ts +94 -71
- package/{plugins → dist/types/plugins}/video/lg-video.d.ts +116 -104
- package/{plugins → dist/types/plugins}/video/types.d.ts +8 -8
- package/{plugins → dist/types/plugins}/vimeoThumbnail/lg-vimeo-thumbnail-settings.d.ts +11 -11
- package/{plugins → dist/types/plugins}/vimeoThumbnail/lg-vimeo-thumbnail.d.ts +14 -14
- package/{plugins → dist/types/plugins}/zoom/lg-zoom-settings.d.ts +54 -51
- package/{plugins → dist/types/plugins}/zoom/lg-zoom.d.ts +145 -108
- package/{types.d.ts → dist/types/types.d.ts} +40 -40
- package/package.json +237 -8
- package/angular/10/README.md +0 -24
- package/angular/10/bundles/lightgallery-angular-10.umd.js +0 -289
- package/angular/10/bundles/lightgallery-angular-10.umd.js.map +0 -1
- package/angular/10/bundles/lightgallery-angular-10.umd.min.js +0 -2
- package/angular/10/bundles/lightgallery-angular-10.umd.min.js.map +0 -1
- package/angular/10/esm2015/lib/lightgallery-angular.component.js +0 -225
- package/angular/10/esm2015/lib/lightgallery-angular.module.js +0 -17
- package/angular/10/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/10/esm2015/lightgallery-angular-10.js +0 -5
- package/angular/10/esm2015/public-api.js +0 -7
- package/angular/10/fesm2015/lightgallery-angular-10.js +0 -261
- package/angular/10/fesm2015/lightgallery-angular-10.js.map +0 -1
- package/angular/10/lib/lightgallery-angular.component.d.ts +0 -39
- package/angular/10/lib/lightgallery-angular.component.d.ts.map +0 -1
- package/angular/10/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/10/lib/lightgallery-angular.module.d.ts.map +0 -1
- package/angular/10/lib/lightgallery-angular.service.d.ts +0 -7
- package/angular/10/lib/lightgallery-angular.service.d.ts.map +0 -1
- package/angular/10/lightgallery-angular-10.d.ts +0 -6
- package/angular/10/lightgallery-angular-10.d.ts.map +0 -1
- package/angular/10/package.json +0 -21
- package/angular/10/public-api.d.ts +0 -4
- package/angular/10/public-api.d.ts.map +0 -1
- package/angular/11/README.md +0 -24
- package/angular/11/bundles/lightgallery-angular-11.umd.js +0 -290
- package/angular/11/bundles/lightgallery-angular-11.umd.js.map +0 -1
- package/angular/11/bundles/lightgallery-angular-11.umd.min.js +0 -2
- package/angular/11/bundles/lightgallery-angular-11.umd.min.js.map +0 -1
- package/angular/11/esm2015/lib/lightgallery-angular.component.js +0 -225
- package/angular/11/esm2015/lib/lightgallery-angular.module.js +0 -18
- package/angular/11/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/11/esm2015/lightgallery-angular-11.js +0 -5
- package/angular/11/esm2015/public-api.js +0 -7
- package/angular/11/fesm2015/lightgallery-angular-11.js +0 -262
- package/angular/11/fesm2015/lightgallery-angular-11.js.map +0 -1
- package/angular/11/lib/lightgallery-angular.component.d.ts +0 -39
- package/angular/11/lib/lightgallery-angular.component.d.ts.map +0 -1
- package/angular/11/lib/lightgallery-angular.module.d.ts +0 -8
- package/angular/11/lib/lightgallery-angular.module.d.ts.map +0 -1
- package/angular/11/lib/lightgallery-angular.service.d.ts +0 -7
- package/angular/11/lib/lightgallery-angular.service.d.ts.map +0 -1
- package/angular/11/lightgallery-angular-11.d.ts +0 -6
- package/angular/11/lightgallery-angular-11.d.ts.map +0 -1
- package/angular/11/package.json +0 -21
- package/angular/11/public-api.d.ts +0 -4
- package/angular/11/public-api.d.ts.map +0 -1
- package/angular/12/README.md +0 -24
- package/angular/12/bundles/lightgallery-angular-12.umd.js +0 -296
- package/angular/12/bundles/lightgallery-angular-12.umd.js.map +0 -1
- package/angular/12/esm2015/lib/lightgallery-angular.component.js +0 -221
- package/angular/12/esm2015/lib/lightgallery-angular.module.js +0 -17
- package/angular/12/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/12/esm2015/lightgallery-angular-12.js +0 -5
- package/angular/12/esm2015/public-api.js +0 -7
- package/angular/12/fesm2015/lightgallery-angular-12.js +0 -258
- package/angular/12/fesm2015/lightgallery-angular-12.js.map +0 -1
- package/angular/12/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/12/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/12/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/12/lightgallery-angular-12.d.ts +0 -5
- package/angular/12/package.json +0 -18
- package/angular/12/public-api.d.ts +0 -3
- package/angular/13/README.md +0 -24
- package/angular/13/esm2020/lib/lightgallery-angular.component.mjs +0 -221
- package/angular/13/esm2020/lib/lightgallery-angular.module.mjs +0 -17
- package/angular/13/esm2020/lib/lightgallery-angular.service.mjs +0 -14
- package/angular/13/esm2020/lightgallery-angular-13.mjs +0 -5
- package/angular/13/esm2020/public-api.mjs +0 -7
- package/angular/13/fesm2015/lightgallery-angular-13.mjs +0 -258
- package/angular/13/fesm2015/lightgallery-angular-13.mjs.map +0 -1
- package/angular/13/fesm2020/lightgallery-angular-13.mjs +0 -258
- package/angular/13/fesm2020/lightgallery-angular-13.mjs.map +0 -1
- package/angular/13/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/13/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/13/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/13/lightgallery-angular-13.d.ts +0 -5
- package/angular/13/package.json +0 -31
- package/angular/13/public-api.d.ts +0 -3
- package/angular/14/README.md +0 -24
- package/angular/14/esm2020/lib/lightgallery-angular.component.mjs +0 -217
- package/angular/14/esm2020/lib/lightgallery-angular.module.mjs +0 -17
- package/angular/14/esm2020/lib/lightgallery-angular.service.mjs +0 -14
- package/angular/14/esm2020/lightgallery-angular-14.mjs +0 -5
- package/angular/14/esm2020/public-api.mjs +0 -7
- package/angular/14/fesm2015/lightgallery-angular-14.mjs +0 -254
- package/angular/14/fesm2015/lightgallery-angular-14.mjs.map +0 -1
- package/angular/14/fesm2020/lightgallery-angular-14.mjs +0 -254
- package/angular/14/fesm2020/lightgallery-angular-14.mjs.map +0 -1
- package/angular/14/index.d.ts +0 -5
- package/angular/14/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/14/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/14/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/14/package.json +0 -31
- package/angular/14/public-api.d.ts +0 -3
- package/angular/15/README.md +0 -24
- package/angular/15/esm2022/lib/lightgallery-angular.component.mjs +0 -218
- package/angular/15/esm2022/lib/lightgallery-angular.module.mjs +0 -18
- package/angular/15/esm2022/lib/lightgallery-angular.service.mjs +0 -15
- package/angular/15/esm2022/lightgallery-angular-15.mjs +0 -5
- package/angular/15/esm2022/public-api.mjs +0 -7
- package/angular/15/fesm2022/lightgallery-angular-15.mjs +0 -254
- package/angular/15/fesm2022/lightgallery-angular-15.mjs.map +0 -1
- package/angular/15/index.d.ts +0 -5
- package/angular/15/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/15/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/15/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/15/package.json +0 -25
- package/angular/15/public-api.d.ts +0 -3
- package/angular/16/README.md +0 -24
- package/angular/16/esm2022/lib/lightgallery-angular.component.mjs +0 -218
- package/angular/16/esm2022/lib/lightgallery-angular.module.mjs +0 -18
- package/angular/16/esm2022/lib/lightgallery-angular.service.mjs +0 -15
- package/angular/16/esm2022/lightgallery-angular-16.mjs +0 -5
- package/angular/16/esm2022/public-api.mjs +0 -7
- package/angular/16/fesm2022/lightgallery-angular-16.mjs +0 -254
- package/angular/16/fesm2022/lightgallery-angular-16.mjs.map +0 -1
- package/angular/16/index.d.ts +0 -5
- package/angular/16/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/16/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/16/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/16/package.json +0 -25
- package/angular/16/public-api.d.ts +0 -3
- package/angular/9/README.md +0 -24
- package/angular/9/bundles/lightgallery-angular-9.umd.js +0 -271
- package/angular/9/bundles/lightgallery-angular-9.umd.js.map +0 -1
- package/angular/9/bundles/lightgallery-angular-9.umd.min.js +0 -2
- package/angular/9/bundles/lightgallery-angular-9.umd.min.js.map +0 -1
- package/angular/9/esm2015/lib/lightgallery-angular.component.js +0 -225
- package/angular/9/esm2015/lib/lightgallery-angular.module.js +0 -17
- package/angular/9/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/9/esm2015/lightgallery-angular-9.js +0 -5
- package/angular/9/esm2015/public-api.js +0 -7
- package/angular/9/esm5/lib/lightgallery-angular.component.js +0 -228
- package/angular/9/esm5/lib/lightgallery-angular.module.js +0 -21
- package/angular/9/esm5/lib/lightgallery-angular.service.js +0 -17
- package/angular/9/esm5/lightgallery-angular-9.js +0 -5
- package/angular/9/esm5/public-api.js +0 -7
- package/angular/9/fesm2015/lightgallery-angular-9.js +0 -261
- package/angular/9/fesm2015/lightgallery-angular-9.js.map +0 -1
- package/angular/9/fesm5/lightgallery-angular-9.js +0 -268
- package/angular/9/fesm5/lightgallery-angular-9.js.map +0 -1
- package/angular/9/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/9/lib/lightgallery-angular.module.d.ts +0 -6
- package/angular/9/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/9/lightgallery-angular-9.d.ts +0 -5
- package/angular/9/package.json +0 -23
- package/angular/9/public-api.d.ts +0 -3
- package/angular/README.md +0 -24
- package/angular/esm2022/lib/lightgallery-angular.component.mjs +0 -218
- package/angular/esm2022/lib/lightgallery-angular.module.mjs +0 -18
- package/angular/esm2022/lib/lightgallery-angular.service.mjs +0 -15
- package/angular/esm2022/lightgallery-angular.mjs +0 -5
- package/angular/esm2022/public-api.mjs +0 -7
- package/angular/fesm2022/lightgallery-angular.mjs +0 -254
- package/angular/fesm2022/lightgallery-angular.mjs.map +0 -1
- package/angular/index.d.ts +0 -5
- package/angular/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/package.json +0 -25
- package/angular/public-api.d.ts +0 -3
- package/css/lg-fullscreen.css +0 -8
- package/css/lg-fullscreen.css.map +0 -1
- package/css/lg-share.css.map +0 -1
- package/css/lg-thumbnail.css.map +0 -1
- package/css/lg-transitions.css.map +0 -1
- package/css/lg-zoom.css.map +0 -1
- package/css/lightgallery-bundle.css.map +0 -1
- package/css/lightgallery-bundle.min.css +0 -1
- package/css/lightgallery-core.css.map +0 -1
- package/css/lightgallery.css.map +0 -1
- package/fonts/lg.svg +0 -54
- package/fonts/lg.ttf +0 -0
- package/fonts/lg.woff +0 -0
- package/fonts/lg.woff2 +0 -0
- package/lib/index.js +0 -8
- package/lib/index.js.map +0 -1
- package/lib/lg-events.js +0 -37
- package/lib/lg-events.js.map +0 -1
- package/lib/lg-plugin.js +0 -13
- package/lib/lg-plugin.js.map +0 -1
- package/lib/lg-settings.js +0 -83
- package/lib/lg-settings.js.map +0 -1
- package/lib/lg-utils.js +0 -328
- package/lib/lg-utils.js.map +0 -1
- package/lib/lgQuery.js +0 -385
- package/lib/lgQuery.js.map +0 -1
- package/lib/lightgallery.js +0 -1949
- package/lib/lightgallery.js.map +0 -1
- package/lib/plugins/autoplay/lg-autoplay-settings.js +0 -16
- package/lib/plugins/autoplay/lg-autoplay-settings.js.map +0 -1
- package/lib/plugins/autoplay/lg-autoplay.js +0 -184
- package/lib/plugins/autoplay/lg-autoplay.js.map +0 -1
- package/lib/plugins/comment/lg-comment-settings.js +0 -17
- package/lib/plugins/comment/lg-comment-settings.js.map +0 -1
- package/lib/plugins/comment/lg-comment.js +0 -140
- package/lib/plugins/comment/lg-comment.js.map +0 -1
- package/lib/plugins/fullscreen/lg-fullscreen-settings.js +0 -10
- package/lib/plugins/fullscreen/lg-fullscreen-settings.js.map +0 -1
- package/lib/plugins/fullscreen/lg-fullscreen.js +0 -108
- package/lib/plugins/fullscreen/lg-fullscreen.js.map +0 -1
- package/lib/plugins/hash/lg-hash-settings.js +0 -9
- package/lib/plugins/hash/lg-hash-settings.js.map +0 -1
- package/lib/plugins/hash/lg-hash.js +0 -139
- package/lib/plugins/hash/lg-hash.js.map +0 -1
- package/lib/plugins/mediumZoom/lg-medium-zoom-settings.js +0 -9
- package/lib/plugins/mediumZoom/lg-medium-zoom-settings.js.map +0 -1
- package/lib/plugins/mediumZoom/lg-medium-zoom.js +0 -73
- package/lib/plugins/mediumZoom/lg-medium-zoom.js.map +0 -1
- package/lib/plugins/pager/lg-pager-settings.js +0 -7
- package/lib/plugins/pager/lg-pager-settings.js.map +0 -1
- package/lib/plugins/pager/lg-pager.js +0 -82
- package/lib/plugins/pager/lg-pager.js.map +0 -1
- package/lib/plugins/relativeCaption/lg-relative-caption-settings.js +0 -7
- package/lib/plugins/relativeCaption/lg-relative-caption-settings.js.map +0 -1
- package/lib/plugins/relativeCaption/lg-relative-caption.js +0 -97
- package/lib/plugins/relativeCaption/lg-relative-caption.js.map +0 -1
- package/lib/plugins/rotate/lg-rotate-settings.js +0 -18
- package/lib/plugins/rotate/lg-rotate-settings.js.map +0 -1
- package/lib/plugins/rotate/lg-rotate.js +0 -206
- package/lib/plugins/rotate/lg-rotate.js.map +0 -1
- package/lib/plugins/share/lg-fb-share-utils.js +0 -10
- package/lib/plugins/share/lg-fb-share-utils.js.map +0 -1
- package/lib/plugins/share/lg-pinterest-share-utils.js +0 -17
- package/lib/plugins/share/lg-pinterest-share-utils.js.map +0 -1
- package/lib/plugins/share/lg-share-settings.js +0 -15
- package/lib/plugins/share/lg-share-settings.js.map +0 -1
- package/lib/plugins/share/lg-share.js +0 -130
- package/lib/plugins/share/lg-share.js.map +0 -1
- package/lib/plugins/share/lg-twitter-share-utils.js +0 -11
- package/lib/plugins/share/lg-twitter-share-utils.js.map +0 -1
- package/lib/plugins/share/types.js +0 -3
- package/lib/plugins/share/types.js.map +0 -1
- package/lib/plugins/thumbnail/lg-thumbnail-settings.js +0 -23
- package/lib/plugins/thumbnail/lg-thumbnail-settings.js.map +0 -1
- package/lib/plugins/thumbnail/lg-thumbnail.js +0 -414
- package/lib/plugins/thumbnail/lg-thumbnail.js.map +0 -1
- package/lib/plugins/video/lg-video-settings.js +0 -15
- package/lib/plugins/video/lg-video-settings.js.map +0 -1
- package/lib/plugins/video/lg-video-utils.js +0 -84
- package/lib/plugins/video/lg-video-utils.js.map +0 -1
- package/lib/plugins/video/lg-video.js +0 -411
- package/lib/plugins/video/lg-video.js.map +0 -1
- package/lib/plugins/video/types.js +0 -3
- package/lib/plugins/video/types.js.map +0 -1
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js +0 -8
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js.map +0 -1
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js +0 -122
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js.map +0 -1
- package/lib/plugins/zoom/lg-zoom-settings.js +0 -21
- package/lib/plugins/zoom/lg-zoom-settings.js.map +0 -1
- package/lib/plugins/zoom/lg-zoom.js +0 -909
- package/lib/plugins/zoom/lg-zoom.js.map +0 -1
- package/lib/types.js +0 -3
- package/lib/types.js.map +0 -1
- package/lightgallery-2.9.0.tgz +0 -0
- package/lightgallery.es5.js +0 -2786
- package/lightgallery.es5.js.map +0 -1
- package/lightgallery.min.js +0 -8
- package/lightgallery.umd.js +0 -2794
- package/lightgallery.umd.js.map +0 -1
- package/lit/custom-elements.json +0 -82
- package/lit/lightgallery.esm.js +0 -59
- package/lit/lightgallery.umd.js +0 -37
- package/lit/package.json +0 -8
- package/plugins/autoplay/lg-autoplay.es5.js +0 -250
- package/plugins/autoplay/lg-autoplay.es5.js.map +0 -1
- package/plugins/autoplay/lg-autoplay.min.js +0 -8
- package/plugins/autoplay/lg-autoplay.umd.js +0 -258
- package/plugins/autoplay/lg-autoplay.umd.js.map +0 -1
- package/plugins/autoplay/package.json +0 -7
- package/plugins/comment/lg-comment.es5.js +0 -205
- package/plugins/comment/lg-comment.es5.js.map +0 -1
- package/plugins/comment/lg-comment.min.js +0 -8
- package/plugins/comment/lg-comment.umd.js +0 -213
- package/plugins/comment/lg-comment.umd.js.map +0 -1
- package/plugins/comment/package.json +0 -7
- package/plugins/fullscreen/lg-fullscreen.es5.js +0 -135
- package/plugins/fullscreen/lg-fullscreen.es5.js.map +0 -1
- package/plugins/fullscreen/lg-fullscreen.min.js +0 -8
- package/plugins/fullscreen/lg-fullscreen.umd.js +0 -143
- package/plugins/fullscreen/lg-fullscreen.umd.js.map +0 -1
- package/plugins/fullscreen/package.json +0 -7
- package/plugins/hash/lg-hash-settings.d.ts +0 -16
- package/plugins/hash/lg-hash.es5.js +0 -198
- package/plugins/hash/lg-hash.es5.js.map +0 -1
- package/plugins/hash/lg-hash.min.js +0 -8
- package/plugins/hash/lg-hash.umd.js +0 -206
- package/plugins/hash/lg-hash.umd.js.map +0 -1
- package/plugins/hash/package.json +0 -7
- package/plugins/mediumZoom/lg-medium-zoom.es5.js +0 -132
- package/plugins/mediumZoom/lg-medium-zoom.es5.js.map +0 -1
- package/plugins/mediumZoom/lg-medium-zoom.min.js +0 -8
- package/plugins/mediumZoom/lg-medium-zoom.umd.js +0 -140
- package/plugins/mediumZoom/lg-medium-zoom.umd.js.map +0 -1
- package/plugins/mediumZoom/package.json +0 -7
- package/plugins/pager/lg-pager.es5.js +0 -139
- package/plugins/pager/lg-pager.es5.js.map +0 -1
- package/plugins/pager/lg-pager.min.js +0 -8
- package/plugins/pager/lg-pager.umd.js +0 -147
- package/plugins/pager/lg-pager.umd.js.map +0 -1
- package/plugins/pager/package.json +0 -7
- package/plugins/relativeCaption/lg-relative-caption.es5.js +0 -154
- package/plugins/relativeCaption/lg-relative-caption.es5.js.map +0 -1
- package/plugins/relativeCaption/lg-relative-caption.min.js +0 -8
- package/plugins/relativeCaption/lg-relative-caption.umd.js +0 -162
- package/plugins/relativeCaption/lg-relative-caption.umd.js.map +0 -1
- package/plugins/relativeCaption/package.json +0 -7
- package/plugins/rotate/lg-rotate.es5.js +0 -274
- package/plugins/rotate/lg-rotate.es5.js.map +0 -1
- package/plugins/rotate/lg-rotate.min.js +0 -8
- package/plugins/rotate/lg-rotate.umd.js +0 -282
- package/plugins/rotate/lg-rotate.umd.js.map +0 -1
- package/plugins/rotate/package.json +0 -7
- package/plugins/share/lg-share.d.ts +0 -15
- package/plugins/share/lg-share.es5.js +0 -219
- package/plugins/share/lg-share.es5.js.map +0 -1
- package/plugins/share/lg-share.min.js +0 -8
- package/plugins/share/lg-share.umd.js +0 -227
- package/plugins/share/lg-share.umd.js.map +0 -1
- package/plugins/share/lg-twitter-share-utils.d.ts +0 -2
- package/plugins/share/package.json +0 -7
- package/plugins/thumbnail/lg-thumbnail.d.ts +0 -48
- package/plugins/thumbnail/lg-thumbnail.es5.js +0 -487
- package/plugins/thumbnail/lg-thumbnail.es5.js.map +0 -1
- package/plugins/thumbnail/lg-thumbnail.min.js +0 -8
- package/plugins/thumbnail/lg-thumbnail.umd.js +0 -495
- package/plugins/thumbnail/lg-thumbnail.umd.js.map +0 -1
- package/plugins/thumbnail/package.json +0 -7
- package/plugins/video/lg-video-utils.d.ts +0 -10
- package/plugins/video/lg-video.es5.js +0 -545
- package/plugins/video/lg-video.es5.js.map +0 -1
- package/plugins/video/lg-video.min.js +0 -8
- package/plugins/video/lg-video.umd.js +0 -553
- package/plugins/video/lg-video.umd.js.map +0 -1
- package/plugins/video/package.json +0 -7
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +0 -182
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +0 -1
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +0 -8
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +0 -190
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +0 -1
- package/plugins/vimeoThumbnail/package.json +0 -7
- package/plugins/zoom/lg-zoom.es5.js +0 -980
- package/plugins/zoom/lg-zoom.es5.js.map +0 -1
- package/plugins/zoom/lg-zoom.min.js +0 -8
- package/plugins/zoom/lg-zoom.umd.js +0 -988
- package/plugins/zoom/lg-zoom.umd.js.map +0 -1
- package/plugins/zoom/package.json +0 -7
- package/react/Lightgallery.d.ts +0 -33
- package/react/Lightgallery.es5.js +0 -2988
- package/react/Lightgallery.es5.js.map +0 -1
- package/react/Lightgallery.umd.js +0 -2994
- package/react/Lightgallery.umd.js.map +0 -1
- package/react/package.json +0 -7
- package/scss/_lg-fonts.scss +0 -27
- package/scss/lg-fullscreen.scss +0 -9
- package/vue/LightGallery.vue.d.ts +0 -37
- package/vue/LightGalleryVue.common.js +0 -9343
- package/vue/LightGalleryVue.common.js.map +0 -1
- package/vue/LightGalleryVue.umd.js +0 -9353
- package/vue/LightGalleryVue.umd.js.map +0 -1
- package/vue/LightGalleryVue.umd.min.js +0 -8
- package/vue/LightGalleryVue.umd.min.js.map +0 -1
- package/vue/package.json +0 -7
- /package/{css → dist/css}/lg-medium-zoom.css +0 -0
- /package/{css → dist/css}/lg-medium-zoom.css.map +0 -0
- /package/{css → dist/css}/lg-pager.css +0 -0
- /package/{css → dist/css}/lg-relative-caption.css +0 -0
- /package/{css → dist/css}/lg-relative-caption.css.map +0 -0
- /package/{css → dist/css}/lg-video.css +0 -0
- /package/{css → dist/css}/lg-video.css.map +0 -0
- /package/{images → dist/images}/loading.gif +0 -0
- /package/{scss → dist/scss}/_lg-mixins.scss +0 -0
- /package/{scss → dist/scss}/lg-medium-zoom.scss +0 -0
- /package/{scss → dist/scss}/lg-pager.scss +0 -0
- /package/{scss → dist/scss}/lg-relative-caption.scss +0 -0
- /package/{scss → dist/scss}/lg-transitions.scss +0 -0
- /package/{scss → dist/scss}/lg-video.scss +0 -0
- /package/{scss → dist/scss}/transitions/_index.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-lollipop-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-lollipop.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-rotate-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-rotate.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-cross-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-cross.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-y-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-y.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-cross-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-cross.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-vertical-growth.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-vertical.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-tube.scss +0 -0
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* lightgallery | 3.0.0-beta.2 | October 1st 2026
|
|
3
|
+
* http://www.lightgalleryjs.com/
|
|
4
|
+
* Copyright (c) 2020 Sachin Neravath;
|
|
5
|
+
* @license GPLv3
|
|
6
|
+
*/
|
|
7
|
+
function isUsableOriginRect(rect) {
|
|
8
|
+
return !!rect && Number.isFinite(rect.left) && Number.isFinite(rect.top) && rect.width > 0 && rect.height > 0;
|
|
9
|
+
}
|
|
10
|
+
function getOriginTransform(input) {
|
|
11
|
+
const { triggerRect, containerRect, top, bottom, imageSize } = input;
|
|
12
|
+
const availableWidth = containerRect.width;
|
|
13
|
+
const availableHeight = containerRect.height - (top + bottom);
|
|
14
|
+
const x = (availableWidth - triggerRect.width) / 2 - triggerRect.left + containerRect.left;
|
|
15
|
+
const y = (availableHeight - triggerRect.height) / 2 - triggerRect.top + top;
|
|
16
|
+
const scaleX = triggerRect.width / imageSize.width;
|
|
17
|
+
const scaleY = triggerRect.height / imageSize.height;
|
|
18
|
+
return `translate3d(${-x}px, ${-y}px, 0) scale3d(${scaleX}, ${scaleY}, 1)`;
|
|
19
|
+
}
|
|
20
|
+
const WHOLE_IMAGE = { x: 0, y: 0, width: 1, height: 1 };
|
|
21
|
+
const FRACTION_EPSILON = 1e-3;
|
|
22
|
+
function isWholeImage(rect) {
|
|
23
|
+
return Math.abs(rect.x) < FRACTION_EPSILON && Math.abs(rect.y) < FRACTION_EPSILON && Math.abs(rect.width - 1) < FRACTION_EPSILON && Math.abs(rect.height - 1) < FRACTION_EPSILON;
|
|
24
|
+
}
|
|
25
|
+
const CENTER_AXIS = { percent: 50, px: 0 };
|
|
26
|
+
const CSS_POSITION_CENTER = {
|
|
27
|
+
x: CENTER_AXIS,
|
|
28
|
+
y: CENTER_AXIS
|
|
29
|
+
};
|
|
30
|
+
const POSITION_KEYWORDS = {
|
|
31
|
+
left: 0,
|
|
32
|
+
top: 0,
|
|
33
|
+
center: 50,
|
|
34
|
+
right: 100,
|
|
35
|
+
bottom: 100
|
|
36
|
+
};
|
|
37
|
+
function parsePositionAxis(token) {
|
|
38
|
+
const keyword = POSITION_KEYWORDS[token];
|
|
39
|
+
if (keyword !== void 0) {
|
|
40
|
+
return { percent: keyword, px: 0 };
|
|
41
|
+
}
|
|
42
|
+
const percent = /^(-?\d*\.?\d+)%$/.exec(token);
|
|
43
|
+
if (percent) {
|
|
44
|
+
return { percent: parseFloat(percent[1]), px: 0 };
|
|
45
|
+
}
|
|
46
|
+
const px = /^(-?\d*\.?\d+)px$/.exec(token);
|
|
47
|
+
if (px) {
|
|
48
|
+
return { percent: 0, px: parseFloat(px[1]) };
|
|
49
|
+
}
|
|
50
|
+
const calc = /^calc\(\s*(-?\d*\.?\d+)%\s*([+-])\s*(-?\d*\.?\d+)px\s*\)$/.exec(token);
|
|
51
|
+
if (calc) {
|
|
52
|
+
const sign = calc[2] === "-" ? -1 : 1;
|
|
53
|
+
return {
|
|
54
|
+
percent: parseFloat(calc[1]),
|
|
55
|
+
px: sign * parseFloat(calc[3])
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
function parseCssPosition(value) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const layer = (value != null ? value : "").split(",")[0].trim().toLowerCase();
|
|
63
|
+
if (!layer) {
|
|
64
|
+
return CSS_POSITION_CENTER;
|
|
65
|
+
}
|
|
66
|
+
const tokens = (_a = layer.match(/calc\([^)]*\)|\S+/g)) != null ? _a : [];
|
|
67
|
+
if (tokens.length === 2 && (tokens[0] === "top" || tokens[0] === "bottom") && (tokens[1] === "left" || tokens[1] === "right")) {
|
|
68
|
+
tokens.reverse();
|
|
69
|
+
}
|
|
70
|
+
const x = parsePositionAxis((_b = tokens[0]) != null ? _b : "");
|
|
71
|
+
const y = tokens[1] === void 0 ? CENTER_AXIS : parsePositionAxis(tokens[1]);
|
|
72
|
+
if (!x || !y) {
|
|
73
|
+
return CSS_POSITION_CENTER;
|
|
74
|
+
}
|
|
75
|
+
return { x, y };
|
|
76
|
+
}
|
|
77
|
+
function parseObjectFit(value) {
|
|
78
|
+
const fit = (value != null ? value : "").trim().toLowerCase();
|
|
79
|
+
switch (fit) {
|
|
80
|
+
case "contain":
|
|
81
|
+
case "cover":
|
|
82
|
+
case "none":
|
|
83
|
+
case "scale-down":
|
|
84
|
+
return fit;
|
|
85
|
+
default:
|
|
86
|
+
return "fill";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function parseBackgroundFit(value) {
|
|
90
|
+
const layer = (value != null ? value : "").split(",")[0].trim().toLowerCase();
|
|
91
|
+
switch (layer) {
|
|
92
|
+
case "cover":
|
|
93
|
+
case "contain":
|
|
94
|
+
return layer;
|
|
95
|
+
case "auto":
|
|
96
|
+
case "auto auto":
|
|
97
|
+
return "none";
|
|
98
|
+
case "100% 100%":
|
|
99
|
+
return "fill";
|
|
100
|
+
default:
|
|
101
|
+
return void 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function parseCssUrl(value) {
|
|
105
|
+
var _a;
|
|
106
|
+
const match = /url\(\s*(["']?)(.*?)\1\s*\)/.exec(value != null ? value : "");
|
|
107
|
+
const url = (_a = match == null ? void 0 : match[2]) == null ? void 0 : _a.trim();
|
|
108
|
+
return url || void 0;
|
|
109
|
+
}
|
|
110
|
+
const ASPECT_EPSILON = 0.01;
|
|
111
|
+
function aspectOf(size) {
|
|
112
|
+
return size.width / size.height;
|
|
113
|
+
}
|
|
114
|
+
function sameAspect(a, b) {
|
|
115
|
+
return Math.abs(a / b - 1) < ASPECT_EPSILON;
|
|
116
|
+
}
|
|
117
|
+
function centeredCrop(imageAspect, cropAspect) {
|
|
118
|
+
if (sameAspect(imageAspect, cropAspect)) {
|
|
119
|
+
return WHOLE_IMAGE;
|
|
120
|
+
}
|
|
121
|
+
if (cropAspect > imageAspect) {
|
|
122
|
+
const height = imageAspect / cropAspect;
|
|
123
|
+
return { x: 0, y: (1 - height) / 2, width: 1, height };
|
|
124
|
+
}
|
|
125
|
+
const width = cropAspect / imageAspect;
|
|
126
|
+
return { x: (1 - width) / 2, y: 0, width, height: 1 };
|
|
127
|
+
}
|
|
128
|
+
function resolvePositionAxis(axis, freeSpace) {
|
|
129
|
+
return freeSpace * axis.percent / 100 + axis.px;
|
|
130
|
+
}
|
|
131
|
+
const uncropped = (box) => ({
|
|
132
|
+
rect: box,
|
|
133
|
+
window: WHOLE_IMAGE,
|
|
134
|
+
region: WHOLE_IMAGE
|
|
135
|
+
});
|
|
136
|
+
function getOriginWindow(input) {
|
|
137
|
+
var _a;
|
|
138
|
+
const { box, imageSize, thumbSize, position = CSS_POSITION_CENTER } = input;
|
|
139
|
+
let fit = (_a = input.fit) != null ? _a : "fill";
|
|
140
|
+
if (!isUsableOriginRect(box) || !(imageSize.width > 0) || !(imageSize.height > 0)) {
|
|
141
|
+
return uncropped(box);
|
|
142
|
+
}
|
|
143
|
+
const imageAspect = aspectOf(imageSize);
|
|
144
|
+
const knownThumb = thumbSize && thumbSize.width > 0 && thumbSize.height > 0 ? thumbSize : void 0;
|
|
145
|
+
if (!knownThumb && (fit === "none" || fit === "scale-down")) {
|
|
146
|
+
fit = "fill";
|
|
147
|
+
}
|
|
148
|
+
const thumb = knownThumb != null ? knownThumb : imageSize;
|
|
149
|
+
const region = centeredCrop(imageAspect, aspectOf(thumb));
|
|
150
|
+
let scaleX;
|
|
151
|
+
let scaleY;
|
|
152
|
+
switch (fit) {
|
|
153
|
+
case "fill":
|
|
154
|
+
scaleX = box.width / thumb.width;
|
|
155
|
+
scaleY = box.height / thumb.height;
|
|
156
|
+
break;
|
|
157
|
+
case "cover":
|
|
158
|
+
scaleX = scaleY = Math.max(
|
|
159
|
+
box.width / thumb.width,
|
|
160
|
+
box.height / thumb.height
|
|
161
|
+
);
|
|
162
|
+
break;
|
|
163
|
+
case "contain":
|
|
164
|
+
scaleX = scaleY = Math.min(
|
|
165
|
+
box.width / thumb.width,
|
|
166
|
+
box.height / thumb.height
|
|
167
|
+
);
|
|
168
|
+
break;
|
|
169
|
+
case "none":
|
|
170
|
+
scaleX = scaleY = 1;
|
|
171
|
+
break;
|
|
172
|
+
case "scale-down":
|
|
173
|
+
scaleX = scaleY = Math.min(
|
|
174
|
+
1,
|
|
175
|
+
box.width / thumb.width,
|
|
176
|
+
box.height / thumb.height
|
|
177
|
+
);
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
const paintedWidth = thumb.width * scaleX;
|
|
181
|
+
const paintedHeight = thumb.height * scaleY;
|
|
182
|
+
const offsetX = resolvePositionAxis(position.x, box.width - paintedWidth);
|
|
183
|
+
const offsetY = resolvePositionAxis(position.y, box.height - paintedHeight);
|
|
184
|
+
const visibleLeft = Math.max(0, offsetX);
|
|
185
|
+
const visibleTop = Math.max(0, offsetY);
|
|
186
|
+
const visibleRight = Math.min(box.width, offsetX + paintedWidth);
|
|
187
|
+
const visibleBottom = Math.min(box.height, offsetY + paintedHeight);
|
|
188
|
+
if (visibleRight <= visibleLeft || visibleBottom <= visibleTop) {
|
|
189
|
+
return uncropped(box);
|
|
190
|
+
}
|
|
191
|
+
const rect = {
|
|
192
|
+
left: box.left + visibleLeft,
|
|
193
|
+
top: box.top + visibleTop,
|
|
194
|
+
width: visibleRight - visibleLeft,
|
|
195
|
+
height: visibleBottom - visibleTop
|
|
196
|
+
};
|
|
197
|
+
const fileX = (visibleLeft - offsetX) / paintedWidth;
|
|
198
|
+
const fileY = (visibleTop - offsetY) / paintedHeight;
|
|
199
|
+
const window2 = {
|
|
200
|
+
x: region.x + fileX * region.width,
|
|
201
|
+
y: region.y + fileY * region.height,
|
|
202
|
+
width: rect.width / paintedWidth * region.width,
|
|
203
|
+
height: rect.height / paintedHeight * region.height
|
|
204
|
+
};
|
|
205
|
+
return { rect, window: window2, region };
|
|
206
|
+
}
|
|
207
|
+
function getOriginCropFlight(input) {
|
|
208
|
+
const { triggerRect, containerRect, top, bottom, imageSize, window: window2 } = input;
|
|
209
|
+
const stageLeft = containerRect.left;
|
|
210
|
+
const stageTop = containerRect.top + top;
|
|
211
|
+
const stageWidth = containerRect.width;
|
|
212
|
+
const stageHeight = containerRect.height - (top + bottom);
|
|
213
|
+
const outerX = triggerRect.left + triggerRect.width - (stageLeft + stageWidth);
|
|
214
|
+
const outerY = triggerRect.top + triggerRect.height - (stageTop + stageHeight);
|
|
215
|
+
const innerX = stageWidth - triggerRect.width;
|
|
216
|
+
const innerY = stageHeight - triggerRect.height;
|
|
217
|
+
const scaleX = triggerRect.width / (imageSize.width * window2.width);
|
|
218
|
+
const scaleY = triggerRect.height / (imageSize.height * window2.height);
|
|
219
|
+
const windowX = imageSize.width * (window2.x + window2.width / 2 - 0.5);
|
|
220
|
+
const windowY = imageSize.height * (window2.y + window2.height / 2 - 0.5);
|
|
221
|
+
const x = (triggerRect.width - stageWidth) / 2 - windowX * scaleX;
|
|
222
|
+
const y = (triggerRect.height - stageHeight) / 2 - windowY * scaleY;
|
|
223
|
+
return {
|
|
224
|
+
transform: `translate3d(${x}px, ${y}px, 0) scale3d(${scaleX}, ${scaleY}, 1)`,
|
|
225
|
+
outer: `translate3d(${outerX}px, ${outerY}px, 0)`,
|
|
226
|
+
inner: `translate3d(${innerX}px, ${innerY}px, 0)`
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const lGEvents = {
|
|
230
|
+
beforeOpen: "lgBeforeOpen",
|
|
231
|
+
beforeClose: "lgBeforeClose",
|
|
232
|
+
afterClose: "lgAfterClose"
|
|
233
|
+
};
|
|
234
|
+
const originCropSettings = {
|
|
235
|
+
originCrop: true
|
|
236
|
+
};
|
|
237
|
+
var __defProp = Object.defineProperty;
|
|
238
|
+
var __defProps = Object.defineProperties;
|
|
239
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
240
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
241
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
242
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
243
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
244
|
+
var __spreadValues = (a, b) => {
|
|
245
|
+
for (var prop in b || (b = {}))
|
|
246
|
+
if (__hasOwnProp.call(b, prop))
|
|
247
|
+
__defNormalProp(a, prop, b[prop]);
|
|
248
|
+
if (__getOwnPropSymbols)
|
|
249
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
250
|
+
if (__propIsEnum.call(b, prop))
|
|
251
|
+
__defNormalProp(a, prop, b[prop]);
|
|
252
|
+
}
|
|
253
|
+
return a;
|
|
254
|
+
};
|
|
255
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
256
|
+
const STAGE_REST = "translate3d(0, 0, 0)";
|
|
257
|
+
const SLIDE_REST = /^(none|translate3d\(0(px)?,\s*0(px)?,\s*0(px)?\))$/;
|
|
258
|
+
const FLIP_GRACE = 300;
|
|
259
|
+
const TIMING_FUNCTIONS = /[a-z-]+\([^)]*\)|[a-z-]+/gi;
|
|
260
|
+
const RECT_EPSILON = 0.5;
|
|
261
|
+
function sameRect(a, b) {
|
|
262
|
+
return Math.abs(a.left - b.left) < RECT_EPSILON && Math.abs(a.top - b.top) < RECT_EPSILON && Math.abs(a.width - b.width) < RECT_EPSILON && Math.abs(a.height - b.height) < RECT_EPSILON;
|
|
263
|
+
}
|
|
264
|
+
function getThumbPaint(thumb, style) {
|
|
265
|
+
if (thumb instanceof HTMLImageElement) {
|
|
266
|
+
return {
|
|
267
|
+
thumbSize: thumb.naturalWidth > 0 ? {
|
|
268
|
+
width: thumb.naturalWidth,
|
|
269
|
+
height: thumb.naturalHeight
|
|
270
|
+
} : void 0,
|
|
271
|
+
fit: parseObjectFit(style.getPropertyValue("object-fit")),
|
|
272
|
+
position: parseCssPosition(
|
|
273
|
+
style.getPropertyValue("object-position")
|
|
274
|
+
)
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
fit: parseBackgroundFit(style.getPropertyValue("background-size")) || "fill",
|
|
279
|
+
position: parseCssPosition(
|
|
280
|
+
style.getPropertyValue("background-position")
|
|
281
|
+
)
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function getTransformTransition(el, fallbackDuration) {
|
|
285
|
+
const style = window.getComputedStyle(el);
|
|
286
|
+
const properties = style.getPropertyValue("transition-property").split(",").map((property) => property.trim());
|
|
287
|
+
const durations = style.getPropertyValue("transition-duration").split(",").map((duration) => duration.trim());
|
|
288
|
+
const easings = style.getPropertyValue("transition-timing-function").match(TIMING_FUNCTIONS) || [];
|
|
289
|
+
let index = properties.indexOf("transform");
|
|
290
|
+
if (index < 0) {
|
|
291
|
+
index = Math.max(0, properties.indexOf("all"));
|
|
292
|
+
}
|
|
293
|
+
return {
|
|
294
|
+
duration: durations[index % durations.length] || fallbackDuration,
|
|
295
|
+
easing: easings.length ? easings[index % easings.length] : "ease"
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function createStageBox() {
|
|
299
|
+
const box = document.createElement("div");
|
|
300
|
+
box.className = "lg-origin-crop";
|
|
301
|
+
box.style.position = "absolute";
|
|
302
|
+
box.style.top = "0";
|
|
303
|
+
box.style.right = "0";
|
|
304
|
+
box.style.bottom = "0";
|
|
305
|
+
box.style.left = "0";
|
|
306
|
+
return box;
|
|
307
|
+
}
|
|
308
|
+
class OriginCrop {
|
|
309
|
+
constructor(instance) {
|
|
310
|
+
this.closing = false;
|
|
311
|
+
this.stageMoved = false;
|
|
312
|
+
this.core = instance;
|
|
313
|
+
this.settings = __spreadValues(__spreadValues({}, originCropSettings), this.core.settings);
|
|
314
|
+
return this;
|
|
315
|
+
}
|
|
316
|
+
init() {
|
|
317
|
+
if (!this.settings.originCrop) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
this.wrapStage();
|
|
321
|
+
this.patchCore();
|
|
322
|
+
this.core.LGel.on(
|
|
323
|
+
`${lGEvents.beforeOpen}.originCrop`,
|
|
324
|
+
() => this.onBeforeOpen()
|
|
325
|
+
);
|
|
326
|
+
this.core.LGel.on(
|
|
327
|
+
`${lGEvents.beforeClose}.originCrop`,
|
|
328
|
+
() => this.onBeforeClose()
|
|
329
|
+
);
|
|
330
|
+
this.core.LGel.on(
|
|
331
|
+
`${lGEvents.afterClose}.originCrop`,
|
|
332
|
+
() => this.onAfterClose()
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
destroy() {
|
|
336
|
+
this.stopFollowing();
|
|
337
|
+
this.core.LGel.off(".originCrop");
|
|
338
|
+
this.resetStage();
|
|
339
|
+
this.unwrapStage();
|
|
340
|
+
if (this.restoreCore) {
|
|
341
|
+
this.restoreCore();
|
|
342
|
+
this.restoreCore = void 0;
|
|
343
|
+
}
|
|
344
|
+
this.flight = void 0;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Takes over the core's flight hooks: the flight's transform, and the
|
|
348
|
+
* dummy that flies in place of the loading image.
|
|
349
|
+
*/
|
|
350
|
+
patchCore() {
|
|
351
|
+
const core = this.core;
|
|
352
|
+
const getCoreTransform = core.getOriginTransform;
|
|
353
|
+
const getCoreDummyStyles = core.getDummyImgStyles;
|
|
354
|
+
const getCoreDummy = core.getDummyImageContent;
|
|
355
|
+
core.getOriginTransform = (element, imageSize) => {
|
|
356
|
+
const flight = this.getFlight(element, imageSize);
|
|
357
|
+
this.flight = flight;
|
|
358
|
+
if (this.closing) {
|
|
359
|
+
this.followClose();
|
|
360
|
+
}
|
|
361
|
+
return flight ? flight.transform : getCoreTransform.call(core, element, imageSize);
|
|
362
|
+
};
|
|
363
|
+
core.getDummyImgStyles = (imageSize) => {
|
|
364
|
+
const region = this.flight && this.flight.region;
|
|
365
|
+
if (!imageSize || !region || isWholeImage(region)) {
|
|
366
|
+
return getCoreDummyStyles.call(core, imageSize);
|
|
367
|
+
}
|
|
368
|
+
return `width:${imageSize.width * region.width}px;
|
|
369
|
+
margin-left: ${imageSize.width * (region.x - 0.5)}px;
|
|
370
|
+
margin-top: ${imageSize.height * (region.y - 0.5)}px;
|
|
371
|
+
height:${imageSize.height * region.height}px`;
|
|
372
|
+
};
|
|
373
|
+
core.getDummyImageContent = ($currentSlide, index, alt) => {
|
|
374
|
+
const content = getCoreDummy.call(core, $currentSlide, index, alt);
|
|
375
|
+
const flight = this.flight;
|
|
376
|
+
if (content || !flight || !flight.dummySrc || core.items[index] !== flight.element) {
|
|
377
|
+
return content;
|
|
378
|
+
}
|
|
379
|
+
const dummy = document.createElement("img");
|
|
380
|
+
dummy.alt = alt || "";
|
|
381
|
+
dummy.src = flight.dummySrc;
|
|
382
|
+
dummy.className = "lg-dummy-img";
|
|
383
|
+
dummy.style.cssText = core.getDummyImgStyles(core.currentImageSize);
|
|
384
|
+
$currentSlide.addClass("lg-first-slide");
|
|
385
|
+
core.outer.addClass("lg-first-slide-loading");
|
|
386
|
+
return dummy;
|
|
387
|
+
};
|
|
388
|
+
this.restoreCore = () => {
|
|
389
|
+
core.getOriginTransform = getCoreTransform;
|
|
390
|
+
core.getDummyImgStyles = getCoreDummyStyles;
|
|
391
|
+
core.getDummyImageContent = getCoreDummy;
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* The flight from (or back to) a trigger, when the built-in flight
|
|
396
|
+
* cannot land it exactly: a cropped thumbnail, one letterboxed in its
|
|
397
|
+
* box, or a background thumbnail. Undefined otherwise, and the core
|
|
398
|
+
* flies as it always does.
|
|
399
|
+
*/
|
|
400
|
+
getFlight(element, imageSize) {
|
|
401
|
+
if (!imageSize || !(imageSize.width > 0) || !(imageSize.height > 0)) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
const img = element.querySelector("img");
|
|
405
|
+
const thumb = img || element;
|
|
406
|
+
const bounds = thumb.getBoundingClientRect();
|
|
407
|
+
const box = {
|
|
408
|
+
left: bounds.left,
|
|
409
|
+
top: bounds.top,
|
|
410
|
+
width: bounds.width,
|
|
411
|
+
height: bounds.height
|
|
412
|
+
};
|
|
413
|
+
if (!isUsableOriginRect(box)) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
const style = window.getComputedStyle(thumb);
|
|
417
|
+
const dummySrc = img ? void 0 : parseCssUrl(style.getPropertyValue("background-image"));
|
|
418
|
+
if (!img && !dummySrc) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
const origin = getOriginWindow(__spreadValues({
|
|
422
|
+
box,
|
|
423
|
+
imageSize
|
|
424
|
+
}, getThumbPaint(thumb, style)));
|
|
425
|
+
const cropped = !isWholeImage(origin.window);
|
|
426
|
+
if (img && !cropped && sameRect(origin.rect, box)) {
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
const outerRect = this.core.outer.get().getBoundingClientRect();
|
|
430
|
+
const containerRect = {
|
|
431
|
+
left: outerRect.left,
|
|
432
|
+
top: outerRect.top,
|
|
433
|
+
width: outerRect.width,
|
|
434
|
+
// Element height, as the core measures it.
|
|
435
|
+
height: this.core.outer.height()
|
|
436
|
+
};
|
|
437
|
+
const { top, bottom } = this.core.mediaContainerPosition;
|
|
438
|
+
const flight = { element, region: origin.region, dummySrc };
|
|
439
|
+
if (!cropped) {
|
|
440
|
+
return __spreadProps(__spreadValues({}, flight), {
|
|
441
|
+
transform: getOriginTransform({
|
|
442
|
+
triggerRect: origin.rect,
|
|
443
|
+
containerRect,
|
|
444
|
+
top,
|
|
445
|
+
bottom,
|
|
446
|
+
imageSize
|
|
447
|
+
})
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
const crop = getOriginCropFlight({
|
|
451
|
+
triggerRect: origin.rect,
|
|
452
|
+
containerRect,
|
|
453
|
+
top,
|
|
454
|
+
bottom,
|
|
455
|
+
imageSize,
|
|
456
|
+
window: origin.window
|
|
457
|
+
});
|
|
458
|
+
return __spreadProps(__spreadValues({}, flight), {
|
|
459
|
+
transform: crop.transform,
|
|
460
|
+
stage: { outer: crop.outer, inner: crop.inner }
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* The opening flight, whose transform the core has just asked for. For
|
|
465
|
+
* a cropped thumbnail the stage crops to the thumbnail before anything
|
|
466
|
+
* shows (the gallery is still transparent), then follows the slide.
|
|
467
|
+
*/
|
|
468
|
+
onBeforeOpen() {
|
|
469
|
+
const stage = this.flight && this.flight.stage;
|
|
470
|
+
if (!stage || !this.outerBox) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
this.setStage(stage.outer, stage.inner);
|
|
474
|
+
this.outerBox.getBoundingClientRect();
|
|
475
|
+
this.followOpen(this.core.getSlideItem(this.core.index).get());
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Follows the opening slide with the stage. Mutation records are
|
|
479
|
+
* delivered at the end of the task that made them, before the browser
|
|
480
|
+
* renders, so the stage moves in the same frame as each of the core's
|
|
481
|
+
* steps: when the core flips the slide to rest, the stage opens with it
|
|
482
|
+
* on the slide's duration and easing; when the core settles the flight,
|
|
483
|
+
* the stage lets go.
|
|
484
|
+
*/
|
|
485
|
+
followOpen(slide) {
|
|
486
|
+
this.stopFollowing();
|
|
487
|
+
let flipped = false;
|
|
488
|
+
this.observer = new MutationObserver(() => {
|
|
489
|
+
const flying = slide.classList.contains("lg-start-end-progress");
|
|
490
|
+
if (!flipped && flying && SLIDE_REST.test(slide.style.transform.trim())) {
|
|
491
|
+
flipped = true;
|
|
492
|
+
clearTimeout(this.flipGrace);
|
|
493
|
+
this.setStage(
|
|
494
|
+
STAGE_REST,
|
|
495
|
+
STAGE_REST,
|
|
496
|
+
this.getSlideTransition(slide)
|
|
497
|
+
);
|
|
498
|
+
} else if (flipped && !flying) {
|
|
499
|
+
this.stopFollowing();
|
|
500
|
+
this.resetStage();
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
this.observer.observe(slide, {
|
|
504
|
+
attributes: true,
|
|
505
|
+
attributeFilter: ["class", "style"]
|
|
506
|
+
});
|
|
507
|
+
this.flipGrace = setTimeout(() => {
|
|
508
|
+
if (!flipped) {
|
|
509
|
+
this.stopFollowing();
|
|
510
|
+
this.resetStage();
|
|
511
|
+
}
|
|
512
|
+
}, this.core.settings.startAnimationDuration + FLIP_GRACE);
|
|
513
|
+
}
|
|
514
|
+
onBeforeClose() {
|
|
515
|
+
this.stopFollowing();
|
|
516
|
+
this.closing = true;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* The closing flight, whose transform the core has just asked for. The
|
|
520
|
+
* core puts the slide on it right after, in the same task; once it has,
|
|
521
|
+
* the stage follows on the slide's duration and easing: onto the
|
|
522
|
+
* thumbnail's box for a cropped thumbnail, else back to rest if an
|
|
523
|
+
* opening flight left it cropped.
|
|
524
|
+
*/
|
|
525
|
+
followClose() {
|
|
526
|
+
const stage = this.flight && this.flight.stage;
|
|
527
|
+
if (!stage && !this.stageMoved) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
void Promise.resolve().then(() => {
|
|
531
|
+
const slide = this.core.getSlideItem(this.core.index).get();
|
|
532
|
+
if (!this.closing || !slide) {
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
this.setStage(
|
|
536
|
+
stage ? stage.outer : STAGE_REST,
|
|
537
|
+
stage ? stage.inner : STAGE_REST,
|
|
538
|
+
this.getSlideTransition(slide)
|
|
539
|
+
);
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
onAfterClose() {
|
|
543
|
+
this.resetStage();
|
|
544
|
+
this.closing = false;
|
|
545
|
+
this.flight = void 0;
|
|
546
|
+
}
|
|
547
|
+
getSlideTransition(slide) {
|
|
548
|
+
return getTransformTransition(
|
|
549
|
+
slide,
|
|
550
|
+
this.core.settings.startAnimationDuration + "ms"
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Crops the stage: both boxes hide their overflow and take their
|
|
555
|
+
* transforms, instantly or on a transition.
|
|
556
|
+
*/
|
|
557
|
+
setStage(outer, inner, transition) {
|
|
558
|
+
const boxes = [
|
|
559
|
+
[this.outerBox, outer],
|
|
560
|
+
[this.innerBox, inner]
|
|
561
|
+
];
|
|
562
|
+
boxes.forEach(([box, transform]) => {
|
|
563
|
+
if (!box) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
box.style.overflow = "hidden";
|
|
567
|
+
box.style.transitionProperty = transition ? "transform" : "none";
|
|
568
|
+
box.style.transitionDuration = transition ? transition.duration : "";
|
|
569
|
+
box.style.transitionTimingFunction = transition ? transition.easing : "";
|
|
570
|
+
box.style.transform = transform;
|
|
571
|
+
});
|
|
572
|
+
this.stageMoved = true;
|
|
573
|
+
}
|
|
574
|
+
/** Lets go of the crop: the boxes are inert again. */
|
|
575
|
+
resetStage() {
|
|
576
|
+
[this.outerBox, this.innerBox].forEach((box) => {
|
|
577
|
+
if (!box) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
box.style.overflow = "";
|
|
581
|
+
box.style.transitionProperty = "";
|
|
582
|
+
box.style.transitionDuration = "";
|
|
583
|
+
box.style.transitionTimingFunction = "";
|
|
584
|
+
box.style.transform = "";
|
|
585
|
+
});
|
|
586
|
+
this.stageMoved = false;
|
|
587
|
+
}
|
|
588
|
+
stopFollowing() {
|
|
589
|
+
if (this.observer) {
|
|
590
|
+
this.observer.disconnect();
|
|
591
|
+
this.observer = void 0;
|
|
592
|
+
}
|
|
593
|
+
clearTimeout(this.flipGrace);
|
|
594
|
+
this.flipGrace = void 0;
|
|
595
|
+
}
|
|
596
|
+
wrapStage() {
|
|
597
|
+
const inner = this.core.$inner.get();
|
|
598
|
+
const parent = inner && inner.parentNode;
|
|
599
|
+
if (!parent) {
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
this.outerBox = createStageBox();
|
|
603
|
+
this.innerBox = createStageBox();
|
|
604
|
+
parent.insertBefore(this.outerBox, inner);
|
|
605
|
+
this.outerBox.appendChild(this.innerBox);
|
|
606
|
+
this.innerBox.appendChild(inner);
|
|
607
|
+
}
|
|
608
|
+
unwrapStage() {
|
|
609
|
+
const inner = this.core.$inner.get();
|
|
610
|
+
const outerBox = this.outerBox;
|
|
611
|
+
if (outerBox && inner && outerBox.parentNode) {
|
|
612
|
+
outerBox.parentNode.insertBefore(inner, outerBox);
|
|
613
|
+
outerBox.remove();
|
|
614
|
+
}
|
|
615
|
+
this.outerBox = void 0;
|
|
616
|
+
this.innerBox = void 0;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
export {
|
|
620
|
+
OriginCrop as default
|
|
621
|
+
};
|
|
622
|
+
//# sourceMappingURL=lg-origin-crop.es5.js.map
|