diff --git a/frameworks/ivi-v0.10.0-keyed/gulpfile.js b/frameworks/ivi-v0.10.0-keyed/gulpfile.js deleted file mode 100644 index a37f9911d..000000000 --- a/frameworks/ivi-v0.10.0-keyed/gulpfile.js +++ /dev/null @@ -1,42 +0,0 @@ -const gulp = require('gulp'); -const del = require('del'); -const rollup = require('rollup'); -const rollupNodeResolve = require('rollup-plugin-node-resolve-main-fields'); -const closureCompiler = require('google-closure-compiler').gulp(); - -gulp.task('clean', function () { - return del(['build', 'dist']); -}); - -gulp.task('bundle', ['clean'], function (done) { - return rollup.rollup({ - input: 'src/main.js', - plugins: [ - rollupNodeResolve({ - mainFields: ['es2016', 'module', 'main'], - }), - ] - }).then(function (bundle) { - return bundle.write({ - format: 'es', - file: 'build/bundle.js' - }); - }); -}); - -gulp.task('build', ['bundle'], function () { - return gulp.src(['src/env.js', 'build/bundle.js']) - .pipe(closureCompiler({ - js_output_file: 'main.js', - compilation_level: 'ADVANCED', - language_in: 'ECMASCRIPT_2017', - language_out: 'ECMASCRIPT5_STRICT', - use_types_for_optimization: true, - assume_function_wrapper: true, - isolation_mode: "IIFE", - warning_level: 'QUIET', - rewrite_polyfills: false, - new_type_inf: true - })) - .pipe(gulp.dest('dist')); -}); diff --git a/frameworks/ivi-v0.10.0-keyed/src/env.js b/frameworks/ivi-v0.10.0-keyed/src/env.js deleted file mode 100644 index 480790301..000000000 --- a/frameworks/ivi-v0.10.0-keyed/src/env.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Debug Mode - * - * @const {boolean} - */ -const DEBUG = false; - -/** - * Target Environment - * - * @const {string} - */ -const TARGET = "evergreen"; diff --git a/frameworks/ivi-v0.10.0-keyed/src/main.js b/frameworks/ivi-v0.10.0-keyed/src/main.js deleted file mode 100644 index a11b36d46..000000000 --- a/frameworks/ivi-v0.10.0-keyed/src/main.js +++ /dev/null @@ -1,79 +0,0 @@ -import { Component, component, connect, render, map, elementFactory, disableDirtyChecking } from "ivi"; -import * as h from "ivi-html"; -import * as Events from "ivi-events"; -import { store } from "./store"; - -const GlyphIcon = elementFactory(h.span("glyphicon glyphicon-remove").a({ "aria-hidden": "true" })); - -const Row = component(class extends Component { - constructor(props) { - super(props); - this.click = Events.onClick(() => { store.dispatch({ type: "select", item: this.props.item }); }); - this.del = Events.onClick(() => { store.dispatch({ type: "delete", item: this.props.item }); }); - } - - render() { - const { item, selected } = this.props; - return disableDirtyChecking( - h.tr(selected ? "danger" : "").c( - h.td("col-md-1").c(item.id), - h.td("col-md-4").c(h.a().e(this.click).c(item.label)), - h.td("col-md-1").c( - h.a().e(this.del).c(GlyphIcon()), - ), - h.td("col-md-6"), - ), - ); - } -}); - -const RowConnector = connect( - (prev, id) => { - const item = store.getState().data.value[id]; - const selected = store.getState().selected === item; - return (prev !== null && prev.item === item && prev.selected === selected) ? prev : - { item, selected }; - }, - (props) => Row(props), -); - -const RowListConnector = connect( - (prev) => { - const rows = store.getState().data; - return (prev !== null && prev.rows === rows) ? prev : - { rows, value: rows.value }; - }, - ({ value }) => h.tbody().c(map(value, (r, i) => RowConnector(i).k(r.id))), -); - -function button(text, id) { - return h.div("col-sm-6 smallpad").c( - h.button("btn btn-primary btn-block") - .e(Events.onClick(() => { store.dispatch({ type: id }); })) - .a({ "type": "button", "id": id }) - .c(text), - ); -} - -render( - h.div("container").c( - h.div("jumbotron").c( - h.div("row").c( - h.div("col-md-6").c(h.h1().c("ivi")), - h.div("col-md-6").c( - h.div("row").c( - button("Create 1,000 rows", "run"), - button("Create 10,000 rows", "runlots"), - button("Append 1,000 rows", "add"), - button("Update every 10th row", "update"), - button("Clear", "clear"), - button("Swap Rows", "swaprows"), - ), - ), - ), - ), - h.table("table table-hover table-striped test-data").c(RowListConnector()), - GlyphIcon("preloadicon glyphicon glyphicon-remove"), - ), - document.getElementById("main"), -); diff --git a/frameworks/ivi-v0.10.0-keyed/.gitignore b/frameworks/ivi-v0.13.0-keyed/.gitignore similarity index 100% rename from frameworks/ivi-v0.10.0-keyed/.gitignore rename to frameworks/ivi-v0.13.0-keyed/.gitignore diff --git a/frameworks/ivi-v0.10.0-keyed/index.html b/frameworks/ivi-v0.13.0-keyed/index.html similarity index 70% rename from frameworks/ivi-v0.10.0-keyed/index.html rename to frameworks/ivi-v0.13.0-keyed/index.html index e82ba3d70..0be5dfa2d 100644 --- a/frameworks/ivi-v0.10.0-keyed/index.html +++ b/frameworks/ivi-v0.13.0-keyed/index.html @@ -3,13 +3,13 @@
-