WIP move d-code and d-math and d-footnote to ShadowDOM

This commit is contained in:
Ludwig Schubert
2017-07-25 19:22:11 -07:00
parent 4f3ddce184
commit 291864acae
20 changed files with 1252 additions and 791 deletions
+7 -5
View File
@@ -1,4 +1,5 @@
import "webcomponents.js/webcomponents-hi-ce.js";
// load `webcomponent` polyfills asynchronously
// import "webcomponents.js/webcomponents-loader.js";
import * as frontMatter from "./components/d-front-matter";
import * as title from "./components/d-title";
@@ -11,12 +12,13 @@ import * as appendix from "./components/d-appendix";
import * as distillAppendix from "./components/distill-appendix";
import * as bibliography from "./components/d-bibliography";
import * as references from "./components/d-references";
import { css as codeCss } from "./components/d-code";
import * as code from "./components/d-code";
import * as math from "./components/d-math";
import * as footnote from "./components/d-footnote";
let codeStyle = document.createElement("style");
codeStyle.textContent = codeCss;
document.querySelector("head").appendChild(codeStyle);
// let codeStyle = document.createElement("style");
// codeStyle.textContent = codeCss;
// document.querySelector("head").appendChild(codeStyle);
document.addEventListener("DOMContentLoaded", function() {
// Render byline with authors list.
+72
View File
@@ -0,0 +1,72 @@
const templateHTML = `
<style>
dt-appendix {
display: block;
font-size: 14px;
line-height: 24px;
margin-bottom: 0;
border-top: 1px solid rgba(0,0,0,0.1);
color: rgba(0,0,0,0.5);
background: rgb(250, 250, 250);
padding-top: 36px;
padding-bottom: 60px;
}
dt-appendix h3 {
font-size: 16px;
font-weight: 500;
margin-top: 18px;
margin-bottom: 18px;
color: rgba(0,0,0,0.65);
}
dt-appendix .citation {
font-size: 11px;
line-height: 15px;
border-left: 1px solid rgba(0, 0, 0, 0.1);
padding-left: 18px;
border: 1px solid rgba(0,0,0,0.1);
background: rgba(0, 0, 0, 0.02);
padding: 10px 18px;
border-radius: 3px;
color: rgba(150, 150, 150, 1);
overflow: hidden;
margin-top: -12px;
}
dt-appendix .references {
font-size: 12px;
line-height: 20px;
}
dt-appendix a {
color: rgba(0, 0, 0, 0.6);
}
dt-appendix ol,
dt-appendix ul {
padding-left: 24px;
}
</style>
<div class="l-body">
</div>
`;
export default function(dom, data) {
let el = dom.querySelector('dt-appendix')
if (el) {
let userHTML = el.innerHTML;
el.innerHTML = templateHTML;
let newHTML = "";
// If we have some footnotes on the page, render a container for the footnote list.
if (dom.querySelector("dt-fn")) {
newHTML = newHTML + `<h3>Footnotes</h3><dt-fn-list></dt-fn-list>`;
}
// If we have any citations on the page, render a container for the bibliography.
if (dom.querySelector("dt-cite")) {
newHTML = newHTML + `<h3>References</h3><dt-bibliography></dt-bibliography>`;
}
let div = el.querySelector("div.l-body")
div.innerHTML = userHTML + newHTML;
}
}
+5 -1
View File
@@ -185,6 +185,10 @@ const T = Template("d-article", `
d-article section > d-code {
display: block;
}
d-article > d-math[block],
d-article section > d-math[block] {
display: block;
}
d-article .citation {
color: #668;
cursor: pointer;
@@ -200,4 +204,4 @@ export default class Article extends T(HTMLElement) {
static get is() { return "d-article"; }
}
customElements.define(Article.is, Article);
customElements.define(Article.is, Article);
+1 -1
View File
@@ -157,9 +157,9 @@ export default class Byline extends T(HTMLElement) {
return "d-byline";
}
render(data) {
console.warn("byline!");
this.innerHTML = mustache.render(mustacheTemplate, data);
}
}
customElements.define(Byline.is, Byline);
+53 -172
View File
@@ -1,59 +1,16 @@
import Prism from "prismjs";
import "prismjs/components/prism-python";
import "prismjs/components/prism-clike";
import css from "prismjs/themes/prism.css";
export class Code extends HTMLElement {
import { Template } from "../mixins/template.js"
import { Mutating } from "../mixins/mutating.js"
constructor() {
super();
const options = {childList: true};
let observer = new MutationObserver( (mutations) => {
observer.disconnect();
this.formatCode();
observer.observe(this, options);
})
observer.observe(this, options);
this.formatCode();
}
formatCode() {
const templateString = `
<style>
// check if we have content to render
let content = this.textContent;
if (!content) { return; }
// check if language can be highlighted
this.languageName = this.getAttribute('language');
const language = Prism.languages[this.languageName];
if (language == undefined) {
console.warn(`Distill does not support highlighting your code block in "${this.languageName}".`);
return;
}
this.innerHTML = "";
const c = document.createElement("code");
if (this.hasAttribute("block")) {
// Let's normalize the tab indents
content = content.replace(/\n/, "");
const tabs = content.match(/\s*/);
content = content.replace(new RegExp("\n" + tabs, "g"), "\n");
content = content.trim();
const p = document.createElement("pre");
p.appendChild(c);
this.appendChild(p);
} else {
this.appendChild(c);
}
c.setAttribute("class", "language-" + this.languageName);
c.innerHTML = Prism.highlight(content, language);
}
}
customElements.define("d-code", Code);
export const css = `
code {
white-space: nowrap;
background: rgba(0, 0, 0, 0.04);
@@ -70,130 +27,54 @@ pre code {
padding: 0 0 0 24px;
}
${css}
</style>
code[class*="language-"],
pre[class*="language-"] {
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
}
/* Inline code */
:not(pre) > code[class*="language-"] {
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
<code id="code-container"></code>
`
const Templated = Template("d-code", templateString);
export class Code extends Mutating(Templated(HTMLElement)) {
renderContent() {
// check if language can be highlighted
this.languageName = this.getAttribute('language');
if (!this.languageName) {
console.warn(`You need to provide a language attribute to your <d-code> block to let us know how to highlight your code; e.g.:\n <d-code language="python">zeros = np.zeros(shape)</d-code>.`);
return;
}
const language = Prism.languages[this.languageName];
if (language == undefined) {
console.warn(`Distill does not yet support highlighting your code block in "${this.languageName}".`);
return;
}
let content = this.textContent;
const codeTag = this.shadowRoot.querySelector("#code-container");
if (this.hasAttribute("block")) {
// normalize the tab indents
content = content.replace(/\n/, "");
const tabs = content.match(/\s*/);
content = content.replace(new RegExp("\n" + tabs, "g"), "\n");
content = content.trim();
// wrap code block in pre tag if needed
if (codeTag.parentNode instanceof ShadowRoot) {
const preTag = document.createElement("pre");
this.shadowRoot.removeChild(codeTag)
preTag.appendChild(codeTag);
this.shadowRoot.appendChild(preTag);
}
}
codeTag.className = `language-${this.languageName}`;
codeTag.innerHTML = Prism.highlight(content, language);
}
}
customElements.define("d-code", Code);
+47
View File
@@ -0,0 +1,47 @@
import { Template } from "../mixins/template.js"
import { HoverBox } from "./hover-box.js"
const templateString = `
<style>
d-math[block] {
display: block;
}
</style>
<div style="display: none;" class="dt-hover-box">
<slot></slot>
</div>
<sup><span id="fn-" data-hover-ref="" style="cursor:pointer"></span></sup>
`;
const TemplatedFootnote = Template("d-math", templateString);
export class Footnote extends TemplatedFootnote(HTMLElement) {
constructor() {
super();
Footnote.currentFootnoteId += 1;
const IdString = Footnote.currentFootnoteId.toString();
// set up hidden hover box
const div = this.root.querySelector('.dt-hover-box');
div.id = 'dt-fn-hover-box-' + IdString;
// set up visible footnote marker
const span = this.root.querySelector('#fn-');
span.setAttribute('id', 'fn-' + IdString);
span.setAttribute('data-hover-ref', div.id);
span.textContent = IdString;
HoverBox.get_box(div).bind(span);
}
}
Footnote.currentFootnoteId = 0;
customElements.define("d-footnote", Footnote);
+16 -22
View File
@@ -1,35 +1,29 @@
import katex from "katex";
import { Mutating } from "../mixins/mutating.js"
import { Template } from "../mixins/template.js"
export const html = `
const templateString = `
<style>
dt-math[block] {
d-math[block] {
display: block;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css">
<span id="katex-container"></span>
`;
export class Math extends HTMLElement {
const TemplatedMath = Template("d-math", templateString);
constructor() {
super();
export class Math extends Mutating(TemplatedMath(HTMLElement)) {
const options = {childList: true};
let observer = new MutationObserver( (mutations) => {
observer.disconnect();
this.renderComponent();
observer.observe(this, options);
})
// try a first render
this.renderComponent();
// listen for changes
observer.observe(this, options);
}
renderComponent() {
const displayMode = this.hasAttribute("block");
const options = { displayMode: displayMode };
const renderedMath = katex.renderToString(this.textContent, options);
this.innerHTML = html + renderedMath
renderContent() {
const options = { displayMode: this.hasAttribute("block") };
const container = this.shadowRoot.querySelector("#katex-container")
katex.render(this.textContent, container, options);
}
}
+112
View File
@@ -0,0 +1,112 @@
function make_hover_css(pos) {
var pretty = window.innerWidth > 600;
var padding = pretty? 18 : 12;
var outer_padding = pretty ? 18 : 0;
var bbox = document.querySelector("body").getBoundingClientRect();
var left = pos[0] - bbox.left, top = pos[1] - bbox.top;
var width = Math.min(window.innerWidth-2*outer_padding, 648);
left = Math.min(left, window.innerWidth-width-outer_padding);
width = width - 2*padding;
return (`position: absolute;
background-color: #FFF;
opacity: 0.95;
max-width: ${width}px;
top: ${top}px;
left: ${left}px;
border: 1px solid rgba(0, 0, 0, 0.25);
padding: ${padding}px;
border-radius: ${pretty? 3 : 0}px;
box-shadow: 0px 2px 10px 2px rgba(0, 0, 0, 0.2);
z-index: ${1e6};`);
}
export class HoverBox {
constructor(div) {
this.div = div;
this.visible = false;
this.bindDivEvents(div);
HoverBox.box_map[div.id] = this;
}
}
HoverBox.box_map = {};
HoverBox.get_box = function get_box(div_id) {
if (div_id in HoverBox.box_map) {
return HoverBox.box_map[div_id];
} else {
return new HoverBox(div_id);
}
}
HoverBox.prototype.show = function show(pos){
this.visible = true;
this.div.setAttribute("style", make_hover_css(pos) );
for (var box_id in HoverBox.box_map) {
var box = HoverBox.box_map[box_id];
if (box != this) box.hide();
}
}
HoverBox.prototype.showAtNode = function showAtNode(node){
var bbox = node.getBoundingClientRect();
this.show([bbox.right, bbox.bottom]);
}
HoverBox.prototype.hide = function hide(){
this.visible = false;
if (this.div) this.div.setAttribute("style", "display:none");
if (this.timeout) clearTimeout(this.timeout);
}
HoverBox.prototype.stopTimeout = function stopTimeout() {
if (this.timeout) clearTimeout(this.timeout);
}
HoverBox.prototype.extendTimeout = function extendTimeout(T) {
//console.log("extend", T)
var this_ = this;
this.stopTimeout();
this.timeout = setTimeout(function(){this_.hide();}.bind(this), T);
}
// Bind events to a link to open this box
HoverBox.prototype.bind = function bind(node) {
if (typeof node == "string"){
node = document.querySelector(node);
}
node.addEventListener("mouseover", function(){
if (!this.visible) this.showAtNode(node);
this.stopTimeout();
}.bind(this));
node.addEventListener("mouseout", function(){this.extendTimeout(250);}.bind(this));
node.addEventListener("touchstart", function(e) {
if (this.visible) {
this.hide();
} else {
this.showAtNode(node);
}
// Don't trigger body touchstart event when touching link
e.stopPropagation();
}.bind(this));
}
HoverBox.prototype.bindDivEvents = function bindDivEvents(node){
// For mice, same behavior as hovering on links
this.div.addEventListener("mouseover", function(){
if (!this.visible) this.showAtNode(node);
this.stopTimeout();
}.bind(this));
this.div.addEventListener("mouseout", function(){this.extendTimeout(250);}.bind(this));
// Don't trigger body touchstart event when touching within box
this.div.addEventListener("touchstart", function(e){e.stopPropagation();});
// Close box when touching outside box
document.body.addEventListener("touchstart", function(){this.hide();}.bind(this));
}
-147
View File
@@ -1,147 +0,0 @@
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code {
white-space: nowrap;
background: rgba(0, 0, 0, 0.04);
border-radius: 2px;
padding: 4px 7px;
font-size: 15px;
color: rgba(0, 0, 0, 0.6);
}
pre code {
display: block;
background: white;
border-left: 3px solid rgba(0, 0, 0, 0.05);
padding: 0 0 0 24px;
}
code[class*="language-"],
pre[class*="language-"] {
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
}
/* Inline code */
:not(pre) > code[class*="language-"] {
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
+9 -3
View File
@@ -27,6 +27,7 @@ d-article > figure,
d-article > ul,
d-article > d-abstract,
d-article > d-code,
d-article > d-math,
d-article section > div,
d-article section > p,
d-article section > h1,
@@ -36,7 +37,8 @@ d-article section > h4,
d-article section > figure,
d-article section > ul,
d-article section > d-abstract,
d-article section > d-code {
d-article section > d-code,
d-article section > d-math {
width: auto;
margin-left: 24px;
margin-right: 24px;
@@ -60,6 +62,7 @@ d-article section > d-code {
d-article > ul,
d-article > d-abstract,
d-article > d-code,
d-article > d-math,
d-article section > div,
d-article section > p,
d-article section > h1,
@@ -69,7 +72,8 @@ d-article section > d-code {
d-article section > figure,
d-article section > ul,
d-article section > d-abstract,
d-article section > d-code {
d-article section > d-code,
d-article section > d-math {
margin-left: 72px;
margin-right: 72px;
}
@@ -86,6 +90,7 @@ d-article section > d-code {
d-article > ul,
d-article > d-abstract,
d-article > d-code,
d-article > d-math,
d-article section > div,
d-article section > p,
d-article section > h2,
@@ -94,7 +99,8 @@ d-article section > d-code {
d-article section > figure,
d-article section > ul,
d-article section > d-abstract,
d-article section > d-code {
d-article section > d-code,
d-article section > d-math {
margin-left: calc(50% - 984px / 2);
width: 648px;
}
+2 -3
View File
@@ -1,10 +1,9 @@
import base from "./styles-base.css";
import layout from "./styles-layout.css";
import article from "./styles-article.css";
import code from "./styles-code.css";
import print from "./styles-print.css";
let s = document.createElement("style");
s.textContent = base + layout + code + print;
s.textContent = base + layout + print;
document.querySelector("head").appendChild(s);
export default s;
export default s;
+399 -277
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+14 -9
View File
@@ -2,7 +2,8 @@
<meta charset="utf8">
<script src="../dist/components.js" async></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css">
<d-front-matter>
<script type="text/yml">
@@ -25,8 +26,11 @@
<p>This is the first paragraph of the article. Test a long&thinsp;&mdash;&thinsp;dash -- here it is.</p>
<p>Test for owner's possessive. Test for "quoting a passage." And another sentence. Or two.</p>
<p>Here's a test of an inline equation <d-math>c = a^2 + b^2</d-math>. And then there's a block equation:</p>
<d-math block>c = \pm\sqrt{a^2 + b^2}</d-math>
<p>We can also cite <d-cite key="gregor2015draw,mercier2011humans"></d-cite> external publications. <d-cite key="dong2014image,dumoulin2016guide,mordvintsev2015inceptionism"></d-cite> We should also be testing footnotes<d-fn>This will become a hoverable footnote.</d-fn>.</p>
<d-math block>
c = \pm \sqrt{ \sum_{i=0}^{n}{a^{222} + b^2}}
</d-math>
<p>We can also cite <d-cite key="gregor2015draw,mercier2011humans"></d-cite> external publications. <d-cite key="dong2014image,dumoulin2016guide,mordvintsev2015inceptionism"></d-cite></p>
<p>We should also be testing footnotes<d-footnote>This will become a hoverable footnote.</d-footnote>.</p>
<table>
<thead>
<tr><th>First</th><th>Second</th><th>Third</th></tr>
@@ -37,6 +41,8 @@
<tr><td>234</td><td>54</td><td>23</td></tr>
</tbody>
</table>
<h3>Displaying code snippets</h3>
<p>Some inline javascript:<d-code language="javascript">var x = 25;</d-code></p>
<p>Here's a javascript code block.</p>
<d-code block language="javascript">
var x = 25;
@@ -45,14 +51,13 @@
}
</d-code>
<p>We also support python.</p>
<d-code>hi<div>hello</div></d-code>
<d-code block language="python">
# Python 3: Fibonacci series up to n
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
</d-code>
</d-article>
+81
View File
@@ -0,0 +1,81 @@
import html from "./components/html";
import styles from "./components/styles";
import frontMatter from "./components/front-matter";
import bibliography from "./components/bibliography";
import expandData from "./components/data";
import meta from "./components/meta";
import banner from "./components/banner";
import byline from "./components/byline";
import appendix from "./components/appendix";
import appendixDistill from "./components/appendix-distill";
import citation from "./components/citation";
import footnote from "./components/footnote";
import DTMath from "./components/dt-math";
import markdown from "./components/markdown";
import code from "./components/code";
import typeset from "./components/typeset";
import hoverBox from "./components/hover-box-include";
import generateCrossref from "./components/generate-crossref";
import header from "./components/header";
import footer from "./components/footer";
function renderImmediately(dom) {
html(dom);
styles(dom);
}
function renderOnLoad(dom, data) {
frontMatter(dom, data);
bibliography(dom, data);
expandData(dom, data);
meta(dom, data);
byline(dom, data);
appendix(dom, data);
markdown(dom, data);
DTMath(dom, data);
code(dom, data);
citation(dom, data);
footnote(dom, data);
typeset(dom, data);
hoverBox(dom, data);
}
// If we are in a browser, render automatically...
var browser = new Function("try { return this === window; }catch(e){ return false; }");
if (browser) {
try {
var data = {};
renderImmediately(window.document);
window.document.addEventListener("DOMContentLoaded", function (event) {
renderOnLoad(window.document, data);
// Add a banner if we're not on localhost.
if (window.location.hostname !== "localhost" && window.location.origin !== "file://") {
banner(window.document, data);
}
generateCrossref(data);
// console.log(data);
});
} catch (error) {
console.error("Window not defined");
}
}
// If we are in node...
function render(dom, data) {
renderImmediately(dom);
renderOnLoad(dom, data);
// Remove script tag so it doesn't run again in the client
let s = dom.querySelector('script[src*="distill.pub/template"]');
if (s) { s.parentElement.removeChild(s); };
}
// Distill specific rendering
function distillify(dom, data) {
header(dom, data);
appendixDistill(dom, data);
footer(dom, data);
}
export {render as render};
export {distillify as distillify};
export {generateCrossref as generateCrossref};
+46
View File
@@ -0,0 +1,46 @@
export const Mutating = (superclass) => {
return class extends superclass {
static get observedAttributes() {
return ['textContent'];
}
attributeChangedCallback(name, oldValue, newValue) {
console.warn(name, oldValue, newValue);
}
constructor() {
super();
// set up mutation observer
const options = {childList: true, characterData: true, subtree: true};
const observer = new MutationObserver( (mutations) => {
observer.disconnect();
this.renderIfPossible();
observer.observe(this, options);
});
this.renderIfPossible();
// ...and listen for changes afterwards
observer.observe(this, options);
}
connectedCallback() {
this.renderIfPossible();
}
// potential TODO: check if this is enough for all our usecases
// maybe provide a custom function to tell if we have enough information to render
renderIfPossible() {
if (this.textContent && this.shadowRoot) { this.renderContent(); }
};
renderContent() {
console.error(`Your class ${this.constructor.name} must provide a custom renderContent() method!` );
}
} // end class
}; // end mixin function
+15 -5
View File
@@ -1,35 +1,45 @@
// import '@webcomponents/shadycss/scoping-shim';
export const Template = (name, templateString, useShadow = false) => {
export const Template = (name, templateString, useShadow = true) => {
const template = document.createElement('template');
template.innerHTML = templateString;
// ShadyCSS.prepareTemplate(template, name);
return (superclass) => {
return class extends superclass {
constructor() {
super();
this.clone = document.importNode(template.content, true);
if (useShadow) {
// ShadyCSS.applyStyle(this);
this.shadow_ = this.attachShadow({mode: 'open'});
this.shadow_.appendChild(clone);
this.attachShadow({mode: 'open'});
this.shadowRoot.appendChild(this.clone);
}
}
connectedCallback() {
if (!useShadow) {
this.insertBefore(this.clone, this.firstChild);
}
}
/* TODO: Are we using these? Should we even? */
get root() {
if (useShadow) {
return this.shadow_;
return this.shadowRoot;
} else {
return this;
}
return this;
}
$(query) {
return this.root.querySelector(query);
}
$$(query) {
return this.root.querySelectorAll(query);
}
+2 -1
View File
@@ -41,7 +41,8 @@
"handlebars": "^4.0.6",
"katex": "^0.7.1",
"mustache": "^2.3.0",
"rollup-plugin-babili": "^1.1.1",
"rollup-plugin-babili": "^3.1.0",
"rollup-plugin-gzip": "^1.2.0",
"webcomponents.js": "webcomponents/webcomponentsjs",
"webpack": "^2.2.1"
}
+15 -8
View File
@@ -1,12 +1,12 @@
import buble from 'rollup-plugin-buble';
import resolve from 'rollup-plugin-node-resolve';
import resolve from 'rollup-plugin-node-resolve';
import string from 'rollup-plugin-string';
import commonjs from 'rollup-plugin-commonjs';
import serve from 'rollup-plugin-serve';
// import uglify from 'rollup-plugin-uglify';
import string from 'rollup-plugin-string';
import babili from 'rollup-plugin-babili';
import gzip from 'rollup-plugin-gzip';
import serve from 'rollup-plugin-serve';
const PORT = 8080;
console.log(`open http://localhost:${PORT}/`);
console.log(`opening http://localhost:${PORT} .../`);
export default {
entry: 'components.js',
@@ -27,7 +27,14 @@ export default {
include: ["**/*.txt", "**/*.svg", "**/*.html", "**/*.css", "**/*.base64"]
}),
commonjs(),
// uglify(),
serve({port: PORT})
// babili({
// comments: false, // means: *don't* preserve comments
// sourceMap: true,
// }),
// gzip(), // just for testing -- firebase CDN gzips automatically
serve({
port: PORT,
open: true,
})
]
};
+355 -136
View File
@@ -57,6 +57,13 @@ ajv@^4.7.0:
co "^4.6.0"
json-stable-stringify "^1.0.1"
ajv@^4.9.1:
version "4.11.8"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"
align-text@^0.1.1, align-text@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
@@ -228,33 +235,33 @@ babel-generator@^6.24.0:
source-map "^0.5.0"
trim-right "^1.0.1"
babel-helper-evaluate-path@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.0.3.tgz#1d103ac9d4a59e5d431842212f151785f7ac547b"
babel-helper-evaluate-path@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.1.0.tgz#95d98c4ea36150483db2e7d3ec9e1954a72629cb"
babel-helper-flip-expressions@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.0.2.tgz#7bab2cf61162bc92703e9b298ef512bcf77d6787"
babel-helper-flip-expressions@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.1.2.tgz#77f6652f9de9c42401d827bd46ebd2109e3ef18a"
babel-helper-is-nodes-equiv@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684"
babel-helper-is-void-0@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.0.1.tgz#ed74553b883e68226ae45f989a99b02c190f105a"
babel-helper-is-void-0@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.1.1.tgz#72f21a3abba0bef3837f9174fca731aed9a02888"
babel-helper-mark-eval-scopes@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.0.3.tgz#902f75aeb537336edc35eb9f52b6f09db7785328"
babel-helper-mark-eval-scopes@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.1.1.tgz#4554345edf9f2549427bd2098e530253f8af2992"
babel-helper-remove-or-void@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.0.1.tgz#f602790e465acf2dfbe84fb3dd210c43a2dd7262"
babel-helper-remove-or-void@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.1.1.tgz#9d7e1856dc6fafcb41b283a416730dc1844f66d7"
babel-helper-to-multiple-sequence-expressions@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.0.3.tgz#c789a0faccd2669c51234be2cea7a3e5a0573c25"
babel-helper-to-multiple-sequence-expressions@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.1.1.tgz#5f1b832b39e4acf954e9137f0251395c71196b35"
babel-helpers@^6.23.0:
version "6.23.0"
@@ -269,135 +276,142 @@ babel-messages@^6.23.0:
dependencies:
babel-runtime "^6.22.0"
babel-plugin-minify-constant-folding@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.0.3.tgz#a511e839562489811987a7a503c43c312c40138a"
babel-plugin-minify-builtins@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.1.3.tgz#4f21a7dcb51f91a04ea71d47ff0e8e3b05fec021"
dependencies:
babel-helper-evaluate-path "^0.0.3"
babel-helper-evaluate-path "^0.1.0"
babel-plugin-minify-dead-code-elimination@^0.1.2:
version "0.1.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.4.tgz#18b6ecfab77c29caca061d8210fa3495001e4fa1"
babel-plugin-minify-constant-folding@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.1.3.tgz#57bd172adf8b8d74ad7c99612eb950414ebea3ca"
dependencies:
babel-helper-mark-eval-scopes "^0.0.3"
babel-helper-remove-or-void "^0.0.1"
babel-helper-evaluate-path "^0.1.0"
babel-plugin-minify-dead-code-elimination@^0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.7.tgz#774f536f347b98393a27baa717872968813c342c"
dependencies:
babel-helper-mark-eval-scopes "^0.1.1"
babel-helper-remove-or-void "^0.1.1"
lodash.some "^4.6.0"
babel-plugin-minify-flip-comparisons@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.0.2.tgz#7d0953aa5876ede6118966bda9edecc63bf346ab"
babel-plugin-minify-flip-comparisons@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.1.2.tgz#e286b40b7599b18dfea195071e4279465cfc1884"
dependencies:
babel-helper-is-void-0 "^0.0.1"
babel-helper-is-void-0 "^0.1.1"
babel-plugin-minify-guarded-expressions@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.0.4.tgz#957104a760e6a7ffd967005a7a11621bb42fd11c"
babel-plugin-minify-guarded-expressions@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.1.2.tgz#dfc3d473b0362d9605d3ce0ac1e22328c60d1007"
dependencies:
babel-helper-flip-expressions "^0.0.2"
babel-helper-flip-expressions "^0.1.2"
babel-plugin-minify-infinity@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.0.3.tgz#4cc99b61d12b434ce80ad675103335c589cba9a1"
babel-plugin-minify-infinity@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.1.2.tgz#5f1cf67ddedcba13c8a00da832542df0091a1cd4"
babel-plugin-minify-mangle-names@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.0.6.tgz#7311e82292d5add93ca80c4ecfbde9e8a9730a43"
babel-plugin-minify-numeric-literals@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.0.1.tgz#9597e6c31154d7daf3744d0bd417c144b275bd53"
babel-plugin-minify-replace@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.0.1.tgz#5d5aea7cb9899245248d1ee9ce7a2fe556a8facc"
babel-plugin-minify-simplify@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.0.6.tgz#1d50899b29c3c4503eaefb98365cc5f7a84aedfe"
babel-plugin-minify-mangle-names@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.1.3.tgz#bfa24661a6794fb03833587e55828b65449e06fe"
dependencies:
babel-helper-flip-expressions "^0.0.2"
babel-helper-mark-eval-scopes "^0.1.1"
babel-plugin-minify-numeric-literals@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.1.1.tgz#d4b8b0c925f874714ee33ee4b26678583d7ce7fb"
babel-plugin-minify-replace@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.1.2.tgz#b90b9e71ab4d3b36325629a91beabe13b0b16ac1"
babel-plugin-minify-simplify@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.1.2.tgz#a968f1658fdeb2fc759e81fe331d89829df0f6b9"
dependencies:
babel-helper-flip-expressions "^0.1.2"
babel-helper-is-nodes-equiv "^0.0.1"
babel-helper-to-multiple-sequence-expressions "^0.0.3"
babel-helper-to-multiple-sequence-expressions "^0.1.1"
babel-plugin-minify-type-constructors@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.0.3.tgz#ab59c1ad835b6b6e8e932b875d4df4dc393d9d26"
babel-plugin-minify-type-constructors@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.1.2.tgz#db53c5b76cb8e2fcd45d862f17104c78761337ee"
dependencies:
babel-helper-is-void-0 "^0.0.1"
babel-helper-is-void-0 "^0.1.1"
babel-plugin-transform-inline-consecutive-adds@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.0.2.tgz#a58fcecfc09c08fbf9373a5a3e70746c03d01fc1"
babel-plugin-transform-inline-consecutive-adds@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.1.2.tgz#5442e9f1c19c78a7899f8a4dee6fd481f61001f5"
babel-plugin-transform-member-expression-literals@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.1.tgz#60b78cb2b814ac71dd6104ef51c496c62e877337"
babel-plugin-transform-member-expression-literals@^6.8.4:
version "6.8.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.4.tgz#05679bc40596b91293401959aa1620ab1b2be437"
babel-plugin-transform-merge-sibling-variables@^6.8.1:
babel-plugin-transform-merge-sibling-variables@^6.8.5:
version "6.8.5"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.5.tgz#03abdf107c61241913eb268ddede6d5bc541862c"
babel-plugin-transform-minify-booleans@^6.8.2:
version "6.8.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.2.tgz#498acd07481ab340c1bad8b726c2fad1b8f644e5"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.8.2.tgz#8451579f706e702c1e1ab2756de5c8ea369cf07c"
babel-plugin-transform-minify-booleans@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.8.0.tgz#b1a48864a727847696b84eae36fa4d085a54b42b"
babel-plugin-transform-property-literals@^6.8.4:
version "6.8.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.8.4.tgz#6ad311110b80a192a56efb5ddf4fe3ca6f7a61da"
dependencies:
babel-runtime "^6.0.0"
esutils "^2.0.2"
babel-plugin-transform-property-literals@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.8.1.tgz#05ed01f6024820b18f1d0495c80fe287176bccd9"
babel-plugin-transform-regexp-constructors@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.1.1.tgz#312ab7487cc88a1c62ee25ea1b6087e89b87799c"
babel-plugin-transform-regexp-constructors@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.0.5.tgz#74d95e0c567e6fc1d9c699a084894d40de8e581d"
babel-plugin-transform-remove-console@^6.8.4:
version "6.8.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.8.4.tgz#41fddac19a729a4c3dd7ef2964eac07b096f9a8f"
babel-plugin-transform-remove-console@^6.8.0:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.8.1.tgz#38f6a6ca1581e76b75fc2c6fdcf909deadee7d6a"
babel-plugin-transform-remove-debugger@^6.8.4:
version "6.8.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.8.4.tgz#f85704a08adaa71b55d77005b5b94e9b9df21f6e"
babel-plugin-transform-remove-debugger@^6.8.0:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.8.1.tgz#aabd0be107f8299094defe8e1ba8ccf4b114d07f"
babel-plugin-transform-remove-undefined@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.1.2.tgz#e1ebf51110f6b1e0665f28382ef73f95e5023652"
babel-plugin-transform-remove-undefined@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.0.4.tgz#cc75be04b9bbd7bb2005272cc160b4d08692d77c"
babel-plugin-transform-simplify-comparison-operators@^6.8.4:
version "6.8.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.8.4.tgz#2aa24a262d664c8cb3e125a306c798d7a2de08d5"
babel-plugin-transform-simplify-comparison-operators@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.8.1.tgz#a307088e0d1c728081777fba568f4107396ab25c"
babel-plugin-transform-undefined-to-void@^6.8.2:
version "6.8.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.8.2.tgz#fe2b1d294eb05e87524eb93724dea6e2c3d66fa1"
babel-plugin-transform-undefined-to-void@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.8.0.tgz#bc5b6b4908d3b1262170e67cb3963903ddce167e"
babel-preset-babili@^0.1.2:
version "0.1.4"
resolved "https://registry.yarnpkg.com/babel-preset-babili/-/babel-preset-babili-0.1.4.tgz#ad9d6651002f5bc3f07cab300781167f54724bf2"
dependencies:
babel-runtime "^6.0.0"
babel-preset-babili@^0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/babel-preset-babili/-/babel-preset-babili-0.0.10.tgz#59118924b77b898eecd8f75a5b97d694719443ff"
dependencies:
babel-plugin-minify-constant-folding "^0.0.3"
babel-plugin-minify-dead-code-elimination "^0.1.2"
babel-plugin-minify-flip-comparisons "^0.0.2"
babel-plugin-minify-guarded-expressions "^0.0.4"
babel-plugin-minify-infinity "^0.0.3"
babel-plugin-minify-mangle-names "^0.0.6"
babel-plugin-minify-numeric-literals "^0.0.1"
babel-plugin-minify-replace "^0.0.1"
babel-plugin-minify-simplify "^0.0.6"
babel-plugin-minify-type-constructors "^0.0.3"
babel-plugin-transform-inline-consecutive-adds "^0.0.2"
babel-plugin-transform-member-expression-literals "^6.8.1"
babel-plugin-transform-merge-sibling-variables "^6.8.1"
babel-plugin-transform-minify-booleans "^6.8.0"
babel-plugin-transform-property-literals "^6.8.1"
babel-plugin-transform-regexp-constructors "^0.0.5"
babel-plugin-transform-remove-console "^6.8.0"
babel-plugin-transform-remove-debugger "^6.8.0"
babel-plugin-transform-remove-undefined "^0.0.4"
babel-plugin-transform-simplify-comparison-operators "^6.8.1"
babel-plugin-transform-undefined-to-void "^6.8.0"
babel-plugin-minify-builtins "^0.1.3"
babel-plugin-minify-constant-folding "^0.1.3"
babel-plugin-minify-dead-code-elimination "^0.1.7"
babel-plugin-minify-flip-comparisons "^0.1.2"
babel-plugin-minify-guarded-expressions "^0.1.2"
babel-plugin-minify-infinity "^0.1.2"
babel-plugin-minify-mangle-names "^0.1.3"
babel-plugin-minify-numeric-literals "^0.1.1"
babel-plugin-minify-replace "^0.1.2"
babel-plugin-minify-simplify "^0.1.2"
babel-plugin-minify-type-constructors "^0.1.2"
babel-plugin-transform-inline-consecutive-adds "^0.1.2"
babel-plugin-transform-member-expression-literals "^6.8.4"
babel-plugin-transform-merge-sibling-variables "^6.8.5"
babel-plugin-transform-minify-booleans "^6.8.2"
babel-plugin-transform-property-literals "^6.8.4"
babel-plugin-transform-regexp-constructors "^0.1.1"
babel-plugin-transform-remove-console "^6.8.4"
babel-plugin-transform-remove-debugger "^6.8.4"
babel-plugin-transform-remove-undefined "^0.1.2"
babel-plugin-transform-simplify-comparison-operators "^6.8.4"
babel-plugin-transform-undefined-to-void "^6.8.2"
lodash.isplainobject "^4.0.6"
babel-register@^6.24.0:
@@ -412,7 +426,7 @@ babel-register@^6.24.0:
mkdirp "^0.5.1"
source-map-support "^0.4.2"
babel-runtime@^6.0.0, babel-runtime@^6.22.0:
babel-runtime@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
dependencies:
@@ -628,6 +642,10 @@ caseless@~0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
center-align@^0.1.1:
version "0.1.3"
resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
@@ -698,6 +716,10 @@ cliui@^3.2.0:
strip-ansi "^3.0.1"
wrap-ansi "^2.0.0"
clone@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149"
co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
@@ -718,6 +740,10 @@ commander@2.9.0, commander@^2.9.0:
dependencies:
graceful-readlink ">= 1.0.0"
commander@^2.8.1:
version "2.11.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -850,6 +876,12 @@ deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
defaults@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d"
dependencies:
clone "^1.0.2"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
@@ -1063,7 +1095,7 @@ fsevents@^1.0.0:
nan "^2.3.0"
node-pre-gyp "^0.6.29"
fstream-ignore@~1.0.5:
fstream-ignore@^1.0.5, fstream-ignore@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105"
dependencies:
@@ -1080,6 +1112,15 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10:
mkdirp ">=0.5 0"
rimraf "2"
fstream@^1.0.10:
version "1.0.11"
resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171"
dependencies:
graceful-fs "^4.1.2"
inherits "~2.0.0"
mkdirp ">=0.5 0"
rimraf "2"
gauge@~2.7.1:
version "2.7.2"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774"
@@ -1094,6 +1135,19 @@ gauge@~2.7.1:
supports-color "^0.2.0"
wide-align "^1.1.0"
gauge@~2.7.3:
version "2.7.4"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
dependencies:
aproba "^1.0.3"
console-control-strings "^1.0.0"
has-unicode "^2.0.0"
object-assign "^4.1.0"
signal-exit "^3.0.0"
string-width "^1.0.1"
strip-ansi "^3.0.1"
wide-align "^1.1.0"
generate-function@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
@@ -1170,6 +1224,10 @@ handlebars@^4.0.6:
optionalDependencies:
uglify-js "^2.6"
har-schema@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
har-validator@~2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d"
@@ -1179,6 +1237,13 @@ har-validator@~2.0.6:
is-my-json-valid "^2.12.4"
pinkie-promise "^2.0.0"
har-validator@~4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a"
dependencies:
ajv "^4.9.1"
har-schema "^1.0.5"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
@@ -1268,7 +1333,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1:
inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
@@ -1729,6 +1794,10 @@ mustache@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.0.tgz#4028f7778b17708a489930a6e52ac3bca0da41d0"
nan@^2.0.0:
version "2.6.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
nan@^2.3.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8"
@@ -1775,6 +1844,36 @@ node-pre-gyp@^0.6.29:
tar "~2.2.1"
tar-pack "~3.3.0"
node-pre-gyp@^0.6.4:
version "0.6.36"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786"
dependencies:
mkdirp "^0.5.1"
nopt "^4.0.1"
npmlog "^4.0.2"
rc "^1.1.7"
request "^2.81.0"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^2.2.1"
tar-pack "^3.4.0"
node-zopfli@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/node-zopfli/-/node-zopfli-2.0.2.tgz#a7a473ae92aaea85d4c68d45bbf2c944c46116b8"
dependencies:
commander "^2.8.1"
defaults "^1.0.2"
nan "^2.0.0"
node-pre-gyp "^0.6.4"
nopt@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
dependencies:
abbrev "1"
osenv "^0.1.4"
nopt@~3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
@@ -1803,6 +1902,15 @@ npmlog@^4.0.1:
gauge "~2.7.1"
set-blocking "~2.0.0"
npmlog@^4.0.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
dependencies:
are-we-there-yet "~1.1.2"
console-control-strings "~1.1.0"
gauge "~2.7.3"
set-blocking "~2.0.0"
number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
@@ -1832,6 +1940,12 @@ once@^1.3.0, once@~1.3.3:
dependencies:
wrappy "1"
once@^1.3.3:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
opener@^1.4.2:
version "1.4.2"
resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.2.tgz#b32582080042af8680c389a499175b4c54fff523"
@@ -1868,10 +1982,17 @@ os-locale@^1.4.0:
dependencies:
lcid "^1.0.0"
os-tmpdir@^1.0.1:
os-tmpdir@^1.0.0, os-tmpdir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
osenv@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644"
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"
pako@~0.2.0:
version "0.2.9"
resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75"
@@ -1933,6 +2054,10 @@ pbkdf2@^3.0.3:
dependencies:
create-hmac "^1.1.2"
performance-now@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
pify@^2.0.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -1999,6 +2124,10 @@ qs@~6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442"
qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
querystring-es3@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
@@ -2018,6 +2147,15 @@ randombytes@^2.0.0, randombytes@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec"
rc@^1.1.7:
version "1.2.1"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95"
dependencies:
deep-extend "~0.4.0"
ini "~1.3.0"
minimist "^1.2.0"
strip-json-comments "~2.0.1"
rc@~1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9"
@@ -2054,6 +2192,18 @@ read-pkg@^1.0.0:
string_decoder "~0.10.x"
util-deprecate "~1.0.1"
readable-stream@^2.1.4:
version "2.3.3"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
safe-buffer "~5.1.1"
string_decoder "~1.0.3"
util-deprecate "~1.0.1"
readable-stream@~2.1.4:
version "2.1.5"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
@@ -2125,6 +2275,33 @@ request@^2.79.0:
tunnel-agent "~0.4.1"
uuid "^3.0.0"
request@^2.81.0:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
dependencies:
aws-sign2 "~0.6.0"
aws4 "^1.2.1"
caseless "~0.12.0"
combined-stream "~1.0.5"
extend "~3.0.0"
forever-agent "~0.6.1"
form-data "~2.1.1"
har-validator "~4.2.1"
hawk "~3.1.3"
http-signature "~1.1.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.7"
oauth-sign "~0.8.1"
performance-now "^0.2.0"
qs "~6.4.0"
safe-buffer "^5.0.1"
stringstream "~0.0.4"
tough-cookie "~2.3.0"
tunnel-agent "^0.6.0"
uuid "^3.0.0"
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
@@ -2153,18 +2330,23 @@ rimraf@2, rimraf@~2.5.1, rimraf@~2.5.4:
dependencies:
glob "^7.0.5"
rimraf@^2.5.1, rimraf@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d"
dependencies:
glob "^7.0.5"
ripemd160@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e"
rollup-plugin-babili@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-babili/-/rollup-plugin-babili-1.1.1.tgz#fb5438c0c71aa85e648c98f6e53e6426e46514bd"
rollup-plugin-babili@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-babili/-/rollup-plugin-babili-3.1.0.tgz#27ada043a0ed021050a712528f68ed641888b5dc"
dependencies:
"@comandeer/babel-plugin-banner" "^1.0.0"
babel-core "^6.21.0"
babel-preset-babili "^0.0.10"
sourcemap-codec "^1.3.0"
babel-preset-babili "^0.1.2"
rollup-plugin-buble@^0.14.0:
version "0.14.0"
@@ -2183,6 +2365,12 @@ rollup-plugin-commonjs@^7.0.0:
resolve "^1.1.7"
rollup-pluginutils "^1.5.1"
rollup-plugin-gzip@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-gzip/-/rollup-plugin-gzip-1.2.0.tgz#4b63c2fcfb7b5eefaf5ea187ef2b4496b2d418d0"
optionalDependencies:
node-zopfli "^2.0.2"
rollup-plugin-node-resolve@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.0.0.tgz#07e0ae94ac002a3ea36e8f33ca121d9f836b1309"
@@ -2229,6 +2417,10 @@ rollup@latest:
dependencies:
source-map-support "^0.4.0"
safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
sax@>=0.6.0, sax@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a"
@@ -2241,6 +2433,10 @@ select@^1.0.6:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
semver@^5.3.0:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
set-blocking@^2.0.0, set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
@@ -2299,12 +2495,6 @@ source-map@~0.2.0:
dependencies:
amdefine ">=0.0.4"
sourcemap-codec@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.3.0.tgz#754b78bdc42edc48295eeb6e5ca525c9ab09413a"
dependencies:
vlq "^0.2.1"
spdx-correct@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40"
@@ -2367,6 +2557,12 @@ string_decoder@^0.10.25, string_decoder@~0.10.x:
version "0.10.31"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
string_decoder@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
dependencies:
safe-buffer "~5.1.0"
stringstream@~0.0.4:
version "0.0.5"
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
@@ -2387,6 +2583,10 @@ strip-json-comments@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"
strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
supports-color@3.1.2, supports-color@^3.1.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
@@ -2409,6 +2609,19 @@ tapable@^0.2.5, tapable@~0.2.5:
version "0.2.6"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.6.tgz#206be8e188860b514425375e6f1ae89bfb01fd8d"
tar-pack@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984"
dependencies:
debug "^2.2.0"
fstream "^1.0.10"
fstream-ignore "^1.0.5"
once "^1.3.3"
readable-stream "^2.1.4"
rimraf "^2.5.1"
tar "^2.2.1"
uid-number "^0.0.6"
tar-pack@~3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae"
@@ -2422,7 +2635,7 @@ tar-pack@~3.3.0:
tar "~2.2.1"
uid-number "~0.0.6"
tar@~2.2.1:
tar@^2.2.1, tar@~2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1"
dependencies:
@@ -2466,6 +2679,12 @@ tty-browserify@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
dependencies:
safe-buffer "^5.0.1"
tunnel-agent@~0.4.1:
version "0.4.3"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
@@ -2501,7 +2720,7 @@ uglify-to-browserify@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
uid-number@~0.0.6:
uid-number@^0.0.6, uid-number@~0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"