@iris.interactive/handcook 7.0.11 → 7.0.12
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/README.md +1 -1
- package/mix-manifest.json +6 -0
- package/package.json +2 -2
- package/public/scripts/components/collapse/collapse.component.js +1 -9
- package/public/scripts/components/share/share.component.js +51 -0
- package/public/scripts/components/slider/slider.component.js +1 -10
- package/public/scripts/components/tooltip/tooltip.component.js +2 -2
- package/public/scripts/enumerators/share.enum.js +6 -0
- package/public/scripts/support/cookie.support.js +22 -0
- package/public/scripts/support/hash.support.js +11 -0
- package/public/scripts/support/toggle-html.support.js +5 -0
- package/public/scripts/support/wrap-select.support.js +3 -0
- package/public/styles/scss/_variables.scss +0 -4
- package/public/styles/scss/mixins/_mixin-layout.scss +7 -7
- package/public/styles/scss/mixins/_mixin-style.scss +8 -4
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Welcome to HandCook 👨🍳
|
|
2
|
-

|
|
3
3
|

|
|
4
4
|
[](#)
|
|
5
5
|
[](https://twitter.com/captain\_iris)
|
package/mix-manifest.json
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"/public/scripts/components/scroll-reveal/scroll-reveal.component.js": "/public/scripts/components/scroll-reveal/scroll-reveal.component.js",
|
|
31
31
|
"/public/scripts/components/scroll-reveal/scroll-reveal.component.scss": "/public/scripts/components/scroll-reveal/scroll-reveal.component.scss",
|
|
32
32
|
"/public/scripts/components/scrollspy/scrollspy.component.js": "/public/scripts/components/scrollspy/scrollspy.component.js",
|
|
33
|
+
"/public/scripts/components/share/share.component.js": "/public/scripts/components/share/share.component.js",
|
|
33
34
|
"/public/scripts/components/slider/slider.component.js": "/public/scripts/components/slider/slider.component.js",
|
|
34
35
|
"/public/scripts/components/smooth-scroll/smooth-scroll.component.js": "/public/scripts/components/smooth-scroll/smooth-scroll.component.js",
|
|
35
36
|
"/public/scripts/components/tab/tab.component.js": "/public/scripts/components/tab/tab.component.js",
|
|
@@ -37,10 +38,15 @@
|
|
|
37
38
|
"/public/scripts/components/toggle/toggle.component.js": "/public/scripts/components/toggle/toggle.component.js",
|
|
38
39
|
"/public/scripts/components/tooltip/tooltip.component.js": "/public/scripts/components/tooltip/tooltip.component.js",
|
|
39
40
|
"/public/scripts/enumerators/element.enum.js": "/public/scripts/enumerators/element.enum.js",
|
|
41
|
+
"/public/scripts/enumerators/share.enum.js": "/public/scripts/enumerators/share.enum.js",
|
|
40
42
|
"/public/scripts/enumerators/smooth-scroll.enum.js": "/public/scripts/enumerators/smooth-scroll.enum.js",
|
|
41
43
|
"/public/scripts/enumerators/tooltip.enum.js": "/public/scripts/enumerators/tooltip.enum.js",
|
|
42
44
|
"/public/scripts/handcook.js": "/public/scripts/handcook.js",
|
|
43
45
|
"/public/scripts/index.js.LICENSE.txt": "/public/scripts/index.js.LICENSE.txt",
|
|
46
|
+
"/public/scripts/support/cookie.support.js": "/public/scripts/support/cookie.support.js",
|
|
47
|
+
"/public/scripts/support/hash.support.js": "/public/scripts/support/hash.support.js",
|
|
48
|
+
"/public/scripts/support/toggle-html.support.js": "/public/scripts/support/toggle-html.support.js",
|
|
49
|
+
"/public/scripts/support/wrap-select.support.js": "/public/scripts/support/wrap-select.support.js",
|
|
44
50
|
"/public/styles/scss/_utils.scss": "/public/styles/scss/_utils.scss",
|
|
45
51
|
"/public/styles/scss/_variables.scss": "/public/styles/scss/_variables.scss",
|
|
46
52
|
"/public/styles/scss/handcook.scss": "/public/styles/scss/handcook.scss",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iris.interactive/handcook",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.12",
|
|
4
4
|
"description": "The web cooking by IRIS Interactive",
|
|
5
5
|
"main": "./public/scripts/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"sass-loader": "11.1.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nats-io/nats-core": "^3.0.0-27",
|
|
36
35
|
"@fancyapps/ui": "^4.0.22",
|
|
36
|
+
"@nats-io/nats-core": "^3.0.0-27",
|
|
37
37
|
"bootstrap": "^5.1.3",
|
|
38
38
|
"swiper": "8.0.6",
|
|
39
39
|
"tippy.js": "^6.3.7",
|
|
@@ -39,15 +39,9 @@ export class HcCollapse {
|
|
|
39
39
|
});
|
|
40
40
|
collapseList.map(function (collapse) {
|
|
41
41
|
document.querySelectorAll(`[data-hc-collapse-trigger="${collapse._element.getAttribute("data-hc-collapse")}"]`).forEach(trigger => {
|
|
42
|
-
|
|
42
|
+
trigger.addEventListener('click', function (e) {
|
|
43
43
|
e.preventDefault();
|
|
44
44
|
collapse.toggle();
|
|
45
|
-
};
|
|
46
|
-
trigger.addEventListener('click', handleTriggerAction);
|
|
47
|
-
trigger.addEventListener('keydown', (e) => {
|
|
48
|
-
if (e.which == 13 ) {
|
|
49
|
-
handleTriggerAction(e);
|
|
50
|
-
}
|
|
51
45
|
});
|
|
52
46
|
});
|
|
53
47
|
});
|
|
@@ -58,7 +52,6 @@ export class HcCollapse {
|
|
|
58
52
|
if (triggerEl.classList.contains('active')) {
|
|
59
53
|
triggerEl.classList.remove('active');
|
|
60
54
|
}
|
|
61
|
-
triggerEl.setAttribute('aria-expanded', 'false');
|
|
62
55
|
});
|
|
63
56
|
trigger.dispatchEvent(this.hideEvent);
|
|
64
57
|
});
|
|
@@ -70,7 +63,6 @@ export class HcCollapse {
|
|
|
70
63
|
if (!triggerEl.classList.contains('active')) {
|
|
71
64
|
triggerEl.classList.add('active');
|
|
72
65
|
}
|
|
73
|
-
triggerEl.setAttribute('aria-expanded', 'true');
|
|
74
66
|
});
|
|
75
67
|
trigger.dispatchEvent(this.showEvent);
|
|
76
68
|
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import ShareEnum from "../../enumerators/share.enum";
|
|
2
|
+
|
|
3
|
+
export default class ShareComponent {
|
|
4
|
+
|
|
5
|
+
constructor() {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static manageDisplayOfShareButtons() {
|
|
9
|
+
|
|
10
|
+
if (navigator.share && window.matchMedia('(max-width: 1024px)').matches) {
|
|
11
|
+
$(ShareEnum.shareMobile).removeClass('hidden');
|
|
12
|
+
$(ShareEnum.shareDesktop).addClass('hidden');
|
|
13
|
+
} else {
|
|
14
|
+
$(ShareEnum.shareMobile).addClass('hidden');
|
|
15
|
+
$(ShareEnum.shareDesktop).removeClass('hidden');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static sharePage() {
|
|
20
|
+
let shareButton = $('[data-share="mobile"]');
|
|
21
|
+
|
|
22
|
+
shareButton.on('click', event => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
|
|
25
|
+
if (navigator.share) {
|
|
26
|
+
navigator.share({
|
|
27
|
+
title: document.title,
|
|
28
|
+
url: window.location.href
|
|
29
|
+
})
|
|
30
|
+
} else {
|
|
31
|
+
// fallback
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static shareOnWhatsappWeb() {
|
|
37
|
+
|
|
38
|
+
$(ShareEnum.shareWhatsappService).on('click', function (e) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
window.open('https://web.whatsapp.com/send?text='+$(location).attr('href'), '_blank');
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static shareOnMessengerWeb() {
|
|
45
|
+
|
|
46
|
+
$(ShareEnum.shareMessengerService).on('click', function (e) {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
window.open('http://www.facebook.com/dialog/send?app_id=702473707947207&link='+$(location).attr('href')+'&redirect_uri='+$(location).attr('href'), '_blank');
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -198,7 +198,6 @@ export class HcSlider {
|
|
|
198
198
|
const items = [].slice.call(this.slider.children);
|
|
199
199
|
items.forEach(item => {
|
|
200
200
|
item.classList.add('swiper-slide');
|
|
201
|
-
item.setAttribute('aria-roledescription', 'slide');
|
|
202
201
|
});
|
|
203
202
|
|
|
204
203
|
// On ajoute la classe swiper a notre slider,
|
|
@@ -238,7 +237,7 @@ export class HcSlider {
|
|
|
238
237
|
buttonsWrapper.appendChild(buttonPrev);
|
|
239
238
|
buttonsWrapper.appendChild(buttonNext);
|
|
240
239
|
|
|
241
|
-
this.slider.
|
|
240
|
+
this.slider.appendChild(buttonsWrapper);
|
|
242
241
|
} else {
|
|
243
242
|
if (!this.slider.hasAttribute('data-hc-slider-arrow-prev') && prevEl.length === 0) {
|
|
244
243
|
const buttonPrev = document.createElement("div");
|
|
@@ -267,14 +266,6 @@ export class HcSlider {
|
|
|
267
266
|
grabCursor: true,
|
|
268
267
|
loop: false,
|
|
269
268
|
watchSlidesProgress: true,
|
|
270
|
-
a11y: {
|
|
271
|
-
prevSlideMessage: IRISCollectionTheme.translate.slider.prevSlideMessage ?? 'Slide précédente',
|
|
272
|
-
nextSlideMessage: IRISCollectionTheme.translate.slider.nextSlideMessage ?? 'Slide suivante',
|
|
273
|
-
firstSlideMessage: IRISCollectionTheme.translate.slider.firstSlideMessage ?? 'Vous êtes sur la première slide',
|
|
274
|
-
lastSlideMessage: IRISCollectionTheme.translate.slider.lastSlideMessage ?? 'Vous avez atteint la dernière slide',
|
|
275
|
-
paginationBulletMessage: IRISCollectionTheme.translate.slider.paginationBulletMessage ?? 'Aller sur la slide {{index}}',
|
|
276
|
-
slideLabelMessage: IRISCollectionTheme.translate.slider.slideLabelMessage ?? 'Slide {{index}} sur {{slidesLength}}',
|
|
277
|
-
},
|
|
278
269
|
on: {
|
|
279
270
|
init: (swiper) => {
|
|
280
271
|
|
|
@@ -40,14 +40,14 @@ export class HcTooltip {
|
|
|
40
40
|
document.querySelectorAll(elements).forEach(element => {
|
|
41
41
|
let options = {};
|
|
42
42
|
Object.assign(options, this.defaultOptions, overrideOptions);
|
|
43
|
-
options.trigger = options.trigger != '' ? options.trigger : (element.hasAttribute(TooltipEnum.attrPopover) ? "click
|
|
43
|
+
options.trigger = options.trigger != '' ? options.trigger : (element.hasAttribute(TooltipEnum.attrPopover) ? "click" : "mouseenter");
|
|
44
44
|
options.content = options.content != '' ? options.content : (element.hasAttribute(TooltipEnum.attrContent) ? element.getAttribute(TooltipEnum.attrContent) : '');
|
|
45
45
|
options.placement = options.placement != '' ? options.placement : (element.hasAttribute(TooltipEnum.attrPlacement) ? element.getAttribute(TooltipEnum.attrPlacement) : 'bottom');
|
|
46
46
|
options.interactive = options.interactive != '' ? options.interactive : (element.hasAttribute(TooltipEnum.attrInteractive) ? element.getAttribute(TooltipEnum.attrInteractive) : false);
|
|
47
47
|
let backgroundColor = element.hasAttribute(TooltipEnum.attrBackgroundColor) ? element.getAttribute(TooltipEnum.attrBackgroundColor) : '';
|
|
48
48
|
let color = element.hasAttribute(TooltipEnum.attrColor) ? element.getAttribute(TooltipEnum.attrColor) : '';
|
|
49
49
|
let fontSize = element.hasAttribute(TooltipEnum.attrFontSize) ? element.getAttribute(TooltipEnum.attrFontSize) : '';
|
|
50
|
-
if (options.trigger
|
|
50
|
+
if (options.trigger === 'click') {
|
|
51
51
|
element.addEventListener('click', (e) => {
|
|
52
52
|
e.preventDefault();
|
|
53
53
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default class ShareEnum {
|
|
2
|
+
static shareDesktop = '[data-share="desktop"]';
|
|
3
|
+
static shareMobile = '[data-share="mobile"]';
|
|
4
|
+
static shareWhatsappService = '[data-share-service="whatsapp"]';
|
|
5
|
+
static shareMessengerService = '[data-share-service="messenger"]';
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function getCookie(cname) {
|
|
2
|
+
let name = cname + "=";
|
|
3
|
+
let decodedCookie = decodeURIComponent(document.cookie);
|
|
4
|
+
let ca = decodedCookie.split(';');
|
|
5
|
+
for(let i = 0; i <ca.length; i++) {
|
|
6
|
+
let c = ca[i];
|
|
7
|
+
while (c.charAt(0) == ' ') {
|
|
8
|
+
c = c.substring(1);
|
|
9
|
+
}
|
|
10
|
+
if (c.indexOf(name) == 0) {
|
|
11
|
+
return c.substring(name.length, c.length);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return "";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function setCookie(cname, cvalue, exdays) {
|
|
18
|
+
const d = new Date();
|
|
19
|
+
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
|
20
|
+
let expires = "expires="+ d.toUTCString();
|
|
21
|
+
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
String.prototype.hashCode = function() {
|
|
2
|
+
var hash = 0, i, chr;
|
|
3
|
+
if (this.length === 0) return hash;
|
|
4
|
+
for (i = 0; i < this.length; i++) {
|
|
5
|
+
chr = this.charCodeAt(i);
|
|
6
|
+
hash = ((hash << 5) - hash) + chr;
|
|
7
|
+
hash |= 0; // Convert to 32bit integer
|
|
8
|
+
}
|
|
9
|
+
return hash;
|
|
10
|
+
};
|
|
11
|
+
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
/* Hover
|
|
59
59
|
/* ============================================= */
|
|
60
60
|
@mixin hover {
|
|
61
|
-
|
|
61
|
+
@media (hover: hover) and (pointer: fine) {
|
|
62
62
|
&:hover {
|
|
63
63
|
@content;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
@mixin hover-focus
|
|
69
|
-
|
|
68
|
+
@mixin hover-focus {
|
|
69
|
+
@media (hover: hover) and (pointer: fine) {
|
|
70
70
|
&:hover,
|
|
71
71
|
&:focus {
|
|
72
72
|
@content;
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
@mixin hover-focus-active
|
|
78
|
-
|
|
77
|
+
@mixin hover-focus-active {
|
|
78
|
+
@media (hover: hover) and (pointer: fine) {
|
|
79
79
|
&:hover,
|
|
80
80
|
&:focus,
|
|
81
81
|
&:active {
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
@mixin hover-focus-visited
|
|
88
|
-
|
|
87
|
+
@mixin hover-focus-visited {
|
|
88
|
+
@media (hover: hover) and (pointer: fine) {
|
|
89
89
|
&:hover,
|
|
90
90
|
&:focus,
|
|
91
91
|
&:visited {
|
|
@@ -169,7 +169,9 @@
|
|
|
169
169
|
@include transition;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
&:visited
|
|
172
|
+
&:visited,
|
|
173
|
+
&:focus,
|
|
174
|
+
&:focus-within {
|
|
173
175
|
color: $button-color;
|
|
174
176
|
background-color: $button-background-color;
|
|
175
177
|
background-image: $button-background-image;
|
|
@@ -178,7 +180,7 @@
|
|
|
178
180
|
border: $button-border;
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
@include hover
|
|
183
|
+
@include hover {
|
|
182
184
|
color: $button-color-hover;
|
|
183
185
|
background-color: $button-background-color-hover;
|
|
184
186
|
border: $button-border-hover;
|
|
@@ -226,7 +228,9 @@
|
|
|
226
228
|
@include transition;
|
|
227
229
|
}
|
|
228
230
|
|
|
229
|
-
&:visited
|
|
231
|
+
&:visited,
|
|
232
|
+
&:focus,
|
|
233
|
+
&:focus-within {
|
|
230
234
|
color: $secondary-button-color;
|
|
231
235
|
background-color: $secondary-button-background-color;
|
|
232
236
|
background-image: $secondary-button-background-image;
|
|
@@ -235,7 +239,7 @@
|
|
|
235
239
|
border: $secondary-button-border;
|
|
236
240
|
}
|
|
237
241
|
|
|
238
|
-
@include hover
|
|
242
|
+
@include hover {
|
|
239
243
|
color: $secondary-button-color-hover;
|
|
240
244
|
background-color: $secondary-button-background-color-hover;
|
|
241
245
|
border: $secondary-button-border-hover;
|