First commit on facets block.

This commit is contained in:
Mateus Machado Luna 2019-05-29 13:01:22 -03:00
parent 8840c654a9
commit 2f038fac12
16 changed files with 1950 additions and 5 deletions

View File

@ -72,6 +72,9 @@
width: 95%; } } width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label { .wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; } 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-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field { .wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0; padding: 0;

View File

@ -1,6 +1,6 @@
{ {
"version": 3, "version": 3,
"mappings": "AAEA,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,EA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-blocks/tainacan-collections/collections-list/collections-list.scss"], "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss"],
"names": [], "names": [],
"file": "tainacan-gutenberg-block-collections-list.css" "file": "tainacan-gutenberg-block-collections-list.css"

View File

@ -72,6 +72,9 @@
width: 95%; } } width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label { .wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; } 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-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field { .wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0; padding: 0;

File diff suppressed because one or more lines are too long

View File

@ -72,6 +72,9 @@
width: 95%; } } width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label { .wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; } 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-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field { .wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0; padding: 0;

View File

@ -1,6 +1,6 @@
{ {
"version": 3, "version": 3,
"mappings": "AAEA,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,E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;MAClB,OAAO,EAAE,CAAC;MACV,KAAK,EAAE,KAAK;MACZ,GAAG,EAAE,GAAG;MACR,eAAe,EAAE,MAAM;MACvB,OAAO,EAAE,GAAG;IAGhB,+EAAe;MACX,UAAU,EAAE,OAAO;MACnB,gBAAgB,EAAE,gBAAiC;MACnD,OAAO,EAAE,CAAC;MACV,KAAK,EAAE,IAAI;MACX,GAAG,EAAE,IAAI;MACT,MAAM,EAAE,iBAAiB;MACzB,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,wCAAwC;IAExD,qFAAqB;MACjB,gBAAgB,EAAE,gBAAiC;MACnD,MAAM,EAAE,4BAA4B;EAG5C,yCAA0C;IAEtC;sEACqC;MACjC,qBAAqB,EAAE,uBAAuB;MAE9C;0FAAkB;QACd,KAAK,EAAE,IAAI;QACX;gGAAI;UAAE,KAAK,EAAE,IAAI;EAM7B;oEACqC;IACjC,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,KAAK;IACd,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,OAAO,EAAE,YAAY;MACrB,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,IAAI;MAChB,SAAS,EAAE,GAAG;MACd,KAAK,EAAE,GAAG;MAEV;4FAAE;QACE,KAAK,EAAE,OAAO;QAId,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,IAAI;MAGhB;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI",
"sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/items-list/items-list.scss"], "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/items-list/items-list.scss"],
"names": [], "names": [],
"file": "tainacan-gutenberg-block-items-list.css" "file": "tainacan-gutenberg-block-items-list.css"

View File

@ -72,6 +72,9 @@
width: 95%; } } width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label { .wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; } 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-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field { .wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0; padding: 0;

View File

@ -1,6 +1,6 @@
{ {
"version": 3, "version": 3,
"mappings": "AAEA,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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AE,IAAI;MACnB,UAAU,EAAE,IAAI;MAChB,SAAS,EAAE,GAAG;MACd,KAAK,EAAE,GAAG;MAEV;4FAAE;QACE,KAAK,EAAE,OAAO;QAId,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,IAAI;MAGhB;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;EAKjC,0CAA2C;IACvC;wFACwD;MACpD,SAAS,EAAE,GAAG;MACd,KAAK,EAAE,GAAG;EAIlB,0CAA2C;IACvC;wFACwD;MACpD,SAAS,EAAE,GAAG;MACd,KAAK,EAAE,GAAG;EAIlB,yCAA0C;IACtC;wFACuD;MACnD,SAAS,EAAE,IAAI;MACf,KAAK,EAAE,IAAI",
"sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss"], "sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss"],
"names": [], "names": [],
"file": "tainacan-gutenberg-block-terms-list.css" "file": "tainacan-gutenberg-block-terms-list.css"

View File

@ -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_items_list');
add_action('init', 'tainacan_blocks_register_tainacan_dynamic_items_list'); add_action('init', 'tainacan_blocks_register_tainacan_dynamic_items_list');
add_action('init', 'tainacan_blocks_register_tainacan_collections_list'); add_action('init', 'tainacan_blocks_register_tainacan_collections_list');
add_action('init', 'tainacan_blocks_register_tainacan_facets_list');
add_action('init', 'tainacan_blocks_add_plugin_settings'); add_action('init', 'tainacan_blocks_add_plugin_settings');
@ -59,6 +60,36 @@ function tainacan_blocks_register_tainacan_terms_list(){
} }
} }
function tainacan_blocks_register_tainacan_facets_list(){
global $TAINACAN_BASE_URL;
wp_enqueue_script(
'facets-list-theme',
$TAINACAN_BASE_URL . '/assets/gutenberg_facets_list_theme-components.js',
array('wp-components')
);
wp_register_script(
'facets-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_facets_list-components.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
wp_register_style(
'facets-list',
$TAINACAN_BASE_URL . '/assets/css/tainacan-gutenberg-block-facets-list.css',
array('wp-edit-blocks')
);
if (function_exists('register_block_type')) {
register_block_type( 'tainacan/facets-list', array(
'editor_script' => 'facets-list',
'style' => 'facets-list',
'script' => 'facets-list-theme'
) );
}
}
function tainacan_blocks_register_tainacan_items_list(){ function tainacan_blocks_register_tainacan_items_list(){
global $TAINACAN_BASE_URL; global $TAINACAN_BASE_URL;
@ -156,4 +187,5 @@ function tainacan_blocks_add_plugin_settings() {
wp_localize_script( 'items-list', 'tainacan_plugin', $settings ); wp_localize_script( 'items-list', 'tainacan_plugin', $settings );
wp_localize_script( 'dynamic-items-list', 'tainacan_plugin', $settings ); wp_localize_script( 'dynamic-items-list', 'tainacan_plugin', $settings );
wp_localize_script( 'collections-list', 'tainacan_plugin', $settings ); wp_localize_script( 'collections-list', 'tainacan_plugin', $settings );
wp_localize_script( 'facets-list', 'tainacan_plugin', $settings );
} }

View File

@ -94,6 +94,11 @@
} }
} }
.modal-radio-area-label {
font-weight: bold;
margin-left: 1.75rem;
}
.modal-checkbox-list, .modal-checkbox-list,
.modal-radio-list .components-base-control__field { .modal-radio-list .components-base-control__field {
padding: 0; padding: 0;

View File

@ -0,0 +1,85 @@
import Vue from 'vue';
import FacetsListTheme from './facets-list-theme.vue';
// This is rendered on the theme side.
document.addEventListener("DOMContentLoaded", () => {
// Configure Vue logic before passing it to constructor:
let vueOptions = {
data: {
collectionId: '',
showImage: true,
showName: true,
layout: 'grid',
gridMargin: 0,
searchURL: '',
maxFacetsNumber: 12,
order: 'asc',
showSearchBar: false,
showCollectionHeader: false,
showCollectionLabel: false,
collectionBackgroundColor: '#454647',
collectionTextColor: '#ffffff',
tainacanApiRoot: '',
tainacanBaseUrl: '',
className: ''
},
render(h){
return h(FacetsListTheme, {
props: {
collectionId: this.collectionId,
showImage: this.showImage,
showName: this.showName,
layout: this.layout,
gridMargin: this.gridMargin,
searchURL: this.searchURL,
maxFacetsNumber: this.maxFacetsNumber,
order: this.order,
showSearchBar: this.showSearchBar,
showCollectionHeader: this.showCollectionHeader,
showCollectionLabel: this.showCollectionLabel,
collectionBackgroundColor: this.collectionBackgroundColor,
collectionTextColor: this.collectionTextColor,
tainacanApiRoot: this.tainacanApiRoot,
tainacanBaseUrl: this.tainacanBaseUrl,
className: this.className
}
});
},
beforeMount () {
this.className = this.$el.attributes.class != undefined ? this.$el.attributes.class.value : undefined;
this.searchURL = this.$el.attributes['search-url'] != undefined ? this.$el.attributes['search-url'].value : undefined;
this.collectionId = this.$el.attributes['collection-id'] != undefined ? this.$el.attributes['collection-id'].value : undefined;
this.showImage = this.$el.attributes['show-image'] != undefined ? this.$el.attributes['show-image'].value == 'true' : true;
this.showName = this.$el.attributes['show-name'] != undefined ? this.$el.attributes['show-name'].value == 'true' : true;
this.layout = this.$el.attributes['layout'] != undefined ? this.$el.attributes['layout'].value : undefined;
this.gridMargin = this.$el.attributes['grid-margin'] != undefined ? Number(this.$el.attributes['grid-margin'].value) : undefined;
this.maxFacetsNumber = this.$el.attributes['max-facets-number'] != undefined ? this.$el.attributes['max-facets-number'].value : undefined;
this.order = this.$el.attributes['order'] != undefined ? this.$el.attributes['order'].value : undefined;
this.showSearchBar = this.$el.attributes['show-search-bar'] != undefined ? this.$el.attributes['show-search-bar'].value == 'true' : false;
this.showCollectionHeader = this.$el.attributes['show-collection-header'] != undefined ? this.$el.attributes['show-collection-header'].value == 'true' : false;
this.showCollectionLabel = this.$el.attributes['show-collection-label'] != undefined ? this.$el.attributes['show-collection-label'].value == 'true' : false;
this.collectionBackgroundColor = this.$el.attributes['collection-background-color'] != undefined ? this.$el.attributes['collection-background-color'].value : undefined;
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;
},
methods: {
__(text, domain) {
return wp.i18n.__(text, domain);
}
}
};
// Gets all divs with content created by our block;
let blocks = document.getElementsByClassName('wp-block-tainacan-facets-list');
if (blocks) {
let blockIds = Object.values(blocks).map((block) => block.id);
// Creates a new Vue Instance to manage each block isolatelly
for (let blockId of blockIds) {
new Vue( Object.assign({ el: '#' + blockId }, jQuery.extend(true, {}, vueOptions)) );
}
}
});

View File

@ -0,0 +1,366 @@
<template>
<div :class="className">
<div v-if="showCollectionHeader">
<div
v-if="isLoadingCollection"
class="facets-collection-header skeleton"
:style="{ height: '165px' }"/>
<a
v-else
target="_blank"
:href="collection.url ? collection.url : ''"
class="facets-collection-header">
<div
:style="{
backgroundColor: collectionBackgroundColor ? collectionBackgroundColor : '',
paddingRight: collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium']) ? '' : '20px',
paddingTop: (!collection || !collection.thumbnail || (!collection.thumbnail['tainacan-medium'] && !collection.thumbnail['medium'])) ? '1rem' : '',
width: collection && collection.header_image ? '' : '100%'
}"
:class="
'collection-name ' +
((!collection || !collection.thumbnail || (!collection.thumbnail['tainacan-medium'] && !collection.thumbnail['medium'])) && (!collection || !collection.header_image) ? 'only-collection-name' : '')
">
<h3 :style="{ color: collectionTextColor ? collectionTextColor : '' }">
<span
v-if="showCollectionLabel"
class="label">
{{ $root.__('Collection', 'tainacan') }}
<br>
</span>
{{ collection && collection.name ? collection.name : '' }}
</h3>
</div>
<div
v-if="collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium'])"
class="collection-thumbnail"
:style="{
backgroundImage: 'url(' + (collection.thumbnail['tainacan-medium'] != undefined ? (collection.thumbnail['tainacan-medium'][0]) : (collection.thumbnail['medium'][0])) + ')',
}"/>
<div
class="collection-header-image"
:style="{
backgroundImage: collection.header_image ? 'url(' + collection.header_image + ')' : '',
minHeight: collection && collection.header_image ? '' : '80px',
display: !(collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium'])) ? collection && collection.header_image ? '' : 'none' : ''
}"/>
</a>
</div>
<div
v-if="showSearchBar"
class="facets-search-bar">
<button
@click="localOrder = 'asc'; fetchFacets()"
:class="localOrder == 'asc' ? 'sorting-button-selected' : ''"
:label="$root.__('Sort ascending', 'tainacan')">
<span class="icon">
<i>
<svg
width="24"
height="24"
viewBox="-2 -2 20 20">
<path d="M6.7,10.8l-3.3,3.3L0,10.8h2.5V0h1.7v10.8H6.7z M11.7,0.8H8.3v1.7h3.3V0.8z M14.2,5.8H8.3v1.7h5.8V5.8z M16.7,10.8H8.3v1.7 h8.3V10.8z"/>
</svg>
</i>
</span>
</button>
<button
@click="localOrder = 'desc'; fetchFacets(); "
:class="localOrder == 'desc' ? 'sorting-button-selected' : ''"
:label="$root.__('Sort descending', 'tainacan')">
<span class="icon">
<i>
<svg
width="24"
height="24"
viewBox="-2 -2 20 20">
<path
d="M6.7,3.3H4.2v10.8H2.5V3.3H0L3.3,0L6.7,3.3z M11.6,2.5H8.3v1.7h3.3V2.5z M14.1,7.5H8.3v1.7h5.8V7.5z M16.6,12.5H8.3v1.7 h8.3V12.5z"/>
</svg>
</i>
</span>
</button>
<button
@click="fetchFacets()"
:label="$root.__('Search', 'tainacan')"
class="search-button">
<span class="icon">
<i>
<svg
width="24"
height="24"
viewBox="-2 -2 20 20">
<path
class="st0"
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"/>
</svg>
</i>
</span>
</button>
<input
:value="searchString"
@input="(value) => applySearchString(value)"
type="text">
<button
class="previous-button"
v-if="paged > 1"
@click="paged--; fetchFacets()"
:label="$root.__('Previous page', 'tainacan')">
<span class="icon">
<i>
<svg
width="30"
height="30"
viewBox="0 2 20 20">
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>
<path
d="M0 0h24v24H0z"
fill="none"/>
</svg>
</i>
</span>
</button>
<button
:style="{ marginLeft: paged <= 1 ? 'auto' : '0' }"
class="next-button"
v-if="paged < totalFacets/maxFacetsNumber && facets.length < totalFacets"
@click="paged++; fetchFacets()"
:label="$root.__('Next page', 'tainacan')">
<span class="icon">
<i>
<svg
width="30"
height="30"
viewBox="0 2 20 20">
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/>
<path
d="M0 0h24v24H0z"
fill="none"/>
</svg>
</i>
</span>
</button>
</div>
<ul
v-if="isLoading"
:style="{
gridTemplateColumns: layout == 'grid' ? 'repeat(auto-fill, ' + (gridMargin + (showName ? 220 : 185)) + 'px)' : 'inherit',
marginTop: showSearchBar || showCollectionHeader ? '1.34rem' : '0px'
}"
class="facets-list"
:class="'facets-layout-' + layout + (!showName ? ' facets-list-without-margin' : '')">
<li
:key="facet"
v-for="facet in Number(maxFacetsNumber)"
class="facet-list-item skeleton"
:style="{
marginBottom: layout == 'grid' ? (showName ? gridMargin + 12 : gridMargin) + 'px' : '',
height: layout == 'grid' ? '230px' : '54px'
}" />
</ul>
<div v-else>
<ul
v-if="facets.length > 0"
:style="{
gridTemplateColumns: layout == 'grid' ? 'repeat(auto-fill, ' + (gridMargin + (showName ? 220 : 185)) + 'px)' : 'inherit',
marginTop: showSearchBar || showCollectionHeader ? '1.35rem' : '0px'
}"
class="facets-list"
:class="'facets-layout-' + layout + (!showName ? ' facets-list-without-margin' : '')">
<li
:key="index"
v-for="(facet, index) of facets"
class="facet-list-item"
:style="{ marginBottom: layout == 'grid' ? (showName ? gridMargin + 12 : gridMargin) + 'px' : ''}">
<a
:id="isNaN(facet.id) ? facet.id : 'facet-id-' + facet.id"
:href="facet.url"
target="_blank"
:class="(!showName ? 'facet-without-title' : '') + ' ' + (!showImage ? 'facet-without-image' : '')">
<img
:src="
facet.thumbnail && facet.thumbnail['tainacan-medium'][0] && facet.thumbnail['tainacan-medium'][0]
?
facet.thumbnail['tainacan-medium'][0]
:
(facet.thumbnail && facet.thumbnail['thumbnail'][0] && facet.thumbnail['thumbnail'][0]
?
facet.thumbnail['thumbnail'][0]
:
`${tainacanBaseUrl}/admin/images/placeholder_square.png`)
"
:alt="facet.title ? facet.title : $root.__('Thumbnail', 'tainacan')">
<span>{{ facet.title ? facet.title : '' }}</span>
</a>
</li>
</ul>
<div
v-else
class="spinner-container">
{{ $root.__('No facets found.', 'tainacan') }}
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
import qs from 'qs';
import { debounce } from 'lodash';
export default {
name: "FacetsListTheme",
data() {
return {
facets: [],
collection: undefined,
facetsRequestSource: undefined,
searchString: '',
isLoading: false,
isLoadingCollection: false,
localMaxFacetsNumber: undefined,
localOrder: undefined,
tainacanAxios: undefined,
paged: undefined,
totalFacets: 0
}
},
props: {
collectionId: String,
showImage: Boolean,
showName: Boolean,
layout: String,
gridMargin: Number,
searchURL: String,
maxFacetsNumber: Number,
order: String,
showSearchBar: Boolean,
showCollectionHeader: Boolean,
showCollectionLabel: Boolean,
collectionBackgroundColor: String,
collectionTextColor: String,
tainacanApiRoot: String,
tainacanBaseUrl: String,
className: String
},
methods: {
applySearchString: debounce(function(event) {
let value = event.target.value;
if (this.searchString != value) {
this.searchString = value;
this.paged = 1;
this.fetchFacets();
}
}, 500),
fetchFacets() {
this.facets = [];
this.isLoading = true;
if (this.facetsRequestSource != undefined && typeof this.facetsRequestSource == 'function')
this.facetsRequestSource.cancel('Previous facets search canceled.');
this.facetsRequestSource = axios.CancelToken.source();
let endpoint = '/collection' + this.searchURL.split('#')[1].split('/collections')[1];
let query = endpoint.split('?')[1];
let queryObject = qs.parse(query);
// Set up max facets to be shown
if (this.maxFacetsNumber != undefined && Number(this.maxFacetsNumber) > 0)
queryObject.perpage = this.maxFacetsNumber;
else if (queryObject.perpage != undefined && queryObject.perpage > 0)
this.localMaxFacetsNumber = queryObject.perpage;
else {
queryObject.perpage = 12;
this.localMaxFacetsNumber = 12;
}
// Set up sorting order
if (this.localOrder != undefined)
queryObject.order = this.localOrder;
else if (queryObject.order != undefined)
this.localOrder = queryObject.order;
else {
queryObject.order = 'asc';
this.localOrder = 'asc';
}
// Set up sorting order
if (this.searchString != undefined)
queryObject.search = this.searchString;
else if (queryObject.search != undefined)
this.searchString = queryObject.search;
else {
delete queryObject.search;
this.searchString = undefined;
}
// Set up paging
if (this.paged != undefined)
queryObject.paged = this.paged;
else if (queryObject.paged != undefined)
this.paged = queryObject.paged;
else
this.paged = 1;
// Remove unecessary queries
delete queryObject.readmode;
delete queryObject.iframemode;
delete queryObject.admin_view_mode;
delete queryObject.fetch_only_meta;
endpoint = endpoint.split('?')[0] + '?' + qs.stringify(queryObject) + '&fetch_only=title,url,thumbnail';
this.tainacanAxios.get(endpoint, { cancelToken: this.facetsRequestSource.token })
.then(response => {
for (let facet of response.data.facets)
this.facets.push(facet);
this.isLoading = false;
this.totalFacets = response.headers['x-wp-total'];
}).catch(() => {
this.isLoading = false;
// console.log(error);
});
},
fetchCollectionForHeader() {
if (this.showCollectionHeader) {
this.isLoadingCollection = true;
this.tainacanAxios.get('/collections/' + this.collectionId + '?fetch_only=name,thumbnail,header_image')
.then(response => {
this.collection = response.data;
this.isLoadingCollection = false;
});
}
}
},
created() {
this.tainacanAxios = axios.create({ baseURL: this.tainacanApiRoot });
this.localOrder = this.order;
if (this.showCollectionHeader)
this.fetchCollectionForHeader();
this.fetchFacets();
},
}
</script>
<style lang="scss">
@import './facets-list.scss';
</style>

View File

@ -0,0 +1,371 @@
@import '../../gutenberg-blocks-style.scss';
.wp-block-tainacan-facets-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
.facets-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
.facets-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.facets-list.facets-list-without-margin,
ul.facets-list-edit.facets-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.facets-list.facets-layout-grid,
ul.facets-list-edit.facets-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.facet-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.facet-without-title span {
display: none;
}
&:hover a {
color: #454647;
text-decoration: none;
}
}
}
ul.facets-list-edit li.facet-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.facets-list.facets-layout-grid,
ul.facets-list-edit.facets-layout-grid {
grid-template-columns: repeat(auto-fill, 100%);
li.facet-list-item {
width: 100%;
img { width: 100%; }
}
}
}
// List View Mode ----------------------------------------------------
ul.facets-list.facets-layout-list,
ul.facets-list-edit.facets-layout-list {
padding: 0;
display: block;
list-style-type: none;
li.facet-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.facet-without-image img {
display: none;
}
&:hover a {
color: #454647;
text-decoration: none;
}
}
}
}

View File

@ -0,0 +1,301 @@
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 FacetsModal extends React.Component {
constructor(props) {
super(props);
// Initialize state
this.state = {
collectionsPerPage: 24,
collectionId: undefined,
collectionName: '',
isLoadingCollections: false,
modalCollections: [],
totalModalCollections: 0,
collectionPage: 1,
temporaryCollectionId: '',
searchCollectionName: '',
collections: [],
collectionsRequestSource: undefined,
searchURL: '',
};
// Bind events
this.resetCollections = this.resetCollections.bind(this);
this.selectCollection = this.selectCollection.bind(this);
this.fetchCollections = this.fetchCollections.bind(this);
this.fetchModalCollections = this.fetchModalCollections.bind(this);
this.fetchCollection = this.fetchCollection.bind(this);
this.applySelectedSearchURL = this.applySelectedSearchURL.bind(this);
}
componentWillMount() {
this.setState({
collectionId: this.props.existingCollectionId
});
if (this.props.existingCollectionId != null && this.props.existingCollectionId != undefined) {
this.fetchCollection(this.props.existingCollectionId);
this.setState({ searchURL: this.props.existingSearchURL ? this.props.existingSearchURL : tainacan_plugin.admin_url + 'admin.php?page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/facets/?readmode=true&iframemode=true' });
} 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
});
}
this.setState({
isLoadingCollections: false,
modalCollections: otherModalCollections,
totalModalCollections: response.headers['x-wp-total']
});
return otherModalCollections;
})
.catch(error => {
console.log('Error trying to fetch collections: ' + error);
});
}
fetchCollection(collectionId) {
tainacan.get('/collections/' + collectionId)
.then((response) => {
this.setState({ collectionName: response.data.name });
}).catch(error => {
console.log('Error trying to fetch collection: ' + error);
});
}
selectCollection(selectedCollectionId) {
this.setState({
collectionId: selectedCollectionId,
searchURL: tainacan_plugin.admin_url + 'admin.php?page=tainacan_admin#/collections/' + selectedCollectionId + '/facets/?readmode=true&iframemode=true'
});
this.props.onSelectCollection(selectedCollectionId);
this.fetchCollection(selectedCollectionId);
}
fetchCollections(name) {
if (this.state.collectionsRequestSource != undefined)
this.state.collectionsRequestSource.cancel('Previous collections search canceled.');
let aCollectionRequestSource = axios.CancelToken.source();
this.setState({
collectionsRequestSource: aCollectionRequestSource,
isLoadingCollections: true,
collections: [],
facets: []
});
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);
});
}
applySelectedSearchURL() {
this.props.onApplySearchURL(document.getElementById("facetsFrame").contentWindow.location.href);
}
resetCollections() {
this.setState({
collectionId: null,
collectionPage: 1,
modalCollections: []
});
this.fetchModalCollections();
}
cancelSelection() {
this.setState({
modalCollections: []
});
this.props.onCancelSelection();
}
render() {
return this.state.collectionId != null && this.state.collectionId != undefined ? (
// Facets modal
<Modal
className="wp-block-tainacan-modal"
title={__('Select the facet to show values on block', 'tainacan')}
onRequestClose={ () => this.cancelSelection() }
contentLabel={__('Configure your facets search to be shown on block', 'tainacan')}>
<iframe
id="facetsFrame"
src={ this.state.searchURL } />
<div className="modal-footer-area">
<Button
isDefault
onClick={ () => { this.resetCollections() }}>
{__('Switch collection', 'tainacan')}
</Button>
<Button
isPrimary
onClick={ () => this.applySelectedSearchURL() }>
{__('Use this search', 'tainacan')}
</Button>
</div>
</Modal>
) : (
// Collections modal
<Modal
className="wp-block-tainacan-modal"
title={__('Select a collection to fetch facets from', 'tainacan')}
onRequestClose={ () => this.cancelSelection() }
contentLabel={__('Select facets', 'tainacan')}>
<div>
<div className="modal-search-area">
<TextControl
label={__('Search for a collection', 'tainacan')}
value={ this.state.searchCollectionName }
onChange={(value) => {
this.setState({
searchCollectionName: value
});
_.debounce(this.fetchCollections(value), 300);
}}/>
</div>
{(
this.state.searchCollectionName != '' ? (
this.state.collections.length > 0 ?
(
<div>
<div className="modal-radio-list">
{
<RadioControl
selected={ this.state.temporaryCollectionId }
options={
this.state.collections.map((collection) => {
return { label: collection.name, value: '' + collection.id }
})
}
onChange={ ( aCollectionId ) => {
this.setState({ temporaryCollectionId: aCollectionId });
} } />
}
</div>
</div>
) :
this.state.isLoadingCollections ? (
<Spinner />
) :
<div className="modal-loadmore-section">
<p>{ __('Sorry, no collection found.', 'tainacan') }</p>
</div>
):
this.state.modalCollections.length > 0 ?
(
<div>
<div className="modal-radio-list">
<p class="modal-radio-area-label">{__('Repository', 'tainacan')}</p>
<RadioControl
className={'repository-radio-option'}
selected={ this.state.temporaryCollectionId }
options={ [{ label: __('Repository items', 'tainacan'), value: 'default' }] }
onChange={ ( aCollectionId ) => {
this.setState({ temporaryCollectionId: aCollectionId });
} } />
<hr/>
<p class="modal-radio-area-label">{__('Collections', 'tainacan')}</p>
<RadioControl
selected={ this.state.temporaryCollectionId }
options={
this.state.modalCollections.map((collection) => {
return { label: collection.name, value: '' + collection.id }
})
}
onChange={ ( aCollectionId ) => {
this.setState({ temporaryCollectionId: aCollectionId });
} } />
</div>
<div className="modal-loadmore-section">
<p>{ __('Showing', 'tainacan') + " " + this.state.modalCollections.length + " " + __('of', 'tainacan') + " " + this.state.totalModalCollections + " " + __('collections', 'tainacan') + "."}</p>
{
this.state.modalCollections.length < this.state.totalModalCollections ? (
<Button
isDefault
isSmall
onClick={ () => this.fetchModalCollections() }>
{__('Load more', 'tainacan')}
</Button>
) : null
}
</div>
</div>
) : this.state.isLoadingCollections ? <Spinner/> :
<div className="modal-loadmore-section">
<p>{ __('Sorry, no collection found.', 'tainacan') }</p>
</div>
)}
<div className="modal-footer-area">
<Button
isDefault
onClick={ () => { this.cancelSelection() }}>
{__('Cancel', 'tainacan')}
</Button>
<Button
isPrimary
disabled={ this.state.temporaryCollectionId == undefined || this.state.temporaryCollectionId == null || this.state.temporaryCollectionId == ''}
onClick={ () => { this.selectCollection(this.state.temporaryCollectionId); } }>
{__('Configure search', 'tainacan')}
</Button>
</div>
</div>
</Modal>
);
}
}

View File

@ -0,0 +1,772 @@
const { registerBlockType } = wp.blocks;
const { __ } = wp.i18n;
const { RangeControl, Spinner, Button, ToggleControl, Tooltip, Placeholder, Toolbar, ColorPicker, ColorPalette, BaseControl, Panel, PanelBody, PanelRow } = wp.components;
const { InspectorControls, BlockControls } = wp.editor;
import FacetsModal from './facets-modal.js';
import tainacan from '../../api-client/axios.js';
import axios from 'axios';
import qs from 'qs';
registerBlockType('tainacan/facets-list', {
title: __('Tainacan Facets List', 'tainacan'),
icon:
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
height="24px"
width="24px">
<path
fill="#298596"
d="M21.43,13.64,19.32,16a2.57,2.57,0,0,1-2,1H11a3.91,3.91,0,0,0,0-.49,5.49,5.49,0,0,0-5-5.47V9.64A2.59,2.59,0,0,1,8.59,7H17.3a2.57,2.57,0,0,1,2,1l2.11,2.38A2.59,2.59,0,0,1,21.43,13.64ZM4,3A2,2,0,0,0,2,5v7.3a5.32,5.32,0,0,1,2-1V5H16V3ZM11,21l-1,1L8.86,20.89,8,20H8l-.57-.57A3.42,3.42,0,0,1,5.5,20a3.5,3.5,0,0,1,0-7,2.74,2.74,0,0,1,.5,0A3.5,3.5,0,0,1,9,16a2.92,2.92,0,0,1,0,.51,3.42,3.42,0,0,1-.58,1.92L9,19H9l.85.85Zm-4-4.5A1.5,1.5,0,1,0,5.5,18,1.5,1.5,0,0,0,7,16.53Z"/>
</svg>,
category: 'tainacan-blocks',
keywords: [ __( 'facets', 'tainacan' ), __( 'search', 'tainacan' ), __( 'terms', 'tainacan' ) ],
attributes: {
content: {
type: 'array',
source: 'children',
selector: 'div'
},
collectionId: {
type: String,
default: undefined
},
facets: {
type: Array,
default: []
},
showImage: {
type: Boolean,
default: true
},
showName: {
type: Boolean,
default: true
},
layout: {
type: String,
default: 'grid'
},
isModalOpen: {
type: Boolean,
default: false
},
gridMargin: {
type: Number,
default: 0
},
searchURL: {
type: String,
default: undefined
},
facetsRequestSource: {
type: String,
default: undefined
},
maxFacetsNumber: {
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 {
facets,
content,
collectionId,
showImage,
showName,
layout,
isModalOpen,
gridMargin,
searchURL,
facetsRequestSource,
maxFacetsNumber,
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 prepareFacet(facet) {
return (
<li
key={ facet.id }
className="facet-list-item"
style={{ marginBottom: layout == 'grid' ? (showName ? gridMargin + 12 : gridMargin) + 'px' : ''}}>
<a
id={ isNaN(facet.id) ? facet.id : 'facet-id-' + facet.id }
href={ facet.url }
target="_blank"
className={ (!showName ? 'facet-without-title' : '') + ' ' + (!showImage ? 'facet-without-image' : '') }>
<img
src={
facet.thumbnail && facet.thumbnail['tainacan-medium'][0] && facet.thumbnail['tainacan-medium'][0]
?
facet.thumbnail['tainacan-medium'][0]
:
(facet.thumbnail && facet.thumbnail['thumbnail'][0] && facet.thumbnail['thumbnail'][0]
?
facet.thumbnail['thumbnail'][0]
:
`${tainacan_plugin.base_url}/admin/images/placeholder_square.png`)
}
alt={ facet.title ? facet.title : __( 'Thumbnail', 'tainacan' ) }/>
<span>{ facet.title ? facet.title : '' }</span>
</a>
</li>
);
}
function setContent(){
facets = [];
isLoading = true;
if (facetsRequestSource != undefined && typeof facetsRequestSource == 'function')
facetsRequestSource.cancel('Previous facets search canceled.');
facetsRequestSource = axios.CancelToken.source();
setAttributes({
isLoading: isLoading
});
let endpoint = '/collection' + searchURL.split('#')[1].split('/collections')[1];
let query = endpoint.split('?')[1];
let queryObject = qs.parse(query);
// Set up max facets to be shown
if (maxFacetsNumber != undefined && maxFacetsNumber > 0)
queryObject.perpage = maxFacetsNumber;
else if (queryObject.perpage != undefined && queryObject.perpage > 0)
setAttributes({ maxFacetsNumber: queryObject.perpage });
else {
queryObject.perpage = 12;
setAttributes({ maxFacetsNumber: 12 });
}
// Set up sorting order
if (order != undefined)
queryObject.order = order;
else if (queryObject.order != undefined)
setAttributes({ order: queryObject.order });
else {
queryObject.order = 'asc';
setAttributes({ order: 'asc' });
}
// Set up sorting order
if (searchString != undefined)
queryObject.search = searchString;
else if (queryObject.search != undefined)
setAttributes({ searchString: queryObject.search });
else {
delete queryObject.search;
setAttributes({ searchString: undefined });
}
// Remove unecessary queries
delete queryObject.readmode;
delete queryObject.iframemode;
delete queryObject.admin_view_mode;
delete queryObject.fetch_only_meta;
endpoint = endpoint.split('?')[0] + '?' + qs.stringify(queryObject) + '&fetch_only=title,url,thumbnail';
tainacan.get(endpoint, { cancelToken: facetsRequestSource.token })
.then(response => {
for (let facet of response.data.facets)
facets.push(prepareFacet(facet));
setAttributes({
content: <div></div>,
facets: facets,
isLoading: false,
facetsRequestSource: facetsRequestSource
});
});
}
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: <div></div>,
collection: collection,
isLoadingCollection: isLoadingCollection,
collectionBackgroundColor: collectionBackgroundColor,
collectionTextColor: collectionTextColor
});
});
}
}
function openFacetsModal() {
isModalOpen = true;
setAttributes( {
isModalOpen: isModalOpen
} );
}
function updateLayout(newLayout) {
layout = newLayout;
if (layout == 'grid' && showImage == false)
showImage = true;
if (layout == 'list' && showName == false)
showName = true;
setAttributes({
layout: layout,
showImage: showImage,
showName: showName
});
setContent();
}
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();
const layoutControls = [
{
icon: 'grid-view',
title: __( 'Grid View' ),
onClick: () => updateLayout('grid'),
isActive: layout === 'grid',
},
{
icon: 'list-view',
title: __( 'List View' ),
onClick: () => updateLayout('list'),
isActive: layout === 'list',
}
];
return (
<div className={className}>
<div>
<BlockControls>
<Toolbar controls={ layoutControls } />
</BlockControls>
</div>
<div>
<InspectorControls>
<PanelBody
title={__('Collection header', 'tainacan')}
initialOpen={ false }
>
<ToggleControl
label={__('Display header', 'tainacan')}
help={ !showCollectionHeader ? __('Toggle to show collection header', 'tainacan') : __('Do not show collection header', 'tainacan')}
checked={ showCollectionHeader }
onChange={ ( isChecked ) => {
showCollectionHeader = isChecked;
if (isChecked) fetchCollectionForHeader();
setAttributes({ showCollectionHeader: showCollectionHeader });
}
}
/>
{ showCollectionHeader ?
<div style={{ margin: '6px' }}>
<ToggleControl
label={__('Display "Collection" label', 'tainacan')}
help={ !showCollectionLabel ? __('Toggle to show "Collection" label above header', 'tainacan') : __('Do not show "Collection" label', 'tainacan')}
checked={ showCollectionLabel }
onChange={ ( isChecked ) => {
showCollectionLabel = isChecked;
setAttributes({ showCollectionLabel: showCollectionLabel });
}
}
/>
<BaseControl
id="colorpicker"
label={ __('Background color', 'tainacan')}>
<ColorPicker
color={ collectionBackgroundColor }
onChangeComplete={ ( value ) => {
collectionBackgroundColor = value.hex;
setAttributes({ collectionBackgroundColor: collectionBackgroundColor })
}}
disableAlpha
/>
</BaseControl>
<BaseControl
id="colorpallete"
label={ __('Collection name color', 'tainacan')}>
<ColorPalette
colors={ [{ name: __('Black', 'tainacan'), color: '#000000'}, { name: __('White', 'tainacan'), color: '#ffffff'} ] }
value={ collectionTextColor }
onChange={ ( color ) => {
collectionTextColor = color;
setAttributes({ collectionTextColor: collectionTextColor })
}}
/>
</BaseControl>
</div>
: null
}
</PanelBody>
<PanelBody
title={__('Search bar', 'tainacan')}
initialOpen={ true }
>
<ToggleControl
label={__('Display bar', 'tainacan')}
help={ showSearchBar ? __('Toggle to show search bar on block', 'tainacan') : __('Do not show search bar', 'tainacan')}
checked={ showSearchBar }
onChange={ ( isChecked ) => {
showSearchBar = isChecked;
setAttributes({ showSearchBar: showSearchBar });
}
}
/>
</PanelBody>
<PanelBody
title={__('Facets', 'tainacan')}
initialOpen={ true }
>
<div>
<RangeControl
label={__('Maximum number of facets', 'tainacan')}
value={ maxFacetsNumber }
onChange={ ( aMaxFacetsNumber ) => {
maxFacetsNumber = aMaxFacetsNumber;
setAttributes( { maxFacetsNumber: aMaxFacetsNumber } )
setContent();
}}
min={ 1 }
max={ 96 }
/>
</div>
<hr></hr>
<div>
{ layout == 'list' ?
<ToggleControl
label={__('Image', 'tainacan')}
help={ showImage ? __("Toggle to show facet's image", 'tainacan') : __("Do not show facet's image", 'tainacan')}
checked={ showImage }
onChange={ ( isChecked ) => {
showImage = isChecked;
setAttributes({ showImage: showImage });
setContent();
}
}
/>
: null }
{ layout == 'grid' ?
<div>
<ToggleControl
label={__("Facet's title", 'tainacan')}
help={ showName ? __("Toggle to show facet's title", 'tainacan') : __("Do not show facet's title", 'tainacan')}
checked={ showName }
onChange={ ( isChecked ) => {
showName = isChecked;
setAttributes({ showName: showName });
setContent();
}
}
/>
<div style={{ marginTop: '16px'}}>
<RangeControl
label={__('Margin between facets in pixels', 'tainacan')}
value={ gridMargin }
onChange={ ( margin ) => {
gridMargin = margin;
setAttributes( { gridMargin: margin } )
setContent();
}}
min={ 0 }
max={ 48 }
/>
</div>
</div>
: null }
</div>
</PanelBody>
</InspectorControls>
</div>
{ isSelected ?
(
<div>
{ isModalOpen ?
<FacetsModal
existingCollectionId={ collectionId }
existingSearchURL={ searchURL }
onSelectCollection={ (selectedCollectionId) => {
collectionId = selectedCollectionId;
setAttributes({ collectionId: collectionId });
fetchCollectionForHeader();
}}
onApplySearchURL={ (aSearchURL) =>{
searchURL = aSearchURL
setAttributes({
searchURL: searchURL,
isModalOpen: false
});
setContent();
}}
onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/>
: null
}
{ facets.length ? (
<div className="block-control">
<p>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
height="24px"
width="24px">
<path
fill="#298596"
d="M21.43,13.64,19.32,16a2.57,2.57,0,0,1-2,1H11a3.91,3.91,0,0,0,0-.49,5.49,5.49,0,0,0-5-5.47V9.64A2.59,2.59,0,0,1,8.59,7H17.3a2.57,2.57,0,0,1,2,1l2.11,2.38A2.59,2.59,0,0,1,21.43,13.64ZM4,3A2,2,0,0,0,2,5v7.3a5.32,5.32,0,0,1,2-1V5H16V3ZM11,21l-1,1L8.86,20.89,8,20H8l-.57-.57A3.42,3.42,0,0,1,5.5,20a3.5,3.5,0,0,1,0-7,2.74,2.74,0,0,1,.5,0A3.5,3.5,0,0,1,9,16a2.92,2.92,0,0,1,0,.51,3.42,3.42,0,0,1-.58,1.92L9,19H9l.85.85Zm-4-4.5A1.5,1.5,0,1,0,5.5,18,1.5,1.5,0,0,0,7,16.53Z"/>
</svg>
{__('List facets from a Tainacan Collection or Repository', 'tainacan')}
</p>
<Button
isPrimary
type="submit"
onClick={ () => openFacetsModal() }>
{__('Configure search', 'tainacan')}
</Button>
</div>
): null
}
</div>
) : null
}
{
showCollectionHeader ?
<div> {
isLoadingCollection ?
<div class="spinner-container">
<Spinner />
</div>
:
<a
href={ collection.url ? collection.url : '' }
target="_blank"
class="facets-collection-header">
<div
style={{
backgroundColor: collectionBackgroundColor ? collectionBackgroundColor : '',
paddingRight: collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium']) ? '' : '20px',
paddingTop: (!collection || !collection.thumbnail || (!collection.thumbnail['tainacan-medium'] && !collection.thumbnail['medium'])) ? '1rem' : '',
width: collection && collection.header_image ? '' : '100%'
}}
className={
'collection-name ' +
((!collection || !collection.thumbnail || (!collection.thumbnail['tainacan-medium'] && !collection.thumbnail['medium'])) && (!collection || !collection.header_image) ? 'only-collection-name' : '')
}>
<h3 style={{ color: collectionTextColor ? collectionTextColor : '' }}>
{ showCollectionLabel ? <span class="label">{ __('Collection', 'tainacan') }<br/></span> : null }
{ collection && collection.name ? collection.name : '' }
</h3>
</div>
{
collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium']) ?
<div
class="collection-thumbnail"
style={{
backgroundImage: 'url(' + (collection.thumbnail['tainacan-medium'] != undefined ? (collection.thumbnail['tainacan-medium'][0]) : (collection.thumbnail['medium'][0])) + ')',
}}/>
: null
}
<div
class="collection-header-image"
style={{
backgroundImage: collection.header_image ? 'url(' + collection.header_image + ')' : '',
minHeight: collection && collection.header_image ? '' : '80px',
display: !(collection && collection.thumbnail && (collection.thumbnail['tainacan-medium'] || collection.thumbnail['medium'])) ? collection && collection.header_image ? '' : 'none' : ''
}}/>
</a>
}
</div>
: null
}
{
showSearchBar ?
<div class="facets-search-bar">
<Button
onClick={ () => { order = 'asc'; setAttributes({ order: order }); setContent(); }}
className={order == 'asc' ? 'sorting-button-selected' : ''}
label={__('Sort ascending', 'tainacan')}>
<span class="icon">
<i>
<svg width="24" height="24" viewBox="-2 -4 20 20">
<path d="M6.7,10.8l-3.3,3.3L0,10.8h2.5V0h1.7v10.8H6.7z M11.7,0.8H8.3v1.7h3.3V0.8z M14.2,5.8H8.3v1.7h5.8V5.8z M16.7,10.8H8.3v1.7 h8.3V10.8z"/>
</svg>
</i>
</span>
</Button>
<Button
onClick={ () => { order = 'desc'; setAttributes({ order: order }); setContent(); }}
className={order == 'desc' ? 'sorting-button-selected' : ''}
label={__('Sort descending', 'tainacan')}>
<span class="icon">
<i>
<svg width="24" height="24" viewBox="-2 -4 20 20">
<path d="M6.7,3.3H4.2v10.8H2.5V3.3H0L3.3,0L6.7,3.3z M11.6,2.5H8.3v1.7h3.3V2.5z M14.1,7.5H8.3v1.7h5.8V7.5z M16.6,12.5H8.3v1.7 h8.3V12.5z"/>
</svg>
</i>
</span>
</Button>
<Button
onClick={ () => { setContent(); }}
label={__('Search', 'tainacan')}>
<span class="icon">
<i>
<svg width="24" height="24" viewBox="-2 -4 20 20">
<path class="st0" 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"/>
</svg>
</i>
</span>
</Button>
<input
value={ searchString }
onChange={ (value) => { _.debounce(applySearchString(value), 300); } }
type="text"/>
<Tooltip text={__('If necessary, pagination will be available on post or page.', 'tainacan')}>
<button
class="previous-button"
disabled
label={__('Previous page', 'tainacan')}>
<span class="icon">
<i>
<svg
width="30"
height="30"
viewBox="0 2 20 20">
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>
<path
d="M0 0h24v24H0z"
fill="none"/>
</svg>
</i>
</span>
</button>
</Tooltip>
<Tooltip text={__('If necessary, pagination will be available on post or page.', 'tainacan')}>
<button
class="next-button"
disabled
label={__('Next page', 'tainacan')}>
<span class="icon">
<i>
<svg
width="30"
height="30"
viewBox="0 2 20 20">
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/>
<path
d="M0 0h24v24H0z"
fill="none"/>
</svg>
</i>
</span>
</button>
</Tooltip>
</div>
: null
}
{ !facets.length && !isLoading ? (
<Placeholder
icon={(
<img
width={148}
src={ `${tainacan_plugin.base_url}/admin/images/tainacan_logo_header.svg` }
alt="Tainacan Logo"/>
)}>
<p>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
height="24px"
width="24px">
<path
fill="#298596"
d="M21.43,13.64,19.32,16a2.57,2.57,0,0,1-2,1H11a3.91,3.91,0,0,0,0-.49,5.49,5.49,0,0,0-5-5.47V9.64A2.59,2.59,0,0,1,8.59,7H17.3a2.57,2.57,0,0,1,2,1l2.11,2.38A2.59,2.59,0,0,1,21.43,13.64ZM4,3A2,2,0,0,0,2,5v7.3a5.32,5.32,0,0,1,2-1V5H16V3ZM11,21l-1,1L8.86,20.89,8,20H8l-.57-.57A3.42,3.42,0,0,1,5.5,20a3.5,3.5,0,0,1,0-7,2.74,2.74,0,0,1,.5,0A3.5,3.5,0,0,1,9,16a2.92,2.92,0,0,1,0,.51,3.42,3.42,0,0,1-.58,1.92L9,19H9l.85.85Zm-4-4.5A1.5,1.5,0,1,0,5.5,18,1.5,1.5,0,0,0,7,16.53Z"/>
</svg>
{__('List facets from a Tainacan Collection or Repository', 'tainacan')}
</p>
<Button
isPrimary
type="submit"
onClick={ () => openFacetsModal() }>
{__('Select facets', 'tainacan')}
</Button>
</Placeholder>
) : null
}
{ isLoading ?
<div class="spinner-container">
<Spinner />
</div> :
<div>
<ul
style={{
gridTemplateColumns: layout == 'grid' ? 'repeat(auto-fill, ' + (gridMargin + (showName ? 220 : 185)) + 'px)' : 'inherit',
marginTop: showSearchBar || showCollectionHeader ? '1.5rem' : '0px'
}}
className={'facets-list-edit facets-layout-' + layout + (!showName ? ' facets-list-without-margin' : '')}>
{ facets }
</ul>
</div>
}
</div>
);
},
save({ attributes, className }){
const {
content,
blockId,
collectionId,
showImage,
showName,
layout,
gridMargin,
searchURL,
maxFacetsNumber,
order,
showSearchBar,
showCollectionHeader,
showCollectionLabel,
collectionBackgroundColor,
collectionTextColor
} = attributes;
return <div
search-url={ searchURL }
className={ className }
collection-id={ collectionId }
show-image={ '' + showImage }
show-name={ '' + showName }
show-search-bar={ '' + showSearchBar }
show-collection-header={ '' + showCollectionHeader }
show-collection-label={ '' + showCollectionLabel }
layout={ layout }
collection-background-color={ collectionBackgroundColor }
collection-text-color={ collectionTextColor }
grid-margin={ gridMargin }
max-facets-number={ maxFacetsNumber }
order={ order }
tainacan-api-root={ tainacan_plugin.root }
tainacan-base-url={ tainacan_plugin.base_url }
id={ 'wp-block-tainacan-facets-list_' + blockId }>
{ content }
</div>
}
});

View File

@ -13,7 +13,8 @@ module.exports = {
gutenberg_items_list: './src/gutenberg-blocks/tainacan-items/items-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: './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_dynamic_items_list_theme: './src/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list-theme.js',
gutenberg_collections_list: './src/gutenberg-blocks/tainacan-collections/collections-list/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'
}, },
output: { output: {
path: path.resolve(__dirname, './src/assets/'), path: path.resolve(__dirname, './src/assets/'),