From 7871fb7c6dfcb452dd7fa1727db95b318f186d34 Mon Sep 17 00:00:00 2001 From: jeremyfelt Date: Tue, 5 Nov 2024 16:50:57 -0800 Subject: [PATCH] Add anchor support to deprecation --- build/show-hide-section/index.asset.php | 2 +- build/show-hide-section/index.js | 2 +- src/show-hide-section/deprecated.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/show-hide-section/index.asset.php b/build/show-hide-section/index.asset.php index aac6ade..4d7cad4 100644 --- a/build/show-hide-section/index.asset.php +++ b/build/show-hide-section/index.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '11fe62fbfeb17f1144ce'); + array('wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'beb08742a35f54543878'); diff --git a/build/show-hide-section/index.js b/build/show-hide-section/index.js index 4056f8f..9435ea2 100644 --- a/build/show-hide-section/index.js +++ b/build/show-hide-section/index.js @@ -1 +1 @@ -(()=>{"use strict";const e=window.wp.blocks,t=window.wp.blockEditor,s=window.wp.i18n,i=JSON.parse('{"$schema":"https://json.schemastore.org/block.json","apiVersion":3,"name":"happyprime/show-hide-section","title":"Show Hide Section","textdomain":"show-hide-section-block","category":"widgets","description":"A section of collapsible content contained in a details element with a summary.","icon":"media-document","parent":["happyprime/show-hide-group"],"attributes":{"isOpen":{"type":"boolean","default":false}},"supports":{"anchor":true,"align":true,"alignWide":true,"color":{"background":true,"enableContrastChecker":true,"text":true,"link":true,"gradients":true},"defaultStylePicker":true,"dimensions":{"minHeight":true},"html":false,"multiple":true,"position":{"sticky":false},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true}},"editorScript":"file:index.js"}'),a=[{attributes:{summary:{type:"string",source:"html",selector:"summary"}},save:({attributes:e})=>React.createElement("details",t.useBlockProps.save(),React.createElement("summary",null,e.summary),React.createElement(t.InnerBlocks.Content,null)),migrate:(t,s)=>[{},[(0,e.createBlock)("happyprime/show-hide-summary",{summary:t.summary}),(0,e.createBlock)("happyprime/show-hide-details",{},s)]],supports:{html:!0},isEligible:({summary:e})=>"string"==typeof e&&e.length>0}];(0,e.registerBlockType)(i,{edit:e=>{const{attributes:{isOpen:i},setAttributes:a,isSelected:r}=e,o=[["happyprime/show-hide-summary",{summary:(0,s.__)("Summary","show-hide-section-block")}],["happyprime/show-hide-details",{details:(0,s.__)("Details","show-hide-section-block")}]];return React.createElement("div",(0,t.useBlockProps)(),React.createElement(t.InnerBlocks,{template:o,allowedBlocks:["happyprime/show-hide-summary","happyprime/show-hide-details"],templateLock:"all"}))},save:()=>React.createElement("details",t.useBlockProps.save(),React.createElement(t.InnerBlocks.Content,null)),deprecated:a})})(); \ No newline at end of file +(()=>{"use strict";const e=window.wp.blocks,t=window.wp.blockEditor,s=window.wp.i18n,i=JSON.parse('{"$schema":"https://json.schemastore.org/block.json","apiVersion":3,"name":"happyprime/show-hide-section","title":"Show Hide Section","textdomain":"show-hide-section-block","category":"widgets","description":"A section of collapsible content contained in a details element with a summary.","icon":"media-document","parent":["happyprime/show-hide-group"],"attributes":{"isOpen":{"type":"boolean","default":false}},"supports":{"anchor":true,"align":true,"alignWide":true,"color":{"background":true,"enableContrastChecker":true,"text":true,"link":true,"gradients":true},"defaultStylePicker":true,"dimensions":{"minHeight":true},"html":false,"multiple":true,"position":{"sticky":false},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true}},"editorScript":"file:index.js"}'),a=[{attributes:{summary:{type:"string",source:"html",selector:"summary"}},save:({attributes:e})=>React.createElement("details",t.useBlockProps.save(),React.createElement("summary",null,e.summary),React.createElement(t.InnerBlocks.Content,null)),migrate:(t,s)=>[{},[(0,e.createBlock)("happyprime/show-hide-summary",{summary:t.summary}),(0,e.createBlock)("happyprime/show-hide-details",{},s)]],supports:{html:!0,anchor:!0},isEligible:({summary:e})=>"string"==typeof e&&e.length>0}];(0,e.registerBlockType)(i,{edit:e=>{const{attributes:{isOpen:i},setAttributes:a,isSelected:r}=e,o=[["happyprime/show-hide-summary",{summary:(0,s.__)("Summary","show-hide-section-block")}],["happyprime/show-hide-details",{details:(0,s.__)("Details","show-hide-section-block")}]];return React.createElement("div",(0,t.useBlockProps)(),React.createElement(t.InnerBlocks,{template:o,allowedBlocks:["happyprime/show-hide-summary","happyprime/show-hide-details"],templateLock:"all"}))},save:()=>React.createElement("details",t.useBlockProps.save(),React.createElement(t.InnerBlocks.Content,null)),deprecated:a})})(); \ No newline at end of file diff --git a/src/show-hide-section/deprecated.js b/src/show-hide-section/deprecated.js index 16353af..35751eb 100644 --- a/src/show-hide-section/deprecated.js +++ b/src/show-hide-section/deprecated.js @@ -45,6 +45,7 @@ const v2 = { }, supports: { html: true, + anchor: true, }, isEligible({ summary }) { return typeof summary === 'string' && summary.length > 0;