1.2.0 • Published 3 years ago

reactive-cards-util v1.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Content transformation utilities for Reactive Cards

RHAST (ReactiveCards Html-like Abstract Syntax Tree)

RHAST is to JSX as HAST is to HTML

Similar to HAST in the Unified collected, RHAST adds JSX Code elements in addition to text and native elements

Utilities included

  • RHAST to JSX (creates raw JSX string output)
  • RHAST to Hyperscript code (like a JSX transpiler)
  • JSX to RHAST (a fast, tiny javascript-based JSX parser)

RCAST (Reactive Cards Abstract Syntax Tree)

RCAST is to Reactive Cards JSX as ReactElement is to React JSX

Similar to Reacts internal virtual dom, RCAST is an abstract syntax tree that

  • has a type as the tagName (or function) of every element
  • has a props bag (equivalent to properties in RHAST, HAST)
  • has the children listed in the props bag instead of separately

Utilities included:

  • JSX to RCAST (a fast, tiny javascript-based JSX parser)
  • RCAST to RHAST
  • Adaptive Cards JSON to RCAST (a simple re-export of ReactiveCards.createFromObject)
  • RCAST to Adaptive Cards JSON (a simple re-export of ReactiveCards.render)

Dependencies

Each of these utilities is intended to be a tiny javascript transformer that can be used on its own or plugged into frameworks like Unified

The only transformer with an external dependency is the RHAST to JSX formatter, that uses a similarly tiny rhype-format to prettify the abstract syntax tree with additional line breaks and spaces before formatting

1.2.0

3 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.5.31

5 years ago

0.5.30

5 years ago

0.5.29

5 years ago

0.5.28

5 years ago

0.5.27

5 years ago

0.5.26

5 years ago

0.5.25

5 years ago

0.5.24

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.1

5 years ago