richlagetest
Advanced tools
Comparing version 0.0.0-38a5badf733cc46d87023565f85a37eca72b3bca to 0.0.0-3d4b022e55cbb930ef39c94d77fa68b87120a3dc
@@ -1,3 +0,3 @@ | ||
"use strict";var _extends=require("@babel/runtime/helpers/extends"),classNames=require("classnames"),lodash=require("lodash"),loadable=require("@loadable/component");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),classNames__default=_interopDefaultLegacy(classNames),loadable__default=_interopDefaultLegacy(loadable),IMAGE_TYPE="wix-draft-plugin-image",IMAGE_TYPE_LEGACY="IMAGE",shouldDisableStyles=function(componentData,isMobile){var _ref=componentData.config||{},size=_ref.size,width=_ref.width;return!("inline"===size&&lodash.isNumber(width)&&width<=150)&&isMobile},alignmentClassName=function(componentData,theme,styles,isMobile){var _ref2=componentData.config||{},alignment=_ref2.alignment,size=_ref2.size;if(!alignment||shouldDisableStyles(componentData,isMobile)&&"original"!==size)return"";var align=alignment;if("original"===size&&"center"!==alignment){var width=(componentData.src||{}).width;lodash.isNumber(width)&&width>350&&(align="center")}return classNames__default.default(styles["align"+lodash.upperFirst(align)],theme["align"+lodash.upperFirst(align)])},sizeClassName=function(componentData,theme,styles,isMobile){var size=(componentData.config||{}).size;return!size||isMobile&&"original"===size?"":shouldDisableStyles(componentData,isMobile)?classNames__default.default(styles.sizeFullWidth,theme.sizeFullWidth):classNames__default.default(styles["size"+lodash.upperFirst(lodash.camelCase(size))],theme["size"+lodash.upperFirst(lodash.camelCase(size))])},imageRenderDescriptor={component:loadable__default.default({resolved:{},chunkName:function(){return"image-viewer"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return Promise.resolve().then((function(){return require( | ||
/* webpackChunkName: "image-viewer" */ | ||
"./image-viewer.cjs.js")}))},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./image-viewer"):eval("require.resolve")("./image-viewer")}}),classNameStrategies:{size:sizeClassName,alignment:alignmentClassName}},typeMapper=function(){var _ref;return(_ref={})[IMAGE_TYPE_LEGACY]=imageRenderDescriptor,_ref[IMAGE_TYPE]=imageRenderDescriptor,_ref},DEFAULTS=Object.freeze({config:{alignment:"center",size:"content",showTitle:!0,showDescription:!0}}),SEO_IMAGE_WIDTH=1e3,pluginImage=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:IMAGE_TYPE,typeMapper:typeMapper}};exports.DEFAULTS=DEFAULTS,exports.IMAGE_TYPE=IMAGE_TYPE,exports.SEO_IMAGE_WIDTH=SEO_IMAGE_WIDTH,exports.pluginImage=pluginImage,exports.typeMapper=typeMapper; | ||
"use strict";var _extends=require("@babel/runtime/helpers/extends"),loadable=require("@loadable/component");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),loadable__default=_interopDefaultLegacy(loadable),GALLERY_TYPE="wix-draft-plugin-gallery",typeMapper=function typeMapper(){var _ref;return _ref={},_ref[GALLERY_TYPE]={component:loadable__default.default({resolved:{},chunkName:function(){return"gallery-viewer"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return Promise.resolve().then((function(){return require( | ||
/* webpackChunkName: "gallery-viewer" */ | ||
"./gallery-viewer.cjs.js")}))},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./gallery-viewer"):eval("require.resolve")("./gallery-viewer")}})},_ref},_layoutData,GALLERY_LAYOUTS;exports.GALLERY_LAYOUTS=void 0,GALLERY_LAYOUTS=exports.GALLERY_LAYOUTS||(exports.GALLERY_LAYOUTS={}),GALLERY_LAYOUTS[GALLERY_LAYOUTS.EMPTY=-1]="EMPTY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLLAGE=0]="COLLAGE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MASONRY=1]="MASONRY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.GRID=2]="GRID",GALLERY_LAYOUTS[GALLERY_LAYOUTS.THUMBNAIL=3]="THUMBNAIL",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDER=4]="SLIDER",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDESHOW=5]="SLIDESHOW",GALLERY_LAYOUTS[GALLERY_LAYOUTS.PANORAMA=6]="PANORAMA",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLUMN=7]="COLUMN",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MAGIC=8]="MAGIC",GALLERY_LAYOUTS[GALLERY_LAYOUTS.FULLSIZE=9]="FULLSIZE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.BRICKS=10]="BRICKS",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MIX=11]="MIX",GALLERY_LAYOUTS[GALLERY_LAYOUTS.ALTERNATE=12]="ALTERNATE";var layoutData=(_layoutData={},_layoutData[exports.GALLERY_LAYOUTS.COLLAGE]={isVertical:!0,oneRow:!1,galleryType:"Columns",gallerySizePx:"300"},_layoutData[exports.GALLERY_LAYOUTS.MASONRY]={numberOfImagesPerRow:0,isVertical:!1,gallerySizePx:"300"},_layoutData[exports.GALLERY_LAYOUTS.GRID]={numberOfImagesPerRow:3,cubeType:"fill",cubeRatio:1,isVertical:!0,oneRow:!1},_layoutData[exports.GALLERY_LAYOUTS.THUMBNAIL]={galleryThumbnailsAlignment:"bottom",thumbnailSpacings:5},_layoutData[exports.GALLERY_LAYOUTS.SLIDER]={cubeType:"fit",cubeRatio:"16/9"},_layoutData[exports.GALLERY_LAYOUTS.SLIDESHOW]={cubeType:"fit"},_layoutData[exports.GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[exports.GALLERY_LAYOUTS.COLUMN]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[exports.GALLERY_LAYOUTS.FULLSIZE]={cubeType:"fill"},_layoutData),_LAYOUT_FIXED_STYLES,GALLERY_ITEMS_TYPES=Object.freeze({IMAGE:"image",VIDEO:"video"}),HORIZONTAL_LAYOUTS=Object.freeze([exports.GALLERY_LAYOUTS.THUMBNAIL,exports.GALLERY_LAYOUTS.SLIDER,exports.GALLERY_LAYOUTS.SLIDESHOW,exports.GALLERY_LAYOUTS.COLUMN,exports.GALLERY_LAYOUTS.FULLSIZE]),sampleItems=[1,2,3].map((function(i){return{metadata:{height:10,width:10},orderIndex:i,itemId:"sampleItem-"+i,url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAA1JREFUCB1jePv27X8ACVkDxyMHIvwAAAAASUVORK5CYII="}})),DEFAULTS=Object.freeze({items:[],styles:_extends__default.default({galleryLayout:exports.GALLERY_LAYOUTS.GRID},layoutData[exports.GALLERY_LAYOUTS.GRID]),config:{alignment:"center",size:"content"}}),LAYOUT_FIXED_STYLES=(_LAYOUT_FIXED_STYLES={},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.COLLAGE]={galleryType:"Columns",imageMargin:5},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.MASONRY]={imageMargin:5,isVertical:!1,gridStyle:0},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.GRID]={imageResize:!1,gridStyle:1,galleryImageRatio:2,imageMargin:5},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.THUMBNAIL]={arrowsSize:23,thumbnailSize:120,floatingImages:0},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.SLIDER]={arrowsSize:23,imageMargin:5},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.SLIDESHOW]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.COLUMN]={arrowsSize:23,hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[exports.GALLERY_LAYOUTS.FULLSIZE]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES),FIXED_STYLES={gallerySizeType:"px",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",hoveringBehaviour:"NO_CHANGE",alwaysShowHover:!0,allowHover:!0,itemClick:"link",fullscreen:!1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",gotStyleParams:!0,videoPlay:"onClick",videoLoop:!1,videoSound:!0,hidePlay:!1,showVideoControls:!0},getFixedStyles=function(layout){return _extends__default.default({},FIXED_STYLES,LAYOUT_FIXED_STYLES[layout])},isHorizontalLayout=function(_ref){var galleryLayout=_ref.galleryLayout,oneRow=_ref.oneRow;return HORIZONTAL_LAYOUTS.indexOf(galleryLayout)>-1||oneRow},pluginGallery=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:GALLERY_TYPE,typeMapper:typeMapper}};exports.GALLERY_ITEMS_TYPES=GALLERY_ITEMS_TYPES,exports.GALLERY_TYPE=GALLERY_TYPE,exports.getFixedStyles=getFixedStyles,exports.isHorizontalLayout=isHorizontalLayout,exports.pluginGallery=pluginGallery,exports.sampleItems=sampleItems,exports.typeMapper=typeMapper; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@babel/runtime/helpers/extends");var viewerLoadable=require("./viewer-loadable.cjs.js");require("classnames"),require("lodash"),require("@loadable/component"),exports.IMAGE_TYPE=viewerLoadable.IMAGE_TYPE,exports.imageTypeMapper=viewerLoadable.typeMapper,exports.pluginImage=viewerLoadable.pluginImage; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@babel/runtime/helpers/extends");var viewerLoadable=require("./viewer-loadable.cjs.js");require("@loadable/component"),exports.GALLERY_TYPE=viewerLoadable.GALLERY_TYPE,exports.galleryTypeMapper=viewerLoadable.typeMapper,exports.pluginGallery=viewerLoadable.pluginGallery; |
@@ -1,1 +0,1 @@ | ||
import"@babel/runtime/helpers/extends";export{I as IMAGE_TYPE,t as imageTypeMapper,p as pluginImage}from"./viewer-loadable2.js";import"classnames";import"lodash";import"@loadable/component"; | ||
import"@babel/runtime/helpers/extends";export{b as GALLERY_TYPE,t as galleryTypeMapper,p as pluginGallery}from"./viewer-loadable2.js";import"@loadable/component"; |
@@ -1,3 +0,3 @@ | ||
import _extends from"@babel/runtime/helpers/extends";import classNames from"classnames";import{isNumber,upperFirst,camelCase}from"lodash";import loadable from"@loadable/component";var IMAGE_TYPE="wix-draft-plugin-image",IMAGE_TYPE_LEGACY="IMAGE",shouldDisableStyles=function(componentData,isMobile){var _ref=componentData.config||{},size=_ref.size,width=_ref.width;return!("inline"===size&&isNumber(width)&&width<=150)&&isMobile},alignmentClassName=function(componentData,theme,styles,isMobile){var _ref2=componentData.config||{},alignment=_ref2.alignment,size=_ref2.size;if(!alignment||shouldDisableStyles(componentData,isMobile)&&"original"!==size)return"";var align=alignment;if("original"===size&&"center"!==alignment){var width=(componentData.src||{}).width;isNumber(width)&&width>350&&(align="center")}return classNames(styles["align"+upperFirst(align)],theme["align"+upperFirst(align)])},sizeClassName=function(componentData,theme,styles,isMobile){var size=(componentData.config||{}).size;return!size||isMobile&&"original"===size?"":shouldDisableStyles(componentData,isMobile)?classNames(styles.sizeFullWidth,theme.sizeFullWidth):classNames(styles["size"+upperFirst(camelCase(size))],theme["size"+upperFirst(camelCase(size))])},imageRenderDescriptor={component:loadable({resolved:{},chunkName:function(){return"image-viewer"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return import( | ||
/* webpackChunkName: "image-viewer" */ | ||
"./image-viewer.js")},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./image-viewer"):eval("require.resolve")("./image-viewer")}}),classNameStrategies:{size:sizeClassName,alignment:alignmentClassName}},typeMapper=function(){var _ref;return(_ref={})[IMAGE_TYPE_LEGACY]=imageRenderDescriptor,_ref[IMAGE_TYPE]=imageRenderDescriptor,_ref},DEFAULTS=Object.freeze({config:{alignment:"center",size:"content",showTitle:!0,showDescription:!0}}),SEO_IMAGE_WIDTH=1e3,pluginImage=function(config){return{config:_extends({},DEFAULTS.config,config),type:IMAGE_TYPE,typeMapper:typeMapper}};export{DEFAULTS as D,IMAGE_TYPE as I,SEO_IMAGE_WIDTH as S,pluginImage as p,typeMapper as t}; | ||
import _extends from"@babel/runtime/helpers/extends";import loadable from"@loadable/component";var GALLERY_TYPE="wix-draft-plugin-gallery",typeMapper=function typeMapper(){var _ref;return _ref={},_ref[GALLERY_TYPE]={component:loadable({resolved:{},chunkName:function(){return"gallery-viewer"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return import( | ||
/* webpackChunkName: "gallery-viewer" */ | ||
"./gallery-viewer.js")},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./gallery-viewer"):eval("require.resolve")("./gallery-viewer")}})},_ref},_layoutData,GALLERY_LAYOUTS;!function(GALLERY_LAYOUTS){GALLERY_LAYOUTS[GALLERY_LAYOUTS.EMPTY=-1]="EMPTY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLLAGE=0]="COLLAGE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MASONRY=1]="MASONRY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.GRID=2]="GRID",GALLERY_LAYOUTS[GALLERY_LAYOUTS.THUMBNAIL=3]="THUMBNAIL",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDER=4]="SLIDER",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDESHOW=5]="SLIDESHOW",GALLERY_LAYOUTS[GALLERY_LAYOUTS.PANORAMA=6]="PANORAMA",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLUMN=7]="COLUMN",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MAGIC=8]="MAGIC",GALLERY_LAYOUTS[GALLERY_LAYOUTS.FULLSIZE=9]="FULLSIZE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.BRICKS=10]="BRICKS",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MIX=11]="MIX",GALLERY_LAYOUTS[GALLERY_LAYOUTS.ALTERNATE=12]="ALTERNATE"}(GALLERY_LAYOUTS||(GALLERY_LAYOUTS={}));var layoutData=(_layoutData={},_layoutData[GALLERY_LAYOUTS.COLLAGE]={isVertical:!0,oneRow:!1,galleryType:"Columns",gallerySizePx:"300"},_layoutData[GALLERY_LAYOUTS.MASONRY]={numberOfImagesPerRow:0,isVertical:!1,gallerySizePx:"300"},_layoutData[GALLERY_LAYOUTS.GRID]={numberOfImagesPerRow:3,cubeType:"fill",cubeRatio:1,isVertical:!0,oneRow:!1},_layoutData[GALLERY_LAYOUTS.THUMBNAIL]={galleryThumbnailsAlignment:"bottom",thumbnailSpacings:5},_layoutData[GALLERY_LAYOUTS.SLIDER]={cubeType:"fit",cubeRatio:"16/9"},_layoutData[GALLERY_LAYOUTS.SLIDESHOW]={cubeType:"fit"},_layoutData[GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[GALLERY_LAYOUTS.COLUMN]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[GALLERY_LAYOUTS.FULLSIZE]={cubeType:"fill"},_layoutData),_LAYOUT_FIXED_STYLES,GALLERY_ITEMS_TYPES=Object.freeze({IMAGE:"image",VIDEO:"video"}),HORIZONTAL_LAYOUTS=Object.freeze([GALLERY_LAYOUTS.THUMBNAIL,GALLERY_LAYOUTS.SLIDER,GALLERY_LAYOUTS.SLIDESHOW,GALLERY_LAYOUTS.COLUMN,GALLERY_LAYOUTS.FULLSIZE]),sampleItems=[1,2,3].map((function(i){return{metadata:{height:10,width:10},orderIndex:i,itemId:"sampleItem-"+i,url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAA1JREFUCB1jePv27X8ACVkDxyMHIvwAAAAASUVORK5CYII="}})),DEFAULTS=Object.freeze({items:[],styles:_extends({galleryLayout:GALLERY_LAYOUTS.GRID},layoutData[GALLERY_LAYOUTS.GRID]),config:{alignment:"center",size:"content"}}),LAYOUT_FIXED_STYLES=(_LAYOUT_FIXED_STYLES={},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.COLLAGE]={galleryType:"Columns",imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.MASONRY]={imageMargin:5,isVertical:!1,gridStyle:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.GRID]={imageResize:!1,gridStyle:1,galleryImageRatio:2,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.THUMBNAIL]={arrowsSize:23,thumbnailSize:120,floatingImages:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.SLIDER]={arrowsSize:23,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.SLIDESHOW]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.COLUMN]={arrowsSize:23,hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.FULLSIZE]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES),FIXED_STYLES={gallerySizeType:"px",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",hoveringBehaviour:"NO_CHANGE",alwaysShowHover:!0,allowHover:!0,itemClick:"link",fullscreen:!1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",gotStyleParams:!0,videoPlay:"onClick",videoLoop:!1,videoSound:!0,hidePlay:!1,showVideoControls:!0},getFixedStyles=function(layout){return _extends({},FIXED_STYLES,LAYOUT_FIXED_STYLES[layout])},isHorizontalLayout=function(_ref){var galleryLayout=_ref.galleryLayout,oneRow=_ref.oneRow;return HORIZONTAL_LAYOUTS.indexOf(galleryLayout)>-1||oneRow},pluginGallery=function(config){return{config:_extends({},DEFAULTS.config,config),type:GALLERY_TYPE,typeMapper:typeMapper}};export{GALLERY_ITEMS_TYPES as G,GALLERY_LAYOUTS as a,GALLERY_TYPE as b,getFixedStyles as g,isHorizontalLayout as i,pluginGallery as p,sampleItems as s,typeMapper as t}; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),classNames=require("classnames"),lodash=require("lodash"),wixRichContentCommon=require("wix-rich-content-common"),imageUtils=require("wix-rich-content-common/libs/imageUtils"),pluginImageSchema=require("wix-rich-content-common/dist/statics/schemas/plugin-image.schema.json");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),pluginImageSchema__default=_interopDefaultLegacy(pluginImageSchema),IMAGE_TYPE="wix-draft-plugin-image",DEFAULTS=Object.freeze({config:{alignment:"center",size:"content",showTitle:!0,showDescription:!0}}),styles$1={fontElementMap:"_1hNZF",imageContainer:"_2kEVY",expandContainer:"-D6i8",expandIcon:"_2Lky3",pointer:"_2Ybje",imageWrapper:"_3WJnn",image:"OzAYt",imageOverlay:"_1b5Ar",imageCaption:"EilAw",imagePreload:"_3ii3f",imageHighres:"_3xs9_",onlyHighRes:"_1I_dK",image_loading:"_3aC9X"},expand=function(props){return React__default.default.createElement("svg",Object.assign({viewBox:"0 0 19 19",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{d:"M15.071 8.371V4.585l-4.355 4.356a.2.2 0 0 1-.283 0l-.374-.374a.2.2 0 0 1 0-.283l4.356-4.355h-3.786a.2.2 0 0 1-.2-.2V3.2c0-.11.09-.2.2-.2H16v5.371a.2.2 0 0 1-.2.2h-.529a.2.2 0 0 1-.2-.2zm-6.5 6.9v.529a.2.2 0 0 1-.2.2H3v-5.371c0-.11.09-.2.2-.2h.529c.11 0 .2.09.2.2v3.786l4.355-4.356a.2.2 0 0 1 .283 0l.374.374a.2.2 0 0 1 0 .283L4.585 15.07h3.786c.11 0 .2.09.2.2z",fill:"#000",fillRule:"nonzero"}))},styles_inPluginInput="_1k3YS",InPluginInput=function(_Component){function InPluginInput(){var _this;return(_this=_Component.apply(this,arguments)||this).handleFocus=function(e){e.stopPropagation(),_this.props.setFocusToBlock(),_this.props.setInPluginEditingMode(!0)},_this.handleBlur=function(){return _this.props.setInPluginEditingMode(!1)},_this.handleKeyPress=function(e){var _this$props=_this.props,setFocusToBlock=_this$props.setFocusToBlock,value=_this$props.value;"Enter"===e.key&&setFocusToBlock&&""!==value&&(_this.handleBlur(),setFocusToBlock())},_this.onChange=function(e){var _this$props$onChange,_this$props2;return null===(_this$props$onChange=(_this$props2=_this.props).onChange)||void 0===_this$props$onChange?void 0:_this$props$onChange.call(_this$props2,e.target.value)},_this}return _inheritsLoose__default.default(InPluginInput,_Component),InPluginInput.prototype.render=function(){var className=classNames__default.default(styles_inPluginInput,this.props.className);return React__default.default.createElement("textarea",{className:className,value:this.props.value,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyPress:this.handleKeyPress,dir:"auto",rows:1})},InPluginInput}(React.Component);InPluginInput.defaultProps={setInPluginEditingMode:function(){return!1},setFocusToBlock:function(){return!1}};var ImageViewer=function(_React$Component){function ImageViewer(props){var _this;return(_this=_React$Component.call(this,props)||this).forceOnImageLoad=function(){var executionTimes=0,interval=setInterval((function(){var _this$imageRef,_this$imageRef$curren;null!==(_this$imageRef=_this.imageRef)&&void 0!==_this$imageRef&&null!==(_this$imageRef$curren=_this$imageRef.current)&&void 0!==_this$imageRef$curren&&_this$imageRef$curren.complete&&(_this.onImageLoad(_this.imageRef.current),clearInterval(interval)),10==++executionTimes&&clearInterval(interval)}),200)},_this.onImageLoadError=function(){var src=_this.props.componentData.src;src&&src.fallback&&_this.setState({fallbackImageSrc:{preload:src.fallback,highres:src.fallback}})},_this.renderImage=function(imageClassName,imageSrc,alt,props,isGif,onlyHighRes){var _classNames;return _this.getImage(classNames__default.default(imageClassName,_this.styles.imageHighres,((_classNames={})[_this.styles.onlyHighRes]=onlyHighRes,_classNames)),imageSrc.highres,alt,props,{fadeIn:!isGif,width:imageSrc.highresWidth,height:imageSrc.highresHeight})},_this.renderPreloadImage=function(imageClassName,imageSrc,alt,props){return _this.getImage(classNames__default.default(imageClassName,_this.styles.imagePreload),imageSrc.preload,alt,_extends__default.default({"aria-hidden":!0},props))},_this.onImageLoad=function(element){element.style.opacity=1,_this.preloadRef.current&&(_this.preloadRef.current.style.opacity="0")},_this.handleExpand=function(e){var _helpers$onViewerActi;e.preventDefault();var _this$props=_this.props,onExpand=_this$props.settings.onExpand,_this$props$helpers=_this$props.helpers,helpers=void 0===_this$props$helpers?{}:_this$props$helpers;null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,IMAGE_TYPE,"Click","expand_image"),_this.hasExpand()&&(null==onExpand||onExpand(_this.props.blockKey))},_this.scrollToAnchor=function(e){var _this$props2=_this.props,_this$props2$componen=_this$props2.componentData.config.link,anchor=(_this$props2$componen=void 0===_this$props2$componen?{}:_this$props2$componen).anchor,customAnchorScroll=_this$props2.customAnchorScroll;if(customAnchorScroll)customAnchorScroll(e,anchor);else{var anchorString="viewer-"+anchor,element=document.getElementById(anchorString);wixRichContentCommon.addAnchorTagToUrl(anchorString),wixRichContentCommon.anchorScroll(element,_this.context.experiments)}},_this.hasLink=function(){var _this$props$component,_this$props$component2,_this$props$component3;return null===(_this$props$component=_this.props.componentData)||void 0===_this$props$component||null===(_this$props$component2=_this$props$component.config)||void 0===_this$props$component2||null===(_this$props$component3=_this$props$component2.link)||void 0===_this$props$component3?void 0:_this$props$component3.url},_this.hasAnchor=function(){var _this$props$component4,_this$props$component5,_this$props$component6;return null===(_this$props$component4=_this.props.componentData)||void 0===_this$props$component4||null===(_this$props$component5=_this$props$component4.config)||void 0===_this$props$component5||null===(_this$props$component6=_this$props$component5.link)||void 0===_this$props$component6?void 0:_this$props$component6.anchor},_this.onKeyDown=function(e){"Enter"!==e.key&&" "!==e.key||_this.props.getInPluginEditingMode||_this.handleClick(e)},_this.handleClick=function(e){if(_this.hasLink())return null;_this.hasAnchor()?(e.preventDefault(),e.stopPropagation(),_this.scrollToAnchor(e)):_this.handleExpand(e)},_this.handleRef=function(e){_this.state.container||_this.setState({container:e})},_this.handleContextMenu=function(e){var _this$props$component7=_this.props.componentData.disableDownload;return void 0!==_this$props$component7&&_this$props$component7&&e.preventDefault()},_this.hasExpand=function(){var _this$props3=_this.props,componentData=_this$props3.componentData,settings=_this$props3.settings,disableExpand=!1;return void 0!==componentData.disableExpand?disableExpand=componentData.disableExpand:void 0!==settings.disableExpand&&(disableExpand=settings.disableExpand),!disableExpand&&settings.onExpand},_this.renderExpandIcon=function(){return React__default.default.createElement("div",{className:_this.styles.expandContainer},React__default.default.createElement(expand,{className:_this.styles.expandIcon,onClick:_this.handleExpand}))},wixRichContentCommon.validate(props.componentData,pluginImageSchema__default.default),_this.state={},_this.preloadRef=React__default.default.createRef(),_this.imageRef=React__default.default.createRef(),_this}_inheritsLoose__default.default(ImageViewer,_React$Component);var _proto=ImageViewer.prototype;return _proto.componentDidMount=function(){this.setState({ssrDone:!0}),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.forceOnImageLoad()},_proto.componentWillReceiveProps=function(nextProps){lodash.isEqual(nextProps.componentData,this.props.componentData)||wixRichContentCommon.validate(nextProps.componentData,pluginImageSchema__default.default)},_proto.calculateHeight=function(width,src){return void 0===width&&(width=1),src&&src.height&&src.width?Math.ceil(src.height/src.width*width):imageUtils.WIX_MEDIA_DEFAULT.SIZE},_proto.getImageDataUrl=function(){return this.props.dataUrl?{preload:this.props.dataUrl,highres:this.props.dataUrl}:null},_proto.getImageUrl=function(src){var _this$context$experim,_this$context$experim2,_this2=this,_ref=this.props||{},helpers=_ref.helpers,seoMode=_ref.seoMode;if(!src&&null!=helpers&&helpers.handleFileSelection)return null;var requiredWidth,requiredHeight,removeUsm=null===(_this$context$experim=this.context.experiments)||void 0===_this$context$experim||null===(_this$context$experim2=_this$context$experim.removeUsmFromImageUrls)||void 0===_this$context$experim2?void 0:_this$context$experim2.enabled,imageUrl={preload:"",highres:""},imageSrcOpts={};if(!this.props.isMobile&&!imageUtils.isPNG(src)){var _this$props$component8=this.props.componentData.config,alignment=(_this$props$component8=void 0===_this$props$component8?{}:_this$props$component8).alignment,width=_this$props$component8.width,usePredefinedWidth=("left"===alignment||"right"===alignment)&&!width;imageSrcOpts=_extends__default.default({removeUsm:removeUsm,imageType:"quailtyPreload"},usePredefinedWidth&&{requiredWidth:300})}if(imageUrl.preload=imageUtils.getImageSrc(src,null==helpers?void 0:helpers.getImageUrl,imageSrcOpts),seoMode)requiredWidth=(null==src?void 0:src.width)&&Math.min(src.width,1e3),requiredHeight=this.calculateHeight(1e3,src);else if(this.state.container){var _getImageDimensions=function(width,isMobile){var requiredHeight,requiredWidth=width||1;return isMobile&&!wixRichContentCommon.isSSR()&&(requiredWidth*=window.devicePixelRatio,requiredWidth*=window.screen.width/document.body.clientWidth),requiredHeight=_this2.calculateHeight(requiredWidth,src),[requiredWidth=Math.ceil(requiredWidth),requiredHeight=Math.ceil(requiredHeight)]}(this.state.container.getBoundingClientRect().width||(null==src?void 0:src.width),this.props.isMobile);requiredWidth=_getImageDimensions[0],requiredHeight=_getImageDimensions[1]}return imageUrl.highres=imageUtils.getImageSrc(src,null==helpers?void 0:helpers.getImageUrl,{removeUsm:removeUsm,requiredWidth:requiredWidth,requiredHeight:requiredHeight,requiredQuality:90,imageType:"highRes"}),!this.state.ssrDone||imageUrl.preload||this.props.isLoading||console.error("image plugin mounted with invalid image source!",src),imageUrl},_proto.getImage=function(imageClassNames,src,alt,props,opts){var _this$context$experim3,_this3=this;void 0===opts&&(opts={});var _opts=opts,_opts$fadeIn=_opts.fadeIn,fadeIn=void 0!==_opts$fadeIn&&_opts$fadeIn,width=_opts.width,height=_opts.height,loading=null!==(_this$context$experim3=this.context.experiments.lazyImagesAndIframes)&&void 0!==_this$context$experim3&&_this$context$experim3.enabled?"lazy":void 0;return React__default.default.createElement("img",Object.assign({},props,{className:imageClassNames,src:src,alt:alt,onError:this.onImageLoadError,onLoad:fadeIn?function(e){return _this3.onImageLoad(e.target)}:void 0,ref:fadeIn?this.imageRef:this.preloadRef,width:width,height:height,loading:loading}))},_proto.renderTitle=function(data,styles){return!!(data.config||{}).showTitle&&React__default.default.createElement("div",{className:classNames__default.default(styles.imageTitle)},data&&data.title||"")},_proto.renderDescription=function(data,styles){return!!(data.config||{}).showDescription&&React__default.default.createElement("div",{className:classNames__default.default(styles.imageDescription)},data&&data.description||"")},_proto.renderCaption=function(caption){var _this$props4=this.props,onCaptionChange=_this$props4.onCaptionChange,setFocusToBlock=_this$props4.setFocusToBlock,setInPluginEditingMode=_this$props4.setInPluginEditingMode,_this$styles=this.styles,imageCaption=_this$styles.imageCaption,link=_this$styles.link,classes=classNames__default.default(imageCaption,this.hasLink()&&link);return onCaptionChange?React__default.default.createElement(InPluginInput,{setInPluginEditingMode:setInPluginEditingMode,className:classes,value:caption,onChange:onCaptionChange,setFocusToBlock:setFocusToBlock}):React__default.default.createElement("span",{dir:"auto",className:classes},caption)},_proto.shouldRenderCaption=function(){var _componentData$metada,_this$props5=this.props,getInPluginEditingMode=_this$props5.getInPluginEditingMode,settings=_this$props5.settings,componentData=_this$props5.componentData,defaultCaption=_this$props5.defaultCaption,caption=null===(_componentData$metada=componentData.metadata)||void 0===_componentData$metada?void 0:_componentData$metada.caption;if(lodash.includes(lodash.get(settings,"toolbar.hidden"),"settings"))return!1;if(void 0===caption||""===caption&&(null==getInPluginEditingMode||!getInPluginEditingMode())||caption===defaultCaption)return!1;var data=componentData||DEFAULTS;return"original"!==data.config.size||!data.src||!data.src.width||data.src.width>=350},_proto.render=function(){var _classNames2,_imageSrc$highres,_imageSrc$highres$end;this.styles=this.styles||wixRichContentCommon.mergeStyles({styles:styles$1,theme:this.props.theme});var _this$props6=this.props,componentData=_this$props6.componentData,className=_this$props6.className,settings=_this$props6.settings,setComponentUrl=_this$props6.setComponentUrl,seoMode=_this$props6.seoMode,_this$state=this.state,fallbackImageSrc=_this$state.fallbackImageSrc,ssrDone=_this$state.ssrDone,data=componentData||DEFAULTS,metadata=componentData.metadata;metadata||(metadata={});var itemClassName=classNames__default.default(this.styles.imageWrapper,className,((_classNames2={})[this.styles.pointer]=this.hasExpand(),_classNames2)),imageClassName=this.styles.image,imageSrc=fallbackImageSrc||this.getImageDataUrl()||this.getImageUrl(data.src),imageProps={};data.src&&settings&&settings.imageProps&&(imageProps=lodash.isFunction(settings.imageProps)?settings.imageProps(data.src):settings.imageProps);var isGif=null==imageSrc||null===(_imageSrc$highres=imageSrc.highres)||void 0===_imageSrc$highres||null===(_imageSrc$highres$end=_imageSrc$highres.endsWith)||void 0===_imageSrc$highres$end?void 0:_imageSrc$highres$end.call(_imageSrc$highres,".gif");null==setComponentUrl||setComponentUrl(null==imageSrc?void 0:imageSrc.highres);var shouldRenderPreloadImage=!seoMode&&imageSrc&&!isGif,shouldRenderImage=imageSrc&&(seoMode||ssrDone)||isGif,accesibilityProps=!this.hasLink()&&{role:"button",tabIndex:0},onlyHiRes=seoMode||isGif;return React__default.default.createElement("div",Object.assign({"data-hook":"imageViewer",className:this.styles.imageContainer,ref:this.handleRef,onContextMenu:this.handleContextMenu,onKeyDown:this.onKeyDown},accesibilityProps),React__default.default.createElement("div",{className:itemClassName,"aria-label":metadata.alt,onClick:this.handleClick,onKeyDown:this.onKeyDown},shouldRenderPreloadImage&&this.renderPreloadImage(imageClassName,imageSrc,metadata.alt,imageProps),shouldRenderImage&&this.renderImage(imageClassName,imageSrc,metadata.alt,imageProps,isGif,onlyHiRes),this.hasExpand()&&this.renderExpandIcon()),this.renderTitle(data,this.styles),this.renderDescription(data,this.styles),this.shouldRenderCaption()&&this.renderCaption(metadata.caption))},ImageViewer}(React__default.default.Component);ImageViewer.contextType=wixRichContentCommon.GlobalContext;var shouldDisableStyles=function(componentData,isMobile){var _ref=componentData.config||{},size=_ref.size,width=_ref.width;return!("inline"===size&&lodash.isNumber(width)&&width<=150)&&isMobile},imageRenderDescriptor={component:ImageViewer,classNameStrategies:{size:function(componentData,theme,styles,isMobile){var size=(componentData.config||{}).size;return!size||isMobile&&"original"===size?"":shouldDisableStyles(componentData,isMobile)?classNames__default.default(styles.sizeFullWidth,theme.sizeFullWidth):classNames__default.default(styles["size"+lodash.upperFirst(lodash.camelCase(size))],theme["size"+lodash.upperFirst(lodash.camelCase(size))])},alignment:function(componentData,theme,styles,isMobile){var _ref2=componentData.config||{},alignment=_ref2.alignment,size=_ref2.size;if(!alignment||shouldDisableStyles(componentData,isMobile)&&"original"!==size)return"";var align=alignment;if("original"===size&&"center"!==alignment){var width=(componentData.src||{}).width;lodash.isNumber(width)&&width>350&&(align="center")}return classNames__default.default(styles["align"+lodash.upperFirst(align)],theme["align"+lodash.upperFirst(align)])}}},typeMapper=function(){var _ref;return(_ref={}).IMAGE=imageRenderDescriptor,_ref[IMAGE_TYPE]=imageRenderDescriptor,_ref};exports.IMAGE_TYPE=IMAGE_TYPE,exports.imageTypeMapper=typeMapper,exports.pluginImage=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:IMAGE_TYPE,typeMapper:typeMapper}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),wixRichContentCommon=require("wix-rich-content-common"),pluginGallerySchema=require("wix-rich-content-common/dist/statics/schemas/plugin-gallery.schema.json"),lodash=require("lodash"),imageClientAPI=require("image-client-api/dist/imageClientSDK"),classnames=require("classnames");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _layoutData,GALLERY_LAYOUTS,_extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),pluginGallerySchema__default=_interopDefaultLegacy(pluginGallerySchema),imageClientAPI__default=_interopDefaultLegacy(imageClientAPI),classnames__default=_interopDefaultLegacy(classnames),isAbsoluteUrl=function(url){return url.startsWith("http://")||url.startsWith("https://")},getAbsoluteUrl=function(url,type){return isAbsoluteUrl(url)?url:("image"===type?(baseUrl="https://static.wixstatic.com/",baseFolder="media/"):(baseUrl="https://video.wixstatic.com/",baseFolder="video/"),baseUrl+(url.startsWith(baseFolder)?url:baseFolder+url));var baseUrl,baseFolder};!function(GALLERY_LAYOUTS){GALLERY_LAYOUTS[GALLERY_LAYOUTS.EMPTY=-1]="EMPTY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLLAGE=0]="COLLAGE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MASONRY=1]="MASONRY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.GRID=2]="GRID",GALLERY_LAYOUTS[GALLERY_LAYOUTS.THUMBNAIL=3]="THUMBNAIL",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDER=4]="SLIDER",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDESHOW=5]="SLIDESHOW",GALLERY_LAYOUTS[GALLERY_LAYOUTS.PANORAMA=6]="PANORAMA",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLUMN=7]="COLUMN",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MAGIC=8]="MAGIC",GALLERY_LAYOUTS[GALLERY_LAYOUTS.FULLSIZE=9]="FULLSIZE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.BRICKS=10]="BRICKS",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MIX=11]="MIX",GALLERY_LAYOUTS[GALLERY_LAYOUTS.ALTERNATE=12]="ALTERNATE"}(GALLERY_LAYOUTS||(GALLERY_LAYOUTS={}));var _LAYOUT_FIXED_STYLES,layoutData=((_layoutData={})[GALLERY_LAYOUTS.COLLAGE]={isVertical:!0,oneRow:!1,galleryType:"Columns",gallerySizePx:"300"},_layoutData[GALLERY_LAYOUTS.MASONRY]={numberOfImagesPerRow:0,isVertical:!1,gallerySizePx:"300"},_layoutData[GALLERY_LAYOUTS.GRID]={numberOfImagesPerRow:3,cubeType:"fill",cubeRatio:1,isVertical:!0,oneRow:!1},_layoutData[GALLERY_LAYOUTS.THUMBNAIL]={galleryThumbnailsAlignment:"bottom",thumbnailSpacings:5},_layoutData[GALLERY_LAYOUTS.SLIDER]={cubeType:"fit",cubeRatio:"16/9"},_layoutData[GALLERY_LAYOUTS.SLIDESHOW]={cubeType:"fit"},_layoutData[GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[GALLERY_LAYOUTS.COLUMN]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[GALLERY_LAYOUTS.FULLSIZE]={cubeType:"fill"},_layoutData),GALLERY_ITEMS_TYPES=Object.freeze({IMAGE:"image",VIDEO:"video"}),HORIZONTAL_LAYOUTS=Object.freeze([GALLERY_LAYOUTS.THUMBNAIL,GALLERY_LAYOUTS.SLIDER,GALLERY_LAYOUTS.SLIDESHOW,GALLERY_LAYOUTS.COLUMN,GALLERY_LAYOUTS.FULLSIZE]),sampleItems=[1,2,3].map((function(i){return{metadata:{height:10,width:10},orderIndex:i,itemId:"sampleItem-"+i,url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAA1JREFUCB1jePv27X8ACVkDxyMHIvwAAAAASUVORK5CYII="}})),DEFAULTS=Object.freeze({items:[],styles:_extends__default.default({galleryLayout:GALLERY_LAYOUTS.GRID},layoutData[GALLERY_LAYOUTS.GRID]),config:{alignment:"center",size:"content"}}),LAYOUT_FIXED_STYLES=((_LAYOUT_FIXED_STYLES={})[GALLERY_LAYOUTS.COLLAGE]={galleryType:"Columns",imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.MASONRY]={imageMargin:5,isVertical:!1,gridStyle:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.GRID]={imageResize:!1,gridStyle:1,galleryImageRatio:2,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.THUMBNAIL]={arrowsSize:23,thumbnailSize:120,floatingImages:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.SLIDER]={arrowsSize:23,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.SLIDESHOW]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.COLUMN]={arrowsSize:23,hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.FULLSIZE]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES),FIXED_STYLES={gallerySizeType:"px",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",hoveringBehaviour:"NO_CHANGE",alwaysShowHover:!0,allowHover:!0,itemClick:"link",fullscreen:!1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",gotStyleParams:!0,videoPlay:"onClick",videoLoop:!1,videoSound:!0,hidePlay:!1,showVideoControls:!0},isHorizontalLayout=function(_ref){var galleryLayout=_ref.galleryLayout,oneRow=_ref.oneRow;return HORIZONTAL_LAYOUTS.indexOf(galleryLayout)>-1||oneRow},resizeMediaUrl=function(item,originalUrl,resizeMethod,requiredWidth,requiredHeight,sharpParams,faces,allowWatermark,focalPoint){if(void 0===faces&&(faces=!1),void 0===allowWatermark&&(allowWatermark=!1),sharpParams=sharpParams||{},-1!==(originalUrl=originalUrl||"").indexOf("base64"))return originalUrl;if(requiredWidth=Math.ceil(requiredWidth),requiredHeight=Math.ceil(requiredHeight),resizeMethod===GALLERY_ITEMS_TYPES.VIDEO)return getAbsoluteUrl(originalUrl,GALLERY_ITEMS_TYPES.VIDEO);if(requiredWidth>=item.maxWidth&&requiredHeight>=item.maxHeight){var url=item.dto.metaData.type===GALLERY_ITEMS_TYPES.VIDEO?originalUrl:item.url;return getAbsoluteUrl(url,GALLERY_ITEMS_TYPES.IMAGE)}return function(item,originalUrl,resizeMethod,requiredWidth,requiredHeight,sharpParams,faces,allowWatermark,focalPoint){originalUrl=originalUrl||"",(sharpParams=sharpParams||{}).quality>0&&(sharpParams.quality=Math.min(90,sharpParams.quality));var focalPointObj={x:50,y:50};focalPoint&&focalPoint[0]>=0&&focalPoint[1]>=0&&(focalPointObj.x=Math.round(100*focalPoint[0]),focalPointObj.y=Math.round(100*focalPoint[1])),!0===sharpParams.allowUsm&&sharpParams.usm?(sharpParams.usm.usm_a=Math.min(5,Math.max(0,sharpParams.usm.usm_a||0)),sharpParams.usm.usm_r=Math.min(128,Math.max(0,sharpParams.usm.usm_r||0)),sharpParams.usm.usm_t=Math.min(1,Math.max(0,sharpParams.usm.usm_t||0))):sharpParams.usm={usm_a:0,usm_r:0,usm_t:0};var resizer=function(){};resizer="fit"===resizeMethod?imageClientAPI__default.default.getScaleToFitImageURL:imageClientAPI__default.default.getScaleToFillImageURL;var options={};return sharpParams.quality>0&&(options.quality=sharpParams.quality),sharpParams.blur>0&&(options.filters={blur:sharpParams.blur}),focalPointObj&&(options.focalPoint=focalPointObj),sharpParams&&sharpParams.usm&&(options.unsharpMask={radius:parseFloat(sharpParams.usm.usm_r),amount:parseFloat(sharpParams.usm.usm_a),threshold:parseFloat(sharpParams.usm.usm_t)}),isAbsoluteUrl(originalUrl)?originalUrl:resizer(originalUrl.replace("https://static.wixstatic.com/",""),item.maxWidth,item.maxHeight,requiredWidth,requiredHeight,options)}(item,originalUrl,resizeMethod,requiredWidth,requiredHeight,sharpParams,0,0,focalPoint)},styles={gallery_container:"_1lf3C",expandContainer:"_2trtH",itemOverlay:"_2Vr_d",expandIcon:"_1nQrL",clickableItem:"_2QozM",imageTitle:"w8o3K",imageTitleContainer:"F9_4B",pointer:"_1pMUq"},expand=function(props){return React__default.default.createElement("svg",Object.assign({viewBox:"0 0 19 19",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{d:"M15.071 8.371V4.585l-4.355 4.356a.2.2 0 0 1-.283 0l-.374-.374a.2.2 0 0 1 0-.283l4.356-4.355h-3.786a.2.2 0 0 1-.2-.2V3.2c0-.11.09-.2.2-.2H16v5.371a.2.2 0 0 1-.2.2h-.529a.2.2 0 0 1-.2-.2zm-6.5 6.9v.529a.2.2 0 0 1-.2.2H3v-5.371c0-.11.09-.2.2-.2h.529c.11 0 .2.09.2.2v3.786l4.355-4.356a.2.2 0 0 1 .283 0l.374.374a.2.2 0 0 1 0 .283L4.585 15.07h3.786c.11 0 .2.09.2.2z",fill:"#000",fillRule:"nonzero"}))},GALLERY_TYPE="wix-draft-plugin-gallery",_excluded=["scrollingElement"],_require=require("pro-gallery"),ProGallery=_require.ProGallery,GALLERY_CONSTS=_require.GALLERY_CONSTS,GALLERY_EVENTS=GALLERY_CONSTS.events,GalleryViewer=function(_React$Component){function GalleryViewer(_props){var _this;return wixRichContentCommon.validate(_props.componentData,pluginGallerySchema__default.default),(_this=_React$Component.call(this,_props)||this).shouldUpdateDimensions=function(prevComponentData){var prevGalleryLayout=prevComponentData.styles.galleryLayout;return _this.props.componentData.styles.galleryLayout!==prevGalleryLayout||(!lodash.isEqual(prevComponentData.config,_this.props.componentData.config)||void 0)},_this.shouldConsiderThumbnailSize=function(){var _this$props$component=_this.props.componentData.styles,galleryLayout=_this$props$component.galleryLayout,galleryThumbnailsAlignment=_this$props$component.galleryThumbnailsAlignment;return _this.props.isMobile&&galleryLayout===GALLERY_LAYOUTS.THUMBNAIL&&["top","bottom"].includes(galleryThumbnailsAlignment)},_this.getGalleryHeight=function(width){var height=305;return width&&(height=_this.shouldConsiderThumbnailSize()?Math.floor(2*width/3)+95:Math.floor(3*width/4)),height},_this.getDimensions=function(){var width=Math.floor(_this.containerRef.current.getBoundingClientRect().width);return{width:width,height:_this.getGalleryHeight(width)}},_this.updateDimensions=lodash.debounce((function(){var _this$state$size,_this$state$size2,_this$getDimensions=_this.getDimensions(),width=_this$getDimensions.width,height=_this$getDimensions.height;width===(null===(_this$state$size=_this.state.size)||void 0===_this$state$size?void 0:_this$state$size.width)&&height===(null===(_this$state$size2=_this.state.size)||void 0===_this$state$size2?void 0:_this$state$size2.height)||_this.setState({size:{width:width,height:height}})}),100),_this.stateFromProps=function(props){var items=props.componentData.items||[];return{items:items=items.filter((function(item){return!item.error}))}},_this.handleGalleryEvents=function(name,data){var styleParams=_this.props.componentData.styles;switch(name){case GALLERY_EVENTS.GALLERY_CHANGE:_this.containerRef.current&&(isHorizontalLayout(styleParams)?_this.containerRef.current.style.height="auto":_this.containerRef.current.style.height=data.layoutHeight+"px");break;case GALLERY_EVENTS.ITEM_ACTION_TRIGGERED:"video"!==data.type&&!data.linkData.url&&_this.hasExpand()&&_this.handleExpand(data)}},_this.handleExpand=function(data){var _helpers$onViewerActi,_this$props=_this.props,onExpand=_this$props.settings.onExpand,_this$props$helpers=_this$props.helpers,helpers=void 0===_this$props$helpers?{}:_this$props$helpers;null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,GALLERY_TYPE,"Click","expand_gallery"),_this.hasExpand()&&onExpand(_this.props.blockKey,data.idx)},_this.renderExpandIcon=function(itemProps){return React__default.default.createElement("div",{className:_this.styles.expandContainer},React__default.default.createElement(expand,{className:_this.styles.expandIcon,onClick:function(e){e.preventDefault(),e.stopPropagation(),_this.handleExpand(itemProps)}}))},_this.hasExpand=function(){var _this$props2=_this.props,componentData=_this$props2.componentData,settings=_this$props2.settings,disableExpand=!1;return void 0!==componentData.disableExpand?disableExpand=componentData.disableExpand:void 0!==settings.disableExpand&&(disableExpand=settings.disableExpand),!disableExpand&&settings.onExpand},_this.renderTitle=function(title){return title?React__default.default.createElement("div",{className:styles.imageTitleContainer},React__default.default.createElement("div",{className:_this.styles.imageTitle},title)):null},_this.hoverElement=function(itemProps){var _this$props$itemOverl,_this$props3,isClickable=_this.hasExpand()||itemProps.link,itemOverlayStyles=classnames__default.default(_this.styles.itemOverlay,isClickable&&_this.styles.clickableItem);return React__default.default.createElement("div",{className:itemOverlayStyles},_this.hasExpand()&&_this.renderExpandIcon(itemProps),_this.renderTitle(itemProps.title,"HOVER"),null===(_this$props$itemOverl=(_this$props3=_this.props).itemOverlayElement)||void 0===_this$props$itemOverl?void 0:_this$props$itemOverl.call(_this$props3,itemProps))},_this.getStyleParams=function(){var layout,_this$props4=_this.props,_this$props4$componen=_this$props4.componentData,styleParams=_this$props4$componen.styles,disableDownload=_this$props4$componen.disableDownload,isMobile=_this$props4.isMobile,calculatedStyles=_extends__default.default({},(layout=styleParams.galleryLayout,_extends__default.default({},FIXED_STYLES,LAYOUT_FIXED_STYLES[layout])),{allowContextMenu:!disableDownload,showArrows:isHorizontalLayout(styleParams)},styleParams);return isMobile&&isHorizontalLayout(calculatedStyles)&&(calculatedStyles.arrowsSize=20,calculatedStyles.imageMargin=0,calculatedStyles.galleryLayout===GALLERY_LAYOUTS.THUMBNAIL&&(calculatedStyles.thumbnailSize=90)),calculatedStyles.thumbnailSpacings&&(calculatedStyles.thumbnailSpacings/=2),calculatedStyles},_this.handleContextMenu=function(e){var _this$props$component2=_this.props.componentData.disableDownload;return void 0!==_this$props$component2&&_this$props$component2&&e.preventDefault()},_this.domId=_this.props.blockKey||"v-"+_this.props.entityIndex,_this.containerRef=React__default.default.createRef(),_this.state=_extends__default.default({},_this.stateFromProps(_props)),_this}_inheritsLoose__default.default(GalleryViewer,_React$Component);var _proto=GalleryViewer.prototype;return _proto.componentDidMount=function(){window.addEventListener("resize",this.updateDimensions),this.setState({size:this.getDimensions()}),this.initUpdateDimensionsForDomChanges()},_proto.initUpdateDimensionsForDomChanges=function(){var _this$props5,_contentElement,_this2=this,scrollingElement=(null===(_this$props5=this.props)||void 0===_this$props5?void 0:_this$props5.settings).scrollingElement;scrollingElement||(console.error("Please fix the gallery config of Rich Content Editor.\n A scrollingElement needs to be provided. Without it the gallery will not work correctly"),scrollingElement=document.body);var contentElement="function"==typeof scrollingElement?scrollingElement():scrollingElement;1!==(null===(_contentElement=contentElement)||void 0===_contentElement?void 0:_contentElement.nodeType)&&(contentElement=document.body),contentElement?(this.observer=new MutationObserver((function(){contentElement.clientHeight!==_this2.oldContentElementHeight&&(_this2.oldContentElementHeight=contentElement.clientHeight,_this2.updateDimensions())})),this.observer.observe(contentElement,{attributes:!0,childList:!0,subtree:!0})):console.warn("can't find content container to listen for changes to update gallery")},_proto.componentWillReceiveProps=function(nextProps){this.setState(_extends__default.default({},this.stateFromProps(nextProps)))},_proto.componentDidUpdate=function(prevProps){this.shouldUpdateDimensions(prevProps.componentData)&&this.updateDimensions()},_proto.componentWillUnmount=function(){this.observer.disconnect(),window.removeEventListener("resize",this.updateDimensions),this.updateDimensions.cancel()},_proto.getItems=function(){var items=this.state.items,_this$props6=this.props,anchorTarget=_this$props6.anchorTarget,relValue=_this$props6.relValue;return items.length>0?function(_ref){var items=_ref.items,anchorTarget=_ref.anchorTarget,relValue=_ref.relValue;return items.map((function(item,index){var metadata=item.metadata;if(item.metaData)return item;var convertedData={metaData:{link:{type:"none",target:"_blank"}},directLink:{}};if(metadata){if(convertedData.metaData=_extends__default.default({},metadata,{link:{type:"none",target:"_blank"}}),"video"===item.metadata.type){convertedData.metaData.link={target:"_blank",rel:"noopener",url:wixRichContentCommon.normalizeUrl(item.url||"")};var _convertedData$metaDa=convertedData.metaData.poster,pathname=_convertedData$metaDa.pathname,_convertedData$metaDa2=_convertedData$metaDa.thumbnail,thumbPathname=(_convertedData$metaDa2=void 0===_convertedData$metaDa2?{}:_convertedData$metaDa2).pathname,width=_convertedData$metaDa2.width,height=_convertedData$metaDa2.height;pathname&&thumbPathname?convertedData.metaData.poster={url:getAbsoluteUrl(thumbPathname,"image"),width:width,height:height}:"string"==typeof convertedData.metaData.poster&&(convertedData.metaData.poster={url:convertedData.metaData.poster,width:convertedData.metaData.width,height:convertedData.metaData.height})}convertedData.metaData.alt=metadata.altText,item.metadata.link&&(convertedData.metaData.link={type:"wix",target:item.metadata.link.target||anchorTarget||"_self",data:{type:"ExternalLink",target:item.metadata.link.target||anchorTarget||"_self",rel:item.metadata.link.rel||relValue||"noopener",url:wixRichContentCommon.normalizeUrl(item.metadata.link.url||"")}},convertedData.directLink={url:wixRichContentCommon.normalizeUrl(item.metadata.link.url||""),target:item.metadata.link.target||anchorTarget||"_self",rel:item.metadata.link.rel||relValue||"noopener"})}return _extends__default.default({},item,{metadata:void 0},convertedData,{itemId:wixRichContentCommon.uuid()+"_"+index.toString()})}))}({items:items,anchorTarget:anchorTarget,relValue:relValue}):sampleItems},_proto.render=function(){var _this$props7=this.props,theme=_this$props7.theme,settings=_this$props7.settings,seoMode=_this$props7.seoMode;this.styles=this.styles||wixRichContentCommon.mergeStyles({styles:styles,theme:theme});var scrollingElement=settings.scrollingElement,gallerySettings=_objectWithoutPropertiesLoose__default.default(settings,_excluded),size=this.state.size,items=this.getItems(),styleParams=this.getStyleParams(),viewMode=seoMode?GALLERY_CONSTS.viewMode.SEO:void 0;return React__default.default.createElement("div",{ref:this.containerRef,className:this.styles.gallery_container,"data-hook":"galleryViewer",role:"none",onContextMenu:this.handleContextMenu},null!=size&&size.width?React__default.default.createElement(ProGallery,{domId:this.domId,allowSSR:!!seoMode,items:items,options:styleParams,container:size,settings:gallerySettings,scrollingElement:scrollingElement,eventsListener:this.handleGalleryEvents,resizeMediaUrl:resizeMediaUrl,viewMode:viewMode,customHoverRenderer:this.hoverElement}):null)},GalleryViewer}(React__default.default.Component),typeMapper=function(){var _ref;return(_ref={})[GALLERY_TYPE]={component:GalleryViewer},_ref};exports.GALLERY_TYPE=GALLERY_TYPE,exports.galleryTypeMapper=typeMapper,exports.pluginGallery=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:GALLERY_TYPE,typeMapper:typeMapper}}; | ||
//# sourceMappingURL=module.viewer.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import classNames from"classnames";import{isEqual,includes,get,isFunction,isNumber,upperFirst,camelCase}from"lodash";import{addAnchorTagToUrl,anchorScroll,validate,mergeStyles,GlobalContext,isSSR}from"wix-rich-content-common";import{WIX_MEDIA_DEFAULT,isPNG,getImageSrc}from"wix-rich-content-common/libs/imageUtils";import pluginImageSchema from"wix-rich-content-common/dist/statics/schemas/plugin-image.schema.json";var IMAGE_TYPE="wix-draft-plugin-image",DEFAULTS=Object.freeze({config:{alignment:"center",size:"content",showTitle:!0,showDescription:!0}}),styles$1={fontElementMap:"_1hNZF",imageContainer:"_2kEVY",expandContainer:"-D6i8",expandIcon:"_2Lky3",pointer:"_2Ybje",imageWrapper:"_3WJnn",image:"OzAYt",imageOverlay:"_1b5Ar",imageCaption:"EilAw",imagePreload:"_3ii3f",imageHighres:"_3xs9_",onlyHighRes:"_1I_dK",image_loading:"_3aC9X"},expand=function(props){return React.createElement("svg",Object.assign({viewBox:"0 0 19 19",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{d:"M15.071 8.371V4.585l-4.355 4.356a.2.2 0 0 1-.283 0l-.374-.374a.2.2 0 0 1 0-.283l4.356-4.355h-3.786a.2.2 0 0 1-.2-.2V3.2c0-.11.09-.2.2-.2H16v5.371a.2.2 0 0 1-.2.2h-.529a.2.2 0 0 1-.2-.2zm-6.5 6.9v.529a.2.2 0 0 1-.2.2H3v-5.371c0-.11.09-.2.2-.2h.529c.11 0 .2.09.2.2v3.786l4.355-4.356a.2.2 0 0 1 .283 0l.374.374a.2.2 0 0 1 0 .283L4.585 15.07h3.786c.11 0 .2.09.2.2z",fill:"#000",fillRule:"nonzero"}))},styles_inPluginInput="_1k3YS",InPluginInput=function(_Component){function InPluginInput(){var _this;return(_this=_Component.apply(this,arguments)||this).handleFocus=function(e){e.stopPropagation(),_this.props.setFocusToBlock(),_this.props.setInPluginEditingMode(!0)},_this.handleBlur=function(){return _this.props.setInPluginEditingMode(!1)},_this.handleKeyPress=function(e){var _this$props=_this.props,setFocusToBlock=_this$props.setFocusToBlock,value=_this$props.value;"Enter"===e.key&&setFocusToBlock&&""!==value&&(_this.handleBlur(),setFocusToBlock())},_this.onChange=function(e){var _this$props$onChange,_this$props2;return null===(_this$props$onChange=(_this$props2=_this.props).onChange)||void 0===_this$props$onChange?void 0:_this$props$onChange.call(_this$props2,e.target.value)},_this}return _inheritsLoose(InPluginInput,_Component),InPluginInput.prototype.render=function(){var className=classNames(styles_inPluginInput,this.props.className);return React.createElement("textarea",{className:className,value:this.props.value,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyPress:this.handleKeyPress,dir:"auto",rows:1})},InPluginInput}(Component);InPluginInput.defaultProps={setInPluginEditingMode:function(){return!1},setFocusToBlock:function(){return!1}};var ImageViewer=function(_React$Component){function ImageViewer(props){var _this;return(_this=_React$Component.call(this,props)||this).forceOnImageLoad=function(){var executionTimes=0,interval=setInterval((function(){var _this$imageRef,_this$imageRef$curren;null!==(_this$imageRef=_this.imageRef)&&void 0!==_this$imageRef&&null!==(_this$imageRef$curren=_this$imageRef.current)&&void 0!==_this$imageRef$curren&&_this$imageRef$curren.complete&&(_this.onImageLoad(_this.imageRef.current),clearInterval(interval)),10==++executionTimes&&clearInterval(interval)}),200)},_this.onImageLoadError=function(){var src=_this.props.componentData.src;src&&src.fallback&&_this.setState({fallbackImageSrc:{preload:src.fallback,highres:src.fallback}})},_this.renderImage=function(imageClassName,imageSrc,alt,props,isGif,onlyHighRes){var _classNames;return _this.getImage(classNames(imageClassName,_this.styles.imageHighres,((_classNames={})[_this.styles.onlyHighRes]=onlyHighRes,_classNames)),imageSrc.highres,alt,props,{fadeIn:!isGif,width:imageSrc.highresWidth,height:imageSrc.highresHeight})},_this.renderPreloadImage=function(imageClassName,imageSrc,alt,props){return _this.getImage(classNames(imageClassName,_this.styles.imagePreload),imageSrc.preload,alt,_extends({"aria-hidden":!0},props))},_this.onImageLoad=function(element){element.style.opacity=1,_this.preloadRef.current&&(_this.preloadRef.current.style.opacity="0")},_this.handleExpand=function(e){var _helpers$onViewerActi;e.preventDefault();var _this$props=_this.props,onExpand=_this$props.settings.onExpand,_this$props$helpers=_this$props.helpers,helpers=void 0===_this$props$helpers?{}:_this$props$helpers;null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,IMAGE_TYPE,"Click","expand_image"),_this.hasExpand()&&(null==onExpand||onExpand(_this.props.blockKey))},_this.scrollToAnchor=function(e){var _this$props2=_this.props,_this$props2$componen=_this$props2.componentData.config.link,anchor=(_this$props2$componen=void 0===_this$props2$componen?{}:_this$props2$componen).anchor,customAnchorScroll=_this$props2.customAnchorScroll;if(customAnchorScroll)customAnchorScroll(e,anchor);else{var anchorString="viewer-"+anchor,element=document.getElementById(anchorString);addAnchorTagToUrl(anchorString),anchorScroll(element,_this.context.experiments)}},_this.hasLink=function(){var _this$props$component,_this$props$component2,_this$props$component3;return null===(_this$props$component=_this.props.componentData)||void 0===_this$props$component||null===(_this$props$component2=_this$props$component.config)||void 0===_this$props$component2||null===(_this$props$component3=_this$props$component2.link)||void 0===_this$props$component3?void 0:_this$props$component3.url},_this.hasAnchor=function(){var _this$props$component4,_this$props$component5,_this$props$component6;return null===(_this$props$component4=_this.props.componentData)||void 0===_this$props$component4||null===(_this$props$component5=_this$props$component4.config)||void 0===_this$props$component5||null===(_this$props$component6=_this$props$component5.link)||void 0===_this$props$component6?void 0:_this$props$component6.anchor},_this.onKeyDown=function(e){"Enter"!==e.key&&" "!==e.key||_this.props.getInPluginEditingMode||_this.handleClick(e)},_this.handleClick=function(e){if(_this.hasLink())return null;_this.hasAnchor()?(e.preventDefault(),e.stopPropagation(),_this.scrollToAnchor(e)):_this.handleExpand(e)},_this.handleRef=function(e){_this.state.container||_this.setState({container:e})},_this.handleContextMenu=function(e){var _this$props$component7=_this.props.componentData.disableDownload;return void 0!==_this$props$component7&&_this$props$component7&&e.preventDefault()},_this.hasExpand=function(){var _this$props3=_this.props,componentData=_this$props3.componentData,settings=_this$props3.settings,disableExpand=!1;return void 0!==componentData.disableExpand?disableExpand=componentData.disableExpand:void 0!==settings.disableExpand&&(disableExpand=settings.disableExpand),!disableExpand&&settings.onExpand},_this.renderExpandIcon=function(){return React.createElement("div",{className:_this.styles.expandContainer},React.createElement(expand,{className:_this.styles.expandIcon,onClick:_this.handleExpand}))},validate(props.componentData,pluginImageSchema),_this.state={},_this.preloadRef=React.createRef(),_this.imageRef=React.createRef(),_this}_inheritsLoose(ImageViewer,_React$Component);var _proto=ImageViewer.prototype;return _proto.componentDidMount=function(){this.setState({ssrDone:!0}),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.forceOnImageLoad()},_proto.componentWillReceiveProps=function(nextProps){isEqual(nextProps.componentData,this.props.componentData)||validate(nextProps.componentData,pluginImageSchema)},_proto.calculateHeight=function(width,src){return void 0===width&&(width=1),src&&src.height&&src.width?Math.ceil(src.height/src.width*width):WIX_MEDIA_DEFAULT.SIZE},_proto.getImageDataUrl=function(){return this.props.dataUrl?{preload:this.props.dataUrl,highres:this.props.dataUrl}:null},_proto.getImageUrl=function(src){var _this$context$experim,_this$context$experim2,_this2=this,_ref=this.props||{},helpers=_ref.helpers,seoMode=_ref.seoMode;if(!src&&null!=helpers&&helpers.handleFileSelection)return null;var requiredWidth,requiredHeight,removeUsm=null===(_this$context$experim=this.context.experiments)||void 0===_this$context$experim||null===(_this$context$experim2=_this$context$experim.removeUsmFromImageUrls)||void 0===_this$context$experim2?void 0:_this$context$experim2.enabled,imageUrl={preload:"",highres:""},imageSrcOpts={};if(!this.props.isMobile&&!isPNG(src)){var _this$props$component8=this.props.componentData.config,alignment=(_this$props$component8=void 0===_this$props$component8?{}:_this$props$component8).alignment,width=_this$props$component8.width;imageSrcOpts=_extends({removeUsm:removeUsm,imageType:"quailtyPreload"},("left"===alignment||"right"===alignment)&&!width&&{requiredWidth:300})}if(imageUrl.preload=getImageSrc(src,null==helpers?void 0:helpers.getImageUrl,imageSrcOpts),seoMode)requiredWidth=(null==src?void 0:src.width)&&Math.min(src.width,1e3),requiredHeight=this.calculateHeight(1e3,src);else if(this.state.container){var _getImageDimensions=function(width,isMobile){var requiredHeight,requiredWidth=width||1;return isMobile&&!isSSR()&&(requiredWidth*=window.devicePixelRatio,requiredWidth*=window.screen.width/document.body.clientWidth),requiredHeight=_this2.calculateHeight(requiredWidth,src),[requiredWidth=Math.ceil(requiredWidth),requiredHeight=Math.ceil(requiredHeight)]}(this.state.container.getBoundingClientRect().width||(null==src?void 0:src.width),this.props.isMobile);requiredWidth=_getImageDimensions[0],requiredHeight=_getImageDimensions[1]}return imageUrl.highres=getImageSrc(src,null==helpers?void 0:helpers.getImageUrl,{removeUsm:removeUsm,requiredWidth:requiredWidth,requiredHeight:requiredHeight,requiredQuality:90,imageType:"highRes"}),!this.state.ssrDone||imageUrl.preload||this.props.isLoading||console.error("image plugin mounted with invalid image source!",src),imageUrl},_proto.getImage=function(imageClassNames,src,alt,props,opts){var _this$context$experim3,_this3=this;void 0===opts&&(opts={});var _opts=opts,_opts$fadeIn=_opts.fadeIn,fadeIn=void 0!==_opts$fadeIn&&_opts$fadeIn,width=_opts.width,height=_opts.height,loading=null!==(_this$context$experim3=this.context.experiments.lazyImagesAndIframes)&&void 0!==_this$context$experim3&&_this$context$experim3.enabled?"lazy":void 0;return React.createElement("img",Object.assign({},props,{className:imageClassNames,src:src,alt:alt,onError:this.onImageLoadError,onLoad:fadeIn?function(e){return _this3.onImageLoad(e.target)}:void 0,ref:fadeIn?this.imageRef:this.preloadRef,width:width,height:height,loading:loading}))},_proto.renderTitle=function(data,styles){return!!(data.config||{}).showTitle&&React.createElement("div",{className:classNames(styles.imageTitle)},data&&data.title||"")},_proto.renderDescription=function(data,styles){return!!(data.config||{}).showDescription&&React.createElement("div",{className:classNames(styles.imageDescription)},data&&data.description||"")},_proto.renderCaption=function(caption){var _this$props4=this.props,onCaptionChange=_this$props4.onCaptionChange,setFocusToBlock=_this$props4.setFocusToBlock,setInPluginEditingMode=_this$props4.setInPluginEditingMode,_this$styles=this.styles,imageCaption=_this$styles.imageCaption,link=_this$styles.link,classes=classNames(imageCaption,this.hasLink()&&link);return onCaptionChange?React.createElement(InPluginInput,{setInPluginEditingMode:setInPluginEditingMode,className:classes,value:caption,onChange:onCaptionChange,setFocusToBlock:setFocusToBlock}):React.createElement("span",{dir:"auto",className:classes},caption)},_proto.shouldRenderCaption=function(){var _componentData$metada,_this$props5=this.props,getInPluginEditingMode=_this$props5.getInPluginEditingMode,settings=_this$props5.settings,componentData=_this$props5.componentData,defaultCaption=_this$props5.defaultCaption,caption=null===(_componentData$metada=componentData.metadata)||void 0===_componentData$metada?void 0:_componentData$metada.caption;if(includes(get(settings,"toolbar.hidden"),"settings"))return!1;if(void 0===caption||""===caption&&(null==getInPluginEditingMode||!getInPluginEditingMode())||caption===defaultCaption)return!1;var data=componentData||DEFAULTS;return"original"!==data.config.size||!data.src||!data.src.width||data.src.width>=350},_proto.render=function(){var _classNames2,_imageSrc$highres,_imageSrc$highres$end;this.styles=this.styles||mergeStyles({styles:styles$1,theme:this.props.theme});var _this$props6=this.props,componentData=_this$props6.componentData,className=_this$props6.className,settings=_this$props6.settings,setComponentUrl=_this$props6.setComponentUrl,seoMode=_this$props6.seoMode,_this$state=this.state,fallbackImageSrc=_this$state.fallbackImageSrc,ssrDone=_this$state.ssrDone,data=componentData||DEFAULTS,metadata=componentData.metadata;metadata||(metadata={});var itemClassName=classNames(this.styles.imageWrapper,className,((_classNames2={})[this.styles.pointer]=this.hasExpand(),_classNames2)),imageClassName=this.styles.image,imageSrc=fallbackImageSrc||this.getImageDataUrl()||this.getImageUrl(data.src),imageProps={};data.src&&settings&&settings.imageProps&&(imageProps=isFunction(settings.imageProps)?settings.imageProps(data.src):settings.imageProps);var isGif=null==imageSrc||null===(_imageSrc$highres=imageSrc.highres)||void 0===_imageSrc$highres||null===(_imageSrc$highres$end=_imageSrc$highres.endsWith)||void 0===_imageSrc$highres$end?void 0:_imageSrc$highres$end.call(_imageSrc$highres,".gif");null==setComponentUrl||setComponentUrl(null==imageSrc?void 0:imageSrc.highres);var shouldRenderPreloadImage=!seoMode&&imageSrc&&!isGif,shouldRenderImage=imageSrc&&(seoMode||ssrDone)||isGif,accesibilityProps=!this.hasLink()&&{role:"button",tabIndex:0},onlyHiRes=seoMode||isGif;return React.createElement("div",Object.assign({"data-hook":"imageViewer",className:this.styles.imageContainer,ref:this.handleRef,onContextMenu:this.handleContextMenu,onKeyDown:this.onKeyDown},accesibilityProps),React.createElement("div",{className:itemClassName,"aria-label":metadata.alt,onClick:this.handleClick,onKeyDown:this.onKeyDown},shouldRenderPreloadImage&&this.renderPreloadImage(imageClassName,imageSrc,metadata.alt,imageProps),shouldRenderImage&&this.renderImage(imageClassName,imageSrc,metadata.alt,imageProps,isGif,onlyHiRes),this.hasExpand()&&this.renderExpandIcon()),this.renderTitle(data,this.styles),this.renderDescription(data,this.styles),this.shouldRenderCaption()&&this.renderCaption(metadata.caption))},ImageViewer}(React.Component);ImageViewer.contextType=GlobalContext;var shouldDisableStyles=function(componentData,isMobile){var _ref=componentData.config||{},size=_ref.size,width=_ref.width;return!("inline"===size&&isNumber(width)&&width<=150)&&isMobile},imageRenderDescriptor={component:ImageViewer,classNameStrategies:{size:function(componentData,theme,styles,isMobile){var size=(componentData.config||{}).size;return!size||isMobile&&"original"===size?"":shouldDisableStyles(componentData,isMobile)?classNames(styles.sizeFullWidth,theme.sizeFullWidth):classNames(styles["size"+upperFirst(camelCase(size))],theme["size"+upperFirst(camelCase(size))])},alignment:function(componentData,theme,styles,isMobile){var _ref2=componentData.config||{},alignment=_ref2.alignment,size=_ref2.size;if(!alignment||shouldDisableStyles(componentData,isMobile)&&"original"!==size)return"";var align=alignment;if("original"===size&&"center"!==alignment){var width=(componentData.src||{}).width;isNumber(width)&&width>350&&(align="center")}return classNames(styles["align"+upperFirst(align)],theme["align"+upperFirst(align)])}}},typeMapper=function(){var _ref;return(_ref={}).IMAGE=imageRenderDescriptor,_ref[IMAGE_TYPE]=imageRenderDescriptor,_ref},pluginImage=function(config){return{config:_extends({},DEFAULTS.config,config),type:IMAGE_TYPE,typeMapper:typeMapper}};export{IMAGE_TYPE,typeMapper as imageTypeMapper,pluginImage}; | ||
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React from"react";import{normalizeUrl,uuid,validate,mergeStyles}from"wix-rich-content-common";import pluginGallerySchema from"wix-rich-content-common/dist/statics/schemas/plugin-gallery.schema.json";import{isEqual,debounce}from"lodash";import imageClientAPI from"image-client-api/dist/imageClientSDK";import classnames from"classnames";var _layoutData,GALLERY_LAYOUTS,isAbsoluteUrl=function(url){return url.startsWith("http://")||url.startsWith("https://")},getAbsoluteUrl=function(url,type){return isAbsoluteUrl(url)?url:("image"===type?(baseUrl="https://static.wixstatic.com/",baseFolder="media/"):(baseUrl="https://video.wixstatic.com/",baseFolder="video/"),baseUrl+(url.startsWith(baseFolder)?url:baseFolder+url));var baseUrl,baseFolder};!function(GALLERY_LAYOUTS){GALLERY_LAYOUTS[GALLERY_LAYOUTS.EMPTY=-1]="EMPTY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLLAGE=0]="COLLAGE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MASONRY=1]="MASONRY",GALLERY_LAYOUTS[GALLERY_LAYOUTS.GRID=2]="GRID",GALLERY_LAYOUTS[GALLERY_LAYOUTS.THUMBNAIL=3]="THUMBNAIL",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDER=4]="SLIDER",GALLERY_LAYOUTS[GALLERY_LAYOUTS.SLIDESHOW=5]="SLIDESHOW",GALLERY_LAYOUTS[GALLERY_LAYOUTS.PANORAMA=6]="PANORAMA",GALLERY_LAYOUTS[GALLERY_LAYOUTS.COLUMN=7]="COLUMN",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MAGIC=8]="MAGIC",GALLERY_LAYOUTS[GALLERY_LAYOUTS.FULLSIZE=9]="FULLSIZE",GALLERY_LAYOUTS[GALLERY_LAYOUTS.BRICKS=10]="BRICKS",GALLERY_LAYOUTS[GALLERY_LAYOUTS.MIX=11]="MIX",GALLERY_LAYOUTS[GALLERY_LAYOUTS.ALTERNATE=12]="ALTERNATE"}(GALLERY_LAYOUTS||(GALLERY_LAYOUTS={}));var _LAYOUT_FIXED_STYLES,layoutData=((_layoutData={})[GALLERY_LAYOUTS.COLLAGE]={isVertical:!0,oneRow:!1,galleryType:"Columns",gallerySizePx:"300"},_layoutData[GALLERY_LAYOUTS.MASONRY]={numberOfImagesPerRow:0,isVertical:!1,gallerySizePx:"300"},_layoutData[GALLERY_LAYOUTS.GRID]={numberOfImagesPerRow:3,cubeType:"fill",cubeRatio:1,isVertical:!0,oneRow:!1},_layoutData[GALLERY_LAYOUTS.THUMBNAIL]={galleryThumbnailsAlignment:"bottom",thumbnailSpacings:5},_layoutData[GALLERY_LAYOUTS.SLIDER]={cubeType:"fit",cubeRatio:"16/9"},_layoutData[GALLERY_LAYOUTS.SLIDESHOW]={cubeType:"fit"},_layoutData[GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[GALLERY_LAYOUTS.COLUMN]={hasThumbnails:!1,galleryThumbnailsAlignment:"none"},_layoutData[GALLERY_LAYOUTS.FULLSIZE]={cubeType:"fill"},_layoutData),GALLERY_ITEMS_TYPES=Object.freeze({IMAGE:"image",VIDEO:"video"}),HORIZONTAL_LAYOUTS=Object.freeze([GALLERY_LAYOUTS.THUMBNAIL,GALLERY_LAYOUTS.SLIDER,GALLERY_LAYOUTS.SLIDESHOW,GALLERY_LAYOUTS.COLUMN,GALLERY_LAYOUTS.FULLSIZE]),sampleItems=[1,2,3].map((function(i){return{metadata:{height:10,width:10},orderIndex:i,itemId:"sampleItem-"+i,url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAA1JREFUCB1jePv27X8ACVkDxyMHIvwAAAAASUVORK5CYII="}})),DEFAULTS=Object.freeze({items:[],styles:_extends({galleryLayout:GALLERY_LAYOUTS.GRID},layoutData[GALLERY_LAYOUTS.GRID]),config:{alignment:"center",size:"content"}}),LAYOUT_FIXED_STYLES=((_LAYOUT_FIXED_STYLES={})[GALLERY_LAYOUTS.COLLAGE]={galleryType:"Columns",imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.MASONRY]={imageMargin:5,isVertical:!1,gridStyle:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.GRID]={imageResize:!1,gridStyle:1,galleryImageRatio:2,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.THUMBNAIL]={arrowsSize:23,thumbnailSize:120,floatingImages:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.SLIDER]={arrowsSize:23,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.SLIDESHOW]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.PANORAMA]={hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.COLUMN]={arrowsSize:23,hasThumbnails:!1,imageMargin:5},_LAYOUT_FIXED_STYLES[GALLERY_LAYOUTS.FULLSIZE]={arrowsSize:23,floatingImages:0,slideshowInfoSize:0},_LAYOUT_FIXED_STYLES),FIXED_STYLES={gallerySizeType:"px",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",hoveringBehaviour:"NO_CHANGE",alwaysShowHover:!0,allowHover:!0,itemClick:"link",fullscreen:!1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",gotStyleParams:!0,videoPlay:"onClick",videoLoop:!1,videoSound:!0,hidePlay:!1,showVideoControls:!0},isHorizontalLayout=function(_ref){var galleryLayout=_ref.galleryLayout,oneRow=_ref.oneRow;return HORIZONTAL_LAYOUTS.indexOf(galleryLayout)>-1||oneRow},resizeMediaUrl=function(item,originalUrl,resizeMethod,requiredWidth,requiredHeight,sharpParams,faces,allowWatermark,focalPoint){if(void 0===faces&&(faces=!1),void 0===allowWatermark&&(allowWatermark=!1),sharpParams=sharpParams||{},-1!==(originalUrl=originalUrl||"").indexOf("base64"))return originalUrl;if(requiredWidth=Math.ceil(requiredWidth),requiredHeight=Math.ceil(requiredHeight),resizeMethod===GALLERY_ITEMS_TYPES.VIDEO)return getAbsoluteUrl(originalUrl,GALLERY_ITEMS_TYPES.VIDEO);if(requiredWidth>=item.maxWidth&&requiredHeight>=item.maxHeight){var url=item.dto.metaData.type===GALLERY_ITEMS_TYPES.VIDEO?originalUrl:item.url;return getAbsoluteUrl(url,GALLERY_ITEMS_TYPES.IMAGE)}return function(item,originalUrl,resizeMethod,requiredWidth,requiredHeight,sharpParams,faces,allowWatermark,focalPoint){originalUrl=originalUrl||"",(sharpParams=sharpParams||{}).quality>0&&(sharpParams.quality=Math.min(90,sharpParams.quality));var focalPointObj={x:50,y:50};focalPoint&&focalPoint[0]>=0&&focalPoint[1]>=0&&(focalPointObj.x=Math.round(100*focalPoint[0]),focalPointObj.y=Math.round(100*focalPoint[1])),!0===sharpParams.allowUsm&&sharpParams.usm?(sharpParams.usm.usm_a=Math.min(5,Math.max(0,sharpParams.usm.usm_a||0)),sharpParams.usm.usm_r=Math.min(128,Math.max(0,sharpParams.usm.usm_r||0)),sharpParams.usm.usm_t=Math.min(1,Math.max(0,sharpParams.usm.usm_t||0))):sharpParams.usm={usm_a:0,usm_r:0,usm_t:0};var resizer=function(){};resizer="fit"===resizeMethod?imageClientAPI.getScaleToFitImageURL:imageClientAPI.getScaleToFillImageURL;var options={};return sharpParams.quality>0&&(options.quality=sharpParams.quality),sharpParams.blur>0&&(options.filters={blur:sharpParams.blur}),focalPointObj&&(options.focalPoint=focalPointObj),sharpParams&&sharpParams.usm&&(options.unsharpMask={radius:parseFloat(sharpParams.usm.usm_r),amount:parseFloat(sharpParams.usm.usm_a),threshold:parseFloat(sharpParams.usm.usm_t)}),isAbsoluteUrl(originalUrl)?originalUrl:resizer(originalUrl.replace("https://static.wixstatic.com/",""),item.maxWidth,item.maxHeight,requiredWidth,requiredHeight,options)}(item,originalUrl,resizeMethod,requiredWidth,requiredHeight,sharpParams,0,0,focalPoint)},styles={gallery_container:"_1lf3C",expandContainer:"_2trtH",itemOverlay:"_2Vr_d",expandIcon:"_1nQrL",clickableItem:"_2QozM",imageTitle:"w8o3K",imageTitleContainer:"F9_4B",pointer:"_1pMUq"},expand=function(props){return React.createElement("svg",Object.assign({viewBox:"0 0 19 19",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{d:"M15.071 8.371V4.585l-4.355 4.356a.2.2 0 0 1-.283 0l-.374-.374a.2.2 0 0 1 0-.283l4.356-4.355h-3.786a.2.2 0 0 1-.2-.2V3.2c0-.11.09-.2.2-.2H16v5.371a.2.2 0 0 1-.2.2h-.529a.2.2 0 0 1-.2-.2zm-6.5 6.9v.529a.2.2 0 0 1-.2.2H3v-5.371c0-.11.09-.2.2-.2h.529c.11 0 .2.09.2.2v3.786l4.355-4.356a.2.2 0 0 1 .283 0l.374.374a.2.2 0 0 1 0 .283L4.585 15.07h3.786c.11 0 .2.09.2.2z",fill:"#000",fillRule:"nonzero"}))},GALLERY_TYPE="wix-draft-plugin-gallery",_excluded=["scrollingElement"],_require=require("pro-gallery"),ProGallery=_require.ProGallery,GALLERY_CONSTS=_require.GALLERY_CONSTS,GALLERY_EVENTS=GALLERY_CONSTS.events,GalleryViewer=function(_React$Component){function GalleryViewer(_props){var _this;return validate(_props.componentData,pluginGallerySchema),(_this=_React$Component.call(this,_props)||this).shouldUpdateDimensions=function(prevComponentData){var prevGalleryLayout=prevComponentData.styles.galleryLayout;return _this.props.componentData.styles.galleryLayout!==prevGalleryLayout||(!isEqual(prevComponentData.config,_this.props.componentData.config)||void 0)},_this.shouldConsiderThumbnailSize=function(){var _this$props$component=_this.props.componentData.styles,galleryLayout=_this$props$component.galleryLayout,galleryThumbnailsAlignment=_this$props$component.galleryThumbnailsAlignment;return _this.props.isMobile&&galleryLayout===GALLERY_LAYOUTS.THUMBNAIL&&["top","bottom"].includes(galleryThumbnailsAlignment)},_this.getGalleryHeight=function(width){var height=305;return width&&(height=_this.shouldConsiderThumbnailSize()?Math.floor(2*width/3)+95:Math.floor(3*width/4)),height},_this.getDimensions=function(){var width=Math.floor(_this.containerRef.current.getBoundingClientRect().width);return{width:width,height:_this.getGalleryHeight(width)}},_this.updateDimensions=debounce((function(){var _this$state$size,_this$state$size2,_this$getDimensions=_this.getDimensions(),width=_this$getDimensions.width,height=_this$getDimensions.height;width===(null===(_this$state$size=_this.state.size)||void 0===_this$state$size?void 0:_this$state$size.width)&&height===(null===(_this$state$size2=_this.state.size)||void 0===_this$state$size2?void 0:_this$state$size2.height)||_this.setState({size:{width:width,height:height}})}),100),_this.stateFromProps=function(props){var items=props.componentData.items||[];return{items:items=items.filter((function(item){return!item.error}))}},_this.handleGalleryEvents=function(name,data){var styleParams=_this.props.componentData.styles;switch(name){case GALLERY_EVENTS.GALLERY_CHANGE:_this.containerRef.current&&(isHorizontalLayout(styleParams)?_this.containerRef.current.style.height="auto":_this.containerRef.current.style.height=data.layoutHeight+"px");break;case GALLERY_EVENTS.ITEM_ACTION_TRIGGERED:"video"!==data.type&&!data.linkData.url&&_this.hasExpand()&&_this.handleExpand(data)}},_this.handleExpand=function(data){var _helpers$onViewerActi,_this$props=_this.props,onExpand=_this$props.settings.onExpand,_this$props$helpers=_this$props.helpers,helpers=void 0===_this$props$helpers?{}:_this$props$helpers;null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,GALLERY_TYPE,"Click","expand_gallery"),_this.hasExpand()&&onExpand(_this.props.blockKey,data.idx)},_this.renderExpandIcon=function(itemProps){return React.createElement("div",{className:_this.styles.expandContainer},React.createElement(expand,{className:_this.styles.expandIcon,onClick:function(e){e.preventDefault(),e.stopPropagation(),_this.handleExpand(itemProps)}}))},_this.hasExpand=function(){var _this$props2=_this.props,componentData=_this$props2.componentData,settings=_this$props2.settings,disableExpand=!1;return void 0!==componentData.disableExpand?disableExpand=componentData.disableExpand:void 0!==settings.disableExpand&&(disableExpand=settings.disableExpand),!disableExpand&&settings.onExpand},_this.renderTitle=function(title){return title?React.createElement("div",{className:styles.imageTitleContainer},React.createElement("div",{className:_this.styles.imageTitle},title)):null},_this.hoverElement=function(itemProps){var _this$props$itemOverl,_this$props3,isClickable=_this.hasExpand()||itemProps.link,itemOverlayStyles=classnames(_this.styles.itemOverlay,isClickable&&_this.styles.clickableItem);return React.createElement("div",{className:itemOverlayStyles},_this.hasExpand()&&_this.renderExpandIcon(itemProps),_this.renderTitle(itemProps.title,"HOVER"),null===(_this$props$itemOverl=(_this$props3=_this.props).itemOverlayElement)||void 0===_this$props$itemOverl?void 0:_this$props$itemOverl.call(_this$props3,itemProps))},_this.getStyleParams=function(){var layout,_this$props4=_this.props,_this$props4$componen=_this$props4.componentData,styleParams=_this$props4$componen.styles,disableDownload=_this$props4$componen.disableDownload,isMobile=_this$props4.isMobile,calculatedStyles=_extends({},(layout=styleParams.galleryLayout,_extends({},FIXED_STYLES,LAYOUT_FIXED_STYLES[layout])),{allowContextMenu:!disableDownload,showArrows:isHorizontalLayout(styleParams)},styleParams);return isMobile&&isHorizontalLayout(calculatedStyles)&&(calculatedStyles.arrowsSize=20,calculatedStyles.imageMargin=0,calculatedStyles.galleryLayout===GALLERY_LAYOUTS.THUMBNAIL&&(calculatedStyles.thumbnailSize=90)),calculatedStyles.thumbnailSpacings&&(calculatedStyles.thumbnailSpacings/=2),calculatedStyles},_this.handleContextMenu=function(e){var _this$props$component2=_this.props.componentData.disableDownload;return void 0!==_this$props$component2&&_this$props$component2&&e.preventDefault()},_this.domId=_this.props.blockKey||"v-"+_this.props.entityIndex,_this.containerRef=React.createRef(),_this.state=_extends({},_this.stateFromProps(_props)),_this}_inheritsLoose(GalleryViewer,_React$Component);var _proto=GalleryViewer.prototype;return _proto.componentDidMount=function(){window.addEventListener("resize",this.updateDimensions),this.setState({size:this.getDimensions()}),this.initUpdateDimensionsForDomChanges()},_proto.initUpdateDimensionsForDomChanges=function(){var _this$props5,_contentElement,_this2=this,scrollingElement=(null===(_this$props5=this.props)||void 0===_this$props5?void 0:_this$props5.settings).scrollingElement;scrollingElement||(console.error("Please fix the gallery config of Rich Content Editor.\n A scrollingElement needs to be provided. Without it the gallery will not work correctly"),scrollingElement=document.body);var contentElement="function"==typeof scrollingElement?scrollingElement():scrollingElement;1!==(null===(_contentElement=contentElement)||void 0===_contentElement?void 0:_contentElement.nodeType)&&(contentElement=document.body),contentElement?(this.observer=new MutationObserver((function(){contentElement.clientHeight!==_this2.oldContentElementHeight&&(_this2.oldContentElementHeight=contentElement.clientHeight,_this2.updateDimensions())})),this.observer.observe(contentElement,{attributes:!0,childList:!0,subtree:!0})):console.warn("can't find content container to listen for changes to update gallery")},_proto.componentWillReceiveProps=function(nextProps){this.setState(_extends({},this.stateFromProps(nextProps)))},_proto.componentDidUpdate=function(prevProps){this.shouldUpdateDimensions(prevProps.componentData)&&this.updateDimensions()},_proto.componentWillUnmount=function(){this.observer.disconnect(),window.removeEventListener("resize",this.updateDimensions),this.updateDimensions.cancel()},_proto.getItems=function(){var items=this.state.items,_this$props6=this.props,anchorTarget=_this$props6.anchorTarget,relValue=_this$props6.relValue;return items.length>0?function(_ref){var items=_ref.items,anchorTarget=_ref.anchorTarget,relValue=_ref.relValue;return items.map((function(item,index){var metadata=item.metadata;if(item.metaData)return item;var convertedData={metaData:{link:{type:"none",target:"_blank"}},directLink:{}};if(metadata){if(convertedData.metaData=_extends({},metadata,{link:{type:"none",target:"_blank"}}),"video"===item.metadata.type){convertedData.metaData.link={target:"_blank",rel:"noopener",url:normalizeUrl(item.url||"")};var _convertedData$metaDa=convertedData.metaData.poster,pathname=_convertedData$metaDa.pathname,_convertedData$metaDa2=_convertedData$metaDa.thumbnail,thumbPathname=(_convertedData$metaDa2=void 0===_convertedData$metaDa2?{}:_convertedData$metaDa2).pathname,width=_convertedData$metaDa2.width,height=_convertedData$metaDa2.height;pathname&&thumbPathname?convertedData.metaData.poster={url:getAbsoluteUrl(thumbPathname,"image"),width:width,height:height}:"string"==typeof convertedData.metaData.poster&&(convertedData.metaData.poster={url:convertedData.metaData.poster,width:convertedData.metaData.width,height:convertedData.metaData.height})}convertedData.metaData.alt=metadata.altText,item.metadata.link&&(convertedData.metaData.link={type:"wix",target:item.metadata.link.target||anchorTarget||"_self",data:{type:"ExternalLink",target:item.metadata.link.target||anchorTarget||"_self",rel:item.metadata.link.rel||relValue||"noopener",url:normalizeUrl(item.metadata.link.url||"")}},convertedData.directLink={url:normalizeUrl(item.metadata.link.url||""),target:item.metadata.link.target||anchorTarget||"_self",rel:item.metadata.link.rel||relValue||"noopener"})}return _extends({},item,{metadata:void 0},convertedData,{itemId:uuid()+"_"+index.toString()})}))}({items:items,anchorTarget:anchorTarget,relValue:relValue}):sampleItems},_proto.render=function(){var _this$props7=this.props,theme=_this$props7.theme,settings=_this$props7.settings,seoMode=_this$props7.seoMode;this.styles=this.styles||mergeStyles({styles:styles,theme:theme});var scrollingElement=settings.scrollingElement,gallerySettings=_objectWithoutPropertiesLoose(settings,_excluded),size=this.state.size,items=this.getItems(),styleParams=this.getStyleParams(),viewMode=seoMode?GALLERY_CONSTS.viewMode.SEO:void 0;return React.createElement("div",{ref:this.containerRef,className:this.styles.gallery_container,"data-hook":"galleryViewer",role:"none",onContextMenu:this.handleContextMenu},null!=size&&size.width?React.createElement(ProGallery,{domId:this.domId,allowSSR:!!seoMode,items:items,options:styleParams,container:size,settings:gallerySettings,scrollingElement:scrollingElement,eventsListener:this.handleGalleryEvents,resizeMediaUrl:resizeMediaUrl,viewMode:viewMode,customHoverRenderer:this.hoverElement}):null)},GalleryViewer}(React.Component),typeMapper=function(){var _ref;return(_ref={})[GALLERY_TYPE]={component:GalleryViewer},_ref},pluginGallery=function(config){return{config:_extends({},DEFAULTS.config,config),type:GALLERY_TYPE,typeMapper:typeMapper}};export{GALLERY_TYPE,typeMapper as galleryTypeMapper,pluginGallery}; | ||
//# sourceMappingURL=module.viewer.js.map |
@@ -1,4 +0,4 @@ | ||
import { ImagePluginEditorConfig } from './types'; | ||
import { GalleryPluginEditorConfig } from './types'; | ||
import { EditorPluginCreator } from 'wix-rich-content-common'; | ||
export declare const pluginImage: EditorPluginCreator<ImagePluginEditorConfig>; | ||
export declare const pluginGallery: EditorPluginCreator<GalleryPluginEditorConfig>; | ||
//# sourceMappingURL=editor.d.ts.map |
@@ -0,4 +1,43 @@ | ||
export { default as AddIcon } from './AddIcon'; | ||
export { default as BackIcon } from './BackIcon'; | ||
export { default as Collage } from './Collage'; | ||
export { default as Columns } from './Columns'; | ||
export { default as DragIcon } from './DragIcon'; | ||
export { default as Dropdown1 } from './Dropdown1'; | ||
export { default as Dropdown2 } from './Dropdown2'; | ||
export { default as EditActiveIcon } from './EditActiveIcon'; | ||
export { default as FabIcon } from './FabIcon'; | ||
export { default as Grid } from './Grid'; | ||
export { default as IconGridLarge } from './IconGridLarge'; | ||
export { default as IconGridLargeActive } from './IconGridLargeActive'; | ||
export { default as IconGridMedium } from './IconGridMedium'; | ||
export { default as IconGridMediumActive } from './IconGridMediumActive'; | ||
export { default as IconGridSmall } from './IconGridSmall'; | ||
export { default as IconGridSmallActive } from './IconGridSmallActive'; | ||
export { default as IconUpload } from './IconUpload'; | ||
export { default as InsertPluginIcon } from './InsertPluginIcon'; | ||
export { default as MediaReplaceIcon } from './MediaReplaceIcon'; | ||
export { default as ImageEditorIcon } from './ImageEditorIcon'; | ||
export { default as LayoutActiveIcon } from './LayoutActiveIcon'; | ||
export { default as LayoutCollageIcon } from './LayoutCollageIcon'; | ||
export { default as LayoutColumnsIcon } from './LayoutColumnsIcon'; | ||
export { default as LayoutGridIcon } from './LayoutGridIcon'; | ||
export { default as LayoutIcon } from './LayoutIcon'; | ||
export { default as LayoutMasonryIcon } from './LayoutMasonryIcon'; | ||
export { default as LayoutPanoramaIcon } from './LayoutPanoramaIcon'; | ||
export { default as LayoutSlideshowIcon } from './LayoutSlideshowIcon'; | ||
export { default as LayoutSlidesIcon } from './LayoutSlidesIcon'; | ||
export { default as LayoutThumbnailsIcon } from './LayoutThumbnailsIcon'; | ||
export { default as ManageMediaIcon } from './ManageMediaIcon'; | ||
export { default as Masonry } from './Masonry'; | ||
export { default as Panorama } from './Panorama'; | ||
export { default as PlusIcon } from './PlusIcon'; | ||
export { default as Slides } from './Slides'; | ||
export { default as Slideshow } from './Slideshow'; | ||
export { default as Thumbnails } from './Thumbnails'; | ||
export { default as UploadIcon } from './UploadIcon'; | ||
export { default as DeleteIcon } from './DeleteIcon'; | ||
export { default as ReplaceIcon } from './ReplaceIcon'; | ||
export { default as NextIcon } from './NextIcon'; | ||
export { default as PreviousIcon } from './PreviousIcon'; | ||
export { default as SelectedIcon } from './SelectedIcon'; | ||
export { default as NotSelectedIcon } from './NotSelectedIcon'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,7 +0,5 @@ | ||
export { createImagePlugin } from './createImagePlugin'; | ||
export { default as ImageViewer } from './image-viewer'; | ||
export { IMAGE_TYPE_LEGACY, IMAGE_TYPE } from './types'; | ||
export { createGalleryPlugin } from './createGalleryPlugin'; | ||
export { GALLERY_TYPE } from './types'; | ||
export { Modals, ModalsMap } from './modals'; | ||
export { pluginImage } from './editor'; | ||
export { Component as ImageComponent } from './image-component'; | ||
export { pluginGallery } from './editor'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,11 +0,9 @@ | ||
import ImageSettingsModal from './toolbar/image-settings'; | ||
import ImageEditorModal from './imageStudio/image-editor'; | ||
import GallerySettingsModal from './components/gallery-settings-modal'; | ||
declare const Modals: { | ||
IMAGE_SETTINGS: string; | ||
IMAGE_EDITOR: string; | ||
GALLERY_SETTINGS: string; | ||
}; | ||
declare const ModalsMap: { | ||
[x: string]: typeof ImageSettingsModal | typeof ImageEditorModal; | ||
[x: string]: typeof GallerySettingsModal; | ||
}; | ||
export { Modals, ModalsMap }; | ||
//# sourceMappingURL=modals.d.ts.map |
import React from 'react'; | ||
import { PluginProps } from 'wix-rich-content-editor-common'; | ||
export declare const Image: React.FC<PluginProps>; | ||
export declare const Gallery: React.FC<PluginProps>; | ||
//# sourceMappingURL=component.d.ts.map |
import { CreateRicosExtensions } from 'wix-tiptap-editor'; | ||
declare module '@tiptap/core' { | ||
interface Commands<ReturnType> { | ||
image: { | ||
/** | ||
* Toggle a paragraph | ||
*/ | ||
setImageUrl: (url: string) => ReturnType; | ||
/** | ||
* Update Image's loading state | ||
*/ | ||
setImageLoading: (isLoading: boolean) => ReturnType; | ||
}; | ||
} | ||
} | ||
export declare const createRicosExtensions: CreateRicosExtensions; | ||
//# sourceMappingURL=tiptap.d.ts.map |
import { EditorPluginConfig, ViewerPluginConfig } from 'wix-rich-content-common'; | ||
export declare const IMAGE_TYPE = "wix-draft-plugin-image"; | ||
export declare const IMAGE_TYPE_LEGACY = "IMAGE"; | ||
export declare type ImageEditorWixSettings = { | ||
initiator: string; | ||
siteToken: string; | ||
metaSiteId: string; | ||
mediaRoot: string; | ||
}; | ||
export interface ImageConfig { | ||
size?: string; | ||
alignment?: string; | ||
showTitle?: boolean; | ||
showDescription?: boolean; | ||
link?: { | ||
anchor: unknown; | ||
url: string; | ||
}; | ||
width?: number; | ||
export declare const GALLERY_TYPE = "wix-draft-plugin-gallery"; | ||
export interface GalleryPluginEditorConfig extends EditorPluginConfig { | ||
[key: string]: any; | ||
} | ||
export interface ImagePluginEditorConfig extends EditorPluginConfig, ImageConfig { | ||
export interface GalleryPluginViewerConfig extends ViewerPluginConfig { | ||
[key: string]: any; | ||
spoiler?: { | ||
buttonContent: string | undefined; | ||
description: string | undefined; | ||
enabled: boolean | undefined; | ||
}; | ||
defaultData?: { | ||
config?: ImageConfig; | ||
disableExpand?: boolean; | ||
}; | ||
imageProps?: HTMLImageElement; | ||
createGalleryForMultipleImages?: boolean; | ||
imageEditor?: boolean; | ||
consumer?: string; | ||
imageEditorWixSettings?: ImageEditorWixSettings; | ||
onImageEditorOpen?: () => void; | ||
uploadHandler?: () => void; | ||
} | ||
declare type ImageSrc = Record<string, unknown>; | ||
export interface ImagePluginViewerConfig extends ViewerPluginConfig, ImageConfig { | ||
onExpand?: (blockkey: string) => unknown; | ||
disableExpand?: boolean; | ||
imageProps?: ((src: ImageSrc) => HTMLImageElement) | HTMLImageElement; | ||
} | ||
export interface ImageData { | ||
config: ImageConfig; | ||
src: { | ||
fallback: string; | ||
width: number; | ||
}; | ||
metadata?: { | ||
caption?: unknown; | ||
alt?: string | undefined; | ||
}; | ||
[key: string]: unknown; | ||
disableDownload?: boolean; | ||
disableExpand?: boolean; | ||
} | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
import { typeMapper } from './typeMapper-loadable'; | ||
import { IMAGE_TYPE, ImagePluginViewerConfig } from './types'; | ||
import { GALLERY_TYPE, GalleryPluginViewerConfig } from './types'; | ||
import { ViewerPluginCreator } from 'wix-rich-content-common'; | ||
export { typeMapper as imageTypeMapper, IMAGE_TYPE }; | ||
export declare const pluginImage: ViewerPluginCreator<ImagePluginViewerConfig>; | ||
export { typeMapper as galleryTypeMapper, GALLERY_TYPE }; | ||
export declare const pluginGallery: ViewerPluginCreator<GalleryPluginViewerConfig>; | ||
//# sourceMappingURL=viewer-loadable.d.ts.map |
import { typeMapper } from './typeMapper'; | ||
import { IMAGE_TYPE, ImagePluginViewerConfig } from './types'; | ||
import { GALLERY_TYPE, GalleryPluginViewerConfig } from './types'; | ||
import { ViewerPluginCreator } from 'wix-rich-content-common'; | ||
export { typeMapper as imageTypeMapper, IMAGE_TYPE }; | ||
export declare const pluginImage: ViewerPluginCreator<ImagePluginViewerConfig>; | ||
export { typeMapper as galleryTypeMapper, GALLERY_TYPE }; | ||
export declare const pluginGallery: ViewerPluginCreator<GalleryPluginViewerConfig>; | ||
//# sourceMappingURL=viewer.d.ts.map |
@@ -1,1 +0,1 @@ | ||
{"name":"richlagetest","version":"0.0.0-38a5badf733cc46d87023565f85a37eca72b3bca"} | ||
{"name":"richlagetest","version":"0.0.0-3d4b022e55cbb930ef39c94d77fa68b87120a3dc"} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
838592
191
2395
1
9