api-viewer-element
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -19,2 +19,10 @@ # Change Log | ||
## [0.3.6] - 2020-01-09 | ||
### Fixed | ||
- Demo: do not include getters to property knobs | ||
- Demo: use `text-align: initial` to not override | ||
- Demo: add missing `input` part for property knob | ||
## [0.3.5] - 2019-12-23 | ||
@@ -21,0 +29,0 @@ |
@@ -21,2 +21,20 @@ import { __decorate } from "tslib"; | ||
}; | ||
// TODO: remove when analyzer outputs "readOnly" to JSON | ||
const isGetter = (element, prop) => { | ||
function getDescriptor(obj) { | ||
return obj === HTMLElement | ||
? undefined | ||
: Object.getOwnPropertyDescriptor(obj.prototype, prop) || | ||
getDescriptor(Object.getPrototypeOf(obj)); | ||
} | ||
if (element) { | ||
const descriptor = getDescriptor(element.constructor); | ||
return Boolean(descriptor && descriptor.get && descriptor.set === undefined); | ||
} | ||
return false; | ||
}; | ||
const filterProps = (tag, props) => { | ||
const element = document.createElement(tag); | ||
return props.filter(prop => !isGetter(element, prop.name)); | ||
}; | ||
let ApiViewerDemoLayout = class ApiViewerDemoLayout extends LitElement { | ||
@@ -71,3 +89,3 @@ constructor() { | ||
<h3 part="knobs-header">Properties</h3> | ||
${renderKnobs(this.props, 'prop', propRenderer)} | ||
${renderKnobs(filterProps(this.tag, this.props), 'prop', propRenderer)} | ||
</section> | ||
@@ -74,0 +92,0 @@ <section |
@@ -13,3 +13,2 @@ import { LitElement, TemplateResult } from 'lit-element'; | ||
private renderDemoLayout; | ||
private renderWarning; | ||
protected createRenderRoot(): this; | ||
@@ -16,0 +15,0 @@ protected render(): TemplateResult; |
@@ -27,9 +27,2 @@ import { __decorate } from "tslib"; | ||
} | ||
renderWarning() { | ||
return html ` | ||
<div part="warning"> | ||
Element "${this.name}" is not defined. Have you imported it? | ||
</div> | ||
`; | ||
} | ||
createRenderRoot() { | ||
@@ -45,3 +38,7 @@ return this; | ||
return html ` | ||
${until(this.renderDemoLayout(this.whenDefined), this.renderWarning())} | ||
${until(this.renderDemoLayout(this.whenDefined), html ` | ||
<div part="warning"> | ||
Element "${this.name}" is not defined. Have you imported it? | ||
</div> | ||
`)} | ||
`; | ||
@@ -48,0 +45,0 @@ } |
@@ -181,2 +181,3 @@ import { css } from 'lit-element'; | ||
padding: 1.5rem; | ||
text-align: initial; | ||
} | ||
@@ -183,0 +184,0 @@ |
@@ -36,2 +36,3 @@ import { html } from 'lit-html'; | ||
data-type="${type}" | ||
part="input" | ||
/> | ||
@@ -38,0 +39,0 @@ `; |
{ | ||
"name": "api-viewer-element", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "Web Components API viewer element", | ||
@@ -30,3 +30,3 @@ "author": "Serhii Kulykov <iamkulykov@gmail.com>", | ||
"dependencies": { | ||
"@types/dompurify": "^2.0.0", | ||
"@types/dompurify": "^2.0.1", | ||
"dompurify": "^2.0.7", | ||
@@ -40,11 +40,11 @@ "highlight-ts": "9.12.1-2", | ||
"devDependencies": { | ||
"@open-wc/building-rollup": "^0.17.0", | ||
"@size-limit/preset-big-lib": "^2.2.3", | ||
"@typescript-eslint/eslint-plugin": "^2.12.0", | ||
"@typescript-eslint/parser": "^2.12.0", | ||
"@open-wc/building-rollup": "^0.18.1", | ||
"@size-limit/preset-big-lib": "^3.0.0", | ||
"@typescript-eslint/eslint-plugin": "^2.15.0", | ||
"@typescript-eslint/parser": "^2.15.0", | ||
"@webcomponents/webcomponentsjs": "^2.4.0", | ||
"es-dev-server": "^1.32.0", | ||
"eslint": "^6.7.2", | ||
"es-dev-server": "^1.36.1", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
"eslint-config-prettier": "^6.7.0", | ||
"eslint-config-prettier": "^6.9.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
@@ -54,3 +54,3 @@ "eslint-plugin-lit": "^1.2.0", | ||
"eslint-plugin-wc": "^1.2.0", | ||
"husky": "^3.1.0", | ||
"husky": "^4.0.3", | ||
"lint-staged": "^9.5.0", | ||
@@ -61,5 +61,5 @@ "lit-analyzer": "^1.1.9", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.27.13", | ||
"rollup": "^1.29.0", | ||
"rollup-plugin-cpy": "^2.0.1", | ||
"stylelint": "^12.0.0", | ||
"stylelint": "^12.0.1", | ||
"stylelint-config-prettier": "^8.0.0", | ||
@@ -70,4 +70,4 @@ "stylelint-config-standard": "^19.0.0", | ||
"tsc-watch": "^4.0.0", | ||
"typescript": "^3.7.3", | ||
"web-component-analyzer": "^1.0.0" | ||
"typescript": "^3.7.4", | ||
"web-component-analyzer": "^1.0.1" | ||
}, | ||
@@ -74,0 +74,0 @@ "husky": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193729
2133
Updated@types/dompurify@^2.0.1