From 0a1eb85f677524b14d2fdd96adc0570f6234ff3b Mon Sep 17 00:00:00 2001 From: Mike Auteri Date: Sun, 26 Jan 2025 15:13:45 -0500 Subject: [PATCH] Update metadata names for RSVP templates. --- build/blocks/rsvp-v2/index.asset.php | 2 +- build/blocks/rsvp-v2/index.js | 6 +- src/blocks/rsvp-v2/templates/attending.js | 53 +++++++++++- src/blocks/rsvp-v2/templates/no-status.js | 81 ++++++++++++++++++- src/blocks/rsvp-v2/templates/not-attending.js | 53 +++++++++++- src/blocks/rsvp-v2/templates/past.js | 11 ++- src/blocks/rsvp-v2/templates/waiting-list.js | 55 ++++++++++++- 7 files changed, 246 insertions(+), 15 deletions(-) diff --git a/build/blocks/rsvp-v2/index.asset.php b/build/blocks/rsvp-v2/index.asset.php index e153f1dd0..18dfff889 100644 --- a/build/blocks/rsvp-v2/index.asset.php +++ b/build/blocks/rsvp-v2/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '1b2fa879959531e01563'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '60364ee630288db57bf2'); diff --git a/build/blocks/rsvp-v2/index.js b/build/blocks/rsvp-v2/index.js index 061a7c47d..ebe205494 100644 --- a/build/blocks/rsvp-v2/index.js +++ b/build/blocks/rsvp-v2/index.js @@ -1,3 +1,3 @@ -(()=>{"use strict";var t,e={546:()=>{const t=window.wp.blocks,e=window.wp.blockEditor,a=window.wp.components,s=window.wp.i18n,r=window.wp.element,o=window.wp.data,n=[["gatherpress/modal-manager",{style:{spacing:{blockGap:"var:preset|spacing|40"}}},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("RSVP Buttons","Section title in editor","gatherpress")}},[["core/button",{text:(0,s._x)("Edit RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal"}]]],["core/group",{style:{spacing:{blockGap:"0"}}},[["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20"}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"yes-alt",iconSize:24}],["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Attending","RSVP status indicator","gatherpress")}]]],["gatherpress/rsvp-guest-count-display",{}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Modal title in editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("You're Attending","RSVP modal header","gatherpress")}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Not Attending button below.","gatherpress")}],["gatherpress/rsvp-guest-count-input",{}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}}},[["core/button",{text:(0,s._x)("Not Attending","RSVP button label for declining event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp"}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal"}]]]]]]]]]];function l(t){if("object"==typeof GatherPress)return t.split(".").reduce(((t,e)=>t&&t[e]),GatherPress)}const i=[["gatherpress/modal-manager",{},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("RSVP Buttons","Section title in editor","gatherpress")}},[["core/button",{text:(0,s._x)("RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal"}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Modal title in editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("RSVP to this event","RSVP modal header","gatherpress")}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Attending button below.","gatherpress")}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}}},[["core/button",{text:(0,s._x)("Attending","RSVP button label for confirming event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp"}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal"}]]]]]]],["gatherpress/modal",{className:"gatherpress--is-login-modal",metadata:{name:(0,s._x)("Login Modal","Block title for the login modal","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Login Required","Login modal header","gatherpress")}],["core/paragraph",{content:(0,s.sprintf)(/* translators: %s: Login URL. */ /* translators: %s: Login URL. */ -(0,s.__)('This action requires an account. Please Login to RSVP to this event.',"gatherpress"),l("urls.loginUrl")),className:"gatherpress--has-login-url"}],["core/paragraph",{content:(0,s.sprintf)(/* translators: %s: Registration URL. */ /* translators: %s: Registration URL. */ -(0,s.__)('Don\'t have an account? Register here to create one.',"gatherpress"),l("urls.registrationUrl")),className:"gatherpress--has-registration-url"}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}}},[["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"gatherpress--close-modal"}]]]]]]]]]],p=[["gatherpress/modal-manager",{style:{spacing:{blockGap:"var:preset|spacing|40"}}},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("RSVP Buttons","Section title in editor","gatherpress")}},[["core/button",{text:(0,s._x)("Edit RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal"}]]],["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20"}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"dismiss",iconSize:24}],["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Not Attending","RSVP status indicator","gatherpress")}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Modal title in editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("You're Not Attending","RSVP modal header","gatherpress")}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Attending button below.","gatherpress")}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}}},[["core/button",{text:(0,s._x)("Attending","RSVP button label for confirming event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp"}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal"}]]]]]]]]]],g={no_status:i,attending:n,waiting_list:[["gatherpress/modal-manager",{style:{spacing:{blockGap:"var:preset|spacing|40"}}},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("RSVP Buttons","Section title in editor","gatherpress")}},[["core/button",{text:(0,s._x)("Edit RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal"}]]],["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20"}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"clock",iconSize:24}],["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Waiting List","RSVP status indicator","gatherpress")}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Modal title in editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("You're Wait Listed","RSVP modal header","gatherpress")}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Not Attending button below.","gatherpress")}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}}},[["core/button",{text:(0,s._x)("Not Attending","RSVP button label for declining event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp"}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal"}]]]]]]]]]],not_attending:p,past:[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("RSVP Buttons","Section title in editor","gatherpress")}},[["core/button",{text:(0,s._x)("Past Event","Button label for past RSVP","gatherpress"),tagName:"button",className:"gatherpress--is-disabled"}]]]]},c=window.ReactJSXRuntime;function d(e){return e.map((([e,a,s])=>(0,t.createBlock)(e,a,d(s||[]))))}const u=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/rsvp-v2","version":"2.0.0","title":"RSVP V2","category":"gatherpress","icon":"insert","example":{},"description":"Enables members to easily confirm their attendance for an event.","usesContext":["postId","queryId"],"attributes":{"serializedInnerBlocks":{"type":"string","default":"[]"},"selectedStatus":{"type":"string","default":"no_status"}},"supports":{"gatherpress":{"postIdOverride":true},"html":false,"interactivity":true},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js"}');(0,t.registerBlockType)(u,{edit:({attributes:n,setAttributes:l,clientId:i})=>{const{serializedInnerBlocks:p="{}",selectedStatus:u}=n,h=(0,e.useBlockProps)(),{replaceInnerBlocks:m}=(0,o.useDispatch)(e.store),b=(0,o.useSelect)((t=>t(e.store).getBlocks(i)),[i]),y=(0,r.useCallback)(((e,a,s)=>{const r=JSON.parse(p||"{}"),o=(0,t.serialize)(s),n={...r,[e]:o};delete n[a],l({serializedInnerBlocks:JSON.stringify(n)})}),[p,l]),f=(0,r.useCallback)((e=>{const a=JSON.parse(p||"{}")[e];a&&a.length>0&&m(i,(0,t.parse)(a,{}))}),[i,m,p]);return(0,r.useEffect)((()=>{(()=>{const e=JSON.parse(p||"{}"),a=Object.keys(g).reduce(((a,s)=>{if(e[s])return a[s]=e[s],a;if(s!==u){const e=d(g[s]);a[s]=(0,t.serialize)(e)}return a}),{...e});l({serializedInnerBlocks:JSON.stringify(a)})})()}),[p,l,u]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e.InspectorControls,{children:(0,c.jsx)(a.PanelBody,{children:(0,c.jsx)(a.SelectControl,{label:(0,s.__)("RSVP Status","gatherpress"),value:u,options:[{label:(0,s.__)("No Status (User has not responded)","gatherpress"),value:"no_status"},{label:(0,s.__)("Attending (User is confirmed)","gatherpress"),value:"attending"},{label:(0,s.__)("Waiting List (Pending confirmation)","gatherpress"),value:"waiting_list"},{label:(0,s.__)("Not Attending (User declined)","gatherpress"),value:"not_attending"},{label:(0,s.__)("Past Event (Event has already occurred)","gatherpress"),value:"past"}],onChange:t=>{f(t),l({selectedStatus:t}),y(u,t,b)}})})}),(0,c.jsx)("div",{...h,children:(0,c.jsx)(e.InnerBlocks,{template:g[u]})})]})},save:()=>(0,c.jsx)("div",{...e.useBlockProps.save(),children:(0,c.jsx)(e.InnerBlocks.Content,{})})})}},a={};function s(t){var r=a[t];if(void 0!==r)return r.exports;var o=a[t]={exports:{}};return e[t](o,o.exports,s),o.exports}s.m=e,t=[],s.O=(e,a,r,o)=>{if(!a){var n=1/0;for(g=0;g=o)&&Object.keys(s.O).every((t=>s.O[t](a[i])))?a.splice(i--,1):(l=!1,o0&&t[g-1][2]>o;g--)t[g]=t[g-1];t[g]=[a,r,o]},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={345:0,525:0};s.O.j=e=>0===t[e];var e=(e,a)=>{var r,o,[n,l,i]=a,p=0;if(n.some((e=>0!==t[e]))){for(r in l)s.o(l,r)&&(s.m[r]=l[r]);if(i)var g=i(s)}for(e&&e(a);ps(546)));r=s.O(r)})(); \ No newline at end of file +(()=>{"use strict";var e,t={546:()=>{const e=window.wp.blocks,t=window.wp.blockEditor,a=window.wp.components,s=window.wp.i18n,r=window.wp.element,n=window.wp.data,o=[["gatherpress/modal-manager",{style:{spacing:{blockGap:"var:preset|spacing|40"}}},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Edit RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}]]],["core/group",{style:{spacing:{blockGap:"0"}}},[["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20"}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"yes-alt",iconSize:24}],["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Attending","RSVP status indicator","gatherpress"),metadata:{name:(0,s._x)("RSVP Status","Block name displayed in the editor","gatherpress")}}]]],["gatherpress/rsvp-guest-count-display",{}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Modal title in editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("You're Attending","RSVP modal header","gatherpress"),metadata:{name:(0,s._x)("RSVP Heading","Block name displayed in the editor","gatherpress")}}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Not Attending button below.","gatherpress"),metadata:{name:(0,s._x)("RSVP Info","Block name displayed in the editor","gatherpress")}}],["gatherpress/rsvp-guest-count-input",{}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Not Attending","RSVP button label for declining event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal",metadata:{name:(0,s._x)("Close Button","Block name displayed in the editor","gatherpress")}}]]]]]]]]]];function i(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const l=[["gatherpress/modal-manager",{},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Modal title in editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("RSVP to this event","RSVP modal header","gatherpress"),metadata:{name:(0,s._x)("RSVP Heading","Block name displayed in the editor","gatherpress")}}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Attending button below.","gatherpress"),metadata:{name:(0,s._x)("RSVP Info","Block name displayed in the editor","gatherpress")}}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Attending","RSVP button label for confirming event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal",metadata:{name:(0,s._x)("Close Button","Block name displayed in the editor","gatherpress")}}]]]]]]],["gatherpress/modal",{className:"gatherpress--is-login-modal",metadata:{name:(0,s._x)("Login Modal","Block title for the login modal","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Login Required","Login modal header","gatherpress"),metadata:{name:(0,s._x)("Login Heading","Block name displayed in the editor","gatherpress")}}],["core/paragraph",{content:(0,s.sprintf)(/* translators: %s: Login URL. */ /* translators: %s: Login URL. */ +(0,s.__)('This action requires an account. Please Login to RSVP to this event.',"gatherpress"),i("urls.loginUrl")),className:"gatherpress--has-login-url",metadata:{name:(0,s._x)("Login Info","Block name displayed in the editor","gatherpress")}}],["core/paragraph",{content:(0,s.sprintf)(/* translators: %s: Registration URL. */ /* translators: %s: Registration URL. */ +(0,s.__)('Don\'t have an account? Register here to create one.',"gatherpress"),i("urls.registrationUrl")),className:"gatherpress--has-registration-url",metadata:{name:(0,s._x)("Register Info","Block name displayed in the editor","gatherpress")}}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"gatherpress--close-modal",metadata:{name:(0,s._x)("Close Button","Block name displayed in the editor","gatherpress")}}]]]]]]]]]],p=[["gatherpress/modal-manager",{style:{spacing:{blockGap:"var:preset|spacing|40"}}},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Edit RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}]]],["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20"}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"dismiss",iconSize:24}],["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Not Attending","RSVP status indicator","gatherpress"),metadata:{name:(0,s._x)("RSVP Status","Block name displayed in the editor","gatherpress")}}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Modal title in editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("You're Not Attending","RSVP modal header","gatherpress"),metadata:{name:(0,s._x)("RSVP Heading","Block name displayed in the editor","gatherpress")}}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Attending button below.","gatherpress"),metadata:{name:(0,s._x)("RSVP Info","Block name displayed in the editor","gatherpress")}}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Attending","RSVP button label for confirming event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal",metadata:{name:(0,s._x)("Close Button","Block name displayed in the editor","gatherpress")}}]]]]]]]]]],d={no_status:l,attending:o,waiting_list:[["gatherpress/modal-manager",{style:{spacing:{blockGap:"var:preset|spacing|40"}}},[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Edit RSVP","Button label for editing RSVP","gatherpress"),tagName:"button",className:"gatherpress--open-modal",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}]]],["core/group",{style:{spacing:{blockGap:"var:preset|spacing|20"}},layout:{type:"flex",flexWrap:"nowrap"}},[["gatherpress/icon",{icon:"clock",iconSize:24}],["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("Waiting List","RSVP status indicator","gatherpress"),metadata:{name:(0,s._x)("RSVP Status","Block name displayed in the editor","gatherpress")}}]]],["gatherpress/modal",{className:"gatherpress--is-rsvp-modal",metadata:{name:(0,s._x)("RSVP Modal","Block name displayed in the editor","gatherpress")}},[["gatherpress/modal-content",{},[["core/paragraph",{style:{spacing:{margin:{top:"0"},padding:{top:"0"}}},content:(0,s._x)("You're Wait Listed","RSVP modal header","gatherpress"),metadata:{name:(0,s._x)("RSVP Heading","Block name displayed in the editor","gatherpress")}}],["core/paragraph",{content:(0,s.__)("To set or change your attending status, simply click the Not Attending button below.","gatherpress"),metadata:{name:(0,s._x)("RSVP Info","Block name displayed in the editor","gatherpress")}}],["gatherpress/rsvp-anonymous-checkbox",{}],["core/buttons",{align:"left",layout:{type:"flex",justifyContent:"flex-start"},style:{spacing:{margin:{bottom:"0"},padding:{bottom:"0"}}},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Not Attending","RSVP button label for declining event attendance","gatherpress"),tagName:"button",className:"gatherpress--update-rsvp",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}],["core/button",{text:(0,s._x)("Close","Button label for closing modal dialog","gatherpress"),tagName:"button",className:"is-style-outline gatherpress--close-modal",metadata:{name:(0,s._x)("Close Button","Block name displayed in the editor","gatherpress")}}]]]]]]]]]],not_attending:p,past:[["core/buttons",{align:"center",layout:{type:"flex",justifyContent:"center"},metadata:{name:(0,s._x)("Call to Action","Block name displayed in the editor","gatherpress")}},[["core/button",{text:(0,s._x)("Past Event","Button label for past RSVP","gatherpress"),tagName:"button",className:"gatherpress--is-disabled",metadata:{name:(0,s._x)("RSVP Button","Block name displayed in the editor","gatherpress")}}]]]]},g=window.ReactJSXRuntime;function c(t){return t.map((([t,a,s])=>(0,e.createBlock)(t,a,c(s||[]))))}const m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/rsvp-v2","version":"2.0.0","title":"RSVP V2","category":"gatherpress","icon":"insert","example":{},"description":"Enables members to easily confirm their attendance for an event.","usesContext":["postId","queryId"],"attributes":{"serializedInnerBlocks":{"type":"string","default":"[]"},"selectedStatus":{"type":"string","default":"no_status"}},"supports":{"gatherpress":{"postIdOverride":true},"html":false,"interactivity":true},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js"}');(0,e.registerBlockType)(m,{edit:({attributes:o,setAttributes:i,clientId:l})=>{const{serializedInnerBlocks:p="{}",selectedStatus:m}=o,h=(0,t.useBlockProps)(),{replaceInnerBlocks:u}=(0,n.useDispatch)(t.store),y=(0,n.useSelect)((e=>e(t.store).getBlocks(l)),[l]),x=(0,r.useCallback)(((t,a,s)=>{const r=JSON.parse(p||"{}"),n=(0,e.serialize)(s),o={...r,[t]:n};delete o[a],i({serializedInnerBlocks:JSON.stringify(o)})}),[p,i]),b=(0,r.useCallback)((t=>{const a=JSON.parse(p||"{}")[t];a&&a.length>0&&u(l,(0,e.parse)(a,{}))}),[l,u,p]);return(0,r.useEffect)((()=>{(()=>{const t=JSON.parse(p||"{}"),a=Object.keys(d).reduce(((a,s)=>{if(t[s])return a[s]=t[s],a;if(s!==m){const t=c(d[s]);a[s]=(0,e.serialize)(t)}return a}),{...t});i({serializedInnerBlocks:JSON.stringify(a)})})()}),[p,i,m]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(t.InspectorControls,{children:(0,g.jsx)(a.PanelBody,{children:(0,g.jsx)(a.SelectControl,{label:(0,s.__)("RSVP Status","gatherpress"),value:m,options:[{label:(0,s.__)("No Status (User has not responded)","gatherpress"),value:"no_status"},{label:(0,s.__)("Attending (User is confirmed)","gatherpress"),value:"attending"},{label:(0,s.__)("Waiting List (Pending confirmation)","gatherpress"),value:"waiting_list"},{label:(0,s.__)("Not Attending (User declined)","gatherpress"),value:"not_attending"},{label:(0,s.__)("Past Event (Event has already occurred)","gatherpress"),value:"past"}],onChange:e=>{b(e),i({selectedStatus:e}),x(m,e,y)}})})}),(0,g.jsx)("div",{...h,children:(0,g.jsx)(t.InnerBlocks,{template:d[m]})})]})},save:()=>(0,g.jsx)("div",{...t.useBlockProps.save(),children:(0,g.jsx)(t.InnerBlocks.Content,{})})})}},a={};function s(e){var r=a[e];if(void 0!==r)return r.exports;var n=a[e]={exports:{}};return t[e](n,n.exports,s),n.exports}s.m=t,e=[],s.O=(t,a,r,n)=>{if(!a){var o=1/0;for(d=0;d=n)&&Object.keys(s.O).every((e=>s.O[e](a[l])))?a.splice(l--,1):(i=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,r,n]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={345:0,525:0};s.O.j=t=>0===e[t];var t=(t,a)=>{var r,n,[o,i,l]=a,p=0;if(o.some((t=>0!==e[t]))){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(l)var d=l(s)}for(t&&t(a);ps(546)));r=s.O(r)})(); \ No newline at end of file diff --git a/src/blocks/rsvp-v2/templates/attending.js b/src/blocks/rsvp-v2/templates/attending.js index b731d9a6d..74f27c6f7 100644 --- a/src/blocks/rsvp-v2/templates/attending.js +++ b/src/blocks/rsvp-v2/templates/attending.js @@ -21,8 +21,8 @@ const ATTENDING = [ layout: { type: 'flex', justifyContent: 'center' }, metadata: { name: _x( - 'RSVP Buttons', - 'Section title in editor', + 'Call to Action', + 'Block name displayed in the editor', 'gatherpress' ), }, @@ -38,6 +38,13 @@ const ATTENDING = [ ), tagName: 'button', className: 'gatherpress--open-modal', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -91,6 +98,13 @@ const ATTENDING = [ 'RSVP status indicator', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Status', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -133,6 +147,13 @@ const ATTENDING = [ 'RSVP modal header', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Heading', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -142,6 +163,13 @@ const ATTENDING = [ 'To set or change your attending status, simply click the Not Attending button below.', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Info', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ['gatherpress/rsvp-guest-count-input', {}], @@ -164,6 +192,13 @@ const ATTENDING = [ }, }, }, + metadata: { + name: _x( + 'Call to Action', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, [ [ @@ -177,6 +212,13 @@ const ATTENDING = [ tagName: 'button', className: 'gatherpress--update-rsvp', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -190,6 +232,13 @@ const ATTENDING = [ tagName: 'button', className: 'is-style-outline gatherpress--close-modal', + metadata: { + name: _x( + 'Close Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], diff --git a/src/blocks/rsvp-v2/templates/no-status.js b/src/blocks/rsvp-v2/templates/no-status.js index 1e8a0ee81..c566d9431 100644 --- a/src/blocks/rsvp-v2/templates/no-status.js +++ b/src/blocks/rsvp-v2/templates/no-status.js @@ -20,8 +20,8 @@ const NO_STATUS = [ layout: { type: 'flex', justifyContent: 'center' }, metadata: { name: _x( - 'RSVP Buttons', - 'Section title in editor', + 'Call to Action', + 'Block name displayed in the editor', 'gatherpress' ), }, @@ -37,6 +37,13 @@ const NO_STATUS = [ ), tagName: 'button', className: 'gatherpress--open-modal', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -76,6 +83,13 @@ const NO_STATUS = [ 'RSVP modal header', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Heading', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -85,6 +99,13 @@ const NO_STATUS = [ 'To set or change your attending status, simply click the Attending button below.', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Info', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ['gatherpress/rsvp-anonymous-checkbox', {}], @@ -106,6 +127,13 @@ const NO_STATUS = [ }, }, }, + metadata: { + name: _x( + 'Call to Action', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, [ [ @@ -119,6 +147,13 @@ const NO_STATUS = [ tagName: 'button', className: 'gatherpress--update-rsvp', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -132,6 +167,13 @@ const NO_STATUS = [ tagName: 'button', className: 'is-style-outline gatherpress--close-modal', + metadata: { + name: _x( + 'Close Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -175,6 +217,13 @@ const NO_STATUS = [ 'Login modal header', 'gatherpress' ), + metadata: { + name: _x( + 'Login Heading', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -189,6 +238,13 @@ const NO_STATUS = [ getFromGlobal('urls.loginUrl') ), className: 'gatherpress--has-login-url', + metadata: { + name: _x( + 'Login Info', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -204,6 +260,13 @@ const NO_STATUS = [ ), className: 'gatherpress--has-registration-url', + metadata: { + name: _x( + 'Register Info', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -224,6 +287,13 @@ const NO_STATUS = [ }, }, }, + metadata: { + name: _x( + 'Call to Action', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, [ [ @@ -237,6 +307,13 @@ const NO_STATUS = [ tagName: 'button', className: 'gatherpress--close-modal', + metadata: { + name: _x( + 'Close Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], diff --git a/src/blocks/rsvp-v2/templates/not-attending.js b/src/blocks/rsvp-v2/templates/not-attending.js index 764d89e1b..37c2aa198 100644 --- a/src/blocks/rsvp-v2/templates/not-attending.js +++ b/src/blocks/rsvp-v2/templates/not-attending.js @@ -21,8 +21,8 @@ const NOT_ATTENDING = [ layout: { type: 'flex', justifyContent: 'center' }, metadata: { name: _x( - 'RSVP Buttons', - 'Section title in editor', + 'Call to Action', + 'Block name displayed in the editor', 'gatherpress' ), }, @@ -38,6 +38,13 @@ const NOT_ATTENDING = [ ), tagName: 'button', className: 'gatherpress--open-modal', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -81,6 +88,13 @@ const NOT_ATTENDING = [ 'RSVP status indicator', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Status', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -120,6 +134,13 @@ const NOT_ATTENDING = [ 'RSVP modal header', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Heading', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -129,6 +150,13 @@ const NOT_ATTENDING = [ 'To set or change your attending status, simply click the Attending button below.', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Info', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ['gatherpress/rsvp-anonymous-checkbox', {}], @@ -150,6 +178,13 @@ const NOT_ATTENDING = [ }, }, }, + metadata: { + name: _x( + 'Call to Action', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, [ [ @@ -163,6 +198,13 @@ const NOT_ATTENDING = [ tagName: 'button', className: 'gatherpress--update-rsvp', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -176,6 +218,13 @@ const NOT_ATTENDING = [ tagName: 'button', className: 'is-style-outline gatherpress--close-modal', + metadata: { + name: _x( + 'Close Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], diff --git a/src/blocks/rsvp-v2/templates/past.js b/src/blocks/rsvp-v2/templates/past.js index 473e7fdfd..7a36bffe3 100644 --- a/src/blocks/rsvp-v2/templates/past.js +++ b/src/blocks/rsvp-v2/templates/past.js @@ -11,8 +11,8 @@ const PAST = [ layout: { type: 'flex', justifyContent: 'center' }, metadata: { name: _x( - 'RSVP Buttons', - 'Section title in editor', + 'Call to Action', + 'Block name displayed in the editor', 'gatherpress' ), }, @@ -28,6 +28,13 @@ const PAST = [ ), tagName: 'button', className: 'gatherpress--is-disabled', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], diff --git a/src/blocks/rsvp-v2/templates/waiting-list.js b/src/blocks/rsvp-v2/templates/waiting-list.js index ad1f556b8..26881f2b7 100644 --- a/src/blocks/rsvp-v2/templates/waiting-list.js +++ b/src/blocks/rsvp-v2/templates/waiting-list.js @@ -21,8 +21,8 @@ const WAITING_LIST = [ layout: { type: 'flex', justifyContent: 'center' }, metadata: { name: _x( - 'RSVP Buttons', - 'Section title in editor', + 'Call to Action', + 'Block name displayed in the editor', 'gatherpress' ), }, @@ -38,6 +38,13 @@ const WAITING_LIST = [ ), tagName: 'button', className: 'gatherpress--open-modal', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -81,6 +88,13 @@ const WAITING_LIST = [ 'RSVP status indicator', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Status', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ], @@ -92,7 +106,7 @@ const WAITING_LIST = [ metadata: { name: _x( 'RSVP Modal', - 'Modal title in editor', + 'Block name displayed in the editor', 'gatherpress' ), }, @@ -120,6 +134,13 @@ const WAITING_LIST = [ 'RSVP modal header', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Heading', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -129,6 +150,13 @@ const WAITING_LIST = [ 'To set or change your attending status, simply click the Not Attending button below.', 'gatherpress' ), + metadata: { + name: _x( + 'RSVP Info', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ['gatherpress/rsvp-anonymous-checkbox', {}], @@ -150,6 +178,13 @@ const WAITING_LIST = [ }, }, }, + metadata: { + name: _x( + 'Call to Action', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, [ [ @@ -163,6 +198,13 @@ const WAITING_LIST = [ tagName: 'button', className: 'gatherpress--update-rsvp', + metadata: { + name: _x( + 'RSVP Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], [ @@ -176,6 +218,13 @@ const WAITING_LIST = [ tagName: 'button', className: 'is-style-outline gatherpress--close-modal', + metadata: { + name: _x( + 'Close Button', + 'Block name displayed in the editor', + 'gatherpress' + ), + }, }, ], ],