diff --git a/kirby4-blueprints.schema.json b/kirby4-blueprints.schema.json index e95bc58..beb034b 100644 --- a/kirby4-blueprints.schema.json +++ b/kirby4-blueprints.schema.json @@ -39,6 +39,9 @@ { "$ref": "#/$defs/fields/line" }, + { + "$ref": "#/$defs/fields/link" + }, { "$ref": "#/$defs/fields/list" }, @@ -1633,7 +1636,7 @@ "properties": { "type": { "enum": [ - "headline" + "color" ] }, "alpha": { @@ -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" @@ -3996,6 +4053,9 @@ { "$ref": "#/$defs/fields/line" }, + { + "$ref": "#/$defs/fields/link" + }, { "$ref": "#/$defs/fields/list" }, diff --git a/package-lock.json b/package-lock.json index 4a569ec..3600329 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kirby3-schema", - "version": "4.1.0", + "version": "4.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kirby3-schema", - "version": "4.1.0", + "version": "4.1.1", "license": "MIT", "devDependencies": { "ajv": "^8.11.0", diff --git a/package.json b/package.json index 813b686..d79741f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kirby3-schema", - "version": "4.1.1", + "version": "4.2.0", "description": "", "main": "index.js", "directories": { diff --git a/tests/fields.test.js b/tests/fields.test.js index 521d02c..bda3f45 100644 --- a/tests/fields.test.js +++ b/tests/fields.test.js @@ -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(); }); diff --git a/tests/fixtures/fields/color.yml b/tests/fixtures/fields/color.yml index 70b4057..ceb515c 100644 --- a/tests/fixtures/fields/color.yml +++ b/tests/fixtures/fields/color.yml @@ -1,5 +1,8 @@ type: color +mode: options +alpha: true options: - type: query - alpha: true - mode: picker + - '#fff' + - '#ccc' + - '#666' + - '#000' diff --git a/tests/fixtures/fields/link.yml b/tests/fixtures/fields/link.yml new file mode 100644 index 0000000..1ea7416 --- /dev/null +++ b/tests/fixtures/fields/link.yml @@ -0,0 +1,4 @@ +type: link +options: + - page + - anchor \ No newline at end of file