diff --git a/web/themes/custom/materiotheme/assets/dist/main.js b/web/themes/custom/materiotheme/assets/dist/main.js index 36e48fb..ac8d4f9 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 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"); +eval("\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\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//\n// import { JSONAPI } from 'vuejs/api/json-axios'\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"); /***/ }), @@ -985,7 +985,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 _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nvar _cardMixins = _interopRequireDefault(__webpack_require__(/*! vuejs/components/cardMixins */ \"./web/themes/custom/materiotheme/vuejs/components/cardMixins.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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: \"ModalCard\",\n props: ['item'],\n mixins: [_cardMixins.default],\n data: function data() {\n return {\n blanksrc: \"\".concat(drupalSettings.path.themePath, \"/assets/img/blank.gif\"),\n loadingFlag: false,\n lightbox_index: null\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n flagcolls: function flagcolls(state) {\n return state.User.flagcolls;\n },\n showrooms: function showrooms(state) {\n return state.Showrooms.showrooms_by_tid;\n }\n })),\n created: function created() {\n console.log('modale item', this.item);\n },\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n flagUnflag: 'User/flagUnflag'\n })), {}, {\n flagIsActive: function flagIsActive(collid) {\n // console.log(this.item.uuid);\n // console.log(this.flagcolls[collid].items_uuids);\n // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;\n return this.flagcolls[collid].items.indexOf(this.item.id) !== -1;\n },\n flagIsLoading: function flagIsLoading(collid) {\n // console.log(this.item.uuid);\n // console.log(this.flagcolls[collid].items_uuids);\n return collid === this.loadingFlag;\n },\n onFlagActionCard: function onFlagActionCard(e) {\n var _this = this;\n\n console.log(\"Card onFlagActionCard\", e);\n\n if (!this.loadingFlag) {\n var collid = e.target.getAttribute('collid');\n var isActive = this.flagIsActive(collid);\n var action = isActive ? 'unflag' : 'flag'; // console.log('collid', collid);\n // console.log(\"this.item\", this.item);\n\n this.loadingFlag = collid;\n this.flagUnflag({\n action: action,\n id: this.item.id,\n collid: collid\n }).then(function (data) {\n console.log(\"onFlagActionCard then\", data);\n _this.loadingFlag = false;\n });\n }\n },\n onCloseModalCard: function onCloseModalCard(e) {\n this.$modal.hideAll();\n }\n })\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/ModalCard.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 _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nvar _cardMixins = _interopRequireDefault(__webpack_require__(/*! vuejs/components/cardMixins */ \"./web/themes/custom/materiotheme/vuejs/components/cardMixins.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 _materiaumodalFragment = _interopRequireDefault(__webpack_require__(/*! vuejs/api/gql/materiaumodal.fragment.gql */ \"./web/themes/custom/materiotheme/vuejs/api/gql/materiaumodal.fragment.gql\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n materiau(id: \", \") {\\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 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: \"ModalCard\",\n props: ['item'],\n mixins: [_cardMixins.default],\n data: function data() {\n return {\n material: null,\n loading: false,\n blanksrc: \"\".concat(drupalSettings.path.themePath, \"/assets/img/blank.gif\"),\n loadingFlag: false,\n lightbox_index: null\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n flagcolls: function flagcolls(state) {\n return state.User.flagcolls;\n },\n showrooms: function showrooms(state) {\n return state.Showrooms.showrooms_by_tid;\n }\n })),\n created: function created() {\n console.log('modale item', this.item);\n this.loadMaterial();\n },\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n flagUnflag: 'User/flagUnflag'\n })), {}, {\n loadMaterial: function loadMaterial() {\n var _this = this;\n\n console.log('loadMaterial', this.item.id);\n this.loading = true;\n var ast = (0, _graphqlTag.default)(_templateObject(), this.item.id, _materiaumodalFragment.default);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (_ref) {\n var materiau = _ref.data.data.materiau;\n console.log('loadMaterial', materiau);\n _this.material = materiau;\n _this.loading = false; // delay the lazyload to let the card the time to update dom\n // maybe not the best method\n\n setTimeout(function () {\n this.activateLazyLoad();\n }.bind(_this), 5);\n }).catch(function (error) {\n console.warn('Issue with loadMaterial', error);\n Promise.reject(error);\n });\n },\n flagIsActive: function flagIsActive(collid) {\n // console.log(this.item.uuid);\n // console.log(this.flagcolls[collid].items_uuids);\n // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;\n return this.flagcolls[collid].items.indexOf(this.item.id) !== -1;\n },\n flagIsLoading: function flagIsLoading(collid) {\n // console.log(this.item.uuid);\n // console.log(this.flagcolls[collid].items_uuids);\n return collid === this.loadingFlag;\n },\n onFlagActionCard: function onFlagActionCard(e) {\n var _this2 = this;\n\n console.log(\"Card onFlagActionCard\", e);\n\n if (!this.loadingFlag) {\n var collid = e.target.getAttribute('collid');\n var isActive = this.flagIsActive(collid);\n var action = isActive ? 'unflag' : 'flag'; // console.log('collid', collid);\n // console.log(\"this.item\", this.item);\n\n this.loadingFlag = collid;\n this.flagUnflag({\n action: action,\n id: this.item.id,\n collid: collid\n }).then(function (data) {\n console.log(\"onFlagActionCard then\", data);\n _this2.loadingFlag = false;\n });\n }\n },\n onCloseModalCard: function onCloseModalCard(e) {\n this.$modal.hideAll();\n }\n })\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/ModalCard.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -1017,7 +1017,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//\nvar basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;\nvar _default = {\n name: \"Showroom\",\n router: _route.default,\n props: ['item'] // data(){\n // return {\n // alias: this.item.view_node.replace(/^.?\\/showroom\\//g, '')\n // }\n // },\n // methods:{}\n\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Showroom.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 _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// import { JSONAPI } from 'vuejs/api/json-axios'\nvar basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;\nvar _default = {\n name: \"Showroom\",\n router: _route.default,\n props: ['item'] // data(){\n // return {\n // alias: this.item.view_node.replace(/^.?\\/showroom\\//g, '')\n // }\n // },\n // methods:{}\n\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Showroom.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 _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"); +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 _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 _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"); /***/ }), @@ -1334,22 +1334,6 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), -/***/ "./web/themes/custom/materiotheme/vuejs/api/json-axios.js": -/*!****************************************************************!*\ - !*** ./web/themes/custom/materiotheme/vuejs/api/json-axios.js ***! - \****************************************************************/ -/*! flagged exports */ -/*! export JSONAPI [provided] [no usage info] [missing usage info prevents renaming] */ -/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ -/*! other exports [not provided] [no usage info] */ -/*! runtime requirements: __webpack_exports__, __webpack_require__ */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.JSONAPI = void 0;\n\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ \"./node_modules/axios/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js\n// console.log('drupalSettings', drupalSettings);\nconsole.log(window.location);\n\nvar JSONAPI = _axios.default.create({\n baseURL: window.location.origin + \"/jsonapi\",\n withCredentials: true,\n headers: {\n Accept: 'application/vnd.api+json' // Authorization: 'Basic {token}',\n // \"Content-Type\": \"application/json\"\n\n }\n});\n\nexports.JSONAPI = JSONAPI;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/api/json-axios.js?"); - -/***/ }), - /***/ "./web/themes/custom/materiotheme/vuejs/api/ma-axios.js": /*!**************************************************************!*\ !*** ./web/themes/custom/materiotheme/vuejs/api/ma-axios.js ***! @@ -1394,7 +1378,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n// https://forum.vuejs.org/t/how-to-use-helper-functions-for-imported-modules-in-vuejs-vue-template/6266/5\nvar _default = {\n directives: {\n lazy: {\n bind: function bind(img, binding) {\n // console.log('lazy bind', img, binding);\n if (binding.value === 0) {\n img.setAttribute('src', img.getAttribute('data-src'));\n img.removeAttribute('data-src');\n img.classList.remove('lazy');\n }\n }\n },\n switcher: {\n inserted: function inserted(el, binding) {\n // switch images on mousemove\n el.addEventListener('mousemove', function (event) {\n var figs = this.querySelectorAll('figure'); // console.log('mousemove', this, event, figs.length);\n // let len = figs.length\n // let w = this.clientWidth;\n // let g = w / len;\n // let delta = Math.floor(event.layerX / g)\n\n var delta = Math.floor(event.layerX / (this.clientWidth / figs.length)); // console.log('delta', delta);\n\n figs.forEach(function (fig, index) {\n // console.log(index);\n if (index == delta) {\n // fig.style.display = \"block\"\n fig.classList.remove(\"hide\");\n fig.classList.add(\"show\");\n } else {\n // fig.style.display = \"none\"\n fig.classList.remove(\"show\");\n fig.classList.add(\"hide\");\n }\n });\n });\n }\n }\n },\n mounted: function mounted() {\n // lazy load images on mouseover\n this.$el.addEventListener('mouseover', function (event) {\n var imgs = this.querySelectorAll('.images figure img.lazy'); // console.log('mouseover', this, imgs);\n\n imgs.forEach(function (img) {\n // console.log('forEach img',img);\n img.setAttribute('src', img.getAttribute('data-src'));\n img.removeAttribute('data-src');\n img.classList.remove('lazy');\n });\n }, {\n once: true\n });\n },\n methods: {// deg2rad (deg) {\n // return deg * (Math.PI / 180)\n // },\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/cardMixins.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n// https://forum.vuejs.org/t/how-to-use-helper-functions-for-imported-modules-in-vuejs-vue-template/6266/5\nvar _default = {\n directives: {\n lazy: {\n bind: function bind(img, binding) {\n // console.log('lazy bind', img, binding);\n // show only the first image\n if (binding.value === 0) {\n img.setAttribute('src', img.getAttribute('data-src'));\n img.removeAttribute('data-src');\n img.classList.remove('lazy');\n }\n }\n },\n switcher: {\n inserted: function inserted(el, binding) {\n // switch images on mousemove\n el.addEventListener('mousemove', function (event) {\n var figs = this.querySelectorAll('figure'); // console.log('mousemove', this, event, figs.length);\n // let len = figs.length\n // let w = this.clientWidth;\n // let g = w / len;\n // let delta = Math.floor(event.layerX / g)\n\n var delta = Math.floor(event.layerX / (this.clientWidth / figs.length)); // console.log('delta', delta);\n\n figs.forEach(function (fig, index) {\n // console.log(index);\n if (index == delta) {\n // fig.style.display = \"block\"\n fig.classList.remove(\"hide\");\n fig.classList.add(\"show\");\n } else {\n // fig.style.display = \"none\"\n fig.classList.remove(\"show\");\n fig.classList.add(\"hide\");\n }\n });\n });\n }\n }\n },\n mounted: function mounted() {\n // lazy load images on mouseover\n console.log('card mounted', this.$options.name); // if (this.$options.name ==! 'ModalCard') {\n\n this.$el.addEventListener('mouseover', function (event) {\n var imgs = this.querySelectorAll('.images figure img.lazy');\n console.log('mousemove', this, imgs);\n imgs.forEach(function (img) {\n // console.log('forEach img',img);\n img.setAttribute('src', img.getAttribute('data-src'));\n img.removeAttribute('data-src');\n img.classList.remove('lazy');\n });\n }, {\n once: true\n }); // }\n },\n methods: {\n activateLazyLoad: function activateLazyLoad() {\n console.log('card activateLazyLoad', this.$options.name);\n this.$el.addEventListener('mousemove', function (event) {\n var imgs = this.querySelectorAll('.images figure img.lazy');\n console.log('mousemove', this, imgs);\n imgs.forEach(function (img) {\n // console.log('forEach img',img);\n img.setAttribute('src', img.getAttribute('data-src'));\n img.removeAttribute('data-src');\n img.classList.remove('lazy');\n });\n }, {\n once: true\n });\n } // deg2rad (deg) {\n // return deg * (Math.PI / 180)\n // },\n\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/cardMixins.js?"); /***/ }), @@ -1443,7 +1427,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 _vue = _interopRequireDefault(__webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.js\"));\n\nvar _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\"));\n\nvar _vuexExtensions = __webpack_require__(/*! vuex-extensions */ \"./node_modules/vuex-extensions/lib/index.js\");\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-axios.js\");\n\nvar _querystringEs = _interopRequireDefault(__webpack_require__(/*! querystring-es3 */ \"./node_modules/querystring-es3/index.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 _common = _interopRequireDefault(__webpack_require__(/*! ./modules/common */ \"./web/themes/custom/materiotheme/vuejs/store/modules/common.js\"));\n\nvar _user = _interopRequireDefault(__webpack_require__(/*! ./modules/user */ \"./web/themes/custom/materiotheme/vuejs/store/modules/user.js\"));\n\nvar _search = _interopRequireDefault(__webpack_require__(/*! ./modules/search */ \"./web/themes/custom/materiotheme/vuejs/store/modules/search.js\"));\n\nvar _blabla = _interopRequireDefault(__webpack_require__(/*! ./modules/blabla */ \"./web/themes/custom/materiotheme/vuejs/store/modules/blabla.js\"));\n\nvar _showrooms = _interopRequireDefault(__webpack_require__(/*! ./modules/showrooms */ \"./web/themes/custom/materiotheme/vuejs/store/modules/showrooms.js\"));\n\nvar _pages = _interopRequireDefault(__webpack_require__(/*! ./modules/pages */ \"./web/themes/custom/materiotheme/vuejs/store/modules/pages.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n materiaux(ids: [\", \"]) {\\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\n// https://github.com/vuejs/vuex/tree/dev/examples/shopping-cart\n_vue.default.use(_vuex.default); // export default new Vuex.Store({\n\n\nvar _default = (0, _vuexExtensions.createStore)(_vuex.default.Store, {\n modules: {\n Common: _common.default,\n User: _user.default,\n Search: _search.default,\n Blabla: _blabla.default,\n Showrooms: _showrooms.default,\n Pages: _pages.default\n },\n // https://github.com/huybuidac/vuex-extensions\n mixins: {\n actions: {\n loadMaterialsGQL: function loadMaterialsGQL(_ref, _ref2) {\n var dispatch = _ref.dispatch;\n var ids = _ref2.ids,\n gqlfragment = _ref2.gqlfragment,\n callBack = _ref2.callBack,\n callBackArgs = _ref2.callBackArgs;\n console.log('loadMaterialsGQL ids', ids);\n var ast = (0, _graphqlTag.default)(_templateObject(), ids, gqlfragment);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (resp) {\n console.log('loadMaterialsGQL resp', resp);\n dispatch('parseMaterialsGQL', {\n items: resp.data.data.materiaux,\n callBack: callBack,\n callBackArgs: callBackArgs\n });\n }).catch(function (error) {\n console.warn('Issue with loadMaterials', error);\n Promise.reject(error);\n });\n },\n parseMaterialsGQL: function parseMaterialsGQL(_ref3, _ref4) {\n var dispatch = _ref3.dispatch;\n var items = _ref4.items,\n callBack = _ref4.callBack,\n callBackArgs = _ref4.callBackArgs;\n dispatch(callBack, {\n items: items,\n callBackArgs: callBackArgs\n });\n },\n loadMaterials: function loadMaterials(_ref5, _ref6) {\n var dispatch = _ref5.dispatch;\n var uuids = _ref6.uuids,\n imgStyle = _ref6.imgStyle,\n callBack = _ref6.callBack,\n callBackArgs = _ref6.callBackArgs;\n var params = {\n // include: 'images', // no needs to include thanks to consumers_image_styles module\n // include: 'drupal_internal__nid',\n 'filter[uuids-groupe][group][conjunction]': 'OR'\n };\n\n for (var i = 0; i < uuids.length; i++) {\n var uuid = uuids[i];\n params[\"filter[\".concat(uuid, \"][condition][path]\")] = 'id';\n params[\"filter[\".concat(uuid, \"][condition][value]\")] = uuid;\n params[\"filter[\".concat(uuid, \"][condition][operator]\")] = '=';\n params[\"filter[\".concat(uuid, \"][condition][memberOf]\")] = 'uuids-groupe';\n } // console.log('search JSONAPI params', params);\n\n\n var q = _querystringEs.default.stringify(params);\n\n return _jsonAxios.JSONAPI.get('node/materiau?' + q).then(function (_ref7) {\n var data = _ref7.data;\n console.log('mixin getMaterials data', data);\n dispatch('parseMaterials', {\n data: data.data,\n uuids: uuids,\n imgStyle: imgStyle,\n callBack: callBack,\n callBackArgs: callBackArgs\n }); // commit('setItems', data.items)\n }).catch(function (error) {\n console.warn('Issue with getItems', error);\n Promise.reject(error);\n });\n },\n parseMaterials: function parseMaterials(_ref8, _ref9) {\n var dispatch = _ref8.dispatch;\n var data = _ref9.data,\n uuids = _ref9.uuids,\n imgStyle = _ref9.imgStyle,\n callBack = _ref9.callBack,\n callBackArgs = _ref9.callBackArgs;\n // data comes from jsonapi query\n // uuids comes from original query (solr, FlagCollection, etc)\n // so we loop from uuids to conserve the original order\n console.log('mixin parseMaterials', data, uuids, callBack, callBackArgs);\n var items = []; // for (var i = 0; i < data.length; i++) {\n\n var _loop = function _loop(i) {\n var uuid = uuids[i]; // https://stackoverflow.com/questions/11258077/how-to-find-index-of-an-object-by-key-and-value-in-an-javascript-array\n\n var item_index = data.findIndex(function (p) {\n return p.id === uuid;\n }); // console.log('item_index', item_index);\n\n if (item_index === -1) return \"continue\";\n var item_src = data[item_index];\n var attrs = item_src.attributes;\n var relations = item_src.relationships; // get field values\n\n var item = {\n uuid: uuid,\n title: attrs.title,\n field_short_description: attrs.field_short_description,\n body: attrs.body,\n field_reference: attrs.field_reference\n }; // get images included values\n\n var img_src = relations.images.data; // console.log('img_src', img_src);\n // this is a temporary deactivation of images\n // img_src = [];\n\n item.images = [];\n\n for (var j = 0; j < img_src.length; j++) {\n if (img_src[j].meta.imageDerivatives) {\n var img_styles = {};\n\n for (k = 0; k < imgStyle.length; k++) {\n img_styles[imgStyle[k]] = img_src[j].meta.imageDerivatives.links[imgStyle[k]].href;\n }\n\n item.images.push({\n title: img_src[j].meta.title,\n src: img_src[j].meta.imageDerivatives.links.hd.href,\n // meta.imageDerivatives.style.href link is provided by drupal consumers_image_styles module\n // BUG: missing all image derivative but first\n img_styles: img_styles\n });\n } else {\n console.warn('missing image derivative ' + j + '/' + img_src.length + ' for ' + attrs.title);\n }\n }\n\n items.push(item);\n };\n\n for (var i = 0; i < uuids.length; i++) {\n var k;\n\n var _ret = _loop(i);\n\n if (_ret === \"continue\") continue;\n }\n\n console.log('items', items);\n dispatch(callBack, {\n items: items,\n callBackArgs: callBackArgs\n });\n }\n }\n }\n});\n\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/index.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _vue = _interopRequireDefault(__webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.js\"));\n\nvar _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\"));\n\nvar _vuexExtensions = __webpack_require__(/*! vuex-extensions */ \"./node_modules/vuex-extensions/lib/index.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 _common = _interopRequireDefault(__webpack_require__(/*! ./modules/common */ \"./web/themes/custom/materiotheme/vuejs/store/modules/common.js\"));\n\nvar _user = _interopRequireDefault(__webpack_require__(/*! ./modules/user */ \"./web/themes/custom/materiotheme/vuejs/store/modules/user.js\"));\n\nvar _search = _interopRequireDefault(__webpack_require__(/*! ./modules/search */ \"./web/themes/custom/materiotheme/vuejs/store/modules/search.js\"));\n\nvar _blabla = _interopRequireDefault(__webpack_require__(/*! ./modules/blabla */ \"./web/themes/custom/materiotheme/vuejs/store/modules/blabla.js\"));\n\nvar _showrooms = _interopRequireDefault(__webpack_require__(/*! ./modules/showrooms */ \"./web/themes/custom/materiotheme/vuejs/store/modules/showrooms.js\"));\n\nvar _pages = _interopRequireDefault(__webpack_require__(/*! ./modules/pages */ \"./web/themes/custom/materiotheme/vuejs/store/modules/pages.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n materiaux(ids: [\", \"]) {\\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\n// https://github.com/vuejs/vuex/tree/dev/examples/shopping-cart\n_vue.default.use(_vuex.default); // export default new Vuex.Store({\n\n\nvar _default = (0, _vuexExtensions.createStore)(_vuex.default.Store, {\n modules: {\n Common: _common.default,\n User: _user.default,\n Search: _search.default,\n Blabla: _blabla.default,\n Showrooms: _showrooms.default,\n Pages: _pages.default\n },\n // https://github.com/huybuidac/vuex-extensions\n mixins: {\n actions: {\n loadMaterialsGQL: function loadMaterialsGQL(_ref, _ref2) {\n var dispatch = _ref.dispatch;\n var ids = _ref2.ids,\n gqlfragment = _ref2.gqlfragment,\n callBack = _ref2.callBack,\n callBackArgs = _ref2.callBackArgs;\n console.log('loadMaterialsGQL ids', ids);\n var ast = (0, _graphqlTag.default)(_templateObject(), ids, gqlfragment);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (resp) {\n console.log('loadMaterialsGQL resp', resp); // dispatch('parseMaterialsGQL', {\n // items: resp.data.data.materiaux,\n // callBack: callBack,\n // callBackArgs: callBackArgs\n // })\n\n dispatch(callBack, {\n items: resp.data.data.materiaux,\n callBackArgs: callBackArgs\n });\n }).catch(function (error) {\n console.warn('Issue with loadMaterials', error);\n Promise.reject(error);\n });\n } // parseMaterialsGQL ({ dispatch }, { items, callBack, callBackArgs }) {\n // dispatch(callBack, { items: items, callBackArgs: callBackArgs })\n // }\n // loadMaterials ({ dispatch }, { uuids, imgStyle, callBack, callBackArgs }) {\n // const params = {\n // // include: 'images', // no needs to include thanks to consumers_image_styles module\n // // include: 'drupal_internal__nid',\n // 'filter[uuids-groupe][group][conjunction]': 'OR'\n // }\n // for (let i = 0; i < uuids.length; i++) {\n // const uuid = uuids[i]\n // params[`filter[${uuid}][condition][path]`] = 'id'\n // params[`filter[${uuid}][condition][value]`] = uuid\n // params[`filter[${uuid}][condition][operator]`] = '='\n // params[`filter[${uuid}][condition][memberOf]`] = 'uuids-groupe'\n // }\n // // console.log('search JSONAPI params', params);\n // const q = qs.stringify(params)\n // return JSONAPI.get('node/materiau?' + q)\n // .then(({ data }) => {\n // console.log('mixin getMaterials data', data)\n // dispatch('parseMaterials', { data: data.data, uuids: uuids, imgStyle: imgStyle, callBack: callBack, callBackArgs: callBackArgs })\n // // commit('setItems', data.items)\n // })\n // .catch((error) => {\n // console.warn('Issue with getItems', error)\n // Promise.reject(error)\n // })\n // },\n // parseMaterials ({ dispatch }, { data, uuids, imgStyle, callBack, callBackArgs }) {\n // // data comes from jsonapi query\n // // uuids comes from original query (solr, FlagCollection, etc)\n // // so we loop from uuids to conserve the original order\n // console.log('mixin parseMaterials', data, uuids, callBack, callBackArgs)\n // const items = []\n // // for (var i = 0; i < data.length; i++) {\n // for (let i = 0; i < uuids.length; i++) {\n // const uuid = uuids[i]\n // // https://stackoverflow.com/questions/11258077/how-to-find-index-of-an-object-by-key-and-value-in-an-javascript-array\n // const item_index = data.findIndex(p => p.id === uuid)\n // // console.log('item_index', item_index);\n // if (item_index === -1) continue\n //\n // const item_src = data[item_index]\n // const attrs = item_src.attributes\n // const relations = item_src.relationships\n //\n // // get field values\n // const item = {\n // uuid: uuid,\n // title: attrs.title,\n // field_short_description: attrs.field_short_description,\n // body: attrs.body,\n // field_reference: attrs.field_reference\n // }\n //\n // // get images included values\n // const img_src = relations.images.data\n // // console.log('img_src', img_src);\n // // this is a temporary deactivation of images\n // // img_src = [];\n // item.images = []\n // for (let j = 0; j < img_src.length; j++) {\n // if (img_src[j].meta.imageDerivatives) {\n // let img_styles = {}\n // for (var k = 0; k < imgStyle.length; k++) {\n // img_styles[imgStyle[k]] = img_src[j].meta.imageDerivatives.links.[imgStyle[k]].href\n // }\n // item.images.push({\n // title: img_src[j].meta.title,\n // src: img_src[j].meta.imageDerivatives.links.hd.href,\n // // meta.imageDerivatives.style.href link is provided by drupal consumers_image_styles module\n // // BUG: missing all image derivative but first\n // img_styles: img_styles\n // })\n // } else {\n // console.warn('missing image derivative ' + j + '/' + img_src.length + ' for ' + attrs.title)\n // }\n // }\n //\n // items.push(item)\n // }\n // console.log('items', items)\n // dispatch(callBack, { items: items, callBackArgs: callBackArgs })\n // }\n\n }\n }\n});\n\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/index.js?"); /***/ }), @@ -1459,7 +1443,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, 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?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\n// import { JSONAPI } from 'vuejs/api/json-axios'\n// import { MA } from 'vuejs/api/ma-axios'\n// import qs from 'querystring-es3'\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?"); /***/ }), @@ -1471,11 +1455,11 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ -/*! runtime requirements: __webpack_exports__, __webpack_require__ */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/*! runtime requirements: __webpack_exports__ */ +/***/ ((__unused_webpack_module, exports) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\nvar _jsonAxios = __webpack_require__(/*! vuejs/api/json-axios */ \"./web/themes/custom/materiotheme/vuejs/api/json-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 pagetitle: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setPagetitle: function setPagetitle(state, title) {\n console.log('Common, setPagetitle', title);\n state.pagetitle = title;\n }\n },\n // actions\n actions: {}\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/common.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n// import { REST } from 'vuejs/api/rest-axios'\n// import { JSONAPI } from 'vuejs/api/json-axios'\n// import qs from 'querystring-es3'\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n pagetitle: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setPagetitle: function setPagetitle(state, title) {\n console.log('Common, setPagetitle', title);\n state.pagetitle = title;\n }\n },\n // actions\n actions: {}\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/common.js?"); /***/ }), @@ -1491,7 +1475,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 pricing: {}\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setPricing: function setPricing(state, page) {\n state.pricing = page;\n }\n },\n // actions\n actions: {\n getPricing: function getPricing(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n\n _restAxios.REST.get('/pricing_rest?_format=json', {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('pricing REST: data', data);\n commit('setPricing', data);\n }).catch(function (error) {\n console.warn('Issue with pricing', error);\n Promise.reject(error);\n });\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/pages.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\n// import { JSONAPI } from 'vuejs/api/json-axios'\n// import { MA } from 'vuejs/api/ma-axios'\n// import qs from 'querystring-es3'\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n pricing: {}\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setPricing: function setPricing(state, page) {\n state.pricing = page;\n }\n },\n // actions\n actions: {\n getPricing: function getPricing(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n\n _restAxios.REST.get('/pricing_rest?_format=json', {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('pricing REST: data', data);\n commit('setPricing', data);\n }).catch(function (error) {\n console.warn('Issue with pricing', error);\n Promise.reject(error);\n });\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/pages.js?"); /***/ }), @@ -1523,7 +1507,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 items: [],\n showrooms_by_tid: {}\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setItems: function setItems(state, items) {\n state.items = state.items.concat(items);\n items.forEach(function (item, i) {\n state.showrooms_by_tid[item.tid] = item;\n });\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\n _restAxios.REST.get('/showrooms_rest?_format=json', {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('showrooms REST: data', data);\n commit('setItems', data);\n }).catch(function (error) {\n console.warn('Issue with showrooms', error);\n Promise.reject(error);\n });\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/showrooms.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\n// import { JSONAPI } from 'vuejs/api/json-axios'\n// import { MA } from 'vuejs/api/ma-axios'\n// import qs from 'querystring-es3'\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n items: [],\n showrooms_by_tid: {}\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setItems: function setItems(state, items) {\n state.items = state.items.concat(items);\n items.forEach(function (item, i) {\n state.showrooms_by_tid[item.tid] = item;\n });\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\n _restAxios.REST.get('/showrooms_rest?_format=json', {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('showrooms REST: data', data);\n commit('setItems', data);\n }).catch(function (error) {\n console.warn('Issue with showrooms', error);\n Promise.reject(error);\n });\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/showrooms.js?"); /***/ }), @@ -1567,6 +1551,18 @@ eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"Fragme /***/ }), +/***/ "./web/themes/custom/materiotheme/vuejs/api/gql/materiaumodal.fragment.gql": +/*!*********************************************************************************!*\ + !*** ./web/themes/custom/materiotheme/vuejs/api/gql/materiaumodal.fragment.gql ***! + \*********************************************************************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/***/ ((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\":\"title\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"short_description\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"body\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reference\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"samples\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"showroom\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"location\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"images\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"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_cardfull\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":221}};\n doc.loc.source = {\"body\":\"fragment MateriauFields on Materiau {\\n title\\n short_description\\n body\\n reference\\n samples{\\n showroom{\\n name\\n id\\n }\\n location\\n }\\n images{\\n url\\n alt\\n style_cardfull{\\n url\\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/materiaumodal.fragment.gql?"); + +/***/ }), + /***/ "./web/themes/custom/materiotheme/vuejs/api/gql/materiausearch.fragment.gql": /*!**********************************************************************************!*\ !*** ./web/themes/custom/materiotheme/vuejs/api/gql/materiausearch.fragment.gql ***! @@ -3019,7 +3015,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 modal-card\" },\n [\n _c(\"section\", { staticClass: \"col col-right\" }, [\n _c(\"header\", [\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 close\" }, [\n _c(\"span\", {\n staticClass: \"btn mdi mdi-close\",\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onCloseModalCard($event)\n }\n }\n })\n ]),\n _vm._v(\" \"),\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(\"section\", { staticClass: \"samples\" }, [\n _c(\"h3\", [_vm._v(_vm._s(_vm.$t(\"materio.Samples\")))]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.item.field_samples, function(sample) {\n return _c(\"li\", { key: sample.target_id }, [\n _c(\"span\", { staticClass: \"showroom\" }, [\n _vm._v(_vm._s(_vm.showrooms[sample.target_id].name))\n ]),\n _vm._v(\": \" + _vm._s(sample.location) + \"\\n \")\n ])\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.item.body.processed) }\n })\n ]),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"col col-left 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.img_styles.card_full, 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: \"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/ModalCard.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.material || _vm.loading\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"article\",\n { staticClass: \"card modal-card\" },\n [\n _c(\"section\", { staticClass: \"col col-right\" }, [\n _c(\"header\", [\n _c(\"h1\", [_vm._v(_vm._s(_vm.material.title))]),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.material.short_description))]),\n _vm._v(\" \"),\n _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.material.reference))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool close\" }, [\n _c(\"span\", {\n staticClass: \"btn mdi mdi-close\",\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onCloseModalCard($event)\n }\n }\n })\n ]),\n _vm._v(\" \"),\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(\"section\", { staticClass: \"samples\" }, [\n _c(\"h3\", [_vm._v(_vm._s(_vm.$t(\"materio.Samples\")))]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.material.samples, function(sample) {\n return _c(\"li\", { key: sample.showroom.id }, [\n _c(\"span\", { staticClass: \"showroom\" }, [\n _vm._v(_vm._s(sample.showroom.name))\n ]),\n _vm._v(\": \" + _vm._s(sample.location) + \"\\n \")\n ])\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.material.body) }\n })\n ]),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"col col-left images\"\n },\n _vm._l(_vm.material.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.style_cardfull.url,\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.material.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/ModalCard.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/materiaumodal.fragment.gql b/web/themes/custom/materiotheme/vuejs/api/gql/materiaumodal.fragment.gql new file mode 100644 index 0000000..3c1132d --- /dev/null +++ b/web/themes/custom/materiotheme/vuejs/api/gql/materiaumodal.fragment.gql @@ -0,0 +1,20 @@ +fragment MateriauFields on Materiau { + title + short_description + body + reference + samples{ + showroom{ + name + id + } + location + } + images{ + url + alt + style_cardfull{ + url + } + } +} diff --git a/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue b/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue index f6ee465..a5b55c1 100644 --- a/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue +++ b/web/themes/custom/materiotheme/vuejs/components/Content/ArticleCard.vue @@ -18,7 +18,7 @@