Skip to content

Commit c3cbb13

Browse files
authored
Merge branch 'develop' into master
2 parents f54a69c + e06cff3 commit c3cbb13

File tree

10 files changed

+1606
-888
lines changed

10 files changed

+1606
-888
lines changed

.travis.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,28 @@ node_js:
99
before_install:
1010
- export DISPLAY=:99.0
1111
- sh -e /etc/init.d/xvfb start
12+
- sudo apt install -y jq
1213
script: npm test && npm run wct-sauce
1314
branches:
1415
only:
1516
- master
1617
- develop
17-
env:
18-
global:
19-
- secure: IczLyQVw0rGAirfVHal4lcPNymjSQewhh2F8vu2rsp6ncNSAkSEVm9tXvSq47UkYzkLEUvi5l2rOIcmnfGsyjc8uCH3yFVpsMdoClP5W+2LO6XB7k6FyV3GXpfotEjKqIXqUWFosbFMdsV5X3zhuouckdvPcrY+QNltVl8P90JqGtVq5VqSIUZVhWsMxelrgY1p0iIx0YdftD0Hq8mip8ULztip+mbAAcLbUBOlOHHRdiG1cNp7GjpaBUPvtVY+/rDM8sgJ7SlK9F+BWsxj5If/Ky3n4HcyvvAAGeiqxJu0jxPQ37JwJKHligE5gK1O/piaAblSsy5kT4ElQXkxJLKLH8SQ7XViJ1NVGzh2AynDnx4J7PzWYfHKMYTbW2/6VaPOR/wr2xj1OdCRlNi8dK7y7Frhml9o58BakCDPx9zJgHd0s9lZQGdGA6O8DD6FpBwK9n8GqzEHI56phgtW8HH9T98r8ZSmm3iggwUesZo12kkkdc9/Eoe3X07G5cxq5r97E/rCnzhFz/uF786FX25H/pDIRUJ9K03VQuBMgG/vkFk1hzMEPjiFqFFXoa6odBR98OwbVFpR0JEpg4vcSRXDXfeNjxy1Pb2HXXSJAR9y2aCEW0U+IL4INPvK40igA/ijp16RP8TsLYszulzwxl8w8EvJTm0eJc1zlMc2QpZI=
20-
- secure: M8pX7iiBmx8OdCmvMt6sbYSISIUVPYj6Xi52oP0TkOjDN14fxH2OS+Egnui2F9sudNFOgvGoiK4VnE3iH2z8wjFoA1YnbS+wHI1sK862qdtYlxk5pe4HglwrqAH4beg3cBQkN48ds0/gqifMuVxySbKn06KsU7fqMeOV5vunguSpWXbHBT+0vjJAF/J5f6JqZRbw0ggiAWThwqyulIYJPQ+BpYb2hoEhQfmUxGjTisILsNOWzU/qaYojf1PjBgfm7tpRCcvEZxohvqYQx6yCaus5U4I9gWNashpVWlOYbhtdxpRPA2thp2tfZLtuVP6CATeI+YwAcjbPhx4RG9Bxr/TNChh3s0rp4n+wcdXToQtPINnHjcDxK9Wlw+DbAu3tOoxHnhBR7KOWEOCZ3iTlRPMiGivBy5aopf1Lmk+h745PFdTOtF4QAWyY/gwzon1v3HWTwjZxwASSNoc8z4Q05f3vs+Iro9F6FBWsXTFciMpJ7hQ435SmYaX/LCyy3p6iP7W22+mH3vOdGE1yx8LqG3GQ4cRJaUFilRUVAFBF5NOHesB1m8kf1yAjpdqzJT1+/sJEmdmDLCq2WOZor/EjeXvr+4uAy3WvBz3avNKHzZavY/cpHSTTWuwZsLyU16OcQlaIhBWRbmxJj2NWOFI5OjKqXUImJMyp9iifbRTy53I=
18+
before_deploy:
19+
- build_version=$(cat package.json | jq '.version')
20+
- build_version=${build_version#\"}
21+
- build_version=${build_version%\"}
22+
- git tag -f v${build_version}
23+
deploy:
24+
- provider: releases
25+
skip_cleanup: true
26+
api_key: $CHANGELOG_GITHUB_TOKEN
27+
file_glob: true
28+
file: dist/*
29+
on:
30+
branch: master
31+
- provider: npm
32+
skip_cleanup: true
33+
email: $NPM_EMAIL
34+
api_key: $NPM_TOKEN
35+
on:
36+
branch: master

element-lite-base.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,14 +599,14 @@ export const ElementLiteBase = dedupingMixin(base => {
599599
* @return {void}
600600
* @protected
601601
*/
602-
_invalidateProperties () {
602+
_invalidateProperties (forceInvalidate) {
603603
if (!this.__dataInvalid && this.__dataReady) {
604604
this.__dataInvalid = true;
605605

606606
Promise.resolve().then(() => {
607607
if (this.__dataInvalid) {
608608
this.__dataInvalid = false;
609-
this._flushProperties();
609+
this._flushProperties(forceInvalidate);
610610
}
611611
});
612612
}
@@ -621,16 +621,16 @@ export const ElementLiteBase = dedupingMixin(base => {
621621
* @return {void}
622622
* @protected
623623
*/
624-
_flushProperties () {
624+
_flushProperties (forceFlush) {
625625
this.__dataCounter++;
626626

627627
const props = this.__data;
628628
const changedProps = this.__dataPending;
629629
const old = this.__dataOld;
630-
if (this._shouldPropertiesChange(props, changedProps, old)) {
630+
if (this._shouldPropertiesChange(props, changedProps, old) || forceFlush) {
631631
this.__dataPending = null;
632632
this.__dataOld = {};
633-
this._propertiesChanged(props, changedProps, old);
633+
this._propertiesChanged(props, forceFlush ? props : changedProps, old);
634634
}
635635

636636
this.__dataCounter--;
@@ -679,7 +679,7 @@ export const ElementLiteBase = dedupingMixin(base => {
679679
}
680680

681681
if (this.__dataNotify[root(prop)]) {
682-
this.dispatchEvent(new window.CustomEvent(`${camelToDashCase(root(prop))}-changed`, { detail: this.__data[root(prop)] }));
682+
this.dispatchEvent(new window.CustomEvent(`${camelToDashCase(root(prop))}-change`, { detail: this.__data[root(prop)] }));
683683
}
684684

685685
if (this.__dataObserver[prop]) {
@@ -919,7 +919,7 @@ export const ElementLiteBase = dedupingMixin(base => {
919919
*/
920920
ready () {
921921
this.__dataReady = true;
922-
this._flushProperties();
922+
this._flushProperties(true);
923923
}
924924

925925
/**
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { dedupingMixin } from './lib/deduping-mixin.js';
44
import { render, html } from './lib/lit-html/lib/lit-extended.js';
55

66
export { html };
7-
export const ElementLiteLitOnly = dedupingMixin(base => {
7+
export const ElementLiteLit = dedupingMixin(base => {
88
/**
99
* ElementLite is a set of methods coming from Polymer Property Mixins and Property Accessor Mixins
1010
* that automates the creation of setter and getters given a list of properties and
@@ -13,7 +13,7 @@ export const ElementLiteLitOnly = dedupingMixin(base => {
1313
*
1414
* @extends {HTMLElement}
1515
*/
16-
class ElementLiteLitOnly extends /** @type {HTMLElement} */(base) {
16+
class ElementLiteLit extends /** @type {HTMLElement} */(base) {
1717
connectedCallback () {
1818
if (super.connectedCallback) super.connectedCallback();
1919
this.attachShadow({ mode: 'open' });
@@ -32,5 +32,5 @@ export const ElementLiteLitOnly = dedupingMixin(base => {
3232
render (self) { return html``; }
3333
}
3434

35-
return ElementLiteLitOnly;
35+
return ElementLiteLit;
3636
});
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
import { ElementLiteBase } from './element-lite-base.js';
22
import { dedupingMixin } from './lib/deduping-mixin.js';
33

4-
export const ElementLiteStaticShadow = dedupingMixin(base => {
4+
export const ElementLiteStatic = dedupingMixin(base => {
55
/**
66
* ElementLite is a set of methods coming from Polymer Property Mixins and Property Accessor Mixins
77
* that automates the creation of setter and getters given a list of properties and
88
* allows auto-calling of methods given observers. This uses a static shadow DOM. It doesn't use
99
* lit-html
1010
* @extends {ElementLiteBase}
1111
*/
12-
class ElementLiteStaticShadow extends ElementLiteBase(base) {
12+
class ElementLiteStatic extends ElementLiteBase(base) {
13+
constructor () {
14+
super();
15+
this.attachShadow({ mode: 'open' });
16+
this.__template = document.createElement('template');
17+
this.__template.innerHTML = this.render();
18+
19+
if (window.ShadyCSS) {
20+
window.ShadyCSS.prepareTemplate(this.__template, this.constructor.is || this.tagName.toLowerCase());
21+
}
22+
}
23+
1324
ready () {
1425
// attaches shadow
15-
this.attachShadow({ mode: 'open' });
1626
super.ready();
17-
1827
// renders the shadowRoot statically
19-
this.shadowRoot = this.render();
28+
if (window.ShadyCSS && this.__template) {
29+
window.ShadyCSS.styleElement(this);
30+
}
31+
this.shadowRoot.appendChild(document.importNode(this.__template.content, true));
2032
}
2133

2234
/**
@@ -25,5 +37,5 @@ export const ElementLiteStaticShadow = dedupingMixin(base => {
2537
render () { return ``; }
2638
}
2739

28-
return ElementLiteStaticShadow;
40+
return ElementLiteStatic;
2941
});

element-lite.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { ElementLiteBase } from './element-lite-base.js';
2-
import { ElementLiteStaticShadow } from './element-lite-static-shadow.js';
3-
import { ElementLiteLitOnly } from './element-lite-lit-only.js';
2+
import { ElementLiteStatic } from './element-lite-static.js';
3+
import { ElementLiteLit } from './element-lite-lit.js';
44
import { dedupingMixin } from './lib/deduping-mixin.js';
55
import { render, html } from './lib/lit-html/lib/lit-extended.js';
66

7-
export { html, ElementLiteBase, ElementLiteStaticShadow, ElementLiteLitOnly };
7+
export { html, ElementLiteBase, ElementLiteStatic, ElementLiteLit };
88
export const ElementLite = dedupingMixin(base => {
99
/**
1010
* ElementLite is a set of methods coming from Polymer Property Mixins and Property Accessor Mixins
@@ -37,6 +37,7 @@ export const ElementLite = dedupingMixin(base => {
3737
*/
3838
_propertiesChanged (currentProps, changedProps, oldProps) {
3939
this.__isChanging = true;
40+
this.__isInvalid = false;
4041
super._propertiesChanged(currentProps, changedProps, oldProps);
4142
this._setShadow();
4243

@@ -67,9 +68,9 @@ export const ElementLite = dedupingMixin(base => {
6768
/**
6869
* Override which provides tracking of invalidated state.
6970
*/
70-
_invalidateProperties () {
71+
_invalidateProperties (forceInvalidate) {
7172
this.__isInvalid = true;
72-
super._invalidateProperties();
73+
super._invalidateProperties(forceInvalidate);
7374
}
7475

7576
/**
@@ -81,7 +82,7 @@ export const ElementLite = dedupingMixin(base => {
8182
* Helper method to re-render the whole setup.
8283
*/
8384
invalidate () {
84-
this._invalidateProperties();
85+
this._invalidateProperties(true);
8586
}
8687
}
8788

0 commit comments

Comments
 (0)