Skip to content

Commit

Permalink
Fix: Accordion styling in Gutenberg editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoensing committed Nov 1, 2022
1 parent f400a0a commit 3ecef0e
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions build/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "simpletoc/toc",
"version": "5.0.38",
"version": "5.0.40",
"title": "SimpleTOC",
"category": "layout",
"icon": "<svg clip-rule='evenodd' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'><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.718z' fill='#070D0D'/><g fill='#fff'><path d='m423.898 112.744v-24.188h-24.008v-10.108h24.008v-24.008h10.229v24.008h24.008v10.108h-24.008v24.188z'/><path d='m120.04 403.105c-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.714z'/><path d='m170.891 362.153h183.063v20.476h-183.063z'/><path d='m120.04 300.725c-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.714z'/><path d='m170.891 259.773h183.063v20.476h-183.063z'/><path d='m120.04 198.345c-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.714z'/><path d='m170.891 157.393h183.063v20.476h-183.063z'/></g></svg>",
Expand Down Expand Up @@ -69,5 +69,5 @@
},
"textdomain": "simpletoc",
"editorScript": "file:index.js",
"editorStyle": "file:editor.css"
"editorStyle": "file:index.css"
}
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '70da79290167de8f0d39');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '228ca87507b1fafbfffa');
2 changes: 2 additions & 0 deletions build/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simpletoc",
"version": "5.0.39",
"version": "5.0.40",
"author": "Marc Tönsing",
"description": "SEO-friendly Table of Contents Gutenberg block. No JavaScript and no CSS means faster loading.",
"main": "build/index.js",
Expand All @@ -22,7 +22,7 @@
},
"devDependencies": {
"@wordpress/env": "^5.5.0",
"@wordpress/scripts": "^24.4.0",
"@wordpress/scripts": "24.4.0",
"ansi-regex": ">=6.0.1",
"markdown-it": ">=12.3.2",
"nanoid": ">=3.1.31",
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: 5.0.39
* Version: 5.0.40
* Author: Marc Tönsing
* Author URI: https://marc.tv
* Text Domain: simpletoc
Expand Down
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: Gutenberg, block, TOC, Table of Contents, AMP
Requires at least: 5.9
Donate link: https://marc.tv/out/donate
Tested up to: 6.0
Stable tag: 5.0.39
Stable tag: 5.0.40
Requires PHP: 7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -51,6 +51,7 @@ SimpleTOC is open-source and developed on [GitHub Pages](https://github.com/mtoe
* Feature: Hide SimpleTOC in an accordion menu. Adds minimal JavaScript and css styles if enabled.
* Feature: Option to change SimpleTOC block heading level.
* Fix: Accordion menu can now be added multiple times.
* Fix: Accordion styling in Gutenberg editor.

= 5.0.36 =
* Feature: [Spin up](https://demo.tastewp.com/simpletoc) a new WordPress instance with the SimpleTOC plugin already installed.
Expand Down Expand Up @@ -113,7 +114,7 @@ Example:

= How do I add SimpleTOC to all articles automatically? =

I don’t see an easy solution at the moment. SimpleTOC is only a block that can be placed in your post. If there was a plugin that adds blocks to every post, then this would be the solution. I think this should be another separate plug-in to keep the code of SimpleTOC clean and … well, simple. Maybe someone knows of a plug-in that adds blocks automatically to all posts with some parameters and settings?
I don’t see an easy solution at the moment. SimpleTOC is only a block that can be placed in your post. If there was a plugin that adds blocks to every post, then this would be the solution. I think this should be another separate plug-in to keep the code of SimpleTOC clean and … well, simple.

== Screenshots ==
1. SimpleTOC block in Gutenberg editor.
Expand Down
1 change: 0 additions & 1 deletion src/accordion.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@
overflow: hidden;
background-color: #f1f1f1;
}

4 changes: 2 additions & 2 deletions src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "simpletoc/toc",
"version": "5.0.38",
"version": "5.0.40",
"title": "SimpleTOC",
"category": "layout",
"icon": "<svg clip-rule='evenodd' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'><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.718z' fill='#070D0D'/><g fill='#fff'><path d='m423.898 112.744v-24.188h-24.008v-10.108h24.008v-24.008h10.229v24.008h24.008v10.108h-24.008v24.188z'/><path d='m120.04 403.105c-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.714z'/><path d='m170.891 362.153h183.063v20.476h-183.063z'/><path d='m120.04 300.725c-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.714z'/><path d='m170.891 259.773h183.063v20.476h-183.063z'/><path d='m120.04 198.345c-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.714z'/><path d='m170.891 157.393h183.063v20.476h-183.063z'/></g></svg>",
Expand Down Expand Up @@ -61,5 +61,5 @@
},
"textdomain": "simpletoc",
"editorScript": "file:index.js",
"editorStyle": "file:editor.css"
"editorStyle": "file:index.css"
}
4 changes: 3 additions & 1 deletion src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import {
import HeadingLevelDropdown from './heading-level-dropdown';
import { select, subscribe } from '@wordpress/data';
import { useEffect, useState } from 'react';
import './editor.scss';
import './accordion.css';

export default function Edit( { attributes, setAttributes } ) {
const blockProps = useBlockProps();
Expand Down Expand Up @@ -273,7 +275,7 @@ export default function Edit( { attributes, setAttributes } ) {
'simpletoc'
) }
help={ __(
'This will add minimal JavaScript and css styles.',
'Adds minimal JavaScript and css styles.',
'simpletoc'
) }
checked={ attributes.accordion }
Expand Down
File renamed without changes.

0 comments on commit 3ecef0e

Please sign in to comment.