@castlabs/ui 7.11.0 → 7.13.0
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.
- package/dist/castlabs-ui.common.js +1 -1
- package/dist/castlabs-ui.common.js.map +1 -1
- package/dist/castlabs-ui.core.js +16 -7
- package/dist/castlabs-ui.css +1 -1
- package/dist/castlabs-ui.module.js +16 -7
- package/dist/castlabs-ui.umd.js +2 -2
- package/dist/castlabs-ui.umd.js.map +1 -1
- package/package.json +1 -1
- package/plugins/matomo/README.md +5 -0
- package/plugins/matomo/index.ts +93 -0
- package/plugins/matomo/vue-matomo.d.ts +1 -0
- package/src/styles/layout/meta.scss +1 -1
package/dist/castlabs-ui.core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @castlabs/ui v7.
|
|
1
|
+
/* @castlabs/ui v7.13.0 */
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
4
|
* Bootstrap v5.3.8 (https://getbootstrap.com/)
|
|
@@ -114,8 +114,17 @@ function clSidenavInitiallyOpen () {
|
|
|
114
114
|
|
|
115
115
|
const cookieName = 'cl_banner_nok'
|
|
116
116
|
|
|
117
|
-
function clCookieBannerSetup () {
|
|
118
|
-
|
|
117
|
+
function clCookieBannerSetup (siteId = 1, forced = false) {
|
|
118
|
+
if (
|
|
119
|
+
!window.location.hostname.match(/castlabs.com$/) &&
|
|
120
|
+
!window.location.search.match('mtm=DEBUG') &&
|
|
121
|
+
!forced
|
|
122
|
+
) {
|
|
123
|
+
console.info(`skipping cookie banner on ${window.location.hostname ?? 'unknown domain'}`)
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
clMatomoSetup(siteId)
|
|
119
128
|
let show = true
|
|
120
129
|
for (const cookie of document?.cookie?.split(/; */) ?? []) {
|
|
121
130
|
const [name, value] = cookie.split('=')
|
|
@@ -188,17 +197,17 @@ function clCookieBannerShow (accept = clCookieBannerAccept, decline = clCookieBa
|
|
|
188
197
|
document.getElementById('cl-button-cookie-decline').addEventListener('click', decline)
|
|
189
198
|
}
|
|
190
199
|
|
|
191
|
-
function clMatomoSetup () {
|
|
200
|
+
function clMatomoSetup (siteId = 1, domain = 'castlabs.com') {
|
|
192
201
|
const _paq = (window._paq = window._paq || [])
|
|
193
202
|
_paq.push(['requireCookieConsent'])
|
|
194
203
|
_paq.push(['setDocumentTitle', document.domain + '/' + document.title])
|
|
195
|
-
_paq.push(['setCookieDomain',
|
|
196
|
-
_paq.push(['setDomains', [
|
|
204
|
+
_paq.push(['setCookieDomain', `*.${domain}`])
|
|
205
|
+
_paq.push(['setDomains', [`*.${domain}`]])
|
|
197
206
|
_paq.push(['trackPageView'])
|
|
198
207
|
_paq.push(['enableLinkTracking'])
|
|
199
208
|
;(function () {
|
|
200
209
|
_paq.push(['setTrackerUrl', 'https://castlabs.matomo.cloud/matomo.php'])
|
|
201
|
-
_paq.push(['setSiteId',
|
|
210
|
+
_paq.push(['setSiteId', `${siteId}`])
|
|
202
211
|
const g = document.createElement('script')
|
|
203
212
|
const s = document.getElementsByTagName('script')[0]
|
|
204
213
|
g.async = true
|