From b13c81e45897442cc62d2fabd57e63c3200b6caa Mon Sep 17 00:00:00 2001 From: Marc Toensing Date: Tue, 30 Jan 2024 12:40:37 +0100 Subject: [PATCH] tagging 6.2.0 --- build/block.json | 2 +- build/index.asset.php | 2 +- build/index.css | 2 +- build/index.js | 2 +- package.json | 2 +- plugin.php | 6 +++--- src/block.json | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/block.json b/build/block.json index d81ed58..d1e7e68 100644 --- a/build/block.json +++ b/build/block.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/block.json", "apiVersion": 2, "name": "simpletoc/toc", - "version": "6.1.0", + "version": "6.2.0", "title": "SimpleTOC", "category": "layout", "icon": "", diff --git a/build/index.asset.php b/build/index.asset.php index 5b0cefe..e43d302 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => 'f3c357c9b8dbe6e5560a'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '336d7aad1fdc0644270e'); diff --git a/build/index.css b/build/index.css index 47b0d7a..cebf706 100644 --- a/build/index.css +++ b/build/index.css @@ -1,2 +1,2 @@ .wp-block-simpletoc-toc .components-notice{background-color:#fef8ee;color:#333;font-size:13px;margin:1em}.wp-block-simpletoc-toc .components-notice span{padding-left:5px} -.simpletoc{margin-bottom:1em}.simpletoc-collapsible{background-color:#eee;border:none;border-radius:5px;color:#444;cursor:pointer;font-size:18px;font-weight:700;outline:none;padding:18px;text-align:left;width:100%}.simpletoc-collapsible.active{border-bottom-left-radius:0;border-bottom-right-radius:0}.simpletoc .active,.simpletoc-collapsible:hover{background-color:#ddd}.simpletoc-collapsible .simpletoc-icon:after{content:"\02795";float:right;font-size:13px;margin-left:5px}.simpletoc .active .simpletoc-icon:after{content:"\2796"}.simpletoc-content{background-color:#f1f1f1;border-bottom-left-radius:5px;border-bottom-right-radius:5px;display:none;display:block;max-height:0;overflow:hidden;padding:0;transition:max-height .25s ease-in-out} +.simpletoc{margin-bottom:1em}.simpletoc-collapsible{background-color:#eee;border:none;border-radius:5px;color:#444;cursor:pointer;font-size:18px;font-weight:700;outline:none;padding:18px;text-align:left;width:100%}.simpletoc-collapsible.active{border-bottom-left-radius:0;border-bottom-right-radius:0}.simpletoc .active,.simpletoc-collapsible:hover{background-color:#ddd}.simpletoc-collapsible .simpletoc-icon:after{content:"\02795";float:right;font-size:13px;margin-left:5px}.simpletoc .active .simpletoc-icon:after{content:"\2796"}.simpletoc-content{background-color:#f1f1f1;border-bottom-left-radius:5px;border-bottom-right-radius:5px;display:block;max-height:0;overflow:hidden;padding:0;transition:max-height .25s ease-in-out} diff --git a/build/index.js b/build/index.js index 9d263fd..125adaa 100644 --- a/build/index.js +++ b/build/index.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,l=window.wp.blocks,n=JSON.parse('{"$schema":"https://json.schemastore.org/block.json","apiVersion":2,"name":"simpletoc/toc","version":"6.1.0","title":"SimpleTOC","category":"layout","icon":"","keywords":["TOC","Table of Contents","SimpleTOC","Index"],"supports":{"align":["wide","full"]},"description":"Adds a Table of Contents.","attributes":{"no_title":{"type":"boolean","default":false},"title_level":{"type":"integer","default":2},"title_text":{"type":"string"},"use_ol":{"type":"boolean","default":false},"remove_indent":{"type":"boolean","default":false},"add_smooth":{"type":"boolean","default":false},"use_absolute_urls":{"type":"boolean","default":false},"max_level":{"type":"integer","default":6},"min_level":{"type":"integer","default":1},"updated":{"type":"integer"},"accordion":{"type":"boolean","default":false},"wrapper":{"type":"boolean","default":false}},"textdomain":"simpletoc","editorScript":"file:index.js","editorStyle":"file:index.css"}'),o=window.wp.i18n,i=window.wp.blockEditor,a=window.wp.editor,c=window.wp.serverSideRender;var s=e.n(c);const r=window.React,m=window.wp.primitives,d=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),v=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})),h=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})),p=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})),u=window.wp.components;function _({level:e,isPressed:l=!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 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(e)?(0,t.createElement)(u.SVG,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:l},(0,t.createElement)(u.Path,{d:n[e]})):null}const g=[0,1,2,3,4,5,6],w={className:"block-library-heading-level-dropdown"};function b({selectedLevel:e,onChange:l}){return(0,t.createElement)(u.ToolbarDropdownMenu,{popoverProps:w,icon:(0,t.createElement)(_,{level:e}),label:(0,o.__)("Change heading level tag"),controls:g.map((n=>{{const o=n===e;return{icon:(0,t.createElement)(_,{level:n,isPressed:o}),isActive:o,onClick(){l(n)}}}}))})}const E=window.wp.data,f=(0,t.createElement)("svg",{clipRule:"evenodd",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",viewBox:"0 0 500 500",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"m365.983 78.248c2.72-32.415 29.921-57.908 63.029-57.908 34.91 0 63.253 28.342 63.253 63.252s-28.343 63.252-63.253 63.252v269.582c0 25.232-20.485 45.718-45.718 45.718h-313.62c-25.233 0-45.719-20.486-45.719-45.718v-292.46c0-25.233 20.486-45.718 45.719-45.718zm-245.943 324.857c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714zm50.851-40.952h183.063v20.476h-183.063zm-50.851-61.428c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714zm50.851-40.952h183.063v20.476h-183.063zm-50.851-61.428c-16.883 0-30.511-13.719-30.511-30.714 0-16.791 13.628-30.714 30.511-30.714 16.679 0 30.511 13.923 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714zm50.851-40.952h183.063v20.476h-183.063zm253.007-44.649v-24.188h-24.008v-10.108h24.008v-24.008h10.229v24.008h24.008v10.108h-24.008v24.188z"}));(0,l.registerBlockType)(n,{icon:f,edit:function({attributes:e,setAttributes:l}){const n=(0,i.useBlockProps)(),{returnisSaving:c,returnisSavingNonPostEntityChanges:r}=(0,E.useSelect)((e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:l}=e(a.store);return{returnisSaving:t(),returnisSavingNonPostEntityChanges:l()}})),m=(0,t.createElement)(i.BlockControls,{group:"block"},!(e.no_title||e.accordion)&&(0,t.createElement)(b,{selectedLevel:e.title_level,onChange:e=>l({title_level:Number(e)})}),(0,t.createElement)(u.ToolbarButton,{icon:d,title:(0,o.__)("Convert to unordered list","simpletoc"),describedBy:(0,o.__)("Convert to unordered list","simpletoc"),isActive:!1===e.use_ol,onClick:()=>{l({use_ol:!1})}}),(0,t.createElement)(u.ToolbarButton,{icon:v,title:(0,o.__)("Convert to ordered list","simpletoc"),describedBy:(0,o.__)("Convert to ordered list","simpletoc"),isActive:!0===e.use_ol,onClick:()=>{l({use_ol:!0})}}),(0,t.createElement)(u.ToolbarButton,{icon:h,title:(0,o.__)("Indent list","simpletoc"),describedBy:(0,o.__)("Indent list","simpletoc"),isActive:!0===e.remove_indent,onClick:()=>{l({remove_indent:!0})}}),(0,t.createElement)(u.ToolbarButton,{icon:p,title:(0,o.__)("Outdent list","simpletoc"),describedBy:(0,o.__)("Outdent list","simpletoc"),isActive:!1===e.remove_indent,onClick:()=>{l({remove_indent:!1})}})),_=(0,t.createElement)(i.InspectorControls,null,(0,t.createElement)(u.Panel,null,(0,t.createElement)(u.PanelBody,null,!e.no_title&&(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.TextControl,{label:(0,o.__)("Heading Text","simpletoc"),help:(0,o.__)("Set the heading text of the block.","simpletoc")+" "+(0,o.__)("Default value","simpletoc")+": "+(0,o.__)("Table of Contents","simpletoc"),value:e.title_text,onChange:e=>l({title_text:e||(0,o.__)("Table of Contents","simpletoc")})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Remove heading","simpletoc"),checked:e.no_title,onChange:()=>l({no_title:!e.no_title})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.SelectControl,{label:(0,o.__)("Minimum level","simpletoc"),help:(0,o.__)("Minimum depth of the headings.","simpletoc"),value:e.min_level,options:[{label:(0,o.__)("Including","simpletoc")+" H6",value:"6"},{label:(0,o.__)("Including","simpletoc")+" H5",value:"5"},{label:(0,o.__)("Including","simpletoc")+" H4",value:"4"},{label:(0,o.__)("Including","simpletoc")+" H3",value:"3"},{label:(0,o.__)("Including","simpletoc")+" H2",value:"2"},{label:(0,o.__)("Including","simpletoc")+" H1 ("+(0,o.__)("default","simpletoc")+")",value:"1"}],onChange:e=>l({min_level:Number(e)})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.SelectControl,{label:(0,o.__)("Maximum level","simpletoc"),help:(0,o.__)("Maximum depth of the headings.","simpletoc"),value:e.max_level,options:[{label:(0,o.__)("Including","simpletoc")+" H6 ("+(0,o.__)("default","simpletoc")+")",value:"6"},{label:(0,o.__)("Including","simpletoc")+" H5",value:"5"},{label:(0,o.__)("Including","simpletoc")+" H4",value:"4"},{label:(0,o.__)("Including","simpletoc")+" H3",value:"3"},{label:(0,o.__)("Including","simpletoc")+" H2",value:"2"},{label:(0,o.__)("Including","simpletoc")+" H1",value:"1"}],onChange:e=>l({max_level:Number(e)})})))),(0,t.createElement)(u.Panel,null,(0,t.createElement)(u.PanelBody,{title:(0,o.__)("Advanced Features","simpletoc"),icon:"settings",initialOpen:!1},(0,t.createElement)(u.PanelRow,null,(0,t.createElement)("div",{style:{marginBottom:"1em",border:"1px solid rgba(0, 0, 0, 0.05)",padding:"0.5em",backgroundColor:"#f7f7f7"}},(0,t.createElement)("p",null,(0,t.createElement)("strong",null,(0,o.__)("Think about making a donation if you use any of these features.","simpletoc"))),(0,t.createElement)(u.ExternalLink,{href:"https://marc.tv/out/donate"},(0,o.__)("Donate here!","simpletoc")))),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide in accordion menu","simpletoc"),help:(0,o.__)("Adds minimal JavaScript and css styles.","simpletoc"),checked:e.accordion,onChange:()=>l({accordion:!e.accordion})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Smooth scrolling support","simpletoc"),help:(0,o.__)('Adds the following CSS to the HTML element: "scroll-behavior: smooth;"',"simpletoc"),checked:e.add_smooth,onChange:()=>l({add_smooth:!e.add_smooth})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Use absolute urls","simpletoc"),help:(0,o.__)("Adds the permalink url to the fragment.","simpletoc"),checked:e.use_absolute_urls,onChange:()=>l({use_absolute_urls:!e.use_absolute_urls})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Wrapper div","simpletoc"),help:(0,o.__)('Additionally adds the role "navigation" and ARIA attributes.',"simpletoc"),checked:e.wrapper,onChange:()=>l({wrapper:!e.wrapper})})))));return(0,t.createElement)("div",n,m,_,c||r?(0,t.createElement)(u.Spinner,null):(0,t.createElement)(s(),{block:"simpletoc/toc",attributes:e}))},save:function(){return null}})})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,l=window.wp.blocks,n=JSON.parse('{"$schema":"https://json.schemastore.org/block.json","apiVersion":2,"name":"simpletoc/toc","version":"6.2.0","title":"SimpleTOC","category":"layout","icon":"","keywords":["TOC","Table of Contents","SimpleTOC","Index"],"supports":{"align":["wide","full"]},"description":"Adds a Table of Contents.","attributes":{"no_title":{"type":"boolean","default":false},"title_level":{"type":"integer","default":2},"title_text":{"type":"string"},"use_ol":{"type":"boolean","default":false},"remove_indent":{"type":"boolean","default":false},"add_smooth":{"type":"boolean","default":false},"use_absolute_urls":{"type":"boolean","default":false},"max_level":{"type":"integer","default":6},"min_level":{"type":"integer","default":1},"updated":{"type":"integer"},"accordion":{"type":"boolean","default":false},"wrapper":{"type":"boolean","default":false}},"textdomain":"simpletoc","editorScript":"file:index.js","editorStyle":"file:index.css"}'),o=window.wp.i18n,i=window.wp.blockEditor,a=window.wp.editor,c=window.wp.serverSideRender;var s=e.n(c);const r=window.React,m=window.wp.primitives,d=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),v=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})),h=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})),p=(0,r.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(m.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})),u=window.wp.components;function _({level:e,isPressed:l=!1}){const n={0:"M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z",1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.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-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(e)?(0,t.createElement)(u.SVG,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:l},(0,t.createElement)(u.Path,{d:n[e]})):null}const g=[0,1,2,3,4,5,6],w={className:"block-library-heading-level-dropdown"};function b({selectedLevel:e,onChange:l}){return(0,t.createElement)(u.ToolbarDropdownMenu,{popoverProps:w,icon:(0,t.createElement)(_,{level:e}),label:(0,o.__)("Change heading level tag"),controls:g.map((n=>{{const o=n===e;return{icon:(0,t.createElement)(_,{level:n,isPressed:o}),isActive:o,onClick(){l(n)}}}}))})}const E=window.wp.data,f=(0,t.createElement)("svg",{clipRule:"evenodd",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",viewBox:"0 0 500 500",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"m365.983 78.248c2.72-32.415 29.921-57.908 63.029-57.908 34.91 0 63.253 28.342 63.253 63.252s-28.343 63.252-63.253 63.252v269.582c0 25.232-20.485 45.718-45.718 45.718h-313.62c-25.233 0-45.719-20.486-45.719-45.718v-292.46c0-25.233 20.486-45.718 45.719-45.718zm-245.943 324.857c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714zm50.851-40.952h183.063v20.476h-183.063zm-50.851-61.428c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714zm50.851-40.952h183.063v20.476h-183.063zm-50.851-61.428c-16.883 0-30.511-13.719-30.511-30.714 0-16.791 13.628-30.714 30.511-30.714 16.679 0 30.511 13.923 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714zm50.851-40.952h183.063v20.476h-183.063zm253.007-44.649v-24.188h-24.008v-10.108h24.008v-24.008h10.229v24.008h24.008v10.108h-24.008v24.188z"}));(0,l.registerBlockType)(n,{icon:f,edit:function({attributes:e,setAttributes:l}){const n=(0,i.useBlockProps)(),{returnisSaving:c,returnisSavingNonPostEntityChanges:r}=(0,E.useSelect)((e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:l}=e(a.store);return{returnisSaving:t(),returnisSavingNonPostEntityChanges:l()}})),m=(0,t.createElement)(i.BlockControls,{group:"block"},!(e.no_title||e.accordion)&&(0,t.createElement)(b,{selectedLevel:e.title_level,onChange:e=>l({title_level:Number(e)})}),(0,t.createElement)(u.ToolbarButton,{icon:d,title:(0,o.__)("Convert to unordered list","simpletoc"),describedBy:(0,o.__)("Convert to unordered list","simpletoc"),isActive:!1===e.use_ol,onClick:()=>{l({use_ol:!1})}}),(0,t.createElement)(u.ToolbarButton,{icon:v,title:(0,o.__)("Convert to ordered list","simpletoc"),describedBy:(0,o.__)("Convert to ordered list","simpletoc"),isActive:!0===e.use_ol,onClick:()=>{l({use_ol:!0})}}),(0,t.createElement)(u.ToolbarButton,{icon:h,title:(0,o.__)("Indent list","simpletoc"),describedBy:(0,o.__)("Indent list","simpletoc"),isActive:!0===e.remove_indent,onClick:()=>{l({remove_indent:!0})}}),(0,t.createElement)(u.ToolbarButton,{icon:p,title:(0,o.__)("Outdent list","simpletoc"),describedBy:(0,o.__)("Outdent list","simpletoc"),isActive:!1===e.remove_indent,onClick:()=>{l({remove_indent:!1})}})),_=(0,t.createElement)(i.InspectorControls,null,(0,t.createElement)(u.Panel,null,(0,t.createElement)(u.PanelBody,null,!e.no_title&&(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.TextControl,{label:(0,o.__)("Heading Text","simpletoc"),help:(0,o.__)("Set the heading text of the block.","simpletoc")+" "+(0,o.__)("Default value","simpletoc")+": "+(0,o.__)("Table of Contents","simpletoc"),value:e.title_text,onChange:e=>l({title_text:e||(0,o.__)("Table of Contents","simpletoc")})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Remove heading","simpletoc"),checked:e.no_title,onChange:()=>l({no_title:!e.no_title})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.SelectControl,{label:(0,o.__)("Minimum level","simpletoc"),help:(0,o.__)("Minimum depth of the headings.","simpletoc"),value:e.min_level,options:[{label:(0,o.__)("Including","simpletoc")+" H6",value:"6"},{label:(0,o.__)("Including","simpletoc")+" H5",value:"5"},{label:(0,o.__)("Including","simpletoc")+" H4",value:"4"},{label:(0,o.__)("Including","simpletoc")+" H3",value:"3"},{label:(0,o.__)("Including","simpletoc")+" H2",value:"2"},{label:(0,o.__)("Including","simpletoc")+" H1 ("+(0,o.__)("default","simpletoc")+")",value:"1"}],onChange:e=>l({min_level:Number(e)})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.SelectControl,{label:(0,o.__)("Maximum level","simpletoc"),help:(0,o.__)("Maximum depth of the headings.","simpletoc"),value:e.max_level,options:[{label:(0,o.__)("Including","simpletoc")+" H6 ("+(0,o.__)("default","simpletoc")+")",value:"6"},{label:(0,o.__)("Including","simpletoc")+" H5",value:"5"},{label:(0,o.__)("Including","simpletoc")+" H4",value:"4"},{label:(0,o.__)("Including","simpletoc")+" H3",value:"3"},{label:(0,o.__)("Including","simpletoc")+" H2",value:"2"},{label:(0,o.__)("Including","simpletoc")+" H1",value:"1"}],onChange:e=>l({max_level:Number(e)})})))),(0,t.createElement)(u.Panel,null,(0,t.createElement)(u.PanelBody,{title:(0,o.__)("Advanced Features","simpletoc"),icon:"settings",initialOpen:!1},(0,t.createElement)(u.PanelRow,null,(0,t.createElement)("div",{style:{marginBottom:"1em",border:"1px solid rgba(0, 0, 0, 0.05)",padding:"0.5em",backgroundColor:"#f7f7f7"}},(0,t.createElement)("p",null,(0,t.createElement)("strong",null,(0,o.__)("Think about making a donation if you use any of these features.","simpletoc"))),(0,t.createElement)(u.ExternalLink,{href:"https://marc.tv/out/donate"},(0,o.__)("Donate here!","simpletoc")))),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide in accordion menu","simpletoc"),help:(0,o.__)("Adds minimal JavaScript and css styles.","simpletoc"),checked:e.accordion,onChange:()=>l({accordion:!e.accordion})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Smooth scrolling support","simpletoc"),help:(0,o.__)('Adds the following CSS to the HTML element: "scroll-behavior: smooth;"',"simpletoc"),checked:e.add_smooth,onChange:()=>l({add_smooth:!e.add_smooth})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Use absolute urls","simpletoc"),help:(0,o.__)("Adds the permalink url to the fragment.","simpletoc"),checked:e.use_absolute_urls,onChange:()=>l({use_absolute_urls:!e.use_absolute_urls})})),(0,t.createElement)(u.PanelRow,null,(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Wrapper div","simpletoc"),help:(0,o.__)('Additionally adds the role "navigation" and ARIA attributes.',"simpletoc"),checked:e.wrapper,onChange:()=>l({wrapper:!e.wrapper})})))));return(0,t.createElement)("div",n,m,_,c||r?(0,t.createElement)(u.Spinner,null):(0,t.createElement)(s(),{block:"simpletoc/toc",attributes:e}))},save:function(){return null}})})(); \ No newline at end of file diff --git a/package.json b/package.json index d447255..84b640f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simpletoc", - "version": "6.1.1", + "version": "6.2.0", "author": "Marc Tönsing", "description": "SEO-friendly Table of Contents Gutenberg block. No JavaScript and no CSS means faster loading.", "main": "build/index.js", diff --git a/plugin.php b/plugin.php index d73746f..5b725bb 100644 --- a/plugin.php +++ b/plugin.php @@ -4,7 +4,7 @@ * Plugin Name: SimpleTOC - Table of Contents Block * Plugin URI: https://marc.tv/simpletoc-wordpress-inhaltsverzeichnis-plugin-gutenberg/ * Description: SEO-friendly Table of Contents Gutenberg block. No JavaScript and no CSS means faster loading. - * Version: 6.1.1 + * Version: 6.2.0 * Author: Marc Tönsing * Author URI: https://toensing.com * Text Domain: simpletoc @@ -621,7 +621,7 @@ function enqueue_accordion_frontend() 'simpletoc-accordion', plugin_dir_url(__FILE__) . 'src/accordion.js', array(), - '6.1.1', + '6.2.0', true ); @@ -629,7 +629,7 @@ function enqueue_accordion_frontend() 'simpletoc-accordion', plugin_dir_url(__FILE__) . 'src/accordion.css', array(), - '6.1.1' + '6.2.0' ); } diff --git a/src/block.json b/src/block.json index e8e9dbf..5219403 100644 --- a/src/block.json +++ b/src/block.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/block.json", "apiVersion": 2, "name": "simpletoc/toc", - "version": "6.1.0", + "version": "6.2.0", "title": "SimpleTOC", "category": "layout", "icon": "",