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

@bolt/element

Package Overview
Dependencies
Maintainers
5
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bolt/element - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

37

CHANGELOG.md

@@ -6,2 +6,29 @@ # Change Log

# [3.1.0](https://github.com/boltdesignsystem/bolt/compare/v2.31.2...v3.1.0) (2021-02-08)
### Features
* remove polyfill workaround from @bolt/element as part of the broader perf updates ([e082868](https://github.com/boltdesignsystem/bolt/commit/e082868e2c731e40a746a3a25e78ca7ed66156ec))
## [2.31.2](https://github.com/boltdesignsystem/bolt/compare/v2.31.1...v2.31.2) (2021-02-04)
**Note:** Version bump only for package @bolt/element
# [2.31.0](https://github.com/boltdesignsystem/bolt/compare/v2.30.2...v2.31.0) (2021-02-02)
**Note:** Version bump only for package @bolt/element
## [3.0.1](https://github.com/boltdesignsystem/bolt/compare/v3.0.0...v3.0.1) (2021-01-22)

@@ -15,13 +42,17 @@

# [3.0.0](https://github.com/boltdesignsystem/bolt/compare/v2.29.3...v3.0.0) (2021-01-08)
# [2.30.0](https://github.com/boltdesignsystem/bolt/compare/v2.29.3...v2.30.0) (2021-01-13)
**Note:** Version bump only for package @bolt/element
### Features
* remove polyfill workaround from @bolt/element as part of the broader perf updates ([e082868](https://github.com/boltdesignsystem/bolt/commit/e082868e2c731e40a746a3a25e78ca7ed66156ec))
# [3.0.0](https://github.com/boltdesignsystem/bolt/compare/v2.29.3...v3.0.0) (2021-01-08)
### Features
* remove polyfill workaround from @bolt/element as part of the broader perf updates ([e082868](https://github.com/boltdesignsystem/bolt/commit/e082868e2c731e40a746a3a25e78ca7ed66156ec))
# [2.29.0](https://github.com/boltdesignsystem/bolt/compare/v2.28.0...v2.29.0) (2020-11-23)

@@ -28,0 +59,0 @@

8

package.json
{
"name": "@bolt/element",
"version": "3.0.1",
"version": "3.1.0",
"description": "Web Component Base used in the Bolt Design System",

@@ -8,4 +8,4 @@ "license": "MIT",

"dependencies": {
"@bolt/core-v3.x": "^3.0.1",
"@bolt/polyfills": "^3.0.0",
"@bolt/core-v3.x": "^3.1.0",
"@bolt/polyfills": "^3.1.0",
"@open-wc/lit-helpers": "^0.3.5",

@@ -20,3 +20,3 @@ "camel-case": "^4.1.1",

"schema": "element.schemas.js",
"gitHead": "f0d3a40030f8161c39d43f82b06632bf54ad263f"
"gitHead": "3729b39e8361bd8fcb88ab140ab9856f17440833"
}

@@ -42,3 +42,9 @@ import { camelCase } from 'camel-case/dist.es2015/index';

// these schema props are never used by Web Components, only by Twig
const twigOnlyProps = ['attributes', 'content', 'items', 'children'];
const twigOnlyProps = [
'attributes',
'content',
'items',
'children',
'style',
];
const isTwigOnly = twigOnlyProps.includes(key.toLowerCase());

@@ -45,0 +51,0 @@

@@ -28,15 +28,23 @@ /* eslint-disable class-methods-use-this */

// Save a reference to the pseudoSlot content before lit-element renders
// 1. Always add at least a default slot to the slotMap. Otherwise, content added after the initial render will not appear.
saveSlots() {
Array.from(this.childNodes).forEach(child => {
const slot = this.assignSlotToContent(child);
const childNodes = Array.from(this.childNodes);
// Prevent dupes when `saveSlots` is run multiple times
if (this.slotMap.get(slot)?.includes(child)) return;
if (childNodes.length) {
childNodes.forEach(child => {
const slot = this.assignSlotToContent(child);
// Prevent dupes when `saveSlots` is run multiple times
if (this.slotMap.get(slot)?.includes(child)) return;
if (!child.textContent || child.textContent.trim().length > 0) {
this.addChildToSlotMap(slot, child);
} else if (slot && child instanceof HTMLElement) {
this.addChildToSlotMap(slot, child);
}
});
if (!child.textContent || child.textContent.trim().length > 0) {
this.addChildToSlotMap(slot, child);
} else if (slot && child instanceof HTMLElement) {
this.addChildToSlotMap(slot, child);
} else {
this.addChildToSlotMap('default', ''); // [1]
}
});
} else {
this.addChildToSlotMap('default', ''); // [1]
}
}

@@ -43,0 +51,0 @@

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