@twreporter/core 1.24.2 → 1.24.3

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.
Files changed (34) hide show
  1. package/lib/constants/category-set.d.ts +105 -0
  2. package/lib/constants/color.d.ts +80 -0
  3. package/lib/constants/donation-link-anchor.d.ts +7 -0
  4. package/lib/constants/email-subscription.d.ts +6 -0
  5. package/lib/constants/entity-path.d.ts +14 -0
  6. package/lib/constants/external-links.d.ts +14 -0
  7. package/lib/constants/feature-flag.d.ts +0 -0
  8. package/lib/constants/font.d.ts +33 -0
  9. package/lib/constants/fundraising.d.ts +2 -0
  10. package/lib/constants/html-attributes.d.ts +4 -0
  11. package/lib/constants/infogram.d.ts +1 -0
  12. package/lib/constants/link-type.d.ts +3 -0
  13. package/lib/constants/member-role.d.ts +13 -0
  14. package/lib/constants/predefined-css.d.ts +1 -0
  15. package/lib/constants/prop-types.d.ts +9 -0
  16. package/lib/constants/read-preference.d.ts +20 -0
  17. package/lib/constants/reading-time-unit.d.ts +15 -0
  18. package/lib/constants/release-branch.d.ts +25 -0
  19. package/lib/constants/request-origins.d.ts +21 -0
  20. package/lib/constants/site-meta.d.ts +1 -0
  21. package/lib/constants/size.d.ts +5 -0
  22. package/lib/constants/storage.d.ts +5 -0
  23. package/lib/constants/theme.d.ts +16 -0
  24. package/lib/constants/z-index.d.ts +16 -0
  25. package/lib/utils/css.d.ts +9 -0
  26. package/lib/utils/date.d.ts +8 -0
  27. package/lib/utils/global-env.d.ts +4 -0
  28. package/lib/utils/media-query.d.ts +42 -0
  29. package/lib/utils/sign-in-href.d.ts +1 -0
  30. package/lib/utils/sign-out-href.d.ts +1 -0
  31. package/lib/utils/smooth-scroll.d.ts +1 -0
  32. package/lib/utils/storage-url-processor.d.ts +9 -0
  33. package/lib/utils/truncate.d.ts +8 -0
  34. package/package.json +8 -4
@@ -0,0 +1,105 @@
1
+ export const CATEGORY_PATH: Readonly<{
2
+ world: string;
3
+ humanrights: string;
4
+ politicsAndSociety: string;
5
+ health: string;
6
+ environment: string;
7
+ econ: string;
8
+ culture: string;
9
+ education: string;
10
+ podcast: string;
11
+ opinion: string;
12
+ photography: string;
13
+ foundation: string;
14
+ }>;
15
+ export const CATEGORY_ORDER: string[];
16
+ export const CATEGORY_LABEL: {
17
+ [x: string]: string;
18
+ };
19
+ export const CATEGORY_ID: {
20
+ [x: string]: string;
21
+ };
22
+ export function GET_CATEGORY_PATH_FROM_ID(id: any): any;
23
+ export const SUBCATEGORY_PATH: Readonly<{
24
+ all: string;
25
+ hk: string;
26
+ china: string;
27
+ us: string;
28
+ jpAndKr: string;
29
+ indoPacific: string;
30
+ europe: string;
31
+ others: string;
32
+ gender: string;
33
+ labor: string;
34
+ immigrant: string;
35
+ housingJustice: string;
36
+ transformationalJustice: string;
37
+ socialAdministration: string;
38
+ justice: string;
39
+ digital: string;
40
+ election: string;
41
+ politicalPartyAndLocalFaction: string;
42
+ policy: string;
43
+ transportation: string;
44
+ foodSafety: string;
45
+ informationWarfare: string;
46
+ socialwatch: string;
47
+ pandemic: string;
48
+ healthPolicy: string;
49
+ biotech: string;
50
+ patientAutonomy: string;
51
+ psychology: string;
52
+ longTermCare: string;
53
+ publicHealth: string;
54
+ cicularEconomy: string;
55
+ ocean: string;
56
+ mountainAndForest: string;
57
+ animal: string;
58
+ climateChange: string;
59
+ pollution: string;
60
+ naturalDisaster: string;
61
+ economy: string;
62
+ energyEcon: string;
63
+ agriculture: string;
64
+ technology: string;
65
+ peAndSports: string;
66
+ movie: string;
67
+ publishing: string;
68
+ music: string;
69
+ dramaAndTheatre: string;
70
+ art: string;
71
+ scientificResearch: string;
72
+ higherEducation: string;
73
+ teens: string;
74
+ parenting: string;
75
+ lowBirthRate: string;
76
+ theRealStory: string;
77
+ onTheGround: string;
78
+ bookReview: string;
79
+ letter: string;
80
+ milestone: string;
81
+ award: string;
82
+ cooperation: string;
83
+ }>;
84
+ export const SUBCATEGORY_LABEL: {
85
+ [x: string]: string;
86
+ };
87
+ export const SUBCATEGORY_ID: {
88
+ [x: string]: string;
89
+ };
90
+ export function GET_SUBCATEGORY_PATH_FROM_ID(id: any): any;
91
+ export const CATEGORY_SET: {
92
+ [x: string]: string[];
93
+ };
94
+ declare namespace _default {
95
+ export { CATEGORY_PATH };
96
+ export { CATEGORY_ORDER };
97
+ export { CATEGORY_LABEL };
98
+ export { CATEGORY_ID };
99
+ export { GET_CATEGORY_PATH_FROM_ID };
100
+ export { GET_SUBCATEGORY_PATH_FROM_ID };
101
+ export { SUBCATEGORY_LABEL };
102
+ export { SUBCATEGORY_ID };
103
+ export { CATEGORY_SET };
104
+ }
105
+ export default _default;
@@ -0,0 +1,80 @@
1
+ export const colorBrand: Readonly<{
2
+ faded: "#f4c6c6";
3
+ pastel: "#f76977";
4
+ main: "#f80b28";
5
+ heavy: "#c40d23";
6
+ dark: "#9b051e";
7
+ }>;
8
+ export const colorPhoto: Readonly<{
9
+ faded: "#abdef4";
10
+ pastel: "#6d9be0";
11
+ main: "#2f58cc";
12
+ heavy: "#143071";
13
+ dark: "#052142";
14
+ }>;
15
+ export const colorPodcast: Readonly<{
16
+ faded: "#c4f2dc";
17
+ pastel: "#99ecc9";
18
+ main: "#6ee5b5";
19
+ heavy: "#3c927a";
20
+ dark: "#0e3532";
21
+ }>;
22
+ export const colorSupportive: Readonly<{
23
+ faded: "#f0d5be";
24
+ pastel: "#e3be98";
25
+ main: "#c09662";
26
+ heavy: "#9f7544";
27
+ dark: "#7a522c";
28
+ }>;
29
+ export const colorGrayscale: Readonly<{
30
+ white: "#ffffff";
31
+ gray100: "#f1f1f1";
32
+ gray200: "#e2e2e2";
33
+ gray300: "#cdcdcd";
34
+ gray400: "#bbbbbb";
35
+ gray500: "#9c9c9c";
36
+ gray600: "#808080";
37
+ gray700: "#666666";
38
+ gray800: "#404040";
39
+ gray900: "#262626";
40
+ black: "#000000";
41
+ }>;
42
+ export const colorOpacity: Readonly<{
43
+ white_0: "rgba(255, 255, 255, 0.0)";
44
+ 'white_0.2': "rgba(255, 255, 255, 0.2)";
45
+ 'white_0.5': "rgba(255, 255, 255, 0.5)";
46
+ 'white_0.8': "rgba(255, 255, 255, 0.8)";
47
+ 'white_0.9': "rgba(255, 255, 255, 0.9)";
48
+ 'gray100_0.8': "rgba(241, 241, 241, 0.8)";
49
+ 'black_0.1': "rgba(0, 0, 0, 0.1)";
50
+ 'black_0.2': "rgba(0, 0, 0, 0.2)";
51
+ 'black_0.5': "rgba(0, 0, 0, 0.5)";
52
+ 'black_0.7': "rgba(0, 0, 0, 0.7)";
53
+ 'black_0.8': "rgba(0, 0, 0, 0.8)";
54
+ 'black_0.05': "rgba(0, 0, 0, 0.05)";
55
+ }>;
56
+ export const COLOR_SEMANTIC: Readonly<{
57
+ danger: "#c7000a";
58
+ success: "#4db41d";
59
+ info: "#1a7aeb";
60
+ warning: "#fcaa0c";
61
+ }>;
62
+ export const COLOR_PINK_ARTICLE: Readonly<{
63
+ lightBlue: "#2440fb";
64
+ blue: "#355ed3";
65
+ darkBlue: "#08192d";
66
+ lightPink: "#fadaf5";
67
+ pink: "#fbafef";
68
+ darkPink: "#ef7ede";
69
+ }>;
70
+ declare namespace _default {
71
+ export { colorBrand };
72
+ export { colorPhoto };
73
+ export { colorPodcast };
74
+ export { colorSupportive };
75
+ export { colorGrayscale };
76
+ export { colorOpacity };
77
+ export { COLOR_SEMANTIC };
78
+ export { COLOR_PINK_ARTICLE };
79
+ }
80
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export namespace DONATION_LINK_ANCHOR {
2
+ let value: string;
3
+ let impact: string;
4
+ let faq: string;
5
+ let contribute: string;
6
+ let plan: string;
7
+ }
@@ -0,0 +1,6 @@
1
+ export namespace EMAIL_SUBSCRIPTION_KEY {
2
+ let featured: string;
3
+ let behindTheScenes: string;
4
+ let operationalJournal: string;
5
+ let eventUpdates: string;
6
+ }
@@ -0,0 +1,14 @@
1
+ declare namespace _default {
2
+ let article: string;
3
+ let interactiveArticle: string;
4
+ let categories: string;
5
+ let tag: string;
6
+ let topic: string;
7
+ let topics: string;
8
+ let author: string;
9
+ let authors: string;
10
+ let aboutus: string;
11
+ let account: string;
12
+ let myReading: string;
13
+ }
14
+ export default _default;
@@ -0,0 +1,14 @@
1
+ declare namespace _default {
2
+ let donation: string;
3
+ let github: string;
4
+ let line: string;
5
+ let facebook: string;
6
+ let rss: string;
7
+ let instagram: string;
8
+ let ccLicense: string;
9
+ let newsLetter: string;
10
+ let medium: string;
11
+ let twitter: string;
12
+ let IJMBrochureDownloadLink: string;
13
+ }
14
+ export default _default;
File without changes
@@ -0,0 +1,33 @@
1
+ declare namespace _default {
2
+ export { fonts };
3
+ export { fontWeight };
4
+ export { fontFamily };
5
+ }
6
+ export default _default;
7
+ export namespace fonts {
8
+ export { merriweather };
9
+ export { sourceHanSerifTC };
10
+ export { serif };
11
+ export { robotoSlab };
12
+ export { notoSansTC };
13
+ export { sansSerif };
14
+ export { tauhuOo };
15
+ }
16
+ export namespace fontWeight {
17
+ let extraLight: string;
18
+ let normal: string;
19
+ let bold: string;
20
+ }
21
+ export namespace fontFamily {
22
+ export let title: string;
23
+ let _default: string;
24
+ export { _default as default };
25
+ export let defaultFallback: string;
26
+ }
27
+ declare const merriweather: "merriweather";
28
+ declare const sourceHanSerifTC: "source-han-serif-tc";
29
+ declare const serif: "serif";
30
+ declare const robotoSlab: "Roboto Slab";
31
+ declare const notoSansTC: "Noto Sans TC";
32
+ declare const sansSerif: "sans-serif";
33
+ declare const tauhuOo: "Tauhu Oo";
@@ -0,0 +1,2 @@
1
+ export default fundraisingId;
2
+ export const fundraisingId: "\u516C\u76CA\u52F8\u52DF\u8A31\u53EF\u5B57\u865F\uFF5C\u885B\u90E8\u6551\u5B57\u7B2C 1131363879 \u865F";
@@ -0,0 +1,4 @@
1
+ export namespace target {
2
+ let self: string;
3
+ let blank: string;
4
+ }
@@ -0,0 +1 @@
1
+ export const INFOGRAM_ID: "630f029461ca4e07004ef530";
@@ -0,0 +1,3 @@
1
+ export const external: "external";
2
+ export const internal: "internal";
3
+ export const redirect: "redirect";
@@ -0,0 +1,13 @@
1
+ export namespace MEMBER_ROLE {
2
+ let explorer: string;
3
+ let action_taker: string;
4
+ let trailblazer: string;
5
+ let action_taker_ntch: string;
6
+ let trailblazer_ntch: string;
7
+ let trailblazer_ntch_3: string;
8
+ let trailblazer_ntch_12: string;
9
+ }
10
+ declare namespace _default {
11
+ export { MEMBER_ROLE };
12
+ }
13
+ export default _default;
@@ -0,0 +1 @@
1
+ export const absoluteCentering: "\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n";
@@ -0,0 +1,9 @@
1
+ declare namespace _default {
2
+ export { articleMetaForBookmark };
3
+ export { bookmark };
4
+ export { releaseBranch };
5
+ }
6
+ export default _default;
7
+ declare const articleMetaForBookmark: any;
8
+ declare const bookmark: any;
9
+ declare const releaseBranch: any;
@@ -0,0 +1,20 @@
1
+ export namespace READ_PREFERENCE {
2
+ let international: string;
3
+ let crossStraits: string;
4
+ let humanRight: string;
5
+ let society: string;
6
+ let environment: string;
7
+ let education: string;
8
+ let politics: string;
9
+ let economy: string;
10
+ let culture: string;
11
+ let art: string;
12
+ let life: string;
13
+ let health: string;
14
+ let sport: string;
15
+ let all: string;
16
+ }
17
+ export const READ_PREFERENCE_ZH_TW: {
18
+ [x: string]: string;
19
+ };
20
+ export const READ_PREFERENCE_ORDER: string[];
@@ -0,0 +1,15 @@
1
+ export const READING_TIME_UNIT: Readonly<{
2
+ minute: "minute";
3
+ hour: "hour";
4
+ day: "day";
5
+ }>;
6
+ export const READING_TIME_UNIT_CARD_TEXT: Readonly<{
7
+ minute: "分鐘";
8
+ hour: "小時";
9
+ day: "天數";
10
+ }>;
11
+ export const READING_TIME_UNIT_PAGE_TEXT: Readonly<{
12
+ minute: "分鐘";
13
+ hour: "小時";
14
+ day: "天";
15
+ }>;
@@ -0,0 +1,25 @@
1
+ export namespace BRANCH {
2
+ let master: string;
3
+ let test: string;
4
+ let preview: string;
5
+ let staging: string;
6
+ let release: string;
7
+ let next: string;
8
+ let dev: string;
9
+ }
10
+ export const BRANCH_PROP_TYPES: any;
11
+ declare namespace _default {
12
+ let master_1: string;
13
+ export { master_1 as master };
14
+ let test_1: string;
15
+ export { test_1 as test };
16
+ let preview_1: string;
17
+ export { preview_1 as preview };
18
+ let staging_1: string;
19
+ export { staging_1 as staging };
20
+ let release_1: string;
21
+ export { release_1 as release };
22
+ let dev_1: string;
23
+ export { dev_1 as dev };
24
+ }
25
+ export default _default;
@@ -0,0 +1,21 @@
1
+ declare namespace _default {
2
+ export { forClientSideRendering };
3
+ export { forServerSideRendering };
4
+ }
5
+ export default _default;
6
+ declare const forClientSideRendering: {
7
+ [x: string]: {
8
+ accounts: string;
9
+ api: string;
10
+ main: string;
11
+ support: string;
12
+ };
13
+ };
14
+ declare const forServerSideRendering: {
15
+ [x: string]: {
16
+ accounts: string;
17
+ api: string;
18
+ main: string;
19
+ support: string;
20
+ };
21
+ };
@@ -0,0 +1 @@
1
+ export const shortDescription: "\u300A\u5831\u5C0E\u8005\u300B\u662F\u53F0\u7063\u7B2C\u4E00\u500B\u7531\u516C\u76CA\u57FA\u91D1\u6703\u6210\u7ACB\u7684\u7DB2\u8DEF\u5A92\u9AD4\uFF0C\u79C9\u6301\u6DF1\u5EA6\u3001\u958B\u653E\u3001\u975E\u71DF\u5229\u7684\u7CBE\u795E\uFF0C\u81F4\u529B\u65BC\u516C\u5171\u9818\u57DF\u8ABF\u67E5\u5831\u5C0E\uFF0C\u8207\u793E\u6703\u5171\u540C\u6253\u9020\u591A\u5143\u9032\u6B65\u7684\u5A92\u9AD4\u74B0\u5883\u3002";
@@ -0,0 +1,5 @@
1
+ export namespace SIZE {
2
+ let S: string;
3
+ let L: string;
4
+ }
5
+ export const SIZE_PROP_TYPES: any;
@@ -0,0 +1,5 @@
1
+ export namespace google {
2
+ let schema: string;
3
+ let hostname: string;
4
+ let bucket: string;
5
+ }
@@ -0,0 +1,16 @@
1
+ export const THEME: Readonly<{
2
+ normal: "normal";
3
+ photography: "photography";
4
+ transparent: "transparent";
5
+ index: "index";
6
+ }>;
7
+ export const THEME_PROP_TYPES: any;
8
+ export const ARTICLE_THEME: Readonly<{
9
+ v2: {
10
+ pink: string;
11
+ default: string;
12
+ photo: string;
13
+ interactive: string;
14
+ embedded: string;
15
+ };
16
+ }>;
@@ -0,0 +1,16 @@
1
+ declare namespace _default {
2
+ let topBanner: number;
3
+ let articleImgFullScreenMask: number;
4
+ let loadingCover: number;
5
+ let popup: number;
6
+ let hamburgerMenu: number;
7
+ let toc: number;
8
+ let webPush: number;
9
+ let buttomBanner: number;
10
+ let header: number;
11
+ let articleFullScreenHeroImage: number;
12
+ let embedUp: number;
13
+ let mobileToolBar: number;
14
+ let embedDown: number;
15
+ }
16
+ export default _default;
@@ -0,0 +1,9 @@
1
+ /**
2
+ *
3
+ *
4
+ * @export
5
+ * @param {Array<number>|Array<string>} [values=[]]
6
+ * @param {string} [unit='px']
7
+ * @returns {string}
8
+ */
9
+ export function arrayToCssShorthand(values?: Array<number> | Array<string>, unit?: string): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @export
4
+ * @param {number} timestampInMs - UNIX timestamp in mileseconds
5
+ * @param {string} separator - return string will be like 2019{separator}1{separator}31
6
+ * @returns
7
+ */
8
+ export function date2yyyymmdd(timestampInMs: number, separator?: string): string;
@@ -0,0 +1,4 @@
1
+ export function getGlobalEnv(): {
2
+ nodeEnv: string;
3
+ releaseBranch: string;
4
+ };
@@ -0,0 +1,42 @@
1
+ export function getMediaQueryUtil(screen?: Readonly<{
2
+ tablet: {
3
+ minWidth: number;
4
+ };
5
+ desktop: {
6
+ minWidth: number;
7
+ };
8
+ hd: {
9
+ minWidth: number;
10
+ };
11
+ }>): {
12
+ mobileOnly: (...args: any[]) => import("styled-components").RuleSet<object>;
13
+ tabletAndBelow: (...args: any[]) => import("styled-components").RuleSet<object>;
14
+ tabletOnly: (...args: any[]) => import("styled-components").RuleSet<object>;
15
+ tabletAndAbove: (...args: any[]) => import("styled-components").RuleSet<object>;
16
+ desktopAndBelow: (...args: any[]) => import("styled-components").RuleSet<object>;
17
+ desktopOnly: (...args: any[]) => import("styled-components").RuleSet<object>;
18
+ desktopAndAbove: (...args: any[]) => import("styled-components").RuleSet<object>;
19
+ hdOnly: (...args: any[]) => import("styled-components").RuleSet<object>;
20
+ };
21
+ export const DEFAULT_SCREEN: Readonly<{
22
+ tablet: {
23
+ minWidth: number;
24
+ };
25
+ desktop: {
26
+ minWidth: number;
27
+ };
28
+ hd: {
29
+ minWidth: number;
30
+ };
31
+ }>;
32
+ export default defaultMq;
33
+ declare namespace defaultMq {
34
+ function mobileOnly(...args: any[]): import("styled-components").RuleSet<object>;
35
+ function tabletAndBelow(...args: any[]): import("styled-components").RuleSet<object>;
36
+ function tabletOnly(...args: any[]): import("styled-components").RuleSet<object>;
37
+ function tabletAndAbove(...args: any[]): import("styled-components").RuleSet<object>;
38
+ function desktopAndBelow(...args: any[]): import("styled-components").RuleSet<object>;
39
+ function desktopOnly(...args: any[]): import("styled-components").RuleSet<object>;
40
+ function desktopAndAbove(...args: any[]): import("styled-components").RuleSet<object>;
41
+ function hdOnly(...args: any[]): import("styled-components").RuleSet<object>;
42
+ }
@@ -0,0 +1 @@
1
+ export function getSignInHref(destination?: string): string;
@@ -0,0 +1 @@
1
+ export function getSignOutHref(destination?: string): string;
@@ -0,0 +1 @@
1
+ export default function _default(el: any, duration: any, callback: any, context: any): void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Replace Google Cloud Storage url origin with the origin of main site
3
+ *
4
+ * @export
5
+ * @param {string} [url=''] The url with Google Cloud Storage url
6
+ * @param {boolean} [forceToReplace=false] The defaut action is not to replace the origin when nodeEnv==='development', use the para to overwrite it.
7
+ * @returns
8
+ */
9
+ export function replaceGCSUrlOrigin(url?: string, forceToReplace?: boolean): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @prop {string} position - postion of the content div
3
+ * @prop {number} lineHeight - line-height
4
+ * @prop {number} numberOfLine - number of line that you need in div
5
+ * @prop {string} backgroundColor - background
6
+ * @prop {string} textAlign - text-align
7
+ * */
8
+ export default function truncate(position: any, lineHeight: any, numberOfLine: any, backgroundColor: any, textAlign: any): string;
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@twreporter/core",
3
- "version": "1.24.2",
3
+ "version": "1.24.3",
4
4
  "main": "lib/index.js",
5
+ "types": "lib/index.d.ts",
5
6
  "repository": "https://github.com/twreporter/twreporter-npm-packages.git",
6
7
  "author": "twreporter <developer@twreporter.org>",
7
8
  "license": "MIT",
8
9
  "scripts": {
9
10
  "clean": "make clean",
10
- "build": "make build",
11
+ "build": "make build && tsc --noEmit false",
11
12
  "dev": "make dev",
12
- "prepublishOnly": "make build"
13
+ "prepublishOnly": "make build && tsc --noEmit false"
13
14
  },
14
15
  "dependencies": {
15
16
  "lodash": "^4.0.0",
@@ -20,5 +21,8 @@
20
21
  "files": [
21
22
  "lib"
22
23
  ],
23
- "gitHead": "7125c4d886b5a8c9877a9714c0730fcc03c3833a"
24
+ "devDependencies": {
25
+ "typescript": "^5.7.3"
26
+ },
27
+ "gitHead": "46ab7372a7f9eb23f4b874ea197d439b90440ab2"
24
28
  }