From 5d166a3fbde94747c0940d5c4457c3d58007c79e Mon Sep 17 00:00:00 2001 From: Mike Auteri Date: Fri, 31 Jan 2025 10:01:04 -0500 Subject: [PATCH 1/2] Fixes that Patricia caught. --- build/blocks/icon/block.json | 3 --- build/blocks/icon/index.asset.php | 2 +- build/blocks/icon/index.js | 2 +- build/blocks/modal/block.json | 8 -------- build/blocks/modal/index.asset.php | 2 +- build/blocks/modal/index.js | 2 +- build/blocks/modal/style-index-rtl.css | 2 +- build/blocks/modal/style-index.css | 2 +- build/blocks/rsvp-response-v2/index.asset.php | 2 +- build/blocks/rsvp-response-v2/index.js | 2 +- src/blocks/icon/block.json | 3 --- src/blocks/modal/block.json | 8 -------- src/blocks/modal/style.scss | 1 + src/blocks/rsvp-response-v2/rsvp-manager.js | 2 +- 14 files changed, 10 insertions(+), 31 deletions(-) diff --git a/build/blocks/icon/block.json b/build/blocks/icon/block.json index 071b35c3e..084fa59f8 100644 --- a/build/blocks/icon/block.json +++ b/build/blocks/icon/block.json @@ -32,9 +32,6 @@ "html": false, "spacing": { "margin": true - }, - "shadow": { - "__experimentalSkipSerialization": true } }, "textdomain": "gatherpress", diff --git a/build/blocks/icon/index.asset.php b/build/blocks/icon/index.asset.php index 650839c54..31d1dfeda 100644 --- a/build/blocks/icon/index.asset.php +++ b/build/blocks/icon/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '9083b216155bcd585c73'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '91751e2f1cadafb0a973'); diff --git a/build/blocks/icon/index.js b/build/blocks/icon/index.js index c25b12069..5aa37c159 100644 --- a/build/blocks/icon/index.js +++ b/build/blocks/icon/index.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={8166:()=>{const e=window.wp.blocks,t=window.wp.blockEditor,r=window.wp.components,s=window.wp.i18n,a=window.wp.element,l=window.ReactJSXRuntime,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/icon","version":"1.0.0","title":"Icon","description":"Adds customizable icons to visually enhance your content.","category":"gatherpress","icon":"format-image","example":{},"attributes":{"icon":{"type":"string","default":"nametag"},"iconColor":{"type":"string","default":""},"iconSize":{"type":"number","default":24}},"supports":{"align":["left","center","right"],"anchor":true,"html":false,"spacing":{"margin":true},"shadow":{"__experimentalSkipSerialization":true}},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');(0,e.registerBlockType)(n,{edit:({attributes:e,setAttributes:n})=>{const o=(0,t.useBlockProps)(),{icon:i,iconColor:c,iconSize:p}=e,[h,u]=(0,a.useState)(""),g=`${function(){if("object"==typeof GatherPress)return"urls.pluginUrl".split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}()}includes/assets/svg/`,d=[{label:(0,s.__)("Calendar","gatherpress"),value:"calendar"},{label:(0,s.__)("Clock","gatherpress"),value:"clock"},{label:(0,s.__)("Dismiss","gatherpress"),value:"dismiss"},{label:(0,s.__)("Editor Help","gatherpress"),value:"editor-help"},{label:(0,s.__)("Groups","gatherpress"),value:"groups"},{label:(0,s.__)("Location","gatherpress"),value:"location"},{label:(0,s.__)("Nametag","gatherpress"),value:"nametag"},{label:(0,s.__)("Yes Alt","gatherpress"),value:"yes-alt"}];return(0,a.useEffect)((()=>{i&&fetch(`${g}${i}.svg`).then((e=>e.text())).then((e=>u(e))).catch((()=>u(`${(0,s.__)("SVG Error","gatherpress")}`)))}),[i,g]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.InspectorControls,{children:(0,l.jsxs)(r.PanelBody,{title:(0,s.__)("Icon Settings","gatherpress"),children:[(0,l.jsx)(r.SelectControl,{label:(0,s.__)("Icon","gatherpress"),value:i,options:d,onChange:e=>n({icon:e})}),(0,l.jsx)(r.ColorPalette,{label:(0,s.__)("Color","gatherpress"),value:c,clearable:!0,onChange:e=>n({iconColor:e})}),(0,l.jsx)(r.RangeControl,{label:(0,s.__)("Size","gatherpress"),value:p,onChange:e=>n({iconSize:e}),min:8,max:240,initialPosition:24})]})}),(0,l.jsx)("div",{...o,children:(0,l.jsx)("div",{style:{fill:c||"inherit",width:`${p}px`,height:`${p}px`,lineHeight:0},dangerouslySetInnerHTML:{__html:h}})})]})},save:()=>null})}},r={};function s(e){var a=r[e];if(void 0!==a)return a.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,s),l.exports}s.m=t,e=[],s.O=(t,r,a,l)=>{if(!r){var n=1/0;for(p=0;p=l)&&Object.keys(s.O).every((e=>s.O[e](r[i])))?r.splice(i--,1):(o=!1,l0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[r,a,l]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={6022:0,3690:0};s.O.j=t=>0===e[t];var t=(t,r)=>{var a,l,[n,o,i]=r,c=0;if(n.some((t=>0!==e[t]))){for(a in o)s.o(o,a)&&(s.m[a]=o[a]);if(i)var p=i(s)}for(t&&t(r);cs(8166)));a=s.O(a)})(); \ No newline at end of file +(()=>{"use strict";var e,t={8166:()=>{const e=window.wp.blocks,t=window.wp.blockEditor,r=window.wp.components,s=window.wp.i18n,a=window.wp.element,l=window.ReactJSXRuntime,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/icon","version":"1.0.0","title":"Icon","description":"Adds customizable icons to visually enhance your content.","category":"gatherpress","icon":"format-image","example":{},"attributes":{"icon":{"type":"string","default":"nametag"},"iconColor":{"type":"string","default":""},"iconSize":{"type":"number","default":24}},"supports":{"align":["left","center","right"],"anchor":true,"html":false,"spacing":{"margin":true}},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');(0,e.registerBlockType)(n,{edit:({attributes:e,setAttributes:n})=>{const o=(0,t.useBlockProps)(),{icon:i,iconColor:c,iconSize:p}=e,[h,g]=(0,a.useState)(""),u=`${function(){if("object"==typeof GatherPress)return"urls.pluginUrl".split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}()}includes/assets/svg/`,d=[{label:(0,s.__)("Calendar","gatherpress"),value:"calendar"},{label:(0,s.__)("Clock","gatherpress"),value:"clock"},{label:(0,s.__)("Dismiss","gatherpress"),value:"dismiss"},{label:(0,s.__)("Editor Help","gatherpress"),value:"editor-help"},{label:(0,s.__)("Groups","gatherpress"),value:"groups"},{label:(0,s.__)("Location","gatherpress"),value:"location"},{label:(0,s.__)("Nametag","gatherpress"),value:"nametag"},{label:(0,s.__)("Yes Alt","gatherpress"),value:"yes-alt"}];return(0,a.useEffect)((()=>{i&&fetch(`${u}${i}.svg`).then((e=>e.text())).then((e=>g(e))).catch((()=>g(`${(0,s.__)("SVG Error","gatherpress")}`)))}),[i,u]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.InspectorControls,{children:(0,l.jsxs)(r.PanelBody,{title:(0,s.__)("Icon Settings","gatherpress"),children:[(0,l.jsx)(r.SelectControl,{label:(0,s.__)("Icon","gatherpress"),value:i,options:d,onChange:e=>n({icon:e})}),(0,l.jsx)(r.ColorPalette,{label:(0,s.__)("Color","gatherpress"),value:c,clearable:!0,onChange:e=>n({iconColor:e})}),(0,l.jsx)(r.RangeControl,{label:(0,s.__)("Size","gatherpress"),value:p,onChange:e=>n({iconSize:e}),min:8,max:240,initialPosition:24})]})}),(0,l.jsx)("div",{...o,children:(0,l.jsx)("div",{style:{fill:c||"inherit",width:`${p}px`,height:`${p}px`,lineHeight:0},dangerouslySetInnerHTML:{__html:h}})})]})},save:()=>null})}},r={};function s(e){var a=r[e];if(void 0!==a)return a.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,s),l.exports}s.m=t,e=[],s.O=(t,r,a,l)=>{if(!r){var n=1/0;for(p=0;p=l)&&Object.keys(s.O).every((e=>s.O[e](r[i])))?r.splice(i--,1):(o=!1,l0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[r,a,l]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={6022:0,3690:0};s.O.j=t=>0===e[t];var t=(t,r)=>{var a,l,[n,o,i]=r,c=0;if(n.some((t=>0!==e[t]))){for(a in o)s.o(o,a)&&(s.m[a]=o[a]);if(i)var p=i(s)}for(t&&t(r);cs(8166)));a=s.O(a)})(); \ No newline at end of file diff --git a/build/blocks/modal/block.json b/build/blocks/modal/block.json index 61c8a7b73..bdda453a6 100644 --- a/build/blocks/modal/block.json +++ b/build/blocks/modal/block.json @@ -12,14 +12,6 @@ "example": {}, "description": "Enables members to easily confirm their attendance for an event.", "attributes": { - "style": { - "type": "object", - "default": { - "color": { - "background": "rgba(0, 0, 0, 0.5)" - } - } - }, "zIndex": { "type": "number", "default": 1000 diff --git a/build/blocks/modal/index.asset.php b/build/blocks/modal/index.asset.php index 72d3431c7..47d37fd83 100644 --- a/build/blocks/modal/index.asset.php +++ b/build/blocks/modal/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '002a02336686f41e94ba'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => 'a4bbf03b2a0d4e985df3'); diff --git a/build/blocks/modal/index.js b/build/blocks/modal/index.js index 49d3ea68f..03cd67409 100644 --- a/build/blocks/modal/index.js +++ b/build/blocks/modal/index.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={7110:()=>{const e=window.wp.blocks,t=window.wp.blockEditor,r=window.wp.data,s=window.wp.i18n,a=window.wp.components,o=window.ReactJSXRuntime,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/modal","version":"1.0.0","title":"Modal","parent":["gatherpress/modal-manager"],"category":"gatherpress","icon":"external","example":{},"description":"Enables members to easily confirm their attendance for an event.","attributes":{"style":{"type":"object","default":{"color":{"background":"rgba(0, 0, 0, 0.5)"}}},"zIndex":{"type":"number","default":1000}},"supports":{"html":false,"color":{"gradients":true,"__experimentalDefaultControls":{"background":true}}},"allowedBlocks":["gatherpress/modal-content"],"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css"}');(0,e.registerBlockType)(n,{edit:({attributes:e,setAttributes:n,clientId:l,isSelected:i})=>{const c=(0,r.useSelect)((e=>e(t.store).hasSelectedInnerBlock(l,!0)),[l]),d=(0,t.useBlockProps)({style:{display:i||c?"block":"none",maxWidth:"none"}}),{zIndex:p,metadata:h={}}=e,g=(0,r.select)("core/block-editor").getBlockParents(l,{levels:1})?.[0];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.InspectorControls,{children:(0,o.jsxs)(a.PanelBody,{title:(0,s.__)("Modal Settings","gatherpress"),children:[(0,o.jsx)(a.TextControl,{label:(0,s.__)("Modal Name","gatherpress"),value:h.name||(0,s.__)("Modal","gatherpress"),onChange:e=>{n({metadata:{...h,name:e}})},help:(0,s.__)("Set a unique name for this modal. This will be used as the aria-label.","gatherpress")}),(0,o.jsx)(a.RangeControl,{label:(0,s.__)("Z-Index","gatherpress"),value:p,onChange:e=>n({zIndex:e}),min:0,max:9999,step:1,help:(0,s.__)("Set the layering position of the modal.","gatherpress")}),(0,o.jsx)(a.Button,{variant:"secondary",onClick:()=>{g&&(0,r.dispatch)("core/block-editor").selectBlock(g)},children:(0,s.__)("Back to Modal Manager","gatherpress")})]})}),(0,o.jsx)("div",{...d,children:(0,o.jsx)(t.InnerBlocks,{template:[["gatherpress/modal-content",{}]]})})]})},save:()=>(0,o.jsx)("div",{...t.useBlockProps.save(),children:(0,o.jsx)(t.InnerBlocks.Content,{})})})}},r={};function s(e){var a=r[e];if(void 0!==a)return a.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.m=t,e=[],s.O=(t,r,a,o)=>{if(!r){var n=1/0;for(d=0;d=o)&&Object.keys(s.O).every((e=>s.O[e](r[i])))?r.splice(i--,1):(l=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[r,a,o]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={2310:0,8170:0};s.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,[n,l,i]=r,c=0;if(n.some((t=>0!==e[t]))){for(a in l)s.o(l,a)&&(s.m[a]=l[a]);if(i)var d=i(s)}for(t&&t(r);cs(7110)));a=s.O(a)})(); \ No newline at end of file +(()=>{"use strict";var e,t={7110:()=>{const e=window.wp.blocks,t=window.wp.blockEditor,r=window.wp.data,s=window.wp.i18n,a=window.wp.components,o=window.ReactJSXRuntime,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/modal","version":"1.0.0","title":"Modal","parent":["gatherpress/modal-manager"],"category":"gatherpress","icon":"external","example":{},"description":"Enables members to easily confirm their attendance for an event.","attributes":{"zIndex":{"type":"number","default":1000}},"supports":{"html":false,"color":{"gradients":true,"__experimentalDefaultControls":{"background":true}}},"allowedBlocks":["gatherpress/modal-content"],"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css"}');(0,e.registerBlockType)(n,{edit:({attributes:e,setAttributes:n,clientId:l,isSelected:i})=>{const c=(0,r.useSelect)((e=>e(t.store).hasSelectedInnerBlock(l,!0)),[l]),d=(0,t.useBlockProps)({style:{display:i||c?"block":"none",maxWidth:"none"}}),{zIndex:p,metadata:h={}}=e,g=(0,r.select)("core/block-editor").getBlockParents(l,{levels:1})?.[0];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.InspectorControls,{children:(0,o.jsxs)(a.PanelBody,{title:(0,s.__)("Modal Settings","gatherpress"),children:[(0,o.jsx)(a.TextControl,{label:(0,s.__)("Modal Name","gatherpress"),value:h.name||(0,s.__)("Modal","gatherpress"),onChange:e=>{n({metadata:{...h,name:e}})},help:(0,s.__)("Set a unique name for this modal. This will be used as the aria-label.","gatherpress")}),(0,o.jsx)(a.RangeControl,{label:(0,s.__)("Z-Index","gatherpress"),value:p,onChange:e=>n({zIndex:e}),min:0,max:9999,step:1,help:(0,s.__)("Set the layering position of the modal.","gatherpress")}),(0,o.jsx)(a.Button,{variant:"secondary",onClick:()=>{g&&(0,r.dispatch)("core/block-editor").selectBlock(g)},children:(0,s.__)("Back to Modal Manager","gatherpress")})]})}),(0,o.jsx)("div",{...d,children:(0,o.jsx)(t.InnerBlocks,{template:[["gatherpress/modal-content",{}]]})})]})},save:()=>(0,o.jsx)("div",{...t.useBlockProps.save(),children:(0,o.jsx)(t.InnerBlocks.Content,{})})})}},r={};function s(e){var a=r[e];if(void 0!==a)return a.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.m=t,e=[],s.O=(t,r,a,o)=>{if(!r){var n=1/0;for(d=0;d=o)&&Object.keys(s.O).every((e=>s.O[e](r[i])))?r.splice(i--,1):(l=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[r,a,o]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={2310:0,8170:0};s.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,[n,l,i]=r,c=0;if(n.some((t=>0!==e[t]))){for(a in l)s.o(l,a)&&(s.m[a]=l[a]);if(i)var d=i(s)}for(t&&t(r);cs(7110)));a=s.O(a)})(); \ No newline at end of file diff --git a/build/blocks/modal/style-index-rtl.css b/build/blocks/modal/style-index-rtl.css index 5f9dce50b..405fdf827 100644 --- a/build/blocks/modal/style-index-rtl.css +++ b/build/blocks/modal/style-index-rtl.css @@ -1 +1 @@ -.wp-block-gatherpress-modal{display:none;inset:0;max-width:none!important;position:fixed!important;z-index:30}.wp-block-gatherpress-modal>div{inset:50% auto auto 50%;margin-left:-50%;position:absolute;transform:translate(50%,-50%)} +.wp-block-gatherpress-modal{background-color:rgba(0,0,0,.5);display:none;inset:0;max-width:none!important;position:fixed!important;z-index:30}.wp-block-gatherpress-modal>div{inset:50% auto auto 50%;margin-left:-50%;position:absolute;transform:translate(50%,-50%)} diff --git a/build/blocks/modal/style-index.css b/build/blocks/modal/style-index.css index 60f13a98c..576e8a215 100644 --- a/build/blocks/modal/style-index.css +++ b/build/blocks/modal/style-index.css @@ -1 +1 @@ -.wp-block-gatherpress-modal{display:none;inset:0;max-width:none!important;position:fixed!important;z-index:30}.wp-block-gatherpress-modal>div{inset:50% auto auto 50%;margin-right:-50%;position:absolute;transform:translate(-50%,-50%)} +.wp-block-gatherpress-modal{background-color:rgba(0,0,0,.5);display:none;inset:0;max-width:none!important;position:fixed!important;z-index:30}.wp-block-gatherpress-modal>div{inset:50% auto auto 50%;margin-right:-50%;position:absolute;transform:translate(-50%,-50%)} diff --git a/build/blocks/rsvp-response-v2/index.asset.php b/build/blocks/rsvp-response-v2/index.asset.php index 3b844900d..f3cb33cff 100644 --- a/build/blocks/rsvp-response-v2/index.asset.php +++ b/build/blocks/rsvp-response-v2/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '506d833227637b32b848'); + array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'fd4b1bfea48cbed7034d'); diff --git a/build/blocks/rsvp-response-v2/index.js b/build/blocks/rsvp-response-v2/index.js index 8e83e86d7..2a5b20a42 100644 --- a/build/blocks/rsvp-response-v2/index.js +++ b/build/blocks/rsvp-response-v2/index.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={8392:(e,t,s)=>{const r=window.wp.blocks,n=window.wp.blockEditor,a=window.wp.i18n,o=window.wp.components,i=window.wp.element,p=window.wp.apiFetch;var l=s.n(p);const d=window.wp.data,c=window.wp.coreData;function u(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const g=window.ReactJSXRuntime,h=({defaultStatus:e,setDefaultStatus:t})=>{var s;const r=u("eventDetails.responses"),n=u("eventDetails.postId"),[p,h]=(0,i.useState)(r),m=p[e].responses,{userList:v}=(0,d.useSelect)((e=>{const{getEntityRecords:t}=e(c.store);return{userList:t("root","user",{per_page:-1})}}),[]),f=null!==(s=v?.reduce(((e,t)=>({...e,[t.username]:t})),{}))&&void 0!==s?s:{},w=(e,t="attending")=>{l()({path:u("urls.eventApiPath")+"/rsvp",method:"POST",data:{post_id:n,status:t,user_id:e,_wpnonce:u("misc.nonce")}}).then((e=>{h(e.responses),function(e,t){if("object"!=typeof GatherPress)return;const s="eventDetails.responses".split("."),r=s.pop();s.reduce(((e,t)=>{var s;return null!==(s=e[t])&&void 0!==s?s:e[t]={}}),GatherPress)[r]=t}(0,e.responses)}))};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(o.SelectControl,{label:(0,a.__)("RSVP Status","gatherpress"),value:e,options:[{label:(0,a._x)("Attending","RSVP status option in dropdown","gatherpress"),value:"attending"},{label:(0,a._x)("Waiting List","RSVP status option in dropdown","gatherpress"),value:"waiting_list"},{label:(0,a._x)("Not Attending","RSVP status option in dropdown","gatherpress"),value:"not_attending"}],onChange:e=>t(e)}),(0,g.jsx)(o.FormTokenField,{label:(0,a.__)("Members","gatherpress"),value:m&&m.map((e=>({id:e.id,value:e.name}))),tokenizeOnSpace:!0,onChange:async t=>{t.length>m.length?t.forEach((t=>{f[t]&&w(f[t].id,e)})):m.forEach((e=>{!1===t.some((t=>t.id===e.id))&&w(e.id,"no_status")}))},suggestions:Object.keys(f),maxSuggestions:20},"query-controls-topics-select")]})},m={attending:(0,a._x)("Attending (%d)","Filter option to view list of confirmed attendees","gatherpress"),waitingList:(0,a._x)("Waiting List (%d)","Filter option to view list of waitlisted attendees","gatherpress"),notAttending:(0,a._x)("Not Attending (%d)","Filter option to view list of declined attendees","gatherpress"),noOne:(0,a.__)("No one is attending this event yet.","gatherpress")},v=[["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20",margin:{bottom:"var:preset|spacing|30"}}},layout:{type:"flex",flexWrap:"nowrap",justifyContent:"space-between"}},[["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20",margin:{bottom:"var:preset|spacing|30"}}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"groups"}],["gatherpress/dropdown",{actAsSelect:!0,dropdownId:"dropdown-7968ad05-cf12-41ae-8392-7fb01e166188",label:m.attending,metadata:{name:m.attending}},[["gatherpress/dropdown-item",{text:`${m.attending}`,metadata:{name:m.attending},className:"gatherpress--rsvp-attending"}],["gatherpress/dropdown-item",{text:`${m.waitingList}`,metadata:{name:m.waitingList},className:"gatherpress--rsvp-waiting-list"}],["gatherpress/dropdown-item",{text:`${m.notAttending}`,metadata:{name:m.notAttending},className:"gatherpress--rsvp-not-attending"}]]]]],["gatherpress/rsvp-response-toggle"]]],["core/group",{layout:{type:"grid",columns:3,justifyContent:"center",alignContent:"space-around",minimumColumnWidth:"8rem"},className:"gatherpress--rsvp-responses"},[["gatherpress/rsvp-template",{}]]],["core/group",{metadata:{name:(0,a._x)("Empty RSVP","Block name displayed in the editor","gatherpress")},className:"gatherpress--empty-rsvp gatherpress--is-not-visible"},[["core/paragraph",{content:m.noOne,metadata:{name:(0,a._x)("Empty RSVP Text","Block name displayed in the editor","gatherpress")}}]]]],f=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/rsvp-response-v2","version":"2.0.0","title":"RSVP Response V2","category":"gatherpress","icon":"groups","example":{},"description":"Displays a list of members who have confirmed their attendance for an event.","usesContext":["postId","queryId"],"attributes":{"rsvpLimitEnabled":{"type":"boolean","default":false},"rsvpLimit":{"type":"number","default":8}},"supports":{"gatherpress":{"postIdOverride":true},"align":["wide","full"],"interactivity":true,"html":false},"providesContext":{"commentId":"commentId","postId":"postId","gatherpress/rsvpLimitEnabled":"rsvpLimitEnabled","gatherpress/rsvpLimit":"rsvpLimit"},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js"}');(0,r.registerBlockType)(f,{edit:({attributes:e,setAttributes:t,context:r})=>{var p,l;const d=(0,n.useBlockProps)(),[c,m]=(0,i.useState)(!1),[f,w]=(0,i.useState)(!1),[b,y]=(0,i.useState)("attending"),[x,_]=(0,i.useState)(null),[S,j]=(0,i.useState)(!0),[k,P]=(0,i.useState)(null),C=null!==(p=null!==(l=e?.postId)&&void 0!==l?l:r?.postId)&&void 0!==p?p:null,{rsvpLimitEnabled:E,rsvpLimit:L}=e;return(0,i.useEffect)((()=>{const e=s.g.document.querySelectorAll(".gatherpress--empty-rsvp"),t=s.g.document.querySelectorAll(".gatherpress--rsvp-responses");e.forEach((e=>{e.style.setProperty("display",f?"block":"none","important")})),t.forEach((e=>{f?e.style.setProperty("display","none","important"):e.style.removeProperty("display")}))}),[f,x]),(0,i.useEffect)((()=>{if(!C)return _(null),void j(!1);j(!0),P(null),async function(e){const t=u("urls.eventApiUrl");return(await fetch(`${t}/rsvp-responses?post_id=${e}`)).json()}(C).then((e=>{_(e.data),j(!1)})).catch((e=>{P(e.message),j(!1)}))}),[C]),S?(0,g.jsx)("div",{...d,children:(0,g.jsx)(o.Spinner,{})}):k?(0,g.jsx)("div",{...d,children:(0,g.jsx)("p",{children:(0,a.__)("Failed to load RSVP responses.","gatherpress")})}):(0,g.jsx)("div",{...d,children:(0,g.jsxs)(n.BlockContextProvider,{value:{"gatherpress/rsvpResponses":x,"gatherpress/rsvpLimitEnabled":E,"gatherpress/rsvpLimit":L,postId:C},children:[(0,g.jsx)(n.InspectorControls,{children:(0,g.jsxs)(o.PanelBody,{children:[(0,g.jsx)(o.ToggleControl,{label:(0,a.__)("Show Empty RSVP Block","gatherpress"),checked:f,onChange:e=>w(e),help:(0,a.__)("Toggle to show or hide the Empty RSVP block.","gatherpress")}),(0,g.jsx)(o.ToggleControl,{label:(0,a.__)("Limit RSVP Display","gatherpress"),checked:E,onChange:()=>t({rsvpLimitEnabled:!E}),help:(0,a.__)("Enable to limit the number of RSVPs displayed in this block.","gatherpress")}),E&&(0,g.jsx)(o.__experimentalNumberControl,{label:(0,a.__)("RSVP Display Limit","gatherpress"),value:L,onChange:e=>t({rsvpLimit:parseInt(e,10)||8}),min:1,max:100,help:(0,a.__)("Set the maximum number of RSVPs to display. Default is 8.","gatherpress")})]})}),(0,g.jsx)(n.BlockControls,{children:(0,g.jsx)(o.ToolbarGroup,{children:(0,g.jsx)(o.ToolbarButton,{label:(0,a.__)("Edit","gatherpress"),text:c?(0,a.__)("Preview","gatherpress"):(0,a.__)("Edit","gatherpress"),onClick:e=>{e.preventDefault(),m(!c)}})})}),c&&(0,g.jsx)(h,{defaultStatus:b,setDefaultStatus:y}),!c&&(0,g.jsx)(n.InnerBlocks,{template:v})]})})},save:()=>(0,g.jsx)("div",{...n.useBlockProps.save(),children:(0,g.jsx)(n.InnerBlocks.Content,{})})})}},s={};function r(e){var n=s[e];if(void 0!==n)return n.exports;var a=s[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.m=t,e=[],r.O=(t,s,n,a)=>{if(!s){var o=1/0;for(d=0;d=a)&&Object.keys(r.O).every((e=>r.O[e](s[p])))?s.splice(p--,1):(i=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[s,n,a]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={8291:0,6507:0};r.O.j=t=>0===e[t];var t=(t,s)=>{var n,a,[o,i,p]=s,l=0;if(o.some((t=>0!==e[t]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(p)var d=p(r)}for(t&&t(s);lr(8392)));n=r.O(n)})(); \ No newline at end of file +(()=>{"use strict";var e,t={8392:(e,t,s)=>{const r=window.wp.blocks,n=window.wp.blockEditor,a=window.wp.i18n,o=window.wp.components,i=window.wp.element,p=window.wp.apiFetch;var l=s.n(p);const d=window.wp.data,c=window.wp.coreData;function u(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const g=window.ReactJSXRuntime,h=({defaultStatus:e,setDefaultStatus:t})=>{var s;const r=u("eventDetails.responses"),n=u("eventDetails.postId"),[p,h]=(0,i.useState)(r),m=p[e].records,{userList:v}=(0,d.useSelect)((e=>{const{getEntityRecords:t}=e(c.store);return{userList:t("root","user",{per_page:-1})}}),[]),f=null!==(s=v?.reduce(((e,t)=>({...e,[t.username]:t})),{}))&&void 0!==s?s:{},w=(e,t="attending")=>{l()({path:u("urls.eventApiPath")+"/rsvp",method:"POST",data:{post_id:n,status:t,user_id:e,_wpnonce:u("misc.nonce")}}).then((e=>{h(e.responses),function(e,t){if("object"!=typeof GatherPress)return;const s="eventDetails.responses".split("."),r=s.pop();s.reduce(((e,t)=>{var s;return null!==(s=e[t])&&void 0!==s?s:e[t]={}}),GatherPress)[r]=t}(0,e.responses)}))};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(o.SelectControl,{label:(0,a.__)("RSVP Status","gatherpress"),value:e,options:[{label:(0,a._x)("Attending","RSVP status option in dropdown","gatherpress"),value:"attending"},{label:(0,a._x)("Waiting List","RSVP status option in dropdown","gatherpress"),value:"waiting_list"},{label:(0,a._x)("Not Attending","RSVP status option in dropdown","gatherpress"),value:"not_attending"}],onChange:e=>t(e)}),(0,g.jsx)(o.FormTokenField,{label:(0,a.__)("Members","gatherpress"),value:m&&m.map((e=>({id:e.id,value:e.name}))),tokenizeOnSpace:!0,onChange:async t=>{t.length>m.length?t.forEach((t=>{f[t]&&w(f[t].id,e)})):m.forEach((e=>{!1===t.some((t=>t.id===e.id))&&w(e.id,"no_status")}))},suggestions:Object.keys(f),maxSuggestions:20},"query-controls-topics-select")]})},m={attending:(0,a._x)("Attending (%d)","Filter option to view list of confirmed attendees","gatherpress"),waitingList:(0,a._x)("Waiting List (%d)","Filter option to view list of waitlisted attendees","gatherpress"),notAttending:(0,a._x)("Not Attending (%d)","Filter option to view list of declined attendees","gatherpress"),noOne:(0,a.__)("No one is attending this event yet.","gatherpress")},v=[["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20",margin:{bottom:"var:preset|spacing|30"}}},layout:{type:"flex",flexWrap:"nowrap",justifyContent:"space-between"}},[["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20",margin:{bottom:"var:preset|spacing|30"}}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"groups"}],["gatherpress/dropdown",{actAsSelect:!0,dropdownId:"dropdown-7968ad05-cf12-41ae-8392-7fb01e166188",label:m.attending,metadata:{name:m.attending}},[["gatherpress/dropdown-item",{text:`${m.attending}`,metadata:{name:m.attending},className:"gatherpress--rsvp-attending"}],["gatherpress/dropdown-item",{text:`${m.waitingList}`,metadata:{name:m.waitingList},className:"gatherpress--rsvp-waiting-list"}],["gatherpress/dropdown-item",{text:`${m.notAttending}`,metadata:{name:m.notAttending},className:"gatherpress--rsvp-not-attending"}]]]]],["gatherpress/rsvp-response-toggle"]]],["core/group",{layout:{type:"grid",columns:3,justifyContent:"center",alignContent:"space-around",minimumColumnWidth:"8rem"},className:"gatherpress--rsvp-responses"},[["gatherpress/rsvp-template",{}]]],["core/group",{metadata:{name:(0,a._x)("Empty RSVP","Block name displayed in the editor","gatherpress")},className:"gatherpress--empty-rsvp gatherpress--is-not-visible"},[["core/paragraph",{content:m.noOne,metadata:{name:(0,a._x)("Empty RSVP Text","Block name displayed in the editor","gatherpress")}}]]]],f=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/rsvp-response-v2","version":"2.0.0","title":"RSVP Response V2","category":"gatherpress","icon":"groups","example":{},"description":"Displays a list of members who have confirmed their attendance for an event.","usesContext":["postId","queryId"],"attributes":{"rsvpLimitEnabled":{"type":"boolean","default":false},"rsvpLimit":{"type":"number","default":8}},"supports":{"gatherpress":{"postIdOverride":true},"align":["wide","full"],"interactivity":true,"html":false},"providesContext":{"commentId":"commentId","postId":"postId","gatherpress/rsvpLimitEnabled":"rsvpLimitEnabled","gatherpress/rsvpLimit":"rsvpLimit"},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js"}');(0,r.registerBlockType)(f,{edit:({attributes:e,setAttributes:t,context:r})=>{var p,l;const d=(0,n.useBlockProps)(),[c,m]=(0,i.useState)(!1),[f,w]=(0,i.useState)(!1),[b,y]=(0,i.useState)("attending"),[x,_]=(0,i.useState)(null),[S,j]=(0,i.useState)(!0),[k,P]=(0,i.useState)(null),C=null!==(p=null!==(l=e?.postId)&&void 0!==l?l:r?.postId)&&void 0!==p?p:null,{rsvpLimitEnabled:E,rsvpLimit:L}=e;return(0,i.useEffect)((()=>{const e=s.g.document.querySelectorAll(".gatherpress--empty-rsvp"),t=s.g.document.querySelectorAll(".gatherpress--rsvp-responses");e.forEach((e=>{e.style.setProperty("display",f?"block":"none","important")})),t.forEach((e=>{f?e.style.setProperty("display","none","important"):e.style.removeProperty("display")}))}),[f,x]),(0,i.useEffect)((()=>{if(!C)return _(null),void j(!1);j(!0),P(null),async function(e){const t=u("urls.eventApiUrl");return(await fetch(`${t}/rsvp-responses?post_id=${e}`)).json()}(C).then((e=>{_(e.data),j(!1)})).catch((e=>{P(e.message),j(!1)}))}),[C]),S?(0,g.jsx)("div",{...d,children:(0,g.jsx)(o.Spinner,{})}):k?(0,g.jsx)("div",{...d,children:(0,g.jsx)("p",{children:(0,a.__)("Failed to load RSVP responses.","gatherpress")})}):(0,g.jsx)("div",{...d,children:(0,g.jsxs)(n.BlockContextProvider,{value:{"gatherpress/rsvpResponses":x,"gatherpress/rsvpLimitEnabled":E,"gatherpress/rsvpLimit":L,postId:C},children:[(0,g.jsx)(n.InspectorControls,{children:(0,g.jsxs)(o.PanelBody,{children:[(0,g.jsx)(o.ToggleControl,{label:(0,a.__)("Show Empty RSVP Block","gatherpress"),checked:f,onChange:e=>w(e),help:(0,a.__)("Toggle to show or hide the Empty RSVP block.","gatherpress")}),(0,g.jsx)(o.ToggleControl,{label:(0,a.__)("Limit RSVP Display","gatherpress"),checked:E,onChange:()=>t({rsvpLimitEnabled:!E}),help:(0,a.__)("Enable to limit the number of RSVPs displayed in this block.","gatherpress")}),E&&(0,g.jsx)(o.__experimentalNumberControl,{label:(0,a.__)("RSVP Display Limit","gatherpress"),value:L,onChange:e=>t({rsvpLimit:parseInt(e,10)||8}),min:1,max:100,help:(0,a.__)("Set the maximum number of RSVPs to display. Default is 8.","gatherpress")})]})}),(0,g.jsx)(n.BlockControls,{children:(0,g.jsx)(o.ToolbarGroup,{children:(0,g.jsx)(o.ToolbarButton,{label:(0,a.__)("Edit","gatherpress"),text:c?(0,a.__)("Preview","gatherpress"):(0,a.__)("Edit","gatherpress"),onClick:e=>{e.preventDefault(),m(!c)}})})}),c&&(0,g.jsx)(h,{defaultStatus:b,setDefaultStatus:y}),!c&&(0,g.jsx)(n.InnerBlocks,{template:v})]})})},save:()=>(0,g.jsx)("div",{...n.useBlockProps.save(),children:(0,g.jsx)(n.InnerBlocks.Content,{})})})}},s={};function r(e){var n=s[e];if(void 0!==n)return n.exports;var a=s[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.m=t,e=[],r.O=(t,s,n,a)=>{if(!s){var o=1/0;for(d=0;d=a)&&Object.keys(r.O).every((e=>r.O[e](s[p])))?s.splice(p--,1):(i=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[s,n,a]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={8291:0,6507:0};r.O.j=t=>0===e[t];var t=(t,s)=>{var n,a,[o,i,p]=s,l=0;if(o.some((t=>0!==e[t]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(p)var d=p(r)}for(t&&t(s);lr(8392)));n=r.O(n)})(); \ No newline at end of file diff --git a/src/blocks/icon/block.json b/src/blocks/icon/block.json index 73ba6714b..e795c3758 100644 --- a/src/blocks/icon/block.json +++ b/src/blocks/icon/block.json @@ -28,9 +28,6 @@ "html": false, "spacing": { "margin": true - }, - "shadow": { - "__experimentalSkipSerialization": true } }, "textdomain": "gatherpress", diff --git a/src/blocks/modal/block.json b/src/blocks/modal/block.json index 502c08574..bd242bec6 100644 --- a/src/blocks/modal/block.json +++ b/src/blocks/modal/block.json @@ -10,14 +10,6 @@ "example": {}, "description": "Enables members to easily confirm their attendance for an event.", "attributes": { - "style": { - "type": "object", - "default": { - "color": { - "background": "rgba(0, 0, 0, 0.5)" - } - } - }, "zIndex": { "type": "number", "default": 1000 diff --git a/src/blocks/modal/style.scss b/src/blocks/modal/style.scss index 89c8bfba7..ab4d2d099 100644 --- a/src/blocks/modal/style.scss +++ b/src/blocks/modal/style.scss @@ -4,6 +4,7 @@ position: fixed !important; z-index: 30; inset: 0; + background-color: rgba(0, 0, 0, 0.5); > div { position: absolute; diff --git a/src/blocks/rsvp-response-v2/rsvp-manager.js b/src/blocks/rsvp-response-v2/rsvp-manager.js index bfcd98b41..99762a076 100644 --- a/src/blocks/rsvp-response-v2/rsvp-manager.js +++ b/src/blocks/rsvp-response-v2/rsvp-manager.js @@ -32,7 +32,7 @@ const RsvpManager = ({ defaultStatus, setDefaultStatus }) => { const responses = getFromGlobal('eventDetails.responses'); const postId = getFromGlobal('eventDetails.postId'); const [rsvpResponse, setRsvpResponse] = useState(responses); - const attendees = rsvpResponse[defaultStatus].responses; + const attendees = rsvpResponse[defaultStatus].records; /** * Fetches user records from the core store via getEntityRecords. From 64d622739e41f24eee84946571c9416e41485733 Mon Sep 17 00:00:00 2001 From: Mike Auteri Date: Fri, 31 Jan 2025 10:11:28 -0500 Subject: [PATCH 2/2] CSS linting fix. --- src/blocks/modal/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/modal/style.scss b/src/blocks/modal/style.scss index ab4d2d099..f2df8282d 100644 --- a/src/blocks/modal/style.scss +++ b/src/blocks/modal/style.scss @@ -4,7 +4,7 @@ position: fixed !important; z-index: 30; inset: 0; - background-color: rgba(0, 0, 0, 0.5); + background-color: rgb(0 0 0 / 50%); > div { position: absolute;