shinkansen-engine 1.0.50 → 1.0.53
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.
- package/README.md +103 -2
- package/docs/array.md +232 -0
- package/docs/boolean.md +25 -0
- package/docs/images/array-array-boolean-all-of.png +0 -0
- package/docs/images/array-array-boolean-any-of.png +0 -0
- package/docs/images/array-array-boolean-enum.png +0 -0
- package/docs/images/array-array-boolean-one-of.png +0 -0
- package/docs/images/array-array-boolean.png +0 -0
- package/docs/images/array-array-null-all-of.png +0 -0
- package/docs/images/array-array-null-any-of.png +0 -0
- package/docs/images/array-array-null-enum.png +0 -0
- package/docs/images/array-array-null-one-of.png +0 -0
- package/docs/images/array-array-null.png +0 -0
- package/docs/images/array-array-number-all-of.png +0 -0
- package/docs/images/array-array-number-any-of.png +0 -0
- package/docs/images/array-array-number-enum.png +0 -0
- package/docs/images/array-array-number-one-of.png +0 -0
- package/docs/images/array-array-number.png +0 -0
- package/docs/images/array-array-string-all-of.png +0 -0
- package/docs/images/array-array-string-any-of.png +0 -0
- package/docs/images/array-array-string-enum.png +0 -0
- package/docs/images/array-array-string-one-of.png +0 -0
- package/docs/images/array-array-string.png +0 -0
- package/docs/images/array-object-boolean-all-of.png +0 -0
- package/docs/images/array-object-boolean-any-of.png +0 -0
- package/docs/images/array-object-boolean-enum.png +0 -0
- package/docs/images/array-object-boolean-one-of.png +0 -0
- package/docs/images/array-object-boolean.png +0 -0
- package/docs/images/array-object-null-all-of.png +0 -0
- package/docs/images/array-object-null-any-of.png +0 -0
- package/docs/images/array-object-null-enum.png +0 -0
- package/docs/images/array-object-null-one-of.png +0 -0
- package/docs/images/array-object-null.png +0 -0
- package/docs/images/array-object-number-all-of.png +0 -0
- package/docs/images/array-object-number-any-of.png +0 -0
- package/docs/images/array-object-number-enum.png +0 -0
- package/docs/images/array-object-number-one-of.png +0 -0
- package/docs/images/array-object-number.png +0 -0
- package/docs/images/array-object-string-all-of.png +0 -0
- package/docs/images/array-object-string-any-of.png +0 -0
- package/docs/images/array-object-string-enum.png +0 -0
- package/docs/images/array-object-string-one-of.png +0 -0
- package/docs/images/array-object-string.png +0 -0
- package/docs/images/boolean-all-of.png +0 -0
- package/docs/images/boolean-any-of.png +0 -0
- package/docs/images/boolean-enum.png +0 -0
- package/docs/images/boolean-one-of.png +0 -0
- package/docs/images/boolean.png +0 -0
- package/docs/images/null-all-of.png +0 -0
- package/docs/images/null-any-of.png +0 -0
- package/docs/images/null-enum.png +0 -0
- package/docs/images/null-one-of.png +0 -0
- package/docs/images/null.png +0 -0
- package/docs/images/number-all-of.png +0 -0
- package/docs/images/number-any-of.png +0 -0
- package/docs/images/number-enum.png +0 -0
- package/docs/images/number-one-of.png +0 -0
- package/docs/images/number.png +0 -0
- package/docs/images/object-boolean-all-of.png +0 -0
- package/docs/images/object-boolean-any-of.png +0 -0
- package/docs/images/object-boolean-enum.png +0 -0
- package/docs/images/object-boolean-one-of.png +0 -0
- package/docs/images/object-boolean.png +0 -0
- package/docs/images/object-null-all-of.png +0 -0
- package/docs/images/object-null-any-of.png +0 -0
- package/docs/images/object-null-enum.png +0 -0
- package/docs/images/object-null-one-of.png +0 -0
- package/docs/images/object-null.png +0 -0
- package/docs/images/object-number-all-of.png +0 -0
- package/docs/images/object-number-any-of.png +0 -0
- package/docs/images/object-number-enum.png +0 -0
- package/docs/images/object-number-one-of.png +0 -0
- package/docs/images/object-number.png +0 -0
- package/docs/images/object-string-all-of.png +0 -0
- package/docs/images/object-string-any-of.png +0 -0
- package/docs/images/object-string-enum.png +0 -0
- package/docs/images/object-string-one-of.png +0 -0
- package/docs/images/object-string.png +0 -0
- package/docs/images/string-all-of.png +0 -0
- package/docs/images/string-any-of.png +0 -0
- package/docs/images/string-enum.png +0 -0
- package/docs/images/string-one-of.png +0 -0
- package/docs/images/string.png +0 -0
- package/docs/null.md +25 -0
- package/docs/number.md +25 -0
- package/docs/object.md +116 -0
- package/docs/string.md +25 -0
- package/package.json +1 -1
- package/src/engine/index.jsx +6 -1
- package/src/index.cjs +2 -2
- package/src/index.d.cts +57 -0
- package/src/index.mjs +10 -8
- package/src/transformers/pinion/index.mjs +9 -0
package/README.md
CHANGED
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
## `shinkansen-engine`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
_Shinkansen_ generates JSON Schema valid documents from user submissions with `<html />` forms.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# Engine
|
|
6
|
+
|
|
7
|
+
_Engine_ renders React layouts with `<html />` form field and group elements, as well as optional navigation components, using [_Pinion_](https://github.com/modernpoacher/shinkansen-pinion), [_Gears_](https://github.com/modernpoacher/shinkansen-gears) and [_Transmission_](https://github.com/modernpoacher/shinkansen-transmission).
|
|
8
|
+
|
|
9
|
+
Layouts can be produced from a JSON Schema transformed into the Zashiki description format. The user submission generated by the layout will be valid according to that JSON Schema.
|
|
10
|
+
|
|
11
|
+
## Storybook
|
|
12
|
+
|
|
13
|
+
We use [Storybook](https://storybook.js.org/) to present React layouts and components.
|
|
14
|
+
|
|
15
|
+
Our Stories contain _single-value_ components for development. (Layouts for production are composed of one or several components.)
|
|
16
|
+
|
|
17
|
+
Typically, these render with an `<input />` element, but under _Controls_ you can see how a _choice_ can be captured with `<radio />` or `<select />` elements.
|
|
18
|
+
|
|
19
|
+
### String values
|
|
20
|
+
|
|
21
|
+
- [String](docs/string.md#1-string)
|
|
22
|
+
- [String (_Enum_)](docs/string.md#1---1-string-enum)
|
|
23
|
+
- [String (_Any of_)](docs/string.md#1---2-string-any-of)
|
|
24
|
+
- [String (_One of_)](docs/string.md#1---3-string-one-of)
|
|
25
|
+
|
|
26
|
+
### Number values
|
|
27
|
+
|
|
28
|
+
- [Number](docs/number.md#2-number)
|
|
29
|
+
- [Number (_Enum_)](docs/number.md#2---1-number-enum)
|
|
30
|
+
- [Number (_Any of_)](docs/number.md#2---2-number-any-of)
|
|
31
|
+
- [Number (_One of_)](docs/number.md#2---3-number-one-of)
|
|
32
|
+
|
|
33
|
+
### [Array](docs/array.md#3-array) values
|
|
34
|
+
|
|
35
|
+
Whether _items is an object_ or _items is an array_ depends on how Zashiki interprets the JSON Schema (assuming that Zashiki has mechanically translated a JSON Schema into a description, and the description hasn't been generated manually). It matters for validating the _document_ according to the _schema_, but for humans the distinction may seem arbitrary. Our stories account for both structures.
|
|
36
|
+
|
|
37
|
+
#### Array (_Items is an object_)
|
|
38
|
+
|
|
39
|
+
- [String](docs/array.md#3---1---1-array-items-is-an-object---string)
|
|
40
|
+
- [String (_Enum_)](docs/array.md#3---1---1---1-array-items-is-an-object---string-enum)
|
|
41
|
+
- [String (_Any of_)](docs/array.md#3---1---1---2-array-items-is-an-object---string-any-of)
|
|
42
|
+
- [String (_One of_)](docs/array.md#3---1---1---3-array-items-is-an-object---string-one-of)
|
|
43
|
+
- [Number](docs/array.md#3---1---2-array-items-is-an-object---number)
|
|
44
|
+
- [Number (_Enum_)](docs/array.md#3---1---2---1-array-items-is-an-object---number-enum)
|
|
45
|
+
- [Number (_Any of_)](docs/array.md#3---1---2---2-array-items-is-an-object---number-any-of)
|
|
46
|
+
- [Number (_One of_)](docs/array.md#3---1---2---3-array-items-is-an-object---number-one-of)
|
|
47
|
+
- [Boolean](docs/array.md#3---1---3-array-items-is-an-object---boolean)
|
|
48
|
+
- [Boolean (_Enum_)](docs/array.md#3---1---3---1-array-items-is-an-object---boolean-enum)
|
|
49
|
+
- [Boolean (_Any of_)](docs/array.md#3---1---3---2-array-items-is-an-object---boolean-any-of)
|
|
50
|
+
- [Boolean (_One of_)](docs/array.md#3---1---3---3-array-items-is-an-object---boolean-one-of)
|
|
51
|
+
- [Null](docs/array.md#3---1---4-array-items-is-an-object---null)
|
|
52
|
+
- [Null (_Enum_)](docs/array.md#3---1---4---1-array-items-is-an-object---null-enum)
|
|
53
|
+
- [Null (_Any of_)](docs/array.md#3---1---4---2-array-items-is-an-object---null-any-of)
|
|
54
|
+
- [Null (_One of_)](docs/array.md#3---1---4---3-array-items-is-an-object---null-one-of)
|
|
55
|
+
|
|
56
|
+
#### Array (_Items is an array_)
|
|
57
|
+
|
|
58
|
+
- [String](docs/array.md#3---2---1-array-items-is-an-array---string)
|
|
59
|
+
- [String (_Enum_)](docs/array.md#3---2---1---1-array-items-is-an-array---string-enum)
|
|
60
|
+
- [String (_Any of_)](docs/array.md#3---2---1---2-array-items-is-an-array---string-any-of)
|
|
61
|
+
- [String (_One of_)](docs/array.md#3---2---1---3-array-items-is-an-array---string-one-of)
|
|
62
|
+
- [Number](docs/array.md#3---2---2-array-items-is-an-array---number)
|
|
63
|
+
- [Number (_Enum_)](docs/array.md#3---2---2---1-array-items-is-an-array---number-enum)
|
|
64
|
+
- [Number (_Any of_)](docs/array.md#3---2---2---2-array-items-is-an-array---number-any-of)
|
|
65
|
+
- [Number (_One of_)](docs/array.md#3---2---2---3-array-items-is-an-array---number-one-of)
|
|
66
|
+
- [Boolean](docs/array.md#3---2---3-array-items-is-an-array---boolean)
|
|
67
|
+
- [Boolean (_Enum_)](docs/array.md#3---2---3---1-array-items-is-an-array---boolean-enum)
|
|
68
|
+
- [Boolean (_Any of_)](docs/array.md#3---2---3---2-array-items-is-an-array---boolean-any-of)
|
|
69
|
+
- [Boolean (_One of_)](docs/array.md#3---2---3---3-array-items-is-an-array---boolean-one-of)
|
|
70
|
+
- [Null](docs/array.md#3---2---4-array-items-is-an-array---null)
|
|
71
|
+
- [Null (_Enum_)](docs/array.md#3---2---4---1-array-items-is-an-array---null-enum)
|
|
72
|
+
- [Null (_Any of_)](docs/array.md#3---2---4---2-array-items-is-an-array---null-any-of)
|
|
73
|
+
- [Null (_One of_)](docs/array.md#3---2---4---3-array-items-is-an-array---null-one-of)
|
|
74
|
+
|
|
75
|
+
### [Object](docs/object.md#4-object) values
|
|
76
|
+
|
|
77
|
+
- [Object - String](docs/object.md#4---1-object---string)
|
|
78
|
+
- [Object - String (_Enum_)](docs/object.md#4---1---1-object---string-enum)
|
|
79
|
+
- [Object - String (_Any of_)](docs/object.md#4---1---2-object---string-any-of)
|
|
80
|
+
- [Object - String (_One of_)](docs/object.md#4---1---3-object---string-one-of)
|
|
81
|
+
- [Object - Number](docs/object.md#4---2-object---number)
|
|
82
|
+
- [Object - Number (_Enum_)](docs/object.md#4---2---1-object---number-enum)
|
|
83
|
+
- [Object - Number (_Any of_)](docs/object.md#4---2---2-object---number-any-of)
|
|
84
|
+
- [Object - Number (_One of_)](docs/object.md#4---2---3-object---number-one-of)
|
|
85
|
+
- [Object - Boolean](docs/object.md#4---3-object---boolean)
|
|
86
|
+
- [Object - Boolean (_Enum_)](docs/object.md#4---3---1-object---boolean-enum)
|
|
87
|
+
- [Object - Boolean (_Any of_)](docs/object.md#4---3---2-object---boolean-any-of)
|
|
88
|
+
- [Object - Boolean (_One of_)](docs/object.md#4---3---3-object---boolean-one-of)
|
|
89
|
+
- [Object - Null](docs/object.md#4---4-object---null)
|
|
90
|
+
- [Object - Null (_Enum_)](docs/object.md#4---4---1-object---null-enum)
|
|
91
|
+
- [Object - Null (_Any of_)](docs/object.md#4---4---2-object---null-any-of)
|
|
92
|
+
- [Object - Null (_One of_)](docs/object.md#4---4---3-object---null-one-of)
|
|
93
|
+
|
|
94
|
+
### Boolean values
|
|
95
|
+
|
|
96
|
+
- [Boolean](docs/boolean.md#5-boolean)
|
|
97
|
+
- [Boolean (_Enum_)](docs/boolean.md#5---1-boolean-enum)
|
|
98
|
+
- [Boolean (_Any of_)](docs/boolean.md#5---2-boolean-any-of)
|
|
99
|
+
- [Boolean (_One of_)](docs/boolean.md#5---3-boolean-one-of)
|
|
100
|
+
|
|
101
|
+
### Null values
|
|
102
|
+
|
|
103
|
+
- [Null](docs/null.md#6-null)
|
|
104
|
+
- [Null (_Enum_)](docs/null.md#6---1-null-enum)
|
|
105
|
+
- [Null (_Any of_)](docs/null.md#6---2-null-any-of)
|
|
106
|
+
- [Null (_One of_)](docs/null.md#6---3-null-one-of)
|
package/docs/array.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
|
|
2
|
+
## 3. Array
|
|
3
|
+
|
|
4
|
+
Arrays contain _one_ or _several_ values, which can be any type (including other arrays). Our Stories contain _single-value_ layouts which you can explore under _Controls_.
|
|
5
|
+
|
|
6
|
+
Whether _items is an object_ or _items is an array_ depends on how Zashiki interprets the JSON Schema (assuming that Zashiki has mechanically translated a JSON Schema into a description, and the description hasn't been generated manually). It matters for validating the _document_ according to the _schema_, but for humans the distinction may seem arbitrary. Our stories account for both structures.
|
|
7
|
+
|
|
8
|
+
### Array (_Items is an object_)
|
|
9
|
+
|
|
10
|
+
- [String](#3---1---1-array-items-is-an-object---string)
|
|
11
|
+
- [String (_Enum_)](#3---1---1---1-array-items-is-an-object---string-enum)
|
|
12
|
+
- [String (_Any of_)](#3---1---1---2-array-items-is-an-object---string-any-of)
|
|
13
|
+
- [String (_One of_)](#3---1---1---3-array-items-is-an-object---string-one-of)
|
|
14
|
+
- [Number](#3---1---2-array-items-is-an-object---number)
|
|
15
|
+
- [Number (_Enum_)](#3---1---2---1-array-items-is-an-object---number-enum)
|
|
16
|
+
- [Number (_Any of_)](#3---1---2---2-array-items-is-an-object---number-any-of)
|
|
17
|
+
- [Number (_One of_)](#3---1---2---3-array-items-is-an-object---number-one-of)
|
|
18
|
+
- [Boolean](#3---1---3-array-items-is-an-object---boolean)
|
|
19
|
+
- [Boolean (_Enum_)](#3---1---3---1-array-items-is-an-object---boolean-enum)
|
|
20
|
+
- [Boolean (_Any of_)](#3---1---3---2-array-items-is-an-object---boolean-any-of)
|
|
21
|
+
- [Boolean (_One of_)](#3---1---3---3-array-items-is-an-object---boolean-one-of)
|
|
22
|
+
- [Null](#3---1---4-array-items-is-an-object---null)
|
|
23
|
+
- [Null (_Enum_)](#3---1---4---1-array-items-is-an-object---null-enum)
|
|
24
|
+
- [Null (_Any of_)](#3---1---4---2-array-items-is-an-object---null-any-of)
|
|
25
|
+
- [Null (_One of_)](#3---1---4---3-array-items-is-an-object---null-one-of)
|
|
26
|
+
|
|
27
|
+
### Array (_Items is an array_)
|
|
28
|
+
|
|
29
|
+
- [String](#3---2---1-array-items-is-an-array---string)
|
|
30
|
+
- [String (_Enum_)](#3---2---1---1-array-items-is-an-array---string-enum)
|
|
31
|
+
- [String (_Any of_)](#3---2---1---2-array-items-is-an-array---string-any-of)
|
|
32
|
+
- [String (_One of_)](#3---2---1---3-array-items-is-an-array---string-one-of)
|
|
33
|
+
- [Number](#3---2---2-array-items-is-an-array---number)
|
|
34
|
+
- [Number (_Enum_)](#3---2---2---1-array-items-is-an-array---number-enum)
|
|
35
|
+
- [Number (_Any of_)](#3---2---2---2-array-items-is-an-array---number-any-of)
|
|
36
|
+
- [Number (_One of_)](#3---2---2---3-array-items-is-an-array---number-one-of)
|
|
37
|
+
- [Boolean](#3---2---3-array-items-is-an-array---boolean)
|
|
38
|
+
- [Boolean (_Enum_)](#3---2---3---1-array-items-is-an-array---boolean-enum)
|
|
39
|
+
- [Boolean (_Any of_)](#3---2---3---2-array-items-is-an-array---boolean-any-of)
|
|
40
|
+
- [Boolean (_One of_)](#3---2---3---3-array-items-is-an-array---boolean-one-of)
|
|
41
|
+
- [Null](#3---2---4-array-items-is-an-array---null)
|
|
42
|
+
- [Null (_Enum_)](#3---2---4---1-array-items-is-an-array---null-enum)
|
|
43
|
+
- [Null (_Any of_)](#3---2---4---2-array-items-is-an-array---null-any-of)
|
|
44
|
+
- [Null (_One of_)](#3---2---4---3-array-items-is-an-array---null-one-of)
|
|
45
|
+
|
|
46
|
+
### 3 - 1 - 1. Array (_Items is an object_) - String
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
_Back to [Array](#3-array)_
|
|
51
|
+
|
|
52
|
+
### 3 - 1 - 1 - 1. Array (_Items is an object_) - String (_Enum_)
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
_Back to [Array](#3-array)_
|
|
57
|
+
|
|
58
|
+
### 3 - 1 - 1 - 2. Array (_Items is an object_) - String (_Any Of_)
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
_Back to [Array](#3-array)_
|
|
63
|
+
|
|
64
|
+
### 3 - 1 - 1 - 3. Array (_Items is an object_) - String (_One Of_)
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
### 3 - 1 - 2. Array (_Items is an object_) - Number
|
|
69
|
+
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
_Back to [Array](#3-array)_
|
|
73
|
+
|
|
74
|
+
### 3 - 1 - 2 - 1. Array (_Items is an object_) - Number (_Enum_)
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
_Back to [Array](#3-array)_
|
|
79
|
+
|
|
80
|
+
### 3 - 1 - 2 - 2. Array (_Items is an object_) - Number (_Any Of_)
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
_Back to [Array](#3-array)_
|
|
85
|
+
|
|
86
|
+
### 3 - 1 - 2 - 3. Array (_Items is an object_) - Number (_One Of_)
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
_Back to [Array](#3-array)_
|
|
91
|
+
|
|
92
|
+
### 3 - 1 - 3. Array (_Items is an object_) - Boolean
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
_Back to [Array](#3-array)_
|
|
97
|
+
|
|
98
|
+
### 3 - 1 - 3 - 1. Array (_Items is an object_) - Boolean (_Enum_)
|
|
99
|
+
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+
_Back to [Array](#3-array)_
|
|
103
|
+
|
|
104
|
+
### 3 - 1 - 3 - 2. Array (_Items is an object_) - Boolean (_Any Of_)
|
|
105
|
+
|
|
106
|
+

|
|
107
|
+
|
|
108
|
+
_Back to [Array](#3-array)_
|
|
109
|
+
|
|
110
|
+
### 3 - 1 - 3 - 3. Array (_Items is an object_) - Boolean (_One Of_)
|
|
111
|
+
|
|
112
|
+

|
|
113
|
+
|
|
114
|
+
_Back to [Array](#3-array)_
|
|
115
|
+
|
|
116
|
+
### 3 - 1 - 4. Array (_Items is an object_) - Null
|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+
_Back to [Array](#3-array)_
|
|
121
|
+
|
|
122
|
+
### 3 - 1 - 4 - 1. Array (_Items is an object_) - Null (_Enum_)
|
|
123
|
+
|
|
124
|
+

|
|
125
|
+
|
|
126
|
+
_Back to [Array](#3-array)_
|
|
127
|
+
|
|
128
|
+
### 3 - 1 - 4 - 2. Array (_Items is an object_) - Null (_Any Of_)
|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+
_Back to [Array](#3-array)_
|
|
133
|
+
|
|
134
|
+
### 3 - 1 - 4 - 3. Array (_Items is an object_) - Null (_One Of_)
|
|
135
|
+
|
|
136
|
+

|
|
137
|
+
|
|
138
|
+
_Back to [Array](#3-array)_
|
|
139
|
+
|
|
140
|
+
### 3 - 2 - 1. Array (_Items is an array_) - String
|
|
141
|
+
|
|
142
|
+

|
|
143
|
+
|
|
144
|
+
_Back to [Array](#3-array)_
|
|
145
|
+
|
|
146
|
+
### 3 - 2 - 1 - 1. Array (_Items is an array_) - String (_Enum_)
|
|
147
|
+
|
|
148
|
+

|
|
149
|
+
|
|
150
|
+
_Back to [Array](#3-array)_
|
|
151
|
+
|
|
152
|
+
### 3 - 2 - 1 - 2. Array (_Items is an array_) - String (_Any Of_)
|
|
153
|
+
|
|
154
|
+

|
|
155
|
+
|
|
156
|
+
_Back to [Array](#3-array)_
|
|
157
|
+
|
|
158
|
+
### 3 - 2 - 1 - 3. Array (_Items is an array_) - String (_One Of_)
|
|
159
|
+
|
|
160
|
+

|
|
161
|
+
|
|
162
|
+
### 3 - 2 - 2. Array (_Items is an array_) - Number
|
|
163
|
+
|
|
164
|
+

|
|
165
|
+
|
|
166
|
+
_Back to [Array](#3-array)_
|
|
167
|
+
|
|
168
|
+
### 3 - 2 - 2 - 1. Array (_Items is an array_) - Number (_Enum_)
|
|
169
|
+
|
|
170
|
+

|
|
171
|
+
|
|
172
|
+
_Back to [Array](#3-array)_
|
|
173
|
+
|
|
174
|
+
### 3 - 2 - 2 - 2. Array (_Items is an array_) - Number (_Any Of_)
|
|
175
|
+
|
|
176
|
+

|
|
177
|
+
|
|
178
|
+
_Back to [Array](#3-array)_
|
|
179
|
+
|
|
180
|
+
### 3 - 2 - 2 - 3. Array (_Items is an array_) - Number (_One Of_)
|
|
181
|
+
|
|
182
|
+

|
|
183
|
+
|
|
184
|
+
_Back to [Array](#3-array)_
|
|
185
|
+
|
|
186
|
+
### 3 - 2 - 3. Array (_Items is an array_) - Boolean
|
|
187
|
+
|
|
188
|
+

|
|
189
|
+
|
|
190
|
+
_Back to [Array](#3-array)_
|
|
191
|
+
|
|
192
|
+
### 3 - 2 - 3 - 1. Array (_Items is an array_) - Boolean (_Enum_)
|
|
193
|
+
|
|
194
|
+

|
|
195
|
+
|
|
196
|
+
_Back to [Array](#3-array)_
|
|
197
|
+
|
|
198
|
+
### 3 - 2 - 3 - 2. Array (_Items is an array_) - Boolean (_Any Of_)
|
|
199
|
+
|
|
200
|
+

|
|
201
|
+
|
|
202
|
+
_Back to [Array](#3-array)_
|
|
203
|
+
|
|
204
|
+
### 3 - 2 - 3 - 3. Array (_Items is an array_) - Boolean (_One Of_)
|
|
205
|
+
|
|
206
|
+

|
|
207
|
+
|
|
208
|
+
_Back to [Array](#3-array)_
|
|
209
|
+
|
|
210
|
+
### 3 - 2 - 4. Array (_Items is an array_) - Null
|
|
211
|
+
|
|
212
|
+

|
|
213
|
+
|
|
214
|
+
_Back to [Array](#3-array)_
|
|
215
|
+
|
|
216
|
+
### 3 - 2 - 4 - 1. Array (_Items is an array_) - Null (_Enum_)
|
|
217
|
+
|
|
218
|
+

|
|
219
|
+
|
|
220
|
+
_Back to [Array](#3-array)_
|
|
221
|
+
|
|
222
|
+
### 3 - 2 - 4 - 2. Array (_Items is an array_) - Null (_Any Of_)
|
|
223
|
+
|
|
224
|
+

|
|
225
|
+
|
|
226
|
+
_Back to [Array](#3-array)_
|
|
227
|
+
|
|
228
|
+
### 3 - 2 - 4 - 3. Array (_Items is an array_) - Null (_One Of_)
|
|
229
|
+
|
|
230
|
+

|
|
231
|
+
|
|
232
|
+
_Back to [Array](#3-array)_
|
package/docs/boolean.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## 5. Boolean
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
- [Boolean (_Enum_)](#5---1-boolean-enum)
|
|
6
|
+
- [Boolean (_Any of_)](#5---2-boolean-any-of)
|
|
7
|
+
- [Boolean (_One of_)](#5---3-boolean-one-of)
|
|
8
|
+
|
|
9
|
+
### 5 - 1. Boolean (_Enum_)
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
_Back to [Boolean](#5-boolean)_
|
|
14
|
+
|
|
15
|
+
### 5 - 2. Boolean (_Any Of_)
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
_Back to [Boolean](#5-boolean)_
|
|
20
|
+
|
|
21
|
+
### 5 - 3. Boolean (_One Of_)
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
_Back to [Boolean](#5-boolean)_
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/null.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## 6. Null
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
- [Null (_Enum_)](#6---1-null-enum)
|
|
6
|
+
- [Null (_Any of_)](#6---2-null-any-of)
|
|
7
|
+
- [Null (_One of_)](#6---3-null-one-of)
|
|
8
|
+
|
|
9
|
+
### 6 - 1. Null (_Enum_)
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
_Back to [Null](#6-null)_
|
|
14
|
+
|
|
15
|
+
### 6 - 2. Null (_Any Of_)
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
_Back to [Null](#6-null)_
|
|
20
|
+
|
|
21
|
+
### 6 - 3. Null (_One Of_)
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
_Back to [Null](#6-null)_
|
package/docs/number.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## 2. Number
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
- [Number (_Enum_)](#2---1-number-enum)
|
|
6
|
+
- [Number (_Any of_)](#2---2-number-any-of)
|
|
7
|
+
- [Number (_One of_)](#2---3-number-one-of)
|
|
8
|
+
|
|
9
|
+
### 2 - 1. Number (_Enum_)
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
_Back to [Number](#2-number)_
|
|
14
|
+
|
|
15
|
+
### 2 - 2. Number (_Any Of_)
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
_Back to [Number](#2-number)_
|
|
20
|
+
|
|
21
|
+
### 2 - 3. Number (_One Of_)
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
_Back to [Number](#2-number)_
|
package/docs/object.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
## 4. Object
|
|
2
|
+
|
|
3
|
+
Objects contain _one_ or _several_ values, which can be any type (including other objects). Our Stories contain _single-value_ layouts which you can explore under _Controls_.
|
|
4
|
+
|
|
5
|
+
- [Object - String](#4---1-object---string)
|
|
6
|
+
- [Object - String (_Enum_)](#4---1---1-object---string-enum)
|
|
7
|
+
- [Object - String (_Any of_)](#4---1---2-object---string-any-of)
|
|
8
|
+
- [Object - String (_One of_)](#4---1---3-object---string-one-of)
|
|
9
|
+
- [Object - Number](#4---2-object---number)
|
|
10
|
+
- [Object - Number (_Enum_)](#4---2---1-object---number-enum)
|
|
11
|
+
- [Object - Number (_Any of_)](#4---2---2-object---number-any-of)
|
|
12
|
+
- [Object - Number (_One of_)](#4---2---3-object---number-one-of)
|
|
13
|
+
- [Object - Boolean](#4---3-object---boolean)
|
|
14
|
+
- [Object - Boolean (_Enum_)](#4---3---1-object---boolean-enum)
|
|
15
|
+
- [Object - Boolean (_Any of_)](#4---3---2-object---boolean-any-of)
|
|
16
|
+
- [Object - Boolean (_One of_)](#4---3---3-object---boolean-one-of)
|
|
17
|
+
- [Object - Null](#4---4-object---null)
|
|
18
|
+
- [Object - Null (_Enum_)](#4---4---1-object---null-enum)
|
|
19
|
+
- [Object - Null (_Any of_)](#4---4---2-object---null-any-of)
|
|
20
|
+
- [Object - Null (_One of_)](#4---4---3-object---null-one-of)
|
|
21
|
+
|
|
22
|
+
### 4 - 1. Object - String
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
_Back to [Object](#4-object)_
|
|
27
|
+
|
|
28
|
+
### 4 - 1 - 1. Object - String (_Enum_)
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
_Back to [Object](#4-object)_
|
|
33
|
+
|
|
34
|
+
### 4 - 1 - 2. Object - String (_Any Of_)
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
_Back to [Object](#4-object)_
|
|
39
|
+
|
|
40
|
+
### 4 - 1 - 3. Object - String (_One Of_)
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
_Back to [Object](#4-object)_
|
|
45
|
+
|
|
46
|
+
### 4 - 2. Object - Number
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
_Back to [Object](#4-object)_
|
|
51
|
+
|
|
52
|
+
### 4 - 2 - 1. Object - Number (_Enum_)
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
_Back to [Object](#4-object)_
|
|
57
|
+
|
|
58
|
+
### 4 - 2 - 2. Object - Number (_Any Of_)
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
_Back to [Object](#4-object)_
|
|
63
|
+
|
|
64
|
+
### 4 - 2 - 3. Object - Number (_One Of_)
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
_Back to [Object](#4-object)_
|
|
69
|
+
|
|
70
|
+
### 4 - 3. Object - Boolean
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
_Back to [Object](#4-object)_
|
|
75
|
+
|
|
76
|
+
### 4 - 3 - 1. Object - Boolean (_Enum_)
|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
_Back to [Object](#4-object)_
|
|
81
|
+
|
|
82
|
+
### 4 - 3 - 2. Object - Boolean (_Any Of_)
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
_Back to [Object](#4-object)_
|
|
87
|
+
|
|
88
|
+
### 4 - 3 - 3. Object - Boolean (_One Of_)
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
_Back to [Object](#4-object)_
|
|
93
|
+
|
|
94
|
+
### 4 - 4. Object - Null
|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+
_Back to [Object](#4-object)_
|
|
99
|
+
|
|
100
|
+
### 4 - 4 - 1. Object - Null (_Enum_)
|
|
101
|
+
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+
_Back to [Object](#4-object)_
|
|
105
|
+
|
|
106
|
+
### 4 - 4 - 2. Object - Null (_Any Of_)
|
|
107
|
+
|
|
108
|
+

|
|
109
|
+
|
|
110
|
+
_Back to [Object](#4-object)_
|
|
111
|
+
|
|
112
|
+
### 4 - 4 - 3. Object - Null (_One Of_)
|
|
113
|
+
|
|
114
|
+

|
|
115
|
+
|
|
116
|
+
_Back to [Object](#4-object)_
|
package/docs/string.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## 1. String
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
- [String (_Enum_)](#1---1-string-enum)
|
|
6
|
+
- [String (_Any of_)](#1---2-string-any-of)
|
|
7
|
+
- [String (_One of_)](#1---3-string-one-of)
|
|
8
|
+
|
|
9
|
+
### 1 - 1. String (_Enum_)
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
_Back to [String](#1-string)_
|
|
14
|
+
|
|
15
|
+
### 1 - 2. String (_Any Of_)
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
_Back to [String](#1-string)_
|
|
20
|
+
|
|
21
|
+
### 1 - 3. String (_One Of_)
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
_Back to [String](#1-string)_
|
package/package.json
CHANGED
package/src/engine/index.jsx
CHANGED
|
@@ -4,6 +4,10 @@ import PropTypes from 'prop-types'
|
|
|
4
4
|
import Pinion from 'shinkansen-engine/components/pinion'
|
|
5
5
|
import Gears from 'shinkansen-engine/components/gears'
|
|
6
6
|
|
|
7
|
+
function onChange () {
|
|
8
|
+
//
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
export default class Engine extends Component {
|
|
8
12
|
render () {
|
|
9
13
|
const {
|
|
@@ -47,5 +51,6 @@ Engine.propTypes = {
|
|
|
47
51
|
|
|
48
52
|
Engine.defaultProps = {
|
|
49
53
|
params: {},
|
|
50
|
-
gears: {}
|
|
54
|
+
gears: {},
|
|
55
|
+
onChange
|
|
51
56
|
}
|
package/src/index.cjs
CHANGED
|
@@ -20,8 +20,6 @@ const log = debug('shinksansen-engine')
|
|
|
20
20
|
|
|
21
21
|
log('`shinkansen` is awake')
|
|
22
22
|
|
|
23
|
-
module.exports.Engine = Engine
|
|
24
|
-
|
|
25
23
|
module.exports.Cogs = Cogs
|
|
26
24
|
module.exports.Sprockets = Sprockets
|
|
27
25
|
module.exports.Gears = Gears
|
|
@@ -33,3 +31,5 @@ module.exports.Pantograph = Pantograph
|
|
|
33
31
|
module.exports.fromDocumentToHash = fromDocumentToHash
|
|
34
32
|
module.exports.fromHashToDocument = fromHashToDocument
|
|
35
33
|
module.exports.toZashiki = toZashiki
|
|
34
|
+
|
|
35
|
+
module.exports.Engine = Engine
|
package/src/index.d.cts
CHANGED
|
@@ -26,6 +26,53 @@ declare module 'shinkansen-engine/components/pantograph' {
|
|
|
26
26
|
export { Pantograph } from 'shinkansen-pantograph'
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
declare module 'shinkansen-engine/transformers/pinion/check-answers' {
|
|
30
|
+
export * from 'shinkansen-pinion/transformers/check-answers'
|
|
31
|
+
export { default } from 'shinkansen-pinion/transformers/check-answers'
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module 'shinkansen-engine/transformers/pinion/common' {
|
|
35
|
+
export * from 'shinkansen-pinion/transformers/common'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare module 'shinkansen-engine/transformers/pinion/error-message' {
|
|
39
|
+
export * from 'shinkansen-pinion/transformers/error-message'
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module 'shinkansen-engine/transformers/pinion' {
|
|
43
|
+
export * as checkAnswers from 'shinkansen-engine/transformers/pinion/check-answers'
|
|
44
|
+
export * as common from 'shinkansen-engine/transformers/pinion/common'
|
|
45
|
+
export * as errorMessage from 'shinkansen-engine/transformers/pinion/error-message'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare module 'shinkansen-engine/transformers/transmission/from-hash-to-document' {
|
|
49
|
+
export { default } from 'shinkansen-transmission/transmission/from-hash-to-document'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare module 'shinkansen-engine/transformers/transmission/from-document-to-hash' {
|
|
53
|
+
export { default } from 'shinkansen-transmission/transmission/from-document-to-hash'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare module 'shinkansen-engine/transformers/transmission/to-zashiki' {
|
|
57
|
+
export { default } from 'shinkansen-transmission/transmission/to-zashiki'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare module 'shinkansen-engine/transformers/transmission' {
|
|
61
|
+
export { default as fromDocumentToHash } from 'shinkansen-engine/transformers/transmission/from-document-to-hash'
|
|
62
|
+
export { default as fromHashToDocument } from 'shinkansen-engine/transformers/transmission/from-hash-to-document'
|
|
63
|
+
export { default as toZashiki } from 'shinkansen-engine/transformers/transmission/to-zashiki'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare module 'shinkansen-engine/engine' {
|
|
67
|
+
import React from 'react'
|
|
68
|
+
import type { PinionProps } from 'shinkansen-pinion/pinion'
|
|
69
|
+
import type { GearsProps } from 'shinkansen-gears/gears'
|
|
70
|
+
|
|
71
|
+
export type EngineProps = PinionProps & { gears: GearsProps }
|
|
72
|
+
|
|
73
|
+
export default class Engine extends React.Component<EngineProps> {}
|
|
74
|
+
}
|
|
75
|
+
|
|
29
76
|
declare module 'shinkansen-engine' {
|
|
30
77
|
export { Cogs } from 'shinkansen-engine/components/cogs'
|
|
31
78
|
export { Sprockets } from 'shinkansen-engine/components/sprockets'
|
|
@@ -34,4 +81,14 @@ declare module 'shinkansen-engine' {
|
|
|
34
81
|
export { Rails } from 'shinkansen-engine/components/rails'
|
|
35
82
|
export { Signals } from 'shinkansen-engine/components/signals'
|
|
36
83
|
export { Pantograph } from 'shinkansen-engine/components/pantograph'
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
fromDocumentToHash,
|
|
87
|
+
fromHashToDocument,
|
|
88
|
+
toZashiki
|
|
89
|
+
} from 'shinkansen-engine/engine/transformers/transmission'
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
default as Engine
|
|
93
|
+
} from 'shinkansen-engine/engine'
|
|
37
94
|
}
|
package/src/index.mjs
CHANGED
|
@@ -12,14 +12,6 @@ const log = debug('shinksansen-engine')
|
|
|
12
12
|
|
|
13
13
|
log('`shinkansen` is awake')
|
|
14
14
|
|
|
15
|
-
export { default as Engine } from './engine/index.cjs'
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
fromDocumentToHash,
|
|
19
|
-
fromHashToDocument,
|
|
20
|
-
toZashiki
|
|
21
|
-
} from './transformers/transmission/index.mjs'
|
|
22
|
-
|
|
23
15
|
export {
|
|
24
16
|
Cogs,
|
|
25
17
|
Sprockets,
|
|
@@ -29,3 +21,13 @@ export {
|
|
|
29
21
|
Signals,
|
|
30
22
|
Pantograph
|
|
31
23
|
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
fromDocumentToHash,
|
|
27
|
+
fromHashToDocument,
|
|
28
|
+
toZashiki
|
|
29
|
+
} from './transformers/transmission/index.mjs'
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
default as Engine
|
|
33
|
+
} from './engine/index.cjs'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import debug from 'debug'
|
|
2
|
+
|
|
3
|
+
const log = debug('shinksansen-engine')
|
|
4
|
+
|
|
5
|
+
log('`shinkansen` is awake')
|
|
6
|
+
|
|
7
|
+
export * as checkAnswers from './check-answers/index.mjs'
|
|
8
|
+
export * as common from './common/index.mjs'
|
|
9
|
+
export * as errorMessage from './error-message/index.mjs'
|