@iris.interactive/handcook 7.1.1-beta → 7.1.1

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  # Welcome to HandCook 👨‍🍳
2
- ![Version](https://img.shields.io/badge/version-7.1.1-beta-blue.svg?cacheSeconds=2592000)
2
+ ![Version](https://img.shields.io/badge/version-7.1.1-blue.svg?cacheSeconds=2592000)
3
3
  ![Prerequisite](https://img.shields.io/badge/node-%3E%3D%2012.14.0-blue.svg)
4
4
  [![License: UNLICENSED](https://img.shields.io/badge/License-UNLICENSED-yellow.svg)](#)
5
5
  [![Twitter: captain\_iris](https://img.shields.io/twitter/follow/captain\_iris.svg?style=social)](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.1.1-beta",
3
+ "version": "7.1.1",
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",
@@ -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
+ }
@@ -294,6 +294,17 @@ export class HcSlider {
294
294
 
295
295
  this.slider.dispatchEvent(this.initEvent);
296
296
  },
297
+ afterInit: (swiper) => {
298
+
299
+ //Remove tabindex
300
+ if (this.slider.hasAttribute('data-hc-slider-disable-arrows-focus')) {
301
+ swiper.$el.find('.hc-slider-buttons > *').removeAttr('tabindex');
302
+ }
303
+
304
+ if (this.slider.hasAttribute('data-hc-slider-disable-pagination-focus')) {
305
+ swiper.$el.find('.hc-slider-pagination > *').removeAttr('tabindex');
306
+ }
307
+ },
297
308
  slideChangeTransitionEnd: (swiper) => {
298
309
 
299
310
  // slide item
@@ -304,6 +315,15 @@ export class HcSlider {
304
315
  swiper.$el.find('.swiper-slide-active').addClass('hc-slider-slide-active');
305
316
  swiper.$el.find('.swiper-slide-next').addClass('hc-slider-slide-next');
306
317
  swiper.$el.find('.swiper-slide-prev').addClass('hc-slider-slide-prev');
318
+
319
+ //Remove tabindex
320
+ if (this.slider.hasAttribute('data-hc-slider-disable-arrows-focus')) {
321
+ swiper.$el.find('.hc-slider-buttons > *').removeAttr('tabindex');
322
+ }
323
+
324
+ if (this.slider.hasAttribute('data-hc-slider-disable-pagination-focus')) {
325
+ swiper.$el.find('.hc-slider-pagination > *').removeAttr('tabindex');
326
+ }
307
327
  }
308
328
  },
309
329
  breakpoints: {}
@@ -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
+
@@ -0,0 +1,5 @@
1
+ jQuery.fn.extend({
2
+ toggleHtml: function (a, b) {
3
+ return this.html(this.html() == b ? a : b);
4
+ }
5
+ });
@@ -0,0 +1,3 @@
1
+ export default function wrapSelect() {
2
+ $('select:not([class*="lightpick"])').parent().not('.form__select').children('select').wrap('<div class="form__select"></div>');
3
+ }
@@ -157,4 +157,10 @@
157
157
  &--center {
158
158
  align-items: center;
159
159
  }
160
+ }
161
+
162
+ /* Foucs style
163
+ /* ============================================= */
164
+ .not-focus-style:focus {
165
+ outline: none !important;
160
166
  }
@@ -609,6 +609,7 @@ $c-intermediate: #ff890e;
609
609
  $c-hard: #ef5350;
610
610
  $c-veryhard: #000;
611
611
 
612
- /* Grey
612
+ /* Gray
613
613
  / ================================================== */
614
- $c-grey: #757575
614
+ $c-gray: #757575;
615
+ $c-lightgray: #ddd;
@@ -58,15 +58,15 @@
58
58
  /* Hover
59
59
  /* ============================================= */
60
60
  @mixin hover {
61
- body.iris-hover & {
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
- body.iris-hover & {
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
- body.iris-hover & {
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
- body.iris-hover & {
87
+ @mixin hover-focus-visited {
88
+ @media (hover: hover) and (pointer: fine) {
89
89
  &:hover,
90
90
  &:focus,
91
91
  &:visited {
@@ -25,4 +25,4 @@
25
25
  * @author Lucas ROCHE
26
26
  * @date 28/01/2022 07:41
27
27
  * @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
28
- */.stretched-link:before{background-color:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.list-flex{display:flex;flex-wrap:wrap;margin-bottom:0}.list-flex>*{list-style-type:none;margin:0 5px 10px 0}.list-flex>:last-child{margin-right:0}@keyframes loader{to{transform:rotate(1turn)}}@keyframes fade{0%{opacity:0}to{opacity:1}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.text-icon{align-items:center;display:inline-flex;gap:5px}.text-icon--start{align-items:flex-start}.hover-item img{transition:.2s ease;will-change:transform}.hover-item:hover img{transform:scale(1.02)}.is-open{color:#009e55}.soon-close{color:#ff890e}.is-close{color:#f33}.fi--color:before,.fi-color:after{color:var(--iris--icon--color)}.font-size-xsmall{font-size:var(--iris--global--font-size-xsmall--rem)}.font-size-small{font-size:var(--iris--global--font-size-small--rem)}.font-size-regular{font-size:var(--iris--global--font-size-regular--rem)}@media screen and (max-width:650px){.font-size-regular{font-size:var(--iris--global--font-size-regular--small--rem)}}.font-size-large{font-size:var(--iris--global--font-size-large--rem)}@media screen and (max-width:650px){.font-size-large{font-size:var(--iris--global--font-size-large--small--rem)}}.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--rem)}@media screen and (max-width:650px){.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--small--rem)}}.align-items--bottom,.align-items--end{align-items:flex-end}.align-items--start,.align-items--top{align-items:flex-start}.align-items--center{align-items:center}
28
+ */.stretched-link:before{background-color:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.list-flex{display:flex;flex-wrap:wrap;margin-bottom:0}.list-flex>*{list-style-type:none;margin:0 5px 10px 0}.list-flex>:last-child{margin-right:0}@keyframes loader{to{transform:rotate(1turn)}}@keyframes fade{0%{opacity:0}to{opacity:1}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.text-icon{align-items:center;display:inline-flex;gap:5px}.text-icon--start{align-items:flex-start}.hover-item img{transition:.2s ease;will-change:transform}.hover-item:hover img{transform:scale(1.02)}.is-open{color:#009e55}.soon-close{color:#ff890e}.is-close{color:#f33}.fi--color:before,.fi-color:after{color:var(--iris--icon--color)}.font-size-xsmall{font-size:var(--iris--global--font-size-xsmall--rem)}.font-size-small{font-size:var(--iris--global--font-size-small--rem)}.font-size-regular{font-size:var(--iris--global--font-size-regular--rem)}@media screen and (max-width:650px){.font-size-regular{font-size:var(--iris--global--font-size-regular--small--rem)}}.font-size-large{font-size:var(--iris--global--font-size-large--rem)}@media screen and (max-width:650px){.font-size-large{font-size:var(--iris--global--font-size-large--small--rem)}}.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--rem)}@media screen and (max-width:650px){.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--small--rem)}}.align-items--bottom,.align-items--end{align-items:flex-end}.align-items--start,.align-items--top{align-items:flex-start}.align-items--center{align-items:center}.not-focus-style:focus{outline:none!important}