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

@polymer/polymer

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polymer/polymer - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

lib/mixins/disable-upgrade-mixin.html

2

.github/ISSUE_TEMPLATE.md

@@ -13,3 +13,3 @@ <!--

<!-- jsBin starting point (fork and edit) -->
https://jsbin.com/luhaxab/1/edit
https://jsbin.com/luhaxab/edit
<!-- glitch.me starting point (remix and edit -- must be logged in to persist!) -->

@@ -16,0 +16,0 @@ https://glitch.com/edit/#!/polymer-repro?path=my-element.html:2:0

@@ -24,7 +24,8 @@ {

"shadycss": "webcomponents/shadycss#^v1.1.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^v1.0.19"
"webcomponentsjs": "webcomponents/webcomponentsjs#^v1.1.0"
},
"devDependencies": {
"web-component-tester": "^6.0.0",
"test-fixture": "PolymerElements/test-fixture#3.0.0-rc.1"
"test-fixture": "PolymerElements/test-fixture#3.0.0-rc.1",
"iron-component-page": "PolymerElements/iron-component-page#^3.0.1"
},

@@ -31,0 +32,0 @@ "private": true,

@@ -152,1 +152,12 @@ # Contributing to Polymer

information on configuring the tool.
### Viewing the source documentation locally
You can view the updates you make to the source documentation locally with the following steps.
Make sure to rerun step 1 after every change you make.
1. Run `polymer analyze > analysis.json`
1. Run `polymer serve`
1. Open `http://127.0.0.1:PORT/components/polymer/` to view the documentation

@@ -85,2 +85,11 @@ /**

in `changedProps`
* @return {boolean}
*/
Polymer_PropertiesChanged.prototype._shouldPropertiesChange = function(currentProps, changedProps, oldProps){};
/**
* @param {!Object} currentProps Bag of all current accessor values
* @param {!Object} changedProps Bag of properties changed since the last
call to `_propertiesChanged`
* @param {!Object} oldProps Bag of previous values for each property
in `changedProps`
* @return {void}

@@ -1369,2 +1378,27 @@ */

*/
Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){};
Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){};
/**
* @interface
* @extends {Polymer_ElementMixin}
*/
function Polymer_DisableUpgradeMixin(){}
/**
* @override
*/
Polymer_DisableUpgradeMixin.prototype._initializeProperties = function(){};
/**
* @override
*/
Polymer_DisableUpgradeMixin.prototype._enableProperties = function(){};
/**
* @override
*/
Polymer_DisableUpgradeMixin.prototype.attributeChangedCallback = function(name, old, value){};
/**
* @override
*/
Polymer_DisableUpgradeMixin.prototype.connectedCallback = function(){};
/**
* @override
*/
Polymer_DisableUpgradeMixin.prototype.disconnectedCallback = function(){};
{
"exclude": [
"excludeFiles": [
"dist/**",

@@ -4,0 +4,0 @@ "externs/**",

/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http:polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http:polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http:polymer.github.io/CONTRIBUTORS.txt
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http:polymer.github.io/PATENTS.txt
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

@@ -27,3 +27,3 @@

const minimalDocument = require('./util/minimalDocument.js');
const dom5 = require('dom5');
const dom5 = require('dom5/lib/index-next');
const parse5 = require('parse5');

@@ -30,0 +30,0 @@ const replace = require('gulp-replace');

{
"name": "@polymer/polymer",
"version": "2.5.0",
"version": "2.6.0",
"description": "The Polymer library makes it easy to create your own web components. Give your element some markup and properties, and then use it on a site. Polymer provides features like dynamic templates and data binding to reduce the amount of boilerplate you need to write",

@@ -12,11 +12,11 @@ "main": "polymer.html",

"@polymer/gen-closure-declarations": "^0.4.0",
"@polymer/gen-typescript-declarations": "^0.3.6",
"@polymer/gen-typescript-declarations": "^1.2.0",
"@webcomponents/shadycss": "^1.1.0",
"@webcomponents/webcomponentsjs": "^1.0.22",
"@webcomponents/webcomponentsjs": "^1.1.0",
"babel-preset-minify": "^0.2.0",
"del": "^3.0.0",
"dom5": "^2.3.0",
"dom5": "^3.0.0",
"eslint-plugin-html": "^4.0.1",
"fs-extra": "^4.0.3",
"google-closure-compiler": "^20171112.0.0",
"fs-extra": "^5.0.0",
"google-closure-compiler": "^20180204.0.0",
"gulp": "^3.9.1",

@@ -27,7 +27,7 @@ "gulp-babel": "^6.1.2",

"gulp-replace": "^0.6.1",
"gulp-size": "^2.1.0",
"gulp-vulcanize": "^6.0.1",
"gulp-size": "^3.0.0",
"gulp-vulcanize": "^7.0.0",
"lazypipe": "^1.0.1",
"merge-stream": "^1.0.1",
"parse5": "^3.0.3",
"parse5": "^4.0.0",
"polymer-build": "^2.1.1",

@@ -34,0 +34,0 @@ "run-sequence": "^2.2.0",

@@ -30,2 +30,5 @@ # Polymer

⁉️ **Looking to use Polymer with npm?** Polymer 1.x and 2.x both use `bower` for version management, but v3 and on will use `npm`. Please see our [v3 announcement](https://www.polymer-project.org/blog/2017-08-22-npm-modules.html) and [v3 hand-on](https://www.polymer-project.org/blog/2017-08-23-hands-on-30-preview.html) to use a preview version of v3.
Versions before 3.0 are also published to npm "as-is" and are generally unsupported. These packages are for advanced users who configure their own tooling to work around the differences between Bower and npm packages, like package folder layout.
## Overview

@@ -32,0 +35,0 @@

@@ -32,3 +32,3 @@ /**

*/
function ArraySelectorMixin<T extends new (...args: any[]) => {}>(base: T): T & ArraySelectorMixinConstructor & Polymer.ElementMixinConstructor;
function ArraySelectorMixin<T extends new (...args: any[]) => {}>(base: T): T & ArraySelectorMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor;

@@ -35,0 +35,0 @@ interface ArraySelectorMixinConstructor {

@@ -37,8 +37,8 @@ /**

*
* ```
* ```html
* <!-- import apply shim--only required if using mixins -->
* <link rel="import href="bower_components/shadycss/apply-shim.html">
* <link rel="import" href="bower_components/shadycss/apply-shim.html">
* <!-- import custom-style element -->
* <link rel="import" href="bower_components/polymer/lib/elements/custom-style.html">
* ...
*
* <custom-style>

@@ -45,0 +45,0 @@ * <style>

@@ -36,2 +36,15 @@ /**

class DomModule extends HTMLElement {
/**
* The absolute URL of the original location of this `dom-module`.
*
* This value will differ from this element's `ownerDocument` in the
* following ways:
* - Takes into account any `assetpath` attribute added during bundling
* to indicate the original location relative to the bundled location
* - Uses the HTMLImports polyfill's `importForElement` API to ensure
* the path is relative to the import document's location since
* `ownerDocument` is not currently polyfilled
*
*/
readonly assetpath: any;

@@ -38,0 +51,0 @@

@@ -44,24 +44,26 @@ /**

*
* <script>
* class EmployeeList extends Polymer.Element {
* static get is() { return 'employee-list'; }
* static get properties() {
* return {
* employees: {
* value() {
* return [
* {first: 'Bob', last: 'Smith'},
* {first: 'Sally', last: 'Johnson'},
* ...
* ];
* }
* }
* };
* }
* }
* < /script>
*
* </dom-module>
* ```
*
* With the following custom element definition:
*
* ```js
* class EmployeeList extends Polymer.Element {
* static get is() { return 'employee-list'; }
* static get properties() {
* return {
* employees: {
* value() {
* return [
* {first: 'Bob', last: 'Smith'},
* {first: 'Sally', last: 'Johnson'},
* ...
* ];
* }
* }
* };
* }
* }
* ```
*
* Notifications for changes to items sub-properties will be forwarded to template

@@ -68,0 +70,0 @@ * instances, which will update via the normal structured data notification system.

@@ -29,3 +29,3 @@ /**

*/
function LegacyElementMixin<T extends new (...args: any[]) => {}>(base: T): T & LegacyElementMixinConstructor & Polymer.ElementMixinConstructor & Polymer.GestureEventListenersConstructor;
function LegacyElementMixin<T extends new (...args: any[]) => {}>(base: T): T & LegacyElementMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor & Polymer.GestureEventListenersConstructor;

@@ -32,0 +32,0 @@ interface LegacyElementMixinConstructor {

@@ -69,2 +69,4 @@ /**

const MutableDataBehavior: object;
/**

@@ -132,2 +134,4 @@ * Legacy element behavior to add the optional ability to skip strict

}
const OptionalMutableDataBehavior: object;
}

@@ -178,3 +178,3 @@ /**

*/
readonly path: Array<EventTarget|null>;
readonly path: EventTarget[];
}

@@ -114,2 +114,4 @@ /**

}
const Templatizer: object;
}

@@ -32,3 +32,3 @@ /**

*/
function DirMixin<T extends new (...args: any[]) => {}>(base: T): T & DirMixinConstructor & Polymer.PropertyAccessorsConstructor;
function DirMixin<T extends new (...args: any[]) => {}>(base: T): T & DirMixinConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor;

@@ -35,0 +35,0 @@ interface DirMixinConstructor {

@@ -79,3 +79,3 @@ /**

*/
function ElementMixin<T extends new (...args: any[]) => {}>(base: T): T & ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.PropertiesMixinConstructor;
function ElementMixin<T extends new (...args: any[]) => {}>(base: T): T & ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor;

@@ -202,2 +202,5 @@ interface ElementMixinConstructor {

*
* Note: This function does not support updating CSS mixins.
* You can not dynamically change the value of an `@apply`.
*
* @param properties Bag of custom property key/values to

@@ -204,0 +207,0 @@ * apply to this element.

@@ -59,3 +59,3 @@ /**

*/
typeForProperty(name: string): any;
typeForProperty(name: string): void;
}

@@ -88,3 +88,3 @@

*/
_addPropertyToAttributeMap(property: string): any;
_addPropertyToAttributeMap(property: string): void;

@@ -188,2 +188,17 @@ /**

/**
* Called in `_flushProperties` to determine if `_propertiesChanged`
* should be called. The default implementation returns true if
* properties are pending. Override to customize when
* `_propertiesChanged` is called.
*
* @param currentProps Bag of all current accessor values
* @param changedProps Bag of properties changed since the last
* call to `_propertiesChanged`
* @param oldProps Bag of previous values for each property
* in `changedProps`
* @returns true if changedProps is truthy
*/
_shouldPropertiesChange(currentProps: object, changedProps: object, oldProps: object): boolean;
/**
* Callback called when any properties with accessors created via

@@ -190,0 +205,0 @@ * `_createPropertyAccessor` have been set.

@@ -56,3 +56,3 @@ /**

*/
_finalizeClass(): any;
_finalizeClass(): void;
}

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

@@ -27,10 +27,10 @@ /**

* - Declare attributes to observe via the standard `static get observedAttributes()`. Use
* `dash-case` attribute names to represent `camelCase` property names.
* `dash-case` attribute names to represent `camelCase` property names.
* - Implement the `_propertiesChanged` callback on the class.
* - Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate
* property accessors for each observed attribute. This must be called before the first
* - Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate
* property accessors for each observed attribute. This must be called before the first
* instance is created, for example, by calling it before calling `customElements.define`.
* It can also be called lazily from the element's `constructor`, as long as it's guarded so
* that the call is only made once, when the first instance is created.
* - Call `this._enableProperties()` in the element's `connectedCallback` to enable
* - Call `this._enableProperties()` in the element's `connectedCallback` to enable
* the accessors.

@@ -37,0 +37,0 @@ *

@@ -49,3 +49,3 @@ /**

*/
function PropertyEffects<T extends new (...args: any[]) => {}>(base: T): T & PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor;
function PropertyEffects<T extends new (...args: any[]) => {}>(base: T): T & PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor;

@@ -52,0 +52,0 @@ interface PropertyEffectsConstructor {

@@ -51,10 +51,10 @@ /**

*
* static get template() {
* return Polymer.html`
* <style>:host{ content:"..." }</style>
* <div class="shadowed">${this.partialTemplate}</div>
* ${super.template}
* `;
* }
* static get partialTemplate() { return Polymer.html`<span>Partial!</span>`; }
* static get template() {
* return Polymer.html`
* <style>:host{ content:"..." }</style>
* <div class="shadowed">${this.partialTemplate}</div>
* ${super.template}
* `;
* }
* static get partialTemplate() { return Polymer.html`<span>Partial!</span>`; }
*

@@ -72,13 +72,13 @@ * @returns Constructed HTMLTemplateElement

*
* static get template() {
* return Polymer.html`
* <style>
* :host { display: block; }
* ${styleTemplate}
* </style>
* <div class="shadowed">${staticValue}</div>
* ${super.template}
* `;
* }
* static get styleTemplate() { return Polymer.htmlLiteral`.shadowed { background: gray; }`; }
* static get template() {
* return Polymer.html`
* <style>
* :host { display: block; }
* ${styleTemplate}
* </style>
* <div class="shadowed">${staticValue}</div>
* ${super.template}
* `;
* }
* static get styleTemplate() { return Polymer.htmlLiteral`.shadowed { background: gray; }`; }
*

@@ -85,0 +85,0 @@ * @returns Constructed literal string

@@ -74,4 +74,5 @@ /**

* @param event Event to dispatch
* @returns Always true.
*/
dispatchEvent(event: Event|null): any;
dispatchEvent(event: Event|null): boolean;
}

@@ -87,2 +88,35 @@

/**
* Module for preparing and stamping instances of templates that utilize
* Polymer's data-binding and declarative event listener features.
*
* Example:
*
* // Get a template from somewhere, e.g. light DOM
* let template = this.querySelector('template');
* // Prepare the template
* let TemplateClass = Polymer.Templatize.templatize(template);
* // Instance the template with an initial data model
* let instance = new TemplateClass({myProp: 'initial'});
* // Insert the instance's DOM somewhere, e.g. element's shadow DOM
* this.shadowRoot.appendChild(instance.root);
* // Changing a property on the instance will propagate to bindings
* // in the template
* instance.myProp = 'new value';
*
* The `options` dictionary passed to `templatize` allows for customizing
* features of the generated template class, including how outer-scope host
* properties should be forwarded into template instances, how any instance
* properties added into the template's scope should be notified out to
* the host, and whether the instance should be decorated as a "parent model"
* of any event handlers.
*
* // Customize property forwarding and event model decoration
* let TemplateClass = Polymer.Templatize.templatize(template, this, {
* parentModel: true,
* forwardHostProp(property, value) {...},
* instanceProps: {...},
* notifyInstanceProp(instance, property, value) {...},
* });
*/
namespace Templatize {

@@ -134,2 +168,7 @@

*
* All callbacks are called bound to the `owner`. Any context
* needed for the callbacks (such as references to `instances` stamped)
* should be stored on the `owner` such that they can be retrieved via
* `this`.
*
* When `options.forwardHostProp` is declared as an option, any properties

@@ -144,10 +183,14 @@ * referenced in the template will be automatically forwarded from the host of

*
* Note that the class returned from `templatize` is generated only once
* for a given `<template>` using `options` from the first call for that
* template, and the cached class is returned for all subsequent calls to
* `templatize` for that template. As such, `options` callbacks should not
* close over owner-specific properties since only the first `options` is
* used; rather, callbacks are called bound to the `owner`, and so context
* needed from the callbacks (such as references to `instances` stamped)
* should be stored on the `owner` such that they can be retrieved via `this`.
* Note that `templatize()` can be run only once for a given `<template>`.
* Further calls will result in an error. Also, there is a special
* behavior if the template was duplicated through a mechanism such as
* `<dom-repeat>` or `<test-fixture>`. In this case, all calls to
* `templatize()` return the same class for all duplicates of a template.
* The class returned from `templatize()` is generated only once using
* the `options` from the first call. This means that any `options`
* provided to subsequent calls will be ignored. Therefore, it is very
* important not to close over any variables inside the callbacks. Also,
* arrow functions must be avoided because they bind the outer `this`.
* Inside the callbacks, any contextual information can be accessed
* through `this`, which points to the `owner`.
*

@@ -154,0 +197,0 @@ * @returns Generated class bound to the template

/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http:polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http:polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http:polymer.github.io/CONTRIBUTORS.txt
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http:polymer.github.io/PATENTS.txt
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

@@ -10,0 +10,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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

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

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

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

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

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

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

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

Sorry, the diff of this file is not supported yet

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