@skbkontur/markdown 1.0.3
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/README.md +11 -0
- package/index.d.ts +5 -0
- package/index.js +3 -0
- package/package.json +105 -0
- package/src/Markdown/Files/Files.logic.d.ts +13 -0
- package/src/Markdown/Files/Files.logic.js +123 -0
- package/src/Markdown/Markdown.d.ts +20 -0
- package/src/Markdown/Markdown.js +148 -0
- package/src/Markdown/Markdown.styled.d.ts +69 -0
- package/src/Markdown/Markdown.styled.js +72 -0
- package/src/Markdown/MarkdownActions.d.ts +18 -0
- package/src/Markdown/MarkdownActions.js +64 -0
- package/src/Markdown/MarkdownEditor.d.ts +13 -0
- package/src/Markdown/MarkdownEditor.js +42 -0
- package/src/Markdown/MarkdownFormat.d.ts +18 -0
- package/src/Markdown/MarkdownFormat.js +19 -0
- package/src/Markdown/MarkdownHelpItems.d.ts +25 -0
- package/src/Markdown/MarkdownHelpItems.js +219 -0
- package/src/Markdown/MarkdownHelpers/MarkdownButton.d.ts +10 -0
- package/src/Markdown/MarkdownHelpers/MarkdownButton.js +10 -0
- package/src/Markdown/MarkdownHelpers/MarkdownCombination.d.ts +8 -0
- package/src/Markdown/MarkdownHelpers/MarkdownCombination.js +15 -0
- package/src/Markdown/MarkdownHelpers/MarkdownFormatButton.d.ts +8 -0
- package/src/Markdown/MarkdownHelpers/MarkdownFormatButton.js +11 -0
- package/src/Markdown/MarkdownHelpers/markdownHelpers.d.ts +10 -0
- package/src/Markdown/MarkdownHelpers/markdownHelpers.js +103 -0
- package/src/Markdown/MarkdownHelpers/markdownMentionHelpers.d.ts +7 -0
- package/src/Markdown/MarkdownHelpers/markdownMentionHelpers.js +44 -0
- package/src/Markdown/MarkdownHelpers/markdownTextareaHelpers.d.ts +11 -0
- package/src/Markdown/MarkdownHelpers/markdownTextareaHelpers.js +86 -0
- package/src/Markdown/MarkdownMention.d.ts +11 -0
- package/src/Markdown/MarkdownMention.js +88 -0
- package/src/Markdown/constants.d.ts +3 -0
- package/src/Markdown/constants.js +3 -0
- package/src/Markdown/types/turndownPluginGfm.d.ts +1 -0
- package/src/Markdown/types.d.ts +39 -0
- package/src/Markdown/types.js +5 -0
- package/src/Markdown/utils/guid.d.ts +6 -0
- package/src/Markdown/utils/guid.js +23 -0
- package/src/Markdown/utils/htmlToMd.d.ts +2 -0
- package/src/Markdown/utils/htmlToMd.js +5 -0
- package/src/Markdown/utils/isMacintosh.d.ts +1 -0
- package/src/Markdown/utils/isMacintosh.js +3 -0
- package/src/Markdown/utils/requestStatus.d.ts +6 -0
- package/src/Markdown/utils/requestStatus.js +7 -0
- package/src/Markdown/utils/saveFile.d.ts +1 -0
- package/src/Markdown/utils/saveFile.js +9 -0
- package/src/MarkdownIcons/AttachLink.d.ts +1 -0
- package/src/MarkdownIcons/AttachLink.js +5 -0
- package/src/MarkdownIcons/AttachPaperclip.d.ts +1 -0
- package/src/MarkdownIcons/AttachPaperclip.js +3 -0
- package/src/MarkdownIcons/CheckedList.d.ts +1 -0
- package/src/MarkdownIcons/CheckedList.js +8 -0
- package/src/MarkdownIcons/Collapse.d.ts +1 -0
- package/src/MarkdownIcons/Collapse.js +4 -0
- package/src/MarkdownIcons/Expand.d.ts +1 -0
- package/src/MarkdownIcons/Expand.js +4 -0
- package/src/MarkdownIcons/EyeOpen.d.ts +1 -0
- package/src/MarkdownIcons/EyeOpen.js +4 -0
- package/src/MarkdownIcons/List.d.ts +1 -0
- package/src/MarkdownIcons/List.js +8 -0
- package/src/MarkdownIcons/MarkdownIcons.styled.d.ts +2 -0
- package/src/MarkdownIcons/MarkdownIcons.styled.js +8 -0
- package/src/MarkdownIcons/NumberedList.d.ts +1 -0
- package/src/MarkdownIcons/NumberedList.js +6 -0
- package/src/MarkdownIcons/Table.d.ts +1 -0
- package/src/MarkdownIcons/Table.js +3 -0
- package/src/MarkdownIcons/ToolPencil.d.ts +1 -0
- package/src/MarkdownIcons/ToolPencil.js +3 -0
- package/src/MarkdownViewer/Helpers/MarkdownImage.d.ts +6 -0
- package/src/MarkdownViewer/Helpers/MarkdownImage.js +6 -0
- package/src/MarkdownViewer/Helpers/MarkdownLink.d.ts +2 -0
- package/src/MarkdownViewer/Helpers/MarkdownLink.js +5 -0
- package/src/MarkdownViewer/MarkdownViewer.d.ts +12 -0
- package/src/MarkdownViewer/MarkdownViewer.js +64 -0
- package/src/MarkdownViewer/MarkdownViewer.styles.d.ts +8 -0
- package/src/MarkdownViewer/MarkdownViewer.styles.js +15 -0
- package/src/MarkdownViewer/index.d.ts +1 -0
- package/src/MarkdownViewer/index.js +1 -0
- package/src/MarkdownViewer/types.d.ts +7 -0
- package/src/MarkdownViewer/types.js +1 -0
- package/src/styles/styled-components.d.ts +5 -0
- package/src/styles/styled-components.js +4 -0
- package/src/styles/theme.d.ts +11 -0
- package/src/styles/theme.js +13 -0
- package/src/styles/types.d.ts +9 -0
- package/src/styles/types.js +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { getTextareaTokens } from './markdownTextareaHelpers';
|
|
3
|
+
var ArrowsVertical = ['ArrowUp', 'ArrowDown'];
|
|
4
|
+
export function mentionActions(event, setToken) {
|
|
5
|
+
var _a = event.currentTarget, value = _a.value, selectionStart = _a.selectionStart;
|
|
6
|
+
var tokens = getTextareaTokens(value);
|
|
7
|
+
var mention = tokens.find(function (t) { return selectionStart >= t.positions[0] && selectionStart <= t.positions[1] && t.value.startsWith('@'); });
|
|
8
|
+
if (mention) {
|
|
9
|
+
setToken(mention);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
setToken(undefined);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export var useMenuKeyListener = function (onUserSelect, users, menuRef) {
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
var keyListener = function (event) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) {
|
|
20
|
+
if (ArrowsVertical.includes(event.key)) {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
if (event.key === 'ArrowUp')
|
|
23
|
+
menuRef.current.up();
|
|
24
|
+
if (event.key === 'ArrowDown')
|
|
25
|
+
menuRef.current.down();
|
|
26
|
+
}
|
|
27
|
+
if (event.key === 'Enter' && (users === null || users === void 0 ? void 0 : users.length)) {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
var selected = users[menuRef.current.state.highlightedIndex];
|
|
30
|
+
onUserSelect((_a = selected.login) !== null && _a !== void 0 ? _a : '', selected.name);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
window.addEventListener('keydown', keyListener);
|
|
35
|
+
return function () { return window.removeEventListener('keydown', keyListener); };
|
|
36
|
+
}, [menuRef, onUserSelect, users]);
|
|
37
|
+
};
|
|
38
|
+
export var getMentionValue = function (mention) { var _a, _b; return (_b = (_a = mention === null || mention === void 0 ? void 0 : mention.value) === null || _a === void 0 ? void 0 : _a.replace('@', '')) !== null && _b !== void 0 ? _b : ''; };
|
|
39
|
+
export function getAvatarUrl(sid) {
|
|
40
|
+
if (!sid) {
|
|
41
|
+
return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAANTSURBVFhH7Zg/aBNRHMebXEv+CFKxSusgBAcXRdDJWnA4qAVdRMzgIogScCldmj8dQighoRgh/hnataCSSXRyCA7BQS0OdVGHgrGCOqQiUmNiEr+v960Ycum9dy9m8gPH789d775573fv/a4D/9HEQ6tFLpcL1Gq1Cx6Px9dsNj/CvonFYu9hW7zENdoCk8mk1+/3ZyBmlqktWq3WOkwB+TzElq2sOq4Ezs/PHzIMY9br9U5CyBhEDCHttc52UMU1sXg8nmeshEErTTabnYCwEo5xhMMQNwi70w8dxDVTpmkaxWLxKXPSKI1gPp/3bW5uvsMDDzIlDUaxhR9lRqNRJZHdpsWWarV6xo04Af7OgxcoxVAaJYF4wEm6bplYWFgYpS+FkkAwRusKMYqNRuMEQymUBKKG6Gmxl1YK1SneoKvDD1oppAVieREvxx4r0mIUi/tu+o6ojOAKSugyfdfgHrcCgcBdho5ICSwUCmJB32dF+ojdh64jUgLD4XADN/3GUBuMYoWuI9JTjJu+oNsLpO+lIvA2jHb7BDawFi7Td0RaIPbQR1hmpjDVaaaUECWC4zrEjc/NzX1m2hHldmtxcXGoUqmsY0T3MyUFxN1Hy3WJoTTSI7hNJBKpw6j2dk3sQjfpK6EsUBAMBnMwL63IGYzeDZTICkMlXAmcnp7+iVo6iwe/ZaoruOYe2rQ4Q2W0vknE9gcBr1GP3bau0tramrm0tCTKwhWuRnAb8TEEcV8Y2rGqI06gJZD8orVjp3NSaAlkd9y1v8P0H0bnIj6qXOOqBkW7hI7kKtwEDqcGdBVlkAyFQo/Fns6cNNICIWoEy4uJUTmH4zweuounpMDfiA/5Bzie4D4lsRJsnXBgR4GizcJbeBHuNTzgNEQpf0d34TuOh9g67yQSiedWyp6uAjOZzDGYZYg6amX+DfjhBb/fH5mZmfnKVBu2AtPp9BHDMJ7BlW7NdYDIV1jMT6VSqSpTf7B9i7Fvio6lL+IEmKXjPp/vCsM2OgSyvTetqH9gUCbpttEhsFwuH1B9Q3uEba13CKzX6yN0+wrqcJhuG3Y1qPTl30NqtG10CEQtBOn2FZSV7Zdeh0Asnq62vx7wibYNuynuxf9flEENfqD7FwMDvwH9BxCkLLaB+AAAAABJRU5ErkJggg==';
|
|
42
|
+
}
|
|
43
|
+
return "https://staff.skbkontur.ru/api/avatar/".concat(sid, "?size=s}");
|
|
44
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Textarea } from '@skbkontur/react-ui';
|
|
2
|
+
import { Token } from '../types';
|
|
3
|
+
export declare const textareaTokensRegExp: RegExp;
|
|
4
|
+
export declare const getTextareaTokens: (value: string) => Token[];
|
|
5
|
+
export declare const getCursorCoordinates: (textArea: HTMLTextAreaElement, id: string) => {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const useListenTextareaScroll: (setMention: (value: undefined) => void, textarea?: Textarea | null) => void;
|
|
10
|
+
export declare const getFullscreenHorizontalPadding: (fullscreen: boolean, textareaWidth: number) => number | undefined;
|
|
11
|
+
export declare const getPastedHtml: (html: string, event: ClipboardEvent, textArea: HTMLTextAreaElement) => void;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
2
|
+
import { setMarkdownPastedHtml } from './markdownHelpers';
|
|
3
|
+
import { MENTION_WRAPPER_ID_POSTFIX } from '../constants';
|
|
4
|
+
import { turndownService } from '../utils/htmlToMd';
|
|
5
|
+
export var textareaTokensRegExp = /(\[[\w\s\dА-Яа-яЁёЙй]+]\(@[\w\d]+\)|[@А-Яа-яЁёЙйA-Za-z]+)/g;
|
|
6
|
+
export var getTextareaTokens = function (value) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
var splitValue = value.split(textareaTokensRegExp).filter(Boolean);
|
|
9
|
+
var tokens = [];
|
|
10
|
+
for (var i = 0; i < splitValue.length; i++) {
|
|
11
|
+
var prevPositions = (_b = (_a = tokens[i - 1]) === null || _a === void 0 ? void 0 : _a.positions) !== null && _b !== void 0 ? _b : [0, 0];
|
|
12
|
+
var start = i ? prevPositions[1] + 1 : prevPositions[0];
|
|
13
|
+
var val = splitValue[i] || '';
|
|
14
|
+
var end = i ? start + (val.length - 1 || 0) : val.length;
|
|
15
|
+
if (val === ' ')
|
|
16
|
+
end = start;
|
|
17
|
+
if (val === '\n')
|
|
18
|
+
end = end - 1;
|
|
19
|
+
tokens.push({
|
|
20
|
+
value: val,
|
|
21
|
+
positions: [start, end],
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return tokens;
|
|
25
|
+
};
|
|
26
|
+
export var getCursorCoordinates = function (textArea, id) {
|
|
27
|
+
var container = document.getElementById("".concat(id).concat(MENTION_WRAPPER_ID_POSTFIX));
|
|
28
|
+
var textBefore = textArea.value.slice(0, textArea.selectionStart).replace('\n', '<br/>');
|
|
29
|
+
var textAfter = textArea.value.slice(textArea.selectionStart).replace('\n', '<br/>');
|
|
30
|
+
var textareaStyles = getComputedStyle(textArea);
|
|
31
|
+
if (container) {
|
|
32
|
+
var content = "<span style='position: relative; display: inline;'>" + textBefore + '</span>';
|
|
33
|
+
content += "<span id='caret' style='position: relative; display: inline;'>|</span>";
|
|
34
|
+
content += "<span style='position: relative; display: inline;'>" + textAfter + '</span>';
|
|
35
|
+
container.contentEditable = 'true';
|
|
36
|
+
container.innerHTML = content;
|
|
37
|
+
for (var _i = 0, _a = textareaStyles; _i < _a.length; _i++) {
|
|
38
|
+
var prop = _a[_i];
|
|
39
|
+
container.style[prop] = textareaStyles[prop];
|
|
40
|
+
}
|
|
41
|
+
container.style['top'] = '0';
|
|
42
|
+
container.style['position'] = 'absolute';
|
|
43
|
+
container.style['zIndex'] = '100';
|
|
44
|
+
container.style['whiteSpace'] = 'pre-wrap';
|
|
45
|
+
container.style['wordBreak'] = 'normal';
|
|
46
|
+
container.style['overflowWrap'] = 'break-word';
|
|
47
|
+
container.style['overflowY'] = 'scroll';
|
|
48
|
+
container.style['visibility'] = 'hidden';
|
|
49
|
+
container.scrollTop = textArea.scrollTop;
|
|
50
|
+
}
|
|
51
|
+
var caret = document.getElementById('caret');
|
|
52
|
+
var _b = caret.getBoundingClientRect(), top = _b.top, left = _b.left;
|
|
53
|
+
container.innerHTML = '';
|
|
54
|
+
return {
|
|
55
|
+
x: left,
|
|
56
|
+
y: top + window.scrollY + parseInt(textareaStyles.lineHeight),
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export var useListenTextareaScroll = function (setMention, textarea) {
|
|
60
|
+
var resetMention = useCallback(function () {
|
|
61
|
+
setMention(undefined);
|
|
62
|
+
}, [setMention]);
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
if (textarea) {
|
|
65
|
+
var node_1 = textarea === null || textarea === void 0 ? void 0 : textarea.node;
|
|
66
|
+
node_1 === null || node_1 === void 0 ? void 0 : node_1.addEventListener('scroll', resetMention);
|
|
67
|
+
return function () { return node_1 === null || node_1 === void 0 ? void 0 : node_1.removeEventListener('scroll', resetMention); };
|
|
68
|
+
}
|
|
69
|
+
}, [resetMention, textarea]);
|
|
70
|
+
useEffect(function () {
|
|
71
|
+
window.addEventListener('scroll', resetMention);
|
|
72
|
+
return window.removeEventListener('scroll', resetMention);
|
|
73
|
+
}, [resetMention]);
|
|
74
|
+
};
|
|
75
|
+
export var getFullscreenHorizontalPadding = function (fullscreen, textareaWidth) {
|
|
76
|
+
if (fullscreen) {
|
|
77
|
+
return (document.body.clientWidth - textareaWidth) / 2;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export var getPastedHtml = function (html, event, textArea) {
|
|
81
|
+
/** Игнорируем Google Docs/Tables/Presentations **/
|
|
82
|
+
if (!html.includes('id="docs-internal-guid') && !html.includes('<google-sheets-html')) {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
setMarkdownPastedHtml(turndownService.turndown(html), textArea);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { User } from './types';
|
|
3
|
+
interface Props {
|
|
4
|
+
getUsersApi: (value: string) => Promise<User[]>;
|
|
5
|
+
onUserSelect: (login: string, name: string) => void;
|
|
6
|
+
value: string;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const MarkdownMention: FC<Props>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { Toast } from '@skbkontur/react-ui';
|
|
38
|
+
import { Menu } from '@skbkontur/react-ui/internal/Menu';
|
|
39
|
+
import { ZIndex } from '@skbkontur/react-ui/internal/ZIndex';
|
|
40
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
41
|
+
import { createPortal } from 'react-dom';
|
|
42
|
+
import { markdownRenderContainer, textEditorDebounceTime } from './constants';
|
|
43
|
+
import { getMarkdownMentionStyle, MentionMenuItem, UserDescriptions, UserWrapper, Avatar } from './Markdown.styled';
|
|
44
|
+
import { getAvatarUrl, useMenuKeyListener } from './MarkdownHelpers/markdownMentionHelpers';
|
|
45
|
+
export var MarkdownMention = function (_a) {
|
|
46
|
+
var value = _a.value, onUserSelect = _a.onUserSelect, x = _a.x, y = _a.y, getUsersApi = _a.getUsersApi;
|
|
47
|
+
var _b = useState(), users = _b[0], setUsers = _b[1];
|
|
48
|
+
var menuRef = useRef(null);
|
|
49
|
+
var markdownMentionsRef = useRef(document.getElementById(markdownRenderContainer));
|
|
50
|
+
var timerRef = useRef(textEditorDebounceTime);
|
|
51
|
+
if (!markdownMentionsRef.current) {
|
|
52
|
+
var container = document.createElement('div');
|
|
53
|
+
container.id = markdownRenderContainer;
|
|
54
|
+
document.body.appendChild(container);
|
|
55
|
+
markdownMentionsRef.current = container;
|
|
56
|
+
}
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
window.clearTimeout(timerRef.current);
|
|
59
|
+
try {
|
|
60
|
+
var load_1 = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
+
var result;
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
64
|
+
case 0: return [4 /*yield*/, getUsersApi(value)];
|
|
65
|
+
case 1:
|
|
66
|
+
result = _a.sent();
|
|
67
|
+
result && setUsers(result);
|
|
68
|
+
return [2 /*return*/];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}); };
|
|
72
|
+
timerRef.current = window.setTimeout(function () { return void load_1(); }, textEditorDebounceTime);
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
Toast.push('Ошибка в получении списка пользователей');
|
|
76
|
+
}
|
|
77
|
+
}, [getUsersApi, value]);
|
|
78
|
+
useMenuKeyListener(onUserSelect, users, menuRef);
|
|
79
|
+
if (!(users === null || users === void 0 ? void 0 : users.length))
|
|
80
|
+
return null;
|
|
81
|
+
return createPortal(React.createElement(ZIndex, { priority: "Toast", style: getMarkdownMentionStyle(x, y) },
|
|
82
|
+
React.createElement(Menu, { ref: menuRef, preventWindowScroll: true, hasShadow: true, maxHeight: 300, width: 300 }, users === null || users === void 0 ? void 0 : users.map(function (user) { return (React.createElement(MentionMenuItem, { key: user.id, onClick: function () { var _a; return onUserSelect((_a = user === null || user === void 0 ? void 0 : user.login) !== null && _a !== void 0 ? _a : '', user.name); } },
|
|
83
|
+
React.createElement(UserWrapper, null,
|
|
84
|
+
React.createElement(Avatar, { height: 48, width: 48, src: getAvatarUrl(user.sid) }),
|
|
85
|
+
React.createElement("div", null,
|
|
86
|
+
React.createElement("div", null, user.name),
|
|
87
|
+
React.createElement(UserDescriptions, null, user === null || user === void 0 ? void 0 : user.teams.map(function (t) { return t.caption; }).join(', ')))))); }))), markdownMentionsRef.current);
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'turndown-plugin-gfm';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { THEME_2022, THEME_2022_DARK } from '@skbkontur/react-ui';
|
|
2
|
+
export declare enum ViewMode {
|
|
3
|
+
Preview = "Preview",
|
|
4
|
+
Edit = "Edit"
|
|
5
|
+
}
|
|
6
|
+
export interface Token {
|
|
7
|
+
positions: number[];
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export interface HorizontalPaddings {
|
|
11
|
+
fullscreenPadding?: number;
|
|
12
|
+
panelPadding?: number;
|
|
13
|
+
}
|
|
14
|
+
export type Nullable<T> = T | null | undefined;
|
|
15
|
+
export interface RefItem {
|
|
16
|
+
caption: string;
|
|
17
|
+
id: string;
|
|
18
|
+
}
|
|
19
|
+
export type ReactUiTheme = typeof THEME_2022 | typeof THEME_2022_DARK;
|
|
20
|
+
export interface User {
|
|
21
|
+
id: string;
|
|
22
|
+
login: string;
|
|
23
|
+
name: string;
|
|
24
|
+
teams: RefItem[];
|
|
25
|
+
sid?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface MarkdownApi {
|
|
28
|
+
/** Метод для загрузки файла */
|
|
29
|
+
fileDownloadApi?: (id: string) => Promise<File>;
|
|
30
|
+
/** Метод для скачивания файла */
|
|
31
|
+
fileUploadApi?: (file: File) => Promise<RefItem>;
|
|
32
|
+
/** Метод для получения списка пользователей */
|
|
33
|
+
getUsersApi?: (query: string) => Promise<User[]>;
|
|
34
|
+
}
|
|
35
|
+
export interface TestCase<V, E> {
|
|
36
|
+
expected: E;
|
|
37
|
+
name: string;
|
|
38
|
+
values: V;
|
|
39
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
var Guid = /** @class */ (function () {
|
|
3
|
+
function Guid() {
|
|
4
|
+
this._generated = uuid();
|
|
5
|
+
}
|
|
6
|
+
Object.defineProperty(Guid.prototype, "generated", {
|
|
7
|
+
get: function () {
|
|
8
|
+
if (this._generated) {
|
|
9
|
+
return this._generated;
|
|
10
|
+
}
|
|
11
|
+
return this.generate();
|
|
12
|
+
},
|
|
13
|
+
enumerable: false,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
16
|
+
Guid.prototype.generate = function () {
|
|
17
|
+
var id = uuid();
|
|
18
|
+
this._generated = id;
|
|
19
|
+
return id;
|
|
20
|
+
};
|
|
21
|
+
return Guid;
|
|
22
|
+
}());
|
|
23
|
+
export { Guid };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isMacintosh(): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var RequestStatus;
|
|
2
|
+
(function (RequestStatus) {
|
|
3
|
+
RequestStatus[RequestStatus["Default"] = 0] = "Default";
|
|
4
|
+
RequestStatus[RequestStatus["isFetching"] = 1] = "isFetching";
|
|
5
|
+
RequestStatus[RequestStatus["isLoaded"] = 2] = "isLoaded";
|
|
6
|
+
RequestStatus[RequestStatus["isFailed"] = 3] = "isFailed";
|
|
7
|
+
})(RequestStatus || (RequestStatus = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const saveFile: (response: File, fileName?: string) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var saveFile = function (response, fileName) {
|
|
2
|
+
var url = window.URL.createObjectURL(response);
|
|
3
|
+
var link = document.createElement('a');
|
|
4
|
+
link.href = url;
|
|
5
|
+
link.setAttribute('download', "".concat(fileName || response.name));
|
|
6
|
+
document.body.appendChild(link);
|
|
7
|
+
link.click();
|
|
8
|
+
window.URL.revokeObjectURL(url);
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AttachLink: () => JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var AttachLink = function () { return (React.createElement("svg", { width: "18", height: "11", viewBox: "0 0 18 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M0 5.5C0 2.46243 2.46243 0 5.5 0H6.75C7.02614 0 7.25 0.223858 7.25 0.5C7.25 0.776142 7.02614 1 6.75 1H5.5C3.01472 1 1 3.01472 1 5.5C1 7.98528 3.01472 10 5.5 10H6.75C7.02614 10 7.25 10.2239 7.25 10.5C7.25 10.7761 7.02614 11 6.75 11H5.5C2.46243 11 0 8.53757 0 5.5Z", fill: "currentColor" }),
|
|
4
|
+
React.createElement("path", { d: "M18 5.5C18 2.46243 15.5376 0 12.5 0H11.25C10.9739 0 10.75 0.223858 10.75 0.5C10.75 0.776142 10.9739 1 11.25 1H12.5C14.9853 1 17 3.01472 17 5.5C17 7.98528 14.9853 10 12.5 10H11.25C10.9739 10 10.75 10.2239 10.75 10.5C10.75 10.7761 10.9739 11 11.25 11H12.5C15.5376 11 18 8.53757 18 5.5Z", fill: "currentColor" }),
|
|
5
|
+
React.createElement("path", { d: "M5 5C4.72386 5 4.5 5.22386 4.5 5.5C4.5 5.77614 4.72386 6 5 6H13C13.2761 6 13.5 5.77614 13.5 5.5C13.5 5.22386 13.2761 5 13 5H5Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AttachPaperclip: () => JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var AttachPaperclip = function () { return (React.createElement("svg", { width: "16", height: "15", viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M10.4504 0.95575C11.7177 -0.311543 13.7724 -0.311544 15.0397 0.955749C16.307 2.22304 16.307 4.27773 15.0397 5.54502L7.91213 12.6726C6.10883 14.4759 3.18509 14.4759 1.38178 12.6726C-0.421531 10.8693 -0.421529 7.94555 1.38178 6.14224L6.34291 1.18111C6.53817 0.985847 6.85476 0.985847 7.05002 1.18111C7.24528 1.37637 7.24528 1.69295 7.05002 1.88822L2.08889 6.84935C0.676101 8.26213 0.6761 10.5527 2.08888 11.9655C3.50167 13.3783 5.79224 13.3783 7.20503 11.9655L14.3326 4.83792C15.2094 3.96115 15.2094 2.53962 14.3326 1.66286C13.4558 0.786087 12.0343 0.786088 11.1575 1.66286L4.14265 8.67776C3.80189 9.01851 3.80189 9.57098 4.14265 9.91173C4.4834 10.2525 5.03587 10.2525 5.37662 9.91173L10.2251 5.06328C10.4203 4.86801 10.7369 4.86801 10.9322 5.06328C11.1274 5.25854 11.1274 5.57512 10.9322 5.77038L6.08373 10.6188C5.35245 11.3501 4.16682 11.3501 3.43554 10.6188C2.70426 9.88756 2.70426 8.70193 3.43554 7.97065L10.4504 0.95575Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CheckedList: () => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var CheckedList = function () { return (React.createElement("svg", { width: "16", height: "15", viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M5.60355 1.35355C5.79882 1.15829 5.79882 0.841709 5.60355 0.646447C5.40829 0.451184 5.09171 0.451184 4.89645 0.646447L2.5 3.04289L1.60355 2.14645C1.40829 1.95118 1.09171 1.95118 0.896447 2.14645C0.701184 2.34171 0.701184 2.65829 0.896447 2.85355L1.79289 3.75C2.18342 4.14053 2.81658 4.14052 3.20711 3.75L5.60355 1.35355Z", fill: "currentColor" }),
|
|
4
|
+
React.createElement("path", { d: "M15.5 3H7.5C7.22386 3 7 2.77614 7 2.5C7 2.22386 7.22386 2 7.5 2H15.5C15.7761 2 16 2.22386 16 2.5C16 2.77614 15.7761 3 15.5 3Z", fill: "currentColor" }),
|
|
5
|
+
React.createElement("path", { d: "M7.5 7C7.22386 7 7 7.22386 7 7.5C7 7.77614 7.22386 8 7.5 8H15.5C15.7761 8 16 7.77614 16 7.5C16 7.22386 15.7761 7 15.5 7H7.5Z", fill: "currentColor" }),
|
|
6
|
+
React.createElement("path", { d: "M15.5 12H7.5C7.22386 12 7 12.2239 7 12.5C7 12.7761 7.22386 13 7.5 13H15.5C15.7761 13 16 12.7761 16 12.5C16 12.2239 15.7761 12 15.5 12Z", fill: "currentColor" }),
|
|
7
|
+
React.createElement("path", { d: "M5.60355 5.64645C5.79882 5.84171 5.79882 6.15829 5.60355 6.35355L3.20711 8.75C2.81658 9.14052 2.18342 9.14053 1.79289 8.75L0.896447 7.85355C0.701184 7.65829 0.701184 7.34171 0.896447 7.14645C1.09171 6.95118 1.40829 6.95118 1.60355 7.14645L2.5 8.04289L4.89645 5.64645C5.09171 5.45118 5.40829 5.45118 5.60355 5.64645Z", fill: "currentColor" }),
|
|
8
|
+
React.createElement("path", { d: "M5.60355 11.3536C5.79882 11.1583 5.79882 10.8417 5.60355 10.6464C5.40829 10.4512 5.09171 10.4512 4.89645 10.6464L2.5 13.0429L1.60355 12.1464C1.40829 11.9512 1.09171 11.9512 0.896447 12.1464C0.701184 12.3417 0.701184 12.6583 0.896447 12.8536L1.79289 13.75C2.18342 14.1405 2.81658 14.1405 3.20711 13.75L5.60355 11.3536Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Collapse: () => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var Collapse = function () { return (React.createElement("svg", { width: "19", height: "18", viewBox: "0 0 19 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M8.93499 11.2072C8.93499 10.1026 8.03956 9.20715 6.93499 9.20715L0.656814 9.20715C0.380672 9.20715 0.156814 9.43101 0.156814 9.70715C0.156814 9.9833 0.380672 10.2072 0.656814 10.2072L6.93499 10.2072C7.48727 10.2072 7.93499 10.6549 7.93499 11.2072L7.93499 17.4853C7.93499 17.7615 8.15885 17.9853 8.43499 17.9853C8.71113 17.9853 8.93499 17.7615 8.93499 17.4853L8.93499 11.2072Z", fill: "currentColor" }),
|
|
4
|
+
React.createElement("path", { d: "M11.3492 8.79294C10.2446 8.79294 9.3492 7.89751 9.3492 6.79294L9.3492 0.514765C9.3492 0.238622 9.57306 0.0147653 9.8492 0.014765C10.1253 0.0147656 10.3492 0.238623 10.3492 0.514765L10.3492 6.79294C10.3492 7.34522 10.7969 7.79294 11.3492 7.79294L17.6274 7.79294C17.9035 7.79294 18.1274 8.0168 18.1274 8.29294C18.1274 8.56908 17.9035 8.79294 17.6274 8.79294L11.3492 8.79294Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Expand: () => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var Expand = function () { return (React.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M2.9851 13.1571C1.88053 13.1571 0.985101 12.2616 0.985101 11.1571L0.985102 4.87888C0.985102 4.60274 1.20896 4.37888 1.4851 4.37888C1.76124 4.37888 1.9851 4.60274 1.9851 4.87888L1.9851 11.1571C1.9851 11.7093 2.43282 12.1571 2.9851 12.1571L9.26328 12.1571C9.53942 12.1571 9.76328 12.3809 9.76328 12.6571C9.76328 12.9332 9.53942 13.1571 9.26328 13.1571L2.9851 13.1571Z", fill: "#222222" }),
|
|
4
|
+
React.createElement("path", { d: "M13.2988 2.84335C13.2988 1.73878 12.4034 0.843347 11.2988 0.843347L5.02064 0.843347C4.74449 0.843347 4.52064 1.06721 4.52064 1.34335C4.52064 1.61949 4.74449 1.84335 5.02064 1.84335L11.2988 1.84335C11.8511 1.84335 12.2988 2.29106 12.2988 2.84335L12.2988 9.12152C12.2988 9.39767 12.5227 9.62152 12.7988 9.62152C13.075 9.62152 13.2988 9.39766 13.2988 9.12152L13.2988 2.84335Z", fill: "#222222" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EyeOpen: () => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var EyeOpen = function () { return (React.createElement("svg", { width: "20", height: "14", viewBox: "0 0 20 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 3.3761C7.99853 3.3761 6.37599 4.99863 6.37599 7.00013C6.37599 9.00163 7.99853 10.6242 10 10.6242C12.0015 10.6242 13.6241 9.00163 13.6241 7.00013C13.6241 4.99863 12.0015 3.3761 10 3.3761ZM7.37599 7.00013C7.37599 5.55092 8.55081 4.3761 10 4.3761C11.4492 4.3761 12.6241 5.55092 12.6241 7.00013C12.6241 8.44934 11.4492 9.62416 10 9.62416C8.55081 9.62416 7.37599 8.44934 7.37599 7.00013Z", fill: "currentColor" }),
|
|
4
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 0.5625C5.94148 0.5625 2.45219 2.98066 0.937234 6.44084C0.781176 6.79728 0.781176 7.20273 0.937234 7.55917C2.45219 11.0193 5.94148 13.4375 10 13.4375C14.0586 13.4375 17.5479 11.0193 19.0628 7.55917C19.2189 7.20273 19.2189 6.79728 19.0628 6.44084C17.5479 2.98066 14.0586 0.5625 10 0.5625ZM1.85328 6.84191C3.21211 3.73833 6.34654 1.5625 10 1.5625C13.6535 1.5625 16.7879 3.73833 18.1468 6.84191C18.1909 6.94268 18.1909 7.05732 18.1468 7.1581C16.7879 10.2617 13.6535 12.4375 10 12.4375C6.34654 12.4375 3.21211 10.2617 1.85328 7.1581C1.80916 7.05732 1.80916 6.94268 1.85328 6.84191Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const List: () => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var List = function () { return (React.createElement("svg", { width: "14", height: "13", viewBox: "0 0 14 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M1 2.5C1.55228 2.5 2 2.05228 2 1.5C2 0.947715 1.55228 0.5 1 0.5C0.447715 0.5 0 0.947715 0 1.5C0 2.05228 0.447715 2.5 1 2.5Z", fill: "currentColor" }),
|
|
4
|
+
React.createElement("path", { d: "M4 1.5C4 1.22386 4.22386 1 4.5 1H13.5C13.7761 1 14 1.22386 14 1.5C14 1.77614 13.7761 2 13.5 2H4.5C4.22386 2 4 1.77614 4 1.5Z", fill: "currentColor" }),
|
|
5
|
+
React.createElement("path", { d: "M4.5 6C4.22386 6 4 6.22386 4 6.5C4 6.77614 4.22386 7 4.5 7H13.5C13.7761 7 14 6.77614 14 6.5C14 6.22386 13.7761 6 13.5 6H4.5Z", fill: "currentColor" }),
|
|
6
|
+
React.createElement("path", { d: "M4.5 11C4.22386 11 4 11.2239 4 11.5C4 11.7761 4.22386 12 4.5 12H13.5C13.7761 12 14 11.7761 14 11.5C14 11.2239 13.7761 11 13.5 11H4.5Z", fill: "currentColor" }),
|
|
7
|
+
React.createElement("path", { d: "M2 6.5C2 7.05228 1.55228 7.5 1 7.5C0.447715 7.5 0 7.05228 0 6.5C0 5.94772 0.447715 5.5 1 5.5C1.55228 5.5 2 5.94772 2 6.5Z", fill: "currentColor" }),
|
|
8
|
+
React.createElement("path", { d: "M1 12.5C1.55228 12.5 2 12.0523 2 11.5C2 10.9477 1.55228 10.5 1 10.5C0.447715 10.5 0 10.9477 0 11.5C0 12.0523 0.447715 12.5 1 12.5Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import styled from '../styles/styled-components';
|
|
6
|
+
export var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-top: 6px;\n"], ["\n margin-top: 6px;\n"])));
|
|
7
|
+
export var RotatedWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: rotate(45deg);\n"], ["\n transform: rotate(45deg);\n"])));
|
|
8
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NumberedList: () => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var NumberedList = function () { return (React.createElement("svg", { width: "15", height: "14", viewBox: "0 0 15 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M2.71209 0.0472114C2.88778 0.129501 3.00001 0.305997 3.00001 0.500006V5.50001C3.00001 5.77615 2.77615 6.00001 2.50001 6.00001C2.22387 6.00001 2.00001 5.77615 2.00001 5.50001V1.56753L1.3201 2.13412C1.10797 2.3109 0.792684 2.28224 0.615902 2.0701C0.43912 1.85796 0.467782 1.54268 0.67992 1.3659L2.17992 0.115895C2.32896 -0.00830596 2.5364 -0.0350785 2.71209 0.0472114Z", fill: "currentColor" }),
|
|
4
|
+
React.createElement("path", { d: "M6.50001 2.00001C6.22387 2.00001 6.00001 2.22386 6.00001 2.50001C6.00001 2.77615 6.22387 3.00001 6.50001 3.00001H14.5C14.7762 3.00001 15 2.77615 15 2.50001C15 2.22386 14.7762 2.00001 14.5 2.00001H6.50001Z", fill: "currentColor" }),
|
|
5
|
+
React.createElement("path", { d: "M6.50001 10C6.22387 10 6.00001 10.2239 6.00001 10.5C6.00001 10.7761 6.22387 11 6.50001 11H14.5C14.7762 11 15 10.7761 15 10.5C15 10.2239 14.7762 10 14.5 10H6.50001Z", fill: "currentColor" }),
|
|
6
|
+
React.createElement("path", { d: "M1.55634 9.49196C1.68544 9.27177 1.8093 9.15912 1.92143 9.09655C2.03381 9.03383 2.17464 8.99896 2.37504 9.00003C2.5843 9.00114 2.77363 9.07222 2.9049 9.19165C3.02784 9.30349 3.13038 9.48457 3.13038 9.77831V9.93822C3.07661 10.3953 2.72366 10.6219 2.06126 11.0281C1.4712 11.3899 0.625013 11.9159 0.625013 13.0738V13.5C0.625013 13.7761 0.84887 14 1.12501 14H3.75001C4.02615 14 4.25001 13.7761 4.25001 13.5C4.25001 13.2239 4.02615 13 3.75001 13H1.62713C1.65634 12.5028 1.98696 12.2467 2.58403 11.8806C2.61887 11.8592 2.65517 11.8373 2.69263 11.8146C3.23939 11.484 4.03302 11.0042 4.1281 10.0123C4.12962 9.9964 4.13038 9.98047 4.13038 9.96454V9.77831C4.13038 9.22236 3.92303 8.76599 3.57784 8.45195C3.241 8.14551 2.80398 8.0023 2.38036 8.00004C2.05843 7.99833 1.73598 8.05487 1.43413 8.22331C1.13202 8.39189 0.890698 8.65015 0.693683 8.98618C0.554014 9.22439 0.633903 9.53073 0.87212 9.6704C1.11034 9.81007 1.41667 9.73018 1.55634 9.49196Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Table: () => JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var Table = function () { return (React.createElement("svg", { width: "14", height: "10", viewBox: "0 0 14 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { d: "M1 5V9H7M1 5V1H4H7M1 5H13M13 5V1H7M13 5V9H7M7 1V9", stroke: "currentColor", strokeLinecap: "round" }))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ToolPencil: () => JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var ToolPencil = function () { return (React.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.4755 0.43885C11.8897 -0.146935 10.94 -0.146934 10.3542 0.438852L0.43934 10.3537C0.158035 10.635 0 11.0165 0 11.4144V13.5001C0 13.7763 0.223858 14.0001 0.5 14.0001H2.58579C2.98361 14.0001 3.36514 13.8421 3.64645 13.5608L13.5613 3.64595C14.1471 3.06017 14.1471 2.11042 13.5613 1.52463L12.4755 0.43885ZM11.0613 1.14596C11.2566 0.950696 11.5731 0.950696 11.7684 1.14596L12.8542 2.23174C13.0495 2.427 13.0495 2.74358 12.8542 2.93885L11.75 4.04305L9.9571 2.25016L11.0613 1.14596ZM9.25 2.95726L1.14645 11.0608C1.05268 11.1546 1 11.2818 1 11.4144V13.0001H2.58579C2.71839 13.0001 2.84557 12.9475 2.93934 12.8537L11.0429 4.75015L9.25 2.95726Z", fill: "currentColor" }))); };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var MarkdownLink = function (_a) {
|
|
3
|
+
var href = _a.href, children = _a.children, target = _a.target;
|
|
4
|
+
return (React.createElement("a", { href: href, target: target !== null && target !== void 0 ? target : '_blank', rel: "noopener noreferrer" }, children));
|
|
5
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface MarkdownViewerProps {
|
|
3
|
+
/** Метод апи для скачивания файлов */
|
|
4
|
+
downloadFileApi?: (id: string) => Promise<File>;
|
|
5
|
+
/** Url апи для файлов */
|
|
6
|
+
fileApiUrl?: string;
|
|
7
|
+
/** Url для профиля сотрудника */
|
|
8
|
+
profileUrl?: string;
|
|
9
|
+
/** MD-текст */
|
|
10
|
+
source?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const MarkdownViewer: FC<MarkdownViewerProps>;
|