From a6b1904d020a0ce8d50b1c8a522ec575f4ae97e2 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Tue, 22 Feb 2022 09:14:06 -0300 Subject: [PATCH 01/13] Begins implementation of item gallery block. #674. --- .../blocks/item-gallery/block.json | 39 ++ .../blocks/item-gallery/deprecated.js | 1 + .../blocks/item-gallery/edit.js | 130 +++++++ .../blocks/item-gallery/icon.js | 13 + .../blocks/item-gallery/index.js | 15 + .../item-gallery/related-items-modal.js | 349 ++++++++++++++++++ .../blocks/item-gallery/save.js | 3 + .../class-tainacan-gutenberg-block.php | 22 +- .../js/tainacan-blocks-compat-register.js | 34 +- .../tainacan-blocks-common-scripts.js | 3 +- webpack.common.js | 3 +- 11 files changed, 589 insertions(+), 23 deletions(-) create mode 100644 src/views/gutenberg-blocks/blocks/item-gallery/block.json create mode 100644 src/views/gutenberg-blocks/blocks/item-gallery/deprecated.js create mode 100644 src/views/gutenberg-blocks/blocks/item-gallery/edit.js create mode 100644 src/views/gutenberg-blocks/blocks/item-gallery/icon.js create mode 100644 src/views/gutenberg-blocks/blocks/item-gallery/index.js create mode 100644 src/views/gutenberg-blocks/blocks/item-gallery/related-items-modal.js create mode 100644 src/views/gutenberg-blocks/blocks/item-gallery/save.js diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/block.json b/src/views/gutenberg-blocks/blocks/item-gallery/block.json new file mode 100644 index 000000000..c737545d8 --- /dev/null +++ b/src/views/gutenberg-blocks/blocks/item-gallery/block.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "name": "tainacan/item-gallery", + "title": "Tainacan Item Gallery", + "category": "tainacan-blocks", + "keywords": [ "item", "document", "carousel", "attachments", "zoom" ], + "description": "The media gallery of the item, displaying document and attachments.", + "textdomain": "tainacan", + "example": { + "attributes": { + "content": "preview" + } + }, + "attributes": { + "content": { + "type": "array", + "source": "query", + "selector": "div" + }, + "collectionId": { + "type": "string", + "default": "" + }, + "itemId": { + "type": "string", + "default": "" + }, + "isModalOpen": { + "type": "boolean", + "default": false + } + }, + "supports": { + "align": ["full", "wide"], + "multiple": true + }, + "editorScript": "item-gallery", + "editorStyle": "item-gallery" +} \ No newline at end of file diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/deprecated.js b/src/views/gutenberg-blocks/blocks/item-gallery/deprecated.js new file mode 100644 index 000000000..109fa8b38 --- /dev/null +++ b/src/views/gutenberg-blocks/blocks/item-gallery/deprecated.js @@ -0,0 +1 @@ +export default []; \ No newline at end of file diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js new file mode 100644 index 000000000..56c36381a --- /dev/null +++ b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js @@ -0,0 +1,130 @@ +const { __ } = wp.i18n; + +const { Spinner, Button, Placeholder } = wp.components; + +const { InnerBlocks } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor ); + +import RelatedItemsModal from './related-items-modal.js'; +import tainacan from '../../js/axios.js'; +import axios from 'axios'; + +export default function ({ attributes, setAttributes, className, isSelected }) { + + let { + content, + collectionId, + itemId, + isModalOpen, + isLoading, + } = attributes; + + function setContent(){ + } + + function openRelatedItemsModal() { + isModalOpen = true; + setAttributes( { + isModalOpen: isModalOpen + } ); + } + + // Executed only on the first load of page + if(content && content.length && content[0].type) + setContent(); + + return content == 'preview' ? +
+ +
+ : ( +
+ + { isSelected ? + ( +
+ { isModalOpen ? + { + // if (collectionId != selectedCollectionId) + // relatedItems = []; + + collectionId = selectedCollectionId; + setAttributes({ + collectionId: collectionId, + // relatedItems: relatedItems + }); + }} + onApplyRelatedItem={ (selectedItemId) => { + // if (itemId != selectedItemId) { + // relatedItems = []; + // relatedItemsTemplate = []; + // } + + itemId = selectedItemId; + setAttributes({ + itemId: itemId, + // relatedItems: relatedItems, + // relatedItemsTemplate: relatedItemsTemplate, + isModalOpen: false + }); + setContent(); + }} + onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> + : null + } + +
+ ) : null + } + + { !itemId && !isLoading ? ( + + )}> +

+ + + + {__('Select an item to create a set of lists with items related to it via relationship metadata.', 'tainacan')} +

+ +
+ ) : null + } + + { isLoading ? +
+ +
: +
+ { itemId ? ( + +
+ +
+ ) : null + } +
+ } + +
+ ); +}; \ No newline at end of file diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/icon.js b/src/views/gutenberg-blocks/blocks/item-gallery/icon.js new file mode 100644 index 000000000..da9503476 --- /dev/null +++ b/src/views/gutenberg-blocks/blocks/item-gallery/icon.js @@ -0,0 +1,13 @@ + const { SVG, Path } = wp.components; + + export default ( + + + + ); + \ No newline at end of file diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/index.js b/src/views/gutenberg-blocks/blocks/item-gallery/index.js new file mode 100644 index 000000000..956c07742 --- /dev/null +++ b/src/views/gutenberg-blocks/blocks/item-gallery/index.js @@ -0,0 +1,15 @@ +import tainacanRegisterBlockType from '../../js/tainacan-blocks-compat-register.js'; + +import metadata from './block.json'; +import icon from './icon.js'; +import edit from './edit.js'; +import save from './save.js'; +import deprecated from './deprecated.js'; + +tainacanRegisterBlockType({ + metadata, + icon, + edit, + save, + deprecated +}); diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/related-items-modal.js b/src/views/gutenberg-blocks/blocks/item-gallery/related-items-modal.js new file mode 100644 index 000000000..81118188d --- /dev/null +++ b/src/views/gutenberg-blocks/blocks/item-gallery/related-items-modal.js @@ -0,0 +1,349 @@ +import tainacan from '../../js/axios.js'; +import axios from 'axios'; + +const { __ } = wp.i18n; + +const { TextControl, Button, Modal, RadioControl, SelectControl, Spinner } = wp.components; +const currentWPVersion = (typeof tainacan_blocks != 'undefined') ? tainacan_blocks.wp_version : tainacan_plugin.wp_version; + +export default class RelatedItemsModal extends React.Component { + constructor(props) { + super(props); + + // Initialize state + this.state = { + collectionsPerPage: 24, + collectionId: undefined, + itemId: undefined, + collectionName: '', + isLoadingCollections: false, + modalCollections: [], + totalModalCollections: 0, + collectionOrderBy: 'date-desc', + collectionPage: 1, + temporaryCollectionId: '', + temporaryItemId: '', + searchCollectionName: '', + collections: [], + collectionsRequestSource: undefined, + searchURL: '', + itemsPerPage: 12 + }; + + // Bind events + this.resetCollections = this.resetCollections.bind(this); + this.selectCollection = this.selectCollection.bind(this); + this.fetchCollections = this.fetchCollections.bind(this); + this.fetchModalCollections = this.fetchModalCollections.bind(this); + this.fetchCollection = this.fetchCollection.bind(this); + this.applyRelatedItem = this.applyRelatedItem.bind(this); + } + + componentWillMount() { + + this.setState({ + collectionId: this.props.existingCollectionId, + itemId: this.props.existingItemId + }); + + if (this.props.existingCollectionId) { + this.fetchCollection(this.props.existingCollectionId); + this.setState({ + searchURL: tainacan_blocks.admin_url + 'admin.php?itemsSingleSelectionMode=true&page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/items/?status=publish' + }); + } else { + this.setState({ collectionPage: 1 }); + this.fetchModalCollections(); + } + } + + // COLLECTIONS RELATED -------------------------------------------------- + fetchModalCollections() { + + let someModalCollections = this.state.modalCollections; + if (this.state.collectionPage <= 1) + someModalCollections = []; + + let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage; + + if (this.state.collectionOrderBy == 'date') + endpoint += '&orderby=date&order=asc'; + else if (this.state.collectionOrderBy == 'date-desc') + endpoint += '&orderby=date&order=desc'; + else if (this.state.collectionOrderBy == 'title') + endpoint += '&orderby=title&order=asc'; + else if (this.state.collectionOrderBy == 'title-desc') + endpoint += '&orderby=title&order=desc'; + + this.setState({ + isLoadingCollections: true, + collectionPage: this.state.collectionPage + 1, + modalCollections: someModalCollections + }); + + tainacan.get(endpoint) + .then(response => { + + let otherModalCollections = this.state.modalCollections; + for (let collection of response.data) { + otherModalCollections.push({ + name: collection.name, + id: collection.id + }); + } + + this.setState({ + isLoadingCollections: false, + modalCollections: otherModalCollections, + totalModalCollections: response.headers['x-wp-total'] + }); + + return otherModalCollections; + }) + .catch(error => { + console.log('Error trying to fetch collections: ' + error); + }); + } + + fetchCollection(collectionId) { + tainacan.get('/collections/' + collectionId) + .then((response) => { + this.setState({ collectionName: response.data.name }); + }).catch(error => { + console.log('Error trying to fetch collection: ' + error); + }); + } + + selectCollection(selectedCollectionId) { + this.setState({ + collectionId: selectedCollectionId, + searchURL: tainacan_blocks.admin_url + 'admin.php?itemsSingleSelectionMode=true&page=tainacan_admin#/collections/' + selectedCollectionId + '/items/?status=publish' + }); + + this.props.onSelectCollection(selectedCollectionId); + this.fetchCollection(selectedCollectionId); + } + + fetchCollections(name) { + + if (this.state.collectionsRequestSource != undefined) + this.state.collectionsRequestSource.cancel('Previous collections search canceled.'); + + let aCollectionRequestSource = axios.CancelToken.source(); + + this.setState({ + collectionsRequestSource: aCollectionRequestSource, + isLoadingCollections: true, + collections: [], + items: [] + }); + + let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage; + if (name != undefined && name != '') + endpoint += '&search=' + name; + + if (this.state.collectionOrderBy == 'date') + endpoint += '&orderby=date&order=asc'; + else if (this.state.collectionOrderBy == 'date-desc') + endpoint += '&orderby=date&order=desc'; + else if (this.state.collectionOrderBy == 'title') + endpoint += '&orderby=title&order=asc'; + else if (this.state.collectionOrderBy == 'title-desc') + endpoint += '&orderby=title&order=desc'; + + tainacan.get(endpoint, { cancelToken: aCollectionRequestSource.token }) + .then(response => { + let someCollections = response.data.map((collection) => ({ name: collection.name, id: collection.id + '' })); + + this.setState({ + isLoadingCollections: false, + collections: someCollections + }); + + return someCollections; + }) + .catch(error => { + console.log('Error trying to fetch collections: ' + error); + }); + } + + applyRelatedItem() { + let iframe = document.getElementById("itemsFrame"); + if (iframe) { + let params = new URLSearchParams(iframe.contentWindow.location.search); + let selectedItems = params.getAll('selecteditems'); + params.delete('selecteditems') + this.props.onApplyRelatedItem(selectedItems[0]); + } + } + + resetCollections() { + + this.setState({ + collectionId: null, + collectionPage: 1, + modalCollections: [] + }); + this.fetchModalCollections(); + } + + cancelSelection() { + + this.setState({ + modalCollections: [] + }); + + this.props.onCancelSelection(); + } + + render() { + return this.state.collectionId ? ( + // Items modal + this.cancelSelection() } + shouldCloseOnClickOutside={ false } + contentLabel={ __('Select one item that has relations', 'tainacan') }> + '), + 'media_title' => $attachment->post_title, + 'media_description' => $attachment->post_content, + 'media_caption' => $attachment->post_excerpt, + 'media_type' => $attachment->post_mime_type, + 'class_slide_metadata' => $class_slide_metadata + )); + } + } + } + + if ( isset($layout_elements['thumbnails']) && $layout_elements['thumbnails'] ) { + + $class_slide_metadata = ''; + if ($hide_file_name_thumbnails) + $class_slide_metadata .= ' hide-name'; + if ($hide_file_description_thumbnails) + $class_slide_metadata .= ' hide-description'; + if ($hide_file_caption_thumbnails) + $class_slide_metadata .= ' hide-caption'; + + if ( isset($media_sources['document']) && $media_sources['document'] && !empty(tainacan_get_the_document($item_id)) ) { + $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; + $media_items_thumbnails[] = + tainacan_get_the_media_component_slide(array( + 'media_content' => get_the_post_thumbnail(null, 'tainacan-medium'), + 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
'), + 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', + 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', + 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', + 'media_type' => tainacan_get_the_document_type($item_id), + 'class_slide_metadata' => $class_slide_metadata + )); + } + + if ( isset($media_sources['attachments']) && $media_sources['attachments'] ) { + foreach ( $attachments as $attachment ) { + $media_items_thumbnails[] = + tainacan_get_the_media_component_slide(array( + 'media_content' => wp_get_attachment_image( $attachment->ID, 'tainacan-medium', false ), + 'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
'), + 'media_title' => $attachment->post_title, + 'media_description' => $attachment->post_content, + 'media_caption' => $attachment->post_excerpt, + 'media_type' => $attachment->post_mime_type, + 'class_slide_metadata' => $class_slide_metadata + )); + } + } + } + + $wrapper_attributes = get_block_wrapper_attributes(); + + return sprintf( + '
%2$s
', + $wrapper_attributes, + tainacan_get_the_media_component( + 'tainacan-item-gallery-block_id-' . $block_id, + (isset($layout_elements['thumbnails']) && $layout_elements['thumbnails']) ? $media_items_thumbnails : null, + (isset($layout_elements['main']) && $layout_elements['main']) ? $media_items_main : null, + array( + 'class_main_div' => '', + 'class_thumbs_div' => '', + 'swiper_main_options' => (isset($layout_elements['main']) && $layout_elements['main']) ? array( + 'navigation' => array( + 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', + 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', + 'preloadImages' => false, + 'lazy' => true + ) + ) : '', + 'swiper_thumbs_options' => (isset($layout_elements['thumbnails']) && $layout_elements['thumbnails'] && (!isset($layout_elements['main']) || !$layout_elements['main']) ) ? array( + 'navigation' => array( + 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', + 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', + 'preloadImages' => false, + 'lazy' => true + ) + ) : '', + 'disable_lightbox' => !$open_lightbox_on_click, + ) + ) + ); +} \ No newline at end of file diff --git a/src/views/gutenberg-blocks/class-tainacan-gutenberg-block.php b/src/views/gutenberg-blocks/class-tainacan-gutenberg-block.php index d6543a262..53ebd5ff3 100644 --- a/src/views/gutenberg-blocks/class-tainacan-gutenberg-block.php +++ b/src/views/gutenberg-blocks/class-tainacan-gutenberg-block.php @@ -82,15 +82,6 @@ function tainacan_blocks_register_and_enqueue_all_blocks() { } } -/** - * Plugin Name: Gutenberg examples dynamic - */ - -function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { - $content = '

TESTE

'; - return '

EITA

'; -} - /** * Registers a 'generic' Tainacan Block, according to the TAINACAN_BLOCKs array * @@ -109,6 +100,7 @@ function tainacan_blocks_register_block($block_slug, $options = []) { // If there is a server side render callback, we add its render function if ( isset($options['render_callback']) ) { + require_once( __DIR__ . '/blocks/' . $block_slug . '/save.php' ); $register_params['render_callback'] = $options['render_callback']; $register_params['skip_inner_blocks'] = true; @@ -120,7 +112,7 @@ 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'); + $editor_script_deps = array('wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-server-side-render'); if ( version_compare( $wp_version, '5.2', '<') ) $editor_script_deps[] = 'wp-editor'; else diff --git a/src/views/gutenberg-blocks/tainacan-blocks-common-scripts.js b/src/views/gutenberg-blocks/tainacan-blocks-common-scripts.js index f44b9ddbf..882a8af42 100644 --- a/src/views/gutenberg-blocks/tainacan-blocks-common-scripts.js +++ b/src/views/gutenberg-blocks/tainacan-blocks-common-scripts.js @@ -23,8 +23,7 @@ const addDataModuleToOldBlocks = () => { 'carousel-items-list', 'carousel-terms-list', 'related-items-list', - 'carousel-collections-list', - 'item-gallery' + 'carousel-collections-list' ]; // Looks for Tainacan Blocks based on their classes. @@ -36,7 +35,7 @@ const addDataModuleToOldBlocks = () => { }); }); - // Extra case for the items list and item submission, as their + // Extra case for the items list, item gallery and item submission, as their // theme wrapper does not uses gutenberg classes, but the div ID let existingItemListOnPage = document.getElementById('tainacan-items-page'); if ( existingItemListOnPage && !existingItemListOnPage.getAttribute('data-module') ) @@ -45,6 +44,14 @@ const addDataModuleToOldBlocks = () => { let existingItemSubmissionFormOnPage = document.getElementById('tainacan-item-submission-form'); if ( existingItemSubmissionFormOnPage && !existingItemSubmissionFormOnPage.getAttribute('data-module') ) existingItemSubmissionFormOnPage.setAttribute('data-module', 'item-submission-form'); + + let existingItemGalleryOnPages = document.getElementsByClassName('wp-block-tainacan-item-gallery'); + [...existingItemGalleryOnPages].forEach((existingItemGalleryOnPage) => { + let mediaComponentDiv = existingItemGalleryOnPage.getElementsByClassName('tainacan-media-component'); + if ( mediaComponentDiv[0] && !mediaComponentDiv[0].getAttribute('data-module') ) + mediaComponentDiv[0].setAttribute('data-module', 'item-gallery'); + }); + } performWhenDocumentIsLoaded(() => { From a7be8809520fce18260ed781dc24f046935e1bae Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 3 Mar 2022 18:21:38 -0300 Subject: [PATCH 04/13] Uses serverSideRender component to display item gallery. #674. --- .../blocks/item-gallery/edit.js | 31 +++++++++---------- .../blocks/item-gallery/save.php | 2 +- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js index ce63ba5ad..15607d790 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js +++ b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js @@ -2,7 +2,7 @@ const { __ } = wp.i18n; const { Button, Placeholder, ToggleControl, PanelBody } = wp.components; -const { serverSideRender: ServerSideRender } = wp.serverSideRender; +const ServerSideRender = wp.serverSideRender; const { InspectorControls, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor ); import SingleItemModal from '../../js/selection/single-item-modal.js'; @@ -10,7 +10,6 @@ import SingleItemModal from '../../js/selection/single-item-modal.js'; export default function ({ attributes, setAttributes, className, isSelected, clientId }) { let { - blockId, content, collectionId, itemId, @@ -35,13 +34,6 @@ export default function ({ attributes, setAttributes, className, isSelected, cli // Obtains block's client id to render it on save function setAttributes({ blockId: clientId }); - function openSingleItemModal() { - isModalOpen = true; - setAttributes( { - isModalOpen: isModalOpen - }); - } - return content == 'preview' ?
openSingleItemModal() }> + onClick={ () => { + isModalOpen = true; + setAttributes( { + isModalOpen: isModalOpen + }); + } + }> {__('Select Item', 'tainacan')} @@ -286,13 +284,12 @@ export default function ({ attributes, setAttributes, className, isSelected, cli } { itemId ? ( - -
- { JSON.stringify(attributes) } - {/* */} -
+
+ +
) : null } diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/save.php b/src/views/gutenberg-blocks/blocks/item-gallery/save.php index 6a6228df4..8de3ecfd8 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/save.php +++ b/src/views/gutenberg-blocks/blocks/item-gallery/save.php @@ -10,7 +10,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { if ( !isset($block_attributes['itemId']) ) return ''; - + // Gets options from block attributes $item_id = $block_attributes['itemId']; $block_id = $block_attributes['blockId']; From aa40c5fb873f2d09cc99817f566fa0d27cfebf3f Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Fri, 4 Mar 2022 11:26:57 -0300 Subject: [PATCH 05/13] Better check boolean values on the save function #674. --- .../blocks/item-gallery/edit.js | 11 ++++---- .../blocks/item-gallery/save.php | 28 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js index 15607d790..6caf35b59 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js +++ b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js @@ -53,7 +53,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli label={__('Document', 'tainacan')} checked={ mediaSources['document'] === true } onChange={ ( isChecked ) => { - let updatedSources = JSON.parse(JSON.stringify(mediaSources)); + let updatedSources = Object.assign({},mediaSources); updatedSources['document'] = isChecked; setAttributes({ mediaSources: updatedSources }); } @@ -63,7 +63,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli label={__('Attachments', 'tainacan')} checked={ mediaSources['attachments'] === true } onChange={ ( isChecked ) => { - let updatedSources = JSON.parse(JSON.stringify(mediaSources)); + let updatedSources = Object.assign({},mediaSources); updatedSources['attachments'] = isChecked; setAttributes({ mediaSources: updatedSources }); } @@ -73,7 +73,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli label={__('Metadata', 'tainacan')} checked={ mediaSources['metadata'] === true } onChange={ ( isChecked ) => { - let updatedSources = JSON.parse(JSON.stringify(mediaSources)); + let updatedSources = Object.assign({},mediaSources); updatedSources['metadata'] = isChecked; setAttributes({ mediaSources: updatedSources }); } @@ -88,7 +88,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli label={__('Main slider', 'tainacan')} checked={ layoutElements['main'] === true } onChange={ ( isChecked ) => { - let updatedElements = JSON.parse(JSON.stringify(layoutElements)); + let updatedElements = Object.assign({},layoutElements); updatedElements['main'] = isChecked; setAttributes({ layoutElements: updatedElements }); } @@ -98,7 +98,8 @@ export default function ({ attributes, setAttributes, className, isSelected, cli label={__('Thumbnails carousel', 'tainacan')} checked={ layoutElements['thumbnails'] === true } onChange={ (isChecked) => { - let updatedElements = JSON.parse(JSON.stringify(layoutElements)); + console.log(typeof layoutElements['thumbnails']) + let updatedElements = Object.assign({},layoutElements); updatedElements['thumbnails'] = isChecked; setAttributes({ layoutElements: updatedElements }); } diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/save.php b/src/views/gutenberg-blocks/blocks/item-gallery/save.php index 8de3ecfd8..cbfd804c6 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/save.php +++ b/src/views/gutenberg-blocks/blocks/item-gallery/save.php @@ -10,7 +10,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { if ( !isset($block_attributes['itemId']) ) return ''; - + // Gets options from block attributes $item_id = $block_attributes['itemId']; $block_id = $block_attributes['blockId']; @@ -26,14 +26,14 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { $hide_file_caption_lightbox = isset($block_attributes['hideFileCaptionLightbox']) ? $block_attributes['hideFileCaptionLightbox'] : false; $hide_file_description_lightbox = isset($block_attributes['hideFileDescriptionLightbox']) ? $block_attributes['hideFileDescriptionLightbox'] : false; $open_lightbox_on_click = isset($block_attributes['openLightboxOnClick']) ? $block_attributes['openLightboxOnClick'] : true; - + $media_items_main = array(); $media_items_thumbnails = array(); - if ( isset($media_sources['attachments']) && $media_sources['attachments'] ) + if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) $attachments = tainacan_get_the_attachments(null, $item_id); - if ( isset($layout_elements['main']) && $layout_elements['main'] ) { + if ( isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true') ) { $class_slide_metadata = ''; if ($hide_file_name_main) @@ -43,7 +43,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { if ($hide_file_caption_main) $class_slide_metadata .= ' hide-caption'; - if ( isset($media_sources['document']) && $media_sources['document'] && !empty(tainacan_get_the_document($item_id)) ) { + if ( isset($media_sources['document']) && ($media_sources['document'] === true || $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; $media_items_main[] = tainacan_get_the_media_component_slide(array( @@ -60,7 +60,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { )); } - if ( isset($media_sources['attachments']) && $media_sources['attachments'] ) { + if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { foreach ( $attachments as $attachment ) { $media_items_main[] = tainacan_get_the_media_component_slide(array( @@ -78,8 +78,8 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { } } } - - if ( isset($layout_elements['thumbnails']) && $layout_elements['thumbnails'] ) { + + if ( isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') ) { $class_slide_metadata = ''; if ($hide_file_name_thumbnails) @@ -89,7 +89,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { if ($hide_file_caption_thumbnails) $class_slide_metadata .= ' hide-caption'; - if ( isset($media_sources['document']) && $media_sources['document'] && !empty(tainacan_get_the_document($item_id)) ) { + if ( isset($media_sources['document']) && ($media_sources['document'] === true && $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; $media_items_thumbnails[] = tainacan_get_the_media_component_slide(array( @@ -103,7 +103,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { )); } - if ( isset($media_sources['attachments']) && $media_sources['attachments'] ) { + if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { foreach ( $attachments as $attachment ) { $media_items_thumbnails[] = tainacan_get_the_media_component_slide(array( @@ -126,12 +126,12 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { $wrapper_attributes, tainacan_get_the_media_component( 'tainacan-item-gallery-block_id-' . $block_id, - (isset($layout_elements['thumbnails']) && $layout_elements['thumbnails']) ? $media_items_thumbnails : null, - (isset($layout_elements['main']) && $layout_elements['main']) ? $media_items_main : null, + (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true')) ? $media_items_thumbnails : null, + (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? $media_items_main : null, array( 'class_main_div' => '', 'class_thumbs_div' => '', - 'swiper_main_options' => (isset($layout_elements['main']) && $layout_elements['main']) ? array( + 'swiper_main_options' => (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? array( 'navigation' => array( 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', @@ -139,7 +139,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { 'lazy' => true ) ) : '', - 'swiper_thumbs_options' => (isset($layout_elements['thumbnails']) && $layout_elements['thumbnails'] && (!isset($layout_elements['main']) || !$layout_elements['main']) ) ? array( + 'swiper_thumbs_options' => (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') && (!isset($layout_elements['main']) || !($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ) ? array( 'navigation' => array( 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', From 4e835fd2c37186eac44b206b9b9f97f5e4ae4414 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 7 Mar 2022 12:01:17 -0300 Subject: [PATCH 06/13] Adds options to control appearance of the item gallery #674. --- .../tainacan-gutenberg-block-item-gallery.css | 10 ++- ...nacan-gutenberg-block-item-gallery.css.map | 2 +- src/classes/theme-helper/template-tags.php | 4 +- .../blocks/item-gallery/block.json | 32 +++++++- .../blocks/item-gallery/edit.js | 62 +++++++++++++++- .../blocks/item-gallery/icon.js | 5 +- .../blocks/item-gallery/save.php | 73 +++++++++++-------- .../blocks/item-gallery/style.scss | 10 +++ .../blocks/item-gallery/theme.js | 2 +- .../tainacan-blocks-common-scripts.js | 10 +-- 10 files changed, 158 insertions(+), 52 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-item-gallery.css b/src/assets/css/tainacan-gutenberg-block-item-gallery.css index 131dc0862..19030764d 100644 --- a/src/assets/css/tainacan-gutenberg-block-item-gallery.css +++ b/src/assets/css/tainacan-gutenberg-block-item-gallery.css @@ -689,6 +689,9 @@ a.pswp__share--download:hover { .tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata.hide-name.hide-description.hide-caption br { display: none; visibility: hidden; } + .tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata.hide-name.hide-description.hide-caption { + display: none; + visibility: hidden; } .tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata__name { font-size: 1em; font-weight: bold; @@ -760,7 +763,9 @@ a.pswp__share--download:hover { max-height: var(--tainacan-media-main-carousel-height, 60vh); } .tainacan-media-component__swiper-main .swiper-slide-content img { width: auto; - max-height: var(--tainacan-media-main-carousel-height, 60vh); } + max-height: var(--tainacan-media-main-carousel-height, 60vh); + max-width: 100%; + height: auto; } .tainacan-media-component__swiper-main .swiper-slide-content .twitter-tweet { margin-left: auto; margin-right: auto; } @@ -829,6 +834,9 @@ a.pswp__share--download:hover { .tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata.hide-name.hide-description.hide-caption br { display: none; visibility: hidden; } + .tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata.hide-name.hide-description.hide-caption { + display: none; + visibility: hidden; } .tainacan-media-component__swiper-thumbs li.swiper-slide a { width: 100%; max-width: var(--tainacan-media-thumbs-carousel-item-size, 136px); diff --git a/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map b/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map index 0d5606fa0..1b9611b27 100644 --- a/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map +++ b/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAAA,2EAA2E;AAE3E;;EAEE;AAOF,uBAAuB;AACvB,KAAM;EACL,OAAO,EAAE,IAAI;EACb,QAAQ,EAAC,QAAQ;EACjB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,IAAI,EAAC,CAAC;EACN,GAAG,EAAC,CAAC;EACL,QAAQ,EAAE,MAAM;EAChB,gBAAgB,EAAE,IAAI;EACtB,YAAY,EAAE,IAAI;EAClB,OAAO,ECjBa,OAAO;EDkB3B,wBAAwB,EAAE,IAAI;EAC9B,8EAA8E;EAC9E,2BAA2B,EAAE,MAAM;EACnC,OAAO,EAAE,IAAI;EAGZ,OAAE;IACD,UAAU,EAAE,UAAU;EAIxB,SAAI;IACH,SAAS,EAAE,IAAI;;AAIjB,kEAAkE;AAClE,sBAAuB;EACtB,oGAAoG;EACpG,OAAO,EAAE,KAAK;EACd,WAAW,EAAC,OAAO;EACnB,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B;MACxB,SAAS,EAAE,IAAI;IAEnB,8FAA6B;MACzB,SAAS,EAAE,qBAAqB;IAEpC,6FAA4B;MACxB,SAAS,EAAE,oBAAoB;EAGvC;;mEAEsB;IAClB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,cAAc;IACvB,UAAU,EAAE,yCAAyC;IACrD,aAAa,EAAE,wBAAwB;IACvC,SAAS,EAAE,UAAU;EAEzB,iDAAM;IACF,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,GAAG;EAElB,iDAAM;IACF,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,GAAG;AAGtB,qDAA2B;EACvB,KAAK,EAAE,KAAK;EACZ,UAAU,EAAE,MAAM;EAClB,SAAS,EAAE,OAAO;EAClB,OAAO,EAAE,KAAK;EACd,MAAM,EAAE,IAAI;EACZ,SAAS,EAAE,kBAAkB;EAC7B,KAAK,EAAE,IAAI;EACX,IAAI,EAAE,IAAI;EACV,QAAQ,EAAE,QAAQ;EAClB,QAAQ,EAAE,MAAM;EAChB,aAAa,EAAE,QAAQ;EACvB,WAAW,EAAE,MAAM;EACnB,WAAW,EAAE,IAAI;EACjB,OAAO,EAAE,MAAM;AAEnB,gDAAsB;EAClB,SAAS,EAAE,OAAO;EAClB,UAAU,EAAE,MAAM;AAEtB,6CAAmB;EACf,SAAS,EAAE,QAAQ;AAEvB,iDAAuB;EACnB,UAAU,EAAE,MAAM;EAClB,SAAS,EAAE,GAAG;EACd,SAAS,EAAE,KAAK", "sources": ["../../../node_modules/photoswipe/src/css/main.scss","../../views/gutenberg-blocks/blocks/item-gallery/style.scss","../../../node_modules/photoswipe/src/css/default-skin/default-skin.scss"], "names": [], "file": "tainacan-gutenberg-block-item-gallery.css" diff --git a/src/classes/theme-helper/template-tags.php b/src/classes/theme-helper/template-tags.php index 8c92c7b3f..a1dd96141 100644 --- a/src/classes/theme-helper/template-tags.php +++ b/src/classes/theme-helper/template-tags.php @@ -278,6 +278,7 @@ function tainacan_the_media_component($media_id, $media_items_thumbs, $media_ite * @param array $media_items_main Array of media items to be rendered inside main, bigger the carousel. Default to empty array * @param array|string $args { * Optional. Array of arguments. + * @type string wrapper_attributes String containing attrs (style, class) for the wrapper div. If used, remember to pass class="tainacan-media-component" * @type string before_main_div String to be added before the main gallery div * @type string after_main_div String to be added after the main gallery div * @type string before_thumbs_div String to be added before the thumbs gallery div @@ -308,6 +309,7 @@ function tainacan_get_the_media_component( global $TAINACAN_BASE_URL; $args = array_merge(array( + 'wrapper_attributes' => 'class="tainacan-media-component"', 'before_main_div' => '', 'after_main_div' => '', 'before_thumbs_div' => '', @@ -353,7 +355,7 @@ function tainacan_get_the_media_component( tainacan_plugin.tainacan_media_components[''] = ; -
+
data-module='item-gallery'> diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/block.json b/src/views/gutenberg-blocks/blocks/item-gallery/block.json index 716ca6534..566f9604b 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/block.json +++ b/src/views/gutenberg-blocks/blocks/item-gallery/block.json @@ -1,11 +1,11 @@ { "$schema": "https://schemas.wp.org/trunk/block.json", "name": "tainacan/item-gallery", - "title": "Tainacan Item Gallery", + "title": "Tainacan Item Media Gallery", "apiVersion": 2, "category": "tainacan-blocks", "keywords": [ "item", "document", "carousel", "attachments", "zoom" ], - "description": "The media gallery of the item, displaying document and attachments.", + "description": "The media gallery of the item, displaying document, attachments and more.", "textdomain": "tainacan", "example": { "attributes": { @@ -88,11 +88,37 @@ "openLightboxOnClick": { "type": "boolean", "default": true + }, + "arrowsSize": { + "type": "integer", + "default": 44 + }, + "mainSliderHeight": { + "type": "integer", + "default": 60 + }, + "mainSliderWidth": { + "type": "integer", + "default": 100 + }, + "thumbnailsCarouselWidth": { + "type": "integer", + "default": 100 + }, + "thumbnailsCarouselItemSize": { + "type": "integer", + "default": 136 } }, "supports": { "align": ["full", "wide"], - "multiple": true + "multiple": true, + "color": { + "text": true, + "background": true, + "gradients": true, + "link": true + } }, "editorScript": "item-gallery", "editorStyle": "item-gallery" diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js index 6caf35b59..49d1d97f0 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js +++ b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js @@ -1,6 +1,6 @@ const { __ } = wp.i18n; -const { Button, Placeholder, ToggleControl, PanelBody } = wp.components; +const { Button, Placeholder, RangeControl, ToggleControl, PanelBody } = wp.components; const ServerSideRender = wp.serverSideRender; const { InspectorControls, useBlockProps } = (tainacan_blocks.wp_version < '5.2' ? wp.editor : wp.blockEditor ); @@ -25,7 +25,12 @@ export default function ({ attributes, setAttributes, className, isSelected, cli hideFileNameLightbox, hideFileCaptionLightbox, hideFileDescriptionLightbox, - openLightboxOnClick + openLightboxOnClick, + arrowsSize, + mainSliderHeight, + mainSliderWidth, + thumbnailsCarouselWidth, + thumbnailsCarouselItemSize } = attributes; // Gets blocks props from hook @@ -98,7 +103,6 @@ export default function ({ attributes, setAttributes, className, isSelected, cli label={__('Thumbnails carousel', 'tainacan')} checked={ layoutElements['thumbnails'] === true } onChange={ (isChecked) => { - console.log(typeof layoutElements['thumbnails']) let updatedElements = Object.assign({},layoutElements); updatedElements['thumbnails'] = isChecked; setAttributes({ layoutElements: updatedElements }); @@ -120,6 +124,36 @@ export default function ({ attributes, setAttributes, className, isSelected, cli title={__('Main slider settings', 'tainacan')} initialOpen={ true } > + { + arrowsSize = updatedArrowsSize; + setAttributes({ arrowsSize: updatedArrowsSize }); + }} + min={ 8 } + max={ 64 } + /> + { + mainSliderHeight = updatedMainSliderHeight; + setAttributes({ mainSliderHeight: updatedMainSliderHeight }); + }} + min={ 10 } + max={ 150 } + /> + { + mainSliderWidth = updatedMainSliderWidth; + setAttributes({ mainSliderWidth: updatedMainSliderWidth }); + }} + min={ 10 } + max={ 150 } + /> + { + thumbnailsCarouselWidth = updatedThumbnailsCarouselWidth; + setAttributes({ thumbnailsCarouselWidth: updatedThumbnailsCarouselWidth }); + }} + min={ 10 } + max={ 150 } + /> + { + thumbnailsCarouselItemSize = updatedThumbnailsCarouselItemSize; + setAttributes({ thumbnailsCarouselItemSize: updatedThumbnailsCarouselItemSize }); + }} + min={ 32 } + max={ 400 } + /> - {__('Select an item to create a set of lists with items related to it via relationship metadata.', 'tainacan')} + {__('Select an item to display its media gallery, including Document and Attachments.', 'tainacan')}

@@ -412,8 +440,30 @@ function tainacan_get_the_media_component( -
-
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/save.php b/src/views/gutenberg-blocks/blocks/item-gallery/save.php index 82a70262e..5f62715e5 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/save.php +++ b/src/views/gutenberg-blocks/blocks/item-gallery/save.php @@ -183,6 +183,7 @@ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { 'lazy' => true ) ) : '', + 'swiper_arrows_as_svg' => true, 'disable_lightbox' => !$open_lightbox_on_click, ) ); diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/style.scss b/src/views/gutenberg-blocks/blocks/item-gallery/style.scss index f488ee12b..bd0ca0b64 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/style.scss +++ b/src/views/gutenberg-blocks/blocks/item-gallery/style.scss @@ -40,13 +40,12 @@ $pswp__include-minimal-style: true !default; /* Style valid for both cases of carousel, main and thumbs */ .tainacan-media-component__swiper-main, .tainacan-media-component__swiper-thumbs { - .swiper-button-prev::after, - .swiper-container-rtl .swiper-button-next::after { + .swiper-button-prev:not(.swiper-button-has-svg)::after, + .swiper-container-rtl .swiper-button-next:not(.swiper-button-has-svg)::after { content: 'previous'; } - - .swiper-button-next::after, - .swiper-button-prev::after { + .swiper-button-next:not(.swiper-button-has-svg)::after, + .swiper-button-prev:not(.swiper-button-has-svg)::after { font-family: "TainacanIcons"; opacity: 0.7; transition: opacity ease 0.2s; @@ -57,6 +56,16 @@ $pswp__include-minimal-style: true !default; opacity: 1; } } + .swiper-button-next.swiper-button-has-svg::after, + .swiper-button-prev.swiper-button-has-svg::after { + display: none; + } + .swiper-button-next.swiper-button-has-svg svg, + .swiper-button-prev.swiper-button-has-svg svg { + min-width: calc(var(--swiper-navigation-size) * 1.35); + min-height: calc(var(--swiper-navigation-size) * 1.35); + fill: currentColor; + } ul.swiper-wrapper { list-style: none; padding: 0; From b9074fef6a1a767e0daec90d94674dfae3130c9a Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Tue, 8 Mar 2022 11:10:43 -0300 Subject: [PATCH 10/13] Removes unavailable features from the gallery block by now. #674. --- .../tainacan-gutenberg-block-item-gallery.css | 13 ++++++ ...nacan-gutenberg-block-item-gallery.css.map | 2 +- .../blocks/item-gallery/block.json | 12 ------ .../blocks/item-gallery/edit.js | 42 ++----------------- .../blocks/item-gallery/save.php | 6 +-- .../blocks/item-gallery/style.scss | 18 ++++++++ 6 files changed, 37 insertions(+), 56 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-item-gallery.css b/src/assets/css/tainacan-gutenberg-block-item-gallery.css index 48484c1e2..daca13344 100644 --- a/src/assets/css/tainacan-gutenberg-block-item-gallery.css +++ b/src/assets/css/tainacan-gutenberg-block-item-gallery.css @@ -609,6 +609,19 @@ a.pswp__share--download:hover { .pswp--minimal--dark .pswp__top-bar { background: none; } +.item-gallery-edit-container .tainacan-media-component .swiper-slide, +.item-gallery-edit-container .tainacan-media-component .swiper-button-prev, +.item-gallery-edit-container .tainacan-media-component .swiper-button-next { + cursor: not-allowed !important; } +.item-gallery-edit-container .preview-warning { + width: 100%; + font-size: 0.875rem; + font-style: italic; + color: inherit; + text-align: center; + margin: 0 auto; + padding: 8px 2px 2px 2px; } + .tainacan-media-component { --swiper-theme-color: var(--tainacan-secondary, #298596); --swiper-navigation-size: 44px; diff --git a/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map b/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map index b5c626841..28e5b23e3 100644 --- a/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map +++ b/src/assets/css/tainacan-gutenberg-block-item-gallery.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAAA,2EAA2E;AAE3E;;EAEE;AAOF,uBAAuB;AACvB,KAAM;EACL,OAAO,EAAE,IAAI;EACb,QAAQ,EAAC,QAAQ;EACjB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,IAAI,EAAC,CAAC;EACN,GAAG,EAAC,CAAC;EACL,QAAQ,EAAE,MAAM;EAChB,gBAAgB,EAAE,IAAI;EACtB,YAAY,EAAE,IAAI;EAClB,OAAO,ECjBa,OAAO;EDkB3B,wBAAwB,EAAE,IAAI;EAC9B,8EAA8E;EAC9E,2BAA2B,EAAE,MAAM;EACnC,OAAO,EAAE,IAAI;EAGZ,OAAE;IACD,UAAU,EAAE,UAAU;EAIxB,SAAI;IACH,SAAS,EAAE,IAAI;;AAIjB,kEAAkE;AAClE,sBAAuB;EACtB,oGAAoG;EACpG,OAAO,EAAE,KAAK;EACd,WAAW,EAAC,OAAO;EACnB,+BAA+B;EAC/B,UAAU,EAAE,2CAAqE;;AAGlF,WAAY;EACX,OAAO,EAAE,KAAK;;AAGf,8BAA+B;EAC9B,uBAAuB;EACvB,MAAM,EAAE,eAAe;EACvB,MAAM,EAAE,YAAY;EACpB,MAAM,EAAE,OAAO;;AAGhB,2BAA4B;EAC3B,uBAAuB;EACvB,MAAM,EAAE,YAAY;EACpB,MAAM,EAAE,SAAS;EACjB,MAAM,EAAE,IAAI;;AAGb,0BAA4B;EAC3B,uBAAuB;EACvB,MAAM,EAAE,gBAAgB;EACxB,MAAM,EAAE,aAAa;EACrB,MAAM,EAAE,QAAQ;;AAGjB;;;EAGE;AACF,SAAU;EACT,QAAQ,EAAE,QAAQ;EAClB,IAAI,EAAE,CAAC;EACP,GAAG,EA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AAW,EAAE,IAAI;EACjB,OAAO,EAAE,MAAM;AAEnB,gDAAsB;EAClB,SAAS,EAAE,OAAO;EAClB,UAAU,EAAE,MAAM;AAEtB,6CAAmB;EACf,SAAS,EAAE,QAAQ;AAEvB,iDAAuB;EACnB,UAAU,EAAE,MAAM;EAClB,SAAS,EAAE,GAAG;EACd,SAAS,EAAE,KAAK", "sources": ["../../../node_modules/photoswipe/src/css/main.scss","../../views/gutenberg-blocks/blocks/item-gallery/style.scss","../../../node_modules/photoswipe/src/css/default-skin/default-skin.scss"], "names": [], "file": "tainacan-gutenberg-block-item-gallery.css" diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/block.json b/src/views/gutenberg-blocks/blocks/item-gallery/block.json index 82a3341e3..d4e113aab 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/block.json +++ b/src/views/gutenberg-blocks/blocks/item-gallery/block.json @@ -73,18 +73,6 @@ "type": "boolean", "default": true }, - "hideFileNameLightbox": { - "type": "boolean", - "default": false - }, - "hideFileCaptionLightbox": { - "type": "boolean", - "default": false - }, - "hideFileDescriptionLightbox": { - "type": "boolean", - "default": false - }, "openLightboxOnClick": { "type": "boolean", "default": true diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js index 7ab1d10a3..4886cc9cc 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js +++ b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js @@ -22,9 +22,6 @@ export default function ({ attributes, setAttributes, className, isSelected, cli hideFileNameThumbnails, hideFileCaptionThumbnails, hideFileDescriptionThumbnails, - hideFileNameLightbox, - hideFileCaptionLightbox, - hideFileDescriptionLightbox, openLightboxOnClick, arrowsSize, mainSliderHeight, @@ -74,7 +71,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli } } /> - { @@ -83,7 +80,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli setAttributes({ mediaSources: updatedSources }); } } - /> + /> */} : null } - { openLightboxOnClick ? - - { - hideFileNameLightbox = isChecked; - setAttributes({ hideFileNameLightbox: hideFileNameLightbox }); - } - } - /> - { - hideFileCaptionLightbox = isChecked; - setAttributes({ hideFileCaptionLightbox: hideFileCaptionLightbox }); - } - } - /> - { - hideFileDescriptionLightbox = isChecked; - setAttributes({ hideFileDescriptionLightbox: hideFileDescriptionLightbox }); - } - } - /> - - : null } { isSelected ? @@ -340,6 +303,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli { itemId ? (
+
{__('Warning: this is just a demonstration. To see the gallery in action, either preview or publish your post.', 'tainacan') }
$block_custom_css, 'class' => 'tainacan-media-component' ) ); + return tainacan_get_the_media_component( 'tainacan-item-gallery-block_id-' . $block_id, (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true')) ? $media_items_thumbnails : null, diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/style.scss b/src/views/gutenberg-blocks/blocks/item-gallery/style.scss index bd0ca0b64..12374c6cd 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/style.scss +++ b/src/views/gutenberg-blocks/blocks/item-gallery/style.scss @@ -11,6 +11,24 @@ $pswp__include-minimal-style: true !default; @import '../../../../../node_modules/photoswipe/src/css/main.scss'; @import '../../../../../node_modules/photoswipe/src/css/default-skin/default-skin.scss'; +.item-gallery-edit-container { + .tainacan-media-component { + .swiper-slide, + .swiper-button-prev, + .swiper-button-next { + cursor: not-allowed !important; + } + } + .preview-warning { + width: 100%; + font-size: 0.875rem; + font-style: italic; + color: inherit; + text-align: center; + margin: 0 auto; + padding: 8px 2px 2px 2px; + } +} .tainacan-media-component { --swiper-theme-color: var(--tainacan-secondary, #298596); --swiper-navigation-size: 44px; From 2dff14a57d6ae0cb31750cf82d1adaf920469289 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Wed, 9 Mar 2022 17:09:04 -0300 Subject: [PATCH 11/13] Moves logic for creating the media gallery from block save function to template tags and theme helper. #674. --- .../class-tainacan-theme-helper.php | 210 ++++++++++++++++++ src/classes/theme-helper/template-tags.php | 34 ++- .../blocks/item-gallery/save.php | 179 +-------------- 3 files changed, 241 insertions(+), 182 deletions(-) diff --git a/src/classes/theme-helper/class-tainacan-theme-helper.php b/src/classes/theme-helper/class-tainacan-theme-helper.php index 2867d94c6..904b68798 100644 --- a/src/classes/theme-helper/class-tainacan-theme-helper.php +++ b/src/classes/theme-helper/class-tainacan-theme-helper.php @@ -1104,5 +1104,215 @@ class Theme_Helper { $args = wp_parse_args($args, [ 'items_list_layout' => 'carousel' ]); return $this->get_tainacan_related_items_list($args); } + + /** + * Returns an item gallery, containing document, + * attachments and other information in a slider, carousel and lightbox + * + * @param array $args { + * Optional. Array of arguments. + * @type string $item_id The Item ID + * @type string $blockId A unique identifier for the gallery, will be generated automatically if not provided, + * @type array $layoutElements Array of elements present in the gallery. Possible values are 'main' and 'carousel' + * @type array $mediaSources Array of sources for the gallery. Possible values are 'document' and 'attachments' + * @type bool $hideFileNameMain Hides the Main slider file name + * @type bool $hideFileCaptionMain Hides the Main slider file caption + * @type bool $hideFileDescriptionMain Hides the Main slider file description + * @type bool $hideFileNameThumbnails Hides the Thumbnails carousel file name + * @type bool $hideFileCaptionThumbnails Hides the Thumbnails carousel file caption + * @type bool $hideFileDescriptionThumbnails Hides the Thumbnails carousel file description + * @type bool $openLightboxOnClick Enables the behaviour of opening a lightbox with zoom when clicking on the media item + * @return string The HTML div to be used for rendering the item galery component + */ + public function get_tainacan_item_gallery($args = []) { + + $defaults = array( + 'blockId' => uniqid(), + 'layoutElements' => array('main' => true, 'thumbnails' => true), + 'mediaSources' => array( 'document' => true, 'attachments' => true, 'metadata' => false), + 'hideFileNameMain' => true, + 'hideFileCaptionMain' => false, + 'hideFileDescriptionMain' => true, + 'hideFileNameThumbnails' => true, + 'hideFileCaptionThumbnails' => true, + 'hideFileDescriptionThumbnails' => true, + 'openLightboxOnClick' => true + ); + $args = wp_parse_args($args, $defaults); + + // Gets the current Item. This way, the function can be used in the loop without needing to pass it + $item = isset($args['itemId']) ? $this->tainacan_get_item($args['itemId']) : $this->tainacan_get_item(); + if (!$item) + return; + + // Gets options from block attributes + $item_id = $item->get_id(); + $block_id = $args['blockId']; + $layout_elements = $args['layoutElements']; + $media_sources = $args['mediaSources']; + $hide_file_name_main = $args['hideFileNameMain']; + $hide_file_caption_main = $args['hideFileCaptionMain']; + $hide_file_description_main = $args['hideFileDescriptionMain']; + $hide_file_name_thumbnails = $args['hideFileNameThumbnails']; + $hide_file_caption_thumbnails = $args['hideFileCaptionThumbnails']; + $hide_file_description_thumbnails = $args['hideFileDescriptionThumbnails']; + $open_lightbox_on_click = $args['openLightboxOnClick']; + + $media_items_main = array(); + $media_items_thumbnails = array(); + + if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) + $attachments = tainacan_get_the_attachments(null, $item_id); + + if ( isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true') ) { + + $class_slide_metadata = ''; + if ($hide_file_name_main) + $class_slide_metadata .= ' hide-name'; + if ($hide_file_description_main) + $class_slide_metadata .= ' hide-description'; + if ($hide_file_caption_main) + $class_slide_metadata .= ' hide-caption'; + + if ( isset($media_sources['document']) && ($media_sources['document'] === true || $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { + $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; + $media_items_main[] = + tainacan_get_the_media_component_slide(array( + 'after_slide_metadata' => (( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && tainacan_the_item_document_download_link($item_id) != '' ) ? + ('' . tainacan_the_item_document_download_link($item_id) . '') + : ''), + 'media_content' => tainacan_get_the_document($item_id), + 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
'), + 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', + 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', + 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', + 'media_type' => tainacan_get_the_document_type($item_id), + 'class_slide_metadata' => $class_slide_metadata + )); + } + + if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { + foreach ( $attachments as $attachment ) { + $media_items_main[] = + tainacan_get_the_media_component_slide(array( + 'after_slide_metadata' => (( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && tainacan_the_item_attachment_download_link($attachment->ID) != '' ) ? + '' . tainacan_the_item_attachment_download_link($attachment->ID) . '' + : ''), + 'media_content' => tainacan_get_attachment_as_html($attachment->ID, $item_id), + 'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
'), + 'media_title' => $attachment->post_title, + 'media_description' => $attachment->post_content, + 'media_caption' => $attachment->post_excerpt, + 'media_type' => $attachment->post_mime_type, + 'class_slide_metadata' => $class_slide_metadata + )); + } + } + } + + if ( isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') ) { + + $class_slide_metadata = ''; + if ($hide_file_name_thumbnails) + $class_slide_metadata .= ' hide-name'; + if ($hide_file_description_thumbnails) + $class_slide_metadata .= ' hide-description'; + if ($hide_file_caption_thumbnails) + $class_slide_metadata .= ' hide-caption'; + + if ( isset($media_sources['document']) && ($media_sources['document'] === true && $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { + $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; + $media_items_thumbnails[] = + tainacan_get_the_media_component_slide(array( + 'media_content' => get_the_post_thumbnail(null, 'tainacan-medium'), + 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
'), + 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', + 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', + 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', + 'media_type' => tainacan_get_the_document_type($item_id), + 'class_slide_metadata' => $class_slide_metadata + )); + } + + if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { + foreach ( $attachments as $attachment ) { + $media_items_thumbnails[] = + tainacan_get_the_media_component_slide(array( + 'media_content' => wp_get_attachment_image( $attachment->ID, 'tainacan-medium', false ), + 'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
'), + 'media_title' => $attachment->post_title, + 'media_description' => $attachment->post_content, + 'media_caption' => $attachment->post_excerpt, + 'media_type' => $attachment->post_mime_type, + 'class_slide_metadata' => $class_slide_metadata + )); + } + } + } + + $block_custom_css = ''; + + // Text color. First we check for custom preset colors, then actual values + $block_custom_css .= isset($args['textColor']) ? ('--tainacan-media-metadata-color: var(--wp--preset--color--' . $args['textColor'] . ');') : ''; + $block_custom_css .= isset($args['style']['color']['text']) ? ('--tainacan-media-metadata-color: ' . $args['style']['color']['text'] . ';') : ''; + + // Background color. First we check for custom preset colors, then actual values + $block_custom_css .= isset($args['backgroundColor']) ? ('--tainacan-media-background: var(--wp--preset--color--' . $args['backgroundColor'] . ');') : ''; + $block_custom_css .= isset($args['style']['color']['background']) ? ('--tainacan-media-background: ' . $args['style']['color']['background'] . ';') : ''; + + // Link color, if enabled. Firts we check for custom preset colors, then actual values. + $block_custom_css .= isset($args['linkColor']) ? ('--swiper-theme-color: var(--wp--preset--color--' . $args['linkColor'] . ');') : ''; + if ( isset($args['style']['elements']['link']['color']['text']) ) { + $link_color = $args['style']['elements']['link']['color']['text']; + if ( strpos( $link_color, 'var:' ) !== false ) { + $link_color = str_replace('|', '--', $link_color); + $link_color = str_replace('var:', 'var(--wp--', $link_color) . ')'; + } + $block_custom_css .= '--swiper-theme-color: ' . $link_color . ';'; + } + + // Other values are obtained directly from the attributes + $block_custom_css .= (isset($args['arrowsSize']) && is_numeric($args['arrowsSize'])) ? ('--swiper-navigation-size: ' . $args['arrowsSize'] . 'px;') : ''; + $block_custom_css .= (isset($args['mainSliderHeight']) && is_numeric($args['mainSliderHeight'])) ? ('--tainacan-media-main-carousel-height: ' . $args['mainSliderHeight'] . 'vh;') : ''; + $block_custom_css .= (isset($args['mainSliderWidth']) && is_numeric($args['mainSliderWidth'])) ? ('--tainacan-media-main-carousel-width: ' . $args['mainSliderWidth'] . '%;') : ''; + $block_custom_css .= (isset($args['thumbnailsCarouselWidth']) && is_numeric($args['thumbnailsCarouselWidth'])) ? ('--tainacan-media-thumbs-carousel-width: ' . $args['thumbnailsCarouselWidth'] . '%;') : ''; + $block_custom_css .= (isset($args['thumbnailsCarouselItemSize']) && is_numeric($args['thumbnailsCarouselItemSize'])) ? ('--tainacan-media-thumbs-carousel-item-size: ' . $args['thumbnailsCarouselItemSize'] . 'px;') : ''; + + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'style' => $block_custom_css, + 'class' => 'tainacan-media-component' + ) + ); + + return tainacan_get_the_media_component( + 'tainacan-item-gallery-block_id-' . $block_id, + (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true')) ? $media_items_thumbnails : null, + (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? $media_items_main : null, + array( + 'wrapper_attributes' => $wrapper_attributes, + 'class_main_div' => '', + 'class_thumbs_div' => '', + 'swiper_main_options' => (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? array( + 'navigation' => array( + 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', + 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', + 'preloadImages' => false, + 'lazy' => true + ) + ) : '', + 'swiper_thumbs_options' => (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') && (!isset($layout_elements['main']) || !($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ) ? array( + 'navigation' => array( + 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', + 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', + 'preloadImages' => false, + 'lazy' => true + ) + ) : '', + 'swiper_arrows_as_svg' => true, + 'disable_lightbox' => !$open_lightbox_on_click, + ) + ); + } } diff --git a/src/classes/theme-helper/template-tags.php b/src/classes/theme-helper/template-tags.php index e406ef3cf..906ea8f72 100644 --- a/src/classes/theme-helper/template-tags.php +++ b/src/classes/theme-helper/template-tags.php @@ -1065,8 +1065,8 @@ function tainacan_get_the_mime_type_icon($mime_type, $image_size = 'medium') { * @param array $args { * Optional. Array of arguments. * @type string $collection_id The Collection ID - * @type string $search_URL A query string to fetch items from, if load strategy is 'search' - * @type array $selected_items An array of item IDs to fetch items from, if load strategy is 'selection' and an array of items, if the load strategy is 'parent' + * @type string $search_URL A query string to fetch items from, if load strategy is 'search' + * @type array $selected_items An array of item IDs to fetch items from, if load strategy is 'selection' and an array of items, if the load strategy is 'parent' * @type string $load_strategy Either 'search' or 'selection', to determine how items will be fetch * @type integer $max_items_number Maximum number of items to be fetch * @type integer $max_tems_per_screen Maximum columns of items to be displayed on a row of the carousel @@ -1075,9 +1075,9 @@ function tainacan_get_the_mime_type_icon($mime_type, $image_size = 'medium') { * @type bool $auto_play Should the Caroulsel start automatically to slide? * @type integer $auto_play_speed The time in s to translate to the next slide automatically * @type bool $loop_slides Should slides loop when reached the end of the Carousel? - * @type bool $hide_title Should the title of the items be displayed? + * @type bool $hide_title Should the title of the items be displayed? * @type bool $crop_images_to_square Should it use the `tainacan-medium-size` instead of the `tainacan-medium-large-size`? - * @type bool $show_collection_header Should it display a small version of the collection header? + * @type bool $show_collection_header Should it display a small version of the collection header? * @type bool $show_collection_label Should it displar a 'Collection' label before the collection name on the collection header? * @type string $collection_background_color Color of the collection header background * @type string $collection_text_color Color of the collection header text @@ -1138,4 +1138,30 @@ function tainacan_has_related_items($item_id = false) { return true; } return false; +} + + +/** + * Renders the content of the item gallery block + * using Tainacan template functions that create + * a Swiper.js carousel and slider, with a PhotoSwipe.js + * lightbox + * + * @param array $args { + * Optional. Array of arguments. + * @type string $item_id The Item ID + * @type string $blockId A unique identifier for the gallery, will be generated automatically if not provided, + * @type array $layoutElements Array of elements present in the gallery. Possible values are 'main' and 'carousel' + * @type array $mediaSources Array of sources for the gallery. Possible values are 'document' and 'attachments' + * @type bool $hideFileNameMain Hides the Main slider file name + * @type bool $hideFileCaptionMain Hides the Main slider file caption + * @type bool $hideFileDescriptionMain Hides the Main slider file description + * @type bool $hideFileNameThumbnails Hides the Thumbnails carousel file name + * @type bool $hideFileCaptionThumbnails Hides the Thumbnails carousel file caption + * @type bool $hideFileDescriptionThumbnails Hides the Thumbnails carousel file description + * @type bool $openLightboxOnClick Enables the behaviour of opening a lightbox with zoom when clicking on the media item + * @return void + */ +function tainacan_the_item_gallery($args = []) { + echo \Tainacan\Theme_Helper::get_instance()->get_tainacan_item_gallery($args); } \ No newline at end of file diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/save.php b/src/views/gutenberg-blocks/blocks/item-gallery/save.php index de63edf82..a506f7e00 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/save.php +++ b/src/views/gutenberg-blocks/blocks/item-gallery/save.php @@ -7,182 +7,5 @@ * lightbox */ function tainacan_blocks_render_items_gallery( $block_attributes, $content ) { - - if ( !isset($block_attributes['itemId']) ) - return ''; - - // Gets options from block attributes - $item_id = $block_attributes['itemId']; - $block_id = $block_attributes['blockId']; - $layout_elements = isset($block_attributes['layoutElements']) ? $block_attributes['layoutElements'] : array('main' => true, 'thumbnails' => true); - $media_sources = isset($block_attributes['mediaSources']) ? $block_attributes['mediaSources'] : array( 'document' => true, 'attachments' => true, 'metadata' => false); - $hide_file_name_main = isset($block_attributes['hideFileNameMain']) ? $block_attributes['hideFileNameMain'] : true; - $hide_file_caption_main = isset($block_attributes['hideFileCaptionMain']) ? $block_attributes['hideFileCaptionMain'] : false; - $hide_file_description_main = isset($block_attributes['hideFileDescriptionMain']) ? $block_attributes['hideFileDescriptionMain'] : true; - $hide_file_name_thumbnails = isset($block_attributes['hideFileNameThumbnails']) ? $block_attributes['hideFileNameThumbnails'] : true; - $hide_file_caption_thumbnails = isset($block_attributes['hideFileCaptionThumbnails']) ? $block_attributes['hideFileCaptionThumbnails'] : true; - $hide_file_description_thumbnails = isset($block_attributes['hideFileDescriptionThumbnails']) ? $block_attributes['hideFileDescriptionThumbnails'] : true; - $open_lightbox_on_click = isset($block_attributes['openLightboxOnClick']) ? $block_attributes['openLightboxOnClick'] : true; - - $media_items_main = array(); - $media_items_thumbnails = array(); - - if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) - $attachments = tainacan_get_the_attachments(null, $item_id); - - if ( isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true') ) { - - $class_slide_metadata = ''; - if ($hide_file_name_main) - $class_slide_metadata .= ' hide-name'; - if ($hide_file_description_main) - $class_slide_metadata .= ' hide-description'; - if ($hide_file_caption_main) - $class_slide_metadata .= ' hide-caption'; - - if ( isset($media_sources['document']) && ($media_sources['document'] === true || $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { - $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; - $media_items_main[] = - tainacan_get_the_media_component_slide(array( - 'after_slide_metadata' => (( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && tainacan_the_item_document_download_link($item_id) != '' ) ? - ('' . tainacan_the_item_document_download_link($item_id) . '') - : ''), - 'media_content' => tainacan_get_the_document($item_id), - 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
'), - 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', - 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', - 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', - 'media_type' => tainacan_get_the_document_type($item_id), - 'class_slide_metadata' => $class_slide_metadata - )); - } - - if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { - foreach ( $attachments as $attachment ) { - $media_items_main[] = - tainacan_get_the_media_component_slide(array( - 'after_slide_metadata' => (( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && tainacan_the_item_attachment_download_link($attachment->ID) != '' ) ? - '' . tainacan_the_item_attachment_download_link($attachment->ID) . '' - : ''), - 'media_content' => tainacan_get_attachment_as_html($attachment->ID, $item_id), - 'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
'), - 'media_title' => $attachment->post_title, - 'media_description' => $attachment->post_content, - 'media_caption' => $attachment->post_excerpt, - 'media_type' => $attachment->post_mime_type, - 'class_slide_metadata' => $class_slide_metadata - )); - } - } - } - - if ( isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') ) { - - $class_slide_metadata = ''; - if ($hide_file_name_thumbnails) - $class_slide_metadata .= ' hide-name'; - if ($hide_file_description_thumbnails) - $class_slide_metadata .= ' hide-description'; - if ($hide_file_caption_thumbnails) - $class_slide_metadata .= ' hide-caption'; - - if ( isset($media_sources['document']) && ($media_sources['document'] === true && $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { - $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; - $media_items_thumbnails[] = - tainacan_get_the_media_component_slide(array( - 'media_content' => get_the_post_thumbnail(null, 'tainacan-medium'), - 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
'), - 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', - 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', - 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', - 'media_type' => tainacan_get_the_document_type($item_id), - 'class_slide_metadata' => $class_slide_metadata - )); - } - - if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { - foreach ( $attachments as $attachment ) { - $media_items_thumbnails[] = - tainacan_get_the_media_component_slide(array( - 'media_content' => wp_get_attachment_image( $attachment->ID, 'tainacan-medium', false ), - 'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
'), - 'media_title' => $attachment->post_title, - 'media_description' => $attachment->post_content, - 'media_caption' => $attachment->post_excerpt, - 'media_type' => $attachment->post_mime_type, - 'class_slide_metadata' => $class_slide_metadata - )); - } - } - } - - $block_custom_css = ''; - - // Text color. First we check for custom preset colors, then actual values - $block_custom_css .= isset($block_attributes['textColor']) ? ('--tainacan-media-metadata-color: var(--wp--preset--color--' . $block_attributes['textColor'] . ');') : ''; - $block_custom_css .= (isset($block_attributes['style']) && isset($block_attributes['style']['color']) && isset($block_attributes['style']['color']['text'])) ? ('--tainacan-media-metadata-color: ' . $block_attributes['style']['color']['text'] . ';') : ''; - - // Background color. First we check for custom preset colors, then actual values - $block_custom_css .= isset($block_attributes['backgroundColor']) ? ('--tainacan-media-background: var(--wp--preset--color--' . $block_attributes['backgroundColor'] . ');') : ''; - $block_custom_css .= (isset($block_attributes['style']) && isset($block_attributes['style']['color']) && isset($block_attributes['style']['color']['background'])) ? ('--tainacan-media-background: ' . $block_attributes['style']['color']['background'] . ';') : ''; - - // Link color, if enabled. Firts we check for custom preset colors, then actual values. - $block_custom_css .= isset($block_attributes['linkColor']) ? ('--swiper-theme-color: var(--wp--preset--color--' . $block_attributes['linkColor'] . ');') : ''; - if ( - isset($block_attributes['style']) && - isset($block_attributes['style']['elements']) && - isset($block_attributes['style']['elements']['link']) && - isset($block_attributes['style']['elements']['link']['color']) && - isset($block_attributes['style']['elements']['link']['color']['text']) - ) { - $link_color = $block_attributes['style']['elements']['link']['color']['text']; - if ( strpos( $link_color, 'var:' ) !== false ) { - $link_color = str_replace('|', '--', $link_color); - $link_color = str_replace('var:', 'var(--wp--', $link_color) . ')'; - } - $block_custom_css .= '--swiper-theme-color: ' . $link_color . ';'; - } - - // Other values are obtained directly from the attributes - $block_custom_css .= (isset($block_attributes['arrowsSize']) && is_numeric($block_attributes['arrowsSize'])) ? ('--swiper-navigation-size: ' . $block_attributes['arrowsSize'] . 'px;') : ''; - $block_custom_css .= (isset($block_attributes['mainSliderHeight']) && is_numeric($block_attributes['mainSliderHeight'])) ? ('--tainacan-media-main-carousel-height: ' . $block_attributes['mainSliderHeight'] . 'vh;') : ''; - $block_custom_css .= (isset($block_attributes['mainSliderWidth']) && is_numeric($block_attributes['mainSliderWidth'])) ? ('--tainacan-media-main-carousel-width: ' . $block_attributes['mainSliderWidth'] . '%;') : ''; - $block_custom_css .= (isset($block_attributes['thumbnailsCarouselWidth']) && is_numeric($block_attributes['thumbnailsCarouselWidth'])) ? ('--tainacan-media-thumbs-carousel-width: ' . $block_attributes['thumbnailsCarouselWidth'] . '%;') : ''; - $block_custom_css .= (isset($block_attributes['thumbnailsCarouselItemSize']) && is_numeric($block_attributes['thumbnailsCarouselItemSize'])) ? ('--tainacan-media-thumbs-carousel-item-size: ' . $block_attributes['thumbnailsCarouselItemSize'] . 'px;') : ''; - - $wrapper_attributes = get_block_wrapper_attributes( - array( - 'style' => $block_custom_css, - 'class' => 'tainacan-media-component' - ) - ); - - return tainacan_get_the_media_component( - 'tainacan-item-gallery-block_id-' . $block_id, - (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true')) ? $media_items_thumbnails : null, - (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? $media_items_main : null, - array( - 'wrapper_attributes' => $wrapper_attributes, - 'class_main_div' => '', - 'class_thumbs_div' => '', - 'swiper_main_options' => (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? array( - 'navigation' => array( - 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', - 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', - 'preloadImages' => false, - 'lazy' => true - ) - ) : '', - 'swiper_thumbs_options' => (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') && (!isset($layout_elements['main']) || !($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ) ? array( - 'navigation' => array( - 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', - 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', - 'preloadImages' => false, - 'lazy' => true - ) - ) : '', - 'swiper_arrows_as_svg' => true, - 'disable_lightbox' => !$open_lightbox_on_click, - ) - ); + return \Tainacan\Theme_Helper::get_instance()->get_tainacan_item_gallery($block_attributes); } \ No newline at end of file From b88a579c37661f0b66dc23c24f140940695170ef Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 10 Mar 2022 12:04:05 -0300 Subject: [PATCH 12/13] Adds option do show download button. Better PHP. Avoids passing full content when not necessary. #674. --- .../class-tainacan-theme-helper.php | 61 +++++++++++++------ src/classes/theme-helper/template-tags.php | 7 ++- .../blocks/item-gallery/block.json | 4 ++ .../blocks/item-gallery/edit.js | 12 +++- 4 files changed, 62 insertions(+), 22 deletions(-) diff --git a/src/classes/theme-helper/class-tainacan-theme-helper.php b/src/classes/theme-helper/class-tainacan-theme-helper.php index 904b68798..a8d471427 100644 --- a/src/classes/theme-helper/class-tainacan-theme-helper.php +++ b/src/classes/theme-helper/class-tainacan-theme-helper.php @@ -1122,13 +1122,14 @@ class Theme_Helper { * @type bool $hideFileCaptionThumbnails Hides the Thumbnails carousel file caption * @type bool $hideFileDescriptionThumbnails Hides the Thumbnails carousel file description * @type bool $openLightboxOnClick Enables the behaviour of opening a lightbox with zoom when clicking on the media item + * @type bool $showDownloadButtonMain Displays a download button bellow the Main slider * @return string The HTML div to be used for rendering the item galery component */ public function get_tainacan_item_gallery($args = []) { $defaults = array( 'blockId' => uniqid(), - 'layoutElements' => array('main' => true, 'thumbnails' => true), + 'layoutElements' => array( 'main' => true, 'thumbnails' => true ), 'mediaSources' => array( 'document' => true, 'attachments' => true, 'metadata' => false), 'hideFileNameMain' => true, 'hideFileCaptionMain' => false, @@ -1136,7 +1137,8 @@ class Theme_Helper { 'hideFileNameThumbnails' => true, 'hideFileCaptionThumbnails' => true, 'hideFileDescriptionThumbnails' => true, - 'openLightboxOnClick' => true + 'openLightboxOnClick' => true, + 'showDownloadButtonMain' => true ); $args = wp_parse_args($args, $defaults); @@ -1157,14 +1159,26 @@ class Theme_Helper { $hide_file_caption_thumbnails = $args['hideFileCaptionThumbnails']; $hide_file_description_thumbnails = $args['hideFileDescriptionThumbnails']; $open_lightbox_on_click = $args['openLightboxOnClick']; + $show_download_button_main = $args['showDownloadButtonMain']; + + // Prefils arrays with proper values to avoid messsy IFs + $layout_elements = array( + 'main' => (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? true : false, + 'thumbnails' => (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true')) ? true : false + ); + $media_sources = array( + 'document' => (isset($media_sources['document']) && ($media_sources['document'] === true || $media_sources['document'] == 'true')) ? true : false, + 'attachments' => (isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true')) ? true : false, + 'metadata' => (isset($media_sources['metadata']) && ($media_sources['metadata'] === true || $media_sources['metadata'] == 'true')) ? true : false + ); $media_items_main = array(); $media_items_thumbnails = array(); - if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) + if ( $media_sources['attachments'] ) $attachments = tainacan_get_the_attachments(null, $item_id); - if ( isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true') ) { + if ( $layout_elements['main'] ) { $class_slide_metadata = ''; if ($hide_file_name_main) @@ -1174,32 +1188,39 @@ class Theme_Helper { if ($hide_file_caption_main) $class_slide_metadata .= ' hide-caption'; - if ( isset($media_sources['document']) && ($media_sources['document'] === true || $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { + if ( $media_sources['document'] && !empty(tainacan_get_the_document($item_id)) ) { $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; + + // Document description is a bit more tricky + if ($is_document_type_attachment) { + $attachment = get_post(tainacan_get_the_document_raw($item_id)); + $document_description = ($attachment instanceof WP_Post) ? $attachment->post_content : ''; + } + $media_items_main[] = tainacan_get_the_media_component_slide(array( - 'after_slide_metadata' => (( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && tainacan_the_item_document_download_link($item_id) != '' ) ? + 'after_slide_metadata' => (( $show_download_button_main && tainacan_the_item_document_download_link($item_id) != '' ) ? ('' . tainacan_the_item_document_download_link($item_id) . '') : ''), 'media_content' => tainacan_get_the_document($item_id), - 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
'), + 'media_content_full' => $open_lightbox_on_click ? ( $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
') ) : '', 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', - 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', + 'media_description' => $is_document_type_attachment ? $document_description : '', 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', 'media_type' => tainacan_get_the_document_type($item_id), 'class_slide_metadata' => $class_slide_metadata )); } - if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { + if ( $media_sources['attachments'] ) { foreach ( $attachments as $attachment ) { $media_items_main[] = tainacan_get_the_media_component_slide(array( - 'after_slide_metadata' => (( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && tainacan_the_item_attachment_download_link($attachment->ID) != '' ) ? + 'after_slide_metadata' => (( $show_download_button_main && tainacan_the_item_attachment_download_link($attachment->ID) != '' ) ? '' . tainacan_the_item_attachment_download_link($attachment->ID) . '' : ''), 'media_content' => tainacan_get_attachment_as_html($attachment->ID, $item_id), - 'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
'), + 'media_content_full' => $open_lightbox_on_click ? ( wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
') ) : '', 'media_title' => $attachment->post_title, 'media_description' => $attachment->post_content, 'media_caption' => $attachment->post_excerpt, @@ -1210,7 +1231,7 @@ class Theme_Helper { } } - if ( isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') ) { + if ( $layout_elements['thumbnails'] ) { $class_slide_metadata = ''; if ($hide_file_name_thumbnails) @@ -1220,12 +1241,12 @@ class Theme_Helper { if ($hide_file_caption_thumbnails) $class_slide_metadata .= ' hide-caption'; - if ( isset($media_sources['document']) && ($media_sources['document'] === true && $media_sources['document'] == 'true') && !empty(tainacan_get_the_document($item_id)) ) { + if ( $media_sources['document'] && !empty(tainacan_get_the_document($item_id)) ) { $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; $media_items_thumbnails[] = tainacan_get_the_media_component_slide(array( 'media_content' => get_the_post_thumbnail(null, 'tainacan-medium'), - 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
'), + 'media_content_full' => $open_lightbox_on_click ? ($is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
') ) : '', 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', @@ -1234,12 +1255,12 @@ class Theme_Helper { )); } - if ( isset($media_sources['attachments']) && ($media_sources['attachments'] === true || $media_sources['attachments'] == 'true') ) { + if ( $media_sources['attachments'] ) { foreach ( $attachments as $attachment ) { $media_items_thumbnails[] = tainacan_get_the_media_component_slide(array( 'media_content' => wp_get_attachment_image( $attachment->ID, 'tainacan-medium', false ), - 'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
'), + 'media_content_full' => ( $open_lightbox_on_click && !$layout_elements['main'] ) ? ( wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
') ) : '', 'media_title' => $attachment->post_title, 'media_description' => $attachment->post_content, 'media_caption' => $attachment->post_excerpt, @@ -1287,13 +1308,13 @@ class Theme_Helper { return tainacan_get_the_media_component( 'tainacan-item-gallery-block_id-' . $block_id, - (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true')) ? $media_items_thumbnails : null, - (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? $media_items_main : null, + $layout_elements['thumbnails'] ? $media_items_thumbnails : null, + $layout_elements['main'] ? $media_items_main : null, array( 'wrapper_attributes' => $wrapper_attributes, 'class_main_div' => '', 'class_thumbs_div' => '', - 'swiper_main_options' => (isset($layout_elements['main']) && ($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ? array( + 'swiper_main_options' => $layout_elements['main'] ? array( 'navigation' => array( 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', @@ -1301,7 +1322,7 @@ class Theme_Helper { 'lazy' => true ) ) : '', - 'swiper_thumbs_options' => (isset($layout_elements['thumbnails']) && ($layout_elements['thumbnails'] === true || $layout_elements['thumbnails'] == 'true') && (!isset($layout_elements['main']) || !($layout_elements['main'] === true || $layout_elements['main'] == 'true')) ) ? array( + 'swiper_thumbs_options' => ( $layout_elements['thumbnails'] && !$layout_elements['main'] ) ? array( 'navigation' => array( 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', diff --git a/src/classes/theme-helper/template-tags.php b/src/classes/theme-helper/template-tags.php index 906ea8f72..9e977e7e3 100644 --- a/src/classes/theme-helper/template-tags.php +++ b/src/classes/theme-helper/template-tags.php @@ -298,6 +298,7 @@ function tainacan_the_media_component($media_id, $media_items_thumbs, $media_ite * @type bool swiper_arrows_as_svg Uses SVG icons insetead of Tainacan Icon font for navigation arrows * @type string swiper_arrow_next_custom_svg Custom SVG icon to render next navigation arrow * @type string swiper_arrow_prev_custom_svg Custom SVG icon to render previous navigation arrow + * @type bool disable_lightbox Do not open Photoswiper layer on click * @type bool show_share_button Shows share button on lightbox * } * @return string @@ -332,6 +333,7 @@ function tainacan_get_the_media_component( 'swiper_arrows_as_svg' => false, 'swiper_arrow_next_custom_svg' => '', 'swiper_arrow_prev_custom_svg' => '', + 'disable_lightbox' => false, 'show_share_button' => false ), $args); @@ -344,8 +346,10 @@ function tainacan_get_the_media_component( ob_start(); if ( $args['has_media_main'] || $args['has_media_thumbs'] ) : + // Modal lightbox layer for rendering photoswipe - add_action('wp_footer', 'tainacan_get_the_media_modal_layer'); + if (!$args['disable_lightbox']) + add_action('wp_footer', 'tainacan_get_the_media_modal_layer'); wp_enqueue_style( 'tainacan-media-component', $TAINACAN_BASE_URL . '/assets/css/tainacan-gutenberg-block-item-gallery.css', array(), TAINACAN_VERSION); @@ -1160,6 +1164,7 @@ function tainacan_has_related_items($item_id = false) { * @type bool $hideFileCaptionThumbnails Hides the Thumbnails carousel file caption * @type bool $hideFileDescriptionThumbnails Hides the Thumbnails carousel file description * @type bool $openLightboxOnClick Enables the behaviour of opening a lightbox with zoom when clicking on the media item + * @type bool $showDownloadButtonMain Displays a download button bellow the Main slider * @return void */ function tainacan_the_item_gallery($args = []) { diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/block.json b/src/views/gutenberg-blocks/blocks/item-gallery/block.json index d4e113aab..df6c4e4f8 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/block.json +++ b/src/views/gutenberg-blocks/blocks/item-gallery/block.json @@ -96,6 +96,10 @@ "thumbnailsCarouselItemSize": { "type": "integer", "default": 136 + }, + "showDownloadButtonMain": { + "type": "boolean", + "default": false } }, "supports": { diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js index 4886cc9cc..ed55f88c9 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js +++ b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js @@ -27,7 +27,8 @@ export default function ({ attributes, setAttributes, className, isSelected, cli mainSliderHeight, mainSliderWidth, thumbnailsCarouselWidth, - thumbnailsCarouselItemSize + thumbnailsCarouselItemSize, + showDownloadButtonMain } = attributes; // Gets blocks props from hook @@ -178,6 +179,15 @@ export default function ({ attributes, setAttributes, className, isSelected, cli } } /> + { + showDownloadButtonMain = isChecked; + setAttributes({ showDownloadButtonMain: showDownloadButtonMain }); + } + } + /> : null } { layoutElements['thumbnails'] === true ? From d0d77184a7be55426b79b07025ecd967e2c84ede Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 10 Mar 2022 17:05:02 -0300 Subject: [PATCH 13/13] Replaces string concatenations by sprintf. #674. --- .../class-tainacan-theme-helper.php | 42 +++++++++---------- .../blocks/item-gallery/edit.js | 2 + 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/classes/theme-helper/class-tainacan-theme-helper.php b/src/classes/theme-helper/class-tainacan-theme-helper.php index a8d471427..daac2a508 100644 --- a/src/classes/theme-helper/class-tainacan-theme-helper.php +++ b/src/classes/theme-helper/class-tainacan-theme-helper.php @@ -1200,10 +1200,10 @@ class Theme_Helper { $media_items_main[] = tainacan_get_the_media_component_slide(array( 'after_slide_metadata' => (( $show_download_button_main && tainacan_the_item_document_download_link($item_id) != '' ) ? - ('' . tainacan_the_item_document_download_link($item_id) . '') + sprintf('%s', tainacan_the_item_document_download_link($item_id)) : ''), 'media_content' => tainacan_get_the_document($item_id), - 'media_content_full' => $open_lightbox_on_click ? ( $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
') ) : '', + 'media_content_full' => $open_lightbox_on_click ? ( $is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : sprintf('
%s
', tainacan_get_the_document($item_id, 'full')) ) : '', 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', 'media_description' => $is_document_type_attachment ? $document_description : '', 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', @@ -1217,10 +1217,10 @@ class Theme_Helper { $media_items_main[] = tainacan_get_the_media_component_slide(array( 'after_slide_metadata' => (( $show_download_button_main && tainacan_the_item_attachment_download_link($attachment->ID) != '' ) ? - '' . tainacan_the_item_attachment_download_link($attachment->ID) . '' + sprintf('%s', tainacan_the_item_attachment_download_link($attachment->ID)) : ''), 'media_content' => tainacan_get_attachment_as_html($attachment->ID, $item_id), - 'media_content_full' => $open_lightbox_on_click ? ( wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
') ) : '', + 'media_content_full' => $open_lightbox_on_click ? ( wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : sprintf('
', $block_id, tainacan_get_attachment_html_url($attachment->ID)) ) : '', 'media_title' => $attachment->post_title, 'media_description' => $attachment->post_content, 'media_caption' => $attachment->post_excerpt, @@ -1246,7 +1246,7 @@ class Theme_Helper { $media_items_thumbnails[] = tainacan_get_the_media_component_slide(array( 'media_content' => get_the_post_thumbnail(null, 'tainacan-medium'), - 'media_content_full' => $open_lightbox_on_click ? ($is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : ('
' . tainacan_get_the_document($item_id, 'full') . '
') ) : '', + 'media_content_full' => $open_lightbox_on_click ? ($is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : sprintf('
%s
', tainacan_get_the_document($item_id, 'full')) ) : '', 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '', 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '', @@ -1260,7 +1260,7 @@ class Theme_Helper { $media_items_thumbnails[] = tainacan_get_the_media_component_slide(array( 'media_content' => wp_get_attachment_image( $attachment->ID, 'tainacan-medium', false ), - 'media_content_full' => ( $open_lightbox_on_click && !$layout_elements['main'] ) ? ( wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : ('
') ) : '', + 'media_content_full' => ( $open_lightbox_on_click && !$layout_elements['main'] ) ? ( wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image( $attachment->ID, 'full', false) : sprintf('
', $block_id, tainacan_get_attachment_html_url($attachment->ID)) ) : '', 'media_title' => $attachment->post_title, 'media_description' => $attachment->post_content, 'media_caption' => $attachment->post_excerpt, @@ -1274,30 +1274,30 @@ class Theme_Helper { $block_custom_css = ''; // Text color. First we check for custom preset colors, then actual values - $block_custom_css .= isset($args['textColor']) ? ('--tainacan-media-metadata-color: var(--wp--preset--color--' . $args['textColor'] . ');') : ''; - $block_custom_css .= isset($args['style']['color']['text']) ? ('--tainacan-media-metadata-color: ' . $args['style']['color']['text'] . ';') : ''; + $block_custom_css .= isset($args['textColor']) ? sprintf('--tainacan-media-metadata-color: var(--wp--preset--color--%s);', $args['textColor']) : ''; + $block_custom_css .= isset($args['style']['color']['text']) ? sprintf('--tainacan-media-metadata-color: %s;', $args['style']['color']['text']) : ''; // Background color. First we check for custom preset colors, then actual values - $block_custom_css .= isset($args['backgroundColor']) ? ('--tainacan-media-background: var(--wp--preset--color--' . $args['backgroundColor'] . ');') : ''; - $block_custom_css .= isset($args['style']['color']['background']) ? ('--tainacan-media-background: ' . $args['style']['color']['background'] . ';') : ''; + $block_custom_css .= isset($args['backgroundColor']) ? sprintf('--tainacan-media-background: var(--wp--preset--color--%s);', $args['backgroundColor']) : ''; + $block_custom_css .= isset($args['style']['color']['background']) ? sprintf('--tainacan-media-background: %s;', $args['style']['color']['background']) : ''; // Link color, if enabled. Firts we check for custom preset colors, then actual values. - $block_custom_css .= isset($args['linkColor']) ? ('--swiper-theme-color: var(--wp--preset--color--' . $args['linkColor'] . ');') : ''; + $block_custom_css .= isset($args['linkColor']) ? sprintf('--swiper-theme-color: var(--wp--preset--color--%s);', $args['linkColor']) : ''; if ( isset($args['style']['elements']['link']['color']['text']) ) { $link_color = $args['style']['elements']['link']['color']['text']; if ( strpos( $link_color, 'var:' ) !== false ) { $link_color = str_replace('|', '--', $link_color); $link_color = str_replace('var:', 'var(--wp--', $link_color) . ')'; } - $block_custom_css .= '--swiper-theme-color: ' . $link_color . ';'; + $block_custom_css .= sprintf('--swiper-theme-color: %s;', $link_color); } // Other values are obtained directly from the attributes - $block_custom_css .= (isset($args['arrowsSize']) && is_numeric($args['arrowsSize'])) ? ('--swiper-navigation-size: ' . $args['arrowsSize'] . 'px;') : ''; - $block_custom_css .= (isset($args['mainSliderHeight']) && is_numeric($args['mainSliderHeight'])) ? ('--tainacan-media-main-carousel-height: ' . $args['mainSliderHeight'] . 'vh;') : ''; - $block_custom_css .= (isset($args['mainSliderWidth']) && is_numeric($args['mainSliderWidth'])) ? ('--tainacan-media-main-carousel-width: ' . $args['mainSliderWidth'] . '%;') : ''; - $block_custom_css .= (isset($args['thumbnailsCarouselWidth']) && is_numeric($args['thumbnailsCarouselWidth'])) ? ('--tainacan-media-thumbs-carousel-width: ' . $args['thumbnailsCarouselWidth'] . '%;') : ''; - $block_custom_css .= (isset($args['thumbnailsCarouselItemSize']) && is_numeric($args['thumbnailsCarouselItemSize'])) ? ('--tainacan-media-thumbs-carousel-item-size: ' . $args['thumbnailsCarouselItemSize'] . 'px;') : ''; + $block_custom_css .= (isset($args['arrowsSize']) && is_numeric($args['arrowsSize'])) ? sprintf('--swiper-navigation-size: %spx;', $args['arrowsSize']) : ''; + $block_custom_css .= (isset($args['mainSliderHeight']) && is_numeric($args['mainSliderHeight'])) ? sprintf('--tainacan-media-main-carousel-height: %svh;', $args['mainSliderHeight']) : ''; + $block_custom_css .= (isset($args['mainSliderWidth']) && is_numeric($args['mainSliderWidth'])) ? sprintf('--tainacan-media-main-carousel-width: %s%%;', $args['mainSliderWidth']) : ''; + $block_custom_css .= (isset($args['thumbnailsCarouselWidth']) && is_numeric($args['thumbnailsCarouselWidth'])) ? sprintf('--tainacan-media-thumbs-carousel-width: %s%%;', $args['thumbnailsCarouselWidth']) : ''; + $block_custom_css .= (isset($args['thumbnailsCarouselItemSize']) && is_numeric($args['thumbnailsCarouselItemSize'])) ? sprintf('--tainacan-media-thumbs-carousel-item-size: %spx;', $args['thumbnailsCarouselItemSize']) : ''; $wrapper_attributes = get_block_wrapper_attributes( array( @@ -1316,16 +1316,16 @@ class Theme_Helper { 'class_thumbs_div' => '', 'swiper_main_options' => $layout_elements['main'] ? array( 'navigation' => array( - 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', - 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-main', + 'nextEl' => sprintf('.swiper-navigation-next_tainacan-item-gallery-block_id-%s-main', $block_id), + 'prevEl' => sprintf('.swiper-navigation-prev_tainacan-item-gallery-block_id-%s-main', $block_id), 'preloadImages' => false, 'lazy' => true ) ) : '', 'swiper_thumbs_options' => ( $layout_elements['thumbnails'] && !$layout_elements['main'] ) ? array( 'navigation' => array( - 'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', - 'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-gallery-block_id-' . $block_id . '-thumbs', + 'nextEl' => sprintf('.swiper-navigation-next_tainacan-item-gallery-block_id-%s-thumbs', $block_id), + 'prevEl' => sprintf('.swiper-navigation-prev_tainacan-item-gallery-block_id-%s-thumbs', $block_id), 'preloadImages' => false, 'lazy' => true ) diff --git a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js index ed55f88c9..aa1a574a1 100644 --- a/src/views/gutenberg-blocks/blocks/item-gallery/edit.js +++ b/src/views/gutenberg-blocks/blocks/item-gallery/edit.js @@ -33,6 +33,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli // Gets blocks props from hook const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : 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 setAttributes({ blockId: clientId }); @@ -317,6 +318,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli = '5.5' ? 'POST' : 'GET' } />
) : null