@cntrl-site/sdk 0.2.0 → 0.2.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.
@@ -46,14 +46,14 @@ class Client {
46
46
  const article = core_1.ArticleSchema.parse(articleData);
47
47
  return article;
48
48
  }
49
- static getPageMeta(projectMeta, pageMeta) {
50
- return {
49
+ static getPageMeta(projectMeta, pageMeta, enableMeta) {
50
+ return enableMeta ? {
51
51
  title: pageMeta.title ? pageMeta.title : projectMeta.title,
52
52
  description: pageMeta.description ? pageMeta.description : projectMeta.description,
53
53
  keywords: pageMeta.keywords ? pageMeta.keywords : projectMeta.keywords,
54
54
  opengraphThumbnail: pageMeta.opengraphThumbnail ? pageMeta.opengraphThumbnail : projectMeta.opengraphThumbnail,
55
55
  favicon: projectMeta.favicon
56
- };
56
+ } : projectMeta;
57
57
  }
58
58
  }
59
59
  exports.Client = Client;
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FontFaceGenerator = void 0;
4
4
  const FILE_TYPES_MAP = {
5
- ttf: 'truetype'
5
+ ttf: 'truetype',
6
+ otf: 'opentype'
6
7
  };
7
8
  class FontFaceGenerator {
8
9
  constructor(fonts) {
@@ -18,6 +19,7 @@ class FontFaceGenerator {
18
19
  @font-face {
19
20
  font-family: ${font.name};
20
21
  font-weight: ${font.weight};
22
+ font-style: ${font.style};
21
23
  ${eotFile ? `src: url('${eotFile.url}');\n ` : ''}src: ${otherFiles.join(', ')};
22
24
  }`;
23
25
  }).join('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -24,7 +24,7 @@
24
24
  "lib": "lib"
25
25
  },
26
26
  "dependencies": {
27
- "@cntrl-site/core": "^1.0.12",
27
+ "@cntrl-site/core": "^1.0.16",
28
28
  "@types/isomorphic-fetch": "^0.0.36",
29
29
  "isomorphic-fetch": "^3.0.0"
30
30
  },
@@ -47,13 +47,13 @@ export class Client {
47
47
  return article;
48
48
  }
49
49
 
50
- public static getPageMeta(projectMeta: TMeta, pageMeta: TPageMeta): TMeta {
51
- return {
50
+ public static getPageMeta(projectMeta: TMeta, pageMeta: TPageMeta, enableMeta: boolean): TMeta {
51
+ return enableMeta ? {
52
52
  title: pageMeta.title ? pageMeta.title : projectMeta.title,
53
53
  description: pageMeta.description ? pageMeta.description : projectMeta.description,
54
54
  keywords: pageMeta.keywords ? pageMeta.keywords : projectMeta.keywords,
55
55
  opengraphThumbnail: pageMeta.opengraphThumbnail ? pageMeta.opengraphThumbnail : projectMeta.opengraphThumbnail,
56
56
  favicon: projectMeta.favicon
57
- };
57
+ } : projectMeta;
58
58
  }
59
59
  }
@@ -40,6 +40,7 @@ describe('FontFaceGenerator', () => {
40
40
  @font-face {
41
41
  font-family: Aeonik;
42
42
  font-weight: 400;
43
+ font-style: normal;
43
44
  src: url('link/to/font.eot');
44
45
  src: url('link/to/font.woff') format('woff');
45
46
  }
@@ -47,6 +48,7 @@ describe('FontFaceGenerator', () => {
47
48
  @font-face {
48
49
  font-family: Anek Odia;
49
50
  font-weight: 700;
51
+ font-style: italic;
50
52
  src: url('link/to/font.woff') format('woff'), url('link/to/font.ttf') format('truetype');
51
53
  }`)
52
54
  });
@@ -1,7 +1,8 @@
1
1
  import { TCustomFont } from '@cntrl-site/core';
2
2
 
3
3
  const FILE_TYPES_MAP: Record<string, string> = {
4
- ttf: 'truetype'
4
+ ttf: 'truetype',
5
+ otf: 'opentype'
5
6
  };
6
7
 
7
8
  export class FontFaceGenerator {
@@ -19,6 +20,7 @@ export class FontFaceGenerator {
19
20
  @font-face {
20
21
  font-family: ${font.name};
21
22
  font-weight: ${font.weight};
23
+ font-style: ${font.style};
22
24
  ${eotFile ? `src: url('${eotFile.url}');\n ` : ''}src: ${otherFiles.join(', ')};
23
25
  }`;
24
26
  }).join('\n');