Plugin Directory

Changeset 3461135


Ignore:
Timestamp:
02/14/2026 12:50:41 AM (5 days ago)
Author:
ultradevs
Message:

Update to version 1.1.0 from GitHub

Location:
random-image-block-for-block-editor
Files:
17 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • random-image-block-for-block-editor/tags/1.1.0/.distignore

    r3449156 r3461135  
    3535*.spec.js
    3636coverage
     37
     38.wordpress-org/banner-772x250.html
     39.wordpress-org/banner-1544x500.html
     40.wordpress-org/README.md
  • random-image-block-for-block-editor/tags/1.1.0/FEATURES.md

    r3449156 r3461135  
    88
    99### 1. Link Options
    10 - [ ] Link to attachment page
    11 - [ ] Link to custom URL
     10- [x] Link to attachment page
     11- [x] Link to custom URL
    1212- [ ] Lightbox/Modal integration
    13 - [ ] Open in new tab option
     13- [x] Open in new tab option
    1414
    1515### 2. Image Shuffle Animation
    16 - [ ] Fade transition
    17 - [ ] Slide transition
    18 - [ ] Zoom transition
    19 - [ ] Transition duration control
     16- [x] Fade transition
     17- [x] Slide transition
     18- [x] Zoom transition
     19- [x] Transition duration control
    2020
    2121### 3. Auto-refresh Interval
    22 - [ ] Auto-rotate images every X seconds
    23 - [ ] Enable/disable toggle
    24 - [ ] Custom time interval (seconds)
     22- [x] Auto-rotate images every X seconds
     23- [x] Enable/disable toggle
     24- [x] Custom time interval (seconds)
    2525
    2626### 4. Image Filters (CSS)
    27 - [ ] Grayscale
    28 - [ ] Blur
    29 - [ ] Brightness
    30 - [ ] Contrast
    31 - [ ] Saturation
    32 - [ ] Hue Rotate
     27- [x] Grayscale
     28- [x] Blur
     29- [x] Brightness
     30- [x] Contrast
     31- [x] Saturation
     32- [x] Hue Rotate
    3333
    3434### 5. Random Seed/Sticky Mode
    35 - [ ] Keep same random image for session duration
    36 - [ ] Cookie-based persistence
    37 - [ ] Local storage option
     35- [x] Keep same random image for session duration
     36- [x] Cookie-based persistence (using Local Storage)
     37- [x] Local storage option
    3838
    3939---
  • random-image-block-for-block-editor/tags/1.1.0/build/block.json

    r3449156 r3461135  
    4747      "type": "array",
    4848      "default": []
     49    },
     50    "selectedImageIndex": {
     51      "type": "number",
     52      "default": 0
    4953    },
    5054    "imageAlign": {
     
    122126        "openInNewTab": false
    123127      }
     128    },
     129    "filterSettings": {
     130      "type": "object",
     131      "default": {
     132        "grayscale": 0,
     133        "blur": 0,
     134        "brightness": 100,
     135        "contrast": 100,
     136        "saturate": 100,
     137        "hueRotate": 0
     138      }
     139    },
     140    "autoRefresh": {
     141      "type": "boolean",
     142      "default": false
     143    },
     144    "refreshInterval": {
     145      "type": "number",
     146      "default": 5
     147    },
     148    "shuffleAnimation": {
     149      "type": "string",
     150      "default": "fade"
     151    },
     152    "animationDuration": {
     153      "type": "number",
     154      "default": 500
     155    },
     156    "stickyMode": {
     157      "type": "boolean",
     158      "default": false
     159    },
     160    "uniqueId": {
     161      "type": "string",
     162      "default": ""
    124163    }
    125164  },
     
    127166  "editorScript": "file:./index.js",
    128167  "editorStyle": "file:./index.css",
    129   "style": "file:./style-index.css"
     168  "style": "file:./style-index.css",
     169  "viewScript": "file:./frontend.js"
    130170}
  • random-image-block-for-block-editor/tags/1.1.0/build/index.asset.php

    r3449156 r3461135  
    1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'dd9bc390fd6f5685dae6');
     1<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '512cd438f6840c0b4013');
  • random-image-block-for-block-editor/tags/1.1.0/build/index.js

    r3449156 r3461135  
    1 (()=>{"use strict";var e,t={411(e,t,a){const l=window.wp.blocks,o=window.wp.i18n,n=JSON.parse('{"DD":"Random Image Block","L1":"widgets","Kk":"image-flip-horizontal","h_":"Display random images from a gallery.","uK":{"images":{"type":"array","default":[]},"imageAlign":{"type":"string","default":"center"},"imageObjectFit":{"type":"string","default":""},"captionStyle":{"type":"object","default":{"color":"#ffffff","fontSize":16,"fontSizeUnit":"px","showCaptionOn":"","captionOverlay":{"enabled":"no","position":{"x":0.5,"y":0.5}},"padding":{"desktop":{"top":"0px","right":"0px","bottom":"0px","left":"0px"},"tablet":{"top":"","right":"","bottom":"","left":""},"mobile":{"top":"","right":"","bottom":"","left":""}}}},"imageSize":{"type":"object","default":{"desktop":{"width":100,"widthUnit":"%","height":100,"heightUnit":"%"},"tablet":{"width":"","widthUnit":"%","height":"","heightUnit":"%"},"mobile":{"width":"","widthUnit":"%","height":"","heightUnit":"%"}}},"linkSettings":{"type":"object","default":{"enabled":"none","customUrl":"","openInNewTab":false}}}}'),i=window.wp.element,r=window.wp.blockEditor,m=window.wp.serverSideRender;var c=a.n(m);const d=window.wp.components,g=({attributes:e,setAttributes:t})=>{const{images:a}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(r.BlockControls,null,(0,i.createElement)(d.ToolbarGroup,null,(0,i.createElement)(r.MediaUploadCheck,null,(0,i.createElement)(r.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:a.map(e=>e.id),onSelect:e=>{const a=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));t({images:a})},render:({open:e})=>(0,i.createElement)(d.ToolbarButton,{label:(0,o.__)("Edit Images","random-image-block"),icon:"edit",onClick:e})})))))},b=()=>(0,i.createElement)("div",{className:"ud-upgrade"},(0,i.createElement)("p",null,(0,o.__)("Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too","random-image-block-for-block-editor")," "," ",(0,i.createElement)("a",{href:"https://ultradevs.com/contact-us/",target:"_blank"},(0,o.__)("Here","random-image-block-for-block-editor"))),(0,i.createElement)("a",{href:ultraDevsRandomImageBlock.upgradeLink,target:"_blank",rel:"noreferrer"},(0,o.__)("Upgrade Now","random-image-block-for-block-editor"))),s=({imageSizes:e,onChange:t})=>(0,i.createElement)("div",{className:"udb-image-size"},(0,i.createElement)(d.TabPanel,{className:"udb-image-size__tabs",activeClass:"active-tab",tabs:[{name:"desktop",title:"Desktop",className:"desktop-tab"},{name:"tablet",title:"Tablet",className:"tablet-tab"},{name:"mobile",title:"Mobile",className:"mobile-tab"}]},a=>"mobile"!==a.name&&"tablet"!==a.name||ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,i.createElement)("div",{className:"udb-image-size__tabs__content"},(0,i.createElement)("div",{className:"udb-image-size__tabs__content__width"},(0,i.createElement)("label",{htmlFor:"width"},"Width:"),(0,i.createElement)("input",{type:"number",id:"width",value:e[a.name].width,onChange:l=>t({...e,[a.name]:{...e[a.name],width:Number(l.target.value)}})}),(0,i.createElement)("select",{value:e[a.name].widthUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],widthUnit:l.target.value}})},(0,i.createElement)("option",{value:"%"},"%"),(0,i.createElement)("option",{value:"px"},"px"),(0,i.createElement)("option",{value:"em"},"em"),(0,i.createElement)("option",{value:"rem"},"rem"),(0,i.createElement)("option",{value:"vw"},"vw"))),(0,i.createElement)("div",{className:"udb-image-size__tabs__content__height"},(0,i.createElement)("label",{htmlFor:"height"},"Height:"),(0,i.createElement)("input",{type:"number",id:"height",value:e[a.name].height,onChange:l=>t({...e,[a.name]:{...e[a.name],height:Number(l.target.value)}})}),(0,i.createElement)("select",{value:e[a.name].heightUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],heightUnit:l.target.value}})},(0,i.createElement)("option",{value:"%"},"%"),(0,i.createElement)("option",{value:"px"},"px"),(0,i.createElement)("option",{value:"em"},"em"),(0,i.createElement)("option",{value:"rem"},"rem"),(0,i.createElement)("option",{value:"vh"},"vh")))):(0,i.createElement)(b,null))),u=e=>{const{attributes:t,setAttributes:a}=e,{images:l,imageSize:n,imageAlign:m,imageObjectFit:c,captionStyle:g,linkSettings:u}=t;return(0,i.createElement)(r.InspectorControls,null,(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Images","random-image-block-for-block-editor")},(0,i.createElement)(r.MediaUploadCheck,null,(0,i.createElement)(r.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:l.map(e=>e.id),onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));a({images:t})},render:({open:e})=>(0,i.createElement)(i.Fragment,null,l?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.Button,{label:(0,o.__)("Edit Images","random-image-block-for-block-editor"),icon:"edit",onClick:e},(0,o.__)("Open Gallery","random-image-block-for-block-editor")),(0,i.createElement)("div",{className:"random-image-block__images"},l.map(e=>(0,i.createElement)("div",{className:"random-image-block__images__image",key:e.id},(0,i.createElement)("div",{className:"random-image-block__images__image__action"},(0,i.createElement)(d.Button,{label:(0,o.__)("Remove Image","random-image-block-for-block-editor"),icon:"trash",onClick:()=>{const t=l.filter(t=>t.id!==e.id);a({images:t})}})),(0,i.createElement)("img",{src:e.url,alt:e.alt}))))):(0,i.createElement)(d.Button,{label:(0,o.__)("Select Images","random-image-block-for-block-editor"),icon:"edit",onClick:e}))}))),(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Image Setting","random-image-block-for-block-editor")},(0,i.createElement)(s,{imageSizes:n,onChange:e=>{a({imageSize:e})}}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Image Object Fit","random-image-block-for-block-editor"),value:c,options:[{label:(0,o.__)("","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Fill","random-image-block-for-block-editor"),value:"fill"},{label:(0,o.__)("Contain","random-image-block-for-block-editor"),value:"contain"},{label:(0,o.__)("Cover","random-image-block-for-block-editor"),value:"cover"},{label:(0,o.__)("Scale Down","random-image-block-for-block-editor"),value:"scale-down"},{label:(0,o.__)("Initial","random-image-block-for-block-editor"),value:"initial"},{label:(0,o.__)("Inherit","random-image-block-for-block-editor"),value:"inherit"}],onChange:e=>a({imageObjectFit:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("p",null,"Image Object Fit"),(0,i.createElement)(b,null))),(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Link Settings","random-image-block-for-block-editor")},(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Link To","random-image-block-for-block-editor"),value:u.enabled,options:[{label:(0,o.__)("None","random-image-block-for-block-editor"),value:"none"},{label:(0,o.__)("Attachment Page","random-image-block-for-block-editor"),value:"attachment"},{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:"custom"}],onChange:e=>a({linkSettings:{...u,enabled:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"custom"===u.enabled&&(0,i.createElement)(d.TextControl,{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:u.customUrl,onChange:e=>a({linkSettings:{...u,customUrl:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"none"!==u.enabled&&(0,i.createElement)(d.ToggleControl,{label:(0,o.__)("Open in new tab","random-image-block-for-block-editor"),checked:u.openInNewTab,onChange:e=>a({linkSettings:{...u,openInNewTab:e}})})),(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Caption Setting","random-image-block-for-block-editor")},(0,i.createElement)(d.__experimentalToggleGroupControl,{label:(0,o.__)("Image Text Alignment","random-image-block-for-block-editor"),className:"random-image-block__alignment",value:m,onChange:e=>a({imageAlign:e}),isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},(0,i.createElement)(d.__experimentalToggleGroupControlOption,{value:"left",label:(0,o.__)("Left","random-image-block-for-block-editor")}),(0,i.createElement)(d.__experimentalToggleGroupControlOption,{value:"center",label:(0,o.__)("Center","random-image-block-for-block-editor")}),(0,i.createElement)(d.__experimentalToggleGroupControlOption,{value:"right",label:(0,o.__)("Right","random-image-block-for-block-editor")})),(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Show Caption On","random-image-block-for-block-editor"),value:g.showCaptionOn,options:[{label:(0,o.__)("Default","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Hover","random-image-block-for-block-editor"),value:"hover"}],onChange:e=>a({captionStyle:{...g,showCaptionOn:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Caption Over Image?","random-image-block-for-block-editor"),value:g.captionOverlay.enabled,options:[{label:(0,o.__)("No","random-image-block-for-block-editor"),value:"no"},{label:(0,o.__)("Yes","random-image-block-for-block-editor"),value:"yes"}],onChange:e=>a({captionStyle:{...g,captionOverlay:{...g.captionOverlay,enabled:e}}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"yes"===g.captionOverlay.enabled&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.FocalPointPicker,{url:l[0]?.url,value:g.captionOverlay.position,onChange:e=>a({captionStyle:{...g,captionOverlay:{...g.captionOverlay,position:e}}})}))):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("p",null,"Caption Over Image?"),(0,i.createElement)(b,null))))};(0,l.registerBlockType)("ultradevs/random-image-block",{title:n.DD,description:n.h_,attributes:n.uK,icon:n.Kk,category:n.L1,keywords:[(0,o.__)("random image","random-image-block"),(0,o.__)("image","random-image-block"),(0,o.__)("random","random-image-block")],edit:function(e){const{attributes:t,setAttributes:a}=e,{images:l}=t;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(g,{attributes:t,setAttributes:a}),(0,i.createElement)(u,{attributes:t,setAttributes:a}),(0,i.createElement)("div",(0,r.useBlockProps)(),l.length?(0,i.createElement)(c(),{block:"ultradevs/random-image-block",attributes:t}):(0,i.createElement)(r.MediaPlaceholder,{multiple:!0,gallery:!0,icon:(0,i.createElement)(r.BlockIcon,{icon:"format-gallery"}),allowedTypes:["image"],labels:{title:(0,o.__)("Random Image","random-image-block"),instructions:(0,o.__)("Select Images","random-image-block")},onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));a({images:t})}})))},save:()=>null})}},a={};function l(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=(t,a,o,n)=>{if(!a){var i=1/0;for(d=0;d<e.length;d++){for(var[a,o,n]=e[d],r=!0,m=0;m<a.length;m++)(!1&n||i>=n)&&Object.keys(l.O).every(e=>l.O[e](a[m]))?a.splice(m--,1):(r=!1,n<i&&(i=n));if(r){e.splice(d--,1);var c=o();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,o,n]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,a)=>{var o,n,[i,r,m]=a,c=0;if(i.some(t=>0!==e[t])){for(o in r)l.o(r,o)&&(l.m[o]=r[o]);if(m)var d=m(l)}for(t&&t(a);c<i.length;c++)n=i[c],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(d)},a=globalThis.webpackChunkrandom_image_block=globalThis.webpackChunkrandom_image_block||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var o=l.O(void 0,[350],()=>l(411));o=l.O(o)})();
     1(()=>{"use strict";var e,t={411(e,t,a){const l=window.wp.blocks,o=window.wp.i18n,n=JSON.parse('{"DD":"Random Image Block","L1":"widgets","Kk":"image-flip-horizontal","h_":"Display random images from a gallery.","uK":{"images":{"type":"array","default":[]},"selectedImageIndex":{"type":"number","default":0},"imageAlign":{"type":"string","default":"center"},"imageObjectFit":{"type":"string","default":""},"captionStyle":{"type":"object","default":{"color":"#ffffff","fontSize":16,"fontSizeUnit":"px","showCaptionOn":"","captionOverlay":{"enabled":"no","position":{"x":0.5,"y":0.5}},"padding":{"desktop":{"top":"0px","right":"0px","bottom":"0px","left":"0px"},"tablet":{"top":"","right":"","bottom":"","left":""},"mobile":{"top":"","right":"","bottom":"","left":""}}}},"imageSize":{"type":"object","default":{"desktop":{"width":100,"widthUnit":"%","height":100,"heightUnit":"%"},"tablet":{"width":"","widthUnit":"%","height":"","heightUnit":"%"},"mobile":{"width":"","widthUnit":"%","height":"","heightUnit":"%"}}},"linkSettings":{"type":"object","default":{"enabled":"none","customUrl":"","openInNewTab":false}},"filterSettings":{"type":"object","default":{"grayscale":0,"blur":0,"brightness":100,"contrast":100,"saturate":100,"hueRotate":0}},"autoRefresh":{"type":"boolean","default":false},"refreshInterval":{"type":"number","default":5},"shuffleAnimation":{"type":"string","default":"fade"},"animationDuration":{"type":"number","default":500},"stickyMode":{"type":"boolean","default":false},"uniqueId":{"type":"string","default":""}}}'),r=window.wp.element,i=window.wp.blockEditor,m=window.wp.serverSideRender;var c=a.n(m);const g=window.wp.components,d=({attributes:e,setAttributes:t})=>{const{images:a,selectedImageIndex:l}=e;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.BlockControls,null,(0,r.createElement)(g.ToolbarGroup,null,a.length>1&&(0,r.createElement)(g.ToolbarButton,{label:(0,o.__)("Shuffle Image","random-image-block-for-block-editor"),icon:"randomize",onClick:()=>{if(a.length>1){let e;do{e=Math.floor(Math.random()*a.length)}while(e===l);t({selectedImageIndex:e})}}}),(0,r.createElement)(i.MediaUploadCheck,null,(0,r.createElement)(i.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:a.map(e=>e.id),onSelect:e=>{const a=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));t({images:a})},render:({open:e})=>(0,r.createElement)(g.ToolbarButton,{label:(0,o.__)("Edit Images","random-image-block"),icon:"edit",onClick:e})})))))},s=()=>(0,r.createElement)("div",{className:"ud-upgrade"},(0,r.createElement)("p",null,(0,o.__)("Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too","random-image-block-for-block-editor")," "," ",(0,r.createElement)("a",{href:"https://ultradevs.com/contact-us/",target:"_blank"},(0,o.__)("Here","random-image-block-for-block-editor"))),(0,r.createElement)("a",{href:ultraDevsRandomImageBlock.upgradeLink,target:"_blank",rel:"noreferrer"},(0,o.__)("Upgrade Now","random-image-block-for-block-editor"))),b=({imageSizes:e,onChange:t})=>(0,r.createElement)("div",{className:"udb-image-size"},(0,r.createElement)(g.TabPanel,{className:"udb-image-size__tabs",activeClass:"active-tab",tabs:[{name:"desktop",title:"Desktop",className:"desktop-tab"},{name:"tablet",title:"Tablet",className:"tablet-tab"},{name:"mobile",title:"Mobile",className:"mobile-tab"}]},a=>"mobile"!==a.name&&"tablet"!==a.name||ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)("div",{className:"udb-image-size__tabs__content"},(0,r.createElement)("div",{className:"udb-image-size__tabs__content__width"},(0,r.createElement)("label",{htmlFor:"width"},"Width:"),(0,r.createElement)("input",{type:"number",id:"width",value:e[a.name].width,onChange:l=>t({...e,[a.name]:{...e[a.name],width:Number(l.target.value)}})}),(0,r.createElement)("select",{value:e[a.name].widthUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],widthUnit:l.target.value}})},(0,r.createElement)("option",{value:"%"},"%"),(0,r.createElement)("option",{value:"px"},"px"),(0,r.createElement)("option",{value:"em"},"em"),(0,r.createElement)("option",{value:"rem"},"rem"),(0,r.createElement)("option",{value:"vw"},"vw"))),(0,r.createElement)("div",{className:"udb-image-size__tabs__content__height"},(0,r.createElement)("label",{htmlFor:"height"},"Height:"),(0,r.createElement)("input",{type:"number",id:"height",value:e[a.name].height,onChange:l=>t({...e,[a.name]:{...e[a.name],height:Number(l.target.value)}})}),(0,r.createElement)("select",{value:e[a.name].heightUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],heightUnit:l.target.value}})},(0,r.createElement)("option",{value:"%"},"%"),(0,r.createElement)("option",{value:"px"},"px"),(0,r.createElement)("option",{value:"em"},"em"),(0,r.createElement)("option",{value:"rem"},"rem"),(0,r.createElement)("option",{value:"vh"},"vh")))):(0,r.createElement)(s,null))),u=e=>{const{attributes:t,setAttributes:a}=e,{images:l,imageSize:n,imageAlign:m,imageObjectFit:c,captionStyle:d,linkSettings:u,filterSettings:_}=t;return(0,r.createElement)(i.InspectorControls,null,(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Images","random-image-block-for-block-editor")},(0,r.createElement)(i.MediaUploadCheck,null,(0,r.createElement)(i.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:l.map(e=>e.id),onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption,link:e.link})),l=e.length>1?Math.floor(Math.random()*e.length):0;a({images:t,selectedImageIndex:l})},render:({open:e})=>(0,r.createElement)(r.Fragment,null,l?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Edit Images","random-image-block-for-block-editor"),icon:"edit",onClick:e},(0,o.__)("Open Gallery","random-image-block-for-block-editor")),(0,r.createElement)("div",{className:"random-image-block__images"},l.map(e=>(0,r.createElement)("div",{className:"random-image-block__images__image",key:e.id},(0,r.createElement)("div",{className:"random-image-block__images__image__action"},(0,r.createElement)(g.Button,{label:(0,o.__)("Remove Image","random-image-block-for-block-editor"),icon:"trash",onClick:()=>{const t=l.filter(t=>t.id!==e.id);a({images:t})}})),(0,r.createElement)("img",{src:e.url,alt:e.alt}))))):(0,r.createElement)(g.Button,{label:(0,o.__)("Select Images","random-image-block-for-block-editor"),icon:"edit",onClick:e}))}))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Image Setting","random-image-block-for-block-editor")},(0,r.createElement)(b,{imageSizes:n,onChange:e=>{a({imageSize:e})}}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Image Object Fit","random-image-block-for-block-editor"),value:c,options:[{label:(0,o.__)("","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Fill","random-image-block-for-block-editor"),value:"fill"},{label:(0,o.__)("Contain","random-image-block-for-block-editor"),value:"contain"},{label:(0,o.__)("Cover","random-image-block-for-block-editor"),value:"cover"},{label:(0,o.__)("Scale Down","random-image-block-for-block-editor"),value:"scale-down"},{label:(0,o.__)("Initial","random-image-block-for-block-editor"),value:"initial"},{label:(0,o.__)("Inherit","random-image-block-for-block-editor"),value:"inherit"}],onChange:e=>a({imageObjectFit:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Image Object Fit"),(0,r.createElement)(s,null))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Link Settings","random-image-block-for-block-editor")},(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Link To","random-image-block-for-block-editor"),value:u.enabled,options:[{label:(0,o.__)("None","random-image-block-for-block-editor"),value:"none"},{label:(0,o.__)("Attachment Page","random-image-block-for-block-editor"),value:"attachment"},{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:"custom"}],onChange:e=>a({linkSettings:{...u,enabled:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"custom"===u.enabled&&(0,r.createElement)(g.TextControl,{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:u.customUrl,onChange:e=>a({linkSettings:{...u,customUrl:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"none"!==u.enabled&&(0,r.createElement)(g.ToggleControl,{label:(0,o.__)("Open in new tab","random-image-block-for-block-editor"),checked:u.openInNewTab,onChange:e=>a({linkSettings:{...u,openInNewTab:e}})})),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Image Filters","random-image-block-for-block-editor")},ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Grayscale","random-image-block-for-block-editor"),value:_.grayscale,onChange:e=>a({filterSettings:{..._,grayscale:e}}),min:0,max:100,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,grayscale:0}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Blur (px)","random-image-block-for-block-editor"),value:_.blur,onChange:e=>a({filterSettings:{..._,blur:e}}),min:0,max:20,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,blur:0}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Brightness (%)","random-image-block-for-block-editor"),value:_.brightness,onChange:e=>a({filterSettings:{..._,brightness:e}}),min:0,max:200,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,brightness:100}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Contrast (%)","random-image-block-for-block-editor"),value:_.contrast,onChange:e=>a({filterSettings:{..._,contrast:e}}),min:0,max:200,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,contrast:100}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Saturation (%)","random-image-block-for-block-editor"),value:_.saturate,onChange:e=>a({filterSettings:{..._,saturate:e}}),min:0,max:200,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,saturate:100}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Hue Rotate (deg)","random-image-block-for-block-editor"),value:_.hueRotate,onChange:e=>a({filterSettings:{..._,hueRotate:e}}),min:0,max:360,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,hueRotate:0}}),style:{marginTop:"24px"}})))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Image Object Fit"),(0,r.createElement)(s,null))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Shuffle Settings","random-image-block-for-block-editor")},ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.ToggleControl,{label:(0,o.__)("Auto-refresh","random-image-block-for-block-editor"),checked:t.autoRefresh,onChange:e=>a({autoRefresh:e})}),t.autoRefresh&&(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Refresh Interval (seconds)","random-image-block-for-block-editor"),value:t.refreshInterval,onChange:e=>a({refreshInterval:e}),min:1,max:60,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Shuffle Animation","random-image-block-for-block-editor"),value:t.shuffleAnimation,options:[{label:(0,o.__)("None","random-image-block-for-block-editor"),value:"none"},{label:(0,o.__)("Fade","random-image-block-for-block-editor"),value:"fade"},{label:(0,o.__)("Slide","random-image-block-for-block-editor"),value:"slide"},{label:(0,o.__)("Zoom","random-image-block-for-block-editor"),value:"zoom"}],onChange:e=>a({shuffleAnimation:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"none"!==t.shuffleAnimation&&(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Animation Duration (ms)","random-image-block-for-block-editor"),value:t.animationDuration,onChange:e=>a({animationDuration:e}),min:100,max:2e3,step:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,r.createElement)(g.ToggleControl,{label:(0,o.__)("Sticky Mode","random-image-block-for-block-editor"),help:(0,o.__)("Keep same random image for session duration using local storage.","random-image-block-for-block-editor"),checked:t.stickyMode,onChange:e=>a({stickyMode:e})})):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Image Object Fit"),(0,r.createElement)(s,null))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Caption Setting","random-image-block-for-block-editor")},(0,r.createElement)(g.__experimentalToggleGroupControl,{label:(0,o.__)("Image Text Alignment","random-image-block-for-block-editor"),className:"random-image-block__alignment",value:m,onChange:e=>a({imageAlign:e}),isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},(0,r.createElement)(g.__experimentalToggleGroupControlOption,{value:"left",label:(0,o.__)("Left","random-image-block-for-block-editor")}),(0,r.createElement)(g.__experimentalToggleGroupControlOption,{value:"center",label:(0,o.__)("Center","random-image-block-for-block-editor")}),(0,r.createElement)(g.__experimentalToggleGroupControlOption,{value:"right",label:(0,o.__)("Right","random-image-block-for-block-editor")})),(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Show Caption On","random-image-block-for-block-editor"),value:d.showCaptionOn,options:[{label:(0,o.__)("Default","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Hover","random-image-block-for-block-editor"),value:"hover"}],onChange:e=>a({captionStyle:{...d,showCaptionOn:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Caption Over Image?","random-image-block-for-block-editor"),value:d.captionOverlay.enabled,options:[{label:(0,o.__)("No","random-image-block-for-block-editor"),value:"no"},{label:(0,o.__)("Yes","random-image-block-for-block-editor"),value:"yes"}],onChange:e=>a({captionStyle:{...d,captionOverlay:{...d.captionOverlay,enabled:e}}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"yes"===d.captionOverlay.enabled&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.FocalPointPicker,{url:l[0]?.url,value:d.captionOverlay.position,onChange:e=>a({captionStyle:{...d,captionOverlay:{...d.captionOverlay,position:e}}})}))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Caption Over Image?"),(0,r.createElement)(s,null))))};(0,l.registerBlockType)("ultradevs/random-image-block",{title:n.DD,description:n.h_,attributes:n.uK,icon:n.Kk,category:n.L1,keywords:[(0,o.__)("random image","random-image-block"),(0,o.__)("image","random-image-block"),(0,o.__)("random","random-image-block")],edit:function(e){const{attributes:t,setAttributes:a}=e,{images:l,uniqueId:n}=t;return wp.element.useEffect(()=>{n||a({uniqueId:e.clientId})},[]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(d,{attributes:t,setAttributes:a}),(0,r.createElement)(u,{attributes:t,setAttributes:a}),(0,r.createElement)("div",(0,i.useBlockProps)(),l.length?(0,r.createElement)(c(),{block:"ultradevs/random-image-block",attributes:t}):(0,r.createElement)(i.MediaPlaceholder,{multiple:!0,gallery:!0,icon:(0,r.createElement)(i.BlockIcon,{icon:"format-gallery"}),allowedTypes:["image"],labels:{title:(0,o.__)("Random Image","random-image-block"),instructions:(0,o.__)("Select Images","random-image-block")},onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption})),l=e.length>1?Math.floor(Math.random()*e.length):0;a({images:t,selectedImageIndex:l})}})))},save:()=>null})}},a={};function l(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=(t,a,o,n)=>{if(!a){var r=1/0;for(g=0;g<e.length;g++){for(var[a,o,n]=e[g],i=!0,m=0;m<a.length;m++)(!1&n||r>=n)&&Object.keys(l.O).every(e=>l.O[e](a[m]))?a.splice(m--,1):(i=!1,n<r&&(r=n));if(i){e.splice(g--,1);var c=o();void 0!==c&&(t=c)}}return t}n=n||0;for(var g=e.length;g>0&&e[g-1][2]>n;g--)e[g]=e[g-1];e[g]=[a,o,n]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,a)=>{var o,n,[r,i,m]=a,c=0;if(r.some(t=>0!==e[t])){for(o in i)l.o(i,o)&&(l.m[o]=i[o]);if(m)var g=m(l)}for(t&&t(a);c<r.length;c++)n=r[c],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(g)},a=globalThis.webpackChunkrandom_image_block=globalThis.webpackChunkrandom_image_block||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var o=l.O(void 0,[350],()=>l(411));o=l.O(o)})();
  • random-image-block-for-block-editor/tags/1.1.0/build/style-index.css

    r3449156 r3461135  
    1 .ud-random-img-block-pro.ud-radmon-img-block-caption-over-img .ud-random-img-block__content{left:var(--ud-rib-overlay-position-x,50%);position:absolute;top:var(--ud-rib-overlay-position-y,50%);transform:translate(var(--ud-rib-overlay-position-t-y,-50%),var(--ud-rib-overlay-position-t-x,-50%));z-index:999}.ud-random-img-block-caption-on-hover{transition:all .3s ease-in-out}.ud-random-img-block-caption-on-hover .ud-random-img-block__content-caption{opacity:0;transition:all .3s ease-in-out;visibility:hidden}.ud-random-img-block-caption-on-hover:hover .ud-random-img-block__content-caption{opacity:1;visibility:visible}.ud-random-img-block__images{position:relative}.ud-random-img-block__images img{max-height:100%;max-width:100%}.ud-random-img-block__content figcaption{font-size:inherit;text-align:inherit!important}
     1.ud-random-img-block-pro.ud-radmon-img-block-caption-over-img .ud-random-img-block__content{left:var(--ud-rib-overlay-position-x,50%);position:absolute;top:var(--ud-rib-overlay-position-y,50%);transform:translate(var(--ud-rib-overlay-position-t-y,-50%),var(--ud-rib-overlay-position-t-x,-50%));z-index:999}.ud-random-img-block-caption-on-hover{transition:all .3s ease-in-out}.ud-random-img-block-caption-on-hover .ud-random-img-block__content-caption{opacity:0;transition:all .3s ease-in-out;visibility:hidden}.ud-random-img-block-caption-on-hover:hover .ud-random-img-block__content-caption{opacity:1;visibility:visible}.ud-random-img-block__images{overflow:hidden;position:relative}.ud-random-img-block__images img{max-height:100%;max-width:100%;transition:all var(--ud-rib-anim-duration,.5s) ease-in-out}.ud-random-img-block.animating{pointer-events:none}.ud-random-img-block.animating-fade .ud-random-img-block__images img{opacity:0}.ud-random-img-block.animating-slide .ud-random-img-block__images img{opacity:1}.ud-random-img-block.animating-zoom .ud-random-img-block__images img{opacity:0;transform:scale(1.1)}.ud-random-img-block__content figcaption{font-size:inherit;text-align:inherit!important}
  • random-image-block-for-block-editor/tags/1.1.0/includes/class-generate-css.php

    r2985580 r3461135  
    118118        $css .= ! empty( $this->attributes['imageObjectFit'] ) ? 'object-fit: ' . $this->attributes['imageObjectFit'] . '; ' : '';
    119119
     120        // Add CSS filters.
     121        if ( isset( $this->attributes['filterSettings'] ) ) {
     122            $filters = array();
     123
     124            if ( ! empty( $this->attributes['filterSettings']['grayscale'] ) && $this->attributes['filterSettings']['grayscale'] > 0 ) {
     125                $filters[] = 'grayscale(' . $this->attributes['filterSettings']['grayscale'] . '%)';
     126            }
     127            if ( ! empty( $this->attributes['filterSettings']['blur'] ) && $this->attributes['filterSettings']['blur'] > 0 ) {
     128                $filters[] = 'blur(' . $this->attributes['filterSettings']['blur'] . 'px)';
     129            }
     130            if ( isset( $this->attributes['filterSettings']['brightness'] ) && $this->attributes['filterSettings']['brightness'] != 100 ) {
     131                $filters[] = 'brightness(' . $this->attributes['filterSettings']['brightness'] . '%)';
     132            }
     133            if ( isset( $this->attributes['filterSettings']['contrast'] ) && $this->attributes['filterSettings']['contrast'] != 100 ) {
     134                $filters[] = 'contrast(' . $this->attributes['filterSettings']['contrast'] . '%)';
     135            }
     136            if ( isset( $this->attributes['filterSettings']['saturate'] ) && $this->attributes['filterSettings']['saturate'] != 100 ) {
     137                $filters[] = 'saturate(' . $this->attributes['filterSettings']['saturate'] . '%)';
     138            }
     139            if ( ! empty( $this->attributes['filterSettings']['hueRotate'] ) && $this->attributes['filterSettings']['hueRotate'] > 0 ) {
     140                $filters[] = 'hue-rotate(' . $this->attributes['filterSettings']['hueRotate'] . 'deg)';
     141            }
     142
     143            if ( ! empty( $filters ) ) {
     144                $css .= 'filter: ' . implode( ' ', $filters ) . '; ';
     145            }
     146        }
     147
    120148        $css .= '}';
    121149
  • random-image-block-for-block-editor/tags/1.1.0/languages/random-image-block-for-block-editor.pot

    r3224694 r3461135  
    1 # Copyright (C) 2025 ultraDevs
     1# Copyright (C) 2026 ultraDevs
    22# This file is distributed under the GPL-2.0-or-later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Random Image Block for Block Editor 1.0.4\n"
     5"Project-Id-Version: Random Image Block for Block Editor 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/random-imaage-block\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-01-18T01:29:11+00:00\n"
     12"POT-Creation-Date: 2026-02-14T00:48:28+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.11.0\n"
     14"X-Generator: WP-CLI 2.10.0\n"
    1515"X-Domain: random-image-block-for-block-editor\n"
    1616
     
    3535msgstr ""
    3636
    37 #: random-image-block.php:171
    38 #: random-image-block.php:190
     37#: random-image-block.php:219
     38#: random-image-block.php:238
    3939msgid "Random Image Block Settings"
    4040msgstr ""
    4141
    42 #: random-image-block.php:172
     42#: random-image-block.php:220
    4343msgid "Random Image Block"
    4444msgstr ""
    4545
    46 #: random-image-block.php:191
     46#: random-image-block.php:239
    4747msgid "This plugin is developed by ultraDevs. If you need any help, please contact with us"
    4848msgstr ""
    4949
    50 #: random-image-block.php:192
     50#: random-image-block.php:240
    5151msgid "Contact"
    5252msgstr ""
    5353
    54 #: random-image-block.php:193
     54#: random-image-block.php:241
    5555msgid "If you like this plugin, please leave us a 5 star review on WordPress.org"
    5656msgstr ""
    5757
    58 #: random-image-block.php:194
     58#: random-image-block.php:242
    5959msgid "Review"
    6060msgstr ""
    6161
    62 #: random-image-block.php:195
     62#: random-image-block.php:243
    6363msgid "If you want to upgrade to pro version, please click on the button below"
    6464msgstr ""
    6565
    66 #: random-image-block.php:200
     66#: random-image-block.php:248
    6767msgid "My Account"
    6868msgstr ""
    6969
    70 #: random-image-block.php:204
     70#: random-image-block.php:252
    7171msgid "Upgrade to Pro"
    7272msgstr ""
    7373
    74 #: build/index.js:228
    75 #: src/Inspector.js:27
    76 #: build/index.js:169
     74#: build/index.js:1
     75#: src/Controls.js:31
     76msgid "Shuffle Image"
     77msgstr ""
     78
     79#: build/index.js:1
     80#: src/helper/UpgradeMessage.js:7
     81msgid "Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too"
     82msgstr ""
     83
     84#: build/index.js:1
     85#: src/helper/UpgradeMessage.js:9
     86msgid "Here"
     87msgstr ""
     88
     89#: build/index.js:1
     90#: src/helper/UpgradeMessage.js:13
     91msgid "Upgrade Now"
     92msgstr ""
     93
     94#: build/index.js:1
     95#: src/Inspector.js:32
    7796msgid "Images"
    7897msgstr ""
    7998
    80 #: build/index.js:253
    81 #: src/Inspector.js:53
    82 #: build/index.js:195
     99#: build/index.js:1
     100#: src/Inspector.js:60
    83101msgid "Edit Images"
    84102msgstr ""
    85103
    86 #: build/index.js:256
    87 #: src/Inspector.js:57
    88 #: build/index.js:199
     104#: build/index.js:1
     105#: src/Inspector.js:64
    89106msgid "Open Gallery"
    90107msgstr ""
    91108
    92 #: build/index.js:265
    93 #: src/Inspector.js:66
    94 #: build/index.js:208
     109#: build/index.js:1
     110#: src/Inspector.js:73
    95111msgid "Remove Image"
    96112msgstr ""
    97113
    98 #: build/index.js:278
    99 #: src/Inspector.js:83
    100 #: build/index.js:225
     114#: build/index.js:1
     115#: src/Inspector.js:90
    101116msgid "Select Images"
    102117msgstr ""
    103118
    104 #: build/index.js:284
    105 #: src/Inspector.js:95
    106 #: build/index.js:237
     119#: build/index.js:1
     120#: src/Inspector.js:102
    107121msgid "Image Setting"
    108122msgstr ""
    109123
    110 #: build/index.js:293
    111 #: src/Inspector.js:114
    112 #: build/index.js:256
     124#: build/index.js:1
     125#: src/Inspector.js:121
    113126msgid "Image Object Fit"
    114127msgstr ""
    115128
    116 #: build/index.js:299
    117 #: src/Inspector.js:118
    118 #: build/index.js:260
     129#: build/index.js:1
     130#: src/Inspector.js:125
    119131msgid "Fill"
    120132msgstr ""
    121133
    122 #: build/index.js:302
    123 #: src/Inspector.js:119
    124 #: build/index.js:261
     134#: build/index.js:1
     135#: src/Inspector.js:126
    125136msgid "Contain"
    126137msgstr ""
    127138
    128 #: build/index.js:305
    129 #: src/Inspector.js:120
    130 #: build/index.js:262
     139#: build/index.js:1
     140#: src/Inspector.js:127
    131141msgid "Cover"
    132142msgstr ""
    133143
    134 #: build/index.js:308
    135 #: src/Inspector.js:121
    136 #: build/index.js:263
     144#: build/index.js:1
     145#: src/Inspector.js:128
    137146msgid "Scale Down"
    138147msgstr ""
    139148
    140 #: build/index.js:311
    141 #: src/Inspector.js:122
    142 #: build/index.js:264
     149#: build/index.js:1
     150#: src/Inspector.js:129
    143151msgid "Initial"
    144152msgstr ""
    145153
    146 #: build/index.js:314
    147 #: src/Inspector.js:123
    148 #: build/index.js:265
     154#: build/index.js:1
     155#: src/Inspector.js:130
    149156msgid "Inherit"
    150157msgstr ""
    151158
    152 #: build/index.js:321
    153 #: src/Inspector.js:130
    154 #: build/index.js:272
     159#: build/index.js:1
     160#: src/Inspector.js:139
     161msgid "Link Settings"
     162msgstr ""
     163
     164#: build/index.js:1
     165#: src/Inspector.js:141
     166msgid "Link To"
     167msgstr ""
     168
     169#: build/index.js:1
     170#: src/Inspector.js:144
     171#: src/Inspector.js:354
     172msgid "None"
     173msgstr ""
     174
     175#: build/index.js:1
     176#: src/Inspector.js:145
     177msgid "Attachment Page"
     178msgstr ""
     179
     180#: build/index.js:1
     181#: src/Inspector.js:146
     182#: src/Inspector.js:154
     183msgid "Custom URL"
     184msgstr ""
     185
     186#: build/index.js:1
     187#: src/Inspector.js:163
     188msgid "Open in new tab"
     189msgstr ""
     190
     191#: build/index.js:1
     192#: src/Inspector.js:169
     193msgid "Image Filters"
     194msgstr ""
     195
     196#: build/index.js:1
     197#: src/Inspector.js:182
     198msgid "Grayscale"
     199msgstr ""
     200
     201#: build/index.js:1
     202#: src/Inspector.js:192
     203#: src/Inspector.js:216
     204#: src/Inspector.js:240
     205#: src/Inspector.js:264
     206#: src/Inspector.js:288
     207#: src/Inspector.js:312
     208msgid "Reset"
     209msgstr ""
     210
     211#: build/index.js:1
     212#: src/Inspector.js:206
     213msgid "Blur (px)"
     214msgstr ""
     215
     216#: build/index.js:1
     217#: src/Inspector.js:230
     218msgid "Brightness (%)"
     219msgstr ""
     220
     221#: build/index.js:1
     222#: src/Inspector.js:254
     223msgid "Contrast (%)"
     224msgstr ""
     225
     226#: build/index.js:1
     227#: src/Inspector.js:278
     228msgid "Saturation (%)"
     229msgstr ""
     230
     231#: build/index.js:1
     232#: src/Inspector.js:302
     233msgid "Hue Rotate (deg)"
     234msgstr ""
     235
     236#: build/index.js:1
     237#: src/Inspector.js:325
     238msgid "Shuffle Settings"
     239msgstr ""
     240
     241#: build/index.js:1
     242#: src/Inspector.js:335
     243msgid "Auto-refresh"
     244msgstr ""
     245
     246#: build/index.js:1
     247#: src/Inspector.js:341
     248msgid "Refresh Interval (seconds)"
     249msgstr ""
     250
     251#: build/index.js:1
     252#: src/Inspector.js:351
     253msgid "Shuffle Animation"
     254msgstr ""
     255
     256#: build/index.js:1
     257#: src/Inspector.js:355
     258msgid "Fade"
     259msgstr ""
     260
     261#: build/index.js:1
     262#: src/Inspector.js:356
     263msgid "Slide"
     264msgstr ""
     265
     266#: build/index.js:1
     267#: src/Inspector.js:357
     268msgid "Zoom"
     269msgstr ""
     270
     271#: build/index.js:1
     272#: src/Inspector.js:365
     273msgid "Animation Duration (ms)"
     274msgstr ""
     275
     276#: build/index.js:1
     277#: src/Inspector.js:376
     278msgid "Sticky Mode"
     279msgstr ""
     280
     281#: build/index.js:1
     282#: src/Inspector.js:377
     283msgid "Keep same random image for session duration using local storage."
     284msgstr ""
     285
     286#: build/index.js:1
     287#: src/Inspector.js:385
    155288msgid "Caption Setting"
    156289msgstr ""
    157290
    158 #: build/index.js:330
    159 #: src/Inspector.js:138
    160 #: build/index.js:280
     291#: build/index.js:1
     292#: src/Inspector.js:387
     293msgid "Image Text Alignment"
     294msgstr ""
     295
     296#: build/index.js:1
     297#: src/Inspector.js:395
    161298msgid "Left"
    162299msgstr ""
    163300
    164 #: build/index.js:336
    165 #: src/Inspector.js:145
    166 #: build/index.js:287
     301#: build/index.js:1
     302#: src/Inspector.js:396
    167303msgid "Center"
    168304msgstr ""
    169305
    170 #: build/index.js:342
    171 #: src/Inspector.js:152
    172 #: build/index.js:294
     306#: build/index.js:1
     307#: src/Inspector.js:397
    173308msgid "Right"
    174309msgstr ""
    175310
    176 #: build/index.js:343
    177 #: src/Inspector.js:156
    178 #: build/index.js:298
     311#: build/index.js:1
     312#: src/Inspector.js:400
    179313msgid "Show Caption On"
    180314msgstr ""
    181315
    182 #: build/index.js:346
    183 #: src/Inspector.js:159
    184 #: build/index.js:301
     316#: build/index.js:1
     317#: src/Inspector.js:403
    185318msgid "Default"
    186319msgstr ""
    187320
    188 #: build/index.js:349
    189 #: src/Inspector.js:160
    190 #: build/index.js:302
     321#: build/index.js:1
     322#: src/Inspector.js:404
    191323msgid "Hover"
    192324msgstr ""
    193325
    194 #: build/index.js:359
    195 #: src/Inspector.js:174
    196 #: build/index.js:316
     326#: build/index.js:1
     327#: src/Inspector.js:420
    197328msgid "Caption Over Image?"
    198329msgstr ""
    199330
    200 #: build/index.js:362
    201 #: src/Inspector.js:177
    202 #: build/index.js:319
     331#: build/index.js:1
     332#: src/Inspector.js:423
    203333msgid "No"
    204334msgstr ""
    205335
    206 #: build/index.js:365
    207 #: src/Inspector.js:178
    208 #: build/index.js:320
     336#: build/index.js:1
     337#: src/Inspector.js:424
    209338msgid "Yes"
    210339msgstr ""
    211 
    212 #: build/index.js:485
    213 #: src/helper/UpgradeMessage.js:7
    214 #: build/index.js:409
    215 msgid "Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too"
    216 msgstr ""
    217 
    218 #: build/index.js:488
    219 #: src/helper/UpgradeMessage.js:9
    220 #: build/index.js:411
    221 msgid "Here"
    222 msgstr ""
    223 
    224 #: build/index.js:492
    225 #: src/helper/UpgradeMessage.js:13
    226 #: build/index.js:415
    227 msgid "Upgrade Now"
    228 msgstr ""
  • random-image-block-for-block-editor/tags/1.1.0/random-image-block.php

    r3449156 r3461135  
    55 * Requires at least: 5.8
    66 * Requires PHP:      7.0
    7  * Version:           1.0.5
     7 * Version:           1.1.0
    88 * Author:            ultraDevs
    99 * Author URI:        https://ultradevs.com
     
    121121            [ 'ud-random-img-block-pro' => udrib_fs()->is_plan( 'pro' ) ],
    122122            [
    123                 'ud-random-img-block-caption-on-hover' => $attributes['captionStyle']['showCaptionOn'] && 'hover' === $attributes['captionStyle']['showCaptionOn']
     123                'ud-random-img-block-caption-on-hover' => isset( $attributes['captionStyle']['showCaptionOn'] ) && 'hover' === $attributes['captionStyle']['showCaptionOn']
    124124            ],
    125125            [
    126                 'ud-radmon-img-block-caption-over-img' => $attributes['captionStyle']['captionOverlay']["enabled"] && 'yes' === $attributes['captionStyle']['captionOverlay']["enabled"]
     126                'ud-radmon-img-block-caption-over-img' => isset( $attributes['captionStyle']['captionOverlay']["enabled"] ) && 'yes' === $attributes['captionStyle']['captionOverlay']["enabled"]
    127127            ]
    128128        ),
    129         'style' => '--ud-rib-overlay-position-x:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-y:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';--ud-rib-overlay-position-t-x:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-t-y:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';'
     129        'style' => '--ud-rib-overlay-position-x:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-y:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';--ud-rib-overlay-position-t-x:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-t-y:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';',
     130        'data-images'               => wp_json_encode( $attributes['images'] ),
     131        'data-anim-enabled'         => ( isset( $attributes['shuffleAnimation'] ) && 'none' !== $attributes['shuffleAnimation'] ) ? 'yes' : 'no',
     132        'data-anim-type'            => isset( $attributes['shuffleAnimation'] ) ? $attributes['shuffleAnimation'] : 'none',
     133        'data-anim-duration'        => isset( $attributes['animationDuration'] ) ? $attributes['animationDuration'] : 500,
     134        'data-auto-refresh-enabled' => ( isset( $attributes['autoRefresh'] ) && $attributes['autoRefresh'] ) ? 'true' : 'false',
     135        'data-auto-refresh-interval'=> isset( $attributes['refreshInterval'] ) ? $attributes['refreshInterval'] : 5,
     136        'data-current-index'        => isset( $index ) ? $index : 0,
     137        'data-link-enabled'         => isset( $attributes['linkSettings']['enabled'] ) ? $attributes['linkSettings']['enabled'] : 'none',
     138        'data-sticky-mode'          => ( isset( $attributes['stickyMode'] ) && $attributes['stickyMode'] ) ? 'yes' : 'no',
     139        'data-unique-id'            => isset( $attributes['uniqueId'] ) ? $attributes['uniqueId'] : '',
    130140    ]);
    131141
     
    137147
    138148    $count    = count( $images );
    139     $index    = ( $count > 1 ) ? wp_rand( 0, $count - 1 ) : 0;
     149
     150    // Check if rendering in editor (via REST API for ServerSideRender).
     151    $is_editor_preview = defined( 'REST_REQUEST' ) && REST_REQUEST;
     152
     153    // Use stored index only in editor for consistency, always random on frontend.
     154    if ( $is_editor_preview && isset( $attributes['selectedImageIndex'] ) && $attributes['selectedImageIndex'] >= 0 && $attributes['selectedImageIndex'] < $count ) {
     155        $index = $attributes['selectedImageIndex'];
     156    } else {
     157        // Frontend always shows random image.
     158        $index = ( $count > 1 ) ? wp_rand( 0, $count - 1 ) : 0;
     159    }
     160
    140161    $content  = ( new UDRIB_Generate_CSS( $attributes ) )->css_output();
    141162    $content .= '<div '. $wrapper_attributes .'>';
  • random-image-block-for-block-editor/tags/1.1.0/readme.txt

    r3449156 r3461135  
    11=== Random Image Block for Block Editor ===
    22Contributors:      mhimon, ultradevs
    3 Tags:              random image block, random image, image block, block, gutenberg, gutenberg block
     3Tags:              random image block, random image, image block, block, gutenberg
    44Tested up to:      6.9
    5 Stable tag:        1.0.5
     5Stable tag:        1.1.0
    66License:           GPL-2.0-or-later
    77License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    1919* Compatible with desktop devices.
    2020* Easy-to-use Gutenberg block interface.
    21 
     21* **Link Options** (Attachment page, Custom URL).
    2222
    2323## Features (Pro Version)
     
    2626* Enhanced customization options for advanced users.
    2727* **Caption Over Image**
     28* **Image Shuffle Animations** (Fade, Slide, Zoom).
     29* **Auto-refresh Interval** functionality.
     30* **Sticky Mode** (Random Seed persistence via local storage).
     31* **Image Filters** (Grayscale, Blur, Brightness, etc.).
    2832* Priority support.
    2933
     
    4751
    4852== Changelog ==
     53
     54= 1.1.0 - 14 Feb 2026 =
     55* Added: Image Shuffle Animations (Fade, Slide, Zoom).
     56* Added: Auto-refresh Interval functionality.
     57* Added: Sticky Mode (Random Seed persistence via local storage).
     58* Added: Image Filters (Grayscale, Blur, Brightness, Contrast, Saturation, Hue Rotate).
     59* Added: Link Options (Attachment page, Custom URL).
    4960
    5061= 1.0.5 - 18 Jan 2025 =
  • random-image-block-for-block-editor/trunk/.distignore

    r3449156 r3461135  
    3535*.spec.js
    3636coverage
     37
     38.wordpress-org/banner-772x250.html
     39.wordpress-org/banner-1544x500.html
     40.wordpress-org/README.md
  • random-image-block-for-block-editor/trunk/FEATURES.md

    r3449156 r3461135  
    88
    99### 1. Link Options
    10 - [ ] Link to attachment page
    11 - [ ] Link to custom URL
     10- [x] Link to attachment page
     11- [x] Link to custom URL
    1212- [ ] Lightbox/Modal integration
    13 - [ ] Open in new tab option
     13- [x] Open in new tab option
    1414
    1515### 2. Image Shuffle Animation
    16 - [ ] Fade transition
    17 - [ ] Slide transition
    18 - [ ] Zoom transition
    19 - [ ] Transition duration control
     16- [x] Fade transition
     17- [x] Slide transition
     18- [x] Zoom transition
     19- [x] Transition duration control
    2020
    2121### 3. Auto-refresh Interval
    22 - [ ] Auto-rotate images every X seconds
    23 - [ ] Enable/disable toggle
    24 - [ ] Custom time interval (seconds)
     22- [x] Auto-rotate images every X seconds
     23- [x] Enable/disable toggle
     24- [x] Custom time interval (seconds)
    2525
    2626### 4. Image Filters (CSS)
    27 - [ ] Grayscale
    28 - [ ] Blur
    29 - [ ] Brightness
    30 - [ ] Contrast
    31 - [ ] Saturation
    32 - [ ] Hue Rotate
     27- [x] Grayscale
     28- [x] Blur
     29- [x] Brightness
     30- [x] Contrast
     31- [x] Saturation
     32- [x] Hue Rotate
    3333
    3434### 5. Random Seed/Sticky Mode
    35 - [ ] Keep same random image for session duration
    36 - [ ] Cookie-based persistence
    37 - [ ] Local storage option
     35- [x] Keep same random image for session duration
     36- [x] Cookie-based persistence (using Local Storage)
     37- [x] Local storage option
    3838
    3939---
  • random-image-block-for-block-editor/trunk/build/block.json

    r3449156 r3461135  
    4747      "type": "array",
    4848      "default": []
     49    },
     50    "selectedImageIndex": {
     51      "type": "number",
     52      "default": 0
    4953    },
    5054    "imageAlign": {
     
    122126        "openInNewTab": false
    123127      }
     128    },
     129    "filterSettings": {
     130      "type": "object",
     131      "default": {
     132        "grayscale": 0,
     133        "blur": 0,
     134        "brightness": 100,
     135        "contrast": 100,
     136        "saturate": 100,
     137        "hueRotate": 0
     138      }
     139    },
     140    "autoRefresh": {
     141      "type": "boolean",
     142      "default": false
     143    },
     144    "refreshInterval": {
     145      "type": "number",
     146      "default": 5
     147    },
     148    "shuffleAnimation": {
     149      "type": "string",
     150      "default": "fade"
     151    },
     152    "animationDuration": {
     153      "type": "number",
     154      "default": 500
     155    },
     156    "stickyMode": {
     157      "type": "boolean",
     158      "default": false
     159    },
     160    "uniqueId": {
     161      "type": "string",
     162      "default": ""
    124163    }
    125164  },
     
    127166  "editorScript": "file:./index.js",
    128167  "editorStyle": "file:./index.css",
    129   "style": "file:./style-index.css"
     168  "style": "file:./style-index.css",
     169  "viewScript": "file:./frontend.js"
    130170}
  • random-image-block-for-block-editor/trunk/build/index.asset.php

    r3449156 r3461135  
    1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'dd9bc390fd6f5685dae6');
     1<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '512cd438f6840c0b4013');
  • random-image-block-for-block-editor/trunk/build/index.js

    r3449156 r3461135  
    1 (()=>{"use strict";var e,t={411(e,t,a){const l=window.wp.blocks,o=window.wp.i18n,n=JSON.parse('{"DD":"Random Image Block","L1":"widgets","Kk":"image-flip-horizontal","h_":"Display random images from a gallery.","uK":{"images":{"type":"array","default":[]},"imageAlign":{"type":"string","default":"center"},"imageObjectFit":{"type":"string","default":""},"captionStyle":{"type":"object","default":{"color":"#ffffff","fontSize":16,"fontSizeUnit":"px","showCaptionOn":"","captionOverlay":{"enabled":"no","position":{"x":0.5,"y":0.5}},"padding":{"desktop":{"top":"0px","right":"0px","bottom":"0px","left":"0px"},"tablet":{"top":"","right":"","bottom":"","left":""},"mobile":{"top":"","right":"","bottom":"","left":""}}}},"imageSize":{"type":"object","default":{"desktop":{"width":100,"widthUnit":"%","height":100,"heightUnit":"%"},"tablet":{"width":"","widthUnit":"%","height":"","heightUnit":"%"},"mobile":{"width":"","widthUnit":"%","height":"","heightUnit":"%"}}},"linkSettings":{"type":"object","default":{"enabled":"none","customUrl":"","openInNewTab":false}}}}'),i=window.wp.element,r=window.wp.blockEditor,m=window.wp.serverSideRender;var c=a.n(m);const d=window.wp.components,g=({attributes:e,setAttributes:t})=>{const{images:a}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(r.BlockControls,null,(0,i.createElement)(d.ToolbarGroup,null,(0,i.createElement)(r.MediaUploadCheck,null,(0,i.createElement)(r.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:a.map(e=>e.id),onSelect:e=>{const a=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));t({images:a})},render:({open:e})=>(0,i.createElement)(d.ToolbarButton,{label:(0,o.__)("Edit Images","random-image-block"),icon:"edit",onClick:e})})))))},b=()=>(0,i.createElement)("div",{className:"ud-upgrade"},(0,i.createElement)("p",null,(0,o.__)("Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too","random-image-block-for-block-editor")," "," ",(0,i.createElement)("a",{href:"https://ultradevs.com/contact-us/",target:"_blank"},(0,o.__)("Here","random-image-block-for-block-editor"))),(0,i.createElement)("a",{href:ultraDevsRandomImageBlock.upgradeLink,target:"_blank",rel:"noreferrer"},(0,o.__)("Upgrade Now","random-image-block-for-block-editor"))),s=({imageSizes:e,onChange:t})=>(0,i.createElement)("div",{className:"udb-image-size"},(0,i.createElement)(d.TabPanel,{className:"udb-image-size__tabs",activeClass:"active-tab",tabs:[{name:"desktop",title:"Desktop",className:"desktop-tab"},{name:"tablet",title:"Tablet",className:"tablet-tab"},{name:"mobile",title:"Mobile",className:"mobile-tab"}]},a=>"mobile"!==a.name&&"tablet"!==a.name||ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,i.createElement)("div",{className:"udb-image-size__tabs__content"},(0,i.createElement)("div",{className:"udb-image-size__tabs__content__width"},(0,i.createElement)("label",{htmlFor:"width"},"Width:"),(0,i.createElement)("input",{type:"number",id:"width",value:e[a.name].width,onChange:l=>t({...e,[a.name]:{...e[a.name],width:Number(l.target.value)}})}),(0,i.createElement)("select",{value:e[a.name].widthUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],widthUnit:l.target.value}})},(0,i.createElement)("option",{value:"%"},"%"),(0,i.createElement)("option",{value:"px"},"px"),(0,i.createElement)("option",{value:"em"},"em"),(0,i.createElement)("option",{value:"rem"},"rem"),(0,i.createElement)("option",{value:"vw"},"vw"))),(0,i.createElement)("div",{className:"udb-image-size__tabs__content__height"},(0,i.createElement)("label",{htmlFor:"height"},"Height:"),(0,i.createElement)("input",{type:"number",id:"height",value:e[a.name].height,onChange:l=>t({...e,[a.name]:{...e[a.name],height:Number(l.target.value)}})}),(0,i.createElement)("select",{value:e[a.name].heightUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],heightUnit:l.target.value}})},(0,i.createElement)("option",{value:"%"},"%"),(0,i.createElement)("option",{value:"px"},"px"),(0,i.createElement)("option",{value:"em"},"em"),(0,i.createElement)("option",{value:"rem"},"rem"),(0,i.createElement)("option",{value:"vh"},"vh")))):(0,i.createElement)(b,null))),u=e=>{const{attributes:t,setAttributes:a}=e,{images:l,imageSize:n,imageAlign:m,imageObjectFit:c,captionStyle:g,linkSettings:u}=t;return(0,i.createElement)(r.InspectorControls,null,(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Images","random-image-block-for-block-editor")},(0,i.createElement)(r.MediaUploadCheck,null,(0,i.createElement)(r.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:l.map(e=>e.id),onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));a({images:t})},render:({open:e})=>(0,i.createElement)(i.Fragment,null,l?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.Button,{label:(0,o.__)("Edit Images","random-image-block-for-block-editor"),icon:"edit",onClick:e},(0,o.__)("Open Gallery","random-image-block-for-block-editor")),(0,i.createElement)("div",{className:"random-image-block__images"},l.map(e=>(0,i.createElement)("div",{className:"random-image-block__images__image",key:e.id},(0,i.createElement)("div",{className:"random-image-block__images__image__action"},(0,i.createElement)(d.Button,{label:(0,o.__)("Remove Image","random-image-block-for-block-editor"),icon:"trash",onClick:()=>{const t=l.filter(t=>t.id!==e.id);a({images:t})}})),(0,i.createElement)("img",{src:e.url,alt:e.alt}))))):(0,i.createElement)(d.Button,{label:(0,o.__)("Select Images","random-image-block-for-block-editor"),icon:"edit",onClick:e}))}))),(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Image Setting","random-image-block-for-block-editor")},(0,i.createElement)(s,{imageSizes:n,onChange:e=>{a({imageSize:e})}}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Image Object Fit","random-image-block-for-block-editor"),value:c,options:[{label:(0,o.__)("","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Fill","random-image-block-for-block-editor"),value:"fill"},{label:(0,o.__)("Contain","random-image-block-for-block-editor"),value:"contain"},{label:(0,o.__)("Cover","random-image-block-for-block-editor"),value:"cover"},{label:(0,o.__)("Scale Down","random-image-block-for-block-editor"),value:"scale-down"},{label:(0,o.__)("Initial","random-image-block-for-block-editor"),value:"initial"},{label:(0,o.__)("Inherit","random-image-block-for-block-editor"),value:"inherit"}],onChange:e=>a({imageObjectFit:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("p",null,"Image Object Fit"),(0,i.createElement)(b,null))),(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Link Settings","random-image-block-for-block-editor")},(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Link To","random-image-block-for-block-editor"),value:u.enabled,options:[{label:(0,o.__)("None","random-image-block-for-block-editor"),value:"none"},{label:(0,o.__)("Attachment Page","random-image-block-for-block-editor"),value:"attachment"},{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:"custom"}],onChange:e=>a({linkSettings:{...u,enabled:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"custom"===u.enabled&&(0,i.createElement)(d.TextControl,{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:u.customUrl,onChange:e=>a({linkSettings:{...u,customUrl:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"none"!==u.enabled&&(0,i.createElement)(d.ToggleControl,{label:(0,o.__)("Open in new tab","random-image-block-for-block-editor"),checked:u.openInNewTab,onChange:e=>a({linkSettings:{...u,openInNewTab:e}})})),(0,i.createElement)(d.PanelBody,{title:(0,o.__)("Caption Setting","random-image-block-for-block-editor")},(0,i.createElement)(d.__experimentalToggleGroupControl,{label:(0,o.__)("Image Text Alignment","random-image-block-for-block-editor"),className:"random-image-block__alignment",value:m,onChange:e=>a({imageAlign:e}),isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},(0,i.createElement)(d.__experimentalToggleGroupControlOption,{value:"left",label:(0,o.__)("Left","random-image-block-for-block-editor")}),(0,i.createElement)(d.__experimentalToggleGroupControlOption,{value:"center",label:(0,o.__)("Center","random-image-block-for-block-editor")}),(0,i.createElement)(d.__experimentalToggleGroupControlOption,{value:"right",label:(0,o.__)("Right","random-image-block-for-block-editor")})),(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Show Caption On","random-image-block-for-block-editor"),value:g.showCaptionOn,options:[{label:(0,o.__)("Default","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Hover","random-image-block-for-block-editor"),value:"hover"}],onChange:e=>a({captionStyle:{...g,showCaptionOn:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.SelectControl,{label:(0,o.__)("Caption Over Image?","random-image-block-for-block-editor"),value:g.captionOverlay.enabled,options:[{label:(0,o.__)("No","random-image-block-for-block-editor"),value:"no"},{label:(0,o.__)("Yes","random-image-block-for-block-editor"),value:"yes"}],onChange:e=>a({captionStyle:{...g,captionOverlay:{...g.captionOverlay,enabled:e}}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"yes"===g.captionOverlay.enabled&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.FocalPointPicker,{url:l[0]?.url,value:g.captionOverlay.position,onChange:e=>a({captionStyle:{...g,captionOverlay:{...g.captionOverlay,position:e}}})}))):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("p",null,"Caption Over Image?"),(0,i.createElement)(b,null))))};(0,l.registerBlockType)("ultradevs/random-image-block",{title:n.DD,description:n.h_,attributes:n.uK,icon:n.Kk,category:n.L1,keywords:[(0,o.__)("random image","random-image-block"),(0,o.__)("image","random-image-block"),(0,o.__)("random","random-image-block")],edit:function(e){const{attributes:t,setAttributes:a}=e,{images:l}=t;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(g,{attributes:t,setAttributes:a}),(0,i.createElement)(u,{attributes:t,setAttributes:a}),(0,i.createElement)("div",(0,r.useBlockProps)(),l.length?(0,i.createElement)(c(),{block:"ultradevs/random-image-block",attributes:t}):(0,i.createElement)(r.MediaPlaceholder,{multiple:!0,gallery:!0,icon:(0,i.createElement)(r.BlockIcon,{icon:"format-gallery"}),allowedTypes:["image"],labels:{title:(0,o.__)("Random Image","random-image-block"),instructions:(0,o.__)("Select Images","random-image-block")},onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));a({images:t})}})))},save:()=>null})}},a={};function l(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=(t,a,o,n)=>{if(!a){var i=1/0;for(d=0;d<e.length;d++){for(var[a,o,n]=e[d],r=!0,m=0;m<a.length;m++)(!1&n||i>=n)&&Object.keys(l.O).every(e=>l.O[e](a[m]))?a.splice(m--,1):(r=!1,n<i&&(i=n));if(r){e.splice(d--,1);var c=o();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,o,n]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,a)=>{var o,n,[i,r,m]=a,c=0;if(i.some(t=>0!==e[t])){for(o in r)l.o(r,o)&&(l.m[o]=r[o]);if(m)var d=m(l)}for(t&&t(a);c<i.length;c++)n=i[c],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(d)},a=globalThis.webpackChunkrandom_image_block=globalThis.webpackChunkrandom_image_block||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var o=l.O(void 0,[350],()=>l(411));o=l.O(o)})();
     1(()=>{"use strict";var e,t={411(e,t,a){const l=window.wp.blocks,o=window.wp.i18n,n=JSON.parse('{"DD":"Random Image Block","L1":"widgets","Kk":"image-flip-horizontal","h_":"Display random images from a gallery.","uK":{"images":{"type":"array","default":[]},"selectedImageIndex":{"type":"number","default":0},"imageAlign":{"type":"string","default":"center"},"imageObjectFit":{"type":"string","default":""},"captionStyle":{"type":"object","default":{"color":"#ffffff","fontSize":16,"fontSizeUnit":"px","showCaptionOn":"","captionOverlay":{"enabled":"no","position":{"x":0.5,"y":0.5}},"padding":{"desktop":{"top":"0px","right":"0px","bottom":"0px","left":"0px"},"tablet":{"top":"","right":"","bottom":"","left":""},"mobile":{"top":"","right":"","bottom":"","left":""}}}},"imageSize":{"type":"object","default":{"desktop":{"width":100,"widthUnit":"%","height":100,"heightUnit":"%"},"tablet":{"width":"","widthUnit":"%","height":"","heightUnit":"%"},"mobile":{"width":"","widthUnit":"%","height":"","heightUnit":"%"}}},"linkSettings":{"type":"object","default":{"enabled":"none","customUrl":"","openInNewTab":false}},"filterSettings":{"type":"object","default":{"grayscale":0,"blur":0,"brightness":100,"contrast":100,"saturate":100,"hueRotate":0}},"autoRefresh":{"type":"boolean","default":false},"refreshInterval":{"type":"number","default":5},"shuffleAnimation":{"type":"string","default":"fade"},"animationDuration":{"type":"number","default":500},"stickyMode":{"type":"boolean","default":false},"uniqueId":{"type":"string","default":""}}}'),r=window.wp.element,i=window.wp.blockEditor,m=window.wp.serverSideRender;var c=a.n(m);const g=window.wp.components,d=({attributes:e,setAttributes:t})=>{const{images:a,selectedImageIndex:l}=e;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.BlockControls,null,(0,r.createElement)(g.ToolbarGroup,null,a.length>1&&(0,r.createElement)(g.ToolbarButton,{label:(0,o.__)("Shuffle Image","random-image-block-for-block-editor"),icon:"randomize",onClick:()=>{if(a.length>1){let e;do{e=Math.floor(Math.random()*a.length)}while(e===l);t({selectedImageIndex:e})}}}),(0,r.createElement)(i.MediaUploadCheck,null,(0,r.createElement)(i.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:a.map(e=>e.id),onSelect:e=>{const a=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}));t({images:a})},render:({open:e})=>(0,r.createElement)(g.ToolbarButton,{label:(0,o.__)("Edit Images","random-image-block"),icon:"edit",onClick:e})})))))},s=()=>(0,r.createElement)("div",{className:"ud-upgrade"},(0,r.createElement)("p",null,(0,o.__)("Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too","random-image-block-for-block-editor")," "," ",(0,r.createElement)("a",{href:"https://ultradevs.com/contact-us/",target:"_blank"},(0,o.__)("Here","random-image-block-for-block-editor"))),(0,r.createElement)("a",{href:ultraDevsRandomImageBlock.upgradeLink,target:"_blank",rel:"noreferrer"},(0,o.__)("Upgrade Now","random-image-block-for-block-editor"))),b=({imageSizes:e,onChange:t})=>(0,r.createElement)("div",{className:"udb-image-size"},(0,r.createElement)(g.TabPanel,{className:"udb-image-size__tabs",activeClass:"active-tab",tabs:[{name:"desktop",title:"Desktop",className:"desktop-tab"},{name:"tablet",title:"Tablet",className:"tablet-tab"},{name:"mobile",title:"Mobile",className:"mobile-tab"}]},a=>"mobile"!==a.name&&"tablet"!==a.name||ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)("div",{className:"udb-image-size__tabs__content"},(0,r.createElement)("div",{className:"udb-image-size__tabs__content__width"},(0,r.createElement)("label",{htmlFor:"width"},"Width:"),(0,r.createElement)("input",{type:"number",id:"width",value:e[a.name].width,onChange:l=>t({...e,[a.name]:{...e[a.name],width:Number(l.target.value)}})}),(0,r.createElement)("select",{value:e[a.name].widthUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],widthUnit:l.target.value}})},(0,r.createElement)("option",{value:"%"},"%"),(0,r.createElement)("option",{value:"px"},"px"),(0,r.createElement)("option",{value:"em"},"em"),(0,r.createElement)("option",{value:"rem"},"rem"),(0,r.createElement)("option",{value:"vw"},"vw"))),(0,r.createElement)("div",{className:"udb-image-size__tabs__content__height"},(0,r.createElement)("label",{htmlFor:"height"},"Height:"),(0,r.createElement)("input",{type:"number",id:"height",value:e[a.name].height,onChange:l=>t({...e,[a.name]:{...e[a.name],height:Number(l.target.value)}})}),(0,r.createElement)("select",{value:e[a.name].heightUnit,onChange:l=>t({...e,[a.name]:{...e[a.name],heightUnit:l.target.value}})},(0,r.createElement)("option",{value:"%"},"%"),(0,r.createElement)("option",{value:"px"},"px"),(0,r.createElement)("option",{value:"em"},"em"),(0,r.createElement)("option",{value:"rem"},"rem"),(0,r.createElement)("option",{value:"vh"},"vh")))):(0,r.createElement)(s,null))),u=e=>{const{attributes:t,setAttributes:a}=e,{images:l,imageSize:n,imageAlign:m,imageObjectFit:c,captionStyle:d,linkSettings:u,filterSettings:_}=t;return(0,r.createElement)(i.InspectorControls,null,(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Images","random-image-block-for-block-editor")},(0,r.createElement)(i.MediaUploadCheck,null,(0,r.createElement)(i.MediaUpload,{multiple:!0,gallery:!0,addToGallery:!0,allowedTypes:["image"],value:l.map(e=>e.id),onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption,link:e.link})),l=e.length>1?Math.floor(Math.random()*e.length):0;a({images:t,selectedImageIndex:l})},render:({open:e})=>(0,r.createElement)(r.Fragment,null,l?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Edit Images","random-image-block-for-block-editor"),icon:"edit",onClick:e},(0,o.__)("Open Gallery","random-image-block-for-block-editor")),(0,r.createElement)("div",{className:"random-image-block__images"},l.map(e=>(0,r.createElement)("div",{className:"random-image-block__images__image",key:e.id},(0,r.createElement)("div",{className:"random-image-block__images__image__action"},(0,r.createElement)(g.Button,{label:(0,o.__)("Remove Image","random-image-block-for-block-editor"),icon:"trash",onClick:()=>{const t=l.filter(t=>t.id!==e.id);a({images:t})}})),(0,r.createElement)("img",{src:e.url,alt:e.alt}))))):(0,r.createElement)(g.Button,{label:(0,o.__)("Select Images","random-image-block-for-block-editor"),icon:"edit",onClick:e}))}))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Image Setting","random-image-block-for-block-editor")},(0,r.createElement)(b,{imageSizes:n,onChange:e=>{a({imageSize:e})}}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Image Object Fit","random-image-block-for-block-editor"),value:c,options:[{label:(0,o.__)("","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Fill","random-image-block-for-block-editor"),value:"fill"},{label:(0,o.__)("Contain","random-image-block-for-block-editor"),value:"contain"},{label:(0,o.__)("Cover","random-image-block-for-block-editor"),value:"cover"},{label:(0,o.__)("Scale Down","random-image-block-for-block-editor"),value:"scale-down"},{label:(0,o.__)("Initial","random-image-block-for-block-editor"),value:"initial"},{label:(0,o.__)("Inherit","random-image-block-for-block-editor"),value:"inherit"}],onChange:e=>a({imageObjectFit:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Image Object Fit"),(0,r.createElement)(s,null))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Link Settings","random-image-block-for-block-editor")},(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Link To","random-image-block-for-block-editor"),value:u.enabled,options:[{label:(0,o.__)("None","random-image-block-for-block-editor"),value:"none"},{label:(0,o.__)("Attachment Page","random-image-block-for-block-editor"),value:"attachment"},{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:"custom"}],onChange:e=>a({linkSettings:{...u,enabled:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"custom"===u.enabled&&(0,r.createElement)(g.TextControl,{label:(0,o.__)("Custom URL","random-image-block-for-block-editor"),value:u.customUrl,onChange:e=>a({linkSettings:{...u,customUrl:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"none"!==u.enabled&&(0,r.createElement)(g.ToggleControl,{label:(0,o.__)("Open in new tab","random-image-block-for-block-editor"),checked:u.openInNewTab,onChange:e=>a({linkSettings:{...u,openInNewTab:e}})})),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Image Filters","random-image-block-for-block-editor")},ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Grayscale","random-image-block-for-block-editor"),value:_.grayscale,onChange:e=>a({filterSettings:{..._,grayscale:e}}),min:0,max:100,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,grayscale:0}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Blur (px)","random-image-block-for-block-editor"),value:_.blur,onChange:e=>a({filterSettings:{..._,blur:e}}),min:0,max:20,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,blur:0}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Brightness (%)","random-image-block-for-block-editor"),value:_.brightness,onChange:e=>a({filterSettings:{..._,brightness:e}}),min:0,max:200,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,brightness:100}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Contrast (%)","random-image-block-for-block-editor"),value:_.contrast,onChange:e=>a({filterSettings:{..._,contrast:e}}),min:0,max:200,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,contrast:100}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Saturation (%)","random-image-block-for-block-editor"),value:_.saturate,onChange:e=>a({filterSettings:{..._,saturate:e}}),min:0,max:200,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,saturate:100}}),style:{marginTop:"24px"}}))),(0,r.createElement)(g.Flex,{align:"start",gap:"0"},(0,r.createElement)(g.FlexItem,{style:{flex:1}},(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Hue Rotate (deg)","random-image-block-for-block-editor"),value:_.hueRotate,onChange:e=>a({filterSettings:{..._,hueRotate:e}}),min:0,max:360,__next40pxDefaultSize:!0})),(0,r.createElement)(g.FlexItem,null,(0,r.createElement)(g.Button,{label:(0,o.__)("Reset","random-image-block-for-block-editor"),icon:"redo",isSmall:!0,isSecondary:!0,onClick:()=>a({filterSettings:{..._,hueRotate:0}}),style:{marginTop:"24px"}})))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Image Object Fit"),(0,r.createElement)(s,null))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Shuffle Settings","random-image-block-for-block-editor")},ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.ToggleControl,{label:(0,o.__)("Auto-refresh","random-image-block-for-block-editor"),checked:t.autoRefresh,onChange:e=>a({autoRefresh:e})}),t.autoRefresh&&(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Refresh Interval (seconds)","random-image-block-for-block-editor"),value:t.refreshInterval,onChange:e=>a({refreshInterval:e}),min:1,max:60,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Shuffle Animation","random-image-block-for-block-editor"),value:t.shuffleAnimation,options:[{label:(0,o.__)("None","random-image-block-for-block-editor"),value:"none"},{label:(0,o.__)("Fade","random-image-block-for-block-editor"),value:"fade"},{label:(0,o.__)("Slide","random-image-block-for-block-editor"),value:"slide"},{label:(0,o.__)("Zoom","random-image-block-for-block-editor"),value:"zoom"}],onChange:e=>a({shuffleAnimation:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"none"!==t.shuffleAnimation&&(0,r.createElement)(g.RangeControl,{label:(0,o.__)("Animation Duration (ms)","random-image-block-for-block-editor"),value:t.animationDuration,onChange:e=>a({animationDuration:e}),min:100,max:2e3,step:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,r.createElement)(g.ToggleControl,{label:(0,o.__)("Sticky Mode","random-image-block-for-block-editor"),help:(0,o.__)("Keep same random image for session duration using local storage.","random-image-block-for-block-editor"),checked:t.stickyMode,onChange:e=>a({stickyMode:e})})):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Image Object Fit"),(0,r.createElement)(s,null))),(0,r.createElement)(g.PanelBody,{title:(0,o.__)("Caption Setting","random-image-block-for-block-editor")},(0,r.createElement)(g.__experimentalToggleGroupControl,{label:(0,o.__)("Image Text Alignment","random-image-block-for-block-editor"),className:"random-image-block__alignment",value:m,onChange:e=>a({imageAlign:e}),isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},(0,r.createElement)(g.__experimentalToggleGroupControlOption,{value:"left",label:(0,o.__)("Left","random-image-block-for-block-editor")}),(0,r.createElement)(g.__experimentalToggleGroupControlOption,{value:"center",label:(0,o.__)("Center","random-image-block-for-block-editor")}),(0,r.createElement)(g.__experimentalToggleGroupControlOption,{value:"right",label:(0,o.__)("Right","random-image-block-for-block-editor")})),(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Show Caption On","random-image-block-for-block-editor"),value:d.showCaptionOn,options:[{label:(0,o.__)("Default","random-image-block-for-block-editor"),value:""},{label:(0,o.__)("Hover","random-image-block-for-block-editor"),value:"hover"}],onChange:e=>a({captionStyle:{...d,showCaptionOn:e}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),ultraDevsRandomImageBlock.licensing.is_plan_pro?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.SelectControl,{label:(0,o.__)("Caption Over Image?","random-image-block-for-block-editor"),value:d.captionOverlay.enabled,options:[{label:(0,o.__)("No","random-image-block-for-block-editor"),value:"no"},{label:(0,o.__)("Yes","random-image-block-for-block-editor"),value:"yes"}],onChange:e=>a({captionStyle:{...d,captionOverlay:{...d.captionOverlay,enabled:e}}}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"yes"===d.captionOverlay.enabled&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(g.FocalPointPicker,{url:l[0]?.url,value:d.captionOverlay.position,onChange:e=>a({captionStyle:{...d,captionOverlay:{...d.captionOverlay,position:e}}})}))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,"Caption Over Image?"),(0,r.createElement)(s,null))))};(0,l.registerBlockType)("ultradevs/random-image-block",{title:n.DD,description:n.h_,attributes:n.uK,icon:n.Kk,category:n.L1,keywords:[(0,o.__)("random image","random-image-block"),(0,o.__)("image","random-image-block"),(0,o.__)("random","random-image-block")],edit:function(e){const{attributes:t,setAttributes:a}=e,{images:l,uniqueId:n}=t;return wp.element.useEffect(()=>{n||a({uniqueId:e.clientId})},[]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(d,{attributes:t,setAttributes:a}),(0,r.createElement)(u,{attributes:t,setAttributes:a}),(0,r.createElement)("div",(0,i.useBlockProps)(),l.length?(0,r.createElement)(c(),{block:"ultradevs/random-image-block",attributes:t}):(0,r.createElement)(i.MediaPlaceholder,{multiple:!0,gallery:!0,icon:(0,r.createElement)(i.BlockIcon,{icon:"format-gallery"}),allowedTypes:["image"],labels:{title:(0,o.__)("Random Image","random-image-block"),instructions:(0,o.__)("Select Images","random-image-block")},onSelect:e=>{const t=e.map(e=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption})),l=e.length>1?Math.floor(Math.random()*e.length):0;a({images:t,selectedImageIndex:l})}})))},save:()=>null})}},a={};function l(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=(t,a,o,n)=>{if(!a){var r=1/0;for(g=0;g<e.length;g++){for(var[a,o,n]=e[g],i=!0,m=0;m<a.length;m++)(!1&n||r>=n)&&Object.keys(l.O).every(e=>l.O[e](a[m]))?a.splice(m--,1):(i=!1,n<r&&(r=n));if(i){e.splice(g--,1);var c=o();void 0!==c&&(t=c)}}return t}n=n||0;for(var g=e.length;g>0&&e[g-1][2]>n;g--)e[g]=e[g-1];e[g]=[a,o,n]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,a)=>{var o,n,[r,i,m]=a,c=0;if(r.some(t=>0!==e[t])){for(o in i)l.o(i,o)&&(l.m[o]=i[o]);if(m)var g=m(l)}for(t&&t(a);c<r.length;c++)n=r[c],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(g)},a=globalThis.webpackChunkrandom_image_block=globalThis.webpackChunkrandom_image_block||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var o=l.O(void 0,[350],()=>l(411));o=l.O(o)})();
  • random-image-block-for-block-editor/trunk/build/style-index.css

    r3449156 r3461135  
    1 .ud-random-img-block-pro.ud-radmon-img-block-caption-over-img .ud-random-img-block__content{left:var(--ud-rib-overlay-position-x,50%);position:absolute;top:var(--ud-rib-overlay-position-y,50%);transform:translate(var(--ud-rib-overlay-position-t-y,-50%),var(--ud-rib-overlay-position-t-x,-50%));z-index:999}.ud-random-img-block-caption-on-hover{transition:all .3s ease-in-out}.ud-random-img-block-caption-on-hover .ud-random-img-block__content-caption{opacity:0;transition:all .3s ease-in-out;visibility:hidden}.ud-random-img-block-caption-on-hover:hover .ud-random-img-block__content-caption{opacity:1;visibility:visible}.ud-random-img-block__images{position:relative}.ud-random-img-block__images img{max-height:100%;max-width:100%}.ud-random-img-block__content figcaption{font-size:inherit;text-align:inherit!important}
     1.ud-random-img-block-pro.ud-radmon-img-block-caption-over-img .ud-random-img-block__content{left:var(--ud-rib-overlay-position-x,50%);position:absolute;top:var(--ud-rib-overlay-position-y,50%);transform:translate(var(--ud-rib-overlay-position-t-y,-50%),var(--ud-rib-overlay-position-t-x,-50%));z-index:999}.ud-random-img-block-caption-on-hover{transition:all .3s ease-in-out}.ud-random-img-block-caption-on-hover .ud-random-img-block__content-caption{opacity:0;transition:all .3s ease-in-out;visibility:hidden}.ud-random-img-block-caption-on-hover:hover .ud-random-img-block__content-caption{opacity:1;visibility:visible}.ud-random-img-block__images{overflow:hidden;position:relative}.ud-random-img-block__images img{max-height:100%;max-width:100%;transition:all var(--ud-rib-anim-duration,.5s) ease-in-out}.ud-random-img-block.animating{pointer-events:none}.ud-random-img-block.animating-fade .ud-random-img-block__images img{opacity:0}.ud-random-img-block.animating-slide .ud-random-img-block__images img{opacity:1}.ud-random-img-block.animating-zoom .ud-random-img-block__images img{opacity:0;transform:scale(1.1)}.ud-random-img-block__content figcaption{font-size:inherit;text-align:inherit!important}
  • random-image-block-for-block-editor/trunk/includes/class-generate-css.php

    r2985580 r3461135  
    118118        $css .= ! empty( $this->attributes['imageObjectFit'] ) ? 'object-fit: ' . $this->attributes['imageObjectFit'] . '; ' : '';
    119119
     120        // Add CSS filters.
     121        if ( isset( $this->attributes['filterSettings'] ) ) {
     122            $filters = array();
     123
     124            if ( ! empty( $this->attributes['filterSettings']['grayscale'] ) && $this->attributes['filterSettings']['grayscale'] > 0 ) {
     125                $filters[] = 'grayscale(' . $this->attributes['filterSettings']['grayscale'] . '%)';
     126            }
     127            if ( ! empty( $this->attributes['filterSettings']['blur'] ) && $this->attributes['filterSettings']['blur'] > 0 ) {
     128                $filters[] = 'blur(' . $this->attributes['filterSettings']['blur'] . 'px)';
     129            }
     130            if ( isset( $this->attributes['filterSettings']['brightness'] ) && $this->attributes['filterSettings']['brightness'] != 100 ) {
     131                $filters[] = 'brightness(' . $this->attributes['filterSettings']['brightness'] . '%)';
     132            }
     133            if ( isset( $this->attributes['filterSettings']['contrast'] ) && $this->attributes['filterSettings']['contrast'] != 100 ) {
     134                $filters[] = 'contrast(' . $this->attributes['filterSettings']['contrast'] . '%)';
     135            }
     136            if ( isset( $this->attributes['filterSettings']['saturate'] ) && $this->attributes['filterSettings']['saturate'] != 100 ) {
     137                $filters[] = 'saturate(' . $this->attributes['filterSettings']['saturate'] . '%)';
     138            }
     139            if ( ! empty( $this->attributes['filterSettings']['hueRotate'] ) && $this->attributes['filterSettings']['hueRotate'] > 0 ) {
     140                $filters[] = 'hue-rotate(' . $this->attributes['filterSettings']['hueRotate'] . 'deg)';
     141            }
     142
     143            if ( ! empty( $filters ) ) {
     144                $css .= 'filter: ' . implode( ' ', $filters ) . '; ';
     145            }
     146        }
     147
    120148        $css .= '}';
    121149
  • random-image-block-for-block-editor/trunk/languages/random-image-block-for-block-editor.pot

    r3224694 r3461135  
    1 # Copyright (C) 2025 ultraDevs
     1# Copyright (C) 2026 ultraDevs
    22# This file is distributed under the GPL-2.0-or-later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Random Image Block for Block Editor 1.0.4\n"
     5"Project-Id-Version: Random Image Block for Block Editor 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/random-imaage-block\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-01-18T01:29:11+00:00\n"
     12"POT-Creation-Date: 2026-02-14T00:48:28+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.11.0\n"
     14"X-Generator: WP-CLI 2.10.0\n"
    1515"X-Domain: random-image-block-for-block-editor\n"
    1616
     
    3535msgstr ""
    3636
    37 #: random-image-block.php:171
    38 #: random-image-block.php:190
     37#: random-image-block.php:219
     38#: random-image-block.php:238
    3939msgid "Random Image Block Settings"
    4040msgstr ""
    4141
    42 #: random-image-block.php:172
     42#: random-image-block.php:220
    4343msgid "Random Image Block"
    4444msgstr ""
    4545
    46 #: random-image-block.php:191
     46#: random-image-block.php:239
    4747msgid "This plugin is developed by ultraDevs. If you need any help, please contact with us"
    4848msgstr ""
    4949
    50 #: random-image-block.php:192
     50#: random-image-block.php:240
    5151msgid "Contact"
    5252msgstr ""
    5353
    54 #: random-image-block.php:193
     54#: random-image-block.php:241
    5555msgid "If you like this plugin, please leave us a 5 star review on WordPress.org"
    5656msgstr ""
    5757
    58 #: random-image-block.php:194
     58#: random-image-block.php:242
    5959msgid "Review"
    6060msgstr ""
    6161
    62 #: random-image-block.php:195
     62#: random-image-block.php:243
    6363msgid "If you want to upgrade to pro version, please click on the button below"
    6464msgstr ""
    6565
    66 #: random-image-block.php:200
     66#: random-image-block.php:248
    6767msgid "My Account"
    6868msgstr ""
    6969
    70 #: random-image-block.php:204
     70#: random-image-block.php:252
    7171msgid "Upgrade to Pro"
    7272msgstr ""
    7373
    74 #: build/index.js:228
    75 #: src/Inspector.js:27
    76 #: build/index.js:169
     74#: build/index.js:1
     75#: src/Controls.js:31
     76msgid "Shuffle Image"
     77msgstr ""
     78
     79#: build/index.js:1
     80#: src/helper/UpgradeMessage.js:7
     81msgid "Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too"
     82msgstr ""
     83
     84#: build/index.js:1
     85#: src/helper/UpgradeMessage.js:9
     86msgid "Here"
     87msgstr ""
     88
     89#: build/index.js:1
     90#: src/helper/UpgradeMessage.js:13
     91msgid "Upgrade Now"
     92msgstr ""
     93
     94#: build/index.js:1
     95#: src/Inspector.js:32
    7796msgid "Images"
    7897msgstr ""
    7998
    80 #: build/index.js:253
    81 #: src/Inspector.js:53
    82 #: build/index.js:195
     99#: build/index.js:1
     100#: src/Inspector.js:60
    83101msgid "Edit Images"
    84102msgstr ""
    85103
    86 #: build/index.js:256
    87 #: src/Inspector.js:57
    88 #: build/index.js:199
     104#: build/index.js:1
     105#: src/Inspector.js:64
    89106msgid "Open Gallery"
    90107msgstr ""
    91108
    92 #: build/index.js:265
    93 #: src/Inspector.js:66
    94 #: build/index.js:208
     109#: build/index.js:1
     110#: src/Inspector.js:73
    95111msgid "Remove Image"
    96112msgstr ""
    97113
    98 #: build/index.js:278
    99 #: src/Inspector.js:83
    100 #: build/index.js:225
     114#: build/index.js:1
     115#: src/Inspector.js:90
    101116msgid "Select Images"
    102117msgstr ""
    103118
    104 #: build/index.js:284
    105 #: src/Inspector.js:95
    106 #: build/index.js:237
     119#: build/index.js:1
     120#: src/Inspector.js:102
    107121msgid "Image Setting"
    108122msgstr ""
    109123
    110 #: build/index.js:293
    111 #: src/Inspector.js:114
    112 #: build/index.js:256
     124#: build/index.js:1
     125#: src/Inspector.js:121
    113126msgid "Image Object Fit"
    114127msgstr ""
    115128
    116 #: build/index.js:299
    117 #: src/Inspector.js:118
    118 #: build/index.js:260
     129#: build/index.js:1
     130#: src/Inspector.js:125
    119131msgid "Fill"
    120132msgstr ""
    121133
    122 #: build/index.js:302
    123 #: src/Inspector.js:119
    124 #: build/index.js:261
     134#: build/index.js:1
     135#: src/Inspector.js:126
    125136msgid "Contain"
    126137msgstr ""
    127138
    128 #: build/index.js:305
    129 #: src/Inspector.js:120
    130 #: build/index.js:262
     139#: build/index.js:1
     140#: src/Inspector.js:127
    131141msgid "Cover"
    132142msgstr ""
    133143
    134 #: build/index.js:308
    135 #: src/Inspector.js:121
    136 #: build/index.js:263
     144#: build/index.js:1
     145#: src/Inspector.js:128
    137146msgid "Scale Down"
    138147msgstr ""
    139148
    140 #: build/index.js:311
    141 #: src/Inspector.js:122
    142 #: build/index.js:264
     149#: build/index.js:1
     150#: src/Inspector.js:129
    143151msgid "Initial"
    144152msgstr ""
    145153
    146 #: build/index.js:314
    147 #: src/Inspector.js:123
    148 #: build/index.js:265
     154#: build/index.js:1
     155#: src/Inspector.js:130
    149156msgid "Inherit"
    150157msgstr ""
    151158
    152 #: build/index.js:321
    153 #: src/Inspector.js:130
    154 #: build/index.js:272
     159#: build/index.js:1
     160#: src/Inspector.js:139
     161msgid "Link Settings"
     162msgstr ""
     163
     164#: build/index.js:1
     165#: src/Inspector.js:141
     166msgid "Link To"
     167msgstr ""
     168
     169#: build/index.js:1
     170#: src/Inspector.js:144
     171#: src/Inspector.js:354
     172msgid "None"
     173msgstr ""
     174
     175#: build/index.js:1
     176#: src/Inspector.js:145
     177msgid "Attachment Page"
     178msgstr ""
     179
     180#: build/index.js:1
     181#: src/Inspector.js:146
     182#: src/Inspector.js:154
     183msgid "Custom URL"
     184msgstr ""
     185
     186#: build/index.js:1
     187#: src/Inspector.js:163
     188msgid "Open in new tab"
     189msgstr ""
     190
     191#: build/index.js:1
     192#: src/Inspector.js:169
     193msgid "Image Filters"
     194msgstr ""
     195
     196#: build/index.js:1
     197#: src/Inspector.js:182
     198msgid "Grayscale"
     199msgstr ""
     200
     201#: build/index.js:1
     202#: src/Inspector.js:192
     203#: src/Inspector.js:216
     204#: src/Inspector.js:240
     205#: src/Inspector.js:264
     206#: src/Inspector.js:288
     207#: src/Inspector.js:312
     208msgid "Reset"
     209msgstr ""
     210
     211#: build/index.js:1
     212#: src/Inspector.js:206
     213msgid "Blur (px)"
     214msgstr ""
     215
     216#: build/index.js:1
     217#: src/Inspector.js:230
     218msgid "Brightness (%)"
     219msgstr ""
     220
     221#: build/index.js:1
     222#: src/Inspector.js:254
     223msgid "Contrast (%)"
     224msgstr ""
     225
     226#: build/index.js:1
     227#: src/Inspector.js:278
     228msgid "Saturation (%)"
     229msgstr ""
     230
     231#: build/index.js:1
     232#: src/Inspector.js:302
     233msgid "Hue Rotate (deg)"
     234msgstr ""
     235
     236#: build/index.js:1
     237#: src/Inspector.js:325
     238msgid "Shuffle Settings"
     239msgstr ""
     240
     241#: build/index.js:1
     242#: src/Inspector.js:335
     243msgid "Auto-refresh"
     244msgstr ""
     245
     246#: build/index.js:1
     247#: src/Inspector.js:341
     248msgid "Refresh Interval (seconds)"
     249msgstr ""
     250
     251#: build/index.js:1
     252#: src/Inspector.js:351
     253msgid "Shuffle Animation"
     254msgstr ""
     255
     256#: build/index.js:1
     257#: src/Inspector.js:355
     258msgid "Fade"
     259msgstr ""
     260
     261#: build/index.js:1
     262#: src/Inspector.js:356
     263msgid "Slide"
     264msgstr ""
     265
     266#: build/index.js:1
     267#: src/Inspector.js:357
     268msgid "Zoom"
     269msgstr ""
     270
     271#: build/index.js:1
     272#: src/Inspector.js:365
     273msgid "Animation Duration (ms)"
     274msgstr ""
     275
     276#: build/index.js:1
     277#: src/Inspector.js:376
     278msgid "Sticky Mode"
     279msgstr ""
     280
     281#: build/index.js:1
     282#: src/Inspector.js:377
     283msgid "Keep same random image for session duration using local storage."
     284msgstr ""
     285
     286#: build/index.js:1
     287#: src/Inspector.js:385
    155288msgid "Caption Setting"
    156289msgstr ""
    157290
    158 #: build/index.js:330
    159 #: src/Inspector.js:138
    160 #: build/index.js:280
     291#: build/index.js:1
     292#: src/Inspector.js:387
     293msgid "Image Text Alignment"
     294msgstr ""
     295
     296#: build/index.js:1
     297#: src/Inspector.js:395
    161298msgid "Left"
    162299msgstr ""
    163300
    164 #: build/index.js:336
    165 #: src/Inspector.js:145
    166 #: build/index.js:287
     301#: build/index.js:1
     302#: src/Inspector.js:396
    167303msgid "Center"
    168304msgstr ""
    169305
    170 #: build/index.js:342
    171 #: src/Inspector.js:152
    172 #: build/index.js:294
     306#: build/index.js:1
     307#: src/Inspector.js:397
    173308msgid "Right"
    174309msgstr ""
    175310
    176 #: build/index.js:343
    177 #: src/Inspector.js:156
    178 #: build/index.js:298
     311#: build/index.js:1
     312#: src/Inspector.js:400
    179313msgid "Show Caption On"
    180314msgstr ""
    181315
    182 #: build/index.js:346
    183 #: src/Inspector.js:159
    184 #: build/index.js:301
     316#: build/index.js:1
     317#: src/Inspector.js:403
    185318msgid "Default"
    186319msgstr ""
    187320
    188 #: build/index.js:349
    189 #: src/Inspector.js:160
    190 #: build/index.js:302
     321#: build/index.js:1
     322#: src/Inspector.js:404
    191323msgid "Hover"
    192324msgstr ""
    193325
    194 #: build/index.js:359
    195 #: src/Inspector.js:174
    196 #: build/index.js:316
     326#: build/index.js:1
     327#: src/Inspector.js:420
    197328msgid "Caption Over Image?"
    198329msgstr ""
    199330
    200 #: build/index.js:362
    201 #: src/Inspector.js:177
    202 #: build/index.js:319
     331#: build/index.js:1
     332#: src/Inspector.js:423
    203333msgid "No"
    204334msgstr ""
    205335
    206 #: build/index.js:365
    207 #: src/Inspector.js:178
    208 #: build/index.js:320
     336#: build/index.js:1
     337#: src/Inspector.js:424
    209338msgid "Yes"
    210339msgstr ""
    211 
    212 #: build/index.js:485
    213 #: src/helper/UpgradeMessage.js:7
    214 #: build/index.js:409
    215 msgid "Upgrade to Random Image Block Pro to use this feature. We have some features in mind and those will be added to pro version in the future InshAllah. Also you can suggest some too"
    216 msgstr ""
    217 
    218 #: build/index.js:488
    219 #: src/helper/UpgradeMessage.js:9
    220 #: build/index.js:411
    221 msgid "Here"
    222 msgstr ""
    223 
    224 #: build/index.js:492
    225 #: src/helper/UpgradeMessage.js:13
    226 #: build/index.js:415
    227 msgid "Upgrade Now"
    228 msgstr ""
  • random-image-block-for-block-editor/trunk/random-image-block.php

    r3449156 r3461135  
    55 * Requires at least: 5.8
    66 * Requires PHP:      7.0
    7  * Version:           1.0.5
     7 * Version:           1.1.0
    88 * Author:            ultraDevs
    99 * Author URI:        https://ultradevs.com
     
    121121            [ 'ud-random-img-block-pro' => udrib_fs()->is_plan( 'pro' ) ],
    122122            [
    123                 'ud-random-img-block-caption-on-hover' => $attributes['captionStyle']['showCaptionOn'] && 'hover' === $attributes['captionStyle']['showCaptionOn']
     123                'ud-random-img-block-caption-on-hover' => isset( $attributes['captionStyle']['showCaptionOn'] ) && 'hover' === $attributes['captionStyle']['showCaptionOn']
    124124            ],
    125125            [
    126                 'ud-radmon-img-block-caption-over-img' => $attributes['captionStyle']['captionOverlay']["enabled"] && 'yes' === $attributes['captionStyle']['captionOverlay']["enabled"]
     126                'ud-radmon-img-block-caption-over-img' => isset( $attributes['captionStyle']['captionOverlay']["enabled"] ) && 'yes' === $attributes['captionStyle']['captionOverlay']["enabled"]
    127127            ]
    128128        ),
    129         'style' => '--ud-rib-overlay-position-x:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-y:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';--ud-rib-overlay-position-t-x:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-t-y:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';'
     129        'style' => '--ud-rib-overlay-position-x:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-y:' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';--ud-rib-overlay-position-t-x:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['x'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['x'] * 100 ) . '%' : '50%' ) . '; --ud-rib-overlay-position-t-y:-' . ( isset( $attributes['captionStyle']['captionOverlay']['position']['y'] ) ? esc_attr( $attributes['captionStyle']['captionOverlay']['position']['y'] * 100 ) . '%' : '50%' ) . ';',
     130        'data-images'               => wp_json_encode( $attributes['images'] ),
     131        'data-anim-enabled'         => ( isset( $attributes['shuffleAnimation'] ) && 'none' !== $attributes['shuffleAnimation'] ) ? 'yes' : 'no',
     132        'data-anim-type'            => isset( $attributes['shuffleAnimation'] ) ? $attributes['shuffleAnimation'] : 'none',
     133        'data-anim-duration'        => isset( $attributes['animationDuration'] ) ? $attributes['animationDuration'] : 500,
     134        'data-auto-refresh-enabled' => ( isset( $attributes['autoRefresh'] ) && $attributes['autoRefresh'] ) ? 'true' : 'false',
     135        'data-auto-refresh-interval'=> isset( $attributes['refreshInterval'] ) ? $attributes['refreshInterval'] : 5,
     136        'data-current-index'        => isset( $index ) ? $index : 0,
     137        'data-link-enabled'         => isset( $attributes['linkSettings']['enabled'] ) ? $attributes['linkSettings']['enabled'] : 'none',
     138        'data-sticky-mode'          => ( isset( $attributes['stickyMode'] ) && $attributes['stickyMode'] ) ? 'yes' : 'no',
     139        'data-unique-id'            => isset( $attributes['uniqueId'] ) ? $attributes['uniqueId'] : '',
    130140    ]);
    131141
     
    137147
    138148    $count    = count( $images );
    139     $index    = ( $count > 1 ) ? wp_rand( 0, $count - 1 ) : 0;
     149
     150    // Check if rendering in editor (via REST API for ServerSideRender).
     151    $is_editor_preview = defined( 'REST_REQUEST' ) && REST_REQUEST;
     152
     153    // Use stored index only in editor for consistency, always random on frontend.
     154    if ( $is_editor_preview && isset( $attributes['selectedImageIndex'] ) && $attributes['selectedImageIndex'] >= 0 && $attributes['selectedImageIndex'] < $count ) {
     155        $index = $attributes['selectedImageIndex'];
     156    } else {
     157        // Frontend always shows random image.
     158        $index = ( $count > 1 ) ? wp_rand( 0, $count - 1 ) : 0;
     159    }
     160
    140161    $content  = ( new UDRIB_Generate_CSS( $attributes ) )->css_output();
    141162    $content .= '<div '. $wrapper_attributes .'>';
  • random-image-block-for-block-editor/trunk/readme.txt

    r3449156 r3461135  
    11=== Random Image Block for Block Editor ===
    22Contributors:      mhimon, ultradevs
    3 Tags:              random image block, random image, image block, block, gutenberg, gutenberg block
     3Tags:              random image block, random image, image block, block, gutenberg
    44Tested up to:      6.9
    5 Stable tag:        1.0.5
     5Stable tag:        1.1.0
    66License:           GPL-2.0-or-later
    77License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    1919* Compatible with desktop devices.
    2020* Easy-to-use Gutenberg block interface.
    21 
     21* **Link Options** (Attachment page, Custom URL).
    2222
    2323## Features (Pro Version)
     
    2626* Enhanced customization options for advanced users.
    2727* **Caption Over Image**
     28* **Image Shuffle Animations** (Fade, Slide, Zoom).
     29* **Auto-refresh Interval** functionality.
     30* **Sticky Mode** (Random Seed persistence via local storage).
     31* **Image Filters** (Grayscale, Blur, Brightness, etc.).
    2832* Priority support.
    2933
     
    4751
    4852== Changelog ==
     53
     54= 1.1.0 - 14 Feb 2026 =
     55* Added: Image Shuffle Animations (Fade, Slide, Zoom).
     56* Added: Auto-refresh Interval functionality.
     57* Added: Sticky Mode (Random Seed persistence via local storage).
     58* Added: Image Filters (Grayscale, Blur, Brightness, Contrast, Saturation, Hue Rotate).
     59* Added: Link Options (Attachment page, Custom URL).
    4960
    5061= 1.0.5 - 18 Jan 2025 =
Note: See TracChangeset for help on using the changeset viewer.