From 6eafaa6a04c0c9ff1a906a67a5a9d39e57af37f0 Mon Sep 17 00:00:00 2001 From: prcdevgitbot Date: Sun, 10 Mar 2024 22:58:02 +0000 Subject: [PATCH] See https://github.com/pewresearch/pewresearch-org/commit/c47e250ad430242cd4e7b8e3df55607e44ad509a from refs/heads/release/5.0 --- blocks/collapsible/build/block.json | 2 +- blocks/collapsible/build/index.asset.php | 2 +- blocks/collapsible/build/index.js | 2 +- blocks/collapsible/build/index.js.map | 2 +- blocks/collapsible/build/render.php | 16 ++++++++++++---- blocks/collapsible/build/view.js.map | 2 +- blocks/collapsible/src/block.json | 2 +- blocks/collapsible/src/render.php | 16 ++++++++++++---- blocks/table-of-contents/table-of-contents.php | 2 +- 9 files changed, 31 insertions(+), 15 deletions(-) diff --git a/blocks/collapsible/build/block.json b/blocks/collapsible/build/block.json index bd2866341..870e86def 100644 --- a/blocks/collapsible/build/block.json +++ b/blocks/collapsible/build/block.json @@ -106,5 +106,5 @@ "editorScript": "file:./index.js", "style": "file:./style-index.css", "render": "file:./render.php", - "viewModule": "file:./view.js" + "viewScriptModule": "file:./view.js" } \ No newline at end of file diff --git a/blocks/collapsible/build/index.asset.php b/blocks/collapsible/build/index.asset.php index f302edb4e..a1cb3a9bc 100644 --- a/blocks/collapsible/build/index.asset.php +++ b/blocks/collapsible/build/index.asset.php @@ -1 +1 @@ - array('classnames', 'prc-block-utils', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-element', 'wp-polyfill'), 'version' => 'eb9a0bfba21ab3ec6c8a'); + array('classnames', 'prc-block-utils', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-element', 'wp-polyfill'), 'version' => 'adac3a8fa2e134c0e2ac'); diff --git a/blocks/collapsible/build/index.js b/blocks/collapsible/build/index.js index 36a2afc85..dbce8dc50 100644 --- a/blocks/collapsible/build/index.js +++ b/blocks/collapsible/build/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t={871:(e,t,r)=>{const o=window.wp.blocks,l=window.React,i=window.classnames;var a=r.n(i);const n=window.prcIcons,c=window.prcBlockUtils,s=window.wp.element,p=window.wp.blockEditor,u=["core/paragraph","core/heading","core/image","core/table","core/list","core/buttons","core/file","core/video","core/group"],d=[["core/paragraph",{}]],m={from:[{type:"shortcode",tag:"collapsible",transform({},{shortcode:e}){const{content:t}=e,{title:r,contents:l}=function(e){var t=e,r="",o=/

(.*?)<\/h4>/i,l=o.exec(t);return l&&l[1]&&(r=l[1],t=t.replace(o,"")),{title:r,contents:t}}(t);return(0,o.createBlock)("prc-block/collapsible",{title:r},(0,o.rawHandler)({HTML:l}))}}]},b=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/collapsible","version":"0.1.0","title":"Collapsible","category":"design","keywords":["collapsible","accordion","how we did this"],"attributes":{"title":{"type":"string"},"allowedBlocks":{"type":"array"},"backgroundColor":{"type":"string","default":"ui-beige-very-light"},"borderColor":{"type":"string","default":"ui-beige-dark"},"style":{"type":"object","default":{"border":{"width":"1px"},"spacing":{"blockGap":{"top":"var:preset|spacing|30"},"padding":{"bottom":"var:preset|spacing|20","left":"var:preset|spacing|30","right":"var:preset|spacing|30","top":"var:preset|spacing|20"}}}}},"supports":{"anchor":false,"html":false,"spacing":{"blockGap":{"sides":["vertical"]},"margin":["top","bottom"],"padding":true,"__experimentalDefaultControls":{"padding":true}},"color":{"background":true,"text":true,"link":true},"__experimentalBorder":{"color":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"style":true,"width":true}},"typography":{"fontSize":true,"__experimentalFontFamily":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"interactivity":true},"example":{"attributes":{"title":"How we did this"},"innerBlocks":[{"name":"core/paragraph","attributes":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam ultricies, quam sapien aliquet nunc, nec aliquam nisl nunc"}}],"viewportWidth":640},"textdomain":"collapsible","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php","viewModule":"file:./view.js"}'),{name:g}=b,h={icon:function(){return(0,l.createElement)(n.Icon,{icon:n.icons.faCirclePlusSolid,width:21,preserveAspectRatio:"xMidYMid meet"})},edit:function({attributes:e,setAttributes:t}){const{title:r,className:o,allowedBlocks:i}=e,[m,b]=(0,s.useState)(!0),g=(0,p.useBlockProps)({className:a()(o,{"is-open":m}),style:{"--block-gap":(0,c.getBlockGapSupportValue)(e,"vertical")}}),h=(0,p.useInnerBlocksProps)({className:"wp-block-prc-block-collapsible__content"},{allowedBlocks:i||u,templateLock:!1,template:d});return(0,l.createElement)("div",{...g},(0,l.createElement)("div",{className:"wp-block-prc-block-collapsible__title"},(0,l.createElement)(p.RichText,{tagName:"div",value:r,onChange:e=>t({title:e}),placeholder:"How we did this...",formattingControls:[],keepPlaceholderOnFocus:!0}),(0,l.createElement)("button",{className:"wp-block-prc-block-collapsible__icon",onClick:()=>{b(!m)},type:"button"},(0,l.createElement)(n.Icon,{icon:m?n.icons.faCircleMinusLight:n.icons.faCirclePlusLight}))),(0,l.createElement)("div",{...h}))},save:function(){return(0,l.createElement)(p.InnerBlocks.Content,null)},transforms:m};(0,o.registerBlockType)(g,{...b,...h})}},r={};function o(e){var l=r[e];if(void 0!==l)return l.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.m=t,e=[],o.O=(t,r,l,i)=>{if(!r){var a=1/0;for(p=0;p=i)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(n=!1,i0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[r,l,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var l,i,[a,n,c]=r,s=0;if(a.some((t=>0!==e[t]))){for(l in n)o.o(n,l)&&(o.m[l]=n[l]);if(c)var p=c(o)}for(t&&t(r);so(871)));l=o.O(l)})(); +(()=>{"use strict";var e,t={871:(e,t,r)=>{const o=window.wp.blocks,l=window.React,i=window.classnames;var a=r.n(i);const n=window.prcIcons,c=window.prcBlockUtils,s=window.wp.element,p=window.wp.blockEditor,u=["core/paragraph","core/heading","core/image","core/table","core/list","core/buttons","core/file","core/video","core/group"],d=[["core/paragraph",{}]],m={from:[{type:"shortcode",tag:"collapsible",transform({},{shortcode:e}){const{content:t}=e,{title:r,contents:l}=function(e){var t=e,r="",o=/

(.*?)<\/h4>/i,l=o.exec(t);return l&&l[1]&&(r=l[1],t=t.replace(o,"")),{title:r,contents:t}}(t);return(0,o.createBlock)("prc-block/collapsible",{title:r},(0,o.rawHandler)({HTML:l}))}}]},b=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/collapsible","version":"0.1.0","title":"Collapsible","category":"design","keywords":["collapsible","accordion","how we did this"],"attributes":{"title":{"type":"string"},"allowedBlocks":{"type":"array"},"backgroundColor":{"type":"string","default":"ui-beige-very-light"},"borderColor":{"type":"string","default":"ui-beige-dark"},"style":{"type":"object","default":{"border":{"width":"1px"},"spacing":{"blockGap":{"top":"var:preset|spacing|30"},"padding":{"bottom":"var:preset|spacing|20","left":"var:preset|spacing|30","right":"var:preset|spacing|30","top":"var:preset|spacing|20"}}}}},"supports":{"anchor":false,"html":false,"spacing":{"blockGap":{"sides":["vertical"]},"margin":["top","bottom"],"padding":true,"__experimentalDefaultControls":{"padding":true}},"color":{"background":true,"text":true,"link":true},"__experimentalBorder":{"color":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"style":true,"width":true}},"typography":{"fontSize":true,"__experimentalFontFamily":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"interactivity":true},"example":{"attributes":{"title":"How we did this"},"innerBlocks":[{"name":"core/paragraph","attributes":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam ultricies, quam sapien aliquet nunc, nec aliquam nisl nunc"}}],"viewportWidth":640},"textdomain":"collapsible","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php","viewScriptModule":"file:./view.js"}'),{name:g}=b,h={icon:function(){return(0,l.createElement)(n.Icon,{icon:n.icons.faCirclePlusSolid,width:21,preserveAspectRatio:"xMidYMid meet"})},edit:function({attributes:e,setAttributes:t}){const{title:r,className:o,allowedBlocks:i}=e,[m,b]=(0,s.useState)(!0),g=(0,p.useBlockProps)({className:a()(o,{"is-open":m}),style:{"--block-gap":(0,c.getBlockGapSupportValue)(e,"vertical")}}),h=(0,p.useInnerBlocksProps)({className:"wp-block-prc-block-collapsible__content"},{allowedBlocks:i||u,templateLock:!1,template:d});return(0,l.createElement)("div",{...g},(0,l.createElement)("div",{className:"wp-block-prc-block-collapsible__title"},(0,l.createElement)(p.RichText,{tagName:"div",value:r,onChange:e=>t({title:e}),placeholder:"How we did this...",formattingControls:[],keepPlaceholderOnFocus:!0}),(0,l.createElement)("button",{className:"wp-block-prc-block-collapsible__icon",onClick:()=>{b(!m)},type:"button"},(0,l.createElement)(n.Icon,{icon:m?n.icons.faCircleMinusLight:n.icons.faCirclePlusLight}))),(0,l.createElement)("div",{...h}))},save:function(){return(0,l.createElement)(p.InnerBlocks.Content,null)},transforms:m};(0,o.registerBlockType)(g,{...b,...h})}},r={};function o(e){var l=r[e];if(void 0!==l)return l.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.m=t,e=[],o.O=(t,r,l,i)=>{if(!r){var a=1/0;for(p=0;p=i)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(n=!1,i0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[r,l,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var l,i,[a,n,c]=r,s=0;if(a.some((t=>0!==e[t]))){for(l in n)o.o(n,l)&&(o.m[l]=n[l]);if(c)var p=c(o)}for(t&&t(r);so(871)));l=o.O(l)})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/blocks/collapsible/build/index.js.map b/blocks/collapsible/build/index.js.map index 342884241..c6ae108ff 100644 --- a/blocks/collapsible/build/index.js.map +++ b/blocks/collapsible/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":"uBAAIA,E,iBCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,EAA+BA,OAAmB,W,aCAxD,MAAM,EAA+BA,OAAiB,SCAhD,EAA+BA,OAAsB,cCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAe,YCoBzDC,EAAiB,CACtB,iBACA,eACA,aACA,aACA,YACA,eACA,YACA,aACA,cAGKC,EAAW,CAAC,CAAC,iBAAkB,CAAC,ICQtC,EAhBmB,CAClBC,KAAM,CACL,CACCC,KAAM,YACNC,IAAK,cACLC,SAAAA,KAAc,UAACC,IACd,MAAM,QAACC,GAAWD,GACZ,MAACE,EAAK,SAAEC,GA1BlB,SAAuBC,GAEtB,IAAIC,EAAgBD,EAGhBF,EAAQ,GACRI,EAAQ,mBACRC,EAAQD,EAAME,KAAKH,GAMvB,OALIE,GAASA,EAAM,KACjBL,EAAQK,EAAM,GACdF,EAAgBA,EAAcI,QAAQH,EAAO,KAGxC,CACLJ,MAAOA,EACPC,SAAUE,EAEb,CAS8BK,CAAcT,GACxC,OAAOU,EAAAA,EAAAA,aAAY,wBAAyB,CAC3CT,UACEU,EAAAA,EAAAA,YAAW,CAACC,KA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AAoB+B,EAAED,EAAYR,KAAStB,EAAoB+B,EAAE3B,EAASkB,IAC5EH,OAAOa,eAAe5B,EAASkB,EAAK,CAAEW,YAAY,EAAMC,IAAKJ,EAAWR,IAE1E,ECNDtB,EAAoB+B,EAAI,CAACI,EAAKC,IAAUjB,OAAOkB,UAAUC,eAAeC,KAAKJ,EAAKC,G,MCKlF,IAAII,EAAkB,CACrB,GAAI,EACJ,IAAK,GAaNxC,EAAoBQ,EAAEU,EAAKuB,GAA0C,IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4BC,KACvD,IAGI3C,EAAUwC,GAHT/B,EAAUmC,EAAaC,GAAWF,EAGhB7B,EAAI,EAC3B,GAAGL,EAASqC,MAAMC,GAAgC,IAAxBR,EAAgBQ,KAAa,CACtD,IAAI/C,KAAY4C,EACZ7C,EAAoB+B,EAAEc,EAAa5C,KACrCD,EAAoBO,EAAEN,GAAY4C,EAAY5C,IAGhD,GAAG6C,EAAS,IAAIrC,EAASqC,EAAQ9C,EAClC,CAEA,IADG2C,GAA4BA,EAA2BC,GACrD7B,EAAIL,EAASM,OAAQD,IACzB0B,EAAU/B,EAASK,GAChBf,EAAoB+B,EAAES,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOzC,EAAoBQ,EAAEC,EAAO,EAGjCwC,EAAqBC,WAAoC,wBAAIA,WAAoC,yBAAK,GAC1GD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsBtD,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7FsD,EAAsBtD,EAAoBQ,EAAE8C,E","sources":["webpack://collapsible/webpack/runtime/chunk loaded","webpack://collapsible/external window [\"wp\",\"blocks\"]","webpack://collapsible/external window \"React\"","webpack://collapsible/external window \"classnames\"","webpack://collapsible/external window \"prcIcons\"","webpack://collapsible/external window \"prcBlockUtils\"","webpack://collapsible/external window [\"wp\",\"element\"]","webpack://collapsible/external window [\"wp\",\"blockEditor\"]","webpack://collapsible/./src/edit.jsx","webpack://collapsible/./src/transforms.js","webpack://collapsible/./src/index.js","webpack://collapsible/./src/icon.jsx","webpack://collapsible/./src/save.jsx","webpack://collapsible/webpack/bootstrap","webpack://collapsible/webpack/runtime/compat get default export","webpack://collapsible/webpack/runtime/define property getters","webpack://collapsible/webpack/runtime/hasOwnProperty shorthand","webpack://collapsible/webpack/runtime/jsonp chunk loading","webpack://collapsible/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * External Dependencies\n */\nimport classNames from 'classnames';\nimport { icons, Icon } from '@prc/icons';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nconst ALLOWED_BLOCKS = [\n\t'core/paragraph',\n\t'core/heading',\n\t'core/image',\n\t'core/table',\n\t'core/list',\n\t'core/buttons',\n\t'core/file',\n\t'core/video',\n\t'core/group',\n];\n\nconst TEMPLATE = [['core/paragraph', {}]];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { title, className, allowedBlocks } = attributes;\n\n\tconst [isOpen, setOpen] = useState(true);\n\n\tconst blockProps = useBlockProps({\n\t\tclassName: classNames(className, {\n\t\t\t'is-open': isOpen,\n\t\t}),\n\t\tstyle: {\n\t\t\t'--block-gap': getBlockGapSupportValue(attributes, 'vertical'),\n\t\t}\n\t});\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-prc-block-collapsible__content'\n\t\t},\n\t\t{\n\t\t\tallowedBlocks: allowedBlocks || ALLOWED_BLOCKS,\n\t\t\ttemplateLock: false,\n\t\t\ttemplate: TEMPLATE,\n\t\t},\n\t);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t setAttributes({ title: t })}\n\t\t\t\t\tplaceholder=\"How we did this...\"\n\t\t\t\t\tformattingControls={[]}\n\t\t\t\t\tkeepPlaceholderOnFocus\n\t\t\t\t/>\n\t\t\t\t {\n\t\t\t\t\t\tsetOpen(!isOpen);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n","/**\n * WordPress Dependencies\n */\nimport { createBlock, rawHandler } from '@wordpress/blocks';\n\nfunction cleanUpString(inputString) {\n\t// Remove non-closing paragraph tags at the beginning\n\tvar cleanedString = inputString;\n\n\t// Extract the content of the first h4 tag\n\tvar title = '';\n\tvar regex = /

(.*?)<\\/h4>/i;\n\tvar match = regex.exec(cleanedString);\n\tif (match && match[1]) {\n\t title = match[1];\n\t cleanedString = cleanedString.replace(regex, '');\n\t}\n\n\treturn {\n\t title: title,\n\t contents: cleanedString\n\t};\n}\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'collapsible',\n\t\t\ttransform({}, {shortcode}) {\n\t\t\t\tconst {content} = shortcode;\n\t\t\t\tconst {title, contents} = cleanUpString(content);\n\t\t\t\treturn createBlock('prc-block/collapsible', {\n\t\t\t\t\ttitle,\n\t\t\t\t}, rawHandler({HTML: contents}));\n\t\t\t}\n\t\t},\n\t],\n};\n\nexport default transforms;\n","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport edit from './edit';\nimport save from './save';\nimport icon from './icon';\nimport transforms from './transforms';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n\ttransforms,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\nimport { icons, Icon } from '@prc/icons';\n\nexport default function() {\n\treturn(\n\t\t\n\t);\n}\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save() {\n\treturn ;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t57: 0,\n\t350: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkcollapsible\"] = globalThis[\"webpackChunkcollapsible\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [350], () => (__webpack_require__(871)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","ALLOWED_BLOCKS","TEMPLATE","from","type","tag","transform","shortcode","content","title","contents","inputString","cleanedString","regex","match","exec","replace","cleanUpString","createBlock","rawHandler","HTML","name","metadata","settings","icon","createElement","Icon","icons","faCirclePlusSolid","width","preserveAspectRatio","edit","attributes","setAttributes","className","allowedBlocks","isOpen","setOpen","useState","blockProps","useBlockProps","classNames","style","getBlockGapSupportValue","innerBlocksProps","useInnerBlocksProps","templateLock","template","RichText","tagName","value","onChange","t","placeholder","formattingControls","keepPlaceholderOnFocus","onClick","faCircleMinusLight","faCirclePlusLight","save","InnerBlocks","Content","transforms","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":"uBAAIA,E,iBCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,EAA+BA,OAAmB,W,aCAxD,MAAM,EAA+BA,OAAiB,SCAhD,EAA+BA,OAAsB,cCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+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A2BC,GACrD7B,EAAIL,EAASM,OAAQD,IACzB0B,EAAU/B,EAASK,GAChBf,EAAoB+B,EAAES,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOzC,EAAoBQ,EAAEC,EAAO,EAGjCwC,EAAqBC,WAAoC,wBAAIA,WAAoC,yBAAK,GAC1GD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsBtD,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7FsD,EAAsBtD,EAAoBQ,EAAE8C,E","sources":["webpack://collapsible/webpack/runtime/chunk loaded","webpack://collapsible/external window [\"wp\",\"blocks\"]","webpack://collapsible/external window \"React\"","webpack://collapsible/external window \"classnames\"","webpack://collapsible/external window \"prcIcons\"","webpack://collapsible/external window \"prcBlockUtils\"","webpack://collapsible/external window [\"wp\",\"element\"]","webpack://collapsible/external window [\"wp\",\"blockEditor\"]","webpack://collapsible/./src/edit.jsx","webpack://collapsible/./src/transforms.js","webpack://collapsible/./src/index.js","webpack://collapsible/./src/icon.jsx","webpack://collapsible/./src/save.jsx","webpack://collapsible/webpack/bootstrap","webpack://collapsible/webpack/runtime/compat get default export","webpack://collapsible/webpack/runtime/define property getters","webpack://collapsible/webpack/runtime/hasOwnProperty shorthand","webpack://collapsible/webpack/runtime/jsonp chunk loading","webpack://collapsible/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * External Dependencies\n */\nimport classNames from 'classnames';\nimport { icons, Icon } from '@prc/icons';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nconst ALLOWED_BLOCKS = [\n\t'core/paragraph',\n\t'core/heading',\n\t'core/image',\n\t'core/table',\n\t'core/list',\n\t'core/buttons',\n\t'core/file',\n\t'core/video',\n\t'core/group',\n];\n\nconst TEMPLATE = [['core/paragraph', {}]];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { title, className, allowedBlocks } = attributes;\n\n\tconst [isOpen, setOpen] = useState(true);\n\n\tconst blockProps = useBlockProps({\n\t\tclassName: classNames(className, {\n\t\t\t'is-open': isOpen,\n\t\t}),\n\t\tstyle: {\n\t\t\t'--block-gap': getBlockGapSupportValue(attributes, 'vertical'),\n\t\t}\n\t});\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-prc-block-collapsible__content'\n\t\t},\n\t\t{\n\t\t\tallowedBlocks: allowedBlocks || ALLOWED_BLOCKS,\n\t\t\ttemplateLock: false,\n\t\t\ttemplate: TEMPLATE,\n\t\t},\n\t);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t setAttributes({ title: t })}\n\t\t\t\t\tplaceholder=\"How we did this...\"\n\t\t\t\t\tformattingControls={[]}\n\t\t\t\t\tkeepPlaceholderOnFocus\n\t\t\t\t/>\n\t\t\t\t {\n\t\t\t\t\t\tsetOpen(!isOpen);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n","/**\n * WordPress Dependencies\n */\nimport { createBlock, rawHandler } from '@wordpress/blocks';\n\nfunction cleanUpString(inputString) {\n\t// Remove non-closing paragraph tags at the beginning\n\tvar cleanedString = inputString;\n\n\t// Extract the content of the first h4 tag\n\tvar title = '';\n\tvar regex = /

(.*?)<\\/h4>/i;\n\tvar match = regex.exec(cleanedString);\n\tif (match && match[1]) {\n\t title = match[1];\n\t cleanedString = cleanedString.replace(regex, '');\n\t}\n\n\treturn {\n\t title: title,\n\t contents: cleanedString\n\t};\n}\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'collapsible',\n\t\t\ttransform({}, {shortcode}) {\n\t\t\t\tconst {content} = shortcode;\n\t\t\t\tconst {title, contents} = cleanUpString(content);\n\t\t\t\treturn createBlock('prc-block/collapsible', {\n\t\t\t\t\ttitle,\n\t\t\t\t}, rawHandler({HTML: contents}));\n\t\t\t}\n\t\t},\n\t],\n};\n\nexport default transforms;\n","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport edit from './edit';\nimport save from './save';\nimport icon from './icon';\nimport transforms from './transforms';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n\ttransforms,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\nimport { icons, Icon } from '@prc/icons';\n\nexport default function() {\n\treturn(\n\t\t\n\t);\n}\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save() {\n\treturn ;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t57: 0,\n\t350: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkcollapsible\"] = globalThis[\"webpackChunkcollapsible\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [350], () => (__webpack_require__(871)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","ALLOWED_BLOCKS","TEMPLATE","from","type","tag","transform","shortcode","content","title","contents","inputString","cleanedString","regex","match","exec","replace","cleanUpString","createBlock","rawHandler","HTML","name","metadata","settings","icon","createElement","Icon","icons","faCirclePlusSolid","width","preserveAspectRatio","edit","attributes","setAttributes","className","allowedBlocks","isOpen","setOpen","useState","blockProps","useBlockProps","classNames","style","getBlockGapSupportValue","innerBlocksProps","useInnerBlocksProps","templateLock","template","RichText","tagName","value","onChange","t","placeholder","formattingControls","keepPlaceholderOnFocus","onClick","faCircleMinusLight","faCirclePlusLight","save","InnerBlocks","Content","transforms","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/collapsible/build/render.php b/blocks/collapsible/build/render.php index 38b2825d2..05cf2baa0 100644 --- a/blocks/collapsible/build/render.php +++ b/blocks/collapsible/build/render.php @@ -8,16 +8,17 @@ $collapsible_title = str_replace(["u003cstrongu003e", "u003c/strongu003e"], "", $collapsible_title); $classname = array_key_exists('className', $attributes) ? $attributes['className'] : ''; +$block_gap = \PRC\Platform\Block_Utils\get_block_gap_support_value($attributes); + if ( $is_deprecated ) { $classname = $classname . ' is-style-plus'; } $collapsible_id = sanitize_title($collapsible_title); -$wrapper_attrs = get_block_wrapper_attributes(array( +$block_wrapper_attrs = array( 'class' => $classname, 'id' => $collapsible_id, - 'style' => '--block-gap: ' . \PRC\Platform\Block_Utils\get_block_gap_support_value($attributes), 'data-wp-interactive' => wp_json_encode(array( 'namespace' => 'prc-block/collapsible', )), @@ -27,13 +28,20 @@ )), 'data-wp-class--is-open' => 'context.isOpen', 'data-wp-init--scroll-into-view' => 'callbacks.onInitScrollIntoView', -)); +); +if ( $block_gap ) { + $block_wrapper_attrs['style'] = '--block-gap: ' . $block_gap . ';'; +} + +$wrapper_attrs = get_block_wrapper_attributes($block_wrapper_attrs); + +do_action('qm/debug', print_r($content, true)); if ( function_exists( 'apple_news_is_exporting' ) && apple_news_is_exporting() ) { // echo wp_sprintf(); } else { echo wp_sprintf( - '
%2$s
%3$s
', + '
%s
%s
', $wrapper_attrs, esc_html($collapsible_title), $content, diff --git a/blocks/collapsible/build/view.js.map b/blocks/collapsible/build/view.js.map index 29882549b..eb5975b81 100644 --- a/blocks/collapsible/build/view.js.map +++ b/blocks/collapsible/build/view.js.map @@ -1 +1 @@ -{"version":3,"file":"view.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICIlF,MAAM,GAJGI,EAI8B,CAAE,WAAgB,IAAOC,EAAwE,WAAG,WAAgB,IAAOA,EAAwE,WAAG,MAAW,IAAOA,EAAmE,OAH7TC,EAAI,CAAC,EAAGhB,EAAoBiB,EAAED,EAAGF,GAAWE,GADzC,IAACF,EACJE,GCCLE,EAAAA,EAAAA,OAAM,wBAAyB,CAC9BC,QAAS,CACRC,QAASA,KACR,MAAMC,GAAUC,EAAAA,EAAAA,cAChBD,EAAQE,QAAUF,EAAQE,MAAM,GAGlCC,UAAW,CACVC,qBAAsBA,KACrB,MAAMJ,GAAUC,EAAAA,EAAAA,eACV,IAAEI,IAAQC,EAAAA,EAAAA,cAEXN,EAAQE,QACZK,YAAW,KACVF,EAAIG,eAAe,CAAEC,SAAU,SAAUC,MAAO,SAAU,GACxD,IACJ","sources":["webpack://collapsible/webpack/bootstrap","webpack://collapsible/webpack/runtime/define property getters","webpack://collapsible/webpack/runtime/hasOwnProperty shorthand","webpack://collapsible/external module \"@wordpress/interactivity\"","webpack://collapsible/./src/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"getElement\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","import { store, getContext, getElement } from '@wordpress/interactivity';\n\nstore('prc-block/collapsible', {\n\tactions: {\n\t\tonClick: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isOpen = !context.isOpen;\n\t\t},\n\t},\n\tcallbacks: {\n\t\tonInitScrollIntoView: () => {\n\t\t\tconst context = getContext();\n\t\t\tconst { ref } = getElement();\n\t\t\t// If the collapsible is open on init then scroll to it.\n\t\t\tif ( context.isOpen ) {\n\t\t\t\tsetTimeout(()=> {\n\t\t\t\t\tref.scrollIntoView({ behavior: 'smooth', block: 'start' });\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t}\n\t}\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","store","actions","onClick","context","getContext","isOpen","callbacks","onInitScrollIntoView","ref","getElement","setTimeout","scrollIntoView","behavior","block"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"view.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICIlF,MAAM,GAJGI,EAI8B,CAAE,WAAgB,IAAOC,EAAwE,WAAG,WAAgB,IAAOA,EAAwE,WAAG,MAAW,IAAOA,EAAmE,OAH7TC,EAAI,CAAC,EAAGhB,EAAoBiB,EAAED,EAAGF,GAAWE,GADzC,IAACF,EACJE,GCCLE,EAAAA,EAAAA,OAAM,wBAAyB,CAC9BC,QAAS,CACRC,QAASA,KACR,MAAMC,GAAUC,EAAAA,EAAAA,cAChBD,EAAQE,QAAUF,EAAQE,MAAM,GAGlCC,UAAW,CACVC,qBAAsBA,KACrB,MAAMJ,GAAUC,EAAAA,EAAAA,eACV,IAAEI,IAAQC,EAAAA,EAAAA,cAEZN,EAAQE,QACXK,YAAW,KACVF,EAAIG,eAAe,CAAEC,SAAU,SAAUC,MAAO,SAAU,GACxD,IACJ","sources":["webpack://collapsible/webpack/bootstrap","webpack://collapsible/webpack/runtime/define property getters","webpack://collapsible/webpack/runtime/hasOwnProperty shorthand","webpack://collapsible/external module \"@wordpress/interactivity\"","webpack://collapsible/./src/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"getElement\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","import { store, getContext, getElement } from '@wordpress/interactivity';\n\nstore('prc-block/collapsible', {\n\tactions: {\n\t\tonClick: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isOpen = !context.isOpen;\n\t\t},\n\t},\n\tcallbacks: {\n\t\tonInitScrollIntoView: () => {\n\t\t\tconst context = getContext();\n\t\t\tconst { ref } = getElement();\n\t\t\t// If the collapsible is open on init then scroll to it.\n\t\t\tif (context.isOpen) {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tref.scrollIntoView({ behavior: 'smooth', block: 'start' });\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t},\n\t},\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","store","actions","onClick","context","getContext","isOpen","callbacks","onInitScrollIntoView","ref","getElement","setTimeout","scrollIntoView","behavior","block"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/collapsible/src/block.json b/blocks/collapsible/src/block.json index f4b8f4a75..bfa9991de 100644 --- a/blocks/collapsible/src/block.json +++ b/blocks/collapsible/src/block.json @@ -97,5 +97,5 @@ "editorScript": "file:./index.js", "style": "file:./style-index.css", "render": "file:./render.php", - "viewModule": "file:./view.js" + "viewScriptModule": "file:./view.js" } diff --git a/blocks/collapsible/src/render.php b/blocks/collapsible/src/render.php index 38b2825d2..05cf2baa0 100644 --- a/blocks/collapsible/src/render.php +++ b/blocks/collapsible/src/render.php @@ -8,16 +8,17 @@ $collapsible_title = str_replace(["u003cstrongu003e", "u003c/strongu003e"], "", $collapsible_title); $classname = array_key_exists('className', $attributes) ? $attributes['className'] : ''; +$block_gap = \PRC\Platform\Block_Utils\get_block_gap_support_value($attributes); + if ( $is_deprecated ) { $classname = $classname . ' is-style-plus'; } $collapsible_id = sanitize_title($collapsible_title); -$wrapper_attrs = get_block_wrapper_attributes(array( +$block_wrapper_attrs = array( 'class' => $classname, 'id' => $collapsible_id, - 'style' => '--block-gap: ' . \PRC\Platform\Block_Utils\get_block_gap_support_value($attributes), 'data-wp-interactive' => wp_json_encode(array( 'namespace' => 'prc-block/collapsible', )), @@ -27,13 +28,20 @@ )), 'data-wp-class--is-open' => 'context.isOpen', 'data-wp-init--scroll-into-view' => 'callbacks.onInitScrollIntoView', -)); +); +if ( $block_gap ) { + $block_wrapper_attrs['style'] = '--block-gap: ' . $block_gap . ';'; +} + +$wrapper_attrs = get_block_wrapper_attributes($block_wrapper_attrs); + +do_action('qm/debug', print_r($content, true)); if ( function_exists( 'apple_news_is_exporting' ) && apple_news_is_exporting() ) { // echo wp_sprintf(); } else { echo wp_sprintf( - '
%2$s
%3$s
', + '
%s
%s
', $wrapper_attrs, esc_html($collapsible_title), $content, diff --git a/blocks/table-of-contents/table-of-contents.php b/blocks/table-of-contents/table-of-contents.php index c623bf4a7..c81eaa726 100644 --- a/blocks/table-of-contents/table-of-contents.php +++ b/blocks/table-of-contents/table-of-contents.php @@ -198,7 +198,7 @@ public function render_block_callback( $attributes, $content, $block ) { $return_top_level = false === $report_package->is_report_package( $post_id ); $chapters = $report_package->get_constructed_toc( $post_id ); - if ( empty($chapters) ) { + if ( false === $chapters || empty($chapters) ) { return; }