Skip to content

Commit e16d4b7

Browse files
committed
Use fork of stoplight and fixup content descriptor formatting
1 parent 55e849c commit e16d4b7

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"@rjsf/core": "^5.6.2",
2121
"@rjsf/utils": "^5.6.2",
2222
"@rjsf/validator-ajv8": "^5.6.2",
23-
"@stoplight/json-schema-viewer": "^4.9.0",
2423
"@stoplight/markdown-viewer": "^5",
2524
"@stoplight/mosaic": "^1.32",
2625
"@stoplight/mosaic-code-viewer": "^1.32",
@@ -29,6 +28,7 @@
2928
"jest-transform-css": "^2.0.0",
3029
"json-schema": "^0.2.3",
3130
"lodash": "^4.17.15",
31+
"mm-json-schema-viewer": "^0.0.1",
3232
"qs": "^6.11.1",
3333
"react-markdown": "^8.0.7",
3434
"react-syntax-highlighter": "^15.4.3"

src/ContentDescriptor/ContentDescriptor.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import ReactMarkdown from "react-markdown";
44
import { ContentDescriptorObject } from "@open-rpc/meta-schema";
55
import "./ContentDescriptor.css";
66
import MarkdownDescription from "../MarkdownDescription/MarkdownDescription";
7-
import { JsonSchemaViewer } from "@stoplight/json-schema-viewer";
8-
7+
import { JsonSchemaViewer } from "mm-json-schema-viewer/dist/index";
98

109
interface IProps {
1110
contentDescriptor?: ContentDescriptorObject;
@@ -20,21 +19,20 @@ class ContentDescriptor extends Component<IProps> {
2019
const entries = Object.entries(contentDescriptor);
2120
if (entries.length === 0) { return null; }
2221
return (
23-
<>
22+
<div style={{ paddingLeft: 'var(--ifm-list-left-padding)' }}>
2423
{contentDescriptor.description &&
2524
<MarkdownDescription
2625
uiSchema={uiSchema}
2726
source={contentDescriptor.description}
2827
className="content-descriptor-description"
2928
/>
3029
}
31-
<h4 style={{marginBottom: "0px"}}>Schema:</h4>
3230
{contentDescriptor.schema &&
3331
<JsonSchemaViewer
3432
schema={contentDescriptor.schema}
3533
/>
3634
}
37-
</>
35+
</div>
3836
);
3937

4038
/* return (

yarn.lock

+14-14
Original file line numberDiff line numberDiff line change
@@ -859,20 +859,6 @@
859859
"@types/json-schema" "^7.0.7"
860860
magic-error "0.0.1"
861861

862-
"@stoplight/json-schema-viewer@^4.9.0":
863-
version "4.9.0"
864-
resolved "https://registry.yarnpkg.com/@stoplight/json-schema-viewer/-/json-schema-viewer-4.9.0.tgz#3009e6a9af77756017f48ea3f1ee3e3012f63da0"
865-
integrity sha512-xuOt1FFeFxiy/bJrD0++9rjKY0NlaxH7y6jDZGCMGmH0y2vykpC2ZbHji+ol7/rB5TvVp7oE0NwlpK8TVizinw==
866-
dependencies:
867-
"@stoplight/json" "^3.20.1"
868-
"@stoplight/json-schema-tree" "^2.2.2"
869-
"@stoplight/react-error-boundary" "^2.0.0"
870-
"@types/json-schema" "^7.0.7"
871-
classnames "^2.2.6"
872-
fnv-plus "^1.3.1"
873-
jotai "^1.4.5"
874-
lodash "^4.17.19"
875-
876862
"@stoplight/json@^3.12.0", "@stoplight/json@^3.20.1":
877863
version "3.20.2"
878864
resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.20.2.tgz#466ba5c6381cfd141f1726439442fbd579804c8e"
@@ -3800,6 +3786,20 @@ mkdirp@^0.5.1:
38003786
dependencies:
38013787
minimist "^1.2.6"
38023788

3789+
mm-json-schema-viewer@^0.0.1:
3790+
version "0.0.1"
3791+
resolved "https://registry.yarnpkg.com/mm-json-schema-viewer/-/mm-json-schema-viewer-0.0.1.tgz#995b60f211ecfeee604fa24cc965340a251f8ad3"
3792+
integrity sha512-Nmly2cwMyIxNIBEPO7Bu9TzcdeuL0gj3ogfB+SWZPGjiXqwHBphMHkR2uPgnL+RPDycs6bS8j/qXDkMN8FYWPw==
3793+
dependencies:
3794+
"@stoplight/json" "^3.20.1"
3795+
"@stoplight/json-schema-tree" "^2.2.2"
3796+
"@stoplight/react-error-boundary" "^2.0.0"
3797+
"@types/json-schema" "^7.0.7"
3798+
classnames "^2.2.6"
3799+
fnv-plus "^1.3.1"
3800+
jotai "^1.4.5"
3801+
lodash "^4.17.19"
3802+
38033803
mri@^1.1.0:
38043804
version "1.2.0"
38053805
resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"

0 commit comments

Comments
 (0)