mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
theme: mark shade and textSelection colors as deprecated
This commit is contained in:
committed by
Abdullah Atta
parent
577a976e01
commit
d256d435e4
@@ -34,8 +34,6 @@ const generator = tsj.createGenerator({
|
|||||||
const schema = generator.createSchema("ThemeDefinition");
|
const schema = generator.createSchema("ThemeDefinition");
|
||||||
|
|
||||||
removeProperty("ThemeDefinition", "codeBlockCSS");
|
removeProperty("ThemeDefinition", "codeBlockCSS");
|
||||||
removeProperty("Colors", "shade");
|
|
||||||
removeProperty("PartialOrFullColors<false>", "shade");
|
|
||||||
addProperty(
|
addProperty(
|
||||||
"ThemeDefinition",
|
"ThemeDefinition",
|
||||||
"$schema",
|
"$schema",
|
||||||
@@ -46,14 +44,21 @@ addProperty(
|
|||||||
},
|
},
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
makePropertyOptional("Colors", "shade");
|
||||||
|
makePropertyOptional("PartialOrFullColors<false>", "shade");
|
||||||
|
makePropertyOptional("Colors", "textSelection");
|
||||||
|
makePropertyOptional("PartialOrFullColors<false>", "textSelection");
|
||||||
await writeFile(`v1.schema.json`, JSON.stringify(schema, undefined, 2));
|
await writeFile(`v1.schema.json`, JSON.stringify(schema, undefined, 2));
|
||||||
|
|
||||||
function removeProperty(definition, propertyName) {
|
function removeProperty(definition, propertyName) {
|
||||||
delete schema.definitions[definition].properties[propertyName];
|
delete schema.definitions[definition].properties[propertyName];
|
||||||
const required = schema.definitions[definition].required;
|
makePropertyOptional(definition, propertyName);
|
||||||
|
}
|
||||||
|
|
||||||
|
function makePropertyOptional(definition, propertyName) {
|
||||||
|
const required = schema.definitions[definition].required;
|
||||||
if (required && required.includes(propertyName)) {
|
if (required && required.includes(propertyName)) {
|
||||||
required.splice(required.indexOf("shade"), 1);
|
required.splice(required.indexOf(propertyName), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,18 @@ export type Colors = {
|
|||||||
*/
|
*/
|
||||||
backdrop: string;
|
backdrop: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)
|
||||||
|
* @pattern ^#(?:(?:[\da-fA-F]{3}){1,2}|(?:[\da-fA-F]{4}){1,2})$
|
||||||
|
* @deprecated true
|
||||||
|
*/
|
||||||
shade: string;
|
shade: string;
|
||||||
|
/**
|
||||||
|
* Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)
|
||||||
|
* @pattern ^#(?:(?:[\da-fA-F]{3}){1,2}|(?:[\da-fA-F]{4}){1,2})$
|
||||||
|
* @deprecated true
|
||||||
|
*/
|
||||||
|
textSelection: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type VariantsWithStaticColors<TRequired extends boolean = false> =
|
export type VariantsWithStaticColors<TRequired extends boolean = false> =
|
||||||
|
|||||||
@@ -255,6 +255,18 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
||||||
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
|
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
|
||||||
|
},
|
||||||
|
"shade": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
||||||
|
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
|
||||||
|
"deprecated": true
|
||||||
|
},
|
||||||
|
"textSelection": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
||||||
|
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
|
||||||
|
"deprecated": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -353,6 +365,18 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
||||||
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
|
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
|
||||||
|
},
|
||||||
|
"shade": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
||||||
|
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
|
||||||
|
"deprecated": true
|
||||||
|
},
|
||||||
|
"textSelection": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
|
||||||
|
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
|
||||||
|
"deprecated": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|||||||
Reference in New Issue
Block a user