@redocly/marketing-pages 0.1.18 → 0.1.20
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import
|
|
1
|
+
import*as e from"react";import u from"styled-components";import{useEffect as a,useRef as i}from"react";import E from"./EmptyState";const R=u.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -10,11 +10,11 @@ import*as e from"react";import d from"styled-components";import{useEffect as o,u
|
|
|
10
10
|
text-align: center;
|
|
11
11
|
font-size: 0.9em;
|
|
12
12
|
z-index: 10;
|
|
13
|
-
`,
|
|
13
|
+
`,b=u.iframe`
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
16
|
border: none;
|
|
17
|
-
`,
|
|
17
|
+
`,I=({definition:o,rawValue:c,hasStructErrors:p,onTemplateClick:g,onFileLoad:y})=>{const d=i(null),r=o||d.current,h=i(null),n=i(null),[f,v]=e.useState(!1),[w,P]=e.useState(0),l=i(!1);a(()=>{const s=t=>{t.data?.type!=="scroll-sync"||t.data?.source==="preview"||!n.current||l.current||(l.current=!0,n.current.postMessage(t.data,"*"),setTimeout(()=>{l.current=!1},50))};return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[]),a(()=>{const s=t=>{n.current=t,t.updateDefinition(r),v(!0)};window.onReady=s},[r]),a(()=>{o&&(d.current=o)},[o]),a(()=>{n.current&&f&&n.current.updateDefinition(r)},[r,f]);const m=p&&e.createElement(R,null,"Preview is showing the last valid version. The current content has structural errors. Please check editor messages.")||null;return!c||typeof c!="string"||c.trim()===""?e.createElement(E,{onTemplateClick:g,onUploadClick:y}):r?e.createElement(e.Fragment,null,m,e.createElement(x,null,e.createElement(b,{key:w,ref:h,title:"API Documentation Preview",src:"/preview",onLoad:()=>{}}))):m||"Loading..."};var L=I;const x=u.div`
|
|
18
18
|
height: 100%;
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
`;export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as n from"react";function h({RedoclyOpenAPIDocs:i}){const[o,e]=n.useState(null),l=n.useRef(null),c=n.useRef(!1),w=n.useRef(null);return n.useEffect(()=>{window.updateDefinition=r=>{if(r&&typeof r=="object"&&typeof r.openapi=="string"){const t=v(r);l.current=t,e(t)}else l.current?w.current!==l.current&&e(l.current):e(null);w.current=r},window.parent.onReady(window)},[]),n.useEffect(()=>{const r=()=>{if(c.current)return;const t=document.querySelector("article");if(!t)return;const a=window.innerHeight,f=t.scrollHeight,d=window.scrollY,s=f-a;if(s<=0)return;const p=Math.round(d/s*100);window.parent.postMessage({type:"scroll-sync",position:{absolute:d,relative:p},source:"preview"},"*")},u=t=>{if(t.data?.type!=="scroll-sync"||t.data?.source==="preview"||c.current)return;const a=document.querySelector("article");if(!a)return;const f=window.innerHeight,s=a.scrollHeight-f;if(s<=0)return;c.current=!0;const p=Math.round(t.data.position.relative/100*s);window.scrollTo({top:p,behavior:"smooth"}),setTimeout(()=>{c.current=!1},50)};return window.addEventListener("scroll",r),window.addEventListener("message",u),()=>{window.removeEventListener("scroll",r),window.removeEventListener("message",u)}},[]),o?n.createElement(i,{store:{options:{routingBasePath:"/preview",disableRouter:!0,hideSidebar:!0,scrollYOffset:0},definition:o}}):n.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontFamily:"system-ui, -apple-system, sans-serif",color:"#666"}},"No API definition available")}function v(i){try{const o={...i};return Array.isArray(o.servers)&&(o.servers=o.servers.filter(e=>e&&typeof e=="object").filter(e=>typeof e.url=="string"&&e.url.trim().length>0)),o}catch{return i}}export{h as default};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import e from"react";import
|
|
1
|
+
import e from"react";import r from"styled-components";import{Box as i}from"../../ui/Box";import{breakpoints as t}from"@redocly/theme/core/utils";import{TopLearnBlock as n,CardsBlock as o,BottomLearnBlock as p}from"./components";const u={seo:{title:"Learn"},slug:"/learn"};function f({cards:a}){return e.createElement(d,{backgroundColor:"var(--bg-color)",width:"100vw",height:"fit-content",position:"relative"},e.createElement(l,null),e.createElement(n,null),e.createElement(o,{cards:a}),e.createElement(p,null))}const l=r.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
max-width: 1384px;
|
|
4
4
|
width: -webkit-fill-available;
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
background-image: url(${require("./images/hero-img.svg")});
|
|
7
|
+
.dark & {
|
|
8
|
+
background-image: url(${require("./images/hero-img-dark.svg")});
|
|
9
|
+
}
|
|
10
|
+
`,d=r(i)`
|
|
6
11
|
display: flex;
|
|
7
12
|
align-items: center;
|
|
8
13
|
flex-direction: column;
|
|
@@ -23,4 +28,4 @@ import e from"react";import n from"styled-components";import{Box as l}from"../..
|
|
|
23
28
|
gap: 64px;
|
|
24
29
|
padding: 0 128px 64px 128px;
|
|
25
30
|
}
|
|
26
|
-
`;export{
|
|
31
|
+
`;export{f as default,u as frontmatter};
|