Detect CssClasses from polish pass.

This commit is contained in:
Nik
2023-02-03 11:32:31 +11:00
parent 4e45d01e63
commit a834c1699f
2 changed files with 43 additions and 14 deletions

View File

@@ -67,7 +67,7 @@ function _extractJSDocBlocks(srcFile, propsObj) {
const declaration = node.declarationList?.declarations[0]; const declaration = node.declarationList?.declarations[0];
switch (node.kind) { switch (node.kind) {
case ts.SyntaxKind.FirstStatement: case ts.SyntaxKind.FirstStatement:
if (declaration.type?.typeName?.escapedText == 'CSS') { if (declaration.type?.typeName?.escapedText == 'CssClasses') {
propsObj[declaration.name.escapedText] = { comment: jsDoc.comment, type: 'css' }; propsObj[declaration.name.escapedText] = { comment: jsDoc.comment, type: 'css' };
} else { } else {
propsObj[declaration.name.escapedText] = { comment: jsDoc.comment, type: 'prop' }; propsObj[declaration.name.escapedText] = { comment: jsDoc.comment, type: 'prop' };
@@ -116,7 +116,7 @@ function writeJSDocsToDefinitionFiles() {
} }
function generateKeyWordsFromProps() { function generateKeyWordsFromProps() {
let propSet = new Set() let propSet = new Set(['class'])
for (let file in filesToProps) { for (let file in filesToProps) {
for (let prop in filesToProps[file].props) { for (let prop in filesToProps[file].props) {
if (filesToProps[file].props[prop].type == 'css') { if (filesToProps[file].props[prop].type == 'css') {

View File

@@ -1,20 +1,33 @@
{ {
"tailwindCSS.classAttributes": [ "tailwindCSS.classAttributes": [
"class", "class",
"hover",
"spacing", "spacing",
"padding", "padding",
"hover",
"rounded", "rounded",
"regionControl",
"regionPanel",
"regionCaret",
"background", "background",
"border", "border",
"shadow", "shadow",
"space", "space",
"gridColumns",
"gap",
"regionRowMain",
"regionRowHeadline",
"slotLead",
"slotDefault",
"slotTrail",
"active", "active",
"width", "width",
"height", "height",
"gap", "regionLead",
"regionDefault",
"regionTrail",
"regionIcon", "regionIcon",
"regionLabel", "regionLabel",
"regionPage",
"slotHeader", "slotHeader",
"slotSidebarLeft", "slotSidebarLeft",
"slotSidebarRight", "slotSidebarRight",
@@ -22,26 +35,42 @@
"slotPageContent", "slotPageContent",
"slotPageFooter", "slotPageFooter",
"slotFooter", "slotFooter",
"cursor",
"fill", "fill",
"cursor",
"regionCaption",
"regionCone",
"regionLegend",
"button", "button",
"color", "regionInterface",
"chip", "regionInterfaceText",
"ring", "slotMessage",
"accent", "slotMeta",
"regionList", "chips",
"invalid",
"select",
"justify", "justify",
"text", "text",
"amountText",
"buttonClasses", "buttonClasses",
"buttonTextPrevious",
"buttonTextNext",
"meter", "meter",
"track", "track",
"display", "display",
"borderWidth", "borderWidth",
"borderColor", "borderColor",
"size", "color",
"buttonClassesBack", "accent",
"buttonClassesNext", "regionHeader",
"buttonClassesComplete", "regionContent",
"regionNavigation",
"badge",
"buttonBack",
"buttonNext",
"buttonComplete",
"flex",
"regionList",
"element",
"regionHead", "regionHead",
"regionBody", "regionBody",
"regionFoot" "regionFoot"