Changeset 3465238
- Timestamp:
- 02/19/2026 04:56:46 PM (5 weeks ago)
- Location:
- pulseshare
- Files:
-
- 24 edited
- 1 copied
-
tags/1.1.1 (copied) (copied from pulseshare/trunk)
-
tags/1.1.1/README.md (modified) (2 diffs)
-
tags/1.1.1/assets/admin/blocks/album-embed/block.json (modified) (1 diff)
-
tags/1.1.1/assets/admin/blocks/album-embed/index.asset.php (modified) (1 diff)
-
tags/1.1.1/assets/admin/blocks/album-embed/index.js (modified) (1 diff)
-
tags/1.1.1/assets/admin/blocks/list-embed/block.json (modified) (1 diff)
-
tags/1.1.1/assets/admin/blocks/list-embed/index.asset.php (modified) (1 diff)
-
tags/1.1.1/assets/admin/blocks/list-embed/index.js (modified) (1 diff)
-
tags/1.1.1/languages/pulseshare.pot (modified) (3 diffs)
-
tags/1.1.1/pulseshare.php (modified) (2 diffs)
-
tags/1.1.1/readme.txt (modified) (2 diffs)
-
tags/1.1.1/widgets/AlbumWidget.php (modified) (1 diff)
-
tags/1.1.1/widgets/PodcastWidget.php (modified) (1 diff)
-
trunk/README.md (modified) (2 diffs)
-
trunk/assets/admin/blocks/album-embed/block.json (modified) (1 diff)
-
trunk/assets/admin/blocks/album-embed/index.asset.php (modified) (1 diff)
-
trunk/assets/admin/blocks/album-embed/index.js (modified) (1 diff)
-
trunk/assets/admin/blocks/list-embed/block.json (modified) (1 diff)
-
trunk/assets/admin/blocks/list-embed/index.asset.php (modified) (1 diff)
-
trunk/assets/admin/blocks/list-embed/index.js (modified) (1 diff)
-
trunk/languages/pulseshare.pot (modified) (3 diffs)
-
trunk/pulseshare.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/widgets/AlbumWidget.php (modified) (1 diff)
-
trunk/widgets/PodcastWidget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pulseshare/tags/1.1.1/README.md
r3465141 r3465238 5 5 **Requires at least:** 6.6 6 6 **Tested up to:** 6.9.1 7 **Stable tag:** 1.1. 07 **Stable tag:** 1.1.1 8 8 **Requires PHP:** 8.0 9 9 **License:** GPLv2 or later … … 85 85 ## Changelog ## 86 86 87 ### 1.1.1 ### 88 * Improvement: Spotify API error handling and user feedback in blocks and Elementor widgets. 89 * Fix: Standardized ID comparison in block editors to fix single item selection. 90 87 91 ### 1.1.0 ### 88 92 * New: Server-side REST API proxy for Spotify — API credentials are no longer exposed to the browser. -
pulseshare/tags/1.1.1/assets/admin/blocks/album-embed/block.json
r3465141 r3465238 3 3 "apiVersion": 3, 4 4 "name": "pulseshare/album-embed", 5 "version": "1.1. 0",5 "version": "1.1.1", 6 6 "title": "Album & Tracks", 7 7 "category": "pulseshare", -
pulseshare/tags/1.1.1/assets/admin/blocks/album-embed/index.asset.php
r3465141 r3465238 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' 044b76486b6781e16e41');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '832ef2532ce1332a863d'); -
pulseshare/tags/1.1.1/assets/admin/blocks/album-embed/index.js
r3465141 r3465238 1 !function(){var e,t={235:function(e,t, r){"use strict";var l=window.wp.blocks,a=window.React,n=window.wp.i18n,i=window.wp.components,o=window.wp.blockEditor,s=window.wp.element,c=window.wp.apiFetch,u=r.n(c),p=r(942),d=r.n(p),m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/album-embed","version":"1.1.0","title":"Album & Tracks","category":"pulseshare","description":"Display a list of album tracks to embed in your posts.","keywords":["spotify","album","track","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"albumArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentTrack":{"type":"object","default":{}},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');(0,a.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,a.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));const f=(0,a.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,a.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,a.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}));(0,l.registerBlockType)(m,{icon:{src:f,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:r,className:l}){var c;const{blockID:p,albumArray:m,displayType:f,currentTrack:h,height:b,width:v}=e;(0,s.useEffect)((()=>{p||t({blockID:`album-embed-${r}`})}),[p,r,t]),(0,s.useEffect)((()=>{u()({path:"/pulseshare/v1/tracks"}).then((e=>{t({albumArray:e})})).catch((e=>{console.error("PulseShare: Failed to fetch tracks",e)}))}),[]);const y=d()(l,"album-embed");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(o.InspectorControls,null,(0,a.createElement)("div",{className:"sfwe-block-sidebar"},(0,a.createElement)(i.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,a.createElement)(i.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the album.",selected:f||"full",options:[{label:"Full Album",value:"full"},{label:"Single Track",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===f&&(0,a.createElement)(i.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Track","pulseshare"),help:"Selected track will be displayed in the frontend.",value:h?h.id:null===(c=m[0])||void 0===c?void 0:c.id,options:m.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentTrack:m.find((t=>t.id===e))})}}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:b}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:v})))),(0,a.createElement)("div",{className:y,id:p},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},"single"===f&&!(null!=h&&h.id)&&(0,a.createElement)("div",{className:"notice notice-info alt"},(0,a.createElement)("p",null,(0,a.createElement)("i",null,(0,n.__)("Please select a track from the block settings.","pulseshare")))),"single"===f&&(null==h?void 0:h.id)&&(0,a.createElement)("iframe",{id:"sfwe-track-"+h.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"200",src:"https://open.spotify.com/embed/track/"+h.id+"?utm_source=generator"}),"full"===f&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:r}=e,{blockID:l,currentTrack:n,displayType:i,height:o,width:s}=r,c=d()(t,"album-embed");return(0,a.createElement)("div",{className:c,id:l},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},"single"===i&&n.id&&(0,a.createElement)("iframe",{id:"sfwe-track-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"200",src:"https://open.spotify.com/embed/track/"+n.id+"?utm_source=generator"}),"full"===i&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"}))))}})},942:function(e,t){var r;!function(){"use strict";var l={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=i(e,n(r)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)l.call(e,r)&&e[r]&&(t=i(t,r));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()}},r={};function l(e){var a=r[e];if(void 0!==a)return a.exports;var n=r[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=function(t,r,a,n){if(!r){var i=1/0;for(u=0;u<e.length;u++){r=e[u][0],a=e[u][1],n=e[u][2];for(var o=!0,s=0;s<r.length;s++)(!1&n||i>=n)&&Object.keys(l.O).every((function(e){return l.O[e](r[s])}))?r.splice(s--,1):(o=!1,n<i&&(i=n));if(o){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[r,a,n]},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={141:0,137:0};l.O.j=function(t){return 0===e[t]};var t=function(t,r){var a,n,i=r[0],o=r[1],s=r[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(a in o)l.o(o,a)&&(l.m[a]=o[a]);if(s)var u=s(l)}for(t&&t(r);c<i.length;c++)n=i[c],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(u)},r=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var a=l.O(void 0,[137],(function(){return l(235)}));a=l.O(a)}();1 !function(){var e,t={235:function(e,t,l){"use strict";var r=window.wp.blocks,a=window.React,n=window.wp.i18n,i=window.wp.components,o=window.wp.blockEditor,s=window.wp.element,c=window.wp.apiFetch,u=l.n(c),p=l(942),d=l.n(p),m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/album-embed","version":"1.1.1","title":"Album & Tracks","category":"pulseshare","description":"Display a list of album tracks to embed in your posts.","keywords":["spotify","album","track","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"albumArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentTrack":{"type":"object","default":{}},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');(0,a.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,a.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));const f=(0,a.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,a.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,a.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}));(0,r.registerBlockType)(m,{icon:{src:f,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:l,className:r}){var c;const{blockID:p,albumArray:m,displayType:f,currentTrack:h,height:b,width:v}=e;(0,s.useEffect)((()=>{p||t({blockID:`album-embed-${l}`})}),[p,l,t]);const[y,w]=(0,s.useState)(null);(0,s.useEffect)((()=>{u()({path:"/pulseshare/v1/tracks"}).then((e=>{t({albumArray:e}),w(null)})).catch((e=>{console.error("PulseShare: Failed to fetch tracks",e),w((null==e?void 0:e.message)||"Failed to load tracks from Spotify.")}))}),[]);const g=d()(r,"album-embed");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(o.InspectorControls,null,(0,a.createElement)("div",{className:"sfwe-block-sidebar"},(0,a.createElement)(i.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,a.createElement)(i.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the album.",selected:f||"full",options:[{label:"Full Album",value:"full"},{label:"Single Track",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===f&&(0,a.createElement)(i.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Track","pulseshare"),help:"Selected track will be displayed in the frontend.",value:null!=h&&h.id?h.id:null===(c=m[0])||void 0===c?void 0:c.id,options:m.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentTrack:m.find((t=>String(t.id)===String(e)))})}}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:b}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:v})))),(0,a.createElement)("div",{className:g,id:p},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},y&&(0,a.createElement)("div",{className:"notice notice-error alt"},(0,a.createElement)("p",null,y)),"single"===f&&!(null!=h&&h.id)&&!y&&(0,a.createElement)("div",{className:"notice notice-info alt"},(0,a.createElement)("p",null,(0,a.createElement)("i",null,(0,n.__)("Please select a track from the block settings.","pulseshare")))),"single"===f&&(null==h?void 0:h.id)&&(0,a.createElement)("iframe",{id:"sfwe-track-"+h.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"200",src:"https://open.spotify.com/embed/track/"+h.id+"?utm_source=generator"}),"full"===f&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:l}=e,{blockID:r,currentTrack:n,displayType:i,height:o,width:s}=l,c=d()(t,"album-embed");return(0,a.createElement)("div",{className:c,id:r},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},"single"===i&&n.id&&(0,a.createElement)("iframe",{id:"sfwe-track-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"200",src:"https://open.spotify.com/embed/track/"+n.id+"?utm_source=generator"}),"full"===i&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"}))))}})},942:function(e,t){var l;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var l=arguments[t];l&&(e=i(e,n(l)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var l in e)r.call(e,l)&&e[l]&&(t=i(t,l));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(l=function(){return a}.apply(t,[]))||(e.exports=l)}()}},l={};function r(e){var a=l[e];if(void 0!==a)return a.exports;var n=l[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.m=t,e=[],r.O=function(t,l,a,n){if(!l){var i=1/0;for(u=0;u<e.length;u++){l=e[u][0],a=e[u][1],n=e[u][2];for(var o=!0,s=0;s<l.length;s++)(!1&n||i>=n)&&Object.keys(r.O).every((function(e){return r.O[e](l[s])}))?l.splice(s--,1):(o=!1,n<i&&(i=n));if(o){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[l,a,n]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var l in t)r.o(t,l)&&!r.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={141:0,137:0};r.O.j=function(t){return 0===e[t]};var t=function(t,l){var a,n,i=l[0],o=l[1],s=l[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(a in o)r.o(o,a)&&(r.m[a]=o[a]);if(s)var u=s(r)}for(t&&t(l);c<i.length;c++)n=i[c],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(u)},l=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))}();var a=r.O(void 0,[137],(function(){return r(235)}));a=r.O(a)}(); -
pulseshare/tags/1.1.1/assets/admin/blocks/list-embed/block.json
r3465141 r3465238 3 3 "apiVersion": 3, 4 4 "name": "pulseshare/list-embed", 5 "version": "1.1. 0",5 "version": "1.1.1", 6 6 "title": "Podcast & Episodes", 7 7 "category": "pulseshare", -
pulseshare/tags/1.1.1/assets/admin/blocks/list-embed/index.asset.php
r3465141 r3465238 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' 9a5f34f7b2de3e48c868');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'c61584cd22fdaf7b9c40'); -
pulseshare/tags/1.1.1/assets/admin/blocks/list-embed/index.js
r3465141 r3465238 1 !function(){var e,t={744:function(e,t,l){"use strict";var r=window.wp.blocks,i=window.React,n=window.wp.i18n,o=window.wp.components,a=window.wp.blockEditor,s=window.wp.element,d=window.wp.apiFetch,p=l.n(d),c=l(942),u=l.n(c),h=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/list-embed","version":"1.1.0","title":"Podcast & Episodes","category":"pulseshare","description":"Display a list of episodes to embed in your posts.","keywords":["spotify","podcast","show","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"episodesArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentEpisode":{"type":"object","default":{}},"isVideo":{"type":"boolean","default":false},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');const f=(0,i.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,i.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));(0,i.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,i.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,i.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,i.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})),(0,r.registerBlockType)(h,{icon:{src:f,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:l,className:r}){var d;const{blockID:c,episodesArray:h,displayType:f,currentEpisode:m,isVideo:v,height:w,width:y}=e;(0,s.useEffect)((()=>{c||t({blockID:`list-embed-${l}`})}),[c,l,t]),(0,s.useEffect)((()=>{p()({path:"/pulseshare/v1/episodes"}).then((e=>{t({episodesArray:e})})).catch((e=>{console.error("PulseShare: Failed to fetch episodes",e)}))}),[]);const b=u()(r,"list-embed"),g=v?"video":"";return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(a.InspectorControls,null,(0,i.createElement)("div",{className:"sfwe-block-sidebar"},(0,i.createElement)(o.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,i.createElement)(o.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the episode.",selected:f||"full",options:[{label:"Full Show",value:"full"},{label:"Single Episode",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===f&&(0,i.createElement)(o.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Episode","pulseshare"),help:"Selected episode will be displayed in the frontend.",value:m?m.id:null===(d=h[0])||void 0===d?void 0:d.id,options:h.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentEpisode:h.find((t=>t.id===e))})}}),"single"===f&&(0,i.createElement)(o.ToggleControl,{__nextHasNoMarginBottom:!0,checked:v||!1,help:(0,n.__)("Enable this option if this episode is a video.","pulseshare"),label:(0,n.__)("Is this a video episode?","pulseshare"),onChange:e=>{t({isVideo:e})}}),(0,i.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:w}),(0,i.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:y})))),(0,i.createElement)("div",{className:b,id:c},(0,i.createElement)("div",{className:"container"},(0,i.createElement)("div",{className:"sfwe-episode"},"single"===f&&!(null!=m&&m.id)&&(0,i.createElement)("div",{className:"notice notice-info alt"},(0,i.createElement)("p",null,(0,i.createElement)("i",null,(0,n.__)("Please select an episode from the block settings.","pulseshare")))),"single"===f&&(null==m?void 0:m.id)&&(0,i.createElement)("iframe",{id:"sfwe-episode-"+m.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/episode/"+m.id+"/"+g+"?utm_source=generator"}),"full"===f&&(0,i.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:l}=e,{blockID:r,currentEpisode:n,displayType:o,height:a,width:s}=l,d=u()(t,"list-embed");return(0,i.createElement)("div",{className:d,id:r},(0,i.createElement)("div",{className:"container"},(0,i.createElement)("div",{className:"sfwe-episode"},"single"===o&&n.id&&(0,i.createElement)("iframe",{id:"sfwe-episode-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/episode/"+n.id+"?utm_source=generator"}),"full"===o&&(0,i.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"}))))}})},942:function(e,t){var l;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var l=arguments[t];l&&(e=o(e,n(l)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var l in e)r.call(e,l)&&e[l]&&(t=o(t,l));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(l=function(){return i}.apply(t,[]))||(e.exports=l)}()}},l={};function r(e){var i=l[e];if(void 0!==i)return i.exports;var n=l[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.m=t,e=[],r.O=function(t,l,i,n){if(!l){var o=1/0;for(p=0;p<e.length;p++){l=e[p][0],i=e[p][1],n=e[p][2];for(var a=!0,s=0;s<l.length;s++)(!1&n||o>=n)&&Object.keys(r.O).every((function(e){return r.O[e](l[s])}))?l.splice(s--,1):(a=!1,n<o&&(o=n));if(a){e.splice(p--,1);var d=i();void 0!==d&&(t=d)}}return t}n=n||0;for(var p=e.length;p>0&&e[p-1][2]>n;p--)e[p]=e[p-1];e[p]=[l,i,n]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var l in t)r.o(t,l)&&!r.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={266:0,542:0};r.O.j=function(t){return 0===e[t]};var t=function(t,l){var i,n,o=l[0],a=l[1],s=l[2],d=0;if(o.some((function(t){return 0!==e[t]}))){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(s)var p=s(r)}for(t&&t(l);d<o.length;d++)n=o[d],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(p)},l=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))}();var i=r.O(void 0,[542],(function(){return r(744)}));i=r.O(i)}();1 !function(){var e,t={744:function(e,t,l){"use strict";var i=window.wp.blocks,r=window.React,n=window.wp.i18n,o=window.wp.components,a=window.wp.blockEditor,s=window.wp.element,d=window.wp.apiFetch,c=l.n(d),p=l(942),u=l.n(p),f=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/list-embed","version":"1.1.1","title":"Podcast & Episodes","category":"pulseshare","description":"Display a list of episodes to embed in your posts.","keywords":["spotify","podcast","show","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"episodesArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentEpisode":{"type":"object","default":{}},"isVideo":{"type":"boolean","default":false},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');const h=(0,r.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,r.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,r.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})),(0,i.registerBlockType)(f,{icon:{src:h,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:l,className:i}){var d;const{blockID:p,episodesArray:f,displayType:h,currentEpisode:m,isVideo:v,height:w,width:y}=e;(0,s.useEffect)((()=>{p||t({blockID:`list-embed-${l}`})}),[p,l,t]);const[g,b]=(0,s.useState)(null);(0,s.useEffect)((()=>{c()({path:"/pulseshare/v1/episodes"}).then((e=>{t({episodesArray:e}),b(null)})).catch((e=>{console.error("PulseShare: Failed to fetch episodes",e),b((null==e?void 0:e.message)||"Failed to load episodes from Spotify.")}))}),[]);const E=u()(i,"list-embed"),_=v?"video":"";return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)("div",{className:"sfwe-block-sidebar"},(0,r.createElement)(o.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,r.createElement)(o.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the episode.",selected:h||"full",options:[{label:"Full Show",value:"full"},{label:"Single Episode",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===h&&(0,r.createElement)(o.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Episode","pulseshare"),help:"Selected episode will be displayed in the frontend.",value:null!=m&&m.id?m.id:null===(d=f[0])||void 0===d?void 0:d.id,options:f.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentEpisode:f.find((t=>String(t.id)===String(e)))})}}),"single"===h&&(0,r.createElement)(o.ToggleControl,{__nextHasNoMarginBottom:!0,checked:v||!1,help:(0,n.__)("Enable this option if this episode is a video.","pulseshare"),label:(0,n.__)("Is this a video episode?","pulseshare"),onChange:e=>{t({isVideo:e})}}),(0,r.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:w}),(0,r.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:y})))),(0,r.createElement)("div",{className:E,id:p},(0,r.createElement)("div",{className:"container"},(0,r.createElement)("div",{className:"sfwe-episode"},g&&(0,r.createElement)("div",{className:"notice notice-error alt"},(0,r.createElement)("p",null,g)),"single"===h&&!(null!=m&&m.id)&&!g&&(0,r.createElement)("div",{className:"notice notice-info alt"},(0,r.createElement)("p",null,(0,r.createElement)("i",null,(0,n.__)("Please select an episode from the block settings.","pulseshare")))),"single"===h&&(null==m?void 0:m.id)&&(0,r.createElement)("iframe",{id:"sfwe-episode-"+m.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/episode/"+m.id+"/"+_+"?utm_source=generator"}),"full"===h&&(0,r.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:l}=e,{blockID:i,currentEpisode:n,displayType:o,height:a,width:s}=l,d=u()(t,"list-embed");return(0,r.createElement)("div",{className:d,id:i},(0,r.createElement)("div",{className:"container"},(0,r.createElement)("div",{className:"sfwe-episode"},"single"===o&&n.id&&(0,r.createElement)("iframe",{id:"sfwe-episode-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/episode/"+n.id+"?utm_source=generator"}),"full"===o&&(0,r.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"}))))}})},942:function(e,t){var l;!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var l=arguments[t];l&&(e=o(e,n(l)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var l in e)i.call(e,l)&&e[l]&&(t=o(t,l));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(l=function(){return r}.apply(t,[]))||(e.exports=l)}()}},l={};function i(e){var r=l[e];if(void 0!==r)return r.exports;var n=l[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.m=t,e=[],i.O=function(t,l,r,n){if(!l){var o=1/0;for(c=0;c<e.length;c++){l=e[c][0],r=e[c][1],n=e[c][2];for(var a=!0,s=0;s<l.length;s++)(!1&n||o>=n)&&Object.keys(i.O).every((function(e){return i.O[e](l[s])}))?l.splice(s--,1):(a=!1,n<o&&(o=n));if(a){e.splice(c--,1);var d=r();void 0!==d&&(t=d)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[l,r,n]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var l in t)i.o(t,l)&&!i.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={266:0,542:0};i.O.j=function(t){return 0===e[t]};var t=function(t,l){var r,n,o=l[0],a=l[1],s=l[2],d=0;if(o.some((function(t){return 0!==e[t]}))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(s)var c=s(i)}for(t&&t(l);d<o.length;d++)n=o[d],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(c)},l=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))}();var r=i.O(void 0,[542],(function(){return i(744)}));r=i.O(r)}(); -
pulseshare/tags/1.1.1/languages/pulseshare.pot
r3465141 r3465238 7 7 "Content-Type: text/plain; charset=UTF-8\n" 8 8 "Content-Transfer-Encoding: 8bit\n" 9 "POT-Creation-Date: 2026-02-19 1 4:01+0000\n"9 "POT-Creation-Date: 2026-02-19 16:56+0000\n" 10 10 "X-Poedit-Basepath: ..\n" 11 11 "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" … … 155 155 msgstr "" 156 156 157 #: widgets/AlbumWidget.php:2 66157 #: widgets/AlbumWidget.php:271 158 158 msgid "Please select a track from the widget settings." 159 msgstr "" 160 161 #: widgets/AlbumWidget.php:267 162 msgid "Unable to load tracks from Spotify. Please check your API keys and Album ID in the PulseShare settings." 159 163 msgstr "" 160 164 … … 203 207 msgstr "" 204 208 205 #: widgets/PodcastWidget.php:28 3209 #: widgets/PodcastWidget.php:288 206 210 msgid "Please select an episode from the widget settings" 211 msgstr "" 212 213 #: widgets/PodcastWidget.php:284 214 msgid "Unable to load episodes from Spotify. Please check your API keys and Show ID in the PulseShare settings." 207 215 msgstr "" 208 216 -
pulseshare/tags/1.1.1/pulseshare.php
r3465141 r3465238 11 11 * Plugin URI: https://swapnild.com 12 12 * Description: PulseShare help you share interactive content from Spotify on your website. Embed podcast, an album, or other audio and video content to your website and promote your music, share your new podcast episodes with fans, or highlight your favourite album or playlist. 13 * Version: 1.1. 013 * Version: 1.1.1 14 14 * Author: Swapnil Deshpande 15 15 * Author URI: https://swapnild.com/ … … 34 34 * Currently plugin version. 35 35 */ 36 define( 'PULSESHARE_VERSION', '1.1. 0' );36 define( 'PULSESHARE_VERSION', '1.1.1' ); 37 37 define( 'PULSESHARE_DIRPATH', plugin_dir_path( __FILE__ ) ); 38 38 define( 'PULSESHARE_URLPATH', plugin_dir_url( __FILE__ ) ); -
pulseshare/tags/1.1.1/readme.txt
r3465141 r3465238 5 5 Requires at least: 6.6 6 6 Tested up to: 6.9.1 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 Requires PHP: 8.0 9 9 License: GPLv2 or later … … 91 91 == Changelog == 92 92 93 = 1.1.1 = 94 * Improvement: Spotify API error handling and user feedback in blocks and Elementor widgets. 95 * Fix: Standardized ID comparison in block editors to fix single item selection. 96 93 97 = 1.1.0 = 94 98 * New: Server-side REST API proxy for Spotify — API credentials are no longer exposed to the browser. -
pulseshare/tags/1.1.1/widgets/AlbumWidget.php
r3465141 r3465238 263 263 264 264 <?php if ( $is_editor && 'single' === $settings['sfwe_album_display_type'] && empty( $settings['sfwe_album_list'] ) ) : ?> 265 <div class="sfwe-album-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 266 <?php esc_html_e( 'Please select a track from the widget settings.', 'pulseshare' ); ?> 267 </div> 265 <?php if ( empty( Helper::get_pulseshareshow_tracks() ) ) : ?> 266 <div class="sfwe-album-editor-placeholder elementor-panel-alert elementor-panel-alert-warning"> 267 <?php esc_html_e( 'Unable to load tracks from Spotify. Please check your API keys and Album ID in the PulseShare settings.', 'pulseshare' ); ?> 268 </div> 269 <?php else : ?> 270 <div class="sfwe-album-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 271 <?php esc_html_e( 'Please select a track from the widget settings.', 'pulseshare' ); ?> 272 </div> 273 <?php endif; ?> 268 274 <?php endif; ?> 269 275 </div> -
pulseshare/tags/1.1.1/widgets/PodcastWidget.php
r3465141 r3465238 280 280 281 281 <?php if ( $is_editor && 'single' === $settings['sfwe_podcast_display_type'] && empty( $settings['sfwe_podcast_list'] ) ) : ?> 282 <div class="sfwe-podcast-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 283 <?php esc_html_e( 'Please select an episode from the widget settings', 'pulseshare' ); ?> 284 </div> 282 <?php if ( empty( Helper::get_pulseshareall_episodes() ) ) : ?> 283 <div class="sfwe-podcast-editor-placeholder elementor-panel-alert elementor-panel-alert-warning"> 284 <?php esc_html_e( 'Unable to load episodes from Spotify. Please check your API keys and Show ID in the PulseShare settings.', 'pulseshare' ); ?> 285 </div> 286 <?php else : ?> 287 <div class="sfwe-podcast-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 288 <?php esc_html_e( 'Please select an episode from the widget settings', 'pulseshare' ); ?> 289 </div> 290 <?php endif; ?> 285 291 <?php endif; ?> 286 292 </div> -
pulseshare/trunk/README.md
r3465141 r3465238 5 5 **Requires at least:** 6.6 6 6 **Tested up to:** 6.9.1 7 **Stable tag:** 1.1. 07 **Stable tag:** 1.1.1 8 8 **Requires PHP:** 8.0 9 9 **License:** GPLv2 or later … … 85 85 ## Changelog ## 86 86 87 ### 1.1.1 ### 88 * Improvement: Spotify API error handling and user feedback in blocks and Elementor widgets. 89 * Fix: Standardized ID comparison in block editors to fix single item selection. 90 87 91 ### 1.1.0 ### 88 92 * New: Server-side REST API proxy for Spotify — API credentials are no longer exposed to the browser. -
pulseshare/trunk/assets/admin/blocks/album-embed/block.json
r3465141 r3465238 3 3 "apiVersion": 3, 4 4 "name": "pulseshare/album-embed", 5 "version": "1.1. 0",5 "version": "1.1.1", 6 6 "title": "Album & Tracks", 7 7 "category": "pulseshare", -
pulseshare/trunk/assets/admin/blocks/album-embed/index.asset.php
r3465141 r3465238 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' 044b76486b6781e16e41');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '832ef2532ce1332a863d'); -
pulseshare/trunk/assets/admin/blocks/album-embed/index.js
r3465141 r3465238 1 !function(){var e,t={235:function(e,t, r){"use strict";var l=window.wp.blocks,a=window.React,n=window.wp.i18n,i=window.wp.components,o=window.wp.blockEditor,s=window.wp.element,c=window.wp.apiFetch,u=r.n(c),p=r(942),d=r.n(p),m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/album-embed","version":"1.1.0","title":"Album & Tracks","category":"pulseshare","description":"Display a list of album tracks to embed in your posts.","keywords":["spotify","album","track","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"albumArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentTrack":{"type":"object","default":{}},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');(0,a.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,a.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));const f=(0,a.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,a.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,a.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}));(0,l.registerBlockType)(m,{icon:{src:f,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:r,className:l}){var c;const{blockID:p,albumArray:m,displayType:f,currentTrack:h,height:b,width:v}=e;(0,s.useEffect)((()=>{p||t({blockID:`album-embed-${r}`})}),[p,r,t]),(0,s.useEffect)((()=>{u()({path:"/pulseshare/v1/tracks"}).then((e=>{t({albumArray:e})})).catch((e=>{console.error("PulseShare: Failed to fetch tracks",e)}))}),[]);const y=d()(l,"album-embed");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(o.InspectorControls,null,(0,a.createElement)("div",{className:"sfwe-block-sidebar"},(0,a.createElement)(i.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,a.createElement)(i.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the album.",selected:f||"full",options:[{label:"Full Album",value:"full"},{label:"Single Track",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===f&&(0,a.createElement)(i.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Track","pulseshare"),help:"Selected track will be displayed in the frontend.",value:h?h.id:null===(c=m[0])||void 0===c?void 0:c.id,options:m.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentTrack:m.find((t=>t.id===e))})}}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:b}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:v})))),(0,a.createElement)("div",{className:y,id:p},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},"single"===f&&!(null!=h&&h.id)&&(0,a.createElement)("div",{className:"notice notice-info alt"},(0,a.createElement)("p",null,(0,a.createElement)("i",null,(0,n.__)("Please select a track from the block settings.","pulseshare")))),"single"===f&&(null==h?void 0:h.id)&&(0,a.createElement)("iframe",{id:"sfwe-track-"+h.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"200",src:"https://open.spotify.com/embed/track/"+h.id+"?utm_source=generator"}),"full"===f&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:r}=e,{blockID:l,currentTrack:n,displayType:i,height:o,width:s}=r,c=d()(t,"album-embed");return(0,a.createElement)("div",{className:c,id:l},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},"single"===i&&n.id&&(0,a.createElement)("iframe",{id:"sfwe-track-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"200",src:"https://open.spotify.com/embed/track/"+n.id+"?utm_source=generator"}),"full"===i&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"}))))}})},942:function(e,t){var r;!function(){"use strict";var l={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=i(e,n(r)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)l.call(e,r)&&e[r]&&(t=i(t,r));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()}},r={};function l(e){var a=r[e];if(void 0!==a)return a.exports;var n=r[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=function(t,r,a,n){if(!r){var i=1/0;for(u=0;u<e.length;u++){r=e[u][0],a=e[u][1],n=e[u][2];for(var o=!0,s=0;s<r.length;s++)(!1&n||i>=n)&&Object.keys(l.O).every((function(e){return l.O[e](r[s])}))?r.splice(s--,1):(o=!1,n<i&&(i=n));if(o){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[r,a,n]},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={141:0,137:0};l.O.j=function(t){return 0===e[t]};var t=function(t,r){var a,n,i=r[0],o=r[1],s=r[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(a in o)l.o(o,a)&&(l.m[a]=o[a]);if(s)var u=s(l)}for(t&&t(r);c<i.length;c++)n=i[c],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(u)},r=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var a=l.O(void 0,[137],(function(){return l(235)}));a=l.O(a)}();1 !function(){var e,t={235:function(e,t,l){"use strict";var r=window.wp.blocks,a=window.React,n=window.wp.i18n,i=window.wp.components,o=window.wp.blockEditor,s=window.wp.element,c=window.wp.apiFetch,u=l.n(c),p=l(942),d=l.n(p),m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/album-embed","version":"1.1.1","title":"Album & Tracks","category":"pulseshare","description":"Display a list of album tracks to embed in your posts.","keywords":["spotify","album","track","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"albumArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentTrack":{"type":"object","default":{}},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');(0,a.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,a.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));const f=(0,a.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,a.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,a.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}));(0,r.registerBlockType)(m,{icon:{src:f,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:l,className:r}){var c;const{blockID:p,albumArray:m,displayType:f,currentTrack:h,height:b,width:v}=e;(0,s.useEffect)((()=>{p||t({blockID:`album-embed-${l}`})}),[p,l,t]);const[y,w]=(0,s.useState)(null);(0,s.useEffect)((()=>{u()({path:"/pulseshare/v1/tracks"}).then((e=>{t({albumArray:e}),w(null)})).catch((e=>{console.error("PulseShare: Failed to fetch tracks",e),w((null==e?void 0:e.message)||"Failed to load tracks from Spotify.")}))}),[]);const g=d()(r,"album-embed");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(o.InspectorControls,null,(0,a.createElement)("div",{className:"sfwe-block-sidebar"},(0,a.createElement)(i.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,a.createElement)(i.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the album.",selected:f||"full",options:[{label:"Full Album",value:"full"},{label:"Single Track",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===f&&(0,a.createElement)(i.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Track","pulseshare"),help:"Selected track will be displayed in the frontend.",value:null!=h&&h.id?h.id:null===(c=m[0])||void 0===c?void 0:c.id,options:m.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentTrack:m.find((t=>String(t.id)===String(e)))})}}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:b}),(0,a.createElement)(i.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:v})))),(0,a.createElement)("div",{className:g,id:p},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},y&&(0,a.createElement)("div",{className:"notice notice-error alt"},(0,a.createElement)("p",null,y)),"single"===f&&!(null!=h&&h.id)&&!y&&(0,a.createElement)("div",{className:"notice notice-info alt"},(0,a.createElement)("p",null,(0,a.createElement)("i",null,(0,n.__)("Please select a track from the block settings.","pulseshare")))),"single"===f&&(null==h?void 0:h.id)&&(0,a.createElement)("iframe",{id:"sfwe-track-"+h.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"200",src:"https://open.spotify.com/embed/track/"+h.id+"?utm_source=generator"}),"full"===f&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:v||"100%",height:b||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:l}=e,{blockID:r,currentTrack:n,displayType:i,height:o,width:s}=l,c=d()(t,"album-embed");return(0,a.createElement)("div",{className:c,id:r},(0,a.createElement)("div",{className:"container"},(0,a.createElement)("div",{className:"sfwe-episode"},"single"===i&&n.id&&(0,a.createElement)("iframe",{id:"sfwe-track-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"200",src:"https://open.spotify.com/embed/track/"+n.id+"?utm_source=generator"}),"full"===i&&(0,a.createElement)("iframe",{id:"sfwe-album-"+PulseShareAdminVars.pulseshare_options.album_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:o||"380",src:"https://open.spotify.com/embed/album/"+PulseShareAdminVars.pulseshare_options.album_id+"?utm_source=generator"}))))}})},942:function(e,t){var l;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var l=arguments[t];l&&(e=i(e,n(l)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var l in e)r.call(e,l)&&e[l]&&(t=i(t,l));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(l=function(){return a}.apply(t,[]))||(e.exports=l)}()}},l={};function r(e){var a=l[e];if(void 0!==a)return a.exports;var n=l[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.m=t,e=[],r.O=function(t,l,a,n){if(!l){var i=1/0;for(u=0;u<e.length;u++){l=e[u][0],a=e[u][1],n=e[u][2];for(var o=!0,s=0;s<l.length;s++)(!1&n||i>=n)&&Object.keys(r.O).every((function(e){return r.O[e](l[s])}))?l.splice(s--,1):(o=!1,n<i&&(i=n));if(o){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[l,a,n]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var l in t)r.o(t,l)&&!r.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={141:0,137:0};r.O.j=function(t){return 0===e[t]};var t=function(t,l){var a,n,i=l[0],o=l[1],s=l[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(a in o)r.o(o,a)&&(r.m[a]=o[a]);if(s)var u=s(r)}for(t&&t(l);c<i.length;c++)n=i[c],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(u)},l=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))}();var a=r.O(void 0,[137],(function(){return r(235)}));a=r.O(a)}(); -
pulseshare/trunk/assets/admin/blocks/list-embed/block.json
r3465141 r3465238 3 3 "apiVersion": 3, 4 4 "name": "pulseshare/list-embed", 5 "version": "1.1. 0",5 "version": "1.1.1", 6 6 "title": "Podcast & Episodes", 7 7 "category": "pulseshare", -
pulseshare/trunk/assets/admin/blocks/list-embed/index.asset.php
r3465141 r3465238 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' 9a5f34f7b2de3e48c868');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'c61584cd22fdaf7b9c40'); -
pulseshare/trunk/assets/admin/blocks/list-embed/index.js
r3465141 r3465238 1 !function(){var e,t={744:function(e,t,l){"use strict";var r=window.wp.blocks,i=window.React,n=window.wp.i18n,o=window.wp.components,a=window.wp.blockEditor,s=window.wp.element,d=window.wp.apiFetch,p=l.n(d),c=l(942),u=l.n(c),h=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/list-embed","version":"1.1.0","title":"Podcast & Episodes","category":"pulseshare","description":"Display a list of episodes to embed in your posts.","keywords":["spotify","podcast","show","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"episodesArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentEpisode":{"type":"object","default":{}},"isVideo":{"type":"boolean","default":false},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');const f=(0,i.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,i.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));(0,i.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,i.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,i.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,i.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})),(0,r.registerBlockType)(h,{icon:{src:f,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:l,className:r}){var d;const{blockID:c,episodesArray:h,displayType:f,currentEpisode:m,isVideo:v,height:w,width:y}=e;(0,s.useEffect)((()=>{c||t({blockID:`list-embed-${l}`})}),[c,l,t]),(0,s.useEffect)((()=>{p()({path:"/pulseshare/v1/episodes"}).then((e=>{t({episodesArray:e})})).catch((e=>{console.error("PulseShare: Failed to fetch episodes",e)}))}),[]);const b=u()(r,"list-embed"),g=v?"video":"";return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(a.InspectorControls,null,(0,i.createElement)("div",{className:"sfwe-block-sidebar"},(0,i.createElement)(o.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,i.createElement)(o.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the episode.",selected:f||"full",options:[{label:"Full Show",value:"full"},{label:"Single Episode",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===f&&(0,i.createElement)(o.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Episode","pulseshare"),help:"Selected episode will be displayed in the frontend.",value:m?m.id:null===(d=h[0])||void 0===d?void 0:d.id,options:h.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentEpisode:h.find((t=>t.id===e))})}}),"single"===f&&(0,i.createElement)(o.ToggleControl,{__nextHasNoMarginBottom:!0,checked:v||!1,help:(0,n.__)("Enable this option if this episode is a video.","pulseshare"),label:(0,n.__)("Is this a video episode?","pulseshare"),onChange:e=>{t({isVideo:e})}}),(0,i.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:w}),(0,i.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:y})))),(0,i.createElement)("div",{className:b,id:c},(0,i.createElement)("div",{className:"container"},(0,i.createElement)("div",{className:"sfwe-episode"},"single"===f&&!(null!=m&&m.id)&&(0,i.createElement)("div",{className:"notice notice-info alt"},(0,i.createElement)("p",null,(0,i.createElement)("i",null,(0,n.__)("Please select an episode from the block settings.","pulseshare")))),"single"===f&&(null==m?void 0:m.id)&&(0,i.createElement)("iframe",{id:"sfwe-episode-"+m.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/episode/"+m.id+"/"+g+"?utm_source=generator"}),"full"===f&&(0,i.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:l}=e,{blockID:r,currentEpisode:n,displayType:o,height:a,width:s}=l,d=u()(t,"list-embed");return(0,i.createElement)("div",{className:d,id:r},(0,i.createElement)("div",{className:"container"},(0,i.createElement)("div",{className:"sfwe-episode"},"single"===o&&n.id&&(0,i.createElement)("iframe",{id:"sfwe-episode-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/episode/"+n.id+"?utm_source=generator"}),"full"===o&&(0,i.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"}))))}})},942:function(e,t){var l;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var l=arguments[t];l&&(e=o(e,n(l)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var l in e)r.call(e,l)&&e[l]&&(t=o(t,l));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(l=function(){return i}.apply(t,[]))||(e.exports=l)}()}},l={};function r(e){var i=l[e];if(void 0!==i)return i.exports;var n=l[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.m=t,e=[],r.O=function(t,l,i,n){if(!l){var o=1/0;for(p=0;p<e.length;p++){l=e[p][0],i=e[p][1],n=e[p][2];for(var a=!0,s=0;s<l.length;s++)(!1&n||o>=n)&&Object.keys(r.O).every((function(e){return r.O[e](l[s])}))?l.splice(s--,1):(a=!1,n<o&&(o=n));if(a){e.splice(p--,1);var d=i();void 0!==d&&(t=d)}}return t}n=n||0;for(var p=e.length;p>0&&e[p-1][2]>n;p--)e[p]=e[p-1];e[p]=[l,i,n]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var l in t)r.o(t,l)&&!r.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={266:0,542:0};r.O.j=function(t){return 0===e[t]};var t=function(t,l){var i,n,o=l[0],a=l[1],s=l[2],d=0;if(o.some((function(t){return 0!==e[t]}))){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(s)var p=s(r)}for(t&&t(l);d<o.length;d++)n=o[d],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(p)},l=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))}();var i=r.O(void 0,[542],(function(){return r(744)}));i=r.O(i)}();1 !function(){var e,t={744:function(e,t,l){"use strict";var i=window.wp.blocks,r=window.React,n=window.wp.i18n,o=window.wp.components,a=window.wp.blockEditor,s=window.wp.element,d=window.wp.apiFetch,c=l.n(d),p=l(942),u=l.n(p),f=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"pulseshare/list-embed","version":"1.1.1","title":"Podcast & Episodes","category":"pulseshare","description":"Display a list of episodes to embed in your posts.","keywords":["spotify","podcast","show","embed"],"supports":{"html":false},"attributes":{"blockID":{"type":"string","default":""},"episodesArray":{"type":"array","default":[]},"displayType":{"type":"string","default":"full"},"currentEpisode":{"type":"object","default":{}},"isVideo":{"type":"boolean","default":false},"height":{"type":"string"},"width":{"type":"string"}},"textdomain":"pulseshare","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');const h=(0,r.createElement)("svg",{width:"24",height:"24",fill:"none"},(0,r.createElement)("path",{d:"M16 5H4v2h12V5ZM16 9H4v2h12V9ZM4 13h8v2H4v-2ZM20 16l-6-3v6l6-3Z",fill:"currentColor"}));(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)("path",{d:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm-1 3a1 1 0 1 0 2 0 1 1 0 0 0-2 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"}),(0,r.createElement)("path",{d:"M5 12a7 7 0 0 1 7-7v2a5 5 0 0 0-5 5H5zM12 17a5 5 0 0 0 5-5h2a7 7 0 0 1-7 7v-2z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zM3 12a9 9 0 1 0 18 0 9 9 0 0 0-18 0z","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})),(0,i.registerBlockType)(f,{icon:{src:h,foreground:"#2BA266"},edit:function({attributes:e,setAttributes:t,clientId:l,className:i}){var d;const{blockID:p,episodesArray:f,displayType:h,currentEpisode:m,isVideo:v,height:w,width:y}=e;(0,s.useEffect)((()=>{p||t({blockID:`list-embed-${l}`})}),[p,l,t]);const[g,b]=(0,s.useState)(null);(0,s.useEffect)((()=>{c()({path:"/pulseshare/v1/episodes"}).then((e=>{t({episodesArray:e}),b(null)})).catch((e=>{console.error("PulseShare: Failed to fetch episodes",e),b((null==e?void 0:e.message)||"Failed to load episodes from Spotify.")}))}),[]);const E=u()(i,"list-embed"),_=v?"video":"";return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)("div",{className:"sfwe-block-sidebar"},(0,r.createElement)(o.PanelBody,{title:(0,n.__)("Settings","pulseshare"),initialOpen:!0},(0,r.createElement)(o.RadioControl,{label:(0,n.__)("Display Type","pulseshare"),help:"Select the display type for the episode.",selected:h||"full",options:[{label:"Full Show",value:"full"},{label:"Single Episode",value:"single"}],onChange:e=>{t({displayType:e})}}),"single"===h&&(0,r.createElement)(o.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Select Episode","pulseshare"),help:"Selected episode will be displayed in the frontend.",value:null!=m&&m.id?m.id:null===(d=f[0])||void 0===d?void 0:d.id,options:f.map((e=>({label:e.name,value:e.id}))),onChange:e=>{t({currentEpisode:f.find((t=>String(t.id)===String(e)))})}}),"single"===h&&(0,r.createElement)(o.ToggleControl,{__nextHasNoMarginBottom:!0,checked:v||!1,help:(0,n.__)("Enable this option if this episode is a video.","pulseshare"),label:(0,n.__)("Is this a video episode?","pulseshare"),onChange:e=>{t({isVideo:e})}}),(0,r.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Height",onChange:e=>{t({height:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:w}),(0,r.createElement)(o.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:"Width",onChange:e=>{t({width:e})},units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"},{a11yLabel:"Percent (%)",label:"%",step:1,value:"%"}],value:y})))),(0,r.createElement)("div",{className:E,id:p},(0,r.createElement)("div",{className:"container"},(0,r.createElement)("div",{className:"sfwe-episode"},g&&(0,r.createElement)("div",{className:"notice notice-error alt"},(0,r.createElement)("p",null,g)),"single"===h&&!(null!=m&&m.id)&&!g&&(0,r.createElement)("div",{className:"notice notice-info alt"},(0,r.createElement)("p",null,(0,r.createElement)("i",null,(0,n.__)("Please select an episode from the block settings.","pulseshare")))),"single"===h&&(null==m?void 0:m.id)&&(0,r.createElement)("iframe",{id:"sfwe-episode-"+m.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/episode/"+m.id+"/"+_+"?utm_source=generator"}),"full"===h&&(0,r.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:y||"100%",height:w||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"})))))},save:function(e){const{className:t,attributes:l}=e,{blockID:i,currentEpisode:n,displayType:o,height:a,width:s}=l,d=u()(t,"list-embed");return(0,r.createElement)("div",{className:d,id:i},(0,r.createElement)("div",{className:"container"},(0,r.createElement)("div",{className:"sfwe-episode"},"single"===o&&n.id&&(0,r.createElement)("iframe",{id:"sfwe-episode-"+n.id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/episode/"+n.id+"?utm_source=generator"}),"full"===o&&(0,r.createElement)("iframe",{id:"sfwe-show-"+PulseShareAdminVars.pulseshare_options.show_id,frameBorder:"0",allowFullScreen:"",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",width:s||"100%",height:a||"200",src:"https://open.spotify.com/embed/show/"+PulseShareAdminVars.pulseshare_options.show_id+"?utm_source=generator"}))))}})},942:function(e,t){var l;!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var l=arguments[t];l&&(e=o(e,n(l)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var l in e)i.call(e,l)&&e[l]&&(t=o(t,l));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(l=function(){return r}.apply(t,[]))||(e.exports=l)}()}},l={};function i(e){var r=l[e];if(void 0!==r)return r.exports;var n=l[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.m=t,e=[],i.O=function(t,l,r,n){if(!l){var o=1/0;for(c=0;c<e.length;c++){l=e[c][0],r=e[c][1],n=e[c][2];for(var a=!0,s=0;s<l.length;s++)(!1&n||o>=n)&&Object.keys(i.O).every((function(e){return i.O[e](l[s])}))?l.splice(s--,1):(a=!1,n<o&&(o=n));if(a){e.splice(c--,1);var d=r();void 0!==d&&(t=d)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[l,r,n]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var l in t)i.o(t,l)&&!i.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={266:0,542:0};i.O.j=function(t){return 0===e[t]};var t=function(t,l){var r,n,o=l[0],a=l[1],s=l[2],d=0;if(o.some((function(t){return 0!==e[t]}))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(s)var c=s(i)}for(t&&t(l);d<o.length;d++)n=o[d],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(c)},l=self.webpackChunkpulseshare=self.webpackChunkpulseshare||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))}();var r=i.O(void 0,[542],(function(){return i(744)}));r=i.O(r)}(); -
pulseshare/trunk/languages/pulseshare.pot
r3465141 r3465238 7 7 "Content-Type: text/plain; charset=UTF-8\n" 8 8 "Content-Transfer-Encoding: 8bit\n" 9 "POT-Creation-Date: 2026-02-19 1 4:01+0000\n"9 "POT-Creation-Date: 2026-02-19 16:56+0000\n" 10 10 "X-Poedit-Basepath: ..\n" 11 11 "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" … … 155 155 msgstr "" 156 156 157 #: widgets/AlbumWidget.php:2 66157 #: widgets/AlbumWidget.php:271 158 158 msgid "Please select a track from the widget settings." 159 msgstr "" 160 161 #: widgets/AlbumWidget.php:267 162 msgid "Unable to load tracks from Spotify. Please check your API keys and Album ID in the PulseShare settings." 159 163 msgstr "" 160 164 … … 203 207 msgstr "" 204 208 205 #: widgets/PodcastWidget.php:28 3209 #: widgets/PodcastWidget.php:288 206 210 msgid "Please select an episode from the widget settings" 211 msgstr "" 212 213 #: widgets/PodcastWidget.php:284 214 msgid "Unable to load episodes from Spotify. Please check your API keys and Show ID in the PulseShare settings." 207 215 msgstr "" 208 216 -
pulseshare/trunk/pulseshare.php
r3465141 r3465238 11 11 * Plugin URI: https://swapnild.com 12 12 * Description: PulseShare help you share interactive content from Spotify on your website. Embed podcast, an album, or other audio and video content to your website and promote your music, share your new podcast episodes with fans, or highlight your favourite album or playlist. 13 * Version: 1.1. 013 * Version: 1.1.1 14 14 * Author: Swapnil Deshpande 15 15 * Author URI: https://swapnild.com/ … … 34 34 * Currently plugin version. 35 35 */ 36 define( 'PULSESHARE_VERSION', '1.1. 0' );36 define( 'PULSESHARE_VERSION', '1.1.1' ); 37 37 define( 'PULSESHARE_DIRPATH', plugin_dir_path( __FILE__ ) ); 38 38 define( 'PULSESHARE_URLPATH', plugin_dir_url( __FILE__ ) ); -
pulseshare/trunk/readme.txt
r3465141 r3465238 5 5 Requires at least: 6.6 6 6 Tested up to: 6.9.1 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 Requires PHP: 8.0 9 9 License: GPLv2 or later … … 91 91 == Changelog == 92 92 93 = 1.1.1 = 94 * Improvement: Spotify API error handling and user feedback in blocks and Elementor widgets. 95 * Fix: Standardized ID comparison in block editors to fix single item selection. 96 93 97 = 1.1.0 = 94 98 * New: Server-side REST API proxy for Spotify — API credentials are no longer exposed to the browser. -
pulseshare/trunk/widgets/AlbumWidget.php
r3465141 r3465238 263 263 264 264 <?php if ( $is_editor && 'single' === $settings['sfwe_album_display_type'] && empty( $settings['sfwe_album_list'] ) ) : ?> 265 <div class="sfwe-album-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 266 <?php esc_html_e( 'Please select a track from the widget settings.', 'pulseshare' ); ?> 267 </div> 265 <?php if ( empty( Helper::get_pulseshareshow_tracks() ) ) : ?> 266 <div class="sfwe-album-editor-placeholder elementor-panel-alert elementor-panel-alert-warning"> 267 <?php esc_html_e( 'Unable to load tracks from Spotify. Please check your API keys and Album ID in the PulseShare settings.', 'pulseshare' ); ?> 268 </div> 269 <?php else : ?> 270 <div class="sfwe-album-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 271 <?php esc_html_e( 'Please select a track from the widget settings.', 'pulseshare' ); ?> 272 </div> 273 <?php endif; ?> 268 274 <?php endif; ?> 269 275 </div> -
pulseshare/trunk/widgets/PodcastWidget.php
r3465141 r3465238 280 280 281 281 <?php if ( $is_editor && 'single' === $settings['sfwe_podcast_display_type'] && empty( $settings['sfwe_podcast_list'] ) ) : ?> 282 <div class="sfwe-podcast-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 283 <?php esc_html_e( 'Please select an episode from the widget settings', 'pulseshare' ); ?> 284 </div> 282 <?php if ( empty( Helper::get_pulseshareall_episodes() ) ) : ?> 283 <div class="sfwe-podcast-editor-placeholder elementor-panel-alert elementor-panel-alert-warning"> 284 <?php esc_html_e( 'Unable to load episodes from Spotify. Please check your API keys and Show ID in the PulseShare settings.', 'pulseshare' ); ?> 285 </div> 286 <?php else : ?> 287 <div class="sfwe-podcast-editor-placeholder elementor-panel-alert elementor-panel-alert-info"> 288 <?php esc_html_e( 'Please select an episode from the widget settings', 'pulseshare' ); ?> 289 </div> 290 <?php endif; ?> 285 291 <?php endif; ?> 286 292 </div>
Note: See TracChangeset
for help on using the changeset viewer.