ag-common 0.0.796 → 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
|
})));
|
|
@@ -32,18 +32,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.useTooltip = void 0;
|
|
40
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
41
37
|
const react_1 = __importStar(require("react"));
|
|
42
38
|
const react_dom_1 = require("react-dom");
|
|
43
|
-
const Base = styled_1.default.div `
|
|
44
|
-
position: absolute;
|
|
45
|
-
z-index: 10;
|
|
46
|
-
`;
|
|
47
39
|
const Comp = ({ pos, children, }) => {
|
|
48
40
|
const ref = (0, react_1.createRef)();
|
|
49
41
|
const [size, setSize] = (0, react_1.useState)();
|
|
@@ -100,7 +92,7 @@ const Comp = ({ pos, children, }) => {
|
|
|
100
92
|
top = 0;
|
|
101
93
|
}
|
|
102
94
|
}
|
|
103
|
-
const Content = (react_1.default.createElement(
|
|
95
|
+
const Content = (react_1.default.createElement("div", { "data-type": "tooltip-content", ref: ref, className: "absolute z-10", style: Object.assign(Object.assign({ left,
|
|
104
96
|
right,
|
|
105
97
|
top,
|
|
106
98
|
bottom }, (!pos.hasParent && { position: 'fixed' })), (!size && { zIndex: -1 })) }, children(pos, size)));
|
package/package.json
CHANGED