@json-layout/vocabulary
Advanced tools
Comparing version 0.23.3 to 1.0.0
{ | ||
"name": "@json-layout/vocabulary", | ||
"version": "0.23.3", | ||
"version": "1.0.0", | ||
"description": "Main JSON Layout vocabulary as JSON schemas and Typescript types. Also contains some small utility functions to validate and normalize annotations.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -170,2 +170,5 @@ | ||
"$ref": "#/$defs/partial-cols" | ||
}, | ||
"if": { | ||
"$ref": "#/$defs/partial-expression" | ||
} | ||
@@ -200,2 +203,5 @@ } | ||
"$ref": "#/$defs/partial-cols" | ||
}, | ||
"if": { | ||
"$ref": "#/$defs/partial-expression" | ||
} | ||
@@ -202,0 +208,0 @@ } |
@@ -74,3 +74,4 @@ { | ||
"key": {"type": ["string", "integer"]}, | ||
"cols": {"$ref": "#/$defs/partial-cols"} | ||
"cols": {"$ref": "#/$defs/partial-cols"}, | ||
"if": {"$ref": "#/$defs/partial-expression"} | ||
} | ||
@@ -86,3 +87,4 @@ }, | ||
"children": {"$ref": "#/$defs/partial-children"}, | ||
"cols": {"$ref": "#/$defs/partial-cols"} | ||
"cols": {"$ref": "#/$defs/partial-cols"}, | ||
"if": {"$ref": "#/$defs/partial-expression"} | ||
} | ||
@@ -89,0 +91,0 @@ }, |
@@ -28,10 +28,10 @@ /** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-children". | ||
* via the `definition` "partial-expression". | ||
*/ | ||
export type PartialChildren = PartialChild[]; | ||
export type PartialExpression = string | PartialExpressionObj; | ||
/** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-expression". | ||
* via the `definition` "partial-children". | ||
*/ | ||
export type PartialExpression = string | PartialExpressionObj; | ||
export type PartialChildren = PartialChild[]; | ||
/** | ||
@@ -91,2 +91,3 @@ * This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
cols?: PartialCols; | ||
if?: PartialExpression; | ||
} | ||
@@ -107,2 +108,11 @@ /** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-expression-obj". | ||
*/ | ||
export interface PartialExpressionObj { | ||
type?: "js-fn" | "js-eval" | "js-tpl"; | ||
expr: string; | ||
[k: string]: unknown; | ||
} | ||
/** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-child-composite". | ||
@@ -116,2 +126,3 @@ */ | ||
cols?: PartialCols; | ||
if?: PartialExpression; | ||
[k: string]: unknown; | ||
@@ -162,11 +173,2 @@ } | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-expression-obj". | ||
*/ | ||
export interface PartialExpressionObj { | ||
type?: "js-fn" | "js-eval" | "js-tpl"; | ||
expr: string; | ||
[k: string]: unknown; | ||
} | ||
/** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-get-items-fetch". | ||
@@ -173,0 +175,0 @@ */ |
@@ -81,5 +81,6 @@ import { validateLayoutKeyword, isComponentName, isPartialCompObject, isPartialChildren, isPartialSwitch, isPartialGetItemsExpr, isPartialGetItemsObj, isPartialSlotMarkdown, isPartialGetItemsFetch, isPartialChildComposite } from './layout-keyword/index.js' | ||
} else { | ||
if (partialChild.if) partialChild.if = normalizeExpression(partialChild.if) | ||
if (typeof partialChild.cols === 'number') partialChild.cols = { sm: partialChild.cols } | ||
if (typeof partialChild.cols === 'object' && partialChild.cols.xs === undefined) partialChild.cols.xs = 12 | ||
if (partialChild.key) { // object referencing known child and overwriting cols | ||
if (partialChild.key) { // object referencing known child and overwriting cols / if | ||
const matchingDefaultChild = defaultChildren.find(c => c.key === partialChild.key) | ||
@@ -545,3 +546,3 @@ if (!matchingDefaultChild) throw new Error(`unknown child "${partialChild.key}"`) | ||
for (const error of errors) { | ||
let message = error.message ?? error.keyword | ||
let message = error.instancePath + ' ' + (error.message ?? error.keyword) | ||
if (error.params) message += ' ' + JSON.stringify(error.params) | ||
@@ -548,0 +549,0 @@ messages.push(message) |
@@ -240,2 +240,5 @@ | ||
"$ref": "#/$defs/cols-obj" | ||
}, | ||
"if": { | ||
"$ref": "#/$defs/expression" | ||
} | ||
@@ -250,2 +253,3 @@ } | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
@@ -272,2 +276,5 @@ "key": { | ||
"$ref": "#/$defs/children" | ||
}, | ||
"if": { | ||
"$ref": "#/$defs/expression" | ||
} | ||
@@ -274,0 +281,0 @@ } |
@@ -132,3 +132,4 @@ { | ||
"key": {"type": ["string", "integer"]}, | ||
"cols": {"$ref": "#/$defs/cols-obj"} | ||
"cols": {"$ref": "#/$defs/cols-obj"}, | ||
"if": {"$ref": "#/$defs/expression"} | ||
} | ||
@@ -139,2 +140,3 @@ }, | ||
"required": ["key", "children"], | ||
"additionalProperties": false, | ||
"properties": { | ||
@@ -146,3 +148,4 @@ "key": {"type": ["string", "integer"]}, | ||
"subtitle": {"type": "string"}, | ||
"children": {"$ref": "#/$defs/children"} | ||
"children": {"$ref": "#/$defs/children"}, | ||
"if": {"$ref": "#/$defs/expression"} | ||
} | ||
@@ -149,0 +152,0 @@ }, |
@@ -230,2 +230,3 @@ /** | ||
cols?: ColsObj; | ||
if?: Expression; | ||
} | ||
@@ -243,3 +244,3 @@ /** | ||
children: Children; | ||
[k: string]: unknown; | ||
if?: Expression; | ||
} | ||
@@ -246,0 +247,0 @@ /** |
@@ -134,2 +134,5 @@ declare namespace _default { | ||
}; | ||
if: { | ||
$ref: string; | ||
}; | ||
}; | ||
@@ -156,2 +159,5 @@ }; | ||
}; | ||
if: { | ||
$ref: string; | ||
}; | ||
}; | ||
@@ -158,0 +164,0 @@ }; |
@@ -28,10 +28,10 @@ /** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-children". | ||
* via the `definition` "partial-expression". | ||
*/ | ||
export type PartialChildren = PartialChild[]; | ||
export type PartialExpression = string | PartialExpressionObj; | ||
/** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-expression". | ||
* via the `definition` "partial-children". | ||
*/ | ||
export type PartialExpression = string | PartialExpressionObj; | ||
export type PartialChildren = PartialChild[]; | ||
/** | ||
@@ -84,2 +84,3 @@ * This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
cols?: PartialCols; | ||
if?: PartialExpression; | ||
} | ||
@@ -100,2 +101,11 @@ /** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-expression-obj". | ||
*/ | ||
export interface PartialExpressionObj { | ||
type?: "js-fn" | "js-eval" | "js-tpl"; | ||
expr: string; | ||
[k: string]: unknown; | ||
} | ||
/** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-child-composite". | ||
@@ -109,2 +119,3 @@ */ | ||
cols?: PartialCols; | ||
if?: PartialExpression; | ||
[k: string]: unknown; | ||
@@ -155,11 +166,2 @@ } | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-expression-obj". | ||
*/ | ||
export interface PartialExpressionObj { | ||
type?: "js-fn" | "js-eval" | "js-tpl"; | ||
expr: string; | ||
[k: string]: unknown; | ||
} | ||
/** | ||
* This interface was referenced by `HttpsJsonLayoutGithubIoLayoutKeyword`'s JSON-Schema | ||
* via the `definition` "partial-get-items-fetch". | ||
@@ -166,0 +168,0 @@ */ |
@@ -212,2 +212,5 @@ declare namespace _default { | ||
}; | ||
if: { | ||
$ref: string; | ||
}; | ||
}; | ||
@@ -218,2 +221,3 @@ }; | ||
required: string[]; | ||
additionalProperties: boolean; | ||
properties: { | ||
@@ -238,2 +242,5 @@ key: { | ||
}; | ||
if: { | ||
$ref: string; | ||
}; | ||
}; | ||
@@ -240,0 +247,0 @@ }; |
@@ -226,2 +226,3 @@ /** | ||
cols?: ColsObj; | ||
if?: Expression; | ||
} | ||
@@ -239,3 +240,3 @@ /** | ||
children: Children; | ||
[k: string]: unknown; | ||
if?: Expression; | ||
} | ||
@@ -242,0 +243,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
196585
5628
0