@kernelift/markdown 1.0.2 → 1.1.0
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.d.ts +3 -2
- package/dist/index.js +11 -6
- package/dist/markdown.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ declare type __VLS_Props = {
|
|
|
10
10
|
modelValue: string;
|
|
11
11
|
plugins?: Array<any>;
|
|
12
12
|
options?: MarkdownItOptions;
|
|
13
|
-
|
|
13
|
+
onCopy?: (code: string) => void;
|
|
14
|
+
copyText?: string;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
declare type __VLS_Props_2 = {
|
|
@@ -40,7 +41,7 @@ execMethods: (fn: (renderInstance: default_2) => void) => void;
|
|
|
40
41
|
}>, {
|
|
41
42
|
plugins: Array<any>;
|
|
42
43
|
options: MarkdownItOptions;
|
|
43
|
-
|
|
44
|
+
copyText: string;
|
|
44
45
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
45
46
|
containerRef: HTMLDivElement;
|
|
46
47
|
}, HTMLElement>;
|
package/dist/index.js
CHANGED
|
@@ -52768,7 +52768,8 @@ const ZT = { class: "kernelift-md-render" }, JT = ["id"], jT = /* @__PURE__ */ a
|
|
|
52768
52768
|
modelValue: {},
|
|
52769
52769
|
plugins: { default: () => [] },
|
|
52770
52770
|
options: { default: () => ({}) },
|
|
52771
|
-
|
|
52771
|
+
onCopy: {},
|
|
52772
|
+
copyText: { default: "复制代码" }
|
|
52772
52773
|
}, {
|
|
52773
52774
|
modelValue: {},
|
|
52774
52775
|
modelModifiers: {}
|
|
@@ -52816,7 +52817,7 @@ const ZT = { class: "kernelift-md-render" }, JT = ["id"], jT = /* @__PURE__ */ a
|
|
|
52816
52817
|
<div class="code-block-wrapper not-prose">
|
|
52817
52818
|
<div class="code-header">
|
|
52818
52819
|
<span class="lang">${d || "text"}</span>
|
|
52819
|
-
<button class="copy-btn"
|
|
52820
|
+
<button class="copy-btn">${n.copyText}</button>
|
|
52820
52821
|
</div>
|
|
52821
52822
|
<div class="code-content">
|
|
52822
52823
|
<div class="line-numbers">${f}</div>
|
|
@@ -52840,14 +52841,18 @@ const ZT = { class: "kernelift-md-render" }, JT = ["id"], jT = /* @__PURE__ */ a
|
|
|
52840
52841
|
const u = l.target?.closest(".copy-btn");
|
|
52841
52842
|
if (!u) return;
|
|
52842
52843
|
const p = u.closest(".code-block-wrapper")?.querySelector(".code-content__code")?.innerText;
|
|
52844
|
+
if (typeof n.onCopy == "function") {
|
|
52845
|
+
n.onCopy(p || "");
|
|
52846
|
+
return;
|
|
52847
|
+
}
|
|
52843
52848
|
if (!p) {
|
|
52844
|
-
|
|
52849
|
+
console.error("[kernelift/markdown-render] Failed to copy code");
|
|
52845
52850
|
return;
|
|
52846
52851
|
}
|
|
52847
52852
|
navigator.clipboard.writeText(p).then(() => {
|
|
52848
|
-
|
|
52853
|
+
console.info("[kernelift/markdown-render] Copied successfully");
|
|
52849
52854
|
}).catch(() => {
|
|
52850
|
-
|
|
52855
|
+
console.error("[kernelift/markdown-render] Failed to copy code");
|
|
52851
52856
|
});
|
|
52852
52857
|
};
|
|
52853
52858
|
u_([() => r.value, () => i.value], ([l, u]) => {
|
|
@@ -52873,7 +52878,7 @@ const ZT = { class: "kernelift-md-render" }, JT = ["id"], jT = /* @__PURE__ */ a
|
|
|
52873
52878
|
for (const [r, a] of t)
|
|
52874
52879
|
n[r] = a;
|
|
52875
52880
|
return n;
|
|
52876
|
-
}, aR = /* @__PURE__ */ ad(jT, [["__scopeId", "data-v-
|
|
52881
|
+
}, aR = /* @__PURE__ */ ad(jT, [["__scopeId", "data-v-ff472b87"]]), eR = { class: "kernelift-md-render" }, tR = ["id"], nR = /* @__PURE__ */ a_({
|
|
52877
52882
|
name: "MdRender",
|
|
52878
52883
|
__name: "md-render-simple",
|
|
52879
52884
|
props: /* @__PURE__ */ i_({
|
package/dist/markdown.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}html.dark{--markdown-text-color: #f7f7f7}html.dark .kernelift-md-render{color:var(--markdown-text-color)}.kernelift-md-render.prose{max-width:100%!important}.kernelift-md-render{width:100%}.kernelift-md-render h1,.kernelift-md-render h2,.kernelift-md-render h3{margin-top:.8rem;margin-bottom:.5rem;font-weight:600;color:#2c3e50;line-height:1.3}.kernelift-md-render h1{font-size:1.3em}.kernelift-md-render h2{font-size:1.1em;border-bottom:1px solid #eee;padding-bottom:.3rem}.kernelift-md-render h3{font-size:1em}.kernelift-md-render .code-block-wrapper{border:1px solid #e1e4e8;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;width:100%;margin-top
|
|
1
|
+
@charset "UTF-8";pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}html.dark,.kernelift-md-render.dark{--markdown-text-color: #f7f7f7}html.dark .kernelift-md-render__container,.kernelift-md-render.dark .kernelift-md-render__container{color:var(--markdown-text-color)}html.dark .kernelift-md-render__container .hljs,.kernelift-md-render.dark .kernelift-md-render__container .hljs{color:#eaeaea;background:#202020}html.dark .kernelift-md-render__container h1,html.dark .kernelift-md-render__container h2,html.dark .kernelift-md-render__container h3,.kernelift-md-render.dark .kernelift-md-render__container h1,.kernelift-md-render.dark .kernelift-md-render__container h2,.kernelift-md-render.dark .kernelift-md-render__container h3{color:#f7f7f7}html.dark .kernelift-md-render__container h2,.kernelift-md-render.dark .kernelift-md-render__container h2{border-bottom:1px solid #555}html.dark .kernelift-md-render__container .code-block-wrapper,.kernelift-md-render.dark .kernelift-md-render__container .code-block-wrapper{border:1px solid #555}html.dark .kernelift-md-render__container .code-block-wrapper .code-header,.kernelift-md-render.dark .kernelift-md-render__container .code-block-wrapper .code-header{background-color:#333;border-bottom:1px solid #555}html.dark .kernelift-md-render__container .code-block-wrapper .code-content,.kernelift-md-render.dark .kernelift-md-render__container .code-block-wrapper .code-content{background:#1e1e1e}html.dark .kernelift-md-render__container .code-block-wrapper .line-numbers,.kernelift-md-render.dark .kernelift-md-render__container .code-block-wrapper .line-numbers{background-color:#2a2a2a;border-right:1px solid #444;border-top:2px solid #2a2a2a}html.dark .kernelift-md-render__container .code-block-wrapper pre,.kernelift-md-render.dark .kernelift-md-render__container .code-block-wrapper pre{border-top:2px solid transparent}html.dark .kernelift-md-render__container table,.kernelift-md-render.dark .kernelift-md-render__container table{background-color:#1e1e1e;border:1px solid #555;box-shadow:0 .0625rem .1875rem #0000004d}html.dark .kernelift-md-render__container table th,.kernelift-md-render.dark .kernelift-md-render__container table th{background-color:#2a2a2a;border:1px solid #555!important;color:#f7f7f7}html.dark .kernelift-md-render__container table th:after,.kernelift-md-render.dark .kernelift-md-render__container table th:after{background-color:#555}html.dark .kernelift-md-render__container table td,.kernelift-md-render.dark .kernelift-md-render__container table td{border:1px solid #555}html.dark .kernelift-md-render__container table tr:nth-child(2n),.kernelift-md-render.dark .kernelift-md-render__container table tr:nth-child(2n){background-color:#252525}html.dark .kernelift-md-render__container table tr:hover td,.kernelift-md-render.dark .kernelift-md-render__container table tr:hover td{background-color:#333}.kernelift-md-render.prose{max-width:100%!important}.kernelift-md-render{width:100%}.kernelift-md-render h1,.kernelift-md-render h2,.kernelift-md-render h3{margin-top:.8rem;margin-bottom:.5rem;font-weight:600;color:#2c3e50;line-height:1.3}.kernelift-md-render h1{font-size:1.3em}.kernelift-md-render h2{font-size:1.1em;border-bottom:1px solid #eee;padding-bottom:.3rem}.kernelift-md-render h3{font-size:1em}.kernelift-md-render .code-block-wrapper{border:1px solid #e1e4e8;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;width:100%;margin-top:.5rem}.kernelift-md-render .code-block-wrapper .code-header{display:flex;justify-content:space-between;align-items:center;padding:.5rem .75rem;background-color:#f6f8fa;border-bottom:1px solid #e1e4e8}.kernelift-md-render .code-block-wrapper .lang{color:#6a737d;font-size:.9em}.kernelift-md-render .code-block-wrapper .copy-btn{background:none;border:none;cursor:pointer;padding:.25rem;font-size:.875rem;opacity:.6;transition:opacity .2s}.kernelift-md-render .code-block-wrapper .copy-btn:hover{opacity:1}.kernelift-md-render .code-block-wrapper .code-content{display:flex;position:relative;background:#fff}.kernelift-md-render .code-block-wrapper .line-numbers{-webkit-user-select:none;user-select:none;padding:1em;text-align:right;background-color:#f6f8fa;border-right:1px solid #f5f5f5;border-top:2px solid #f6f8fa;position:sticky;box-sizing:border-box;left:0;z-index:1}.kernelift-md-render .code-block-wrapper .line-numbers .ln{color:#6a737d;font-family:Noto Sans,sans-serif;font-size:.9375rem;line-height:1.5em}.kernelift-md-render .code-block-wrapper pre{margin:0;padding:0;overflow-x:auto;border-top:2px solid transparent;width:100%}.kernelift-md-render .code-block-wrapper pre code{font-family:Noto Sans,sans-serif;font-size:.9375rem;line-height:1.5em;display:block;margin:0;counter-reset:line;padding:1em!important}.kernelift-md-render .code-block-wrapper pre :deep(.hljs){background:transparent}.kernelift-md-render hr{margin:.8em 0}.kernelift-md-render p{margin:.5em 0}.kernelift-md-render .table-container{overflow-x:auto;width:100%}.kernelift-md-render table{width:100%;overflow:auto;margin:1em 0;border-collapse:collapse;background-color:#fff;border:1px solid #e1e4e8;box-shadow:0 .0625rem .1875rem #0000000d}.kernelift-md-render table th{background-color:#f6f8fa;border:1px solid #e1e4e8!important;font-weight:600;color:#2d3748;position:relative;white-space:nowrap}.kernelift-md-render table th:after{content:"";position:absolute;right:0;top:50%;transform:translateY(-50%);height:60%;width:.0625rem;background-color:#e1e4e8}.kernelift-md-render table th:last-child:after{display:none}.kernelift-md-render table td{border:1px solid #e1e4e8;transition:background-color .2s}.kernelift-md-render table th,.kernelift-md-render table td{padding:.75rem 1rem;text-align:left;font-size:.9375rem;line-height:1.4}.kernelift-md-render table tr:nth-child(2n){background-color:#f8f8f8}.kernelift-md-render table tr:hover td{background-color:#f0f4ff}.kernelift-md-render[data-v-ff472b87],.kernelift-md-render__container[data-v-ff472b87],.kernelift-md-render[data-v-39c9bcb3],.kernelift-md-render__container[data-v-39c9bcb3]{width:100%;min-width:200px;position:relative}
|