@canofold/markdown 0.3.0 → 0.3.2
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 +2 -0
- package/README.zh-CN.md +2 -0
- package/dist/ImageGallery-Bcpjlfh9.js +569 -0
- package/dist/Markdown-607_slPB.js +117 -0
- package/dist/assets-CqlggKr8.js +77 -0
- package/dist/base.css +1 -1
- package/dist/client/bundler.js +308 -0
- package/dist/client/chunks/{client-kVNIqHQd.js → client-CHUUETWE.js} +3 -3
- package/dist/client/chunks/{gallery-BTg1qJjd.js → gallery-Cr0TgC1h.js} +2 -2
- package/dist/client/chunks/{image-BuMCsr5L.js → image-6_o7fPkU.js} +3 -3
- package/dist/client/chunks/provider-k1N-5njv.js +1037 -0
- package/dist/client/chunks/react-runtime-DRPMrVPX.js +12062 -0
- package/dist/client/chunks/{serialized-T1PzI4rG.js → serialized-Chn9ydGA.js} +270 -220
- package/dist/client/chunks/{table-JOSJsHgy.js → table-D99-Zhc8.js} +3 -3
- package/dist/client/index.js +1 -1
- package/dist/compiler/fenceMetadata.d.ts +7 -0
- package/dist/compiler/normalizeOptions.d.ts +2 -1
- package/dist/compiler/plugins/code.d.ts +1 -1
- package/dist/compiler/prepareMarkdown.d.ts +1 -1
- package/dist/compiler/types.d.ts +3 -0
- package/dist/componentMap-CKSUGzQH.js +1483 -0
- package/dist/components/blocks/MarkdownCodeBlock.d.ts +3 -1
- package/dist/copyText-C0ZgrMnH.js +18 -0
- package/dist/{directiveValidation-BdVbgcY_.js → directiveValidation-B7LY-R5p.js} +187 -248
- package/dist/fileKinds-BPzIxbaS.js +170 -0
- package/dist/gallery-BqQ-i0TC.js +42 -0
- package/dist/image-CiPni6Az.js +38 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/plugins-CXYBB-oH.js +130 -0
- package/dist/{prepareMarkdown-D-bFl1_V.js → prepareMarkdown-CS6sALIb.js} +344 -329
- package/dist/provider-BJDHf4Z_.js +8 -0
- package/dist/serialized-DFiNQYA5.js +39 -0
- package/dist/server/analyze.js +11 -11
- package/dist/server.js +30 -28
- package/dist/table-DQSeLjVL.js +32 -0
- package/package.json +14 -9
- package/dist/Markdown-C7O01MRv.js +0 -2116
- package/dist/client/chunks/provider-DNSHvvN7.js +0 -841
- package/dist/client/chunks/react-runtime-Dzgdzn6D.js +0 -10571
- package/dist/plugins-StkCS2su.js +0 -298
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { MarkdownCodeOverflow } from '../../compiler/types';
|
|
2
3
|
export interface MarkdownCodeBlockProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
3
4
|
children?: ReactNode;
|
|
4
5
|
language?: string;
|
|
5
6
|
filename?: string;
|
|
7
|
+
overflow?: MarkdownCodeOverflow;
|
|
6
8
|
source?: string;
|
|
7
9
|
copyLabel?: string;
|
|
8
10
|
copyFailureLabel?: string;
|
|
9
11
|
}
|
|
10
|
-
export declare function MarkdownCodeBlock({ children, source: directSource, language: directLanguage, filename: directFilename, copyLabel: directCopyLabel, copyFailureLabel: directCopyFailureLabel, ...inputProps }: MarkdownCodeBlockProps): import("react").JSX.Element;
|
|
12
|
+
export declare function MarkdownCodeBlock({ children, source: directSource, language: directLanguage, filename: directFilename, overflow: directOverflow, copyLabel: directCopyLabel, copyFailureLabel: directCopyFailureLabel, ...inputProps }: MarkdownCodeBlockProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
async function n(t) {
|
|
2
|
+
if (typeof navigator < "u" && navigator.clipboard)
|
|
3
|
+
try {
|
|
4
|
+
return await navigator.clipboard.writeText(t), !0;
|
|
5
|
+
} catch {
|
|
6
|
+
}
|
|
7
|
+
if (typeof document > "u" || typeof document.execCommand != "function") return !1;
|
|
8
|
+
const e = document.createElement("textarea");
|
|
9
|
+
e.value = t, e.setAttribute("readonly", ""), e.style.position = "fixed", e.style.inset = "0 auto auto 0", e.style.opacity = "0", document.body.appendChild(e), e.select();
|
|
10
|
+
try {
|
|
11
|
+
return document.execCommand("copy");
|
|
12
|
+
} finally {
|
|
13
|
+
e.remove();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
n as c
|
|
18
|
+
};
|