2.0.1 • Published 7 months ago

@uidu/email-renderer v2.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

Email renderer

This package provides renderer that is capable of rendering email-friendly HTML from ADF documents.

Usage

Use as follows:

import { defaultSchema } from '@uidu/adf-schema';
import { EmailSerializer } from '@uidu/email-renderer';

const document = ... // Your ADF JSON document

const serializer = EmailSerializer.fromSchema(defaultSchema);
const node = defaultSchema.nodeFromJSON(document);
const result = serializer.serializeFragment(node.content);

Development

Project consists of different serializers in order to render ADF into html

ADF nodes serializers are stored in src/nodes ADF marks serializers are stored in src/marks

HTML rendering occurs via traversal of the ADF and calling the serializer corresponding to each visited ADF Node, as well as applying any marks that exist on a node.

Adding new embedded images / icons

This will generate static image modules that can be used to easily embed inside of email as part of a ADF node serializer, etc.

Currently uses a custom build process, which like this: SVG -> PNG -> Base64 -> TypeScript Module

  • Add the source image to src/static/svg folder and to generator config src/static/image-sources.ts
  • run yarn run build:images
2.0.1

7 months ago

2.0.0

7 months ago

1.12.5

10 months ago

1.12.3

1 year ago

1.12.4

1 year ago

1.12.2

1 year ago

1.12.1

1 year ago

1.12.0

1 year ago

1.11.2

1 year ago

1.11.1

1 year ago

1.11.0

1 year ago

1.10.0

1 year ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.14

2 years ago

1.3.15

2 years ago

1.3.10

2 years ago

1.3.13

2 years ago

1.3.11

2 years ago

1.3.12

2 years ago

1.3.9

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.3.8

2 years ago

0.1.8

2 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago