diff --git a/.eslintrc.json b/.eslintrc.json
index 171f4b7..4928a99 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -20,6 +20,7 @@
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"import/extensions": "off",
+ "import/no-import-module-exports": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"lit/no-template-map": "off",
diff --git a/.gitignore b/.gitignore
index c419900..5d2f79f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ node_modules
/lib
/dist
entrypoint.hashmanifest.json
+custom-elements.json
diff --git a/README.md b/README.md
index bf5d1f4..396d860 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# <api-viewer>
-API documentation and live playground for Web Components. Based on [web-component-analyzer](https://github.com/runem/web-component-analyzer) JSON format.
+API documentation and live playground for Web Components. Based on [custom elements manifest](https://github.com/webcomponents/custom-elements-manifest) JSON format.
```html
@@ -42,18 +42,20 @@ Or grab from [unpkg.com CDN](https://unpkg.com/api-viewer-element?module):
## Usage
-1. Install [web-component-analyzer](https://github.com/runem/web-component-analyzer):
+1. Install [custom elements manifest analyzer](https://custom-elements-manifest.open-wc.org/analyzer/getting-started/):
```sh
-$ npm install -g web-component-analyzer
+$ npm install @custom-elements-manifest/analyzer
```
-2. Analyze your components using `--format json`:
+2. Analyze your components:
```sh
-$ wca analyze my-element.js --outFile custom-elements.json --format json
+$ cem analyze my-element.js
```
+Read the [docs](https://custom-elements-manifest.open-wc.org) for more information on how to use the analyzer.
+
3. Create an HTML file and import the component:
```html
@@ -179,17 +181,17 @@ Use `exclude-knobs` attribute to exclude properties from demo:
```
-#### `elements`
+#### `manifest`
-Use `elements` property instead of `src` to pass data directly:
+Use `manifest` property instead of `src` to pass manifest data directly:
```html
```
@@ -374,7 +376,7 @@ npm run serve:dist
## Acknowledgements
-- Big thanks to [@runem](http://github.com/runem) for creating Web Component Analyzer.
+- Big thanks to [@runem](http://github.com/runem) for creating Web Component Analyzer, which previous versions of this package were based on.
- Thanks to [@bahrus](https://github.com/bahrus) for [wc-info](https://github.com/bahrus/wc-info) component which inspired me.
- The visual appearance is largely inspired by [Vuetify](https://vuetifyjs.com/en/getting-started/quick-start) API docs.
- The tabs component is based on the [howto-tabs](https://developers.google.com/web/fundamentals/web-components/examples/howto-tabs) example.
diff --git a/demo/styles.css b/assets/styles.css
similarity index 100%
rename from demo/styles.css
rename to assets/styles.css
diff --git a/custom-elements.json b/custom-elements.json
deleted file mode 100644
index 98d3215..0000000
--- a/custom-elements.json
+++ /dev/null
@@ -1,267 +0,0 @@
-{
- "version": "experimental",
- "tags": [
- {
- "name": "expansion-panel",
- "path": "./src/fixtures/expansion-panel.ts",
- "description": "A custom element similar to the HTML5 `` element.",
- "attributes": [
- {
- "name": "opened",
- "description": "When true, the panel content is expanded and visible",
- "type": "boolean | null | undefined",
- "default": "false"
- },
- {
- "name": "disabled",
- "description": "Disabled panel can not be expanded or collapsed",
- "type": "boolean",
- "default": "false"
- },
- {
- "name": "focused",
- "description": "State attribute set when element has focus.",
- "type": "boolean"
- },
- {
- "name": "focus-ring",
- "description": "State attribute set when focused from keyboard.",
- "type": "boolean"
- }
- ],
- "properties": [
- {
- "name": "opened",
- "attribute": "opened",
- "description": "When true, the panel content is expanded and visible",
- "type": "boolean | null | undefined",
- "default": "false"
- },
- {
- "name": "disabled",
- "attribute": "disabled",
- "description": "Disabled panel can not be expanded or collapsed",
- "type": "boolean",
- "default": "false"
- }
- ],
- "events": [
- {
- "name": "opened-changed",
- "description": "Event fired when expanding / collapsing"
- }
- ],
- "slots": [
- {
- "name": "",
- "description": "Slot fot panel content"
- },
- {
- "name": "header",
- "description": "Slot for panel header"
- }
- ],
- "cssProperties": [
- {
- "name": "--panel-header-background",
- "description": "Default panel header background color.",
- "type": "Background",
- "default": "\"#fff\""
- },
- {
- "name": "--panel-header-min-height",
- "description": "Panel header minimum height.",
- "default": "\"48px\""
- },
- {
- "name": "--panel-ripple-background",
- "description": "Active toggle button ripple background.",
- "type": "Background",
- "default": "\"rgba(0, 0, 0, 0.38)\""
- }
- ],
- "cssParts": [
- {
- "name": "header",
- "description": "An element wrapping the `header` slot."
- },
- {
- "name": "toggle",
- "description": "A toggle button, child of the header part."
- },
- {
- "name": "content",
- "description": "An element wrapping the `content` slot."
- }
- ]
- },
- {
- "name": "fancy-accordion",
- "path": "./src/fixtures/fancy-accordion.ts",
- "description": "A custom element implementing the accordion widget: a vertically stacked set of expandable panels\nthat wraps several instances of the `` element. Only one panel can be opened\n(expanded) at a time.\n\nPanel headings function as controls that enable users to open (expand) or hide (collapse) their\nassociated sections of content. The user can toggle panels by mouse click, Enter and Space keys.\n\nThe component supports keyboard navigation and is aligned with the\n[WAI-ARIA Authoring Practices](https://www.w3.org/TR/wai-aria-practices-1.1/#accordion).",
- "attributes": [
- {
- "name": "opened-index",
- "description": "Index of the currently opened panel. By default all the panels are closed.\nOnly one panel can be opened at the same time. Setting `null` or `undefined`\ncloses all the accordion panels.",
- "type": "number | null | undefined"
- }
- ],
- "properties": [
- {
- "name": "openedIndex",
- "attribute": "opened-index",
- "description": "Index of the currently opened panel. By default all the panels are closed.\nOnly one panel can be opened at the same time. Setting `null` or `undefined`\ncloses all the accordion panels.",
- "type": "number | null | undefined"
- },
- {
- "name": "focused",
- "type": "Element | null"
- }
- ],
- "events": [
- {
- "name": "opened-index-changed",
- "description": "Event fired when changing currently opened panel."
- }
- ],
- "slots": [
- {
- "name": "",
- "description": "Slot fot panel elements."
- }
- ]
- },
- {
- "name": "intl-currency",
- "path": "./src/fixtures/intl-currency.ts",
- "description": "A custom element that formats currency using Intl.",
- "attributes": [
- {
- "name": "value",
- "description": "Amount to be formatted.",
- "type": "number",
- "default": "0"
- },
- {
- "name": "currency",
- "description": "Currency code used for formatting.",
- "type": "string | null | undefined",
- "default": "\"EUR\""
- },
- {
- "name": "locale",
- "description": "Locale code used for formatting.",
- "type": "string | null | undefined",
- "default": "\"en-GB\""
- }
- ],
- "properties": [
- {
- "name": "value",
- "attribute": "value",
- "description": "Amount to be formatted.",
- "type": "number",
- "default": "0"
- },
- {
- "name": "currency",
- "attribute": "currency",
- "description": "Currency code used for formatting.",
- "type": "string | null | undefined",
- "default": "\"EUR\""
- },
- {
- "name": "locale",
- "attribute": "locale",
- "description": "Locale code used for formatting.",
- "type": "string | null | undefined",
- "default": "\"en-GB\""
- }
- ]
- },
- {
- "name": "progress-bar",
- "path": "./src/fixtures/progress-bar.ts",
- "description": "A custom element similar to the HTML5 `