@vaadin/vaadin-usage-statistics
Advanced tools
Comparing version 1.0.6-pre.1 to 1.0.6-pre.2
@@ -9,3 +9,3 @@ { | ||
"name": "@vaadin/vaadin-usage-statistics", | ||
"version": "1.0.6-pre.1", | ||
"version": "1.0.6-pre.2", | ||
"main": "index.js", | ||
@@ -12,0 +12,0 @@ "directories": { |
@@ -82,13 +82,59 @@ (function() { | ||
get knownVaadinElementNames() { | ||
if (!this._knownVaadinElementNames) { | ||
const names = [ | ||
'vaadin-button', | ||
'vaadin-checkbox', | ||
'vaadin-combo-box', | ||
'vaadin-context-menu', | ||
'vaadin-date-picker', | ||
'vaadin-dialog', | ||
'vaadin-dropdown-menu', | ||
'vaadin-form-layout', | ||
'vaadin-grid', | ||
'vaadin-horizontal-layout', | ||
'vaadin-icons', | ||
'vaadin-item', | ||
'vaadin-list-box', | ||
'vaadin-notification', | ||
'vaadin-password-field', | ||
'vaadin-progress-bar', | ||
'vaadin-radio-button', | ||
'vaadin-split-layout', | ||
'vaadin-tab', | ||
'vaadin-tabs', | ||
'vaadin-text-area', | ||
'vaadin-text-field', | ||
'vaadin-upload', | ||
'vaadin-vertical-layout' | ||
]; | ||
this._knownVaadinElementNames = names; | ||
} | ||
return this._knownVaadinElementNames; | ||
} | ||
getUsedVaadinElementVersion(elementName) { | ||
const klass = customElements.get(elementName); | ||
if (klass) { | ||
return klass.version || "0.0.0"; | ||
} | ||
} | ||
getUsedVaadinElements(elements) { | ||
const elementClasses = Object.keys(window.Vaadin).map(c => window.Vaadin[c]).filter(c => c.is); | ||
elementClasses.forEach(cls => { | ||
const version = cls.version ? cls.version : "0.0.0"; | ||
elements[cls.is] = { "version": version }; | ||
this.knownVaadinElementNames.forEach(elementName => { | ||
const version = this.getUsedVaadinElementVersion(elementName); | ||
if (version) { | ||
elements[elementName] = {version}; | ||
} | ||
}); | ||
} | ||
getUsedVaadinThemes(themes) { | ||
if (window.Vaadin && window.Vaadin.Lumo) { | ||
themes["Lumo"] = { version: window.Vaadin.Lumo.version }; | ||
} | ||
[ | ||
'Lumo' | ||
].forEach(themeName => { | ||
const elementName = `vaadin-${themeName.toLowerCase()}-styles`; | ||
const version = this.getUsedVaadinElementVersion(elementName); | ||
if (version) { | ||
themes[themeName] = {version}; | ||
} | ||
}); | ||
} | ||
@@ -245,3 +291,3 @@ getFrameworks(frameworks) { | ||
static get version() { | ||
return '1.0.1'; | ||
return '1.0.6-pre.2'; | ||
} | ||
@@ -248,0 +294,0 @@ static get firstUseKey() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
26583
351
0