@churchapps/apphelper 0.2.52 → 0.2.53

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.
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface Props {
3
+ value: string;
4
+ textAlign?: "left" | "center" | "right";
5
+ }
6
+ export declare function MarkdownPreviewLight({ value: markdownString, textAlign }: Props): React.JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=MarkdownPreviewLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownPreviewLight.d.ts","sourceRoot":"","sources":["../../../src/components/markdownEditor/MarkdownPreviewLight.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;CACxC;AAED,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,cAAmB,EAAE,SAAS,EAAE,EAAE,KAAK,qBAKpF"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MarkdownPreviewLight = void 0;
7
+ const marked_1 = require("marked");
8
+ const react_1 = __importDefault(require("react"));
9
+ function MarkdownPreviewLight({ value: markdownString = "", textAlign }) {
10
+ const html = marked_1.marked.parse(markdownString || "");
11
+ const style = (textAlign) ? { textAlign } : {};
12
+ return react_1.default.createElement("div", { style: style, dangerouslySetInnerHTML: { __html: html } });
13
+ }
14
+ exports.MarkdownPreviewLight = MarkdownPreviewLight;
15
+ //# sourceMappingURL=MarkdownPreviewLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownPreviewLight.js","sourceRoot":"","sources":["../../../src/components/markdownEditor/MarkdownPreviewLight.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAA8B;AAC9B,kDAA0B;AAO1B,SAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,cAAc,GAAG,EAAE,EAAE,SAAS,EAAS;IACnF,MAAM,IAAI,GAAG,eAAM,CAAC,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAC,SAAS,EAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC5C,OAAO,uCAAK,KAAK,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,GAAQ,CAAA;AAE3E,CAAC;AALD,oDAKC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@churchapps/apphelper",
3
- "version": "0.2.52",
3
+ "version": "0.2.53",
4
4
  "description": "Library of helper functions for React and NextJS ChurchApps",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -58,6 +58,7 @@
58
58
  "flexsearch": "0.7.43",
59
59
  "jwt-decode": "^3.1.2",
60
60
  "lexical": "^0.12.0",
61
+ "marked": "^14.1.2",
61
62
  "material-symbols": "^0.11.0",
62
63
  "mui-tel-input": "^4.0.1",
63
64
  "react-activity": "^2.1.3",
@@ -0,0 +1,14 @@
1
+ import {marked} from "marked";
2
+ import React from "react";
3
+
4
+ interface Props {
5
+ value: string;
6
+ textAlign?: "left" | "center" | "right"
7
+ }
8
+
9
+ export function MarkdownPreviewLight({ value: markdownString = "", textAlign }: Props) {
10
+ const html = marked.parse(markdownString || "")
11
+ const style = (textAlign) ? {textAlign} : {}
12
+ return <div style={style} dangerouslySetInnerHTML={{__html: html}}></div>
13
+
14
+ }