@20minutes/tyr 0.1.75 → 0.1.76

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.
@@ -0,0 +1,14 @@
1
+ import { LayoutType } from '@20minutes/hela';
2
+ import { Prefix } from '@/types/helpers';
3
+ export declare abstract class PageManagerHelper<PageProps = Record<string, unknown>, SelectedProps extends keyof PageProps = keyof PageProps, PageFeatures extends string = string, PageContent = string> {
4
+ protected data: Pick<PageProps, SelectedProps>;
5
+ protected layout: LayoutType;
6
+ protected templateActivators: Record<Prefix<'enable', PageFeatures>, boolean>;
7
+ constructor(data: Pick<PageProps, SelectedProps>, layout: LayoutType, templateActivators: Record<Prefix<'enable', PageFeatures>, boolean>);
8
+ abstract transformContent(): PageContent;
9
+ abstract resolveTemplating(): Record<Prefix<'enable', PageFeatures>, boolean>;
10
+ resolve(): {
11
+ content: PageContent;
12
+ features: Record<`enable${PageFeatures}`, boolean>;
13
+ };
14
+ }
@@ -0,0 +1,21 @@
1
+ import { LayoutType } from '@20minutes/hela';
2
+ import React from 'react';
3
+ import { ArticlePageProps } from '../..';
4
+ import { PageManagerHelper } from '../PageManagerHelper';
5
+ type ArticlePageTemplatingActivators = 'HeaderAd';
6
+ type SelectedProps = 'articleContent' | 'articleCover';
7
+ export type ArticlePageFilteredProps = Pick<ArticlePageProps, SelectedProps>;
8
+ export type ArticleContent = {
9
+ articleContent: React.ReactNode;
10
+ articleCover: React.ReactNode;
11
+ };
12
+ export declare class ArticlePageManager extends PageManagerHelper<ArticlePageProps, SelectedProps, ArticlePageTemplatingActivators, ArticleContent> {
13
+ constructor(data: ArticlePageFilteredProps, layout: LayoutType);
14
+ transformContent(): ArticleContent;
15
+ resolveTemplating(): {
16
+ enableHeaderAd: boolean;
17
+ };
18
+ handleDesktopInArticleAds(): string;
19
+ handleMobileInArticleAds(): string;
20
+ }
21
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const insertInread: (content: React.ReactElement, adUnitCompletePath: string) => string;
@@ -0,0 +1 @@
1
+ export type Prefix<P extends string, S extends string> = `${P}${S}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@20minutes/tyr",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
4
4
  "repository": "git@github.com:20minutes/tyr.git",
5
5
  "license": "MIT",
6
6
  "author": "20 Minutes",
@@ -45,6 +45,7 @@
45
45
  "dependencies": {
46
46
  "@20minutes/hela": "^0.1.68",
47
47
  "aws-rum-web": "^1.12.0",
48
+ "html-entities": "^2.3.3",
48
49
  "node-html-parser": "^6.1.5",
49
50
  "react": "^18.2.0",
50
51
  "react-dom": "^18.2.0"