From 762eb5df9b79ddc2deed4e965d38a9d351b55927 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Wed, 24 Jul 2019 17:02:25 -0300 Subject: [PATCH 001/104] Begins implementation of search bar gutenberg block. --- .../class-tainacan-gutenberg-block.php | 25 + .../tainacan-items/search-bar/index.js | 562 ++++++++++++++++++ .../search-bar/search-bar-modal.js | 280 +++++++++ .../tainacan-items/search-bar/search-bar.scss | 371 ++++++++++++ webpack.config.js | 11 +- 5 files changed, 1246 insertions(+), 3 deletions(-) create mode 100644 src/gutenberg-blocks/tainacan-items/search-bar/index.js create mode 100644 src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js create mode 100644 src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss diff --git a/src/gutenberg-blocks/class-tainacan-gutenberg-block.php b/src/gutenberg-blocks/class-tainacan-gutenberg-block.php index 0f0e1dab4..e23127c0d 100644 --- a/src/gutenberg-blocks/class-tainacan-gutenberg-block.php +++ b/src/gutenberg-blocks/class-tainacan-gutenberg-block.php @@ -17,6 +17,7 @@ function tainacan_blocks_add_gutenberg_blocks_actions() { add_action('init', 'tainacan_blocks_register_tainacan_items_list'); add_action('init', 'tainacan_blocks_register_tainacan_dynamic_items_list'); add_action('init', 'tainacan_blocks_register_tainacan_carousel_items_list'); + add_action('init', 'tainacan_blocks_register_tainacan_search_bar'); add_action('init', 'tainacan_blocks_register_tainacan_collections_list'); add_action('init', 'tainacan_blocks_register_tainacan_facets_list'); @@ -174,6 +175,29 @@ function tainacan_blocks_register_tainacan_carousel_items_list(){ } } +function tainacan_blocks_register_tainacan_search_bar(){ + global $TAINACAN_BASE_URL; + + wp_register_script( + 'search-bar', + $TAINACAN_BASE_URL . '/assets/gutenberg_search_bar-components.js', + array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor') + ); + + wp_register_style( + 'search-bar', + $TAINACAN_BASE_URL . '/assets/css/tainacan-gutenberg-block-search-bar.css', + array('wp-edit-blocks') + ); + + if (function_exists('register_block_type')) { + register_block_type( 'tainacan/search-bar', array( + 'editor_script' => 'search-bar', + 'style' => 'search-bar' + ) ); + } +} + function tainacan_blocks_register_tainacan_collections_list(){ global $TAINACAN_BASE_URL; @@ -220,6 +244,7 @@ function tainacan_blocks_add_plugin_settings() { wp_localize_script( 'items-list', 'tainacan_plugin', $settings ); wp_localize_script( 'dynamic-items-list', 'tainacan_plugin', $settings ); wp_localize_script( 'carousel-items-list', 'tainacan_plugin', $settings ); + wp_localize_script( 'search-bar', 'tainacan_plugin', $settings ); wp_localize_script( 'collections-list', 'tainacan_plugin', $settings ); wp_localize_script( 'facets-list', 'tainacan_plugin', $settings ); } diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js new file mode 100644 index 000000000..4a7995065 --- /dev/null +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -0,0 +1,562 @@ +const { registerBlockType } = wp.blocks; + +const { __ } = wp.i18n; + +const { RangeControl, TextControl, Spinner, Button, ToggleControl, Tooltip, Placeholder, Toolbar, ColorPicker, ColorPalette, BaseControl, Panel, PanelBody, PanelRow } = wp.components; + +const { InspectorControls } = wp.editor; + +import SearchBarModal from './search-bar-modal.js'; +import tainacan from '../../api-client/axios.js'; +import axios from 'axios'; +import qs from 'qs'; + +registerBlockType('tainacan/search-bar', { + title: __('Tainacan Search Bar', 'tainacan'), + icon: + + + , + category: 'tainacan-blocks', + keywords: [ __( 'items', 'tainacan' ), __( 'search', 'tainacan' ), __( 'bar', 'tainacan' ) ], + attributes: { + content: { + type: 'array', + source: 'children', + selector: 'div' + }, + collectionId: { + type: String, + default: undefined + }, + collectionSlug: { + type: String, + default: undefined + }, + items: { + type: Array, + default: [] + }, + showImage: { + type: Boolean, + default: true + }, + showName: { + type: Boolean, + default: true + }, + isModalOpen: { + type: Boolean, + default: false + }, + gridMargin: { + type: Number, + default: 0 + }, + searchURL: { + type: String, + default: undefined + }, + itemsRequestSource: { + type: String, + default: undefined + }, + maxItemsNumber: { + type: Number, + value: undefined + }, + isLoading: { + type: Boolean, + value: false + }, + isLoadingCollection: { + type: Boolean, + value: false + }, + showSearchBar: { + type: Boolean, + value: false + }, + showCollectionHeader: { + type: Boolean, + value: false + }, + showCollectionLabel: { + type: Boolean, + value: false + }, + collection: { + type: Object, + value: undefined + }, + searchString: { + type: String, + default: undefined + }, + order: { + type: String, + default: undefined + }, + blockId: { + type: String, + default: undefined + }, + collectionBackgroundColor: { + type: String, + default: "#454647" + }, + collectionTextColor: { + type: String, + default: "#ffffff" + } + }, + supports: { + align: ['full', 'wide'], + html: false, + }, + edit({ attributes, setAttributes, className, isSelected, clientId }){ + let { + items, + content, + collectionId, + collectionSlug, + showImage, + showName, + isModalOpen, + gridMargin, + searchURL, + itemsRequestSource, + maxItemsNumber, + order, + searchString, + isLoading, + showSearchBar, + showCollectionHeader, + showCollectionLabel, + isLoadingCollection, + collection, + collectionBackgroundColor, + collectionTextColor + } = attributes; + + // Obtains block's client id to render it on save function + setAttributes({ blockId: clientId }); + + function setContent(){ + + setAttributes({ + content: ( +
+
+ + +
+
+ ) + }); + + } + + function fetchCollectionForHeader() { + if (showCollectionHeader) { + + isLoadingCollection = true; + setAttributes({ + isLoadingCollection: isLoadingCollection + }); + + tainacan.get('/collections/' + collectionId + '?fetch_only=name,thumbnail,header_image') + .then(response => { + collection = response.data; + isLoadingCollection = false; + + if (collection.tainacan_theme_collection_background_color) + collectionBackgroundColor = collection.tainacan_theme_collection_background_color; + else + collectionBackgroundColor = '#454647'; + + if (collection.tainacan_theme_collection_color) + collectionTextColor = collection.tainacan_theme_collection_color; + else + collectionTextColor = '#ffffff'; + + setAttributes({ + content:
, + collection: collection, + isLoadingCollection: isLoadingCollection, + collectionBackgroundColor: collectionBackgroundColor, + collectionTextColor: collectionTextColor + }); + }); + } + } + + function openSearchBarModal() { + isModalOpen = true; + setAttributes( { + isModalOpen: isModalOpen + } ); + } + + function applySearchString(event) { + + let value = event.target.value; + + if (searchString != value) { + searchString = value; + setAttributes({ searchString: searchString }); + setContent(); + } + } + + // Executed only on the first load of page + if(content && content.length && content[0].type) + setContent(); + + return ( +
+ +
+ + + + { + showCollectionHeader = isChecked; + if (isChecked) fetchCollectionForHeader(); + setAttributes({ showCollectionHeader: showCollectionHeader }); + } + } + /> + { showCollectionHeader ? +
+ + { + showCollectionLabel = isChecked; + setAttributes({ showCollectionLabel: showCollectionLabel }); + } + } + /> + + + { + collectionBackgroundColor = value.hex; + setAttributes({ collectionBackgroundColor: collectionBackgroundColor }) + }} + disableAlpha + /> + + + + { + collectionTextColor = color; + setAttributes({ collectionTextColor: collectionTextColor }) + }} + /> + +
+ : null + } +
+ + { + showSearchBar = isChecked; + setAttributes({ showSearchBar: showSearchBar }); + } + } + /> + + +
+ { + maxItemsNumber = aMaxItemsNumber; + setAttributes( { maxItemsNumber: aMaxItemsNumber } ) + setContent(); + }} + min={ 1 } + max={ 96 } + /> +
+ +
+
+
+ + { isSelected ? + ( +
+ { isModalOpen ? + { + collectionId = selectedCollection.id; + collectionSlug = selectedCollection.slug; + setAttributes({ + collectionId: collectionId, + collectionSlug: collectionSlug, + isModalOpen: false + }); + fetchCollectionForHeader(); + setContent(); + }} + onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> + : null + } + + { items.length ? ( +
+

+ + + + {__('Dynamically list items from a Tainacan items search', 'tainacan')} +

+ +
+ ): null + } +
+ ) : null + } + + { + showCollectionHeader ? + +
{ + isLoadingCollection ? +
+ +
+ : + +
+

+ { showCollectionLabel ? { __('Collection', 'tainacan') }
: null } + { collection && collection.name ? collection.name : '' } +

+
+ { + collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium']) ? +
+ : null + } +
+ + } +
+ : null + } + + { + showSearchBar ? + + : null + } + + { !collectionId && !isLoading ? ( + + )}> +

+ + + + {__('Dynamically list items from a Tainacan items search', 'tainacan')} +

+ +
+ ) : null + } + + { isLoading ? +
+ +
: +
+ { content } +
+ } +
+ ); + }, + save({ attributes, className }){ + const { + content + } = attributes; + + return
{ content }
+ } +}); \ No newline at end of file diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js new file mode 100644 index 000000000..411d49a4a --- /dev/null +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js @@ -0,0 +1,280 @@ +import tainacan from '../../api-client/axios.js'; +import axios from 'axios'; + +const { __ } = wp.i18n; + +const { TextControl, Button, Modal, RadioControl, Spinner } = wp.components; + +export default class SearchBarModal extends React.Component { + constructor(props) { + super(props); + + // Initialize state + this.state = { + collectionsPerPage: 24, + collectionId: undefined, + collectionSlug: undefined, + collectionName: '', + isLoadingCollections: false, + modalCollections: [], + totalModalCollections: 0, + collectionPage: 1, + temporaryCollectionId: '', + searchCollectionName: '', + collections: [], + collectionsRequestSource: undefined + }; + + // 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); + } + + componentWillMount() { + + this.setState({ + collectionId: this.props.existingCollectionId, + collectionSlug: this.props.existingCollectionSlug + }); + + if (this.props.existingCollectionId != null && this.props.existingCollectionId != undefined) { + this.fetchCollection(this.props.existingCollectionId); + } else { + this.setState({ collectionPage: 1 }); + this.fetchModalCollections(); + } + } + + // COLLECTIONS RELATED -------------------------------------------------- + fetchModalCollections() { + + let someModalCollections = this.state.modalCollections; + if (this.state.collectionPage <= 1) + someModalCollections = []; + + let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage; + + 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, + slug: collection.slug + }); + } + + 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) { + + let selectedCollection; + if (selectedCollectionId == 'default') + selectedCollection = { label: __('Repository items', 'tainacan'), id: 'default', slug: tainacan_plugin.theme_items_list_url.split('/')[tainacan_plugin.theme_items_list_url.split('/').length - 1] }; + else { + selectedCollection = this.state.modalCollections.find((collection) => collection.id == selectedCollectionId) + if (selectedCollection == undefined) + selectedCollection = this.state.collections.find((collection) => collection.id == selectedCollectionId) + } + + this.setState({ + collectionId: selectedCollection.id, + collectionSlug: selectedCollection.slug + }); + + this.props.onSelectCollection(selectedCollection); + } + + 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/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage; + if (name != undefined && name != '') + endpoint += '&search=' + name; + + 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); + }); + } + + resetCollections() { + + this.setState({ + collectionId: null, + collectionPage: 1, + modalCollections: [] + }); + this.fetchModalCollections(); + } + + cancelSelection() { + + this.setState({ + modalCollections: [] + }); + + this.props.onCancelSelection(); + } + + render() { + return this.cancelSelection() } + contentLabel={__('Select search source', 'tainacan')}> +
+
+ { + this.setState({ + searchCollectionName: value + }); + _.debounce(this.fetchCollections(value), 300); + }}/> +
+ {( + this.state.searchCollectionName != '' ? ( + this.state.collections.length > 0 ? + ( +
+
+ { + { + return { label: collection.name, value: '' + collection.id } + }) + } + onChange={ ( aCollectionId ) => { + this.setState({ temporaryCollectionId: aCollectionId }); + } } /> + } +
+
+ ) : + this.state.isLoadingCollections ? ( + + ) : +
+

{ __('Sorry, no collection found.', 'tainacan') }

+
+ ): + this.state.modalCollections.length > 0 ? + ( +
+
+ + + { + this.setState({ temporaryCollectionId: aCollectionId }); + } } /> +
+ + { + return { label: collection.name, value: '' + collection.id } + }) + } + onChange={ ( aCollectionId ) => { + this.setState({ temporaryCollectionId: aCollectionId }); + } } /> + +
+
+

{ __('Showing', 'tainacan') + " " + this.state.modalCollections.length + " " + __('of', 'tainacan') + " " + this.state.totalModalCollections + " " + __('collections', 'tainacan') + "."}

+ { + this.state.modalCollections.length < this.state.totalModalCollections ? ( + + ) : null + } +
+
+ ) : this.state.isLoadingCollections ? : +
+

{ __('Sorry, no collection found.', 'tainacan') }

+
+ )} +
+ + +
+
+
+ } +} \ No newline at end of file diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss new file mode 100644 index 000000000..18892c458 --- /dev/null +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -0,0 +1,371 @@ +@import '../../gutenberg-blocks-style.scss'; + +.wp-block-tainacan-search-bar-list { + margin: 2rem 0px; + + // Spinner + .spinner-container { + min-height: 56px; + padding: 1rem; + display: flex; + justify-content: center; + align-items: center; + color: #555758; + } + + // Skeleton loading + @-webkit-keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + @-moz-keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + @-o-keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + @keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + .skeleton { + border-radius: 2px; + background: #f2f2f2; + + -webkit-animation: skeleton-animation 1.8s ease infinite; + -moz-animation: skeleton-animation 1.8s ease infinite; + -o-animation: skeleton-animation 1.8s ease infinite; + animation: skeleton-animation 1.8s ease infinite; + } + + // Collection header + .search-bar-collection-header { + display: flex; + width: 100%; + align-items: stretch; + text-decoration: none !important; + &:hover { + text-decoration: none; + } + + .collection-name { + width: auto; + min-width: 350px; + flex-grow: 1; + padding: 1rem 100px 1rem 1rem; + text-align: right; + line-height: 1.5rem; + min-height: 165px; + display: flex; + justify-content: flex-end; + align-items: center; + background-color: #454647; + + h3 { + color: white; + text-decoration: none; + font-size: 1.3rem; + &:hover { + text-decoration: none; + } + } + span.label { + font-weight: normal; + font-size: 1rem; + } + + &.only-collection-name { + justify-content: center; + padding: 1rem; + h3 { + text-align: center; + font-size: 1.75rem; + } + } + } + .collection-thumbnail { + height: 145px; + width: 145px; + background-size: cover; + background-position: center; + border-radius: 80px; + border: 4px solid white; + margin: 10px; + flex-shrink: 0; + position: relative; + margin-left: -155px; + left: 82px; + background-color: #dbdbdb; + } + .collection-header-image { + width: auto; + min-width: 150px; + min-height: 165px; + flex-grow: 2; + background-size: cover; + background-position: center; + background-color: #dbdbdb; + } + + @media only screen and (max-width: 1024px) { + flex-wrap: wrap-reverse; + + .collection-name { + width: 100% !important; + min-width: 100% !important; + justify-content: center !important; + text-align: center !important; + padding: 64px 1rem 0rem 1rem; + h3 { margin-bottom: 1rem; } + } + .collection-thumbnail { + left: calc(-50% + 78px) !important; + top: -78px !important; + } + .collection-header-image { + background-color: transparent; + } + } + } + + // Search control bar + .search-bar-search-bar { + width: 100%; + display: flex; + align-items: center; + border-bottom: 1px solid #cbcbcb; + padding: 1.00rem 0.5rem 0.75rem 0.5rem; + + @media only screen and (max-width: 768px) { + flex-wrap: wrap; + + .search-button { + order: 4; + position: absolute; + margin-top: 37px; + } + input { + width: 100% !important; + order: 5; + margin-top: 8px; + margin-left: 0px !important; + padding-left: 4px !important; + border-color: #dbdbdb !important; + } + } + + button { + margin-right: 0.75rem; + padding: 0 0.35rem; + min-height: 28px; + z-index: 2; + border: none; + background: transparent; + cursor: pointer; + + svg { + fill: #cbcbcb; + transition: fill 0.4s ease; + } + &:hover svg { fill: #545758; } + &:focus, &:active { border: none; box-shadow: none; } + &.sorting-button-selected svg { + fill: #545758; + } + &.next-button { + margin-right: 0rem; + padding: 0; + + svg { fill: #298596; } + } + &.previous-button { + margin-left: auto; + margin-right: 1rem; + padding: 0; + + svg { fill: #298596; } + } + &[disabled] svg { + fill: #f2f2f2; + cursor: not-allowed; + } + } + input { + height: 32px; + width: 20%; + border-radius: 0; + margin-left: -52px; + padding-left: 52px; + border: 1px solid white; + transition: border-color 0.7s ease, width 0.5s ease-in; + + &:focus, + &:active, + &:hover { + width: 100%; + border: 1px solid #cbcbcb; + box-shadow: none; + } + } + } + + // Grid View Mode ---------------------------------------------------- + ul.items-list.items-list-without-margin, + ul.items-list-edit.items-list-without-margin { + grid-template-columns: repeat(auto-fill, 185px); + justify-content: center !important; + grid-template-rows: auto !important; + list-style: none; + + li { + margin-top: 0 !important; + margin-right: 0 !important; + margin-left: 0 !important; + height: 185px !important; + + img { + height: 185px !important; + margin-bottom: 0px !important; + } + } + } + ul.items-list.items-layout-grid, + ul.items-list-edit.items-layout-grid { + padding: 0; + display: -ms-grid; + display: grid; + grid-template-columns: repeat(auto-fill, 220px); + grid-gap: 0px; + justify-content: space-evenly; + list-style-type: none; + + li.item-list-item { + position: relative; + display: block; + margin: 12px 12px 24px 12px; + margin-bottom: 12px; + width: 185px; + + a { + color: #454647; + font-weight: bold; + line-height: normal; + } + + img { + height: auto; + width: 185px; + min-width: 185px; + padding: 0px; + margin-bottom: 0.5rem; + } + + a.item-without-title span { + display: none; + } + + &:hover a { + color: #454647; + text-decoration: none; + } + } + } + ul.items-list-edit li.item-list-item { + display: flex; + align-items: flex-start; + + button { + position: absolute !important; + background-color: rgba(255, 255, 255, 0.75); + color: #454647; + padding: 2px; + margin-left: 5px; + min-width: 14px; + visibility: hidden; + position: relative; + opacity: 0; + right: -14px; + top: 0px; + justify-content: center; + z-index: 999; + } + + &:hover button { + visibility: visible; + background-color: rgba(255, 255, 255, 1) !important; + opacity: 1; + right: -8px; + top: -8px; + border: 1px solid #cbcbcb; + border-radius: 12px; + transition: opacity linear 0.15s, right linear 0.15s; + } + &:hover button:hover { + background-color: rgba(255, 255, 255, 1) !important; + border: 1px solid #cbcbcb !important; + } + } + @media only screen and (max-width: 498px) { + + ul.items-list.items-layout-grid, + ul.items-list-edit.items-layout-grid { + grid-template-columns: repeat(auto-fill, 100%); + + li.item-list-item { + width: 100%; + img { width: 100%; } + } + } + } + + // List View Mode ---------------------------------------------------- + ul.items-list.items-layout-list, + ul.items-list-edit.items-layout-list { + padding: 0; + display: block; + list-style-type: none; + + li.item-list-item { + position: relative; + display: inline-block; + margin: 12px 12px 24px 12px; + margin-bottom: 12px; + min-height: 54px; + min-width: 22%; + width: 22%; + + a { + color: #454647; + // overflow: hidden; + // text-overflow: ellipsis; + // white-space: nowrap; + display: flex; + align-items: center; + height: 54px; + } + + img { + height: auto; + width: 54px; + min-width: 54px; + padding: 0px; + margin-right: 20px; + } + + a.item-without-image img { + display: none; + } + + &:hover a { + color: #454647; + text-decoration: none; + } + } + } +} diff --git a/webpack.config.js b/webpack.config.js index 06ef0592c..f677058c9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,18 +5,23 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl module.exports = { entry: { - //dev_admin: './src/js/main.js',\ user_search: './src/admin/js/theme-main.js', user_admin: './src/admin/js/main.js', - //gutenberg_collections_carousel: './src/gutenberg-blocks/tainacan-collections/collections-carousel/index.js', - // gutenberg_items_grid: './src/gutenberg-blocks/tainacan-items/items-grid/index.js', + gutenberg_terms_list: './src/gutenberg-blocks/tainacan-terms/terms-list/index.js', + gutenberg_items_list: './src/gutenberg-blocks/tainacan-items/items-list/index.js', + gutenberg_dynamic_items_list: './src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js', gutenberg_dynamic_items_list_theme: './src/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list-theme.js', + gutenberg_carousel_items_list: './src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js', gutenberg_carousel_items_list_theme: './src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.js', + + gutenberg_search_bar: './src/gutenberg-blocks/tainacan-items/search-bar/index.js', + gutenberg_collections_list: './src/gutenberg-blocks/tainacan-collections/collections-list/index.js', + gutenberg_facets_list: './src/gutenberg-blocks/tainacan-facets/facets-list/index.js', gutenberg_facets_list_theme: './src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.js' }, From 07a184dc11b3f82662bbd0de745c22d1f0231b75 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Thu, 25 Jul 2019 12:43:09 -0300 Subject: [PATCH 002/104] First works on jquery strategy to redirect to correct URL. --- .../tainacan-items/search-bar/index.js | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index 4a7995065..0a6daa11d 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -153,17 +153,30 @@ registerBlockType('tainacan/search-bar', { setAttributes({ content: (
-
+
- ) - }); - + ) + }); + jQuery( document ).ready(function() { + jQuery('.editor-writing-flow').on('submit','form', (function(e) { + e.preventDefault(); + var val = jQuery('#taincan-search-bar-block_input').val(); + if (val) { + window.location.href = e.target.action + '?search=' + val; + } + return; + })); + }); } function fetchCollectionForHeader() { From 150121e699de0afd78ec2c54bd0e35f4e6a6041f Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Fri, 26 Jul 2019 16:33:48 -0300 Subject: [PATCH 003/104] Adds search bar script for theme side. --- .../class-tainacan-gutenberg-block.php | 6 + .../tainacan-items/search-bar/index.js | 10 +- .../search-bar/search-bar-theme-script.js | 10 + .../tainacan-items/search-bar/search-bar.scss | 289 +----------------- webpack.config.js | 1 + 5 files changed, 32 insertions(+), 284 deletions(-) create mode 100644 src/gutenberg-blocks/tainacan-items/search-bar/search-bar-theme-script.js diff --git a/src/gutenberg-blocks/class-tainacan-gutenberg-block.php b/src/gutenberg-blocks/class-tainacan-gutenberg-block.php index e23127c0d..ba477fc56 100644 --- a/src/gutenberg-blocks/class-tainacan-gutenberg-block.php +++ b/src/gutenberg-blocks/class-tainacan-gutenberg-block.php @@ -178,6 +178,12 @@ function tainacan_blocks_register_tainacan_carousel_items_list(){ function tainacan_blocks_register_tainacan_search_bar(){ global $TAINACAN_BASE_URL; + wp_enqueue_script( + 'search-bar-theme-script', + $TAINACAN_BASE_URL . '/assets/gutenberg_search_bar_script-components.js', + array('wp-components') + ); + wp_register_script( 'search-bar', $TAINACAN_BASE_URL . '/assets/gutenberg_search_bar-components.js', diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index 0a6daa11d..6465d6623 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -8,8 +8,6 @@ const { InspectorControls } = wp.editor; import SearchBarModal from './search-bar-modal.js'; import tainacan from '../../api-client/axios.js'; -import axios from 'axios'; -import qs from 'qs'; registerBlockType('tainacan/search-bar', { title: __('Tainacan Search Bar', 'tainacan'), @@ -149,7 +147,7 @@ registerBlockType('tainacan/search-bar', { setAttributes({ blockId: clientId }); function setContent(){ - + setAttributes({ content: (
@@ -162,7 +160,11 @@ registerBlockType('tainacan/search-bar', { label={ __('Search', 'taincan')} name='search' /> - +
) diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-theme-script.js b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-theme-script.js new file mode 100644 index 000000000..0657ad60b --- /dev/null +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-theme-script.js @@ -0,0 +1,10 @@ +jQuery( document ).ready(function() { + jQuery('#taincan-search-bar-block').submit(function(e) { + e.preventDefault(); + var val = jQuery('#taincan-search-bar-block_input').val(); + if (val) { + window.location.href = e.target.action + '?search=' + val; + } + return; + }); +}); \ No newline at end of file diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss index 18892c458..813530eae 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -1,135 +1,18 @@ @import '../../gutenberg-blocks-style.scss'; -.wp-block-tainacan-search-bar-list { +.wp-block-tainacan-search-bar { margin: 2rem 0px; - // Spinner - .spinner-container { - min-height: 56px; - padding: 1rem; - display: flex; - justify-content: center; - align-items: center; - color: #555758; - } - - // Skeleton loading - @-webkit-keyframes skeleton-animation { - 0%{opacity: 1.0} - 50%{opacity: 0.2} - 100%{opacity: 1.0} - } - @-moz-keyframes skeleton-animation { - 0%{opacity: 1.0} - 50%{opacity: 0.2} - 100%{opacity: 1.0} - } - @-o-keyframes skeleton-animation { - 0%{opacity: 1.0} - 50%{opacity: 0.2} - 100%{opacity: 1.0} - } - @keyframes skeleton-animation { - 0%{opacity: 1.0} - 50%{opacity: 0.2} - 100%{opacity: 1.0} - } - .skeleton { - border-radius: 2px; - background: #f2f2f2; - - -webkit-animation: skeleton-animation 1.8s ease infinite; - -moz-animation: skeleton-animation 1.8s ease infinite; - -o-animation: skeleton-animation 1.8s ease infinite; - animation: skeleton-animation 1.8s ease infinite; - } - - // Collection header - .search-bar-collection-header { - display: flex; - width: 100%; - align-items: stretch; - text-decoration: none !important; - &:hover { - text-decoration: none; - } - - .collection-name { - width: auto; - min-width: 350px; - flex-grow: 1; - padding: 1rem 100px 1rem 1rem; - text-align: right; - line-height: 1.5rem; - min-height: 165px; + .tainacan-search-container { + form#taincan-search-bar-block { + width: 800px; + max-width: 100%; display: flex; - justify-content: flex-end; - align-items: center; - background-color: #454647; + justify-content: center; + align-items: middle; - h3 { - color: white; - text-decoration: none; - font-size: 1.3rem; - &:hover { - text-decoration: none; - } - } - span.label { - font-weight: normal; - font-size: 1rem; - } - - &.only-collection-name { - justify-content: center; - padding: 1rem; - h3 { - text-align: center; - font-size: 1.75rem; - } - } - } - .collection-thumbnail { - height: 145px; - width: 145px; - background-size: cover; - background-position: center; - border-radius: 80px; - border: 4px solid white; - margin: 10px; - flex-shrink: 0; - position: relative; - margin-left: -155px; - left: 82px; - background-color: #dbdbdb; - } - .collection-header-image { - width: auto; - min-width: 150px; - min-height: 165px; - flex-grow: 2; - background-size: cover; - background-position: center; - background-color: #dbdbdb; - } - - @media only screen and (max-width: 1024px) { - flex-wrap: wrap-reverse; - - .collection-name { - width: 100% !important; - min-width: 100% !important; - justify-content: center !important; - text-align: center !important; - padding: 64px 1rem 0rem 1rem; - h3 { margin-bottom: 1rem; } - } - .collection-thumbnail { - left: calc(-50% + 78px) !important; - top: -78px !important; - } - .collection-header-image { - background-color: transparent; + input#taincan-search-bar-block_input { + width: 100%; } } } @@ -214,158 +97,4 @@ } } } - - // Grid View Mode ---------------------------------------------------- - ul.items-list.items-list-without-margin, - ul.items-list-edit.items-list-without-margin { - grid-template-columns: repeat(auto-fill, 185px); - justify-content: center !important; - grid-template-rows: auto !important; - list-style: none; - - li { - margin-top: 0 !important; - margin-right: 0 !important; - margin-left: 0 !important; - height: 185px !important; - - img { - height: 185px !important; - margin-bottom: 0px !important; - } - } - } - ul.items-list.items-layout-grid, - ul.items-list-edit.items-layout-grid { - padding: 0; - display: -ms-grid; - display: grid; - grid-template-columns: repeat(auto-fill, 220px); - grid-gap: 0px; - justify-content: space-evenly; - list-style-type: none; - - li.item-list-item { - position: relative; - display: block; - margin: 12px 12px 24px 12px; - margin-bottom: 12px; - width: 185px; - - a { - color: #454647; - font-weight: bold; - line-height: normal; - } - - img { - height: auto; - width: 185px; - min-width: 185px; - padding: 0px; - margin-bottom: 0.5rem; - } - - a.item-without-title span { - display: none; - } - - &:hover a { - color: #454647; - text-decoration: none; - } - } - } - ul.items-list-edit li.item-list-item { - display: flex; - align-items: flex-start; - - button { - position: absolute !important; - background-color: rgba(255, 255, 255, 0.75); - color: #454647; - padding: 2px; - margin-left: 5px; - min-width: 14px; - visibility: hidden; - position: relative; - opacity: 0; - right: -14px; - top: 0px; - justify-content: center; - z-index: 999; - } - - &:hover button { - visibility: visible; - background-color: rgba(255, 255, 255, 1) !important; - opacity: 1; - right: -8px; - top: -8px; - border: 1px solid #cbcbcb; - border-radius: 12px; - transition: opacity linear 0.15s, right linear 0.15s; - } - &:hover button:hover { - background-color: rgba(255, 255, 255, 1) !important; - border: 1px solid #cbcbcb !important; - } - } - @media only screen and (max-width: 498px) { - - ul.items-list.items-layout-grid, - ul.items-list-edit.items-layout-grid { - grid-template-columns: repeat(auto-fill, 100%); - - li.item-list-item { - width: 100%; - img { width: 100%; } - } - } - } - - // List View Mode ---------------------------------------------------- - ul.items-list.items-layout-list, - ul.items-list-edit.items-layout-list { - padding: 0; - display: block; - list-style-type: none; - - li.item-list-item { - position: relative; - display: inline-block; - margin: 12px 12px 24px 12px; - margin-bottom: 12px; - min-height: 54px; - min-width: 22%; - width: 22%; - - a { - color: #454647; - // overflow: hidden; - // text-overflow: ellipsis; - // white-space: nowrap; - display: flex; - align-items: center; - height: 54px; - } - - img { - height: auto; - width: 54px; - min-width: 54px; - padding: 0px; - margin-right: 20px; - } - - a.item-without-image img { - display: none; - } - - &:hover a { - color: #454647; - text-decoration: none; - } - } - } } diff --git a/webpack.config.js b/webpack.config.js index f677058c9..ad3e1da66 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,6 +19,7 @@ module.exports = { gutenberg_carousel_items_list_theme: './src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.js', gutenberg_search_bar: './src/gutenberg-blocks/tainacan-items/search-bar/index.js', + gutenberg_search_bar_script: './src/gutenberg-blocks/tainacan-items/search-bar/search-bar-theme-script.js', gutenberg_collections_list: './src/gutenberg-blocks/tainacan-collections/collections-list/index.js', From 370dc608155786ea17ffbbb2dd386e6d699f8e77 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Fri, 26 Jul 2019 18:23:05 -0300 Subject: [PATCH 004/104] Adds default and alternate style options to block. --- compile-sass.sh | 2 + .../tainacan-gutenberg-block-search-bar.css | 223 ++++++++++++++++++ ...ainacan-gutenberg-block-search-bar.css.map | 7 + .../tainacan-items/search-bar/index.js | 27 ++- .../tainacan-items/search-bar/search-bar.scss | 158 +++++++------ 5 files changed, 343 insertions(+), 74 deletions(-) create mode 100644 src/assets/css/tainacan-gutenberg-block-search-bar.css create mode 100644 src/assets/css/tainacan-gutenberg-block-search-bar.css.map diff --git a/compile-sass.sh b/compile-sass.sh index 0ed850c2a..81cec66bd 100644 --- a/compile-sass.sh +++ b/compile-sass.sh @@ -19,6 +19,8 @@ sass -E 'UTF-8' --cache-location .tmp/sass-cache-4 src/gutenberg-blocks/tainacan sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list.scss:src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css +sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss:src/assets/css/tainacan-gutenberg-block-search-bar.css + sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css sass -E 'UTF-8' --cache-location .tmp/sass-cache-6 src/gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css b/src/assets/css/tainacan-gutenberg-block-search-bar.css new file mode 100644 index 000000000..3dd092c1f --- /dev/null +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css @@ -0,0 +1,223 @@ +[data-align='full'] .block-control { + width: calc(100% + 14px); } + +.block-control { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 5px; + position: relative; + top: -14px; + left: -14px; + width: calc(100% + 28px); + background: #f2f2f2; } + .block-control p { + font-size: 0.875rem !important; + margin: 12px 1.5rem 16px 0; + fill: #555758; } + .block-control p svg { + top: 4px; + margin-right: 0.75rem; + position: relative; + fill: #555758; } + +.components-placeholder__fieldset p { + font-size: 0.875rem !important; + margin-top: -2px; + fill: #555758; } + .components-placeholder__fieldset p svg { + margin-right: 1rem; + top: 4px; + position: relative; + fill: #555758; } + +.wp-block-tainacan-modal { + width: 50%; } + @media only screen and (max-width: 1024px) { + .wp-block-tainacan-modal { + width: 75%; } } + @media only screen and (max-width: 768px) { + .wp-block-tainacan-modal { + width: 100%; } } + .wp-block-tainacan-modal.dynamic-modal { + width: 90%; + height: 90%; + width: 80vw; + height: 80vh; } + .wp-block-tainacan-modal.dynamic-modal iframe { + width: calc(100% + 32px); + height: calc(100% - 128px); + margin-left: -16px; } + .wp-block-tainacan-modal.dynamic-modal .modal-footer-area { + height: 68px; + width: calc(100% + 32px); + margin-left: -16px !important; + padding: 1.2rem 1.2rem !important; + border-top: 1px solid #cbcbcb; } + .wp-block-tainacan-modal .spinner-container { + min-height: 56px; + padding: 1rem; + display: flex; + justify-content: center; + align-items: center; + color: #555758; } + .wp-block-tainacan-modal .spinner-container .components-spineer { + margin: 8px; } + .wp-block-tainacan-modal .modal-search-area { + display: flex; + justify-content: center; + margin-bottom: 24px; } + .wp-block-tainacan-modal .modal-search-area .components-base-control { + width: 60%; } + @media only screen and (max-width: 1024px) { + .wp-block-tainacan-modal .modal-search-area .components-base-control { + width: 95%; } } + .wp-block-tainacan-modal .modal-search-area .components-base-control label { + text-align: center; } + .wp-block-tainacan-modal .modal-radio-area-label { + font-weight: bold; + margin-left: 1.75rem; } + .wp-block-tainacan-modal .modal-checkbox-list, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field { + padding: 0; + display: -ms-grid; + display: grid; + grid-template-columns: repeat(auto-fill, 250px); + grid-gap: 0px; + justify-content: space-evenly; + list-style-type: none; + margin: 12px; + max-height: 50vh; + overflow-y: auto; } + .wp-block-tainacan-modal .modal-checkbox-list .components-base-control, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control { + overflow: hidden; } + .wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item, + .wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option { + display: flex; + justify-content: flex-start; } + .wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item img, + .wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option img, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item img, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option img { + width: 24px; + height: 24px; + margin-right: 10px; } + .wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item label, + .wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option label, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item label, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option label { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + display: inline-block; + max-width: 85%; } + @media only screen and (max-width: 768px) { + .wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item label, + .wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option label, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item label, + .wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option label { + max-width: 80%; } } + .wp-block-tainacan-modal .modal-loadmore-section { + display: flex; + align-items: baseline; + justify-content: center; } + .wp-block-tainacan-modal .modal-loadmore-section p { + color: #555758; + margin-right: 12px; + margin-top: 2px; } + .wp-block-tainacan-modal .modal-footer-area { + border-top: 1px solid #e2e4e7; + display: flex; + align-items: baseline; + justify-content: space-between; + padding: 16px 16px 0 16px; + margin: 0 -16px; } + .wp-block-tainacan-modal .modal-footer-area p { + padding: 0 12px; + color: #454647; } + +.wp-block-tainacan-search-bar { + margin: 2rem 0px; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block { + width: 800px; + height: 32px; + max-width: 100%; + display: flex; + justify-content: center; + align-items: stretch; + margin: 0 auto; + border: 1px solid #dbdbdb; + transition: border-color ease 0.3s; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input { + width: 100%; + margin: 0; + border: none; + padding: 4px 0.75rem; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active { + border: 1px solid #545758; + border-right: none; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button { + height: auto; + display: flex; + align-items: center; + border: none; + border-radius: 0; + background: #f2f2f2; + padding: 4px 1rem; + font-size: 1rem; + transition: background ease 0.3s; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover { + background: #dbdbdb; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon { + height: 28px; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon svg { + fill: #298596; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block { + width: 100%; + display: flex; + flex-direction: row-reverse; + border: none; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input { + width: 35%; + border-radius: 0; + margin-left: -52px; + padding-left: 52px; + border: 1px solid white; + transition: border-color 0.7s ease, width 0.5s ease-in; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { + width: 100%; + border: 1px solid #cbcbcb; + box-shadow: none; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button { + margin-right: 0.75rem; + padding: 0 0.35rem; + min-height: 28px; + z-index: 2; + border: none; + background: transparent; + cursor: pointer; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button .icon svg { + fill: #cbcbcb; + transition: fill 0.4s ease; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button:hover .icon svg { + fill: #545758; } + @media only screen and (max-width: 768px) { + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block { + flex-wrap: wrap; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block .search-button { + order: 4; + position: absolute; + margin-top: 37px; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input { + width: 100% !important; + order: 5; + margin-top: 8px; + margin-left: 0px !important; + padding-left: 4px !important; + border-color: #dbdbdb !important; } } + +/*# sourceMappingURL=tainacan-gutenberg-block-search-bar.css.map */ diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map new file mode 100644 index 000000000..fc7e4b250 --- /dev/null +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,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IAAI;MAClB,MAAM,EAAE,eAAe;MACvB,UAAU,EAAE,0CAA0C;MAEtD,gXAEQ;QACJ,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,iBAAiB;QACzB,UAAU,EAAE,IAAI;IAIxB,qFAAO;MACH,YAAY,EAAE,OAAO;MACrB,OAAO,EAAE,SAAS;MAClB,UAAU,EAAE,IAAI;MAChB,OAAO,EAAE,CAAC;MACV,MAAM,EAAE,IAAI;MACZ,UAAU,EAAE,WAAW;MACvB,MAAM,EAAE,OAAO;MAEX,+FAAI;QACJ,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,cAAc;MAG9B,qGAAkB;QAAE,IAAI,EAAE,OAAO;IAIrC,yCAA0C;MAzC9C,8EAA8B;QA0CtB,SAAS,EAAE,IAAI;QAEf,6FAAe;UACX,KAAK,EAAE,CAAC;UACR,QAAQ,EAAE,QAAQ;UAClB,UAAU,EAAE,IAAI;QAEpB,oFAAM;UACF,KAAK,EAAE,eAAe;UACtB,KAAK,EAAE,CAAC;UACR,UAAU,EAAE,GAAG;UACf,WAAW,EAAE,cAAc;UAC3B,YAAY,EAAE,cAAc;UAC5B,YAAY,EAAE,kBAAkB", +"sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"], +"names": [], +"file": "tainacan-gutenberg-block-search-bar.css" +} diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index 6465d6623..6118b8ffa 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -1,4 +1,4 @@ -const { registerBlockType } = wp.blocks; +const { registerBlockType, registerBlockStyle } = wp.blocks; const { __ } = wp.i18n; @@ -118,6 +118,16 @@ registerBlockType('tainacan/search-bar', { align: ['full', 'wide'], html: false, }, + styles: [ + { + name: 'default', + label: __('Default', 'tainacan'), + isDefault: true, + },{ + name: 'alternate', + label: __('alternate', 'tainacan'), + } + ], edit({ attributes, setAttributes, className, isSelected, clientId }){ let { items, @@ -159,11 +169,24 @@ registerBlockType('tainacan/search-bar', { id="taincan-search-bar-block_input" label={ __('Search', 'taincan')} name='search' + placeholder={ __('Search', 'taincan')} />
diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss index 813530eae..cec8b9e79 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -6,95 +6,109 @@ .tainacan-search-container { form#taincan-search-bar-block { width: 800px; + height: 32px; max-width: 100%; display: flex; justify-content: center; - align-items: middle; + align-items: stretch; + margin: 0 auto; + border: 1px solid #dbdbdb; + transition: border-color ease 0.3s; input#taincan-search-bar-block_input { width: 100%; + margin: 0; + border: none; + padding: 4px 0.75rem; + &:focus, + &:active { + border: 1px solid #545758; + border-right: none; + } + } + button { + height: auto; + display: flex; + align-items: center; + border: none; + border-radius: 0; + background: #f2f2f2; + padding: 4px 1rem; + font-size: 1rem; + transition: background ease 0.3s; + + &:hover { + background: #dbdbdb; + } + .icon { + height: 28px; + svg { + fill: #298596; + } + } } } } - // Search control bar - .search-bar-search-bar { - width: 100%; - display: flex; - align-items: center; - border-bottom: 1px solid #cbcbcb; - padding: 1.00rem 0.5rem 0.75rem 0.5rem; - - @media only screen and (max-width: 768px) { - flex-wrap: wrap; - - .search-button { - order: 4; - position: absolute; - margin-top: 37px; - } - input { - width: 100% !important; - order: 5; - margin-top: 8px; - margin-left: 0px !important; - padding-left: 4px !important; - border-color: #dbdbdb !important; - } - } - - button { - margin-right: 0.75rem; - padding: 0 0.35rem; - min-height: 28px; - z-index: 2; + &.is-style-alternate { + form#taincan-search-bar-block { + width: 100%; + display: flex; + flex-direction: row-reverse; border: none; - background: transparent; - cursor: pointer; - svg { - fill: #cbcbcb; - transition: fill 0.4s ease; - } - &:hover svg { fill: #545758; } - &:focus, &:active { border: none; box-shadow: none; } - &.sorting-button-selected svg { - fill: #545758; - } - &.next-button { - margin-right: 0rem; - padding: 0; + input#taincan-search-bar-block_input { + width: 35%; + border-radius: 0; + margin-left: -52px; + padding-left: 52px; + border: 1px solid white; + transition: border-color 0.7s ease, width 0.5s ease-in; - svg { fill: #298596; } + &:focus, + &:active, + &:hover { + width: 100%; + border: 1px solid #cbcbcb; + box-shadow: none; + } } - &.previous-button { - margin-left: auto; - margin-right: 1rem; - padding: 0; - svg { fill: #298596; } - } - &[disabled] svg { - fill: #f2f2f2; - cursor: not-allowed; - } - } - input { - height: 32px; - width: 20%; - border-radius: 0; - margin-left: -52px; - padding-left: 52px; - border: 1px solid white; - transition: border-color 0.7s ease, width 0.5s ease-in; + button { + margin-right: 0.75rem; + padding: 0 0.35rem; + min-height: 28px; + z-index: 2; + border: none; + background: transparent; + cursor: pointer; + .icon { + svg { + fill: #cbcbcb; + transition: fill 0.4s ease; + } + } + &:hover .icon svg { fill: #545758; } - &:focus, - &:active, - &:hover { - width: 100%; - border: 1px solid #cbcbcb; - box-shadow: none; } + + @media only screen and (max-width: 768px) { + flex-wrap: wrap; + + .search-button { + order: 4; + position: absolute; + margin-top: 37px; + } + input { + width: 100% !important; + order: 5; + margin-top: 8px; + margin-left: 0px !important; + padding-left: 4px !important; + border-color: #dbdbdb !important; + } + } } } } From 857105c524eb2ec279a15687ee4bee600071f677 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Wed, 31 Jul 2019 14:22:59 -0300 Subject: [PATCH 005/104] Adds 'stylish' style, right and left alignment and max width attribute. --- .../tainacan-gutenberg-block-search-bar.css | 62 ++++++++++++- ...ainacan-gutenberg-block-search-bar.css.map | 2 +- .../tainacan-items/search-bar/index.js | 55 +++++------- .../tainacan-items/search-bar/search-bar.scss | 87 ++++++++++++++++++- 4 files changed, 167 insertions(+), 39 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css b/src/assets/css/tainacan-gutenberg-block-search-bar.css index 3dd092c1f..42979e207 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css @@ -143,7 +143,6 @@ .wp-block-tainacan-search-bar { margin: 2rem 0px; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block { - width: 800px; height: 32px; max-width: 100%; display: flex; @@ -165,6 +164,7 @@ display: flex; align-items: center; border: none; + box-shadow: none; border-radius: 0; background: #f2f2f2; padding: 4px 1rem; @@ -172,6 +172,8 @@ transition: background ease 0.3s; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover { background: #dbdbdb; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover .icon svg { + fill: #545758; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon { height: 28px; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon svg { @@ -203,8 +205,6 @@ .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button .icon svg { fill: #cbcbcb; transition: fill 0.4s ease; } - .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button:hover .icon svg { - fill: #545758; } @media only screen and (max-width: 768px) { .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block { flex-wrap: wrap; } @@ -219,5 +219,61 @@ margin-left: 0px !important; padding-left: 4px !important; border-color: #dbdbdb !important; } } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block { + width: 100%; + height: 53px; + display: flex; + flex-direction: row; + border: none; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block:hover input#taincan-search-bar-block_input { + width: 100%; + padding-right: 52px; + padding-left: 24px; + border: none !important; + box-shadow: 0px 4px 17px -9px black; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input { + width: 0%; + border-radius: 28px; + margin-right: -56px; + padding-right: 27px; + padding-left: 26px; + font-size: 1rem; + border: none; + box-shadow: 0px 3px 12px -7px black; + background: rgba(250, 250, 250, 0.8); + transition: width 0.5s ease-in, box-shadow 0.5s ease; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { + width: 100%; + padding-right: 52px; + padding-left: 24px; + border: none !important; + box-shadow: 0px 3px 16px -9px black; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block button { + margin-left: 0.75rem; + padding: 0 0.35rem; + min-height: 28px; + z-index: 2; + border: none; + background: transparent; + cursor: pointer; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block button .icon svg { + fill: black; + transition: fill 0.4s ease; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block button:hover { + background: transparent; } + @media only screen and (max-width: 768px) { + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block { + flex-wrap: wrap; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block .search-button { + order: 4; + position: absolute; + margin-top: 37px; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input { + width: 100% !important; + order: 5; + margin-top: 8px; + margin-left: 0px !important; + padding-left: 4px !important; + border-color: #dbdbdb !important; } } /*# sourceMappingURL=tainacan-gutenberg-block-search-bar.css.map */ diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map index fc7e4b250..c82ceddcd 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5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;QA2DtB,SAAS,EAAE,IAAI;QAEf,2FAAe;UACX,KAAK,EAAE,CAAC;UACR,QAAQ,EAAE,QAAQ;UAClB,UAAU,EAAE,IAAI;QAEpB,kFAAM;UACF,KAAK,EAAE,eAAe;UACtB,KAAK,EAAE,CAAC;UACR,UAAU,EAAE,GAAG;UACf,WAAW,EAAE,cAAc;UAC3B,YAAY,EAAE,cAAc;UAC5B,YAAY,EAAE,kBAAkB", "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"], "names": [], "file": "tainacan-gutenberg-block-search-bar.css" diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index 6118b8ffa..ca2dc3dc0 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -53,22 +53,18 @@ registerBlockType('tainacan/search-bar', { type: Boolean, default: false }, - gridMargin: { - type: Number, - default: 0 - }, searchURL: { type: String, default: undefined }, - itemsRequestSource: { - type: String, - default: undefined - }, maxItemsNumber: { type: Number, value: undefined }, + maxWidth: { + type: Number, + value: 80 + }, isLoading: { type: Boolean, value: false @@ -115,7 +111,7 @@ registerBlockType('tainacan/search-bar', { } }, supports: { - align: ['full', 'wide'], + align: ['full', 'wide', 'left', 'center', 'right'], html: false, }, styles: [ @@ -126,6 +122,9 @@ registerBlockType('tainacan/search-bar', { },{ name: 'alternate', label: __('alternate', 'tainacan'), + },{ + name: 'stylish', + label: __('stylish', 'tainacan'), } ], edit({ attributes, setAttributes, className, isSelected, clientId }){ @@ -137,12 +136,11 @@ registerBlockType('tainacan/search-bar', { showImage, showName, isModalOpen, - gridMargin, searchURL, - itemsRequestSource, maxItemsNumber, + maxWidth, order, - searchString, + searchString, isLoading, showSearchBar, showCollectionHeader, @@ -162,6 +160,7 @@ registerBlockType('tainacan/search-bar', { content: (
@@ -339,25 +338,19 @@ registerBlockType('tainacan/search-bar', { } /> - -
- { - maxItemsNumber = aMaxItemsNumber; - setAttributes( { maxItemsNumber: aMaxItemsNumber } ) - setContent(); - }} - min={ 1 } - max={ 96 } - /> -
- -
+
+ { + maxWidth = aMaxWidth; + setAttributes( { maxWidth: aMaxWidth } ) + setContent(); + }} + min={ 25 } + max={ 100 } + /> +
diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss index cec8b9e79..27f3dbafb 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -5,7 +5,6 @@ .tainacan-search-container { form#taincan-search-bar-block { - width: 800px; height: 32px; max-width: 100%; display: flex; @@ -31,6 +30,7 @@ display: flex; align-items: center; border: none; + box-shadow: none; border-radius: 0; background: #f2f2f2; padding: 4px 1rem; @@ -39,6 +39,7 @@ &:hover { background: #dbdbdb; + .icon svg { fill: #545758; } } .icon { height: 28px; @@ -82,14 +83,92 @@ border: none; background: transparent; cursor: pointer; + .icon { svg { - fill: #cbcbcb; - transition: fill 0.4s ease; + fill: #cbcbcb; + transition: fill 0.4s ease; } } - &:hover .icon svg { fill: #545758; } + } + @media only screen and (max-width: 768px) { + flex-wrap: wrap; + + .search-button { + order: 4; + position: absolute; + margin-top: 37px; + } + input { + width: 100% !important; + order: 5; + margin-top: 8px; + margin-left: 0px !important; + padding-left: 4px !important; + border-color: #dbdbdb !important; + } + } + } + } + + &.is-style-stylish { + form#taincan-search-bar-block { + width: 100%; + height: 53px; + display: flex; + flex-direction: row; + border: none; + + &:hover input#taincan-search-bar-block_input { + width: 100%; + padding-right: 52px; + padding-left: 24px; + border: none !important; + box-shadow: 0px 4px 17px -9px black; + } + + input#taincan-search-bar-block_input { + width: 0%; + border-radius: 28px; + margin-right: -56px; + padding-right: 27px; + padding-left: 26px; + font-size: 1rem; + border: none; + box-shadow: 0px 3px 12px -7px black; + background: rgba(250, 250, 250, 0.8); + transition: width 0.5s ease-in, box-shadow 0.5s ease; + + &:focus, + &:active, + &:hover { + width: 100%; + padding-right: 52px; + padding-left: 24px; + border: none !important; + box-shadow: 0px 3px 16px -9px black; + } + } + + button { + margin-left: 0.75rem; + padding: 0 0.35rem; + min-height: 28px; + z-index: 2; + border: none; + background: transparent; + cursor: pointer; + + .icon { + svg { + fill: black; + transition: fill 0.4s ease; + } + } + &:hover { + background: transparent; + } } @media only screen and (max-width: 768px) { From e3f746acc7138ff171c6c7906ecda2bf8b58dbb7 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Wed, 31 Jul 2019 17:03:44 -0300 Subject: [PATCH 006/104] Adds text placeholder option to block. Removes unused params. --- .../tainacan-items/search-bar/index.js | 268 +++++------------- 1 file changed, 75 insertions(+), 193 deletions(-) diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index ca2dc3dc0..0b424e232 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -1,8 +1,8 @@ -const { registerBlockType, registerBlockStyle } = wp.blocks; +const { registerBlockType } = wp.blocks; const { __ } = wp.i18n; -const { RangeControl, TextControl, Spinner, Button, ToggleControl, Tooltip, Placeholder, Toolbar, ColorPicker, ColorPalette, BaseControl, Panel, PanelBody, PanelRow } = wp.components; +const { RangeControl, TextControl, Spinner, Button, ToggleControl, Placeholder, ColorPicker, ColorPalette, BaseControl, PanelBody } = wp.components; const { InspectorControls } = wp.editor; @@ -14,12 +14,18 @@ registerBlockType('tainacan/search-bar', { icon: - + d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5 + c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6 + c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2 + c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2 + C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3 + c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2 + c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/> , category: 'tainacan-blocks', keywords: [ __( 'items', 'tainacan' ), __( 'search', 'tainacan' ), __( 'bar', 'tainacan' ) ], @@ -37,10 +43,6 @@ registerBlockType('tainacan/search-bar', { type: String, default: undefined }, - items: { - type: Array, - default: [] - }, showImage: { type: Boolean, default: true @@ -53,18 +55,14 @@ registerBlockType('tainacan/search-bar', { type: Boolean, default: false }, - searchURL: { - type: String, - default: undefined - }, - maxItemsNumber: { - type: Number, - value: undefined - }, maxWidth: { type: Number, value: 80 }, + placeholderText: { + type: String, + default: __('Search', 'taincan') + }, isLoading: { type: Boolean, value: false @@ -73,10 +71,6 @@ registerBlockType('tainacan/search-bar', { type: Boolean, value: false }, - showSearchBar: { - type: Boolean, - value: false - }, showCollectionHeader: { type: Boolean, value: false @@ -89,18 +83,6 @@ registerBlockType('tainacan/search-bar', { type: Object, value: undefined }, - searchString: { - type: String, - default: undefined - }, - order: { - type: String, - default: undefined - }, - blockId: { - type: String, - default: undefined - }, collectionBackgroundColor: { type: String, default: "#454647" @@ -112,7 +94,7 @@ registerBlockType('tainacan/search-bar', { }, supports: { align: ['full', 'wide', 'left', 'center', 'right'], - html: false, + html: false }, styles: [ { @@ -129,20 +111,15 @@ registerBlockType('tainacan/search-bar', { ], edit({ attributes, setAttributes, className, isSelected, clientId }){ let { - items, content, collectionId, collectionSlug, showImage, showName, + placeholderText, isModalOpen, - searchURL, - maxItemsNumber, maxWidth, - order, - searchString, isLoading, - showSearchBar, showCollectionHeader, showCollectionLabel, isLoadingCollection, @@ -168,7 +145,7 @@ registerBlockType('tainacan/search-bar', { id="taincan-search-bar-block_input" label={ __('Search', 'taincan')} name='search' - placeholder={ __('Search', 'taincan')} + placeholder={ placeholderText } />
@@ -376,23 +338,29 @@ registerBlockType('tainacan/search-bar', { : null } - { items.length ? ( + { collectionId ? (

- - - - {__('Dynamically list items from a Tainacan items search', 'tainacan')} + + + + + + + + {__('Set up a custom search bar to redirect to an item\'s list', 'tainacan')}

): null @@ -452,98 +420,6 @@ registerBlockType('tainacan/search-bar', { : null } - { - showSearchBar ? - - : null - } - { !collectionId && !isLoading ? ( )}>

- - - - {__('Dynamically list items from a Tainacan items search', 'tainacan')} + + + + + + + + {__('Set up a custom search bar to redirect to an item\'s list', 'tainacan')}

) : null From ae45bdee97bf5c4eed93cbfc20e3a5e6504969d2 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Thu, 1 Aug 2019 15:10:29 -0300 Subject: [PATCH 007/104] Adds first verions of collection header and more alignments option. --- .../tainacan-gutenberg-block-search-bar.css | 127 ++++++++--- ...ainacan-gutenberg-block-search-bar.css.map | 2 +- .../dynamic-items-list/index.js | 2 +- .../tainacan-items/search-bar/index.js | 212 +++++++++++++----- .../search-bar/search-bar-modal.js | 24 +- .../tainacan-items/search-bar/search-bar.scss | 76 ++++++- 6 files changed, 326 insertions(+), 117 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css b/src/assets/css/tainacan-gutenberg-block-search-bar.css index 42979e207..daf70089d 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css @@ -140,44 +140,60 @@ padding: 0 12px; color: #454647; } +.edit-post-sidebar div.components-toolbar { + border: none; + justify-content: center; } + .wp-block-tainacan-search-bar { margin: 2rem 0px; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block { - height: 32px; - max-width: 100%; - display: flex; - justify-content: center; - align-items: stretch; - margin: 0 auto; - border: 1px solid #dbdbdb; - transition: border-color ease 0.3s; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input { - width: 100%; - margin: 0; - border: none; - padding: 4px 0.75rem; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active { - border: 1px solid #545758; - border-right: none; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button { - height: auto; + .wp-block-tainacan-search-bar .tainacan-search-container { + width: 100%; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block { + height: 32px; + max-width: 100%; display: flex; - align-items: center; - border: none; - box-shadow: none; - border-radius: 0; - background: #f2f2f2; - padding: 4px 1rem; - font-size: 1rem; - transition: background ease 0.3s; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover { - background: #dbdbdb; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover .icon svg { - fill: #545758; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon { - height: 28px; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon svg { - fill: #298596; } + justify-content: center; + align-items: stretch; + margin: 0 auto; + border: 1px solid #dbdbdb; + transition: border-color ease 0.3s; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-aligned-left { + margin-left: 0; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-aligned-right { + margin-right: 0; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-expanded-aligned-left { + justify-content: flex-start; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-expanded-aligned-right { + justify-content: flex-end; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input { + width: 100%; + min-width: 28px; + margin: 0; + border: none; + padding: 4px 0.75rem; + text-overflow: ellipsis; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active { + border: 1px solid #545758; + border-right: none; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button { + height: auto; + display: flex; + align-items: center; + border: none; + box-shadow: none; + border-radius: 0; + background: #f2f2f2; + padding: 4px 1rem; + font-size: 1rem; + transition: background ease 0.3s; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover { + background: #dbdbdb; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover .icon svg { + fill: #545758; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon { + height: 28px; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon svg { + fill: #298596; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block { width: 100%; display: flex; @@ -205,6 +221,8 @@ .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button .icon svg { fill: #cbcbcb; transition: fill 0.4s ease; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button:hover { + background: transparent; } @media only screen and (max-width: 768px) { .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block { flex-wrap: wrap; } @@ -233,6 +251,7 @@ box-shadow: 0px 4px 17px -9px black; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input { width: 0%; + min-width: 0%; border-radius: 28px; margin-right: -56px; padding-right: 27px; @@ -240,7 +259,7 @@ font-size: 1rem; border: none; box-shadow: 0px 3px 12px -7px black; - background: rgba(250, 250, 250, 0.8); + background: rgba(250, 250, 250, 0.9); transition: width 0.5s ease-in, box-shadow 0.5s ease; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { width: 100%; @@ -275,5 +294,41 @@ margin-left: 0px !important; padding-left: 4px !important; border-color: #dbdbdb !important; } } + .wp-block-tainacan-search-bar .search-bar-collection-header { + display: flex; + flex-wrap: wrap; + width: 100%; + min-width: 150px; + min-height: 165px; + align-items: center; + flex-grow: 2; + padding: 1rem; + background-size: cover; + background-position: center; + background-color: #dbdbdb; + text-align: center; + text-decoration: none !important; } + .wp-block-tainacan-search-bar .search-bar-collection-header:hover { + text-decoration: none; } + .wp-block-tainacan-search-bar .search-bar-collection-header.is-aligned-left { + text-align: left; } + .wp-block-tainacan-search-bar .search-bar-collection-header.is-aligned-right { + text-align: right; } + .wp-block-tainacan-search-bar .search-bar-collection-header h3 { + width: 100%; + margin: 0 auto; + color: white; + text-decoration: none; + font-size: 1.3rem; + line-height: 1.5rem; + text-overflow: ellipsis; } + .wp-block-tainacan-search-bar .search-bar-collection-header h3:hover { + text-decoration: none; } + .wp-block-tainacan-search-bar .search-bar-collection-header span.label { + font-weight: normal; + font-size: 1rem; } + @media only screen and (max-width: 1024px) { + .wp-block-tainacan-search-bar .search-bar-collection-header h3 { + margin-bottom: 1rem; } } /*# sourceMappingURL=tainacan-gutenberg-block-search-bar.css.map */ diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map index c82ceddcd..e95a21c2f 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5B,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,iBAAiB;EACxB,UAAU,EAAE,OAAO;EAEnB,gBAAE;IACE,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,OAAO;IAEb,oBAAI;MACA,GAAG,EAAE,GAAG;MACR,YAAY,EAAE,OAAO;MACrB,QAAQ,EAAE,QAAQ;MAClB,IAAI,EAAE,OAAO;;AAIzB,mCAAoC;EAChC,SAAS,EAAE,mBAAmB;EAC9B,UAAU,EAAE,IAAI;EAChB,IAAI,EAAE,OAAO;EAEb,uCAAI;IACA,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,GAAG;IACR,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,OAAO;;AAKrB,wBAAyB;EACrB,KAAK,EAAE,GAAG;EAEV,0CAA2C;IAH/C,wBAAyB;MAGyB,KAAK,EAAE,GAAG;EACxD,yCAA0C;IAJ9C,wBAAyB;MAIuB,KAAK,EAAE,IAAI;EAGvD,sCAAgB;IACZ,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IAEZ,6CAAO;MACH,KAAK,EAA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IACzB,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE,eAAe;IAEhC,iEAAQ;MACJ,eAAe,EAAE,IAAI;IAGzB,2EAAkB;MACd,UAAU,EAAE,IAAI;IAEpB,4EAAmB;MACf,UAAU,EAAE,KAAK;IAGrB,8DAAG;MACC,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,MAAM;MACd,KAAK,EAAE,KAAK;MACZ,eAAe,EAAE,IAAI;MACrB,SAAS,EAAE,MAAM;MACjB,WAAW,EAAE,MAAM;MACnB,aAAa,EAAE,QAAQ;MACvB,oEAAQ;QACJ,eAAe,EAAE,IAAI;IAG7B,sEAAW;MACP,WAAW,EAAE,MAAM;MACnB,SAAS,EAAE,IAAI;IAGnB,0CAA2C;MACvC,8DAAG;QAAE,aAAa,EAAE,IAAI", "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"], "names": [], "file": "tainacan-gutenberg-block-search-bar.css" diff --git a/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js b/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js index 24ac8e1c3..faff027dc 100644 --- a/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js +++ b/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js @@ -2,7 +2,7 @@ const { registerBlockType } = wp.blocks; const { __ } = wp.i18n; -const { RangeControl, Spinner, Button, ToggleControl, Tooltip, Placeholder, Toolbar, ColorPicker, ColorPalette, BaseControl, Panel, PanelBody, PanelRow } = wp.components; +const { RangeControl, Spinner, Button, ToggleControl, Tooltip, Placeholder, Toolbar, ColorPicker, ColorPalette, BaseControl, PanelBody } = wp.components; const { InspectorControls, BlockControls } = wp.editor; diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index 0b424e232..1416e4030 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -2,9 +2,9 @@ const { registerBlockType } = wp.blocks; const { __ } = wp.i18n; -const { RangeControl, TextControl, Spinner, Button, ToggleControl, Placeholder, ColorPicker, ColorPalette, BaseControl, PanelBody } = wp.components; +const { RangeControl, TextControl, Toolbar, Spinner, SelectControl, Button, ToggleControl, Placeholder, ColorPicker, ColorPalette, BaseControl, PanelBody } = wp.components; -const { InspectorControls } = wp.editor; +const { InspectorControls, BlockControls } = wp.editor; import SearchBarModal from './search-bar-modal.js'; import tainacan from '../../api-client/axios.js'; @@ -43,13 +43,13 @@ registerBlockType('tainacan/search-bar', { type: String, default: undefined }, - showImage: { - type: Boolean, - default: true + alignment: { + type: String, + default: 'center' }, - showName: { - type: Boolean, - default: true + expandAlignment: { + type: String, + default: 'center' }, isModalOpen: { type: Boolean, @@ -63,10 +63,6 @@ registerBlockType('tainacan/search-bar', { type: String, default: __('Search', 'taincan') }, - isLoading: { - type: Boolean, - value: false - }, isLoadingCollection: { type: Boolean, value: false @@ -79,6 +75,10 @@ registerBlockType('tainacan/search-bar', { type: Boolean, value: false }, + collectionHeaderHeight: { + type: Number, + value: 165 + }, collection: { type: Object, value: undefined @@ -90,6 +90,10 @@ registerBlockType('tainacan/search-bar', { collectionTextColor: { type: String, default: "#ffffff" + }, + collectionTextSize: { + type: Number, + default: 2 } }, supports: { @@ -114,12 +118,13 @@ registerBlockType('tainacan/search-bar', { content, collectionId, collectionSlug, - showImage, - showName, + collectionHeaderHeight, + collectionTextSize, + alignment, + expandAlignment, placeholderText, isModalOpen, maxWidth, - isLoading, showCollectionHeader, showCollectionLabel, isLoadingCollection, @@ -137,7 +142,13 @@ registerBlockType('tainacan/search-bar', { content: (
@@ -204,12 +215,12 @@ registerBlockType('tainacan/search-bar', { collectionTextColor = '#ffffff'; setAttributes({ - content:
, collection: collection, isLoadingCollection: isLoadingCollection, collectionBackgroundColor: collectionBackgroundColor, collectionTextColor: collectionTextColor }); + setContent(); }); } } @@ -221,13 +232,72 @@ registerBlockType('tainacan/search-bar', { } ); } + function updateAlignment(newAlignment) { + alignment = newAlignment; + setAttributes({ alignment: alignment }); + setContent(); + } + + function updateExpandAlignment(newAlignment) { + expandAlignment = newAlignment; + setAttributes({ expandAlignment: expandAlignment }); + setContent(); + } + // Executed only on the first load of page if(content && content.length && content[0].type) setContent(); + const alignmentControls = [ + { + icon: 'editor-alignleft', + title: __( 'Left' ), + onClick: () => updateAlignment('left'), + isActive: alignment === 'left', + }, + { + icon: 'editor-aligncenter', + title: __( 'Center' ), + onClick: () => updateAlignment('center'), + isActive: alignment === 'center', + }, + { + icon: 'editor-alignright', + title: __( 'Right' ), + onClick: () => updateAlignment('right'), + isActive: alignment === 'right', + }, + ]; + const expandAlignmentControls = [ + { + icon: 'editor-alignleft', + title: __( 'Left' ), + onClick: () => updateExpandAlignment('left'), + isActive: expandAlignment === 'left', + }, + { + icon: 'editor-aligncenter', + title: __( 'Center' ), + onClick: () => updateExpandAlignment('center'), + isActive: expandAlignment === 'center', + }, + { + icon: 'editor-alignright', + title: __( 'Right' ), + onClick: () => updateExpandAlignment('right'), + isActive: expandAlignment === 'right', + }, + ]; + return (
+
+ + + +
+

@@ -242,6 +312,7 @@ registerBlockType('tainacan/search-bar', { }} />
+
+
+ +
+ + + + +
+ { + collectionHeaderHeight = aHeight; + setAttributes( { collectionHeaderHeight: collectionHeaderHeight } ) + setContent(); + }} + min={ 165 } + max={ 400 } /> + + + { + collectionTextSize = size; + setAttributes({ collectionTextSize: collectionTextSize }) + }} + />
: null } @@ -371,56 +480,41 @@ registerBlockType('tainacan/search-bar', { { showCollectionHeader ? -
{ isLoadingCollection ?
: - -
-

- { showCollectionLabel ? { __('Collection', 'tainacan') }
: null } - { collection && collection.name ? collection.name : '' } -

-
- { - collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium']) ? -
: + { collectionId && collectionSlug && !showCollectionHeader?
{ content }
+ : null }
); diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js index 411d49a4a..e4e9145f8 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js @@ -30,22 +30,19 @@ export default class SearchBarModal extends React.Component { this.selectCollection = this.selectCollection.bind(this); this.fetchCollections = this.fetchCollections.bind(this); this.fetchModalCollections = this.fetchModalCollections.bind(this); - this.fetchCollection = this.fetchCollection.bind(this); } componentWillMount() { - + this.setState({ + temporaryCollectionId: this.props.existingCollectionId, collectionId: this.props.existingCollectionId, collectionSlug: this.props.existingCollectionSlug }); - if (this.props.existingCollectionId != null && this.props.existingCollectionId != undefined) { - this.fetchCollection(this.props.existingCollectionId); - } else { - this.setState({ collectionPage: 1 }); - this.fetchModalCollections(); - } + this.setState({ collectionPage: 1 }); + this.fetchModalCollections(); + } // COLLECTIONS RELATED -------------------------------------------------- @@ -88,15 +85,6 @@ export default class SearchBarModal extends React.Component { }); } - 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) { let selectedCollection; @@ -172,7 +160,7 @@ export default class SearchBarModal extends React.Component { render() { return this.cancelSelection() } contentLabel={__('Select search source', 'tainacan')}>
diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss index 27f3dbafb..f9f257f2a 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -1,9 +1,15 @@ @import '../../gutenberg-blocks-style.scss'; +.edit-post-sidebar div.components-toolbar { + border: none; + justify-content: center; +} .wp-block-tainacan-search-bar { margin: 2rem 0px; .tainacan-search-container { + width: 100%; + form#taincan-search-bar-block { height: 32px; max-width: 100%; @@ -14,11 +20,26 @@ border: 1px solid #dbdbdb; transition: border-color ease 0.3s; + &.is-aligned-left { + margin-left: 0; + } + &.is-aligned-right { + margin-right: 0; + } + &.is-expanded-aligned-left { + justify-content: flex-start; + } + &.is-expanded-aligned-right { + justify-content: flex-end; + } + input#taincan-search-bar-block_input { width: 100%; + min-width: 28px; margin: 0; border: none; padding: 4px 0.75rem; + text-overflow: ellipsis; &:focus, &:active { border: 1px solid #545758; @@ -90,6 +111,9 @@ transition: fill 0.4s ease; } } + &:hover { + background: transparent; + } } @media only screen and (max-width: 768px) { @@ -130,6 +154,7 @@ input#taincan-search-bar-block_input { width: 0%; + min-width: 0%; border-radius: 28px; margin-right: -56px; padding-right: 27px; @@ -137,7 +162,7 @@ font-size: 1rem; border: none; box-shadow: 0px 3px 12px -7px black; - background: rgba(250, 250, 250, 0.8); + background: rgba(250, 250, 250, 0.9); transition: width 0.5s ease-in, box-shadow 0.5s ease; &:focus, @@ -190,4 +215,53 @@ } } } + + // Collection header + .search-bar-collection-header { + display: flex; + flex-wrap: wrap; + width: 100%; + min-width: 150px; + min-height: 165px; + align-items: center; + flex-grow: 2; + padding: 1rem; + background-size: cover; + background-position: center; + background-color: #dbdbdb; + text-align: center; + text-decoration: none !important; + + &:hover { + text-decoration: none; + } + + &.is-aligned-left { + text-align: left; + } + &.is-aligned-right { + text-align: right; + } + + h3 { + width: 100%; + margin: 0 auto; + color: white; + text-decoration: none; + font-size: 1.3rem; + line-height: 1.5rem; + text-overflow: ellipsis; + &:hover { + text-decoration: none; + } + } + span.label { + font-weight: normal; + font-size: 1rem; + } + + @media only screen and (max-width: 1024px) { + h3 { margin-bottom: 1rem; } + } + } } From 1ed4f7d39aa9a8348aebdd3ee0ff4e54c212487b Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Mon, 5 Aug 2019 10:12:50 -0300 Subject: [PATCH 008/104] Begins new heading and styles adjustments for search block. --- .../tainacan-gutenberg-block-search-bar.css | 64 +++++++++---------- ...ainacan-gutenberg-block-search-bar.css.map | 2 +- .../tainacan-items/search-bar/index.js | 53 ++++++++------- .../tainacan-items/search-bar/search-bar.scss | 46 ++++++------- 4 files changed, 86 insertions(+), 79 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css b/src/assets/css/tainacan-gutenberg-block-search-bar.css index daf70089d..75dd10c1c 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css @@ -182,14 +182,9 @@ border: none; box-shadow: none; border-radius: 0; - background: #f2f2f2; + background: transparent; padding: 4px 1rem; - font-size: 1rem; - transition: background ease 0.3s; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover { - background: #dbdbdb; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button:hover .icon svg { - fill: #545758; } + font-size: 1rem; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon { height: 28px; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon svg { @@ -204,11 +199,12 @@ border-radius: 0; margin-left: -52px; padding-left: 52px; - border: 1px solid white; - transition: border-color 0.7s ease, width 0.5s ease-in; } + border: 1px solid transparent; + background: rgba(250, 250, 250, 0.6); + transition: border-color 0.7s ease, width 0.5s ease-in, background-color 0.5s ease; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { width: 100%; - border: 1px solid #cbcbcb; + border: 1px solid white; box-shadow: none; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button { margin-right: 0.75rem; @@ -247,8 +243,7 @@ width: 100%; padding-right: 52px; padding-left: 24px; - border: none !important; - box-shadow: 0px 4px 17px -9px black; } + border: none !important; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input { width: 0%; min-width: 0%; @@ -258,15 +253,13 @@ padding-left: 26px; font-size: 1rem; border: none; - box-shadow: 0px 3px 12px -7px black; background: rgba(250, 250, 250, 0.9); - transition: width 0.5s ease-in, box-shadow 0.5s ease; } + transition: width 0.5s ease-in; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { width: 100%; padding-right: 52px; padding-left: 24px; - border: none !important; - box-shadow: 0px 3px 16px -9px black; } + border: none !important; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block button { margin-left: 0.75rem; padding: 0 0.35rem; @@ -294,27 +287,34 @@ margin-left: 0px !important; padding-left: 4px !important; border-color: #dbdbdb !important; } } - .wp-block-tainacan-search-bar .search-bar-collection-header { - display: flex; - flex-wrap: wrap; + .wp-block-tainacan-search-bar .search-bar-collection-header-image { width: 100%; min-width: 150px; min-height: 165px; + background-size: cover; + background-position: center; + background-color: #dbdbdb; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container { + width: 100%; + min-height: 165px; + display: flex; + flex-wrap: wrap; align-items: center; flex-grow: 2; padding: 1rem; - background-size: cover; - background-position: center; - background-color: #dbdbdb; text-align: center; text-decoration: none !important; } - .wp-block-tainacan-search-bar .search-bar-collection-header:hover { - text-decoration: none; } - .wp-block-tainacan-search-bar .search-bar-collection-header.is-aligned-left { - text-align: left; } - .wp-block-tainacan-search-bar .search-bar-collection-header.is-aligned-right { - text-align: right; } - .wp-block-tainacan-search-bar .search-bar-collection-header h3 { + .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left { + text-align: left; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right { + text-align: right; + flex-direction: row-reverse; + flex-wrap: nowrap; + justify-content: space-between; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container h3 { width: 100%; margin: 0 auto; color: white; @@ -322,13 +322,13 @@ font-size: 1.3rem; line-height: 1.5rem; text-overflow: ellipsis; } - .wp-block-tainacan-search-bar .search-bar-collection-header h3:hover { + .wp-block-tainacan-search-bar .search-bar-collection-header-container h3:hover { text-decoration: none; } - .wp-block-tainacan-search-bar .search-bar-collection-header span.label { + .wp-block-tainacan-search-bar .search-bar-collection-header-container span.label { font-weight: normal; font-size: 1rem; } @media only screen and (max-width: 1024px) { - .wp-block-tainacan-search-bar .search-bar-collection-header h3 { + .wp-block-tainacan-search-bar .search-bar-collection-header-container h3 { margin-bottom: 1rem; } } /*# sourceMappingURL=tainacan-gutenberg-block-search-bar.css.map */ diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map index e95a21c2f..3447e9c69 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5B,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,iBAAiB;EACxB,UAAU,EAAE,OAAO;EAEnB,gBAAE;IACE,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,OAAO;IAEb,oBAAI;MACA,GAAG,EAAE,GAAG;MACR,YAAY,EAAE,OAAO;MACrB,QAAQ,EAAE,QAAQ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AOhD,iEAAoC;IAChC,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;IACjB,eAAe,EAAE,KAAK;IACtB,mBAAmB,EAAE,MAAM;IAC3B,gBAAgB,EAAE,OAAO;EAG7B,qEAAwC;IACpC,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE,eAAe;IAEhC,qFAAkB;MACd,UAAU,EAAE,IAAI;MAChB,cAAc,EAAE,GAAG;MACnB,SAAS,EAAE,MAAM;MACjB,eAAe,EAAE,aAAa;IAElC,sFAAmB;MACf,UAAU,EAAE,KAAK;MACjB,cAAc,EAAE,WAAW;MAC3B,SAAS,EAAE,MAAM;MACjB,eAAe,EAAE,aAAa;IAGlC,wEAAG;MACC,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,MAAM;MACd,KAAK,EAAE,KAAK;MACZ,eAAe,EAAE,IAAI;MACrB,SAAS,EAAE,MAAM;MACjB,WAAW,EAAE,MAAM;MACnB,aAAa,EAAE,QAAQ;MACvB,8EAAQ;QACJ,eAAe,EAAE,IAAI;IAG7B,gFAAW;MACP,WAAW,EAAE,MAAM;MACnB,SAAS,EAAE,IAAI;IAGnB,0CAA2C;MACvC,wEAAG;QAAE,aAAa,EAAE,IAAI", "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"], "names": [], "file": "tainacan-gutenberg-block-search-bar.css" diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index 1416e4030..c0adf2b47 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -485,29 +485,36 @@ registerBlockType('tainacan/search-bar', {
- : -
-

- { showCollectionLabel ? { __('Collection', 'tainacan') }
: null } - { collection && collection.name ? collection.name : '' } -

- { collectionId && collectionSlug ? - content - : null - } + : +
+
+
+
+

+ { showCollectionLabel ? { __('Collection', 'tainacan') }
: null } + { collection && collection.name ? collection.name : '' } +

+ { collectionId && collectionSlug ? + content + : null + } +
}
diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss index f9f257f2a..8d83988eb 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -53,15 +53,10 @@ border: none; box-shadow: none; border-radius: 0; - background: #f2f2f2; + background: white; padding: 4px 1rem; font-size: 1rem; - transition: background ease 0.3s; - &:hover { - background: #dbdbdb; - .icon svg { fill: #545758; } - } .icon { height: 28px; svg { @@ -84,14 +79,15 @@ border-radius: 0; margin-left: -52px; padding-left: 52px; - border: 1px solid white; - transition: border-color 0.7s ease, width 0.5s ease-in; + border: 1px solid transparent; + background: rgba(250, 250, 250, 0.6); + transition: border-color 0.7s ease, width 0.5s ease-in, background-color 0.5s ease; &:focus, &:active, &:hover { width: 100%; - border: 1px solid #cbcbcb; + border: 1px solid white; box-shadow: none; } } @@ -149,7 +145,6 @@ padding-right: 52px; padding-left: 24px; border: none !important; - box-shadow: 0px 4px 17px -9px black; } input#taincan-search-bar-block_input { @@ -161,9 +156,8 @@ padding-left: 26px; font-size: 1rem; border: none; - box-shadow: 0px 3px 12px -7px black; background: rgba(250, 250, 250, 0.9); - transition: width 0.5s ease-in, box-shadow 0.5s ease; + transition: width 0.5s ease-in; &:focus, &:active, @@ -172,7 +166,6 @@ padding-right: 52px; padding-left: 24px; border: none !important; - box-shadow: 0px 3px 16px -9px black; } } @@ -217,30 +210,37 @@ } // Collection header - .search-bar-collection-header { - display: flex; - flex-wrap: wrap; + .search-bar-collection-header-image { width: 100%; min-width: 150px; min-height: 165px; - align-items: center; - flex-grow: 2; - padding: 1rem; background-size: cover; background-position: center; background-color: #dbdbdb; + + } + .search-bar-collection-header-container { + width: 100%; + min-height: 165px; + display: flex; + flex-wrap: wrap; + align-items: center; + flex-grow: 2; + padding: 1rem; text-align: center; text-decoration: none !important; - &:hover { - text-decoration: none; - } - &.is-aligned-left { text-align: left; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; } &.is-aligned-right { text-align: right; + flex-direction: row-reverse; + flex-wrap: nowrap; + justify-content: space-between; } h3 { From e2d16cf71bae40bd74787f7850a4bdfed22e07cb Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Mon, 5 Aug 2019 15:41:02 -0300 Subject: [PATCH 009/104] Adjustments to input disposal on header and alternate style. --- .../tainacan-gutenberg-block-search-bar.css | 92 +++++++++--- ...ainacan-gutenberg-block-search-bar.css.map | 2 +- .../tainacan-items/search-bar/index.js | 82 +++------- .../tainacan-items/search-bar/search-bar.scss | 142 +++++++++++++++--- 4 files changed, 215 insertions(+), 103 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css b/src/assets/css/tainacan-gutenberg-block-search-bar.css index 75dd10c1c..ca6ca2422 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css @@ -158,12 +158,10 @@ border: 1px solid #dbdbdb; transition: border-color ease 0.3s; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-aligned-left { - margin-left: 0; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-aligned-right { - margin-right: 0; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-expanded-aligned-left { + margin-left: 0; justify-content: flex-start; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-expanded-aligned-right { + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-aligned-right { + margin-right: 0; justify-content: flex-end; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input { width: 100%; @@ -182,7 +180,7 @@ border: none; box-shadow: none; border-radius: 0; - background: transparent; + background: white; padding: 4px 1rem; font-size: 1rem; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button .icon { @@ -194,17 +192,24 @@ display: flex; flex-direction: row-reverse; border: none; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block.is-aligned-left { + margin-left: 0; + justify-content: flex-end; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block.is-aligned-right { + margin-right: 0; + justify-content: flex-start; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input { width: 35%; border-radius: 0; margin-left: -52px; padding-left: 52px; border: 1px solid transparent; - background: rgba(250, 250, 250, 0.6); + background: rgba(250, 250, 250, 0.3); transition: border-color 0.7s ease, width 0.5s ease-in, background-color 0.5s ease; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { width: 100%; border: 1px solid white; + background: #fafafa; box-shadow: none; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button { margin-right: 0.75rem; @@ -233,6 +238,16 @@ margin-left: 0px !important; padding-left: 4px !important; border-color: #dbdbdb !important; } } + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover input::placeholder { + color: #454647; } + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover button .icon svg { + fill: #cbcbcb !important; } + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input::placeholder { + color: white; } + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:hover, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:hover::placeholder { + color: #454647; } + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block button .icon svg { + fill: #dbdbdb !important; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block { width: 100%; height: 53px; @@ -243,7 +258,7 @@ width: 100%; padding-right: 52px; padding-left: 24px; - border: none !important; } + border-width: 0; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input { width: 0%; min-width: 0%; @@ -252,14 +267,14 @@ padding-right: 27px; padding-left: 26px; font-size: 1rem; - border: none; - background: rgba(250, 250, 250, 0.9); + border-width: 0; + background: #f2f2f2; transition: width 0.5s ease-in; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { width: 100%; padding-right: 52px; padding-left: 24px; - border: none !important; } + border-width: 0; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block button { margin-left: 0.75rem; padding: 0 0.35rem; @@ -287,33 +302,70 @@ margin-left: 0px !important; padding-left: 4px !important; border-color: #dbdbdb !important; } } + .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .tainacan-search-container { + width: calc(100% - 4.1667% - 26px); + width: calc(100% - 4.1667vw - 26px); + bottom: calc(-50% + 38px); + position: absolute; } + .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) h3 { + margin-bottom: 26px; } + .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-right .tainacan-search-container { + width: calc(100% - 4.1667% - 26px); + width: calc(100% - 4.1667vw - 26px); + top: calc(-50% + 26px); + right: calc(4.1667% + 26px); + right: calc(4.1667vw + 26px); + position: absolute; } + .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-left .tainacan-search-container { + width: calc(100% - 1rem - 26px); + top: calc(-50% + 26px); + left: calc(4.1667% + 26px); + left: calc(4.1667vw + 26px); + position: absolute; } + .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input { + background: white; + border-width: 3px; + border-style: solid; + margin-right: -56px; + padding-right: 24px; + padding-left: 24px; } + .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { + border-width: 3px !important; } .wp-block-tainacan-search-bar .search-bar-collection-header-image { width: 100%; - min-width: 150px; - min-height: 165px; + min-width: 160px; + min-height: 125px; background-size: cover; background-position: center; background-color: #dbdbdb; } .wp-block-tainacan-search-bar .search-bar-collection-header-container { width: 100%; - min-height: 165px; + min-height: 125px; + position: relative; display: flex; flex-wrap: wrap; align-items: center; flex-grow: 2; - padding: 1rem; + padding: 1rem 4.1667%; + padding: 1rem 4.1667vw; text-align: center; text-decoration: none !important; } .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left { + min-height: 100px; text-align: left; - flex-direction: row; - flex-wrap: nowrap; - justify-content: space-between; } - .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right { - text-align: right; flex-direction: row-reverse; flex-wrap: nowrap; justify-content: space-between; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left h3 { + text-align: right; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right { + min-height: 100px; + text-align: right; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right h3 { + text-align: left; } .wp-block-tainacan-search-bar .search-bar-collection-header-container h3 { width: 100%; margin: 0 auto; diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map index 3447e9c69..3ba1ba6c4 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5B,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE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sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"], "names": [], "file": "tainacan-gutenberg-block-search-bar.css" diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index c0adf2b47..f9bf138eb 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -47,10 +47,6 @@ registerBlockType('tainacan/search-bar', { type: String, default: 'center' }, - expandAlignment: { - type: String, - default: 'center' - }, isModalOpen: { type: Boolean, default: false @@ -121,7 +117,6 @@ registerBlockType('tainacan/search-bar', { collectionHeaderHeight, collectionTextSize, alignment, - expandAlignment, placeholderText, isModalOpen, maxWidth, @@ -145,25 +140,28 @@ registerBlockType('tainacan/search-bar', { style={{ maxWidth: maxWidth ? maxWidth + '%' : '80%' }} className={ (alignment == 'left' ? ' is-aligned-left' : '') + - (alignment == 'right' ? ' is-aligned-right' : '') + - (expandAlignment == 'left' ? ' is-expanded-aligned-left' : '') + - (expandAlignment == 'right' ? ' is-expanded-aligned-right' : '') + (alignment == 'right' ? ' is-aligned-right' : '') } id="taincan-search-bar-block" action={ tainacan_plugin.site_url + '/' + collectionSlug + '/#/' } method='get'> - + />
{ showCollectionHeader ? -
- +
+ { collectionHeaderHeight = aHeight; setAttributes( { collectionHeaderHeight: collectionHeaderHeight } ) setContent(); }} - min={ 165 } - max={ 400 } /> + min={ 100 } + max={ 300 } />
: null - } + }
@@ -493,10 +455,10 @@ registerBlockType('tainacan/search-bar', { backgroundImage: collection.header_image ? 'url(' + collection.header_image + ')' : '', height: collectionHeaderHeight ? collectionHeaderHeight + 'px' : '160px' }}> -
+
Date: Tue, 6 Aug 2019 13:45:36 -0300 Subject: [PATCH 010/104] Little adjustments to alternate style. --- .../tainacan-gutenberg-block-search-bar.css | 48 +++++++++------- ...ainacan-gutenberg-block-search-bar.css.map | 2 +- .../tainacan-items/search-bar/index.js | 56 ++++++++++--------- .../tainacan-items/search-bar/search-bar.scss | 51 ++++++++++------- 4 files changed, 90 insertions(+), 67 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css b/src/assets/css/tainacan-gutenberg-block-search-bar.css index ca6ca2422..616e62b99 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css @@ -204,11 +204,11 @@ margin-left: -52px; padding-left: 52px; border: 1px solid transparent; - background: rgba(250, 250, 250, 0.3); - transition: border-color 0.7s ease, width 0.5s ease-in, background-color 0.5s ease; } + background: rgba(250, 250, 250, 0.2); + transition: border-color 0.4s ease, width 0.5s ease-in, background-color 0.3s ease, color 0.3s ease; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input:hover { width: 100%; - border: 1px solid white; + border-color: #cbcbcb; background: #fafafa; box-shadow: none; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block button { @@ -239,7 +239,8 @@ padding-left: 4px !important; border-color: #dbdbdb !important; } } .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover input::placeholder { - color: #454647; } + color: #454647; + border-width: 0; } .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover button .icon svg { fill: #cbcbcb !important; } .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input::placeholder { @@ -307,7 +308,7 @@ width: calc(100% - 4.1667vw - 26px); bottom: calc(-50% + 38px); position: absolute; } - .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) h3 { + .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .search-bar-collection-header-title { margin-bottom: 26px; } .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-right .tainacan-search-container { width: calc(100% - 4.1667% - 26px); @@ -356,7 +357,7 @@ flex-direction: row-reverse; flex-wrap: nowrap; justify-content: space-between; } - .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left h3 { + .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left .search-bar-collection-header-title { text-align: right; } .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right { min-height: 100px; @@ -364,23 +365,28 @@ flex-direction: row; flex-wrap: nowrap; justify-content: space-between; } - .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right h3 { + .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right .search-bar-collection-header-title { text-align: left; } - .wp-block-tainacan-search-bar .search-bar-collection-header-container h3 { - width: 100%; - margin: 0 auto; - color: white; - text-decoration: none; - font-size: 1.3rem; - line-height: 1.5rem; - text-overflow: ellipsis; } - .wp-block-tainacan-search-bar .search-bar-collection-header-container h3:hover { - text-decoration: none; } - .wp-block-tainacan-search-bar .search-bar-collection-header-container span.label { - font-weight: normal; - font-size: 1rem; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title { + width: 100%; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title h3 { + margin: 0 auto; + color: white; + text-decoration: none; + font-size: 1.3rem; + line-height: 1.5rem; + text-overflow: ellipsis; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title h3:hover { + text-decoration: none; } + .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title span.label { + width: 100%; + display: block; + margin-top: -12px; + font-weight: normal; + font-size: 1rem; + color: white; } @media only screen and (max-width: 1024px) { - .wp-block-tainacan-search-bar .search-bar-collection-header-container h3 { + .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title { margin-bottom: 1rem; } } /*# sourceMappingURL=tainacan-gutenberg-block-search-bar.css.map */ diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map index 3ba1ba6c4..f04a67345 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5B,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,iBAAiB;EACxB,UAAU,EAAE,OAAO;EAEnB,gBAAE;IACE,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,OAAO;IAEb,oBAAI;MACA,GAAG,EAAE,GAAG;MACR,YAAY,EAAE,OAAO;MACrB,QAAQ,EAAE,QAAQ;MAClB,IAAI,EAAE,OAAO;;AAIzB,mCAAoC;EAChC,SAAS,EAAE,mBAAmB;EAC9B,UAA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,EAAE,CAAC;IACZ,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE,eAAe;IAEhC,qFAAkB;MACd,UAAU,EAAE,KAAK;MACjB,UAAU,EAAE,IAAI;MAChB,cAAc,EAAE,WAAW;MAC3B,SAAS,EAAE,MAAM;MACjB,eAAe,EAAE,aAAa;MAE9B,yHAAoC;QAAE,UAAU,EAAE,KAAK;IAE3D,sFAAmB;MACf,UAAU,EAAE,KAAK;MACjB,UAAU,EAAE,KAAK;MACjB,cAAc,EAAE,GAAG;MACnB,SAAS,EAAE,MAAM;MACjB,eAAe,EAAE,aAAa;MAE9B,0HAAoC;QAAE,UAAU,EAAE,IAAI;IAG1D,yGAAoC;MAChC,KAAK,EAAE,IAAI;MAEX,4GAAG;QACC,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,KAAK;QACZ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,QAAQ;QACvB,kHAAQ;UACJ,eAAe,EAAE,IAAI;MAG7B,oHAAW;QACP,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,MAAM;QACnB,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,KAAK;IAKpB,0CAA2C;MACvC,yGAAoC;QAAE,aAAa,EAAE,IAAI", "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"], "names": [], "file": "tainacan-gutenberg-block-search-bar.css" diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index f9bf138eb..1b8596d48 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -145,7 +145,7 @@ registerBlockType('tainacan/search-bar', { id="taincan-search-bar-block" action={ tainacan_plugin.site_url + '/' + collectionSlug + '/#/' } method='get'> - - { - collectionHeaderHeight = aHeight; - setAttributes( { collectionHeaderHeight: collectionHeaderHeight } ) - setContent(); - }} - min={ 100 } - max={ 300 } /> + { collection && collection.header_image ? + { + collectionHeaderHeight = aHeight; + setAttributes( { collectionHeaderHeight: collectionHeaderHeight } ) + setContent(); + }} + min={ 100 } + max={ 300 } /> : null + } :
-
-
+ { collection.header_image ? +
+
: null + }
-

- { showCollectionLabel ? { __('Collection', 'tainacan') }
: null } - { collection && collection.name ? collection.name : '' } -

+
+ { showCollectionLabel ? { __('Collection', 'tainacan') } : null } +

+ { collection && collection.name ? collection.name : '' } +

+
{ collectionId && collectionSlug ? content : null diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss index dea6dcf78..881532e37 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -86,13 +86,13 @@ padding-left: 52px; border: 1px solid transparent; background: rgba(250, 250, 250, 0.2); - transition: border-color 0.4s ease, width 0.5s ease-in, background-color 0.3s ease, color 0.3 ease; + transition: border-color 0.4s ease, width 0.5s ease-in, background-color 0.3s ease, color 0.3s ease; &:focus, &:active, &:hover { width: 100%; - border: 1px solid white; + border-color: #cbcbcb; background:rgba(250, 250, 250, 1); box-shadow: none; } @@ -143,7 +143,10 @@ &:focus, &:active, &:hover { - input::placeholder { color: #454647; } + input::placeholder { + color: #454647; + border-width: 0; + } button .icon { svg { fill: #cbcbcb !important; @@ -260,7 +263,7 @@ bottom: calc(-50% + 38px); position: absolute; } - h3 { + .search-bar-collection-header-title { margin-bottom: 26px; } } @@ -329,7 +332,7 @@ flex-wrap: nowrap; justify-content: space-between; - h3 { text-align: right; } + .search-bar-collection-header-title { text-align: right; } } &.is-aligned-right { min-height: 100px; @@ -338,28 +341,36 @@ flex-wrap: nowrap; justify-content: space-between; - h3 { text-align: left; } + .search-bar-collection-header-title { text-align: left; } } - h3 { - width: 100%; - margin: 0 auto; - color: white; - text-decoration: none; - font-size: 1.3rem; - line-height: 1.5rem; - text-overflow: ellipsis; - &:hover { + .search-bar-collection-header-title { + width: 100%; + + h3 { + margin: 0 auto; + color: white; text-decoration: none; + font-size: 1.3rem; + line-height: 1.5rem; + text-overflow: ellipsis; + &:hover { + text-decoration: none; + } + } + span.label { + width: 100%; + display: block; + margin-top: -12px; + font-weight: normal; + font-size: 1rem; + color: white; } } - span.label { - font-weight: normal; - font-size: 1rem; - } + @media only screen and (max-width: 1024px) { - h3 { margin-bottom: 1rem; } + .search-bar-collection-header-title { margin-bottom: 1rem; } } } } From b9d33567f33fe384ebe1c4f3e09821d2b86c1dd3 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 6 Aug 2019 14:18:08 -0300 Subject: [PATCH 011/104] Version 0.11RC1 --- src/tainacan.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tainacan.php b/src/tainacan.php index 5c3084cd0..b2067c1b8 100644 --- a/src/tainacan.php +++ b/src/tainacan.php @@ -4,13 +4,13 @@ Plugin Name: Tainacan Plugin URI: https://tainacan.org/ Description: powerfull and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional respository platform. Author: Media Lab / UFG -Version: 0.10.1 +Version: 0.11RC1 Text Domain: tainacan License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html */ -const TAINACAN_VERSION = '0.10.1'; +const TAINACAN_VERSION = '0.11RC1'; defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); $TAINACAN_BASE_URL = plugins_url('', __FILE__); From d445a276cc9aa3a56dd4fa6750a41879d04f9e5c Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 6 Aug 2019 14:51:41 -0300 Subject: [PATCH 012/104] First fix on RC1: avoid column break for only one metadata on item page. --- src/admin/pages/singles/item-page.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/admin/pages/singles/item-page.vue b/src/admin/pages/singles/item-page.vue index 2f1b3c209..67c665466 100644 --- a/src/admin/pages/singles/item-page.vue +++ b/src/admin/pages/singles/item-page.vue @@ -199,7 +199,9 @@ - - +
__( 'Max options to show', 'tainacan' ), 'label_unamed_process' => __( 'Unamed process', 'tainacan' ), 'label_semantic_uri' => __( 'Semantic Uri', 'tainacan' ), - 'label_view_collection' => __( 'View collection', 'tainacan' ), + 'label_view_collection_on_website' => __( 'View collection on website', 'tainacan' ), 'label_view_more' => __( 'View more', 'tainacan' ), 'label_log_file' => __( 'Log file', 'tainacan' ), 'label_error_log_file' => __( 'Error Log file', 'tainacan' ), From aa2a33b2f08e6087f48688fc8cab78f368eed9e4 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Wed, 7 Aug 2019 14:48:48 -0300 Subject: [PATCH 015/104] Function to get styles from block. --- .../tainacan-gutenberg-block-search-bar.css | 40 ++++++++++-------- ...ainacan-gutenberg-block-search-bar.css.map | 2 +- .../dynamic-items-list/index.js | 1 - .../tainacan-items/search-bar/index.js | 41 +++++++++++++------ .../tainacan-items/search-bar/search-bar.scss | 36 ++++++++++------ 5 files changed, 77 insertions(+), 43 deletions(-) diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css b/src/assets/css/tainacan-gutenberg-block-search-bar.css index 616e62b99..11741a58b 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css @@ -163,6 +163,8 @@ .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block.is-aligned-right { margin-right: 0; justify-content: flex-end; } + .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block:hover, .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block:focus, .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block:active { + border: 1px solid #545758; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input { width: 100%; min-width: 28px; @@ -170,9 +172,6 @@ border: none; padding: 4px 0.75rem; text-overflow: ellipsis; } - .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active { - border: 1px solid #545758; - border-right: none; } .wp-block-tainacan-search-bar .tainacan-search-container form#taincan-search-bar-block button { height: auto; display: flex; @@ -198,6 +197,8 @@ .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block.is-aligned-right { margin-right: 0; justify-content: flex-start; } + .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block:focus, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block:active, .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block:hover { + border: none; } .wp-block-tainacan-search-bar.is-style-alternate form#taincan-search-bar-block input#taincan-search-bar-block_input { width: 35%; border-radius: 0; @@ -238,15 +239,20 @@ margin-left: 0px !important; padding-left: 4px !important; border-color: #dbdbdb !important; } } - .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover input::placeholder { + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus input, + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active input, + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover input, + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover input::placeholder { color: #454647; border-width: 0; } .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:focus button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:active button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block:hover button .icon svg { fill: #cbcbcb !important; } - .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input::placeholder { + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input { color: white; } - .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:hover, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:hover::placeholder { - color: #454647; } + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input::placeholder { + color: white; } + .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:hover, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:focus::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:active::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block input#taincan-search-bar-block_input:hover::placeholder { + color: #454647; } .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container form#taincan-search-bar-block button .icon svg { fill: #dbdbdb !important; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block { @@ -255,6 +261,8 @@ display: flex; flex-direction: row; border: none; } + .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block:focus, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block:active, .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block:hover { + border: none; } .wp-block-tainacan-search-bar.is-style-stylish form#taincan-search-bar-block:hover input#taincan-search-bar-block_input { width: 100%; padding-right: 52px; @@ -304,8 +312,8 @@ padding-left: 4px !important; border-color: #dbdbdb !important; } } .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .tainacan-search-container { - width: calc(100% - 4.1667% - 26px); - width: calc(100% - 4.1667vw - 26px); + width: calc(100% - 4.1667% - 53px); + width: calc(100% - 4.1667vw - 53px); bottom: calc(-50% + 38px); position: absolute; } .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .search-bar-collection-header-title { @@ -347,8 +355,8 @@ flex-wrap: wrap; align-items: center; flex-grow: 2; - padding: 1rem 4.1667%; - padding: 1rem 4.1667vw; + padding: 0.5rem 4.1667%; + padding: 0.5rem 4.1667vw; text-align: center; text-decoration: none !important; } .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left { @@ -368,14 +376,15 @@ .wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right .search-bar-collection-header-title { text-align: left; } .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title { - width: 100%; } + width: 100%; + color: white; } .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title h3 { margin: 0 auto; - color: white; text-decoration: none; font-size: 1.3rem; line-height: 1.5rem; - text-overflow: ellipsis; } + text-overflow: ellipsis; + color: inherit; } .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title h3:hover { text-decoration: none; } .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title span.label { @@ -383,8 +392,7 @@ display: block; margin-top: -12px; font-weight: normal; - font-size: 1rem; - color: white; } + font-size: 1rem; } @media only screen and (max-width: 1024px) { .wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title { margin-bottom: 1rem; } } diff --git a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map index f04a67345..e6be668a2 100644 --- a/src/assets/css/tainacan-gutenberg-block-search-bar.css.map +++ b/src/assets/css/tainacan-gutenberg-block-search-bar.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5B,cAAe;EACX,OAAO,EA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AAK;MAEZ,4GAAG;QACC,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,OAAO;QACd,kHAAQ;UACJ,eAAe,EAAE,IAAI;MAG7B,oHAAW;QACP,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,MAAM;QACnB,SAAS,EAAE,IAAI;IAKvB,0CAA2C;MACvC,yGAAoC;QAAE,aAAa,EAAE,IAAI", "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"], "names": [], "file": "tainacan-gutenberg-block-search-bar.css" diff --git a/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js b/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js index faff027dc..6168733cb 100644 --- a/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js +++ b/src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js @@ -140,7 +140,6 @@ registerBlockType('tainacan/dynamic-items-list', { showCollectionHeader, showCollectionLabel, isLoadingCollection, - collection, collectionBackgroundColor, collectionTextColor } = attributes; diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index 1b8596d48..e41f67195 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -1,4 +1,4 @@ -const { registerBlockType } = wp.blocks; +const { registerBlockType, getBlockStyles, getBlockAttributes } = wp.blocks; const { __ } = wp.i18n; @@ -90,7 +90,7 @@ registerBlockType('tainacan/search-bar', { collectionTextSize: { type: Number, default: 2 - } + }, }, supports: { align: ['full', 'wide', 'left', 'center', 'right'], @@ -236,6 +236,18 @@ registerBlockType('tainacan/search-bar', { setContent(); } + function getCurrentStyle() { + if (isSelected) { + if (className.split(' ').find((aClass) => aClass == 'is-style-alternate')) { + return 'alternate' + } else if (className.split(' ').find((aClass) => aClass == 'is-style-stylish')) { + return 'stylish' + } + } + return 'default' + } + + // Executed only on the first load of page if(content && content.length && content[0].type) setContent(); @@ -260,7 +272,7 @@ registerBlockType('tainacan/search-bar', { isActive: alignment === 'right', }, ]; - + return (
@@ -310,8 +322,10 @@ registerBlockType('tainacan/search-bar', { checked={ showCollectionHeader } onChange={ ( isChecked ) => { showCollectionHeader = isChecked; - if (isChecked) fetchCollectionForHeader(); + if (isChecked) + fetchCollectionForHeader(); setAttributes({ showCollectionHeader: showCollectionHeader }); + setContent(); } } /> @@ -338,6 +352,7 @@ registerBlockType('tainacan/search-bar', { onChange={ ( isChecked ) => { showCollectionLabel = isChecked; setAttributes({ showCollectionLabel: showCollectionLabel }); + setContent(); } } /> @@ -349,7 +364,8 @@ registerBlockType('tainacan/search-bar', { color={ collectionBackgroundColor } onChangeComplete={ ( value ) => { collectionBackgroundColor = value.hex; - setAttributes({ collectionBackgroundColor: collectionBackgroundColor }) + setAttributes({ collectionBackgroundColor: collectionBackgroundColor }) ; + setContent(); }} disableAlpha /> @@ -363,7 +379,8 @@ registerBlockType('tainacan/search-bar', { value={ collectionTextColor } onChange={ ( color ) => { collectionTextColor = color; - setAttributes({ collectionTextColor: collectionTextColor }) + setAttributes({ collectionTextColor: collectionTextColor }); + setContent(); }} /> @@ -372,14 +389,13 @@ registerBlockType('tainacan/search-bar', { label={__('Collection name size', 'tainacan')} value={ collectionTextSize ? collectionTextSize : 2 } options={ [ - { label: __('Huge', 'tainacan'), value: 3 }, { label: __('Large', 'tainacan'), value: 2.5 }, { label: __('Medium', 'tainacan'), value: 2 }, { label: __('Small', 'tainacan'), value: 1.5 }, ] } onChange={ ( size ) => { collectionTextSize = size; - setAttributes({ collectionTextSize: collectionTextSize }) + setAttributes({ collectionTextSize: collectionTextSize }); }} />
@@ -469,12 +485,11 @@ registerBlockType('tainacan/search-bar', { style={{ backgroundColor: collectionBackgroundColor }}> -
+
{ showCollectionLabel ? { __('Collection', 'tainacan') } : null } -

+

{ collection && collection.name ? collection.name : '' }

diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss index 881532e37..640174538 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss @@ -28,6 +28,11 @@ margin-right: 0; justify-content: flex-end; } + &:hover, + &:focus, + &:active { + border: 1px solid #545758; + } input#taincan-search-bar-block_input { width: 100%; @@ -36,11 +41,6 @@ border: none; padding: 4px 0.75rem; text-overflow: ellipsis; - &:focus, - &:active { - border: 1px solid #545758; - border-right: none; - } } button { height: auto; @@ -78,7 +78,11 @@ margin-right: 0; justify-content: flex-start; } - + &:focus, + &:active, + &:hover { + border: none; + } input#taincan-search-bar-block_input { width: 35%; border-radius: 0; @@ -143,6 +147,7 @@ &:focus, &:active, &:hover { + input, input::placeholder { color: #454647; border-width: 0; @@ -155,6 +160,7 @@ } input#taincan-search-bar-block_input { + color: white; &::placeholder { color: white; } &:focus, @@ -184,6 +190,12 @@ flex-direction: row; border: none; + &:focus, + &:active, + &:hover { + border: none; + } + &:hover input#taincan-search-bar-block_input { width: 100%; padding-right: 52px; @@ -258,8 +270,8 @@ &:not(.is-aligned-right):not(.is-aligned-left) { .tainacan-search-container { - width: calc(100% - 4.1667% - 26px); - width: calc(100% - 4.1667vw - 26px); + width: calc(100% - 4.1667% - 53px); + width: calc(100% - 4.1667vw - 53px); bottom: calc(-50% + 38px); position: absolute; } @@ -320,8 +332,8 @@ flex-wrap: wrap; align-items: center; flex-grow: 2; - padding: 1rem 4.1667%; - padding: 1rem 4.1667vw; + padding: 0.5rem 4.1667%; + padding: 0.5rem 4.1667vw; text-align: center; text-decoration: none !important; @@ -346,14 +358,15 @@ .search-bar-collection-header-title { width: 100%; + color: white; h3 { margin: 0 auto; - color: white; text-decoration: none; font-size: 1.3rem; line-height: 1.5rem; text-overflow: ellipsis; + color: inherit; &:hover { text-decoration: none; } @@ -364,7 +377,6 @@ margin-top: -12px; font-weight: normal; font-size: 1rem; - color: white; } } From 6b230f9b87beefea69c8db89bfcfa5f865f65988 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Wed, 7 Aug 2019 14:59:38 -0300 Subject: [PATCH 016/104] Fixes english labels on carousel and removes extraParams object. --- .../carousel-items-list/carousel-items-list-theme.js | 7 ++----- .../tainacan-items/carousel-items-list/index.js | 12 +++--------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.js b/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.js index 9cd31f64e..56088650f 100644 --- a/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.js +++ b/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.js @@ -23,8 +23,7 @@ document.addEventListener("DOMContentLoaded", () => { collectionTextColor: '#ffffff', tainacanApiRoot: '', tainacanBaseUrl: '', - className: '', - extraParams: {} + className: '' }, render(h){ return h(CarouselItemsListTheme, { @@ -45,8 +44,7 @@ document.addEventListener("DOMContentLoaded", () => { collectionTextColor: this.collectionTextColor, tainacanApiRoot: this.tainacanApiRoot, tainacanBaseUrl: this.tainacanBaseUrl, - className: this.className, - extraParams: this.extraParams + className: this.className } }); }, @@ -68,7 +66,6 @@ document.addEventListener("DOMContentLoaded", () => { this.collectionTextColor = this.$el.attributes['collection-text-color'] != undefined ? this.$el.attributes['collection-text-color'].value : undefined; this.tainacanApiRoot = this.$el.attributes['tainacan-api-root'] != undefined ? this.$el.attributes['tainacan-api-root'].value : undefined; this.tainacanBaseUrl = this.$el.attributes['tainacan-base-url'] != undefined ? this.$el.attributes['tainacan-base-url'].value : undefined; - this.extraParams = this.$el.attributes['extra-params'] != undefined ? JSON.parse(this.$el.attributes['extra-params'].value) : undefined; }, methods: { __(text, domain) { diff --git a/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js b/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js index 455fd309b..a07a329bf 100644 --- a/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js +++ b/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js @@ -114,10 +114,6 @@ registerBlockType('tainacan/carousel-items-list', { collectionTextColor: { type: String, default: "#ffffff" - }, - extraParams: { - type: Object, - default: {} } }, supports: { @@ -417,7 +413,7 @@ registerBlockType('tainacan/carousel-items-list', { /> { autoPlay = isChecked; @@ -428,7 +424,7 @@ registerBlockType('tainacan/carousel-items-list', { { autoPlay ? { autoPlaySpeed = aAutoPlaySpeed; @@ -713,8 +709,7 @@ registerBlockType('tainacan/carousel-items-list', { showCollectionHeader, showCollectionLabel, collectionBackgroundColor, - collectionTextColor, - extraParams + collectionTextColor } = attributes; return
{ content }
From c4626c53c039130bbb84a6ec7ce199c56c62d5a2 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Wed, 7 Aug 2019 15:31:42 -0300 Subject: [PATCH 017/104] Transition animation for card and record action bar --- src/admin/scss/_view-mode-cards.scss | 12 +++++++++--- src/admin/scss/_view-mode-records.scss | 11 +++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/admin/scss/_view-mode-cards.scss b/src/admin/scss/_view-mode-cards.scss index d7b894243..d6eca1274 100644 --- a/src/admin/scss/_view-mode-cards.scss +++ b/src/admin/scss/_view-mode-cards.scss @@ -64,22 +64,28 @@ .actions-area { position: relative; float: right; - top: -7px; + top: -25px; padding-right: 12px; - //width: 80px; display: flex; justify-content: space-between; visibility: hidden; opacity: 0; - transition: visibility 0.2s, opacity 0.2s; + transition: visibility 0.2s ease, opacity 0.3s ease, top 0.2s ease; a { + opacity: 0; margin-left: 12px; + transition: opacity 0.3s ease; } } &:hover .actions-area { visibility: visible; opacity: 1.0; + top: -7px; + + a { + opacity: 1; + } } .card-line { diff --git a/src/admin/scss/_view-mode-records.scss b/src/admin/scss/_view-mode-records.scss index ab893cb0c..954c91480 100644 --- a/src/admin/scss/_view-mode-records.scss +++ b/src/admin/scss/_view-mode-records.scss @@ -44,22 +44,29 @@ .actions-area { position: relative; float: right; - top: -7px; + top: -25px; padding-right: 12px; //width: 80px; display: flex; justify-content: space-between; visibility: hidden; opacity: 0; - transition: visibility 0.2s, opacity 0.2s; + transition: visibility 0.2s, opacity 0.3s ease, top 0.2s ease; a { margin-left: 12px; + opacity: 0; + transition: opacity 0.3s ease; } } &:hover .actions-area { visibility: visible; opacity: 1.0; + top: -7px; + + a { + opacity: 1; + } } .record-line { From 98f70f29b21ae15783ab30e739d961104374b850 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Thu, 8 Aug 2019 16:50:49 -0300 Subject: [PATCH 018/104] First experiments with logic for passing cookies to exposer links. --- src/admin/components/other/exposers-modal.vue | 28 +++ .../tainacan-items/search-bar/index.js | 191 +++++++++--------- .../search-bar/search-bar-modal.js | 23 ++- 3 files changed, 139 insertions(+), 103 deletions(-) diff --git a/src/admin/components/other/exposers-modal.vue b/src/admin/components/other/exposers-modal.vue index d994aa08a..79aba04c1 100644 --- a/src/admin/components/other/exposers-modal.vue +++ b/src/admin/components/other/exposers-modal.vue @@ -210,6 +210,21 @@ + + + + +
@@ -417,6 +432,19 @@ export default { document.body.removeChild(textArea); }, + openFile(url, name){ + let xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function (data) { + if (this.readyState == 4 && this.status == 200 && data.target && data.target.response) { + let blob = new Blob([data.target.response]); + let newWindow = window.open(window.URL.createObjectURL(blob), name); + newWindow.focus(); + } + }; + xhttp.open("GET", url, true); + xhttp.setRequestHeader("X-WP-Nonce", tainacan_plugin.nonce); + xhttp.send(); + }, copyTextToClipboard(text) { if (!navigator.clipboard) { diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/index.js b/src/gutenberg-blocks/tainacan-items/search-bar/index.js index e41f67195..16c1d5829 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/index.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/index.js @@ -1,4 +1,4 @@ -const { registerBlockType, getBlockStyles, getBlockAttributes } = wp.blocks; +const { registerBlockType } = wp.blocks; const { __ } = wp.i18n; @@ -59,10 +59,6 @@ registerBlockType('tainacan/search-bar', { type: String, default: __('Search', 'taincan') }, - isLoadingCollection: { - type: Boolean, - value: false - }, showCollectionHeader: { type: Boolean, value: false @@ -75,10 +71,6 @@ registerBlockType('tainacan/search-bar', { type: Number, value: 165 }, - collection: { - type: Object, - value: undefined - }, collectionBackgroundColor: { type: String, default: "#454647" @@ -87,6 +79,14 @@ registerBlockType('tainacan/search-bar', { type: String, default: "#ffffff" }, + collectionHeaderImage: { + type: String, + default: undefined + }, + collectionName: { + type: String, + default: undefined + }, collectionTextSize: { type: Number, default: 2 @@ -109,7 +109,7 @@ registerBlockType('tainacan/search-bar', { label: __('stylish', 'tainacan'), } ], - edit({ attributes, setAttributes, className, isSelected, clientId }){ + edit({ attributes, setAttributes, className, isSelected }){ let { content, collectionId, @@ -122,15 +122,12 @@ registerBlockType('tainacan/search-bar', { maxWidth, showCollectionHeader, showCollectionLabel, - isLoadingCollection, - collection, collectionBackgroundColor, - collectionTextColor + collectionTextColor, + collectionHeaderImage, + collectionName } = attributes; - // Obtains block's client id to render it on save function - setAttributes({ blockId: clientId }); - function setContent(){ setAttributes({ @@ -174,8 +171,7 @@ registerBlockType('tainacan/search-bar', { -
- ) +
) }); jQuery( document ).ready(function() { jQuery('.editor-writing-flow').on('submit','form', (function(e) { @@ -189,40 +185,6 @@ registerBlockType('tainacan/search-bar', { }); } - function fetchCollectionForHeader() { - if (showCollectionHeader) { - - isLoadingCollection = true; - setAttributes({ - isLoadingCollection: isLoadingCollection - }); - - tainacan.get('/collections/' + collectionId + '?fetch_only=name,thumbnail,header_image') - .then(response => { - collection = response.data; - isLoadingCollection = false; - - if (collection.tainacan_theme_collection_background_color) - collectionBackgroundColor = collection.tainacan_theme_collection_background_color; - else - collectionBackgroundColor = '#454647'; - - if (collection.tainacan_theme_collection_color) - collectionTextColor = collection.tainacan_theme_collection_color; - else - collectionTextColor = '#ffffff'; - - setAttributes({ - collection: collection, - isLoadingCollection: isLoadingCollection, - collectionBackgroundColor: collectionBackgroundColor, - collectionTextColor: collectionTextColor - }); - setContent(); - }); - } - } - function openSearchBarModal() { isModalOpen = true; setAttributes( { @@ -322,8 +284,6 @@ registerBlockType('tainacan/search-bar', { checked={ showCollectionHeader } onChange={ ( isChecked ) => { showCollectionHeader = isChecked; - if (isChecked) - fetchCollectionForHeader(); setAttributes({ showCollectionHeader: showCollectionHeader }); setContent(); } @@ -332,7 +292,7 @@ registerBlockType('tainacan/search-bar', { { showCollectionHeader ?
- { collection && collection.header_image ? + { collectionHeaderImage ? { collectionId = selectedCollection.id; collectionSlug = selectedCollection.slug; + collectionName = selectedCollection.name; + collectionHeaderImage = selectedCollection.header_image; + collectionBackgroundColor = selectedCollection.tainacan_theme_collection_background_color ? selectedCollection.tainacan_theme_collection_background_color : '#454647' + collectionTextColor = selectedCollection.tainacan_theme_collection_color ? selectedCollection.tainacan_theme_collection_color : '#ffffff'; setAttributes({ collectionId: collectionId, collectionSlug: collectionSlug, + collectionHeaderImage: collectionHeaderImage, + collectionName: collectionName, + collectionBackgroundColor: collectionBackgroundColor, + collectionTextColor: collectionTextColor, isModalOpen: false }); - fetchCollectionForHeader(); setContent(); }} onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> @@ -460,47 +427,39 @@ registerBlockType('tainacan/search-bar', { { showCollectionHeader ? -
{ - isLoadingCollection ? -
- -
- : -
- { collection.header_image ? -
-
: null - } +
+ { collectionHeaderImage ?
-
- { showCollectionLabel ? { __('Collection', 'tainacan') } : null } -

- { collection && collection.name ? collection.name : '' } -

-
- { collectionId && collectionSlug ? - content - : null - } +
: null + } +
+
+ { showCollectionLabel ? { __('Collection', 'tainacan') } : null } +

+ { collectionName ? collectionName : '' } +

+ { collectionId && collectionSlug ? + content + : null + }
- } -
+
: null } @@ -539,19 +498,53 @@ registerBlockType('tainacan/search-bar', { } { collectionId && collectionSlug && !showCollectionHeader? -
- { content } -
+
+
+ + +
+
: null }
); }, save({ attributes, className }){ - const { - content - } = attributes; - + const { content } = attributes; return
{ content }
} }); \ No newline at end of file diff --git a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js index e4e9145f8..dd7395dd0 100644 --- a/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js +++ b/src/gutenberg-blocks/tainacan-items/search-bar/search-bar-modal.js @@ -68,7 +68,10 @@ export default class SearchBarModal extends React.Component { otherModalCollections.push({ name: collection.name, id: collection.id, - slug: collection.slug + slug: collection.slug, + header_image: collection.header_image, + tainacan_theme_collection_background_color: collection.tainacan_theme_collection_background_color, + tainacan_theme_collection_color: collection.tainacan_theme_collection_color }); } @@ -89,13 +92,18 @@ export default class SearchBarModal extends React.Component { let selectedCollection; if (selectedCollectionId == 'default') - selectedCollection = { label: __('Repository items', 'tainacan'), id: 'default', slug: tainacan_plugin.theme_items_list_url.split('/')[tainacan_plugin.theme_items_list_url.split('/').length - 1] }; + selectedCollection = { + label: __('Repository items', 'tainacan'), + name: __('Repository items', 'tainacan'), + id: 'default', + slug: tainacan_plugin.theme_items_list_url.split('/')[tainacan_plugin.theme_items_list_url.split('/').length - 1] + }; else { selectedCollection = this.state.modalCollections.find((collection) => collection.id == selectedCollectionId) if (selectedCollection == undefined) selectedCollection = this.state.collections.find((collection) => collection.id == selectedCollectionId) } - + console.log(selectedCollection) this.setState({ collectionId: selectedCollection.id, collectionSlug: selectedCollection.slug @@ -124,7 +132,14 @@ export default class SearchBarModal extends React.Component { tainacan.get(endpoint, { cancelToken: aCollectionRequestSource.token }) .then(response => { - let someCollections = response.data.map((collection) => ({ name: collection.name, id: collection.id + '' })); + let someCollections = response.data.map((collection) => ({ + name: collection.name, + id: collection.id + '', + header_image: collection.header_image, + slug: collection.slug, + tainacan_theme_collection_background_color: collection.tainacan_theme_collection_background_color, + tainacan_theme_collection_color: collection.tainacan_theme_collection_color + })); this.setState({ isLoadingCollections: false, From 89e7d9eeb14fa400e2f8c7f5e61537bbc46cab3d Mon Sep 17 00:00:00 2001 From: leogermani Date: Fri, 9 Aug 2019 15:38:04 -0300 Subject: [PATCH 019/104] allow external pdfs; protect against external embed of pdf iframe #292 --- src/pdf-viewer/pdf-viewer.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/pdf-viewer/pdf-viewer.js b/src/pdf-viewer/pdf-viewer.js index 287132ada..75c97bfa5 100644 --- a/src/pdf-viewer/pdf-viewer.js +++ b/src/pdf-viewer/pdf-viewer.js @@ -1846,29 +1846,27 @@ var PDFViewerApplication = { _boundEvents.windowAfterPrint = null; } }; -var validateFileURL = void 0; +var validateViewerURL = void 0; { - var HOSTED_VIEWER_ORIGINS = ['null', 'http://mozilla.github.io', 'https://mozilla.github.io']; - validateFileURL = function validateFileURL(file) { + validateViewerURL = function validateViewerURL(file) { if (file === undefined) { return; } - try { - var viewerOrigin = new URL(window.location.href).origin || 'null'; - if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) { - return; - } - var fileOrigin = new URL(file, window.location.href).origin; - if (fileOrigin !== viewerOrigin) { - throw new Error('file origin does not match viewer\'s'); - } - } catch (ex) { - var message = ex && ex.message; - PDFViewerApplication.l10n.get('loading_error', null, 'An error occurred while loading the PDF.').then(function (loadingErrorMessage) { - PDFViewerApplication.error(loadingErrorMessage, { message: message }); - }); - throw ex; + if (window.self != window.top) { + // iframe + var viewerOrigin = window.location.hostname; + try { + // if parent is in a different domain, it will trigger an error + var parentOrigin = window.parent.location.hostname; + } catch (e) { + var message = 'parent origin does not match viewer\'s'; + PDFViewerApplication.l10n.get('loading_error', null, 'An error occurred while loading the PDF.').then(function (loadingErrorMessage) { + PDFViewerApplication.error(loadingErrorMessage, { message: message }); + }); + throw e; + } } + }; } function loadAndEnablePDFBug(enabledTabs) { @@ -1896,7 +1894,7 @@ function webViewerInitialized() { var queryString = document.location.search.substring(1); var params = (0, _ui_utils.parseQueryString)(queryString); file = 'file' in params ? params.file : appConfig.defaultUrl; - validateFileURL(file); + validateViewerURL(file); var waitForBeforeOpening = []; var fileInput = document.createElement('input'); fileInput.id = appConfig.openFileInputName; From 28b96909096cf77b64daab60d60ac7a60442f352 Mon Sep 17 00:00:00 2001 From: leogermani Date: Mon, 29 Jul 2019 11:40:29 -0300 Subject: [PATCH 020/104] Display full hierarchy for taxonomy metadata #283 --- .../taxonomy/class-tainacan-taxonomy.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php b/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php index a01bff51a..51d828fcc 100644 --- a/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php +++ b/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php @@ -220,7 +220,7 @@ class Taxonomy extends Metadata_Type { if ( $term instanceof \Tainacan\Entities\Term ) { $return .= $prefix; - $return .= $term->_toHtml(); + $return .= $this->get_term_hierarchy_html($term); $return .= $suffix; @@ -244,6 +244,23 @@ class Taxonomy extends Metadata_Type { } + private function get_term_hierarchy_html( \Tainacan\Entities\Term $term ) { + + $terms = []; + + $terms[] = $term->_toHtml(); + + while ($term->get_parent() > 0) { + $term = \Tainacan\Repositories\Terms::get_instance()->fetch( (int) $term->get_parent(), $term->get_taxonomy() ); + $terms[] = $term->_toHtml(); + } + + $terms = \array_reverse($terms); + + return \implode(' > ', $terms); + + } + public function _toArray() { $array = parent::_toArray(); From f918c92588c90cc3a8612981351f055296b61191 Mon Sep 17 00:00:00 2001 From: leogermani Date: Mon, 29 Jul 2019 15:06:05 -0300 Subject: [PATCH 021/104] Add support for LIKE operator to Tax_Query in Tainacan API #266 --- src/api/class-tainacan-rest-controller.php | 37 ++++ .../repositories/class-tainacan-items.php | 74 -------- tests/test-api-items.php | 169 ++++++++++++++++++ 3 files changed, 206 insertions(+), 74 deletions(-) diff --git a/src/api/class-tainacan-rest-controller.php b/src/api/class-tainacan-rest-controller.php index df1fd6c54..ed121ad74 100644 --- a/src/api/class-tainacan-rest-controller.php +++ b/src/api/class-tainacan-rest-controller.php @@ -11,6 +11,7 @@ class REST_Controller extends \WP_REST_Controller { public function __construct() { $this->namespace = TAINACAN_REST_NAMESPACE; add_action('rest_api_init', array($this, 'register_routes')); + add_filter('tainacan-api-prepare-items-args', array($this, 'add_support_to_tax_query_like')); } /** @@ -144,7 +145,43 @@ class REST_Controller extends \WP_REST_Controller { $args['perm'] = 'readable'; + return apply_filters('tainacan-api-prepare-items-args', $args, $request); + } + + public function add_support_to_tax_query_like($args) { + + if (!isset($args['tax_query']) || !is_array($args['tax_query'])) { + return $args; + } + + $new_tax_query = []; + + foreach ($args['tax_query'] as $index => $tax_query) { + + if ( isset($tax_query['operator']) && $tax_query['operator'] == 'LIKE' && + isset($tax_query['terms']) && is_string($tax_query['terms']) ) { + + $terms = get_terms([ + 'taxonomy' => $tax_query['taxonomy'], + 'fields' => 'ids', + 'search' => $tax_query['terms'] + ]); + + $new_tax_query[] = [ + 'taxonomy' => $tax_query['taxonomy'], + 'terms' => $terms, + ]; + + } else { + $new_tax_query[] = $tax_query; + } + + } + + $args['tax_query'] = $new_tax_query; + return $args; + } /** diff --git a/src/classes/repositories/class-tainacan-items.php b/src/classes/repositories/class-tainacan-items.php index 05e84bd2c..30ed2c549 100644 --- a/src/classes/repositories/class-tainacan-items.php +++ b/src/classes/repositories/class-tainacan-items.php @@ -286,11 +286,6 @@ class Items extends Repository { $args['post_type'] = $cpt; - // In progress... - // if (isset($args['meta_query'])) { - // $args = $this->transform_meta_query_to_tax_query($args); - // } - $args = apply_filters( 'tainacan_fetch_args', $args, 'items' ); $wp_query = new \WP_Query( $args ); @@ -381,75 +376,6 @@ class Items extends Repository { return $where; } - public function transform_meta_query_to_tax_query($args) { - - if (!isset($args['meta_query']) || !is_array($args['meta_query'])) { - return $args; - } - - $metas = []; - - foreach ($args['meta_query'] as $i => $meta_q) { - if (is_array($meta_q) && isset($meta_q['key']) && is_numeric($meta_q['key'])) { - $metas[$meta_q['key']] = $i; - } - } - - $metadata = Metadata::get_instance()->fetch([ - 'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy', - 'post__in' => array_keys($metas) - ], 'OBJECT'); - - if (empty($metadata)) { - return $args; - } - - if (!isset($args['tax_query'])) { - $args['tax_query'] = []; - } - - foreach ($metadata as $metadatum) { - if ( isset($metas[$metadatum->get_id()]) ) { - $index = $metas[$metadatum->get_id()]; - $metaquery = $args['meta_query'][$index]; - $options = $metadatum->get_metadata_type_options(); - $tax_id = $options['taxonomy_id']; - $tax_slug = Taxonomies::get_instance()->get_db_identifier_by_id($tax_id); - - if (!isset($metaquery['compare']) || $metaquery['compare'] == '=' || $metaquery['compare'] == 'IN' ) { - - $args['tax_query'][] = [ - 'taxonomy' => $tax_slug, - 'field' => 'name', - 'terms' => $terms, - ]; - - } elseif ( strtoupper($metaquery['compare']) == 'LIKE') { - $search['search'] = $metaquery['value']; - - $terms = get_terms([ - 'taxonomy' => $tax_slug, - 'fields' => 'ids', - 'search' => $metaquery['value'] - ]); - - $args['tax_query'][] = [ - 'taxonomy' => $tax_slug, - 'terms' => $terms, - ]; - - } else { - continue; - } - - unset( $args['meta_query'][$index] ); - - } - } - - return $args; - - } /** * Get a default thumbnail ID from the item document. diff --git a/tests/test-api-items.php b/tests/test-api-items.php index 2fc5cf371..b707d4520 100644 --- a/tests/test-api-items.php +++ b/tests/test-api-items.php @@ -697,6 +697,175 @@ class TAINACAN_REST_Items_Controller extends TAINACAN_UnitApiTestCase { + } + + /* + * @group tax_query + */ + function test_support_tax_query_like() { + + $collection = $this->tainacan_entity_factory->create_entity( + 'collection', + array( + 'name' => 'Agile', + 'description' => 'Agile methods', + 'status' => 'publish' + ), + true + ); + + + $taxonomy = $this->tainacan_entity_factory->create_entity( + 'taxonomy', + array( + 'name' => 'taxonomy_public', + 'description' => 'taxonomy_public', + 'status' => 'publish' + ), + true + ); + + $tax_meta = $this->tainacan_entity_factory->create_entity( + 'metadatum', + array( + 'name' => 'metadata-public', + 'status' => 'publish', + 'collection' => $collection, + 'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy', + 'metadata_type_options' => [ + 'allow_new_terms' => 'yes', + 'taxonomy_id' => $taxonomy->get_id() + ], + 'multiple' => 'yes' + ), + true + ); + + $item1 = $this->tainacan_entity_factory->create_entity( + 'item', + array( + 'title' => 'Lean Startup', + 'description' => 'Um processo ágil de criação de novos negócios.', + 'collection' => $collection, + 'status' => 'publish' + ), + true + ); + + $itemMetaRepo = \Tainacan\Repositories\Item_Metadata::get_instance(); + + $newMeta = new \Tainacan\Entities\Item_Metadata_Entity($item1, $tax_meta); + $newMeta->set_value(['blue', 'mellon']); + $newMeta->validate(); + $itemMetaRepo->insert($newMeta); + + $item2 = $this->tainacan_entity_factory->create_entity( + 'item', + array( + 'title' => 'XXLean Startup', + 'description' => 'Um processo ágil de criação de novos negócios.', + 'collection' => $collection, + 'status' => 'publish' + ), + true + ); + + $newMeta = new \Tainacan\Entities\Item_Metadata_Entity($item2, $tax_meta); + $newMeta->set_value(['red', 'watermellon']); + $newMeta->validate(); + $itemMetaRepo->insert($newMeta); + + $item3 = $this->tainacan_entity_factory->create_entity( + 'item', + array( + 'title' => 'XXLean Startup', + 'description' => 'Um processo ágil de criação de novos negócios.', + 'collection' => $collection, + 'status' => 'publish' + ), + true + ); + + $newMeta = new \Tainacan\Entities\Item_Metadata_Entity($item3, $tax_meta); + $newMeta->set_value(['red', 'blue']); + $newMeta->validate(); + $itemMetaRepo->insert($newMeta); + + + #################################################### + + $request = new \WP_REST_Request('GET', $this->namespace . '/collection/' . $collection->get_id() . '/items'); + + $attributes = [ + 'taxquery' => [ + [ + 'taxonomy' => $taxonomy->get_db_identifier(), + 'operator' => 'LIKE', + 'terms' => 'mellon' + ] + ] + ]; + + $request->set_query_params($attributes); + $response = $this->server->dispatch($request); + + $this->assertEquals(200, $response->get_status()); + $data = $response->get_data()['items']; + + $this->assertEquals(2, count($data)); + $ids = array_map(function($e) { return $e['id']; }, $data); + $this->assertContains($item1->get_id(), $ids); + $this->assertContains($item2->get_id(), $ids); + + #################################################### + + $request = new \WP_REST_Request('GET', $this->namespace . '/collection/' . $collection->get_id() . '/items'); + + $attributes = [ + 'taxquery' => [ + [ + 'taxonomy' => $taxonomy->get_db_identifier(), + 'operator' => 'LIKE', + 'terms' => 'red' + ] + ] + ]; + + $request->set_query_params($attributes); + $response = $this->server->dispatch($request); + + $this->assertEquals(200, $response->get_status()); + $data = $response->get_data()['items']; + + $this->assertEquals(2, count($data)); + $ids = array_map(function($e) { return $e['id']; }, $data); + $this->assertContains($item2->get_id(), $ids); + $this->assertContains($item3->get_id(), $ids); + + #################################################### + + $request = new \WP_REST_Request('GET', $this->namespace . '/collection/' . $collection->get_id() . '/items'); + + $attributes = [ + 'taxquery' => [ + [ + 'taxonomy' => $taxonomy->get_db_identifier(), + 'operator' => 'LIKE', + 'terms' => 'water' + ] + ] + ]; + + $request->set_query_params($attributes); + $response = $this->server->dispatch($request); + + $this->assertEquals(200, $response->get_status()); + $data = $response->get_data()['items']; + + $this->assertEquals(1, count($data)); + $ids = array_map(function($e) { return $e['id']; }, $data); + $this->assertContains($item2->get_id(), $ids); + } } From ba3931288cf5d7a471dff6501e60fe18a41eec99 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Tue, 30 Jul 2019 10:11:14 -0300 Subject: [PATCH 022/104] Add span with class and filter to separators #283 --- .../metadata-types/taxonomy/class-tainacan-taxonomy.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php b/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php index 51d828fcc..b8f0ed43c 100644 --- a/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php +++ b/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php @@ -257,7 +257,9 @@ class Taxonomy extends Metadata_Type { $terms = \array_reverse($terms); - return \implode(' > ', $terms); + $glue = apply_filters('tainacan-terms-hierarchy-html-separator', ' > '); + + return \implode($glue, $terms); } From c3e1e6cee61537920f1398223bab8c7aed570ce5 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Tue, 30 Jul 2019 10:11:46 -0300 Subject: [PATCH 023/104] apply filter no hierarchy separator for CSV exporter #283 --- src/exporter/class-tainacan-csv.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/exporter/class-tainacan-csv.php b/src/exporter/class-tainacan-csv.php index 256c39c9a..2c84bde1c 100644 --- a/src/exporter/class-tainacan-csv.php +++ b/src/exporter/class-tainacan-csv.php @@ -21,6 +21,10 @@ class CSV extends Exporter { public function filter_multivalue_separator($separator) { return $this->get_option('multivalued_delimiter'); } + + public function filter_hierarchy_separator($separator) { + return '>>'; + } public function process_item( $item, $metadata ) { @@ -29,6 +33,7 @@ class CSV extends Exporter { $line[] = $item->get_id(); add_filter('tainacan-item-metadata-get-multivalue-separator', [$this, 'filter_multivalue_separator']); + add_filter('tainacan-terms-hierarchy-html-separator', [$this, 'filter_hierarchy_separator']); foreach ($metadata as $meta_key => $meta) { @@ -44,6 +49,7 @@ class CSV extends Exporter { } remove_filter('tainacan-item-metadata-get-multivalue-separator', [$this, 'filter_multivalue_separator']); + remove_filter('tainacan-terms-hierarchy-html-separator', [$this, 'filter_hierarchy_separator']); $line[] = $item->get_status(); From 1fee2374b30c7d29b3847b0006e944e20ea005f2 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Tue, 30 Jul 2019 10:13:05 -0300 Subject: [PATCH 024/104] change filters priority on csv exporter. avoid being overwritten #283 --- src/exporter/class-tainacan-csv.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exporter/class-tainacan-csv.php b/src/exporter/class-tainacan-csv.php index 2c84bde1c..b7995d25f 100644 --- a/src/exporter/class-tainacan-csv.php +++ b/src/exporter/class-tainacan-csv.php @@ -32,8 +32,8 @@ class CSV extends Exporter { $line[] = $item->get_id(); - add_filter('tainacan-item-metadata-get-multivalue-separator', [$this, 'filter_multivalue_separator']); - add_filter('tainacan-terms-hierarchy-html-separator', [$this, 'filter_hierarchy_separator']); + add_filter('tainacan-item-metadata-get-multivalue-separator', [$this, 'filter_multivalue_separator'], 20); + add_filter('tainacan-terms-hierarchy-html-separator', [$this, 'filter_hierarchy_separator'], 20); foreach ($metadata as $meta_key => $meta) { From 2af2d4b90d5c40b995927786c3a6d4bbd447671d Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Tue, 30 Jul 2019 10:27:40 -0300 Subject: [PATCH 025/104] decode special chars for terms names in facets endpoint #286 --- src/classes/repositories/class-tainacan-metadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/repositories/class-tainacan-metadata.php b/src/classes/repositories/class-tainacan-metadata.php index a809f8f4b..e9e857091 100644 --- a/src/classes/repositories/class-tainacan-metadata.php +++ b/src/classes/repositories/class-tainacan-metadata.php @@ -1092,7 +1092,7 @@ class Metadata extends Repository { $count_query = $wpdb->prepare("SELECT COUNT(term_id) FROM $wpdb->term_taxonomy WHERE parent = %d", $r->term_id); $total_children = $wpdb->get_var($count_query); - $label = $r->name; + $label = wp_specialchars_decode($r->name); $total_items = null; if ( $args['count_items'] ) { From 39e169e87ebbd88e1e9abaa2487fe81f9203857b Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 30 Jul 2019 13:53:27 -0300 Subject: [PATCH 026/104] Adds trash to possible values for bulk edit status. Removes double loading layer on item metadata bulk edition form. --- .../components/edition/item-metadata-bulk-edition-form.vue | 5 ----- src/admin/components/other/item-copy-dialog.vue | 2 +- src/classes/class-tainacan-bulk-edit.php | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/admin/components/edition/item-metadata-bulk-edition-form.vue b/src/admin/components/edition/item-metadata-bulk-edition-form.vue index 829453c43..b7aa273f8 100644 --- a/src/admin/components/edition/item-metadata-bulk-edition-form.vue +++ b/src/admin/components/edition/item-metadata-bulk-edition-form.vue @@ -136,11 +136,6 @@ - -