Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

api-viewer-element

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-viewer-element - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

6

CHANGELOG.md

@@ -19,2 +19,8 @@ # Change Log

## [0.2.5] - 2019-11-13
### Added
- Exposed `section` property to toggle between docs and demo
## [0.2.4] - 2019-11-11

@@ -21,0 +27,0 @@

1

lib/api-viewer.d.ts

@@ -5,2 +5,3 @@ import { LitElement, TemplateResult } from 'lit-element';

src?: string;
section: string;
private jsonFetched;

@@ -7,0 +8,0 @@ private lastSrc?;

13

lib/api-viewer.js

@@ -10,10 +10,14 @@ import { __decorate } from "tslib";

super(...arguments);
this.section = 'docs';
this.jsonFetched = Promise.resolve([]);
}
// eslint-disable-next-line class-methods-use-this
async renderDocs(jsonFetched) {
async renderDocs(jsonFetched, section) {
const elements = await jsonFetched;
return elements.length
? html `
<api-viewer-content .elements="${elements}"></api-viewer-content>
<api-viewer-content
.elements="${elements}"
.section="${section}"
></api-viewer-content>
`

@@ -63,3 +67,3 @@ : html `

return html `
${until(this.renderDocs(this.jsonFetched))}
${until(this.renderDocs(this.jsonFetched, this.section))}
`;

@@ -74,2 +78,5 @@ }

], ApiViewer.prototype, "src", void 0);
__decorate([
property({ type: String })
], ApiViewer.prototype, "section", void 0);
ApiViewer = __decorate([

@@ -76,0 +83,0 @@ customElement('api-viewer')

{
"name": "api-viewer-element",
"version": "0.2.4",
"version": "0.2.5",
"description": "Web Components API viewer element",

@@ -5,0 +5,0 @@ "author": "Serhii Kulykov <iamkulykov@gmail.com>",

@@ -83,2 +83,11 @@ # &lt;api-viewer&gt;

### Section
By default, the API documentation is shown. If you want to show the playground instead, set the
`section` property to `demo`:
```html
<api-viewer src="./custom-elements.json" section="demo"></api-viewer>
```
### Knobs

@@ -85,0 +94,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc