diff --git a/.tmp/site-assets/main.css b/.tmp/site-assets/main.css new file mode 100644 index 0000000000..fa7270a86c --- /dev/null +++ b/.tmp/site-assets/main.css @@ -0,0 +1,434 @@ +html, +body { + margin: 0; + padding: 0; +} + +body { + font: 16px 'Helvetica Neue', Helvetica, Arial; + font-weight: 300; + line-height: 1.5; + width: auto; + background: #fafafa; + color: #353535; + font-smoothing: antialiased; +} +body.learn-page{ + max-width: 1600px; + margin: 0 auto; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 400; + line-height: 1.2; + color: #000; +} + +h2 { + margin: 10px 0; + font-size: 24px; +} + +a, +.link { + color: #9f3c3c; + font-weight: 500; + cursor: pointer; +} + + +a:hover, +.link:hover { + color: #431919; + text-decoration: underline; +} + +p { + font-size: 16px; + line-height: 1.5; + font-weight: 300; +} + +var { + font-style: normal; +} + +header p { + font-size: 30px; + line-height: 1.2; + margin-top: 10px; +} + +header nav { + margin-top: 20px; + font-size: 20px; +} + +header nav a { + font-weight: 200; +} + +header nav a:not(:last-child) { + margin-right: 5px; + margin-bottom: 5px; +} + +.logo { + margin-top: 70px; +} + +.logo-icon { + display: none; +} + +.row { + margin-top: 20px; + margin-bottom: 20px; +} + +.screenshot { + width: 100%; + height: auto; + max-width: 558px; + margin-top: 12px; + float: right; +} + +.tagline2 { + font-size: 21px; + font-style: italic; + margin-top: 40px; +} + +.container { + margin-top: 10px; + margin-bottom: 20px; +} + +.whats-new li { + position: relative; + margin: 15px 0; + list-style: none; +} + +.whats-new li:before { + content: '✔'; + position: absolute; + left: -20px; +} + +.app-lists { + overflow: hidden; +} + +.applist { + list-style: none; + margin: 0; + padding: 0; + font-size: 17px; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +.applist li { + padding: 10px 0; + width: 160px; +} + +.applist a { + position: relative; /* popover */ +} + +.applist-intro { + margin: 10px 0 10px; + font-style: italic; +} + +.applist .routing::after, +.applist .label, +.legend .label { + content: 'R'; + position: relative; + top: -3px; + font-size: 9px; + padding: 1px 3px 1px; + background-color: rgba(0, 0, 0, .1); + border-radius: 3px; + font-weight: bold; + line-height: 13px; + color: #777; + vertical-align: middle; + white-space: nowrap; + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.25); +} + +.applist .labs a, +.labs-example { + color: #582C42; +} + +.applist a:hover .label { + text-decoration: none !important; + color: red; +} + +.legend { + margin-top: 20px; + margin-left: 0; + padding: 0; + list-style-type: none; +} + +.legend li { + margin-bottom: 0.5em; +} + +.legend li:last-child { + margin-bottom: 0; +} + +.collapsed { + overflow: hidden; + max-height: 0; + transition: max-height 0.7s ease-out; +} + +#news-expander { + display: none; +} + +#news-expander:checked ~ .collapsed { + max-height: 999px; + transition: max-height 0.7s ease-in; +} + +.credit { + text-align: center; +} + +.credit a { + margin: 5px; + white-space: nowrap; +} + +.credit a img { + border-radius: 3px; + margin-right: 5px; +} + +.popover { + margin: 0; + cursor: default; + color: #333; + white-space: normal; + z-index: 999; +} + +.popover-title { + padding: 9px 70px 9px 15px; +} + +.popover-title a { + font-size: 13px; + position: absolute; + right: 20px; +} + +.quote { + border: none; + margin: 20px 0 70px 0; +} + +.quote p { + font-size: 17px; + line-height: 1.3; + font-style: italic; +} + +.quote p:before { + content: '“'; + font-size: 50px; + opacity: .15; + position: absolute; + top: -20px; + left: 3px; +} + +.quote p:after { + content: '”'; + font-size: 50px; + opacity: .15; + position: absolute; + bottom: -42px; + right: 3px; +} + +.quote footer { + position: absolute; + bottom: -60px; + left: 12px; +} + +.quote footer img { + border-radius: 3px; +} + +.quote footer a { + margin-left: 5px; + vertical-align: middle; +} + +.speech-bubble { + position: relative; + padding: 10px; + background: rgba(0, 0, 0, .04); + border-radius: 5px; +} + +.speech-bubble:after { + content: ''; + position: absolute; + top: 100%; + left: 20px; + border: 13px solid transparent; + border-top-color: rgba(0, 0, 0, .04); +} + +.zocial.red { + background-color: #b12d2b; +} + +.zocial.gray { + background-color: rgba(0, 0, 0, .5); +} + +.zocial.ltgray { + color: inherit; + text-shadow: none; +} + +.zocial.ltgray strong { + color: #B83F45; +} + +.zocial.small { + font-size: 12px; + padding: 2px 10px; +} + +.zocial, +a.zocial { + background: #f4f4f4; + border: 1px solid #777; + border-color: rgba(0, 0, 0, 0.2); + border-bottom-color: #333; + border-bottom-color: rgba(0, 0, 0, 0.4); + color: white; + cursor: pointer; + display: inline-block; + padding: 6px 10px; + text-align: center; + text-decoration: none; + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + position: relative; + border-radius: .3em; +} + +@media (max-width: 480px) { + .credit a { + display: block; + } +} + +@media (max-width: 770px) { + h2 { + margin-top: 20px; + } + + .row, + .credit { + margin-left: 10px; + margin-right: 10px; + } + + .logo { + max-width: 100%; + margin-top: 0; + } + + .container { + margin: auto; + } +} + +@media (min-width: 992px) { + .logo-icon { + display: block; + } +} + +hr { + margin: 20px 0; + border: 0; + border-top: 1px dashed #c5c5c5; + border-bottom: 1px dashed #f7f7f7; +} + +/* Learn page specifics*/ +.learn-page > .learn { + position: fixed; + height: 100%; + width: 272px; + top: 0px; + left: -300px; + overflow-y: auto; + padding: 0px; + background-color: rgba(255, 255, 255, .6); + transition-property: left; + transition-duration: 500ms; + line-height: 36px; + text-indent: 20px; +} +.learn-page nav a { + display: block; +} + +.learn nav a:hover, .learn-page nav a.selected { + background-color: #b83f45; + color: #ffffff; +} + +.learn .content { + padding: 15px; +} +.learn-page header { + width: 100%; +} + +div.learn { + margin: 50px 20px 20px 20px; + padding: 20px; + background: #eee; +} + +@media (min-width: 899px) { + .learn-page { + width: auto; + padding-left: 300px; + } + + .learn-page > .learn { + left: 8px; + } +} \ No newline at end of file diff --git a/cypress/support/index.js b/cypress/support/index.js index 8edffddd85..6dc130452f 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -1,3 +1,9 @@ import { createTodoCommands } from './commands' export default createTodoCommands + +// Cypress.on('uncaught:exception', (err, runnable) => { +// // returning false here prevents Cypress from +// // failing the test +// return false +// }); diff --git a/examples/prest-lib/.editorconfig b/examples/prest-lib/.editorconfig new file mode 100644 index 0000000000..b3f2acdb37 --- /dev/null +++ b/examples/prest-lib/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +trim_trailing_whitespace = true +insert_final_newline = true + +[package.json] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/examples/prest-lib/.gitattributes b/examples/prest-lib/.gitattributes new file mode 100644 index 0000000000..176a458f94 --- /dev/null +++ b/examples/prest-lib/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/examples/prest-lib/.gitignore b/examples/prest-lib/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/examples/prest-lib/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/examples/prest-lib/app-spec.md b/examples/prest-lib/app-spec.md new file mode 100644 index 0000000000..0c2c6a8307 --- /dev/null +++ b/examples/prest-lib/app-spec.md @@ -0,0 +1,122 @@ +# Application Specification + +We have created this short spec to help you create awesome and consistent todo apps. Make sure to not only read it but to understand it as well. + +## Template Application + +Our [template](https://github.com/tastejs/todomvc-app-template/) should be used as the base when implementing a todo app. Before implementing, we recommend that you interact with some of the other apps to see how they're built and how they behave. Check out the [Backbone app](http://todomvc.com/examples/backbone) if you need a reference implementation. If something is unclear or could be improved, [let us know](https://github.com/tastejs/todomvc/issues). + +## Structure + +### Directory Structure + +Recommended file structure: + +```sh +index.html +package.json +node_modules/ +css +└── app.css +js/ +├── app.js +├── controllers/ +└── models/ +readme.md +``` + +Try to follow this structure as close as possible while still keeping to the framework’s best practices. + +Components should be split up into separate files and placed into folders where it makes the most sense. + +Example: + +```sh +js/ +├── app.js +├── controllers/ +│ └── todos.js +└── models/ + └── todo.js +``` + +Keep in mind that the framework’s best practices on how to structure your app come first. + +### README + +All examples must include a README describing the framework, the general implementation, and the build process if required. There is an [example readme](https://github.com/tastejs/todomvc-app-template/blob/master/app-readme.md) included in the [template](https://github.com/tastejs/todomvc-app-template). + +### Dependency Management + +Unless it conflicts with the project's best practices, your example should use [npm](https://npmjs.com) for package management. Specify your dependencies in a `package.json` file in the root directory of your app. The file must include `todomvc-common` and `todomvc-app-css` as dependencies. An example `package.json` could look like this: + +```json +{ + "private": true, + "dependencies": { + "backbone": "^1.1.2", + "todomvc-app-css": "^1.0.0", + "todomvc-common": "^1.0.1" + } +} +``` + +You should `.gitignore` everything in `node_modules` except the files actually used by your example. That means that documentation, READMEs and tests should not be included in the pull request. + +### Code + +Please try to keep the HTML as close to the template as possible. Remove the comments from the HTML when you are finished. The `base.css` file should be referenced from the assets folder and should not be touched. If you need to change some styles, use the `app.css` file, but try to keep changes to a minimum. Remember to update the relative paths when using the template. + +Make sure to follow these: + +- Follow our [code style](contributing.md#code-style). +- Use double-quotes in HTML and single-quotes in JS and CSS. +- Use npm packages for your third-party dependencies and manually remove files that aren't required for your app to run. +- Use a constant instead of the keyCode directly: `var ENTER_KEY = 13;` +- Apps should be written without any preprocessors (Sass/CoffeeScript/..) to reach the largest audience. +- To make it easy to compare frameworks, the app should look and behave exactly like the template and the other examples. +- We require apps to work in every browser we [support](contributing.md#browser-compatibility). + +## Functionality + +### No todos + +When there are no todos, `#main` and `#footer` should be hidden. + +### New todo + +New todos are entered in the input at the top of the app. The input element should be focused when the page is loaded, preferably by using the `autofocus` input attribute. Pressing Enter creates the todo, appends it to the todo list, and clears the input. Make sure to `.trim()` the input and then check that it's not empty before creating a new todo. + +### Mark all as complete + +This checkbox toggles all the todos to the same state as itself. Make sure to clear the checked state after the "Clear completed" button is clicked. The "Mark all as complete" checkbox should also be updated when single todo items are checked/unchecked. Eg. When all the todos are checked it should also get checked. + +### Item + +A todo item has three possible interactions: + +1. Clicking the checkbox marks the todo as complete by updating its `completed` value and toggling the class `completed` on its parent `
  • ` + +2. Double-clicking the `
  • ` + +3. Hovering over the todo shows the remove button (`.destroy`) + +### Editing + +When editing mode is activated it will hide the other controls and bring forward an input that contains the todo title, which should be focused (`.focus()`). The edit should be saved on both blur and enter, and the `editing` class should be removed. Make sure to `.trim()` the input and then check that it's not empty. If it's empty the todo should instead be destroyed. If escape is pressed during the edit, the edit state should be left and any changes be discarded. + +### Counter + +Displays the number of active todos in a pluralized form. Make sure the number is wrapped by a `` tag. Also make sure to pluralize the `item` word correctly: `0 items`, `1 item`, `2 items`. Example: **2** items left + +### Clear completed button + +Removes completed todos when clicked. Should be hidden when there are no completed todos. + +### Persistence + +Your app should dynamically persist the todos to localStorage. If the framework has capabilities for persisting data (e.g. Backbone.sync), use that. Otherwise, use vanilla localStorage. If possible, use the keys `id`, `title`, `completed` for each item. Make sure to use this format for the localStorage name: `todos-[framework]`. Editing mode should not be persisted. + +### Routing + +Routing is required for all implementations. If supported by the framework, use its built-in capabilities. Otherwise, use the [Flatiron Director](https://github.com/flatiron/director) routing library located in the `/assets` folder. The following routes should be implemented: `#/` (all - default), `#/active` and `#/completed` (`#!/` is also allowed). When the route changes, the todo list should be filtered on a model level and the `selected` class on the filter links should be toggled. When an item is updated while in a filtered state, it should be updated accordingly. E.g. if the filter is `Active` and the item is checked, it should be hidden. Make sure the active filter is persisted on reload. diff --git a/examples/prest-lib/css/app.css b/examples/prest-lib/css/app.css new file mode 100644 index 0000000000..dc5dd44da9 --- /dev/null +++ b/examples/prest-lib/css/app.css @@ -0,0 +1,8 @@ +/* + +app-template.css overrides + +remove this comment if used +remove this file if not + +*/ diff --git a/examples/prest-lib/index.html b/examples/prest-lib/index.html new file mode 100644 index 0000000000..951fafb210 --- /dev/null +++ b/examples/prest-lib/index.html @@ -0,0 +1,74 @@ + + + + + + pREST Lib Widgets • TodoMVC + + + + + + +
    +
    +

    todos

    + +
    + +
    + + +
      + + +
    • +
      + + + +
      + +
    • +
    • +
      + + + +
      + +
    • +
    +
    + + +
    + + + + + + + diff --git a/examples/prest-lib/js/index.js b/examples/prest-lib/js/index.js new file mode 100644 index 0000000000..855caf873e --- /dev/null +++ b/examples/prest-lib/js/index.js @@ -0,0 +1,2 @@ +!function(){"use strict";function t(t,e){function n(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function e(t,n,i){if(t){if(0===t.length||"string"!=typeof t[0])throw"jsonml parse error: "+JSON.stringify(t);for(var o=t[0],s=t[1],r=s&&s.constructor===Object,c=r?2:1,a=0,d=c;d void;\n\nexport interface JsonMLObj {\n toJsonML?(): JsonML;\n}\n\nexport interface JsonML extends Array {\n // 0: string;\n // 1?: Attrs | JsonML | JsonMLFnc | JsonMObj;\n}\n\nexport interface JsonMLs extends Array {\n}\n\n\nexport interface JsonMLHandler {\n open(tag: string, attrs: Attrs, children: number, ctx?: any): boolean;\n close(tag: string, children: number, ctx?: any): void;\n text(text: string, ctx?: any): void;\n fnc(fnc: JsonMLFnc, ctx?: any): void;\n obj(obj: JsonMLObj, ctx?: any): void;\n}\n\nexport function jsonml(jsonML: JsonML, handler: JsonMLHandler, ctx?: any): void {\n if (!jsonML) {\n return;\n }\n\n if (jsonML.length === 0 || typeof jsonML[0] !== \"string\") {\n throw `jsonml parse error: ${JSON.stringify(jsonML)}`;\n }\n\n const head = jsonML[0] as string;\n const attrsObj = jsonML[1] as any;\n const hasAttrs = attrsObj && attrsObj.constructor === Object;\n const childIdx = hasAttrs ? 2 : 1;\n\n let children = 0;\n for (let i = childIdx; i < jsonML.length; i++) {\n if (jsonML[i] && jsonML[i].constructor !== Function) {\n children++;\n }\n }\n\n const refSplit = head.split(\"~\");\n const ref = refSplit[1];\n const dotSplit = refSplit[0].split(\".\");\n const hashSplit = dotSplit[0].split(\"#\");\n const tag = hashSplit[0] || \"div\";\n const id = hashSplit[1];\n const classes = dotSplit.slice(1);\n\n let attrs: Attrs;\n if (hasAttrs) {\n attrs = attrsObj as Attrs;\n } else {\n attrs = {};\n }\n\n if (id) {\n attrs._id = id;\n }\n if (classes.length) {\n attrs._classes = classes;\n }\n if (ref) {\n attrs._ref = ref;\n }\n\n const skip = handler.open(tag, attrs, children, ctx);\n\n if (!skip) {\n for (let i = childIdx, l = jsonML.length; i < l; i++) {\n const jml = jsonML[i] as any;\n if (jml === undefined) {\n continue;\n }\n switch (jml.constructor) {\n case Array:\n jsonml(jml, handler, ctx);\n break;\n case Function:\n handler.fnc(jml, ctx);\n break;\n case String:\n handler.text(jml, ctx);\n break;\n case Number:\n handler.text(\"\" + jml, ctx);\n break;\n case Boolean:\n handler.text(\"\" + jml, ctx);\n break;\n default:\n handler.obj(jml, ctx);\n }\n }\n }\n\n handler.close(tag, children, ctx);\n}\n","\nimport {\n JsonML,\n JsonMLs,\n JsonMLObj,\n JsonMLFnc,\n Attrs,\n JsonMLHandler,\n jsonml\n} from \"./jsonml\";\n\n\ndeclare var IncrementalDOM: any;\n\n\nclass JsonmlIDomHandler implements JsonMLHandler {\n\n open(tag: string, attrs: Attrs, children: number, ctx?: any): boolean {\n const props: any[] = [];\n let id: string = attrs._id;\n let classes: string[] = attrs._classes ? attrs._classes : [];\n let ref: string = attrs._ref;\n let widget: any = attrs._widget;\n for (const a in attrs) {\n if (attrs.hasOwnProperty(a)) {\n switch (a) {\n case \"_id\":\n case \"_classes\":\n case \"_ref\":\n case \"_key\":\n case \"_skip\":\n case \"_widget\":\n break;\n case \"id\":\n id = attrs[a];\n break;\n case \"classes\":\n classes = classes.concat(attrs[a]);\n break;\n case \"class\":\n classes = classes.concat(attrs[a].split(\" \"));\n break;\n case \"data\":\n for (const d in attrs[a]) {\n if (attrs[a].hasOwnProperty(d)) {\n if (attrs[a][d].constructor === String) {\n props.push(\"data-\" + d, attrs[a][d]);\n } else {\n props.push(\"data-\" + d, JSON.stringify(attrs[a][d]));\n }\n }\n }\n break;\n case \"styles\":\n props.push(\"style\", attrs[a]);\n break;\n default:\n if (typeof attrs[a] === \"function\") {\n props.push(\"on\" + a, attrs[a]);\n } else {\n props.push(a, attrs[a]);\n }\n }\n }\n }\n if (classes.length) {\n props.unshift(\"class\", classes.join(\" \"));\n }\n if (id) {\n props.unshift(\"id\", id);\n }\n IncrementalDOM.elementOpen(tag, attrs._key || null, null, ...props);\n if (attrs._skip) {\n IncrementalDOM.skip();\n }\n if (ctx && ref) {\n ctx.refs[ref] = IncrementalDOM.currentElement();\n }\n if (widget && \"mount\" in widget && widget.mount.constructor === Function) {\n widget.mount(IncrementalDOM.currentElement());\n IncrementalDOM.skip();\n }\n return attrs._skip ? true : false;\n }\n\n close(tag: string, children: number, ctx?: any): void {\n IncrementalDOM.elementClose(tag);\n }\n\n text(text: string, ctx?: any): void {\n IncrementalDOM.text(text);\n }\n\n fnc(fnc: JsonMLFnc, ctx?: any): void {\n fnc(IncrementalDOM.currentElement());\n }\n\n obj(obj: JsonMLObj, ctx?: any): void {\n if (\"toJsonML\" in obj) {\n jsonml(obj.toJsonML(), this, obj);\n } else {\n this.text(\"\" + obj, ctx);\n }\n }\n\n}\n\nfunction jsonml2idom(jsonML: JsonML, ctx?: any): void {\n jsonml(jsonML, new JsonmlIDomHandler(), ctx);\n}\n\n\nfunction jsonmls2idom(jsonMLs: JsonMLs, ctx?: any): void {\n for (const jsonML of jsonMLs) {\n if (jsonML.constructor === String) {\n IncrementalDOM.text(jsonML);\n } else if (\"toJsonML\" in (jsonML as any)) {\n const obj = jsonML as JsonMLObj;\n jsonml2idom(obj.toJsonML(), obj);\n } else {\n jsonml2idom(jsonML as JsonML, ctx);\n }\n }\n}\n\n\nexport function jsonml2idomPatch(node: Node, jsonML: JsonML, ctx?: any): void {\n IncrementalDOM.patch(node,\n (data: JsonML) => jsonml2idom(data, ctx), jsonML);\n}\n\nexport function jsonmls2idomPatch(node: Node, jsonMLs: JsonMLs, ctx?: any): void {\n IncrementalDOM.patch(node,\n (data: JsonMLs) => jsonmls2idom(data, ctx), jsonMLs);\n}\n","import { Events } from \"prest-lib/src/main/events\";\nimport { TodoWidget, Todo } from \"./todowidget\";\nimport { Store } from \"./store\";\n\nexport function todotHandlers(events: Events,\n store: Store): void {\n events\n .on(\"insert\", (title: string, w: TodoWidget) => {\n const todo = {\n id: new Date().getTime(),\n title: title,\n completed: false\n } as Todo;\n w.getState().todos.push(todo);\n w.getState().todo = \"\";\n w.update();\n })\n .on(\"complete-all\", (complete: boolean, w: TodoWidget) => {\n w.getState().todos.forEach(t => (t.completed = complete));\n w.update();\n })\n .on(\"complete\", (id: number, w: TodoWidget) => {\n w.getState().todos.forEach(\n t => (t.id === id ? (t.completed = !t.completed) : null)\n );\n w.update();\n })\n .on(\"delete\", (id: number, w: TodoWidget) => {\n w.getState().todos = w.getState().todos.filter(t => t.id !== id);\n w.update();\n })\n .on(\"clear-completed\", (data: any, w: TodoWidget) => {\n w.getState().todos = w.getState().todos.filter(t => !t.completed);\n w.update();\n })\n .on(\"edit\", (id: number, w: TodoWidget) => {\n w.getState().edit = id;\n w.update();\n })\n .on(\"edited\", (title: string, w: TodoWidget) => {\n w.getState().todos.forEach(\n t => (t.id === w.getState().edit ? (t.title = title) : null)\n );\n w.getState().edit = null;\n w.getState().todos = w.getState().todos.filter(t => t.title !== \"\");\n w.update();\n })\n .any((data: any, w: TodoWidget, e: string) => {\n console.log(e, JSON.stringify(data, null, 4));\n console.log(\"state\", JSON.stringify(w.getState(), null, 4));\n store.write(w.getState().todos);\n });\n}\n","export class Hash {\n\n private _cb: (data: T) => void;\n private _iId: any;\n\n private _encoder = (data: T) => encodeURIComponent(JSON.stringify(data));\n private _decoder = (data: string) => data ? JSON.parse(decodeURIComponent(data)) : undefined;\n\n onChange(callback: (data: T) => void): this {\n this._cb = callback;\n if (\"onhashchange\" in window) {\n onhashchange = () => {\n callback(this.read());\n };\n } else {\n // prest.log.warning('browser \"window.onhashchange\" not implemented, running emulation');\n let prevHash = location.hash;\n if (this._iId) {\n clearInterval(this._iId);\n }\n this._iId = setInterval(() => {\n if (location.hash !== prevHash) {\n prevHash = location.hash;\n callback(this.read());\n }\n }, 500);\n }\n return this;\n }\n\n coders(encoder: (data: T) => string, decoder: (data: string) => T): this {\n this._encoder = encoder;\n this._decoder = decoder;\n return this;\n }\n\n start(): this {\n this._cb(this.read());\n return this;\n }\n\n read(): T {\n const str = location.hash.slice(1);\n return this._decoder(str);\n }\n\n write(hashData: T): this {\n const str = this._encoder(hashData);\n location.hash = \"#\" + str;\n return this;\n }\n\n}\n","// declare const process: any;\n// const __NODE = Boolean(\n// typeof process === \"object\" &&\n// process.versions &&\n// process.versions.node);\n\n// if (__NODE) {\n// console.log(\"I'm running in Node.JS\");\n// } else {\n// console.log(\"I'm running in browser\");\n// }\n\nimport { JsonML, JsonMLs, JsonMLObj } from \"./jsonml\";\nimport { jsonmls2idomPatch } from \"./jsonml-idom\";\n\n\nexport interface DomWidget {\n mount(e: HTMLElement): this;\n umount(): this;\n onMount?(): void;\n onUmount?(): void;\n}\n\nexport abstract class Widget implements JsonMLObj, DomWidget {\n\n private static __count = 0;\n\n readonly type: string = \"Widget\"; // this.constructor.name;\n readonly id: string = this.type + \"-\" + Widget.__count++;\n readonly dom: HTMLElement;\n readonly refs: { [key: string]: HTMLElement } = {};\n\n private _updateSched: number;\n\n constructor(type: string = \"\") {\n if (type) {\n this.type = type;\n }\n }\n\n abstract render(): JsonMLs;\n\n mount(e: HTMLElement = document.body): this {\n if (\"widget\" in e) {\n const w = (e as any).widget as Widget;\n w && w.umount();\n }\n if (!this.dom) {\n (this as any).dom = e;\n (e as any).widget = this;\n const jsonMLs = (this as any).render();\n jsonmls2idomPatch(e, jsonMLs, this);\n e.setAttribute(\"widget\", this.type);\n if ((this as any).onMount) {\n (this as any).onMount();\n }\n // onDetach(e, () => {\n // (this as any).dom = undefined;\n // if ((this as any).onUmount) {\n // (this as any).onUmount();\n // }\n // });\n }\n return this;\n }\n\n umount(): this {\n if (this.dom) {\n if ((this as any).onUmount) {\n (this as any).onUmount();\n }\n if (this.dom.hasAttribute(\"widget\")) {\n this.dom.removeAttribute(\"widget\");\n }\n const wNodes = this.dom.querySelectorAll(\"[widget]\");\n for (let i = 0; i < wNodes.length; i++) {\n const w = (wNodes[i] as any).widget as Widget;\n w && w.umount();\n }\n // if (this.dom.parentElement) {\n // this.dom.parentElement.removeChild(this.dom);\n // }\n while (this.dom.firstChild /*.hasChildNodes()*/) {\n this.dom.removeChild(this.dom.firstChild);\n }\n (this.dom as any).widget = undefined;\n (this as any).dom = undefined;\n }\n return this;\n }\n\n update(): this {\n if (this.dom && !this._updateSched) {\n this._updateSched = setTimeout(() => {\n if (this.dom) {\n jsonmls2idomPatch(this.dom, this.render(), this);\n }\n this._updateSched = null;\n }, 0);\n }\n return this;\n }\n\n toJsonML(): JsonML {\n if (this.dom) {\n if (this._updateSched) {\n clearTimeout(this._updateSched);\n this._updateSched = undefined;\n } else {\n return (\n [\"div\",\n {\n _skip: true,\n _id: this.id,\n _key: this.id,\n widget: this.type\n }\n ]\n );\n }\n }\n const jsonMLs = (this as any).render();\n return (\n [\"div\",\n {\n _id: this.id,\n _key: this.id,\n widget: this.type\n },\n ...jsonMLs,\n (e: HTMLElement) => {\n if (!this.dom) {\n (this as any).dom = e;\n (e as any).widget = this;\n if ((this as any).onMount) {\n (this as any).onMount();\n }\n // onDetach(e, () => {\n // (this as any).dom = undefined;\n // if ((this as any).onUmount) {\n // (this as any).onUmount();\n // }\n // });\n }\n }\n ]\n );\n }\n\n}\n\n\ndeclare var IncrementalDOM: any;\n\nIncrementalDOM.notifications.nodesDeleted = (nodes: Node[]) => {\n nodes.forEach(node => {\n if (node.nodeType === 1 && \"widget\" in node) {\n const w = (node as any).widget as Widget;\n w && w.umount();\n }\n });\n};\n\n\n// IncrementalDOM.notifications.nodesCreated = (nodes: Node[]) => {\n// nodes.forEach(node => {\n// // node may be an Element or a Text\n// console.log(\"IncrementalDOM.notifications.nodesCreated\", node);\n// });\n// };\n// IncrementalDOM.notifications.nodesDeleted = (nodes: Node[]) => {\n// nodes.forEach(node => {\n// // node may be an Element or a Text\n// console.log(\"IncrementalDOM.notifications.nodesDeleted\", node);\n// });\n// };\n\n\n\n// function onDetach(e: HTMLElement, callback: () => void) {\n// new MutationObserver(mutations => {\n// mutations.forEach(mutation => {\n// const removed = mutation.removedNodes as any;\n// for (const r of removed) {\n// console.log(r, r === e);\n// if (r === e) {\n// callback();\n// }\n// }\n// });\n// }).observe(e.parentElement, { childList: true });\n// // }).observe(e.parentElement, { childList: true, subtree: true });\n// }\n\n\n// const observer = new MutationObserver(mutations => {\n// mutations.forEach(mutation => {\n// // console.log(mutation.type);\n// // console.log(mutation.target);\n// // console.log(\"add\", mutation.addedNodes);\n// // console.log(\"rm\", mutation.removedNodes);\n// const added = mutation.addedNodes as any;\n// for (const a of added) {\n// console.log(\"added\", a);\n// }\n// const removed = mutation.removedNodes as any;\n// for (const r of removed) {\n// console.log(\"removed\", r);\n// }\n// });\n// });\n// const config = {\n// childList: true,\n// // attributes: true,\n// // characterData: true,\n// // subtree: true,\n// // attributeOldValue: true,\n// // characterDataOldValue: true,\n// attributeFilter: [] as string[]\n// };\n// observer.observe(document.getElementById(\"app\"), config);\n// // observer.disconnect();\n","\nexport class Events {\n\n static any = \"\";\n\n private _ctx: C;\n private _cbs: { [e: string]: Array<(data: any, ctx: C, e: string) => void> };\n private _cb: Array<(data: any, ctx: C, e: string) => void>;\n\n constructor(ctx?: C) {\n this._cbs = {};\n this._ctx = ctx;\n }\n\n on(e: string, cb: (data: any, ctx: C, e: string) => void): this {\n if (!e) {\n if (!this._cb) {\n this._cb = [];\n }\n this._cb.push(cb);\n }\n if (!(e in this._cbs)) {\n this._cbs[e] = [];\n }\n if (this._cbs[e].indexOf(cb) === -1) {\n this._cbs[e].push(cb);\n }\n return this;\n }\n\n any(cb: (data: any, ctx: C, e: string) => void): this {\n this.on(Events.any, cb);\n return this;\n }\n\n all(es: string[], cb: (data: any, ctx: C, e: string) => void): this {\n es.forEach(e => this.on(e, cb));\n return this;\n }\n\n once(e: string, cb: (data: any, ctx: C, e: string) => void): this {\n const wrap = (d: any, c: C, ev: string) => {\n this.off(e, wrap);\n cb(d, c, ev);\n };\n this.on(e, wrap);\n return this;\n }\n\n off(e: string, cb?: (data: any, ctx: C, e: string) => void): this {\n if (!e) {\n if (cb) {\n this._cb.splice(this._cbs[e].indexOf(cb), 1);\n } else {\n this._cb.length = 0;\n delete this._cb;\n }\n }\n if (e in this._cbs) {\n if (cb) {\n this._cbs[e].splice(this._cbs[e].indexOf(cb), 1);\n } else {\n this._cbs[e].length = 0;\n delete this._cbs[e];\n }\n }\n return this;\n }\n\n emit(e: string, data?: any): this {\n if (e in this._cbs) {\n for (let i = 0, l = this._cbs[e].length; i < l; i++) {\n this._cbs[e][i](data, this._ctx, e);\n }\n }\n if (this._cb) {\n for (let i = 0, l = this._cb.length; i < l; i++) {\n this._cb[i](data, this._ctx, e);\n }\n }\n return this;\n }\n\n}\n\n\n// const es = new Events(3);\n\n// es.any((data, ctx, e) => console.log(\"any:\", data, ctx, e));\n\n// es.emit(\"e\", \"eee1\");\n// es.on(\"e\", (data, ctx, e) => console.log(data, ctx, e));\n// es.emit(\"e\", \"eee2\");\n// es.off(\"e\");\n// es.emit(\"e\", \"eee3\");\n\n// es.off(Events.any);\n\n// es.once(Events.any, (data, ctx, e) => console.log(\"once all:\", data, ctx, e));\n\n// es.emit(\"o\", \"ooo1\");\n// es.once(\"o\", (data, ctx, e) => console.log(data, ctx, e));\n// es.emit(\"o\", \"ooo2\");\n// es.emit(\"o\", \"ooo3\");\n\n// es.all([\"e1\", \"e3\"], (data, ctx, e) => console.log(data, ctx, e));\n// es.emit(\"e1\", \"all e1\");\n// es.emit(\"e2\", \"all e2\");\n// es.emit(\"e3\", \"all e3\");\n","import { Widget } from \"./widget\";\nimport { Events } from \"./events\";\n\n\nexport abstract class WidgetE extends Widget {\n\n protected _state: S;\n\n readonly events: Events;\n\n constructor(type: string = \"\", state?: S, events?: Events) {\n super(type);\n this._state = state;\n this.events = events ? events : new Events(this);\n }\n\n setState(state: S): this {\n this._state = state;\n this.update();\n return this;\n }\n\n getState(): S {\n return this._state;\n }\n\n}\n","import { WidgetE } from \"prest-lib/src/main/widgete\";\nimport { JsonMLs } from \"prest-lib/src/main/jsonml\";\n\nexport interface Todo {\n id: number;\n title: string;\n completed: boolean;\n}\n\nexport interface TodoState {\n todo: string;\n todos: Todo[];\n filter: string;\n edit: number;\n}\n\nexport class TodoWidget extends WidgetE {\n\n constructor() {\n super(\"TodoWidget\");\n this.setState({\n todo: \"\",\n todos: [],\n filter: \"/\",\n edit: null\n });\n }\n\n render(): JsonMLs {\n let todos = this._state.todos;\n const completed = this._state.todos.filter(t => t.completed);\n const active = this._state.todos.filter(t => !t.completed);\n switch (this._state.filter) {\n case \"/active\":\n todos = active;\n break;\n case \"/completed\":\n todos = completed;\n break;\n }\n\n return [\n [\"section#app.todoapp\",\n [\"header.header\",\n [\"h1\", \"todos\"],\n [\"input.new-todo\",\n {\n placeholder: \"What needs to be done?\",\n autofocus: \"autofocus\",\n value: new String(this._state.todo),\n change: this.onInsert\n }\n ]\n ],\n this._state.todos.length ?\n [\"section.main\",\n [\"input#toggle-all.toggle-all\",\n {\n type: \"checkbox\",\n change: this.onCompleteAll\n }\n ],\n [\"label\", { for: \"toggle-all\" },\n \"Mark all as complete\"\n ],\n [\"ul.todo-list\",\n ...todos.map(t => {\n const classes = [];\n t.completed && classes.push(\"completed\");\n t.id === this._state.edit && classes.push(\"editing\");\n\n return [\"li\", { _key: t.id, classes: classes },\n [\"div.view\",\n [\"input.toggle\",\n {\n type: \"checkbox\",\n data: { id: t.id },\n change: this.onComplete\n },\n (e: HTMLInputElement) => e.checked = t.completed\n ],\n [\"label\",\n {\n data: { id: t.id },\n dblclick: this.onEdit\n },\n t.title],\n [\"button.destroy\",\n {\n data: { id: t.id },\n click: this.onDelete\n }\n ]\n ],\n [\"input.edit\",\n {\n value: new String(t.title),\n change: this.onEdited,\n blur: this.onEdited\n },\n (e: HTMLInputElement) => setTimeout(() => e.select(), 0)\n ]\n ];\n })\n ]\n ] :\n \"\",\n this._state.todos.length ?\n [\"footer.footer\",\n [\"span.todo-count\",\n [\"strong\", active.length],\n active.length === 1 ? \" item left\" : \" items left\"\n ],\n [\"ul.filters\",\n [\"li\",\n [\"a\",\n {\n href: \"#/\",\n classes: this._state.filter === \"/\" ? [\"selected\"] : []\n },\n \"All\"\n ]\n ],\n [\"li\",\n [\"a\",\n {\n href: \"#/active\",\n classes: this._state.filter === \"/active\" ? [\"selected\"] : []\n },\n \"Active\"\n ]\n ],\n [\"li\",\n [\"a\",\n {\n href: \"#/completed\",\n classes: this._state.filter === \"/completed\" ? [\"selected\"] : []\n },\n \"Completed\"\n ]\n ]\n ],\n this._state.todos.filter(t => t.completed).length ?\n [\"button.clear-completed\", { click: this.onClearCompleted },\n \"Clear completed\"\n ] :\n \"\"\n ] :\n \"\"\n ]\n ];\n }\n\n private onInsert = (e: Event) => {\n const title = (e.target as HTMLInputElement).value.trim();\n if (title) {\n this.events.emit(\"insert\", title);\n }\n }\n\n private onCompleteAll = (e: Event) => {\n const complete = (e.target as HTMLInputElement).checked;\n this.events.emit(\"complete-all\", complete);\n }\n\n private onComplete = (e: Event) => {\n const id = Number((e.target as HTMLElement).dataset.id);\n this.events.emit(\"complete\", id);\n }\n\n private onDelete = (e: Event) => {\n const id = Number((e.target as HTMLElement).dataset.id);\n this.events.emit(\"delete\", id);\n }\n\n private onClearCompleted = (e: Event) => {\n this.events.emit(\"clear-completed\");\n }\n\n private onEdit = (e: Event) => {\n const id = Number((e.target as HTMLElement).dataset.id);\n this.events.emit(\"edit\", id);\n }\n\n private onEdited = (e: Event) => {\n const title = (e.target as HTMLInputElement).value.trim();\n this.events.emit(\"edited\", title);\n }\n\n}\n","export class Store {\n\n private static _key = \"todos-prest-lib\";\n\n private _data: T;\n private _isLS: boolean = false;\n\n constructor(data: T) {\n if (\"localStorage\" in self) {\n try {\n localStorage.getItem(Store._key);\n this._isLS = true;\n } catch (e) {\n console.warn(e);\n }\n }\n if (!this.read()) {\n this.write(data);\n }\n }\n\n read(): T {\n return this._isLS ?\n JSON.parse(localStorage.getItem(Store._key)) :\n this._data;\n }\n\n write(data: T): void {\n this._isLS ?\n localStorage.setItem(Store._key, JSON.stringify(data)) :\n this._data = data;\n }\n\n}\n","import { Hash } from \"prest-lib/src/main/hash\";\nimport { TodoWidget, Todo } from \"./todowidget\";\nimport { Store } from \"./store\";\nimport { todotHandlers } from \"./todohandlers\";\n\nexport class TodoApp {\n\n store: Store;\n todoWidget: TodoWidget;\n hash: Hash;\n\n constructor(element: HTMLElement, todos: Todo[] = []) {\n this._initStore(todos);\n this._initWidget(element);\n this._initRouting();\n }\n\n private _initStore(todos: Todo[]): void {\n this.store = new Store(todos);\n }\n\n private _initWidget(element: HTMLElement): void {\n this.todoWidget = new TodoWidget()\n .setState({\n todo: \"\",\n todos: this.store.read(),\n filter: \"\",\n edit: null\n });\n todotHandlers(this.todoWidget.events, this.store);\n this.todoWidget.mount(element);\n }\n\n private _initRouting(): void {\n this.hash = new Hash()\n .coders(\n data => encodeURI(data),\n str => decodeURI(str)\n );\n this.hash.onChange(data => {\n switch (data) {\n case \"/\":\n case \"/active\":\n case \"/completed\":\n this.todoWidget.getState().filter = data;\n this.todoWidget.update();\n this.todoWidget.events.emit(\"filter\", data);\n break;\n default:\n this.todoWidget.getState().filter = \"\";\n this.todoWidget.update();\n this.todoWidget.events.emit(\"filter\", data);\n this.hash.write(\"/\");\n break;\n }\n });\n this.hash.start();\n }\n\n}\n","import { TodoApp } from \"./todoapp\";\nimport { Todo } from \"./todowidget\";\n\nconst todos: Todo[] = [\n // {\n // id: new Date().getTime(),\n // title: \"Learn prest-lib widgets\",\n // completed: true\n // },\n // {\n // id: new Date().getTime() + 1,\n // title: \"Add star to prest-lib\",\n // completed: false\n // }\n];\n\nconst app = new TodoApp(document.getElementById(\"app\"), todos);\n\n(self as any).app = app;\n(self as any).app.version = \"@VERSION@\";\n"],"names":["jsonML","handler","ctx","length","JSON","stringify","head","attrsObj","hasAttrs","constructor","Object","childIdx","children","i","Function","attrs","refSplit","split","ref","dotSplit","hashSplit","tag","id","classes","slice","_id","_classes","_ref","open","l","jml","undefined","Array","jsonml","fnc","String","text","Number","Boolean","obj","close","JsonmlIDomHandler","jsonMLs","jsonMLs_1","_i","IncrementalDOM","jsonml2idom","toJsonML","node","patch","data","jsonmls2idom","events","store","on","title","w","todo","Date","getTime","completed","getState","todos","push","update","complete","forEach","t","filter","edit","any","e","console","log","write","this","encodeURIComponent","parse","decodeURIComponent","Hash","callback","_cb","window","onhashchange","_this","read","prevHash_1","location","hash","_iId","clearInterval","setInterval","encoder","decoder","_encoder","_decoder","str","hashData","props","widget","_widget","a","hasOwnProperty","concat","d","unshift","join","elementOpen","_key","_skip","skip","refs","currentElement","mount","elementClose","type","Widget","__count","document","body","umount","dom","jsonmls2idomPatch","render","setAttribute","onMount","onUmount","hasAttribute","removeAttribute","wNodes","querySelectorAll","firstChild","removeChild","_updateSched","setTimeout","clearTimeout","notifications","nodesDeleted","nodes","nodeType","_cbs","_ctx","Events","cb","indexOf","es","wrap","c","ev","off","splice","state","_super","_state","__extends","WidgetE","target","value","trim","emit","checked","dataset","setState","TodoWidget","active","placeholder","autofocus","change","onInsert","onCompleteAll","for","map","onComplete","dblclick","onEdit","click","onDelete","onEdited","blur","select","href","onClearCompleted","self","localStorage","getItem","Store","_isLS","warn","_data","setItem","element","_initStore","_initWidget","_initRouting","TodoApp","todoWidget","todotHandlers","coders","encodeURI","decodeURI","onChange","start","app","getElementById","version"],"mappings":"0MAoCuBA,EAAgBC,EAAwBC,GAC3D,GAAKF,EAAL,CAIA,GAAsB,IAAlBA,EAAOG,QAAqC,gBAAdH,GAAO,GACrC,KAAM,uBAAuBI,KAAKC,UAAUL,EAShD,KAAK,GANCM,GAAON,EAAO,GACdO,EAAWP,EAAO,GAClBQ,EAAWD,GAAYA,EAASE,cAAgBC,OAChDC,EAAWH,EAAW,EAAI,EAE5BI,EAAW,EACNC,EAAIF,EAAUE,EAAIb,EAAOG,OAAQU,IAClCb,EAAOa,I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KAAKiH,cCrDZ3I,KAaA4I,EAAM,GAAIR,GAAQ5E,SAASqF,eAAe,OAAQ7I,EAEvDwH,MAAaoB,IAAMA,EACnBpB,KAAaoB,IAAIE,QAAU"} \ No newline at end of file diff --git a/examples/prest-lib/lib/incremental-dom/incremental-dom-min.js b/examples/prest-lib/lib/incremental-dom/incremental-dom-min.js new file mode 100644 index 0000000000..d79a01e681 --- /dev/null +++ b/examples/prest-lib/lib/incremental-dom/incremental-dom-min.js @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2015 The Incremental DOM Authors. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.IncrementalDOM={})}(this,function(t){"use strict";function e(){}function n(t,e){this.attrs=o(),this.attrsArr=[],this.newAttrs=o(),this.staticsApplied=!1,this.key=e,this.keyMap=o(),this.keyMapValid=!0,this.focused=!1,this.nodeName=t,this.text=null}function r(){this.created=p.nodesCreated&&[],this.deleted=p.nodesDeleted&&[]}var i=Object.prototype.hasOwnProperty;e.prototype=Object.create(null);var a=function(t,e){return i.call(t,e)},o=function(){return new e},u=function(t,e,r){var i=new n(e,r);return t.__incrementalDOMData=i,i},l=function(t){return f(t),t.__incrementalDOMData},f=function(t){if(!t.__incrementalDOMData){var e=t instanceof Element,n=e?t.localName:t.nodeName,r=e?t.getAttribute("key"):null,i=u(t,n,r);if(r&&(l(t.parentNode).keyMap[r]=t),e)for(var a=t.attributes,o=i.attrs,c=i.newAttrs,s=i.attrsArr,d=0;d0&&p.nodesCreated(this.created),this.deleted&&this.deleted.length>0&&p.nodesDeleted(this.deleted)};var h=function(t){return t instanceof Document||t instanceof DocumentFragment},v=function(t,e){for(var n=[],r=t;r!==e;)n.push(r),r=r.parentNode;return n},m=function(t){for(var e=t,n=e;e;)n=e,e=e.parentNode;return n},y=function(t){var e=m(t);return h(e)?e.activeElement:null},g=function(t,e){var n=y(t);return n&&t.contains(n)?v(n,e):[]},k=function(t,e,n){for(var r=e.nextSibling,i=n;i!==e;){var a=i.nextSibling;t.insertBefore(i,r),i=a}},x=null,w=null,b=null,D=null,N=function(t,e){for(var n=0;n=0?t.setProperty(e,n):t[e]=n},K=function(t,e,n){if("string"==typeof n)t.style.cssText=n;else{t.style.cssText="";var r=t.style,i=n;for(var o in i)a(i,o)&&J(r,o,i[o])}},Q=function(t,e,n){var r=typeof n;"object"===r||"function"===r?H(t,e,n):G(t,e,n)},W=function(t,e,n){var r=l(t),i=r.attrs;if(i[e]!==n){var a=Y[e]||Y[q["default"]];a(t,e,n),i[e]=n}},Y=o();Y[q["default"]]=Q,Y.style=K;var Z=3,$=[],tt=function(t,e,n){var r=T(t,e),i=l(r);if(!i.staticsApplied){if(n)for(var a=0;a} map The map to check.\n * @param {string} property The property to check.\n * @return {boolean} Whether map has property.\n */\nconst has = function(map, property) {\n return hasOwnProperty.call(map, property);\n};\n\n\n/**\n * Creates an map object without a prototype.\n * @return {!Object}\n */\nconst createMap = function() {\n return new Blank();\n};\n\n\n/** */\nexport {\n createMap,\n has\n};\n\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createMap } from './util';\n\n\n/**\n * Keeps track of information needed to perform diffs for a given DOM node.\n * @param {!string} nodeName\n * @param {?string=} key\n * @constructor\n */\nfunction NodeData(nodeName, key) {\n /**\n * The attributes and their values.\n * @const {!Object}\n */\n this.attrs = createMap();\n\n /**\n * An array of attribute name/value pairs, used for quickly diffing the\n * incomming attributes to see if the DOM node's attributes need to be\n * updated.\n * @const {Array<*>}\n */\n this.attrsArr = [];\n\n /**\n * The incoming attributes for this Node, before they are updated.\n * @const {!Object}\n */\n this.newAttrs = createMap();\n\n /**\n * Whether or not the statics have been applied for the node yet.\n * {boolean}\n */\n this.staticsApplied = false;\n\n /**\n * The key used to identify this node, used to preserve DOM nodes when they\n * move within their parent.\n * @const\n */\n this.key = key;\n\n /**\n * Keeps track of children within this node by their key.\n * {!Object}\n */\n this.keyMap = createMap();\n\n /**\n * Whether or not the keyMap is currently valid.\n * @type {boolean}\n */\n this.keyMapValid = true;\n\n /**\n * Whether or the associated node is, or contains, a focused Element.\n * @type {boolean}\n */\n this.focused = false;\n\n /**\n * The node name for this node.\n * @const {string}\n */\n this.nodeName = nodeName;\n\n /**\n * @type {?string}\n */\n this.text = null;\n}\n\n\n/**\n * Initializes a NodeData object for a Node.\n *\n * @param {Node} node The node to initialize data for.\n * @param {string} nodeName The node name of node.\n * @param {?string=} key The key that identifies the node.\n * @return {!NodeData} The newly initialized data object\n */\nconst initData = function(node, nodeName, key) {\n const data = new NodeData(nodeName, key);\n node['__incrementalDOMData'] = data;\n return data;\n};\n\n\n/**\n * Retrieves the NodeData object for a Node, creating it if necessary.\n *\n * @param {?Node} node The Node to retrieve the data for.\n * @return {!NodeData} The NodeData for this Node.\n */\nconst getData = function(node) {\n importNode(node);\n return node['__incrementalDOMData'];\n};\n\n\n/**\n * Imports node and its subtree, initializing caches.\n *\n * @param {?Node} node The Node to import.\n */\nconst importNode = function(node) {\n if (node['__incrementalDOMData']) {\n return;\n }\n\n const isElement = node instanceof Element;\n const nodeName = isElement ? node.localName : node.nodeName;\n const key = isElement ? node.getAttribute('key') : null;\n const data = initData(node, nodeName, key);\n\n if (key) {\n getData(node.parentNode).keyMap[key] = node;\n }\n\n if (isElement) {\n const attributes = node.attributes;\n const attrs = data.attrs;\n const newAttrs = data.newAttrs;\n const attrsArr = data.attrsArr;\n\n for (let i = 0; i < attributes.length; i += 1) {\n const attr = attributes[i];\n const name = attr.name;\n const value = attr.value;\n\n attrs[name] = value;\n newAttrs[name] = undefined;\n attrsArr.push(name);\n attrsArr.push(value);\n }\n }\n\n for (let child = node.firstChild; child; child = child.nextSibling) {\n importNode(child);\n }\n};\n\n\n/** */\nexport {\n getData,\n initData,\n importNode\n};\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n getData,\n initData\n} from './node_data';\n\n\n/**\n * Gets the namespace to create an element (of a given tag) in.\n * @param {string} tag The tag to get the namespace for.\n * @param {?Node} parent\n * @return {?string} The namespace to create the tag in.\n */\nconst getNamespaceForTag = function(tag, parent) {\n if (tag === 'svg') {\n return 'http://www.w3.org/2000/svg';\n }\n\n if (getData(parent).nodeName === 'foreignObject') {\n return null;\n }\n\n return parent.namespaceURI;\n};\n\n\n/**\n * Creates an Element.\n * @param {Document} doc The document with which to create the Element.\n * @param {?Node} parent\n * @param {string} tag The tag for the Element.\n * @param {?string=} key A key to identify the Element.\n * @return {!Element}\n */\nconst createElement = function(doc, parent, tag, key) {\n const namespace = getNamespaceForTag(tag, parent);\n let el;\n\n if (namespace) {\n el = doc.createElementNS(namespace, tag);\n } else {\n el = doc.createElement(tag);\n }\n\n initData(el, tag, key);\n\n return el;\n};\n\n\n/**\n * Creates a Text Node.\n * @param {Document} doc The document with which to create the Element.\n * @return {!Text}\n */\nconst createText = function(doc) {\n const node = doc.createTextNode('');\n initData(node, '#text', null);\n return node;\n};\n\n\n/** */\nexport {\n createElement,\n createText\n};\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @const */\nconst notifications = {\n /**\n * Called after patch has compleated with any Nodes that have been created\n * and added to the DOM.\n * @type {?function(Array)}\n */\n nodesCreated: null,\n\n /**\n * Called after patch has compleated with any Nodes that have been removed\n * from the DOM.\n * Note it's an applications responsibility to handle any childNodes.\n * @type {?function(Array)}\n */\n nodesDeleted: null\n};\n\nexport {\n notifications\n};\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { notifications } from './notifications';\n\n\n/**\n * Keeps track of the state of a patch.\n * @constructor\n */\nfunction Context() {\n /**\n * @type {(Array|undefined)}\n */\n this.created = notifications.nodesCreated && [];\n\n /**\n * @type {(Array|undefined)}\n */\n this.deleted = notifications.nodesDeleted && [];\n}\n\n\n/**\n * @param {!Node} node\n */\nContext.prototype.markCreated = function(node) {\n if (this.created) {\n this.created.push(node);\n }\n};\n\n\n/**\n * @param {!Node} node\n */\nContext.prototype.markDeleted = function(node) {\n if (this.deleted) {\n this.deleted.push(node);\n }\n};\n\n\n/**\n * Notifies about nodes that were created during the patch opearation.\n */\nContext.prototype.notifyChanges = function() {\n if (this.created && this.created.length > 0) {\n notifications.nodesCreated(this.created);\n }\n\n if (this.deleted && this.deleted.length > 0) {\n notifications.nodesDeleted(this.deleted);\n }\n};\n\n\n/** */\nexport {\n Context\n};\n","/**\n * Copyright 2016 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @param {!Node} node\n * @return {boolean} True if the node the root of a document, false otherwise.\n */\nconst isDocumentRoot = function(node) {\n // For ShadowRoots, check if they are a DocumentFragment instead of if they\n // are a ShadowRoot so that this can work in 'use strict' if ShadowRoots are\n // not supported.\n return node instanceof Document || node instanceof DocumentFragment;\n};\n\n\n/**\n * @param {!Node} node The node to start at, inclusive.\n * @param {?Node} root The root ancestor to get until, exclusive.\n * @return {!Array} The ancestry of DOM nodes.\n */\nconst getAncestry = function(node, root) {\n const ancestry = [];\n let cur = node;\n\n while (cur !== root) {\n ancestry.push(cur);\n cur = cur.parentNode;\n }\n\n return ancestry;\n};\n\n\n/**\n * @param {!Node} node\n * @return {!Node} The root node of the DOM tree that contains node.\n */\nconst getRoot = function(node) {\n let cur = node;\n let prev = cur;\n\n while (cur) {\n prev = cur;\n cur = cur.parentNode;\n }\n\n return prev;\n};\n\n\n/**\n * @param {!Node} node The node to get the activeElement for.\n * @return {?Element} The activeElement in the Document or ShadowRoot\n * corresponding to node, if present.\n */\nconst getActiveElement = function(node) {\n const root = getRoot(node);\n return isDocumentRoot(root) ? root.activeElement : null;\n};\n\n\n/**\n * Gets the path of nodes that contain the focused node in the same document as\n * a reference node, up until the root.\n * @param {!Node} node The reference node to get the activeElement for.\n * @param {?Node} root The root to get the focused path until.\n * @return {!Array}\n */\nconst getFocusedPath = function(node, root) {\n const activeElement = getActiveElement(node);\n\n if (!activeElement || !node.contains(activeElement)) {\n return [];\n }\n\n return getAncestry(activeElement, root);\n};\n\n\n/**\n * Like insertBefore, but instead instead of moving the desired node, instead\n * moves all the other nodes after.\n * @param {?Node} parentNode\n * @param {!Node} node\n * @param {?Node} referenceNode\n */\nconst moveBefore = function(parentNode, node, referenceNode) {\n const insertReferenceNode = node.nextSibling;\n let cur = referenceNode;\n\n while (cur !== node) {\n const next = cur.nextSibling;\n parentNode.insertBefore(cur, insertReferenceNode);\n cur = next;\n }\n};\n\n\n/** */\nexport {\n getFocusedPath,\n moveBefore\n};\n\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createElement,\n createText\n} from './nodes';\nimport { getData } from './node_data';\nimport { Context } from './context';\nimport {\n assertInPatch,\n assertNoUnclosedTags,\n assertNotInAttributes,\n assertVirtualAttributesClosed,\n assertNoChildrenDeclaredYet,\n assertPatchElementNoExtras,\n setInAttributes,\n setInSkip\n} from './assertions';\nimport {\n getFocusedPath,\n moveBefore\n} from './dom_util';\n\n\n/** @type {?Context} */\nlet context = null;\n\n/** @type {?Node} */\nlet currentNode = null;\n\n/** @type {?Node} */\nlet currentParent = null;\n\n/** @type {?Document} */\nlet doc = null;\n\n\n/**\n * @param {!Array} focusPath The nodes to mark.\n * @param {boolean} focused Whether or not they are focused.\n */\nconst markFocused = function(focusPath, focused) {\n for (let i = 0; i < focusPath.length; i += 1) {\n getData(focusPath[i]).focused = focused;\n }\n};\n\n\n/**\n * Returns a patcher function that sets up and restores a patch context,\n * running the run function with the provided data.\n * @param {function((!Element|!DocumentFragment),!function(T),T=): ?Node} run\n * @return {function((!Element|!DocumentFragment),!function(T),T=): ?Node}\n * @template T\n */\nconst patchFactory = function(run) {\n /**\n * TODO(moz): These annotations won't be necessary once we switch to Closure\n * Compiler's new type inference. Remove these once the switch is done.\n *\n * @param {(!Element|!DocumentFragment)} node\n * @param {!function(T)} fn\n * @param {T=} data\n * @return {?Node} node\n * @template T\n */\n const f = function(node, fn, data) {\n const prevContext = context;\n const prevDoc = doc;\n const prevCurrentNode = currentNode;\n const prevCurrentParent = currentParent;\n let previousInAttributes = false;\n let previousInSkip = false;\n\n context = new Context();\n doc = node.ownerDocument;\n currentParent = node.parentNode;\n\n if (process.env.NODE_ENV !== 'production') {\n previousInAttributes = setInAttributes(false);\n previousInSkip = setInSkip(false);\n }\n\n const focusPath = getFocusedPath(node, currentParent);\n markFocused(focusPath, true);\n const retVal = run(node, fn, data);\n markFocused(focusPath, false);\n\n if (process.env.NODE_ENV !== 'production') {\n assertVirtualAttributesClosed();\n setInAttributes(previousInAttributes);\n setInSkip(previousInSkip);\n }\n\n context.notifyChanges();\n\n context = prevContext;\n doc = prevDoc;\n currentNode = prevCurrentNode;\n currentParent = prevCurrentParent;\n\n return retVal;\n };\n return f;\n};\n\n\n/**\n * Patches the document starting at node with the provided function. This\n * function may be called during an existing patch operation.\n * @param {!Element|!DocumentFragment} node The Element or Document\n * to patch.\n * @param {!function(T)} fn A function containing elementOpen/elementClose/etc.\n * calls that describe the DOM.\n * @param {T=} data An argument passed to fn to represent DOM state.\n * @return {!Node} The patched node.\n * @template T\n */\nconst patchInner = patchFactory(function(node, fn, data) {\n currentNode = node;\n\n enterNode();\n fn(data);\n exitNode();\n\n if (process.env.NODE_ENV !== 'production') {\n assertNoUnclosedTags(currentNode, node);\n }\n\n return node;\n});\n\n\n/**\n * Patches an Element with the the provided function. Exactly one top level\n * element call should be made corresponding to `node`.\n * @param {!Element} node The Element where the patch should start.\n * @param {!function(T)} fn A function containing elementOpen/elementClose/etc.\n * calls that describe the DOM. This should have at most one top level\n * element call.\n * @param {T=} data An argument passed to fn to represent DOM state.\n * @return {?Node} The node if it was updated, its replacedment or null if it\n * was removed.\n * @template T\n */\nconst patchOuter = patchFactory(function(node, fn, data) {\n let startNode = /** @type {!Element} */({ nextSibling: node });\n let expectedNextNode = null;\n let expectedPrevNode = null;\n\n if (process.env.NODE_ENV !== 'production') {\n expectedNextNode = node.nextSibling;\n expectedPrevNode = node.previousSibling;\n }\n\n currentNode = startNode;\n fn(data);\n\n if (process.env.NODE_ENV !== 'production') {\n assertPatchElementNoExtras(startNode, currentNode, expectedNextNode,\n expectedPrevNode);\n }\n\n if (node !== currentNode && node.parentNode) {\n removeChild(currentParent, node, getData(currentParent).keyMap);\n }\n\n return (startNode === currentNode) ? null : currentNode;\n});\n\n\n/**\n * Checks whether or not the current node matches the specified nodeName and\n * key.\n *\n * @param {!Node} matchNode A node to match the data to.\n * @param {?string} nodeName The nodeName for this node.\n * @param {?string=} key An optional key that identifies a node.\n * @return {boolean} True if the node matches, false otherwise.\n */\nconst matches = function(matchNode, nodeName, key) {\n const data = getData(matchNode);\n\n // Key check is done using double equals as we want to treat a null key the\n // same as undefined. This should be okay as the only values allowed are\n // strings, null and undefined so the == semantics are not too weird.\n return nodeName === data.nodeName && key == data.key;\n};\n\n\n/**\n * Aligns the virtual Element definition with the actual DOM, moving the\n * corresponding DOM node to the correct location or creating it if necessary.\n * @param {string} nodeName For an Element, this should be a valid tag string.\n * For a Text, this should be #text.\n * @param {?string=} key The key used to identify this element.\n */\nconst alignWithDOM = function(nodeName, key) {\n if (currentNode && matches(currentNode, nodeName, key)) {\n return;\n }\n\n const parentData = getData(currentParent);\n const currentNodeData = currentNode && getData(currentNode);\n const keyMap = parentData.keyMap;\n let node;\n\n // Check to see if the node has moved within the parent.\n if (key) {\n const keyNode = keyMap[key];\n if (keyNode) {\n if (matches(keyNode, nodeName, key)) {\n node = keyNode;\n } else if (keyNode === currentNode) {\n context.markDeleted(keyNode);\n } else {\n removeChild(currentParent, keyNode, keyMap);\n }\n }\n }\n\n // Create the node if it doesn't exist.\n if (!node) {\n if (nodeName === '#text') {\n node = createText(doc);\n } else {\n node = createElement(doc, currentParent, nodeName, key);\n }\n\n if (key) {\n keyMap[key] = node;\n }\n\n context.markCreated(node);\n }\n\n // Re-order the node into the right position, preserving focus if either\n // node or currentNode are focused by making sure that they are not detached\n // from the DOM.\n if (getData(node).focused) {\n // Move everything else before the node.\n moveBefore(currentParent, node, currentNode);\n } else if (currentNodeData && currentNodeData.key && !currentNodeData.focused) {\n // Remove the currentNode, which can always be added back since we hold a\n // reference through the keyMap. This prevents a large number of moves when\n // a keyed item is removed or moved backwards in the DOM.\n currentParent.replaceChild(node, currentNode);\n parentData.keyMapValid = false;\n } else {\n currentParent.insertBefore(node, currentNode);\n }\n\n currentNode = node;\n};\n\n\n/**\n * @param {?Node} node\n * @param {?Node} child\n * @param {?Object} keyMap\n */\nconst removeChild = function(node, child, keyMap) {\n node.removeChild(child);\n context.markDeleted(/** @type {!Node}*/(child));\n\n const key = getData(child).key;\n if (key) {\n delete keyMap[key];\n }\n};\n\n\n/**\n * Clears out any unvisited Nodes, as the corresponding virtual element\n * functions were never called for them.\n */\nconst clearUnvisitedDOM = function() {\n const node = currentParent;\n const data = getData(node);\n const keyMap = data.keyMap;\n const keyMapValid = data.keyMapValid;\n let child = node.lastChild;\n let key;\n\n if (child === currentNode && keyMapValid) {\n return;\n }\n\n while (child !== currentNode) {\n removeChild(node, child, keyMap);\n child = node.lastChild;\n }\n\n // Clean the keyMap, removing any unusued keys.\n if (!keyMapValid) {\n for (key in keyMap) {\n child = keyMap[key];\n if (child.parentNode !== node) {\n context.markDeleted(child);\n delete keyMap[key];\n }\n }\n\n data.keyMapValid = true;\n }\n};\n\n\n/**\n * Changes to the first child of the current node.\n */\nconst enterNode = function() {\n currentParent = currentNode;\n currentNode = null;\n};\n\n\n/**\n * @return {?Node} The next Node to be patched.\n */\nconst getNextNode = function() {\n if (currentNode) {\n return currentNode.nextSibling;\n } else {\n return currentParent.firstChild;\n }\n};\n\n\n/**\n * Changes to the next sibling of the current node.\n */\nconst nextNode = function() {\n currentNode = getNextNode();\n};\n\n\n/**\n * Changes to the parent of the current node, removing any unvisited children.\n */\nconst exitNode = function() {\n clearUnvisitedDOM();\n\n currentNode = currentParent;\n currentParent = currentParent.parentNode;\n};\n\n\n/**\n * Makes sure that the current node is an Element with a matching tagName and\n * key.\n *\n * @param {string} tag The element's tag.\n * @param {?string=} key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @return {!Element} The corresponding Element.\n */\nconst elementOpen = function(tag, key) {\n nextNode();\n alignWithDOM(tag, key);\n enterNode();\n return /** @type {!Element} */(currentParent);\n};\n\n\n/**\n * Closes the currently open Element, removing any unvisited children if\n * necessary.\n *\n * @return {!Element} The corresponding Element.\n */\nconst elementClose = function() {\n if (process.env.NODE_ENV !== 'production') {\n setInSkip(false);\n }\n\n exitNode();\n return /** @type {!Element} */(currentNode);\n};\n\n\n/**\n * Makes sure the current node is a Text node and creates a Text node if it is\n * not.\n *\n * @return {!Text} The corresponding Text Node.\n */\nconst text = function() {\n nextNode();\n alignWithDOM('#text', null);\n return /** @type {!Text} */(currentNode);\n};\n\n\n/**\n * Gets the current Element being patched.\n * @return {!Element}\n */\nconst currentElement = function() {\n if (process.env.NODE_ENV !== 'production') {\n assertInPatch('currentElement', context);\n assertNotInAttributes('currentElement');\n }\n return /** @type {!Element} */(currentParent);\n};\n\n\n/**\n * @return {Node} The Node that will be evaluated for the next instruction.\n */\nconst currentPointer = function() {\n if (process.env.NODE_ENV !== 'production') {\n assertInPatch('currentPointer', context);\n assertNotInAttributes('currentPointer');\n }\n return getNextNode();\n};\n\n\n/**\n * Skips the children in a subtree, allowing an Element to be closed without\n * clearing out the children.\n */\nconst skip = function() {\n if (process.env.NODE_ENV !== 'production') {\n assertNoChildrenDeclaredYet('skip', currentNode);\n setInSkip(true);\n }\n currentNode = currentParent.lastChild;\n};\n\n\n/**\n * Skips the next Node to be patched, moving the pointer forward to the next\n * sibling of the current pointer.\n */\nconst skipNode = nextNode;\n\n\n/** */\nexport {\n elementOpen,\n elementClose,\n text,\n patchInner,\n patchOuter,\n currentElement,\n currentPointer,\n skip,\n skipNode\n};\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @const */\nconst symbols = {\n default: '__default'\n};\n\n/** */\nexport {\n symbols\n};\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getData } from './node_data';\nimport { symbols } from './symbols';\nimport {\n createMap,\n has\n} from './util';\n\n\n/**\n * @param {string} name\n * @return {string|undefined} The namespace to use for the attribute.\n */\nconst getNamespace = function(name) {\n if (name.lastIndexOf('xml:', 0) === 0) {\n return 'http://www.w3.org/XML/1998/namespace';\n }\n\n if (name.lastIndexOf('xlink:', 0) === 0) {\n return 'http://www.w3.org/1999/xlink';\n }\n};\n\n\n/**\n * Applies an attribute or property to a given Element. If the value is null\n * or undefined, it is removed from the Element. Otherwise, the value is set\n * as an attribute.\n * @param {!Element} el\n * @param {string} name The attribute's name.\n * @param {?(boolean|number|string)=} value The attribute's value.\n */\nconst applyAttr = function(el, name, value) {\n if (value == null) {\n el.removeAttribute(name);\n } else {\n const attrNS = getNamespace(name);\n if (attrNS) {\n el.setAttributeNS(attrNS, name, value);\n } else {\n el.setAttribute(name, value);\n }\n }\n};\n\n/**\n * Applies a property to a given Element.\n * @param {!Element} el\n * @param {string} name The property's name.\n * @param {*} value The property's value.\n */\nconst applyProp = function(el, name, value) {\n el[name] = value;\n};\n\n\n/**\n * Applies a value to a style declaration. Supports CSS custom properties by\n * setting properties containing a dash using CSSStyleDeclaration.setProperty.\n * @param {CSSStyleDeclaration} style\n * @param {!string} prop\n * @param {*} value\n */\nconst setStyleValue = function(style, prop, value) {\n if (prop.indexOf('-') >= 0) {\n style.setProperty(prop, /** @type {string} */(value));\n } else {\n style[prop] = value;\n }\n};\n\n\n/**\n * Applies a style to an Element. No vendor prefix expansion is done for\n * property names/values.\n * @param {!Element} el\n * @param {string} name The attribute's name.\n * @param {*} style The style to set. Either a string of css or an object\n * containing property-value pairs.\n */\nconst applyStyle = function(el, name, style) {\n if (typeof style === 'string') {\n el.style.cssText = style;\n } else {\n el.style.cssText = '';\n const elStyle = el.style;\n const obj = /** @type {!Object} */(style);\n\n for (const prop in obj) {\n if (has(obj, prop)) {\n setStyleValue(elStyle, prop, obj[prop]);\n }\n }\n }\n};\n\n\n/**\n * Updates a single attribute on an Element.\n * @param {!Element} el\n * @param {string} name The attribute's name.\n * @param {*} value The attribute's value. If the value is an object or\n * function it is set on the Element, otherwise, it is set as an HTML\n * attribute.\n */\nconst applyAttributeTyped = function(el, name, value) {\n const type = typeof value;\n\n if (type === 'object' || type === 'function') {\n applyProp(el, name, value);\n } else {\n applyAttr(el, name, /** @type {?(boolean|number|string)} */(value));\n }\n};\n\n\n/**\n * Calls the appropriate attribute mutator for this attribute.\n * @param {!Element} el\n * @param {string} name The attribute's name.\n * @param {*} value The attribute's value.\n */\nconst updateAttribute = function(el, name, value) {\n const data = getData(el);\n const attrs = data.attrs;\n\n if (attrs[name] === value) {\n return;\n }\n\n const mutator = attributes[name] || attributes[symbols.default];\n mutator(el, name, value);\n\n attrs[name] = value;\n};\n\n\n/**\n * A publicly mutable object to provide custom mutators for attributes.\n * @const {!Object}\n */\nconst attributes = createMap();\n\n// Special generic mutator that's called for any attribute that does not\n// have a specific mutator.\nattributes[symbols.default] = applyAttributeTyped;\n\nattributes['style'] = applyStyle;\n\n\n/** */\nexport {\n updateAttribute,\n applyProp,\n applyAttr,\n attributes\n};\n","/**\n * Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n elementOpen as coreElementOpen,\n elementClose as coreElementClose,\n text as coreText\n} from './core';\nimport { updateAttribute } from './attributes';\nimport { getData } from './node_data';\nimport {\n assertNotInAttributes,\n assertNotInSkip,\n assertInAttributes,\n assertCloseMatchesOpenTag,\n setInAttributes\n} from './assertions';\n\n\n/**\n * The offset in the virtual element declaration where the attributes are\n * specified.\n * @const\n */\nconst ATTRIBUTES_OFFSET = 3;\n\n\n/**\n * Builds an array of arguments for use with elementOpenStart, attr and\n * elementOpenEnd.\n * @const {Array<*>}\n */\nconst argsBuilder = [];\n\n\n/**\n * @param {string} tag The element's tag.\n * @param {?string=} key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param {?Array<*>=} statics An array of attribute name/value pairs of the\n * static attributes for the Element. These will only be set once when the\n * Element is created.\n * @param {...*} var_args, Attribute name/value pairs of the dynamic attributes\n * for the Element.\n * @return {!Element} The corresponding Element.\n */\nconst elementOpen = function(tag, key, statics, var_args) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotInAttributes('elementOpen');\n assertNotInSkip('elementOpen');\n }\n\n const node = coreElementOpen(tag, key);\n const data = getData(node);\n\n if (!data.staticsApplied) {\n if (statics) {\n for (let i = 0; i < statics.length; i += 2) {\n const name = /** @type {string} */(statics[i]);\n const value = statics[i + 1];\n updateAttribute(node, name, value);\n }\n }\n // Down the road, we may want to keep track of the statics array to use it\n // as an additional signal about whether a node matches or not. For now,\n // just use a marker so that we do not reapply statics.\n data.staticsApplied = true;\n }\n\n /*\n * Checks to see if one or more attributes have changed for a given Element.\n * When no attributes have changed, this is much faster than checking each\n * individual argument. When attributes have changed, the overhead of this is\n * minimal.\n */\n const attrsArr = data.attrsArr;\n const newAttrs = data.newAttrs;\n const isNew = !attrsArr.length;\n let i = ATTRIBUTES_OFFSET;\n let j = 0;\n\n for (; i < arguments.length; i += 2, j += 2) {\n const attr = arguments[i];\n if (isNew) {\n attrsArr[j] = attr;\n newAttrs[attr] = undefined;\n } else if (attrsArr[j] !== attr) {\n break;\n }\n\n const value = arguments[i + 1];\n if (isNew || attrsArr[j + 1] !== value) {\n attrsArr[j + 1] = value;\n updateAttribute(node, attr, value);\n }\n }\n\n if (i < arguments.length || j < attrsArr.length) {\n for (; i < arguments.length; i += 1, j += 1) {\n attrsArr[j] = arguments[i];\n }\n\n if (j < attrsArr.length) {\n attrsArr.length = j;\n }\n\n /*\n * Actually perform the attribute update.\n */\n for (i = 0; i < attrsArr.length; i += 2) {\n const name = /** @type {string} */(attrsArr[i]);\n const value = attrsArr[i + 1];\n newAttrs[name] = value;\n }\n\n for (const attr in newAttrs) {\n updateAttribute(node, attr, newAttrs[attr]);\n newAttrs[attr] = undefined;\n }\n }\n\n return node;\n};\n\n\n/**\n * Declares a virtual Element at the current location in the document. This\n * corresponds to an opening tag and a elementClose tag is required. This is\n * like elementOpen, but the attributes are defined using the attr function\n * rather than being passed as arguments. Must be folllowed by 0 or more calls\n * to attr, then a call to elementOpenEnd.\n * @param {string} tag The element's tag.\n * @param {?string=} key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param {?Array<*>=} statics An array of attribute name/value pairs of the\n * static attributes for the Element. These will only be set once when the\n * Element is created.\n */\nconst elementOpenStart = function(tag, key, statics) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotInAttributes('elementOpenStart');\n setInAttributes(true);\n }\n\n argsBuilder[0] = tag;\n argsBuilder[1] = key;\n argsBuilder[2] = statics;\n};\n\n\n/***\n * Defines a virtual attribute at this point of the DOM. This is only valid\n * when called between elementOpenStart and elementOpenEnd.\n *\n * @param {string} name\n * @param {*} value\n */\nconst attr = function(name, value) {\n if (process.env.NODE_ENV !== 'production') {\n assertInAttributes('attr');\n }\n\n argsBuilder.push(name);\n argsBuilder.push(value);\n};\n\n\n/**\n * Closes an open tag started with elementOpenStart.\n * @return {!Element} The corresponding Element.\n */\nconst elementOpenEnd = function() {\n if (process.env.NODE_ENV !== 'production') {\n assertInAttributes('elementOpenEnd');\n setInAttributes(false);\n }\n\n const node = elementOpen.apply(null, argsBuilder);\n argsBuilder.length = 0;\n return node;\n};\n\n\n/**\n * Closes an open virtual Element.\n *\n * @param {string} tag The element's tag.\n * @return {!Element} The corresponding Element.\n */\nconst elementClose = function(tag) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotInAttributes('elementClose');\n }\n\n const node = coreElementClose();\n\n if (process.env.NODE_ENV !== 'production') {\n assertCloseMatchesOpenTag(getData(node).nodeName, tag);\n }\n\n return node;\n};\n\n\n/**\n * Declares a virtual Element at the current location in the document that has\n * no children.\n * @param {string} tag The element's tag.\n * @param {?string=} key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param {?Array<*>=} statics An array of attribute name/value pairs of the\n * static attributes for the Element. These will only be set once when the\n * Element is created.\n * @param {...*} var_args Attribute name/value pairs of the dynamic attributes\n * for the Element.\n * @return {!Element} The corresponding Element.\n */\nconst elementVoid = function(tag, key, statics, var_args) {\n elementOpen.apply(null, arguments);\n return elementClose(tag);\n};\n\n\n/**\n * Declares a virtual Text at this point in the document.\n *\n * @param {string|number|boolean} value The value of the Text.\n * @param {...(function((string|number|boolean)):string)} var_args\n * Functions to format the value which are called only when the value has\n * changed.\n * @return {!Text} The corresponding text node.\n */\nconst text = function(value, var_args) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotInAttributes('text');\n assertNotInSkip('text');\n }\n\n const node = coreText();\n const data = getData(node);\n\n if (data.text !== value) {\n data.text = /** @type {string} */(value);\n\n let formatted = value;\n for (let i = 1; i < arguments.length; i += 1) {\n /*\n * Call the formatter function directly to prevent leaking arguments.\n * https://github.com/google/incremental-dom/pull/204#issuecomment-178223574\n */\n const fn = arguments[i];\n formatted = fn(formatted);\n }\n\n node.data = formatted;\n }\n\n return node;\n};\n\n\n/** */\nexport {\n elementOpenStart,\n elementOpenEnd,\n elementOpen,\n elementVoid,\n elementClose,\n text,\n attr\n};\n"],"names":["Blank","NodeData","nodeName","key","attrs","createMap","attrsArr","newAttrs","staticsApplied","keyMap","keyMapValid","focused","text","Context","created","notifications","nodesCreated","deleted","nodesDeleted","hasOwnProperty","Object","prototype","create","has","map","property","call","initData","node","data","getData","importNode","isElement","Element","localName","getAttribute","parentNode","attributes","i","length","attr","name","value","undefined","push","child","firstChild","nextSibling","getNamespaceForTag","tag","parent","namespaceURI","createElement","doc","namespace","el","createElementNS","createText","createTextNode","markCreated","this","markDeleted","notifyChanges","isDocumentRoot","Document","DocumentFragment","getAncestry","root","ancestry","cur","getRoot","prev","getActiveElement","activeElement","getFocusedPath","contains","moveBefore","referenceNode","insertReferenceNode","next","insertBefore","context","currentNode","currentParent","markFocused","focusPath","patchFactory","run","f","fn","prevContext","prevDoc","prevCurrentNode","prevCurrentParent","ownerDocument","retVal","patchInner","patchOuter","startNode","matches","matchNode","alignWithDOM","parentData","currentNodeData","keyNode","replaceChild","removeChild","clearUnvisitedDOM","lastChild","enterNode","getNextNode","nextNode","exitNode","elementOpen","elementClose","currentElement","currentPointer","skip","skipNode","symbols","getNamespace","lastIndexOf","applyAttr","removeAttribute","attrNS","setAttributeNS","setAttribute","applyProp","setStyleValue","style","prop","indexOf","setProperty","applyStyle","cssText","elStyle","obj","applyAttributeTyped","type","updateAttribute","mutator","ATTRIBUTES_OFFSET","argsBuilder","statics","coreElementOpen","_i","isNew","j","arguments","_attr","_attr2","elementOpenStart","elementOpenEnd","apply","coreElementClose","elementVoid","coreText","formatted"],"mappings":";;;;;;;;;;;;;;;;gMA2BA,SAASA,MCFT,QAASC,GAASC,EAAUC,QAKrBC,MAAQC,SAQRC,iBAMAC,SAAWF,SAMXG,gBAAiB,OAOjBL,IAAMA,OAMNM,OAASJ,SAMTK,aAAc,OAMdC,SAAU,OAMVT,SAAWA,OAKXU,KAAO,KG/Dd,QAASC,UAIFC,QAAUC,EAAcC,sBAKxBC,QAAUF,EAAcG,iBJZ/B,GAAMC,GAAiBC,OAAOC,UAAUF,cASxCnB,GAAMqB,UAAYD,OAAOE,OAAO,KAShC,IAAMC,GAAM,SAASC,EAAKC,SACjBN,GAAeO,KAAKF,EAAKC,IAQ5BpB,EAAY,iBACT,IAAIL,ICkDP2B,EAAW,SAASC,EAAM1B,EAAUC,MAClC0B,GAAO,GAAI5B,GAASC,EAAUC,YACpC,qBAA+B0B,EACxBA,GAUHC,EAAU,SAASF,YACZA,GACJA,EAAA,sBASHG,EAAa,SAASH,OACtBA,EAAA,yBAIEI,GAAYJ,YAAgBK,SAC5B/B,EAAW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C,EAAK4I,KAM9B,GAAK9F,IACL,GAAK9C,IACL,GAAK4I,GAWbvG,GAAO,SAASC,EAAMC,KAKdE,KAAKH,KACLG,KAAKF,IAQb8G,GAAiB,cAMf5H,GAAOqF,GAAYwC,MAAM,KAAMX,YACzBvG,OAAS,EACdX,GAUHsF,GAAe,cAKbtF,GAAO8H,UAMN9H,IAkBH+H,GAAc,SAAS1G,aACfwG,MAAM,KAAML,WACjBlC,GAAajE,IAahBrC,GAAO,SAAS8B,MAMdd,GAAOgI,IACP/H,EAAOC,EAAQF,MAEjBC,EAAKjB,OAAS8B,EAAO,GAClB9B,KAA6B8B,MAG7B,GADDmH,GAAYnH,EACPJ,EAAI,EAAGA,EAAI8G,UAAU7G,OAAQD,GAAK,EAAG,IAKtCmD,GAAK2D,UAAU9G,KACTmD,EAAGoE,KAGZhI,KAAOgI,QAGPjI","sourceRoot":"/source/"} \ No newline at end of file diff --git a/examples/prest-lib/lib/todomvc-app-css/index.css b/examples/prest-lib/lib/todomvc-app-css/index.css new file mode 100644 index 0000000000..3ac79f05b9 --- /dev/null +++ b/examples/prest-lib/lib/todomvc-app-css/index.css @@ -0,0 +1,379 @@ +html, +body { + margin: 0; + padding: 0; +} + +button { + margin: 0; + padding: 0; + border: 0; + background: none; + font-size: 100%; + vertical-align: baseline; + font-family: inherit; + font-weight: inherit; + color: inherit; + -webkit-appearance: none; + appearance: none; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +body { + font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif; + line-height: 1.4em; + background: #f5f5f5; + color: #4d4d4d; + min-width: 230px; + max-width: 550px; + margin: 0 auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-weight: 300; +} + +:focus { + outline: 0; +} + +.hidden { + display: none; +} + +.todoapp { + background: #fff; + margin: 130px 0 40px 0; + position: relative; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), + 0 25px 50px 0 rgba(0, 0, 0, 0.1); +} + +.todoapp input::-webkit-input-placeholder { + font-style: italic; + font-weight: 300; + color: #e6e6e6; +} + +.todoapp input::-moz-placeholder { + font-style: italic; + font-weight: 300; + color: #e6e6e6; +} + +.todoapp input::input-placeholder { + font-style: italic; + font-weight: 300; + color: #e6e6e6; +} + +.todoapp h1 { + position: absolute; + top: -155px; + width: 100%; + font-size: 100px; + font-weight: 100; + text-align: center; + color: rgba(175, 47, 47, 0.15); + -webkit-text-rendering: optimizeLegibility; + -moz-text-rendering: optimizeLegibility; + text-rendering: optimizeLegibility; +} + +.new-todo, +.edit { + position: relative; + margin: 0; + width: 100%; + font-size: 24px; + font-family: inherit; + font-weight: inherit; + line-height: 1.4em; + border: 0; + color: inherit; + padding: 6px; + border: 1px solid #999; + box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2); + box-sizing: border-box; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.new-todo { + padding: 16px 16px 16px 60px; + border: none; + background: rgba(0, 0, 0, 0.003); + box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03); +} + +.main { + position: relative; + z-index: 2; + border-top: 1px solid #e6e6e6; +} + +.toggle-all { + width: 1px; + height: 1px; + border: none; /* Mobile Safari */ + opacity: 0; + position: absolute; + right: 100%; + bottom: 100%; +} + +.toggle-all + label { + width: 60px; + height: 34px; + font-size: 0; + position: absolute; + top: -52px; + left: -13px; + -webkit-transform: rotate(90deg); + transform: rotate(90deg); +} + +.toggle-all + label:before { + content: '❯'; + font-size: 22px; + color: #e6e6e6; + padding: 10px 27px 10px 27px; +} + +.toggle-all:checked + label:before { + color: #737373; +} + +.todo-list { + margin: 0; + padding: 0; + list-style: none; +} + +.todo-list li { + position: relative; + font-size: 24px; + border-bottom: 1px solid #ededed; +} + +.todo-list li:last-child { + border-bottom: none; +} + +.todo-list li.editing { + border-bottom: none; + padding: 0; +} + +.todo-list li.editing .edit { + display: block; + width: 506px; + padding: 12px 16px; + margin: 0 0 0 43px; +} + +.todo-list li.editing .view { + display: none; +} + +.todo-list li .toggle { + text-align: center; + width: 40px; + /* auto, since non-WebKit browsers doesn't support input styling */ + height: auto; + position: absolute; + top: 0; + bottom: 0; + margin: auto 0; + border: none; /* Mobile Safari */ + -webkit-appearance: none; + appearance: none; +} + +.todo-list li .toggle { + opacity: 0; +} + +.todo-list li .toggle + label { + /* + Firefox requires `#` to be escaped - https://bugzilla.mozilla.org/show_bug.cgi?id=922433 + IE and Edge requires *everything* to be escaped to render, so we do that instead of just the `#` - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7157459/ + */ + background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E'); + background-repeat: no-repeat; + background-position: center left; +} + +.todo-list li .toggle:checked + label { + background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23bddad5%22%20stroke-width%3D%223%22/%3E%3Cpath%20fill%3D%22%235dc2af%22%20d%3D%22M72%2025L42%2071%2027%2056l-4%204%2020%2020%2034-52z%22/%3E%3C/svg%3E'); +} + +.todo-list li label { + word-break: break-all; + padding: 15px 15px 15px 60px; + display: block; + line-height: 1.2; + transition: color 0.4s; +} + +.todo-list li.completed label { + color: #d9d9d9; + text-decoration: line-through; +} + +.todo-list li .destroy { + display: none; + position: absolute; + top: 0; + right: 10px; + bottom: 0; + width: 40px; + height: 40px; + margin: auto 0; + font-size: 30px; + color: #cc9a9a; + margin-bottom: 11px; + transition: color 0.2s ease-out; +} + +.todo-list li .destroy:hover { + color: #af5b5e; +} + +.todo-list li .destroy:after { + content: '×'; +} + +.todo-list li:hover .destroy { + display: block; +} + +.todo-list li .edit { + display: none; +} + +.todo-list li.editing:last-child { + margin-bottom: -1px; +} + +.footer { + color: #777; + padding: 10px 15px; + height: 20px; + text-align: center; + border-top: 1px solid #e6e6e6; +} + +.footer:before { + content: ''; + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 50px; + overflow: hidden; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), + 0 8px 0 -3px #f6f6f6, + 0 9px 1px -3px rgba(0, 0, 0, 0.2), + 0 16px 0 -6px #f6f6f6, + 0 17px 2px -6px rgba(0, 0, 0, 0.2); +} + +.todo-count { + float: left; + text-align: left; +} + +.todo-count strong { + font-weight: 300; +} + +.filters { + margin: 0; + padding: 0; + list-style: none; + position: absolute; + right: 0; + left: 0; +} + +.filters li { + display: inline; +} + +.filters li a { + color: inherit; + margin: 3px; + padding: 3px 7px; + text-decoration: none; + border: 1px solid transparent; + border-radius: 3px; +} + +.filters li a:hover { + border-color: rgba(175, 47, 47, 0.1); +} + +.filters li a.selected { + border-color: rgba(175, 47, 47, 0.2); +} + +.clear-completed, +html .clear-completed:active { + float: right; + position: relative; + line-height: 20px; + text-decoration: none; + cursor: pointer; +} + +.clear-completed:hover { + text-decoration: underline; +} + +.info { + margin: 65px auto 0; + color: #bfbfbf; + font-size: 10px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-align: center; +} + +.info p { + line-height: 1; +} + +.info a { + color: inherit; + text-decoration: none; + font-weight: 400; +} + +.info a:hover { + text-decoration: underline; +} + +/* + Hack to remove background from Mobile Safari. + Can't use it globally since it destroys checkboxes in Firefox +*/ +@media screen and (-webkit-min-device-pixel-ratio:0) { + .toggle-all, + .todo-list li .toggle { + background: none; + } + + .todo-list li .toggle { + height: 40px; + } +} + +@media (max-width: 430px) { + .footer { + height: 50px; + } + + .filters { + bottom: 10px; + } +} diff --git a/examples/prest-lib/lib/todomvc-common/base.css b/examples/prest-lib/lib/todomvc-common/base.css new file mode 100644 index 0000000000..da65968a73 --- /dev/null +++ b/examples/prest-lib/lib/todomvc-common/base.css @@ -0,0 +1,141 @@ +hr { + margin: 20px 0; + border: 0; + border-top: 1px dashed #c5c5c5; + border-bottom: 1px dashed #f7f7f7; +} + +.learn a { + font-weight: normal; + text-decoration: none; + color: #b83f45; +} + +.learn a:hover { + text-decoration: underline; + color: #787e7e; +} + +.learn h3, +.learn h4, +.learn h5 { + margin: 10px 0; + font-weight: 500; + line-height: 1.2; + color: #000; +} + +.learn h3 { + font-size: 24px; +} + +.learn h4 { + font-size: 18px; +} + +.learn h5 { + margin-bottom: 0; + font-size: 14px; +} + +.learn ul { + padding: 0; + margin: 0 0 30px 25px; +} + +.learn li { + line-height: 20px; +} + +.learn p { + font-size: 15px; + font-weight: 300; + line-height: 1.3; + margin-top: 0; + margin-bottom: 0; +} + +#issue-count { + display: none; +} + +.quote { + border: none; + margin: 20px 0 60px 0; +} + +.quote p { + font-style: italic; +} + +.quote p:before { + content: '“'; + font-size: 50px; + opacity: .15; + position: absolute; + top: -20px; + left: 3px; +} + +.quote p:after { + content: '”'; + font-size: 50px; + opacity: .15; + position: absolute; + bottom: -42px; + right: 3px; +} + +.quote footer { + position: absolute; + bottom: -40px; + right: 0; +} + +.quote footer img { + border-radius: 3px; +} + +.quote footer a { + margin-left: 5px; + vertical-align: middle; +} + +.speech-bubble { + position: relative; + padding: 10px; + background: rgba(0, 0, 0, .04); + border-radius: 5px; +} + +.speech-bubble:after { + content: ''; + position: absolute; + top: 100%; + right: 30px; + border: 13px solid transparent; + border-top-color: rgba(0, 0, 0, .04); +} + +.learn-bar > .learn { + position: absolute; + width: 272px; + top: 8px; + left: -300px; + padding: 10px; + border-radius: 5px; + background-color: rgba(255, 255, 255, .6); + transition-property: left; + transition-duration: 500ms; +} + +@media (min-width: 899px) { + .learn-bar { + width: auto; + padding-left: 300px; + } + + .learn-bar > .learn { + left: 8px; + } +} diff --git a/examples/prest-lib/lib/todomvc-common/base.js b/examples/prest-lib/lib/todomvc-common/base.js new file mode 100644 index 0000000000..a56b5aaca9 --- /dev/null +++ b/examples/prest-lib/lib/todomvc-common/base.js @@ -0,0 +1,249 @@ +/* global _ */ +(function () { + 'use strict'; + + /* jshint ignore:start */ + // Underscore's Template Module + // Courtesy of underscorejs.org + var _ = (function (_) { + _.defaults = function (object) { + if (!object) { + return object; + } + for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) { + var iterable = arguments[argsIndex]; + if (iterable) { + for (var key in iterable) { + if (object[key] == null) { + object[key] = iterable[key]; + } + } + } + } + return object; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + _.template = function(text, data, settings) { + var render; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = new RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset) + .replace(escaper, function(match) { return '\\' + escapes[match]; }); + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } + if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } + if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + index = offset + match.length; + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + "return __p;\n"; + + try { + render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + if (data) return render(data, _); + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled function source as a convenience for precompilation. + template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + + return template; + }; + + return _; + })({}); + + if (location.hostname === 'todomvc.com') { + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + ga('create', 'UA-31081062-1', 'auto'); + ga('send', 'pageview'); + } + /* jshint ignore:end */ + + function redirect() { + if (location.hostname === 'tastejs.github.io') { + location.href = location.href.replace('tastejs.github.io/todomvc', 'todomvc.com'); + } + } + + function findRoot() { + var base = location.href.indexOf('examples/'); + return location.href.substr(0, base); + } + + function getFile(file, callback) { + if (!location.host) { + return console.info('Miss the info bar? Run TodoMVC from a server to avoid a cross-origin error.'); + } + + var xhr = new XMLHttpRequest(); + + xhr.open('GET', findRoot() + file, true); + xhr.send(); + + xhr.onload = function () { + if (xhr.status === 200 && callback) { + callback(xhr.responseText); + } + }; + } + + function Learn(learnJSON, config) { + if (!(this instanceof Learn)) { + return new Learn(learnJSON, config); + } + + var template, framework; + + if (typeof learnJSON !== 'object') { + try { + learnJSON = JSON.parse(learnJSON); + } catch (e) { + return; + } + } + + if (config) { + template = config.template; + framework = config.framework; + } + + if (!template && learnJSON.templates) { + template = learnJSON.templates.todomvc; + } + + if (!framework && document.querySelector('[data-framework]')) { + framework = document.querySelector('[data-framework]').dataset.framework; + } + + this.template = template; + + if (learnJSON.backend) { + this.frameworkJSON = learnJSON.backend; + this.frameworkJSON.issueLabel = framework; + this.append({ + backend: true + }); + } else if (learnJSON[framework]) { + this.frameworkJSON = learnJSON[framework]; + this.frameworkJSON.issueLabel = framework; + this.append(); + } + + this.fetchIssueCount(); + } + + Learn.prototype.append = function (opts) { + var aside = document.createElement('aside'); + aside.innerHTML = _.template(this.template, this.frameworkJSON); + aside.className = 'learn'; + + if (opts && opts.backend) { + // Remove demo link + var sourceLinks = aside.querySelector('.source-links'); + var heading = sourceLinks.firstElementChild; + var sourceLink = sourceLinks.lastElementChild; + // Correct link path + var href = sourceLink.getAttribute('href'); + sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http'))); + sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML; + } else { + // Localize demo links + var demoLinks = aside.querySelectorAll('.demo-link'); + Array.prototype.forEach.call(demoLinks, function (demoLink) { + if (demoLink.getAttribute('href').substr(0, 4) !== 'http') { + demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); + } + }); + } + + document.body.className = (document.body.className + ' learn-bar').trim(); + document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); + }; + + Learn.prototype.fetchIssueCount = function () { + var issueLink = document.getElementById('issue-count-link'); + if (issueLink) { + var url = issueLink.href.replace('https://github.com', 'https://api.github.com/repos'); + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.onload = function (e) { + var parsedResponse = JSON.parse(e.target.responseText); + if (parsedResponse instanceof Array) { + var count = parsedResponse.length; + if (count !== 0) { + issueLink.innerHTML = 'This app has ' + count + ' open issues'; + document.getElementById('issue-count').style.display = 'inline'; + } + } + }; + xhr.send(); + } + }; + + redirect(); + getFile('learn.json', Learn); +})(); diff --git a/examples/prest-lib/libs.sh b/examples/prest-lib/libs.sh new file mode 100755 index 0000000000..89623fe383 --- /dev/null +++ b/examples/prest-lib/libs.sh @@ -0,0 +1,5 @@ +cpx -v node_modules/incremental-dom/dist/incremental-dom-min.js lib/incremental-dom +cpx -v node_modules/incremental-dom/dist/incremental-dom-min.js.map lib/incremental-dom +cpx -v node_modules/todomvc-common/base.css lib/todomvc-common +cpx -v node_modules/todomvc-common/base.js lib/todomvc-common +cpx -v node_modules/todomvc-app-css/index.css lib/todomvc-app-css diff --git a/examples/prest-lib/package-lock.json b/examples/prest-lib/package-lock.json new file mode 100644 index 0000000000..d8678e8dd4 --- /dev/null +++ b/examples/prest-lib/package-lock.json @@ -0,0 +1,2387 @@ +{ + "name": "prest-lib-todomvc", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "2.3.11", + "normalize-path": "2.1.1" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.5.6", + "regenerator-runtime": "0.11.1" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "async-each": "1.0.1", + "fsevents": "1.2.3", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "compare-versions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-2.0.1.tgz", + "integrity": "sha1-Htwfk2h/2XoyXFn1XkWgfbEGrKY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "1.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "core-js": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz", + "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "corser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", + "dev": true + }, + "cpx": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/cpx/-/cpx-1.5.0.tgz", + "integrity": "sha1-GFvgGFEdhycN7czCkxceN2VauI8=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "chokidar": "1.7.0", + "duplexer": "0.1.1", + "glob": "7.1.2", + "glob2base": "0.0.12", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "resolve": "1.7.1", + "safe-buffer": "5.1.2", + "shell-quote": "1.6.1", + "subarg": "1.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.4", + "path-key": "2.0.1", + "semver": "5.5.0", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "ecstatic": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.2.0.tgz", + "integrity": "sha512-Goilx/2cfU9vvfQjgtNgc2VmJAD8CasQ6rZDqCd2u4Hsyd/qFET6nBf60jiHodevR3nl3IGzNKtrzPXWP88utQ==", + "dev": true, + "requires": { + "he": "1.1.1", + "mime": "1.6.0", + "minimist": "1.2.0", + "url-join": "2.0.5" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz", + "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==", + "dev": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.1", + "is-callable": "1.1.3", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-stream": { + "version": "3.3.4", + "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "dev": true, + "requires": { + "duplexer": "0.1.1", + "from": "0.1.7", + "map-stream": "0.1.0", + "pause-stream": "0.0.11", + "split": "0.3.3", + "stream-combiner": "0.0.4", + "through": "2.3.8" + } + }, + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.4" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "3.0.0", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "find-index": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", + "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", + "dev": true + }, + "follow-redirects": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", + "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", + "dev": true, + "requires": { + "debug": "3.1.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.3.tgz", + "integrity": "sha512-X+57O5YkDTiEQGiw8i7wYc2nQgweIekqkepI8Q3y4wVlurgBt2SuwxTeYUYMZIGpLZH3r/TsMjczCMXE5ZOt7Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.10.0", + "node-pre-gyp": "0.9.1" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.9", + "iconv-lite": "0.4.21", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.9.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.3", + "mkdirp": "0.5.1", + "needle": "2.2.0", + "nopt": "4.0.1", + "npm-packlist": "1.1.10", + "npmlog": "4.1.2", + "rc": "1.2.6", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.1" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.2.4", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "glob2base": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", + "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "dev": true, + "requires": { + "find-index": "0.1.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "dev": true + }, + "http-proxy": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", + "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "dev": true, + "requires": { + "eventemitter3": "3.1.0", + "follow-redirects": "1.4.1", + "requires-port": "1.0.0" + } + }, + "http-server": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.11.1.tgz", + "integrity": "sha512-6JeGDGoujJLmhjiRGlt8yK8Z9Kl0vnl/dQoQZlc4oeqaUoAKQg94NILLfrY3oWzSyFaQCVNTcKE5PZ3cH8VP9w==", + "dev": true, + "requires": { + "colors": "1.0.3", + "corser": "2.0.1", + "ecstatic": "3.2.0", + "http-proxy": "1.17.0", + "opener": "1.4.3", + "optimist": "0.6.1", + "portfinder": "1.0.13", + "union": "0.4.6" + } + }, + "incremental-dom": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/incremental-dom/-/incremental-dom-0.5.1.tgz", + "integrity": "sha1-UvRTnD6e7nzREqbaBS+3Fi/vsMM=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.11.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.1" + } + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "dev": true, + "requires": { + "vlq": "0.2.3" + } + }, + "map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", + "dev": true + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true, + "optional": true + }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.6.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "npm-run-all": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.3.tgz", + "integrity": "sha512-aOG0N3Eo/WW+q6sUIdzcV2COS8VnTZCmdji0VQIAZF3b+a3YWb0AD0vFIyjKec18A7beLGbaQ5jFTNI2bPt9Cg==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "chalk": "2.4.1", + "cross-spawn": "6.0.5", + "memorystream": "0.3.1", + "minimatch": "3.0.4", + "ps-tree": "1.1.0", + "read-pkg": "3.0.0", + "shell-quote": "1.6.1", + "string.prototype.padend": "3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + } + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "opener": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=", + "dev": true + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } + } + }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "portfinder": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz", + "integrity": "sha1-uzLs2HwnEErm7kS1o8y/Drsa7ek=", + "dev": true, + "requires": { + "async": "1.5.2", + "debug": "2.6.9", + "mkdirp": "0.5.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "pre-commit": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz", + "integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "spawn-sync": "1.0.15", + "which": "1.2.14" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.2.14" + } + }, + "which": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", + "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + } + } + }, + "pre-push": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pre-push/-/pre-push-0.1.1.tgz", + "integrity": "sha1-Kip5gn0kOnbJEImJescH9F5xaqw=", + "dev": true, + "requires": { + "shelljs": "0.3.0" + } + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prest-lib": { + "version": "git+https://github.com/peter-rybar/prest-lib.git#6e28f49653323437c6a22f6509c93e17f9851cab" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "ps-tree": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", + "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", + "dev": true, + "requires": { + "event-stream": "3.3.4" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "qs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", + "dev": true + }, + "randomatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", + "dev": true, + "requires": { + "is-number": "4.0.0", + "kind-of": "6.0.2", + "math-random": "1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.4.0", + "path-type": "3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.6", + "set-immediate-shim": "1.0.1" + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rollup": { + "version": "0.36.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.36.4.tgz", + "integrity": "sha1-oiRJTFOGwdc9OPe7hvafXrARo9I=", + "dev": true, + "requires": { + "source-map-support": "0.4.18" + } + }, + "rollup-plugin-replace": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-1.2.1.tgz", + "integrity": "sha512-l9Pgb7bh5Wx18+qM9iOWZ/CKcwyKJETLAwCh6bjKwTOgTzNH3KmKDWI/X/ToNA7fA/68chhFyvISvreRxWFVtw==", + "dev": true, + "requires": { + "magic-string": "0.22.5", + "minimatch": "3.0.4", + "rollup-pluginutils": "2.2.0" + } + }, + "rollup-plugin-typescript": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript/-/rollup-plugin-typescript-0.8.1.tgz", + "integrity": "sha1-L/fuzCHPa7K0P8J+W2iJUs5xkko=", + "dev": true, + "requires": { + "compare-versions": "2.0.1", + "object-assign": "4.1.1", + "rollup-pluginutils": "1.5.2", + "tippex": "2.3.1", + "typescript": "1.8.10" + }, + "dependencies": { + "estree-walker": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz", + "integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=", + "dev": true + }, + "rollup-pluginutils": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", + "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", + "dev": true, + "requires": { + "estree-walker": "0.2.1", + "minimatch": "3.0.4" + } + }, + "typescript": { + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.8.10.tgz", + "integrity": "sha1-tHXW4N/wv1DyluXKbvn7tccyDx4=", + "dev": true + } + } + }, + "rollup-plugin-uglify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-1.0.2.tgz", + "integrity": "sha1-1KpvXfE1Iurhuhd4DHxMcJYDg1k=", + "dev": true, + "requires": { + "uglify-js": "2.8.29" + } + }, + "rollup-pluginutils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.2.0.tgz", + "integrity": "sha512-aqjTUCfZJK3O+TjH++PdQc8Lg6V6t/1Fhu8/6f3qPQzBt0xZruDgqblvb3RQOfKybTgfxKpyy2pQmQ4X2OmY4w==", + "dev": true, + "requires": { + "estree-walker": "0.5.2", + "micromatch": "2.3.11" + } + }, + "rollup-watch": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/rollup-watch/-/rollup-watch-2.5.0.tgz", + "integrity": "sha1-hS1mDd7MUWlokKqMIule1FWMxfc=", + "dev": true, + "requires": { + "semver": "5.5.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "1.6.2", + "os-shim": "0.1.3" + } + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "dev": true, + "requires": { + "duplexer": "0.1.1" + } + }, + "string.prototype.padend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", + "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.11.0", + "function-bind": "1.1.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "1.2.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tippex": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tippex/-/tippex-2.3.1.tgz", + "integrity": "sha1-ov1bcIfXy/sgyYBqbBYQjCwPr9o=", + "dev": true + }, + "todomvc-app-css": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/todomvc-app-css/-/todomvc-app-css-2.1.2.tgz", + "integrity": "sha512-WgXLWY4snfC7yBkpzFb6xRmUbB06NGuji6njCByte0byW2DUpmyhh32o4sCQ8HX/pTwm71huKQlFiKYxR/2iVQ==" + }, + "todomvc-common": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/todomvc-common/-/todomvc-common-1.0.5.tgz", + "integrity": "sha512-D8kEJmxVMQIWwztEdH+WeiAfXRbbSCpgXq4NkYi+gduJ2tr8CNq7sYLfJvjpQ10KD9QxJwig57rvMbV2QAESwQ==" + }, + "tslib": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", + "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", + "dev": true + }, + "tslint": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", + "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.4.1", + "commander": "2.15.1", + "diff": "3.5.0", + "glob": "7.1.2", + "js-yaml": "3.11.0", + "minimatch": "3.0.4", + "resolve": "1.7.1", + "semver": "5.5.0", + "tslib": "1.9.0", + "tsutils": "2.26.2" + } + }, + "tsutils": { + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.26.2.tgz", + "integrity": "sha512-uzwnhmrSbyinPCiwfzGsOY3IulBTwoky7r83HmZdz9QNCjhSCzavkh47KLWuU0zF2F2WbpmmzoJUIEiYyd+jEQ==", + "dev": true, + "requires": { + "tslib": "1.9.0" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.3.tgz", + "integrity": "sha512-K7g15Bb6Ra4lKf7Iq2l/I5/En+hLIHmxWZGq3D4DIRNFxMNV6j2SHSvDOqs2tGd4UvD/fJvrwopzQXjLrT7Itw==", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "union": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", + "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=", + "dev": true, + "requires": { + "qs": "2.3.3" + } + }, + "url-join": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", + "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } +} diff --git a/examples/prest-lib/package.json b/examples/prest-lib/package.json new file mode 100644 index 0000000000..3a1edb0828 --- /dev/null +++ b/examples/prest-lib/package.json @@ -0,0 +1,75 @@ +{ + "name": "prest-lib-todomvc", + "version": "0.1.0", + "description": "pREST Lib Widgets - TodoMVC demo", + "keywords": [ + "pREST", + "lib", + "typescript", + "jsonml", + "dom", + "encode", + "events", + "form", + "hash", + "history", + "http", + "load", + "router", + "signal", + "template", + "widgets", + "todomvc" + ], + "author": { + "name": "Peter Rybar", + "email": "pr.rybar@gmail.com", + "url": "https://github.com/peter-rybar" + }, + "license": "GPL-3.0", + "private": false, + "repository": { + "type": "git", + "url": "https://github.com/peter-rybar/prest-lib-todomvc.git" + }, + "scripts": { + "clean": "rm -rf lib", + "clean:all": "npm run clean; rm -rf node_modules", + "tslint": "tslint --project tsconfig.json", + "libs": ". ./libs.sh", + "prebuild": "run-s clean tslint libs", + "build": "rollup -c", + "build:watch": "npm run build -- -w", + "server": "http-server ./", + "start": "run-p build:watch server" + }, + "dependencies": { + "incremental-dom": "^0.5.1", + "prest-lib": "git+https://github.com/peter-rybar/prest-lib.git#6e28f49653323437c6a22f6509c93e17f9851cab", + "todomvc-app-css": "^2.0.0", + "todomvc-common": "^1.0.0" + }, + "devDependencies": { + "cpx": "^1.5.0", + "http-server": "^0.11.1", + "npm-run-all": "^4.1.3", + "pre-commit": "^1.2.2", + "pre-push": "^0.1.1", + "rollup": "^0.36.3", + "rollup-plugin-replace": "^1.1.1", + "rollup-plugin-typescript": "^0.8.1", + "rollup-plugin-uglify": "^1.0.1", + "rollup-watch": "^2.5.0", + "tslint": "^5.9.1", + "typescript": "^2.8.1" + }, + "pre-commit": [ + "build" + ], + "pre-push": [ + "build" + ], + "prettier": { + "tabWidth": 4 + } +} diff --git a/examples/prest-lib/readme.md b/examples/prest-lib/readme.md new file mode 100644 index 0000000000..abe9772fc3 --- /dev/null +++ b/examples/prest-lib/readme.md @@ -0,0 +1,36 @@ +# pREST Lib Widgets • [TodoMVC](http://todomvc.com) + +> [pREST Lib](https://github.com/peter-rybar/prest-lib) - TypeScript library and tools for rapid web development. + + + +## Credit + +Created by [Peter Rybar](https://github.com/peter-rybar/) diff --git a/examples/prest-lib/rollup.config.js b/examples/prest-lib/rollup.config.js new file mode 100644 index 0000000000..264d669ee4 --- /dev/null +++ b/examples/prest-lib/rollup.config.js @@ -0,0 +1,27 @@ +import typescript from 'rollup-plugin-typescript'; +import replace from 'rollup-plugin-replace' +import uglify from 'rollup-plugin-uglify'; +import { minify } from 'uglify-js'; + +const pkg = require('./package.json'); + +export default { + entry: './src/index.ts', + plugins: [ + typescript({ + typescript: require('typescript') + }), + replace({ + '@VERSION@': pkg.version + }), + uglify({}, minify) + ], + external: Object.keys(pkg.dependencies), + targets: [ + { + dest: './js/index.js', + format: 'iife', + sourceMap: true + } + ] +} diff --git a/examples/prest-lib/src/index.ts b/examples/prest-lib/src/index.ts new file mode 100644 index 0000000000..34d8aec6ff --- /dev/null +++ b/examples/prest-lib/src/index.ts @@ -0,0 +1,20 @@ +import { TodoApp } from "./todoapp"; +import { Todo } from "./todowidget"; + +const todos: Todo[] = [ + // { + // id: new Date().getTime(), + // title: "Learn prest-lib widgets", + // completed: true + // }, + // { + // id: new Date().getTime() + 1, + // title: "Add star to prest-lib", + // completed: false + // } +]; + +const app = new TodoApp(document.getElementById("app"), todos); + +(self as any).app = app; +(self as any).app.version = "@VERSION@"; diff --git a/examples/prest-lib/src/store.ts b/examples/prest-lib/src/store.ts new file mode 100644 index 0000000000..748d9ebe78 --- /dev/null +++ b/examples/prest-lib/src/store.ts @@ -0,0 +1,34 @@ +export class Store { + + private static _key = "todos-prest-lib"; + + private _data: T; + private _isLS: boolean = false; + + constructor(data: T) { + if ("localStorage" in self) { + try { + localStorage.getItem(Store._key); + this._isLS = true; + } catch (e) { + console.warn(e); + } + } + if (!this.read()) { + this.write(data); + } + } + + read(): T { + return this._isLS ? + JSON.parse(localStorage.getItem(Store._key)) : + this._data; + } + + write(data: T): void { + this._isLS ? + localStorage.setItem(Store._key, JSON.stringify(data)) : + this._data = data; + } + +} diff --git a/examples/prest-lib/src/todoapp.ts b/examples/prest-lib/src/todoapp.ts new file mode 100644 index 0000000000..6e83163ef1 --- /dev/null +++ b/examples/prest-lib/src/todoapp.ts @@ -0,0 +1,60 @@ +import { Hash } from "prest-lib/src/main/hash"; +import { TodoWidget, Todo } from "./todowidget"; +import { Store } from "./store"; +import { todotHandlers } from "./todohandlers"; + +export class TodoApp { + + store: Store; + todoWidget: TodoWidget; + hash: Hash; + + constructor(element: HTMLElement, todos: Todo[] = []) { + this._initStore(todos); + this._initWidget(element); + this._initRouting(); + } + + private _initStore(todos: Todo[]): void { + this.store = new Store(todos); + } + + private _initWidget(element: HTMLElement): void { + this.todoWidget = new TodoWidget() + .setState({ + todo: "", + todos: this.store.read(), + filter: "", + edit: null + }); + todotHandlers(this.todoWidget.events, this.store); + this.todoWidget.mount(element); + } + + private _initRouting(): void { + this.hash = new Hash() + .coders( + data => encodeURI(data), + str => decodeURI(str) + ); + this.hash.onChange(data => { + switch (data) { + case "/": + case "/active": + case "/completed": + this.todoWidget.getState().filter = data; + this.todoWidget.update(); + this.todoWidget.events.emit("filter", data); + break; + default: + this.todoWidget.getState().filter = ""; + this.todoWidget.update(); + this.todoWidget.events.emit("filter", data); + this.hash.write("/"); + break; + } + }); + this.hash.start(); + } + +} diff --git a/examples/prest-lib/src/todohandlers.ts b/examples/prest-lib/src/todohandlers.ts new file mode 100644 index 0000000000..1d7022ab19 --- /dev/null +++ b/examples/prest-lib/src/todohandlers.ts @@ -0,0 +1,53 @@ +import { Events } from "prest-lib/src/main/events"; +import { TodoWidget, Todo } from "./todowidget"; +import { Store } from "./store"; + +export function todotHandlers(events: Events, + store: Store): void { + events + .on("insert", (title: string, w: TodoWidget) => { + const todo = { + id: new Date().getTime(), + title: title, + completed: false + } as Todo; + w.getState().todos.push(todo); + w.getState().todo = ""; + w.update(); + }) + .on("complete-all", (complete: boolean, w: TodoWidget) => { + w.getState().todos.forEach(t => (t.completed = complete)); + w.update(); + }) + .on("complete", (id: number, w: TodoWidget) => { + w.getState().todos.forEach( + t => (t.id === id ? (t.completed = !t.completed) : null) + ); + w.update(); + }) + .on("delete", (id: number, w: TodoWidget) => { + w.getState().todos = w.getState().todos.filter(t => t.id !== id); + w.update(); + }) + .on("clear-completed", (data: any, w: TodoWidget) => { + w.getState().todos = w.getState().todos.filter(t => !t.completed); + w.update(); + }) + .on("edit", (id: number, w: TodoWidget) => { + w.getState().edit = id; + w.update(); + }) + .on("edited", (title: string, w: TodoWidget) => { + w.getState().todos.forEach( + t => (t.id === w.getState().edit ? (t.title = title) : null) + ); + w.getState().edit = null; + w.getState().todos = w.getState().todos.filter(t => t.title !== ""); + w.update(); + }) + .any((data: any, w: TodoWidget, e: string) => { + console.log(e, JSON.stringify(data, null, 4)); + console.log("state", JSON.stringify(w.getState(), null, 4)); + store.write(w.getState().todos); + }); +} diff --git a/examples/prest-lib/src/todowidget.ts b/examples/prest-lib/src/todowidget.ts new file mode 100644 index 0000000000..93e1adfc0a --- /dev/null +++ b/examples/prest-lib/src/todowidget.ts @@ -0,0 +1,190 @@ +import { WidgetE } from "prest-lib/src/main/widgete"; +import { JsonMLs } from "prest-lib/src/main/jsonml"; + +export interface Todo { + id: number; + title: string; + completed: boolean; +} + +export interface TodoState { + todo: string; + todos: Todo[]; + filter: string; + edit: number; +} + +export class TodoWidget extends WidgetE { + + constructor() { + super("TodoWidget"); + this.setState({ + todo: "", + todos: [], + filter: "/", + edit: null + }); + } + + render(): JsonMLs { + let todos = this._state.todos; + const completed = this._state.todos.filter(t => t.completed); + const active = this._state.todos.filter(t => !t.completed); + switch (this._state.filter) { + case "/active": + todos = active; + break; + case "/completed": + todos = completed; + break; + } + + return [ + ["section#app.todoapp", + ["header.header", + ["h1", "todos"], + ["input.new-todo", + { + placeholder: "What needs to be done?", + autofocus: "autofocus", + value: new String(this._state.todo), + change: this.onInsert + } + ] + ], + this._state.todos.length ? + ["section.main", + ["input#toggle-all.toggle-all", + { + type: "checkbox", + change: this.onCompleteAll + } + ], + ["label", { for: "toggle-all" }, + "Mark all as complete" + ], + ["ul.todo-list", + ...todos.map(t => { + const classes = []; + t.completed && classes.push("completed"); + t.id === this._state.edit && classes.push("editing"); + + return ["li", { _key: t.id, classes: classes }, + ["div.view", + ["input.toggle", + { + type: "checkbox", + data: { id: t.id }, + change: this.onComplete + }, + (e: HTMLInputElement) => e.checked = t.completed + ], + ["label", + { + data: { id: t.id }, + dblclick: this.onEdit + }, + t.title], + ["button.destroy", + { + data: { id: t.id }, + click: this.onDelete + } + ] + ], + ["input.edit", + { + value: new String(t.title), + change: this.onEdited, + blur: this.onEdited + }, + (e: HTMLInputElement) => setTimeout(() => e.select(), 0) + ] + ]; + }) + ] + ] : + "", + this._state.todos.length ? + ["footer.footer", + ["span.todo-count", + ["strong", active.length], + active.length === 1 ? " item left" : " items left" + ], + ["ul.filters", + ["li", + ["a", + { + href: "#/", + classes: this._state.filter === "/" ? ["selected"] : [] + }, + "All" + ] + ], + ["li", + ["a", + { + href: "#/active", + classes: this._state.filter === "/active" ? ["selected"] : [] + }, + "Active" + ] + ], + ["li", + ["a", + { + href: "#/completed", + classes: this._state.filter === "/completed" ? ["selected"] : [] + }, + "Completed" + ] + ] + ], + this._state.todos.filter(t => t.completed).length ? + ["button.clear-completed", { click: this.onClearCompleted }, + "Clear completed" + ] : + "" + ] : + "" + ] + ]; + } + + private onInsert = (e: Event) => { + const title = (e.target as HTMLInputElement).value.trim(); + if (title) { + this.events.emit("insert", title); + } + } + + private onCompleteAll = (e: Event) => { + const complete = (e.target as HTMLInputElement).checked; + this.events.emit("complete-all", complete); + } + + private onComplete = (e: Event) => { + const id = Number((e.target as HTMLElement).dataset.id); + this.events.emit("complete", id); + } + + private onDelete = (e: Event) => { + const id = Number((e.target as HTMLElement).dataset.id); + this.events.emit("delete", id); + } + + private onClearCompleted = (e: Event) => { + this.events.emit("clear-completed"); + } + + private onEdit = (e: Event) => { + const id = Number((e.target as HTMLElement).dataset.id); + this.events.emit("edit", id); + } + + private onEdited = (e: Event) => { + const title = (e.target as HTMLInputElement).value.trim(); + this.events.emit("edited", title); + } + +} diff --git a/examples/prest-lib/tsconfig.json b/examples/prest-lib/tsconfig.json new file mode 100644 index 0000000000..727c06eadf --- /dev/null +++ b/examples/prest-lib/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": [ + "dom", + "es2015", + "es2017.object", + "es2016.array.include" + ], + "module": "umd", + "moduleResolution": "node", + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "strictNullChecks": false, + "declaration": false, + "sourceMap": true, + "inlineSourceMap": false, + "removeComments": true, + "outDir": "build" + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "js" + ] +} diff --git a/examples/prest-lib/tslint.json b/examples/prest-lib/tslint.json new file mode 100644 index 0000000000..8a54876f7f --- /dev/null +++ b/examples/prest-lib/tslint.json @@ -0,0 +1,58 @@ +{ + "rules": { + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "indent": [ + true, + "spaces" + ], + "no-duplicate-variable": true, + "no-eval": true, + "no-internal-module": true, + "no-trailing-whitespace": true, + "no-unsafe-finally": true, + "no-var-keyword": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace" + ], + "quotemark": [ + true, + "double" + ], + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "variable-name": [ + true, + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } +} diff --git a/package-lock.json b/package-lock.json index 9450bbb21a..c11105c3bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1643,9 +1643,9 @@ } }, "cypress": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-1.4.2.tgz", - "integrity": "sha1-2VfWMWF6qH5kp+rnFQLy4XUHZjg=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-2.1.0.tgz", + "integrity": "sha512-EKXGjKFKUkhXXfAkYixBN2Lo2Gji4ZGC+ezWflRf/co49+OyHarZaXp7Y/n826WjmMdpHTmkOw4wUWBgyFHEHQ==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1",