UNPKG

@europeana/portal

Version:
1,066 lines (892 loc) 31.1 kB
exports.ids = [63]; exports.modules = { /***/ 198: /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(202); if(content.__esModule) content = content.default; if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add CSS to SSR context var add = __webpack_require__(13).default module.exports.__inject__ = function (context) { add("688b9c6f", content, true, context) }; /***/ }), /***/ 200: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/sharing/SocialShare.vue?vue&type=template&id=a553b8a4&scoped=true& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._l((_vm.networks),function(network,index){return _c('b-link',{key:index,class:("social-share mr-1 " + (network.identifier)),attrs:{"title":_vm.$t('actions.shareOn', { social: network.name }),"href":network.url,"data-qa":("share " + (network.identifier) + " button")},nativeOn:{"click":function($event){_vm.$matomo && _vm.$matomo.trackEvent('Item_share', 'Click social share button', network.url);}}},[_c('span',{class:("icon-" + (network.identifier))}),_vm._v(" "),(_vm.withText)?_c('span',{staticClass:"text"},[_vm._v(_vm._s(network.name)+"\n ")]):_vm._e()])}),1)} var staticRenderFns = [] // CONCATENATED MODULE: ./src/components/sharing/SocialShare.vue?vue&type=template&id=a553b8a4&scoped=true& // EXTERNAL MODULE: external "vuex" var external_vuex_ = __webpack_require__(8); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/sharing/SocialShare.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var SocialSharevue_type_script_lang_js_ = ({ name: 'SocialShare', props: { mediaUrl: { type: String, default: '' }, withText: { type: Boolean, default: false } }, computed: { ...Object(external_vuex_["mapGetters"])({ shareUrl: 'http/canonicalUrlWithoutLocale' }), networks() { return [{ identifier: 'facebook', name: 'Facebook', url: `https://www.facebook.com/sharer/sharer.php?display=page&u=${this.shareUrl}` }, { identifier: 'twitter', name: 'Twitter', url: `https://twitter.com/intent/tweet?text=${this.shareUrl}` }, { identifier: 'pinterest', name: 'Pinterest', url: `https://pinterest.com/pin/create/link/?url=${this.shareUrl}` + (this.mediaUrl ? `&media=${this.mediaUrl}` : '') }]; } } }); // CONCATENATED MODULE: ./src/components/sharing/SocialShare.vue?vue&type=script&lang=js& /* harmony default export */ var sharing_SocialSharevue_type_script_lang_js_ = (SocialSharevue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(3); // CONCATENATED MODULE: ./src/components/sharing/SocialShare.vue function injectStyles (context) { var style0 = __webpack_require__(201) if (style0.__inject__) style0.__inject__(context) } /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( sharing_SocialSharevue_type_script_lang_js_, render, staticRenderFns, false, injectStyles, "a553b8a4", "c7505654" ) /* harmony default export */ var SocialShare = __webpack_exports__["a"] = (component.exports); /***/ }), /***/ 201: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(198); /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ 202: /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(12); var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false); // Module ___CSS_LOADER_EXPORT___.push([module.i, "a[data-v-a553b8a4]{align-items:center;background:transparent;border:1px solid #1a1a1a;border-radius:50%;color:#1a1a1a;display:inline-flex;height:calc(2.5rem - 1px);justify-content:center;text-decoration:none;transition:background .25s;width:calc(2.5rem - 1px)}a [class^=icon][data-v-a553b8a4]{color:#1a1a1a;font-size:1.25rem}a[data-v-a553b8a4]:hover{background:#1a1a1a}a:hover [class^=icon][data-v-a553b8a4]{color:#fff}", ""]); // Exports module.exports = ___CSS_LOADER_EXPORT___; /***/ }), /***/ 203: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentCard.vue?vue&type=template&id=28c51dc4& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',{staticClass:"text-left content-card",class:_vm.cardClass,attrs:{"data-qa":"content card","no-body":""}},[_c('div',{staticClass:"card-wrapper"},[_c('SmartLink',{attrs:{"destination":_vm.url,"link-class":"card-link","aria-label":_vm.displayTitle ? _vm.displayTitle.value : null,"title":(_vm.variant === 'mosaic' && _vm.displayTitle) ? _vm.displayTitle.value : null}}),_vm._v(" "),(_vm.variant !== 'mini')?_c('MediaDefaultThumbnail',{directives:[{name:"show",rawName:"v-show",value:(!_vm.cardImageUrl),expression:"!cardImageUrl"}],attrs:{"media-type":_vm.mediaType,"offset":_vm.offset}}):_vm._e(),_vm._v(" "),(_vm.cardImageUrl)?_c('div',{staticClass:"card-img",class:{ logo: _vm.logo }},[(_vm.lazy)?_c('b-img-lazy',{attrs:{"src":_vm.optimisedImageUrl,"blank-width":_vm.blankImageWidth,"blank-height":_vm.blankImageHeight,"width":_vm.imageWidth,"height":_vm.imageHeight,"alt":_vm.imageAlt},nativeOn:{"error":function($event){return _vm.imageNotFound.apply(null, arguments)},"load":function($event){return _vm.imageLoaded.apply(null, arguments)}}}):_c('b-img',{attrs:{"src":_vm.optimisedImageUrl,"width":_vm.imageWidth,"height":_vm.imageHeight,"alt":_vm.imageAlt},on:{"error":_vm.imageNotFound,"load":_vm.imageLoaded}})],1):_vm._e(),_vm._v(" "),(_vm.variant !== 'mosaic')?_c('b-card-body',{attrs:{"data-qa":"card body"}},[((_vm.displaySubTitle && _vm.variant !== 'mini') && _vm.showSubtitle)?_c('b-card-sub-title',{staticClass:"mt-0",attrs:{"sub-title-tag":"div","sub-title-text-variant":"default"}},[_vm._v("\n "+_vm._s(_vm.displaySubTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"title-texts-wrapper"},[(_vm.displayTitle)?_c('b-card-title',{attrs:{"title-tag":"div","data-qa":"card title","lang":_vm.displayTitle.code}},[_c('span',[_vm._v("\n "+_vm._s(_vm._f("truncate")(_vm.displayTitle.value,90, _vm.$t('formatting.ellipsis')))+"\n ")])]):_vm._e(),_vm._v(" "),(_vm.hitsText)?_c('b-card-text',{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[_c('p',[_vm._v("\n "+_vm._s(_vm.hitsText.prefix)),_c('strong',{staticClass:"has-text-highlight"},[_vm._v(_vm._s(_vm.hitsText.exact))]),_vm._v(_vm._s(_vm.hitsText.suffix)+"\n ")])]):_vm._e(),_vm._v(" "),(_vm.displayTexts.length > 0)?_vm._l((_vm.displayTexts),function(text,index){return _c('b-card-text',{key:index,attrs:{"lang":text.code,"text-tag":"div"}},[_c('p',{domProps:{"innerHTML":_vm._s(_vm.cardText(text.values))}})])}):_vm._e()],2),_vm._v(" "),_c('client-only',[_vm._t("footer")],2)],1):_vm._e()],1),_vm._v(" "),_c('client-only',[_vm._t("image-overlay")],2)],1)} var staticRenderFns = [] // CONCATENATED MODULE: ./src/components/generic/ContentCard.vue?vue&type=template&id=28c51dc4& // EXTERNAL MODULE: external "vue-client-only" var external_vue_client_only_ = __webpack_require__(20); var external_vue_client_only_default = /*#__PURE__*/__webpack_require__.n(external_vue_client_only_); // EXTERNAL MODULE: ./src/components/generic/SmartLink.vue + 3 modules var SmartLink = __webpack_require__(26); // EXTERNAL MODULE: ./src/mixins/stripMarkdown.js var stripMarkdown = __webpack_require__(204); // EXTERNAL MODULE: ./src/plugins/europeana/utils.js var utils = __webpack_require__(2); // EXTERNAL MODULE: ./src/plugins/europeana/themes.js var themes = __webpack_require__(27); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentCard.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var ContentCardvue_type_script_lang_js_ = ({ name: 'ContentCard', components: { ClientOnly: external_vue_client_only_default.a, SmartLink: SmartLink["a" /* default */], MediaDefaultThumbnail: () => __webpack_require__.e(/* import() */ 15).then(__webpack_require__.bind(null, 578)) }, mixins: [stripMarkdown["a" /* default */]], props: { /** * Card title * * If an object is supplied, it is expected to be a LangMap. */ title: { type: [String, Object], default: '' }, /** * Card subtitle */ subTitle: { type: String, default: null }, /** * Card texts * * Each element may be a string, an array of strings, or a LangMap */ texts: { type: Array, default: () => [] }, /** * Hits from a search to highlight in the card texts */ hitsText: { type: Object, default: null }, /** * URL for the card to link to * * An object should be a Vue route */ url: { type: [String, Object], default: '' }, /** * URL of an image to display */ imageUrl: { type: String, default: '' }, /** * Content type of the image */ imageContentType: { type: String, default: null }, /** * Width of the image */ imageWidth: { type: Number, default: null }, /** * Height of the image */ imageHeight: { type: Number, default: null }, /** * Image alt text */ imageAlt: { type: String, default: '' }, /** * Image optimisation options * * Passed to `optimisedImageUrl` filter */ imageOptimisationOptions: { type: Object, default: () => ({}) }, /** * If `true`, image will be lazy-loaded */ lazy: { type: Boolean, default: true }, /** * If `true`, subtitle will be shown */ showSubtitle: { type: Boolean, default: true }, /** * Style variant to use * @values default, entity, mini, list, mosaic */ variant: { type: String, default: 'default' }, /** * If `true`, will omit all URIs from texts */ omitAllUris: { type: Boolean, default: false }, /** * If `true`, will omit URIs from texts only if other values are present */ omitUrisIfOtherValues: { type: Boolean, default: false }, /** * For each element of `texts`, limit the number of values shown * * Default is no limit */ limitValuesWithinEachText: { type: Number, default: -1 }, /** * Height of image placeholder when lazy-loading image */ blankImageHeight: { type: Number, default: null }, /** * Width of image placeholder when lazy-loading image */ blankImageWidth: { type: Number, default: null }, /** * If `true`, the image is a logo and will be styled differently */ logo: { type: Boolean, default: false }, /** * Type of media */ mediaType: { type: String, default: null }, /** * Offset, used for random color picking */ offset: { type: Number, default: null } }, data() { return { cardImageUrl: this.imageUrl, displayLabelTypes: 'exhibitions|galleries|blog|collections', themes: themes["a" /* default */].map(theme => theme.id) }; }, computed: { cardClass() { return `${this.variant}-card`; }, displayTitle() { if (!this.title) { return null; } else if (typeof this.title === 'string') { return { value: this.title, code: null }; } else { const langMapValue = Object(utils["h" /* langMapValueForLocale */])(this.title, this.$i18n.locale); return { value: langMapValue.values[0], code: langMapValue.code }; } }, displaySubTitle() { return this.subTitle || this.displayLabel; }, displayLabel() { if (!this.displayLabelType) { return false; } if (this.displayLabelType === 'collections') { const entityId = typeof this.url === 'string' ? this.url.split('/').pop().split('-').shift() : this.url.params.pathMatch; // TODO: remove when thematic collections topics get their own 'theme' type return this.themes.includes(entityId) ? this.$t('cardLabels.theme') : this.$t(`cardLabels.${this.displayLabelTypeCollections}`); } if (this.displayLabelType === 'blog') { return this.$tc('blog.posts', 1); } return this.$tc(`${this.displayLabelType}.${this.displayLabelType}`, 1); }, displayLabelTypeCollections() { return typeof this.url === 'object' ? this.url.params.type : this.url.split('/').slice(-2, -1); }, displayLabelType() { return this.displayLabelMatch ? this.displayLabelMatch[1] : false; }, displayLabelMatch() { return typeof this.url === 'object' ? this.displayLabelMatchObject : this.displayLabelMatchString; }, displayLabelMatchObject() { return this.url.name.match(new RegExp(`(${this.displayLabelTypes})`)); }, displayLabelMatchString() { return this.url.match(new RegExp(`/(${this.displayLabelTypes})[/.]`)); }, displayTexts() { return this.texts.filter(Boolean).map(value => { if (typeof value === 'string') { return { values: [value], code: null }; } else if (Array.isArray(value)) { return { values: value, code: null }; } else { return Object(utils["h" /* langMapValueForLocale */])(value, this.$i18n.locale, { omitUrisIfOtherValues: this.omitUrisIfOtherValues, omitAllUris: this.omitAllUris }); } }); }, optimisedImageUrl() { return this.$options.filters.optimisedImageUrl(this.imageUrl, this.imageContentType, this.imageOptimisationOptions); } }, watch: { imageUrl() { this.cardImageUrl = this.imageUrl; } }, methods: { cardText(values) { const limited = this.limitValuesWithinEachText > -1 ? values.slice(0, this.limitValuesWithinEachText) : [].concat(values); if (values.length > limited.length) { limited.push(this.$t('formatting.ellipsis')); } const joined = limited.join(this.$t('formatting.listSeperator') + ' '); const stripped = this.stripMarkdown(joined); return this.$options.filters.truncate(stripped, 255, this.$t('formatting.ellipsis')); }, redrawMasonry() { if (this.$redrawVueMasonry) { this.$nextTick(() => { this.$redrawVueMasonry(); }); } }, imageNotFound() { this.cardImageUrl = ''; this.redrawMasonry(); }, imageLoaded(event) { // ignore b-img-lazy's blank placeholder images if (!event.target.src.startsWith('data:')) { this.redrawMasonry(); } } } }); // CONCATENATED MODULE: ./src/components/generic/ContentCard.vue?vue&type=script&lang=js& /* harmony default export */ var generic_ContentCardvue_type_script_lang_js_ = (ContentCardvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(3); // EXTERNAL MODULE: ./src/components/generic/ContentCard.vue?vue&type=custom&index=0&blockType=docs&lang=md var ContentCardvue_type_custom_index_0_blockType_docs_lang_md = __webpack_require__(205); var ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default = /*#__PURE__*/__webpack_require__.n(ContentCardvue_type_custom_index_0_blockType_docs_lang_md); // CONCATENATED MODULE: ./src/components/generic/ContentCard.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( generic_ContentCardvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "473081f0" ) /* custom blocks */ if (typeof ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default.a === 'function') ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default()(component) /* harmony default export */ var ContentCard = __webpack_exports__["default"] = (component.exports); /***/ }), /***/ 204: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(184); /* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(marked__WEBPACK_IMPORTED_MODULE_0__); const htmlRemovalPatternsFromTags = tags => { return [/\n$/].concat(tags.map(tag => new RegExp(`</?${tag}.*?>`, 'gi'))); }; /* harmony default export */ __webpack_exports__["a"] = ({ methods: { /** * Strip markdown from text. * This method FIRST converts markdown to HTML, then removes HTML tags. * WARNING: This also means any HTML tags already present before will be stripped. * * As an optional parameter specific HTML tag names can be supplied. In which case, * only these will be removed. * @param {string} text String containing mark1down * @param {string[]} tags the HTML tags to be removed. * @return {String} text value with HTML breaks */ stripMarkdown(text, tags = ['']) { text = marked__WEBPACK_IMPORTED_MODULE_0__["marked"].parse(text); // Marked adds newlines to the end of the string, and wraps it in a <p> tag. for (const pattern of htmlRemovalPatternsFromTags(tags)) { text = text.replace(pattern, ''); } return text; } } }); /***/ }), /***/ 205: /***/ (function(module, exports) { /***/ }), /***/ 208: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentHeader.vue?vue&type=template&id=70220f01& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('header',{staticClass:"row"},[_c('b-col',{staticClass:"col lead mt-3",attrs:{"cols":"12","lg":"9"}},[(_vm.contextLabel)?_c('div',{staticClass:"context-label",attrs:{"data-qa":"context label"}},[_vm._v("\n "+_vm._s(_vm.contextLabel)+"\n ")]):_vm._e(),_vm._v(" "),_c('h1',{attrs:{"data-qa":"page title"}},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")]),_vm._v(" "),(_vm.description)?_c('div',{domProps:{"innerHTML":_vm._s(_vm.description)}}):_vm._e()]),_vm._ssrNode(" "),(_vm.mediaUrl)?_c('b-col',{staticClass:"pt-0 pb-3 py-lg-3 text-left text-lg-right",attrs:{"cols":"12","lg":"3"}},[_c('SocialShare',{attrs:{"media-url":_vm.mediaUrl}})],1):_vm._e()],2)} var staticRenderFns = [] // CONCATENATED MODULE: ./src/components/generic/ContentHeader.vue?vue&type=template&id=70220f01& // EXTERNAL MODULE: ./src/components/sharing/SocialShare.vue + 4 modules var SocialShare = __webpack_require__(200); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentHeader.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var ContentHeadervue_type_script_lang_js_ = ({ components: { SocialShare: SocialShare["a" /* default */] }, props: { title: { type: String, required: true }, description: { type: String, default: null }, mediaUrl: { type: String, default: null }, contextLabel: { type: String, default: null } } }); // CONCATENATED MODULE: ./src/components/generic/ContentHeader.vue?vue&type=script&lang=js& /* harmony default export */ var generic_ContentHeadervue_type_script_lang_js_ = (ContentHeadervue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(3); // CONCATENATED MODULE: ./src/components/generic/ContentHeader.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( generic_ContentHeadervue_type_script_lang_js_, render, staticRenderFns, false, null, null, "20f96ff6" ) /* harmony default export */ var ContentHeader = __webpack_exports__["a"] = (component.exports); /***/ }), /***/ 542: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/galleries/index.vue?vue&type=template&id=7999fe26& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-container',[_c('ContentHeader',{attrs:{"title":_vm.$tc('galleries.galleries', 2),"description":_vm.$t('galleries.description')}}),_vm._v(" "),_c('b-row',{staticClass:"flex-md-row pb-5"},[_c('b-col',{attrs:{"cols":"12"}},[(_vm.$fetchState.pending)?_c('b-container',{attrs:{"data-qa":"loading spinner container"}},[_c('b-row',{staticClass:"flex-md-row py-4 text-center"},[_c('b-col',{attrs:{"cols":"12"}},[_c('LoadingSpinner')],1)],1)],1):(_vm.$fetchState.error)?_c('b-container',{attrs:{"data-qa":"alert message container"}},[_c('b-row',{staticClass:"flex-md-row py-4"},[_c('b-col',{attrs:{"cols":"12"}},[_c('AlertMessage',{attrs:{"error":_vm.$fetchState.error.message}})],1)],1)],1):_c('b-card-group',{staticClass:"card-deck-4-cols",attrs:{"deck":"","data-qa":"gallery foyer"}},[(_vm.setGalleriesEnabled)?_vm._l((_vm.galleries),function(gallery){return _c('ContentCard',{key:gallery.slug,attrs:{"title":gallery.title,"url":{ name: 'galleries-all', params: { pathMatch: gallery.slug } },"image-url":gallery.thumbnail,"texts":[gallery.description],"show-subtitle":false}})}):_vm._l((_vm.galleries),function(gallery){return _c('ContentCard',{key:gallery.identifier,attrs:{"title":gallery.name,"url":{ name: 'galleries-all', params: { pathMatch: gallery.identifier } },"image-url":gallery.hasPartCollection.items[0] && _vm.imageUrl(gallery.hasPartCollection.items[0]),"texts":[gallery.description],"show-subtitle":false}})})],2)],1)],1),_vm._v(" "),_c('b-row',[_c('b-col',[_c('PaginationNavInput',{attrs:{"total-results":_vm.total,"per-page":_vm.perPage}})],1)],1)],1)} var staticRenderFns = [] // CONCATENATED MODULE: ./src/pages/galleries/index.vue?vue&type=template&id=7999fe26& // EXTERNAL MODULE: ./src/plugins/europeana/utils.js var utils = __webpack_require__(2); // EXTERNAL MODULE: ./src/components/generic/ContentHeader.vue + 4 modules var ContentHeader = __webpack_require__(208); // EXTERNAL MODULE: ./src/components/generic/ContentCard.vue + 4 modules var ContentCard = __webpack_require__(203); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/galleries/index.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // const PER_PAGE = 20; /* harmony default export */ var galleriesvue_type_script_lang_js_ = ({ name: 'GalleriesIndexPage', components: { AlertMessage: () => __webpack_require__.e(/* import() */ 0).then(__webpack_require__.bind(null, 223)), ContentHeader: ContentHeader["a" /* default */], ContentCard: ContentCard["default"], LoadingSpinner: () => __webpack_require__.e(/* import() */ 2).then(__webpack_require__.bind(null, 221)), PaginationNavInput: () => __webpack_require__.e(/* import() */ 14).then(__webpack_require__.bind(null, 231)) }, middleware: 'sanitisePageQuery', data() { return { galleries: [], perPage: PER_PAGE, total: 0 }; }, async fetch() { if (this.setGalleriesEnabled) { await this.fetchSetGalleries(); } else { await this.fetchContentfulGalleries(); } this.$scrollTo && this.$scrollTo('#header'); }, head() { return { title: this.$pageHeadTitle(this.$tc('galleries.galleries', 2)) }; }, computed: { setGalleriesEnabled() { return this.$features.setGalleries; }, page() { return Number(this.$route.query.page || 1); } }, watch: { '$route.query.page': '$fetch' }, methods: { async fetchSetGalleries() { const searchParams = { query: 'visibility:published', pageSize: PER_PAGE, page: this.page - 1, profile: 'standard' }; const setResponse = await this.$apis.set.search(searchParams, { withMinimalItemPreviews: true }); this.galleries = this.parseSets(setResponse.data.items); this.total = setResponse.data.partOf.total; this.perPage = PER_PAGE; }, parseSets(sets) { return sets.map(set => { return { slug: Object(utils["f" /* getLabelledSlug */])(set.id, set.title.en), title: set.title, description: set.description, thumbnail: this.setPreviewUrl(set.items[0].edmPreview) }; }); }, setPreviewUrl(edmPreview) { return this.$apis.thumbnail.edmPreview(edmPreview, { size: 400 }); }, // TODO: remove when using set galleries async fetchContentfulGalleries() { const variables = { locale: this.$i18n.isoLocale(), preview: this.$route.query.mode === 'preview', limit: PER_PAGE, skip: (this.$store.state.sanitised.page - 1) * PER_PAGE }; const contentfulResponse = await this.$contentful.query('galleryFoyerPage', variables).then(response => response.data.data).catch(e => { this.error({ statusCode: 500, message: e.toString() }); }); this.galleries = contentfulResponse.imageGalleryCollection.items; this.total = contentfulResponse.imageGalleryCollection.total; this.perPage = PER_PAGE; }, // TODO: remove when using set galleries imageUrl(data) { var _data$encoding, _data$encoding$edmPre; const edmPreview = ((_data$encoding = data.encoding) === null || _data$encoding === void 0 ? void 0 : (_data$encoding$edmPre = _data$encoding.edmPreview) === null || _data$encoding$edmPre === void 0 ? void 0 : _data$encoding$edmPre[0]) || data.thumbnailUrl; return this.$apis.thumbnail.edmPreview(edmPreview, { size: 400 }); } } }); // CONCATENATED MODULE: ./src/pages/galleries/index.vue?vue&type=script&lang=js& /* harmony default export */ var pages_galleriesvue_type_script_lang_js_ = (galleriesvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(3); // CONCATENATED MODULE: ./src/pages/galleries/index.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( pages_galleriesvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "6e5cdea8" ) /* harmony default export */ var galleries = __webpack_exports__["default"] = (component.exports); /***/ }) };; //# sourceMappingURL=index.js.map