waygo-maps 1.0.91 → 1.0.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bundle.js +2 -2
  2. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -724,7 +724,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
724
724
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
725
725
 
726
726
  "use strict";
727
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentDetails: () => (/* binding */ ContentDetails),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ContentPlacementHeader */ \"./src/components/ContentPlacementView/ContentPlacementHeader.js\");\n/* harmony import */ var _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ContextualLocationView */ \"./src/components/ContentPlacementView/ContextualLocationView.js\");\n/* harmony import */ var _DetailsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DetailsView */ \"./src/components/ContentPlacementView/DetailsView.js\");\n/* harmony import */ var _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ContentChildrenView */ \"./src/components/ContentPlacementView/ContentChildrenView.js\");\n/* harmony import */ var _assets_location_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/location.svg */ \"./src/assets/location.svg\");\n/* harmony import */ var _assets_website_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../assets/website.svg */ \"./src/assets/website.svg\");\n/* harmony import */ var _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/copyIcon.svg */ \"./src/assets/copyIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\n\n\nvar ContentDetails = /*#__PURE__*/function (_Component) {\n function ContentDetails() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentDetails);\n _this = _callSuper(this, ContentDetails, [options]);\n _this.contentPlacement = null;\n _this.element = document.createElement('div');\n _this.element.className = 'content-details';\n _this.header = document.createElement('div');\n _this.header.className = 'content-details-header';\n _this.contentPlacementHeader = null;\n _this.actionsView = document.createElement('div');\n _this.actionsView.className = 'content-details-section';\n _this.actionButtons = document.createElement('div');\n _this.actionButtons.className = 'content-details-action-buttons';\n _this.directionsButton = document.createElement('button');\n _this.directionsButton.className = 'content-details-directions-button';\n _this.directionsButton.textContent = 'Directions';\n _this.shareButton = document.createElement('button');\n _this.shareButton.className = 'content-details-share-button';\n _this.shareButton.textContent = 'Share';\n var copyIconElement = document.createElement('img');\n copyIconElement.src = _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n copyIconElement.className = 'copy-icon'; // Add a class for styling\n\n _this.shareButton.appendChild(copyIconElement);\n _this.locationButton = null;\n // this.websiteButton = null;\n _this.websiteButtons = [];\n _this.detailsView = null;\n _this.childrenComponents = [];\n return _this;\n }\n _inherits(ContentDetails, _Component);\n return _createClass(ContentDetails, [{\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.childrenComponents.forEach(function (childrenComponent) {\n childrenComponent.on('selectChildContentPlacement', _this2._handleSelectChildContentPlacement.bind(_this2));\n });\n this.directionsButton.addEventListener('click', this._handleDirectionsButtonSelect.bind(this));\n this.shareButton.addEventListener('click', this._handleShareButtonSelect.bind(this));\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this3 = this;\n this.element.innerHTML = '';\n this.header.innerHTML = '';\n this.actionsView.innerHTML = '';\n\n // Header elements\n if (this.contentPlacementHeader) {\n this.header.appendChild(this.contentPlacementHeader.getElement());\n }\n this.actionButtons.appendChild(this.directionsButton);\n this.actionButtons.appendChild(this.shareButton);\n this.header.appendChild(this.actionButtons);\n if (this.locationButton) {\n this.actionsView.appendChild(this.locationButton.getElement());\n }\n\n // if (this.websiteButton) {\n // this.actionsView.appendChild(this.websiteButton.getElement());\n // }\n\n this.websiteButtons.forEach(function (websiteButton) {\n _this3.actionsView.appendChild(websiteButton.getElement());\n });\n this.header.appendChild(this.actionsView);\n this.element.appendChild(this.header);\n\n // Details view element\n if (this.detailsView) {\n this.detailsView.innerHTML = '';\n this.element.appendChild(this.detailsView.getElement());\n }\n\n // Children view elements\n this.childrenComponents.forEach(function (childrenComponent) {\n _this3.element.appendChild(childrenComponent.getElement());\n });\n }\n }, {\n key: \"_handleShareButtonSelect\",\n value: function _handleShareButtonSelect() {\n this.fire('selectShareButton', {\n placementId: this.contentPlacement.placement_id\n });\n }\n }, {\n key: \"showCopyPopup\",\n value: function showCopyPopup() {\n // Create popup element\n var popup = document.createElement('div');\n popup.className = 'copy-popup';\n popup.textContent = 'Copied to clipboard';\n\n // Position the popup below the share button\n var buttonRect = this.shareButton.getBoundingClientRect();\n var popupWidth = 120;\n popup.style.position = 'absolute';\n popup.style.left = \"\".concat(buttonRect.left + buttonRect.width / 2 - popupWidth / 2, \"px\"); // `${buttonRect.left}px`;\n popup.style.top = \"\".concat(buttonRect.bottom + window.scrollY, \"px\"); // Adjust for scroll position\n popup.style.zIndex = '9999'; // Ensure it appears on top of other components\n\n document.body.appendChild(popup);\n\n // Fade out and remove popup after 2 seconds\n setTimeout(function () {\n popup.style.opacity = '0';\n popup.style.transition = 'opacity 0.5s';\n setTimeout(function () {\n popup.remove();\n }, 500);\n }, 1500);\n }\n }, {\n key: \"_handleDirectionsButtonSelect\",\n value: function _handleDirectionsButtonSelect() {\n this.fire('selectDirectionsButton', {\n placementId: this.contentPlacement.placement_id\n });\n }\n }, {\n key: \"_handleBackArrowClick\",\n value: function _handleBackArrowClick() {\n this.fire('selectBackButton');\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n var placementId = data.placementId;\n this.fire('selectChildContentPlacement', {\n placementId: placementId\n });\n }\n }, {\n key: \"findViableAdditionalData\",\n value: function findViableAdditionalData(contentPlacement) {\n var data = contentPlacement.content.data;\n var keys = Object.keys(data);\n var titleKey = contentPlacement.content.title_key;\n var notAllowedKeys = [titleKey, 'Type', 'Feature', 'Features', 'Feature ID', 'feature_id', 'Website', 'SNS', 'Website URL', 'Networking Link', 'URL', 'LinkedIn', 'Files & media'];\n var viableData = {};\n keys.forEach(function (key) {\n var value = data[key];\n // const trimValue = value.trim();\n // const cleanValue = trimValue.replace(/[\\s\\r\\n]+/g, '');\n var cleanValue = value.trim().replace(/\\s+/g, ' ');\n if (!notAllowedKeys.includes(key) && cleanValue !== null && cleanValue !== undefined && cleanValue !== \"\") {\n viableData[key] = cleanValue;\n }\n });\n return viableData;\n }\n }, {\n key: \"updateView\",\n value: function updateView(contentPlacement) {\n var _this4 = this;\n this.contentPlacement = contentPlacement;\n\n // Update the header\n this.contentPlacementHeader = new _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](contentPlacement);\n\n // Update location and website buttons\n this.locationButton = new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_location_svg__WEBPACK_IMPORTED_MODULE_5__[\"default\"], contentPlacement.contextual_location);\n // const websiteUrl = contentPlacement.content.data['URL'] || contentPlacement.content.data['Website'] || contentPlacement.content.data['LinkedIn'] || contentPlacement.content.data['Website URL'] || contentPlacement.content.data['SNS'];\n var urlFields = ['URL', 'Website', 'LinkedIn', 'Website URL', 'SNS', 'Networking Link'];\n urlFields.forEach(function (field) {\n var url = contentPlacement.content.data[field];\n if (url && url.trim() !== '') {\n var cleanUrl = url.replace(/[\\s\\r\\n]+/g, '');\n _this4.websiteButtons.push(new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_website_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"], cleanUrl, cleanUrl));\n }\n });\n // this.websiteButton = websiteUrl ? new ContextualLocationView(websiteIcon, websiteUrl, websiteUrl) : null;\n\n // Update details view with new viable data\n var viableAdditionalData = this.findViableAdditionalData(contentPlacement);\n var viableDataKeys = Object.keys(viableAdditionalData);\n this.detailsView = viableDataKeys.length > 0 ? new _DetailsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"](viableAdditionalData) : null;\n\n // Update children components\n this.childrenComponents = [];\n for (var _i = 0, _Object$entries = Object.entries(contentPlacement.children); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n title = _Object$entries$_i[0],\n children = _Object$entries$_i[1];\n var childrenComponent = new _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__[\"default\"](title, children);\n this.childrenComponents.push(childrenComponent);\n }\n\n // Reset event listeners\n this._setupEventListeners();\n\n // Re-render the component with the new data\n this._render();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentDetails);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContentDetails.js?");
727
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentDetails: () => (/* binding */ ContentDetails),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ContentPlacementHeader */ \"./src/components/ContentPlacementView/ContentPlacementHeader.js\");\n/* harmony import */ var _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ContextualLocationView */ \"./src/components/ContentPlacementView/ContextualLocationView.js\");\n/* harmony import */ var _DetailsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DetailsView */ \"./src/components/ContentPlacementView/DetailsView.js\");\n/* harmony import */ var _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ContentChildrenView */ \"./src/components/ContentPlacementView/ContentChildrenView.js\");\n/* harmony import */ var _assets_location_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/location.svg */ \"./src/assets/location.svg\");\n/* harmony import */ var _assets_website_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../assets/website.svg */ \"./src/assets/website.svg\");\n/* harmony import */ var _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/copyIcon.svg */ \"./src/assets/copyIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\n\n\nvar ContentDetails = /*#__PURE__*/function (_Component) {\n function ContentDetails() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentDetails);\n _this = _callSuper(this, ContentDetails, [options]);\n _this.contentPlacement = null;\n _this.element = document.createElement('div');\n _this.element.className = 'content-details';\n _this.header = document.createElement('div');\n _this.header.className = 'content-details-header';\n _this.contentPlacementHeader = null;\n _this.actionsView = document.createElement('div');\n _this.actionsView.className = 'content-details-section';\n _this.actionButtons = document.createElement('div');\n _this.actionButtons.className = 'content-details-action-buttons';\n _this.directionsButton = document.createElement('button');\n _this.directionsButton.className = 'content-details-directions-button';\n _this.directionsButton.textContent = 'Directions';\n _this.shareButton = document.createElement('button');\n _this.shareButton.className = 'content-details-share-button';\n _this.shareButton.textContent = 'Share';\n var copyIconElement = document.createElement('img');\n copyIconElement.src = _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n copyIconElement.className = 'copy-icon'; // Add a class for styling\n\n _this.shareButton.appendChild(copyIconElement);\n _this.locationButton = null;\n // this.websiteButton = null;\n _this.websiteButtons = [];\n _this.detailsView = null;\n _this.childrenComponents = [];\n return _this;\n }\n _inherits(ContentDetails, _Component);\n return _createClass(ContentDetails, [{\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.childrenComponents.forEach(function (childrenComponent) {\n childrenComponent.on('selectChildContentPlacement', _this2._handleSelectChildContentPlacement.bind(_this2));\n });\n this.directionsButton.addEventListener('click', this._handleDirectionsButtonSelect.bind(this));\n this.shareButton.addEventListener('click', this._handleShareButtonSelect.bind(this));\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this3 = this;\n this.element.innerHTML = '';\n this.header.innerHTML = '';\n this.actionsView.innerHTML = '';\n\n // Header elements\n if (this.contentPlacementHeader) {\n this.header.appendChild(this.contentPlacementHeader.getElement());\n }\n this.actionButtons.appendChild(this.directionsButton);\n this.actionButtons.appendChild(this.shareButton);\n this.header.appendChild(this.actionButtons);\n if (this.locationButton) {\n this.actionsView.appendChild(this.locationButton.getElement());\n }\n\n // if (this.websiteButton) {\n // this.actionsView.appendChild(this.websiteButton.getElement());\n // }\n\n this.websiteButtons.forEach(function (websiteButton) {\n _this3.actionsView.appendChild(websiteButton.getElement());\n });\n this.header.appendChild(this.actionsView);\n this.element.appendChild(this.header);\n\n // Details view element\n if (this.detailsView) {\n this.detailsView.innerHTML = '';\n this.element.appendChild(this.detailsView.getElement());\n }\n\n // Children view elements\n this.childrenComponents.forEach(function (childrenComponent) {\n _this3.element.appendChild(childrenComponent.getElement());\n });\n }\n }, {\n key: \"_handleShareButtonSelect\",\n value: function _handleShareButtonSelect() {\n this.fire('selectShareButton', {\n placementId: this.contentPlacement.placement_id\n });\n }\n }, {\n key: \"showCopyPopup\",\n value: function showCopyPopup() {\n // Create popup element\n var popup = document.createElement('div');\n popup.className = 'copy-popup';\n popup.textContent = 'Copied to clipboard';\n\n // Position the popup below the share button\n var buttonRect = this.shareButton.getBoundingClientRect();\n var popupWidth = 120;\n popup.style.position = 'absolute';\n popup.style.left = \"\".concat(buttonRect.left + buttonRect.width / 2 - popupWidth / 2, \"px\"); // `${buttonRect.left}px`;\n popup.style.top = \"\".concat(buttonRect.bottom + window.scrollY, \"px\"); // Adjust for scroll position\n popup.style.zIndex = '9999'; // Ensure it appears on top of other components\n\n document.body.appendChild(popup);\n\n // Fade out and remove popup after 2 seconds\n setTimeout(function () {\n popup.style.opacity = '0';\n popup.style.transition = 'opacity 0.5s';\n setTimeout(function () {\n popup.remove();\n }, 500);\n }, 1500);\n }\n }, {\n key: \"_handleDirectionsButtonSelect\",\n value: function _handleDirectionsButtonSelect() {\n this.fire('selectDirectionsButton', {\n placementId: this.contentPlacement.placement_id\n });\n }\n }, {\n key: \"_handleBackArrowClick\",\n value: function _handleBackArrowClick() {\n this.fire('selectBackButton');\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n var placementId = data.placementId;\n this.fire('selectChildContentPlacement', {\n placementId: placementId\n });\n }\n }, {\n key: \"findViableAdditionalData\",\n value: function findViableAdditionalData(contentPlacement) {\n var data = contentPlacement.content.data;\n var keys = Object.keys(data);\n var titleKey = contentPlacement.content.title_key;\n var notAllowedKeys = [titleKey, 'Type', 'Feature', 'Features', 'Feature ID', 'feature_id', 'Website', 'SNS', 'Website URL', 'Networking Link', 'URL', 'LinkedIn', 'Files & media'];\n var viableData = {};\n keys.forEach(function (key) {\n var value = data[key];\n // const trimValue = value.trim();\n // const cleanValue = trimValue.replace(/[\\s\\r\\n]+/g, '');\n var cleanValue = value.trim().replace(/\\s+/g, ' ');\n if (!notAllowedKeys.includes(key) && cleanValue !== null && cleanValue !== undefined && cleanValue !== \"\") {\n viableData[key] = cleanValue;\n }\n });\n return viableData;\n }\n }, {\n key: \"updateView\",\n value: function updateView(contentPlacement) {\n var _this4 = this;\n this.contentPlacement = contentPlacement;\n\n // Update the header\n this.contentPlacementHeader = new _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](contentPlacement);\n\n // Update location and website buttons\n this.locationButton = new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_location_svg__WEBPACK_IMPORTED_MODULE_5__[\"default\"], contentPlacement.contextual_location);\n // const websiteUrl = contentPlacement.content.data['URL'] || contentPlacement.content.data['Website'] || contentPlacement.content.data['LinkedIn'] || contentPlacement.content.data['Website URL'] || contentPlacement.content.data['SNS'];\n var urlFields = ['URL', 'Website', 'LinkedIn', 'Website URL', 'SNS', 'Networking Link'];\n urlFields.forEach(function (field) {\n var url = contentPlacement.content.data[field];\n if (url && url.trim() !== '') {\n console.log(\"IN URL\", url);\n // const cleanUrl = url.replace(/[\\s\\r\\n]+/g, '');\n // console.log(\"IN CLEAN URL\", cleanUrl);\n _this4.websiteButtons.push(new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_website_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"], url, url));\n }\n });\n // this.websiteButton = websiteUrl ? new ContextualLocationView(websiteIcon, websiteUrl, websiteUrl) : null;\n\n // Update details view with new viable data\n var viableAdditionalData = this.findViableAdditionalData(contentPlacement);\n var viableDataKeys = Object.keys(viableAdditionalData);\n this.detailsView = viableDataKeys.length > 0 ? new _DetailsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"](viableAdditionalData) : null;\n\n // Update children components\n this.childrenComponents = [];\n for (var _i = 0, _Object$entries = Object.entries(contentPlacement.children); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n title = _Object$entries$_i[0],\n children = _Object$entries$_i[1];\n var childrenComponent = new _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__[\"default\"](title, children);\n this.childrenComponents.push(childrenComponent);\n }\n\n // Reset event listeners\n this._setupEventListeners();\n\n // Re-render the component with the new data\n this._render();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentDetails);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContentDetails.js?");
728
728
 
729
729
  /***/ }),
730
730
 
@@ -746,7 +746,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
746
746
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
747
747
 
748
748
  "use strict";
749
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContextualLocationView: () => (/* binding */ ContextualLocationView),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\nvar ContextualLocationView = /*#__PURE__*/function (_Component) {\n function ContextualLocationView(icon, text) {\n var _this;\n var link = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n _classCallCheck(this, ContextualLocationView);\n _this = _callSuper(this, ContextualLocationView, [options]);\n _this.icon = icon;\n _this.text = text;\n _this.link = link;\n _this._initialize();\n return _this;\n }\n _inherits(ContextualLocationView, _Component);\n return _createClass(ContextualLocationView, [{\n key: \"_initialize\",\n value: function _initialize() {\n if (this.link) {\n this.element = document.createElement('a');\n this.element.href = this.link;\n this.element.target = '_blank'; // Open link in a new tab\n this.element.rel = 'noopener noreferrer'; // Security best practice\n this.element.style.textDecoration = 'none';\n } else {\n this.element = document.createElement('div');\n }\n\n // this.element = document.createElement('div');\n this.element.className = 'contextual-location-view';\n this.imageViewElement = document.createElement('img');\n this.imageViewElement.className = 'contextual-location-image';\n this.imageViewElement.src = this.icon;\n this.textElement = document.createElement('span');\n this.textElement.textContent = this.text;\n this.textElement.className = 'contextual-location-text';\n this.element.appendChild(this.imageViewElement);\n this.element.appendChild(this.textElement);\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContextualLocationView);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContextualLocationView.js?");
749
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContextualLocationView: () => (/* binding */ ContextualLocationView),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\nvar ContextualLocationView = /*#__PURE__*/function (_Component) {\n function ContextualLocationView(icon, text) {\n var _this;\n var link = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n _classCallCheck(this, ContextualLocationView);\n _this = _callSuper(this, ContextualLocationView, [options]);\n _this.icon = icon;\n _this.text = text;\n _this.link = link;\n _this._initialize();\n return _this;\n }\n _inherits(ContextualLocationView, _Component);\n return _createClass(ContextualLocationView, [{\n key: \"_formatUrl\",\n value: function _formatUrl(url) {\n if (!url) return url;\n\n // Remove leading/trailing whitespace\n url = url.trim();\n\n // Check if the URL already has a protocol\n if (!/^https?:\\/\\//i.test(url)) {\n // Add https:// if no protocol is present\n url = 'https://' + url;\n }\n return url;\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n if (this.link) {\n console.log(\"IN LINK\", this.link);\n this.element = document.createElement('a');\n this.element.href = this._formatUrl(this.link);\n this.element.target = '_blank'; // Open link in a new tab\n this.element.rel = 'noopener noreferrer'; // Security best practice\n this.element.style.textDecoration = 'none';\n } else {\n this.element = document.createElement('div');\n }\n\n // this.element = document.createElement('div');\n this.element.className = 'contextual-location-view';\n this.imageViewElement = document.createElement('img');\n this.imageViewElement.className = 'contextual-location-image';\n this.imageViewElement.src = this.icon;\n this.textElement = document.createElement('span');\n this.textElement.textContent = this.text;\n this.textElement.className = 'contextual-location-text';\n this.element.appendChild(this.imageViewElement);\n this.element.appendChild(this.textElement);\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContextualLocationView);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContextualLocationView.js?");
750
750
 
751
751
  /***/ }),
752
752
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygo-maps",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "main": "dist/bundle.js",
5
5
  "files": [
6
6
  "dist/bundle.js",