From 50fa6492565c68be6fd4698d1de039e358e72e94 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 00:37:04 +0100 Subject: [PATCH 1/8] fix(hdom): add DEFAULT_IMPL to re-exports (#47) --- packages/hdom/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/hdom/src/index.ts b/packages/hdom/src/index.ts index f7ca9cf68f..e33ab1e275 100644 --- a/packages/hdom/src/index.ts +++ b/packages/hdom/src/index.ts @@ -1,4 +1,5 @@ export * from "./api"; +export * from "./default"; export * from "./diff"; export * from "./dom"; export * from "./normalize"; From 436edc0f26b2b320b02ef4096930a23981f7a11c Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 00:37:32 +0100 Subject: [PATCH 2/8] Publish - @thi.ng/hdom-canvas@0.1.3 - @thi.ng/hdom@5.0.3 - @thi.ng/transducers-hdom@1.1.4 --- packages/hdom-canvas/CHANGELOG.md | 9 +++++++++ packages/hdom-canvas/package.json | 4 ++-- packages/hdom/CHANGELOG.md | 12 ++++++++++++ packages/hdom/package.json | 2 +- packages/transducers-hdom/CHANGELOG.md | 9 +++++++++ packages/transducers-hdom/package.json | 4 ++-- 6 files changed, 35 insertions(+), 5 deletions(-) diff --git a/packages/hdom-canvas/CHANGELOG.md b/packages/hdom-canvas/CHANGELOG.md index a953d26a1e..215ea29890 100644 --- a/packages/hdom-canvas/CHANGELOG.md +++ b/packages/hdom-canvas/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@0.1.2...@thi.ng/hdom-canvas@0.1.3) (2018-09-24) + +**Note:** Version bump only for package @thi.ng/hdom-canvas + + + + + ## [0.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@0.1.1...@thi.ng/hdom-canvas@0.1.2) (2018-09-24) diff --git a/packages/hdom-canvas/package.json b/packages/hdom-canvas/package.json index bc35c61122..541fc3b010 100644 --- a/packages/hdom-canvas/package.json +++ b/packages/hdom-canvas/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-canvas", - "version": "0.1.2", + "version": "0.1.3", "description": "Declarative canvas scenegraph & visualization for @thi.ng/hdom", "main": "./index.js", "typings": "./index.d.ts", @@ -31,7 +31,7 @@ "@thi.ng/api": "^4.2.1", "@thi.ng/checks": "^1.5.11", "@thi.ng/diff": "^1.1.2", - "@thi.ng/hdom": "^5.0.2" + "@thi.ng/hdom": "^5.0.3" }, "keywords": [ "ES6", diff --git a/packages/hdom/CHANGELOG.md b/packages/hdom/CHANGELOG.md index 694be3c7cf..597f266b56 100644 --- a/packages/hdom/CHANGELOG.md +++ b/packages/hdom/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [5.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@5.0.2...@thi.ng/hdom@5.0.3) (2018-09-24) + + +### Bug Fixes + +* **hdom:** add DEFAULT_IMPL to re-exports ([#47](https://github.com/thi-ng/umbrella/issues/47)) ([50fa649](https://github.com/thi-ng/umbrella/commit/50fa649)) + + + + + ## [5.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@5.0.1...@thi.ng/hdom@5.0.2) (2018-09-24) diff --git a/packages/hdom/package.json b/packages/hdom/package.json index f66e0f009a..d4a1301687 100644 --- a/packages/hdom/package.json +++ b/packages/hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom", - "version": "5.0.2", + "version": "5.0.3", "description": "Lightweight vanilla ES6 UI component trees with customizable branch-local behaviors", "main": "./index.js", "typings": "./index.d.ts", diff --git a/packages/transducers-hdom/CHANGELOG.md b/packages/transducers-hdom/CHANGELOG.md index ebc85864f8..07550063d9 100644 --- a/packages/transducers-hdom/CHANGELOG.md +++ b/packages/transducers-hdom/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@1.1.3...@thi.ng/transducers-hdom@1.1.4) (2018-09-24) + +**Note:** Version bump only for package @thi.ng/transducers-hdom + + + + + ## [1.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@1.1.2...@thi.ng/transducers-hdom@1.1.3) (2018-09-24) diff --git a/packages/transducers-hdom/package.json b/packages/transducers-hdom/package.json index d6cceacd6e..cfab8f1b11 100644 --- a/packages/transducers-hdom/package.json +++ b/packages/transducers-hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-hdom", - "version": "1.1.3", + "version": "1.1.4", "description": "Transducer based UI updater for @thi.ng/hdom", "main": "./index.js", "typings": "./index.d.ts", @@ -29,7 +29,7 @@ }, "dependencies": { "@thi.ng/checks": "^1.5.11", - "@thi.ng/hdom": "^5.0.2", + "@thi.ng/hdom": "^5.0.3", "@thi.ng/transducers": "^2.1.4" }, "keywords": [ From 5a893d5bdf07c5d3a164b7e9201a2dc92292557d Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 00:45:27 +0100 Subject: [PATCH 3/8] docs(examples): update table --- examples/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/README.md b/examples/README.md index 1007040b42..8d9b0dccd2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -37,3 +37,4 @@ If you want to [contribute](../CONTRIBUTING.md) an example, please get in touch | 29 | [transducers-hdom](./transducers-hdom) | Transducer & rstream based hdom UI updates | hdom, rstream, transducers-hdom | basic | | 30 | [triple-query](./triple-query) | Triple store query results & sortable table | atom, hdom, hdom-components, rstream-query, transducers | intermediate | | 31 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic | +| 32 | [xml-converter](./xml-converter) | XML/HTML/SVG to hiccup conversion as you type | rstream, sax, transducers, transducers-hdom | basic | From 5119b67eb593c1b8b5333f901dacfc0eb61cb775 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 02:08:58 +0100 Subject: [PATCH 4/8] feat(sax): add opt support for boolean attribs, add tests --- packages/sax/src/index.ts | 41 ++++++++++++++++++++++++++++++++++---- packages/sax/test/index.ts | 23 +++++++++++++++++++-- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/packages/sax/src/index.ts b/packages/sax/src/index.ts index 4f21a8a952..4765924d6b 100644 --- a/packages/sax/src/index.ts +++ b/packages/sax/src/index.ts @@ -27,8 +27,23 @@ export interface ParseOpts { * Default: false */ trim: boolean; + /** + * If `true`, HTML5 boolean attributes are supported. + * + * Default: false + */ + boolean: boolean; + /** + * If given, element names in this set are allowed to omit their + * closing `/`. E.g. `` vs `` + * + * Default: undefined (none allowed) + */ + // voidTags: Set; // TODO #48 } +export const VOID_TAGS = new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")); + export interface ParseElement { tag: string; attribs: IObjectOf; @@ -342,10 +357,7 @@ const PARSER: FSMStateMap = { } } else { if (ch === ">") { - state.state = State.ELEM_BODY; - state.scope.push({ tag: state.tag, attribs: state.attribs, children: [] }); - state.body = ""; - return [{ type: Type.ELEM_START, tag: state.tag, attribs: state.attribs }]; + return beginElementBody(state); } else if (ch === "/") { state.state = State.ELEM_SINGLE; } else if (!isWS(ch)) { @@ -361,6 +373,20 @@ const PARSER: FSMStateMap = { state.name += ch; } else if (ch === "=") { state.state = State.ATTRIB_VAL_START; + } else if (state.opts.boolean) { + if (ch === " ") { + state.attribs[state.name] = true; + state.state = State.MAYBE_ATTRIB; + } else if (ch === "/") { + state.attribs[state.name] = true; + state.state = State.ELEM_SINGLE; + return; + } else if (ch === ">") { + state.attribs[state.name] = true; + return beginElementBody(state); + } else { + return unexpected(state, ch); + } } else { return unexpected(state, ch); } @@ -515,3 +541,10 @@ const PARSER: FSMStateMap = { } }, }; + +const beginElementBody = (state: ParseState) => { + state.state = State.ELEM_BODY; + state.scope.push({ tag: state.tag, attribs: state.attribs, children: [] }); + state.body = ""; + return [{ type: Type.ELEM_START, tag: state.tag, attribs: state.attribs }]; +}; diff --git a/packages/sax/test/index.ts b/packages/sax/test/index.ts index 6876c47102..fe2ae9805c 100644 --- a/packages/sax/test/index.ts +++ b/packages/sax/test/index.ts @@ -120,11 +120,11 @@ describe("sax", () => { it("errors", () => { assert.deepEqual( - [...tx.iterator(sax.parse(), "a")], + [...sax.parse("a")], [{ type: 7, body: "unexpected char: 'a' @ pos 1" }] ); assert.deepEqual( - [...tx.iterator(sax.parse(), "")], + [...sax.parse("")], [ { type: 4, tag: "a", attribs: {} }, { type: 4, tag: "b", attribs: {} }, @@ -132,4 +132,23 @@ describe("sax", () => { ] ); }); + + it("boolean attribs", () => { + assert.deepEqual( + [...sax.parse({ boolean: true }, ``)], + [ + { type: 4, tag: "foo", attribs: { a: true, b: "2", c: true } }, + { type: 5, tag: "foo", attribs: { a: true, b: "2", c: true }, children: [] } + ], + "no slash" + ) + assert.deepEqual( + [...sax.parse({ boolean: true }, ``)], + [ + { type: 4, tag: "foo", attribs: { a: true, b: "2", c: true } }, + { type: 5, tag: "foo", attribs: { a: true, b: "2", c: true } } + ], + "with slash" + ) + }); }); From 0cddc7d678bb8c2fc10e6f761c6cdb6edd8b33ac Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 02:09:32 +0100 Subject: [PATCH 5/8] feat(example): update xml-converter (add boolean attrib support) --- examples/xml-converter/index.html | 6 ++++-- examples/xml-converter/src/index.ts | 22 ++-------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/examples/xml-converter/index.html b/examples/xml-converter/index.html index cfc00c1ff9..65695cbea8 100644 --- a/examples/xml-converter/index.html +++ b/examples/xml-converter/index.html @@ -16,9 +16,11 @@

Current limitations

    -
  • No HTML quirks allowed (well formed XML only)
  • -
  • No HTML boolean attribs
  • +
  • Nicer output formatting needed
  • +
  • No HTML quirks supported (well formed XML only)
  • +
  • No HTML boolean attribs
  • Probably many more... :)
  • +
  • See issue #48
Source code
diff --git a/examples/xml-converter/src/index.ts b/examples/xml-converter/src/index.ts index 2cb5f8b1f8..f4cbc63175 100644 --- a/examples/xml-converter/src/index.ts +++ b/examples/xml-converter/src/index.ts @@ -16,7 +16,7 @@ import { multiplex } from "@thi.ng/transducers/xform/multiplex"; const parseXML = (src: string) => transduce( comp( - parse({ trim: true }), + parse({ trim: true, boolean: true }), filter((e) => e.type === Type.ELEM_END || e.type === Type.ERROR) ), last(), @@ -107,6 +107,7 @@ src.next(`
+ `); @@ -114,22 +115,3 @@ if (process.env.NODE_ENV !== "production") { const hot = (module).hot; hot && hot.dispose(() => src.done()); } - -["html", - { - "lang": "en" - }, - [ - "head", - [ - "title", - "foo" - ] - ], - [ - "body.foo.bar", - [ - "div#app" - ] - ] -] \ No newline at end of file From 0cce048818e61bc3f7606082e870531d5af3fee1 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 14:09:53 +0100 Subject: [PATCH 6/8] feat(strings): add splice(), refactor repeat(), add tests --- packages/strings/README.md | 2 +- packages/strings/package.json | 3 ++- packages/strings/src/center.ts | 8 ++++---- packages/strings/src/index.ts | 1 + packages/strings/src/repeat.ts | 2 +- packages/strings/src/splice.ts | 32 ++++++++++++++++++++++++++++++++ packages/strings/test/index.ts | 2 +- packages/strings/test/splice.ts | 29 +++++++++++++++++++++++++++++ 8 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 packages/strings/src/splice.ts create mode 100644 packages/strings/test/splice.ts diff --git a/packages/strings/README.md b/packages/strings/README.md index 9ab38a59d0..bf6def08b2 100644 --- a/packages/strings/README.md +++ b/packages/strings/README.md @@ -21,7 +21,7 @@ This project is part of the ## About Various higher-order, but low-level string formatting & utility -functions, some memoized. WIP / Alpha. +functions, some memoized. WIP / Alpha. Please sources for now. ## Installation diff --git a/packages/strings/package.json b/packages/strings/package.json index 10cf623f66..8078e5a7ba 100644 --- a/packages/strings/package.json +++ b/packages/strings/package.json @@ -28,6 +28,7 @@ "typescript": "^3.0.1" }, "dependencies": { + "@thi.ng/errors": "^0.1.9", "@thi.ng/memoize": "^0.2.3" }, "keywords": [ @@ -43,4 +44,4 @@ "publishConfig": { "access": "public" } -} +} \ No newline at end of file diff --git a/packages/strings/src/center.ts b/packages/strings/src/center.ts index 23aa06c956..a2a6597b5c 100644 --- a/packages/strings/src/center.ts +++ b/packages/strings/src/center.ts @@ -20,11 +20,11 @@ import { truncate } from "./truncate"; * ``` * * @param lineWidth target length - * @param ch pad character(s) + * @param pad pad character(s) */ -export const center: (lineWidth: number, ch?: string | number) => Stringer = - memoizeJ>((n, ch = " ") => { - const buf = repeat(ch, n); +export const center: (lineWidth: number, pad?: string | number) => Stringer = + memoizeJ>((n, pad = " ") => { + const buf = repeat(pad, n); return (x: any) => { if (x == null) return buf; x = x.toString(); diff --git a/packages/strings/src/index.ts b/packages/strings/src/index.ts index 8b09d3e2d0..55ff7a5424 100644 --- a/packages/strings/src/index.ts +++ b/packages/strings/src/index.ts @@ -9,6 +9,7 @@ export * from "./parse"; export * from "./percent"; export * from "./radix"; export * from "./repeat"; +export * from "./splice"; export * from "./truncate"; export * from "./truncate-left"; export * from "./wrap"; diff --git a/packages/strings/src/repeat.ts b/packages/strings/src/repeat.ts index 8a5101500a..86738ee717 100644 --- a/packages/strings/src/repeat.ts +++ b/packages/strings/src/repeat.ts @@ -5,5 +5,5 @@ import { memoizeJ } from "@thi.ng/memoize/memoizej"; * @param n repeat count */ export const repeat = memoizeJ( - (ch: string, n: number) => new Array(n).fill(ch).join("") + (ch: string, n: number) => ch.repeat(n) ); diff --git a/packages/strings/src/splice.ts b/packages/strings/src/splice.ts new file mode 100644 index 0000000000..7aa846314d --- /dev/null +++ b/packages/strings/src/splice.ts @@ -0,0 +1,32 @@ +import { illegalArgs } from "@thi.ng/errors/illegal-arguments"; + +/** + * Forms a new strings which inserts given `insert` string into `src` + * string at `from` position and appends remaining `src` chars from + * original `to` position. If `from` and `to` are equal (`to` by default + * is), the operation is a pure insertion. If not, then some chars from + * `src` will be removed in the new string. If either position is + * negative, it'll be considered relative to the end of the `src`. + * + * @param src + * @param insert + * @param from + * @param to + */ +export const splice = (src: string, insert: string, from: number, to = from) => { + if (from < 0) { + from += src.length; + } + if (to < 0) { + to += src.length; + } + if (from > to) { + illegalArgs("'from' index must be <= 'to'"); + } + to = Math.max(to, 0); + return from <= 0 ? + insert + src.substr(to) : + from >= src.length ? + src + insert : + src.substr(0, from) + insert + src.substr(to); +}; diff --git a/packages/strings/test/index.ts b/packages/strings/test/index.ts index dac73b9054..4b5bff721e 100644 --- a/packages/strings/test/index.ts +++ b/packages/strings/test/index.ts @@ -13,7 +13,7 @@ describe("strings", () => { assert.strictEqual(str.padLeft(5), str.padLeft(5)); }); - it("padr", () => { + it("padRight", () => { assert.equal(str.padRight(4)(undefined), " "); assert.equal(str.padRight(4, "0")(null), "0000"); assert.equal(str.padRight(4)(1), "1 "); diff --git a/packages/strings/test/splice.ts b/packages/strings/test/splice.ts new file mode 100644 index 0000000000..c5e7968415 --- /dev/null +++ b/packages/strings/test/splice.ts @@ -0,0 +1,29 @@ +import * as assert from "assert"; +import { splice } from "../src/splice"; + +const SRC = "abc"; + +describe("splice", () => { + it("pos index", () => { + assert.equal(splice(SRC, "x", 0), "xabc"); + assert.equal(splice(SRC, "x", 1), "axbc"); + assert.equal(splice(SRC, "x", 2), "abxc"); + assert.equal(splice(SRC, "x", 3), "abcx"); + assert.equal(splice(SRC, "x", 4), "abcx"); + }); + it("neg index", () => { + assert.equal(splice(SRC, "x", -1), "abxc"); + assert.equal(splice(SRC, "x", -2), "axbc"); + assert.equal(splice(SRC, "x", -3), "xabc"); + assert.equal(splice(SRC, "x", -4), "xabc"); + }); + it("w/ deletion", () => { + assert.equal(splice(SRC, "xx", 0, 1), "xxbc"); + assert.equal(splice(SRC, "xx", 1, 2), "axxc"); + assert.equal(splice(SRC, "xx", 2, 4), "abxx"); + assert.equal(splice(SRC, "xx", -1, 4), "abxx"); + assert.equal(splice(SRC, "xx", -2, 4), "axx"); + assert.equal(splice(SRC, "xx", -3, 4), "xx"); + assert.equal(splice(SRC, "xx", -3, 2), "xxc"); + }); +}); \ No newline at end of file From 79cf49e1d471a48e0ad5e7e18de32d32bdea13c3 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 14:13:30 +0100 Subject: [PATCH 7/8] feat(examples): add value coercions & re-formatter (xml-converter) --- examples/xml-converter/index.html | 16 +- examples/xml-converter/src/index.ts | 241 ++++++++++++++++++++++------ 2 files changed, 198 insertions(+), 59 deletions(-) diff --git a/examples/xml-converter/index.html b/examples/xml-converter/index.html index 65695cbea8..274ce607a5 100644 --- a/examples/xml-converter/index.html +++ b/examples/xml-converter/index.html @@ -14,15 +14,17 @@
-

Current limitations

+

Current features

    -
  • Nicer output formatting needed
  • -
  • No HTML quirks supported (well formed XML only)
  • -
  • No HTML boolean attribs
  • -
  • Probably many more... :)
  • -
  • See issue #48
  • +
  • HTML boolean attribs
  • +
  • Numeric & boolean attrib value parsing
  • +
  • style attrib conversion
  • +
  • Standard HTML entity unescaping
  • +
  • Input must be well formed XML
  • +
  • Hiccup specific (more compact) JSON formatting
  • +
  • See issue #48
- Source code + Source code
diff --git a/examples/xml-converter/src/index.ts b/examples/xml-converter/src/index.ts index f4cbc63175..86950425ac 100644 --- a/examples/xml-converter/src/index.ts +++ b/examples/xml-converter/src/index.ts @@ -1,9 +1,17 @@ -import { stream } from "@thi.ng/rstream/stream"; +import { isArray } from "@thi.ng/checks/is-array"; +import { isBoolean } from "@thi.ng/checks/is-boolean"; +import { isNumber } from "@thi.ng/checks/is-number"; +import { isPlainObject } from "@thi.ng/checks/is-plain-object"; +import { DEFAULT, defmulti } from "@thi.ng/defmulti"; +import { stream, Stream } from "@thi.ng/rstream/stream"; import { parse, Type } from "@thi.ng/sax"; +import { splice } from "@thi.ng/strings/splice"; import { maybeParseFloat } from "@thi.ng/strings/parse"; +import { repeat } from "@thi.ng/strings/repeat"; import { updateDOM } from "@thi.ng/transducers-hdom"; import { comp } from "@thi.ng/transducers/func/comp"; import { identity } from "@thi.ng/transducers/func/identity"; +import { peek } from "@thi.ng/transducers/func/peek"; import { pairs } from "@thi.ng/transducers/iter/pairs"; import { assocObj } from "@thi.ng/transducers/rfn/assoc-obj"; import { last } from "@thi.ng/transducers/rfn/last"; @@ -13,34 +21,53 @@ import { filter } from "@thi.ng/transducers/xform/filter"; import { map } from "@thi.ng/transducers/xform/map"; import { multiplex } from "@thi.ng/transducers/xform/multiplex"; +// parses given XMLish string using @thi.ng/sax transducer into a tree +// sequence of parse events. we only care about the final (or error) +// event, which will be related to the final close tag and contains the +// entire tree const parseXML = (src: string) => transduce( comp( - parse({ trim: true, boolean: true }), + parse({ trim: true, boolean: true, entities: true }), filter((e) => e.type === Type.ELEM_END || e.type === Type.ERROR) ), last(), src ); +// transforms string of CSS properties into a plain object +const transformCSS = (css: string) => + css.split(";").reduce( + (acc, p) => { + const [k, v] = p.split(":"); + acc[k.trim()] = v.trim(); + return acc; + }, + {} + ); + +// takes attrib key-value pair and attempts to coerce / transform its +// value. returns updated pair. +const parseAttrib = ([k, v]: string[]) => + k === "style" ? + [k, transformCSS(v)] : + v === "true" ? + [k, true] : + v === "false" ? + [k, false] : + [k, maybeParseFloat(v, v)]; + +// transforms an entire object of attributes const transformAttribs = (attribs: any) => transduce( - comp( - map(([k, v]) => [k, maybeParseFloat(v, null)]), - filter(([_, v]) => v !== null), - ), + map(parseAttrib), assocObj(), attribs, - pairs(attribs) + pairs(attribs) ); -const transformTree = (tree) => { - if (tree.type === Type.ERROR) { - return ["error", tree.body]; - } - const res: any[] = []; - const attribs = transformAttribs(tree.attribs); - let tag = tree.tag; +// transforms element name by attempting to form Emmet-like tags +const transformTag = (tag: string, attribs: any) => { if (attribs.id) { tag += "#" + attribs.id; delete attribs.id; @@ -49,7 +76,16 @@ const transformTree = (tree) => { tag += "." + attribs.class.replace(/\s+/g, "."); delete attribs.class; } - res.push(tag); + return tag; +}; + +// recursively transforms entire parse tree +const transformTree = (tree: any) => { + if (tree.type === Type.ERROR) { + return ["error", tree.body]; + } + const attribs = transformAttribs(tree.attribs); + const res: any[] = [transformTag(tree.tag, attribs)]; if (Object.keys(attribs).length) { res.push(attribs); } @@ -62,55 +98,156 @@ const transformTree = (tree) => { return res; }; -const app = ([html, hiccup]) => - ["div.flex", - ["div", - ["h3", "XML/HTML source", - ["small.fw1.ml2", "(must be well formed!)"]], - ["textarea.mr2.f7.code.bg-light-yellow", - { - cols: 72, - rows: 25, - oninput: (e) => src.next(e.target.value), - value: html - }] - ], - ["div", - ["h3", "Parsed Hiccup / JSON"], - ["textarea.f7.code", - { - cols: 72, - rows: 25, - disabled: true - }, - JSON.stringify(hiccup, null, 2) +// dispatch helper function for the `format` defmulti below +const classify = (x: any) => + isArray(x) ? "array" : isPlainObject(x) ? "obj" : DEFAULT; + +// wraps attrib name in quotes if needed +const formatAttrib = (x: string) => + /^[a-z]+$/i.test(x) ? x : `"${x}"`; + +// attrib or body value formatter +const formatVal = (x: any, indent: number, istep: number) => + isNumber(x) || isBoolean(x) ? + x : + isPlainObject(x) ? + format(x, "", indent + istep, istep) : + `"${x}"`; + +// attrib key-value pair formatter w/ indentation +const formatPair = (x: any, k: string, indent: number, istep: number) => + `${spaces(indent)}${formatAttrib(k)}: ${formatVal(x[k], indent, istep)}`; + +// memoized indentations +const spaces = (n: number) => repeat(" ", n); + +// multiply dispatch function to format the transformed tree (hiccup +// structure) into a more compact & legible format than produced by +// standard: `JSON.stringify(tree, null, 4)` +const format = defmulti(classify); + +// implementation for array values +format.add("array", (x, res, indent, istep) => { + const hasAttribs = isPlainObject(x[1]); + let attribs = hasAttribs ? Object.keys(x[1]) : []; + res += `${spaces(indent)}["${x[0]}"`; + if (hasAttribs) { + res += ", "; + res = format(x[1], res, indent + istep, istep); + } + // single line if none or only single child + // and if max. 1 CSS prop + if (x.length === (hasAttribs ? 3 : 2) && + attribs.length < 2 && + attribs[0] !== "style" && + classify(peek(x)) === DEFAULT) { + return format(peek(x), res += ", ", 0, istep) + "]"; + } + // default format if more children + for (let i = hasAttribs ? 2 : 1; i < x.length; i++) { + res += ",\n"; + res = format(x[i], res, indent + istep, istep); + } + res += "]"; + return res; +}); + +// implementation for object values (i.e. attributes in this case) +format.add("obj", (x, res, indent, istep) => { + const keys = Object.keys(x); + if (keys.length === 1 && + (keys[0] !== "style" || Object.keys(x.style).length == 1)) { + res += `{ ${formatPair(x, keys[0], 0, istep)} }`; + } else { + const outer = spaces(indent); + res += `\n${outer}{\n`; + for (let k in x) { + res += formatPair(x, k, indent + istep, istep) + ",\n"; + } + res += outer + "}"; + } + return res; +}); + +// implementation for other values +format.add(DEFAULT, (x, res, indent, istep) => + res += spaces(indent) + formatVal(x, indent, istep)); + +// hdom UI root component receives tuple of xml & formatted hiccup +// strings. defined as closure purely for demonstration purposes and to +// avoid app using global vars +const app = (src: Stream) => + ([xml, hiccup]: string[]) => + ["div.flex", + ["div", + ["h3", "XML/HTML source", + ["small.fw1.ml2", "(must be well formed!)"]], + ["textarea.mr2.f7.code.bg-light-yellow", + { + cols: 72, + rows: 25, + autofocus: true, + onkeydown: (e: KeyboardEvent) => { + // override tab to insert spaces at edit pos + if (e.key === "Tab") { + e.preventDefault(); + src.next( + splice(xml, spaces(4), (e.target).selectionStart) + ); + } + }, + // emitting a new value to the stream will + // re-trigger UI update + oninput: (e) => src.next(e.target.value), + value: xml + }] + ], + ["div", + ["h3", "Parsed Hiccup / JSON"], + ["textarea.f7.code", + { + cols: 72, + rows: 25, + disabled: true, + value: hiccup + }, + ] ] - ] - ]; - -const src = stream() - .transform( - multiplex( - map(identity), - comp( - map(parseXML), - map(transformTree) - ) - ), - map(app), - updateDOM() - ); + ]; + +// create a stream which transforms input values (xml strings) parses, +// transforms and formats them and then forms a tuple of: +// `[orig, formatted]` to pass to the root component function and +// finally updates the DOM +const src = stream(); +src.transform( + multiplex( + map(identity), + comp( + map(parseXML), + map(transformTree), + map((tree) => format(tree, "", 0, 4)) + ) + ), + map(app(src)), + updateDOM() +); +// seed input and kick off UI/app src.next(` foo +

+ HTML & Hiccup walk into a bar... +

`); +// ParcelJS HMR handling if (process.env.NODE_ENV !== "production") { const hot = (module).hot; hot && hot.dispose(() => src.done()); From 04872dbe30d6c521c59ebaef57acb61b9cd0ae40 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 25 Sep 2018 14:31:00 +0100 Subject: [PATCH 8/8] Publish - @thi.ng/associative@0.6.10 - @thi.ng/cache@0.2.27 - @thi.ng/csp@0.3.66 - @thi.ng/dcons@1.1.10 - @thi.ng/dgraph@0.2.22 - @thi.ng/hdom-components@2.2.9 - @thi.ng/hiccup-css@0.2.25 - @thi.ng/iges@0.2.15 - @thi.ng/iterators@4.1.31 - @thi.ng/range-coder@0.1.15 - @thi.ng/rstream-csp@0.1.111 - @thi.ng/rstream-dot@0.2.50 - @thi.ng/rstream-gestures@0.5.12 - @thi.ng/rstream-graph@2.1.36 - @thi.ng/rstream-log@1.0.62 - @thi.ng/rstream-query@0.3.49 - @thi.ng/rstream@1.13.4 - @thi.ng/sax@0.5.0 - @thi.ng/strings@0.5.0 - @thi.ng/transducers-fsm@0.2.23 - @thi.ng/transducers-hdom@1.1.5 - @thi.ng/transducers-stats@0.4.10 - @thi.ng/transducers@2.1.5 --- packages/associative/CHANGELOG.md | 9 +++++++++ packages/associative/package.json | 6 +++--- packages/cache/CHANGELOG.md | 9 +++++++++ packages/cache/package.json | 6 +++--- packages/csp/CHANGELOG.md | 9 +++++++++ packages/csp/package.json | 6 +++--- packages/dcons/CHANGELOG.md | 9 +++++++++ packages/dcons/package.json | 4 ++-- packages/dgraph/CHANGELOG.md | 9 +++++++++ packages/dgraph/package.json | 6 +++--- packages/hdom-components/CHANGELOG.md | 9 +++++++++ packages/hdom-components/package.json | 4 ++-- packages/hiccup-css/CHANGELOG.md | 9 +++++++++ packages/hiccup-css/package.json | 4 ++-- packages/iges/CHANGELOG.md | 9 +++++++++ packages/iges/package.json | 6 +++--- packages/iterators/CHANGELOG.md | 9 +++++++++ packages/iterators/package.json | 4 ++-- packages/range-coder/CHANGELOG.md | 9 +++++++++ packages/range-coder/package.json | 4 ++-- packages/rstream-csp/CHANGELOG.md | 9 +++++++++ packages/rstream-csp/package.json | 6 +++--- packages/rstream-dot/CHANGELOG.md | 9 +++++++++ packages/rstream-dot/package.json | 4 ++-- packages/rstream-gestures/CHANGELOG.md | 9 +++++++++ packages/rstream-gestures/package.json | 6 +++--- packages/rstream-graph/CHANGELOG.md | 9 +++++++++ packages/rstream-graph/package.json | 6 +++--- packages/rstream-log/CHANGELOG.md | 9 +++++++++ packages/rstream-log/package.json | 6 +++--- packages/rstream-query/CHANGELOG.md | 9 +++++++++ packages/rstream-query/package.json | 10 +++++----- packages/rstream/CHANGELOG.md | 9 +++++++++ packages/rstream/package.json | 6 +++--- packages/sax/CHANGELOG.md | 12 ++++++++++++ packages/sax/package.json | 6 +++--- packages/strings/CHANGELOG.md | 12 ++++++++++++ packages/strings/package.json | 4 ++-- packages/transducers-fsm/CHANGELOG.md | 9 +++++++++ packages/transducers-fsm/package.json | 4 ++-- packages/transducers-hdom/CHANGELOG.md | 9 +++++++++ packages/transducers-hdom/package.json | 4 ++-- packages/transducers-stats/CHANGELOG.md | 9 +++++++++ packages/transducers-stats/package.json | 6 +++--- packages/transducers/CHANGELOG.md | 9 +++++++++ packages/transducers/package.json | 4 ++-- 46 files changed, 274 insertions(+), 61 deletions(-) diff --git a/packages/associative/CHANGELOG.md b/packages/associative/CHANGELOG.md index 358d46d94a..00d9945344 100644 --- a/packages/associative/CHANGELOG.md +++ b/packages/associative/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.6.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@0.6.9...@thi.ng/associative@0.6.10) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/associative + + + + + ## [0.6.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@0.6.8...@thi.ng/associative@0.6.9) (2018-09-24) diff --git a/packages/associative/package.json b/packages/associative/package.json index 6d2103739f..48b90ff347 100644 --- a/packages/associative/package.json +++ b/packages/associative/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/associative", - "version": "0.6.9", + "version": "0.6.10", "description": "Alternative Set & Map data type implementations with customizable equality semantics & supporting operations", "main": "./index.js", "typings": "./index.d.ts", @@ -31,10 +31,10 @@ "@thi.ng/api": "^4.2.1", "@thi.ng/checks": "^1.5.11", "@thi.ng/compare": "^0.1.9", - "@thi.ng/dcons": "^1.1.9", + "@thi.ng/dcons": "^1.1.10", "@thi.ng/equiv": "^0.1.11", "@thi.ng/errors": "^0.1.9", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "data structures", diff --git a/packages/cache/CHANGELOG.md b/packages/cache/CHANGELOG.md index d9cc1a1fdf..f862bf5eb0 100644 --- a/packages/cache/CHANGELOG.md +++ b/packages/cache/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.2.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@0.2.26...@thi.ng/cache@0.2.27) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/cache + + + + + ## [0.2.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@0.2.25...@thi.ng/cache@0.2.26) (2018-09-24) diff --git a/packages/cache/package.json b/packages/cache/package.json index 82c4227a67..8ddb2218c3 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/cache", - "version": "0.2.26", + "version": "0.2.27", "description": "In-memory cache implementations with ES6 Map-like API and different eviction strategies", "main": "./index.js", "typings": "./index.d.ts", @@ -29,8 +29,8 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/dcons": "^1.1.9", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/dcons": "^1.1.10", + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "cache", diff --git a/packages/csp/CHANGELOG.md b/packages/csp/CHANGELOG.md index 8dfd32de4f..f62d1ab808 100644 --- a/packages/csp/CHANGELOG.md +++ b/packages/csp/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.3.66](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@0.3.65...@thi.ng/csp@0.3.66) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/csp + + + + + ## [0.3.65](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@0.3.64...@thi.ng/csp@0.3.65) (2018-09-24) diff --git a/packages/csp/package.json b/packages/csp/package.json index 5ec3a7f4d9..2fa4d1388d 100644 --- a/packages/csp/package.json +++ b/packages/csp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/csp", - "version": "0.3.65", + "version": "0.3.66", "description": "ES6 promise based CSP implementation", "main": "./index.js", "typings": "./index.d.ts", @@ -34,9 +34,9 @@ "dependencies": { "@thi.ng/api": "^4.2.1", "@thi.ng/checks": "^1.5.11", - "@thi.ng/dcons": "^1.1.9", + "@thi.ng/dcons": "^1.1.10", "@thi.ng/errors": "^0.1.9", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "async", diff --git a/packages/dcons/CHANGELOG.md b/packages/dcons/CHANGELOG.md index c28b236145..03ef0f80ea 100644 --- a/packages/dcons/CHANGELOG.md +++ b/packages/dcons/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.1.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@1.1.9...@thi.ng/dcons@1.1.10) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/dcons + + + + + ## [1.1.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@1.1.8...@thi.ng/dcons@1.1.9) (2018-09-24) diff --git a/packages/dcons/package.json b/packages/dcons/package.json index 2d3521ce78..e5bd0c1645 100644 --- a/packages/dcons/package.json +++ b/packages/dcons/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dcons", - "version": "1.1.9", + "version": "1.1.10", "description": "Comprehensive doubly linked list structure w/ iterator support", "main": "./index.js", "typings": "./index.d.ts", @@ -33,7 +33,7 @@ "@thi.ng/compare": "^0.1.9", "@thi.ng/equiv": "^0.1.11", "@thi.ng/errors": "^0.1.9", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "datastructure", diff --git a/packages/dgraph/CHANGELOG.md b/packages/dgraph/CHANGELOG.md index f6bad146f4..a2735a52c8 100644 --- a/packages/dgraph/CHANGELOG.md +++ b/packages/dgraph/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@0.2.21...@thi.ng/dgraph@0.2.22) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/dgraph + + + + + ## [0.2.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@0.2.20...@thi.ng/dgraph@0.2.21) (2018-09-24) diff --git a/packages/dgraph/package.json b/packages/dgraph/package.json index 75ec7dcad2..d86eac92ff 100644 --- a/packages/dgraph/package.json +++ b/packages/dgraph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dgraph", - "version": "0.2.21", + "version": "0.2.22", "description": "Type-agnostic directed acyclic graph (DAG) & graph operations", "main": "./index.js", "typings": "./index.d.ts", @@ -29,10 +29,10 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/associative": "^0.6.9", + "@thi.ng/associative": "^0.6.10", "@thi.ng/equiv": "^0.1.11", "@thi.ng/errors": "^0.1.9", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "data structure", diff --git a/packages/hdom-components/CHANGELOG.md b/packages/hdom-components/CHANGELOG.md index dc06cac56f..b090a087fb 100644 --- a/packages/hdom-components/CHANGELOG.md +++ b/packages/hdom-components/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.2.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@2.2.8...@thi.ng/hdom-components@2.2.9) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/hdom-components + + + + + ## [2.2.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@2.2.7...@thi.ng/hdom-components@2.2.8) (2018-09-24) diff --git a/packages/hdom-components/package.json b/packages/hdom-components/package.json index 9416639010..86c170bf15 100644 --- a/packages/hdom-components/package.json +++ b/packages/hdom-components/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-components", - "version": "2.2.8", + "version": "2.2.9", "description": "Raw, skinnable UI & SVG components for @thi.ng/hdom", "main": "./index.js", "typings": "./index.d.ts", @@ -30,7 +30,7 @@ "dependencies": { "@thi.ng/api": "^4.2.1", "@thi.ng/checks": "^1.5.11", - "@thi.ng/transducers": "^2.1.4", + "@thi.ng/transducers": "^2.1.5", "@types/webgl2": "^0.0.4" }, "keywords": [ diff --git a/packages/hiccup-css/CHANGELOG.md b/packages/hiccup-css/CHANGELOG.md index 0ad51bcb49..cfaca52bb6 100644 --- a/packages/hiccup-css/CHANGELOG.md +++ b/packages/hiccup-css/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.2.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@0.2.24...@thi.ng/hiccup-css@0.2.25) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/hiccup-css + + + + + ## [0.2.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@0.2.23...@thi.ng/hiccup-css@0.2.24) (2018-09-24) diff --git a/packages/hiccup-css/package.json b/packages/hiccup-css/package.json index 1e0e1e2eae..1cda2dcf36 100644 --- a/packages/hiccup-css/package.json +++ b/packages/hiccup-css/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-css", - "version": "0.2.24", + "version": "0.2.25", "description": "CSS from nested JS data structures", "main": "./index.js", "typings": "./index.d.ts", @@ -31,7 +31,7 @@ "@thi.ng/api": "^4.2.1", "@thi.ng/checks": "^1.5.11", "@thi.ng/errors": "^0.1.9", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "clojure", diff --git a/packages/iges/CHANGELOG.md b/packages/iges/CHANGELOG.md index aecfc68775..d0697d25e2 100644 --- a/packages/iges/CHANGELOG.md +++ b/packages/iges/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.2.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@0.2.14...@thi.ng/iges@0.2.15) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/iges + + + + + ## [0.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@0.2.13...@thi.ng/iges@0.2.14) (2018-09-24) diff --git a/packages/iges/package.json b/packages/iges/package.json index 2f9b29dc08..4e0e9bf2f4 100644 --- a/packages/iges/package.json +++ b/packages/iges/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iges", - "version": "0.2.14", + "version": "0.2.15", "description": "IGES 5.3 serializer for (currently only) polygonal geometry, both open & closed", "main": "./index.js", "typings": "./index.d.ts", @@ -30,8 +30,8 @@ "dependencies": { "@thi.ng/api": "^4.2.1", "@thi.ng/defmulti": "^0.3.11", - "@thi.ng/strings": "^0.4.3", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/strings": "^0.5.0", + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "CAD", diff --git a/packages/iterators/CHANGELOG.md b/packages/iterators/CHANGELOG.md index aa1033d428..71c4301752 100644 --- a/packages/iterators/CHANGELOG.md +++ b/packages/iterators/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [4.1.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@4.1.30...@thi.ng/iterators@4.1.31) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/iterators + + + + + ## [4.1.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@4.1.29...@thi.ng/iterators@4.1.30) (2018-09-24) diff --git a/packages/iterators/package.json b/packages/iterators/package.json index 1db138610e..6d6c81ec8e 100644 --- a/packages/iterators/package.json +++ b/packages/iterators/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iterators", - "version": "4.1.30", + "version": "4.1.31", "description": "clojure.core inspired, composable ES6 iterators & generators", "main": "./index.js", "typings": "./index.d.ts", @@ -29,7 +29,7 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/dcons": "^1.1.9", + "@thi.ng/dcons": "^1.1.10", "@thi.ng/errors": "^0.1.9" }, "keywords": [ diff --git a/packages/range-coder/CHANGELOG.md b/packages/range-coder/CHANGELOG.md index 9e5ac527b5..c57fd489d3 100644 --- a/packages/range-coder/CHANGELOG.md +++ b/packages/range-coder/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@0.1.14...@thi.ng/range-coder@0.1.15) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/range-coder + + + + + ## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@0.1.13...@thi.ng/range-coder@0.1.14) (2018-09-24) diff --git a/packages/range-coder/package.json b/packages/range-coder/package.json index c5a7db64f9..f06fd6fdee 100644 --- a/packages/range-coder/package.json +++ b/packages/range-coder/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/range-coder", - "version": "0.1.14", + "version": "0.1.15", "description": "Binary data range encoder / decoder", "main": "./index.js", "typings": "./index.d.ts", @@ -20,7 +20,7 @@ "test": "rm -rf build && tsc -p test && nyc mocha build/test/*.js" }, "devDependencies": { - "@thi.ng/transducers": "^2.1.4", + "@thi.ng/transducers": "^2.1.5", "@types/mocha": "^5.2.5", "@types/node": "^10.5.5", "mocha": "^5.2.0", diff --git a/packages/rstream-csp/CHANGELOG.md b/packages/rstream-csp/CHANGELOG.md index b52032fe68..3d629df369 100644 --- a/packages/rstream-csp/CHANGELOG.md +++ b/packages/rstream-csp/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.1.111](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@0.1.110...@thi.ng/rstream-csp@0.1.111) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/rstream-csp + + + + + ## [0.1.110](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@0.1.109...@thi.ng/rstream-csp@0.1.110) (2018-09-24) diff --git a/packages/rstream-csp/package.json b/packages/rstream-csp/package.json index 847d07d3fa..49f5c3d71b 100644 --- a/packages/rstream-csp/package.json +++ b/packages/rstream-csp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-csp", - "version": "0.1.110", + "version": "0.1.111", "description": "@thi.ng/csp bridge module for @thi.ng/rstream", "main": "./index.js", "typings": "./index.d.ts", @@ -28,8 +28,8 @@ "typescript": "^3.0.1" }, "dependencies": { - "@thi.ng/csp": "^0.3.65", - "@thi.ng/rstream": "^1.13.3" + "@thi.ng/csp": "^0.3.66", + "@thi.ng/rstream": "^1.13.4" }, "keywords": [ "bridge", diff --git a/packages/rstream-dot/CHANGELOG.md b/packages/rstream-dot/CHANGELOG.md index 25adb475b6..404a291e97 100644 --- a/packages/rstream-dot/CHANGELOG.md +++ b/packages/rstream-dot/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.2.50](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@0.2.49...@thi.ng/rstream-dot@0.2.50) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/rstream-dot + + + + + ## [0.2.49](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@0.2.48...@thi.ng/rstream-dot@0.2.49) (2018-09-24) diff --git a/packages/rstream-dot/package.json b/packages/rstream-dot/package.json index 41e6c6c08c..a588c4dd96 100644 --- a/packages/rstream-dot/package.json +++ b/packages/rstream-dot/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-dot", - "version": "0.2.49", + "version": "0.2.50", "description": "Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies", "main": "./index.js", "typings": "./index.d.ts", @@ -28,7 +28,7 @@ "typescript": "^3.0.1" }, "dependencies": { - "@thi.ng/rstream": "^1.13.3" + "@thi.ng/rstream": "^1.13.4" }, "keywords": [ "conversion", diff --git a/packages/rstream-gestures/CHANGELOG.md b/packages/rstream-gestures/CHANGELOG.md index 1bdd106ead..9a5e9ee663 100644 --- a/packages/rstream-gestures/CHANGELOG.md +++ b/packages/rstream-gestures/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.5.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@0.5.11...@thi.ng/rstream-gestures@0.5.12) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/rstream-gestures + + + + + ## [0.5.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@0.5.10...@thi.ng/rstream-gestures@0.5.11) (2018-09-24) diff --git a/packages/rstream-gestures/package.json b/packages/rstream-gestures/package.json index 93bdbc7c92..3bc4aec389 100644 --- a/packages/rstream-gestures/package.json +++ b/packages/rstream-gestures/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-gestures", - "version": "0.5.11", + "version": "0.5.12", "description": "Unified mouse, mouse wheel & single-touch event stream abstraction", "main": "./index.js", "typings": "./index.d.ts", @@ -29,8 +29,8 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/rstream": "^1.13.3", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/rstream": "^1.13.4", + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "dataflow", diff --git a/packages/rstream-graph/CHANGELOG.md b/packages/rstream-graph/CHANGELOG.md index 81595f3167..0c6ea542a0 100644 --- a/packages/rstream-graph/CHANGELOG.md +++ b/packages/rstream-graph/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.1.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@2.1.35...@thi.ng/rstream-graph@2.1.36) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/rstream-graph + + + + + ## [2.1.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@2.1.34...@thi.ng/rstream-graph@2.1.35) (2018-09-24) diff --git a/packages/rstream-graph/package.json b/packages/rstream-graph/package.json index 0404b53921..2a772bebe6 100644 --- a/packages/rstream-graph/package.json +++ b/packages/rstream-graph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-graph", - "version": "2.1.35", + "version": "2.1.36", "description": "Declarative dataflow graph construction for @thi.ng/rstream", "main": "./index.js", "typings": "./index.d.ts", @@ -33,8 +33,8 @@ "@thi.ng/errors": "^0.1.9", "@thi.ng/paths": "^1.6.3", "@thi.ng/resolve-map": "^3.0.13", - "@thi.ng/rstream": "^1.13.3", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/rstream": "^1.13.4", + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "compute", diff --git a/packages/rstream-log/CHANGELOG.md b/packages/rstream-log/CHANGELOG.md index 9c1fd797c6..9a013b20e3 100644 --- a/packages/rstream-log/CHANGELOG.md +++ b/packages/rstream-log/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.0.62](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@1.0.61...@thi.ng/rstream-log@1.0.62) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/rstream-log + + + + + ## [1.0.61](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@1.0.60...@thi.ng/rstream-log@1.0.61) (2018-09-24) diff --git a/packages/rstream-log/package.json b/packages/rstream-log/package.json index 5341d9a08a..285f08d365 100644 --- a/packages/rstream-log/package.json +++ b/packages/rstream-log/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-log", - "version": "1.0.61", + "version": "1.0.62", "description": "Structured, multilevel & hierarchical loggers based on @thi.ng/rstream", "main": "./index.js", "typings": "./index.d.ts", @@ -31,8 +31,8 @@ "@thi.ng/api": "^4.2.1", "@thi.ng/checks": "^1.5.11", "@thi.ng/errors": "^0.1.9", - "@thi.ng/rstream": "^1.13.3", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/rstream": "^1.13.4", + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "ES6", diff --git a/packages/rstream-query/CHANGELOG.md b/packages/rstream-query/CHANGELOG.md index be6723f0cd..4f8071df5b 100644 --- a/packages/rstream-query/CHANGELOG.md +++ b/packages/rstream-query/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.3.49](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@0.3.48...@thi.ng/rstream-query@0.3.49) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/rstream-query + + + + + ## [0.3.48](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@0.3.47...@thi.ng/rstream-query@0.3.48) (2018-09-24) diff --git a/packages/rstream-query/package.json b/packages/rstream-query/package.json index 84c6815027..bb00931ad5 100644 --- a/packages/rstream-query/package.json +++ b/packages/rstream-query/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-query", - "version": "0.3.48", + "version": "0.3.49", "description": "@thi.ng/rstream based triple store & reactive query engine", "main": "./index.js", "typings": "./index.d.ts", @@ -29,13 +29,13 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/associative": "^0.6.9", + "@thi.ng/associative": "^0.6.10", "@thi.ng/checks": "^1.5.11", "@thi.ng/equiv": "^0.1.11", "@thi.ng/errors": "^0.1.9", - "@thi.ng/rstream": "^1.13.3", - "@thi.ng/rstream-dot": "^0.2.49", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/rstream": "^1.13.4", + "@thi.ng/rstream-dot": "^0.2.50", + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "dataflow", diff --git a/packages/rstream/CHANGELOG.md b/packages/rstream/CHANGELOG.md index 79ebaa91e4..f2dcf24d34 100644 --- a/packages/rstream/CHANGELOG.md +++ b/packages/rstream/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.13.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@1.13.3...@thi.ng/rstream@1.13.4) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/rstream + + + + + ## [1.13.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@1.13.2...@thi.ng/rstream@1.13.3) (2018-09-24) diff --git a/packages/rstream/package.json b/packages/rstream/package.json index 0b8549075f..6f0d9f8df6 100644 --- a/packages/rstream/package.json +++ b/packages/rstream/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream", - "version": "1.13.3", + "version": "1.13.4", "description": "Reactive multi-tap streams, dataflow & transformation pipeline constructs", "main": "./index.js", "typings": "./index.d.ts", @@ -29,12 +29,12 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/associative": "^0.6.9", + "@thi.ng/associative": "^0.6.10", "@thi.ng/atom": "^1.5.4", "@thi.ng/checks": "^1.5.11", "@thi.ng/errors": "^0.1.9", "@thi.ng/paths": "^1.6.3", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "datastructure", diff --git a/packages/sax/CHANGELOG.md b/packages/sax/CHANGELOG.md index 4d88b168df..4a1cd2086d 100644 --- a/packages/sax/CHANGELOG.md +++ b/packages/sax/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@0.4.1...@thi.ng/sax@0.5.0) (2018-09-25) + + +### Features + +* **sax:** add opt support for boolean attribs, add tests ([5119b67](https://github.com/thi-ng/umbrella/commit/5119b67)) + + + + + ## [0.4.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@0.4.0...@thi.ng/sax@0.4.1) (2018-09-24) diff --git a/packages/sax/package.json b/packages/sax/package.json index dbab0d948c..780c2e8c0f 100644 --- a/packages/sax/package.json +++ b/packages/sax/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/sax", - "version": "0.4.1", + "version": "0.5.0", "description": "Transducer-based, SAX-like, non-validating, speedy & tiny XML parser", "main": "./index.js", "typings": "./index.d.ts", @@ -29,8 +29,8 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/transducers": "^2.1.4", - "@thi.ng/transducers-fsm": "^0.2.22" + "@thi.ng/transducers": "^2.1.5", + "@thi.ng/transducers-fsm": "^0.2.23" }, "keywords": [ "ES6", diff --git a/packages/strings/CHANGELOG.md b/packages/strings/CHANGELOG.md index e3b892efbc..2b4afb89e7 100644 --- a/packages/strings/CHANGELOG.md +++ b/packages/strings/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.4.3...@thi.ng/strings@0.5.0) (2018-09-25) + + +### Features + +* **strings:** add splice(), refactor repeat(), add tests ([0cce048](https://github.com/thi-ng/umbrella/commit/0cce048)) + + + + + ## [0.4.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.4.2...@thi.ng/strings@0.4.3) (2018-09-24) diff --git a/packages/strings/package.json b/packages/strings/package.json index 8078e5a7ba..0d1b119eab 100644 --- a/packages/strings/package.json +++ b/packages/strings/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/strings", - "version": "0.4.3", + "version": "0.5.0", "description": "Various string formatting & utility functions", "main": "./index.js", "typings": "./index.d.ts", @@ -44,4 +44,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/transducers-fsm/CHANGELOG.md b/packages/transducers-fsm/CHANGELOG.md index 2a8c543731..0b23131469 100644 --- a/packages/transducers-fsm/CHANGELOG.md +++ b/packages/transducers-fsm/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.2.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@0.2.22...@thi.ng/transducers-fsm@0.2.23) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/transducers-fsm + + + + + ## [0.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@0.2.21...@thi.ng/transducers-fsm@0.2.22) (2018-09-24) diff --git a/packages/transducers-fsm/package.json b/packages/transducers-fsm/package.json index 3a8341468e..1059becc55 100644 --- a/packages/transducers-fsm/package.json +++ b/packages/transducers-fsm/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-fsm", - "version": "0.2.22", + "version": "0.2.23", "description": "Transducer-based Finite State Machine transformer", "main": "./index.js", "typings": "./index.d.ts", @@ -29,7 +29,7 @@ }, "dependencies": { "@thi.ng/api": "^4.2.1", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "ES6", diff --git a/packages/transducers-hdom/CHANGELOG.md b/packages/transducers-hdom/CHANGELOG.md index 07550063d9..454359f095 100644 --- a/packages/transducers-hdom/CHANGELOG.md +++ b/packages/transducers-hdom/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.1.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@1.1.4...@thi.ng/transducers-hdom@1.1.5) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/transducers-hdom + + + + + ## [1.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@1.1.3...@thi.ng/transducers-hdom@1.1.4) (2018-09-24) diff --git a/packages/transducers-hdom/package.json b/packages/transducers-hdom/package.json index cfab8f1b11..bb0db84c08 100644 --- a/packages/transducers-hdom/package.json +++ b/packages/transducers-hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-hdom", - "version": "1.1.4", + "version": "1.1.5", "description": "Transducer based UI updater for @thi.ng/hdom", "main": "./index.js", "typings": "./index.d.ts", @@ -30,7 +30,7 @@ "dependencies": { "@thi.ng/checks": "^1.5.11", "@thi.ng/hdom": "^5.0.3", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "diff", diff --git a/packages/transducers-stats/CHANGELOG.md b/packages/transducers-stats/CHANGELOG.md index 52dd6c24c9..6891278afd 100644 --- a/packages/transducers-stats/CHANGELOG.md +++ b/packages/transducers-stats/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.4.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@0.4.9...@thi.ng/transducers-stats@0.4.10) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/transducers-stats + + + + + ## [0.4.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@0.4.8...@thi.ng/transducers-stats@0.4.9) (2018-09-24) diff --git a/packages/transducers-stats/package.json b/packages/transducers-stats/package.json index b0944da9c7..b73a717c2e 100644 --- a/packages/transducers-stats/package.json +++ b/packages/transducers-stats/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-stats", - "version": "0.4.9", + "version": "0.4.10", "description": "Transducers for statistical / technical analysis", "main": "./index.js", "typings": "./index.d.ts", @@ -28,9 +28,9 @@ "typescript": "^3.0.1" }, "dependencies": { - "@thi.ng/dcons": "^1.1.9", + "@thi.ng/dcons": "^1.1.10", "@thi.ng/errors": "^0.1.9", - "@thi.ng/transducers": "^2.1.4" + "@thi.ng/transducers": "^2.1.5" }, "keywords": [ "ES6", diff --git a/packages/transducers/CHANGELOG.md b/packages/transducers/CHANGELOG.md index 79016dbf17..bcced9e770 100644 --- a/packages/transducers/CHANGELOG.md +++ b/packages/transducers/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.1.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@2.1.4...@thi.ng/transducers@2.1.5) (2018-09-25) + +**Note:** Version bump only for package @thi.ng/transducers + + + + + ## [2.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@2.1.3...@thi.ng/transducers@2.1.4) (2018-09-24) diff --git a/packages/transducers/package.json b/packages/transducers/package.json index 605f7adf0b..9deb5762ec 100644 --- a/packages/transducers/package.json +++ b/packages/transducers/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers", - "version": "2.1.4", + "version": "2.1.5", "description": "Lightweight transducer implementations for ES6 / TypeScript", "main": "./index.js", "typings": "./index.d.ts", @@ -34,7 +34,7 @@ "@thi.ng/compose": "^0.1.4", "@thi.ng/equiv": "^0.1.11", "@thi.ng/errors": "^0.1.9", - "@thi.ng/strings": "^0.4.3" + "@thi.ng/strings": "^0.5.0" }, "keywords": [ "ES6",