From 0fd79edfa170a97c50ecfc5bbb3c13538c4c7de7 Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Wed, 18 Nov 2020 21:53:27 +0200 Subject: [PATCH] Restructure add-on --- src/Widgets/index.js | 1 - src/components/index.js | 1 + .../manage/Blocks/Accordion/Panels.jsx | 2 +- .../manage/Blocks/Accordion/editor.less | 9 + .../Accordion/icons/five-circle-bottom.svg | 165 ------------------ .../Accordion/icons/three-circle-bottom.svg | 95 ---------- .../manage/Blocks/Accordion/panels.js | 22 +-- .../manage}/Widgets/PanelWidget.jsx | 0 src/icons/accordion.svg | 83 +++++++++ .../icons/circle-bottom.svg => icons/one.svg} | 52 +++--- src/icons/three.svg | 93 ++++++++++ src/icons/two.svg | 83 +++++++++ src/index.js | 6 +- 13 files changed, 313 insertions(+), 299 deletions(-) delete mode 100644 src/Widgets/index.js delete mode 100644 src/components/manage/Blocks/Accordion/icons/five-circle-bottom.svg delete mode 100644 src/components/manage/Blocks/Accordion/icons/three-circle-bottom.svg rename src/{ => components/manage}/Widgets/PanelWidget.jsx (100%) create mode 100644 src/icons/accordion.svg rename src/{components/manage/Blocks/Accordion/icons/circle-bottom.svg => icons/one.svg} (57%) create mode 100644 src/icons/three.svg create mode 100644 src/icons/two.svg diff --git a/src/Widgets/index.js b/src/Widgets/index.js deleted file mode 100644 index 53373cb..0000000 --- a/src/Widgets/index.js +++ /dev/null @@ -1 +0,0 @@ -export PanelWidget from './PanelWidget.jsx'; diff --git a/src/components/index.js b/src/components/index.js index 96da5e4..573f995 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,5 +1,6 @@ export AccordionBlockEdit from './manage/Blocks/Accordion/Edit'; export AccordionBlockView from './manage/Blocks/Accordion/View'; export AccordionBlockSchema from './manage/Blocks/Accordion/Schema'; +export PanelWidget from './manage/Widgets/PanelWidget'; export { options } from './manage/Blocks/Accordion/panels'; diff --git a/src/components/manage/Blocks/Accordion/Panels.jsx b/src/components/manage/Blocks/Accordion/Panels.jsx index 9b1f232..eff44ba 100644 --- a/src/components/manage/Blocks/Accordion/Panels.jsx +++ b/src/components/manage/Blocks/Accordion/Panels.jsx @@ -6,7 +6,7 @@ import './editor.less'; export default ({ data, onChange, children, variants }) => { return ( -

Select Panels:

+

Accordion Panels:

{variants.map(({ icon, defaultData, title }, index) => ( onChange(defaultData)}> diff --git a/src/components/manage/Blocks/Accordion/editor.less b/src/components/manage/Blocks/Accordion/editor.less index dfe6378..c996551 100644 --- a/src/components/manage/Blocks/Accordion/editor.less +++ b/src/components/manage/Blocks/Accordion/editor.less @@ -1,6 +1,15 @@ .block-editor-accordion { margin: 0 -2.2rem; + .ui.card { + .content { + color: #68778d; + svg { + fill: #68778d; + } + } + } + .block-editor-accordion { margin: 0 0.1rem; } diff --git a/src/components/manage/Blocks/Accordion/icons/five-circle-bottom.svg b/src/components/manage/Blocks/Accordion/icons/five-circle-bottom.svg deleted file mode 100644 index 8c0bb4d..0000000 --- a/src/components/manage/Blocks/Accordion/icons/five-circle-bottom.svg +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/manage/Blocks/Accordion/icons/three-circle-bottom.svg b/src/components/manage/Blocks/Accordion/icons/three-circle-bottom.svg deleted file mode 100644 index 4d13a10..0000000 --- a/src/components/manage/Blocks/Accordion/icons/three-circle-bottom.svg +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - diff --git a/src/components/manage/Blocks/Accordion/panels.js b/src/components/manage/Blocks/Accordion/panels.js index bfeb3b0..d190e8a 100644 --- a/src/components/manage/Blocks/Accordion/panels.js +++ b/src/components/manage/Blocks/Accordion/panels.js @@ -1,27 +1,27 @@ -import threeColumnSVG from './icons/three-circle-bottom.svg'; -import fiveColumnSVG from './icons/five-circle-bottom.svg'; -import oneColumnSVG from './icons/circle-bottom.svg'; +import oneSVG from '@eeacms/volto-accordion-block/icons/one.svg'; +import twoSVG from '@eeacms/volto-accordion-block/icons/two.svg'; +import threeSVG from '@eeacms/volto-accordion-block/icons/three.svg'; export const options = [ { - icon: oneColumnSVG, + icon: oneSVG, defaultData: { count: 1, }, - title: '1 Panel', + title: '1', }, { - icon: threeColumnSVG, + icon: twoSVG, defaultData: { - count: 3, + count: 2, }, - title: '3 Panels', + title: '2', }, { - icon: fiveColumnSVG, + icon: threeSVG, defaultData: { - count: 5, + count: 3, }, - title: '5 Panels', + title: '3', }, ]; diff --git a/src/Widgets/PanelWidget.jsx b/src/components/manage/Widgets/PanelWidget.jsx similarity index 100% rename from src/Widgets/PanelWidget.jsx rename to src/components/manage/Widgets/PanelWidget.jsx diff --git a/src/icons/accordion.svg b/src/icons/accordion.svg new file mode 100644 index 0000000..e9ebd8e --- /dev/null +++ b/src/icons/accordion.svg @@ -0,0 +1,83 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/src/components/manage/Blocks/Accordion/icons/circle-bottom.svg b/src/icons/one.svg similarity index 57% rename from src/components/manage/Blocks/Accordion/icons/circle-bottom.svg rename to src/icons/one.svg index 1a3e725..592660a 100644 --- a/src/components/manage/Blocks/Accordion/icons/circle-bottom.svg +++ b/src/icons/one.svg @@ -1,5 +1,6 @@ + sodipodi:docname="one.svg" + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> - - - - + id="defs104"> + + + + + + diff --git a/src/icons/three.svg b/src/icons/three.svg new file mode 100644 index 0000000..4373d27 --- /dev/null +++ b/src/icons/three.svg @@ -0,0 +1,93 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/src/icons/two.svg b/src/icons/two.svg new file mode 100644 index 0000000..5933806 --- /dev/null +++ b/src/icons/two.svg @@ -0,0 +1,83 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/src/index.js b/src/index.js index ff327b8..32c13cd 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,10 @@ -import circleBottomSVG from '@plone/volto/icons/circle-bottom.svg'; +import accordionSVG from '@eeacms/volto-accordion-block/icons/accordion.svg'; import { AccordionBlockEdit, AccordionBlockView, AccordionBlockSchema, } from './components'; -import { PanelWidget } from './Widgets'; +import { PanelWidget } from '@eeacms/volto-accordion-block/components'; import { options } from '@eeacms/volto-accordion-block/components'; const applyConfig = (config) => { @@ -36,7 +36,7 @@ const applyConfig = (config) => { config.blocks.blocksConfig.accordion = { id: 'accordion', title: 'Accordion', - icon: circleBottomSVG, + icon: accordionSVG, group: 'common', view: AccordionBlockView, edit: AccordionBlockEdit,