@20minutes/tyr 0.1.63 → 0.1.65
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/components/organisms/TagPage/TagPageArticlesList.d.ts +3 -2
- package/dist/css/articlePage-desktop-critical.css +1 -1
- package/dist/css/articlePage-desktop-no-critical.css +1 -1
- package/dist/css/articlePage-mobile-critical.css +1 -1
- package/dist/css/articlePage-mobile-no-critical.css +1 -1
- package/dist/css/errorPage-desktop-critical.css +1 -1
- package/dist/css/errorPage-desktop-no-critical.css +1 -1
- package/dist/css/errorPage-mobile-critical.css +1 -1
- package/dist/css/errorPage-mobile-no-critical.css +1 -1
- package/dist/css/horoscopePage-desktop-critical.css +1 -1
- package/dist/css/horoscopePage-desktop-no-critical.css +1 -1
- package/dist/css/horoscopePage-mobile-critical.css +1 -1
- package/dist/css/horoscopePage-mobile-no-critical.css +1 -1
- package/dist/css/horoscopehomePage-desktop-critical.css +1 -1
- package/dist/css/horoscopehomePage-desktop-no-critical.css +1 -1
- package/dist/css/horoscopehomePage-mobile-critical.css +1 -1
- package/dist/css/horoscopehomePage-mobile-no-critical.css +1 -1
- package/dist/css/searchPage-desktop-critical.css +1 -1
- package/dist/css/searchPage-desktop-no-critical.css +1 -1
- package/dist/css/searchPage-mobile-critical.css +1 -1
- package/dist/css/searchPage-mobile-no-critical.css +1 -1
- package/dist/css/tagPage-desktop-critical.css +1 -1
- package/dist/css/tagPage-desktop-no-critical.css +1 -1
- package/dist/css/tagPage-mobile-critical.css +1 -1
- package/dist/css/tagPage-mobile-no-critical.css +1 -1
- package/dist/index.es.js +35330 -25595
- package/dist/index.umd.js +196 -141
- package/dist/js/concern.min.js +4 -21
- package/dist/types/ComponentConfig.d.ts +3 -1
- package/dist/types/Window.d.ts +2 -2
- package/package.json +5 -5
package/dist/js/concern.min.js
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";function $(
|
|
2
|
-
<div class="flex@xs items-center@xs gap-xs@xs c-smart-banner u-skin-darkBlue">
|
|
3
|
-
<button class="p-0@xs color-white@light flex@xs items-center@xs gap-xxs@xs c-btn c-btn--ghost"><div class="c-icon"><svg width="10" height="10"><use xlink:href="#close"></use></svg></div></button>
|
|
4
|
-
<div class="c-icon u-bg-white u-color-primary c-smart-banner__logo"><svg width="35" height="35"><use xlink:href="#logo"></use></svg></div>
|
|
5
|
-
<div class="">
|
|
6
|
-
<div class="mb-xxs-2@xs text-xxs@xs font-weight-bold@xs c-smart-banner__title">
|
|
7
|
-
20 Minutes
|
|
8
|
-
<div class="ml-xxs-2@xs flex@xs items-start@xs gap-xxs-2@xs">
|
|
9
|
-
<div class="c-icon"><svg width="11" height="11"><use xlink:href="#star"></use></svg></div>
|
|
10
|
-
<div class="c-icon"><svg width="11" height="11"><use xlink:href="#star"></use></svg></div>
|
|
11
|
-
<div class="c-icon"><svg width="11" height="11"><use xlink:href="#star"></use></svg></div>
|
|
12
|
-
<div class="c-icon"><svg width="11" height="11"><use xlink:href="#star"></use></svg></div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
<p class="text-xxs-2@xs">Retrouvez l\u2019actualit\xE9 sur notre application</p>
|
|
16
|
-
</div>
|
|
17
|
-
<button id="c-smart-banner__app" class="bg-white@light color-ultramarine@light flex@xs items-center@xs gap-xxs@xs c-btn c-btn--primary c-smart-banner__btn">Installer</button>
|
|
18
|
-
</div>`;const c=(l=e.appBannerContainer)==null?void 0:l.querySelector(".c-btn--ghost"),o=(a=e.appBannerContainer)==null?void 0:a.querySelector(".c-smart-banner__btn"),g=()=>{!e.appBannerContainer||(localStorage.setItem(e.storageName,JSON.stringify({opened:!1,time:new Date().getTime()})),e.appBannerContainer.innerHTML="",c&&h(c,"close-app-banner","action"))},x=()=>{localStorage.setItem(e.storageName,JSON.stringify({opened:!1,time:new Date().getTime()})),e.appBannerContainer&&(e.appBannerContainer.innerHTML="");const u=navigator?.userAgent||navigator?.platform||"unknown";o&&h(o,"open-store-app-banner","action"),window.location.href=/iPhone|iPad|iPod/i.test(u)?"https://apps.apple.com/fr/app/20-minutes-news-en-continu/id308834491":"https://play.google.com/store/apps/details?id=com.backelite.vingtminutes&hl=fr"};c?.addEventListener("click",g),o?.addEventListener("click",x),r()};(()=>{const n=JSON.parse(localStorage.getItem(e.storageName)),i=JSON.parse(localStorage.getItem("20mnBreakingNews"));!(i!=null&&i.open)&&e.appBannerContainer&&(n===null||n.opened||n.time+e.storageDelay<Date.now())&&(localStorage.setItem(e.storageName,JSON.stringify({opened:!0})),t())})()},j=()=>{document.readyState!=="loading"?m():window.addEventListener("DOMContentLoaded",()=>{m()})};function q(e,r){const t=r||{};return t.headers=t.headers||new Headers,t.headers.append("Content-Type","application/json"),fetch(e,t).then(n=>{if(n.ok)return n;throw new Error(`Fetch error: ${n.statusText}`)}).then(n=>n.json())}const b=()=>{const e={breakingNewsContainer:document.getElementById("c-alert-info"),appBannerContainer:document.getElementById("c-app-banner"),storageName:"20mnBreakingNews",storageDelay:18e4},r=t=>{var n;const i=JSON.parse(localStorage.getItem(e.storageName));if(t.content.length===0||!e.breakingNewsContainer)return;((n=e?.appBannerContainer)==null?void 0:n.innerHTML)&&e.appBannerContainer.innerHTML.length>0&&(e.appBannerContainer.innerHTML="");let s="";t.image&&(s=`
|
|
1
|
+
(function(){"use strict";function $(n){let e=n;const t="\xE3\xE0\xE1\xE4\xE2\u1EBD\xE8\xE9\xEB\xEA\xEC\xED\xEF\xEE\xF5\xF2\xF3\xF6\xF4\xF9\xFA\xFC\xFB\xF1\xE7\xB7/_,:;",i="aaaaaeeeeeiiiiooooouuuunc------";for(let a=0;a<t.length;a+=1)e=n.replace(new RegExp(t.charAt(a),"g"),i.charAt(a));return e}const J=n=>{let e=n.toLowerCase().replace(/[\s-]+/g,"_");return e=$(e),e.replace(/[^\w-]+/g,"")},x=(n,e,t,i="",a="",r="")=>{var s,o,c;if(!((c=(o=(s=window.ATInternet)==null?void 0:s.Tracker)==null?void 0:o.instances)!=null&&c.length))return;const l={elem:n,name:J(e),type:t,chapter1:i,chapter2:a,chapter3:r};Object.keys(l).forEach(u=>{l[u]===""&&delete l[u]}),window.ATInternet.Tracker.instances[0].click.send(l)},w=()=>{const n=document.getElementById("templates"),e={appBannerContainer:document.getElementById("c-app-banner"),breakingNewsContainer:document.getElementById("c-alert-info"),storageName:"20mnAppBanner",storageDelay:864e5},t=()=>{var a,r;const s=document.querySelector(".c-social");if(s&&((a=e.appBannerContainer)==null?void 0:a.firstElementChild)){const o=e.appBannerContainer.firstElementChild,c=(r=s.offsetHeight)!=null?r:0;o.style.bottom=`${c}px`}},i=()=>{var a,r,s,o,c;if(!e.appBannerContainer||((a=e?.breakingNewsContainer)==null?void 0:a.innerHTML)&&((s=(r=e?.breakingNewsContainer)==null?void 0:r.innerHTML)==null?void 0:s.length)>0)return;e.appBannerContainer.innerHTML+=n.dataset.templateSmartBanner;const l=(o=e.appBannerContainer)==null?void 0:o.querySelector(".c-btn--ghost"),u=(c=e.appBannerContainer)==null?void 0:c.querySelector(".c-smart-banner__btn"),h=()=>{!e.appBannerContainer||(localStorage.setItem(e.storageName,JSON.stringify({opened:!1,time:new Date().getTime()})),e.appBannerContainer.innerHTML="",l&&x(l,"close-app-banner","action"))},g=()=>{localStorage.setItem(e.storageName,JSON.stringify({opened:!1,time:new Date().getTime()})),e.appBannerContainer&&(e.appBannerContainer.innerHTML="");const v=navigator?.userAgent||navigator?.platform||"unknown";u&&x(u,"open-store-app-banner","action"),window.location.href=/iPhone|iPad|iPod/i.test(v)?"https://apps.apple.com/fr/app/20-minutes-news-en-continu/id308834491":"https://play.google.com/store/apps/details?id=com.backelite.vingtminutes&hl=fr"};l?.addEventListener("click",h),u?.addEventListener("click",g),t()};(()=>{const a=JSON.parse(localStorage.getItem(e.storageName)),r=JSON.parse(localStorage.getItem("20mnBreakingNews"));!(r!=null&&r.open)&&e.appBannerContainer&&(a===null||a.opened||a.time+e.storageDelay<Date.now())&&(localStorage.setItem(e.storageName,JSON.stringify({opened:!0})),i())})()},j=()=>{document.readyState!=="loading"?w():window.addEventListener("DOMContentLoaded",()=>{w()})};function q(n,e){const t=e||{};return t.headers=t.headers||new Headers,t.headers.append("Content-Type","application/json"),fetch(n,t).then(i=>{if(i.ok)return i;throw new Error(`Fetch error: ${i.statusText}`)}).then(i=>i.json())}const f=()=>{const n={breakingNewsContainer:document.getElementById("c-alert-info"),appBannerContainer:document.getElementById("c-app-banner"),storageName:"20mnBreakingNews",storageDelay:18e4},e=t=>{var i;const a=JSON.parse(localStorage.getItem(n.storageName));if(t.content.length===0||!n.breakingNewsContainer)return;((i=n?.appBannerContainer)==null?void 0:i.innerHTML)&&n.appBannerContainer.innerHTML.length>0&&(n.appBannerContainer.innerHTML="");let r="";t.image&&(r=`
|
|
19
2
|
<a href="${t.link}" class="flex@xs c-info-banner__visual">
|
|
20
3
|
<img width="147" height="96" src="${t.image}" srcset="${t.image} 130w" sizes="8.125rem" alt="ALERTE INFO" class="c-img c-info-banner__cover">
|
|
21
|
-
</a>`),
|
|
4
|
+
</a>`),n.breakingNewsContainer.innerHTML+=`
|
|
22
5
|
<div class="p-s@xs bg-red@light color-white@light flex@xs items-center@xs justify-center@xs gap-s@xs c-info-banner c-info-banner--alert">
|
|
23
6
|
<div class="flex@xs items-start@xs gap-s@xs c-info-banner__container">
|
|
24
|
-
${
|
|
7
|
+
${r}
|
|
25
8
|
<div class="flex@xs direction-column@xs justify-between@xs c-info-banner__content" direction="column">
|
|
26
9
|
<p class="bg-white@light color-red@light px-xxs-2@xs mb-xxs-2@xs text-s@xs font-weight-bold@xs c-info-banner__title">ALERTE INFO</p>
|
|
27
10
|
<a class="c-link c-link--default" href="${t.link}" target="_self" rel="">
|
|
@@ -32,4 +15,4 @@
|
|
|
32
15
|
</button>
|
|
33
16
|
</div>
|
|
34
17
|
</div>
|
|
35
|
-
</div>`;const
|
|
18
|
+
</div>`;const s=n.breakingNewsContainer.querySelector(".c-info-banner__close"),o=n.breakingNewsContainer.querySelector(".c-link--default"),c=n.breakingNewsContainer.querySelector(".c-info-banner__visual"),l=()=>{!n.breakingNewsContainer||(a.open=!1,localStorage.setItem(n.storageName,JSON.stringify(a)),n.breakingNewsContainer.innerHTML="")};s?.addEventListener("click",l),o?.addEventListener("click",l),c?.addEventListener("click",l)};(()=>{var t,i,a,r,s;if(!n.breakingNewsContainer)return;const o=JSON.parse(localStorage.getItem(n.storageName));if(o&&o.time+n.storageDelay>new Date().getTime()){o.open&&e(o.data);return}const c=new Headers;(t=window.envVariables)!=null&&t.apiAuthKey&&c.append("auth-key",window.envVariables.apiAuthKey);const l=(a=(i=n?.breakingNewsContainer)==null?void 0:i.closest("body"))==null?void 0:a.getAttribute("data-api-host"),u=(s=(r=n?.breakingNewsContainer)==null?void 0:r.closest("body"))==null?void 0:s.getAttribute("data-img-host");if(!l||!u)return;const h=`${l}/?id=getBreakingNews&variables=%7B%22brandId%22%3A%22QnJhbmQ6MjBtaW51dGVz%22%7D`;q(h,{headers:c}).then(g=>{var v,b,k,N,C,E,y,B,_,S,L,T,I,A,D,O,F,H;const p=(E=(C=(N=(k=(b=(v=g?.data)==null?void 0:v.brand)==null?void 0:b.node)==null?void 0:k.home)==null?void 0:N.node)==null?void 0:C.homeBreakingNews)==null?void 0:E.node,R=(B=(y=p?.content)==null?void 0:y.editorial_model)==null?void 0:B.toLowerCase(),d=(S=(_=p?.content)==null?void 0:_[R])==null?void 0:S.node;if(!(d!=null&&d.title)||!(d!=null&&d.url_current))throw new Error("No data found...");const m={content:d?.title,link:d?.url_current};if(p?.with_photo&&((A=(I=(T=(L=d?.medias)==null?void 0:L[0])==null?void 0:T.photo)==null?void 0:I.node)==null?void 0:A.id)){const V=atob(d.medias[0].photo.node.id).replace("Photo:","");m.image=`${u}/${V}/147x96_${(H=(F=(O=(D=d?.medias)==null?void 0:D.photo)==null?void 0:O.node)==null?void 0:F.slug)!=null?H:"media"}`}const M=o?.data===m?o.open:m.content.length>0;localStorage.setItem(n.storageName,JSON.stringify({data:m,time:new Date().getTime(),open:M})),M&&e(m)}).catch(g=>{console.error("20mn> Error while loading the breaking news:",g)})})()},P=()=>{document.readyState!=="loading"?f():window.addEventListener("DOMContentLoaded",()=>{f()})};j(),P()})();
|
|
@@ -40,7 +40,9 @@ export declare const enum ComponentNameHoroscope {
|
|
|
40
40
|
}
|
|
41
41
|
export declare const enum ComponentNameTag {
|
|
42
42
|
TAG_BREADCRUMB = "tag/breadcrumb",
|
|
43
|
-
TAG_HEADER_PAGE = "tag/header-page"
|
|
43
|
+
TAG_HEADER_PAGE = "tag/header-page",
|
|
44
|
+
TAG_TOP_ARTICLE = "tag/top-article",
|
|
45
|
+
TAG_ARTICLES_LIST = "tag/articles-list"
|
|
44
46
|
}
|
|
45
47
|
export declare const enum ComponentNameSearch {
|
|
46
48
|
SEARCH_BREADCRUMB = "search/breadcrumb",
|
package/dist/types/Window.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { AwsRum } from 'aws-rum-web';
|
|
|
2
2
|
import type { LayoutType } from '@20minutes/hela';
|
|
3
3
|
import type { AwsRumVariablesType } from './AwsRumVariablesType';
|
|
4
4
|
import type { EnvVariablesType } from './EnvVariablesType';
|
|
5
|
-
import type { ATInternetType, CmpType, DataLayerType, HubvisorType, SlotType, TargetingType, VariablesCmpType, VariablesDataLayerType, VariablesSmartPlayerDigitekaType } from './ThirdParties';
|
|
5
|
+
import type { ATInternetType, CmpType, DataLayerType, HubvisorType, SlotType, TargetingType, VariablesCmpType, VariablesDataLayerType, VariablesSmartPlayerDigitekaType, VariablesdatalayerInfoType } from './ThirdParties';
|
|
6
6
|
declare global {
|
|
7
|
-
interface Window extends VariablesDataLayerType, VariablesCmpType, VariablesSmartPlayerDigitekaType {
|
|
7
|
+
interface Window extends VariablesDataLayerType, VariablesdatalayerInfoType, VariablesCmpType, VariablesSmartPlayerDigitekaType {
|
|
8
8
|
layout: LayoutType;
|
|
9
9
|
datalayer: Partial<DataLayerType>;
|
|
10
10
|
gtmDatalayer: Record<number, unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@20minutes/tyr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.65",
|
|
4
4
|
"repository": "git@github.com:20minutes/tyr.git",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "20 Minutes",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"node": ">=16"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@20minutes/hela": "^0.1.
|
|
46
|
+
"@20minutes/hela": "^0.1.51",
|
|
47
47
|
"aws-rum-web": "^1.12.0",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
49
|
"react-dom": "^18.2.0"
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@types/jest": "^29.2.6",
|
|
63
63
|
"@types/react": "^18.0.27",
|
|
64
64
|
"@types/react-dom": "^18.0.10",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
66
|
-
"@typescript-eslint/parser": "^5.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
|
66
|
+
"@typescript-eslint/parser": "^5.49.0",
|
|
67
67
|
"@vitejs/plugin-react": "^3.0.1",
|
|
68
68
|
"babel-loader": "^9.1.2",
|
|
69
69
|
"eslint": "^8.32.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"eslint-plugin-react": "^7.32.1",
|
|
78
78
|
"eslint-plugin-simple-import-sort": "^9.0.0",
|
|
79
79
|
"husky": "^8.0.3",
|
|
80
|
-
"jest": "^29.
|
|
80
|
+
"jest": "^29.4.0",
|
|
81
81
|
"lint-staged": "^13.1.0",
|
|
82
82
|
"prettier": "^2.8.3",
|
|
83
83
|
"purgecss": "^5.0.0",
|