Skip to content

Commit

Permalink
fix: Cleaned up examples to match schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacivita committed May 21, 2024
1 parent 6759fc0 commit 11bfcbd
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 42 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions requirements/specifications/intents/command-and-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,9 @@ Setting the scale to `1` turns off magnification. Setting the scale to a value g

Even if a Firebolt platform does not support specifying the numeric scale, it **MUST** turn magnifacation on and off based on them.

The magnification intent **MUST** have only one property, `scale`, `toggle`, `value` and **MUST NOT** combine them in a single intent.
If the intent has the `toggle` property, then it **MUST NOT** have the `scale` or `value` property.

If the intent has the `value` property, then it **MUST NOT** have the `toggle`.

### 3.6. Interaction Intents

Expand Down Expand Up @@ -899,8 +901,7 @@ up/down/left/right:
"action": "scroll",
"data": {
"direction": "up" | "down" | "left" | "right",
"unit": "page" | "line" | "percent",
"distance": 2.5
"unit": "page" | "line" | "percent"
},
"context": {
"source": "voice"
Expand All @@ -909,8 +910,7 @@ up/down/left/right:
}
```

The distance is a float that represents how many of units to scroll. All
three data properties are required.
Both `direction` and `unit` are required.

These Intents will generate appropriate browser / DOM scrolling
operations that don\'t require custom APIs.
Expand Down
95 changes: 66 additions & 29 deletions src/schemas/intents.json
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@
"type": "object",
"properties": {
"options": {
"type": "object",
"maxProperties": 1
}
}
Expand All @@ -1122,6 +1123,7 @@
"type": "object",
"properties": {
"options": {
"type": "object",
"maxProperties": 0
}
}
Expand Down Expand Up @@ -1707,10 +1709,6 @@
"page",
"percent"
]
},
"distance": {
"type": "number",
"minimum": 0
}
},
"additionalProperties": false
Expand Down Expand Up @@ -1817,12 +1815,22 @@
"required": [ "relative" ]
},
"then": {
"minimum": 0,
"maximum": 100
"properties": {
"value": {
"type": "number",
"minimum": -50,
"maximum": 50
}
}
},
"else": {
"minimum": -50,
"maximum": 50
"properties": {
"value": {
"type": "number",
"minimum": 0,
"maximum": 100
}
}
},
"additionalProperties": false
}
Expand Down Expand Up @@ -1963,7 +1971,7 @@
"action": "power",
"data": {
"value": false,
"delay": "900"
"delay": 900
},
"context": {
"source": "voice"
Expand Down Expand Up @@ -2383,9 +2391,7 @@
"type": "object",
"properties": {
"seconds": {
"type": "number",
"minimum": 0,
"maximum": 1800
"type": "number"
},
"relative": {
"const": true
Expand All @@ -2400,7 +2406,18 @@
"then": {
"properties": {
"seconds": {
"minimum": 0
"type": "number",
"minimum": 0,
"maximum": 86400
}
}
},
"else": {
"properties": {
"seconds": {
"type": "number",
"minimum": -43200,
"maximum": 43200
}
}
}
Expand Down Expand Up @@ -2521,7 +2538,7 @@
],
"examples": [
{
"action": "closedcaptions",
"action": "closed-captions",
"data": {
"value": false
},
Expand All @@ -2530,7 +2547,7 @@
}
},
{
"action": "closedcaptions",
"action": "closed-captions",
"data": {
"toggle": true
},
Expand All @@ -2540,9 +2557,9 @@
}
]
},
"VoiceGuideanceIntent": {
"VoiceGuidanceIntent": {
"description": "A Firebolt compliant representation of a user intention to enable/disable voice guidance.",
"title": "VoiceGuideanceIntent",
"title": "VoiceGuidanceIntent",
"allOf": [
{
"$ref": "#/definitions/Intent"
Expand Down Expand Up @@ -2592,6 +2609,7 @@
"then": {
"properties": {
"speed": {
"type": "integer",
"minimum": -10,
"maximum": 10
}
Expand All @@ -2600,18 +2618,21 @@
"else": {
"properties": {
"speed": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 10
}
}
}
},
"else": {
"required": [ "toggle" ],
"not": {
"required": [
"speed"
]
"if": {
"required": [ "toggle" ]
},
"then": {
"not": {
"required": [ "value" ]
}
}
},
"additionalProperties": false
Expand Down Expand Up @@ -2801,16 +2822,23 @@
"maximum": 10
}
},
"maxProperties": 1,
"minProperties": 1,
"if": {
"required": [
"toggle"
]
},
"then": {
"type": "object",
"maxProperties": 1
},
"additionalProperties": false
}
}
}
],
"examples": [
{
"action": "power",
"action": "screen-magnification",
"data": {
"value": false
},
Expand All @@ -2819,7 +2847,17 @@
}
},
{
"action": "power",
"action": "screen-magnification",
"data": {
"value": true,
"scale": 2.5
},
"context": {
"source": "voice"
}
},
{
"action": "screen-magnification",
"data": {
"toggle": true
},
Expand All @@ -2828,10 +2866,9 @@
}
},
{
"action": "power",
"action": "screen-magnification",
"data": {
"value": false,
"delay": "900"
"value": false
},
"context": {
"source": "voice"
Expand Down

0 comments on commit 11bfcbd

Please sign in to comment.