Skip to content

Commit

Permalink
feat: cssstate
Browse files Browse the repository at this point in the history
  • Loading branch information
thepassle committed May 7, 2024
1 parent 3ea4234 commit 5d9d384
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/analyzer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Release 0.10.0
- Added support for new `cssState` addition to the schema

## Release 0.9.9
- Support `@attribute` jsdoc better

Expand Down
13 changes: 10 additions & 3 deletions packages/analyzer/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204041,7 +204041,8 @@ function createClass(node, moduleDoc, context) {
slots: [],
members: [],
events: [],
attributes: []
attributes: [],
cssStates: []
};
node?.members?.forEach((member) => {
if (isProperty(member)) {
Expand Down Expand Up @@ -204540,6 +204541,12 @@ function classJsDocPlugin() {
case "element":
classDoc.tagName = jsDoc2?.name || "";
break;
case "cssState":
case "cssstate":
let statePropertyDoc = {};
statePropertyDoc = handleClassJsDoc(statePropertyDoc, jsDoc2);
classDoc.cssStates.push(statePropertyDoc);
break;
case "deprecated":
classDoc.deprecated = jsDoc2?.name ? `${jsDoc2.name} ${jsDoc2?.description}`.trim() : "true";
break;
Expand Down Expand Up @@ -204664,7 +204671,7 @@ function cleanupClassesPlugin() {
moduleLinkPhase({ moduleDoc }) {
const classes = moduleDoc?.declarations?.filter((declaration) => declaration.kind === "class" || declaration.kind === "mixin");
classes?.forEach((klass) => {
["cssProperties", "cssParts", "slots", "members", "attributes", "events"].forEach((field) => {
["cssProperties", "cssParts", "slots", "members", "attributes", "events", "cssStates"].forEach((field) => {
if (!has(klass[field])) {
delete klass[field];
}
Expand Down Expand Up @@ -204907,7 +204914,7 @@ function applyInheritancePlugin() {
if (klass?.name === customElement.name) {
return;
}
["slots", "cssParts", "cssProperties", "attributes", "members", "events"].forEach((type) => {
["slots", "cssParts", "cssProperties", "attributes", "members", "events", "cssStates"].forEach((type) => {
klass?.[type]?.forEach((currItem) => {
const containingModulePath = getModuleForClassLike(allManifests, klass.name);
const containingModule = getModuleFromManifests(allManifests, containingModulePath);
Expand Down
2 changes: 1 addition & 1 deletion packages/analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@custom-elements-manifest/analyzer",
"version": "0.9.9",
"version": "0.10.0",
"description": "",
"license": "MIT",
"type": "module",
Expand Down

0 comments on commit 5d9d384

Please sign in to comment.