Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: asyncapi specification visualization integration #2898

Merged
merged 40 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4ad6eb7
.
AceTheCreator Jan 31, 2024
f5bab9e
Merge branch 'master' of https://github.com/AceTheCreator/website
AceTheCreator Mar 15, 2024
8d29596
Merge branch 'master' of https://github.com/AceTheCreator/website
AceTheCreator Apr 18, 2024
1930b68
adding schyma package
AceTheCreator Apr 22, 2024
6200f53
Merge branch 'master' of https://github.com/AceTheCreator/website
AceTheCreator Apr 22, 2024
a05f1f2
adding schyma for schema visualization
AceTheCreator Apr 22, 2024
8575e33
schema update
AceTheCreator Apr 22, 2024
fc1800e
Merge branch 'master' into schyma-package
quetzalliwrites May 9, 2024
a5f9b81
bumped schyma version
AceTheCreator May 17, 2024
b0c68e0
added visualizer to docs layout
AceTheCreator May 17, 2024
6d1bf78
properly rendering visualizer
AceTheCreator May 17, 2024
ebd212f
Merge branch 'master' into schyma-package
AceTheCreator May 17, 2024
d360965
Merge branch 'master' into schyma-package
quetzalliwrites May 18, 2024
95fef31
Merge branch 'master' into schyma-package
quetzalliwrites May 21, 2024
20e3cdf
added dos menu to explorer view
AceTheCreator May 21, 2024
d05540a
added explorer to bucket list
AceTheCreator May 21, 2024
30689b0
bumped schema version
AceTheCreator May 21, 2024
1dba92d
fix
AceTheCreator May 21, 2024
4a6d316
Merge branch 'master' into schyma-package
AceTheCreator May 22, 2024
1d65720
Merge branch 'master' of https://github.com/AceTheCreator/website int…
AceTheCreator May 29, 2024
f595309
updating branch to meet master branch
AceTheCreator May 29, 2024
3cb53ec
removed unused code
AceTheCreator May 29, 2024
6e2d4a1
fix type failure when passing schema
AceTheCreator May 29, 2024
f00a2b4
.
AceTheCreator May 29, 2024
5412403
fixed lint error
AceTheCreator May 29, 2024
f5954b6
Merge branch 'master' into schyma-package
AceTheCreator Jun 4, 2024
b48560d
added docsnavwrapper component
AceTheCreator Jun 12, 2024
5f6322a
Merge branch 'master' into schyma-package
AceTheCreator Jun 12, 2024
06845d3
Merge branch 'schyma-package' of https://github.com/AceTheCreator/web…
AceTheCreator Jun 12, 2024
b5f7874
fixed lint error
AceTheCreator Jun 12, 2024
07246c9
Trigger Lighthouse
akshatnema Jun 14, 2024
6dc4f9c
Merge branch 'master' into schyma-package
AceTheCreator Jun 18, 2024
e1c30cc
Merge branch 'master' into schyma-package
AceTheCreator Jun 21, 2024
46a1060
added metatag to the visualizer component
AceTheCreator Jun 21, 2024
ed128d6
type name change
AceTheCreator Jun 21, 2024
20edc50
Merge branch 'master' of https://github.com/AceTheCreator/website int…
AceTheCreator Jul 8, 2024
a59c172
added suggested
AceTheCreator Jul 8, 2024
838f249
.
AceTheCreator Jul 8, 2024
0cd60c6
Merge branch 'master' into schyma-package
akshatnema Jul 9, 2024
7c9a1ae
Merge branch 'master' into schyma-package
akshatnema Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/MDX/MDX.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Button from '../buttons/Button';
import ChapterSuggestions from '../buttons/ChapterSuggestions';
import Caption from '../Caption';
import DocsCards from '../docs/DocsCards';
import Visualizer from '../docs/Visualizer';
import CodeBlock from '../editor/CodeBlock';
import Figure from '../Figure';
import GeneratorInstallation from '../GeneratorInstallation';
Expand Down Expand Up @@ -324,7 +325,8 @@ export function getMDXComponents() {
TwitterDMButton,
TwitterVideoEmbed,
TwitterOnAirButton,
Profiles
Profiles,
Visualizer
};
}

Expand Down
10 changes: 10 additions & 0 deletions components/data/buckets.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import IconExplorer from '../icons/Explorer';
import IconGettingStarted from '../icons/GettingStarted';
import IconGuide from '../icons/Guide';
import IconMigration from '../icons/Migration';
Expand Down Expand Up @@ -87,6 +88,15 @@ export const buckets: Bucket[] = [
borderClassName: 'border-orange-200',
href: '/docs/community',
icon: IconUsers
},
{
name: 'Explorer',
title: 'Specification Explorer',
description: 'Simplifying our Specification JSON Schema like a pro.',
link: '/docs/reference/specification/v3.0.0-Explorer',
className: 'bg-teal-200',
borderClassName: 'border-orange-200',
icon: IconExplorer
}
].map((bucket) => {
return {
Expand Down
26 changes: 26 additions & 0 deletions components/docs/Visualizer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'schyma/dist/esm/style.css';

import type { JSONSchema7Object } from 'json-schema';
import React from 'react';
import Schyma from 'schyma';

import schema from '../../config/3.0.0.json';

const typeSchema = schema as unknown as JSONSchema7Object;

/**
* @description This component renders the spec explorer.
*/
function Visualizer() {
return (
<div>
<Schyma
title='AsyncAPI Specification'
description="The AsyncAPI Specification defines a set of fields that can be used in an AsyncAPI document to describe an application's API. The document may reference other files for additional details or shared fields, but it is typically a single, primary document that encapsulates the API description."
schema={typeSchema}
/>
</div>
);
}

export default Visualizer;
10 changes: 10 additions & 0 deletions components/icons/CenterMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @description Icons for asyncapi website
*/
export default function IconMenuCenter({ className = '' }) {
return (
<svg fill='#000000' width='800px' height='800px' viewBox='-5 -7 24 24' className={className}>
<path d='M3 0h8a1 1 0 0 1 0 2H3a1 1 0 1 1 0-2zm0 8h8a1 1 0 0 1 0 2H3a1 1 0 1 1 0-2zM1 4h12a1 1 0 0 1 0 2H1a1 1 0 1 1 0-2z' />
</svg>
);
}
27 changes: 27 additions & 0 deletions components/icons/Explorer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @description Icons for asyncapi website
*/
export default function IconExplorer({ className = '' }) {
return (
<svg
fill='#000000'
className={className}
width='35px'
height='35px'
viewBox='-2.4 -2.4 28.80 28.80'
stroke='#000000'
strokeWidth='0.1'
transform='matrix(1, 0, 0, 1, 0, 0)rotate(0)'
>
<g id='SVGRepo_bgCarrier' strokeWidth='0'></g>
<g
id='SVGRepo_tracerCarrier'
strokeLinecap='round'
strokeLinejoin='round'
stroke='#CCCCCC'
strokeWidth='0.384'
></g>
<path d='M6,6H4A1,1,0,0,1,4,4H6V2A1,1,0,0,1,8,2V4h2a1,1,0,0,1,0,2H8V8A1,1,0,0,1,6,8Zm15,4v4a1,1,0,0,1-1,1H16a1,1,0,0,1-1-1V13H8v6h7V18a1,1,0,0,1,1-1h4a1,1,0,0,1,1,1v4a1,1,0,0,1-1,1H16a1,1,0,0,1-1-1V21H7a1,1,0,0,1-1-1V12a1,1,0,0,1,1-1h8V10a1,1,0,0,1,1-1h4A1,1,0,0,1,21,10ZM17,21h2V19H17Zm2-10H17v2h2Z'></path>
</svg>
);
}
Loading
Loading