1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { __assign, __rest } from "tslib";
|
17 | import classNames from "classnames";
|
18 | import * as React from "react";
|
19 | import { BLOCKQUOTE, CODE, CODE_BLOCK, HEADING, LABEL, LIST } from "../../common/classes";
|
20 | function htmlElement(tagName, tagClassName) {
|
21 |
|
22 | return function (props) {
|
23 | var className = props.className, elementRef = props.elementRef, children = props.children, htmlProps = __rest(props, ["className", "elementRef", "children"]);
|
24 | return React.createElement(tagName, __assign(__assign({}, htmlProps), { className: classNames(tagClassName, className), ref: elementRef }), children);
|
25 | };
|
26 | }
|
27 |
|
28 |
|
29 | export var H1 = htmlElement("h1", HEADING);
|
30 | export var H2 = htmlElement("h2", HEADING);
|
31 | export var H3 = htmlElement("h3", HEADING);
|
32 | export var H4 = htmlElement("h4", HEADING);
|
33 | export var H5 = htmlElement("h5", HEADING);
|
34 | export var H6 = htmlElement("h6", HEADING);
|
35 | export var Blockquote = htmlElement("blockquote", BLOCKQUOTE);
|
36 | export var Code = htmlElement("code", CODE);
|
37 | export var Pre = htmlElement("pre", CODE_BLOCK);
|
38 | export var Label = htmlElement("label", LABEL);
|
39 |
|
40 |
|
41 | export var OL = htmlElement("ol", LIST);
|
42 | export var UL = htmlElement("ul", LIST);
|
43 |
|
\ | No newline at end of file |