@redocly/marketing-pages 0.1.36 → 0.1.38

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.
@@ -5,7 +5,10 @@ interface PostInfoProps {
5
5
  authorBIO?: string;
6
6
  avatar: string;
7
7
  date: Date;
8
- categories: Category[];
8
+ categories: {
9
+ category: Category;
10
+ subcategory?: Category;
11
+ }[];
9
12
  title: string;
10
13
  image: string;
11
14
  author: any;
@@ -1,18 +1,38 @@
1
- import e from"react";import r from"styled-components";import{TextGradient as d}from"../TextGradient/TextGradient";import{TextNormal as n,TextSmall as p}from"../TypographyElements/TypographyElements";import{Box as a}from"../../ui/Box";import{formatDateString as x}from"../../utils/dates";import{breakpoints as o}from"@redocly/theme/core/utils";function s(t){const{date:i,author:m,title:l,image:c}=t;return e.createElement(a,{mt:5},e.createElement(h,{my:5},l),e.createElement(f,{author:m,date:x(i)}),e.createElement(b,null,e.createElement(w,{src:c,alt:"post"})))}const f=({author:t,date:i})=>e.createElement(a,{display:"flex"},e.createElement(u,{bg:t.image}),e.createElement(y,null,e.createElement(g,{hasAuthorBIO:t.authorBIO},e.createElement(n,{color:"var(--color-text-dark)",fontWeight:500},"By ",t.name),e.createElement(n,{style:{marginLeft:t.authorBIO&&"10px"}},i.toLocaleString("en-US",{year:"numeric",month:"long",day:"2-digit"}))),e.createElement(p,{color:"var(--color-text-dimmed)"},t.authorBIO))),g=r.div`
1
+ import e from"react";import r from"styled-components";import{TextGradient as x}from"../TextGradient/TextGradient";import{TextNormal as l,TextSmall as f}from"../TypographyElements/TypographyElements";import{Box as d}from"../../ui/Box";import{formatDateString as h}from"../../utils/dates";import{breakpoints as n}from"@redocly/theme/core/utils";import{Tag as u}from"@redocly/theme/components/Tag/Tag";function y(t){const{date:o,author:m,title:c,image:p,categories:g}=t,s=(i,a)=>{typeof window<"u"&&(window.location.href=`/blog/category/${i}${a?`/${a}`:""}`)};return e.createElement(d,{mt:5},e.createElement(E,null,e.createElement(w,null,g.map(i=>e.createElement(b,{key:i.category.id,onClick:()=>s(i.category.id,i.subcategory?.id||null)},i.category.label,i.subcategory?.label&&` \u2022 ${i.subcategory?.label}`))),e.createElement($,{my:5},c)),e.createElement(v,{author:m,date:h(o)}),e.createElement(C,null,e.createElement(I,{src:p,alt:"post"})))}const b=r(u)`
2
+ display: flex;
3
+ height: 32px;
4
+ padding: 0 12px;
5
+ justify-content: center;
6
+ align-items: center;
7
+ gap: 8px;
8
+ border-radius: 20px;
9
+ border: 1px solid #dcdde5;
10
+ background: #fbfbfc;
11
+ cursor: pointer;
12
+ `,w=r.div`
13
+ display: flex;
14
+ align-items: flex-start;
15
+ gap: 8px;
16
+ `,E=r.div`
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: 16px;
20
+ `,v=({author:t,date:o})=>e.createElement(d,{display:"flex"},e.createElement(T,{bg:t.image}),e.createElement(B,null,e.createElement(k,{hasAuthorBIO:t.authorBIO},e.createElement(l,{color:"var(--color-text-dark)",fontWeight:500},"By ",t.name),e.createElement(l,{style:{marginLeft:t.authorBIO&&"10px"}},o.toLocaleString("en-US",{year:"numeric",month:"long",day:"2-digit"}))),e.createElement(f,{color:"var(--color-text-dimmed)"},t.authorBIO))),k=r.div`
2
21
  display: flex;
3
22
  flex-wrap: wrap;
4
23
  flex-direction: ${({hasAuthorBIO:t})=>t?"row":"column"};
5
- `,h=r(d)`
24
+ `,$=r(x)`
6
25
  font-family: var(--font-family);
7
26
  font-size: 44px;
8
27
  line-height: 48px;
9
28
  font-weight: 600;
29
+ margin-top: 0;
10
30
 
11
- @media screen and (min-width: ${o.medium}) {
31
+ @media screen and (min-width: ${n.medium}) {
12
32
  font-size: 64px;
13
33
  line-height: 78px;
14
34
  }
15
- `,u=r.div`
35
+ `,T=r.div`
16
36
  width: 80px;
17
37
  height: 80px;
18
38
  border-radius: 50%;
@@ -22,7 +42,7 @@ import e from"react";import r from"styled-components";import{TextGradient as d}f
22
42
  background-size: cover;
23
43
  background-position: center;
24
44
  z-index: 1;
25
- `,y=r.div`
45
+ `,B=r.div`
26
46
  display: flex;
27
47
  flex-direction: column;
28
48
  justify-content: center;
@@ -33,15 +53,15 @@ import e from"react";import r from"styled-components";import{TextGradient as d}f
33
53
  padding: 0 10px 0 58px;
34
54
  background: white;
35
55
  border-radius: 8px;
36
- `,w=r.img`
56
+ `,I=r.img`
37
57
  height: 100%;
38
58
  max-height: 210px;
39
59
  width: auto;
40
60
 
41
- @media screen and (min-width: ${o.small}) {
61
+ @media screen and (min-width: ${n.small}) {
42
62
  max-height: 320px;
43
63
  }
44
- `,b=r.div`
64
+ `,C=r.div`
45
65
  display: flex;
46
66
  align-items: center;
47
67
  justify-content: center;
@@ -50,7 +70,7 @@ import e from"react";import r from"styled-components";import{TextGradient as d}f
50
70
  background-color: #deeeff;
51
71
  overflow: hidden;
52
72
 
53
- @media screen and (min-width: ${o.small}) {
73
+ @media screen and (min-width: ${n.small}) {
54
74
  height: 370px;
55
75
  }
56
- `;export{s as default};
76
+ `;export{y as default};
@@ -1,7 +1,7 @@
1
- import e from"react";import p,{css as l}from"styled-components";import{Button as c}from"../Button/CustomButton";import{Box as i}from"../../ui/Box";const b=({categories:r,selectedCategory:t,onCategoryClick:a})=>e.createElement(i,{display:"flex",flexWrap:"wrap",my:5},e.createElement(m,{size:"medium",key:"All",active:!t,onClick:()=>a(null)},"All"),r.map(({id:o,label:n})=>e.createElement(m,{size:"large",key:o,active:o===t,onClick:()=>a(o)},n))),m=p(c)`
2
- ${({active:r})=>r?l`
1
+ import o from"react";import i,{css as a}from"styled-components";import{Box as m}from"../../ui/Box";const g=({categories:r,selectedCategory:t,onCategoryClick:l})=>o.createElement(m,{display:"flex",flexWrap:"wrap",my:5},o.createElement(n,{size:"medium",key:"All",active:!t,onClick:()=>l(null)},"All"),r.map(({id:e,label:c})=>o.createElement(n,{size:"large",key:e,active:e===t,href:`/blog/category/${e}`},c))),n=i.a`
2
+ ${({active:r})=>r?a`
3
3
  background: #f88d3b;
4
- `:l`
4
+ `:a`
5
5
  background: rgba(0, 68, 212, 0.2);
6
6
  `}
7
7
 
@@ -10,6 +10,8 @@ import e from"react";import p,{css as l}from"styled-components";import{Button as
10
10
  border-radius: 24px;
11
11
  color: var(--color-warm-grey-10);
12
12
  border-color: transparent;
13
+ text-decoration: none;
14
+ text-align: center;
13
15
  font-size: 18px;
14
16
  padding: 8px 18px;
15
17
  min-width: 120px;
@@ -18,4 +20,4 @@ import e from"react";import p,{css as l}from"styled-components";import{Button as
18
20
  border-color: var(--color-carrot-7);
19
21
  background: #f88d3b;
20
22
  }
21
- `;export{b as PostsCategoryFilter};
23
+ `;export{g as PostsCategoryFilter};
@@ -8,7 +8,10 @@ export type Post = {
8
8
  };
9
9
  slug: string;
10
10
  author: Author;
11
- categories: Category[];
11
+ categories: {
12
+ category: Category;
13
+ subcategory?: Category;
14
+ }[];
12
15
  image: string;
13
16
  title: string;
14
17
  description: string;
@@ -1,2 +1,7 @@
1
1
  import * as React from 'react';
2
- export default function Page(): React.JSX.Element;
2
+ interface PageProps {
3
+ RedoclyOpenAPIDocs: any;
4
+ safeSlugify: (str: string) => string;
5
+ }
6
+ export default function Page({ RedoclyOpenAPIDocs, safeSlugify }: PageProps): React.JSX.Element;
7
+ export {};
@@ -1,3 +1,3 @@
1
- import{useCommunicationManager as o}from"../hooks/useCommunicationManager";import r from"styled-components";import*as e from"react";import{RedoclyOpenAPIDocs as a,safeSlugify as s}from"@redocly/openapi-docs";import{useThemeManager as f}from"../hooks/useThemeManager";function d(){const[t,i]=e.useState(null);return o({definition:t,safeSlugify:s}),f(),e.useEffect(()=>{window.updateDefinition=n=>{i(n)},window.parent.onReady(window)},[t]),t?e.createElement(l,null,e.createElement(a,{store:{options:{routingBasePath:"/preview",disableRouter:!0,hideSidebar:!0,scrollYOffset:0,hideInfoMetadata:!0,feedback:{hide:!0}},definition:t}})):e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontFamily:"system-ui, -apple-system, sans-serif",color:"#666"}},"No API definition available")}const l=r.div`
1
+ import{useCommunicationManager as a}from"../hooks/useCommunicationManager";import s from"styled-components";import*as e from"react";import{useThemeManager as d}from"../hooks/useThemeManager";function f({RedoclyOpenAPIDocs:i,safeSlugify:n}){const[t,r]=e.useState(null);return a({definition:t,safeSlugify:n}),d(),e.useEffect(()=>{window.updateDefinition=o=>{r(o)},window.parent.onReady(window)},[t]),t?e.createElement(l,null,e.createElement(i,{store:{options:{routingBasePath:"/preview",disableRouter:!0,hideSidebar:!0,scrollYOffset:0,hideInfoMetadata:!0,feedback:{hide:!0}},definition:t}})):e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontFamily:"system-ui, -apple-system, sans-serif",color:"#666"}},"No API definition available")}const l=s.div`
2
2
  --sidebar-width: 0px;
3
- `;export{d as default};
3
+ `;export{f as default};
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export default function BlogPostPage(props: any): React.JSX.Element;
2
+ export default function BlogPost(props: any): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import e from"react";import o from"styled-components";import{useThemeHooks as s}from"@redocly/theme/core/hooks";import d from"@redocly/marketing-pages/components/Blog/PostInfo.js";import{MediaBox as p}from"@redocly/marketing-pages/components/PositionItems/MediaBox.js";import{Markdown as u}from"@redocly/theme/components/Markdown/Markdown";import{Box as g}from"@redocly/marketing-pages/ui/Box.js";import{RecentPosts as f}from"@redocly/marketing-pages/components/Blog/RecentPosts.js";function h(a){const{usePageProps:r}=s(),m=r(),{date:i,author:t,categories:n,title:l,image:c}=m.metadata;return e.createElement(P,{style:{background:"white"}},e.createElement(x,null,e.createElement(d,{authorName:t?.name,authorBIO:t.authorBIO,date:i,categories:n,title:l,author:t,avatar:t?.image,image:c}),e.createElement(u,null,a.children)),e.createElement(p,null,e.createElement(g,{my:"80px"},e.createElement(f,null))))}const x=o.div`
1
+ import e from"react";import o from"styled-components";import{useThemeHooks as s}from"@redocly/theme/core/hooks";import d from"@redocly/marketing-pages/components/Blog/PostInfo.js";import{MediaBox as p}from"@redocly/marketing-pages/components/PositionItems/MediaBox.js";import{Markdown as u}from"@redocly/theme/components/Markdown/Markdown";import{Box as g}from"@redocly/marketing-pages/ui/Box.js";import{RecentPosts as f}from"@redocly/marketing-pages/components/Blog/RecentPosts.js";function h(a){const{usePageProps:r}=s(),m=r(),{date:i,author:t,categories:n,title:l,image:c}=m.metadata;return e.createElement(w,{style:{background:"white"}},e.createElement(x,null,e.createElement(d,{authorName:t?.name,authorBIO:t.authorBIO,date:i,categories:n,title:l,author:t,avatar:t?.image,image:c}),e.createElement(u,null,a.children)),e.createElement(p,null,e.createElement(g,{my:"80px"},e.createElement(f,null))))}const x=o.div`
2
2
  margin-left: auto;
3
3
  margin-right: auto;
4
4
  max-width: calc(90vw);
@@ -6,7 +6,7 @@ import e from"react";import o from"styled-components";import{useThemeHooks as s}
6
6
  @media screen and (min-width: 900px) {
7
7
  max-width: 800px;
8
8
  }
9
- `,P=o.div`
9
+ `,w=o.div`
10
10
  position: relative;
11
11
  overflow: hidden;
12
12
  `;export{h as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/marketing-pages",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "keywords": [],
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -53,7 +53,6 @@
53
53
  "vitest": "^3.1.3"
54
54
  },
55
55
  "peerDependencies": {
56
- "@redocly/openapi-docs": "^3.14.1",
57
56
  "react": "^18.3.1",
58
57
  "react-dom": "^18.3.1",
59
58
  "styled-components": "^5.3.11 || ^6.0.0"
@@ -62,7 +61,6 @@
62
61
  "@changesets/cli": "^2.29.5",
63
62
  "@markdoc/markdoc": "0.5.1",
64
63
  "@redocly/config": "^0.24.0",
65
- "@redocly/openapi-docs": "^3.14.1",
66
64
  "@redocly/theme": "^0.53.0",
67
65
  "@shikijs/types": "3.4.0",
68
66
  "@types/js-yaml": "^4.0.9",