From 9c2db13ae2a1db35e0f18a9a7d1fa1a7ee5ac214 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Fri, 10 Jun 2022 22:22:01 +0200 Subject: [PATCH] Add a trasnformer from shortocde to block Added new attributes for include and hasPublishedPosts --- assets/js/dist/editor.asset.php | 2 +- assets/js/dist/editor.js | 2 +- assets/js/src/blocks/team-list/index.js | 63 +++++++++++++++++++++++++ includes/Plugin.php | 17 +++++-- 4 files changed, 77 insertions(+), 7 deletions(-) diff --git a/assets/js/dist/editor.asset.php b/assets/js/dist/editor.asset.php index 2a65aef..ae0cc5b 100644 --- a/assets/js/dist/editor.asset.php +++ b/assets/js/dist/editor.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '74afaf36e207a8e3185b'); + array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-shortcode', 'wp-url'), 'version' => '3de629e85d4a951d5dd4'); diff --git a/assets/js/dist/editor.js b/assets/js/dist/editor.js index 8774b65..cca8cb5 100644 --- a/assets/js/dist/editor.js +++ b/assets/js/dist/editor.js @@ -1 +1 @@ -!function(){var e={578:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=31)}([function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(0),o=n(5),i=n(6),a=n(14),s=n(16),u="prototype",l=function(e,t,n){var c,p,f,d,h=e&l.F,m=e&l.G,v=e&l.S,g=e&l.P,b=e&l.B,y=m?r:v?r[t]||(r[t]={}):(r[t]||{})[u],w=m?o:o[t]||(o[t]={}),O=w[u]||(w[u]={});for(c in m&&(n=t),n)f=((p=!h&&y&&void 0!==y[c])?y:n)[c],d=b&&p?s(f,r):g&&"function"==typeof f?s(Function.call,f):f,y&&a(y,c,f,e&l.U),w[c]!=f&&i(w,c,d),g&&O[c]!=f&&(O[c]=f)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(7),o=n(35);e.exports=n(3)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(8),o=n(33),i=n(34),a=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(2);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(20);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(t,n){t.exports=e},function(e,t,n){var r=n(2),o=n(0).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(0),o=n(6),i=n(15),a=n(9)("src"),s="toString",u=Function[s],l=(""+u).split(s);n(5).inspectSource=function(e){return u.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(i(n,a)||o(n,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||u.call(this)}))},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(17);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(37),o=n(26);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(10),o=n(11);e.exports=function(e){return r(o(e))}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(19),o=n(22),i=n(38);e.exports=function(e){return function(t,n,a){var s,u=r(t),l=o(u.length),c=i(a,l);if(e&&n!=n){for(;c=r;this.setState({query:s,ariaHint:u}),i||!u&&l&&c?o(s,(function(e){var n=0=i&&0=l,A=this.props.showNoOptionsFound&&V&&D&&L&&T,F=i+"__wrapper",N=i+"__input",j=null!==x?" "+N+"--focused":"",H=this.props.showAllValues?" "+N+"--show-all-values":" "+N+"--default",B=i+"__dropdown-arrow-down",U=-1!==x&&null!==x,$=i+"__menu",z=$+"--"+a,q=$+"--"+(E||A?"visible":"hidden"),W=i+"__option",G=i+"__hint",K=this.templateInputValue(I[M]),Y=K&&0===K.toLowerCase().indexOf(P.toLowerCase())&&R?P+K.substr(P.length):"",Q=u+"__assistiveHint",X=k?{"aria-describedby":Q}:null;return h&&"string"==typeof(e=O({className:B}))&&(e=(0,r.createElement)("div",{className:i+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}})),(0,r.createElement)("div",{className:F,onKeyDown:this.handleKeyDown},(0,r.createElement)(o.default,{id:u,length:I.length,queryLength:P.length,minQueryLength:l,selectedOption:this.templateInputValue(I[M]),selectedOptionIndex:M,validChoiceMade:_,isInFocus:null!==this.state.focused,tQueryTooShort:v,tNoResults:g,tSelectedOption:b,tResults:y}),Y&&(0,r.createElement)("span",null,(0,r.createElement)("input",{className:G,readonly:!0,tabIndex:"-1",value:Y})),(0,r.createElement)("input",s({"aria-expanded":E?"true":"false","aria-activedescendant":!!U&&u+"__option--"+x,"aria-owns":u+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},X,{autoComplete:"off",className:""+N+j+H,id:u,onClick:function(e){return t.handleInputClick(e)},onBlur:this.handleInputBlur},function(e){return{onChange:e}}(this.handleInputChange),{onFocus:this.handleInputFocus,name:p,placeholder:f,ref:function(e){t.elementReferences[-1]=e},type:"text",role:"combobox",required:d,value:P})),e,(0,r.createElement)("ul",{className:$+" "+z+" "+q,onMouseLeave:function(e){return t.handleListMouseLeave(e)},id:u+"__listbox",role:"listbox"},I.map((function(e,n){var o=(-1===x?M===n:x===n)&&null===C?" "+W+"--focused":"",i=n%2?" "+W+"--odd":"",a=c()?" '+(n+1)+" of "+I.length+"":"";return(0,r.createElement)("li",{"aria-selected":x===n?"true":"false",className:""+W+o+i,dangerouslySetInnerHTML:{__html:t.templateSuggestion(e)+a},id:u+"__option--"+n,key:n,onBlur:function(e){return t.handleOptionBlur(e,n)},onClick:function(e){return t.handleOptionClick(e,n)},onMouseDown:t.handleOptionMouseDown,onMouseEnter:function(e){return t.handleOptionMouseEnter(e,n)},ref:function(e){t.elementReferences[n]=e},role:"option",tabIndex:"-1","aria-posinset":n+1,"aria-setsize":I.length})})),A&&(0,r.createElement)("li",{className:W+" "+W+"--no-results"},m())),(0,r.createElement)("span",{id:Q,style:{display:"none"}},w()))},t}(r.Component);(t.default=p).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:i.default}},function(e,t,n){var r=n(1);r(r.S+r.F,"Object",{assign:n(36)})},function(e,t,n){e.exports=!n(3)&&!n(4)((function(){return 7!=Object.defineProperty(n(13)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(2);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(18),o=n(40),i=n(41),a=n(27),s=n(10),u=Object.assign;e.exports=!u||n(4)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r}))?function(e,t){for(var n=a(e),u=arguments.length,l=1,c=o.f,p=i.f;lu;)r(s,n=t[u++])&&(~i(l,n)||l.push(n));return l}},function(e,t,n){var r=n(23),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t){e.exports=!1},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(8),o=n(43),i=n(26),a=n(24)("IE_PROTO"),s=function(){},u="prototype",l=function(){var e,t=n(13)("iframe"),r=i.length;for(t.style.display="none",n(44).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("