Skip to content

Commit 5bc800b

Browse files
Release v3.1.0
1 parent 4d3b134 commit 5bc800b

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

CHANGELOG.MD

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [3.1.0] - 2019-10-11
8+
### Changed
9+
- declare all dependencies as external to allow tree-shaking by consumers
10+
811
### Fixed
912
- declaration of ES module in package.json
1013
- provide CommonJS output as fall-back
@@ -89,7 +92,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8992
## [1.0.0] - 2019-03-03
9093
- initial implementation
9194

92-
[Unreleased]: https://github.com/CarstenWickner/react-jsonschema-inspector/compare/v3.0.0...HEAD
95+
[3.1.0]: https://github.com/CarstenWickner/react-jsonschema-inspector/compare/v3.0.0...v3.1.0
9396
[3.0.0]: https://github.com/CarstenWickner/react-jsonschema-inspector/compare/v2.3.0...v3.0.0
9497
[2.3.0]: https://github.com/CarstenWickner/react-jsonschema-inspector/compare/v2.2.0...v2.3.0
9598
[2.2.0]: https://github.com/CarstenWickner/react-jsonschema-inspector/compare/v2.1.0...v2.2.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-jsonschema-inspector",
3-
"version": "3.1.0-SNAPSHOT",
3+
"version": "3.1.0",
44
"description": "View component for traversing/searching in a JSON Schema",
55
"homepage": "https://CarstenWickner.github.io/react-jsonschema-inspector",
66
"author": "Carsten Wickner",

stories/Inspector.stories.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { action } from '@storybook/addon-actions';
2+
import { Meta, Preview, Story } from '@storybook/addon-docs/blocks';
3+
import "./style-overrides.css";
4+
5+
import { Inspector, getMaximumFieldValueFromSchemaGroup } from "../src/index";
6+
7+
import metaSchema from "./schema-meta.json";
8+
import hyperMetaSchema from "./schema-hyper-meta.json";
9+
import linksMetaSchema from "./schema-links-meta.json";
10+
11+
<Meta title='MDX|Inspector' component={Inspector} />
12+
13+
# Inspector
14+
15+
<Preview>
16+
<Story name="show-case">
17+
<Inspector
18+
schemas={{
19+
"Meta Core JSON Schema": { $ref: "http://json-schema.org/draft-07/schema#" },
20+
"Meta Hyper JSON Schema": { $ref: "http://json-schema.org/draft-07/hyper-schema#" },
21+
"Meta Links JSON Schema": { $ref: "http://json-schema.org/draft-07/links#" }
22+
}}
23+
referenceSchemas={[metaSchema, hyperMetaSchema, linksMetaSchema]}
24+
searchOptions={{
25+
fields: ["title", "description"],
26+
byPropertyName: true
27+
}}
28+
buildArrayProperties={(arrayItemSchema, arraySchemaGroup, optionIndexes) => ({
29+
"[0]": arrayItemSchema,
30+
length: {
31+
title: "Number of Items",
32+
type: "number",
33+
minimum: getMaximumFieldValueFromSchemaGroup(arraySchemaGroup, "minItems", 0, optionIndexes)
34+
}
35+
})}
36+
renderEmptyDetails={({ rootColumnSchemas }) => (
37+
<div style={{ padding: "0.5em 1em 0" }}>
38+
<h3>JSON Schema Inspector</h3>
39+
<p>
40+
{`Just click on one of the ${Object.keys(rootColumnSchemas).length} schema titles
41+
on the left side in order to traverse their nested properties
42+
– but don't get lost in the circular references.`}
43+
</p>
44+
<img
45+
src="https://raw.githubusercontent.com/CarstenWickner/react-jsonschema-inspector/master/logo.svg?sanitize=true"
46+
alt="JSON Schema Inspector Logo"
47+
style={{ width: "70%", margin: "0 15%" }}
48+
/>
49+
</div>
50+
)}
51+
onSelect={action("onSelect")}
52+
/>
53+
</Story>
54+
</Preview>

0 commit comments

Comments
 (0)