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

@granite-elements/granite-c3

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@granite-elements/granite-c3 - npm Package Compare versions

Comparing version 3.0.2 to 3.1.0

3

.eslintrc.json
{
"extends": ["eslint:recommended", "google"],
"parserOptions": {
"ecmaVersion": 6
"ecmaVersion": 6,
"sourceType": "module"
},

@@ -6,0 +7,0 @@ "env": {

@@ -5,22 +5,4 @@

import '@granite-elements/granite-js-dependencies-grabber/granite-js-dependencies-grabber.js';
import { GraniteCssInjector } from '@granite-elements/granite-external-dependencies/granite-css-injector.js'
/*
* We need to get the C3 CSS to inject in in every instance of granite-c3
*/
let c3Css = null;
function pathFromUrl(url) {
return url.substring(0, url.lastIndexOf('/') + 1);
}
async function getC3Css() {
let response = await fetch(`${pathFromUrl(import.meta.url)}../../c3/c3.min.css`);
c3Css = await response.text();
console.log('[granite-c3] getC3Css', c3Css);
document.dispatchEvent(new CustomEvent('c3-css-available'));
}
getC3Css();
/* global c3 */

@@ -51,3 +33,3 @@ /**

*/
class GraniteC3 extends PolymerElement {
class GraniteC3 extends GraniteCssInjector(PolymerElement) {
static get template() {

@@ -76,2 +58,3 @@ return html`

}
/**

@@ -86,2 +69,9 @@ * In order to statically import non ES mudules resources, you need to use `importPath`.

static get cssFiles() {
return [
{ name: 'c3', path: 'c3/c3.min.css' }
];
}
static get is() { return 'granite-c3'; }

@@ -304,16 +294,2 @@ static get properties() {

super.connectedCallback();
if (c3Css) {
if (this.debug) {
console.log('[granite-c3] connectedCallback - CSS already available');
}
} else {
if (this.debug) {
console.log('[granite-c3] connectedCallback - CSS not yet available');
}
document.addEventListener('c3-css-available', (evt) => {
console.log('[granite-c3] connectedCallback - received CSS available method');
this.shadowRoot.querySelector('style').appendChild(document.createTextNode(c3Css));
})
}
}

@@ -320,0 +296,0 @@

@@ -17,3 +17,3 @@ {

"name": "@granite-elements/granite-c3",
"version": "3.0.2",
"version": "3.1.0",
"resolutions": {

@@ -30,2 +30,3 @@ "inherits": "2.0.3",

"dependencies": {
"@granite-elements/granite-external-dependencies": "^1.0.0",
"@granite-elements/granite-js-dependencies-grabber": "^2.0.3",

@@ -32,0 +33,0 @@ "@polymer/lit-element": "^0.5.1",

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