Gets rid of compatibility checks made for WordPress previous to 5.9. #798.

This commit is contained in:
mateuswetah 2023-07-24 18:18:09 -03:00
parent 89a23e3848
commit fcd92e1e2c
86 changed files with 248 additions and 437 deletions

View File

@ -312,7 +312,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item:hover button:hover {
background-color: white !important;

File diff suppressed because one or more lines are too long

View File

@ -304,7 +304,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item:hover button:hover {
background-color: white !important;

File diff suppressed because one or more lines are too long

View File

@ -312,7 +312,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item:hover button:hover {
background-color: white !important;

File diff suppressed because one or more lines are too long

View File

@ -91,7 +91,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-collections-list ul.collections-list-edit li.collection-list-item:hover button:hover {
background-color: white !important;

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,mCAAoC;EAChC,MAAM,EAAE,QAAQ;EAGhB,uDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;gGAC2D;IACvD,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;EAId;8FACyD;IACrD,qBAAqB,EAAE,wBAAwB;I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ACT,KAAK,EAAE,OAAO",
"sources": ["../../views/gutenberg-blocks/blocks/collections-list/style.scss","../../views/gutenberg-blocks/scss/gutenberg-blocks-variables.scss"],
"names": [],
"file": "tainacan-gutenberg-block-collections-list.css"

View File

@ -216,7 +216,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-dynamic-items-list ul.items-list-edit li.item-list-item:hover button:hover {
background-color: white !important;

File diff suppressed because one or more lines are too long

View File

@ -207,7 +207,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-facets-list ul.facets-list-edit li.facet-list-item:hover button:hover {
background-color: white !important;

File diff suppressed because one or more lines are too long

View File

@ -95,7 +95,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-items-list ul.items-list-edit li.item-list-item:hover button:hover {
background-color: white !important;

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAGhB,iDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;8EAC+C;IAC3C,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;EAId;4EAC6C;IACzC,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,iBAAiB;IAClC,kBAAkB,EAAE,eAAe;IAEnC;iFAAG;MACC,UAAU,EAAE,YAAY;MACxB,YAAY,EAAE,YAAY;MAC1B,WAAW,EAAE,YAAY;MACzB,MAAM,EAAE,gBAAgB;MAExB;uFAAI;QACA,MAAM,EAAE,gBAA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"],
"names": [],
"file": "tainacan-gutenberg-block-items-list.css"

View File

@ -75,7 +75,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, #a5a5a5);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-terms-list ul.terms-list-edit li.term-list-item:hover button:hover {
background-color: white !important;

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAGhB,iDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;8EAC+C;IAC3C,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;EAId;oEACqC;IACjC,OAAO,EAAE,CAAC;ICpBd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IDmBT,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,OAAO,EAAE,KAAK;MACd,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,KAAK,EAAE,KAAK;MAEZ;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,MAAM;MAGvB;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,GAAG;QACZ,aAAa,EAAE,KAAK;MAGxB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;;kGACU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;EAIjC,kEAAqC;IACjC,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0FAAkB;QACd,KAAK,EAAE,IAAI;QACX;gGAAI;UAAE,KAAK,EAAE,IAAI;EAM7B;oEACqC;IACjC,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,IAAI;MAChB,SAAS,EAAE,gBAAgB;MAC3B,KAAK,EAAE,gBAAgB;MAEvB;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,UAAU;MAG1B;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;;kGACU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QAnC/C;4FAAkB;UAoCV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAxC/C;4FAAkB;UAyCV,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA7C9C;4FAAkB;UA8CV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAlD9C;4FAAkB;UAmDV,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB;;AAOhC;qHACa;EACT,KAAK,EAAE,OAAO",
"sources": ["../../views/gutenberg-blocks/blocks/terms-list/style.scss","../../views/gutenberg-blocks/scss/gutenberg-blocks-variables.scss"],
"names": [],
"file": "tainacan-gutenberg-block-terms-list.css"

View File

@ -1,7 +1,7 @@
=== Tainacan ===
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, vnmedeiros, tainacan, r-guimaraes, suelanesilva, ccaio, alanargomes, ateneagarcia123, rodrigo0freire, clarandreozzi
Tags: museums, libraries, archives, GLAM, collections, repository
Requires at least: 5.0
Requires at least: 5.9
Tested up to: 6.2.2
Requires PHP: 5.6
Stable tag: 0.20.3

View File

@ -5,7 +5,7 @@ Plugin URI: https://tainacan.org/
Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform.
Author: Tainacan.org
Version: 0.20.3
Requires at least: 5.0
Requires at least: 5.9
Tested up to: 6.2.2
Requires PHP: 5.6
Stable tag: 0.20.3

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/carousel-collections-list",
"title": "Tainacan Collections Carousel",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "collections", "carousel", "slider" ],
"description": "List collections on a Carousel, displaying either its thumbnail or a preview of its items.",
@ -122,5 +122,5 @@
}
},
"editorScript": "carousel-collections-list",
"editorStyle": "carousel-collections-list"
"editorStyle": ["carousel-collections-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,6 +1,6 @@
const { RangeControl, Spinner, Button, BaseControl, ToggleControl, SelectControl, Placeholder, IconButton, PanelBody } = wp.components;
const { RangeControl, Spinner, Button, BaseControl, ToggleControl, SelectControl, Placeholder, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps, store } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps, store } = wp.blockEditor;
const { __ } = wp.i18n;
@ -42,7 +42,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
// Obtains block's client id to render it on save function
setAttributes({ blockId: clientId });
@ -81,17 +81,12 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
<li
key={ collection.id }
className={ 'swiper-slide collection-list-item ' + (!showCollectionThumbnail ? 'collection-list-item-grid ' : '') + (maxCollectionsPerScreen ? ' max-collections-per-screen-' + maxCollectionsPerScreen : '') }>
{ tainacan_blocks.wp_version < '5.4' ?
<IconButton
onClick={ () => removeItemOfId(collection.id) }
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<Button
onClick={ () => removeItemOfId(collection.id) }
icon="no-alt"
icon={ () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"></path></svg>
) }
label={__('Remove', 'tainacan')}/>
}
<a
id={ isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id }
href={ collection.url }>

View File

@ -1,4 +1,4 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function ({ attributes, className }) {
const {
@ -21,7 +21,7 @@ export default function ({ attributes, className }) {
} = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div
{ ...blockProps }
data-module="carousel-collections-list"

View File

@ -377,7 +377,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/carousel-items-list",
"title": "Tainacan Collection's Items Carousel",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "items", "carousel", "slider" ],
"description": "List items on a Carousel, using search or item selection.",
@ -142,5 +142,5 @@
}
},
"editorScript": "carousel-items-list",
"editorStyle": "carousel-items-list"
"editorStyle": [ "carousel-items-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,8 +1,8 @@
const { __ } = wp.i18n;
const { RangeControl, Spinner, Button, ToggleControl, SelectControl, Placeholder, IconButton, ColorPalette, BaseControl, PanelBody } = wp.components;
const { RangeControl, Spinner, Button, ToggleControl, SelectControl, Placeholder, ColorPalette, BaseControl, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps, store } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps, store } = wp.blockEditor;
const { useSelect } = wp.data;
@ -14,7 +14,6 @@ import axios from 'axios';
import qs from 'qs';
import { ThumbnailHelperFunctions } from '../../../admin/js/utilities.js';
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
import TainacanBlocksCompatColorPicker from '../../js/compatibility/tainacan-blocks-compat-colorpicker.js';
import 'swiper/css';
import 'swiper/css/a11y';
import 'swiper/css/autoplay';
@ -52,7 +51,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
// Obtains block's client id to render it on save function
setAttributes({ blockId: clientId });
@ -95,17 +94,13 @@ export default function({ attributes, setAttributes, className, isSelected, clie
key={ item.id }
className={ 'swiper-slide item-list-item ' + (maxItemsPerScreen ? ' max-itens-per-screen-' + maxItemsPerScreen : '') + (['tainacan-medium', 'tainacan-small'].indexOf(imageSize) > -1 ? ' is-forced-square' : '') }>
{ loadStrategy == 'selection' ?
( tainacan_blocks.wp_version < '5.4' ?
<IconButton
onClick={ () => removeItemOfId(item.id) }
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<Button
onClick={ () => removeItemOfId(item.id) }
icon="no-alt"
icon={ () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"></path></svg>
) }
label={__('Remove', 'tainacan')}/>
)
:null
}
<a
@ -351,7 +346,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
<BaseControl
id="backgroundcolorpicker"
label={ __('Background color', 'tainacan')}>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ collectionBackgroundColor }
onChange={ ( color ) => {
collectionBackgroundColor = color;

View File

@ -1,4 +1,4 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function ({ attributes, className }) {
const {
@ -27,7 +27,7 @@ export default function ({ attributes, className }) {
} = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div
{ ...blockProps }
data-module="carousel-items-list"

View File

@ -373,7 +373,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/carousel-terms-list",
"title": "Tainacan Terms Carousel",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "carousel", "slider", "taxonomy" ],
"description": "List terms on a Carousel, showing their thumbnails or a preview of items.",
@ -130,5 +130,5 @@
}
},
"editorScript": "carousel-terms-list",
"editorStyle": "carousel-terms-list"
"editorStyle": ["carousel-terms-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,6 +1,6 @@
const { __ } = wp.i18n;
const { RangeControl, Spinner, Button, BaseControl, ToggleControl, SelectControl, Placeholder, IconButton, PanelBody } = wp.components;
const { RangeControl, Spinner, Button, BaseControl, ToggleControl, SelectControl, Placeholder, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps, store } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
@ -43,7 +43,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
// Obtains block's client id to render it on save function
setAttributes({ blockId: clientId });
@ -82,17 +82,12 @@ export default function({ attributes, setAttributes, className, isSelected, clie
<li
key={ term.id }
className={ 'swiper-slide term-list-item ' + (!showTermThumbnail ? 'term-list-item-grid ' : '') + (maxTermsPerScreen ? ' max-terms-per-screen-' + maxTermsPerScreen : '') }>
{ tainacan_blocks.wp_version < '5.4' ?
<IconButton
onClick={ () => removeItemOfId(term.id) }
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<Button
onClick={ () => removeItemOfId(term.id) }
icon="no-alt"
icon={ () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"></path></svg>
) }
label={__('Remove', 'tainacan')}/>
}
<a
id={ isNaN(term.id) ? term.id : 'term-id-' + term.id }
href={ term.url }>

View File

@ -1,4 +1,4 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes, className }) {
const {
@ -22,7 +22,7 @@ export default function({ attributes, className }) {
} = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div
{ ...blockProps }
data-module="carousel-terms-list"

View File

@ -376,7 +376,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/collections-list",
"title": "Tainacan Collections List",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "Tainacan", "collections", "repository", "tainacan" ],
"description": "Expose collections from your Tainacan repository",
@ -97,5 +97,5 @@
}
},
"editorScript": "collections-list",
"editorStyle": "collections-list"
"editorStyle": ["collections-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,8 +1,8 @@
const { __ } = wp.i18n;
const { RangeControl, IconButton, Button, ToggleControl, Placeholder, PanelBody } = wp.components;
const { RangeControl, Button, ToggleControl, Placeholder, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps } = wp.blockEditor;
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
import CollectionsModal from './collections-modal.js';
@ -20,7 +20,7 @@ export default function({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
function prepareCollection(collection) {
return (
@ -28,13 +28,6 @@ export default function({ attributes, setAttributes, className, isSelected }) {
key={ collection.id }
className="collection-list-item"
style={{ marginBottom: layout == 'grid' ? (showName ? gridMargin + 12 : gridMargin) + 'px' : ''}}>
{
tainacan_blocks.wp_version < '5.4' ?
<IconButton
onClick={ () => removeCollectionOfId(collection.id) }
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<button
onClick={ () => removeCollectionOfId(collection.id) }
type="button"
@ -42,7 +35,6 @@ export default function({ attributes, setAttributes, className, isSelected }) {
aria-label={__('Remove', 'tainacan')}>
<span class="dashicon dashicons dashicons-no-alt" />
</button>
}
<a
id={ isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id }
href={ collection.url }

View File

@ -1,10 +1,10 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes, className }) {
const { content } = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div { ...blockProps } data-module="collections-list">{ content }</div>
};

View File

@ -110,7 +110,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/dynamic-items-list",
"title": "Tainacan Collection's Items List",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "items", "search", "collection" ],
"description": "Dynamically list items from a Tainacan items search",
@ -168,5 +168,5 @@
}
},
"editorScript": "dynamic-items-list",
"editorStyle": "dynamic-items-list"
"editorStyle": ["dynamic-items-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -2,7 +2,7 @@ const { __ } = wp.i18n;
const { ResizableBox, FocalPointPicker, SelectControl, RangeControl, Spinner, Button, ToggleControl, Placeholder, ColorPalette, BaseControl, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps, store } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps, store } = wp.blockEditor;
const { useSelect } = wp.data;
@ -14,7 +14,6 @@ import axios from 'axios';
import qs from 'qs';
import { ThumbnailHelperFunctions } from '../../../admin/js/utilities.js';
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
import TainacanBlocksCompatColorPicker from '../../js/compatibility/tainacan-blocks-compat-colorpicker.js';
export default function({ attributes, setAttributes, className, isSelected, clientId }){
let {
@ -54,7 +53,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
// Obtains block's client id to render it on save function
setAttributes({ blockId: clientId });
@ -130,17 +129,12 @@ export default function({ attributes, setAttributes, className, isSelected, clie
}}
>
{ loadStrategy == 'selection' ?
( tainacan_blocks.wp_version < '5.4' ?
<IconButton
onClick={ () => removeItemOfId(item.id) }
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<Button
onClick={ () => removeItemOfId(item.id) }
icon="no-alt"
icon={ () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"></path></svg>
) }
label={__('Remove', 'tainacan')}/>
)
:null
}
<a
@ -620,7 +614,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
<BaseControl
id="backgroundcolorpicker"
label={ __('Background color', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ collectionBackgroundColor }
onChange={ ( color ) => {
collectionBackgroundColor = color;

View File

@ -1,4 +1,4 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes, className }) {
const {
@ -31,7 +31,7 @@ export default function({ attributes, className }) {
} = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div
{ ...blockProps }
data-module="dynamic-items-list"

View File

@ -264,7 +264,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -219,6 +219,6 @@
"multiple": false
},
"editorScript": "faceted-search",
"editorStyle": "faceted-search",
"editorStyle": ["faceted-search", "tainacan-blocks-common-editor-styles" ],
"style": "faceted-search"
}

View File

@ -4,6 +4,7 @@ const {
Button,
BaseControl,
CheckboxControl,
ColorPalette,
RangeControl,
FontSizePicker,
HorizontalRule,
@ -19,11 +20,10 @@ const {
MenuItemsChoice
} = wp.components;
const { InspectorControls, BlockControls } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls } = wp.blockEditor;
import CollectionModal from './collection-modal.js';
import TermModal from './term-modal.js';
import TainacanBlocksCompatColorPicker from '../../js/compatibility/tainacan-blocks-compat-colorpicker.js';
export default function({ attributes, setAttributes, className, isSelected, clientId }) {
let {
@ -213,67 +213,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
<div>
<BlockControls>
{ !( termId == undefined && listType == 'term' ) && !( collectionId == undefined && listType == 'collection' ) ?
tainacan_blocks.wp_version < '5.4' ?
<Dropdown
contentClassName="wp-block-tainacan__dropdown"
renderToggle={ ( { isOpen, onToggle } ) =>
<Button
style={{ whiteSpace: 'nowrap', backgroundColor: '#fff', alignItems: 'center', borderTop: '1px solid #b5bcc2', borderBottom: '1px solid #b5bcc2', height: '100%' }}
onClick={ onToggle }
aria-expanded={ isOpen }>
{ __('Items list source', 'tainacan') }
<span class="components-dropdown-menu__indicator"></span>
</Button>
}
renderContent={ ( { onToggle } ) => (
<MenuGroup>
<MenuItemsChoice
choices={ listTypeChoices }
value={ listType }
onSelect={ (value) => {
onUpdateListType(value);
onToggle();
}}>
</MenuItemsChoice>
</MenuGroup>
) }
/>
:
<ToolbarGroup>
{ tainacan_blocks.wp_version < '5.6' ?
<Dropdown
contentClassName="wp-block-tainacan__dropdown"
renderToggle={ ( { isOpen, onToggle } ) => (
tainacan_blocks.wp_version < '5.5' ?
<Button
style={{ whiteSpace: 'nowrap' }}
onClick={ onToggle }
aria-expanded={ isOpen }>
{ __('Items list source', 'tainacan') }
<span class="components-dropdown-menu__indicator"></span>
</Button>
:
<ToolbarButton
onClick={ onToggle }
aria-expanded={ isOpen }>
{ __('Items list source', 'tainacan') }
<span class="components-dropdown-menu__indicator"></span>
</ToolbarButton>
) }
renderContent={ ( { onToggle } ) => (
<MenuGroup>
<MenuItemsChoice
choices={ listTypeChoices }
value={ listType }
onSelect={ (value) => {
onUpdateListType(value);
onToggle();
}}>
</MenuItemsChoice>
</MenuGroup>
) }
/>
:
<ToolbarItem>
{ () => (
<Dropdown
@ -301,7 +241,6 @@ export default function({ attributes, setAttributes, className, isSelected, clie
/>
) }
</ToolbarItem>
}
</ToolbarGroup>
:null }
</BlockControls>
@ -642,7 +581,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="backgroundColorPicker"
label={ __('Background color', 'tainacan')}
help={ __('The background color of the entire items list', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ backgroundColor }
onChange={ ( colorValue ) => {
backgroundColor = colorValue;
@ -656,7 +595,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="secondaryColorPicker"
label={ __('Link and Active Main color', 'tainacan')}
help={ __('The text color links and other action or active state elements, such as select arrows, tooltip contents, etc', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ secondaryColor }
onChange={ (colorValue ) => {
secondaryColor = colorValue;
@ -670,7 +609,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="primaryColorPicker"
label={ __('Tooltips background color', 'tainacan')}
help={ __('The tooltips background color and other elements, such as the hide filters button', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ primaryColor }
onChange={ (colorValue ) => {
primaryColor = colorValue;
@ -684,7 +623,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="inputBackgroundColorPicker"
label={ __('Input Background color', 'tainacan')}
help={ __('The background color for input fields', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ inputBackgroundColor }
onChange={ (colorValue ) => {
inputBackgroundColor = colorValue;
@ -698,7 +637,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="inputColorPicker"
label={ __('Input Text color', 'tainacan')}
help={ __('The text color for input fields, including dropdowns and buttons', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ inputColor }
onChange={ (colorValue ) => {
inputColor = colorValue;
@ -712,7 +651,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="inputBorderColorPicker"
label={ __('Input Border color', 'tainacan')}
help={ __('The border color for input fields', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ inputBorderColor }
onChange={ (colorValue ) => {
inputBorderColor = colorValue;
@ -726,7 +665,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="labelColorPicker"
label={ __('Label Text color', 'tainacan')}
help={ __('The text color for field labels', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ labelColor }
onChange={ (colorValue ) => {
labelColor = colorValue;
@ -740,7 +679,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="headingColorPicker"
label={ __('Headings Text color', 'tainacan')}
help={ __('The text color for headings such as items title and filters menu header', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ headingColor }
onChange={ (colorValue ) => {
headingColor = colorValue;
@ -754,7 +693,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="infoColorPicker"
label={ __('General Info Text color', 'tainacan')}
help={ __('The text color for other information such as item metadata, icons, number of pages, etc', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ infoColor }
onChange={ (colorValue ) => {
infoColor = colorValue;
@ -767,7 +706,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="itemBackgroundColorPicker"
label={ __('Item Background color', 'tainacan')}
help={ __('The background color for an item on the list', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ itemBackgroundColor }
onChange={ (colorValue ) => {
itemBackgroundColor = colorValue;
@ -781,7 +720,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="itemHoverBackgroundColorPicker"
label={ __('Item Hover Background color', 'tainacan')}
help={ __('The background color for an item on the list, when hovered', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ itemHoverBackgroundColor }
onChange={ (colorValue ) => {
itemHoverBackgroundColor = colorValue;
@ -799,7 +738,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id="itemHeadingHoverBackgroundColorPicker"
label={ __('Item Heading Hover Background color', 'tainacan')}
help={ __('The background color for the item heading (where the title is), when hovered', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ itemHeadingHoverBackgroundColor }
onChange={ (colorValue ) => {
itemHeadingHoverBackgroundColor = colorValue;

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/facets-list",
"title": "Tainacan Facets List",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "facets", "search", "terms" ],
"description": "List facets from a Tainacan Collection or Repository",
@ -157,5 +157,5 @@
}
},
"editorScript": "facets-list",
"editorStyle": "facets-list"
"editorStyle": ["facets-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -2,7 +2,7 @@ const { __ } = wp.i18n;
const { BaseControl, RangeControl, Spinner, SelectControl, Button, ToggleControl, Placeholder, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps, store } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps, store } = wp.blockEditor;
const { useSelect } = wp.data;
@ -50,7 +50,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
// Obtains block's client id to render it on save function
setAttributes({ blockId: clientId });

View File

@ -1,4 +1,4 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes, className }) {
const {
@ -26,7 +26,7 @@ export default function({ attributes, className }) {
} = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div
{ ...blockProps }
data-module="facets-list"

View File

@ -250,7 +250,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/geocoorinate-item-metadatum",
"title": "Tainacan Geo Coordinate Item Metadatum",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "item", "location", "geographic", "coordinates", "metadatum", "field", "value" ],
"description": "A single item geocoordinate metadatum, containing location information.",
@ -51,5 +51,5 @@
"anchor": true
},
"editorScript": "geocoordinate-item-metadatum",
"editorStyle": "geocoordinate-item-metadatum"
"editorStyle": ["geocoordinate-item-metadatum", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -2,7 +2,7 @@ const { __ } = wp.i18n;
const { Button, Placeholder, ToolbarDropdownMenu, SVG, Path } = wp.components;
const ServerSideRender = wp.serverSideRender;
const { useBlockProps, BlockControls, AlignmentControl } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, BlockControls, AlignmentControl } = wp.blockEditor;
import SingleItemMetadatumModal from '../../js/selection/single-item-metadatum-modal.js';
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
@ -22,7 +22,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps( {
const blockProps = useBlockProps( {
className: {
[ `has-text-align-${ textAlign }` ]: textAlign,
}
@ -154,7 +154,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
<ServerSideRender
block="tainacan/item-metadatum"
attributes={ attributes }
httpMethod={ currentWPVersion >= '5.5' ? 'POST' : 'GET' }
httpMethod={ 'POST' }
/>
</div>
) : null

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/item-gallery",
"title": "Tainacan Item Media Gallery",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "item", "document", "carousel", "attachments", "zoom" ],
"description": "The media gallery of the item, displaying document, attachments and more.",
@ -139,5 +139,5 @@
}
},
"editorScript": "item-gallery",
"editorStyle": "item-gallery"
"editorStyle": ["item-gallery", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -3,7 +3,7 @@ const { __ } = wp.i18n;
const { Button, ButtonGroup, BaseControl, Placeholder, RangeControl, ToggleControl, PanelBody } = wp.components;
const ServerSideRender = wp.serverSideRender;
const { InspectorControls, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, useBlockProps } = wp.blockEditor;
import SingleItemModal from '../../js/selection/single-item-modal.js';
import getCollectionIdFromPossibleTemplateEdition from '../../js/template/tainacan-blocks-single-item-template-mode.js';
@ -38,7 +38,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
const currentWPVersion = (typeof tainacan_blocks != 'undefined') ? tainacan_blocks.wp_version : tainacan_plugin.wp_version;
// Obtains block's client id to render it on save function
@ -395,7 +395,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
<ServerSideRender
block="tainacan/item-gallery"
attributes={ attributes }
httpMethod={ currentWPVersion >= '5.5' ? 'POST' : 'GET' }
httpMethod={ 'POST' }
/>
</div>
) : null

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/item-metadata-section",
"title": "Tainacan Item Metadata Section",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "item", "metadata", "section", "regions", "fields" ],
"description": "A single metadata section, including its label and metadata whitin it.",
@ -97,5 +97,5 @@
}
},
"editorScript": "item-metadata-section",
"editorStyle": "item-metadata-section"
"editorStyle": ["item-metadata-section", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -3,7 +3,7 @@ const { __ } = wp.i18n;
const { Button, Spinner, Placeholder, ToggleControl, PanelBody } = wp.components;
const ServerSideRender = wp.serverSideRender;
const { useBlockProps, InnerBlocks, BlockControls, AlignmentControl, InspectorControls } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, InnerBlocks, BlockControls, AlignmentControl, InspectorControls } = wp.blockEditor;
import SingleItemMetadataSectionModal from '../../js/selection/single-item-metadata-section-modal.js';
import getCollectionIdFromPossibleTemplateEdition from '../../js/template/tainacan-blocks-single-item-template-mode.js';
@ -31,7 +31,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps( {
const blockProps = useBlockProps( {
className: {
[ `has-text-align-${ textAlign }` ]: textAlign,
}
@ -280,7 +280,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
<ServerSideRender
block="tainacan/item-metadata-section"
attributes={ attributes }
httpMethod={ currentWPVersion >= '5.5' ? 'POST' : 'GET' }
httpMethod={ 'POST' }
/>
:
<InnerBlocks

View File

@ -1,10 +1,10 @@
const { useBlockProps, InnerBlocks } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, InnerBlocks } = wp.blockEditor;
export default function({ attributes }) {
const { textAlign, isDynamic } = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: `has-text-align-${ textAlign }` } : useBlockProps.save( {
const blockProps = useBlockProps.save( {
className: `has-text-align-${ textAlign }`
} );
return isDynamic ? null : <div { ...blockProps }><InnerBlocks.Content /></div>

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/item-metadata-sections",
"title": "Tainacan Item Metadata Sections",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "item", "metadata", "sections", "regions", "fields" ],
"description": "The metadata sections, including their labels and metadata whitin it.",
@ -78,5 +78,5 @@
}
},
"editorScript": "item-metadata-sections",
"editorStyle": "item-metadata-sections"
"editorStyle": ["item-metadata-sections", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -3,7 +3,7 @@ const { __ } = wp.i18n;
const { Button, Spinner, Placeholder, ToggleControl, PanelBody } = wp.components;
const ServerSideRender = wp.serverSideRender;
const { useBlockProps, InnerBlocks, BlockControls, AlignmentControl, InspectorControls } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, InnerBlocks, BlockControls, AlignmentControl, InspectorControls } = wp.blockEditor;
import SingleItemModal from '../../js/selection/single-item-modal.js';
import getCollectionIdFromPossibleTemplateEdition from '../../js/template/tainacan-blocks-single-item-template-mode.js';
@ -27,7 +27,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps( {
const blockProps = useBlockProps( {
className: {
[ `has-text-align-${ textAlign }` ]: textAlign,
}
@ -229,7 +229,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
<ServerSideRender
block="tainacan/item-metadata-sections"
attributes={ attributes }
httpMethod={ currentWPVersion >= '5.5' ? 'POST' : 'GET' }
httpMethod={ 'POST' }
/>
:
<InnerBlocks

View File

@ -1,10 +1,10 @@
const { useBlockProps, InnerBlocks } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, InnerBlocks } = wp.blockEditor;
export default function({ attributes }) {
const { textAlign, isDynamic } = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: `has-text-align-${ textAlign }` } : useBlockProps.save( {
const blockProps = useBlockProps.save( {
className: `has-text-align-${ textAlign }`
} );
return isDynamic ? null : <div { ...blockProps }><InnerBlocks.Content /></div>

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/item-metadata",
"title": "Tainacan Item Metadata",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "item", "metadata", "fields", "values" ],
"description": "The item metadata, including their labels and values.",
@ -93,5 +93,5 @@
}
},
"editorScript": "item-metadata",
"editorStyle": "item-metadata"
"editorStyle": ["item-metadata", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -3,7 +3,7 @@ const { __ } = wp.i18n;
const { Button, Spinner, ToggleControl, Placeholder, PanelBody } = wp.components;
const ServerSideRender = wp.serverSideRender;
const { useBlockProps, InnerBlocks, BlockControls, AlignmentControl, InspectorControls } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, InnerBlocks, BlockControls, AlignmentControl, InspectorControls } = wp.blockEditor;
import SingleItemModal from '../../js/selection/single-item-modal.js';
import getCollectionIdFromPossibleTemplateEdition from '../../js/template/tainacan-blocks-single-item-template-mode.js';
@ -30,7 +30,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps( {
const blockProps = useBlockProps( {
className: {
[ `has-text-align-${ textAlign }` ]: textAlign,
}
@ -310,7 +310,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
<ServerSideRender
block="tainacan/item-metadata"
attributes={ attributes }
httpMethod={ currentWPVersion >= '5.5' ? 'POST' : 'GET' }
httpMethod={ 'POST' }
/>
:
<InnerBlocks

View File

@ -1,10 +1,10 @@
const { useBlockProps, InnerBlocks } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, InnerBlocks } = wp.blockEditor;
export default function({ attributes }) {
const { textAlign, isDynamic } = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: `has-text-align-${ textAlign }` } : useBlockProps.save( {
const blockProps = useBlockProps.save( {
className: `has-text-align-${ textAlign }`
} );
return isDynamic ? null : <div { ...blockProps }><InnerBlocks.Content /></div>

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/item-metadatum",
"title": "Tainacan Item Metadatum",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "item", "metadatum", "field", "value" ],
"description": "A single item metadatum, including a label and its value.",
@ -75,5 +75,5 @@
}
},
"editorScript": "item-metadatum",
"editorStyle": "item-metadatum"
"editorStyle": ["item-metadatum", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -2,7 +2,7 @@ const { __ } = wp.i18n;
const { Button, Placeholder, ToolbarDropdownMenu, SVG, Path } = wp.components;
const ServerSideRender = wp.serverSideRender;
const { useBlockProps, BlockControls, AlignmentControl } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, BlockControls, AlignmentControl } = wp.blockEditor;
import SingleItemMetadatumModal from '../../js/selection/single-item-metadatum-modal.js';
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
@ -33,7 +33,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps( {
const blockProps = useBlockProps( {
className: {
[ `has-text-align-${ textAlign }` ]: textAlign,
}
@ -218,7 +218,7 @@ export default function ({ attributes, setAttributes, className, isSelected }) {
<ServerSideRender
block="tainacan/item-metadatum"
attributes={ attributes }
httpMethod={ currentWPVersion >= '5.5' ? 'POST' : 'GET' }
httpMethod={ 'POST' }
/>
</div>
) : null

View File

@ -159,5 +159,5 @@
"multiple": false
},
"editorScript": "item-submission-form",
"editorStyle": "item-submission-form"
"editorStyle": ["item-submission-form", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -7,6 +7,7 @@ const {
BaseControl,
CheckboxControl,
FontSizePicker,
ColorPalette,
HorizontalRule,
Spinner,
ToggleControl,
@ -14,12 +15,11 @@ const {
PanelBody
} = wp.components;
const { InspectorControls, BlockControls, RichText, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, RichText, useBlockProps } = wp.blockEditor;
import tainacan from '../../js/axios.js';
import CollectionModal from '../faceted-search/collection-modal.js';
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
import TainacanBlocksCompatColorPicker from '../../js/compatibility/tainacan-blocks-compat-colorpicker.js';
export default function ({ attributes, setAttributes, className }) {
let {
@ -436,7 +436,7 @@ export default function ({ attributes, setAttributes, className }) {
id="backgroundColorPicker"
label={ __('Background color', 'tainacan')}
help={ __('The background color of the entire items list', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ backgroundColor }
onChange={ (colorValue ) => {
backgroundColor = colorValue;
@ -450,7 +450,7 @@ export default function ({ attributes, setAttributes, className }) {
id="secondaryColorPicker"
label={ __('Link and Active Main color', 'tainacan')}
help={ __('The text color links and other action or active state elements, such as select arrows, tooltip contents, etc', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ secondaryColor }
onChange={ (colorValue ) => {
secondaryColor = colorValue;
@ -464,7 +464,7 @@ export default function ({ attributes, setAttributes, className }) {
id="primaryColorPicker"
label={ __('Tooltips background color', 'tainacan')}
help={ __('The tooltips background color and other elements, such as the hide filters button', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ primaryColor }
onChange={ (colorValue ) => {
primaryColor = colorValue;
@ -478,7 +478,7 @@ export default function ({ attributes, setAttributes, className }) {
id="inputBackgroundColorPicker"
label={ __('Input Background color', 'tainacan')}
help={ __('The background color for input fields', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ inputBackgroundColor }
onChange={ (colorValue ) => {
inputBackgroundColor = colorValue;
@ -492,7 +492,7 @@ export default function ({ attributes, setAttributes, className }) {
id="inputColorPicker"
label={ __('Input Text color', 'tainacan')}
help={ __('The text color for input fields, including dropdowns and buttons', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ inputColor }
onChange={ (colorValue ) => {
inputColor = colorValue;
@ -506,7 +506,7 @@ export default function ({ attributes, setAttributes, className }) {
id="inputBorderColorPicker"
label={ __('Input Border color', 'tainacan')}
help={ __('The border color for input fields', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ inputBorderColor }
onChange={ (colorValue ) => {
inputBorderColor = colorValue;
@ -520,7 +520,7 @@ export default function ({ attributes, setAttributes, className }) {
id="labelColorPicker"
label={ __('Label Text color', 'tainacan')}
help={ __('The text color for field labels', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ labelColor }
onChange={ (colorValue ) => {
labelColor = colorValue;
@ -533,7 +533,7 @@ export default function ({ attributes, setAttributes, className }) {
id="infoColorPicker"
label={ __('General Info Text color', 'tainacan')}
help={ __('The text color for other information such as item metadata, icons, number of pages, etc', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ infoColor }
onChange={ (colorValue ) => {
infoColor = colorValue;

View File

@ -1,4 +1,4 @@
const { RichText, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { RichText, useBlockProps } = wp.blockEditor;
export default function({ attributes, className }) {
const {

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/items-list",
"title": "Tainacan Items List",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "items", "collection" ],
"description": "Expose items from your Tainacan collections",
@ -102,5 +102,5 @@
"inserter": false
},
"editorScript": "items-list",
"editorStyle": "items-list"
"editorStyle": ["items-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,8 +1,8 @@
const { __ } = wp.i18n;
const { RangeControl, IconButton, Button, ToggleControl, Placeholder, PanelBody } = wp.components;
const { RangeControl, Button, ToggleControl, Placeholder, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps } = wp.blockEditor;
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
import ItemsModal from './items-modal.js';
@ -21,7 +21,7 @@ export default function({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
function prepareItem(item) {
return (
@ -29,18 +29,13 @@ export default function({ attributes, setAttributes, className, isSelected }) {
key={ item.id }
className="item-list-item"
style={{ marginBottom: layout == 'grid' ? (showName ? gridMargin + 12 : gridMargin) + 'px' : ''}}>
{ tainacan_blocks.wp_version < '5.4' ?
<IconButton
onClick={ () => removeItemOfId(item.id) }
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<Button
onClick={ () => removeItemOfId(item.id) }
icon="no-alt"
icon={ () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"></path></svg>
) }
showTooltip={false}
label={__('Remove', 'tainacan')}/>
}
<a
id={ isNaN(item.id) ? item.id : 'item-id-' + item.id }
href={ item.url }

View File

@ -1,9 +1,9 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes, className }) {
const { content } = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div { ...blockProps } data-module="items-list">{ content }</div>
};

View File

@ -115,7 +115,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/metadata-section-description",
"title": "Tainacan Metadata Section Description",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": ["metadata", "description", "field", "section"],
"description": "A metadata section description, used to complement information about a metadata section.",
@ -57,5 +57,5 @@
}
},
"editorScript": "metadata-section-description",
"editorStyle": "metadata-section-description"
"editorStyle": ["metadata-section-description", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,6 +1,6 @@
const { __ } = wp.i18n;
const { useBlockProps, BlockControls, AlignmentControl } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, BlockControls, AlignmentControl } = wp.blockEditor;
export default function ({ attributes, setAttributes, className, context }) {
@ -12,7 +12,7 @@ export default function ({ attributes, setAttributes, className, context }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps( {
const blockProps = useBlockProps( {
className: {
[ `has-text-align-${ textAlign }` ]: textAlign,
}

View File

@ -1,10 +1,10 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes }) {
const { textAlign, sectionId, sectionDescription } = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: `has-text-align-${ textAlign }` } : useBlockProps.save( {
const blockProps = useBlockProps.save( {
className: `has-text-align-${ textAlign }`
} );
return (

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/metadata-section-name",
"title": "Tainacan Metadata Section Name",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": ["metadata", "name", "field", "section"],
"description": "A metadata section label, used to identify different metadata sections.",
@ -61,5 +61,5 @@
}
},
"editorScript": "metadata-section-name",
"editorStyle": "metadata-section-name"
"editorStyle": ["metadata-section-name", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,7 +1,7 @@
const { __ } = wp.i18n;
const { ToolbarDropdownMenu, SVG, Path, __experimentalHeading: Heading } = wp.components;
const { useBlockProps, BlockControls, AlignmentControl } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps, BlockControls, AlignmentControl } = wp.blockEditor;
const levelToPath = {
1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
@ -23,7 +23,7 @@ export default function ({ attributes, setAttributes, className, context }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps( {
const blockProps = useBlockProps( {
className: {
[ `has-text-align-${ textAlign }` ]: textAlign,
}

View File

@ -1,13 +1,12 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes }) {
const { textAlign, sectionId, sectionName, labelLevel } = attributes;
const TagName = 'h' + labelLevel;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: `has-text-align-${ textAlign }` } : useBlockProps.save( {
const blockProps = useBlockProps.save( {
className: `has-text-align-${ textAlign }`
} );
return (
<TagName { ...blockProps } id={ 'tainacan-metadata-section-name-block-id--' + sectionId }>

View File

@ -53,5 +53,5 @@
"multiple": true
},
"editorScript": "related-items-list",
"editorStyle": "related-items-list"
"editorStyle": ["related-items-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -2,7 +2,7 @@ const { __ } = wp.i18n;
const { Spinner, Button, Placeholder } = wp.components;
const { InnerBlocks } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InnerBlocks } = wp.blockEditor;
import SingleItemModal from '../../js/selection/single-item-modal.js';
import tainacan from '../../js/axios.js';

View File

@ -1,4 +1,4 @@
const { InnerBlocks} = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InnerBlocks} = wp.blockEditor;
export default function({ className }) {
return <div data-module="related-items-list" className={ className }><InnerBlocks.Content /></div>

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/search-bar",
"title": "Tainacan Search Bar",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "items", "search", "bar" ],
"description": "Set up a custom search bar to redirect to an item's list",
@ -104,5 +104,5 @@
}
],
"editorScript": "search-bar",
"editorStyle": "search-bar"
"editorStyle": ["search-bar", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -2,10 +2,9 @@ const { __ } = wp.i18n;
const { RangeControl, TextControl, SelectControl, Button, ToggleControl, Placeholder, ColorPalette, BaseControl, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps } = wp.blockEditor;
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
import TainacanBlocksCompatColorPicker from '../../js/compatibility/tainacan-blocks-compat-colorpicker.js';
import SearchBarModal from './search-bar-modal.js';
export default function({ attributes, setAttributes, className, isSelected }) {
@ -29,7 +28,7 @@ export default function({ attributes, setAttributes, className, isSelected }) {
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
function setContent(){
@ -311,7 +310,7 @@ export default function({ attributes, setAttributes, className, isSelected }) {
<BaseControl
id="backgroundcolorpicker"
label={ __('Background color', 'tainacan') }>
<TainacanBlocksCompatColorPicker
<ColorPalette
value={ collectionBackgroundColor }
onChange={ ( color ) => {
collectionBackgroundColor = color;

View File

@ -1,9 +1,9 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes, className }) {
const { content } = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div { ...blockProps } data-module="search-bar">{ content }</div>
}

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tainacan/terms-list",
"title": "Tainacan Terms List",
"apiVersion": 2,
"apiVersion": 3,
"category": "tainacan-blocks",
"keywords": [ "terms", "taxonomy" ],
"description": "Expose terms from your Tainacan taxonomies",
@ -97,5 +97,5 @@
}
},
"editorScript": "terms-list",
"editorStyle": "terms-list"
"editorStyle": ["terms-list", "tainacan-blocks-common-editor-styles" ]
}

View File

@ -1,8 +1,8 @@
const { __ } = wp.i18n;
const { IconButton, Button, ToggleControl, Placeholder, PanelBody } = wp.components;
const { Button, ToggleControl, Placeholder, PanelBody } = wp.components;
const { InspectorControls, BlockControls, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { InspectorControls, BlockControls, useBlockProps } = wp.blockEditor;
import TainacanBlocksCompatToolbar from '../../js/compatibility/tainacan-blocks-compat-toolbar.js';
import TermsModal from './terms-modal.js';
@ -20,19 +20,13 @@ export default function({ attributes, setAttributes, className, isSelected }){
} = attributes;
// Gets blocks props from hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
const blockProps = useBlockProps();
function prepareTerm(term) {
return (
<li
key={ term.id }
className="term-list-item">
{ tainacan_blocks.wp_version < '5.4' ?
<IconButton
onClick={ () => removeTermOfId(term.id) }
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<button
onClick={ () => removeTermOfId(term.id) }
type="button"
@ -40,7 +34,6 @@ export default function({ attributes, setAttributes, className, isSelected }){
aria-label={__('Remove', 'tainacan')}>
<span class="dashicon dashicons dashicons-no-alt" />
</button>
}
<a
id={ isNaN(term.id) ? term.id : 'term-id-' + term.id }
href={ term.url }

View File

@ -1,9 +1,9 @@
const { useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor );
const { useBlockProps } = wp.blockEditor;
export default function({ attributes, className }){
const { content } = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
const blockProps = useBlockProps.save();
return <div { ...blockProps } data-module="terms-list">{ content }</div>
};

View File

@ -91,7 +91,7 @@
right: -8px;
top: -8px;
border: 1px solid var(--tainacan-block-gray3, $gray3);
border-radius: 12px;
border-radius: 100em;
transition: opacity linear 0.15s, right linear 0.15s;
}
&:hover button:hover {

View File

@ -1,7 +1,5 @@
<?php
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
// Slugs and options for the Tainacan Blocks.
const TAINACAN_BLOCKS = [
'items-list' => [],
@ -33,9 +31,6 @@ tainacan_blocks_initialize();
* Initialize the Gutenberg Blocks logic, only if possible
*/
function tainacan_blocks_initialize() {
global $wp_version;
if (is_plugin_active('gutenberg/gutenberg.php') || $wp_version >= '5') {
// Via Gutenberg filters, we create the Tainacan category
if ( class_exists('WP_Block_Editor_Context') ) { // Introduced WP 5.8
@ -55,7 +50,6 @@ function tainacan_blocks_initialize() {
// The reason why we don't use admin_init here is because server side blocks
// need to be registered whithin the init
add_action('init', 'tainacan_blocks_register_and_enqueue_all_blocks');
}
}
/**
@ -105,7 +99,6 @@ function tainacan_blocks_register_and_enqueue_all_blocks() {
function tainacan_blocks_register_block($block_slug, $options = []) {
global $TAINACAN_BASE_URL;
global $TAINACAN_VERSION;
global $wp_version;
// Creates Register params based on registered scripts and styles
$register_params = [];
@ -125,9 +118,6 @@ function tainacan_blocks_register_block($block_slug, $options = []) {
// Defines dependencies for editor script
$editor_script_deps = array('wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-server-side-render', 'wp-data');
if ( version_compare( $wp_version, '5.2', '<') )
$editor_script_deps[] = 'wp-editor';
else
$editor_script_deps[] = 'wp-block-editor';
if ( isset($options['extra_editor_script_deps']) )
@ -171,12 +161,9 @@ function tainacan_blocks_register_block($block_slug, $options = []) {
}
// Registers the new block
if (function_exists('register_block_type')) {
if ( version_compare( $wp_version, '5.8-RC', '>=') )
if (function_exists('register_block_type'))
register_block_type( __DIR__ . '/blocks/' . $block_slug, $register_params );
else
register_block_type( 'tainacan/' . $block_slug, $register_params );
}
}
/**

View File

@ -1,21 +0,0 @@
const { ColorPicker, ColorPalette } = wp.components;
export default function TainacanBlocksCompatColorPicker({ value, onChange, enableAlpha, disableAlpha }) {
const currentWPVersion = (typeof tainacan_blocks != 'undefined') ? tainacan_blocks.wp_version : tainacan_plugin.wp_version;
return currentWPVersion < '5.9' ?
<ColorPicker
color={ value }
onChangeComplete={ (value) => onChange(value.hex) }
enableAlpha={ enableAlpha }
disableAlpha={ disableAlpha }
/>
:
<ColorPalette
value={ value }
onChange={ onChange }
enableAlpha={ enableAlpha }
disableAlpha={ disableAlpha }
/>
}

View File

@ -1,29 +1,8 @@
const { registerBlockType } = wp.blocks;
const { __ } = wp.i18n;
// Converts non-localized block metadata info to localized ones, for WP versions older than 5.8
function tainacanBlocksLocalizeMetadata(metadata) {
for (let metadatumKey in metadata) {
if (metadatumKey == 'title' || metadatumKey == 'description') {
metadata[metadatumKey] = __(metadata[metadatumKey], 'tainacan');
} else if (metadatumKey == 'keywords') {
metadata[metadatumKey].forEach(keyword => {
keyword = __(keyword, 'tainacan');
});
} else if (metadatumKey == 'styles') {
metadata[metadatumKey].forEach(style => {
style.label = __(style.label, 'tainacan');
});
}
}
return metadata;
}
// Register the block type according to WP version
export default function({ metadata, icon, edit, save, deprecated, transforms }) {
const currentWPVersion = (typeof tainacan_blocks != 'undefined') ? tainacan_blocks.wp_version : tainacan_plugin.wp_version;
let attributes = {
icon: {
src: icon,
@ -36,17 +15,6 @@ export default function({ metadata, icon, edit, save, deprecated, transforms })
if (save)
attributes['save'] = save;
if (currentWPVersion >= '5.8-RC') {
// Registers block type using new strategy from WP 5.8
registerBlockType( metadata, attributes);
} else {
// Converts this array to a valid array previous to WP 5.8
registerBlockType( metadata.name, {
...tainacanBlocksLocalizeMetadata(metadata),
...attributes
});
}
};

View File

@ -1,35 +1,16 @@
const { Button, Toolbar, ToolbarGroup, ToolbarButton } = wp.components;
const { ToolbarGroup, ToolbarButton } = wp.components;
export default function TainacanBlocksCompatToolbar({ label, icon, onClick, onClickParams, controls }) {
const currentWPVersion = (typeof tainacan_blocks != 'undefined') ? tainacan_blocks.wp_version : tainacan_plugin.wp_version;
if (controls !== undefined)
return currentWPVersion < '5.4' ? <Toolbar controls={ controls } /> : <ToolbarGroup controls={ controls } />
return <ToolbarGroup controls={ controls } />
else
return currentWPVersion < '5.4' ?
<Button style={{ whiteSpace: 'nowrap', backgroundColor: '#fff', alignItems: 'center', borderTop: '1px solid #b5bcc2', borderBottom: '1px solid #b5bcc2' }} onClick={ () => onClick(onClickParams) }>
<p style={{ margin: 0 }}>
{ icon }
</p>&nbsp;
{ label }
</Button>
:
<ToolbarGroup>
{ currentWPVersion < '5.5' ?
<Button style={{ whiteSpace: 'nowrap' }} onClick={ () => onClick(onClickParams) }>
<p>
{ icon }
</p>&nbsp;
{ label }
</Button>
:
return <ToolbarGroup>
<ToolbarButton onClick={ () => onClick(onClickParams) }>
<p>
{ icon }
</p>&nbsp;
{ label }
</ToolbarButton>
}
</ToolbarGroup>
}