Skip to content

Commit

Permalink
✨ link field
Browse files Browse the repository at this point in the history
🐛 color field
  • Loading branch information
bnomei committed Sep 1, 2024
1 parent 36c6910 commit 9769664
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 7 deletions.
62 changes: 61 additions & 1 deletion kirby4-blueprints.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
{
"$ref": "#/$defs/fields/line"
},
{
"$ref": "#/$defs/fields/link"
},
{
"$ref": "#/$defs/fields/list"
},
Expand Down Expand Up @@ -1633,7 +1636,7 @@
"properties": {
"type": {
"enum": [
"headline"
"color"
]
},
"alpha": {
Expand Down Expand Up @@ -2166,6 +2169,60 @@
}
}
},
"link": {
"required": [
"type"
],
"additionalProperties": false,
"properties": {
"type": {
"enum": [
"link"
]
},
"blueprint": {
"enum": [
"field"
]
},
"extends": {
"$ref": "#/$defs/field-properties/@extends"
},
"autofocus": {
"$ref": "#/$defs/field-properties/@autofocus"
},
"default": {
"$ref": "#/$defs/field-properties/@default"
},
"disabled": {
"$ref": "#/$defs/field-properties/@disabled"
},
"help": {
"$ref": "#/$defs/field-properties/@help"
},
"label": {
"$ref": "#/$defs/field-properties/@label"
},
"options": {
"$ref": "#/$defs/field-properties/@options"
},
"required": {
"$ref": "#/$defs/field-properties/@required",
"default": false
},
"translate": {
"$ref": "#/$defs/field-properties/@translate",
"default": true
},
"when": {
"$ref": "#/$defs/field-properties/@when"
},
"width": {
"$ref": "#/$defs/field-properties/@width",
"default": "1/1"
}
}
},
"list": {
"required": [
"type"
Expand Down Expand Up @@ -3996,6 +4053,9 @@
{
"$ref": "#/$defs/fields/line"
},
{
"$ref": "#/$defs/fields/link"
},
{
"$ref": "#/$defs/fields/list"
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kirby3-schema",
"version": "4.1.1",
"version": "4.2.0",
"description": "",
"main": "index.js",
"directories": {
Expand Down
4 changes: 4 additions & 0 deletions tests/fields.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ test('line', () => {
expect(validate('./tests/fixtures/fields/line.yml')).toBeTruthy();
});

test('link', () => {
expect(validate('./tests/fixtures/fields/link.yml')).toBeTruthy();
});

test('list', () => {
expect(validate('./tests/fixtures/fields/list.yml')).toBeTruthy();
});
Expand Down
9 changes: 6 additions & 3 deletions tests/fixtures/fields/color.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
type: color
mode: options
alpha: true
options:
type: query
alpha: true
mode: picker
- '#fff'
- '#ccc'
- '#666'
- '#000'
4 changes: 4 additions & 0 deletions tests/fixtures/fields/link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: link
options:
- page
- anchor

0 comments on commit 9769664

Please sign in to comment.