From ed256b297663dcf81e770d7f86dbf398ea3c4964 Mon Sep 17 00:00:00 2001 From: yoavaa Date: Fri, 16 Oct 2020 14:29:28 +0300 Subject: [PATCH 1/6] added stencil implementation for todomvc --- examples/stencil/.gitignore | 28 +++ examples/stencil/package.json | 36 ++++ examples/stencil/readme.md | 29 +++ examples/stencil/src/components.d.ts | 82 +++++++++ .../stencil/src/components/todo/readme.md | 42 +++++ .../src/components/todo/showing-state.ts | 5 + .../src/components/todo/todo-footer.css | 90 +++++++++ .../src/components/todo/todo-footer.tsx | 68 +++++++ .../stencil/src/components/todo/todo-item.css | 140 ++++++++++++++ .../stencil/src/components/todo/todo-item.tsx | 92 ++++++++++ .../stencil/src/components/todo/todo-model.ts | 14 ++ examples/stencil/src/components/todo/todo.css | 127 +++++++++++++ examples/stencil/src/components/todo/todo.tsx | 172 ++++++++++++++++++ examples/stencil/src/index.css | 0 examples/stencil/src/index.html | 72 ++++++++ examples/stencil/src/index.ts | 86 +++++++++ examples/stencil/src/utils/utils.spec.ts | 21 +++ examples/stencil/src/utils/utils.ts | 39 ++++ examples/stencil/stencil.config.ts | 22 +++ examples/stencil/tsconfig.json | 26 +++ 20 files changed, 1191 insertions(+) create mode 100644 examples/stencil/.gitignore create mode 100644 examples/stencil/package.json create mode 100644 examples/stencil/readme.md create mode 100644 examples/stencil/src/components.d.ts create mode 100644 examples/stencil/src/components/todo/readme.md create mode 100644 examples/stencil/src/components/todo/showing-state.ts create mode 100644 examples/stencil/src/components/todo/todo-footer.css create mode 100644 examples/stencil/src/components/todo/todo-footer.tsx create mode 100644 examples/stencil/src/components/todo/todo-item.css create mode 100644 examples/stencil/src/components/todo/todo-item.tsx create mode 100644 examples/stencil/src/components/todo/todo-model.ts create mode 100644 examples/stencil/src/components/todo/todo.css create mode 100644 examples/stencil/src/components/todo/todo.tsx create mode 100644 examples/stencil/src/index.css create mode 100644 examples/stencil/src/index.html create mode 100644 examples/stencil/src/index.ts create mode 100644 examples/stencil/src/utils/utils.spec.ts create mode 100644 examples/stencil/src/utils/utils.ts create mode 100644 examples/stencil/stencil.config.ts create mode 100644 examples/stencil/tsconfig.json diff --git a/examples/stencil/.gitignore b/examples/stencil/.gitignore new file mode 100644 index 0000000000..22f067a86c --- /dev/null +++ b/examples/stencil/.gitignore @@ -0,0 +1,28 @@ +dist/ +www/ +loader/ + +*~ +*.sw[mnpcod] +*.log +*.lock +*.tmp +*.tmp.* +log.txt +*.sublime-project +*.sublime-workspace + +.stencil/ +.idea/ +.vscode/ +.sass-cache/ +.versions/ +node_modules/ +$RECYCLE.BIN/ +package-lock.json + +.DS_Store +Thumbs.db +UserInterfaceState.xcuserstate +.env +*.iml diff --git a/examples/stencil/package.json b/examples/stencil/package.json new file mode 100644 index 0000000000..14f5f9ca48 --- /dev/null +++ b/examples/stencil/package.json @@ -0,0 +1,36 @@ +{ + "name": "todo-mvc-stencil", + "version": "1.0.0", + "description": "Todo MVC implementation using Stencil", + "main": "dist/index.js", + "module": "dist/index.mjs", + "es2015": "dist/esm/index.mjs", + "es2017": "dist/esm/index.mjs", + "types": "dist/types/index.d.ts", + "collection": "dist/collection/collection-manifest.json", + "collection:main": "dist/collection/index.js", + "unpkg": "dist/stencil-comp/stencil-comp.js", + "files": [ + "dist/", + "loader/" + ], + "scripts": { + "build": "stencil build --docs", + "start": "stencil build --dev --watch --serve", + "test": "stencil test --spec --e2e", + "test.watch": "stencil test --spec --e2e --watchAll", + "generate": "stencil generate" + }, + "devDependencies": { + "@stencil/core": "^1.12.2", + "@types/jest": "24.9.1", + "@types/puppeteer": "2.0.1", + "jest": "24.9.0", + "jest-cli": "24.9.0", + "puppeteer": "2.1.1" + }, + "license": "MIT", + "dependencies": { + "classnames": "^2.2.6" + } +} diff --git a/examples/stencil/readme.md b/examples/stencil/readme.md new file mode 100644 index 0000000000..78fdce1de2 --- /dev/null +++ b/examples/stencil/readme.md @@ -0,0 +1,29 @@ +![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square) + +## Stencil TodoMVC Example + +> Stencil is a toolchain for building reusable, scalable Design Systems. Generate small, blazing fast, and 100% standards based Web Components that run in every browser. + +> _[Stencil](https://stenciljs.com/)_ + + +## Learning Stencil + +The [Stencil introduction](https://stenciljs.com/docs/introduction) is a great way to get started. + +Here are some links you may find helpful: + +* [Getting Started](https://stenciljs.com/docs/getting-started) +* [Introduction](https://stenciljs.com/docs/introduction) +* [Component API](https://stenciljs.com/docs/decorators) + + +## Running + +The app is built with [Stencil init component](https://stenciljs.com/docs/getting-started) as a Stencil web component and compiled at built time. + +To run the app: +```bash +npm install +npm start +``` \ No newline at end of file diff --git a/examples/stencil/src/components.d.ts b/examples/stencil/src/components.d.ts new file mode 100644 index 0000000000..3e686cf4b3 --- /dev/null +++ b/examples/stencil/src/components.d.ts @@ -0,0 +1,82 @@ +/* eslint-disable */ +/* tslint:disable */ +/** + * This is an autogenerated file created by the Stencil compiler. + * It contains typing information for all components that exist in this project. + */ +import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; +import { TodoItemModel, TodoModel } from "./components/todo/todo-model"; +export namespace Components { + interface TodoApp { + "model": TodoModel; + } + interface TodoFooter { + "completedCount": number; + "count": number; + "nowShowing": string; + } + interface TodoItem { + "editing": boolean; + "todo": TodoItemModel; + } +} +declare global { + interface HTMLTodoAppElement extends Components.TodoApp, HTMLStencilElement { + } + var HTMLTodoAppElement: { + prototype: HTMLTodoAppElement; + new (): HTMLTodoAppElement; + }; + interface HTMLTodoFooterElement extends Components.TodoFooter, HTMLStencilElement { + } + var HTMLTodoFooterElement: { + prototype: HTMLTodoFooterElement; + new (): HTMLTodoFooterElement; + }; + interface HTMLTodoItemElement extends Components.TodoItem, HTMLStencilElement { + } + var HTMLTodoItemElement: { + prototype: HTMLTodoItemElement; + new (): HTMLTodoItemElement; + }; + interface HTMLElementTagNameMap { + "todo-app": HTMLTodoAppElement; + "todo-footer": HTMLTodoFooterElement; + "todo-item": HTMLTodoItemElement; + } +} +declare namespace LocalJSX { + interface TodoApp { + "model"?: TodoModel; + } + interface TodoFooter { + "completedCount"?: number; + "count"?: number; + "nowShowing"?: string; + "onClearCompleted"?: (event: CustomEvent) => void; + } + interface TodoItem { + "editing"?: boolean; + "onCancel"?: (event: CustomEvent) => void; + "onDestroy"?: (event: CustomEvent) => void; + "onEdit"?: (event: CustomEvent) => void; + "onSave"?: (event: CustomEvent<{todoId: string, text: string}>) => void; + "onToggle"?: (event: CustomEvent) => void; + "todo"?: TodoItemModel; + } + interface IntrinsicElements { + "todo-app": TodoApp; + "todo-footer": TodoFooter; + "todo-item": TodoItem; + } +} +export { LocalJSX as JSX }; +declare module "@stencil/core" { + export namespace JSX { + interface IntrinsicElements { + "todo-app": LocalJSX.TodoApp & JSXBase.HTMLAttributes; + "todo-footer": LocalJSX.TodoFooter & JSXBase.HTMLAttributes; + "todo-item": LocalJSX.TodoItem & JSXBase.HTMLAttributes; + } + } +} diff --git a/examples/stencil/src/components/todo/readme.md b/examples/stencil/src/components/todo/readme.md new file mode 100644 index 0000000000..87792ca7a2 --- /dev/null +++ b/examples/stencil/src/components/todo/readme.md @@ -0,0 +1,42 @@ +# todo-app + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| --------- | --------- | ----------- | --------------- | ----------- | +| `editing` | `editing` | | `boolean` | `undefined` | +| `todo` | -- | | `TodoItemModel` | `undefined` | + + +## Events + +| Event | Description | Type | +| --------- | ----------- | ------------------------------------------------ | +| `cancel` | | `CustomEvent` | +| `destroy` | | `CustomEvent` | +| `edit` | | `CustomEvent` | +| `save` | | `CustomEvent<{ todoId: string; text: string; }>` | +| `toggle` | | `CustomEvent` | + + +## Dependencies + +### Used by + + - [todo-app](.) + +### Graph +```mermaid +graph TD; + todo-app --> todo-item + style todo-item fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/examples/stencil/src/components/todo/showing-state.ts b/examples/stencil/src/components/todo/showing-state.ts new file mode 100644 index 0000000000..34fa29a512 --- /dev/null +++ b/examples/stencil/src/components/todo/showing-state.ts @@ -0,0 +1,5 @@ +export const ALL_TODOS = 'all'; +export const ACTIVE_TODOS = 'active'; +export const COMPLETED_TODOS = 'completed'; + +export type ShowingState = 'all' | 'active' | 'completed'; diff --git a/examples/stencil/src/components/todo/todo-footer.css b/examples/stencil/src/components/todo/todo-footer.css new file mode 100644 index 0000000000..6d52e8d7f3 --- /dev/null +++ b/examples/stencil/src/components/todo/todo-footer.css @@ -0,0 +1,90 @@ +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; +} + +.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; +} diff --git a/examples/stencil/src/components/todo/todo-footer.tsx b/examples/stencil/src/components/todo/todo-footer.tsx new file mode 100644 index 0000000000..c7edb24906 --- /dev/null +++ b/examples/stencil/src/components/todo/todo-footer.tsx @@ -0,0 +1,68 @@ +import {Component, Prop, h, Event, EventEmitter} from '@stencil/core'; +import {pluralize} from '../../utils/utils'; +import {ALL_TODOS, ACTIVE_TODOS, COMPLETED_TODOS} from './showing-state'; +import classNames from 'classnames'; + +@Component({ + tag: 'todo-footer', + styleUrl: 'todo-footer.css', + shadow: true +}) +export class TodoFooter { + + @Prop() count: number; + @Prop() completedCount: number; + @Prop() nowShowing: string; + @Event() clearCompleted: EventEmitter; + + render() { + let activeTodoWord = pluralize(this.count, 'item'); + let clearButton = null; + + if (this.completedCount > 0) { + clearButton = ( + + ); + } + + let nowShowing = this.nowShowing; + return ( + + ); + } + +} diff --git a/examples/stencil/src/components/todo/todo-item.css b/examples/stencil/src/components/todo/todo-item.css new file mode 100644 index 0000000000..82ed0138f8 --- /dev/null +++ b/examples/stencil/src/components/todo/todo-item.css @@ -0,0 +1,140 @@ +li { + position: relative; + font-size: 24px; + border-bottom: 1px solid #ededed; +} + +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; +} + +:focus { + outline: 0; +} + +.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; +} + + +/*li:last-child {*/ + /*border-bottom: none;*/ +/*}*/ + +li.completed label { + color: #d9d9d9; + text-decoration: line-through; +} + +li.editing { + border-bottom: none; + padding: 0; +} + +li.editing .edit { + display: block; + width: calc(100% - 43px); + padding: 12px 16px; + margin: 0 0 0 43px; +} + +li.editing .view { + display: none; +} + +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; +} + +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; +} + +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'); +} + +li label { + word-break: break-all; + padding: 15px 15px 15px 60px; + display: block; + line-height: 1.2; + transition: color 0.4s; +} + +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; +} + +li .destroy:hover { + color: #af5b5e; +} + +li .destroy:after { + content: '×'; +} + +li:hover .destroy { + display: block; +} + +li .edit { + display: none; +} + +li.editing:last-child { + margin-bottom: -1px; +} diff --git a/examples/stencil/src/components/todo/todo-item.tsx b/examples/stencil/src/components/todo/todo-item.tsx new file mode 100644 index 0000000000..90f7889fd4 --- /dev/null +++ b/examples/stencil/src/components/todo/todo-item.tsx @@ -0,0 +1,92 @@ +import {Component, Prop, h, State, Event, EventEmitter} from '@stencil/core'; +import {TodoItemModel} from "./todo-model"; +import classNames from 'classnames'; + +const ESCAPE_KEY = 27; +const ENTER_KEY = 13; + + +@Component({ + tag: 'todo-item', + styleUrl: 'todo-item.css', + shadow: true +}) +export class TodoItem { + @Prop() todo: TodoItemModel; + @Prop() editing: boolean; + @State() editText: string; + @Event() toggle: EventEmitter; + @Event() destroy: EventEmitter; + @Event() edit: EventEmitter; + @Event() save: EventEmitter<{todoId: string, text: string}>; + @Event() cancel: EventEmitter; + + handleSubmit() { + let text = this.editText.trim(); + if (text && this.editing) { + this.save.emit({todoId: this.todo.id, text}); + this.editText = text; + } else { + this.destroy.emit(); + } + } + + handleChange(event) { + if (this.editing) { + this.editText = event.target.value; + } + } + + handleKeyDown(event: KeyboardEvent) { + if (event.which === ESCAPE_KEY) { + this.editText = this.todo.title; + this.cancel.emit(); + } else if (event.which === ENTER_KEY) { + this.handleSubmit(); + } + } + + + onToggle() { + this.toggle.emit(this.todo.id); + } + + handleEdit() { + this.edit.emit(this.todo.id); + this.editText = this.todo.title; + } + + onDestroy() { + this.destroy.emit(this.todo.id); + } + + render() { + return ( +
  • +
    + this.onToggle()} + /> + +
    + this.handleSubmit()} + onInput={ev => this.handleChange(ev)} + onKeyDown={ev => this.handleKeyDown(ev)} + /> +
  • + ); + } + +} diff --git a/examples/stencil/src/components/todo/todo-model.ts b/examples/stencil/src/components/todo/todo-model.ts new file mode 100644 index 0000000000..c6de891dd3 --- /dev/null +++ b/examples/stencil/src/components/todo/todo-model.ts @@ -0,0 +1,14 @@ + +export interface TodoItemModel { + id: string, title: string, completed: boolean +} + +export interface TodoModel { + addTodo(val: string) + todos: Array + toggle(todoId: string) + destroy(todoId: string) + save(todoId: string, text: string) + toggleAll(checked: boolean) + clearCompleted() +} diff --git a/examples/stencil/src/components/todo/todo.css b/examples/stencil/src/components/todo/todo.css new file mode 100644 index 0000000000..4a19612db2 --- /dev/null +++ b/examples/stencil/src/components/todo/todo.css @@ -0,0 +1,127 @@ +:focus { + outline: 0; +} + +.main { + position: relative; + z-index: 2; + border-top: 1px solid #e6e6e6; +} + +.todoapp { + 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; +} + +.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; + margin-block-start: 0.83em; + margin-block-end: 0.83em; +} + + + +.new-todo, +.edit { + position: relative; + margin: 0; + width: 100%; + font-size: 24px; + font-family: inherit; + font-weight: inherit; + line-height: 1.4em; + 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); +} + +.todo-list { + margin: 0; + padding: 0; + list-style: none; +} + +.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: -53px; + 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; +} diff --git a/examples/stencil/src/components/todo/todo.tsx b/examples/stencil/src/components/todo/todo.tsx new file mode 100644 index 0000000000..7ef6723657 --- /dev/null +++ b/examples/stencil/src/components/todo/todo.tsx @@ -0,0 +1,172 @@ +import { Component, Prop, h, State } from '@stencil/core'; +import {TodoModel} from './todo-model'; +import {ACTIVE_TODOS, COMPLETED_TODOS, ALL_TODOS, ShowingState} from './showing-state'; + +const ENTER_KEY = 13; + +@Component({ + tag: 'todo-app', + styleUrl: 'todo.css', + shadow: true +}) +export class Todo { + + @State() newTodo: string; + @State() editing: string; + @State() nowShowing: ShowingState = ALL_TODOS; + @Prop() model: TodoModel; + + handleNewTodoKeyDown (event: KeyboardEvent) { + if (event.keyCode !== ENTER_KEY) { + return; + } + event.preventDefault(); + + let val = this.newTodo.trim(); + if (val) { + this.model.addTodo(val); + this.newTodo = ''; + } + } + + toggle (todoId) { + this.model.toggle(todoId); + } + + destroy(todoId) { + this.model.destroy(todoId); + } + + edit(todoId) { + this.editing = todoId; + } + + save(todoId, text) { + this.model.save(todoId, text); + this.editing = null; + } + + cancel() { + this.editing = null; + } + + + handleChange (event) { + this.newTodo = event.target.value; + } + + clearCompleted() { + this.model.clearCompleted(); + } + + toggleAll(event) { + let checked = event.target.checked; + this.model.toggleAll(checked); + } + + // noinspection JSMethodCanBeStatic + componentWillLoad() { + window.addEventListener("hashchange", (ev) => { + let newURL = ev.newURL; + let tokens = newURL.split('#'); + let hash = tokens.length > 1?tokens[1]:'/all'; + switch (hash) { + case '/active': this.nowShowing = ACTIVE_TODOS; break; + case '/completed': this.nowShowing = COMPLETED_TODOS; break; + default: this.nowShowing = ALL_TODOS; + } + }, false); + } + + render() { + let main, footer; + + if (!this.model) + return
    todo-app web component requires a model
    ; + + let todos = this.model.todos; + + let shownTodos = todos.filter(function (todo) { + switch (this.nowShowing) { + case ACTIVE_TODOS: + return !todo.completed; + case COMPLETED_TODOS: + return todo.completed; + default: + return true; + } + }, this); + + let todoItems = shownTodos.map(function (todo) { + return ( + this.toggle(ev.detail)} + onDestroy={ev => this.destroy(ev.detail)} + onEdit={ev => this.edit(ev.detail)} + editing={this.editing === todo.id} + onSave={ev => this.save(ev.detail.todoId, ev.detail.text)} + onCancel={_ => this.cancel()} + /> + ); + }, this); + + let activeTodoCount = todos.reduce(function (accum, todo) { + return todo.completed ? accum : accum + 1; + }, 0); + + let completedCount = todos.length - activeTodoCount; + + if (activeTodoCount || completedCount) { + footer = + this.clearCompleted()} + />; + } + + + if (todos.length) { + main = ( +
    + this.toggleAll(ev)} + checked={activeTodoCount === 0} + /> +
    + ); + } + + + return
    +
    +
    +

    todos

    + this.handleNewTodoKeyDown(event)} + onInput={(event: UIEvent) => this.handleChange(event)} + autoFocus={true} + /> +
    + {main} + {footer} +
    +
    + + } +} diff --git a/examples/stencil/src/index.css b/examples/stencil/src/index.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/stencil/src/index.html b/examples/stencil/src/index.html new file mode 100644 index 0000000000..be2955a5bf --- /dev/null +++ b/examples/stencil/src/index.html @@ -0,0 +1,72 @@ + + + + + + Stencil Component Starter + + + + + + + + + +
    +

    Double-click to edit a todo

    +

    Created by yoavaa

    +

    Part of TodoMVC

    +
    + + + diff --git a/examples/stencil/src/index.ts b/examples/stencil/src/index.ts new file mode 100644 index 0000000000..0287872d0d --- /dev/null +++ b/examples/stencil/src/index.ts @@ -0,0 +1,86 @@ +import {TodoItemModel, TodoModel} from "./components/todo/todo-model"; + +export * from './components'; +import {store, uuid} from './utils/utils'; + + +export class TodoModelImpl implements TodoModel { + + key: string; + todos: Array; + onChanges: Array; + + constructor(key: string) { + this.key = key; + this.todos = store(key); + this.onChanges = []; + } + + subscribe(onChange) { + this.onChanges.push(onChange); + } + + inform() { + store(this.key, this.todos); + this.onChanges.forEach(function (cb) { cb(); }); + }; + + addTodo(title) { + this.todos = this.todos.concat({ + id: uuid(), + title: title, + completed: false + }); + + this.inform(); + }; + + toggleAll(checked) { + // Note: it's usually better to use immutable data structures since they're + // easier to reason about and React works very well with them. That's why + // we use map() and filter() everywhere instead of mutating the array or + // todo items themselves. + this.todos = this.todos.map(function (todo) { + return {...todo, ...{completed: checked}}; + }); + + this.inform(); + }; + + toggle(todoId) { + this.todos = this.todos.map(function (todo) { + return todo.id !== todoId ? + todo : {...todo, ...{completed: !todo.completed}}; + }); + + this.inform(); + }; + + destroy(todoId) { + this.todos = this.todos.filter(function (candidate) { + return candidate.id !== todoId; + }); + + this.inform(); + }; + + save(todoId, text) { + this.todos = this.todos.map(function (todo) { + return todo.id !== todoId ? todo : {...todo, ...{title: text}}; + }); + + this.inform(); + }; + + clearCompleted() { + this.todos = this.todos.filter(function (todo) { + return !todo.completed; + }); + + this.inform(); + }; + +} + + + diff --git a/examples/stencil/src/utils/utils.spec.ts b/examples/stencil/src/utils/utils.spec.ts new file mode 100644 index 0000000000..77ef54a21c --- /dev/null +++ b/examples/stencil/src/utils/utils.spec.ts @@ -0,0 +1,21 @@ +import { format } from './utils'; + +describe('format', () => { + it('returns empty string for no names defined', () => { + expect(format(undefined, undefined, undefined)).toEqual(''); + }); + + it('formats just first names', () => { + expect(format('Joseph', undefined, undefined)).toEqual('Joseph'); + }); + + it('formats first and last names', () => { + expect(format('Joseph', undefined, 'Publique')).toEqual('Joseph Publique'); + }); + + it('formats first, middle and last names', () => { + expect(format('Joseph', 'Quincy', 'Publique')).toEqual( + 'Joseph Quincy Publique' + ); + }); +}); diff --git a/examples/stencil/src/utils/utils.ts b/examples/stencil/src/utils/utils.ts new file mode 100644 index 0000000000..d78048259f --- /dev/null +++ b/examples/stencil/src/utils/utils.ts @@ -0,0 +1,39 @@ + +export function format(first: string, middle: string, last: string): string { + return ( + (first || '') + + (middle ? ` ${middle}` : '') + + (last ? ` ${last}` : '') + ); +} + +export function pluralize(count: number, word: string) { + return count === 1 ? word : word + 's'; +} + +export function store(namespace: string, data?: any) { + if (data) { + return localStorage.setItem(namespace, JSON.stringify(data)); + } + + let store = localStorage.getItem(namespace); + return (store && JSON.parse(store)) || []; +} + +export function uuid(): string { + /*jshint bitwise:false */ + let i, random; + let uuid = ''; + + for (i = 0; i < 32; i++) { + random = Math.random() * 16 | 0; + if (i === 8 || i === 12 || i === 16 || i === 20) { + uuid += '-'; + } + uuid += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)) + .toString(16); + } + + return uuid; +} + diff --git a/examples/stencil/stencil.config.ts b/examples/stencil/stencil.config.ts new file mode 100644 index 0000000000..8bd14c575b --- /dev/null +++ b/examples/stencil/stencil.config.ts @@ -0,0 +1,22 @@ +import { Config } from '@stencil/core'; + +export const config: Config = { + namespace: 'stencil-comp', + taskQueue: 'async', + outputTargets: [ + { + type: 'dist', + esmLoaderPath: '../loader' + }, + { + type: 'docs-readme' + }, + { + type: 'dist-custom-elements-bundle' + }, + { + type: 'www', + serviceWorker: null // disable service workers + } + ] +}; diff --git a/examples/stencil/tsconfig.json b/examples/stencil/tsconfig.json new file mode 100644 index 0000000000..fb9308c6f5 --- /dev/null +++ b/examples/stencil/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "allowUnreachableCode": false, + "declaration": false, + "experimentalDecorators": true, + "lib": [ + "dom", + "es2017" + ], + "moduleResolution": "node", + "module": "esnext", + "target": "es2017", + "noUnusedLocals": false, + "noUnusedParameters": true, + "jsx": "react", + "jsxFactory": "h" + }, + "include": [ + "src", + "types/jsx.d.ts" + ], + "exclude": [ + "node_modules" + ] +} From 8a64cb1db792292eae0b720b5ea54b12d34d093a Mon Sep 17 00:00:00 2001 From: yoavaa Date: Fri, 16 Oct 2020 14:30:42 +0300 Subject: [PATCH 2/6] updated generated readme --- examples/stencil/src/components/todo/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/stencil/src/components/todo/readme.md b/examples/stencil/src/components/todo/readme.md index 87792ca7a2..0fb5c9796f 100644 --- a/examples/stencil/src/components/todo/readme.md +++ b/examples/stencil/src/components/todo/readme.md @@ -19,7 +19,7 @@ | --------- | ----------- | ------------------------------------------------ | | `cancel` | | `CustomEvent` | | `destroy` | | `CustomEvent` | -| `edit` | | `CustomEvent` | +| `edit` | | `CustomEvent` | | `save` | | `CustomEvent<{ todoId: string; text: string; }>` | | `toggle` | | `CustomEvent` | From 964ba1163657f95c485c54d1ffd456d9d6d1194d Mon Sep 17 00:00:00 2001 From: yoavaa Date: Fri, 16 Oct 2020 15:19:26 +0300 Subject: [PATCH 3/6] multiple fixes to make the static example work and cleanup --- examples/stencil/.editorconfig | 15 ++++++++ examples/stencil/package.json | 3 +- examples/stencil/src/index.css | 36 ++++++++++++++++++ examples/stencil/src/index.html | 67 ++++++++------------------------- 4 files changed, 69 insertions(+), 52 deletions(-) create mode 100644 examples/stencil/.editorconfig diff --git a/examples/stencil/.editorconfig b/examples/stencil/.editorconfig new file mode 100644 index 0000000000..f1cc3ad329 --- /dev/null +++ b/examples/stencil/.editorconfig @@ -0,0 +1,15 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/examples/stencil/package.json b/examples/stencil/package.json index 14f5f9ca48..70b287534e 100644 --- a/examples/stencil/package.json +++ b/examples/stencil/package.json @@ -31,6 +31,7 @@ }, "license": "MIT", "dependencies": { - "classnames": "^2.2.6" + "classnames": "^2.2.6", + "todomvc-common": "^1.0.5" } } diff --git a/examples/stencil/src/index.css b/examples/stencil/src/index.css index e69de29bb2..934f92b1a1 100644 --- a/examples/stencil/src/index.css +++ b/examples/stencil/src/index.css @@ -0,0 +1,36 @@ +body { + margin: 0; + padding: 0; +} + +body { + background: #f5f5f5; + color: #4d4d4d; + min-width: 230px; + max-width: 550px; + margin: 0 auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.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; +} diff --git a/examples/stencil/src/index.html b/examples/stencil/src/index.html index be2955a5bf..d6b1b10a1d 100644 --- a/examples/stencil/src/index.html +++ b/examples/stencil/src/index.html @@ -5,11 +5,24 @@ Stencil Component Starter - - + + + + + + + + + + +
    +

    Double-click to edit a todo

    +

    Created by yoavaa

    +

    Part of TodoMVC

    +
    + - - - - - -
    -

    Double-click to edit a todo

    -

    Created by yoavaa

    -

    Part of TodoMVC

    -
    - From 3d17d61a5094a04fb9a70b63173a3feff11993e9 Mon Sep 17 00:00:00 2001 From: yoavaa Date: Fri, 16 Oct 2020 15:56:16 +0300 Subject: [PATCH 4/6] added the aside component for stencil --- examples/stencil/src/index.css | 4 ++++ examples/stencil/src/index.html | 2 +- learn.json | 40 ++++++++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/examples/stencil/src/index.css b/examples/stencil/src/index.css index 934f92b1a1..b660edf349 100644 --- a/examples/stencil/src/index.css +++ b/examples/stencil/src/index.css @@ -1,9 +1,12 @@ +html, body { margin: 0; padding: 0; } body { + font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif; + line-height: 1.4em; background: #f5f5f5; color: #4d4d4d; min-width: 230px; @@ -11,6 +14,7 @@ body { margin: 0 auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + font-weight: 300; } .info { diff --git a/examples/stencil/src/index.html b/examples/stencil/src/index.html index d6b1b10a1d..73fc4553b9 100644 --- a/examples/stencil/src/index.html +++ b/examples/stencil/src/index.html @@ -1,5 +1,5 @@ - + diff --git a/learn.json b/learn.json index aa64509afe..81dba3f5b2 100644 --- a/learn.json +++ b/learn.json @@ -1932,7 +1932,45 @@ }] }] }, - "templates": { + "stencil": { + "name": "Stencil", + "description": "Stencil is a toolchain for building reusable, scalable Design Systems. Generate small, blazing fast, and 100% standards based Web Components that run in every browser.", + "homepage": "https://stenciljs.com/", + "examples": [{ + "name": "Example", + "url": "examples/stencil" + }], + "link_groups": [{ + "heading": "Official Resources", + "links": [{ + "name": "Getting Started", + "url": "https://stenciljs.com/docs/getting-started" + }, { + "name": "Introduction", + "url": "https://stenciljs.com/docs/introduction" + }, { + "name": "Component API", + "url": "https://stenciljs.com/docs/decorators" + }, { + "name": "Resources Page", + "url": "https://stenciljs.com/resources" + }] + }, { + "heading": "Community", + "links": [{ + "name": "Stencil on Stack Overflow", + "url": "https://stackoverflow.com/questions/tagged/stenciljs" + }, { + "name": "Slack", + "url": "https://stencil-worldwide.herokuapp.com/" + }, { + "name": "Twitter", + "url": "https://twitter.com/stenciljs" + }] + }] + }, + + "templates": { "todomvc": "

    <%= name %>

    <% if (typeof examples !== 'undefined') { %> <% examples.forEach(function (example) { %>
    <%= example.name %>
    <% if (!location.href.match(example.url + '/')) { %> \" href=\"<%= example.url %>\">Demo, <% } if (example.type === 'backend') { %>\"><% } else { %>\"><% } %>Source <% }); %> <% } %>

    <%= description %>

    <% if (typeof link_groups !== 'undefined') { %>
    <% link_groups.forEach(function (link_group) { %>

    <%= link_group.heading %>

    <% }); %> <% } %>

    If you have other helpful links to share, or find any of the links above no longer work, please let us know.
    ", "todomvc-home": "

    <%= name %>

    <% if (typeof examples !== 'undefined') { %> <% examples.forEach(function (example) { %>
    <%= example.name %>
    <% if (!location.href.match(example.url + '/')) { %> \" href=\"<%= example.url %>\">Demo, <% } if (example.type === 'backend') { %>\"><% } else { %>\"><% } %>Source <% }); %> <% } %>

    <%= description %>

    <% if (typeof link_groups !== 'undefined') { %>
    <% link_groups.forEach(function (link_group) { %>

    <%= link_group.heading %>

    <% }); %> <% } %>" } From cee70601f0d8ad31e754cfdac42af613210064c7 Mon Sep 17 00:00:00 2001 From: yoavaa Date: Fri, 16 Oct 2020 16:02:10 +0300 Subject: [PATCH 5/6] added www folder to git --- examples/stencil/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/stencil/.gitignore b/examples/stencil/.gitignore index 22f067a86c..9c58f0b42a 100644 --- a/examples/stencil/.gitignore +++ b/examples/stencil/.gitignore @@ -1,5 +1,4 @@ dist/ -www/ loader/ *~ From 41a39ad2892024761a4966b50966f511c5e67e5c Mon Sep 17 00:00:00 2001 From: yoavaa Date: Fri, 16 Oct 2020 16:19:54 +0300 Subject: [PATCH 6/6] added stencil generated www folder to display the result application --- examples/stencil/www/build/index.esm.js | 1 + .../stencil/www/build/p-03188b5b.system.js | 1 + examples/stencil/www/build/p-052c23d4.js | 1 + .../stencil/www/build/p-0b8ecd50.system.js | 21 +++ .../stencil/www/build/p-24afcbad.system.js | 1 + examples/stencil/www/build/p-24fc4ba9.js | 1 + examples/stencil/www/build/p-46109683.js | 19 +++ examples/stencil/www/build/p-537d9519.js | 1 + .../stencil/www/build/p-643ed5c5.system.js | 1 + .../stencil/www/build/p-7f0a8d9c.system.js | 13 ++ examples/stencil/www/build/p-8cf04e16.js | 1 + .../www/build/p-8dca6b42.system.entry.js | 7 + .../stencil/www/build/p-ad9d11e3.system.js | 1 + .../stencil/www/build/p-ca8086a1.entry.js | 7 + .../stencil/www/build/p-cb84036f.system.js | 1 + examples/stencil/www/build/p-ebb4d602.js | 12 ++ .../stencil/www/build/p-eed6be7f.system.js | 1 + .../stencil/www/build/stencil-comp.esm.js | 1 + examples/stencil/www/build/stencil-comp.js | 132 ++++++++++++++++++ examples/stencil/www/host.config.json | 15 ++ examples/stencil/www/index.html | 28 ++++ 21 files changed, 266 insertions(+) create mode 100644 examples/stencil/www/build/index.esm.js create mode 100644 examples/stencil/www/build/p-03188b5b.system.js create mode 100644 examples/stencil/www/build/p-052c23d4.js create mode 100644 examples/stencil/www/build/p-0b8ecd50.system.js create mode 100644 examples/stencil/www/build/p-24afcbad.system.js create mode 100644 examples/stencil/www/build/p-24fc4ba9.js create mode 100644 examples/stencil/www/build/p-46109683.js create mode 100644 examples/stencil/www/build/p-537d9519.js create mode 100644 examples/stencil/www/build/p-643ed5c5.system.js create mode 100644 examples/stencil/www/build/p-7f0a8d9c.system.js create mode 100644 examples/stencil/www/build/p-8cf04e16.js create mode 100644 examples/stencil/www/build/p-8dca6b42.system.entry.js create mode 100644 examples/stencil/www/build/p-ad9d11e3.system.js create mode 100644 examples/stencil/www/build/p-ca8086a1.entry.js create mode 100644 examples/stencil/www/build/p-cb84036f.system.js create mode 100644 examples/stencil/www/build/p-ebb4d602.js create mode 100644 examples/stencil/www/build/p-eed6be7f.system.js create mode 100644 examples/stencil/www/build/stencil-comp.esm.js create mode 100644 examples/stencil/www/build/stencil-comp.js create mode 100644 examples/stencil/www/host.config.json create mode 100644 examples/stencil/www/index.html diff --git a/examples/stencil/www/build/index.esm.js b/examples/stencil/www/build/index.esm.js new file mode 100644 index 0000000000..6cd9f15283 --- /dev/null +++ b/examples/stencil/www/build/index.esm.js @@ -0,0 +1 @@ +import{s as t,u as i}from"./p-052c23d4.js";class s{constructor(i){this.key=i,this.todos=t(i),this.onChanges=[]}subscribe(t){this.onChanges.push(t)}inform(){t(this.key,this.todos),this.onChanges.forEach((function(t){t()}))}addTodo(t){this.todos=this.todos.concat({id:i(),title:t,completed:!1}),this.inform()}toggleAll(t){this.todos=this.todos.map((function(i){return Object.assign(Object.assign({},i),{completed:t})})),this.inform()}toggle(t){this.todos=this.todos.map((function(i){return i.id!==t?i:Object.assign(Object.assign({},i),{completed:!i.completed})})),this.inform()}destroy(t){this.todos=this.todos.filter((function(i){return i.id!==t})),this.inform()}save(t,i){this.todos=this.todos.map((function(s){return s.id!==t?s:Object.assign(Object.assign({},s),{title:i})})),this.inform()}clearCompleted(){this.todos=this.todos.filter((function(t){return!t.completed})),this.inform()}}export{s as TodoModelImpl} \ No newline at end of file diff --git a/examples/stencil/www/build/p-03188b5b.system.js b/examples/stencil/www/build/p-03188b5b.system.js new file mode 100644 index 0000000000..bb9bb5a273 --- /dev/null +++ b/examples/stencil/www/build/p-03188b5b.system.js @@ -0,0 +1 @@ +System.register([],(function(){"use strict";return{execute:function(){var t=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function e(t){return s(n(t=r(t)),t)}function r(t){return t.replace(c.comments,"").replace(c.port,"")}function n(e){var r=new t;r.start=0,r.end=e.length;for(var n=r,s=0,i=e.length;s0?o.join(",").trim():void 0}}function E(t,e,r){var n=b(t,r);if(!n)return e.push(t.substring(r,t.length)),t.length;var s=n.propName,i=null!=n.fallback?C(n.fallback):void 0;return e.push(t.substring(r,n.start),(function(t){return y(t,s,i)})),n.end}function x(t,e){for(var r="",n=0;n0&&t.parsedSelector.split(",").forEach((function(t){t=t.trim(),r.push({selector:t,declarations:n,specificity:k(),nu:e})})),e++})),r}function k(t){return 1}var A="!important",L=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function _(t){for(var e,r=[];e=L.exec(t.trim());){var n=O(e[2]),s=n.value,i=n.important;r.push({prop:e[1].trim(),value:C(s),important:i})}return r}function O(t){var e=(t=t.replace(/\s+/gim," ").trim()).endsWith(A);return e&&(t=t.substr(0,t.length-A.length).trim()),{value:t,important:e}}function T(t,e,r){var n=[],s=U(e,t);return r.forEach((function(t){return n.push(t)})),s.forEach((function(t){return n.push(t)})),j(N(n).filter((function(e){return $(t,e.selector)})))}function U(t,e){for(var r=[];e;){var n=t.get(e);n&&r.push(n),e=e.parentElement}return r}function N(t){var e=[];return t.forEach((function(t){e.push.apply(e,t.selectors)})),e}function j(t){return t.sort((function(t,e){return t.specificity===e.specificity?t.nu-e.nu:t.specificity-e.specificity})),t}function $(t,e){return":root"===e||"html"===e||t.matches(e)}function G(t){var r=e(t),n=C(t);return{original:t,template:n,selectors:R(r),usesCssVars:n.length>1}}function H(t,e){if(t.some((function(t){return t.styleEl===e})))return!1;var r=G(e.textContent);return r.styleEl=e,t.push(r),!0}function P(t){var e=I(N(t));t.forEach((function(t){t.usesCssVars&&(t.styleEl.textContent=x(t.template,e))}))}function V(t,e){var r=t.template.map((function(r){return"string"==typeof r?Y(r,t.scopeId,e):r})),n=t.selectors.map((function(r){return Object.assign(Object.assign({},r),{selector:Y(r.selector,t.scopeId,e)})}));return Object.assign(Object.assign({},t),{template:r,selectors:n,scopeId:e})}function Y(t,e,r){return t=q(t,"\\."+e,"."+r)}function q(t,e,r){return t.replace(new RegExp(e,"g"),r)}function F(t,e){return D(t,e),W(t,e).then((function(){P(e)}))}function B(t,e){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){D(t,e)&&P(e)})).observe(document.head,{childList:!0})}function W(t,e){for(var r=[],n=t.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s-1||X.test(t)}var Z=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function J(t){return Z.lastIndex=0,Z.test(t)}function Q(t,e){var r=e.replace(/[^/]*$/,"");return t.replace(Z,(function(t,e){var n=r+e;return t.replace(e,n)}))}var tt=function(){function t(t,e){this.win=t,this.doc=e,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return t.prototype.i=function(){var t=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(e){t.win.requestAnimationFrame((function(){B(t.doc,t.globalScopes),F(t.doc,t.globalScopes).then((function(){return e()}))}))})))},t.prototype.addLink=function(t){var e=this;return K(this.doc,this.globalScopes,t).then((function(){e.updateGlobal()}))},t.prototype.addGlobalStyle=function(t){H(this.globalScopes,t)&&this.updateGlobal()},t.prototype.createHostStyle=function(t,e,r,n){if(this.hostScopeMap.has(t))throw new Error("host style already created");var s=this.registerHostTemplate(r,e,n),i=this.doc.createElement("style");return i.setAttribute("data-no-shim",""),s.usesCssVars?n?(i["s-sc"]=e=s.scopeId+"-"+this.count,i.textContent="/*needs update*/",this.hostStyleMap.set(t,i),this.hostScopeMap.set(t,V(s,e)),this.count++):(s.styleEl=i,s.usesCssVars||(i.textContent=x(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(t,s)):i.textContent=r,i},t.prototype.removeHost=function(t){var e=this.hostStyleMap.get(t);e&&e.remove(),this.hostStyleMap.delete(t),this.hostScopeMap.delete(t)},t.prototype.updateHost=function(t){var e=this.hostScopeMap.get(t);if(e&&e.usesCssVars&&e.isScoped){var r=this.hostStyleMap.get(t);if(r){var n=I(T(t,this.hostScopeMap,this.globalScopes));r.textContent=x(e.template,n)}}},t.prototype.updateGlobal=function(){P(this.globalScopes)},t.prototype.registerHostTemplate=function(t,e,r){var n=this.scopesMap.get(e);return n||((n=G(t)).scopeId=e,n.isScoped=r,this.scopesMap.set(e,n)),n},t}();!function(t){!t||t.__cssshim||t.CSS&&t.CSS.supports&&t.CSS.supports("color","var(--c)")||(t.__cssshim=new tt(t,t.document))}("undefined"!=typeof window&&window)}}})); \ No newline at end of file diff --git a/examples/stencil/www/build/p-052c23d4.js b/examples/stencil/www/build/p-052c23d4.js new file mode 100644 index 0000000000..1e1e1eb3d5 --- /dev/null +++ b/examples/stencil/www/build/p-052c23d4.js @@ -0,0 +1 @@ +function t(t,r){return 1===t?r:r+"s"}function r(t,r){if(r)return localStorage.setItem(t,JSON.stringify(r));let n=localStorage.getItem(t);return n&&JSON.parse(n)||[]}function n(){let t,r,n="";for(t=0;t<32;t++)r=16*Math.random()|0,8!==t&&12!==t&&16!==t&&20!==t||(n+="-"),n+=(12===t?4:16===t?3&r|8:r).toString(16);return n}export{t as p,r as s,n as u} \ No newline at end of file diff --git a/examples/stencil/www/build/p-0b8ecd50.system.js b/examples/stencil/www/build/p-0b8ecd50.system.js new file mode 100644 index 0000000000..83534c16a9 --- /dev/null +++ b/examples/stencil/www/build/p-0b8ecd50.system.js @@ -0,0 +1,21 @@ +System.register([],(function(){"use strict";return{execute:function(){(function(){var t=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function e(e){var n=t.has(e);e=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(e);return!n&&e}function n(t){var e=t.isConnected;if(void 0!==e)return e;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function o(t,e){for(;e&&e!==t&&!e.nextSibling;)e=e.parentNode;return e&&e!==t?e.nextSibling:null}function i(t,e,n){n=void 0===n?new Set:n;for(var r=t;r;){if(r.nodeType===Node.ELEMENT_NODE){var a=r;e(a);var c=a.localName;if("link"===c&&"import"===a.getAttribute("rel")){r=a.import;if(r instanceof Node&&!n.has(r))for(n.add(r),r=r.firstChild;r;r=r.nextSibling)i(r,e,n);r=o(t,a);continue}else if("template"===c){r=o(t,a);continue}if(a=a.__CE_shadowRoot)for(a=a.firstChild;a;a=a.nextSibling)i(a,e,n)}r=r.firstChild?r.firstChild:o(t,r)}}function r(t,e,n){t[e]=n}function a(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1}function c(t,e,n){t.a.set(e,n);t.g.set(n.constructorFunction,n)}function l(t,e){t.b=!0;t.c.push(e)}function s(t,e){t.b=!0;t.f.push(e)}function u(t,e){t.b&&i(e,(function(e){return f(t,e)}))}function f(t,e){if(t.b&&!e.__CE_patched){e.__CE_patched=!0;for(var n=0;n0?t.setAttribute("class",e.join(" ")):t.removeAttribute("class")}return""===e[0]&&e.splice(0,1),e.toggle=function(t,o){void 0!==o?o?e.add(t):e.remove(t):-1!==e.indexOf(t)?e.splice(e.indexOf(t),1):e.push(t),n()},e.add=function(){for(var t=[].slice.call(arguments),o=0,i=t.length;o0?o.join(",").trim():void 0}}(n,r);if(!i)return t.push(n.substring(r,n.length)),n.length;var u=i.propName,e=null!=i.fallback?d(i.fallback):void 0;return t.push(n.substring(r,i.start),(function(n){return function(n,t,r){return n[t]?n[t]:r?m(r,n):""}(n,u,e)})),i.end}function m(n,t){for(var r="",i=0;i0&&n.parsedSelector.split(",").forEach((function(n){n=n.trim(),i.push({selector:n,declarations:t,specificity:1,nu:r})})),r++})),i}var w=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function b(n){var t=(n=n.replace(/\s+/gim," ").trim()).endsWith("!important");return t&&(n=n.substr(0,n.length-10).trim()),{value:n,important:t}}function E(n){var t=[];return n.forEach((function(n){t.push.apply(t,n.selectors)})),t}function k(s){var a=function(s){return function n(r,i){var s=i.substring(r.start,r.end-1);if(r.parsedCssText=r.cssText=s.trim(),r.parent){s=(s=(s=function(n){return n.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var n=arguments[1],t=6-n.length;t--;)n="0"+n;return"\\"+n}))}(s=i.substring(r.previous?r.previous.end:r.parent.start,r.start-1))).replace(u.multipleSpaces," ")).substring(s.lastIndexOf(";")+1);var a=r.parsedSelector=r.selector=s.trim();r.atRule=0===a.indexOf(f),r.atRule?0===a.indexOf(o)?r.type=t.MEDIA_RULE:a.match(u.keyframesRule)&&(r.type=t.KEYFRAMES_RULE,r.keyframesName=r.selector.split(u.multipleSpaces).pop()):r.type=0===a.indexOf(e)?t.MIXIN_RULE:t.STYLE_RULE}var c=r.rules;if(c)for(var v=0,h=c.length,l=void 0;v1}}function M(n,t){if(n.some((function(n){return n.styleEl===t})))return!1;var r=k(t.textContent);return r.styleEl=t,n.push(r),!0}function O(n){var t=y(E(n));n.forEach((function(n){n.usesCssVars&&(n.styleEl.textContent=m(n.template,t))}))}function R(n,t,r){return function(n,t,r){return n.replace(RegExp(t,"g"),r)}(n,"\\."+t,"."+r)}function A(n,t){return Array.from(n.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(n){return M(t,n)})).some(Boolean)}function L(n,t,r){var i=r.href;return fetch(i).then((function(n){return n.text()})).then((function(u){if(function(n){return n.indexOf("var(")>-1||$.test(n)}(u)&&r.parentNode){(function(n){return j.lastIndex=0,j.test(n)})(u)&&(u=function(n,t){var r=t.replace(/[^/]*$/,"");return n.replace(j,(function(n,t){return n.replace(t,r+t)}))}(u,i));var e=n.createElement("style");e.setAttribute("data-styles",""),e.textContent=u,M(t,e),r.parentNode.insertBefore(e,r),r.remove()}})).catch((function(n){console.error(n)}))}var $=/[\s;{]--[-a-zA-Z0-9]+\s*:/m,j=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim,P=function(){function n(n,t){this.win=n,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return n.prototype.i=function(){var n=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){n.win.requestAnimationFrame((function(){(function(n,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){A(n,t)&&O(t)})).observe(document.head,{childList:!0})})(n.doc,n.globalScopes),function(n,t){return A(n,t),function(n,t){for(var r=[],i=n.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),u=0;u0?t.setAttribute("class",n.join(" ")):t.removeAttribute("class")}return""===n[0]&&n.splice(0,1),n.toggle=function(t,e){void 0!==e?e?n.add(t):n.remove(t):-1!==n.indexOf(t)?n.splice(n.indexOf(t),1):n.push(t),i()},n.add=function(){for(var t=[].slice.call(arguments),e=0,o=t.length;ee&&e.supports&&e.supports("color","var(--c)")?t():__sc_import_stencil_comp("./p-24fc4ba9.js").then(()=>(o.o=s.__cssshim)?(!1).i():0)),i=()=>{o.o=s.__cssshim;const e=Array.from(n.querySelectorAll("script")).find(e=>RegExp(`/${r}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===r),a=e["data-opts"]||{};return"onbeforeload"in e&&!history.scrollRestoration?{then(){}}:(a.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,s.location.href)).href,l(a.resourcesUrl,e),s.customElements?t(a):__sc_import_stencil_comp("./p-46109683.js").then(()=>a))},l=(e,o)=>{const t="__sc_import_"+r.replace(/\s|-/g,"_");try{s[t]=Function("w","return import(w);//"+Math.random())}catch(a){const r=new Map;s[t]=a=>{const c=new URL(a,e).href;let p=r.get(c);if(!p){const e=n.createElement("script");e.type="module",e.crossOrigin=o.crossOrigin,e.src=URL.createObjectURL(new Blob([`import * as m from '${c}'; window.${t}.m = m;`],{type:"application/javascript"})),p=new Promise(o=>{e.onload=()=>{o(s[t].m),e.remove()}}),r.set(c,p),n.head.appendChild(e)}return p}}};export{p as a,i as p} \ No newline at end of file diff --git a/examples/stencil/www/build/p-643ed5c5.system.js b/examples/stencil/www/build/p-643ed5c5.system.js new file mode 100644 index 0000000000..82b9c4d691 --- /dev/null +++ b/examples/stencil/www/build/p-643ed5c5.system.js @@ -0,0 +1 @@ +System.register(["./p-cb84036f.system.js","./p-ad9d11e3.system.js"],(function(){"use strict";var t,o;return{setters:[function(o){t=o.b},function(t){o=t.p}],execute:function(){o().then((function(o){return t([["p-8dca6b42.system",[[1,"todo-app",{model:[16],newTodo:[32],editing:[32],nowShowing:[32]}],[1,"todo-footer",{count:[2],completedCount:[2,"completed-count"],nowShowing:[1,"now-showing"]}],[1,"todo-item",{todo:[16],editing:[4],editText:[32]}]]]],o)}))}}})); \ No newline at end of file diff --git a/examples/stencil/www/build/p-7f0a8d9c.system.js b/examples/stencil/www/build/p-7f0a8d9c.system.js new file mode 100644 index 0000000000..d83c5918eb --- /dev/null +++ b/examples/stencil/www/build/p-7f0a8d9c.system.js @@ -0,0 +1,13 @@ +var __spreadArrays=this&&this.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e0){s.push(o)}else{if(s.length>0){n.push(s.join(""));t.push(E);s=[]}t.push(o)}if(o===O){a++}}if(s.length>0){n.push(s.join(""));t.push(E)}var i={escapedString:t.join(""),blocks:n};return i};var k=function(r){r=r.replace(m,s).replace(g,n).replace(d,a);return r};var A=function(r,e,t){return r.replace(e,(function(){var r=[];for(var e=0;e-1){return T(r,e,t)}else{return r+e+t+", "+e+" "+r+t}};var B=function(r,e){var t="."+e+" > ";var n=[];r=r.replace(v,(function(){var r=[];for(var e=0;e=0;i--){var v=r[5][i];if(v==="}"||v===","){break}o=v+o}var l=o+c;var f=""+o.trimRight()+c.trim();if(l.trim()!==f.trim()){var p=f+", "+l;n.push({orgSelector:l,updatedSelector:p})}return c}else{return u+r[3]}}));return{selectors:n,cssText:r}};var I=function(r){return A(r,i,L)};var K=function(r){return f.reduce((function(r,e){return r.replace(e," ")}),r)};var $=function(r){var e=/\[/g;var t=/\]/g;r=r.replace(e,"\\[").replace(t,"\\]");return new RegExp("^("+r+")"+p,"m")};var M=function(r,e){var t=$(e);return!t.test(r)};var U=function(r,e,t){h.lastIndex=0;if(h.test(r)){var n="."+t;return r.replace(l,(function(r,e){return e.replace(/([^:]*)(:*)(.*)/,(function(r,e,t,a){return e+n+t+a}))})).replace(h,n+" ")}return e+" "+r};var q=function(r,n,a){var s=/\[is=([^\]]*)\]/g;n=n.replace(s,(function(r){var e=[];for(var t=1;t-1){e=U(r,n,a)}else{var t=r.replace(h,"");if(t.length>0){var s=t.match(/([^:]*)(:*)(.*)/);if(s){e=s[1]+c+s[2]+s[3]}}}return e};var i=e(r);r=i.content;var v="";var l=0;var f;var p=/( |>|\+|~(?!=))\s*/g;var g=r.indexOf(u)>-1;var d=!g;while((f=p.exec(r))!==null){var m=f[1];var _=r.slice(l,f.index).trim();d=d||_.indexOf(u)>-1;var x=d?o(_):_;v+=x+" "+m+" ";l=p.lastIndex}var w=r.substring(l);d=d||w.indexOf(u)>-1;v+=d?o(w):w;return t(i.placeholders,v)};var z=function(r,e,t,n){return r.split(",").map((function(r){if(n&&r.indexOf("."+n)>-1){return r.trim()}if(M(r,e)){return q(r,e,t).trim()}else{return r.trim()}})).join(", ")};var D=function(r,e,t,n,a){return R(r,(function(r){var a=r.selector;var s=r.content;if(r.selector[0]!=="@"){a=z(r.selector,e,t,n)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){s=D(r.content,e,t,n)}var c={selector:a.replace(/\s{2,}/g," ").trim(),content:s};return c}))};var F=function(r,e,t,n,a){r=k(r);r=C(r);r=I(r);var s=B(r,n);r=s.cssText;r=K(r);if(e){r=D(r,e,t,n)}r=r.replace(/-shadowcsshost-no-combinator/g,"."+t);r=r.replace(/>\s*\*\s+([^{, ]+)/gm," $1 ");return{cssText:r.trim(),slottedSelectors:s.selectors}};var G=r("scopeCss",(function(r,e,t){var n=e+"-h";var a=e+"-s";var s=S(r);r=x(r);var c=[];if(t){var o=function(r){var e="/*!@___"+c.length+"___*/";var t="/*!@"+r.selector+"*/";c.push({placeholder:e,comment:t});r.selector=e+r.selector;return r};r=R(r,(function(r){if(r.selector[0]!=="@"){return o(r)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){r.content=R(r.content,o);return r}return r}))}var i=F(r,e,n,a);r=__spreadArrays([i.cssText],s).join("\n");if(t){c.forEach((function(e){var t=e.placeholder,n=e.comment;r=r.replace(t,n)}))}i.slottedSelectors.forEach((function(e){r=r.replace(e.orgSelector,e.updatedSelector)}));return r}))}}})); \ No newline at end of file diff --git a/examples/stencil/www/build/p-8cf04e16.js b/examples/stencil/www/build/p-8cf04e16.js new file mode 100644 index 0000000000..991faf38ac --- /dev/null +++ b/examples/stencil/www/build/p-8cf04e16.js @@ -0,0 +1 @@ +const e="stencil-comp";let t,n,l=!1;const s="undefined"!=typeof window?window:{},o=s.CSS,i=s.document||{head:{}},c={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=(()=>(i.head.attachShadow+"").indexOf("[native")>-1)(),a=e=>Promise.resolve(e),u=(()=>{try{return new CSSStyleSheet,!0}catch(e){}return!1})(),f=new WeakMap,p=e=>"sc-"+e.s,d={},$=e=>"object"==(e=typeof e)||"function"===e,m="undefined"!=typeof Deno,y=!(m||"undefined"==typeof global||"function"!=typeof require||!global.process||"string"!=typeof __filename||global.origin&&"string"==typeof global.origin),b=(m&&Deno,y?process:m&&Deno,y?process:m&&Deno,(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,c=[];const r=t=>{for(let n=0;ne[t]).join(" "))}}const a=h(e,null);return a.i=t,c.length>0&&(a.u=c),a.p=s,a}),h=(e,t)=>({t:0,$:e,o:t,m:null,u:null,i:null,p:null}),w={},g=(e,t,n,l,o,i)=>{if(n!==l){let a=I(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=j(n),o=j(l);t.remove(...s.filter(e=>e&&!o.includes(e))),t.add(...o.filter(e=>e&&!s.includes(e)))}else if("key"===t);else if(a||"o"!==t[0]||"n"!==t[1]){const s=$(l);if((a||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?a=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(r){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!a||4&i||o)&&!s&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):I(s,u)?u.slice(2):u[2]+t.slice(3),n&&c.rel(e,t,n,!1),l&&c.ael(e,t,l,!1)}},_=/\s/,j=e=>e?e.split(_):[],k=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.i||d,i=t.i||d;for(l in o)l in i||g(s,l,o[l],void 0,n,t.t);for(l in i)g(s,l,o[l],i[l],n,t.t)},v=(e,n,l)=>{let s,o,c=n.u[l],r=0;if(null!==c.o)s=c.m=i.createTextNode(c.o);else if(s=c.m=i.createElement(c.$),k(null,c,!1),null!=t&&s["s-si"]!==t&&s.classList.add(s["s-si"]=t),c.u)for(r=0;r{let c,r=e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=v(null,l,o),c&&(s[o].m=c,r.insertBefore(c,t)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.m.remove()},C=(e,t)=>e.$===t.$&&e.p===t.p,O=(e,t)=>{const n=t.m=e.m,l=e.u,s=t.u,o=t.o;null===o?(k(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o,i=0,c=0,r=0,a=0,u=t.length-1,f=t[0],p=t[u],d=l.length-1,$=l[0],m=l[d];for(;i<=u&&c<=d;)if(null==f)f=t[++i];else if(null==p)p=t[--u];else if(null==$)$=l[++c];else if(null==m)m=l[--d];else if(C(f,$))O(f,$),f=t[++i],$=l[++c];else if(C(p,m))O(p,m),p=t[--u],m=l[--d];else if(C(f,m))O(f,m),e.insertBefore(f.m,p.m.nextSibling),f=t[++i],m=l[--d];else if(C(p,$))O(p,$),e.insertBefore(p.m,f.m),p=t[--u],$=l[++c];else{for(r=-1,a=i;a<=u;++a)if(t[a]&&null!==t[a].p&&t[a].p===$.p){r=a;break}r>=0?(o=t[r],o.$!==$.$?s=v(t&&t[c],n,r):(O(o,$),t[r]=void 0,s=o.m),$=l[++c]):(s=v(t&&t[c],n,c),$=l[++c]),s&&f.m.parentNode.insertBefore(s,f.m)}i>u?S(e,null==l[d+1]?null:l[d+1].m,n,l,c,d):c>d&&M(t,i,u)})(n,l,t,s):null!==s?(null!==e.o&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.o!==o&&(n.data=o)},D=(e,t,n)=>{const l=(e=>z(e).h)(e);return{emit:e=>P(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},P=(e,t,n)=>{const l=c.ce(t,n);return e.dispatchEvent(l),l},x=(e,t)=>{t&&!e.g&&t["s-p"]&&t["s-p"].push(new Promise(t=>e.g=t))},E=(e,t)=>{if(e.t|=16,!(4&e.t))return x(e,e._),se(()=>L(e,t));e.t|=512},L=(e,t)=>{const n=e.j;let l;return t&&(l=q(n,"componentWillLoad")),A(l,()=>R(e,n,t))},R=(e,l,s)=>{const o=e.h,c=o["s-rc"];s&&(e=>{const t=e.k,n=e.h,l=t.t,s=((e,t)=>{let n=p(t),l=X.get(n);if(e=11===e.nodeType?e:i,l)if("string"==typeof l){let t,s=f.get(e=e.head||e);s||f.set(e,s=new Set),s.has(n)||(t=i.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(r&&n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);((e,l)=>{const s=e.h,o=e.v||h(null,null),i=(e=>e&&e.$===w)(l)?l:b(null,null,l);n=s.tagName,i.$=null,i.t|=4,e.v=i,i.m=o.m=s.shadowRoot||s,t=s["s-sc"],O(o,i)})(e,T(e,l)),c&&(c.map(e=>e()),o["s-rc"]=void 0);{const t=o["s-p"],n=()=>U(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},T=(e,t)=>{try{t=t.render(),e.t&=-17,e.t|=2}catch(n){J(n)}return t},U=e=>{const t=e.h,n=e._;64&e.t||(e.t|=64,F(t),e.S(t),n||W()),e.g&&(e.g(),e.g=void 0),512&e.t&&le(()=>E(e,!1)),e.t&=-517},W=()=>{F(i.documentElement),le(()=>P(s,"appload",{detail:{namespace:"stencil-comp"}}))},q=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(l){J(l)}},A=(e,t)=>e&&e.then?e.then(t):t(),F=e=>e.classList.add("hydrated"),N=(e,t,n)=>{if(t.M){const l=Object.entries(t.M),s=e.prototype;if(l.map(([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>z(this).C.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=z(e),o=s.C.get(t),i=s.t,c=s.j;n=((e,t)=>null==e||$(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.M[t][0]),8&i&&void 0!==o||n===o||(s.C.set(t,n),c&&2==(18&i)&&E(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})}),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){c.jmp(()=>{const n=t.get(e);this[n]=(null!==l||"boolean"!=typeof this[n])&&l})},e.observedAttributes=l.filter(([e,t])=>15&t[0]).map(([e,n])=>{const l=n[1]||e;return t.set(l,e),l})}}return e},H=(e,t={})=>{const n=[],l=t.exclude||[],o=s.customElements,a=i.head,f=a.querySelector("meta[charset]"),d=i.createElement("style"),$=[];let m,y=!0;Object.assign(c,t),c.l=new URL(t.resourcesUrl||"./",i.baseURI).href,e.map(e=>e[1].map(t=>{const s={t:t[0],s:t[1],M:t[2],O:t[3]};s.M=t[2],!r&&1&s.t&&(s.t|=8);const i=s.s,a=class extends HTMLElement{constructor(e){super(e),G(e=this,s),1&s.t&&(r?e.attachShadow({mode:"open"}):"shadowRoot"in e||(e.shadowRoot=e))}connectedCallback(){m&&(clearTimeout(m),m=null),y?$.push(this):c.jmp(()=>(e=>{if(0==(1&c.t)){const t=z(e),n=t.k,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){x(t,t._=n);break}}n.M&&Object.entries(n.M).map(([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}}),le(()=>(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(N(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(c){J(c)}t.t&=-9,e()}if(s.style){let e=s.style;const t=p(n);if(!X.has(t)){const l=()=>{};8&n.t&&(e=await __sc_import_stencil_comp("./p-ebb4d602.js").then(n=>n.scopeCss(e,t,!1))),((e,t,n)=>{let l=X.get(e);u&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t._,i=()=>E(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n))}l()}})(this))}disconnectedCallback(){c.jmp(()=>{})}forceUpdate(){(()=>{{const e=z(this);e.h.isConnected&&2==(18&e.t)&&E(e,!1)}})()}componentOnReady(){return z(this).D}};s.P=e[0],l.includes(i)||o.get(i)||(n.push(i),o.define(i,N(a,s,1)))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),y=!1,$.length?$.map(e=>e.connectedCallback()):c.jmp(()=>m=setTimeout(W,30))},V=new WeakMap,z=e=>V.get(e),B=(e,t)=>V.set(t.j=e,t),G=(e,t)=>{const n={t:0,h:e,k:t,C:new Map};return n.D=new Promise(e=>n.S=e),e["s-p"]=[],e["s-rc"]=[],V.set(e,n)},I=(e,t)=>t in e,J=e=>console.error(e),K=new Map,Q=e=>{const t=e.s.replace(/-/g,"_"),n=e.P,l=K.get(n);return l?l[t]:__sc_import_stencil_comp(`./${n}.entry.js`).then(e=>(K.set(n,e),e[t]),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&c.t?le(ne):c.raf(ne))},te=e=>{for(let n=0;n{te(Y),te(Z),(l=Y.length>0)&&c.raf(ne)},le=e=>a().then(e),se=ee(Z,!0);export{o as C,e as N,a,H as b,D as c,i as d,b as h,c as p,B as r,s as w} \ No newline at end of file diff --git a/examples/stencil/www/build/p-8dca6b42.system.entry.js b/examples/stencil/www/build/p-8dca6b42.system.entry.js new file mode 100644 index 0000000000..ff0131a652 --- /dev/null +++ b/examples/stencil/www/build/p-8dca6b42.system.entry.js @@ -0,0 +1,7 @@ +System.register(["./p-cb84036f.system.js","./p-24afcbad.system.js"],(function(t){"use strict";var e,o,i,n;return{setters:[function(t){e=t.r;o=t.h;i=t.c},function(t){n=t.p}],execute:function(){var r="all";var a="active";var l="completed";var s=":focus{outline:0}.main{position:relative;z-index:2;border-top:1px solid #e6e6e6}.todoapp{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}.todoapp{background:#fff;margin:130px 0 40px 0;position:relative;-webkit-box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1);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;-webkit-margin-before:0.83em;margin-block-start:0.83em;-webkit-margin-after:0.83em;margin-block-end:0.83em}.new-todo,.edit{position:relative;margin:0;width:100%;font-size:24px;font-family:inherit;font-weight:inherit;line-height:1.4em;color:inherit;padding:6px;border:1px solid #999;-webkit-box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);-webkit-box-sizing:border-box;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);-webkit-box-shadow:inset 0 -2px 1px rgba(0,0,0,0.03);box-shadow:inset 0 -2px 1px rgba(0,0,0,0.03)}.todo-list{margin:0;padding:0;list-style:none}.toggle-all{width:1px;height:1px;border:none;opacity:0;position:absolute;right:100%;bottom:100%}.toggle-all+label{width:60px;height:34px;font-size:0;position:absolute;top:-53px;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}";var d=13;var p=t("todo_app",function(){function t(t){e(this,t);this.nowShowing=r}t.prototype.handleNewTodoKeyDown=function(t){if(t.keyCode!==d){return}t.preventDefault();var e=this.newTodo.trim();if(e){this.model.addTodo(e);this.newTodo=""}};t.prototype.toggle=function(t){this.model.toggle(t)};t.prototype.destroy=function(t){this.model.destroy(t)};t.prototype.edit=function(t){this.editing=t};t.prototype.save=function(t,e){this.model.save(t,e);this.editing=null};t.prototype.cancel=function(){this.editing=null};t.prototype.handleChange=function(t){this.newTodo=t.target.value};t.prototype.clearCompleted=function(){this.model.clearCompleted()};t.prototype.toggleAll=function(t){var e=t.target.checked;this.model.toggleAll(e)};t.prototype.componentWillLoad=function(){var t=this;window.addEventListener("hashchange",(function(e){var o=e.newURL;var i=o.split("#");var n=i.length>1?i[1]:"/all";switch(n){case"/active":t.nowShowing=a;break;case"/completed":t.nowShowing=l;break;default:t.nowShowing=r}}),false)};t.prototype.render=function(){var t=this;var e,i;if(!this.model)return o("div",null,"todo-app web component requires a model");var n=this.model.todos;var r=n.filter((function(t){switch(this.nowShowing){case a:return!t.completed;case l:return t.completed;default:return true}}),this);var s=r.map((function(t){var e=this;return o("todo-item",{key:t.id,todo:t,onToggle:function(t){return e.toggle(t.detail)},onDestroy:function(t){return e.destroy(t.detail)},onEdit:function(t){return e.edit(t.detail)},editing:this.editing===t.id,onSave:function(t){return e.save(t.detail.todoId,t.detail.text)},onCancel:function(t){return e.cancel()}})}),this);var d=n.reduce((function(t,e){return e.completed?t:t+1}),0);var p=n.length-d;if(d||p){i=o("todo-footer",{count:d,completedCount:p,nowShowing:this.nowShowing,onClearCompleted:function(e){return t.clearCompleted()}})}if(n.length){e=o("section",{class:"main"},o("input",{id:"toggle-all",class:"toggle-all",type:"checkbox",onChange:function(e){return t.toggleAll(e)},checked:d===0}),o("label",{htmlFor:"toggle-all"}),o("ul",{class:"todo-list"},s))}return o("div",{class:"todo"},o("div",{class:"todoapp"},o("header",{class:"header"},o("h1",null,"todos"),o("input",{class:"new-todo",placeholder:"What needs to be done?",value:this.newTodo,onKeyDown:function(e){return t.handleNewTodoKeyDown(e)},onInput:function(e){return t.handleChange(e)},autoFocus:true})),e,i))};return t}());p.style=s;function c(t,e,o){return o={path:e,exports:{},require:function(t,e){return h()}},t(o,o.exports),o.exports}function h(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var g=c((function(t){ +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + */ +(function(){var e={}.hasOwnProperty;function o(){var t=[];for(var i=0;i0){i=o("button",{class:"clear-completed",onClick:function(e){return t.clearCompleted.emit()}},"Clear completed")}var s=this.nowShowing;return o("footer",{class:"footer"},o("span",{class:"todo-count"},o("strong",null,this.count)," ",e," left"),o("ul",{class:"filters"},o("li",null,o("a",{href:"#/",class:g({selected:s===r})},"All"))," ",o("li",null,o("a",{href:"#/active",class:g({selected:s===a})},"Active"))," ",o("li",null,o("a",{href:"#/completed",class:g({selected:s===l})},"Completed"))),i)};return t}());f.style=u;var x="li{position:relative;font-size:24px;border-bottom:1px solid #ededed}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;-moz-appearance:none;appearance:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:focus{outline:0}.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;-webkit-box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}li.completed label{color:#d9d9d9;text-decoration:line-through}li.editing{border-bottom:none;padding:0}li.editing .edit{display:block;width:calc(100% - 43px);padding:12px 16px;margin:0 0 0 43px}li.editing .view{display:none}li .toggle{text-align:center;width:40px;height:auto;position:absolute;top:0;bottom:0;margin:auto 0;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}li .toggle+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%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E');background-repeat:no-repeat;background-position:center left}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')}li label{word-break:break-all;padding:15px 15px 15px 60px;display:block;line-height:1.2;-webkit-transition:color 0.4s;transition:color 0.4s}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;-webkit-transition:color 0.2s ease-out;transition:color 0.2s ease-out}li .destroy:hover{color:#af5b5e}li .destroy:after{content:'×'}li:hover .destroy{display:block}li .edit{display:none}li.editing:last-child{margin-bottom:-1px}";var b=27;var m=13;var w=t("todo_item",function(){function t(t){e(this,t);this.toggle=i(this,"toggle",7);this.destroy=i(this,"destroy",7);this.edit=i(this,"edit",7);this.save=i(this,"save",7);this.cancel=i(this,"cancel",7)}t.prototype.handleSubmit=function(){var t=this.editText.trim();if(t&&this.editing){this.save.emit({todoId:this.todo.id,text:t});this.editText=t}else{this.destroy.emit()}};t.prototype.handleChange=function(t){if(this.editing){this.editText=t.target.value}};t.prototype.handleKeyDown=function(t){if(t.which===b){this.editText=this.todo.title;this.cancel.emit()}else if(t.which===m){this.handleSubmit()}};t.prototype.onToggle=function(){this.toggle.emit(this.todo.id)};t.prototype.handleEdit=function(){this.edit.emit(this.todo.id);this.editText=this.todo.title};t.prototype.onDestroy=function(){this.destroy.emit(this.todo.id)};t.prototype.render=function(){var t=this;return o("li",{class:g({completed:this.todo.completed,editing:this.editing})},o("div",{class:"view"},o("input",{class:"toggle",type:"checkbox",checked:this.todo.completed,onChange:function(e){return t.onToggle()}}),o("label",{onDblClick:function(e){return t.handleEdit()}},this.todo.title),o("button",{class:"destroy",onClick:function(e){return t.onDestroy()}})),o("input",{class:"edit",value:this.editText,onBlur:function(e){return t.handleSubmit()},onInput:function(e){return t.handleChange(e)},onKeyDown:function(e){return t.handleKeyDown(e)}}))};return t}());w.style=x}}})); \ No newline at end of file diff --git a/examples/stencil/www/build/p-ad9d11e3.system.js b/examples/stencil/www/build/p-ad9d11e3.system.js new file mode 100644 index 0000000000..767daba091 --- /dev/null +++ b/examples/stencil/www/build/p-ad9d11e3.system.js @@ -0,0 +1 @@ +System.register(["./p-cb84036f.system.js"],(function(r,e){"use strict";var t,n,o,s,i,c;return{setters:[function(r){t=r.C;n=r.p;o=r.w;s=r.a;i=r.d;c=r.N}],execute:function(){var a=function(){};var u=typeof Deno!=="undefined";var f=!u&&typeof global!=="undefined"&&typeof require==="function"&&!!global.process&&typeof __filename==="string"&&(!global.origin||typeof global.origin!=="string");var p=u&&Deno.build.os==="windows";var l=f?process.cwd:u?Deno.cwd:function(){return"/"};var m=f?process.exit:u?Deno.exit:a;var d=function(r){return"__sc_import_"+r.replace(/\s|-/g,"_")};var v=r("a",(function(){if(!(t&&t.supports&&t.supports("color","var(--c)"))){return e.import("./p-03188b5b.system.js").then((function(){if(n.$cssShim$=o.__cssshim){return n.$cssShim$.i()}else{return 0}}))}return s()}));var w=r("p",(function(){{n.$cssShim$=o.__cssshim}var r=Array.from(i.querySelectorAll("script")).find((function(r){return new RegExp("/"+c+"(\\.esm)?\\.js($|\\?|#)").test(r.src)||r.getAttribute("data-stencil-namespace")===c}));var t=r["data-opts"]||{};if("onbeforeload"in r&&!history.scrollRestoration){return{then:function(){}}}{t.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,o.location.href)).href;{g(t.resourcesUrl,r)}if(!o.customElements){return e.import("./p-0b8ecd50.system.js").then((function(){return t}))}}return s(t)}));var g=function(r,e){var t=d(c);try{o[t]=new Function("w","return import(w);//"+Math.random())}catch(s){var n=new Map;o[t]=function(s){var c=new URL(s,r).href;var a=n.get(c);if(!a){var u=i.createElement("script");u.type="module";u.crossOrigin=e.crossOrigin;u.src=URL.createObjectURL(new Blob(["import * as m from '"+c+"'; window."+t+".m = m;"],{type:"application/javascript"}));a=new Promise((function(r){u.onload=function(){r(o[t].m);u.remove()}}));n.set(c,a);i.head.appendChild(u)}return a}}}}}})); \ No newline at end of file diff --git a/examples/stencil/www/build/p-ca8086a1.entry.js b/examples/stencil/www/build/p-ca8086a1.entry.js new file mode 100644 index 0000000000..06240b172c --- /dev/null +++ b/examples/stencil/www/build/p-ca8086a1.entry.js @@ -0,0 +1,7 @@ +import{r as t,h as e,c as o}from"./p-8cf04e16.js";import{p as i}from"./p-052c23d4.js";const n=class{constructor(e){t(this,e),this.nowShowing="all"}handleNewTodoKeyDown(t){if(13!==t.keyCode)return;t.preventDefault();let e=this.newTodo.trim();e&&(this.model.addTodo(e),this.newTodo="")}toggle(t){this.model.toggle(t)}destroy(t){this.model.destroy(t)}edit(t){this.editing=t}save(t,e){this.model.save(t,e),this.editing=null}cancel(){this.editing=null}handleChange(t){this.newTodo=t.target.value}clearCompleted(){this.model.clearCompleted()}toggleAll(t){this.model.toggleAll(t.target.checked)}componentWillLoad(){window.addEventListener("hashchange",t=>{let e=t.newURL.split("#");switch(e.length>1?e[1]:"/all"){case"/active":this.nowShowing="active";break;case"/completed":this.nowShowing="completed";break;default:this.nowShowing="all"}},!1)}render(){let t,o;if(!this.model)return e("div",null,"todo-app web component requires a model");let i=this.model.todos,n=i.filter((function(t){switch(this.nowShowing){case"active":return!t.completed;case"completed":return t.completed;default:return!0}}),this).map((function(t){return e("todo-item",{key:t.id,todo:t,onToggle:t=>this.toggle(t.detail),onDestroy:t=>this.destroy(t.detail),onEdit:t=>this.edit(t.detail),editing:this.editing===t.id,onSave:t=>this.save(t.detail.todoId,t.detail.text),onCancel:()=>this.cancel()})}),this),a=i.reduce((function(t,e){return e.completed?t:t+1}),0),l=i.length-a;return(a||l)&&(o=e("todo-footer",{count:a,completedCount:l,nowShowing:this.nowShowing,onClearCompleted:()=>this.clearCompleted()})),i.length&&(t=e("section",{class:"main"},e("input",{id:"toggle-all",class:"toggle-all",type:"checkbox",onChange:t=>this.toggleAll(t),checked:0===a}),e("label",{htmlFor:"toggle-all"}),e("ul",{class:"todo-list"},n))),e("div",{class:"todo"},e("div",{class:"todoapp"},e("header",{class:"header"},e("h1",null,"todos"),e("input",{class:"new-todo",placeholder:"What needs to be done?",value:this.newTodo,onKeyDown:t=>this.handleNewTodoKeyDown(t),onInput:t=>this.handleChange(t),autoFocus:!0})),t,o))}};n.style=":focus{outline:0}.main{position:relative;z-index:2;border-top:1px solid #e6e6e6}.todoapp{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}.todoapp{background:#fff;margin:130px 0 40px 0;position:relative;-webkit-box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1);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;-webkit-margin-before:0.83em;margin-block-start:0.83em;-webkit-margin-after:0.83em;margin-block-end:0.83em}.new-todo,.edit{position:relative;margin:0;width:100%;font-size:24px;font-family:inherit;font-weight:inherit;line-height:1.4em;color:inherit;padding:6px;border:1px solid #999;-webkit-box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);-webkit-box-sizing:border-box;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);-webkit-box-shadow:inset 0 -2px 1px rgba(0,0,0,0.03);box-shadow:inset 0 -2px 1px rgba(0,0,0,0.03)}.todo-list{margin:0;padding:0;list-style:none}.toggle-all{width:1px;height:1px;border:none;opacity:0;position:absolute;right:100%;bottom:100%}.toggle-all+label{width:60px;height:34px;font-size:0;position:absolute;top:-53px;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}";var a,l=(function(t){ +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +!function(){var e={}.hasOwnProperty;function o(){for(var t=[],i=0;i0&&(o=e("button",{class:"clear-completed",onClick:()=>this.clearCompleted.emit()},"Clear completed"));let n=this.nowShowing;return e("footer",{class:"footer"},e("span",{class:"todo-count"},e("strong",null,this.count)," ",t," left"),e("ul",{class:"filters"},e("li",null,e("a",{href:"#/",class:l({selected:"all"===n})},"All"))," ",e("li",null,e("a",{href:"#/active",class:l({selected:"active"===n})},"Active"))," ",e("li",null,e("a",{href:"#/completed",class:l({selected:"completed"===n})},"Completed"))),o)}};r.style="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;-moz-appearance:none;appearance:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.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;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.2),\n 0 8px 0 -3px #f6f6f6,\n 0 9px 1px -3px rgba(0, 0, 0, 0.2),\n 0 16px 0 -6px #f6f6f6,\n 0 17px 2px -6px rgba(0, 0, 0, 0.2);box-shadow:0 1px 1px rgba(0, 0, 0, 0.2),\n 0 8px 0 -3px #f6f6f6,\n 0 9px 1px -3px rgba(0, 0, 0, 0.2),\n 0 16px 0 -6px #f6f6f6,\n 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}";const s=class{constructor(e){t(this,e),this.toggle=o(this,"toggle",7),this.destroy=o(this,"destroy",7),this.edit=o(this,"edit",7),this.save=o(this,"save",7),this.cancel=o(this,"cancel",7)}handleSubmit(){let t=this.editText.trim();t&&this.editing?(this.save.emit({todoId:this.todo.id,text:t}),this.editText=t):this.destroy.emit()}handleChange(t){this.editing&&(this.editText=t.target.value)}handleKeyDown(t){27===t.which?(this.editText=this.todo.title,this.cancel.emit()):13===t.which&&this.handleSubmit()}onToggle(){this.toggle.emit(this.todo.id)}handleEdit(){this.edit.emit(this.todo.id),this.editText=this.todo.title}onDestroy(){this.destroy.emit(this.todo.id)}render(){return e("li",{class:l({completed:this.todo.completed,editing:this.editing})},e("div",{class:"view"},e("input",{class:"toggle",type:"checkbox",checked:this.todo.completed,onChange:()=>this.onToggle()}),e("label",{onDblClick:()=>this.handleEdit()},this.todo.title),e("button",{class:"destroy",onClick:()=>this.onDestroy()})),e("input",{class:"edit",value:this.editText,onBlur:()=>this.handleSubmit(),onInput:t=>this.handleChange(t),onKeyDown:t=>this.handleKeyDown(t)}))}};s.style="li{position:relative;font-size:24px;border-bottom:1px solid #ededed}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;-moz-appearance:none;appearance:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:focus{outline:0}.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;-webkit-box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}li.completed label{color:#d9d9d9;text-decoration:line-through}li.editing{border-bottom:none;padding:0}li.editing .edit{display:block;width:calc(100% - 43px);padding:12px 16px;margin:0 0 0 43px}li.editing .view{display:none}li .toggle{text-align:center;width:40px;height:auto;position:absolute;top:0;bottom:0;margin:auto 0;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}li .toggle+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%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E');background-repeat:no-repeat;background-position:center left}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')}li label{word-break:break-all;padding:15px 15px 15px 60px;display:block;line-height:1.2;-webkit-transition:color 0.4s;transition:color 0.4s}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;-webkit-transition:color 0.2s ease-out;transition:color 0.2s ease-out}li .destroy:hover{color:#af5b5e}li .destroy:after{content:'×'}li:hover .destroy{display:block}li .edit{display:none}li.editing:last-child{margin-bottom:-1px}";export{n as todo_app,r as todo_footer,s as todo_item} \ No newline at end of file diff --git a/examples/stencil/www/build/p-cb84036f.system.js b/examples/stencil/www/build/p-cb84036f.system.js new file mode 100644 index 0000000000..1b63a0b749 --- /dev/null +++ b/examples/stencil/www/build/p-cb84036f.system.js @@ -0,0 +1 @@ +var __extends=this&&this.__extends||function(){var e=function(r,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var n in r)if(r.hasOwnProperty(n))e[n]=r[n]};return e(r,n)};return function(r,n){e(r,n);function t(){this.constructor=r}r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}();var __awaiter=this&&this.__awaiter||function(e,r,n,t){function a(e){return e instanceof n?e:new n((function(r){r(e)}))}return new(n||(n=Promise))((function(n,i){function l(e){try{s(t.next(e))}catch(r){i(r)}}function o(e){try{s(t["throw"](e))}catch(r){i(r)}}function s(e){e.done?n(e.value):a(e.value).then(l,o)}s((t=t.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,a,i,l;return l={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function o(e){return function(r){return s([e,r])}}function s(l){if(t)throw new TypeError("Generator is already executing.");while(n)try{if(t=1,a&&(i=l[0]&2?a["return"]:l[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;if(a=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;a=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]-1}();var v=e("a",(function(e){return Promise.resolve(e)}));var d=function(){try{new CSSStyleSheet;return true}catch(e){}return false}();var h="{visibility:hidden}.hydrated{visibility:inherit}";var p=function(e,r){if(r===void 0){r=""}{return function(){return}}};var m=function(e,r){{return function(){return}}};var g=new WeakMap;var y=function(e,r,n){var t=_e.get(e);if(d&&n){t=t||new CSSStyleSheet;t.replace(r)}else{t=r}_e.set(e,t)};var b=function(e,r,n,t){var a=S(r);var i=_e.get(a);e=e.nodeType===11?e:u;if(i){if(typeof i==="string"){e=e.head||e;var l=g.get(e);var o=void 0;if(!l){g.set(e,l=new Set)}if(!l.has(a)){{if($.$cssShim$){o=$.$cssShim$.createHostStyle(t,a,i,!!(r.$flags$&10));var s=o["s-sc"];if(s){a=s;l=null}}else{o=u.createElement("style");o.innerHTML=i}e.insertBefore(o,e.querySelector("link"))}if(l){l.add(a)}}}else if(!e.adoptedStyleSheets.includes(i)){e.adoptedStyleSheets=__spreadArrays(e.adoptedStyleSheets,[i])}}return a};var w=function(e){var r=e.$cmpMeta$;var n=e.$hostElement$;var t=r.$flags$;var a=p("attachStyles",r.$tagName$);var i=b(c&&n.shadowRoot?n.shadowRoot:n.getRootNode(),r,e.$modeName$,n);if(t&10){n["s-sc"]=i;n.classList.add(i+"-h")}a()};var S=function(e,r){return"sc-"+e.$tagName$};var _={};var R=function(e){return e!=null};var x=function(){};var k=function(e){e=typeof e;return e==="object"||e==="function"};var N=typeof Deno!=="undefined";var C=!N&&typeof global!=="undefined"&&typeof require==="function"&&!!global.process&&typeof __filename==="string"&&(!global.origin||typeof global.origin!=="string");var E=N&&Deno.build.os==="windows";var j=C?process.cwd:N?Deno.cwd:function(){return"/"};var M=C?process.exit:N?Deno.exit:x;var A=e("h",(function(e,r){var n=[];for(var t=2;t0){$.$children$=s}{$.$key$=i}return $}));var P=function(e,r){var n={$flags$:0,$tag$:e,$text$:r,$elm$:null,$children$:null};{n.$attrs$=null}{n.$key$=null}return n};var L={};var O=function(e){return e&&e.$tag$===L};var T=function(e,r,n,t,a,i){if(n!==t){var l=ye(e,r);var o=r.toLowerCase();if(r==="class"){var f=e.classList;var u=U(n);var c=U(t);f.remove.apply(f,u.filter((function(e){return e&&!c.includes(e)})));f.add.apply(f,c.filter((function(e){return e&&!u.includes(e)})))}else if(r==="key");else if(!l&&r[0]==="o"&&r[1]==="n"){if(r[2]==="-"){r=r.slice(3)}else if(ye(s,o)){r=o.slice(2)}else{r=o[2]+r.slice(3)}if(n){$.rel(e,r,n,false)}if(t){$.ael(e,r,t,false)}}else{var v=k(t);if((l||v&&t!==null)&&!a){try{if(!e.tagName.includes("-")){var d=t==null?"":t;if(r==="list"){l=false}else if(n==null||e[r]!=d){e[r]=d}}else{e[r]=t}}catch(h){}}if(t==null||t===false){if(t!==false||e.getAttribute(r)===""){{e.removeAttribute(r)}}}else if((!l||i&4||a)&&!v){t=t===true?"":t;{e.setAttribute(r,t)}}}}};var B=/\s/;var U=function(e){return!e?[]:e.split(B)};var I=function(e,r,n,t){var a=r.$elm$.nodeType===11&&r.$elm$.host?r.$elm$.host:r.$elm$;var i=e&&e.$attrs$||_;var l=r.$attrs$||_;{for(t in i){if(!(t in l)){T(a,t,i[t],undefined,n,r.$flags$)}}}for(t in l){T(a,t,i[t],l[t],n,r.$flags$)}};var H=function(e,r,n,t){var i=r.$children$[n];var o=0;var s;var f;if(i.$text$!==null){s=i.$elm$=u.createTextNode(i.$text$)}else{s=i.$elm$=u.createElement(i.$tag$);{I(null,i,l)}if(R(a)&&s["s-si"]!==a){s.classList.add(s["s-si"]=a)}if(i.$children$){for(o=0;o=0){h=r[l];if(h.$tag$!==c.$tag$){d=H(r&&r[i],n,l)}else{W(h,c);r[l]=undefined;d=h.$elm$}c=t[++i]}else{d=H(r&&r[i],n,i);c=t[++i]}if(d){{f.$elm$.parentNode.insertBefore(d,f.$elm$)}}}}if(a>s){z(e,t[$+1]==null?null:t[$+1].$elm$,n,t,i,$)}else if(i>$){q(r,a,s)}};var V=function(e,r){if(e.$tag$===r.$tag$){{return e.$key$===r.$key$}}return false};var W=function(e,r){var n=r.$elm$=e.$elm$;var t=e.$children$;var a=r.$children$;var i=r.$text$;if(i===null){{{I(e,r,l)}}if(t!==null&&a!==null){D(n,t,r,a)}else if(a!==null){if(e.$text$!==null){n.textContent=""}z(n,null,r,a,0,a.length-1)}else if(t!==null){q(t,0,t.length-1)}}else if(e.$text$!==i){n.data=i}};var F=function(e,r){var n=e.$hostElement$;var t=e.$vnode$||P(null,null);var l=O(r)?r:A(null,null,r);i=n.tagName;l.$tag$=null;l.$flags$|=4;e.$vnode$=l;l.$elm$=t.$elm$=n.shadowRoot||n;{a=n["s-sc"]}W(t,l)};var G=function(e){return pe(e).$hostElement$};var J=e("c",(function(e,r,n){var t=G(e);return{emit:function(e){return K(t,r,{bubbles:!!(n&4),composed:!!(n&2),cancelable:!!(n&1),detail:e})}}}));var K=function(e,r,n){var t=$.ce(r,n);e.dispatchEvent(t);return t};var Q=function(e,r){if(r&&!e.$onRenderResolve$&&r["s-p"]){r["s-p"].push(new Promise((function(r){return e.$onRenderResolve$=r})))}};var X=function(e,r){{e.$flags$|=16}if(e.$flags$&4){e.$flags$|=512;return}Q(e,e.$ancestorComponent$);var n=function(){return Y(e,r)};return je(n)};var Y=function(e,r){var n=p("scheduleUpdate",e.$cmpMeta$.$tagName$);var t=e.$lazyInstance$;var a;if(r){{a=ae(t,"componentWillLoad")}}n();return ie(a,(function(){return Z(e,t,r)}))};var Z=function(e,r,n){var t=e.$hostElement$;var a=p("update",e.$cmpMeta$.$tagName$);var i=t["s-rc"];if(n){w(e)}var l=p("render",e.$cmpMeta$.$tagName$);{{F(e,ee(e,r))}}if($.$cssShim$){$.$cssShim$.updateHost(t)}if(i){i.map((function(e){return e()}));t["s-rc"]=undefined}l();a();{var o=t["s-p"];var s=function(){return re(e)};if(o.length===0){s()}else{Promise.all(o).then(s);e.$flags$|=4;o.length=0}}};var ee=function(e,r){try{r=r.render();{e.$flags$&=~16}{e.$flags$|=2}}catch(n){be(n)}return r};var re=function(e){var r=e.$cmpMeta$.$tagName$;var n=e.$hostElement$;var t=p("postUpdate",r);var a=e.$ancestorComponent$;if(!(e.$flags$&64)){e.$flags$|=64;{le(n)}t();{e.$onReadyResolve$(n);if(!a){te()}}}else{t()}{if(e.$onRenderResolve$){e.$onRenderResolve$();e.$onRenderResolve$=undefined}if(e.$flags$&512){Ee((function(){return X(e,false)}))}e.$flags$&=~(4|512)}};var ne=function(e){{var r=pe(e);var n=r.$hostElement$.isConnected;if(n&&(r.$flags$&(2|16))===2){X(r,false)}return n}};var te=function(e){{le(u.documentElement)}Ee((function(){return K(s,"appload",{detail:{namespace:t}})}))};var ae=function(e,r,n){if(e&&e[r]){try{return e[r](n)}catch(t){be(t)}}return undefined};var ie=function(e,r){return e&&e.then?e.then(r):r()};var le=function(e){return e.classList.add("hydrated")};var oe=function(e,r){if(e!=null&&!k(e)){if(r&4){return e==="false"?false:e===""||!!e}if(r&2){return parseFloat(e)}if(r&1){return String(e)}return e}return e};var se=function(e,r){return pe(e).$instanceValues$.get(r)};var fe=function(e,r,n,t){var a=pe(e);var i=a.$instanceValues$.get(r);var l=a.$flags$;var o=a.$lazyInstance$;n=oe(n,t.$members$[r][0]);if((!(l&8)||i===undefined)&&n!==i){a.$instanceValues$.set(r,n);if(o){if((l&(2|16))===2){X(a,false)}}}};var ue=function(e,r,n){if(r.$members$){var t=Object.entries(r.$members$);var a=e.prototype;t.map((function(e){var t=e[0],i=e[1][0];if(i&31||n&2&&i&32){Object.defineProperty(a,t,{get:function(){return se(this,t)},set:function(e){fe(this,t,e,r)},configurable:true,enumerable:true})}}));if(n&1){var i=new Map;a.attributeChangedCallback=function(e,r,n){var t=this;$.jmp((function(){var r=i.get(e);t[r]=n===null&&typeof t[r]==="boolean"?false:n}))};e.observedAttributes=t.filter((function(e){var r=e[0],n=e[1];return n[0]&15})).map((function(e){var r=e[0],n=e[1];var t=n[1]||r;i.set(t,r);return t}))}}return e};var $e=function(e,t,a,i,l){return __awaiter(n,void 0,void 0,(function(){var e,n,i,o,s,f,u;return __generator(this,(function($){switch($.label){case 0:if(!((t.$flags$&32)===0))return[3,5];t.$flags$|=32;l=Se(a);if(!l.then)return[3,2];e=m();return[4,l];case 1:l=$.sent();e();$.label=2;case 2:if(!l.isProxied){ue(l,a,2);l.isProxied=true}n=p("createInstance",a.$tagName$);{t.$flags$|=8}try{new l(t)}catch(c){be(c)}{t.$flags$&=~8}n();if(!l.style)return[3,5];i=l.style;o=S(a);if(!!_e.has(o))return[3,5];s=p("registerStyles",a.$tagName$);if(!(a.$flags$&8))return[3,4];return[4,r.import("./p-7f0a8d9c.system.js").then((function(e){return e.scopeCss(i,o,false)}))];case 3:i=$.sent();$.label=4;case 4:y(o,i,!!(a.$flags$&1));s();$.label=5;case 5:f=t.$ancestorComponent$;u=function(){return X(t,true)};if(f&&f["s-rc"]){f["s-rc"].push(u)}else{u()}return[2]}}))}))};var ce=function(e){if(($.$flags$&1)===0){var r=pe(e);var n=r.$cmpMeta$;var t=p("connectedCallback",n.$tagName$);if(!(r.$flags$&1)){r.$flags$|=1;{var a=e;while(a=a.parentNode||a.host){if(a["s-p"]){Q(r,r.$ancestorComponent$=a);break}}}if(n.$members$){Object.entries(n.$members$).map((function(r){var n=r[0],t=r[1][0];if(t&31&&e.hasOwnProperty(n)){var a=e[n];delete e[n];e[n]=a}}))}{Ee((function(){return $e(e,r,n)}))}}t()}};var ve=function(e){if(($.$flags$&1)===0){var r=pe(e);if($.$cssShim$){$.$cssShim$.removeHost(e)}}};var de=e("b",(function(e,r){if(r===void 0){r={}}var n=p();var t=[];var a=r.exclude||[];var i=s.customElements;var l=u.head;var o=l.querySelector("meta[charset]");var f=u.createElement("style");var v=[];var d;var m=true;Object.assign($,r);$.$resourcesUrl$=new URL(r.resourcesUrl||"./",u.baseURI).href;e.map((function(e){return e[1].map((function(r){var n={$flags$:r[0],$tagName$:r[1],$members$:r[2],$listeners$:r[3]};{n.$members$=r[2]}if(!c&&n.$flags$&1){n.$flags$|=8}var l=n.$tagName$;var o=function(e){__extends(r,e);function r(r){var t=e.call(this,r)||this;r=t;ge(r,n);if(n.$flags$&1){if(c){{r.attachShadow({mode:"open"})}}else if(!("shadowRoot"in r)){r.shadowRoot=r}}return t}r.prototype.connectedCallback=function(){var e=this;if(d){clearTimeout(d);d=null}if(m){v.push(this)}else{$.jmp((function(){return ce(e)}))}};r.prototype.disconnectedCallback=function(){var e=this;$.jmp((function(){return ve(e)}))};r.prototype.forceUpdate=function(){ne(this)};r.prototype.componentOnReady=function(){return pe(this).$onReadyPromise$};return r}(HTMLElement);n.$lazyBundleId$=e[0];if(!a.includes(l)&&!i.get(l)){t.push(l);i.define(l,ue(o,n,1))}}))}));{f.innerHTML=t+h;f.setAttribute("data-styles","");l.insertBefore(f,o?o.nextSibling:l.firstChild)}m=false;if(v.length){v.map((function(e){return e.connectedCallback()}))}else{{$.jmp((function(){return d=setTimeout(te,30)}))}}n()}));var he=new WeakMap;var pe=function(e){return he.get(e)};var me=e("r",(function(e,r){return he.set(r.$lazyInstance$=e,r)}));var ge=function(e,r){var n={$flags$:0,$hostElement$:e,$cmpMeta$:r,$instanceValues$:new Map};{n.$onReadyPromise$=new Promise((function(e){return n.$onReadyResolve$=e}));e["s-p"]=[];e["s-rc"]=[]}return he.set(e,n)};var ye=function(e,r){return r in e};var be=function(e){return console.error(e)};var we=new Map;var Se=function(e,n,t){var a=e.$tagName$.replace(/-/g,"_");var i=e.$lazyBundleId$;var l=we.get(i);if(l){return l[a]}return r.import("./"+i+".entry.js"+"").then((function(e){{we.set(i,e)}return e[a]}),be)};var _e=new Map;var Re=[];var xe=[];var ke=function(e,r){return function(n){e.push(n);if(!o){o=true;if(r&&$.$flags$&4){Ee(Ce)}else{$.raf(Ce)}}}};var Ne=function(e){for(var r=0;r0){$.raf(Ce)}}};var Ee=function(e){return v().then(e)};var je=ke(xe,true)}}})); \ No newline at end of file diff --git a/examples/stencil/www/build/p-ebb4d602.js b/examples/stencil/www/build/p-ebb4d602.js new file mode 100644 index 0000000000..be4cb5277b --- /dev/null +++ b/examples/stencil/www/build/p-ebb4d602.js @@ -0,0 +1,12 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + * + * This file is a port of shadowCSS from webcomponents.js to TypeScript. + * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js + * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts + */ +const s=/(-shadowcsshost)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))?([^,{]*)/gim,t=/(-shadowcsscontext)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))?([^,{]*)/gim,o=/(-shadowcssslotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))?([^,{]*)/gim,n=/-shadowcsshost-no-combinator([^\s]*)/,e=[/::shadow/g,/::content/g],c=/-shadowcsshost/gim,r=/:host/gim,h=/::slotted/gim,a=/:host-context/gim,d=/\/\*\s*[\s\S]*?\*\//g,l=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g,i=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,g=/([{}])/g,u=(s,t)=>{const o=m(s);let n=0;return o.escapedString.replace(i,(...s)=>{const e=s[2];let c="",r=s[4],h="";r&&r.startsWith("{%BLOCK%")&&(c=o.blocks[n++],r=r.substring(8),h="{");const a=t({selector:e,content:c});return`${s[1]}${a.selector}${s[3]}${h}${a.content}${r}`})},m=s=>{const t=s.split(g),o=[],n=[];let e=0,c=[];for(let r=0;r0?c.push(s):(c.length>0&&(n.push(c.join("")),o.push("%BLOCK%"),c=[]),o.push(s)),"{"===s&&e++}return c.length>0&&(n.push(c.join("")),o.push("%BLOCK%")),{escapedString:o.join(""),blocks:n}},w=(s,t,o)=>s.replace(t,(...s)=>{if(s[2]){const t=s[2].split(","),n=[];for(let e=0;es+t.replace("-shadowcsshost","")+o,$=(s,t,o)=>t.indexOf("-shadowcsshost")>-1?p(s,t,o):s+t+o+", "+t+" "+s+o,_=(s,t,o,e)=>u(s,s=>{let r=s.selector,h=s.content;return"@"!==s.selector[0]?r=((s,t,o,e)=>s.split(",").map(s=>e&&s.indexOf("."+e)>-1?s.trim():((s,t)=>!(s=>(s=s.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),RegExp("^("+s+")([>\\s~+[.,{:][\\s\\S]*)?$","m")))(t).test(s))(s,t)?((s,t,o)=>{const e="."+(t=t.replace(/\[is=([^\]]*)\]/g,(s,...t)=>t[0])),r=s=>{let r=s.trim();if(!r)return"";if(s.indexOf("-shadowcsshost-no-combinator")>-1)r=((s,t,o)=>{if(c.lastIndex=0,c.test(s)){const t="."+o;return s.replace(n,(s,o)=>o.replace(/([^:]*)(:*)(.*)/,(s,o,n,e)=>o+t+n+e)).replace(c,t+" ")}return t+" "+s})(s,t,o);else{const t=s.replace(c,"");if(t.length>0){const s=t.match(/([^:]*)(:*)(.*)/);s&&(r=s[1]+e+s[2]+s[3])}}return r},h=(s=>{const t=[];let o,n=0;return o=(s=s.replace(/(\[[^\]]*\])/g,(s,o)=>{const e=`__ph-${n}__`;return t.push(o),n++,e})).replace(/(:nth-[-\w]+)(\([^)]+\))/g,(s,o,e)=>{const c=`__ph-${n}__`;return t.push(e),n++,o+c}),{content:o,placeholders:t}})(s);let a,d="",l=0;const i=/( |>|\+|~(?!=))\s*/g;let g=!((s=h.content).indexOf("-shadowcsshost-no-combinator")>-1);for(;null!==(a=i.exec(s));){const t=a[1],o=s.slice(l,a.index).trim();g=g||o.indexOf("-shadowcsshost-no-combinator")>-1,d+=`${g?r(o):o} ${t} `,l=i.lastIndex}const u=s.substring(l);return g=g||u.indexOf("-shadowcsshost-no-combinator")>-1,d+=g?r(u):u,((s,t)=>t.replace(/__ph-(\d+)__/g,(t,o)=>s[+o]))(h.placeholders,d)})(s,t,o).trim():s.trim()).join(", "))(s.selector,t,o,e):(s.selector.startsWith("@media")||s.selector.startsWith("@supports")||s.selector.startsWith("@page")||s.selector.startsWith("@document"))&&(h=_(s.content,t,o,e)),{selector:r.replace(/\s{2,}/g," ").trim(),content:h}}),f=(n,c,i)=>{const g=c+"-h",m=c+"-s",f=(s=>s.match(l)||[])(n);n=(s=>s.replace(d,""))(n);const b=[];if(i){const s=s=>{const t=`/*!@___${b.length}___*/`;return b.push({placeholder:t,comment:`/*!@${s.selector}*/`}),s.selector=t+s.selector,s};n=u(n,t=>"@"!==t.selector[0]?s(t):t.selector.startsWith("@media")||t.selector.startsWith("@supports")||t.selector.startsWith("@page")||t.selector.startsWith("@document")?(t.content=u(t.content,s),t):t)}const x=((n,c,d,l)=>{const i=((s,t)=>{const n="."+t+" > ",e=[];return s=s.replace(o,(...s)=>{if(s[2]){const t=s[2].trim(),o=n+t+s[3];let c="";for(let n=s[4]-1;n>=0;n--){const t=s[5][n];if("}"===t||","===t)break;c=t+c}const r=c+o,h=`${c.trimRight()}${o.trim()}`;return r.trim()!==h.trim()&&e.push({orgSelector:r,updatedSelector:`${h}, ${r}`}),o}return"-shadowcsshost-no-combinator"+s[3]}),{selectors:e,cssText:s}})(n=(s=>w(s,t,$))(n=(t=>w(t,s,p))(n=(s=>s.replace(a,"-shadowcsscontext").replace(r,"-shadowcsshost").replace(h,"-shadowcssslotted"))(n))),l);return n=(s=>e.reduce((s,t)=>s.replace(t," "),s))(n=i.cssText),c&&(n=_(n,c,d,l)),{cssText:(n=(n=n.replace(/-shadowcsshost-no-combinator/g,"."+d)).replace(/>\s*\*\s+([^{, ]+)/gm," $1 ")).trim(),slottedSelectors:i.selectors}})(n,c,g,m);return n=[x.cssText,...f].join("\n"),i&&b.forEach(({placeholder:s,comment:t})=>{n=n.replace(s,t)}),x.slottedSelectors.forEach(s=>{n=n.replace(s.orgSelector,s.updatedSelector)}),n};export{f as scopeCss} \ No newline at end of file diff --git a/examples/stencil/www/build/p-eed6be7f.system.js b/examples/stencil/www/build/p-eed6be7f.system.js new file mode 100644 index 0000000000..5e6570544c --- /dev/null +++ b/examples/stencil/www/build/p-eed6be7f.system.js @@ -0,0 +1 @@ +System.register(["./p-24afcbad.system.js"],(function(t){"use strict";var o,s;return{setters:[function(t){o=t.s;s=t.u}],execute:function(){var i=function(){function t(t){this.key=t;this.todos=o(t);this.onChanges=[]}t.prototype.subscribe=function(t){this.onChanges.push(t)};t.prototype.inform=function(){o(this.key,this.todos);this.onChanges.forEach((function(t){t()}))};t.prototype.addTodo=function(t){this.todos=this.todos.concat({id:s(),title:t,completed:false});this.inform()};t.prototype.toggleAll=function(t){this.todos=this.todos.map((function(o){return Object.assign(Object.assign({},o),{completed:t})}));this.inform()};t.prototype.toggle=function(t){this.todos=this.todos.map((function(o){return o.id!==t?o:Object.assign(Object.assign({},o),{completed:!o.completed})}));this.inform()};t.prototype.destroy=function(t){this.todos=this.todos.filter((function(o){return o.id!==t}));this.inform()};t.prototype.save=function(t,o){this.todos=this.todos.map((function(s){return s.id!==t?s:Object.assign(Object.assign({},s),{title:o})}));this.inform()};t.prototype.clearCompleted=function(){this.todos=this.todos.filter((function(t){return!t.completed}));this.inform()};return t}();t("TodoModelImpl",i)}}})); \ No newline at end of file diff --git a/examples/stencil/www/build/stencil-comp.esm.js b/examples/stencil/www/build/stencil-comp.esm.js new file mode 100644 index 0000000000..91a106d758 --- /dev/null +++ b/examples/stencil/www/build/stencil-comp.esm.js @@ -0,0 +1 @@ +import{b as o}from"./p-8cf04e16.js";import{p as t}from"./p-537d9519.js";t().then(t=>o([["p-ca8086a1",[[1,"todo-app",{model:[16],newTodo:[32],editing:[32],nowShowing:[32]}],[1,"todo-footer",{count:[2],completedCount:[2,"completed-count"],nowShowing:[1,"now-showing"]}],[1,"todo-item",{todo:[16],editing:[4],editText:[32]}]]]],t)); \ No newline at end of file diff --git a/examples/stencil/www/build/stencil-comp.js b/examples/stencil/www/build/stencil-comp.js new file mode 100644 index 0000000000..0c7985da09 --- /dev/null +++ b/examples/stencil/www/build/stencil-comp.js @@ -0,0 +1,132 @@ + +'use strict'; +(function () { + var currentScript = document.currentScript; + + // Safari 10 support type="module" but still download and executes the nomodule script + if (!currentScript || !currentScript.hasAttribute('nomodule') || !('onbeforeload' in currentScript)) { + + /** + * core-js 3.6.5 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2019 Denis Pushkarev (zloirock.ru) + */ +!function(t){"use strict";!function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){e(1),e(55),e(62),e(68),e(70),e(71),e(72),e(73),e(75),e(76),e(78),e(87),e(88),e(89),e(98),e(99),e(101),e(102),e(103),e(105),e(106),e(107),e(108),e(110),e(111),e(112),e(113),e(114),e(115),e(116),e(117),e(118),e(127),e(130),e(131),e(133),e(135),e(136),e(137),e(138),e(139),e(141),e(143),e(146),e(148),e(150),e(151),e(153),e(154),e(155),e(156),e(157),e(159),e(160),e(162),e(163),e(164),e(165),e(166),e(167),e(168),e(169),e(170),e(172),e(173),e(183),e(184),e(185),e(189),e(191),e(192),e(193),e(194),e(195),e(196),e(198),e(201),e(202),e(203),e(204),e(208),e(209),e(212),e(213),e(214),e(215),e(216),e(217),e(218),e(219),e(221),e(222),e(223),e(226),e(227),e(228),e(229),e(230),e(231),e(232),e(233),e(234),e(235),e(236),e(237),e(238),e(240),e(241),e(243),e(248),t.exports=e(246)},function(t,n,e){var r=e(2),o=e(6),i=e(45),a=e(14),u=e(46),c=e(39),f=e(47),s=e(48),l=e(52),p=e(49),h=e(53),v=p("isConcatSpreadable"),g=h>=51||!o((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),d=l("concat"),y=function(t){if(!a(t))return!1;var n=t[v];return void 0!==n?!!n:i(t)};r({target:"Array",proto:!0,forced:!g||!d},{concat:function(t){var n,e,r,o,i,a=u(this),l=s(a,0),p=0;for(n=-1,r=arguments.length;n9007199254740991)throw TypeError("Maximum allowed index exceeded");for(e=0;e=9007199254740991)throw TypeError("Maximum allowed index exceeded");f(l,p++,i)}return l.length=p,l}})},function(t,n,e){var r=e(3),o=e(4).f,i=e(18),a=e(21),u=e(22),c=e(32),f=e(44);t.exports=function(t,n){var e,s,l,p,h,v=t.target,g=t.global,d=t.stat;if(e=g?r:d?r[v]||u(v,{}):(r[v]||{}).prototype)for(s in n){if(p=n[s],l=t.noTargetGet?(h=o(e,s))&&h.value:e[s],!f(g?s:v+(d?".":"#")+s,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;c(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),a(e,s,p,t)}}},function(t,n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof global&&global)||Function("return this")()},function(t,n,e){var r=e(5),o=e(7),i=e(8),a=e(9),u=e(13),c=e(15),f=e(16),s=Object.getOwnPropertyDescriptor;n.f=r?s:function(t,n){if(t=a(t),n=u(n,!0),f)try{return s(t,n)}catch(t){}if(c(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n,e){var r=e(6);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:r},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(10),o=e(12);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(6),o=e(11),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){var r=e(14);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var r=e(5),o=e(6),i=e(17);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(3),o=e(14),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},function(t,n,e){var r=e(5),o=e(19),i=e(8);t.exports=r?function(t,n,e){return o.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(5),o=e(16),i=e(20),a=e(13),u=Object.defineProperty;n.f=r?u:function(t,n,e){if(i(t),n=a(n,!0),i(e),o)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(14);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n,e){var r=e(3),o=e(18),i=e(15),a=e(22),u=e(23),c=e(25),f=c.get,s=c.enforce,l=String(String).split("String");(t.exports=function(t,n,e,u){var c=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,p=!!u&&!!u.noTargetGet;"function"==typeof e&&("string"!=typeof n||i(e,"name")||o(e,"name",n),s(e).source=l.join("string"==typeof n?n:"")),t!==r?(c?!p&&t[n]&&(f=!0):delete t[n],f?t[n]=e:o(t,n,e)):f?t[n]=e:a(n,e)})(Function.prototype,"toString",(function(){return"function"==typeof this&&f(this).source||u(this)}))},function(t,n,e){var r=e(3),o=e(18);t.exports=function(t,n){try{o(r,t,n)}catch(e){r[t]=n}return n}},function(t,n,e){var r=e(24),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},function(t,n,e){var r=e(3),o=e(22),i=r["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,n,e){var r,o,i,a=e(26),u=e(3),c=e(14),f=e(18),s=e(15),l=e(27),p=e(31),h=u.WeakMap;if(a){var v=new h,g=v.get,d=v.has,y=v.set;r=function(t,n){return y.call(v,t,n),n},o=function(t){return g.call(v,t)||{}},i=function(t){return d.call(v,t)}}else{var x=l("state");p[x]=!0,r=function(t,n){return f(t,x,n),n},o=function(t){return s(t,x)?t[x]:{}},i=function(t){return s(t,x)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(n){var e;if(!c(n)||(e=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}}},function(t,n,e){var r=e(3),o=e(23),i=r.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,n,e){var r=e(28),o=e(30),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n,e){var r=e(29),o=e(24);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!1},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+r).toString(36)}},function(t,n){t.exports={}},function(t,n,e){var r=e(15),o=e(33),i=e(4),a=e(19);t.exports=function(t,n){for(var e=o(n),u=a.f,c=i.f,f=0;fc;)r(u,e=n[c++])&&(~i(f,e)||f.push(e));return f}},function(t,n,e){var r=e(9),o=e(39),i=e(41),a=function(t){return function(n,e,a){var u,c=r(n),f=o(c.length),s=i(a,f);if(t&&e!=e){for(;f>s;)if((u=c[s++])!=u)return!0}else for(;f>s;s++)if((t||s in c)&&c[s]===e)return t||s||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,n,e){var r=e(40),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){var r=e(40),o=Math.max,i=Math.min;t.exports=function(t,n){var e=r(t);return e<0?o(e+n,0):i(e,n)}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,e){var r=e(6),o=/#|\.prototype\./,i=function(t,n){var e=u[a(t)];return e==f||e!=c&&("function"==typeof n?r(n):!!n)},a=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=i.data={},c=i.NATIVE="N",f=i.POLYFILL="P";t.exports=i},function(t,n,e){var r=e(11);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,n,e){var r=e(12);t.exports=function(t){return Object(r(t))}},function(t,n,e){var r=e(13),o=e(19),i=e(8);t.exports=function(t,n,e){var a=r(n);a in t?o.f(t,a,i(0,e)):t[a]=e}},function(t,n,e){var r=e(14),o=e(45),i=e(49)("species");t.exports=function(t,n){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)?r(e)&&null===(e=e[i])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===n?0:n)}},function(t,n,e){var r=e(3),o=e(28),i=e(15),a=e(30),u=e(50),c=e(51),f=o("wks"),s=r.Symbol,l=c?s:s&&s.withoutSetter||a;t.exports=function(t){return i(f,t)||(u&&i(s,t)?f[t]=s[t]:f[t]=l("Symbol."+t)),f[t]}},function(t,n,e){var r=e(6);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(t,n,e){var r=e(50);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,n,e){var r=e(6),o=e(49),i=e(53),a=o("species");t.exports=function(t){return i>=51||!r((function(){var n=[];return(n.constructor={})[a]=function(){return{foo:1}},1!==n[t](Boolean).foo}))}},function(t,n,e){var r,o,i=e(3),a=e(54),u=i.process,c=u&&u.versions,f=c&&c.v8;f?o=(r=f.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=r[1]),t.exports=o&&+o},function(t,n,e){var r=e(34);t.exports=r("navigator","userAgent")||""},function(t,n,e){var r=e(2),o=e(56),i=e(57);r({target:"Array",proto:!0},{copyWithin:o}),i("copyWithin")},function(t,n,e){var r=e(46),o=e(41),i=e(39),a=Math.min;t.exports=[].copyWithin||function(t,n){var e=r(this),u=i(e.length),c=o(t,u),f=o(n,u),s=arguments.length>2?arguments[2]:void 0,l=a((void 0===s?u:o(s,u))-f,u-c),p=1;for(f0;)f in e?e[c]=e[f]:delete e[c],c+=p,f+=p;return e}},function(t,n,e){var r=e(49),o=e(58),i=e(19),a=r("unscopables"),u=Array.prototype;null==u[a]&&i.f(u,a,{configurable:!0,value:o(null)}),t.exports=function(t){u[a][t]=!0}},function(t,n,e){var r,o=e(20),i=e(59),a=e(42),u=e(31),c=e(61),f=e(17),s=e(27),l=s("IE_PROTO"),p=function(){},h=function(t){return" + + + + + +

    Double-click to edit a todo

    +

    Created by yoavaa

    +

    Part of TodoMVC

    + + +