@castlabs/ui 7.24.2 → 8.0.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-editor.common.js +4 -4
- package/dist/castlabs-ui-editor.common.js.map +1 -1
- package/dist/castlabs-ui-editor.umd.js +4 -4
- package/dist/castlabs-ui-editor.umd.js.map +1 -1
- package/dist/castlabs-ui.common.js +3 -3
- package/dist/castlabs-ui.common.js.map +1 -1
- package/dist/castlabs-ui.core.js +1 -105
- package/dist/castlabs-ui.css +1 -1
- package/dist/castlabs-ui.module.js +1 -105
- package/dist/castlabs-ui.umd.js +4 -4
- package/dist/castlabs-ui.umd.js.map +1 -1
- package/package.json +25 -24
- package/src/components/ClPagination/style.scss +1 -1
- package/src/components/ClToggle/style.scss +1 -1
- package/src/styles/abstracts/color.scss +2 -14
- package/src/styles/layout/color.scss +21 -29
- package/src/styles/layout/meta.scss +1 -1
- package/src/styles/ui.scss +0 -1
- package/types/index.d.ts +0 -1
- package/plugins/matomo/README.md +0 -5
- package/plugins/matomo/index.ts +0 -93
- package/plugins/matomo/vue-matomo.d.ts +0 -1
- package/src/components/widget/ClCookieBanner/style.scss +0 -48
package/dist/castlabs-ui.core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @castlabs/ui
|
|
1
|
+
/* @castlabs/ui v8.0.0 */
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
4
|
* Bootstrap v5.3.8 (https://getbootstrap.com/)
|
|
@@ -112,110 +112,6 @@ function clSidenavInitiallyOpen () {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
const cookieName = 'cl_banner_nok'
|
|
116
|
-
|
|
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)
|
|
128
|
-
let show = true
|
|
129
|
-
for (const cookie of document?.cookie?.split(/; */) ?? []) {
|
|
130
|
-
const [name, value] = cookie.split('=')
|
|
131
|
-
if (name === cookieName && ['-mtm', '+mtm'].includes(value)) {
|
|
132
|
-
show = false
|
|
133
|
-
break // for
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (show) clCookieBannerShow()
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function clCookieBannerHide () {
|
|
140
|
-
const banner = document.querySelector('div.cl-cookie-banner')
|
|
141
|
-
banner.classList.add('cl-fade-away')
|
|
142
|
-
setTimeout(() => {
|
|
143
|
-
banner.parentNode.removeChild(banner)
|
|
144
|
-
}, 500)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function clCookieBannerAccept () {
|
|
148
|
-
document.cookie = `cl_banner_nok=+mtm; max-age=${60 * 60 * 24 * 395}; domain=.castlabs.com; path=/; SameSite=Lax;`
|
|
149
|
-
clCookieBannerHide()
|
|
150
|
-
|
|
151
|
-
const _paq = (window._paq = window._paq || [])
|
|
152
|
-
_paq.push(['rememberCookieConsentGiven', 9480])
|
|
153
|
-
_paq.push(['trackPageView'])
|
|
154
|
-
_paq.push(['enableLinkTracking'])
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function clCookieBannerDecline () {
|
|
158
|
-
document.cookie = `cl_banner_nok=-mtm; max-age=${60 * 60 * 24 * 395}; domain=.castlabs.com; path=/; SameSite=Lax;`
|
|
159
|
-
clCookieBannerHide()
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function clCookieBannerShow (accept = clCookieBannerAccept, decline = clCookieBannerDecline) {
|
|
163
|
-
const banner = document.createElement('div')
|
|
164
|
-
banner.classList.add('card', 'cl-card', 'cl-cookie-banner')
|
|
165
|
-
banner.innerHTML = `
|
|
166
|
-
<div class="card-body">
|
|
167
|
-
<p class="cl-p-small">
|
|
168
|
-
For our services to work, we use essential cookies which we control.
|
|
169
|
-
We'd also like to include others to analyze how our site is used to help
|
|
170
|
-
improve it - but only if you accept. Learn more in our
|
|
171
|
-
<a
|
|
172
|
-
class="cl-a-text"
|
|
173
|
-
href="https://castlabs.com/privacy-cookie-policy/"
|
|
174
|
-
>privacy policy</a>.
|
|
175
|
-
</p>
|
|
176
|
-
|
|
177
|
-
<div class="cl-spacing-box cl-spread">
|
|
178
|
-
<button
|
|
179
|
-
id="cl-button-cookie-decline"
|
|
180
|
-
type="button"
|
|
181
|
-
class="btn btn-sm cl-color-night it-cancel"
|
|
182
|
-
>
|
|
183
|
-
Decline
|
|
184
|
-
</button>
|
|
185
|
-
<button
|
|
186
|
-
id="cl-button-cookie-accept"
|
|
187
|
-
type="button"
|
|
188
|
-
class="btn btn-sm cl-color-red it-ok"
|
|
189
|
-
>
|
|
190
|
-
Accept
|
|
191
|
-
</button>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
`
|
|
195
|
-
document.body.appendChild(banner)
|
|
196
|
-
document.getElementById('cl-button-cookie-accept').addEventListener('click', accept)
|
|
197
|
-
document.getElementById('cl-button-cookie-decline').addEventListener('click', decline)
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function clMatomoSetup (siteId = 1, domain = 'castlabs.com') {
|
|
201
|
-
const _paq = (window._paq = window._paq || [])
|
|
202
|
-
_paq.push(['requireCookieConsent'])
|
|
203
|
-
_paq.push(['setDocumentTitle', document.domain + '/' + document.title])
|
|
204
|
-
_paq.push(['setCookieDomain', `*.${domain}`])
|
|
205
|
-
_paq.push(['setDomains', [`*.${domain}`]])
|
|
206
|
-
_paq.push(['trackPageView'])
|
|
207
|
-
_paq.push(['enableLinkTracking'])
|
|
208
|
-
;(function () {
|
|
209
|
-
_paq.push(['setTrackerUrl', 'https://castlabs.matomo.cloud/matomo.php'])
|
|
210
|
-
_paq.push(['setSiteId', `${siteId}`])
|
|
211
|
-
const g = document.createElement('script')
|
|
212
|
-
const s = document.getElementsByTagName('script')[0]
|
|
213
|
-
g.async = true
|
|
214
|
-
g.src = '//cdn.matomo.cloud/castlabs.matomo.cloud/matomo.js'
|
|
215
|
-
s.parentNode.insertBefore(g, s)
|
|
216
|
-
})()
|
|
217
|
-
}
|
|
218
|
-
|
|
219
115
|
function clTableSetupResize (id, auto = false) {
|
|
220
116
|
document.querySelectorAll(`#${id} .cl-resizer`).forEach(resizer => {
|
|
221
117
|
clTableSetResizeListeners(resizer, auto)
|