From f39079c6167efe7a88189ce04a02d85ddaea4a05 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Tue, 22 Dec 2020 16:36:06 +0100 Subject: [PATCH] fixed article graphql refactoring, continued to improve graphql for materials --- .../graphql/materio_extension.base.graphqls | 33 +- .../MaterioSchemaExtension.php | 294 ++++++++++++++---- .../custom/materiotheme/assets/dist/main.js | 22 +- .../vuejs/api/gql/article.fragment.gql | 77 ++++- .../vuejs/components/Content/ArticleCard.vue | 2 +- .../vuejs/components/Content/Card.vue | 4 +- .../vuejs/components/Pages/Article.vue | 206 ++++++------ .../vuejs/components/Pages/Blabla.vue | 2 +- .../vuejs/store/modules/blabla.js | 4 +- 9 files changed, 452 insertions(+), 192 deletions(-) diff --git a/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls b/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls index bceee9ba..eb71a314 100644 --- a/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls +++ b/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls @@ -5,9 +5,22 @@ type Materiau { uuid: String! title: String! author: String - memo: String + body: String + short_description: String linked_materials: [Materiau] + linked_articles: [Article] images: [Image] + videos: [VideoLink] + tags: [Tag] + thesaurus: [Thesaurus] + memo: String + attachments: [Filefield] + # distributor: + # manufacturer: + # famille: + # index: + # reference: + # samples: } type Article { @@ -24,6 +37,21 @@ type Article { tags: [Tag] thesaurus: [Thesaurus] date: Date + memo: String +} + +type Filefield { + file: File! + description: String +} + +type File { + fid: String! + uuid: String! + filename: String! + filemime: String! + filesize: String! + url: String! } type Link { @@ -67,6 +95,9 @@ type Image { url: String! alt: String style_minicard: ImageStyle + style_cardmedium: ImageStyle + style_cardfull: ImageStyle + style_articlecardmedium: ImageStyle } type ImageStyle { diff --git a/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php b/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php index 892e108e..14e73af8 100644 --- a/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php +++ b/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php @@ -7,7 +7,7 @@ use Drupal\graphql\GraphQL\ResolverRegistryInterface; use Drupal\graphql\GraphQL\Response\ResponseInterface; use Drupal\graphql\Plugin\GraphQL\SchemaExtension\SdlSchemaExtensionPluginBase; use Drupal\materio_graphql\GraphQL\Response\MaterioResponse; - +use Drupal\Core\Url; /** * @SchemaExtension( * id = "materio_extension", @@ -24,30 +24,47 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { public function registerResolvers(ResolverRegistryInterface $registry) { $builder = new ResolverBuilder(); - // Materiau + + // __ __ _ _ + // | \/ |__ _| |_ ___ _ _(_)__ _ _ _ + // | |\/| / _` | _/ -_) '_| / _` | || | + // |_| |_\__,_|\__\___|_| |_\__,_|\_,_| $registry->addFieldResolver('Query', 'materiau', $builder->produce('entity_load') ->map('type', $builder->fromValue('node')) ->map('bundles', $builder->fromValue(['materiau'])) ->map('id', $builder->fromArgument('id')) - ); + ); $registry->addFieldResolver('Materiau', 'id', $builder->produce('entity_id') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Materiau', 'uuid', $builder->produce('entity_uuid') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Materiau', 'title', $builder->compose( $builder->produce('entity_label') ->map('entity', $builder->fromParent()) - ) - ); + )); + + $registry->addFieldResolver('Materiau', 'body', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('body.value')) + ); + + $registry->addFieldResolver('Materiau', 'short_description', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_short_description.value')) + ); $registry->addFieldResolver('Materiau', 'author', $builder->compose( @@ -55,8 +72,7 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('entity', $builder->fromParent()), $builder->produce('entity_label') ->map('entity', $builder->fromParent()) - ) - ); + )); // https://github.com/drupal-graphql/graphql/blob/8.x-4.x/doc/SUMMARY.md // https://blog.chrismitchellonline.com/posts/custom_graphql_data/ @@ -66,8 +82,14 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { $builder->produce('entity_reference') ->map('entity', $builder->fromParent()) ->map('field', $builder->fromValue('field_linked_materials')) - ) - ); + )); + + $registry->addFieldResolver('Materiau', 'linked_articles', + $builder->compose( + $builder->produce('entity_reference') + ->map('entity', $builder->fromParent()) + ->map('field', $builder->fromValue('field_linked_articles')) + )); $registry->addFieldResolver('Materiau', 'memo', $builder->produce('property_path') @@ -80,37 +102,70 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { $builder->produce('entity_reference') ->map('entity', $builder->fromParent()) ->map('field', $builder->fromValue('field_materiau_images')) - ); + ); - // Article + $registry->addFieldResolver('Materiau', 'attachments', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_attachments')) + // $builder->produce('entity_reference') + // ->map('entity', $builder->fromParent()) + // ->map('field', $builder->fromValue('field_attachments')) + ); + + $registry->addFieldResolver('Materiau', 'videos', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_video')) + ); + + $registry->addFieldResolver('Materiau', 'tags', + $builder->produce('entity_reference') + ->map('entity', $builder->fromParent()) + ->map('field', $builder->fromValue('field_tags')) + ); + + $registry->addFieldResolver('Materiau', 'thesaurus', + $builder->produce('entity_reference') + ->map('entity', $builder->fromParent()) + ->map('field', $builder->fromValue('field_thesaurus')) + ); + + // field_distributor + // field_famille + // field_index + // field_manufacturer + // field_reference + // field_samples + + // _ _ _ _ + // /_\ _ _| |_(_)__| |___ + // / _ \| '_| _| / _| / -_) + // /_/ \_\_| \__|_\__|_\___| $registry->addFieldResolver('Query', 'article', $builder->produce('entity_load') ->map('type', $builder->fromValue('node')) ->map('bundles', $builder->fromValue(['article'])) ->map('id', $builder->fromArgument('id')) - ); - // $registry->addFieldResolver('ArticleResponse', 'article', - // $builder->callback(function (ArticleResponse $response) { - // return $response->article(); - // }) - // ); + ); $registry->addFieldResolver('Article', 'id', $builder->produce('entity_id') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Article', 'uuid', $builder->produce('entity_uuid') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Article', 'title', $builder->compose( $builder->produce('entity_label') ->map('entity', $builder->fromParent()) - ) - ); + )); $registry->addFieldResolver('Article', 'author', $builder->compose( @@ -118,75 +173,139 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('entity', $builder->fromParent()), $builder->produce('entity_label') ->map('entity', $builder->fromParent()) - ) - ); + )); $registry->addFieldResolver('Article', 'body', $builder->produce('property_path') - ->map('type', $builder->fromValue('entity:node')) - ->map('value', $builder->fromParent()) - ->map('path', $builder->fromValue('body.value')) - ); + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('body.value')) + ); + $registry->addFieldResolver('Article', 'memo', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_memo.value')) + ); // https://github.com/drupal-graphql/graphql/blob/8.x-4.x/doc/SUMMARY.md // https://blog.chrismitchellonline.com/posts/custom_graphql_data/ $registry->addFieldResolver('Article', 'linked_materials', $builder->produce('entity_reference') ->map('entity', $builder->fromParent()) ->map('field', $builder->fromValue('field_linked_materials')) - ); + ); $registry->addFieldResolver('Article', 'images', $builder->produce('entity_reference') ->map('entity', $builder->fromParent()) ->map('field', $builder->fromValue('field_visuel')) - ); + ); $registry->addFieldResolver('Article', 'videos', $builder->produce('property_path') ->map('type', $builder->fromValue('entity:node')) ->map('value', $builder->fromParent()) ->map('path', $builder->fromValue('field_video')) - ); + ); $registry->addFieldResolver('Article', 'tags', $builder->produce('entity_reference') ->map('entity', $builder->fromParent()) ->map('field', $builder->fromValue('field_tags')) - ); + ); $registry->addFieldResolver('Article', 'thesaurus', $builder->produce('entity_reference') ->map('entity', $builder->fromParent()) ->map('field', $builder->fromValue('field_thesaurus')) - ); + ); $registry->addFieldResolver('Article', 'showroom', $builder->compose( $builder->produce('entity_reference') - ->map('entity', $builder->fromParent()) - ->map('field', $builder->fromValue('field_showroom')), + ->map('entity', $builder->fromParent()) + ->map('field', $builder->fromValue('field_showroom')), $builder->callback(function ($items) { - return $items[0]; - }) - ) - ); + return $items[0]; + }) + )); $registry->addFieldResolver('Article', 'source', $builder->produce('property_path') ->map('type', $builder->fromValue('entity:node')) ->map('value', $builder->fromParent()) ->map('path', $builder->fromValue('field_source')) - ); + ); $registry->addFieldResolver('Article', 'date', $builder->produce('property_path') ->map('type', $builder->fromValue('entity:node')) ->map('value', $builder->fromParent()) ->map('path', $builder->fromValue('field_date')) + ); + + + // ___ _ _ + // | __(_) |___ + // | _|| | / -_) + // |_| |_|_\___| + + $registry->addFieldResolver('Filefield', 'description', + $builder->callback(function ($parent, $args) { + return $parent['description']; + }) + ); + $registry->addFieldResolver('Filefield', 'file', + // $builder->produce('entity_reference') + // ->map('entity', $builder->fromParent()) + // ->map('field', $builder->fromValue('field_showroom')) + $builder->callback(function ($parent, $args) { + return \Drupal\file\Entity\File::load($parent['target_id']); + }) ); - // Date + $registry->addFieldResolver('File', 'url', + $builder->callback(function ($parent, $args) { + return $parent->url(); + }) + ); + + $registry->addFieldResolver('File', 'filesize', + $builder->callback(function ($parent, $args) { + return $parent->getSize(); + }) + ); + + $registry->addFieldResolver('File', 'filemime', + $builder->callback(function ($parent, $args) { + return $parent->getMimeType(); + }) + ); + + $registry->addFieldResolver('File', 'filename', + $builder->callback(function ($parent, $args) { + return $parent->getFilename(); + }) + ); + + $registry->addFieldResolver('File', 'fid', + $builder->callback(function ($parent, $args) { + return $parent->id(); + }) + ); + + $registry->addFieldResolver('File', 'uuid', + $builder->callback(function ($parent, $args) { + return $parent->uuid(); + }) + ); + + + // ___ _ + // | \ __ _| |_ ___ + // | |) / _` | _/ -_) + // |___/\__,_|\__\___| $registry->addFieldResolver('Date', 'start', $builder->callback(function ($parent, $args) { return $parent[0]['value']; @@ -198,119 +317,162 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { }) ); - // Link + + // _ _ _ + // | | (_)_ _ | |__ + // | |__| | ' \| / / + // |____|_|_||_|_\_\ $registry->addFieldResolver('Link', 'url', $builder->callback(function ($parent, $args) { return $parent[0]['uri']; }) ); - $registry->addFieldResolver('Link', 'title', $builder->callback(function ($parent, $args) { return $parent[0]['title']; }) ); - // Showroom + + // ___ _ + // / __| |_ _____ __ ___ _ ___ ___ _ __ + // \__ \ ' \/ _ \ V V / '_/ _ \/ _ \ ' \ + // |___/_||_\___/\_/\_/|_| \___/\___/_|_|_| $registry->addFieldResolver('Query', 'showroom', $builder->produce('entity_load') ->map('type', $builder->fromValue('taxonomy_term')) ->map('bundles', $builder->fromValue(['showroom'])) ->map('id', $builder->fromArgument('id')) - ); + ); $registry->addFieldResolver('Showroom', 'id', $builder->produce('entity_id') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Showroom', 'uuid', $builder->produce('entity_uuid') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Showroom', 'name', $builder->produce('entity_label') ->map('entity', $builder->fromParent()) - ); + ); - // Tag + + // _____ + // |_ _|_ _ __ _ + // | |/ _` / _` | + // |_|\__,_\__, | + // |___/ $registry->addFieldResolver('Query', 'tag', $builder->produce('entity_load') ->map('type', $builder->fromValue('taxonomy_term')) ->map('bundles', $builder->fromValue(['tags'])) ->map('id', $builder->fromArgument('id')) - ); + ); $registry->addFieldResolver('Tag', 'id', $builder->produce('entity_id') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Tag', 'uuid', $builder->produce('entity_uuid') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Tag', 'name', $builder->produce('entity_label') ->map('entity', $builder->fromParent()) - ); + ); - // Thesaurus + + // _____ _ + // |_ _| |_ ___ ___ __ _ _ _ _ _ _ _ ___ + // | | | ' \/ -_|_-addFieldResolver('Query', 'thesaurus', $builder->produce('entity_load') ->map('type', $builder->fromValue('taxonomy_term')) ->map('bundles', $builder->fromValue(['thesaurus'])) ->map('id', $builder->fromArgument('id')) - ); + ); $registry->addFieldResolver('Thesaurus', 'id', $builder->produce('entity_id') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Thesaurus', 'uuid', $builder->produce('entity_uuid') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Thesaurus', 'name', $builder->produce('entity_label') ->map('entity', $builder->fromParent()) - ); + ); - // VideoLink + + // __ ___ _ _ _ _ + // \ \ / (_)__| |___ ___| | (_)_ _ | |__ + // \ V /| / _` / -_) _ \ |__| | ' \| / / + // \_/ |_\__,_\___\___/____|_|_||_|_\_\ $registry->addFieldResolver('VideoLink', 'url', $builder->produce('property_path') ->map('type', $builder->fromValue('field_item:video_embed_field')) ->map('value', $builder->fromParent()) ->map('path', $builder->fromValue('value')) - ); + ); - // Image + + // ___ + // |_ _|_ __ __ _ __ _ ___ + // | || ' \/ _` / _` / -_) + // |___|_|_|_\__,_\__, \___| + // |___/ $registry->addFieldResolver('Image', 'id', $builder->produce('entity_id') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Image', 'url', $builder->produce('image_url') ->map('entity', $builder->fromParent()) - ); + ); $registry->addFieldResolver('Image', 'alt', $builder->produce('property_path') ->map('type', $builder->fromValue('entity:node')) ->map('value', $builder->fromParent()) ->map('path', $builder->fromValue('field_image.alt')) - ); + ); $registry->addFieldResolver('Image', 'style_minicard', $builder->produce('image_derivative') ->map('entity', $builder->fromParent()) ->map('style', $builder->fromValue('card_medium_half')) - ); + ); + + $registry->addFieldResolver('Image', 'style_cardmedium', + $builder->produce('image_derivative') + ->map('entity', $builder->fromParent()) + ->map('style', $builder->fromValue('card_medium')) + ); + + $registry->addFieldResolver('Image', 'style_cardfull', + $builder->produce('image_derivative') + ->map('entity', $builder->fromParent()) + ->map('style', $builder->fromValue('card_full')) + ); + + $registry->addFieldResolver('Image', 'style_articlecardmedium', + $builder->produce('image_derivative') + ->map('entity', $builder->fromParent()) + ->map('style', $builder->fromValue('article_card_medium')) + ); // Response type resolver. $registry->addTypeResolver('Response', [ diff --git a/web/themes/custom/materiotheme/assets/dist/main.js b/web/themes/custom/materiotheme/assets/dist/main.js index 9a8dd9d9..2e3c82f9 100644 --- a/web/themes/custom/materiotheme/assets/dist/main.js +++ b/web/themes/custom/materiotheme/assets/dist/main.js @@ -905,7 +905,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-axios.js\");\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;\nvar _default = {\n name: \"ArticleCard\",\n router: _route.default,\n props: ['item'],\n data: function data() {\n return {\n alias: this.item.view_node.replace(/^.?\\/blabla\\//g, '')\n };\n },\n methods: {\n onclick: function onclick() {\n console.log('clicked on article', this.alias);\n this.$router.push({\n name: \"article\",\n params: {\n alias: this.alias\n },\n query: {\n uuid: this.item.uuid\n } // meta: { uuid:this.item.uuid },\n\n });\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-axios.js\");\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;\nvar _default = {\n name: \"ArticleCard\",\n router: _route.default,\n props: ['item'],\n data: function data() {\n return {\n alias: this.item.view_node.replace(/^.?\\/blabla\\//g, '')\n };\n },\n methods: {\n onclick: function onclick() {\n console.log('clicked on article', this.alias);\n this.$router.push({\n name: \"article\",\n params: {\n alias: this.alias\n },\n query: {\n nid: this.item.nid\n } // meta: { uuid:this.item.uuid },\n\n });\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -1113,7 +1113,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nvar _store = _interopRequireDefault(__webpack_require__(/*! vuejs/store */ \"./web/themes/custom/materiotheme/vuejs/store/index.js\"));\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-axios.js\");\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\nvar _graphqlAxios = __webpack_require__(/*! vuejs/api/graphql-axios */ \"./web/themes/custom/materiotheme/vuejs/api/graphql-axios.js\");\n\nvar _printer = __webpack_require__(/*! graphql/language/printer */ \"./node_modules/graphql/language/printer.js\");\n\nvar _graphqlTag = _interopRequireDefault(__webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\"));\n\nvar _materiauFragment = _interopRequireDefault(__webpack_require__(/*! vuejs/api/gql/materiau.fragment.gql */ \"./web/themes/custom/materiotheme/vuejs/api/gql/materiau.fragment.gql\"));\n\nvar _querystringEs = _interopRequireDefault(__webpack_require__(/*! querystring-es3 */ \"./node_modules/querystring-es3/index.js\"));\n\nvar _Card = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/Card */ \"./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n materiau(id: 5150) {\\n ...MateriauFields\\n }\\n }\\n \", \"\\n \"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _wrapRegExp(re, groups) { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = _RegExp.call(this, re, flags); _groups.set(_this, groups || _groups.get(re)); return _this; } _inherits(BabelRegExp, _RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === \"string\") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\\$<([^>]+)>/g, function (_, name) { return \"$\" + groups[name]; })); } else if (typeof substitution === \"function\") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = []; args.push.apply(args, arguments); if (_typeof(args[args.length - 1]) !== \"object\") { args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Article\",\n router: _route.default,\n store: _store.default,\n props: ['item'],\n data: function data() {\n return {\n index: -1,\n prevnext: {},\n uuid: null,\n content: null,\n loading: true,\n lightbox_index: null\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n items: function items(state) {\n return state.Blabla.items;\n }\n })),\n created: function created() {\n this.getArticle();\n },\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n getItems: 'Blabla/getItems',\n getItemIndex: 'Blabla/getItemIndex',\n getPrevNextItems: 'Blabla/getPrevNextItems'\n })), {}, {\n getArticle: function getArticle() {\n var _this = this;\n\n console.log(this.$route); // get the article uuid\n\n if (this.$route.query.uuid) {\n // we come from internal link with vuejs\n // directly record uuid\n this.uuid = this.$route.query.uuid;\n } else if (drupalDecoupled.entity_type == 'node' && drupalDecoupled.entity_bundle == 'article') {\n // we landed in an internal page\n // get the uuid from drupalDeclouped, provided by materio_decoupled.module\n this.uuid = drupalDecoupled.entity_uuid;\n }\n\n if (this.uuid) {\n this.loadArticle(); // get the prev next items\n\n if (!this.items.length) {\n // if items list not yet loaded preload them\n this.getItems().then(function () {\n // then get the index\n _this.getIndex();\n });\n } else {\n // or directly get the index\n this.getIndex();\n }\n } else {\n // if for any reason we dont have the uuid\n // redirect to home\n this.$route.replace('home');\n }\n },\n getIndex: function getIndex() {\n var _this2 = this;\n\n console.log(\"Article getIndex\");\n this.getItemIndex(this.uuid).then(function (index) {\n _this2.index = index; // console.log('article index', index, this);\n\n _this2.getPrevNextItems(index).then(function (pn) {\n _this2.prevnext = pn;\n });\n });\n },\n loadArticle: function loadArticle() {\n var _this3 = this;\n\n console.log('loadArticle', this.uuid);\n this.loading = true;\n var params = {\n include: 'field_linked_materials.images,field_showroom,field_tags,field_thesaurus,field_visuel,uid'\n };\n\n var q = _querystringEs.default.stringify(params);\n\n _jsonAxios.JSONAPI.get(\"node/article/\".concat(this.uuid, \"?\").concat(q)).then(function (_ref) {\n var data = _ref.data;\n console.log('loadArticle data', data);\n\n _this3.parseDataJSONAPI(data);\n }).catch(function (error) {\n console.warn('Issue with loadArticle', error);\n Promise.reject(error);\n }); // let ast = gql`{\n // article(id: ${this.uuid}) {\n // ...ArticleFields\n // }\n // }\n // ${ articleFields }\n // `\n // MGQ.post('', { query: print(ast)\n // })\n // .then((data) => {\n // console.log('loadArticle', data )\n // this.parseDataGQL(data.data.article)\n // })\n // .catch(error => {\n // console.warn('Issue with loadArticle', error)\n // Promise.reject(error)\n // })\n\n },\n // parseDataGQL(data){\n // console.log('parseDataGQL data', data)\n // },\n parseDataJSONAPI: function parseDataJSONAPI(data) {\n var _this4 = this;\n\n var attrs = data.data.attributes;\n var relations = data.data.relationships;\n console.log('relations', relations);\n var inc = data.included;\n console.log('included', inc);\n this.content = {\n title: attrs.title,\n body: attrs.body.value\n }; // build lightbox array\n // will be filled by videos and field_visuel\n\n this.content.lightbox_items = []; // parse embeded videos pushing it in lightbox\n\n for (var key in attrs.field_video) {\n var videolink = attrs.field_video[key]; // console.log('videolink', videolink);\n\n var provider_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?(youtube|vimeo)\\.com\\/.+/, {\n provider: 2\n });\n\n var match = provider_regex.exec(videolink); // console.log('provider', match.groups.provider);\n\n var video_id = null;\n var video_thumb = null;\n\n switch (match.groups.provider) {\n case 'vimeo':\n var vimeo_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/vimeo\\.com\\/([0-9]+)/, {\n id: 1\n });\n\n video_id = vimeo_regex.exec(videolink).groups.id || null; // TODO: get the vimeo thumb https://coderwall.com/p/fdrdmg/get-a-thumbnail-from-a-vimeo-video\n\n video_thumb = \"http://blogpeda.ac-poitiers.fr/ent-lyc/files/2015/06/Vimeo_icon_block.png\";\n break;\n\n case 'youtube':\n var youtube_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=(.+)/, {\n id: 2\n });\n\n video_id = youtube_regex.exec(videolink).groups.id || null;\n video_thumb = \"http://img.youtube.com/vi/\" + video_id + \"/0.jpg\";\n break;\n } // console.log('video_id', video_id);\n\n\n this.content.lightbox_items.push({\n src: videolink,\n title: \"\",\n description: \"\",\n thumb: video_thumb\n }); // this.content.videos.push({\n // provider: match.groups.provider,\n // id: video_id,\n // href: videolink\n // });\n } // parse all relationships\n\n\n var _loop = function _loop(_key) {\n // skip loop if the property is from prototype\n if (!relations.hasOwnProperty(_key)) return \"continue\";\n var relation_obj = relations[_key];\n console.log(\"relation\", _key, relation_obj); // console.log('typeof relation_obj.data', typeof relation_obj.data);\n\n if (!relation_obj.data) return \"continue\"; // showroom is unique field so no array in data\n // we parse it here\n\n switch (_key) {\n case 'field_showroom':\n var included = inc.find(function (i) {\n return i.id == relation_obj.data.id;\n }); // console.log('included',included);\n\n _this4.content[_key] = included.attributes;\n break;\n } // skip relation_obj if data is not array\n\n\n if (!Array.isArray(relation_obj.data)) return \"continue\"; // create empty field array\n\n _this4.content[_key] = []; // parse relationship values using included\n\n var field = {}; // loop through all relation items\n\n relation_obj.data.forEach(function (e) {\n // get the included values for each item using id\n var included = inc.find(function (i) {\n return i.id == e.id;\n }); // if we not found an included item skip the item\n\n if (typeof included != 'undefined') {\n // fill the item values\n switch (_key) {\n case 'field_visuel':\n // build the field object (not used for now)\n field = e.meta;\n field.id = e.id;\n field.src = included.attributes.uri.url;\n field.thumb = included.links.article_card_medium.href;\n break;\n\n case 'field_linked_materials':\n field = included.attributes;\n field.id = field.uuid = included.id; // get the linked material included images\n\n field.images = [];\n included.relationships.images.data.forEach(function (img) {\n // console.log('href', img.meta.imageDerivatives.links.card_medium.href);\n if (img.meta.imageDerivatives) {\n field.images.push({\n title: img.meta.title,\n src: img.meta.imageDerivatives.links.hd.href,\n img_styles: {\n card_medium: img.meta.imageDerivatives.links.card_medium.href,\n card_full: img.meta.imageDerivatives.links.card_full.href\n }\n });\n }\n });\n break;\n\n case 'field_thesaurus':\n case 'field_tags':\n field = included.attributes;\n field.id = included.id;\n break;\n\n default:\n }\n\n _this4.content[_key].push(field);\n }\n });\n };\n\n for (var _key in relations) {\n var _ret = _loop(_key);\n\n if (_ret === \"continue\") continue;\n } // extract first visuel as accroche\n\n\n this.content.image_accroche = this.content.field_visuel.shift(); // fill the lightbox\n\n var _iterator = _createForOfIteratorHelper(this.content.field_visuel),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var visuel = _step.value;\n this.content.lightbox_items.push(visuel);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n console.log('this.content.lightbox_items', this.content.lightbox_items); // update main page title\n\n this.$store.commit('Common/setPagetitle', this.content.title);\n this.loading = false;\n console.log('article.content', this.content);\n this.getFieldDefinition();\n },\n getFieldDefinition: function getFieldDefinition(field) {\n // // JSONAPI.get(`field_config/${field}`)\n // // .then(({ data }) => {\n // // console.log('getFieldDefinition data', data)\n // // })\n // // .catch(( error ) => {\n // // console.warn('Issue with getFieldDefinition', error)\n // // Promise.reject(error)\n // // })\n // REST.get('/entity/node_type/materiau?_format=json')\n // .then((data) => {\n // console.log('getFieldDefiintion', data)\n // })\n // .catch(error => {\n // console.warn('Issue with getFieldDefiintion', error)\n // Promise.reject(error)\n // })\n //\n // https://stackoverflow.com/a/52612632\n // https://stackoverflow.com/a/57873339\n var ast = (0, _graphqlTag.default)(_templateObject(), _materiauFragment.default);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (data) {\n console.log('getFieldDefinition', data);\n }).catch(function (error) {\n console.warn('Issue with getFieldDefiintion', error);\n Promise.reject(error);\n });\n },\n onNext: function onNext() {\n // console.log('clicked on next', this.prevnext.next);\n var alias = this.prevnext.next.view_node.replace(/^.?\\/blabla\\//g, '');\n this.$router.push({\n name: \"article\",\n params: {\n alias: alias\n },\n query: {\n uuid: this.prevnext.next.uuid\n }\n });\n },\n onPrev: function onPrev() {\n // console.log('clicked on prev', this.prevnext.next);\n var alias = this.prevnext.prev.view_node.replace(/^.?\\/blabla\\//g, '');\n this.$router.push({\n name: \"article\",\n params: {\n alias: alias\n },\n query: {\n uuid: this.prevnext.prev.uuid\n }\n });\n },\n setLightboxIndex: function setLightboxIndex(index) {\n this.lightbox_index = index;\n }\n }),\n components: {\n Card: _Card.default\n },\n watch: {\n '$route': function $route(to, from) {\n console.log('route change');\n this.getArticle();\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nvar _store = _interopRequireDefault(__webpack_require__(/*! vuejs/store */ \"./web/themes/custom/materiotheme/vuejs/store/index.js\"));\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-axios.js\");\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\nvar _graphqlAxios = __webpack_require__(/*! vuejs/api/graphql-axios */ \"./web/themes/custom/materiotheme/vuejs/api/graphql-axios.js\");\n\nvar _printer = __webpack_require__(/*! graphql/language/printer */ \"./node_modules/graphql/language/printer.js\");\n\nvar _graphqlTag = _interopRequireDefault(__webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\"));\n\nvar _articleFragment = _interopRequireDefault(__webpack_require__(/*! vuejs/api/gql/article.fragment.gql */ \"./web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql\"));\n\nvar _querystringEs = _interopRequireDefault(__webpack_require__(/*! querystring-es3 */ \"./node_modules/querystring-es3/index.js\"));\n\nvar _Card = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/Card */ \"./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _wrapRegExp(re, groups) { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = _RegExp.call(this, re, flags); _groups.set(_this, groups || _groups.get(re)); return _this; } _inherits(BabelRegExp, _RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === \"string\") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\\$<([^>]+)>/g, function (_, name) { return \"$\" + groups[name]; })); } else if (typeof substitution === \"function\") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = []; args.push.apply(args, arguments); if (_typeof(args[args.length - 1]) !== \"object\") { args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n article(id: \", \") {\\n ...ArticleFields\\n }\\n }\\n \", \"\\n \"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Article\",\n router: _route.default,\n store: _store.default,\n props: ['item'],\n data: function data() {\n return {\n index: -1,\n prevnext: {},\n uuid: null,\n article: null,\n image_accroche: null,\n lightbox_items: null,\n loading: true,\n lightbox_index: null\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n items: function items(state) {\n return state.Blabla.items;\n }\n })),\n created: function created() {\n this.getArticle();\n },\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n getItems: 'Blabla/getItems',\n getItemIndex: 'Blabla/getItemIndex',\n getPrevNextItems: 'Blabla/getPrevNextItems'\n })), {}, {\n getArticle: function getArticle() {\n var _this = this;\n\n console.log(this.$route); // get the article uuid\n\n if (this.$route.query.nid) {\n // we come from internal link with vuejs\n // directly record uuid\n this.nid = this.$route.query.nid;\n } else if (drupalDecoupled.entity_type == 'node' && drupalDecoupled.entity_bundle == 'article') {\n // we landed in an internal page\n // get the uuid from drupalDeclouped, provided by materio_decoupled.module\n this.nid = drupalDecoupled.entity_id;\n }\n\n if (this.nid) {\n this.loadArticle(); // get the prev next items\n\n if (!this.items.length) {\n // if items list not yet loaded preload them\n this.getItems().then(function () {\n // then get the index\n _this.getIndex();\n });\n } else {\n // or directly get the index\n this.getIndex();\n }\n } else {\n // if for any reason we dont have the uuid\n // redirect to home\n this.$route.replace('home');\n }\n },\n getIndex: function getIndex() {\n var _this2 = this;\n\n console.log(\"Article getIndex\");\n this.getItemIndex(this.nid).then(function (index) {\n _this2.index = index; // console.log('article index', index, this);\n\n _this2.getPrevNextItems(index).then(function (pn) {\n _this2.prevnext = pn;\n });\n });\n },\n loadArticle: function loadArticle() {\n var _this3 = this;\n\n console.log('loadArticle', this.nid);\n this.loading = true; // let params = {\n // include:'field_linked_materials.images,field_showroom,field_tags,field_thesaurus,field_visuel,uid'\n // }\n // let q = qs.stringify(params)\n // JSONAPI.get(`node/article/${this.uuid}?${q}`)\n // .then(({ data }) => {\n // console.log('loadArticle data', data)\n // this.parseDataJSONAPI(data)\n // })\n // .catch(( error ) => {\n // console.warn('Issue with loadArticle', error)\n // Promise.reject(error)\n // })\n\n var ast = (0, _graphqlTag.default)(_templateObject(), this.nid, _articleFragment.default);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (_ref) {\n var article = _ref.data.data.article;\n console.log('loadArticle', article);\n\n _this3.parseDataGQL(article);\n }).catch(function (error) {\n console.warn('Issue with loadArticle', error);\n Promise.reject(error);\n });\n },\n parseDataGQL: function parseDataGQL(article) {\n console.log('parseDataGQL article', article);\n this.article = article;\n this.image_accroche = article.images[0];\n this.lightbox_items = []; // fill the lightbox\n\n for (var i = 0; i < article.images.length; i++) {\n article.images[i].thumb = article.images[i].style_articlecardmedium.url;\n this.lightbox_items.push(article.images[i]);\n } // parse embeded videos pushing it in lightbox\n\n\n for (var i = 0; i < article.videos.length; i++) {\n var videoUrl = article.videos[i].url;\n\n var provider_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?(youtube|vimeo)\\.com\\/.+/, {\n provider: 2\n });\n\n var match = provider_regex.exec(videoUrl); // console.log('provider', match.groups.provider);\n\n var video_id = null;\n var video_thumb = null;\n\n switch (match.groups.provider) {\n case 'vimeo':\n var vimeo_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/vimeo\\.com\\/([0-9]+)/, {\n id: 1\n });\n\n video_id = vimeo_regex.exec(videoUrl).groups.id || null; // TODO: get the vimeo thumb https://coderwall.com/p/fdrdmg/get-a-thumbnail-from-a-vimeo-video\n\n video_thumb = \"http://blogpeda.ac-poitiers.fr/ent-lyc/files/2015/06/Vimeo_icon_block.png\";\n break;\n\n case 'youtube':\n var youtube_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=(.+)/, {\n id: 2\n });\n\n video_id = youtube_regex.exec(videoUrl).groups.id || null;\n video_thumb = \"http://img.youtube.com/vi/\" + video_id + \"/0.jpg\";\n break;\n } // console.log('video_id', video_id);\n\n\n this.lightbox_items.push({\n url: videoUrl,\n title: \"\",\n description: \"\",\n thumb: video_thumb\n });\n }\n\n console.log('this.content.lightbox_items', this.lightbox_items); // update main page title\n\n this.$store.commit('Common/setPagetitle', article.title);\n this.loading = false;\n },\n parseDataJSONAPI: function parseDataJSONAPI(data) {\n var _this4 = this;\n\n var attrs = data.data.attributes;\n var relations = data.data.relationships;\n console.log('relations', relations);\n var inc = data.included;\n console.log('included', inc);\n this.content = {\n title: attrs.title,\n body: attrs.body.value\n }; // build lightbox array\n // will be filled by videos and field_visuel\n\n this.content.lightbox_items = []; // parse embeded videos pushing it in lightbox\n\n for (var key in attrs.field_video) {\n var videolink = attrs.field_video[key]; // console.log('videolink', videolink);\n\n var provider_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?(youtube|vimeo)\\.com\\/.+/, {\n provider: 2\n });\n\n var match = provider_regex.exec(videolink); // console.log('provider', match.groups.provider);\n\n var video_id = null;\n var video_thumb = null;\n\n switch (match.groups.provider) {\n case 'vimeo':\n var vimeo_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/vimeo\\.com\\/([0-9]+)/, {\n id: 1\n });\n\n video_id = vimeo_regex.exec(videolink).groups.id || null; // TODO: get the vimeo thumb https://coderwall.com/p/fdrdmg/get-a-thumbnail-from-a-vimeo-video\n\n video_thumb = \"http://blogpeda.ac-poitiers.fr/ent-lyc/files/2015/06/Vimeo_icon_block.png\";\n break;\n\n case 'youtube':\n var youtube_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=(.+)/, {\n id: 2\n });\n\n video_id = youtube_regex.exec(videolink).groups.id || null;\n video_thumb = \"http://img.youtube.com/vi/\" + video_id + \"/0.jpg\";\n break;\n } // console.log('video_id', video_id);\n\n\n this.content.lightbox_items.push({\n src: videolink,\n title: \"\",\n description: \"\",\n thumb: video_thumb\n }); // this.content.videos.push({\n // provider: match.groups.provider,\n // id: video_id,\n // href: videolink\n // });\n } // parse all relationships\n\n\n var _loop = function _loop(_key) {\n // skip loop if the property is from prototype\n if (!relations.hasOwnProperty(_key)) return \"continue\";\n var relation_obj = relations[_key];\n console.log(\"relation\", _key, relation_obj); // console.log('typeof relation_obj.data', typeof relation_obj.data);\n\n if (!relation_obj.data) return \"continue\"; // showroom is unique field so no array in data\n // we parse it here\n\n switch (_key) {\n case 'field_showroom':\n var included = inc.find(function (i) {\n return i.id == relation_obj.data.id;\n }); // console.log('included',included);\n\n _this4.content[_key] = included.attributes;\n break;\n } // skip relation_obj if data is not array\n\n\n if (!Array.isArray(relation_obj.data)) return \"continue\"; // create empty field array\n\n _this4.content[_key] = []; // parse relationship values using included\n\n var field = {}; // loop through all relation items\n\n relation_obj.data.forEach(function (e) {\n // get the included values for each item using id\n var included = inc.find(function (i) {\n return i.id == e.id;\n }); // if we not found an included item skip the item\n\n if (typeof included != 'undefined') {\n // fill the item values\n switch (_key) {\n case 'field_visuel':\n // build the field object (not used for now)\n field = e.meta;\n field.id = e.id;\n field.src = included.attributes.uri.url;\n field.thumb = included.links.article_card_medium.href;\n break;\n\n case 'field_linked_materials':\n field = included.attributes;\n field.id = field.uuid = included.id; // get the linked material included images\n\n field.images = [];\n included.relationships.images.data.forEach(function (img) {\n // console.log('href', img.meta.imageDerivatives.links.card_medium.href);\n if (img.meta.imageDerivatives) {\n field.images.push({\n title: img.meta.title,\n src: img.meta.imageDerivatives.links.hd.href,\n img_styles: {\n card_medium: img.meta.imageDerivatives.links.card_medium.href,\n card_full: img.meta.imageDerivatives.links.card_full.href\n }\n });\n }\n });\n break;\n\n case 'field_thesaurus':\n case 'field_tags':\n field = included.attributes;\n field.id = included.id;\n break;\n\n default:\n }\n\n _this4.content[_key].push(field);\n }\n });\n };\n\n for (var _key in relations) {\n var _ret = _loop(_key);\n\n if (_ret === \"continue\") continue;\n } // extract first visuel as accroche\n\n\n this.content.image_accroche = this.content.field_visuel.shift(); // fill the lightbox\n\n var _iterator = _createForOfIteratorHelper(this.content.field_visuel),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var visuel = _step.value;\n this.content.lightbox_items.push(visuel);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n console.log('this.content.lightbox_items', this.content.lightbox_items); // update main page title\n\n this.$store.commit('Common/setPagetitle', this.content.title);\n this.loading = false;\n console.log('article.content', this.content);\n },\n onNext: function onNext() {\n // console.log('clicked on next', this.prevnext.next);\n var alias = this.prevnext.next.view_node.replace(/^.?\\/blabla\\//g, '');\n this.$router.push({\n name: \"article\",\n params: {\n alias: alias\n },\n query: {\n uuid: this.prevnext.next.uuid\n }\n });\n },\n onPrev: function onPrev() {\n // console.log('clicked on prev', this.prevnext.next);\n var alias = this.prevnext.prev.view_node.replace(/^.?\\/blabla\\//g, '');\n this.$router.push({\n name: \"article\",\n params: {\n alias: alias\n },\n query: {\n uuid: this.prevnext.prev.uuid\n }\n });\n },\n setLightboxIndex: function setLightboxIndex(index) {\n this.lightbox_index = index;\n }\n }),\n components: {\n Card: _Card.default\n },\n watch: {\n '$route': function $route(to, from) {\n console.log('route change');\n this.getArticle();\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -1459,7 +1459,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-axios.js\");\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\nvar _maAxios = __webpack_require__(/*! vuejs/api/ma-axios */ \"./web/themes/custom/materiotheme/vuejs/api/ma-axios.js\");\n\nvar _querystringEs = _interopRequireDefault(__webpack_require__(/*! querystring-es3 */ \"./node_modules/querystring-es3/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n contenttype: null,\n items: [],\n page: 0,\n // infinteState will come from vue-infinite-loading plugin\n // implemented in vuejs/components/Content/Base.vue\n infiniteLoadingState: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setItems: function setItems(state, items) {\n state.items = state.items.concat(items);\n },\n incrementPage: function incrementPage(state) {\n state.page += 1;\n },\n setInfiniteState: function setInfiniteState(state, infiniteLoadingstate) {\n state.infiniteLoadingState = infiniteLoadingstate;\n }\n },\n // actions\n actions: {\n getItems: function getItems(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n // if(!state.contenttype){\n // REST.get('/entity/node_type/article?_format=json', {})\n // .then(({ data }) => {\n // console.log('blabla REST contenttype : data', data);\n // })\n // .catch(( error ) => {\n // console.warn('Issue with blabla contenttype', error)\n // Promise.reject(error)\n // })\n // }\n return _restAxios.REST.get(\"/blabla_rest?_format=json&page=\".concat(state.page), {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('blabla REST: data', data);\n\n if (data.length) {\n commit('setItems', data); // console.log('items.length', this.items.length);\n\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.loaded();\n }\n } else {\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.complete();\n }\n }\n }).catch(function (error) {\n console.warn('Issue with blabla getitems', error);\n Promise.reject(error);\n });\n },\n nextPage: function nextPage(_ref3, $infiniteLoadingstate) {\n var dispatch = _ref3.dispatch,\n commit = _ref3.commit,\n state = _ref3.state;\n console.log('blabla nextPage', $infiniteLoadingstate);\n commit('incrementPage');\n commit('setInfiniteState', $infiniteLoadingstate);\n dispatch('getItems');\n },\n getItemIndex: function getItemIndex(_ref4, uuid) {\n var dispatch = _ref4.dispatch,\n commit = _ref4.commit,\n state = _ref4.state;\n return state.items.findIndex(function (e) {\n return e.uuid == uuid;\n });\n },\n getPrevNextItems: function getPrevNextItems(_ref5, index) {\n var dispatch = _ref5.dispatch,\n commit = _ref5.commit,\n state = _ref5.state;\n return {\n prev: state.items[index - 1],\n next: state.items[index + 1]\n };\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/blabla.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-axios.js\");\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\nvar _maAxios = __webpack_require__(/*! vuejs/api/ma-axios */ \"./web/themes/custom/materiotheme/vuejs/api/ma-axios.js\");\n\nvar _querystringEs = _interopRequireDefault(__webpack_require__(/*! querystring-es3 */ \"./node_modules/querystring-es3/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n contenttype: null,\n items: [],\n page: 0,\n // infinteState will come from vue-infinite-loading plugin\n // implemented in vuejs/components/Content/Base.vue\n infiniteLoadingState: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setItems: function setItems(state, items) {\n state.items = state.items.concat(items);\n },\n incrementPage: function incrementPage(state) {\n state.page += 1;\n },\n setInfiniteState: function setInfiniteState(state, infiniteLoadingstate) {\n state.infiniteLoadingState = infiniteLoadingstate;\n }\n },\n // actions\n actions: {\n getItems: function getItems(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n // if(!state.contenttype){\n // REST.get('/entity/node_type/article?_format=json', {})\n // .then(({ data }) => {\n // console.log('blabla REST contenttype : data', data);\n // })\n // .catch(( error ) => {\n // console.warn('Issue with blabla contenttype', error)\n // Promise.reject(error)\n // })\n // }\n return _restAxios.REST.get(\"/blabla_rest?_format=json&page=\".concat(state.page), {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('blabla REST: data', data);\n\n if (data.length) {\n commit('setItems', data); // console.log('items.length', this.items.length);\n\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.loaded();\n }\n } else {\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.complete();\n }\n }\n }).catch(function (error) {\n console.warn('Issue with blabla getitems', error);\n Promise.reject(error);\n });\n },\n nextPage: function nextPage(_ref3, $infiniteLoadingstate) {\n var dispatch = _ref3.dispatch,\n commit = _ref3.commit,\n state = _ref3.state;\n console.log('blabla nextPage', $infiniteLoadingstate);\n commit('incrementPage');\n commit('setInfiniteState', $infiniteLoadingstate);\n dispatch('getItems');\n },\n getItemIndex: function getItemIndex(_ref4, nid) {\n var dispatch = _ref4.dispatch,\n commit = _ref4.commit,\n state = _ref4.state;\n return state.items.findIndex(function (e) {\n return e.nid == nid;\n });\n },\n getPrevNextItems: function getPrevNextItems(_ref5, index) {\n var dispatch = _ref5.dispatch,\n commit = _ref5.commit,\n state = _ref5.state;\n return {\n prev: state.items[index - 1],\n next: state.items[index + 1]\n };\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/blabla.js?"); /***/ }), @@ -1543,16 +1543,16 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), -/***/ "./web/themes/custom/materiotheme/vuejs/api/gql/materiau.fragment.gql": -/*!****************************************************************************!*\ - !*** ./web/themes/custom/materiotheme/vuejs/api/gql/materiau.fragment.gql ***! - \****************************************************************************/ +/***/ "./web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql": +/*!***************************************************************************!*\ + !*** ./web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql ***! + \***************************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module */ /*! CommonJS bailout: module.exports is used directly at 23:6-20 */ /***/ ((module) => { -eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"MateriauFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Materiau\"}},\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"images\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_minicard\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"author\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"uuid\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"memo\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"linked_materials\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"memo\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"images\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_minicard\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":345}};\n doc.loc.source = {\"body\":\"fragment MateriauFields on Materiau {\\n images {\\n id\\n url\\n alt\\n style_minicard{\\n width\\n height\\n url\\n }\\n }\\n id\\n title\\n author\\n uuid\\n memo\\n linked_materials {\\n id\\n title\\n memo\\n images {\\n id\\n url\\n alt\\n style_minicard{\\n width\\n height\\n url\\n }\\n }\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n module.exports = doc;\n \n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/api/gql/materiau.fragment.gql?"); +eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"ArticleFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Article\"}},\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"uuid\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"author\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"date\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"start\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"end\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"source\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"body\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"showroom\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"uuid\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"tags\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"uuid\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"thesaurus\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"uuid\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"linked_materials\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"memo\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"body\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"images\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_minicard\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardmedium\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardfull\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"images\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_minicard\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardmedium\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardfull\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_articlecardmedium\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"width\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"videos\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"memo\"},\"arguments\":[],\"directives\":[]}]}}],\"loc\":{\"start\":0,\"end\":905}};\n doc.loc.source = {\"body\":\"fragment ArticleFields on Article {\\n id\\n uuid\\n title\\n author\\n date{\\n start\\n end\\n }\\n source{\\n url\\n title\\n }\\n body\\n showroom {\\n id\\n uuid\\n name\\n }\\n tags {\\n id\\n uuid\\n name\\n }\\n thesaurus {\\n id\\n uuid\\n name\\n }\\n linked_materials {\\n id\\n title\\n memo\\n body\\n images {\\n id\\n url\\n alt\\n style_minicard{\\n width\\n height\\n url\\n }\\n style_cardmedium{\\n width\\n height\\n url\\n }\\n style_cardfull{\\n width\\n height\\n url\\n }\\n }\\n }\\n images {\\n id\\n url\\n alt\\n style_minicard{\\n width\\n height\\n url\\n }\\n style_cardmedium{\\n width\\n height\\n url\\n }\\n style_cardfull{\\n width\\n height\\n url\\n }\\n style_articlecardmedium{\\n width\\n height\\n url\\n }\\n }\\n videos {\\n url\\n }\\n memo\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n module.exports = doc;\n \n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql?"); /***/ }), @@ -2932,7 +2932,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"article\",\n { staticClass: \"card search-card\" },\n [\n _c(\"header\", { on: { click: _vm.openModalCard } }, [\n _c(\"h1\", [_vm._v(_vm._s(_vm.item.title))]),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.item.field_short_description))]),\n _vm._v(\" \"),\n _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.item.field_reference))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"images\"\n },\n _vm._l(_vm.item.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: {\n \"data-src\": img.img_styles.card_medium,\n title: img.title\n }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n _vm.lightbox_index = index\n }\n }\n })\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.item.images,\n index: _vm.lightbox_index,\n srcName: \"src\",\n loop: true\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n })\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"article\",\n { staticClass: \"card search-card\" },\n [\n _c(\"header\", { on: { click: _vm.openModalCard } }, [\n _c(\"h1\", [_vm._v(_vm._s(_vm.item.title))]),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.item.field_short_description))]),\n _vm._v(\" \"),\n _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.item.field_reference))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"images\"\n },\n _vm._l(_vm.item.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: { \"data-src\": img.style_cardmedium.url, title: img.title }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n _vm.lightbox_index = index\n }\n }\n })\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.item.images,\n index: _vm.lightbox_index,\n srcName: \"url\",\n loop: true\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n })\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -3076,7 +3076,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return !_vm.content || _vm.loading\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\"article\", { staticClass: \"article\" }, [\n _c(\"nav\", { staticClass: \"prevnext top\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrev($event)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onNext($event)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"cols\" }, [\n _c(\"div\", { staticClass: \"col col-left\" }, [\n _vm.content.image_accroche\n ? _c(\"section\", { staticClass: \"accroche\" }, [\n _c(\"figure\", [\n _c(\"img\", {\n attrs: {\n src: _vm.content.image_accroche.src,\n alt: _vm.content.image_accroche.alt,\n title: _vm.content.image_accroche.title\n }\n })\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"section\", { staticClass: \"taxonomy\" }, [\n _c(\"div\", { staticClass: \"thesaurus\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.content.field_thesaurus, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tags\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.content.field_tags, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ])\n ]),\n _vm._v(\" \"),\n _vm.content.field_showroom\n ? _c(\"section\", { staticClass: \"showroom\" }, [\n _c(\"h2\", [_vm._v(_vm._s(_vm.content.field_showroom.name))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"mail\",\n attrs: {\n href:\n \"mail:\" +\n _vm.content.field_showroom.field_public_email\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.content.field_showroom.field_public_email)\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"phone\",\n attrs: {\n href:\n \"tel:\" + _vm.content.field_showroom.field_public_phone\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.content.field_showroom.field_public_phone)\n )\n ]\n )\n ])\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"col col-right\" },\n [\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.content.body) }\n }),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.content.lightbox_items,\n index: _vm.lightbox_index,\n loop: true\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n }),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"gallery-wrapper\" },\n _vm._l(_vm.content.lightbox_items, function(image, imageIndex) {\n return _c(\"div\", {\n key: imageIndex,\n staticClass: \"image\",\n style: { backgroundImage: \"url(\" + image.thumb + \")\" },\n on: {\n click: function($event) {\n return _vm.setLightboxIndex(imageIndex)\n }\n }\n })\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"aside\", { staticClass: \"linked-materials\" }, [\n _c(\"h3\", { staticClass: \"field__label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Linked Materials\")))\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-list\" }, [\n _c(\n \"ul\",\n {},\n _vm._l(_vm.content.field_linked_materials, function(node) {\n return _c(\n \"li\",\n { key: node.id },\n [_c(\"Card\", { attrs: { item: node } })],\n 1\n )\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"prevnext bottom\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrev($event)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onNext($event)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return !_vm.article || _vm.loading\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\"article\", { staticClass: \"article\" }, [\n _c(\"nav\", { staticClass: \"prevnext top\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrev($event)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onNext($event)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"cols\" }, [\n _c(\"div\", { staticClass: \"col col-left\" }, [\n _vm.image_accroche\n ? _c(\"section\", { staticClass: \"accroche\" }, [\n _c(\"figure\", [\n _c(\"img\", {\n attrs: {\n src: _vm.image_accroche.url,\n alt: _vm.image_accroche.alt,\n title: _vm.image_accroche.title\n },\n on: {\n click: function($event) {\n return _vm.setLightboxIndex(0)\n }\n }\n })\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"section\", { staticClass: \"taxonomy\" }, [\n _c(\"div\", { staticClass: \"thesaurus\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.article.thesaurus, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tags\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.article.tags, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ])\n ]),\n _vm._v(\" \"),\n _vm.article.showroom\n ? _c(\"section\", { staticClass: \"showroom\" }, [\n _c(\"h2\", [_vm._v(_vm._s(_vm.article.showroom.name))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"mail\",\n attrs: {\n href: \"mail:\" + _vm.article.showroom.field_public_email\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.article.showroom.field_public_email)\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"phone\",\n attrs: {\n href: \"tel:\" + _vm.article.showroom.field_public_phone\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.article.showroom.field_public_phone)\n )\n ]\n )\n ])\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"col col-right\" },\n [\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.article.body) }\n }),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.lightbox_items,\n index: _vm.lightbox_index,\n loop: true,\n srcName: \"url\"\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n }),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"gallery-wrapper\" },\n _vm._l(_vm.lightbox_items, function(image, imageIndex) {\n return imageIndex > 0\n ? _c(\"div\", {\n key: imageIndex,\n staticClass: \"image\",\n style: { backgroundImage: \"url(\" + image.thumb + \")\" },\n on: {\n click: function($event) {\n return _vm.setLightboxIndex(imageIndex)\n }\n }\n })\n : _vm._e()\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"aside\", { staticClass: \"linked-materials\" }, [\n _c(\"h3\", { staticClass: \"field__label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Linked Materials\")))\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-list\" }, [\n _c(\n \"ul\",\n {},\n _vm._l(_vm.article.linked_materials, function(node) {\n return _c(\n \"li\",\n { key: node.id },\n [_c(\"Card\", { attrs: { item: node } })],\n 1\n )\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"prevnext bottom\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrev($event)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onNext($event)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -3108,7 +3108,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { attrs: { id: \"blabla\" } }, [\n !_vm.items.length\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"div\",\n { staticClass: \"cards-list\" },\n [\n _c(\n \"ul\",\n _vm._l(_vm.items, function(item) {\n return _c(\n \"li\",\n { key: item.uuid },\n [_c(\"ArticleCard\", { attrs: { item: item } })],\n 1\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"infinite-loading\", { on: { infinite: _vm.nextPage } }, [\n _c(\"div\", { attrs: { slot: \"no-more\" }, slot: \"no-more\" }, [\n _vm._v(\"No more articles\")\n ])\n ])\n ],\n 1\n )\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Blabla.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { attrs: { id: \"blabla\" } }, [\n !_vm.items.length\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"div\",\n { staticClass: \"cards-list\" },\n [\n _c(\n \"ul\",\n _vm._l(_vm.items, function(item) {\n return _c(\n \"li\",\n { key: item.nid },\n [_c(\"ArticleCard\", { attrs: { item: item } })],\n 1\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"infinite-loading\", { on: { infinite: _vm.nextPage } }, [\n _c(\"div\", { attrs: { slot: \"no-more\" }, slot: \"no-more\" }, [\n _vm._v(\"No more articles\")\n ])\n ])\n ],\n 1\n )\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Blabla.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), diff --git a/web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql b/web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql index 45fcbbae..ff8171eb 100644 --- a/web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql +++ b/web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql @@ -1,23 +1,37 @@ fragment ArticleFields on Article { - images { - id - url - alt - style_minicard{ - width - height - url - } - } id + uuid title author - uuid - memo + date{ + start + end + } + source{ + url + title + } + body + showroom { + id + uuid + name + } + tags { + id + uuid + name + } + thesaurus { + id + uuid + name + } linked_materials { id title memo + body images { id url @@ -27,6 +41,45 @@ fragment ArticleFields on Article { height url } + style_cardmedium{ + width + height + url + } + style_cardfull{ + width + height + url + } } } + images { + id + url + alt + style_minicard{ + width + height + url + } + style_cardmedium{ + width + height + url + } + style_cardfull{ + width + height + url + } + style_articlecardmedium{ + width + height + url + } + } + videos { + url + } + memo } diff --git a/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue b/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue index 3c92d0c6..f6ee4658 100644 --- a/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue +++ b/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue @@ -38,7 +38,7 @@ export default { this.$router.push({ name:`article`, params: { alias:this.alias }, - query: { uuid: this.item.uuid } + query: { nid: this.item.nid } // meta: { uuid:this.item.uuid }, }) } diff --git a/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue b/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue index 9502d636..709e85d3 100644 --- a/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue +++ b/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue @@ -36,7 +36,7 @@ diff --git a/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue b/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue index 5d30cdd2..b097a7e5 100644 --- a/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue +++ b/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue @@ -1,5 +1,5 @@