mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +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");
|
||||
|
||||
removeProperty("ThemeDefinition", "codeBlockCSS");
|
||||
removeProperty("Colors", "shade");
|
||||
removeProperty("PartialOrFullColors<false>", "shade");
|
||||
addProperty(
|
||||
"ThemeDefinition",
|
||||
"$schema",
|
||||
@@ -46,14 +44,21 @@ addProperty(
|
||||
},
|
||||
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));
|
||||
|
||||
function removeProperty(definition, 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)) {
|
||||
required.splice(required.indexOf("shade"), 1);
|
||||
required.splice(required.indexOf(propertyName), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,18 @@ export type Colors = {
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* 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> =
|
||||
|
||||
@@ -255,6 +255,18 @@
|
||||
"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})$"
|
||||
},
|
||||
"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": [
|
||||
@@ -353,6 +365,18 @@
|
||||
"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})$"
|
||||
},
|
||||
"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
|
||||
|
||||
Reference in New Issue
Block a user