-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial.schema.json
More file actions
130 lines (123 loc) · 4.42 KB
/
tutorial.schema.json
File metadata and controls
130 lines (123 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://unpkg.com/next-easytour/tutorial.schema.json",
"title": "next-easytour tutorial (0.3.x)",
"description": "JSON schema for a next-easytour step list. Validates arrays of Step objects as defined in src/types.ts.",
"type": "array",
"items": { "$ref": "#/definitions/Step" },
"definitions": {
"Step": {
"type": "object",
"required": ["id"],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"description": "Stable, unique identifier for this step. Used for navigation, deep-linking, and lifecycle callbacks."
},
"title": {
"type": "string",
"description": "Heading displayed by the default <Card>."
},
"body": {
"type": "string",
"description": "Body copy displayed by the default <Card>."
},
"targets": {
"type": "array",
"items": { "type": "string" },
"description": "Registered target ids this step highlights or points at. Matches the arg passed to useTutorialTarget()."
},
"annotations": { "$ref": "#/definitions/Annotations" },
"cardAnchor": { "$ref": "#/definitions/ViewportAnchor" },
"meta": {
"type": "object",
"description": "Host-owned metadata. Shape is declared by the consumer; the library preserves it verbatim."
}
},
"additionalProperties": false
},
"TargetPoint": {
"type": "object",
"required": ["space", "x", "y"],
"properties": {
"space": { "const": "target" },
"x": {
"type": "number",
"description": "Horizontal position as a percentage of the target's width. May fall outside 0–100."
},
"y": {
"type": "number",
"description": "Vertical position as a percentage of the target's height. May fall outside 0–100."
}
},
"additionalProperties": false
},
"ViewportAnchor": {
"type": "object",
"required": ["space", "x", "y"],
"properties": {
"space": { "const": "viewport" },
"x": {
"type": "number",
"description": "Horizontal position as a percentage of the viewport width. May fall outside 0–100."
},
"y": {
"type": "number",
"description": "Vertical position as a percentage of the viewport height. May fall outside 0–100."
}
},
"additionalProperties": false
},
"Annotations": {
"type": "object",
"properties": {
"arrow": { "$ref": "#/definitions/Arrow" },
"circles": {
"type": "array",
"items": { "$ref": "#/definitions/Circle" }
},
"spotlight": {
"type": "boolean",
"description": "Dim the viewport except for cutouts around the step's targets."
}
},
"additionalProperties": false
},
"Arrow": {
"type": "object",
"required": ["to"],
"properties": {
"to": { "$ref": "#/definitions/TargetPoint" },
"label": { "type": "string" },
"style": { "$ref": "#/definitions/ArrowStyle" }
},
"additionalProperties": false
},
"ArrowStyle": {
"type": "object",
"properties": {
"bend": { "type": "number", "minimum": 5, "maximum": 80, "default": 30 },
"flip": { "type": "boolean", "default": false },
"strokeWidth": { "type": "number", "default": 1.5 },
"dashed": { "type": "boolean", "default": false },
"headSize": { "type": "number", "default": 8 },
"loopEnd": { "type": "boolean", "default": false }
},
"additionalProperties": false
},
"Circle": {
"type": "object",
"required": ["x", "y", "r"],
"properties": {
"x": { "type": "number", "description": "Centre x, percentage of target width." },
"y": { "type": "number", "description": "Centre y, percentage of target height." },
"r": { "type": "number", "description": "Horizontal radius, percentage of target width." },
"ry": { "type": "number", "description": "Vertical radius, percentage of target height. Defaults to r (circle)." },
"rot": { "type": "number", "description": "Rotation in degrees." },
"label": { "type": "string", "description": "Optional label rendered below the ellipse." }
},
"additionalProperties": false
}
}
}