Making WordPress.org

Changeset 12187


Ignore:
Timestamp:
11/02/2022 06:28:26 AM (19 months ago)
Author:
dd32
Message:

Handbooks: Allow the callout blocks to include lists in addition to paragraphs.

Props psykro.
Closes https://github.com/WordPress/wordpress.org/pull/102.
Fixes #6548.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/scripts/blocks.asset.php

    r9845 r12187  
    1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '1480a2bfa33c4985c6c8d9c16641a96d');
     1<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '6cebe0cec8356cd3644eb5bf2b7232f3');
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/scripts/blocks.js

    r9845 r12187  
    1 !function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=4)}([function(t,e){!function(){t.exports=this.wp.i18n}()},function(t,e){!function(){t.exports=this.wp.blocks}()},function(t,e){!function(){t.exports=this.wp.element}()},function(t,e){!function(){t.exports=this.wp.blockEditor}()},function(t,e,o){"use strict";o.r(e);var r=o(2),n=o(0),c=o(1),i=o(3),a=function(t){var e=t.attributes,o="callout callout-".concat(e.type);return Object(r.createElement)("div",{className:o},Object(r.createElement)(i.InnerBlocks,{allowedBlocks:["core/paragraph"]}))},l=[{name:"info",isDefault:!0,title:Object(n.__)("Info Callout","wporg"),icon:"info",attributes:{type:"info"}},{name:"tip",title:Object(n.__)("Tip Callout","wporg"),icon:"lightbulb",attributes:{type:"tip"}},{name:"alert",title:Object(n.__)("Alert Callout","wporg"),icon:"flag",attributes:{type:"alert"}},{name:"tutorial",title:Object(n.__)("Tutorial Callout","wporg"),icon:"hammer",attributes:{type:"tutorial"}},{name:"warning",title:Object(n.__)("Warning Callout","wporg"),icon:"dismiss",attributes:{type:"warning"}}],u={from:[{type:"block",blocks:["core/paragraph"],transform:function(t){var e=t.content,o=[Object(c.createBlock)("core/paragraph",{content:e})];return Object(c.createBlock)("wporg/callout",{type:"info"},o)}},{type:"block",blocks:["core/shortcode"],isMatch:function(t){return wp.shortcode.regexp("info|tip|alert|tutorial|warning").test(t.text)},transform:function(t){var e,o,r,n,i,a=t.text,l=null===(e=wp.shortcode.next("info",a))||void 0===e?void 0:e.shortcode;l||(l=null===(o=wp.shortcode.next("tip",a))||void 0===o?void 0:o.shortcode);l||(l=null===(r=wp.shortcode.next("alert",a))||void 0===r?void 0:r.shortcode);l||(l=null===(n=wp.shortcode.next("tutorial",a))||void 0===n?void 0:n.shortcode);l||(l=null===(i=wp.shortcode.next("warning",a))||void 0===i?void 0:i.shortcode);var u=[Object(c.createBlock)("core/paragraph",{content:l.content})];return Object(c.createBlock)("wporg/callout",{type:l.tag},u)}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(t,e){return e}}]};Object(c.registerBlockType)("wporg/callout",{title:Object(n.__)("Callout","wporg"),description:Object(n.__)("Callout boxes to be used in handbooks.","wporg"),category:"widgets",icon:"info",keywords:[Object(n.__)("alert","wporg"),Object(n.__)("tip","wporg")],attributes:{type:{type:"string",default:"info"}},supports:{className:!1},example:{attributes:{type:"info"},innerBlocks:[{name:"core/paragraph",attributes:{content:Object(n.__)("This is the content of the callout boxes.","wporg")}}]},variations:l,transforms:u,edit:a,save:function(t){var e=t.attributes,o="callout callout-".concat(e.type);return Object(r.createElement)("div",{className:o},Object(r.createElement)(i.InnerBlocks.Content,null))}})}]);
     1!function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=4)}([function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.blocks},function(t,e){t.exports=window.wp.element},function(t,e){t.exports=window.wp.blockEditor},function(t,e,o){"use strict";o.r(e);var r=o(2),n=o(0),c=o(1),a=o(3),i=function(t){var e=t.attributes,o="callout callout-".concat(e.type);return Object(r.createElement)("div",{className:o},Object(r.createElement)(a.InnerBlocks,{allowedBlocks:["core/paragraph","core/list"]}))},l=[{name:"info",isDefault:!0,title:Object(n.__)("Info Callout","wporg"),icon:"info",attributes:{type:"info"}},{name:"tip",title:Object(n.__)("Tip Callout","wporg"),icon:"lightbulb",attributes:{type:"tip"}},{name:"alert",title:Object(n.__)("Alert Callout","wporg"),icon:"flag",attributes:{type:"alert"}},{name:"tutorial",title:Object(n.__)("Tutorial Callout","wporg"),icon:"hammer",attributes:{type:"tutorial"}},{name:"warning",title:Object(n.__)("Warning Callout","wporg"),icon:"dismiss",attributes:{type:"warning"}}],u={from:[{type:"block",blocks:["core/paragraph"],transform:function(t){var e=t.content,o=[Object(c.createBlock)("core/paragraph",{content:e})];return Object(c.createBlock)("wporg/callout",{type:"info"},o)}},{type:"block",blocks:["core/shortcode"],isMatch:function(t){return wp.shortcode.regexp("info|tip|alert|tutorial|warning").test(t.text)},transform:function(t){var e,o,r,n,a,i=t.text,l=null===(e=wp.shortcode.next("info",i))||void 0===e?void 0:e.shortcode;l||(l=null===(o=wp.shortcode.next("tip",i))||void 0===o?void 0:o.shortcode);l||(l=null===(r=wp.shortcode.next("alert",i))||void 0===r?void 0:r.shortcode);l||(l=null===(n=wp.shortcode.next("tutorial",i))||void 0===n?void 0:n.shortcode);l||(l=null===(a=wp.shortcode.next("warning",i))||void 0===a?void 0:a.shortcode);var u=[Object(c.createBlock)("core/paragraph",{content:l.content})];return Object(c.createBlock)("wporg/callout",{type:l.tag},u)}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(t,e){return e}}]};Object(c.registerBlockType)("wporg/callout",{title:Object(n.__)("Callout","wporg"),description:Object(n.__)("Callout boxes to be used in handbooks.","wporg"),category:"widgets",icon:"info",keywords:[Object(n.__)("alert","wporg"),Object(n.__)("tip","wporg")],attributes:{type:{type:"string",default:"info"}},supports:{className:!1},example:{attributes:{type:"info"},innerBlocks:[{name:"core/paragraph",attributes:{content:Object(n.__)("This is the content of the callout boxes.","wporg")}}]},variations:l,transforms:u,edit:i,save:function(t){var e=t.attributes,o="callout callout-".concat(e.type);return Object(r.createElement)("div",{className:o},Object(r.createElement)(a.InnerBlocks.Content,null))}})}]);
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/scripts/src/blocks/callout/edit.js

    r9845 r12187  
    88    return (
    99        <div className={ className }>
    10             <InnerBlocks allowedBlocks={ [ 'core/paragraph' ] } />
     10            <InnerBlocks allowedBlocks={ [ 'core/paragraph', 'core/list' ] } />
    1111        </div>
    1212    );
Note: See TracChangeset for help on using the changeset viewer.