diff --git a/src/views/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-deprecated.js b/src/views/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-deprecated.js new file mode 100644 index 000000000..4eb95aab7 --- /dev/null +++ b/src/views/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-deprecated.js @@ -0,0 +1,295 @@ +export default [ + /* Deprecated on Tainacan 0.17.2, due to the introduction of support: fontSize */ + { + attributes: { + content: { + type: 'array', + source: 'children', + selector: 'div' + }, + collectionId: { + type: String, + default: undefined + }, + items: { + type: Array, + default: [] + }, + isModalOpen: { + type: Boolean, + default: false + }, + searchURL: { + type: String, + default: undefined + }, + selectedItems: { + type: Array, + default: [] + }, + itemsRequestSource: { + type: String, + default: undefined + }, + maxItemsNumber: { + type: Number, + value: undefined + }, + maxItemsPerScreen: { + type: Number, + value: 7 + }, + isLoading: { + type: Boolean, + value: false + }, + isLoadingCollection: { + type: Boolean, + value: false + }, + loadStrategy: { + type: String, + value: 'search' + }, + arrowsPosition: { + type: String, + value: 'search' + }, + largeArrows: { + type: Boolean, + value: false + }, + autoPlay: { + type: Boolean, + value: false + }, + autoPlaySpeed: { + type: Number, + value: 3 + }, + loopSlides: { + type: Boolean, + value: false + }, + hideTitle: { + type: Boolean, + value: true + }, + showCollectionHeader: { + type: Boolean, + value: false + }, + showCollectionLabel: { + type: Boolean, + value: false + }, + cropImagesToSquare: { + type: Boolean, + value: true + }, + collection: { + type: Object, + value: undefined + }, + blockId: { + type: String, + default: undefined + }, + collectionBackgroundColor: { + type: String, + default: "#454647" + }, + collectionTextColor: { + type: String, + default: "#ffffff" + } + }, + supports: { + align: ['full', 'wide'], + html: false, + multiple: true + }, + save({ attributes, className }) { + const { + content, + blockId, + collectionId, + searchURL, + selectedItems, + arrowsPosition, + largeArrows, + loadStrategy, + maxItemsNumber, + maxItemsPerScreen, + autoPlay, + autoPlaySpeed, + loopSlides, + hideTitle, + cropImagesToSquare, + showCollectionHeader, + showCollectionLabel, + collectionBackgroundColor, + collectionTextColor + } = attributes; + + return
+ { content } +
+ } + }, + { + attributes: { + content: { + type: 'array', + source: 'children', + selector: 'div' + }, + collectionId: { + type: String, + default: undefined + }, + items: { + type: Array, + default: [] + }, + isModalOpen: { + type: Boolean, + default: false + }, + searchURL: { + type: String, + default: undefined + }, + selectedItems: { + type: Array, + default: [] + }, + itemsRequestSource: { + type: String, + default: undefined + }, + maxItemsNumber: { + type: Number, + value: undefined + }, + isLoading: { + type: Boolean, + value: false + }, + isLoadingCollection: { + type: Boolean, + value: false + }, + loadStrategy: { + type: String, + value: 'search' + }, + arrowsPosition: { + type: String, + value: 'search' + }, + autoPlay: { + type: Boolean, + value: false + }, + autoPlaySpeed: { + type: Number, + value: 3 + }, + loopSlides: { + type: Boolean, + value: false + }, + hideTitle: { + type: Boolean, + value: true + }, + showCollectionHeader: { + type: Boolean, + value: false + }, + showCollectionLabel: { + type: Boolean, + value: false + }, + collection: { + type: Object, + value: undefined + }, + blockId: { + type: String, + default: undefined + }, + collectionBackgroundColor: { + type: String, + default: "#454647" + }, + collectionTextColor: { + type: String, + default: "#ffffff" + } + }, + save({ attributes, className }){ + const { + content, + blockId, + collectionId, + searchURL, + selectedItems, + arrowsPosition, + loadStrategy, + maxItemsNumber, + autoPlay, + autoPlaySpeed, + loopSlides, + hideTitle, + showCollectionHeader, + showCollectionLabel, + collectionBackgroundColor, + collectionTextColor + } = attributes; + return
+ { content } +
+ } + } +]; \ No newline at end of file diff --git a/src/views/gutenberg-blocks/tainacan-items/carousel-items-list/index.js b/src/views/gutenberg-blocks/tainacan-items/carousel-items-list/index.js index b8edae02b..0af3fcf60 100644 --- a/src/views/gutenberg-blocks/tainacan-items/carousel-items-list/index.js +++ b/src/views/gutenberg-blocks/tainacan-items/carousel-items-list/index.js @@ -11,6 +11,7 @@ import tainacan from '../../js/axios.js'; import axios from 'axios'; import qs from 'qs'; import TainacanBlocksCompatToolbar from '../../js/tainacan-blocks-compat-toolbar.js'; +import DeprecatedBlocks from './carousel-items-deprecated.js'; registerBlockType('tainacan/carousel-items-list', { title: __('Tainacan Collection\'s Items Carousel', 'tainacan'), @@ -138,7 +139,8 @@ registerBlockType('tainacan/carousel-items-list', { supports: { align: ['full', 'wide'], html: false, - multiple: true + multiple: true, + fontSize: true }, edit({ attributes, setAttributes, className, isSelected, clientId }){ let { @@ -823,140 +825,5 @@ registerBlockType('tainacan/carousel-items-list', { { content } }, - deprecated: [ - { - attributes: { - content: { - type: 'array', - source: 'children', - selector: 'div' - }, - collectionId: { - type: String, - default: undefined - }, - items: { - type: Array, - default: [] - }, - isModalOpen: { - type: Boolean, - default: false - }, - searchURL: { - type: String, - default: undefined - }, - selectedItems: { - type: Array, - default: [] - }, - itemsRequestSource: { - type: String, - default: undefined - }, - maxItemsNumber: { - type: Number, - value: undefined - }, - isLoading: { - type: Boolean, - value: false - }, - isLoadingCollection: { - type: Boolean, - value: false - }, - loadStrategy: { - type: String, - value: 'search' - }, - arrowsPosition: { - type: String, - value: 'search' - }, - autoPlay: { - type: Boolean, - value: false - }, - autoPlaySpeed: { - type: Number, - value: 3 - }, - loopSlides: { - type: Boolean, - value: false - }, - hideTitle: { - type: Boolean, - value: true - }, - showCollectionHeader: { - type: Boolean, - value: false - }, - showCollectionLabel: { - type: Boolean, - value: false - }, - collection: { - type: Object, - value: undefined - }, - blockId: { - type: String, - default: undefined - }, - collectionBackgroundColor: { - type: String, - default: "#454647" - }, - collectionTextColor: { - type: String, - default: "#ffffff" - } - }, - save({ attributes, className }){ - const { - content, - blockId, - collectionId, - searchURL, - selectedItems, - arrowsPosition, - loadStrategy, - maxItemsNumber, - autoPlay, - autoPlaySpeed, - loopSlides, - hideTitle, - showCollectionHeader, - showCollectionLabel, - collectionBackgroundColor, - collectionTextColor - } = attributes; - return
- { content } -
- } - } - ] + deprecated: DeprecatedBlocks }); \ No newline at end of file