email-builder-utils 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export declare function convertJsonToHtml(jsonData: any): string;
1
+ export declare const convertJsonToHtml: (jsonData: any) => string;
2
2
  //# sourceMappingURL=convertJsonToHtml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"convertJsonToHtml.d.ts","sourceRoot":"","sources":["../../src/utils/convertJsonToHtml.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,UAsC9C"}
1
+ {"version":3,"file":"convertJsonToHtml.d.ts","sourceRoot":"","sources":["../../src/utils/convertJsonToHtml.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,GAAI,UAAU,GAAG,WAsC9C,CAAA"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertJsonToHtml = convertJsonToHtml;
3
+ exports.convertJsonToHtml = void 0;
4
4
  const js_beautify_1 = require("js-beautify");
5
5
  const jsonToHTML_1 = require("./jsonToHTML");
6
- function convertJsonToHtml(jsonData) {
6
+ const convertJsonToHtml = (jsonData) => {
7
7
  const rootData = jsonData?.root?.data;
8
8
  const blocksHtml = rootData?.childrenIds.map((childId) => (0, jsonToHTML_1.convertToHtml)(jsonData[childId], jsonData)).join("");
9
9
  const rawHtml = `
@@ -40,4 +40,5 @@ function convertJsonToHtml(jsonData) {
40
40
  </body>
41
41
  </html>`;
42
42
  return (0, js_beautify_1.html)(rawHtml, { indent_size: 2 });
43
- }
43
+ };
44
+ exports.convertJsonToHtml = convertJsonToHtml;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-builder-utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,38 +0,0 @@
1
- export declare enum BlockType {
2
- TEXT = "Text",
3
- IMAGE = "Image",
4
- BUTTON = "Button",
5
- GRID = "Columns",
6
- EMPTY = "EMPTY",
7
- GRIDCELL = "Column",
8
- SPACER = "Spacer",
9
- DIVIDER = "Divider"
10
- }
11
- export declare enum visibility {
12
- PUBLIC = "PUBLIC",
13
- PRIVATE = "PRIVATE",
14
- PRE_DEFINED = "PRE_DEFINED"
15
- }
16
- interface IProps {
17
- imageUrl: string;
18
- text: string;
19
- rows: number;
20
- columns: number;
21
- textAlign: string;
22
- navigateToUrl: string;
23
- altText: string;
24
- cellWidths: number[];
25
- }
26
- interface IStyle {
27
- [key: string]: any;
28
- }
29
- export interface IBlockData {
30
- type: BlockType;
31
- data: {
32
- style: IStyle;
33
- props: IProps;
34
- childrenIds: string[];
35
- };
36
- }
37
- export {};
38
- //# sourceMappingURL=ITemplate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ITemplate.d.ts","sourceRoot":"","sources":["../../src/types/ITemplate.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,YAAY;IAChB,KAAK,UAAU;IACf,QAAQ,WAAW;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC5B;AAED,UAAU,MAAM;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,UAAU,MAAM;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;CACH"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.visibility = exports.BlockType = void 0;
4
- var BlockType;
5
- (function (BlockType) {
6
- BlockType["TEXT"] = "Text";
7
- BlockType["IMAGE"] = "Image";
8
- BlockType["BUTTON"] = "Button";
9
- BlockType["GRID"] = "Columns";
10
- BlockType["EMPTY"] = "EMPTY";
11
- BlockType["GRIDCELL"] = "Column";
12
- BlockType["SPACER"] = "Spacer";
13
- BlockType["DIVIDER"] = "Divider";
14
- })(BlockType || (exports.BlockType = BlockType = {}));
15
- var visibility;
16
- (function (visibility) {
17
- visibility["PUBLIC"] = "PUBLIC";
18
- visibility["PRIVATE"] = "PRIVATE";
19
- visibility["PRE_DEFINED"] = "PRE_DEFINED";
20
- })(visibility || (exports.visibility = visibility = {}));