From 070631b8e4a58b793cd71576ad721d4e093f34c9 Mon Sep 17 00:00:00 2001 From: Marcin Lulek Date: Wed, 3 May 2017 02:34:33 +0200 Subject: [PATCH] bump polymer to 2.0 rc7 --- .../bower_components/polymer/README.md | 6 +- .../bower_components/polymer/bower.json | 6 +- .../polymer/externs/closure-types.js | 773 ++++++++++ .../externs/closure-upstream-externs.js | 74 - .../polymer/externs/polymer-externs.js | 11 +- .../polymer/externs/webcomponents-externs.js | 10 - .../polymer/lib/elements/array-selector.html | 24 +- .../polymer/lib/elements/dom-bind.html | 16 +- .../polymer/lib/elements/dom-module.html | 14 +- .../polymer/lib/elements/dom-repeat.html | 16 +- .../polymer/lib/legacy/class.html | 55 +- .../lib/legacy/legacy-element-mixin.html | 105 +- .../polymer/lib/legacy/polymer-fn.html | 1 + .../polymer/lib/legacy/polymer.dom.html | 2 + .../lib/legacy/templatizer-behavior.html | 6 +- .../polymer/lib/mixins/element-mixin.html | 243 ++- .../lib/mixins/gesture-event-listeners.html | 16 +- .../polymer/lib/mixins/mutable-data.html | 26 +- .../lib/mixins/property-accessors.html | 136 +- .../polymer/lib/mixins/property-effects.html | 1312 ++++++++++------- .../polymer/lib/mixins/template-stamp.html | 722 +++++---- .../polymer/lib/utils/array-splice.html | 25 + .../polymer/lib/utils/async.html | 27 +- .../polymer/lib/utils/boot.html | 25 +- .../polymer/lib/utils/debounce.html | 25 +- .../lib/utils/flattened-nodes-observer.html | 2 +- .../polymer/lib/utils/gestures.html | 35 +- .../polymer/lib/utils/import-href.html | 1 - .../polymer/lib/utils/mixin.html | 11 +- .../polymer/lib/utils/path.html | 8 +- .../polymer/lib/utils/render-status.html | 38 +- .../polymer/lib/utils/style-gather.html | 3 +- .../polymer/lib/utils/templatize.html | 65 +- .../bower_components/polymer/package.json | 10 +- .../polymer/polymer-element.html | 2 + .../shadycss/apply-shim.min.js | 32 +- .../shadycss/apply-shim.min.js.map | 2 +- .../bower_components/shadycss/bower.json | 25 +- .../shadycss/custom-style-interface.min.js | 4 +- .../custom-style-interface.min.js.map | 2 +- .../shadycss/entrypoints/apply-shim.js | 22 +- .../bower_components/shadycss/gulpfile.js | 6 +- .../bower_components/shadycss/package.json | 16 +- .../shadycss/scoping-shim.min.js | 71 +- .../shadycss/scoping-shim.min.js.map | 2 +- .../webcomponentsjs/README.md | 26 +- .../webcomponentsjs/bower.json | 24 +- ...-es5.js => custom-elements-es5-adapter.js} | 4 +- ...s => custom-elements-es5-adapter-index.js} | 7 - .../entrypoints/webcomponents-sd-ce-index.js | 26 + .../webcomponentsjs/externs/webcomponents.js | 22 + .../webcomponentsjs/gulpfile.js | 16 +- .../webcomponentsjs/package.json | 12 +- .../tests/ce-import-upgrade-async.html | 46 + .../tests/ce-import-upgrade.html | 31 + .../webcomponentsjs/tests/ce-import.html | 38 + .../tests/ce-upgrade-order.html | 36 + .../tests/ce-upgradedocumenttree.html | 56 + .../tests/dev-loader-swizzled.html | 32 + .../webcomponentsjs/tests/dev-loader.html | 32 + .../tests/force-polyfills.html | 40 + .../tests/imports/a1-define.html | 32 + .../tests/imports/a1-import.html | 11 + .../imports/a1-instance.html} | 19 +- .../tests/imports/a1-reference.html | 19 + .../tests/imports/csp-import-1.html | 11 + .../tests/imports/csp-import-2.html | 10 + .../tests/imports/csp-script-1.js | 11 + .../tests/imports/csp-script-2.js | 11 + .../tests/imports/current-script.js | 13 + .../tests/imports/element-import-a.html | 11 + .../tests/imports/element-import-b.html | 11 + .../tests/imports/element-import.html | 20 + .../tests/imports/import-file.html | 12 + .../tests/imports/import-upgrade-order.html | 10 + .../tests/imports/script-1.html | 16 + .../tests/imports/script-2.html | 15 + .../tests/imports/simple-element-es5.html | 54 + .../tests/imports/simple-element.html | 42 + .../tests/integration-es5.html | 62 + .../webcomponentsjs/tests/integration.html | 61 + .../webcomponentsjs/tests/load.html | 53 + .../webcomponentsjs/tests/runner.html | 34 + .../webcomponentsjs/tests/smoke.html | 53 + .../tests/template-and-CE.html | 72 + .../tests/template-and-imports.html | 66 + .../webcomponents-es5-loader.js | 52 - .../webcomponents-hi-ce-es5.js | 16 - .../webcomponentsjs/webcomponents-hi-ce.js | 85 +- .../webcomponents-hi-ce.js.map | 2 +- .../webcomponentsjs/webcomponents-hi-sd-ce.js | 275 ++-- .../webcomponents-hi-sd-ce.js.map | 2 +- .../webcomponentsjs/webcomponents-hi.js | 33 +- .../webcomponentsjs/webcomponents-hi.js.map | 2 +- .../webcomponentsjs/webcomponents-lite.js | 307 ++-- .../webcomponentsjs/webcomponents-lite.js.map | 2 +- .../webcomponentsjs/webcomponents-loader.js | 42 +- .../webcomponentsjs/webcomponents-sd-ce.js | 236 +-- .../webcomponents-sd-ce.js.map | 2 +- 99 files changed, 4243 insertions(+), 2023 deletions(-) create mode 100644 lib/polymer2/bower_components/polymer/externs/closure-types.js delete mode 100644 lib/polymer2/bower_components/polymer/externs/closure-upstream-externs.js rename lib/polymer2/bower_components/webcomponentsjs/{webcomponents-ce-es5.js => custom-elements-es5-adapter.js} (78%) rename lib/polymer2/bower_components/webcomponentsjs/entrypoints/{webcomponents-ce-es5-index.js => custom-elements-es5-adapter-index.js} (81%) create mode 100644 lib/polymer2/bower_components/webcomponentsjs/externs/webcomponents.js create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/ce-import-upgrade-async.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/ce-import-upgrade.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/ce-import.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/ce-upgrade-order.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/ce-upgradedocumenttree.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/dev-loader-swizzled.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/dev-loader.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/force-polyfills.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/a1-define.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/a1-import.html rename lib/polymer2/bower_components/webcomponentsjs/{entrypoints/webcomponents-hi-ce-es5-index.js => tests/imports/a1-instance.html} (53%) create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/a1-reference.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/csp-import-1.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/csp-import-2.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/csp-script-1.js create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/csp-script-2.js create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/current-script.js create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/element-import-a.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/element-import-b.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/element-import.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/import-file.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/import-upgrade-order.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/script-1.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/script-2.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/simple-element-es5.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/imports/simple-element.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/integration-es5.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/integration.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/load.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/runner.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/smoke.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/template-and-CE.html create mode 100644 lib/polymer2/bower_components/webcomponentsjs/tests/template-and-imports.html delete mode 100644 lib/polymer2/bower_components/webcomponentsjs/webcomponents-es5-loader.js delete mode 100644 lib/polymer2/bower_components/webcomponentsjs/webcomponents-hi-ce-es5.js diff --git a/lib/polymer2/bower_components/polymer/README.md b/lib/polymer2/bower_components/polymer/README.md index f1517d1c..52bb45ab 100644 --- a/lib/polymer2/bower_components/polymer/README.md +++ b/lib/polymer2/bower_components/polymer/README.md @@ -367,9 +367,7 @@ Note that `Polymer.Element` provides a cleaner base class void of a lot of sugar See below for a visual guide on migrating Polymer 1.0's declarative syntax to the ES6 class syntax in Polymer 2.0: - -![image](img/migration.png) - +![Difference in Polymer 1.0 and Polymer 2.0 element definition](img/migration.png) ## Polyfills @@ -488,7 +486,7 @@ configure the module name. The only supported declarative way set the module id is to use `id`. * `element.getPropertyInfo`: This api returned unexpected information some of the time and was rarely used. * `element.getNativePrototype`: Removed because it is no longer needed for internal code and was unused by users. -* `element.beforeRegister`: This was originally added for metadata compatibility with ES6 classes. We now prefer users create ES6 classes by extending `Polymer.Element`, specifying metadata in the static `config` property. For legacy use via `Polymer({...})`, dynamic effects may now be added using the `registered` lifecycle method. +* `element.beforeRegister`: This was originally added for metadata compatibility with ES6 classes. We now prefer users create ES6 classes by extending `Polymer.Element`, specifying metadata in the static `properties`, `observers`, and `is` properties. For legacy use via `Polymer({...})`, dynamic effects may still be added by using `beforeRegister` but it is now equivalent to the `registered` lifecycle method. An element's `is` property cannot be set in `beforeRegister` as it could in Polymer 1.x. * `element.attributeFollows`: Removed due to disuse. * `element.classFollows`: Removed due to disuse. * `element.copyOwnProperty`: Removed due to disuse. diff --git a/lib/polymer2/bower_components/polymer/bower.json b/lib/polymer2/bower_components/polymer/bower.json index afee3e29..5a5af4aa 100644 --- a/lib/polymer2/bower_components/polymer/bower.json +++ b/lib/polymer2/bower_components/polymer/bower.json @@ -1,6 +1,6 @@ { "name": "polymer", - "version": "2.0.0-rc.2", + "version": "2.0.0-rc.7", "main": [ "polymer.html" ], @@ -21,8 +21,8 @@ "url": "https://github.com/Polymer/polymer.git" }, "dependencies": { - "shadycss": "webcomponents/shadycss#v1.0.0-rc.1", - "webcomponentsjs": "v1.0.0-rc.5" + "shadycss": "webcomponents/shadycss#^v1.0.0-rc.1", + "webcomponentsjs": "^v1.0.0-rc.5" }, "devDependencies": { "web-component-tester": "^5", diff --git a/lib/polymer2/bower_components/polymer/externs/closure-types.js b/lib/polymer2/bower_components/polymer/externs/closure-types.js new file mode 100644 index 00000000..eadc31f6 --- /dev/null +++ b/lib/polymer2/bower_components/polymer/externs/closure-types.js @@ -0,0 +1,773 @@ + +/** + * @fileoverview Closure types for Polymer mixins + * @externs + * + * This file is generated, do not edit manually + */ +/* eslint-disable no-unused-vars, strict */ + +/** +* @record +*/ +function Polymer_PropertyAccessors(){} +/** +*/ +Polymer_PropertyAccessors.prototype._initializeProperties = function(){}; +/** +* @param {Object} props +*/ +Polymer_PropertyAccessors.prototype._initializeProtoProperties = function(props){}; +/** +* @param {Object} props +*/ +Polymer_PropertyAccessors.prototype._initializeInstanceProperties = function(props){}; +/** +* @param {string} attribute +* @param {string} value +*/ +Polymer_PropertyAccessors.prototype._ensureAttribute = function(attribute, value){}; +/** +* @param {string} attribute +* @param {string} value +* @param {*} type +*/ +Polymer_PropertyAccessors.prototype._attributeToProperty = function(attribute, value, type){}; +/** +* @param {string} property +* @param {string=} attribute +* @param {*=} value +*/ +Polymer_PropertyAccessors.prototype._propertyToAttribute = function(property, attribute, value){}; +/** +* @param {Element} node +* @param {*} value +* @param {string} attribute +*/ +Polymer_PropertyAccessors.prototype._valueToNodeAttribute = function(node, value, attribute){}; +/** +* @param {*} value +* @return {(string|undefined)} +*/ +Polymer_PropertyAccessors.prototype._serializeValue = function(value){}; +/** +* @param {string} value +* @param {*} type +* @return {*} +*/ +Polymer_PropertyAccessors.prototype._deserializeValue = function(value, type){}; +/** +* @param {string} property +* @param {boolean=} readOnly +*/ +Polymer_PropertyAccessors.prototype._createPropertyAccessor = function(property, readOnly){}; +/** +* @param {string} property +* @return {boolean} +*/ +Polymer_PropertyAccessors.prototype._hasAccessor = function(property){}; +/** +* @param {string} property +* @param {*} value +*/ +Polymer_PropertyAccessors.prototype._setProperty = function(property, value){}; +/** +* @param {string} property +* @param {*} value +* @return {boolean} +*/ +Polymer_PropertyAccessors.prototype._setPendingProperty = function(property, value){}; +/** +* @param {string} prop +* @return {boolean} +*/ +Polymer_PropertyAccessors.prototype._isPropertyPending = function(prop){}; +/** +*/ +Polymer_PropertyAccessors.prototype._invalidateProperties = function(){}; +/** +*/ +Polymer_PropertyAccessors.prototype._flushProperties = function(){}; +/** +*/ +Polymer_PropertyAccessors.prototype.ready = function(){}; +/** +* @param {Object} currentProps +* @param {Object} changedProps +* @param {Object} oldProps +*/ +Polymer_PropertyAccessors.prototype._propertiesChanged = function(currentProps, changedProps, oldProps){}; +/** +* @param {string} property +* @param {*} value +* @param {*} old +* @return {boolean} +*/ +Polymer_PropertyAccessors.prototype._shouldPropertyChange = function(property, value, old){}; +/** +* @record +*/ +function Polymer_TemplateStamp(){} +/** +*/ +Polymer_TemplateStamp.prototype._initializeProperties = function(){}; +/** +* @param {HTMLTemplateElement} template +* @return {DocumentFragment} +*/ +Polymer_TemplateStamp.prototype._stampTemplate = function(template){}; +/** +* @param {Node} node +* @param {string} eventName +* @param {string} methodName +* @param {*=} context +* @return {Function} +*/ +Polymer_TemplateStamp.prototype._addMethodEventListenerToNode = function(node, eventName, methodName, context){}; +/** +* @param {Node} node +* @param {string} eventName +* @param {Function} handler +*/ +Polymer_TemplateStamp.prototype._addEventListenerToNode = function(node, eventName, handler){}; +/** +* @param {Node} node +* @param {string} eventName +* @param {Function} handler +*/ +Polymer_TemplateStamp.prototype._removeEventListenerFromNode = function(node, eventName, handler){}; +/** +* @record +* @extends {Polymer_TemplateStamp} +* @extends {Polymer_PropertyAccessors} +*/ +function Polymer_PropertyEffects(){} +/** +* @override +*/ +Polymer_PropertyEffects.prototype._initializeProperties = function(){}; +/** +* @override +* @param {*} props +*/ +Polymer_PropertyEffects.prototype._initializeProtoProperties = function(props){}; +/** +* @override +* @param {*} props +*/ +Polymer_PropertyEffects.prototype._initializeInstanceProperties = function(props){}; +/** +* @param {string} property +* @param {string} type +* @param {Object=} effect +*/ +Polymer_PropertyEffects.prototype._addPropertyEffect = function(property, type, effect){}; +/** +* @param {string} property +* @param {string} type +* @param {Object=} effect +*/ +Polymer_PropertyEffects.prototype._removePropertyEffect = function(property, type, effect){}; +/** +* @param {string} property +* @param {string=} type +* @return {boolean} +*/ +Polymer_PropertyEffects.prototype._hasPropertyEffect = function(property, type){}; +/** +* @param {string} property +* @return {boolean} +*/ +Polymer_PropertyEffects.prototype._hasReadOnlyEffect = function(property){}; +/** +* @param {string} property +* @return {boolean} +*/ +Polymer_PropertyEffects.prototype._hasNotifyEffect = function(property){}; +/** +* @param {string} property +* @return {boolean} +*/ +Polymer_PropertyEffects.prototype._hasReflectEffect = function(property){}; +/** +* @param {string} property +* @return {boolean} +*/ +Polymer_PropertyEffects.prototype._hasComputedEffect = function(property){}; +/** +* @param {(string|!Array.<(number|string)>)} path +* @param {*} value +* @param {boolean=} shouldNotify +* @param {boolean=} isPathNotification +* @return {boolean} +*/ +Polymer_PropertyEffects.prototype._setPendingPropertyOrPath = function(path, value, shouldNotify, isPathNotification){}; +/** +* @param {Node} node +* @param {string} prop +* @param {*} value +*/ +Polymer_PropertyEffects.prototype._setUnmanagedPropertyToNode = function(node, prop, value){}; +/** +* @override +* @param {*} property +* @param {*} value +* @param {*} shouldNotify +*/ +Polymer_PropertyEffects.prototype._setPendingProperty = function(property, value, shouldNotify){}; +/** +* @override +* @param {*} property +* @param {*} value +*/ +Polymer_PropertyEffects.prototype._setProperty = function(property, value){}; +/** +* @override +*/ +Polymer_PropertyEffects.prototype._invalidateProperties = function(){}; +/** +* @param {Object} client +*/ +Polymer_PropertyEffects.prototype._enqueueClient = function(client){}; +/** +*/ +Polymer_PropertyEffects.prototype._flushClients = function(){}; +/** +* @param {Object} props +* @param {boolean=} setReadOnly +*/ +Polymer_PropertyEffects.prototype.setProperties = function(props, setReadOnly){}; +/** +* @override +*/ +Polymer_PropertyEffects.prototype.ready = function(){}; +/** +*/ +Polymer_PropertyEffects.prototype._readyClients = function(){}; +/** +* @override +* @param {*} currentProps +* @param {*} changedProps +* @param {*} oldProps +*/ +Polymer_PropertyEffects.prototype._propertiesChanged = function(currentProps, changedProps, oldProps){}; +/** +* @param {Object} changedProps +* @param {Object} oldProps +* @param {boolean} hasPaths +*/ +Polymer_PropertyEffects.prototype._propagatePropertyChanges = function(changedProps, oldProps, hasPaths){}; +/** +* @param {(string|!Array.<(string|number)>)} to +* @param {(string|!Array.<(string|number)>)} from +*/ +Polymer_PropertyEffects.prototype.linkPaths = function(to, from){}; +/** +* @param {(string|!Array.<(string|number)>)} path +*/ +Polymer_PropertyEffects.prototype.unlinkPaths = function(path){}; +/** +* @param {string} path +* @param {Array} splices +*/ +Polymer_PropertyEffects.prototype.notifySplices = function(path, splices){}; +/** +* @param {(string|!Array.<(string|number)>)} path +* @param {Object=} root +* @return {*} +*/ +Polymer_PropertyEffects.prototype.get = function(path, root){}; +/** +* @param {(string|!Array.<(string|number)>)} path +* @param {*} value +* @param {Object=} root +*/ +Polymer_PropertyEffects.prototype.set = function(path, value, root){}; +/** +* @param {string} path +* @param {*} items +* @return {number} +*/ +Polymer_PropertyEffects.prototype.push = function(path, items){}; +/** +* @param {string} path +* @return {*} +*/ +Polymer_PropertyEffects.prototype.pop = function(path){}; +/** +* @param {string} path +* @param {number} start +* @param {number} deleteCount +* @param {*} items +* @return {Array} +*/ +Polymer_PropertyEffects.prototype.splice = function(path, start, deleteCount, items){}; +/** +* @param {string} path +* @return {*} +*/ +Polymer_PropertyEffects.prototype.shift = function(path){}; +/** +* @param {string} path +* @param {*} items +* @return {number} +*/ +Polymer_PropertyEffects.prototype.unshift = function(path, items){}; +/** +* @param {string} path +* @param {*=} value +*/ +Polymer_PropertyEffects.prototype.notifyPath = function(path, value){}; +/** +* @param {string} property +* @param {boolean=} protectedSetter +*/ +Polymer_PropertyEffects.prototype._createReadOnlyProperty = function(property, protectedSetter){}; +/** +* @param {string} property +* @param {string} methodName +* @param {boolean=} dynamicFn +*/ +Polymer_PropertyEffects.prototype._createPropertyObserver = function(property, methodName, dynamicFn){}; +/** +* @param {string} expression +* @param {Object=} dynamicFns +*/ +Polymer_PropertyEffects.prototype._createMethodObserver = function(expression, dynamicFns){}; +/** +* @param {string} property +*/ +Polymer_PropertyEffects.prototype._createNotifyingProperty = function(property){}; +/** +* @param {string} property +*/ +Polymer_PropertyEffects.prototype._createReflectedProperty = function(property){}; +/** +* @param {string} property +* @param {string} expression +* @param {Object=} dynamicFns +*/ +Polymer_PropertyEffects.prototype._createComputedProperty = function(property, expression, dynamicFns){}; +/** +* @param {HTMLTemplateElement} template +* @param {boolean=} instanceBinding +* @return {Object} +*/ +Polymer_PropertyEffects.prototype._bindTemplate = function(template, instanceBinding){}; +/** +* @param {HTMLTemplateElement} template +* @return {DocumentFragment} +*/ +Polymer_PropertyEffects.prototype._stampTemplate = function(template){}; +/** +* @param {DocumentFragment} dom +*/ +Polymer_PropertyEffects.prototype._removeBoundDom = function(dom){}; +/** +* @record +* @extends {Polymer_PropertyEffects} +*/ +function Polymer_ElementMixin(){} +/** +* @override +*/ +Polymer_ElementMixin.prototype._initializeProperties = function(){}; +/** +* @override +*/ +Polymer_ElementMixin.prototype.connectedCallback = function(){}; +/** +* @override +*/ +Polymer_ElementMixin.prototype.disconnectedCallback = function(){}; +/** +* @override +*/ +Polymer_ElementMixin.prototype.ready = function(){}; +/** +* @override +*/ +Polymer_ElementMixin.prototype._readyClients = function(){}; +/** +* @param {NodeList} dom +* @return {Node} +*/ +Polymer_ElementMixin.prototype._attachDom = function(dom){}; +/** +* @override +* @param {*} name +* @param {*} old +* @param {*} value +*/ +Polymer_ElementMixin.prototype.attributeChangedCallback = function(name, old, value){}; +/** +* @param {Object=} properties +*/ +Polymer_ElementMixin.prototype.updateStyles = function(properties){}; +/** +* @param {string} url +* @param {string=} base +* @return {string} +*/ +Polymer_ElementMixin.prototype.resolveUrl = function(url, base){}; +/** +* @record +*/ +function Polymer_GestureEventListeners(){} +/** +* @param {*} node +* @param {*} eventName +* @param {*} handler +*/ +Polymer_GestureEventListeners.prototype._addEventListenerToNode = function(node, eventName, handler){}; +/** +* @param {*} node +* @param {*} eventName +* @param {*} handler +*/ +Polymer_GestureEventListeners.prototype._removeEventListenerFromNode = function(node, eventName, handler){}; +/** +* @record +* @extends {Polymer_ElementMixin} +* @extends {Polymer_GestureEventListeners} +*/ +function Polymer_LegacyElementMixin(){} +/** +*/ +Polymer_LegacyElementMixin.prototype.created = function(){}; +/** +*/ +Polymer_LegacyElementMixin.prototype.attached = function(){}; +/** +*/ +Polymer_LegacyElementMixin.prototype.detached = function(){}; +/** +*/ +Polymer_LegacyElementMixin.prototype.attributeChanged = function(){}; +/** +* @override +*/ +Polymer_LegacyElementMixin.prototype._initializeProperties = function(){}; +/** +*/ +Polymer_LegacyElementMixin.prototype._registered = function(){}; +/** +* @override +*/ +Polymer_LegacyElementMixin.prototype.ready = function(){}; +/** +*/ +Polymer_LegacyElementMixin.prototype._ensureAttributes = function(){}; +/** +*/ +Polymer_LegacyElementMixin.prototype._applyListeners = function(){}; +/** +* @param {*} value +* @return {string} +*/ +Polymer_LegacyElementMixin.prototype.serialize = function(value){}; +/** +* @param {string} value +* @param {*} type +* @return {*} +*/ +Polymer_LegacyElementMixin.prototype.deserialize = function(value, type){}; +/** +* @param {string} property +* @param {string=} attribute +* @param {*=} value +*/ +Polymer_LegacyElementMixin.prototype.reflectPropertyToAttribute = function(property, attribute, value){}; +/** +* @param {*} value +* @param {string} attribute +* @param {Element} node +*/ +Polymer_LegacyElementMixin.prototype.serializeValueToAttribute = function(value, attribute, node){}; +/** +* @param {Object} prototype +* @param {Object} api +* @return {Object} +*/ +Polymer_LegacyElementMixin.prototype.extend = function(prototype, api){}; +/** +* @param {Object} target +* @param {Object} source +* @return {Object} +*/ +Polymer_LegacyElementMixin.prototype.mixin = function(target, source){}; +/** +* @param {Object} object +* @param {Object} prototype +* @return {Object} +*/ +Polymer_LegacyElementMixin.prototype.chainObject = function(object, prototype){}; +/** +* @param {HTMLTemplateElement} template +* @return {DocumentFragment} +*/ +Polymer_LegacyElementMixin.prototype.instanceTemplate = function(template){}; +/** +* @param {string} type +* @param {*=} detail +* @param {Object=} options +* @return {Event} +*/ +Polymer_LegacyElementMixin.prototype.fire = function(type, detail, options){}; +/** +* @param {Element} node +* @param {string} eventName +* @param {string} methodName +*/ +Polymer_LegacyElementMixin.prototype.listen = function(node, eventName, methodName){}; +/** +* @param {Element} node +* @param {string} eventName +* @param {string} methodName +*/ +Polymer_LegacyElementMixin.prototype.unlisten = function(node, eventName, methodName){}; +/** +* @param {string=} direction +* @param {HTMLElement=} node +*/ +Polymer_LegacyElementMixin.prototype.setScrollDirection = function(direction, node){}; +/** +* @param {string} slctr +* @return {Element} +*/ +Polymer_LegacyElementMixin.prototype.$$ = function(slctr){}; +/** +*/ +Polymer_LegacyElementMixin.prototype.distributeContent = function(){}; +/** +* @return {Array.} +*/ +Polymer_LegacyElementMixin.prototype.getEffectiveChildNodes = function(){}; +/** +* @param {string} selector +* @return {Array.} +*/ +Polymer_LegacyElementMixin.prototype.queryDistributedElements = function(selector){}; +/** +* @return {Array.} +*/ +Polymer_LegacyElementMixin.prototype.getEffectiveChildren = function(){}; +/** +* @return {string} +*/ +Polymer_LegacyElementMixin.prototype.getEffectiveTextContent = function(){}; +/** +* @param {string} selector +* @return {Object.} +*/ +Polymer_LegacyElementMixin.prototype.queryEffectiveChildren = function(selector){}; +/** +* @param {string} selector +* @return {Array.} +*/ +Polymer_LegacyElementMixin.prototype.queryAllEffectiveChildren = function(selector){}; +/** +* @param {string=} slctr +* @return {Array.} +*/ +Polymer_LegacyElementMixin.prototype.getContentChildNodes = function(slctr){}; +/** +* @param {string=} slctr +* @return {Array.} +*/ +Polymer_LegacyElementMixin.prototype.getContentChildren = function(slctr){}; +/** +* @param {?Node} node +* @return {boolean} +*/ +Polymer_LegacyElementMixin.prototype.isLightDescendant = function(node){}; +/** +* @param {HTMLElement=} node +* @return {boolean} +*/ +Polymer_LegacyElementMixin.prototype.isLocalDescendant = function(node){}; +/** +* @param {*} container +* @param {*} shouldObserve +*/ +Polymer_LegacyElementMixin.prototype.scopeSubtree = function(container, shouldObserve){}; +/** +* @param {string} property +* @return {string} +*/ +Polymer_LegacyElementMixin.prototype.getComputedStyleValue = function(property){}; +/** +* @param {string} jobName +* @param {function ()} callback +* @param {number} wait +* @return {Object} +*/ +Polymer_LegacyElementMixin.prototype.debounce = function(jobName, callback, wait){}; +/** +* @param {string} jobName +* @return {boolean} +*/ +Polymer_LegacyElementMixin.prototype.isDebouncerActive = function(jobName){}; +/** +* @param {string} jobName +*/ +Polymer_LegacyElementMixin.prototype.flushDebouncer = function(jobName){}; +/** +* @param {string} jobName +*/ +Polymer_LegacyElementMixin.prototype.cancelDebouncer = function(jobName){}; +/** +* @param {Function} callback +* @param {number=} waitTime +* @return {number} +*/ +Polymer_LegacyElementMixin.prototype.async = function(callback, waitTime){}; +/** +* @param {number} handle +*/ +Polymer_LegacyElementMixin.prototype.cancelAsync = function(handle){}; +/** +* @param {string} tag +* @param {Object} props +* @return {Element} +*/ +Polymer_LegacyElementMixin.prototype.create = function(tag, props){}; +/** +* @param {string} href +* @param {Function} onload +* @param {Function} onerror +* @param {boolean} optAsync +* @return {HTMLLinkElement} +*/ +Polymer_LegacyElementMixin.prototype.importHref = function(href, onload, onerror, optAsync){}; +/** +* @param {string} selector +* @param {Element=} node +* @return {boolean} +*/ +Polymer_LegacyElementMixin.prototype.elementMatches = function(selector, node){}; +/** +* @param {string} name +* @param {boolean=} bool +* @param {HTMLElement=} node +*/ +Polymer_LegacyElementMixin.prototype.toggleAttribute = function(name, bool, node){}; +/** +* @param {string} name +* @param {boolean=} bool +* @param {HTMLElement=} node +*/ +Polymer_LegacyElementMixin.prototype.toggleClass = function(name, bool, node){}; +/** +* @param {string} transformText +* @param {HTMLElement=} node +*/ +Polymer_LegacyElementMixin.prototype.transform = function(transformText, node){}; +/** +* @param {number} x +* @param {number} y +* @param {number} z +* @param {HTMLElement=} node +*/ +Polymer_LegacyElementMixin.prototype.translate3d = function(x, y, z, node){}; +/** +* @param {(string|!Array.<(number|string)>)} arrayOrPath +* @param {*} item +* @return {Array} +*/ +Polymer_LegacyElementMixin.prototype.arrayDelete = function(arrayOrPath, item){}; +/** +* @param {string} level +* @param {Array} args +*/ +Polymer_LegacyElementMixin.prototype._logger = function(level, args){}; +/** +* @param {*} args +*/ +Polymer_LegacyElementMixin.prototype._log = function(args){}; +/** +* @param {*} args +*/ +Polymer_LegacyElementMixin.prototype._warn = function(args){}; +/** +* @param {*} args +*/ +Polymer_LegacyElementMixin.prototype._error = function(args){}; +/** +* @param {*} args +* @return {string} +*/ +Polymer_LegacyElementMixin.prototype._logf = function(args){}; +/** +* @record +*/ +function Polymer_MutableData(){} +/** +* @param {string} property +* @param {*} value +* @param {*} old +* @return {boolean} +*/ +Polymer_MutableData.prototype._shouldPropertyChange = function(property, value, old){}; +/** +* @record +*/ +function Polymer_OptionalMutableData(){} +/** @type {boolean} */ +Polymer_OptionalMutableData.prototype.mutableData; + +/** +* @param {string} property +* @param {*} value +* @param {*} old +* @return {boolean} +*/ +Polymer_OptionalMutableData.prototype._shouldPropertyChange = function(property, value, old){}; +/** +* @record +*/ +function Polymer_ArraySelectorMixin(){} +/** @type {Array} */ +Polymer_ArraySelectorMixin.prototype.items; + +/** @type {boolean} */ +Polymer_ArraySelectorMixin.prototype.multi; + +/** @type {Object} */ +Polymer_ArraySelectorMixin.prototype.selected; + +/** @type {Object} */ +Polymer_ArraySelectorMixin.prototype.selectedItem; + +/** @type {boolean} */ +Polymer_ArraySelectorMixin.prototype.toggle; + +/** +*/ +Polymer_ArraySelectorMixin.prototype.clearSelection = function(){}; +/** +* @param {*} item +* @return {boolean} +*/ +Polymer_ArraySelectorMixin.prototype.isSelected = function(item){}; +/** +* @param {*} idx +* @return {boolean} +*/ +Polymer_ArraySelectorMixin.prototype.isIndexSelected = function(idx){}; +/** +* @param {*} item +*/ +Polymer_ArraySelectorMixin.prototype.deselect = function(item){}; +/** +* @param {number} idx +*/ +Polymer_ArraySelectorMixin.prototype.deselectIndex = function(idx){}; +/** +* @param {*} item +*/ +Polymer_ArraySelectorMixin.prototype.select = function(item){}; +/** +* @param {number} idx +*/ +Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){}; \ No newline at end of file diff --git a/lib/polymer2/bower_components/polymer/externs/closure-upstream-externs.js b/lib/polymer2/bower_components/polymer/externs/closure-upstream-externs.js deleted file mode 100644 index 09fd330f..00000000 --- a/lib/polymer2/bower_components/polymer/externs/closure-upstream-externs.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @fileoverview Externs to upstream to closure compiler - * @externs - */ - -/** @record */ -function CustomElement(){} -/** @type {!Array|undefined} */ -CustomElement.observedAttributes; -/** @type {function()|undefined} */ -CustomElement.prototype.connectedCallback; -/** @type {function()|undefined} */ -CustomElement.prototype.disconnectedCallback; -/** @type {function(string, ?string, ?string, ?string)|undefined} */ -CustomElement.prototype.attributeChangedCallback; - -/** @type {boolean} */ -Event.prototype.composed; - -/** - * @return {!Array} - */ -Event.prototype.composedPath = function(){}; - -/** - * @param {!{mode: string}} options - * @return {!ShadowRoot} - */ -HTMLElement.prototype.attachShadow = function(options){}; - -/** - * @constructor - * @extends {HTMLElement} - */ -function HTMLSlotElement(){} - -/** - * @param {!{flatten: boolean}=} options - * @return {!Array} - */ -HTMLSlotElement.prototype.assignedNodes = function(options){}; - -/** @type {HTMLSlotElement} */ -Node.prototype.assignedSlot; - -/** @constructor */ -function InputDeviceCapabilities(){} - -/** @type {boolean} */ -InputDeviceCapabilities.prototype.firesTouchEvents; - -/** @type {InputDeviceCapabilities} */ -MouseEvent.prototype.sourceCapabilities; - -const customElements = { - /** - * @param {string} tagName - * @param {!CustomElement} klass - * @param {Object=} options - * @return {!CustomElement} - */ - define(tagName, klass, options){}, - /** - * @param {string} tagName - * @return {CustomElement} - */ - get(tagName){}, - /** - * @param {string} tagName - * @return {Promise} - */ - whenDefined(tagName){} -} -window.customElements = customElements; \ No newline at end of file diff --git a/lib/polymer2/bower_components/polymer/externs/polymer-externs.js b/lib/polymer2/bower_components/polymer/externs/polymer-externs.js index 704f0e35..7305e11c 100644 --- a/lib/polymer2/bower_components/polymer/externs/polymer-externs.js +++ b/lib/polymer2/bower_components/polymer/externs/polymer-externs.js @@ -5,6 +5,13 @@ /** * @param {!{is: string}} init - * @return {!CustomElement} + * @return {!HTMLElement} */ -function Polymer(init){} \ No newline at end of file +function Polymer(init){} + +/** + * @param {string} string + * @param {Object} obj + * @return {string} + */ +function JSCompiler_renameProperty(string, obj) {} \ No newline at end of file diff --git a/lib/polymer2/bower_components/polymer/externs/webcomponents-externs.js b/lib/polymer2/bower_components/polymer/externs/webcomponents-externs.js index 55e8aaef..121b5d19 100644 --- a/lib/polymer2/bower_components/polymer/externs/webcomponents-externs.js +++ b/lib/polymer2/bower_components/polymer/externs/webcomponents-externs.js @@ -3,16 +3,6 @@ * @externs */ -/** - * @constructor - * @extends {HTMLElement} - */ -function CustomStyle(){} -/** - * @param {!HTMLStyleElement} style - */ -CustomStyle.prototype.processHook = function(style){}; - let HTMLImports = { /** * @param {function()} callback diff --git a/lib/polymer2/bower_components/polymer/lib/elements/array-selector.html b/lib/polymer2/bower_components/polymer/lib/elements/array-selector.html index 5cf7c3c8..85603aae 100644 --- a/lib/polymer2/bower_components/polymer/lib/elements/array-selector.html +++ b/lib/polymer2/bower_components/polymer/lib/elements/array-selector.html @@ -35,7 +35,11 @@ */ let ArraySelectorMixin = Polymer.dedupingMixin(superClass => { - return class extends superClass { + /** + * @polymerMixinClass + * @implements {Polymer_ArraySelectorMixin} + */ + class ArraySelectorMixin extends superClass { static get properties() { @@ -193,7 +197,6 @@ /** * Clears the selection state. * - * @method clearSelection */ clearSelection() { // Unbind previous selection @@ -211,7 +214,6 @@ /** * Returns whether the item is currently selected. * - * @method isSelected * @param {*} item Item from `items` array to test * @return {boolean} Whether the item is selected */ @@ -222,7 +224,6 @@ /** * Returns whether the item is currently selected. * - * @method isSelected * @param {*} idx Index from `items` array to test * @return {boolean} Whether the item is selected */ @@ -252,7 +253,6 @@ /** * Deselects the given item if it is already selected. * - * @method deselect * @param {*} item Item from `items` array to deselect */ deselect(item) { @@ -275,7 +275,6 @@ /** * Deselects the given index if it is already selected. * - * @method deselect * @param {number} idx Index from `items` array to deselect */ deselectIndex(idx) { @@ -286,7 +285,6 @@ * Selects the given item. When `toggle` is true, this will automatically * deselect the item if already selected. * - * @method select * @param {*} item Item from `items` array to select */ select(item) { @@ -297,7 +295,6 @@ * Selects the given index. When `toggle` is true, this will automatically * deselect the item if already selected. * - * @method select * @param {number} idx Index from `items` array to select */ selectIndex(idx) { @@ -320,11 +317,20 @@ } + return ArraySelectorMixin; + }); // export mixin Polymer.ArraySelectorMixin = ArraySelectorMixin; + /** + * @constructor + * @extends {Polymer.Element} + * @implements {Polymer_ArraySelectorMixin} + */ + let baseArraySelector = ArraySelectorMixin(Polymer.Element); + /** * Element implementing the `Polymer.ArraySelector` mixin, which records * dynamic associations between item paths in a master `items` array and a @@ -391,7 +397,7 @@ * @summary Custom element that links paths between an input `items` array and * an output `selected` item or array based on calls to its selection API. */ - class ArraySelector extends ArraySelectorMixin(Polymer.Element) { + class ArraySelector extends baseArraySelector { // Not needed to find template; can be removed once the analyzer // can find the tag name from customElements.define call static get is() { return 'array-selector' } diff --git a/lib/polymer2/bower_components/polymer/lib/elements/dom-bind.html b/lib/polymer2/bower_components/polymer/lib/elements/dom-bind.html index d08ca0e3..436791d8 100644 --- a/lib/polymer2/bower_components/polymer/lib/elements/dom-bind.html +++ b/lib/polymer2/bower_components/polymer/lib/elements/dom-bind.html @@ -10,13 +10,25 @@ + + diff --git a/lib/polymer2/bower_components/polymer/lib/utils/flattened-nodes-observer.html b/lib/polymer2/bower_components/polymer/lib/utils/flattened-nodes-observer.html index 0a49b3ab..c1f75d03 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/flattened-nodes-observer.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/flattened-nodes-observer.html @@ -57,7 +57,7 @@ * `` elements assigned to it, these are flattened as well. * * @param {Node} node The node for which to return the list of flattened nodes. - * @returns {Array} The list of flattened nodes for the given `node`. + * @return {Array} The list of flattened nodes for the given `node`. */ static getFlattenedNodes(node) { if (isSlot(node)) { diff --git a/lib/polymer2/bower_components/polymer/lib/utils/gestures.html b/lib/polymer2/bower_components/polymer/lib/utils/gestures.html index e4599758..4ee65c3b 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/gestures.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/gestures.html @@ -86,7 +86,7 @@ }; /** - * @param {boolean=} setup + * @param {boolean=} setup True to add, false to remove. */ function setupTeardownMouseCanceller(setup) { let events = IS_TOUCH_ONLY ? ['click'] : MOUSE_EVENTS; @@ -150,6 +150,11 @@ // the bounding box of the target of the event // Thanks IE 10 >:( let t = Gestures._findOriginalTarget(ev); + // make sure the target of the event is an element so we can use getBoundingClientRect, + // if not, just assume it is a synthetic click + if (t.nodeType !== Node.ELEMENT_NODE) { + return true; + } let bcr = t.getBoundingClientRect(); // use page x/y to account for scrolling let x = ev.pageX, y = ev.pageY; @@ -230,6 +235,8 @@ * @memberof Polymer.Gestures * @param {number} x Horizontal pixel coordinate * @param {number} y Vertical pixel coordinate + * @return {HTMLElement} Returns the deepest shadowRoot inclusive element + * found at the screen position given. */ deepTargetFind: function(x, y) { let node = document.elementFromPoint(x, y); @@ -239,7 +246,12 @@ // if there is not a shadowroot, exit the loop while (next && next.shadowRoot && !window.ShadyDOM) { // if there is a node at x/y in the shadowroot, look deeper + let oldNext = next; next = next.shadowRoot.elementFromPoint(x, y); + // on Safari, elementFromPoint may return the shadowRoot host + if (oldNext === next) { + break; + } if (next) { node = next; } @@ -250,6 +262,8 @@ * a cheaper check than ev.composedPath()[0]; * * @private + * @param {Event} ev Event. + * @return {HTMLElement} Returns the event target. */ _findOriginalTarget: function(ev) { // shadowdom @@ -262,6 +276,7 @@ /** * @private + * @param {Event} ev Event. */ _handleNative: function(ev) { let handled; @@ -322,6 +337,7 @@ /** * @private + * @param {Event} ev Event. */ _handleTouchAction: function(ev) { let t = ev.changedTouches[0]; @@ -363,6 +379,7 @@ * @param {Node} node Node to add listener on * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap` * @param {Function} handler Event listener function to call + * @return {boolean} Returns true if a gesture event listener was added. */ addListener: function(node, evType, handler) { if (this.gestures[evType]) { @@ -379,6 +396,7 @@ * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap` * @param {Function} handler Event listener function previously passed to * `addListener`. + * @return {boolean} Returns true if a gesture event listener was removed. */ removeListener: function(node, evType, handler) { if (this.gestures[evType]) { @@ -391,6 +409,9 @@ * automate the event listeners for the native events * * @private + * @param {HTMLElement} node Node on which to add the event. + * @param {string} evType Event type to add. + * @param {function} handler Event handler function. */ _add: function(node, evType, handler) { let recognizer = this.gestures[evType]; @@ -426,6 +447,9 @@ * automate event listener removal for native events * * @private + * @param {HTMLElement} node Node on which to remove the event. + * @param {string} evType Event type to remove. + * @param {function} handler Event handler function. */ _remove: function(node, evType, handler) { let recognizer = this.gestures[evType]; @@ -464,6 +488,8 @@ /** * @private + * @param {string} evName Event name. + * @return {Object} Returns the gesture for the given event name. */ _findRecognizerByEvent: function(evName) { for (let i = 0, r; i < this.recognizers.length; i++) { @@ -496,7 +522,12 @@ }, /** + * Dispatches an event on the `target` element of `type` with the given + * `detail`. * @private + * @param {HTMLElement} target The element on which to fire an event. + * @param {string} type The type of event to fire. + * @param {Object=} detail The detail object to populate on the event. */ _fire: function(target, type, detail) { let ev = new Event(type, { bubbles: true, cancelable: true, composed: true }); @@ -515,6 +546,7 @@ * Prevents the dispatch and default action of the given event name. * * @memberof Polymer.Gestures + * @param {string} evName Event name. */ prevent: function(evName) { let recognizer = this._findRecognizerByEvent(evName); @@ -530,7 +562,6 @@ * This method should only be called during testing with simulated touch inputs. * Calling this method in production may cause duplicate taps or other Gestures. * - * @method resetMouseCanceller * @memberof Polymer.Gestures */ resetMouseCanceller: function() { diff --git a/lib/polymer2/bower_components/polymer/lib/utils/import-href.html b/lib/polymer2/bower_components/polymer/lib/utils/import-href.html index 627eae9c..77933a4e 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/import-href.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/import-href.html @@ -35,7 +35,6 @@ * element will contain the imported document contents. * * @memberof Polymer - * @method importHref * @param {string} href URL to document to load. * @param {Function=} onload Callback to notify when an import successfully * loaded. diff --git a/lib/polymer2/bower_components/polymer/lib/utils/mixin.html b/lib/polymer2/bower_components/polymer/lib/utils/mixin.html index 91dbdbfe..12a4ebb3 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/mixin.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/mixin.html @@ -22,6 +22,9 @@ /** * Given a mixin producing function, memoize applications of mixin to base * @private + * @param {Function} mixin Mixin for which to create a caching mixin. + * @return {Function} Returns a mixin which when applied multiple times to the + * same base will always return the same extended class. */ function cachingMixin(mixin) { return function(base) { @@ -44,16 +47,14 @@ * applications. * * @memberof Polymer - * @param {function} mixin ES6 class expression mixin to wrap - * @return {function} Wrapped mixin that deduplicates and memoizes + * @param {Function} mixin ES6 class expression mixin to wrap + * @return {Function} Wrapped mixin that deduplicates and memoizes * mixin applications to base */ Polymer.dedupingMixin = function(mixin) { mixin = cachingMixin(mixin); // maintain a unique id for each mixin - if (!mixin.__id) { - mixin.__dedupeId = ++dedupeId; - } + mixin.__dedupeId = ++dedupeId; return function(base) { let baseSet = base.__mixinSet; if (baseSet && baseSet[mixin.__dedupeId]) { diff --git a/lib/polymer2/bower_components/polymer/lib/utils/path.html b/lib/polymer2/bower_components/polymer/lib/utils/path.html index 869358d3..2dfe8940 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/path.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/path.html @@ -76,8 +76,9 @@ * ``` * * @memberof Polymer.Path - * @param {string} path Path string - * @return {boolean} True if `path` is an ancestor of `base` + * @param {string} base Path string to test against. + * @param {string} path Path string to test. + * @return {boolean} True if `path` is an ancestor of `base`. */ isAncestor: function(base, path) { // base.startsWith(path + '.'); @@ -96,6 +97,9 @@ * ``` * * @memberof Polymer.Path + * @param {string} base Path string to test against. + * @param {string} path Path string to test. + * @return {boolean} True if `path` is a descendant of `base`. */ isDescendant: function(base, path) { // path.startsWith(base + '.'); diff --git a/lib/polymer2/bower_components/polymer/lib/utils/render-status.html b/lib/polymer2/bower_components/polymer/lib/utils/render-status.html index 1713b57d..ca7175ad 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/render-status.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/render-status.html @@ -26,24 +26,33 @@ flushQueue(beforeRenderQueue); // after the render setTimeout(function() { - flushQueue(afterRenderQueue); + runQueue(afterRenderQueue); }); }); } function flushQueue(queue) { while (queue.length) { - const q = queue.shift(); - const context = q[0]; - const callback = q[1]; - const args = q[2]; - try { - callback.apply(context, args); - } catch(e) { - setTimeout(() => { - throw e; - }) - } + callMethod(queue.shift()); + } + } + + function runQueue(queue) { + for (let i=0, l=queue.length; i < l; i++) { + callMethod(queue.shift()); + } + } + + function callMethod(info) { + const context = info[0]; + const callback = info[1]; + const args = info[2]; + try { + callback.apply(context, args); + } catch(e) { + setTimeout(() => { + throw e; + }) } } @@ -52,6 +61,7 @@ flushQueue(beforeRenderQueue); flushQueue(afterRenderQueue); } + scheduled = false; } /** @@ -75,7 +85,7 @@ * * @memberof Polymer.RenderStatus * @param {*} context Context object the callback function will be bound to - * @param {function} callback Callback function + * @param {function()} callback Callback function * @param {Array} args An array of arguments to call the callback function with */ beforeNextRender: function(context, callback, args) { @@ -96,7 +106,7 @@ * * @memberof Polymer.RenderStatus * @param {*} context Context object the callback function will be bound to - * @param {function} callback Callback function + * @param {function()} callback Callback function * @param {Array} args An array of arguments to call the callback function with */ afterNextRender: function(context, callback, args) { diff --git a/lib/polymer2/bower_components/polymer/lib/utils/style-gather.html b/lib/polymer2/bower_components/polymer/lib/utils/style-gather.html index 1fb045f3..e18a347f 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/style-gather.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/style-gather.html @@ -36,7 +36,8 @@ * Returns CSS text of styles in a space-separated list of `dom-module`s. * * @memberof Polymer.StyleGather - * @param {string} moduleIds + * @param {string} moduleIds List of dom-module id's within which to + * search for css. * @return {string} Concatenated CSS content from specified `dom-module`s */ cssFromModules(moduleIds) { diff --git a/lib/polymer2/bower_components/polymer/lib/utils/templatize.html b/lib/polymer2/bower_components/polymer/lib/utils/templatize.html index ad1008ae..456c0151 100644 --- a/lib/polymer2/bower_components/polymer/lib/utils/templatize.html +++ b/lib/polymer2/bower_components/polymer/lib/utils/templatize.html @@ -40,7 +40,12 @@ } // Base class for TemplateInstance's - class TemplateInstanceBase extends Polymer.PropertyEffects(class{}) { + /** + * @constructor + * @implements {Polymer_PropertyEffects} + */ + const base = Polymer.PropertyEffects(class {}); + class TemplateInstanceBase extends base { constructor(props) { super(); this._configureProperties(props); @@ -62,7 +67,10 @@ } } /** + * Configure the given `props` by calling `_setPendingProperty`. Also + * sets any properties stored in `__hostProps`. * @private + * @param {Object} props Object of property name-value pairs to set. */ _configureProperties(props) { let options = this.__templatizeOptions; @@ -113,6 +121,11 @@ } } /** + * Shows or hides the template instance top level child elements. For + * text nodes, `textContent` is removed while "hidden" and replaced when + * "shown." + * @param {boolean} hide Set to true to hide the children; + * set to false to show them. * @protected */ _showHideChildren(hide) { @@ -193,7 +206,7 @@ return templateHost && templateHost._methodHost || templateHost; } - function createTemplatizerClass(template, options) { + function createTemplatizerClass(template, templateInfo, options) { // Anonymous class created by the templatize /** * @unrestricted @@ -203,22 +216,22 @@ let klass = class extends base { } klass.prototype.__templatizeOptions = options; klass.prototype._bindTemplate(template); - addNotifyEffects(klass, template, options); + addNotifyEffects(klass, template, templateInfo, options); return klass; } - function addPropagateEffects(template, options) { + function addPropagateEffects(template, templateInfo, options) { let userForwardHostProp = options.forwardHostProp; if (userForwardHostProp) { // Provide data API and property effects on memoized template class - let klass = template._content.__templatizeTemplateClass; + let klass = templateInfo.templatizeTemplateClass; if (!klass) { let base = options.mutableData ? MutableDataTemplate : DataTemplate; - klass = template._content.__templatizeTemplateClass = + klass = templateInfo.templatizeTemplateClass = class TemplatizedTemplate extends base {} // Add template - >instances effects // and host <- template effects - let hostProps = template._content._hostProps; + let hostProps = templateInfo.hostProps; for (let prop in hostProps) { klass.prototype._addPropertyEffect('_host_' + prop, klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE, @@ -249,8 +262,8 @@ } } - function addNotifyEffects(klass, template, options) { - let hostProps = template._content._hostProps || {}; + function addNotifyEffects(klass, template, templateInfo, options) { + let hostProps = templateInfo.hostProps || {}; for (let iprop in options.instanceProps) { delete hostProps[iprop]; let userNotifyInstanceProp = options.notifyInstanceProp; @@ -291,7 +304,7 @@ * // Get a template from somewhere, e.g. light DOM * let template = this.querySelector('template'); * // Prepare the template - * let TemplateClass = Polymer.Tempaltize.templatize(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 @@ -353,11 +366,11 @@ * - `instanceProps`: Dictionary of property names that will be added * to the instance by the templatize owner. These properties shadow any * host properties, and changes within the template to these properties - * will result in `notifyInstanceProperties` to be called. + * will result in `notifyInstanceProp` being called. * - `mutableData`: When `true`, the generated class will skip strict * dirty-checking for objects and arrays (always consider them to be * "dirty"). - * - `notifyInstanceProperties(instance, property, value)`: Called when + * - `notifyInstanceProp(instance, property, value)`: Called when * an instance property changes. Users may choose to call `notifyPath` * on e.g. the owner to notify the change. * - `parentModel`: When `true`, events handled by declarative event listeners @@ -379,40 +392,41 @@ * @param {HTMLTemplateElement} template Template to templatize * @param {*} owner Owner of the template instances; any optional callbacks * will be bound to this owner. - * @param {*} options Options dictionary (see summary for details) + * @param {*=} options Options dictionary (see summary for details) * @return {TemplateInstanceBase} Generated class bound to the template * provided */ templatize(template, owner, options) { + options = options || {}; if (template.__templatizeOwner) { throw new Error('A