@10up/block-components
Version:
10up Components built for the WordPress Block Editor.
2 lines • 6.25 kB
JavaScript
!function(){var t={247:function(t,e,n){"use strict";n(7816),n(8139)},516:function(t,e,n){"use strict";n(777)},777:function(t,e,n){"use strict";var r={};n.r(r),n.d(r,{getIcon:function(){return a},getIconSet:function(){return i},getIconSets:function(){return u},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 u(t){const{iconSets:e}=t;return Object.values(e)}function i(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 p="tenup/icons",d=(0,s.createReduxStore)(p,{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)(p)||(0,s.register)(d)},1035:function(t,e,n){"use strict";n(5214),n(7816)},1097:function(t,e,n){"use strict";n(3805),n(7816),n(5214)},1120:function(t,e,n){"use strict";n(2627),n(5214)},1271:function(t,e,n){"use strict";n(5214),n(7816)},2050:function(t){"use strict";t.exports=require("@wordpress/components")},2154:function(t,e,n){"use strict";n.d(e,{wJ:function(){return r.usePrimaryTerm}});n(8058),n(1097),n(3777),n(4585),n(1035),n(5781),n(8139),n(7010),n(7746),n(2274),n(3934),n(1271),n(4304);var r=n(9066);n(7322),n(9342),n(247),n(9754),n(8768),n(1120)},2274:function(t,e,n){"use strict";n(4951),n(5214),n(7816)},2413:function(t){"use strict";t.exports=require("@wordpress/html-entities")},2627:function(t){"use strict";t.exports=require("@wordpress/block-editor")},3777:function(t,e,n){"use strict";n(5214),n(7966),n(516)},3805:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},3934:function(t,e,n){"use strict";n(8139),n(7010),n(7746),n(2274),n(1271)},4304:function(t,e,n){"use strict";n.d(e,{useIsPluginActive:function(){return u}});var r=n(5214),o=n(7816);const s=["active","network-active"],u=t=>(0,r.useSelect)(e=>{const n=e(o.store),r=n.getPlugin(t),u=n.hasFinishedResolution("getPlugin",[t]);return[s.includes(r?.status),u]},[t])},4585:function(t,e,n){"use strict";n(7966);var r=require("@leeoniya/ufuzzy");new(n.n(r)())},4951:function(t){"use strict";t.exports=require("@wordpress/editor")},5214:function(t){"use strict";t.exports=require("@wordpress/data")},5756:function(t,e,n){"use strict";n.d(e,{Zm:function(){return u}});var r=n(7966);const o={postId:void 0,postType:void 0,isEditable:void 0},s=(0,r.createContext)(o),u=()=>(0,r.useContext)(s)},5781:function(t,e,n){"use strict";n(5214),n(2627)},6314:function(t){"use strict";t.exports=require("@wordpress/compose")},7010:function(t,e,n){"use strict";n.d(e,{useIsSupportedTaxonomy:function(){return s}});var r=n(5214),o=n(7816);const s=(t,e)=>(0,r.useSelect)(n=>{const{getPostType:r,hasFinishedResolution:s}=n(o.store),u=r(t),i=s("getPostType",[t]),c=u?.taxonomies?.some(t=>t===e);return[!!c,i]},[t,e])},7322:function(t,e,n){"use strict";n(7966),n(2050),n(8580)},7746:function(t,e,n){"use strict";n(5214),n(7816)},7816:function(t){"use strict";t.exports=require("@wordpress/core-data")},7966:function(t){"use strict";t.exports=require("@wordpress/element")},8058:function(t,e,n){"use strict";n(5214),n(2627)},8139:function(t,e,n){"use strict";n.d(e,{usePost:function(){return u}});var r=n(5214),o=n(4951),s=n(5756);function u(){const{postId:t,postType:e,isEditable:n}=(0,s.Zm)(),{globalPostId:u,globalPostType:i}=(0,r.useSelect)(t=>({globalPostId:t(o.store).getCurrentPostId(),globalPostType:t(o.store).getCurrentPostType()}),[]);return{postId:t||u,postType:e||i,isEditable:!(!!t&&!!e)||n}}},8450:function(t){"use strict";t.exports=require("@wordpress/i18n")},8580:function(t,e,n){"use strict";n(6314)},8768:function(t,e,n){"use strict";n(7816),n(8139)},9066:function(t,e,n){"use strict";n.d(e,{usePrimaryTerm:function(){return a}});var r=n(5214),o=n(8450),s=n(7816),u=n(8139),i=n(4304),c=n(7010);const a=t=>{const{postType:e,isEditable:n}=(0,u.usePost)(),[a,f]=(0,i.useIsPluginActive)("wordpress-seo/wp-seo"),[l,p]=(0,c.useIsSupportedTaxonomy)(e,t),d=(0,r.useSelect)(n=>{if(!p||!f)return null;if(!a&&f)return console.error("Yoast SEO is not active. Please install and activate Yoast SEO to use the PostPrimaryCategory component."),null;if(!l&&p)return console.error(`The taxonomy "${t}" is not supported for the post type "${e}". Please use a supported taxonomy.`),null;return n("yoast-seo/editor")?n("yoast-seo/editor").getPrimaryTaxonomyId(t):(console.error("The yoast-seo/editor store does is not available."),null)},[t,a,l,p,f]),y=(0,r.useSelect)(e=>{if(!d)return null;const{getEntityRecord:n}=e(s.store);return n("taxonomy",t,d)},[d]);return[n?y:{name:(0,o.__)("Primary Term","tenup"),link:"#"},l]}},9342:function(t,e,n){"use strict";n(7966)},9754:function(t,e,n){"use strict";n(5214),n(7816)}},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,{PostPrimaryTerm:function(){return u}});var t=n(7966),e=n(8450),o=n(2413),s=n(2154);const u=({taxonomyName:n="category",placeholder:r=(0,e.__)("Select a term","tenup"),isLink:u=!0,...i})=>{const[c,a]=(0,s.wJ)(n),f=!!c,l=f?c.name:r,p=f?c.link:"#";if(!a)return null;const d=u?"a":"span",y={...i};return u&&(y.href=p),(0,t.createElement)(d,y,(0,o.decodeEntities)(l))}}(),module.exports=r}();
//# sourceMappingURL=index.js.map