@cntrl-site/sdk 1.1.1 → 1.1.4

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.
@@ -20,11 +20,11 @@ class Client {
20
20
  }
21
21
  static getPageMeta(projectMeta, pageMeta) {
22
22
  return pageMeta.enabled ? {
23
- title: pageMeta.title ? pageMeta.title : projectMeta.title,
24
- description: pageMeta.description ? pageMeta.description : projectMeta.description,
25
- keywords: pageMeta.keywords ? pageMeta.keywords : projectMeta.keywords,
26
- opengraphThumbnail: pageMeta.opengraphThumbnail ? pageMeta.opengraphThumbnail : projectMeta.opengraphThumbnail,
27
- favicon: projectMeta.favicon
23
+ title: pageMeta.title ? pageMeta.title : projectMeta.title ?? '',
24
+ description: pageMeta.description ? pageMeta.description : projectMeta.description ?? '',
25
+ keywords: pageMeta.keywords ? pageMeta.keywords : projectMeta.keywords ?? '',
26
+ opengraphThumbnail: pageMeta.opengraphThumbnail ? pageMeta.opengraphThumbnail : projectMeta.opengraphThumbnail ?? '',
27
+ favicon: projectMeta.favicon ?? ''
28
28
  } : projectMeta;
29
29
  }
30
30
  async getPageData(pageSlug) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.1.1",
3
+ "version": "1.1.4",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -27,7 +27,7 @@
27
27
  "lib": "lib"
28
28
  },
29
29
  "dependencies": {
30
- "@cntrl-site/core": "^1.22.3",
30
+ "@cntrl-site/core": "^1.22.4",
31
31
  "@types/ejs": "^3.1.2",
32
32
  "@types/isomorphic-fetch": "^0.0.36",
33
33
  "commander": "^10.0.1",
@@ -32,11 +32,11 @@ export class Client {
32
32
 
33
33
  private static getPageMeta(projectMeta: TMeta, pageMeta: TPageMeta): TMeta {
34
34
  return pageMeta.enabled ? {
35
- title: pageMeta.title ? pageMeta.title : projectMeta.title,
36
- description: pageMeta.description ? pageMeta.description : projectMeta.description,
37
- keywords: pageMeta.keywords ? pageMeta.keywords : projectMeta.keywords,
38
- opengraphThumbnail: pageMeta.opengraphThumbnail ? pageMeta.opengraphThumbnail : projectMeta.opengraphThumbnail,
39
- favicon: projectMeta.favicon
35
+ title: pageMeta.title ? pageMeta.title : projectMeta.title ?? '',
36
+ description: pageMeta.description ? pageMeta.description : projectMeta.description ?? '',
37
+ keywords: pageMeta.keywords ? pageMeta.keywords : projectMeta.keywords ?? '',
38
+ opengraphThumbnail: pageMeta.opengraphThumbnail ? pageMeta.opengraphThumbnail : projectMeta.opengraphThumbnail ?? '',
39
+ favicon: projectMeta.favicon ?? ''
40
40
  } : projectMeta;
41
41
  }
42
42
 
package/.env.local DELETED
@@ -1 +0,0 @@
1
- CNTRL_API_URL=https://01GJ2SPNXG3V5P35ZA35YM1JTW:68e1bacad1b3adb6cb8be99ca7167c2b@preview.cntrl.site
Binary file
package/cntrl.scss DELETED
@@ -1,66 +0,0 @@
1
- // CAUTION: THIS FILE IS AUTO-GENERATED BASED ON
2
- // LAYOUT CONFIGURATION IN YOUR CNTRL PROJECT
3
- // WE HIGHLY ADVICE YOU TO NOT CHANGE IT MANUALLY
4
- @use "sass:map";
5
-
6
- $__CNTRL_LAYOUT_WIDTH__: 375;
7
-
8
- $layout: (
9
-
10
- mobile: (
11
- start: 0,
12
- end: 749,
13
- exemplary: 375,
14
- isFirst: true,
15
- isLast: false
16
- ),
17
-
18
- tablet: (
19
- start: 750,
20
- end: 1023,
21
- exemplary: 768,
22
- isFirst: false,
23
- isLast: false
24
- ),
25
-
26
- desktop: (
27
- start: 1024,
28
- end: 9007199254740991,
29
- exemplary: 1440,
30
- isFirst: false,
31
- isLast: true
32
- ),
33
-
34
- );
35
-
36
- @function size($value) {
37
- @return #{$value/$__CNTRL_LAYOUT_WIDTH__*100}vw;
38
- }
39
-
40
- @mixin for($name) {
41
- $start: map.get(map.get($layout, $name), "start");
42
- $end: map.get(map.get($layout, $name), "end");
43
- $isFirst: map.get(map.get($layout, $name), "isFirst");
44
- $isLast: map.get(map.get($layout, $name), "isLast");
45
- $exemplary: map.get(map.get($layout, $name), "exemplary");
46
- $__CNTRL_LAYOUT_WIDTH__: $exemplary !global;
47
-
48
- @if $isFirst == true and $isLast == true {
49
- @content;
50
- } @else if $isFirst == true {
51
- @media (max-width: #{$end}px) {
52
- @content;
53
- }
54
- } @else if $isLast == true {
55
- @media (min-width: #{$start}px) {
56
- @content;
57
- }
58
- } @else {
59
- @media (min-width: #{$start}px) and (max-width: #{$end}px) {
60
- @content;
61
- }
62
- }
63
-
64
- // reset global variable back to first layout's exemplary (mobile-first)
65
- $__CNTRL_LAYOUT_WIDTH__: 375 !global;
66
- }