New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dbp-toolkit/language-select

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dbp-toolkit/language-select - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

dist/shared/language-select.spN_q76y.es.js

203

dist/dbp-language-select-demo.js

@@ -1,3 +0,204 @@

import { a as Logger, S as ScopedElementsMixin, A as AdapterLitElement, L as LanguageSelect, k as ke, d as defineCustomElement, c as createInstance, s as setOverrides } from './shared/language-select.CEV4RvHX.es.js';
import { a as dedupeMixin, S, b as Logger, A as AdapterLitElement, L as LanguageSelect, k as ke, d as defineCustomElement, c as createInstance, s as setOverrides } from './shared/language-select.spN_q76y.es.js';
/**
* @typedef {import('./types').RenderOptions} RenderOptions
* @typedef {import('./types').ScopedElementsMixin} ScopedElementsMixin
* @typedef {import('./types').ScopedElementsHost} ScopedElementsHost
* @typedef {import('./types').ScopedElementsMap} ScopedElementsMap
* @typedef {import('@lit/reactive-element').CSSResultOrNative} CSSResultOrNative
*/
const version = '2.2.2';
// eslint-disable-next-line dot-notation
const versions = window['scopedElementsVersions'] || (window['scopedElementsVersions'] = []);
if (!versions.includes(version)) {
versions.push(version);
}
// @ts-ignore
const supportsScopedRegistry = !!ShadowRoot.prototype.createElement;
/**
* @template {import('./types').Constructor<HTMLElement>} T
* @param {T} superclass
* @return {T & import('./types').Constructor<ScopedElementsHost>}
*/
const ScopedElementsMixinImplementation = superclass =>
/** @type {ScopedElementsHost} */
class ScopedElementsHost extends superclass {
/**
* Obtains the scoped elements definitions map if specified.
*
* @returns {ScopedElementsMap}
*/
static get scopedElements() {
return {};
}
static get scopedElementsVersion() {
return version;
}
/**
* Obtains the ShadowRoot options.
*
* @type {ShadowRootInit}
*/
static get shadowRootOptions() {
return this.__shadowRootOptions;
}
/**
* Set the shadowRoot options.
*
* @param {ShadowRootInit} value
*/
static set shadowRootOptions(value) {
this.__shadowRootOptions = value;
}
/**
* Obtains the element styles.
*
* @returns {CSSResultOrNative[]}
*/
static get elementStyles() {
return this.__elementStyles;
}
static set elementStyles(styles) {
this.__elementStyles = styles;
}
// either TS or ESLint will complain here
// eslint-disable-next-line no-unused-vars
constructor(..._args) {
super();
/** @type {RenderOptions} */
this.renderOptions = this.renderOptions || undefined;
}
/**
* Obtains the CustomElementRegistry associated to the ShadowRoot.
*
* @returns {CustomElementRegistry}
*/
get registry() {
// @ts-ignore
return this.constructor.__registry;
}
/**
* Set the CustomElementRegistry associated to the ShadowRoot
*
* @param {CustomElementRegistry} registry
*/
set registry(registry) {
// @ts-ignore
this.constructor.__registry = registry;
}
createRenderRoot() {
const { scopedElements, shadowRootOptions, elementStyles } =
/** @type {typeof ScopedElementsHost} */ (this.constructor);
const shouldCreateRegistry =
!this.registry ||
// @ts-ignore
(this.registry === this.constructor.__registry &&
!Object.prototype.hasOwnProperty.call(this.constructor, '__registry'));
/**
* Create a new registry if:
* - the registry is not defined
* - this class doesn't have its own registry *AND* has no shared registry
*/
if (shouldCreateRegistry) {
this.registry = supportsScopedRegistry ? new CustomElementRegistry() : customElements;
for (const [tagName, klass] of Object.entries(scopedElements)) {
this.defineScopedElement(tagName, klass);
}
}
/** @type {ShadowRootInit} */
const options = {
mode: 'open',
...shadowRootOptions,
customElements: this.registry,
registry: this.registry,
};
const createdRoot = this.attachShadow(options);
if (supportsScopedRegistry) {
this.renderOptions.creationScope = createdRoot;
}
if (createdRoot instanceof ShadowRoot) {
S(createdRoot, elementStyles);
this.renderOptions.renderBefore = this.renderOptions.renderBefore || createdRoot.firstChild;
}
return createdRoot;
}
createScopedElement(tagName) {
const root = supportsScopedRegistry ? this.shadowRoot : document;
// @ts-ignore polyfill to support createElement on shadowRoot is loaded
return root.createElement(tagName);
}
/**
* Defines a scoped element.
*
* @param {string} tagName
* @param {typeof HTMLElement} klass
*/
defineScopedElement(tagName, klass) {
const registeredClass = this.registry.get(tagName);
if (registeredClass && supportsScopedRegistry === false && registeredClass !== klass) {
// eslint-disable-next-line no-console
console.error(
[
`You are trying to re-register the "${tagName}" custom element with a different class via ScopedElementsMixin.`,
'This is only possible with a CustomElementRegistry.',
'Your browser does not support this feature so you will need to load a polyfill for it.',
'Load "@webcomponents/scoped-custom-element-registry" before you register ANY web component to the global customElements registry.',
'e.g. add "<script src="/node_modules/@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js"></script>" as your first script tag.',
'For more details you can visit https://open-wc.org/docs/development/scoped-elements/',
].join('\n'),
);
}
if (!registeredClass) {
return this.registry.define(tagName, klass);
}
return this.registry.get(tagName);
}
/**
* @deprecated use the native el.tagName instead
*
* @param {string} tagName
* @returns {string} the tag name
*/
// eslint-disable-next-line class-methods-use-this
getScopedTagName(tagName) {
// @ts-ignore
return this.constructor.getScopedTagName(tagName);
}
/**
* @deprecated use the native el.tagName instead
*
* @param {string} tagName
* @returns {string} the tag name
*/
// eslint-disable-next-line class-methods-use-this
static getScopedTagName(tagName) {
// @ts-ignore
return this.__registry.get(tagName) ? tagName : undefined;
}
};
const ScopedElementsMixin = dedupeMixin(ScopedElementsMixinImplementation);
class Provider extends HTMLElement {

@@ -4,0 +205,0 @@ constructor() {

2

dist/dbp-language-select.js

@@ -1,4 +0,4 @@

import { d as defineCustomElement, L as LanguageSelect } from './shared/language-select.CEV4RvHX.es.js';
import { d as defineCustomElement, L as LanguageSelect } from './shared/language-select.spN_q76y.es.js';
defineCustomElement('dbp-language-select', LanguageSelect);
//# sourceMappingURL=dbp-language-select.js.map
{
"name": "@dbp-toolkit/language-select",
"homepage": "https://github.com/digital-blueprint/toolkit/tree/main/packages/language-select",
"version": "0.3.4",
"version": "0.3.5",
"type": "module",

@@ -43,5 +43,5 @@ "main": "src/index.js",

"dependencies": {
"@dbp-toolkit/common": "^0.3.11",
"@dbp-toolkit/provider": "^0.2.11",
"@open-wc/scoped-elements": "^3.0.5",
"@dbp-toolkit/common": "^0.3.12",
"@dbp-toolkit/provider": "^0.2.12",
"@open-wc/scoped-elements": "^2.1.0",
"lit": "^3.0.0"

@@ -65,3 +65,3 @@ },

},
"gitHead": "8b2032fcf77b68f7b0ed81c4da0ae4c4fde66127"
"gitHead": "76d106e21d7e9c4403fabab792b1941d8d70160b"
}
import {html} from 'lit';
import {LanguageSelect} from './language-select.js';
import * as commonUtils from '@dbp-toolkit/common/utils';
import {AdapterLitElement, ScopedElementsMixin} from '@dbp-toolkit/common';
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
import {AdapterLitElement} from '@dbp-toolkit/common';
import {Provider} from "@dbp-toolkit/provider";

@@ -6,0 +7,0 @@ import {createInstance, setOverrides} from './i18n.js';

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