@20minutes/tyr 0.1.76 → 0.1.78
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/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/global.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/helpers/storage.d.ts +1 -0
- package/dist/index.es.js +46305 -46645
- package/dist/index.umd.js +239 -256
- package/dist/js/atinternet.min.js +1 -1
- package/dist/js/cmp.min.js +1 -1
- package/dist/js/custom-load-ads.js +0 -2
- package/dist/js/datalayer.min.js +1 -1
- package/dist/js/main.min.js +78 -1
- package/dist/js/react-and-react-dom.min.js +451 -0
- package/dist/managers/PageManagerHelper.d.ts +1 -1
- package/dist/templates/HtmlTemplate/HtmlTemplate.d.ts +1 -2
- package/dist/types/ComponentConfig.d.ts +2 -2
- package/package.json +8 -3
- package/dist/assets/scripts/concern/appBanner.d.ts +0 -1
- package/dist/assets/scripts/concern/breakingNews.d.ts +0 -1
- package/dist/assets/scripts/concern/headerMini.d.ts +0 -1
- package/dist/assets/scripts/helpers/ajax.d.ts +0 -3
- package/dist/assets/scripts/main.d.ts +0 -1
- package/dist/assets/scripts/thirdParties/ads/adSlotsKeyValues.d.ts +0 -1
- package/dist/assets/scripts/thirdParties/ads/dfpAdSlots.d.ts +0 -4
- package/dist/assets/scripts/thirdParties/ads/dfpCall.d.ts +0 -2
- package/dist/assets/scripts/thirdParties/ads/dfpConfig.d.ts +0 -1
- package/dist/assets/scripts/thirdParties/ads/dfpDatalayerAdapter.d.ts +0 -2
- package/dist/assets/scripts/thirdParties/ads/fingerPrint.d.ts +0 -2
- package/dist/assets/scripts/thirdParties/ads/index.d.ts +0 -7
- package/dist/assets/scripts/thirdParties/ads/placeholderHandler.d.ts +0 -1
- package/dist/assets/scripts/thirdParties/atinternet/eventTracking.d.ts +0 -1
- package/dist/assets/scripts/thirdParties/atinternet/index.d.ts +0 -2
- package/dist/assets/scripts/thirdParties/atinternet/manager.d.ts +0 -10
- package/dist/assets/scripts/thirdParties/atinternet/pageTracking.d.ts +0 -3
- package/dist/assets/scripts/thirdParties/gcse/index.d.ts +0 -1
- package/dist/assets/scripts/thirdParties/lazy.d.ts +0 -4
- package/dist/assets/scripts/thirdParties/outbrain/index.d.ts +0 -1
- package/dist/helpers/url.d.ts +0 -3
- package/dist/js/concern.min.js +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayoutType } from '@20minutes/hela';
|
|
2
|
-
import { Prefix } from '
|
|
2
|
+
import { Prefix } from '../types/helpers';
|
|
3
3
|
export declare abstract class PageManagerHelper<PageProps = Record<string, unknown>, SelectedProps extends keyof PageProps = keyof PageProps, PageFeatures extends string = string, PageContent = string> {
|
|
4
4
|
protected data: Pick<PageProps, SelectedProps>;
|
|
5
5
|
protected layout: LayoutType;
|
|
@@ -26,11 +26,10 @@ export interface HtmlTemplateProps {
|
|
|
26
26
|
datalayerScript?: string;
|
|
27
27
|
atinternetScript?: string;
|
|
28
28
|
cmpScript?: string;
|
|
29
|
-
|
|
29
|
+
reactAndReactDomScript?: string;
|
|
30
30
|
mainTyrScript?: string;
|
|
31
31
|
memberScript?: string;
|
|
32
32
|
adblockScript?: string;
|
|
33
|
-
concernScript?: string;
|
|
34
33
|
awsRum?: {
|
|
35
34
|
variables: AwsRumVariablesType;
|
|
36
35
|
inlineScript: string;
|
|
@@ -7,12 +7,12 @@ export declare const enum ComponentNameCommon {
|
|
|
7
7
|
COMMON_NEWSLETTER = "common/newsletter",
|
|
8
8
|
COMMON_LIVE_BLOCK = "common/live-block",
|
|
9
9
|
COMMON_OVERVIEW_BAR = "common/overview-bar",
|
|
10
|
-
COMMON_MOST_READ_ARTICLES = "common/most-read-articles"
|
|
10
|
+
COMMON_MOST_READ_ARTICLES = "common/most-read-articles",
|
|
11
|
+
COMMON_PARTNER_CARDS = "common/partner-cards"
|
|
11
12
|
}
|
|
12
13
|
export declare const enum ComponentNameRubric {
|
|
13
14
|
RUBRIC_RUBRIC_CAROUSELS = "rubric/rubric-carousels",
|
|
14
15
|
RUBRIC_MOST_READ_ARTICLES = "rubric/most-read-articles",
|
|
15
|
-
RUBRIC_PARTNER_CARDS = "rubric/partner-cards",
|
|
16
16
|
ARTICLE_SCROLL_PROGRESS_BAR = "rubric/scroll-progress-bar"
|
|
17
17
|
}
|
|
18
18
|
export declare const enum ComponentNameArticle {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@20minutes/tyr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
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.70",
|
|
47
47
|
"aws-rum-web": "^1.12.0",
|
|
48
48
|
"html-entities": "^2.3.3",
|
|
49
49
|
"node-html-parser": "^6.1.5",
|
|
@@ -53,6 +53,9 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@20minutes/eslint-config": "^1.2.4",
|
|
55
55
|
"@babel/core": "^7.21.0",
|
|
56
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
|
57
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
58
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
56
59
|
"@storybook/addon-actions": "^6.5.14",
|
|
57
60
|
"@storybook/addon-essentials": "^6.5.16",
|
|
58
61
|
"@storybook/addon-interactions": "^6.5.16",
|
|
@@ -83,9 +86,11 @@
|
|
|
83
86
|
"lint-staged": "^13.1.2",
|
|
84
87
|
"prettier": "^2.8.4",
|
|
85
88
|
"purgecss": "^5.0.0",
|
|
86
|
-
"rollup": "^3.
|
|
89
|
+
"rollup": "^3.18.0",
|
|
87
90
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
91
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
88
92
|
"rollup-plugin-esbuild": "^5.0.0",
|
|
93
|
+
"rollup-plugin-typescript-paths": "^1.4.0",
|
|
89
94
|
"rollup-plugin-visualizer": "^5.9.0",
|
|
90
95
|
"ts-jest": "^29.0.5",
|
|
91
96
|
"ts-node": "^10.9.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const registerAppBanner: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const registerBreakingNews: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const registerHeaderMini: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const main: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const setAdSlotsKeyValues: () => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TargetingType } from '../../../../types/ThirdParties';
|
|
2
|
-
export declare const adDefinedEvent = "adDefined";
|
|
3
|
-
export declare const initDfpSlot: (slot: HTMLDivElement, targeting?: Partial<TargetingType>) => string | undefined;
|
|
4
|
-
export declare const setDfpSlots: (targeting?: Partial<TargetingType>) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const setDfpConfig: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const placeholderHandler: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sendClickTracking: (element: HTMLElement, name: string, type: string, chapter1?: string, chapter2?: string, chapter3?: string) => void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type SocialProps = {
|
|
2
|
-
utm_source: string;
|
|
3
|
-
utm_campaign: string;
|
|
4
|
-
utm_medium: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const manageSocialProps: () => Partial<SocialProps>;
|
|
7
|
-
export declare const manageDefaultCustomProps: () => {
|
|
8
|
-
[x: string]: string | number | boolean;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const initSearchInput: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const initOutbrain: () => void;
|
package/dist/helpers/url.d.ts
DELETED
package/dist/js/concern.min.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";function q(e){let n=e;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/_,:;",o="aaaaaeeeeeiiiiooooouuuunc------";for(let a=0;a<t.length;a+=1)n=e.replace(new RegExp(t.charAt(a),"g"),o.charAt(a));return n}const j=e=>{let n=e.toLowerCase().replace(/[\s-]+/g,"_");return n=q(n),n.replace(/[^\w-]+/g,"")},w=(e,n,t,o="",a="",i="")=>{var s,r,c;if(!((c=(r=(s=window.ATInternet)==null?void 0:s.Tracker)==null?void 0:r.instances)!=null&&c.length))return;const l={elem:e,name:j(n),type:t,chapter1:o,chapter2:a,chapter3:i};Object.keys(l).forEach(u=>{l[u]===""&&delete l[u]}),window.ATInternet.Tracker.instances[0].click.send(l)},f=()=>{const e=document.getElementById("templates"),n={appBannerContainer:document.getElementById("c-app-banner"),breakingNewsContainer:document.getElementById("c-alert-info"),storageName:"20mnAppBanner",storageDelay:864e5},t=()=>{var a,i;const s=document.querySelector(".c-social");if(s&&(a=n.appBannerContainer)!=null&&a.firstElementChild){const r=n.appBannerContainer.firstElementChild,c=(i=s.offsetHeight)!=null?i:0;r.style.bottom=`${c}px`}},o=()=>{var a,i,s,r,c;if(!n.appBannerContainer||(a=n?.breakingNewsContainer)!=null&&a.innerHTML&&((s=(i=n?.breakingNewsContainer)==null?void 0:i.innerHTML)==null?void 0:s.length)>0)return;n.appBannerContainer.innerHTML+=e.dataset.templateSmartBanner;const l=(r=n.appBannerContainer)==null?void 0:r.querySelector(".c-btn--ghost"),u=(c=n.appBannerContainer)==null?void 0:c.querySelector(".c-smart-banner__btn"),h=()=>{n.appBannerContainer&&(localStorage.setItem(n.storageName,JSON.stringify({opened:!1,time:new Date().getTime()})),n.appBannerContainer.innerHTML="",l&&w(l,"close-app-banner","action"))},g=()=>{localStorage.setItem(n.storageName,JSON.stringify({opened:!1,time:new Date().getTime()})),n.appBannerContainer&&(n.appBannerContainer.innerHTML="");const v=navigator?.userAgent||navigator?.platform||"unknown";u&&w(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(n.storageName)),i=JSON.parse(localStorage.getItem("20mnBreakingNews"));!(i!=null&&i.open)&&n.appBannerContainer&&(a===null||a.opened||a.time+n.storageDelay<Date.now())&&(localStorage.setItem(n.storageName,JSON.stringify({opened:!0})),o())})()},P=()=>{document.readyState!=="loading"?f():window.addEventListener("DOMContentLoaded",()=>{f()})};function R(e,n){const t=n||{};return t.headers=t.headers||new Headers,t.headers.append("Content-Type","application/json"),fetch(e,t).then(o=>{if(o.ok)return o;throw new Error(`Fetch error: ${o.statusText}`)}).then(o=>o.json())}const x=()=>{const e={breakingNewsContainer:document.getElementById("c-alert-info"),appBannerContainer:document.getElementById("c-app-banner"),storageName:"20mnBreakingNews",storageDelay:18e4},n=t=>{var o;const a=JSON.parse(localStorage.getItem(e.storageName));if(t.content.length===0||!e.breakingNewsContainer)return;(o=e?.appBannerContainer)!=null&&o.innerHTML&&e.appBannerContainer.innerHTML.length>0&&(e.appBannerContainer.innerHTML="");let i="";t.image&&(i=`
|
|
2
|
-
<a href="${t.link}" class="flex@xs c-info-banner__visual">
|
|
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">
|
|
4
|
-
</a>`),e.breakingNewsContainer.innerHTML+=`
|
|
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">
|
|
6
|
-
<div class="flex@xs items-start@xs gap-s@xs c-info-banner__container">
|
|
7
|
-
${i}
|
|
8
|
-
<div class="flex@xs direction-column@xs justify-between@xs c-info-banner__content" direction="column">
|
|
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>
|
|
10
|
-
<a class="c-link c-link--default" href="${t.link}" target="_self" rel="">
|
|
11
|
-
<p class="color-white@light text-s@xs">${t.content}</p>
|
|
12
|
-
</a>
|
|
13
|
-
<button id="c-info-banner__cross" class="flex@xs items-center@xs gap-xxs@xs c-btn c-btn--ghost c-info-banner__close">
|
|
14
|
-
<div class="color-white@light c-icon"><svg width="12" height="12"><use xlink:href="#close"></use></svg></div>
|
|
15
|
-
</button>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>`;const s=e.breakingNewsContainer.querySelector(".c-info-banner__close"),r=e.breakingNewsContainer.querySelector(".c-link--default"),c=e.breakingNewsContainer.querySelector(".c-info-banner__visual"),l=()=>{e.breakingNewsContainer&&(a.open=!1,localStorage.setItem(e.storageName,JSON.stringify(a)),e.breakingNewsContainer.innerHTML="")};s?.addEventListener("click",l),r?.addEventListener("click",l),c?.addEventListener("click",l)};(()=>{var t,o,a,i,s;if(!e.breakingNewsContainer)return;const r=JSON.parse(localStorage.getItem(e.storageName));if(r&&r.time+e.storageDelay>new Date().getTime()){r.open&&n(r.data);return}const c=new Headers;(t=window.envVariables)!=null&&t.apiAuthKey&&c.append("auth-key",window.envVariables.apiAuthKey);const l=(a=(o=e?.breakingNewsContainer)==null?void 0:o.closest("body"))==null?void 0:a.getAttribute("data-api-host"),u=(s=(i=e?.breakingNewsContainer)==null?void 0:i.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`;R(h,{headers:c}).then(g=>{var v,E,k,C,N,B,S,_,L,T,I,A,D,H,M,O,F,$;const p=(B=(N=(C=(k=(E=(v=g?.data)==null?void 0:v.brand)==null?void 0:E.node)==null?void 0:k.home)==null?void 0:C.node)==null?void 0:N.homeBreakingNews)==null?void 0:B.node,z=(_=(S=p?.content)==null?void 0:S.editorial_model)==null?void 0:_.toLowerCase(),d=(T=(L=p?.content)==null?void 0:L[z])==null?void 0:T.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!=null&&p.with_photo&&(H=(D=(A=(I=d?.medias)==null?void 0:I[0])==null?void 0:A.photo)==null?void 0:D.node)!=null&&H.id){const K=atob(d.medias[0].photo.node.id).replace("Photo:","");m.image=`${u}/${K}/147x96_${($=(F=(O=(M=d?.medias)==null?void 0:M.photo)==null?void 0:O.node)==null?void 0:F.slug)!=null?$:"media"}`}const J=r?.data===m?r.open:m.content.length>0;localStorage.setItem(e.storageName,JSON.stringify({data:m,time:new Date().getTime(),open:J})),J&&n(m)}).catch(g=>{console.error("20mn> Error while loading the breaking news:",g)})})()},V=()=>{document.readyState!=="loading"?x():window.addEventListener("DOMContentLoaded",()=>{x()})},b=e=>{const n=document.documentElement.scrollTop,t=document.querySelector(".c-header"),o="transform .4s ease";t&&(n>t.offsetHeight?(e.style.transform="translateY(0)",e.style.transition=o):(e.style.transform="translateY(-100%)",e.style.transition=o)),window.removeEventListener("scroll",b.bind(!1,e))},y=()=>{const e=document.querySelector(".c-header-mini");e&&(e.style.transform="translateY(-100%)",window.addEventListener("scroll",b.bind(!1,e)))},Y=()=>{document.readyState!=="loading"?y():window.addEventListener("DOMContentLoaded",()=>{y()})};P(),V(),Y()})();
|