@redocly/marketing-pages 0.1.28 → 0.1.30

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,11 +1,11 @@
1
- import t,{useMemo as a}from"react";import{linearGradient as m}from"polished";import s from"styled-components";import{PrimaryPostCard as l}from"./PrimaryPostCard";import{GridSection as d,MediaBox as p,Skewed as c}from"../PositionItems";import{TextGradient as f}from"../TextGradient/TextGradient";import{breakpoints as g}from"@redocly/theme/core/utils";import{useThemeHooks as u}from"@redocly/theme/core/hooks";const G=()=>{const{usePageSharedData:o}=u(),{posts:r}=o("blog-posts"),i=["Using Redocly tools for better OpenAPI development","Build rich developer experiences with Markdown in OpenAPI","What's an API?"],n=a(()=>r.filter(({title:e})=>i.includes(e)),[r]);return t.createElement(c,{angle:0,bg:m({colorStops:["rgb(0, 104, 251)","rgb(126, 65, 255)"],toDirection:"to right bottom"}),offsetTop:"-300px",offsetBottom:"-200px"},t.createElement(p,{mb:6},t.createElement(h,null,"Featured classics"),t.createElement(d,{gridTemplateColumns:{base:"1fr",medium:"repeat(3, 1fr)"},justifyItems:{base:"center"},gridGap:{base:"5rem"}},n.map(e=>t.createElement(l,{key:e.slug,title:e.title,to:`${e.slug}`,img:e.image,description:e.description,date:e.date,author:e.author})))))},h=s(f)`
1
+ import t,{useMemo as s}from"react";import{linearGradient as l}from"polished";import m from"styled-components";import{PrimaryPostCard as c}from"./PrimaryPostCard";import{GridSection as d,MediaBox as f,Skewed as u}from"../PositionItems";import{TextGradient as p}from"../TextGradient/TextGradient";import{breakpoints as h}from"@redocly/theme/core/utils";import{useThemeHooks as g}from"@redocly/theme/core/hooks";const k=()=>{const{usePageSharedData:i}=g(),{posts:o}=i("blog-posts"),r=["Redocly Premium vs Open Source Features","Open-sourcing Redocly\u2019s unique approach to dogfooding","API documentation essentials","Using Redocly tools for better OpenAPI development","Build rich developer experiences with Markdown in OpenAPI","llms.txt is overhyped","Redocly Launches New API Tools Suite","The rise of interactive documentation","My favorite new features","Rethinking sub-resources in API design","What's an API?","API Governance: Shift-Left to Save Money and Accelerate Velocity","Learn OpenAPI in a day"],n=s(()=>[...o.filter(({title:a})=>r.includes(a))].sort(()=>Math.random()-.5).slice(0,3),[o]);return t.createElement(u,{angle:0,bg:l({colorStops:["rgb(0, 104, 251)","rgb(126, 65, 255)"],toDirection:"to right bottom"}),offsetTop:"-300px",offsetBottom:"-200px"},t.createElement(f,{mb:6},t.createElement(y,null,"Featured classics"),t.createElement(d,{gridTemplateColumns:{base:"1fr",medium:"repeat(3, 1fr)"},justifyItems:{base:"center"},gridGap:{base:"5rem"}},n.map(e=>t.createElement(c,{key:e.slug,title:e.title,to:`${e.slug}`,img:e.image,description:e.description,date:e.date,author:e.author})))))},y=m(p)`
2
2
  font-size: 28px;
3
3
  line-height: 30px;
4
4
  font-family: var(--font-family);
5
5
  font-weight: 600;
6
6
 
7
- @media screen and (min-width: ${g.medium}) {
7
+ @media screen and (min-width: ${h.medium}) {
8
8
  font-size: 40px;
9
9
  line-height: 48px;
10
10
  }
11
- `;export{G as FeaturedClassics};
11
+ `;export{k as FeaturedClassics};
@@ -18,5 +18,5 @@ interface EditorLayoutProps {
18
18
  onDownloadJson: () => void;
19
19
  onToggleFullPreview: () => void;
20
20
  }
21
- declare const EditorLayout: React.FC<EditorLayoutProps>;
21
+ declare const EditorLayout: React.ForwardRefExoticComponent<EditorLayoutProps & React.RefAttributes<any>>;
22
22
  export default EditorLayout;
@@ -1,4 +1,4 @@
1
- import e from"react";import a from"styled-components";import{Panel as n,PanelGroup as z,PanelResizeHandle as h}from"react-resizable-panels";import y from"../EditorPanel";import{ProblemsPanel as k}from"../ProblemsPanel";import S from"../Toolbar";const w=({value:i,onChange:s,onValidationUpdate:d,hideWarnings:r,onHideWarningsChange:c,isFullPreview:m,gotoPosition:p,parsedErrors:u,onProblemClick:f,onFileLoad:P,onDownloadYaml:b,onDownloadJson:E,onToggleFullPreview:g})=>{const[l,t]=e.useState(!0),o=e.useRef(null),C=(v,x)=>{f(v,x),l&&o.current?.expand()};return e.createElement(R,{defaultSize:50,minSize:20},e.createElement(S,{onFileLoad:P,onDownloadYamlClick:b,onDownloadJsonClick:E,hideWarnings:r,onHideWarningsChange:c,onToggleFullPreview:g}),e.createElement(F,null,e.createElement(z,{direction:"vertical"},e.createElement(n,{defaultSize:95},e.createElement(y,{value:i,onChange:s,onValidationUpdate:d,hideWarnings:r,isFullPreview:m,gotoPosition:p})),e.createElement(h,{className:"resize-handle-horizontal",style:{display:l?"none":"block"}}),e.createElement(n,{ref:o,collapsible:!0,collapsedSize:5,defaultSize:5,minSize:20,onCollapse:t.bind(null,!0),onExpand:t.bind(null,!1)},e.createElement(k,{problems:u,onProblemClick:C,isCollapsed:l,onToggle:()=>{l?o.current?.expand():o.current?.collapse()}})))))};var J=w;const R=a(n)`
1
+ import e from"react";import t from"styled-components";import{Panel as n,PanelGroup as h,PanelResizeHandle as S}from"react-resizable-panels";import k from"../EditorPanel";import{ProblemsPanel as w}from"../ProblemsPanel";import R from"../Toolbar";const i=e.forwardRef(({value:d,onChange:s,onValidationUpdate:c,hideWarnings:r,onHideWarningsChange:m,isFullPreview:p,gotoPosition:u,parsedErrors:f,onProblemClick:b,onFileLoad:P,onDownloadYaml:E,onDownloadJson:g,onToggleFullPreview:C},v)=>{const[l,a]=e.useState(!0),o=e.useRef(null),y=(z,x)=>{b(z,x),l&&o.current?.expand()};return e.createElement(F,{ref:v,defaultSize:50,minSize:20,collapsible:!0,collapsedSize:0},e.createElement(R,{onFileLoad:P,onDownloadYamlClick:E,onDownloadJsonClick:g,hideWarnings:r,onHideWarningsChange:m,onToggleFullPreview:C}),e.createElement(L,null,e.createElement(h,{direction:"vertical"},e.createElement(n,{defaultSize:95},e.createElement(k,{value:d,onChange:s,onValidationUpdate:c,hideWarnings:r,isFullPreview:p,gotoPosition:u})),e.createElement(S,{className:"resize-handle-horizontal",style:{display:l?"none":"block"}}),e.createElement(n,{ref:o,collapsible:!0,collapsedSize:5,defaultSize:5,minSize:20,onCollapse:a.bind(null,!0),onExpand:a.bind(null,!1)},e.createElement(w,{problems:f,onProblemClick:y,isCollapsed:l,onToggle:()=>{l?o.current?.expand():o.current?.collapse()}})))))});i.displayName="EditorLayout";var J=i;const F=t(n)`
2
2
  flex: 2;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -8,7 +8,7 @@ import e from"react";import a from"styled-components";import{Panel as n,PanelGro
8
8
  --vscode-editor-background: var(--layer-color);
9
9
  --vscode-editorGutter-background: var(--layer-color);
10
10
  }
11
- `,F=a.div`
11
+ `,L=t.div`
12
12
  flex: 1;
13
13
  min-height: 0;
14
14
  display: flex;
@@ -7,6 +7,8 @@ interface PreviewLayoutProps {
7
7
  onTemplateClick: () => void;
8
8
  onFileLoad: (content: string, fileName: string) => void;
9
9
  isClient: boolean;
10
+ isFullPreview: boolean;
11
+ onExitFullPreview?: () => void;
10
12
  }
11
13
  declare const PreviewLayout: React.FC<PreviewLayoutProps>;
12
14
  export default PreviewLayout;
@@ -1,7 +1,7 @@
1
- import e from"react";import p from"styled-components";import{Panel as d}from"react-resizable-panels";import m from"../PreviewPanel";const c=({definition:r,rawValue:o,hasRenderedOnce:t,hasStructErrors:i,onTemplateClick:a,onFileLoad:l,isClient:n})=>e.createElement(s,{defaultSize:50,minSize:20,collapsible:!0,collapsedSize:0},n&&e.createElement(m,{definition:r,rawValue:o,hasRenderedOnce:t,hasStructErrors:i,onTemplateClick:a,onFileLoad:l}));var P=c;const s=p(d)`
1
+ import e from"react";import s from"styled-components";import{Panel as c}from"react-resizable-panels";import f from"../PreviewPanel";const o=e.memo(({definition:i,rawValue:t,hasRenderedOnce:a,hasStructErrors:l,onTemplateClick:n,onFileLoad:m,isClient:p,isFullPreview:r,onExitFullPreview:d})=>e.createElement(u,{defaultSize:r?100:50,minSize:20,collapsible:!0,collapsedSize:0},p&&e.createElement(f,{definition:i,rawValue:t,hasRenderedOnce:a,hasStructErrors:l,onTemplateClick:n,onFileLoad:m,onExitFullPreview:d,isFullPreview:r})));o.displayName="PreviewLayout";var y=o;const u=s(c)`
2
2
  flex: 3;
3
3
  position: relative;
4
4
  border-left: 1px solid var(--border-color-primary);
5
5
  --sidebar-width: 0px;
6
6
  --panel-gap-horizontal: var(--spacing-md);
7
- `;export{P as default};
7
+ `;export{y as default};
@@ -1 +1,39 @@
1
- import e from"react";import{useEditorState as L}from"../hooks/useEditorState";import{useOpenApiValidation as T}from"../hooks/useOpenApiValidation";import{useFileOperations as W}from"../hooks/useFileOperations";import H from"./Layout/MainLayout";import J from"./Layout/FullPreviewLayout";function Y(){const[r,p]=e.useState(!1),[s,d]=e.useState(!1);e.useEffect(()=>p(!0),[]);const{value:o,setValue:u,validatedValue:w,setValidatedValue:C,setValidationErrors:c,setFileName:E,parsedErrors:F,hasStructErrors:a,hideWarnings:P,setHideWarnings:g}=L(),{definition:t,hasRenderedOnce:f,setHasRenderedOnce:V}=T({validatedValue:w,hasStructErrors:a}),m=e.useRef(null);e.useEffect(()=>{t&&(m.current=t)},[t]);const h=t||m.current,[v,D]=e.useState(null),n=W({setValue:u,setFileName:E,setHasRenderedOnce:V,setValidationErrors:c}),R=(i,l)=>{c(i),C(l)},O=(i,l)=>{D({line:i,column:l})},S=()=>n.handleDownloadYaml(o),k=()=>n.handleDownloadJson(o);return s?e.createElement(J,{definition:h,rawValue:o,hasRenderedOnce:f,hasStructErrors:a,onTemplateClick:n.handleTemplateClick,onFileLoad:n.handleFileLoad,onExitFullPreview:()=>d(!1),isClient:r}):e.createElement(H,{value:o,onChange:u,onValidationUpdate:R,hideWarnings:P,onHideWarningsChange:g,isFullPreview:s,gotoPosition:v,parsedErrors:F,onProblemClick:O,onFileLoad:n.handleFileLoad,onDownloadYaml:S,onDownloadJson:k,onToggleFullPreview:()=>d(!0),definition:h,rawValue:o,hasRenderedOnce:f,hasStructErrors:a,onTemplateClick:n.handleTemplateClick,isClient:r})}export{Y as default};
1
+ import e from"react";import m from"styled-components";import{useEditorState as S}from"../hooks/useEditorState";import{useOpenApiValidation as T}from"../hooks/useOpenApiValidation";import{useFileOperations as H}from"../hooks/useFileOperations";import{PanelGroup as W,PanelResizeHandle as G}from"react-resizable-panels";import J from"./Layout/PreviewLayout";import Y from"./Layout/EditorLayout";function I(){const[p,g]=e.useState(!1),[r,d]=e.useState(!1),l=e.useRef(null);e.useEffect(()=>g(!0),[]);const{value:a,setValue:c,validatedValue:v,setValidatedValue:u,setValidationErrors:t,setFileName:b,parsedErrors:w,hasStructErrors:h,hideWarnings:P,setHideWarnings:k}=S(),{definition:n,hasRenderedOnce:E,setHasRenderedOnce:C}=T({validatedValue:v,hasStructErrors:h}),f=e.useRef(null);e.useEffect(()=>{n&&(f.current=n)},[n]);const F=n||f.current,[y,z]=e.useState(null),o=H({setValue:c,setFileName:b,setHasRenderedOnce:C,setValidationErrors:t}),x=e.useCallback((i,s)=>{t(i),u(s)},[t,u]),R=e.useCallback((i,s)=>{z({line:i,column:s})},[]),V=e.useCallback(()=>o.handleDownloadYaml(a),[o,a]),D=e.useCallback(()=>o.handleDownloadJson(a),[o,a]),L=e.useCallback(()=>d(!0),[]),O=e.useCallback(()=>d(!1),[]);return e.useEffect(()=>{l.current&&(r?l.current.collapse():l.current.expand())},[r]),e.createElement(N,null,e.createElement(U,{direction:"horizontal"},e.createElement(Y,{ref:l,value:a,onChange:c,onValidationUpdate:x,hideWarnings:P,onHideWarningsChange:k,isFullPreview:r,gotoPosition:y,parsedErrors:w,onProblemClick:R,onFileLoad:o.handleFileLoad,onDownloadYaml:V,onDownloadJson:D,onToggleFullPreview:L}),e.createElement(G,{className:"resize-handle",style:{display:r?"none":"block"}}),e.createElement(J,{definition:F,rawValue:a,hasRenderedOnce:E,hasStructErrors:h,onTemplateClick:o.handleTemplateClick,onFileLoad:o.handleFileLoad,isClient:p,isFullPreview:r,onExitFullPreview:O})))}const N=m.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: calc(100vh - var(--navbar-height));
5
+
6
+ background-color: var(--bg-color);
7
+ color: var(--text-color-primary);
8
+
9
+ [data-component-name='Layout/PageLayout']:has(&) + div + footer {
10
+ display: none;
11
+ }
12
+ `,U=m(W)`
13
+ display: flex;
14
+ flex-grow: 1;
15
+ height: 100%;
16
+ overflow: visible;
17
+
18
+ .resize-handle {
19
+ width: 4px;
20
+ background-color: var(--border-color-primary);
21
+ cursor: col-resize;
22
+ transition: background-color 0.2s ease;
23
+ }
24
+
25
+ .resize-handle[data-resize-handle-state="hover"] {
26
+ background-color: var(--color-blue-4);
27
+ }
28
+
29
+ .resize-handle-horizontal {
30
+ height: 4px;
31
+ background-color: var(--border-color-primary);
32
+ cursor: row-resize;
33
+ transition: background-color 0.2s ease;
34
+ }
35
+
36
+ .resize-handle-horizontal[data-resize-handle-state="hover"] {
37
+ background-color: var(--color-blue-4);
38
+ }
39
+ `;export{I as default};
@@ -1,8 +1,8 @@
1
- import o,{useRef as c,useEffect as a}from"react";import u from"styled-components";const d=({definition:t,onIframeReady:s})=>{const l=c(null),r=c(null),[i,w]=o.useState(0);return a(()=>{const n=e=>{r.current=e,e.updateDefinition(t),s(e)};return window.onReady=n,()=>{delete window.onReady}},[t,s]),a(()=>{const n=e=>{e.data?.type==="scroll-to-operation"&&r.current&&r.current.postMessage(e.data,"*")};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[]),a(()=>{r.current&&t&&r.current.updateDefinition(t)},[t]),o.createElement(f,null,o.createElement(m,{key:i,ref:l,title:"API Documentation Preview",src:"/preview",onLoad:()=>{}}))};var y=d;const f=u.div`
1
+ import a,{useRef as i,useEffect as s}from"react";import u from"styled-components";const c=a.memo(({definition:e,onIframeReady:n})=>{const d=i(null),r=i(null),[l,p]=a.useState(0);return s(()=>{const o=t=>{r.current=t,t.updateDefinition(e),n(t)};return window.onReady=o,()=>{delete window.onReady}},[e,n]),s(()=>{const o=t=>{t.data?.type==="scroll-to-operation"&&r.current&&r.current.postMessage(t.data,"*")};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[]),s(()=>{r.current&&e&&r.current.updateDefinition(e)},[e]),a.createElement(f,null,a.createElement(m,{key:l,ref:d,title:"API Documentation Preview",src:"/preview",onLoad:()=>{}}))},(e,n)=>e.definition===n.definition);c.displayName="IframeContainer";var h=c;const f=u.div`
2
2
  height: 100%;
3
3
  overflow: hidden;
4
4
  `,m=u.iframe`
5
5
  width: 100%;
6
6
  height: 100%;
7
7
  border: none;
8
- `;export{y as default};
8
+ `;export{h as default};
@@ -1,20 +1,20 @@
1
- import e from"react";import t from"styled-components";import{Button as f}from"@redocly/theme/components/Button/Button";import{Tooltip as s}from"@redocly/theme/components/Tooltip/Tooltip";import{ViewOffIcon as d}from"@redocly/theme/icons/ViewOffIcon/ViewOffIcon";import l from"./ErrorOverlay";import E from"./IframeContainer";import u from"../EmptyState";const x=({definition:n,rawValue:o,hasStructErrors:r,onTemplateClick:m,onFileLoad:p,onExitFullPreview:i,onIframeReady:c})=>!o||typeof o!="string"||o.trim()===""?e.createElement(u,{onTemplateClick:m,onUploadClick:p}):n?e.createElement(a,null,e.createElement(l,{hasStructErrors:r}),i&&e.createElement(y,null,e.createElement(g,{tip:"Exit full preview mode",width:"fit-content",placement:"right"},e.createElement(f,{variant:"secondary",onClick:i,"aria-label":"Exit full preview",icon:e.createElement(d,null)}))),e.createElement(E,{definition:n,onIframeReady:c})):e.createElement(a,null,e.createElement(l,{hasStructErrors:r}),e.createElement(v,null,"Loading..."));var w=x;const a=t.div`
1
+ import e from"react";import t from"styled-components";import{Button as s}from"@redocly/theme/components/Button/Button";import{Tooltip as d}from"@redocly/theme/components/Tooltip/Tooltip";import{ViewOffIcon as E}from"@redocly/theme/icons/ViewOffIcon/ViewOffIcon";import l from"./ErrorOverlay";import u from"./IframeContainer";import y from"../EmptyState";const m=e.memo(({definition:n,rawValue:o,hasStructErrors:r,onTemplateClick:p,onFileLoad:c,onExitFullPreview:i,onIframeReady:f})=>!o||typeof o!="string"||o.trim()===""?e.createElement(y,{onTemplateClick:p,onUploadClick:c}):n?e.createElement(a,null,e.createElement(l,{hasStructErrors:r}),i&&e.createElement(v,null,e.createElement(x,{tip:"Exit full preview mode",width:"fit-content",placement:"right"},e.createElement(s,{variant:"secondary",onClick:i,"aria-label":"Exit full preview",icon:e.createElement(E,null)}))),e.createElement(u,{definition:n,onIframeReady:f})):e.createElement(a,null,e.createElement(l,{hasStructErrors:r}),e.createElement(g,null,"Loading...")));m.displayName="PreviewContent";var b=m;const a=t.div`
2
2
  position: relative;
3
3
  height: 100%;
4
- `,y=t.div`
4
+ `,v=t.div`
5
5
  position: absolute;
6
6
  top: 12px;
7
7
  left: 12px;
8
8
  z-index: 100;
9
- `,g=t(s)`
9
+ `,x=t(d)`
10
10
  [data-component-name='Tooltip/Tooltip'] {
11
11
  z-index: 101 !important;
12
12
  }
13
- `,v=t.div`
13
+ `,g=t.div`
14
14
  display: flex;
15
15
  align-items: center;
16
16
  justify-content: center;
17
17
  height: 100%;
18
18
  font-size: 14px;
19
19
  color: #666;
20
- `;export{w as default};
20
+ `;export{b as default};
@@ -7,6 +7,7 @@ interface PreviewPanelProps {
7
7
  onTemplateClick: () => void;
8
8
  onFileLoad: (content: string, fileName: string) => void;
9
9
  onExitFullPreview?: () => void;
10
+ isFullPreview?: boolean;
10
11
  }
11
12
  declare const PreviewPanel: React.FC<PreviewPanelProps>;
12
13
  export default PreviewPanel;
@@ -1 +1 @@
1
- import*as e from"react";import m from"./PreviewPanel/PreviewContent";const c=({definition:r,rawValue:a,hasStructErrors:t,onTemplateClick:o,onFileLoad:n,onExitFullPreview:i})=>{const l=e.useCallback(d=>{},[]);return e.createElement(m,{definition:r??"",rawValue:a,hasStructErrors:t,onTemplateClick:o,onFileLoad:n,onExitFullPreview:i,onIframeReady:l})};var s=c;export{s as default};
1
+ import*as e from"react";import f from"./PreviewPanel/PreviewContent";const a=e.memo(({definition:r,rawValue:n,hasStructErrors:o,onTemplateClick:t,onFileLoad:i,onExitFullPreview:l,isFullPreview:m})=>{const d=e.useCallback(c=>{},[]);return e.createElement(f,{definition:r??"",rawValue:n,hasStructErrors:o,onTemplateClick:t,onFileLoad:i,onExitFullPreview:m?l:void 0,onIframeReady:d})});a.displayName="PreviewPanel";var u=a;export{u as default};
@@ -1 +1 @@
1
- import{dump as c,load as e}from"js-yaml";import{downloadFile as s}from"../utils/download";import{defaultOpenapiTemplate as p}from"../templates/defaultOpenapiTemplate";function C(i){const{setValue:a,setFileName:d,setHasRenderedOnce:l,setValidationErrors:r}=i;return{handleFileLoad:(o,n)=>{a(o),d(n),l(!1),r([])},handleTemplateClick:()=>{a(p),l(!1),r([])},handleDownloadYaml:o=>{let n=o;try{if(o.trim().startsWith("{")){const t=JSON.parse(o);n=c(t)}else e(o),n=o}catch{try{e(o),n=o}catch{alert("Content is not valid JSON or YAML. Cannot convert to YAML for download.");return}}s(n,"openapi.yaml","application/x-yaml")},handleDownloadJson:o=>{try{const n=e(o);if(typeof n!="object"||n===null)throw new Error("Parsed content is not an object.");const t=JSON.stringify(n,null,2);s(t,"openapi.json","application/json")}catch{alert("Content is not valid YAML/JSON. Cannot convert to JSON for download.")}}}}export{C as useFileOperations};
1
+ import{dump as h,load as s}from"js-yaml";import{downloadFile as c}from"../utils/download";import{defaultOpenapiTemplate as j}from"../templates/defaultOpenapiTemplate";import{useCallback as l}from"react";function S(d){const{setValue:n,setFileName:i,setHasRenderedOnce:e,setValidationErrors:a}=d,p=l((o,t)=>{n(o),i(t),e(!1),a([])},[n,i,e,a]),m=l(()=>{n(j),e(!1),a([])},[n,e,a]),f=l(o=>{let t=o;try{if(o.trim().startsWith("{")){const r=JSON.parse(o);t=h(r)}else s(o),t=o}catch{try{s(o),t=o}catch{alert("Content is not valid JSON or YAML. Cannot convert to YAML for download.");return}}c(t,"openapi.yaml","application/x-yaml")},[]),O=l(o=>{try{const t=s(o);if(typeof t!="object"||t===null)throw new Error("Parsed content is not an object.");const r=JSON.stringify(t,null,2);c(r,"openapi.json","application/json")}catch{alert("Content is not valid YAML/JSON. Cannot convert to JSON for download.")}},[]);return{handleFileLoad:p,handleTemplateClick:m,handleDownloadYaml:f,handleDownloadJson:O}}export{S as useFileOperations};
@@ -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";function f(){const[t,i]=e.useState(null);return o({definition:t,safeSlugify:s}),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},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 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`
2
2
  --sidebar-width: 0px;
3
- `;export{f as default};
3
+ `;export{d as default};
@@ -1 +1 @@
1
- import{useEffect as a,useRef as i,useCallback as l}from"react";const d="manual",w=()=>{const e=i(null),n=l(r=>r.split(" ").filter(Boolean).find(t=>t==="light"||t==="dark")||"light",[]),u=l(()=>{try{return n(window.parent.document.documentElement.className)}catch{return"light"}},[n]);return a(()=>{const r=window.useColorSwitcher,c=(()=>{const t=n(document.documentElement.className);return t!=="light"?t:u()})();e.current=c,document.documentElement.className=c,window.useColorSwitcher=()=>({isSwitcherHidden:!0,initActiveColorMode:()=>{e.current&&(document.documentElement.className=e.current)},activeColorMode:e.current||"light"});const o=new MutationObserver(()=>{const t=document.documentElement.className,m=t.includes(d),s=n(t);if(m){e.current=s,document.documentElement.className=s;return}e.current&&s!==e.current&&(document.documentElement.className=e.current)});return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{o.disconnect(),r&&(window.useColorSwitcher=r)}},[u,n]),{preservedTheme:e.current}};export{w as useThemeManager};
1
+ import{useEffect as i,useRef as d,useCallback as a}from"react";const h="manual",f=()=>{const e=d(null),r=a(t=>t.split(" ").filter(Boolean).find(n=>n==="light"||n==="dark")||"light",[]),l=a(()=>{try{const t=window.parent.document.documentElement.className;return r(t)}catch{return"light"}},[r]);return i(()=>{const t=window.useColorSwitcher,s=(()=>{const c=r(document.documentElement.className),n=l();return c!=="light"?c:n})();e.current=s,document.documentElement.className=s,window.useColorSwitcher=()=>({isSwitcherHidden:!0,initActiveColorMode:()=>{e.current&&(document.documentElement.className=e.current)},activeColorMode:e.current||"light"});const o=new MutationObserver(c=>{const n=document.documentElement.className,m=n.includes(h),u=r(n);if(m){e.current=u,document.documentElement.className=u;return}e.current&&u!==e.current&&(document.documentElement.className=e.current)});return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{o.disconnect(),t&&(window.useColorSwitcher=t)}},[l,r]),{preservedTheme:e.current}};export{f as useThemeManager};
@@ -5,7 +5,6 @@ import t from"react";import n,{css as u}from"styled-components";import{linearGra
5
5
  margin-top: 48px;
6
6
 
7
7
  img {
8
- height: 100%;
9
8
  width: 100%;
10
9
  position: relative;
11
10
  align-self: flex-start;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/marketing-pages",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "keywords": [],
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- interface FullPreviewLayoutProps {
3
- definition: any | null;
4
- rawValue: string;
5
- hasRenderedOnce: boolean;
6
- hasStructErrors: boolean;
7
- onTemplateClick: () => void;
8
- onFileLoad: (content: string, fileName: string) => void;
9
- onExitFullPreview: () => void;
10
- isClient: boolean;
11
- }
12
- declare const FullPreviewLayout: React.FC<FullPreviewLayoutProps>;
13
- export default FullPreviewLayout;
@@ -1,5 +0,0 @@
1
- import e from"react";import m from"styled-components";import u from"../PreviewPanel";const d=({definition:r,rawValue:t,hasRenderedOnce:l,hasStructErrors:i,onTemplateClick:a,onFileLoad:n,onExitFullPreview:o,isClient:c})=>e.createElement(v,null,c&&e.createElement(u,{definition:r,rawValue:t,hasRenderedOnce:l,hasStructErrors:i,onTemplateClick:a,onFileLoad:n,onExitFullPreview:o}));var p=d;const v=m.div`
2
- display: flex;
3
- flex-direction: column;
4
- height: calc(100vh - var(--navbar-height));
5
- `;export{p as default};
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import type * as Monaco from 'monaco-editor/esm/vs/editor/editor.api';
3
- interface MainLayoutProps {
4
- value: string;
5
- onChange: (value: string | undefined) => void;
6
- onValidationUpdate: (errors: Monaco.editor.IMarkerData[], value: string | undefined) => void;
7
- hideWarnings: boolean;
8
- onHideWarningsChange: (hide: boolean) => void;
9
- isFullPreview: boolean;
10
- gotoPosition: {
11
- line: number;
12
- column: number;
13
- } | null;
14
- parsedErrors: Monaco.editor.IMarkerData[];
15
- onProblemClick: (line: number, column: number) => void;
16
- onFileLoad: (content: string, fileName: string) => void;
17
- onDownloadYaml: () => void;
18
- onDownloadJson: () => void;
19
- onToggleFullPreview: () => void;
20
- definition: any | null;
21
- rawValue: string;
22
- hasRenderedOnce: boolean;
23
- hasStructErrors: boolean;
24
- onTemplateClick: () => void;
25
- isClient: boolean;
26
- }
27
- declare const MainLayout: React.FC<MainLayoutProps>;
28
- export default MainLayout;
@@ -1,39 +0,0 @@
1
- import e from"react";import r from"styled-components";import{PanelGroup as w,PanelResizeHandle as P}from"react-resizable-panels";import k from"./EditorLayout";import x from"./PreviewLayout";const E=({value:a,onChange:n,onValidationUpdate:l,hideWarnings:i,onHideWarningsChange:t,isFullPreview:c,gotoPosition:s,parsedErrors:d,onProblemClick:h,onFileLoad:o,onDownloadYaml:u,onDownloadJson:m,onToggleFullPreview:g,definition:p,rawValue:v,hasRenderedOnce:b,hasStructErrors:f,onTemplateClick:z,isClient:y})=>e.createElement(C,null,e.createElement(L,{direction:"horizontal"},e.createElement(k,{value:a,onChange:n,onValidationUpdate:l,hideWarnings:i,onHideWarningsChange:t,isFullPreview:c,gotoPosition:s,parsedErrors:d,onProblemClick:h,onFileLoad:o,onDownloadYaml:u,onDownloadJson:m,onToggleFullPreview:g}),e.createElement(P,{className:"resize-handle"}),e.createElement(x,{definition:p,rawValue:v,hasRenderedOnce:b,hasStructErrors:f,onTemplateClick:z,onFileLoad:o,isClient:y})));var V=E;const C=r.div`
2
- display: flex;
3
- flex-direction: column;
4
- height: calc(100vh - var(--navbar-height));
5
-
6
- background-color: var(--bg-color);
7
- color: var(--text-color-primary);
8
-
9
- [data-component-name='Layout/PageLayout']:has(&) + div + footer {
10
- display: none;
11
- }
12
- `,L=r(w)`
13
- display: flex;
14
- flex-grow: 1;
15
- height: 100%;
16
- overflow: visible;
17
-
18
- .resize-handle {
19
- width: 4px;
20
- background-color: var(--border-color-primary);
21
- cursor: col-resize;
22
- transition: background-color 0.2s ease;
23
- }
24
-
25
- .resize-handle[data-resize-handle-state="hover"] {
26
- background-color: var(--color-blue-4);
27
- }
28
-
29
- .resize-handle-horizontal {
30
- height: 4px;
31
- background-color: var(--border-color-primary);
32
- cursor: row-resize;
33
- transition: background-color 0.2s ease;
34
- }
35
-
36
- .resize-handle-horizontal[data-resize-handle-state="hover"] {
37
- background-color: var(--color-blue-4);
38
- }
39
- `;export{V as default};