@cntrl-site/sdk-nextjs 0.14.6 → 0.15.1

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.
@@ -18,16 +18,17 @@ const CNTRLHead = ({ meta, project }) => {
18
18
  const customFonts = project.fonts.custom;
19
19
  const htmlHead = (0, html_react_parser_1.default)(project.html.head);
20
20
  const ffGenerator = new sdk_1.FontFaceGenerator(customFonts);
21
+ const links = Object.values(parsedFonts).map((value, i) => {
22
+ if (!value)
23
+ return;
24
+ const rel = value?.rel || value.props?.rel;
25
+ const href = value?.href || value.props?.href;
26
+ if (!rel || !href)
27
+ return;
28
+ return ((0, jsx_runtime_1.jsx)("link", { rel: rel, href: href }, `link-${rel}-${href}`));
29
+ });
21
30
  return ((0, jsx_runtime_1.jsxs)(head_1.default, { children: [(0, jsx_runtime_1.jsx)("title", { children: meta.title }), (0, jsx_runtime_1.jsx)("meta", { name: "description", content: meta.description }), (0, jsx_runtime_1.jsx)("meta", { name: "keywords", content: meta.keywords }), (0, jsx_runtime_1.jsx)("meta", { property: "og:image", content: meta.opengraphThumbnail }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: meta.favicon }), customFonts.length > 0 && ((0, jsx_runtime_1.jsx)("style", { dangerouslySetInnerHTML: {
22
31
  __html: ffGenerator.generate()
23
- } })), Object.values(parsedFonts).map((value, i) => {
24
- if (!value)
25
- return undefined;
26
- const rel = value?.rel || value.props?.rel;
27
- const href = value?.href || value.props?.href;
28
- if (!rel || !href)
29
- return undefined;
30
- return ((0, jsx_runtime_1.jsx)("link", { rel: rel, href: href }, i));
31
- }), htmlHead] }));
32
+ } })), links, htmlHead] }));
32
33
  };
33
34
  exports.CNTRLHead = CNTRLHead;
@@ -86,7 +86,7 @@ const Item = ({ item, sectionId }) => {
86
86
  .item-${item.id} {
87
87
  position: ${sticky ? 'sticky' : 'absolute'};
88
88
  width: ${sizingAxis.x === sdk_1.ArticleItemSizingType.Manual ? `${area.width * 100}vw` : 'max-content'};
89
- height: ${sizingAxis.y === sdk_1.ArticleItemSizingType.Manual ? `w${area.height * 100}vw` : 'unset'};
89
+ height: ${sizingAxis.y === sdk_1.ArticleItemSizingType.Manual ? `${area.height * 100}vw` : 'unset'};
90
90
  transform: scale(${scale});
91
91
  top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
92
92
  transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "0.14.6",
3
+ "version": "0.15.1",
4
4
  "description": "SDK for Next.js",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -18,6 +18,15 @@ export const CNTRLHead: FC<Props> = ({ meta, project }) => {
18
18
  const customFonts = project.fonts.custom;
19
19
  const htmlHead = HTMLReactParser(project.html.head);
20
20
  const ffGenerator = new FontFaceGenerator(customFonts);
21
+ const links = Object.values(parsedFonts as ReturnType<typeof domToReact>).map((value, i) => {
22
+ if (!value) return;
23
+ const rel = value?.rel || value.props?.rel;
24
+ const href = value?.href || value.props?.href;
25
+ if (!rel || !href) return;
26
+ return (
27
+ <link key={`link-${rel}-${href}`} rel={rel} href={href} />
28
+ );
29
+ });
21
30
  return (
22
31
  <Head>
23
32
  <title>{meta.title}</title>
@@ -32,15 +41,7 @@ export const CNTRLHead: FC<Props> = ({ meta, project }) => {
32
41
  }}
33
42
  />
34
43
  )}
35
- {Object.values(parsedFonts as ReturnType<typeof domToReact>).map((value, i) => {
36
- if (!value) return undefined;
37
- const rel = value?.rel || value.props?.rel;
38
- const href = value?.href || value.props?.href;
39
- if (!rel || !href) return undefined;
40
- return (
41
- <link key={i} rel={rel} href={href} />
42
- );
43
- })}
44
+ {links}
44
45
  {htmlHead}
45
46
 
46
47
  </Head>
@@ -113,7 +113,7 @@ export const Item: FC<ItemProps<TArticleItemAny>> = ({ item, sectionId}) => {
113
113
  .item-${item.id} {
114
114
  position: ${sticky ? 'sticky' : 'absolute'};
115
115
  width: ${sizingAxis.x === SizingType.Manual ? `${area.width * 100}vw` : 'max-content'};
116
- height: ${sizingAxis.y === SizingType.Manual ? `w${area.height * 100}vw` : 'unset'};
116
+ height: ${sizingAxis.y === SizingType.Manual ? `${area.height * 100}vw` : 'unset'};
117
117
  transform: scale(${scale});
118
118
  top: ${sticky ? `${getAnchoredItemTop(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
119
119
  transform-origin: ${ScaleAnchorMap[scaleAnchor]};
Binary file
Binary file