🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

html-demo-element

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-demo-element - npm Package Compare versions

Comparing version

to
1.0.4

demo/dev-server.cjs

22

html-demo-element.js

@@ -61,3 +61,2 @@ import "https://unpkg.com/prismjs@1.23.0/components/prism-core.min.js";

connectedCallback()

@@ -73,8 +72,6 @@ {

slot.setAttribute('slot',name);
if( template )
{ const ref = template.nextElementSibling || template.parentElement.lastElementChild;
template.parentElement.insertBefore( slot, ref );
}else
this.insertBefore( slot, this.firstChild );
return slot;
if( 'legend' === name )
return this.insertBefore( slot, this.firstChild );
return template ? template.parentElement.insertBefore( slot, template )
: this.append( slot );
};

@@ -87,8 +84,9 @@

template || demoDom.map( el => el.remove() );
this.demoSlot = createSlot('demo');
this.textSlot = createSlot('text');
this.textSlot = createSlot('text' );
this.demoSlot = createSlot('demo' );
this.legendSlot = createSlot('legend');
if( template )
this.demoSlot.append( template.content.cloneNode(true) );
else
{ this.demoSlot.innerHTML = '';
this.demoSlot.append( template.content.cloneNode( true ) );
}else
demoDom.map( el=> this.demoSlot.append(el));

@@ -99,3 +97,3 @@ this.render();

render()
{ if( this.legend )
{ if( this.legendSlot && this.legend )
this.legendSlot.innerHTML = `<h3>${this.legend}</h3>`;

@@ -102,0 +100,0 @@

{
"name": "html-demo-element",
"version": "1.0.3",
"version": "1.0.4",
"description": "Webcomponent inserts prism JS syntax colored HTML in html-demo-element before actual dom",

@@ -22,2 +22,3 @@ "author": "Sasha Firsov",

"scripts": {
"start": "node demo/dev-server.cjs"
},

@@ -24,0 +25,0 @@ "dependencies": {

@@ -54,4 +54,4 @@ # html-demo-element

# Live demo
* https://unpkg.com/html-demo-element@1.0.3/demo/index.html
* https://unpkg.com/html-demo-element@1.0.3/demo/advanced.html
* https://unpkg.com/html-demo-element@1.0.4/demo/index.html
* https://unpkg.com/html-demo-element@1.0.4/demo/advanced.html
* https://unpkg.com/slotted-element@1.0.2/demo/index.html

@@ -72,4 +72,4 @@

* `source` - the source code text. If the attribute is not defined, it would be initialized from `source` slot ^^
* `type` - one of (prism js supported languages)[https://prismjs.com/#supported-languages].
* `type` - one of [prism js supported languages](https://prismjs.com/#supported-languages).
`html`, `css`, `js` imported by default. When omitted, assumed `html`.
* `legend` - optional heading for `html-demo-element`

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