UNPKG

@10up/block-components

Version:

10up Components built for the WordPress Block Editor.

2 lines 6.82 kB
!function(){var t={3518:function(t,e,n){"use strict";n.d(e,{H:function(){return s},R:function(){return o}});var r=n(7966);const o=(0,r.createContext)({avatar_urls:{},description:"",email:"",first_name:"",id:0,last_name:"",link:"",name:"",nickname:"",registered_date:"",slug:"",url:""}),s=()=>(0,r.useContext)(o)},779:function(t,e,n){"use strict";n.d(e,{Avatar:function(){return l},Bio:function(){return d},Email:function(){return p},FirstName:function(){return a},LastName:function(){return f},Name:function(){return c}});var r=n(7966),o=n(5214),s=n(2627),i=n(3518);function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u.apply(null,arguments)}const c=t=>{const{tagName:e="span",...n}=t,{name:o,link:s}=(0,i.H)(),u={...n};return"a"===e&&s&&(u.href=s),(0,r.createElement)(e,u,o)},a=t=>{const{tagName:e="span",...n}=t,{first_name:o}=(0,i.H)();return(0,r.createElement)(e,n,o)},f=t=>{const{tagName:e="span",...n}=t,{last_name:o}=(0,i.H)();return(0,r.createElement)(e,n,o)};const l=t=>{const{...e}=t,n=(0,i.H)(),c=n?.avatar_urls?Object.values(n.avatar_urls):null,a=function(){const{avatarURL:t}=(0,o.useSelect)(t=>{const{getSettings:e}=t(s.store),{__experimentalDiscussionSettings:n}=e();return n},[]);return t}(),f=c?c[c.length-1]:a;return(0,r.createElement)("img",u({src:f},e))},d=t=>{const{tagName:e="p",...n}=t,{description:o}=(0,i.H)();return(0,r.createElement)(e,n,o)},p=t=>{const{...e}=t,{email:n}=(0,i.H)();return(0,r.createElement)("a",u({href:`mailto:${n}`},e),n)}},161:function(t,e,n){"use strict";n.d(e,{Zm:function(){return i}});var r=n(7966);const o={postId:void 0,postType:void 0,isEditable:void 0},s=(0,r.createContext)(o),i=()=>(0,r.useContext)(s)},283:function(t,e,n){"use strict";n.d(e,{YK:function(){return r.usePost}});n(3505),n(1210),n(1740),n(4512),n(6186),n(2516);var r=n(2312);n(4275),n(2131),n(703),n(8857),n(6856),n(687),n(1461),n(989),n(8021),n(8474),n(3445),n(2737),n(4449),n(3227)},2131:function(t,e,n){"use strict";n(5214),n(7816)},2516:function(t,e,n){"use strict";n(5214),n(2627)},4512:function(t,e,n){"use strict";n(7966);var r=require("@leeoniya/ufuzzy");new(n.n(r)())},4449:function(t,e,n){"use strict";n(2627),n(5214)},3505:function(t,e,n){"use strict";n(5214),n(2627)},1740:function(t,e,n){"use strict";n(5214),n(7966),n(8475)},687:function(t,e,n){"use strict";n(5214),n(7816)},2737:function(t,e,n){"use strict";n(7816),n(2312)},4275:function(t,e,n){"use strict";n(5214),n(7816)},6186:function(t,e,n){"use strict";n(5214),n(7816)},763:function(t,e,n){"use strict";n(6314)},989:function(t,e,n){"use strict";n(7966),n(2050),n(763)},8474:function(t,e,n){"use strict";n(7816),n(2312)},2312:function(t,e,n){"use strict";n.d(e,{usePost:function(){return i}});var r=n(5214),o=n(4951),s=n(161);function i(){const{postId:t,postType:e,isEditable:n}=(0,s.Zm)(),{globalPostId:i,globalPostType:u}=(0,r.useSelect)(t=>({globalPostId:t(o.store).getCurrentPostId(),globalPostType:t(o.store).getCurrentPostType()}),[]);return{postId:t||i,postType:e||u,isEditable:!(!!t&&!!e)||n}}},1461:function(t,e,n){"use strict";n(5214),n(8450),n(7816),n(2312),n(687),n(4275)},3227:function(t,e,n){"use strict";n(5214),n(2627)},1210:function(t,e,n){"use strict";n(3805),n(7816),n(5214)},8021:function(t,e,n){"use strict";n(7966)},703:function(t,e,n){"use strict";n(4951),n(5214),n(7816)},6856:function(t,e,n){"use strict";n(5214),n(7816)},8857:function(t,e,n){"use strict";n(2312),n(4275),n(2131),n(703),n(6856)},3445:function(t,e,n){"use strict";n(5214),n(7816)},7785:function(t,e,n){"use strict";var r={};n.r(r),n.d(r,{getIcon:function(){return a},getIconSet:function(){return u},getIconSets:function(){return i},getIcons:function(){return c}});var o={};n.r(o),n.d(o,{registerIconSet:function(){return f},removeIconSet:function(){return l}});var s=n(5214);function i(t){const{iconSets:e}=t;return Object.values(e)}function u(t,e){const{iconSets:n}=t;return n[e]??[]}function c(t,e){const{iconSets:n}=t;return n?.hasOwnProperty(e)?n[e]?.icons??[]:[]}function a(t,e,n){const{iconSets:r}=t;return r?.hasOwnProperty(e)?r[e]?.icons?.find(t=>t.name===n)??[]:void 0}function f(t){return{type:"REGISTER_ICON_SET",iconSet:t}}function l(t){return{type:"REMOVE_ICON_SET",name:t}}const d="tenup/icons",p=(0,s.createReduxStore)(d,{reducer:function(t={iconSets:{}},e){switch(e.type){case"REGISTER_ICON_SET":return{...t,iconSets:{...t.iconSets,[e.iconSet.name]:e.iconSet}};case"REMOVE_ICON_SET":if(t.iconSets.hasOwnProperty(e.name)){const n={...t};return delete n.iconSets[e.name],n}return t;default:return t}},selectors:r,actions:o});!!(0,s.select)(d)||(0,s.register)(p)},8475:function(t,e,n){"use strict";n(7785)},3805:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},2627:function(t){"use strict";t.exports=require("@wordpress/block-editor")},2050:function(t){"use strict";t.exports=require("@wordpress/components")},6314:function(t){"use strict";t.exports=require("@wordpress/compose")},7816:function(t){"use strict";t.exports=require("@wordpress/core-data")},5214:function(t){"use strict";t.exports=require("@wordpress/data")},4951:function(t){"use strict";t.exports=require("@wordpress/editor")},7966:function(t){"use strict";t.exports=require("@wordpress/element")},8450:function(t){"use strict";t.exports=require("@wordpress/i18n")}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r),n.d(r,{PostAuthor:function(){return a}});var t=n(7966),e=n(7816),o=n(2050),s=n(5214),i=n(283),u=n(779),c=n(3518);const a=n=>{const{children:r,...a}=n,{postId:f,postType:l}=(0,i.YK)(),[d,p]=(0,s.useSelect)(t=>{const{getEditedEntityRecord:n,getUser:r,hasFinishedResolution:o}=t(e.store),s=["postType",l,f],i=n(...s),u=o("getEditedEntityRecord",s),c=u?i?.author:void 0;return[r(c),o("getUser",[c])&&u]},[l,f]),m="function"===typeof r,v=!m&&t.Children.count(r);return p?v?(0,t.createElement)(c.R.Provider,{value:d},(0,t.createElement)("div",a,r)):m?r(d):(0,t.createElement)(u.Name,a):(0,t.createElement)(o.Spinner,null)};a.Name=u.Name,a.FirstName=u.FirstName,a.LastName=u.LastName,a.Avatar=u.Avatar,a.Bio=u.Bio,a.Email=u.Email}(),module.exports=r}(); //# sourceMappingURL=index.js.map