@evergis/react 3.1.92 → 3.1.93
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/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +13 -4
- package/dist/react.esm.js.map +1 -1
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -23,6 +23,8 @@ require('@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css');
|
|
|
23
23
|
require('mapbox-gl/dist/mapbox-gl.css');
|
|
24
24
|
var react = require('swiper/react');
|
|
25
25
|
var ReactMarkdown = require('react-markdown');
|
|
26
|
+
var rehypeRaw = require('rehype-raw');
|
|
27
|
+
var rehypeSanitize = require('rehype-sanitize');
|
|
26
28
|
var remarkGfm = require('remark-gfm');
|
|
27
29
|
var xterm = require('@xterm/xterm');
|
|
28
30
|
var addonFit = require('@xterm/addon-fit');
|
|
@@ -8063,6 +8065,13 @@ const MarkdownWrapper = styled.div `
|
|
|
8063
8065
|
}
|
|
8064
8066
|
`;
|
|
8065
8067
|
|
|
8068
|
+
const sanitizeSchema = {
|
|
8069
|
+
...rehypeSanitize.defaultSchema,
|
|
8070
|
+
attributes: {
|
|
8071
|
+
...rehypeSanitize.defaultSchema.attributes,
|
|
8072
|
+
"*": [...(rehypeSanitize.defaultSchema.attributes?.["*"] || []), "style"],
|
|
8073
|
+
},
|
|
8074
|
+
};
|
|
8066
8075
|
const ElementMarkdown = React.memo(({ elementConfig, type }) => {
|
|
8067
8076
|
const { attributes } = useWidgetContext(type);
|
|
8068
8077
|
const { t } = useGlobalContext();
|
|
@@ -8083,16 +8092,16 @@ const ElementMarkdown = React.memo(({ elementConfig, type }) => {
|
|
|
8083
8092
|
const shouldShowExpand = expandLength > 0 && markdownString.length > expandLength;
|
|
8084
8093
|
// If expand is not needed, show full content
|
|
8085
8094
|
if (!shouldShowExpand) {
|
|
8086
|
-
return (jsxRuntime.jsx(MarkdownWrapper, { children: jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }) }));
|
|
8095
|
+
return (jsxRuntime.jsx(MarkdownWrapper, { children: jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], rehypePlugins: [rehypeRaw, [rehypeSanitize, sanitizeSchema]], children: markdownString }) }));
|
|
8087
8096
|
}
|
|
8088
8097
|
// Collapsed state
|
|
8089
8098
|
if (!expanded) {
|
|
8090
8099
|
// Truncated content for collapsed state
|
|
8091
8100
|
const truncatedContent = markdownString.substring(0, expandLength);
|
|
8092
|
-
return (jsxRuntime.jsxs(MarkdownWrapper, { children: [jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: truncatedContent }), jsxRuntime.jsx(uilibGl.LegendToggler, { onClick: () => setExpanded(true), children: t("more", { ns: "dashboard", defaultValue: "Подробнее" }) })] }));
|
|
8101
|
+
return (jsxRuntime.jsxs(MarkdownWrapper, { children: [jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], rehypePlugins: [rehypeRaw, [rehypeSanitize, sanitizeSchema]], children: truncatedContent }), jsxRuntime.jsx(uilibGl.LegendToggler, { onClick: () => setExpanded(true), children: t("more", { ns: "dashboard", defaultValue: "Подробнее" }) })] }));
|
|
8093
8102
|
}
|
|
8094
8103
|
// Expanded state
|
|
8095
|
-
return (jsxRuntime.jsxs(MarkdownWrapper, { children: [jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }), jsxRuntime.jsx(uilibGl.LegendToggler, { toggled: true, onClick: () => setExpanded(false), children: t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) })] }));
|
|
8104
|
+
return (jsxRuntime.jsxs(MarkdownWrapper, { children: [jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], rehypePlugins: [rehypeRaw, rehypeSanitize], children: markdownString }), jsxRuntime.jsx(uilibGl.LegendToggler, { toggled: true, onClick: () => setExpanded(false), children: t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) })] }));
|
|
8096
8105
|
});
|
|
8097
8106
|
|
|
8098
8107
|
const SmallPreviewContainer = styled.div `
|
|
@@ -8425,7 +8434,7 @@ const ElementUploader = React.memo(({ elementConfig, type }) => {
|
|
|
8425
8434
|
if (index === -1)
|
|
8426
8435
|
return;
|
|
8427
8436
|
const resourceId = files[index].id;
|
|
8428
|
-
await api.file.deleteResource(resourceId);
|
|
8437
|
+
await api.file.deleteResource({ resourceId });
|
|
8429
8438
|
setFiles(currentFiles => currentFiles.filter(({ id }) => id !== resourceId));
|
|
8430
8439
|
}, [files]);
|
|
8431
8440
|
const renderTitle = React.useMemo(() => {
|