ag-common 0.0.797 → 0.0.798
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.
|
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Markdown = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
9
8
|
const common_1 = require("../../../common");
|
|
10
9
|
const array_1 = require("../../../common/helpers/array");
|
|
11
10
|
const trim_1 = require("../../../common/helpers/string/trim");
|
|
11
|
+
const utils_1 = require("../../helpers/utils");
|
|
12
12
|
const injectTable = ({ tableRows, preprocessText, }) => (react_1.default.createElement("table", { key: (0, common_1.hashCode)(JSON.stringify(tableRows)) },
|
|
13
13
|
react_1.default.createElement("thead", null,
|
|
14
14
|
react_1.default.createElement("tr", null, tableRows[0]
|
|
@@ -62,9 +62,7 @@ function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
|
62
62
|
}
|
|
63
63
|
//ol
|
|
64
64
|
if (line.match(/^[0-9]+\./gim)) {
|
|
65
|
-
|
|
66
|
-
ol = { matchLine: line, outputIndex: output.length };
|
|
67
|
-
}
|
|
65
|
+
ol !== null && ol !== void 0 ? ol : (ol = { matchLine: line, outputIndex: output.length });
|
|
68
66
|
}
|
|
69
67
|
else if (ol && ol.matchLine !== line) {
|
|
70
68
|
output = injectGroup({
|
|
@@ -76,9 +74,7 @@ function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
|
76
74
|
}
|
|
77
75
|
//ul
|
|
78
76
|
if (line.startsWith('-') || line.startsWith('*')) {
|
|
79
|
-
|
|
80
|
-
ul = { matchLine: line, outputIndex: output.length };
|
|
81
|
-
}
|
|
77
|
+
ul !== null && ul !== void 0 ? ul : (ul = { matchLine: line, outputIndex: output.length });
|
|
82
78
|
}
|
|
83
79
|
else if (ul && ul.matchLine !== line) {
|
|
84
80
|
output = injectGroup({
|
|
@@ -134,28 +130,7 @@ function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
|
134
130
|
} while (a < lines.length);
|
|
135
131
|
return output;
|
|
136
132
|
}
|
|
137
|
-
const
|
|
138
|
-
> * {
|
|
139
|
-
margin: 0;
|
|
140
|
-
white-space: pre-wrap;
|
|
141
|
-
}
|
|
142
|
-
ul {
|
|
143
|
-
display: grid;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
h1,
|
|
147
|
-
h2,
|
|
148
|
-
h3,
|
|
149
|
-
h4,
|
|
150
|
-
h5,
|
|
151
|
-
h6,
|
|
152
|
-
ol,
|
|
153
|
-
ul,
|
|
154
|
-
table {
|
|
155
|
-
margin-bottom: 1rem;
|
|
156
|
-
}
|
|
157
|
-
`;
|
|
158
|
-
const Markdown = (p) => (react_1.default.createElement(Base, { className: p.className }, renderMarkdown({
|
|
133
|
+
const Markdown = (p) => (react_1.default.createElement("div", { className: (0, utils_1.cn)('*:m-0', '*:whitespace-pre-wrap', '[&>ul]:grid', '[&>h1]:mb-4', '[&>h2]:mb-4', '[&>h3]:mb-4', '[&>h4]:mb-4', '[&>h5]:mb-4', '[&>h6]:mb-4', '[&>ol]:mb-4', '[&>ul]:mb-4', '[&>table]:mb-4', p.className) }, renderMarkdown({
|
|
159
134
|
preprocessText: p.preprocessText,
|
|
160
135
|
markdown: p.markdown.trim(),
|
|
161
136
|
})));
|
package/package.json
CHANGED