acsi-core 1.2.17 → 1.2.18
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.
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +35 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -15,6 +15,7 @@ import rehypeKatex from 'rehype-katex';
|
|
|
15
15
|
import remarkRehype from 'remark-rehype';
|
|
16
16
|
import rehypeRaw from 'rehype-raw';
|
|
17
17
|
import 'katex/dist/katex.min.css';
|
|
18
|
+
import renderMathInElement from 'katex/contrib/auto-render';
|
|
18
19
|
import Cookies from 'js-cookie';
|
|
19
20
|
export { default as Cookies } from 'js-cookie';
|
|
20
21
|
import moment from 'moment';
|
|
@@ -1596,6 +1597,39 @@ function formatContent(content) {
|
|
|
1596
1597
|
return result.join("\n");
|
|
1597
1598
|
}
|
|
1598
1599
|
|
|
1600
|
+
var RichContentRenderer = function RichContentRenderer(_ref) {
|
|
1601
|
+
var content = _ref.content;
|
|
1602
|
+
var ref = useRef(null);
|
|
1603
|
+
var isHtml = /<\/?[a-z][\s\S]*>/i.test(content);
|
|
1604
|
+
useEffect(function () {
|
|
1605
|
+
if (isHtml && ref.current) {
|
|
1606
|
+
renderMathInElement(ref.current, {
|
|
1607
|
+
delimiters: [{
|
|
1608
|
+
left: "$$",
|
|
1609
|
+
right: "$$",
|
|
1610
|
+
display: false
|
|
1611
|
+
}, {
|
|
1612
|
+
left: "$",
|
|
1613
|
+
right: "$",
|
|
1614
|
+
display: false
|
|
1615
|
+
}]
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
}, [content, isHtml]);
|
|
1619
|
+
if (isHtml) {
|
|
1620
|
+
return React.createElement("div", {
|
|
1621
|
+
ref: ref,
|
|
1622
|
+
dangerouslySetInnerHTML: {
|
|
1623
|
+
__html: content
|
|
1624
|
+
}
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
return React.createElement(ReactMarkdown, {
|
|
1628
|
+
remarkPlugins: [remarkMath, remarkGfm],
|
|
1629
|
+
rehypePlugins: [rehypeKatex, rehypeRaw]
|
|
1630
|
+
}, content);
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1599
1633
|
var CookieService = /*#__PURE__*/function () {
|
|
1600
1634
|
function CookieService() {}
|
|
1601
1635
|
CookieService.setAuthCookie = function setAuthCookie(data) {
|
|
@@ -3575,5 +3609,5 @@ var timeSpanToUtc = (function (time, timezone, format) {
|
|
|
3575
3609
|
|
|
3576
3610
|
var historyCore = createBrowserHistory();
|
|
3577
3611
|
|
|
3578
|
-
export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, Role, TIMEZONE_ID, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, getTimeZoneId, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsFirstCalendar, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, timeSpanToLocalMoment, timeSpanToUtc, useAmplitude, useGoogleSignOut, utcToLocalTime };
|
|
3612
|
+
export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, RichContentRenderer, Role, TIMEZONE_ID, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, getTimeZoneId, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsFirstCalendar, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, timeSpanToLocalMoment, timeSpanToUtc, useAmplitude, useGoogleSignOut, utcToLocalTime };
|
|
3579
3613
|
//# sourceMappingURL=index.modern.js.map
|