@epam/ai-dial-chat-shared 1.3.5 → 1.3.7
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/components/MarkdownRenderer/Table/MarkdownTable.js +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -2
- package/package.json +1 -1
- package/utils/copy-to-clipboard.d.ts +0 -15
- package/utils/copy-to-clipboard.d.ts.map +1 -1
- package/utils/copy-to-clipboard.js +2 -59
- package/utils/markdown-rich-text.d.ts +16 -0
- package/utils/markdown-rich-text.d.ts.map +1 -0
- package/utils/markdown-rich-text.js +62 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mergeClasses as e } from "../../../utils/merge-class.js";
|
|
2
2
|
import { buildCssVars as t } from "../../../utils/build-css-vars.js";
|
|
3
|
-
import { copyMarkdownAsRichText as n } from "../../../utils/
|
|
3
|
+
import { copyMarkdownAsRichText as n } from "../../../utils/markdown-rich-text.js";
|
|
4
4
|
import { downloadTextFile as r } from "../../../utils/file-download.js";
|
|
5
5
|
import { CHAT_SHARED_CLASS as i } from "../../../constants/public-class-names.js";
|
|
6
6
|
import { useHorizontalOverflow as a } from "../../../hooks/useHorizontalOverflow.js";
|
package/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from './utils/message-attachment-to-display';
|
|
|
34
34
|
export * from './utils/mime-type';
|
|
35
35
|
export * from './utils/is-audio-transcription-supported';
|
|
36
36
|
export * from './utils/copy-to-clipboard';
|
|
37
|
+
export * from './utils/markdown-rich-text';
|
|
37
38
|
export * from './utils/dom';
|
|
38
39
|
export * from './utils/format-last-used';
|
|
39
40
|
export * from './utils/format-file-size';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC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BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4DAA4D,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,KAAK,0BAA0B,GAChC,MAAM,6DAA6D,CAAC;AAYrE,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAErF,cAAc,qDAAqD,CAAC"}
|
package/index.js
CHANGED
|
@@ -18,7 +18,8 @@ import { isOrgUnitFolder as K, normalizeOrgUnitFolder as q, toOrgUnitFolderSet a
|
|
|
18
18
|
import { isStatusMessage as Y } from "./utils/message.js";
|
|
19
19
|
import { messageAttachmentToDisplayAttachment as X, messageAttachmentsToDisplayAttachments as Z } from "./utils/message-attachment-to-display.js";
|
|
20
20
|
import { isAudioTranscriptionSupported as Q } from "./utils/is-audio-transcription-supported.js";
|
|
21
|
-
import {
|
|
21
|
+
import { copyToClipboard as $ } from "./utils/copy-to-clipboard.js";
|
|
22
|
+
import { copyMarkdownAsRichText as ee, markdownToRichTextHtml as te } from "./utils/markdown-rich-text.js";
|
|
22
23
|
import { makeOutsideInert as ne } from "./utils/dom.js";
|
|
23
24
|
import { formatLastUsed as re } from "./utils/format-last-used.js";
|
|
24
25
|
import { formatFileSize as ie } from "./utils/format-file-size.js";
|
|
@@ -92,4 +93,4 @@ import { useGridEditingScroll as sn } from "./file-manager/useGridEditingScroll/
|
|
|
92
93
|
import { OperationLoaderModal as cn } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
|
|
93
94
|
import { isSkillSelectionUnsupported as ln } from "./utils/is-skill-selection-unsupported.js";
|
|
94
95
|
import { toConversationTransferQueueItems as un } from "./conversation-transfer/conversation-transfer-queue.js";
|
|
95
|
-
export { Qe as ActionMenu, m as AttachmentErrorReason, h as AttachmentType, Ee as BASE_LG_ICON_PROPS, De as BASE_MD_ICON_PROPS, s as BackgroundGenerationStatus, bt as CHAT_SHARED_CLASS, jt as COMPACT_MARKDOWN_CLASS_NAMES, g as CatalogEntityType, y as CodeBlockTheme, dt as ConfirmationDialog, ut as ConfirmationFooter, st as ConfirmationIdentityCard, ct as ConfirmationIdentityRow, lt as ConfirmationView, a as ConversationKind, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, qe as CopyButton, Je as CopyIconButton, Mt as DEFAULT_MARKDOWN_CLASS_NAMES, wt as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, ft as DELETE_CONFIRMATION_MAX_LISTED_NAMES, Re as DESKTOP_BREAKPOINT_PX, ze as DESKTOP_MEDIA_QUERY, mt as DeleteConfirmationDialog, ht as DeleteConfirmationDrawer, pt as DeleteConfirmationView, Ke as DeploymentIcon, Zt as DialFileManagerActionProfile, Qt as DialFileManagerVariant, z as ENTITY_DESCRIPTION_MAX_LENGTH, B as ENTITY_INSTRUCTIONS_MAX_LENGTH, V as ENTITY_NAME_MAX_LENGTH, ge as ENTITY_TYPE_BG_COLOR, _e as ENTITY_TYPE_COLOR, at as EntityHeader, rt as EntityTypeLabel, it as FeaturedChip, tn as FileDownloadStatus, _ as FileExtension, nn as FileUploadFailureReason, rn as FileUploadStatus, o as FilterTab, Oe as HIDDEN_FILE, Ge as InitialsAvatar, nt as ItemHeader, je as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, Me as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, Fe as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, Tt as MARKDOWN_TABLE_CSV_MIME_TYPE, Pt as MDMessageViewer, v as MIMEType, b as MIME_TYPE_ALIASES, x as MIME_TYPE_AUDIO_PREFIX, S as MIME_TYPE_EXT_MAP, C as MIME_TYPE_WILDCARD, Be as MOBILE_MAX_WIDTH_PX, Ve as MOBILE_MEDIA_QUERY, Ct as MarkdownCodeBlock, kt as MarkdownRenderer, Ot as MarkdownTable, Et as MarkdownTableCopyFormat, Ft as MarkdownWithPlaceholders, c as MessageRating, l as MessageRole, et as NewVersionAlert, tt as NotificationStack, cn as OperationLoaderModal, He as PHONE_MEDIA_QUERY, P as PROHIBITED_CONVERSATION_NAME_CHARS_RE, ve as PROMPT_PARAM_DEFAULT_SEPARATOR, ye as PROMPT_PARAM_PATTERN, be as PROMPT_VARIABLE_CLASS_NAME, ke as PUBLIC_BUCKET, $e as PanelEmptyState, Nt as PlainTextRenderer, Ne as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, Pe as RESIZABLE_TEXTAREA_CLASS_NAME, u as RequestStatus, ot as ResourceSummary, p as ResponseFormat, Ie as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, Le as SELECT_LIST_MAX_HEIGHT_PX, d as StageStatus, f as StatusEvent, Ue as TABLET_BREAKPOINT_PX, We as TABLET_MEDIA_QUERY, Ae as TAG_INPUT_TAG_CLASS_NAME, gt as TableHeader, yt as TextRefinementField, _t as TextRefinementState, Xt as UnsavedChangesProvider, ce as base64ToBlob, G as buildCssVars, It as buildInlineSegmentSource, xe as buildPromptParamDefaults,
|
|
96
|
+
export { Qe as ActionMenu, m as AttachmentErrorReason, h as AttachmentType, Ee as BASE_LG_ICON_PROPS, De as BASE_MD_ICON_PROPS, s as BackgroundGenerationStatus, bt as CHAT_SHARED_CLASS, jt as COMPACT_MARKDOWN_CLASS_NAMES, g as CatalogEntityType, y as CodeBlockTheme, dt as ConfirmationDialog, ut as ConfirmationFooter, st as ConfirmationIdentityCard, ct as ConfirmationIdentityRow, lt as ConfirmationView, a as ConversationKind, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, qe as CopyButton, Je as CopyIconButton, Mt as DEFAULT_MARKDOWN_CLASS_NAMES, wt as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, ft as DELETE_CONFIRMATION_MAX_LISTED_NAMES, Re as DESKTOP_BREAKPOINT_PX, ze as DESKTOP_MEDIA_QUERY, mt as DeleteConfirmationDialog, ht as DeleteConfirmationDrawer, pt as DeleteConfirmationView, Ke as DeploymentIcon, Zt as DialFileManagerActionProfile, Qt as DialFileManagerVariant, z as ENTITY_DESCRIPTION_MAX_LENGTH, B as ENTITY_INSTRUCTIONS_MAX_LENGTH, V as ENTITY_NAME_MAX_LENGTH, ge as ENTITY_TYPE_BG_COLOR, _e as ENTITY_TYPE_COLOR, at as EntityHeader, rt as EntityTypeLabel, it as FeaturedChip, tn as FileDownloadStatus, _ as FileExtension, nn as FileUploadFailureReason, rn as FileUploadStatus, o as FilterTab, Oe as HIDDEN_FILE, Ge as InitialsAvatar, nt as ItemHeader, je as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, Me as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, Fe as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, Tt as MARKDOWN_TABLE_CSV_MIME_TYPE, Pt as MDMessageViewer, v as MIMEType, b as MIME_TYPE_ALIASES, x as MIME_TYPE_AUDIO_PREFIX, S as MIME_TYPE_EXT_MAP, C as MIME_TYPE_WILDCARD, Be as MOBILE_MAX_WIDTH_PX, Ve as MOBILE_MEDIA_QUERY, Ct as MarkdownCodeBlock, kt as MarkdownRenderer, Ot as MarkdownTable, Et as MarkdownTableCopyFormat, Ft as MarkdownWithPlaceholders, c as MessageRating, l as MessageRole, et as NewVersionAlert, tt as NotificationStack, cn as OperationLoaderModal, He as PHONE_MEDIA_QUERY, P as PROHIBITED_CONVERSATION_NAME_CHARS_RE, ve as PROMPT_PARAM_DEFAULT_SEPARATOR, ye as PROMPT_PARAM_PATTERN, be as PROMPT_VARIABLE_CLASS_NAME, ke as PUBLIC_BUCKET, $e as PanelEmptyState, Nt as PlainTextRenderer, Ne as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, Pe as RESIZABLE_TEXTAREA_CLASS_NAME, u as RequestStatus, ot as ResourceSummary, p as ResponseFormat, Ie as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, Le as SELECT_LIST_MAX_HEIGHT_PX, d as StageStatus, f as StatusEvent, Ue as TABLET_BREAKPOINT_PX, We as TABLET_MEDIA_QUERY, Ae as TAG_INPUT_TAG_CLASS_NAME, gt as TableHeader, yt as TextRefinementField, _t as TextRefinementState, Xt as UnsavedChangesProvider, ce as base64ToBlob, G as buildCssVars, It as buildInlineSegmentSource, xe as buildPromptParamDefaults, ee as copyMarkdownAsRichText, $ as copyToClipboard, Lt as createInlineSegmentComponents, Rt as createRehypeInlineSegments, M as decodeJsonFromBase64, At as defaultMarkdownComponents, le as downloadTextFile, N as encodeJsonToBase64, ue as ensureDownloadFilename, H as exceedsMaxLength, Ye as extractInitials, Se as extractPromptParams, ae as formatCost, ie as formatFileSize, re as formatLastUsed, oe as formatPrice, se as formatUnitPrice, Te as generateUUID, w as getAttachmentTypeFromMime, T as getBaseMimeType, de as getFileExtensionForLanguage, $t as getParentFolderPath, F as getUtf8ByteLength, U as hasControlCharacters, E as inferMimeTypeFromPath, k as isAnnotationSelector, Q as isAudioTranscriptionSupported, an as isDownloadInProgress, en as isHiddenPath, K as isOrgUnitFolder, ln as isSkillSelectionUnsupported, Y as isStatusMessage, he as isSyntaxHighlightingAllowed, on as isUploadInProgress, ne as makeOutsideInert, te as markdownToRichTextHtml, W as mergeClasses, X as messageAttachmentToDisplayAttachment, Z as messageAttachmentsToDisplayAttachments, D as normalizeMimeType, q as normalizeOrgUnitFolder, A as normalizePersistedHtmlTagAttachmentType, j as normalizeRawAnnotations, Xe as pickAvatarColor, Ce as rehypePromptVariables, we as resolvePromptParams, St as restrainedSyntaxTheme, I as sanitizeConversationName, Dt as serializeMarkdownTableRows, L as stripTrailingDots, O as stripUrlQueryAndFragment, un as toConversationTransferQueueItems, J as toOrgUnitFolderSet, fe as triggerAnchorDownload, pe as triggerBlobDownload, R as truncateToUtf8Bytes, me as tryBase64ToBytes, Bt as useAvailableHeightCap, xt as useCodeCopy, zt as useCollapsedText, Vt as useControlErrorAssociation, sn as useGridEditingScroll, Ht as useIsMobile, Ze as useIsPhone, Ut as useIsTablet, Wt as useIsTextClipped, Gt as useIsVerticallyClamped, vt as useTextRefinement, qt as useUnsavedChanges, Kt as useUnsavedChangesGuard, Yt as useUnsavedChangesLeaveConfirmation, Jt as useUnsavedChangesLeaveGuard };
|
package/package.json
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Renders markdown to sanitized HTML whose styling travels inline, so a
|
|
3
|
-
* rich-text target it is pasted into shows the tables, headings, and code
|
|
4
|
-
* blocks the way the conversation does.
|
|
5
|
-
*/
|
|
6
|
-
export declare const markdownToRichTextHtml: (content: string) => string;
|
|
7
|
-
/**
|
|
8
|
-
* Copies markdown `content` to the clipboard as rich text, so pasting into a
|
|
9
|
-
* rich-text target (Word, Gmail, Slack) keeps the formatting. Both the
|
|
10
|
-
* `text/html` and the `text/plain` flavour are written, so a plain-text
|
|
11
|
-
* target (Notepad, a terminal, a code editor) pastes the raw markdown instead
|
|
12
|
-
* of nothing. Falls back to {@link copyToClipboard}, and therefore to the raw
|
|
13
|
-
* markdown, when the multi-format Clipboard API isn't available.
|
|
14
|
-
*/
|
|
15
|
-
export declare const copyMarkdownAsRichText: (content: string) => Promise<boolean>;
|
|
16
1
|
/** Copies `text` to the clipboard; returns `true` on success, `false` when both the Clipboard API and the `execCommand` fallback fail. */
|
|
17
2
|
export declare const copyToClipboard: (text: string) => Promise<boolean>;
|
|
18
3
|
//# sourceMappingURL=copy-to-clipboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-to-clipboard.d.ts","sourceRoot":"","sources":["../../src/utils/copy-to-clipboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-to-clipboard.d.ts","sourceRoot":"","sources":["../../src/utils/copy-to-clipboard.ts"],"names":[],"mappings":"AAEA,0IAA0I;AAC1I,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,OAAO,CAAC,OAAO,CAY7D,CAAC"}
|
|
@@ -1,62 +1,5 @@
|
|
|
1
|
-
import e from "dompurify";
|
|
2
|
-
import t from "rehype-stringify";
|
|
3
|
-
import n from "remark-gfm";
|
|
4
|
-
import r from "remark-parse";
|
|
5
|
-
import i from "remark-rehype";
|
|
6
|
-
import { unified as a } from "unified";
|
|
7
1
|
//#region src/utils/copy-to-clipboard.ts
|
|
8
|
-
var
|
|
9
|
-
table: "border-collapse:collapse;width:100%;margin:0 0 12px;font-size:14px;line-height:20px;background:#ffffff;color:#161b2d;border:1px solid #d1dbea",
|
|
10
|
-
th: "background:#fcfcfc;color:#57647a;border-bottom:1px solid #e0e6f0;padding:8px 12px;text-align:start;font-weight:600",
|
|
11
|
-
td: "border-top:1px solid #e0e6f0;padding:8px 12px;text-align:start",
|
|
12
|
-
h1: "font-size:20px;line-height:28px;font-weight:600;margin:0 0 12px",
|
|
13
|
-
h2: "font-size:18px;line-height:26px;font-weight:600;margin:16px 0 8px",
|
|
14
|
-
h3: "font-size:16px;line-height:24px;font-weight:600;margin:16px 0 8px",
|
|
15
|
-
p: "font-size:14px;line-height:24px;margin:0 0 12px",
|
|
16
|
-
ul: "font-size:14px;line-height:24px;margin:0 0 12px;padding-inline-start:24px",
|
|
17
|
-
ol: "font-size:14px;line-height:24px;margin:0 0 12px;padding-inline-start:24px",
|
|
18
|
-
blockquote: "border-inline-start:3px solid #d1dbea;margin:0 0 12px;padding:4px 0 4px 12px",
|
|
19
|
-
pre: "background:#f8fafc;border:1px solid #d1dbea;border-radius:8px;padding:12px;overflow:auto;font-size:14px;line-height:20px;color:#161b2d;margin:0 0 12px",
|
|
20
|
-
code: "font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px;background:#f3f5f9;color:#161b2d;padding:1px 4px;border-radius:4px",
|
|
21
|
-
a: "text-decoration:underline",
|
|
22
|
-
hr: "border:0;border-top:1px solid #d1dbea;margin:16px 0"
|
|
23
|
-
}, s = "background:#f5f7fa", c = {
|
|
24
|
-
left: "text-align:start",
|
|
25
|
-
center: "text-align:center",
|
|
26
|
-
right: "text-align:end"
|
|
27
|
-
}, l = (e) => {
|
|
28
|
-
let t = e.properties?.align;
|
|
29
|
-
return typeof t == "string" ? c[t] : void 0;
|
|
30
|
-
}, u = "font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px", d = (e, t) => {
|
|
31
|
-
e.properties ||= {};
|
|
32
|
-
let n = typeof e.properties.style == "string" ? e.properties.style : "";
|
|
33
|
-
e.properties.style = n ? `${n};${t}` : t;
|
|
34
|
-
}, f = (e, t = !1) => {
|
|
35
|
-
if (e.tagName === "code" && t) d(e, u);
|
|
36
|
-
else if (e.tagName) {
|
|
37
|
-
let t = o[e.tagName];
|
|
38
|
-
if (t && d(e, t), e.tagName === "th" || e.tagName === "td") {
|
|
39
|
-
let t = l(e);
|
|
40
|
-
t && d(e, t);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
let n = e.children ?? [];
|
|
44
|
-
e.tagName === "tbody" && n.filter((e) => e.tagName === "tr").forEach((e, t) => {
|
|
45
|
-
t % 2 == 1 && d(e, s);
|
|
46
|
-
}), n.forEach((n) => f(n, t || e.tagName === "pre"));
|
|
47
|
-
}, p = () => (e) => f(e), m = (o) => e.sanitize(a().use(r).use(n).use(i).use(p).use(t).processSync(o).toString()), h = (e) => {
|
|
48
|
-
if (typeof navigator > "u" || !navigator.clipboard?.write || typeof ClipboardItem > "u") return g(e);
|
|
49
|
-
let t;
|
|
50
|
-
try {
|
|
51
|
-
t = m(e);
|
|
52
|
-
} catch {
|
|
53
|
-
return g(e);
|
|
54
|
-
}
|
|
55
|
-
return navigator.clipboard.write([new ClipboardItem({
|
|
56
|
-
"text/html": new Blob([t], { type: "text/html" }),
|
|
57
|
-
"text/plain": new Blob([e], { type: "text/plain" })
|
|
58
|
-
})]).then(() => !0).catch(() => g(e));
|
|
59
|
-
}, g = (e) => typeof navigator < "u" && navigator.clipboard?.writeText ? navigator.clipboard.writeText(e).then(() => !0).catch(() => _(e)) : Promise.resolve(_(e)), _ = (e) => {
|
|
2
|
+
var e = (e) => typeof navigator < "u" && navigator.clipboard?.writeText ? navigator.clipboard.writeText(e).then(() => !0).catch(() => t(e)) : Promise.resolve(t(e)), t = (e) => {
|
|
60
3
|
let t = document.createElement("textarea");
|
|
61
4
|
t.innerText = e, t.style.cssText = "position:fixed;top:0;left:0;width:1px;height:1px;padding:0;border:none;outline:none;box-shadow:none;background:transparent;opacity:0;", t.setAttribute("autocomplete", "off"), t.setAttribute("readonly", ""), document.body.appendChild(t);
|
|
62
5
|
try {
|
|
@@ -66,4 +9,4 @@ var o = {
|
|
|
66
9
|
}
|
|
67
10
|
};
|
|
68
11
|
//#endregion
|
|
69
|
-
export {
|
|
12
|
+
export { e as copyToClipboard };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders markdown to sanitized HTML whose styling travels inline, so a
|
|
3
|
+
* rich-text target it is pasted into shows the tables, headings, and code
|
|
4
|
+
* blocks the way the conversation does.
|
|
5
|
+
*/
|
|
6
|
+
export declare const markdownToRichTextHtml: (content: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Copies markdown `content` to the clipboard as rich text, so pasting into a
|
|
9
|
+
* rich-text target (Word, Gmail, Slack) keeps the formatting. Both the
|
|
10
|
+
* `text/html` and the `text/plain` flavour are written, so a plain-text
|
|
11
|
+
* target (Notepad, a terminal, a code editor) pastes the raw markdown instead
|
|
12
|
+
* of nothing. Falls back to {@link copyToClipboard}, and therefore to the raw
|
|
13
|
+
* markdown, when the multi-format Clipboard API isn't available.
|
|
14
|
+
*/
|
|
15
|
+
export declare const copyMarkdownAsRichText: (content: string) => Promise<boolean>;
|
|
16
|
+
//# sourceMappingURL=markdown-rich-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-rich-text.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-rich-text.ts"],"names":[],"mappings":"AAsIA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,KAAG,MAUtD,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAoCvE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { copyToClipboard as e } from "./copy-to-clipboard.js";
|
|
2
|
+
import t from "dompurify";
|
|
3
|
+
import n from "rehype-stringify";
|
|
4
|
+
import r from "remark-gfm";
|
|
5
|
+
import i from "remark-parse";
|
|
6
|
+
import a from "remark-rehype";
|
|
7
|
+
import { unified as o } from "unified";
|
|
8
|
+
//#region src/utils/markdown-rich-text.ts
|
|
9
|
+
var s = {
|
|
10
|
+
table: "border-collapse:collapse;width:100%;margin:0 0 12px;font-size:14px;line-height:20px;background:#ffffff;color:#161b2d;border:1px solid #d1dbea",
|
|
11
|
+
th: "background:#fcfcfc;color:#57647a;border-bottom:1px solid #e0e6f0;padding:8px 12px;text-align:start;font-weight:600",
|
|
12
|
+
td: "border-top:1px solid #e0e6f0;padding:8px 12px;text-align:start",
|
|
13
|
+
h1: "font-size:20px;line-height:28px;font-weight:600;margin:0 0 12px",
|
|
14
|
+
h2: "font-size:18px;line-height:26px;font-weight:600;margin:16px 0 8px",
|
|
15
|
+
h3: "font-size:16px;line-height:24px;font-weight:600;margin:16px 0 8px",
|
|
16
|
+
p: "font-size:14px;line-height:24px;margin:0 0 12px",
|
|
17
|
+
ul: "font-size:14px;line-height:24px;margin:0 0 12px;padding-inline-start:24px",
|
|
18
|
+
ol: "font-size:14px;line-height:24px;margin:0 0 12px;padding-inline-start:24px",
|
|
19
|
+
blockquote: "border-inline-start:3px solid #d1dbea;margin:0 0 12px;padding:4px 0 4px 12px",
|
|
20
|
+
pre: "background:#f8fafc;border:1px solid #d1dbea;border-radius:8px;padding:12px;overflow:auto;font-size:14px;line-height:20px;color:#161b2d;margin:0 0 12px",
|
|
21
|
+
code: "font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px;background:#f3f5f9;color:#161b2d;padding:1px 4px;border-radius:4px",
|
|
22
|
+
a: "text-decoration:underline",
|
|
23
|
+
hr: "border:0;border-top:1px solid #d1dbea;margin:16px 0"
|
|
24
|
+
}, c = "background:#f5f7fa", l = {
|
|
25
|
+
left: "text-align:start",
|
|
26
|
+
center: "text-align:center",
|
|
27
|
+
right: "text-align:end"
|
|
28
|
+
}, u = (e) => {
|
|
29
|
+
let t = e.properties?.align;
|
|
30
|
+
return typeof t == "string" ? l[t] : void 0;
|
|
31
|
+
}, d = "font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px", f = (e, t) => {
|
|
32
|
+
e.properties ||= {};
|
|
33
|
+
let n = typeof e.properties.style == "string" ? e.properties.style : "";
|
|
34
|
+
e.properties.style = n ? `${n};${t}` : t;
|
|
35
|
+
}, p = (e, t = !1) => {
|
|
36
|
+
if (e.tagName === "code" && t) f(e, d);
|
|
37
|
+
else if (e.tagName) {
|
|
38
|
+
let t = s[e.tagName];
|
|
39
|
+
if (t && f(e, t), e.tagName === "th" || e.tagName === "td") {
|
|
40
|
+
let t = u(e);
|
|
41
|
+
t && f(e, t);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
let n = e.children ?? [];
|
|
45
|
+
e.tagName === "tbody" && n.filter((e) => e.tagName === "tr").forEach((e, t) => {
|
|
46
|
+
t % 2 == 1 && f(e, c);
|
|
47
|
+
}), n.forEach((n) => p(n, t || e.tagName === "pre"));
|
|
48
|
+
}, m = () => (e) => p(e), h = (e) => t.sanitize(o().use(i).use(r).use(a).use(m).use(n).processSync(e).toString()), g = (t) => {
|
|
49
|
+
if (typeof navigator > "u" || !navigator.clipboard?.write || typeof ClipboardItem > "u") return e(t);
|
|
50
|
+
let n;
|
|
51
|
+
try {
|
|
52
|
+
n = h(t);
|
|
53
|
+
} catch {
|
|
54
|
+
return e(t);
|
|
55
|
+
}
|
|
56
|
+
return navigator.clipboard.write([new ClipboardItem({
|
|
57
|
+
"text/html": new Blob([n], { type: "text/html" }),
|
|
58
|
+
"text/plain": new Blob([t], { type: "text/plain" })
|
|
59
|
+
})]).then(() => !0).catch(() => e(t));
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { g as copyMarkdownAsRichText, h as markdownToRichTextHtml };
|