@incremark/vue 0.2.7 → 0.3.1
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.en.md +206 -56
- package/dist/components/ConfigProvider.vue.d.ts +19 -0
- package/dist/components/Incremark.vue.d.ts +0 -7
- package/dist/components/IncremarkCode.vue.d.ts +7 -4
- package/dist/components/IncremarkCodeDefault.vue.d.ts +16 -0
- package/dist/components/IncremarkCodeMermaid.vue.d.ts +10 -0
- package/dist/components/SvgIcon.vue.d.ts +13 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useIncremark.d.ts +2 -2
- package/dist/composables/useLocale.d.ts +21 -0
- package/dist/composables/useShiki.d.ts +6 -2
- package/dist/index.d.ts +6 -1
- package/dist/index.js +784 -522
- package/dist/index.js.map +1 -1
- package/package.json +13 -7
package/dist/index.js
CHANGED
|
@@ -260,9 +260,7 @@ function useIncremark(optionsInput = {}) {
|
|
|
260
260
|
pendingBlocks
|
|
261
261
|
});
|
|
262
262
|
const isDisplayComplete = computed2(() => {
|
|
263
|
-
console.log("\u8BA1\u7B97\u5C5E\u6027\u53D8\u66F4");
|
|
264
263
|
if (!toValue2(optionsInput).typewriter || !typewriter.enabled.value) {
|
|
265
|
-
console.log("isDisplayComplete", isFinalized.value);
|
|
266
264
|
return isFinalized.value;
|
|
267
265
|
}
|
|
268
266
|
return isFinalized.value && isAnimationComplete.value;
|
|
@@ -317,16 +315,24 @@ function useIncremark(optionsInput = {}) {
|
|
|
317
315
|
}
|
|
318
316
|
watch2(
|
|
319
317
|
() => {
|
|
320
|
-
const
|
|
321
|
-
|
|
318
|
+
const opts = toValue2(optionsInput);
|
|
319
|
+
const { typewriter: _, astBuilder, ...parserOptions } = opts;
|
|
320
|
+
return JSON.stringify(parserOptions) + "|" + (astBuilder?.name ?? "default");
|
|
322
321
|
},
|
|
323
322
|
() => {
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
const opts = toValue2(optionsInput);
|
|
324
|
+
const { typewriter: _, ...parserOptions } = opts;
|
|
325
|
+
parser.updateOptions(parserOptions);
|
|
326
|
+
completedBlocks.value = [];
|
|
327
|
+
pendingBlocks.value = [];
|
|
328
|
+
markdown.value = "";
|
|
329
|
+
isLoading.value = false;
|
|
330
|
+
isFinalized.value = false;
|
|
331
|
+
footnoteReferenceOrder.value = [];
|
|
332
|
+
transformer?.reset();
|
|
327
333
|
}
|
|
328
334
|
);
|
|
329
|
-
function
|
|
335
|
+
function render23(content) {
|
|
330
336
|
const update = parser.render(content);
|
|
331
337
|
markdown.value = parser.getBuffer();
|
|
332
338
|
completedBlocks.value = parser.getCompletedBlocks().map((b) => markRaw(b));
|
|
@@ -370,7 +376,7 @@ function useIncremark(optionsInput = {}) {
|
|
|
370
376
|
/** 重置解析器和打字机 */
|
|
371
377
|
reset,
|
|
372
378
|
/** 一次性渲染(reset + append + finalize) */
|
|
373
|
-
render:
|
|
379
|
+
render: render23,
|
|
374
380
|
/** 解析器实例 */
|
|
375
381
|
parser,
|
|
376
382
|
/** 打字机控制 */
|
|
@@ -481,10 +487,38 @@ function useBlockTransformer(sourceBlocks, options = {}) {
|
|
|
481
487
|
};
|
|
482
488
|
}
|
|
483
489
|
|
|
490
|
+
// src/composables/useLocale.ts
|
|
491
|
+
import { inject, computed as computed5 } from "vue";
|
|
492
|
+
var LOCALE_KEY = /* @__PURE__ */ Symbol("incremark-locale");
|
|
493
|
+
function useLocale() {
|
|
494
|
+
const locale = inject(LOCALE_KEY);
|
|
495
|
+
if (!locale) {
|
|
496
|
+
const defaultLocale = enShared;
|
|
497
|
+
const t2 = computed5(() => (key) => {
|
|
498
|
+
const keys = key.split(".");
|
|
499
|
+
let value = defaultLocale;
|
|
500
|
+
for (const k of keys) {
|
|
501
|
+
value = value?.[k];
|
|
502
|
+
}
|
|
503
|
+
return value || key;
|
|
504
|
+
});
|
|
505
|
+
return { t: t2 };
|
|
506
|
+
}
|
|
507
|
+
const t = computed5(() => (key) => {
|
|
508
|
+
const keys = key.split(".");
|
|
509
|
+
let value = locale.value;
|
|
510
|
+
for (const k of keys) {
|
|
511
|
+
value = value?.[k];
|
|
512
|
+
}
|
|
513
|
+
return value || key;
|
|
514
|
+
});
|
|
515
|
+
return { t };
|
|
516
|
+
}
|
|
517
|
+
|
|
484
518
|
// src/composables/useDefinationsContext.ts
|
|
485
|
-
import { inject } from "vue";
|
|
519
|
+
import { inject as inject2 } from "vue";
|
|
486
520
|
function useDefinationsContext() {
|
|
487
|
-
const definationContext =
|
|
521
|
+
const definationContext = inject2(definationsInjectionKey);
|
|
488
522
|
if (!definationContext) {
|
|
489
523
|
throw new Error("definationContext not found");
|
|
490
524
|
}
|
|
@@ -492,16 +526,16 @@ function useDefinationsContext() {
|
|
|
492
526
|
}
|
|
493
527
|
|
|
494
528
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/Incremark.vue?type=script
|
|
495
|
-
import { defineComponent as
|
|
496
|
-
import { computed as
|
|
529
|
+
import { defineComponent as _defineComponent18 } from "vue";
|
|
530
|
+
import { computed as computed14 } from "vue";
|
|
497
531
|
|
|
498
532
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkRenderer.vue?type=script
|
|
499
|
-
import { defineComponent as
|
|
500
|
-
import { computed as
|
|
533
|
+
import { defineComponent as _defineComponent16 } from "vue";
|
|
534
|
+
import { computed as computed12 } from "vue";
|
|
501
535
|
|
|
502
536
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkHeading.vue?type=script
|
|
503
537
|
import { defineComponent as _defineComponent4 } from "vue";
|
|
504
|
-
import { computed as
|
|
538
|
+
import { computed as computed7 } from "vue";
|
|
505
539
|
|
|
506
540
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkInline.vue?type=script
|
|
507
541
|
import { defineComponent as _defineComponent3 } from "vue";
|
|
@@ -513,7 +547,7 @@ import {
|
|
|
513
547
|
|
|
514
548
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkMath.vue?type=script
|
|
515
549
|
import { defineComponent as _defineComponent } from "vue";
|
|
516
|
-
import { computed as
|
|
550
|
+
import { computed as computed6, ref as ref5, watch as watch4, shallowRef as shallowRef3, onUnmounted as onUnmounted4 } from "vue";
|
|
517
551
|
var IncremarkMath_default = /* @__PURE__ */ _defineComponent({
|
|
518
552
|
__name: "IncremarkMath",
|
|
519
553
|
props: {
|
|
@@ -528,8 +562,8 @@ var IncremarkMath_default = /* @__PURE__ */ _defineComponent({
|
|
|
528
562
|
const isLoading = ref5(false);
|
|
529
563
|
const katexRef = shallowRef3(null);
|
|
530
564
|
let renderTimer = null;
|
|
531
|
-
const isInline =
|
|
532
|
-
const formula =
|
|
565
|
+
const isInline = computed6(() => props.node.type === "inlineMath");
|
|
566
|
+
const formula = computed6(() => props.node.value);
|
|
533
567
|
function scheduleRender() {
|
|
534
568
|
if (!formula.value) {
|
|
535
569
|
renderedHtml.value = "";
|
|
@@ -996,7 +1030,7 @@ function render3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
996
1030
|
[
|
|
997
1031
|
_createCommentVNode3(" HTML \u8282\u70B9\uFF08\u539F\u59CB HTML\uFF0C\u5982\u672A\u542F\u7528 htmlTree \u9009\u9879\uFF09 "),
|
|
998
1032
|
_createElementVNode3("span", {
|
|
999
|
-
|
|
1033
|
+
class: "incremark-inline-html",
|
|
1000
1034
|
innerHTML: node.value
|
|
1001
1035
|
}, null, 8, _hoisted_13)
|
|
1002
1036
|
],
|
|
@@ -1209,7 +1243,7 @@ var IncremarkHeading_default = /* @__PURE__ */ _defineComponent4({
|
|
|
1209
1243
|
setup(__props, { expose: __expose }) {
|
|
1210
1244
|
__expose();
|
|
1211
1245
|
const props = __props;
|
|
1212
|
-
const tag =
|
|
1246
|
+
const tag = computed7(() => `h${props.node.depth}`);
|
|
1213
1247
|
const __returned__ = { props, tag, IncremarkInline: IncremarkInline_default };
|
|
1214
1248
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1215
1249
|
return __returned__;
|
|
@@ -1269,11 +1303,279 @@ IncremarkParagraph_default.__file = "src/components/IncremarkParagraph.vue";
|
|
|
1269
1303
|
var IncremarkParagraph_default2 = IncremarkParagraph_default;
|
|
1270
1304
|
|
|
1271
1305
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCode.vue?type=script
|
|
1306
|
+
import { defineComponent as _defineComponent9 } from "vue";
|
|
1307
|
+
import { computed as computed10 } from "vue";
|
|
1308
|
+
|
|
1309
|
+
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCodeMermaid.vue?type=script
|
|
1310
|
+
import { defineComponent as _defineComponent7 } from "vue";
|
|
1311
|
+
import { computed as computed8, ref as ref6, onUnmounted as onUnmounted5, shallowRef as shallowRef4, watch as watch5 } from "vue";
|
|
1312
|
+
import { GravityMermaid, LucideCode, LucideEye, LucideCopy, LucideCopyCheck } from "@incremark/icons";
|
|
1313
|
+
import { isClipboardAvailable } from "@incremark/shared";
|
|
1314
|
+
|
|
1315
|
+
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/SvgIcon.vue?type=script
|
|
1272
1316
|
import { defineComponent as _defineComponent6 } from "vue";
|
|
1273
|
-
|
|
1317
|
+
var SvgIcon_default = /* @__PURE__ */ _defineComponent6({
|
|
1318
|
+
__name: "SvgIcon",
|
|
1319
|
+
props: {
|
|
1320
|
+
svg: { type: String, required: true },
|
|
1321
|
+
sizeClass: { type: String, required: false }
|
|
1322
|
+
},
|
|
1323
|
+
setup(__props, { expose: __expose }) {
|
|
1324
|
+
__expose();
|
|
1325
|
+
const __returned__ = {};
|
|
1326
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1327
|
+
return __returned__;
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/SvgIcon.vue?type=template
|
|
1332
|
+
import { normalizeClass as _normalizeClass2, openBlock as _openBlock6, createElementBlock as _createElementBlock5 } from "vue";
|
|
1333
|
+
var _hoisted_15 = ["innerHTML"];
|
|
1334
|
+
function render6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1335
|
+
return _openBlock6(), _createElementBlock5("span", {
|
|
1336
|
+
class: _normalizeClass2(["incremark-icon", $props.sizeClass]),
|
|
1337
|
+
innerHTML: $props.svg,
|
|
1338
|
+
"aria-hidden": "true"
|
|
1339
|
+
}, null, 10, _hoisted_15);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// src/components/SvgIcon.vue
|
|
1343
|
+
SvgIcon_default.render = render6;
|
|
1344
|
+
SvgIcon_default.__file = "src/components/SvgIcon.vue";
|
|
1345
|
+
var SvgIcon_default2 = SvgIcon_default;
|
|
1346
|
+
|
|
1347
|
+
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCodeMermaid.vue?type=script
|
|
1348
|
+
var IncremarkCodeMermaid_default = /* @__PURE__ */ _defineComponent7({
|
|
1349
|
+
__name: "IncremarkCodeMermaid",
|
|
1350
|
+
props: {
|
|
1351
|
+
node: { type: null, required: true },
|
|
1352
|
+
mermaidDelay: { type: Number, required: false, default: 500 }
|
|
1353
|
+
},
|
|
1354
|
+
setup(__props, { expose: __expose }) {
|
|
1355
|
+
__expose();
|
|
1356
|
+
const props = __props;
|
|
1357
|
+
const { t } = useLocale();
|
|
1358
|
+
const mermaidSvg = ref6("");
|
|
1359
|
+
const mermaidError = ref6("");
|
|
1360
|
+
const mermaidLoading = ref6(false);
|
|
1361
|
+
const mermaidRef = shallowRef4(null);
|
|
1362
|
+
let mermaidTimer = null;
|
|
1363
|
+
const mermaidViewMode = ref6("preview");
|
|
1364
|
+
function toggleMermaidView() {
|
|
1365
|
+
mermaidViewMode.value = mermaidViewMode.value === "preview" ? "source" : "preview";
|
|
1366
|
+
}
|
|
1367
|
+
const code = computed8(() => props.node.value);
|
|
1368
|
+
function scheduleRenderMermaid() {
|
|
1369
|
+
if (!code.value) return;
|
|
1370
|
+
if (mermaidTimer) {
|
|
1371
|
+
clearTimeout(mermaidTimer);
|
|
1372
|
+
}
|
|
1373
|
+
mermaidLoading.value = true;
|
|
1374
|
+
mermaidTimer = setTimeout(() => {
|
|
1375
|
+
doRenderMermaid();
|
|
1376
|
+
}, props.mermaidDelay);
|
|
1377
|
+
}
|
|
1378
|
+
async function doRenderMermaid() {
|
|
1379
|
+
if (!code.value) return;
|
|
1380
|
+
mermaidError.value = "";
|
|
1381
|
+
try {
|
|
1382
|
+
if (!mermaidRef.value) {
|
|
1383
|
+
const mermaidModule = await import("mermaid");
|
|
1384
|
+
mermaidRef.value = mermaidModule.default;
|
|
1385
|
+
mermaidRef.value.initialize({
|
|
1386
|
+
startOnLoad: false,
|
|
1387
|
+
theme: "dark",
|
|
1388
|
+
securityLevel: "loose",
|
|
1389
|
+
suppressErrorRendering: true
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
const mermaid = mermaidRef.value;
|
|
1393
|
+
const id = `mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1394
|
+
const { svg } = await mermaid.render(id, code.value);
|
|
1395
|
+
mermaidSvg.value = svg;
|
|
1396
|
+
} catch (e) {
|
|
1397
|
+
mermaidError.value = "";
|
|
1398
|
+
mermaidSvg.value = "";
|
|
1399
|
+
} finally {
|
|
1400
|
+
mermaidLoading.value = false;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
watch5(code, scheduleRenderMermaid, { immediate: true });
|
|
1404
|
+
onUnmounted5(() => {
|
|
1405
|
+
if (mermaidTimer) {
|
|
1406
|
+
clearTimeout(mermaidTimer);
|
|
1407
|
+
}
|
|
1408
|
+
if (copyTimeoutId) {
|
|
1409
|
+
clearTimeout(copyTimeoutId);
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
const copied = ref6(false);
|
|
1413
|
+
let copyTimeoutId = null;
|
|
1414
|
+
async function copyCode() {
|
|
1415
|
+
if (!isClipboardAvailable()) return;
|
|
1416
|
+
try {
|
|
1417
|
+
await navigator.clipboard.writeText(code.value);
|
|
1418
|
+
copied.value = true;
|
|
1419
|
+
if (copyTimeoutId) {
|
|
1420
|
+
clearTimeout(copyTimeoutId);
|
|
1421
|
+
}
|
|
1422
|
+
copyTimeoutId = setTimeout(() => {
|
|
1423
|
+
copied.value = false;
|
|
1424
|
+
}, 2e3);
|
|
1425
|
+
} catch {
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
const __returned__ = { props, t, mermaidSvg, mermaidError, mermaidLoading, mermaidRef, get mermaidTimer() {
|
|
1429
|
+
return mermaidTimer;
|
|
1430
|
+
}, set mermaidTimer(v) {
|
|
1431
|
+
mermaidTimer = v;
|
|
1432
|
+
}, mermaidViewMode, toggleMermaidView, code, scheduleRenderMermaid, doRenderMermaid, copied, get copyTimeoutId() {
|
|
1433
|
+
return copyTimeoutId;
|
|
1434
|
+
}, set copyTimeoutId(v) {
|
|
1435
|
+
copyTimeoutId = v;
|
|
1436
|
+
}, copyCode, get GravityMermaid() {
|
|
1437
|
+
return GravityMermaid;
|
|
1438
|
+
}, get LucideCode() {
|
|
1439
|
+
return LucideCode;
|
|
1440
|
+
}, get LucideEye() {
|
|
1441
|
+
return LucideEye;
|
|
1442
|
+
}, get LucideCopy() {
|
|
1443
|
+
return LucideCopy;
|
|
1444
|
+
}, get LucideCopyCheck() {
|
|
1445
|
+
return LucideCopyCheck;
|
|
1446
|
+
}, SvgIcon: SvgIcon_default2 };
|
|
1447
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1448
|
+
return __returned__;
|
|
1449
|
+
}
|
|
1450
|
+
});
|
|
1451
|
+
|
|
1452
|
+
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCodeMermaid.vue?type=template
|
|
1453
|
+
import { createVNode as _createVNode5, createTextVNode as _createTextVNode3, createElementVNode as _createElementVNode4, createCommentVNode as _createCommentVNode4, toDisplayString as _toDisplayString4, openBlock as _openBlock7, createElementBlock as _createElementBlock6, Fragment as _Fragment4 } from "vue";
|
|
1454
|
+
var _hoisted_16 = { class: "incremark-mermaid" };
|
|
1455
|
+
var _hoisted_23 = { class: "mermaid-header" };
|
|
1456
|
+
var _hoisted_33 = { class: "language" };
|
|
1457
|
+
var _hoisted_43 = { class: "mermaid-actions" };
|
|
1458
|
+
var _hoisted_53 = ["disabled", "aria-label", "title"];
|
|
1459
|
+
var _hoisted_63 = ["aria-label", "title"];
|
|
1460
|
+
var _hoisted_72 = { class: "mermaid-content" };
|
|
1461
|
+
var _hoisted_82 = {
|
|
1462
|
+
key: 0,
|
|
1463
|
+
class: "mermaid-loading"
|
|
1464
|
+
};
|
|
1465
|
+
var _hoisted_92 = { class: "mermaid-source-code" };
|
|
1466
|
+
var _hoisted_102 = { class: "mermaid-source-code" };
|
|
1467
|
+
var _hoisted_11 = ["innerHTML"];
|
|
1468
|
+
var _hoisted_122 = { class: "mermaid-source-code" };
|
|
1469
|
+
function render7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1470
|
+
return _openBlock7(), _createElementBlock6("div", _hoisted_16, [
|
|
1471
|
+
_createElementVNode4("div", _hoisted_23, [
|
|
1472
|
+
_createElementVNode4("span", _hoisted_33, [
|
|
1473
|
+
_createVNode5($setup["SvgIcon"], {
|
|
1474
|
+
svg: $setup.GravityMermaid,
|
|
1475
|
+
class: "language-icon"
|
|
1476
|
+
}, null, 8, ["svg"]),
|
|
1477
|
+
_cache[0] || (_cache[0] = _createTextVNode3(
|
|
1478
|
+
" MERMAID ",
|
|
1479
|
+
-1
|
|
1480
|
+
/* CACHED */
|
|
1481
|
+
))
|
|
1482
|
+
]),
|
|
1483
|
+
_createElementVNode4("div", _hoisted_43, [
|
|
1484
|
+
_createElementVNode4("button", {
|
|
1485
|
+
class: "code-btn",
|
|
1486
|
+
onClick: $setup.toggleMermaidView,
|
|
1487
|
+
type: "button",
|
|
1488
|
+
disabled: !$setup.mermaidSvg,
|
|
1489
|
+
"aria-label": $setup.mermaidViewMode === "preview" ? $setup.t("mermaid.viewSource") : $setup.t("mermaid.preview"),
|
|
1490
|
+
title: $setup.mermaidViewMode === "preview" ? "View Source" : "Preview"
|
|
1491
|
+
}, [
|
|
1492
|
+
_createVNode5($setup["SvgIcon"], {
|
|
1493
|
+
svg: $setup.mermaidViewMode === "preview" ? $setup.LucideCode : $setup.LucideEye
|
|
1494
|
+
}, null, 8, ["svg"])
|
|
1495
|
+
], 8, _hoisted_53),
|
|
1496
|
+
_createElementVNode4("button", {
|
|
1497
|
+
class: "code-btn",
|
|
1498
|
+
onClick: $setup.copyCode,
|
|
1499
|
+
type: "button",
|
|
1500
|
+
"aria-label": $setup.copied ? $setup.t("mermaid.copied") : $setup.t("mermaid.copy"),
|
|
1501
|
+
title: $setup.copied ? "Copied!" : "Copy"
|
|
1502
|
+
}, [
|
|
1503
|
+
_createVNode5($setup["SvgIcon"], {
|
|
1504
|
+
svg: $setup.copied ? $setup.LucideCopyCheck : $setup.LucideCopy
|
|
1505
|
+
}, null, 8, ["svg"])
|
|
1506
|
+
], 8, _hoisted_63)
|
|
1507
|
+
])
|
|
1508
|
+
]),
|
|
1509
|
+
_createElementVNode4("div", _hoisted_72, [
|
|
1510
|
+
_createCommentVNode4(" \u52A0\u8F7D\u4E2D "),
|
|
1511
|
+
$setup.mermaidLoading && !$setup.mermaidSvg ? (_openBlock7(), _createElementBlock6("div", _hoisted_82, [
|
|
1512
|
+
_createElementVNode4(
|
|
1513
|
+
"pre",
|
|
1514
|
+
_hoisted_92,
|
|
1515
|
+
_toDisplayString4($setup.code),
|
|
1516
|
+
1
|
|
1517
|
+
/* TEXT */
|
|
1518
|
+
)
|
|
1519
|
+
])) : $setup.mermaidViewMode === "source" ? (_openBlock7(), _createElementBlock6(
|
|
1520
|
+
_Fragment4,
|
|
1521
|
+
{ key: 1 },
|
|
1522
|
+
[
|
|
1523
|
+
_createCommentVNode4(" \u6E90\u7801\u6A21\u5F0F "),
|
|
1524
|
+
_createElementVNode4(
|
|
1525
|
+
"pre",
|
|
1526
|
+
_hoisted_102,
|
|
1527
|
+
_toDisplayString4($setup.code),
|
|
1528
|
+
1
|
|
1529
|
+
/* TEXT */
|
|
1530
|
+
)
|
|
1531
|
+
],
|
|
1532
|
+
2112
|
|
1533
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1534
|
+
)) : $setup.mermaidSvg ? (_openBlock7(), _createElementBlock6(
|
|
1535
|
+
_Fragment4,
|
|
1536
|
+
{ key: 2 },
|
|
1537
|
+
[
|
|
1538
|
+
_createCommentVNode4(" \u9884\u89C8\u6A21\u5F0F "),
|
|
1539
|
+
_createElementVNode4("div", {
|
|
1540
|
+
innerHTML: $setup.mermaidSvg,
|
|
1541
|
+
class: "mermaid-svg"
|
|
1542
|
+
}, null, 8, _hoisted_11)
|
|
1543
|
+
],
|
|
1544
|
+
2112
|
|
1545
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1546
|
+
)) : (_openBlock7(), _createElementBlock6(
|
|
1547
|
+
_Fragment4,
|
|
1548
|
+
{ key: 3 },
|
|
1549
|
+
[
|
|
1550
|
+
_createCommentVNode4(" \u65E0\u6CD5\u6E32\u67D3\u65F6\u663E\u793A\u6E90\u7801 "),
|
|
1551
|
+
_createElementVNode4(
|
|
1552
|
+
"pre",
|
|
1553
|
+
_hoisted_122,
|
|
1554
|
+
_toDisplayString4($setup.code),
|
|
1555
|
+
1
|
|
1556
|
+
/* TEXT */
|
|
1557
|
+
)
|
|
1558
|
+
],
|
|
1559
|
+
2112
|
|
1560
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1561
|
+
))
|
|
1562
|
+
])
|
|
1563
|
+
]);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
// src/components/IncremarkCodeMermaid.vue
|
|
1567
|
+
IncremarkCodeMermaid_default.render = render7;
|
|
1568
|
+
IncremarkCodeMermaid_default.__file = "src/components/IncremarkCodeMermaid.vue";
|
|
1569
|
+
var IncremarkCodeMermaid_default2 = IncremarkCodeMermaid_default;
|
|
1570
|
+
|
|
1571
|
+
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCodeDefault.vue?type=script
|
|
1572
|
+
import { defineComponent as _defineComponent8 } from "vue";
|
|
1573
|
+
import { computed as computed9, onUnmounted as onUnmounted6, ref as ref7, watch as watch6 } from "vue";
|
|
1574
|
+
import { LucideCopy as LucideCopy2, LucideCopyCheck as LucideCopyCheck2 } from "@incremark/icons";
|
|
1575
|
+
import { isClipboardAvailable as isClipboardAvailable2 } from "@incremark/shared";
|
|
1274
1576
|
|
|
1275
1577
|
// src/composables/useShiki.ts
|
|
1276
|
-
import { shallowRef as
|
|
1578
|
+
import { shallowRef as shallowRef5 } from "vue";
|
|
1277
1579
|
var ShikiManager = class _ShikiManager {
|
|
1278
1580
|
static instance = null;
|
|
1279
1581
|
/** 存储 highlighter 实例,key 为主题名称 */
|
|
@@ -1365,13 +1667,19 @@ var ShikiManager = class _ShikiManager {
|
|
|
1365
1667
|
this.highlighters.clear();
|
|
1366
1668
|
}
|
|
1367
1669
|
};
|
|
1368
|
-
var
|
|
1670
|
+
var shikiManagerInstance = null;
|
|
1671
|
+
function getShikiManager() {
|
|
1672
|
+
if (!shikiManagerInstance) {
|
|
1673
|
+
shikiManagerInstance = ShikiManager.getInstance();
|
|
1674
|
+
}
|
|
1675
|
+
return shikiManagerInstance;
|
|
1676
|
+
}
|
|
1369
1677
|
function useShiki(theme) {
|
|
1370
|
-
const highlighterInfo =
|
|
1371
|
-
const isHighlighting =
|
|
1678
|
+
const highlighterInfo = shallowRef5(null);
|
|
1679
|
+
const isHighlighting = shallowRef5(false);
|
|
1372
1680
|
async function getHighlighter() {
|
|
1373
1681
|
if (!highlighterInfo.value) {
|
|
1374
|
-
highlighterInfo.value = await
|
|
1682
|
+
highlighterInfo.value = await getShikiManager().getHighlighter(theme);
|
|
1375
1683
|
}
|
|
1376
1684
|
return highlighterInfo.value;
|
|
1377
1685
|
}
|
|
@@ -1379,13 +1687,14 @@ function useShiki(theme) {
|
|
|
1379
1687
|
isHighlighting.value = true;
|
|
1380
1688
|
try {
|
|
1381
1689
|
const info = await getHighlighter();
|
|
1690
|
+
const manager = getShikiManager();
|
|
1382
1691
|
if (!info.loadedLanguages.has(lang) && lang !== "text") {
|
|
1383
|
-
await
|
|
1692
|
+
await manager.loadLanguage(theme, lang);
|
|
1384
1693
|
}
|
|
1385
1694
|
if (!info.loadedThemes.has(theme)) {
|
|
1386
|
-
await
|
|
1695
|
+
await manager.loadTheme(theme);
|
|
1387
1696
|
}
|
|
1388
|
-
return await
|
|
1697
|
+
return await manager.codeToHtml(theme, code, lang, fallbackTheme);
|
|
1389
1698
|
} catch (e) {
|
|
1390
1699
|
throw e;
|
|
1391
1700
|
} finally {
|
|
@@ -1399,89 +1708,25 @@ function useShiki(theme) {
|
|
|
1399
1708
|
};
|
|
1400
1709
|
}
|
|
1401
1710
|
|
|
1402
|
-
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/
|
|
1403
|
-
var
|
|
1404
|
-
__name: "
|
|
1711
|
+
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCodeDefault.vue?type=script
|
|
1712
|
+
var IncremarkCodeDefault_default = /* @__PURE__ */ _defineComponent8({
|
|
1713
|
+
__name: "IncremarkCodeDefault",
|
|
1405
1714
|
props: {
|
|
1406
1715
|
node: { type: null, required: true },
|
|
1407
1716
|
theme: { type: String, required: false, default: "github-dark" },
|
|
1408
1717
|
fallbackTheme: { type: String, required: false, default: "github-dark" },
|
|
1409
|
-
disableHighlight: { type: Boolean, required: false, default: false }
|
|
1410
|
-
mermaidDelay: { type: Number, required: false, default: 500 },
|
|
1411
|
-
customCodeBlocks: { type: Object, required: false, default: () => ({}) },
|
|
1412
|
-
codeBlockConfigs: { type: Object, required: false, default: () => ({}) },
|
|
1413
|
-
blockStatus: { type: String, required: false, default: "completed" }
|
|
1718
|
+
disableHighlight: { type: Boolean, required: false, default: false }
|
|
1414
1719
|
},
|
|
1415
1720
|
setup(__props, { expose: __expose }) {
|
|
1416
1721
|
__expose();
|
|
1417
1722
|
const props = __props;
|
|
1418
|
-
const copied =
|
|
1419
|
-
const highlightedHtml =
|
|
1420
|
-
const
|
|
1421
|
-
const
|
|
1422
|
-
const
|
|
1423
|
-
const mermaidRef = shallowRef5(null);
|
|
1424
|
-
let mermaidTimer = null;
|
|
1425
|
-
const mermaidViewMode = ref6("preview");
|
|
1426
|
-
function toggleMermaidView() {
|
|
1427
|
-
mermaidViewMode.value = mermaidViewMode.value === "preview" ? "source" : "preview";
|
|
1428
|
-
}
|
|
1429
|
-
const language = computed7(() => props.node.lang || "text");
|
|
1430
|
-
const code = computed7(() => props.node.value);
|
|
1431
|
-
const isMermaid = computed7(() => language.value === "mermaid");
|
|
1432
|
-
const CustomCodeBlock = computed7(() => {
|
|
1433
|
-
const component = props.customCodeBlocks?.[language.value];
|
|
1434
|
-
if (!component) return null;
|
|
1435
|
-
const config = props.codeBlockConfigs?.[language.value];
|
|
1436
|
-
if (config?.takeOver) {
|
|
1437
|
-
return component;
|
|
1438
|
-
}
|
|
1439
|
-
if (props.blockStatus !== "completed") {
|
|
1440
|
-
return null;
|
|
1441
|
-
}
|
|
1442
|
-
return component;
|
|
1443
|
-
});
|
|
1723
|
+
const copied = ref7(false);
|
|
1724
|
+
const highlightedHtml = ref7("");
|
|
1725
|
+
const language = computed9(() => props.node.lang || "text");
|
|
1726
|
+
const code = computed9(() => props.node.value);
|
|
1727
|
+
const { t } = useLocale();
|
|
1444
1728
|
const { isHighlighting, highlight } = useShiki(props.theme);
|
|
1445
|
-
function scheduleRenderMermaid() {
|
|
1446
|
-
if (!isMermaid.value || !code.value) return;
|
|
1447
|
-
if (mermaidTimer) {
|
|
1448
|
-
clearTimeout(mermaidTimer);
|
|
1449
|
-
}
|
|
1450
|
-
mermaidLoading.value = true;
|
|
1451
|
-
mermaidTimer = setTimeout(() => {
|
|
1452
|
-
doRenderMermaid();
|
|
1453
|
-
}, props.mermaidDelay);
|
|
1454
|
-
}
|
|
1455
|
-
async function doRenderMermaid() {
|
|
1456
|
-
if (!code.value) return;
|
|
1457
|
-
mermaidError.value = "";
|
|
1458
|
-
try {
|
|
1459
|
-
if (!mermaidRef.value) {
|
|
1460
|
-
const mermaidModule = await import("mermaid");
|
|
1461
|
-
mermaidRef.value = mermaidModule.default;
|
|
1462
|
-
mermaidRef.value.initialize({
|
|
1463
|
-
startOnLoad: false,
|
|
1464
|
-
theme: "dark",
|
|
1465
|
-
securityLevel: "loose",
|
|
1466
|
-
suppressErrorRendering: true
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
const mermaid = mermaidRef.value;
|
|
1470
|
-
const id = `mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1471
|
-
const { svg } = await mermaid.render(id, code.value);
|
|
1472
|
-
mermaidSvg.value = svg;
|
|
1473
|
-
} catch (e) {
|
|
1474
|
-
mermaidError.value = "";
|
|
1475
|
-
mermaidSvg.value = "";
|
|
1476
|
-
} finally {
|
|
1477
|
-
mermaidLoading.value = false;
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
1729
|
async function doHighlight() {
|
|
1481
|
-
if (isMermaid.value) {
|
|
1482
|
-
scheduleRenderMermaid();
|
|
1483
|
-
return;
|
|
1484
|
-
}
|
|
1485
1730
|
if (!code.value || props.disableHighlight) {
|
|
1486
1731
|
highlightedHtml.value = "";
|
|
1487
1732
|
return;
|
|
@@ -1493,231 +1738,201 @@ var IncremarkCode_default = /* @__PURE__ */ _defineComponent6({
|
|
|
1493
1738
|
highlightedHtml.value = "";
|
|
1494
1739
|
}
|
|
1495
1740
|
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
if (mermaidTimer) {
|
|
1499
|
-
clearTimeout(mermaidTimer);
|
|
1500
|
-
}
|
|
1501
|
-
});
|
|
1741
|
+
watch6([code, () => props.theme], doHighlight, { immediate: true });
|
|
1742
|
+
let copyTimeoutId = null;
|
|
1502
1743
|
async function copyCode() {
|
|
1744
|
+
if (!isClipboardAvailable2()) return;
|
|
1503
1745
|
try {
|
|
1504
1746
|
await navigator.clipboard.writeText(code.value);
|
|
1505
1747
|
copied.value = true;
|
|
1506
|
-
|
|
1748
|
+
if (copyTimeoutId) {
|
|
1749
|
+
clearTimeout(copyTimeoutId);
|
|
1750
|
+
}
|
|
1751
|
+
copyTimeoutId = setTimeout(() => {
|
|
1507
1752
|
copied.value = false;
|
|
1508
1753
|
}, 2e3);
|
|
1509
1754
|
} catch {
|
|
1510
1755
|
}
|
|
1511
1756
|
}
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
}
|
|
1757
|
+
onUnmounted6(() => {
|
|
1758
|
+
if (copyTimeoutId) {
|
|
1759
|
+
clearTimeout(copyTimeoutId);
|
|
1760
|
+
}
|
|
1761
|
+
});
|
|
1762
|
+
const __returned__ = { props, copied, highlightedHtml, language, code, t, isHighlighting, highlight, doHighlight, get copyTimeoutId() {
|
|
1763
|
+
return copyTimeoutId;
|
|
1764
|
+
}, set copyTimeoutId(v) {
|
|
1765
|
+
copyTimeoutId = v;
|
|
1766
|
+
}, copyCode, get LucideCopy() {
|
|
1767
|
+
return LucideCopy2;
|
|
1768
|
+
}, get LucideCopyCheck() {
|
|
1769
|
+
return LucideCopyCheck2;
|
|
1770
|
+
}, SvgIcon: SvgIcon_default2 };
|
|
1517
1771
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1518
1772
|
return __returned__;
|
|
1519
1773
|
}
|
|
1520
1774
|
});
|
|
1521
1775
|
|
|
1522
|
-
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/
|
|
1523
|
-
import {
|
|
1524
|
-
var
|
|
1525
|
-
var
|
|
1526
|
-
var
|
|
1527
|
-
var
|
|
1528
|
-
var
|
|
1529
|
-
var
|
|
1530
|
-
key: 0,
|
|
1531
|
-
class: "mermaid-loading"
|
|
1532
|
-
};
|
|
1533
|
-
var _hoisted_72 = { class: "mermaid-source-code" };
|
|
1534
|
-
var _hoisted_82 = { class: "mermaid-source-code" };
|
|
1535
|
-
var _hoisted_92 = ["innerHTML"];
|
|
1536
|
-
var _hoisted_102 = { class: "mermaid-source-code" };
|
|
1537
|
-
var _hoisted_11 = { class: "incremark-code" };
|
|
1538
|
-
var _hoisted_122 = { class: "code-header" };
|
|
1539
|
-
var _hoisted_132 = { class: "language" };
|
|
1540
|
-
var _hoisted_142 = { class: "code-content" };
|
|
1541
|
-
var _hoisted_152 = {
|
|
1776
|
+
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCodeDefault.vue?type=template
|
|
1777
|
+
import { toDisplayString as _toDisplayString5, createElementVNode as _createElementVNode5, createVNode as _createVNode6, createCommentVNode as _createCommentVNode5, openBlock as _openBlock8, createElementBlock as _createElementBlock7, Fragment as _Fragment5 } from "vue";
|
|
1778
|
+
var _hoisted_17 = { class: "incremark-code" };
|
|
1779
|
+
var _hoisted_24 = { class: "code-header" };
|
|
1780
|
+
var _hoisted_34 = { class: "language" };
|
|
1781
|
+
var _hoisted_44 = ["aria-label", "title"];
|
|
1782
|
+
var _hoisted_54 = { class: "code-content" };
|
|
1783
|
+
var _hoisted_64 = {
|
|
1542
1784
|
key: 0,
|
|
1543
1785
|
class: "code-loading"
|
|
1544
1786
|
};
|
|
1545
|
-
var
|
|
1546
|
-
var
|
|
1547
|
-
function
|
|
1548
|
-
return
|
|
1549
|
-
|
|
1787
|
+
var _hoisted_73 = ["innerHTML"];
|
|
1788
|
+
var _hoisted_83 = { class: "code-fallback" };
|
|
1789
|
+
function render8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1790
|
+
return _openBlock8(), _createElementBlock7("div", _hoisted_17, [
|
|
1791
|
+
_createElementVNode5("div", _hoisted_24, [
|
|
1792
|
+
_createElementVNode5(
|
|
1793
|
+
"span",
|
|
1794
|
+
_hoisted_34,
|
|
1795
|
+
_toDisplayString5($setup.language),
|
|
1796
|
+
1
|
|
1797
|
+
/* TEXT */
|
|
1798
|
+
),
|
|
1799
|
+
_createElementVNode5("button", {
|
|
1800
|
+
class: "code-btn",
|
|
1801
|
+
onClick: $setup.copyCode,
|
|
1802
|
+
type: "button",
|
|
1803
|
+
"aria-label": $setup.copied ? $setup.t("code.copied") : $setup.t("code.copy"),
|
|
1804
|
+
title: $setup.copied ? "Copied!" : "Copy"
|
|
1805
|
+
}, [
|
|
1806
|
+
_createVNode6($setup["SvgIcon"], {
|
|
1807
|
+
svg: $setup.copied ? $setup.LucideCopyCheck : $setup.LucideCopy
|
|
1808
|
+
}, null, 8, ["svg"])
|
|
1809
|
+
], 8, _hoisted_44)
|
|
1810
|
+
]),
|
|
1811
|
+
_createElementVNode5("div", _hoisted_54, [
|
|
1812
|
+
_createCommentVNode5(" \u6B63\u5728\u52A0\u8F7D\u9AD8\u4EAE "),
|
|
1813
|
+
$setup.isHighlighting && !$setup.highlightedHtml ? (_openBlock8(), _createElementBlock7("div", _hoisted_64, [
|
|
1814
|
+
_createElementVNode5("pre", null, [
|
|
1815
|
+
_createElementVNode5(
|
|
1816
|
+
"code",
|
|
1817
|
+
null,
|
|
1818
|
+
_toDisplayString5($setup.code),
|
|
1819
|
+
1
|
|
1820
|
+
/* TEXT */
|
|
1821
|
+
)
|
|
1822
|
+
])
|
|
1823
|
+
])) : $setup.highlightedHtml ? (_openBlock8(), _createElementBlock7(
|
|
1824
|
+
_Fragment5,
|
|
1825
|
+
{ key: 1 },
|
|
1826
|
+
[
|
|
1827
|
+
_createCommentVNode5(" \u9AD8\u4EAE\u540E\u7684\u4EE3\u7801 "),
|
|
1828
|
+
_createElementVNode5("div", {
|
|
1829
|
+
innerHTML: $setup.highlightedHtml,
|
|
1830
|
+
class: "shiki-wrapper"
|
|
1831
|
+
}, null, 8, _hoisted_73)
|
|
1832
|
+
],
|
|
1833
|
+
2112
|
|
1834
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1835
|
+
)) : (_openBlock8(), _createElementBlock7(
|
|
1836
|
+
_Fragment5,
|
|
1837
|
+
{ key: 2 },
|
|
1838
|
+
[
|
|
1839
|
+
_createCommentVNode5(" \u56DE\u9000\uFF1A\u65E0\u9AD8\u4EAE "),
|
|
1840
|
+
_createElementVNode5("pre", _hoisted_83, [
|
|
1841
|
+
_createElementVNode5(
|
|
1842
|
+
"code",
|
|
1843
|
+
null,
|
|
1844
|
+
_toDisplayString5($setup.code),
|
|
1845
|
+
1
|
|
1846
|
+
/* TEXT */
|
|
1847
|
+
)
|
|
1848
|
+
])
|
|
1849
|
+
],
|
|
1850
|
+
2112
|
|
1851
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1852
|
+
))
|
|
1853
|
+
])
|
|
1854
|
+
]);
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
// src/components/IncremarkCodeDefault.vue
|
|
1858
|
+
IncremarkCodeDefault_default.render = render8;
|
|
1859
|
+
IncremarkCodeDefault_default.__file = "src/components/IncremarkCodeDefault.vue";
|
|
1860
|
+
var IncremarkCodeDefault_default2 = IncremarkCodeDefault_default;
|
|
1861
|
+
|
|
1862
|
+
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCode.vue?type=script
|
|
1863
|
+
var IncremarkCode_default = /* @__PURE__ */ _defineComponent9({
|
|
1864
|
+
__name: "IncremarkCode",
|
|
1865
|
+
props: {
|
|
1866
|
+
node: { type: null, required: true },
|
|
1867
|
+
theme: { type: String, required: false, default: "github-dark" },
|
|
1868
|
+
fallbackTheme: { type: String, required: false, default: "github-dark" },
|
|
1869
|
+
disableHighlight: { type: Boolean, required: false, default: false },
|
|
1870
|
+
mermaidDelay: { type: Number, required: false, default: 500 },
|
|
1871
|
+
customCodeBlocks: { type: Object, required: false, default: () => ({}) },
|
|
1872
|
+
codeBlockConfigs: { type: Object, required: false, default: () => ({}) },
|
|
1873
|
+
blockStatus: { type: String, required: false, default: "completed" },
|
|
1874
|
+
defaultCodeComponent: { type: null, required: false, default: () => IncremarkCodeDefault_default2 }
|
|
1875
|
+
},
|
|
1876
|
+
setup(__props, { expose: __expose }) {
|
|
1877
|
+
__expose();
|
|
1878
|
+
const props = __props;
|
|
1879
|
+
const language = computed10(() => props.node.lang || "text");
|
|
1880
|
+
const CustomCodeBlock = computed10(() => {
|
|
1881
|
+
const component = props.customCodeBlocks?.[language.value];
|
|
1882
|
+
if (!component) return null;
|
|
1883
|
+
const config = props.codeBlockConfigs?.[language.value];
|
|
1884
|
+
if (config?.takeOver) {
|
|
1885
|
+
return component;
|
|
1886
|
+
}
|
|
1887
|
+
if (props.blockStatus !== "completed") {
|
|
1888
|
+
return null;
|
|
1889
|
+
}
|
|
1890
|
+
return component;
|
|
1891
|
+
});
|
|
1892
|
+
const isMermaid = computed10(() => language.value === "mermaid");
|
|
1893
|
+
const __returned__ = { props, language, CustomCodeBlock, isMermaid, IncremarkCodeMermaid: IncremarkCodeMermaid_default2 };
|
|
1894
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1895
|
+
return __returned__;
|
|
1896
|
+
}
|
|
1897
|
+
});
|
|
1898
|
+
|
|
1899
|
+
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkCode.vue?type=template
|
|
1900
|
+
import { createCommentVNode as _createCommentVNode6, resolveDynamicComponent as _resolveDynamicComponent3, openBlock as _openBlock9, createBlock as _createBlock3, createVNode as _createVNode7, Fragment as _Fragment6, createElementBlock as _createElementBlock8 } from "vue";
|
|
1901
|
+
function render9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1902
|
+
return _openBlock9(), _createElementBlock8(
|
|
1903
|
+
_Fragment6,
|
|
1550
1904
|
null,
|
|
1551
1905
|
[
|
|
1552
|
-
|
|
1553
|
-
$setup.CustomCodeBlock ? (
|
|
1906
|
+
_createCommentVNode6(" \u81EA\u5B9A\u4E49\u4EE3\u7801\u5757\u7EC4\u4EF6 "),
|
|
1907
|
+
$setup.CustomCodeBlock ? (_openBlock9(), _createBlock3(_resolveDynamicComponent3($setup.CustomCodeBlock), {
|
|
1554
1908
|
key: 0,
|
|
1555
|
-
"code-str": $
|
|
1909
|
+
"code-str": $props.node.value,
|
|
1556
1910
|
lang: $setup.language,
|
|
1557
1911
|
completed: $props.blockStatus === "completed",
|
|
1558
1912
|
takeOver: $props.codeBlockConfigs?.[$setup.language]?.takeOver
|
|
1559
|
-
}, null, 8, ["code-str", "lang", "completed", "takeOver"])) : $setup.isMermaid ? (
|
|
1560
|
-
|
|
1913
|
+
}, null, 8, ["code-str", "lang", "completed", "takeOver"])) : $setup.isMermaid ? (_openBlock9(), _createElementBlock8(
|
|
1914
|
+
_Fragment6,
|
|
1561
1915
|
{ key: 1 },
|
|
1562
1916
|
[
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
{ class: "language" },
|
|
1569
|
-
"MERMAID",
|
|
1570
|
-
-1
|
|
1571
|
-
/* CACHED */
|
|
1572
|
-
)),
|
|
1573
|
-
_createElementVNode4("div", _hoisted_33, [
|
|
1574
|
-
_createElementVNode4("button", {
|
|
1575
|
-
class: "code-btn",
|
|
1576
|
-
onClick: $setup.toggleMermaidView,
|
|
1577
|
-
type: "button",
|
|
1578
|
-
disabled: !$setup.mermaidSvg
|
|
1579
|
-
}, _toDisplayString4($setup.mermaidViewMode === "preview" ? "\u6E90\u7801" : "\u9884\u89C8"), 9, _hoisted_43),
|
|
1580
|
-
_createElementVNode4(
|
|
1581
|
-
"button",
|
|
1582
|
-
{
|
|
1583
|
-
class: "code-btn",
|
|
1584
|
-
onClick: $setup.copyCode,
|
|
1585
|
-
type: "button"
|
|
1586
|
-
},
|
|
1587
|
-
_toDisplayString4($setup.copied ? "\u2713 \u5DF2\u590D\u5236" : "\u590D\u5236"),
|
|
1588
|
-
1
|
|
1589
|
-
/* TEXT */
|
|
1590
|
-
)
|
|
1591
|
-
])
|
|
1592
|
-
]),
|
|
1593
|
-
_createElementVNode4("div", _hoisted_53, [
|
|
1594
|
-
_createCommentVNode4(" \u52A0\u8F7D\u4E2D "),
|
|
1595
|
-
$setup.mermaidLoading && !$setup.mermaidSvg ? (_openBlock6(), _createElementBlock5("div", _hoisted_63, [
|
|
1596
|
-
_createElementVNode4(
|
|
1597
|
-
"pre",
|
|
1598
|
-
_hoisted_72,
|
|
1599
|
-
_toDisplayString4($setup.code),
|
|
1600
|
-
1
|
|
1601
|
-
/* TEXT */
|
|
1602
|
-
)
|
|
1603
|
-
])) : $setup.mermaidViewMode === "source" ? (_openBlock6(), _createElementBlock5(
|
|
1604
|
-
_Fragment4,
|
|
1605
|
-
{ key: 1 },
|
|
1606
|
-
[
|
|
1607
|
-
_createCommentVNode4(" \u6E90\u7801\u6A21\u5F0F "),
|
|
1608
|
-
_createElementVNode4(
|
|
1609
|
-
"pre",
|
|
1610
|
-
_hoisted_82,
|
|
1611
|
-
_toDisplayString4($setup.code),
|
|
1612
|
-
1
|
|
1613
|
-
/* TEXT */
|
|
1614
|
-
)
|
|
1615
|
-
],
|
|
1616
|
-
2112
|
|
1617
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1618
|
-
)) : $setup.mermaidSvg ? (_openBlock6(), _createElementBlock5(
|
|
1619
|
-
_Fragment4,
|
|
1620
|
-
{ key: 2 },
|
|
1621
|
-
[
|
|
1622
|
-
_createCommentVNode4(" \u9884\u89C8\u6A21\u5F0F "),
|
|
1623
|
-
_createElementVNode4("div", {
|
|
1624
|
-
innerHTML: $setup.mermaidSvg,
|
|
1625
|
-
class: "mermaid-svg"
|
|
1626
|
-
}, null, 8, _hoisted_92)
|
|
1627
|
-
],
|
|
1628
|
-
2112
|
|
1629
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1630
|
-
)) : (_openBlock6(), _createElementBlock5(
|
|
1631
|
-
_Fragment4,
|
|
1632
|
-
{ key: 3 },
|
|
1633
|
-
[
|
|
1634
|
-
_createCommentVNode4(" \u65E0\u6CD5\u6E32\u67D3\u65F6\u663E\u793A\u6E90\u7801 "),
|
|
1635
|
-
_createElementVNode4(
|
|
1636
|
-
"pre",
|
|
1637
|
-
_hoisted_102,
|
|
1638
|
-
_toDisplayString4($setup.code),
|
|
1639
|
-
1
|
|
1640
|
-
/* TEXT */
|
|
1641
|
-
)
|
|
1642
|
-
],
|
|
1643
|
-
2112
|
|
1644
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1645
|
-
))
|
|
1646
|
-
])
|
|
1647
|
-
])
|
|
1917
|
+
_createCommentVNode6(" Mermaid \u56FE\u8868 "),
|
|
1918
|
+
_createVNode7($setup["IncremarkCodeMermaid"], {
|
|
1919
|
+
node: $props.node,
|
|
1920
|
+
"mermaid-delay": $props.mermaidDelay
|
|
1921
|
+
}, null, 8, ["node", "mermaid-delay"])
|
|
1648
1922
|
],
|
|
1649
1923
|
2112
|
|
1650
1924
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1651
|
-
)) : (
|
|
1652
|
-
|
|
1925
|
+
)) : (_openBlock9(), _createElementBlock8(
|
|
1926
|
+
_Fragment6,
|
|
1653
1927
|
{ key: 2 },
|
|
1654
1928
|
[
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
1
|
|
1663
|
-
/* TEXT */
|
|
1664
|
-
),
|
|
1665
|
-
_createElementVNode4(
|
|
1666
|
-
"button",
|
|
1667
|
-
{
|
|
1668
|
-
class: "code-btn",
|
|
1669
|
-
onClick: $setup.copyCode,
|
|
1670
|
-
type: "button"
|
|
1671
|
-
},
|
|
1672
|
-
_toDisplayString4($setup.copied ? "\u2713 \u5DF2\u590D\u5236" : "\u590D\u5236"),
|
|
1673
|
-
1
|
|
1674
|
-
/* TEXT */
|
|
1675
|
-
)
|
|
1676
|
-
]),
|
|
1677
|
-
_createElementVNode4("div", _hoisted_142, [
|
|
1678
|
-
_createCommentVNode4(" \u6B63\u5728\u52A0\u8F7D\u9AD8\u4EAE "),
|
|
1679
|
-
$setup.isHighlighting && !$setup.highlightedHtml ? (_openBlock6(), _createElementBlock5("div", _hoisted_152, [
|
|
1680
|
-
_createElementVNode4("pre", null, [
|
|
1681
|
-
_createElementVNode4(
|
|
1682
|
-
"code",
|
|
1683
|
-
null,
|
|
1684
|
-
_toDisplayString4($setup.code),
|
|
1685
|
-
1
|
|
1686
|
-
/* TEXT */
|
|
1687
|
-
)
|
|
1688
|
-
])
|
|
1689
|
-
])) : $setup.highlightedHtml ? (_openBlock6(), _createElementBlock5(
|
|
1690
|
-
_Fragment4,
|
|
1691
|
-
{ key: 1 },
|
|
1692
|
-
[
|
|
1693
|
-
_createCommentVNode4(" \u9AD8\u4EAE\u540E\u7684\u4EE3\u7801 "),
|
|
1694
|
-
_createElementVNode4("div", {
|
|
1695
|
-
innerHTML: $setup.highlightedHtml,
|
|
1696
|
-
class: "shiki-wrapper"
|
|
1697
|
-
}, null, 8, _hoisted_16)
|
|
1698
|
-
],
|
|
1699
|
-
2112
|
|
1700
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1701
|
-
)) : (_openBlock6(), _createElementBlock5(
|
|
1702
|
-
_Fragment4,
|
|
1703
|
-
{ key: 2 },
|
|
1704
|
-
[
|
|
1705
|
-
_createCommentVNode4(" \u56DE\u9000\uFF1A\u65E0\u9AD8\u4EAE "),
|
|
1706
|
-
_createElementVNode4("pre", _hoisted_17, [
|
|
1707
|
-
_createElementVNode4(
|
|
1708
|
-
"code",
|
|
1709
|
-
null,
|
|
1710
|
-
_toDisplayString4($setup.code),
|
|
1711
|
-
1
|
|
1712
|
-
/* TEXT */
|
|
1713
|
-
)
|
|
1714
|
-
])
|
|
1715
|
-
],
|
|
1716
|
-
2112
|
|
1717
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1718
|
-
))
|
|
1719
|
-
])
|
|
1720
|
-
])
|
|
1929
|
+
_createCommentVNode6(" \u9ED8\u8BA4\u4EE3\u7801\u5757\u6E32\u67D3\uFF08\u652F\u6301\u7528\u6237\u81EA\u5B9A\u4E49\uFF09 "),
|
|
1930
|
+
(_openBlock9(), _createBlock3(_resolveDynamicComponent3($props.defaultCodeComponent), {
|
|
1931
|
+
node: $props.node,
|
|
1932
|
+
theme: $props.theme,
|
|
1933
|
+
"fallback-theme": $props.fallbackTheme,
|
|
1934
|
+
"disable-highlight": $props.disableHighlight
|
|
1935
|
+
}, null, 8, ["node", "theme", "fallback-theme", "disable-highlight"]))
|
|
1721
1936
|
],
|
|
1722
1937
|
2112
|
|
1723
1938
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -1729,14 +1944,14 @@ function render6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1729
1944
|
}
|
|
1730
1945
|
|
|
1731
1946
|
// src/components/IncremarkCode.vue
|
|
1732
|
-
IncremarkCode_default.render =
|
|
1947
|
+
IncremarkCode_default.render = render9;
|
|
1733
1948
|
IncremarkCode_default.__file = "src/components/IncremarkCode.vue";
|
|
1734
1949
|
var IncremarkCode_default2 = IncremarkCode_default;
|
|
1735
1950
|
|
|
1736
1951
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkList.vue?type=script
|
|
1737
|
-
import { defineComponent as
|
|
1738
|
-
import { computed as
|
|
1739
|
-
var IncremarkList_default = /* @__PURE__ */
|
|
1952
|
+
import { defineComponent as _defineComponent10 } from "vue";
|
|
1953
|
+
import { computed as computed11 } from "vue";
|
|
1954
|
+
var IncremarkList_default = /* @__PURE__ */ _defineComponent10({
|
|
1740
1955
|
...{
|
|
1741
1956
|
name: "IncremarkList"
|
|
1742
1957
|
},
|
|
@@ -1747,7 +1962,7 @@ var IncremarkList_default = /* @__PURE__ */ _defineComponent7({
|
|
|
1747
1962
|
setup(__props, { expose: __expose }) {
|
|
1748
1963
|
__expose();
|
|
1749
1964
|
const props = __props;
|
|
1750
|
-
const tag =
|
|
1965
|
+
const tag = computed11(() => props.node.ordered ? "ol" : "ul");
|
|
1751
1966
|
function getItemInlineContent(item) {
|
|
1752
1967
|
const firstChild = item.children[0];
|
|
1753
1968
|
if (firstChild?.type === "paragraph") {
|
|
@@ -1773,62 +1988,62 @@ var IncremarkList_default = /* @__PURE__ */ _defineComponent7({
|
|
|
1773
1988
|
});
|
|
1774
1989
|
|
|
1775
1990
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkList.vue?type=template
|
|
1776
|
-
import { renderList as _renderList3, Fragment as
|
|
1991
|
+
import { renderList as _renderList3, Fragment as _Fragment7, openBlock as _openBlock10, createElementBlock as _createElementBlock9, createElementVNode as _createElementVNode6, createVNode as _createVNode8, createCommentVNode as _createCommentVNode7, createBlock as _createBlock4, normalizeClass as _normalizeClass3, resolveDynamicComponent as _resolveDynamicComponent4, withCtx as _withCtx3 } from "vue";
|
|
1777
1992
|
var _hoisted_18 = {
|
|
1778
1993
|
key: 0,
|
|
1779
1994
|
class: "task-label"
|
|
1780
1995
|
};
|
|
1781
|
-
var
|
|
1782
|
-
var
|
|
1783
|
-
function
|
|
1784
|
-
return
|
|
1785
|
-
class:
|
|
1996
|
+
var _hoisted_25 = ["checked"];
|
|
1997
|
+
var _hoisted_35 = { class: "task-content" };
|
|
1998
|
+
function render10(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1999
|
+
return _openBlock10(), _createBlock4(_resolveDynamicComponent4($setup.tag), {
|
|
2000
|
+
class: _normalizeClass3(["incremark-list", { "task-list": $props.node.children.some((item) => item.checked !== null && item.checked !== void 0) }]),
|
|
1786
2001
|
start: $props.node.start || void 0
|
|
1787
2002
|
}, {
|
|
1788
2003
|
default: _withCtx3(() => [
|
|
1789
|
-
(
|
|
1790
|
-
|
|
2004
|
+
(_openBlock10(true), _createElementBlock9(
|
|
2005
|
+
_Fragment7,
|
|
1791
2006
|
null,
|
|
1792
2007
|
_renderList3($props.node.children, (item, index) => {
|
|
1793
|
-
return
|
|
2008
|
+
return _openBlock10(), _createElementBlock9(
|
|
1794
2009
|
"li",
|
|
1795
2010
|
{
|
|
1796
2011
|
key: index,
|
|
1797
|
-
class:
|
|
2012
|
+
class: _normalizeClass3(["incremark-list-item", { "task-item": item.checked !== null && item.checked !== void 0 }])
|
|
1798
2013
|
},
|
|
1799
2014
|
[
|
|
1800
|
-
item.checked !== null && item.checked !== void 0 ? (
|
|
1801
|
-
|
|
2015
|
+
item.checked !== null && item.checked !== void 0 ? (_openBlock10(), _createElementBlock9("label", _hoisted_18, [
|
|
2016
|
+
_createElementVNode6("input", {
|
|
1802
2017
|
type: "checkbox",
|
|
1803
2018
|
checked: item.checked,
|
|
1804
2019
|
disabled: "",
|
|
1805
2020
|
class: "checkbox"
|
|
1806
|
-
}, null, 8,
|
|
1807
|
-
|
|
1808
|
-
|
|
2021
|
+
}, null, 8, _hoisted_25),
|
|
2022
|
+
_createElementVNode6("span", _hoisted_35, [
|
|
2023
|
+
_createVNode8($setup["IncremarkInline"], {
|
|
1809
2024
|
nodes: $setup.getItemInlineContent(item)
|
|
1810
2025
|
}, null, 8, ["nodes"])
|
|
1811
2026
|
])
|
|
1812
|
-
])) : (
|
|
1813
|
-
|
|
2027
|
+
])) : (_openBlock10(), _createElementBlock9(
|
|
2028
|
+
_Fragment7,
|
|
1814
2029
|
{ key: 1 },
|
|
1815
2030
|
[
|
|
1816
|
-
|
|
2031
|
+
_createVNode8($setup["IncremarkInline"], {
|
|
1817
2032
|
nodes: $setup.getItemInlineContent(item)
|
|
1818
2033
|
}, null, 8, ["nodes"]),
|
|
1819
|
-
|
|
1820
|
-
$setup.hasBlockChildren(item) ? (
|
|
1821
|
-
|
|
2034
|
+
_createCommentVNode7(" \u9012\u5F52\u6E32\u67D3\u6240\u6709\u5757\u7EA7\u5185\u5BB9\uFF08\u5D4C\u5957\u5217\u8868\u3001heading\u3001blockquote\u3001code\u3001table \u7B49\uFF09 "),
|
|
2035
|
+
$setup.hasBlockChildren(item) ? (_openBlock10(true), _createElementBlock9(
|
|
2036
|
+
_Fragment7,
|
|
1822
2037
|
{ key: 0 },
|
|
1823
2038
|
_renderList3($setup.getItemBlockChildren(item), (child, childIndex) => {
|
|
1824
|
-
return
|
|
2039
|
+
return _openBlock10(), _createBlock4($setup["IncremarkRenderer"], {
|
|
1825
2040
|
key: childIndex,
|
|
1826
2041
|
node: child
|
|
1827
2042
|
}, null, 8, ["node"]);
|
|
1828
2043
|
}),
|
|
1829
2044
|
128
|
|
1830
2045
|
/* KEYED_FRAGMENT */
|
|
1831
|
-
)) :
|
|
2046
|
+
)) : _createCommentVNode7("v-if", true)
|
|
1832
2047
|
],
|
|
1833
2048
|
64
|
|
1834
2049
|
/* STABLE_FRAGMENT */
|
|
@@ -1848,13 +2063,13 @@ function render7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1848
2063
|
}
|
|
1849
2064
|
|
|
1850
2065
|
// src/components/IncremarkList.vue
|
|
1851
|
-
IncremarkList_default.render =
|
|
2066
|
+
IncremarkList_default.render = render10;
|
|
1852
2067
|
IncremarkList_default.__file = "src/components/IncremarkList.vue";
|
|
1853
2068
|
var IncremarkList_default2 = IncremarkList_default;
|
|
1854
2069
|
|
|
1855
2070
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkTable.vue?type=script
|
|
1856
|
-
import { defineComponent as
|
|
1857
|
-
var IncremarkTable_default = /* @__PURE__ */
|
|
2071
|
+
import { defineComponent as _defineComponent11 } from "vue";
|
|
2072
|
+
var IncremarkTable_default = /* @__PURE__ */ _defineComponent11({
|
|
1858
2073
|
__name: "IncremarkTable",
|
|
1859
2074
|
props: {
|
|
1860
2075
|
node: { type: null, required: true }
|
|
@@ -1871,62 +2086,62 @@ var IncremarkTable_default = /* @__PURE__ */ _defineComponent8({
|
|
|
1871
2086
|
});
|
|
1872
2087
|
|
|
1873
2088
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkTable.vue?type=template
|
|
1874
|
-
import { renderList as _renderList4, Fragment as
|
|
2089
|
+
import { renderList as _renderList4, Fragment as _Fragment8, openBlock as _openBlock11, createElementBlock as _createElementBlock10, createVNode as _createVNode9, normalizeClass as _normalizeClass4, createCommentVNode as _createCommentVNode8, createElementVNode as _createElementVNode7 } from "vue";
|
|
1875
2090
|
var _hoisted_19 = { class: "incremark-table-wrapper" };
|
|
1876
|
-
var
|
|
1877
|
-
var
|
|
1878
|
-
function
|
|
1879
|
-
return
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
$props.node.children[0] ? (
|
|
1883
|
-
(
|
|
1884
|
-
|
|
2091
|
+
var _hoisted_26 = { class: "incremark-table" };
|
|
2092
|
+
var _hoisted_36 = { key: 0 };
|
|
2093
|
+
function render11(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2094
|
+
return _openBlock11(), _createElementBlock10("div", _hoisted_19, [
|
|
2095
|
+
_createElementVNode7("table", _hoisted_26, [
|
|
2096
|
+
_createElementVNode7("thead", null, [
|
|
2097
|
+
$props.node.children[0] ? (_openBlock11(), _createElementBlock10("tr", _hoisted_36, [
|
|
2098
|
+
(_openBlock11(true), _createElementBlock10(
|
|
2099
|
+
_Fragment8,
|
|
1885
2100
|
null,
|
|
1886
2101
|
_renderList4($props.node.children[0].children, (cell, cellIndex) => {
|
|
1887
|
-
return
|
|
2102
|
+
return _openBlock11(), _createElementBlock10(
|
|
1888
2103
|
"th",
|
|
1889
2104
|
{
|
|
1890
2105
|
key: cellIndex,
|
|
1891
|
-
|
|
2106
|
+
class: _normalizeClass4(`incremark-table-align-${$props.node.align?.[cellIndex] || "left"}`)
|
|
1892
2107
|
},
|
|
1893
2108
|
[
|
|
1894
|
-
|
|
2109
|
+
_createVNode9($setup["IncremarkInline"], {
|
|
1895
2110
|
nodes: $setup.getCellContent(cell)
|
|
1896
2111
|
}, null, 8, ["nodes"])
|
|
1897
2112
|
],
|
|
1898
|
-
|
|
1899
|
-
/*
|
|
2113
|
+
2
|
|
2114
|
+
/* CLASS */
|
|
1900
2115
|
);
|
|
1901
2116
|
}),
|
|
1902
2117
|
128
|
|
1903
2118
|
/* KEYED_FRAGMENT */
|
|
1904
2119
|
))
|
|
1905
|
-
])) :
|
|
2120
|
+
])) : _createCommentVNode8("v-if", true)
|
|
1906
2121
|
]),
|
|
1907
|
-
|
|
1908
|
-
(
|
|
1909
|
-
|
|
2122
|
+
_createElementVNode7("tbody", null, [
|
|
2123
|
+
(_openBlock11(true), _createElementBlock10(
|
|
2124
|
+
_Fragment8,
|
|
1910
2125
|
null,
|
|
1911
2126
|
_renderList4($props.node.children.slice(1), (row, rowIndex) => {
|
|
1912
|
-
return
|
|
1913
|
-
(
|
|
1914
|
-
|
|
2127
|
+
return _openBlock11(), _createElementBlock10("tr", { key: rowIndex }, [
|
|
2128
|
+
(_openBlock11(true), _createElementBlock10(
|
|
2129
|
+
_Fragment8,
|
|
1915
2130
|
null,
|
|
1916
2131
|
_renderList4(row.children, (cell, cellIndex) => {
|
|
1917
|
-
return
|
|
2132
|
+
return _openBlock11(), _createElementBlock10(
|
|
1918
2133
|
"td",
|
|
1919
2134
|
{
|
|
1920
2135
|
key: cellIndex,
|
|
1921
|
-
|
|
2136
|
+
class: _normalizeClass4(`incremark-table-align-${$props.node.align?.[cellIndex] || "left"}`)
|
|
1922
2137
|
},
|
|
1923
2138
|
[
|
|
1924
|
-
|
|
2139
|
+
_createVNode9($setup["IncremarkInline"], {
|
|
1925
2140
|
nodes: $setup.getCellContent(cell)
|
|
1926
2141
|
}, null, 8, ["nodes"])
|
|
1927
2142
|
],
|
|
1928
|
-
|
|
1929
|
-
/*
|
|
2143
|
+
2
|
|
2144
|
+
/* CLASS */
|
|
1930
2145
|
);
|
|
1931
2146
|
}),
|
|
1932
2147
|
128
|
|
@@ -1943,13 +2158,13 @@ function render8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1943
2158
|
}
|
|
1944
2159
|
|
|
1945
2160
|
// src/components/IncremarkTable.vue
|
|
1946
|
-
IncremarkTable_default.render =
|
|
2161
|
+
IncremarkTable_default.render = render11;
|
|
1947
2162
|
IncremarkTable_default.__file = "src/components/IncremarkTable.vue";
|
|
1948
2163
|
var IncremarkTable_default2 = IncremarkTable_default;
|
|
1949
2164
|
|
|
1950
2165
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkBlockquote.vue?type=script
|
|
1951
|
-
import { defineComponent as
|
|
1952
|
-
var IncremarkBlockquote_default = /* @__PURE__ */
|
|
2166
|
+
import { defineComponent as _defineComponent12 } from "vue";
|
|
2167
|
+
var IncremarkBlockquote_default = /* @__PURE__ */ _defineComponent12({
|
|
1953
2168
|
__name: "IncremarkBlockquote",
|
|
1954
2169
|
props: {
|
|
1955
2170
|
node: { type: null, required: true }
|
|
@@ -1963,15 +2178,15 @@ var IncremarkBlockquote_default = /* @__PURE__ */ _defineComponent9({
|
|
|
1963
2178
|
});
|
|
1964
2179
|
|
|
1965
2180
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkBlockquote.vue?type=template
|
|
1966
|
-
import { renderList as _renderList5, Fragment as
|
|
2181
|
+
import { renderList as _renderList5, Fragment as _Fragment9, openBlock as _openBlock12, createElementBlock as _createElementBlock11, createBlock as _createBlock5 } from "vue";
|
|
1967
2182
|
var _hoisted_110 = { class: "incremark-blockquote" };
|
|
1968
|
-
function
|
|
1969
|
-
return
|
|
1970
|
-
(
|
|
1971
|
-
|
|
2183
|
+
function render12(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2184
|
+
return _openBlock12(), _createElementBlock11("blockquote", _hoisted_110, [
|
|
2185
|
+
(_openBlock12(true), _createElementBlock11(
|
|
2186
|
+
_Fragment9,
|
|
1972
2187
|
null,
|
|
1973
2188
|
_renderList5($props.node.children, (child, index) => {
|
|
1974
|
-
return
|
|
2189
|
+
return _openBlock12(), _createBlock5($setup["IncremarkRenderer"], {
|
|
1975
2190
|
key: index,
|
|
1976
2191
|
node: child
|
|
1977
2192
|
}, null, 8, ["node"]);
|
|
@@ -1983,13 +2198,13 @@ function render9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1983
2198
|
}
|
|
1984
2199
|
|
|
1985
2200
|
// src/components/IncremarkBlockquote.vue
|
|
1986
|
-
IncremarkBlockquote_default.render =
|
|
2201
|
+
IncremarkBlockquote_default.render = render12;
|
|
1987
2202
|
IncremarkBlockquote_default.__file = "src/components/IncremarkBlockquote.vue";
|
|
1988
2203
|
var IncremarkBlockquote_default2 = IncremarkBlockquote_default;
|
|
1989
2204
|
|
|
1990
2205
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkThematicBreak.vue?type=script
|
|
1991
|
-
import { defineComponent as
|
|
1992
|
-
var IncremarkThematicBreak_default = /* @__PURE__ */
|
|
2206
|
+
import { defineComponent as _defineComponent13 } from "vue";
|
|
2207
|
+
var IncremarkThematicBreak_default = /* @__PURE__ */ _defineComponent13({
|
|
1993
2208
|
__name: "IncremarkThematicBreak",
|
|
1994
2209
|
setup(__props, { expose: __expose }) {
|
|
1995
2210
|
__expose();
|
|
@@ -2000,20 +2215,20 @@ var IncremarkThematicBreak_default = /* @__PURE__ */ _defineComponent10({
|
|
|
2000
2215
|
});
|
|
2001
2216
|
|
|
2002
2217
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkThematicBreak.vue?type=template
|
|
2003
|
-
import { openBlock as
|
|
2218
|
+
import { openBlock as _openBlock13, createElementBlock as _createElementBlock12 } from "vue";
|
|
2004
2219
|
var _hoisted_111 = { class: "incremark-hr" };
|
|
2005
|
-
function
|
|
2006
|
-
return
|
|
2220
|
+
function render13(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2221
|
+
return _openBlock13(), _createElementBlock12("hr", _hoisted_111);
|
|
2007
2222
|
}
|
|
2008
2223
|
|
|
2009
2224
|
// src/components/IncremarkThematicBreak.vue
|
|
2010
|
-
IncremarkThematicBreak_default.render =
|
|
2225
|
+
IncremarkThematicBreak_default.render = render13;
|
|
2011
2226
|
IncremarkThematicBreak_default.__file = "src/components/IncremarkThematicBreak.vue";
|
|
2012
2227
|
var IncremarkThematicBreak_default2 = IncremarkThematicBreak_default;
|
|
2013
2228
|
|
|
2014
2229
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkContainer.vue?type=script
|
|
2015
|
-
import { defineComponent as
|
|
2016
|
-
var IncremarkContainer_default = /* @__PURE__ */
|
|
2230
|
+
import { defineComponent as _defineComponent14 } from "vue";
|
|
2231
|
+
var IncremarkContainer_default = /* @__PURE__ */ _defineComponent14({
|
|
2017
2232
|
__name: "IncremarkContainer",
|
|
2018
2233
|
props: {
|
|
2019
2234
|
node: { type: Object, required: true },
|
|
@@ -2045,56 +2260,56 @@ var IncremarkContainer_default = /* @__PURE__ */ _defineComponent11({
|
|
|
2045
2260
|
});
|
|
2046
2261
|
|
|
2047
2262
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkContainer.vue?type=template
|
|
2048
|
-
import { createCommentVNode as
|
|
2263
|
+
import { createCommentVNode as _createCommentVNode9, renderList as _renderList6, Fragment as _Fragment10, openBlock as _openBlock14, createElementBlock as _createElementBlock13, createBlock as _createBlock6, resolveDynamicComponent as _resolveDynamicComponent5, withCtx as _withCtx4, normalizeClass as _normalizeClass5, createElementVNode as _createElementVNode8 } from "vue";
|
|
2049
2264
|
var _hoisted_112 = {
|
|
2050
2265
|
key: 0,
|
|
2051
2266
|
class: "incremark-container-content"
|
|
2052
2267
|
};
|
|
2053
|
-
function
|
|
2054
|
-
return
|
|
2055
|
-
|
|
2268
|
+
function render14(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2269
|
+
return _openBlock14(), _createElementBlock13(
|
|
2270
|
+
_Fragment10,
|
|
2056
2271
|
null,
|
|
2057
2272
|
[
|
|
2058
|
-
|
|
2059
|
-
$setup.hasCustomContainer ? (
|
|
2273
|
+
_createCommentVNode9(" \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u5BB9\u5668\u7EC4\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u7EC4\u4EF6 "),
|
|
2274
|
+
$setup.hasCustomContainer ? (_openBlock14(), _createBlock6(_resolveDynamicComponent5($setup.CustomContainer), {
|
|
2060
2275
|
key: 0,
|
|
2061
2276
|
name: $setup.containerName,
|
|
2062
2277
|
options: $setup.options
|
|
2063
2278
|
}, {
|
|
2064
2279
|
default: _withCtx4(() => [
|
|
2065
|
-
|
|
2066
|
-
$props.node.children && $props.node.children.length > 0 ? (
|
|
2067
|
-
|
|
2280
|
+
_createCommentVNode9(" \u5C06\u5BB9\u5668\u5185\u5BB9\u4F5C\u4E3A\u9ED8\u8BA4 slot \u4F20\u9012 "),
|
|
2281
|
+
$props.node.children && $props.node.children.length > 0 ? (_openBlock14(true), _createElementBlock13(
|
|
2282
|
+
_Fragment10,
|
|
2068
2283
|
{ key: 0 },
|
|
2069
2284
|
_renderList6($props.node.children, (child, index) => {
|
|
2070
|
-
return
|
|
2285
|
+
return _openBlock14(), _createBlock6($setup["IncremarkRenderer"], {
|
|
2071
2286
|
key: index,
|
|
2072
2287
|
node: child
|
|
2073
2288
|
}, null, 8, ["node"]);
|
|
2074
2289
|
}),
|
|
2075
2290
|
128
|
|
2076
2291
|
/* KEYED_FRAGMENT */
|
|
2077
|
-
)) :
|
|
2292
|
+
)) : _createCommentVNode9("v-if", true)
|
|
2078
2293
|
]),
|
|
2079
2294
|
_: 1
|
|
2080
2295
|
/* STABLE */
|
|
2081
|
-
}, 8, ["name", "options"])) : (
|
|
2082
|
-
|
|
2296
|
+
}, 8, ["name", "options"])) : (_openBlock14(), _createElementBlock13(
|
|
2297
|
+
_Fragment10,
|
|
2083
2298
|
{ key: 1 },
|
|
2084
2299
|
[
|
|
2085
|
-
|
|
2086
|
-
|
|
2300
|
+
_createCommentVNode9(" \u5982\u679C\u6CA1\u6709\u81EA\u5B9A\u4E49\u5BB9\u5668\u7EC4\u4EF6\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u6E32\u67D3 "),
|
|
2301
|
+
_createElementVNode8(
|
|
2087
2302
|
"div",
|
|
2088
2303
|
{
|
|
2089
|
-
class:
|
|
2304
|
+
class: _normalizeClass5(["incremark-container", `incremark-container-${$setup.containerName}`])
|
|
2090
2305
|
},
|
|
2091
2306
|
[
|
|
2092
|
-
$props.node.children && $props.node.children.length > 0 ? (
|
|
2093
|
-
(
|
|
2094
|
-
|
|
2307
|
+
$props.node.children && $props.node.children.length > 0 ? (_openBlock14(), _createElementBlock13("div", _hoisted_112, [
|
|
2308
|
+
(_openBlock14(true), _createElementBlock13(
|
|
2309
|
+
_Fragment10,
|
|
2095
2310
|
null,
|
|
2096
2311
|
_renderList6($props.node.children, (child, index) => {
|
|
2097
|
-
return
|
|
2312
|
+
return _openBlock14(), _createBlock6($setup["IncremarkRenderer"], {
|
|
2098
2313
|
key: index,
|
|
2099
2314
|
node: child
|
|
2100
2315
|
}, null, 8, ["node"]);
|
|
@@ -2102,7 +2317,7 @@ function render11(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2102
2317
|
128
|
|
2103
2318
|
/* KEYED_FRAGMENT */
|
|
2104
2319
|
))
|
|
2105
|
-
])) :
|
|
2320
|
+
])) : _createCommentVNode9("v-if", true)
|
|
2106
2321
|
],
|
|
2107
2322
|
2
|
|
2108
2323
|
/* CLASS */
|
|
@@ -2118,13 +2333,13 @@ function render11(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2118
2333
|
}
|
|
2119
2334
|
|
|
2120
2335
|
// src/components/IncremarkContainer.vue
|
|
2121
|
-
IncremarkContainer_default.render =
|
|
2336
|
+
IncremarkContainer_default.render = render14;
|
|
2122
2337
|
IncremarkContainer_default.__file = "src/components/IncremarkContainer.vue";
|
|
2123
2338
|
var IncremarkContainer_default2 = IncremarkContainer_default;
|
|
2124
2339
|
|
|
2125
2340
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkDefault.vue?type=script
|
|
2126
|
-
import { defineComponent as
|
|
2127
|
-
var IncremarkDefault_default = /* @__PURE__ */
|
|
2341
|
+
import { defineComponent as _defineComponent15 } from "vue";
|
|
2342
|
+
var IncremarkDefault_default = /* @__PURE__ */ _defineComponent15({
|
|
2128
2343
|
__name: "IncremarkDefault",
|
|
2129
2344
|
props: {
|
|
2130
2345
|
node: { type: null, required: true }
|
|
@@ -2138,22 +2353,22 @@ var IncremarkDefault_default = /* @__PURE__ */ _defineComponent12({
|
|
|
2138
2353
|
});
|
|
2139
2354
|
|
|
2140
2355
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkDefault.vue?type=template
|
|
2141
|
-
import { toDisplayString as
|
|
2356
|
+
import { toDisplayString as _toDisplayString6, createElementVNode as _createElementVNode9, openBlock as _openBlock15, createElementBlock as _createElementBlock14 } from "vue";
|
|
2142
2357
|
var _hoisted_113 = { class: "incremark-default" };
|
|
2143
|
-
var
|
|
2144
|
-
function
|
|
2145
|
-
return
|
|
2146
|
-
|
|
2358
|
+
var _hoisted_27 = { class: "type-badge" };
|
|
2359
|
+
function render15(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2360
|
+
return _openBlock15(), _createElementBlock14("div", _hoisted_113, [
|
|
2361
|
+
_createElementVNode9(
|
|
2147
2362
|
"span",
|
|
2148
|
-
|
|
2149
|
-
|
|
2363
|
+
_hoisted_27,
|
|
2364
|
+
_toDisplayString6($props.node.type),
|
|
2150
2365
|
1
|
|
2151
2366
|
/* TEXT */
|
|
2152
2367
|
),
|
|
2153
|
-
|
|
2368
|
+
_createElementVNode9(
|
|
2154
2369
|
"pre",
|
|
2155
2370
|
null,
|
|
2156
|
-
|
|
2371
|
+
_toDisplayString6(JSON.stringify($props.node, null, 2)),
|
|
2157
2372
|
1
|
|
2158
2373
|
/* TEXT */
|
|
2159
2374
|
)
|
|
@@ -2161,12 +2376,12 @@ function render12(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2161
2376
|
}
|
|
2162
2377
|
|
|
2163
2378
|
// src/components/IncremarkDefault.vue
|
|
2164
|
-
IncremarkDefault_default.render =
|
|
2379
|
+
IncremarkDefault_default.render = render15;
|
|
2165
2380
|
IncremarkDefault_default.__file = "src/components/IncremarkDefault.vue";
|
|
2166
2381
|
var IncremarkDefault_default2 = IncremarkDefault_default;
|
|
2167
2382
|
|
|
2168
2383
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkRenderer.vue?type=script
|
|
2169
|
-
var IncremarkRenderer_default2 = /* @__PURE__ */
|
|
2384
|
+
var IncremarkRenderer_default2 = /* @__PURE__ */ _defineComponent16({
|
|
2170
2385
|
__name: "IncremarkRenderer",
|
|
2171
2386
|
props: {
|
|
2172
2387
|
node: { type: null, required: true },
|
|
@@ -2194,7 +2409,7 @@ var IncremarkRenderer_default2 = /* @__PURE__ */ _defineComponent13({
|
|
|
2194
2409
|
leafDirective: IncremarkContainer_default2,
|
|
2195
2410
|
textDirective: IncremarkContainer_default2
|
|
2196
2411
|
};
|
|
2197
|
-
const componentMap =
|
|
2412
|
+
const componentMap = computed12(() => ({
|
|
2198
2413
|
...defaultComponentMap,
|
|
2199
2414
|
...props.components
|
|
2200
2415
|
}));
|
|
@@ -2214,57 +2429,58 @@ var IncremarkRenderer_default2 = /* @__PURE__ */ _defineComponent13({
|
|
|
2214
2429
|
});
|
|
2215
2430
|
|
|
2216
2431
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkRenderer.vue?type=template
|
|
2217
|
-
import { createCommentVNode as
|
|
2432
|
+
import { createCommentVNode as _createCommentVNode10, toDisplayString as _toDisplayString7, createElementVNode as _createElementVNode10, openBlock as _openBlock16, createElementBlock as _createElementBlock15, createVNode as _createVNode10, Fragment as _Fragment11, resolveDynamicComponent as _resolveDynamicComponent6, createBlock as _createBlock7 } from "vue";
|
|
2218
2433
|
var _hoisted_114 = {
|
|
2219
2434
|
key: 0,
|
|
2220
2435
|
class: "incremark-html-code"
|
|
2221
2436
|
};
|
|
2222
|
-
function
|
|
2223
|
-
return
|
|
2224
|
-
|
|
2437
|
+
function render16(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2438
|
+
return _openBlock16(), _createElementBlock15(
|
|
2439
|
+
_Fragment11,
|
|
2225
2440
|
null,
|
|
2226
2441
|
[
|
|
2227
|
-
|
|
2228
|
-
$setup.isHtmlNode($props.node) ? (
|
|
2229
|
-
|
|
2442
|
+
_createCommentVNode10(" HTML \u8282\u70B9\uFF1A\u6E32\u67D3\u4E3A\u4EE3\u7801\u5757\u663E\u793A\u6E90\u4EE3\u7801 "),
|
|
2443
|
+
$setup.isHtmlNode($props.node) ? (_openBlock16(), _createElementBlock15("pre", _hoisted_114, [
|
|
2444
|
+
_createElementVNode10(
|
|
2230
2445
|
"code",
|
|
2231
2446
|
null,
|
|
2232
|
-
|
|
2447
|
+
_toDisplayString7($props.node.value),
|
|
2233
2448
|
1
|
|
2234
2449
|
/* TEXT */
|
|
2235
2450
|
)
|
|
2236
|
-
])) : $setup.isContainerNode($props.node) ? (
|
|
2237
|
-
|
|
2451
|
+
])) : $setup.isContainerNode($props.node) ? (_openBlock16(), _createElementBlock15(
|
|
2452
|
+
_Fragment11,
|
|
2238
2453
|
{ key: 1 },
|
|
2239
2454
|
[
|
|
2240
|
-
|
|
2241
|
-
|
|
2455
|
+
_createCommentVNode10(" \u5BB9\u5668\u8282\u70B9\uFF1A\u4F7F\u7528\u5BB9\u5668\u7EC4\u4EF6\uFF0C\u4F20\u9012 customContainers "),
|
|
2456
|
+
_createVNode10($setup["IncremarkContainer"], {
|
|
2242
2457
|
node: $props.node,
|
|
2243
2458
|
"custom-containers": $props.customContainers
|
|
2244
2459
|
}, null, 8, ["node", "custom-containers"])
|
|
2245
2460
|
],
|
|
2246
2461
|
2112
|
|
2247
2462
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
2248
|
-
)) : $props.node.type === "code" ? (
|
|
2249
|
-
|
|
2463
|
+
)) : $props.node.type === "code" ? (_openBlock16(), _createElementBlock15(
|
|
2464
|
+
_Fragment11,
|
|
2250
2465
|
{ key: 2 },
|
|
2251
2466
|
[
|
|
2252
|
-
|
|
2253
|
-
|
|
2467
|
+
_createCommentVNode10(" \u4EE3\u7801\u8282\u70B9\uFF1A\u7279\u6B8A\u5904\u7406\uFF0C\u4F20\u9012 customCodeBlocks\u3001codeBlockConfigs \u548C blockStatus "),
|
|
2468
|
+
_createVNode10($setup["IncremarkCode"], {
|
|
2254
2469
|
node: $props.node,
|
|
2255
2470
|
"custom-code-blocks": $props.customCodeBlocks,
|
|
2256
2471
|
"code-block-configs": $props.codeBlockConfigs,
|
|
2257
|
-
"block-status": $props.blockStatus
|
|
2258
|
-
|
|
2472
|
+
"block-status": $props.blockStatus,
|
|
2473
|
+
"default-code-component": $props.components?.["code"]
|
|
2474
|
+
}, null, 8, ["node", "custom-code-blocks", "code-block-configs", "block-status", "default-code-component"])
|
|
2259
2475
|
],
|
|
2260
2476
|
2112
|
|
2261
2477
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
2262
|
-
)) : (
|
|
2263
|
-
|
|
2478
|
+
)) : (_openBlock16(), _createElementBlock15(
|
|
2479
|
+
_Fragment11,
|
|
2264
2480
|
{ key: 3 },
|
|
2265
2481
|
[
|
|
2266
|
-
|
|
2267
|
-
(
|
|
2482
|
+
_createCommentVNode10(" \u5176\u4ED6\u8282\u70B9\uFF1A\u4F7F\u7528\u5BF9\u5E94\u7EC4\u4EF6 "),
|
|
2483
|
+
(_openBlock16(), _createBlock7(_resolveDynamicComponent6($setup.getComponent($props.node.type)), {
|
|
2268
2484
|
node: $props.node
|
|
2269
2485
|
}, null, 8, ["node"]))
|
|
2270
2486
|
],
|
|
@@ -2278,25 +2494,25 @@ function render13(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2278
2494
|
}
|
|
2279
2495
|
|
|
2280
2496
|
// src/components/IncremarkRenderer.vue
|
|
2281
|
-
IncremarkRenderer_default2.render =
|
|
2497
|
+
IncremarkRenderer_default2.render = render16;
|
|
2282
2498
|
IncremarkRenderer_default2.__file = "src/components/IncremarkRenderer.vue";
|
|
2283
2499
|
var IncremarkRenderer_default = IncremarkRenderer_default2;
|
|
2284
2500
|
|
|
2285
2501
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkFootnotes.vue?type=script
|
|
2286
|
-
import { defineComponent as
|
|
2287
|
-
import { computed as
|
|
2288
|
-
var IncremarkFootnotes_default = /* @__PURE__ */
|
|
2502
|
+
import { defineComponent as _defineComponent17 } from "vue";
|
|
2503
|
+
import { computed as computed13 } from "vue";
|
|
2504
|
+
var IncremarkFootnotes_default = /* @__PURE__ */ _defineComponent17({
|
|
2289
2505
|
__name: "IncremarkFootnotes",
|
|
2290
2506
|
setup(__props, { expose: __expose }) {
|
|
2291
2507
|
__expose();
|
|
2292
2508
|
const { footnoteDefinitions, footnoteReferenceOrder } = useDefinationsContext();
|
|
2293
|
-
const orderedFootnotes =
|
|
2509
|
+
const orderedFootnotes = computed13(() => {
|
|
2294
2510
|
return footnoteReferenceOrder.value.map((identifier) => ({
|
|
2295
2511
|
identifier,
|
|
2296
2512
|
definition: footnoteDefinitions.value[identifier]
|
|
2297
2513
|
})).filter((item) => item.definition !== void 0);
|
|
2298
2514
|
});
|
|
2299
|
-
const hasFootnotes =
|
|
2515
|
+
const hasFootnotes = computed13(() => orderedFootnotes.value.length > 0);
|
|
2300
2516
|
const __returned__ = { footnoteDefinitions, footnoteReferenceOrder, orderedFootnotes, hasFootnotes, IncremarkRenderer: IncremarkRenderer_default };
|
|
2301
2517
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
2302
2518
|
return __returned__;
|
|
@@ -2304,52 +2520,52 @@ var IncremarkFootnotes_default = /* @__PURE__ */ _defineComponent14({
|
|
|
2304
2520
|
});
|
|
2305
2521
|
|
|
2306
2522
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkFootnotes.vue?type=template
|
|
2307
|
-
import { createElementVNode as
|
|
2523
|
+
import { createElementVNode as _createElementVNode11, renderList as _renderList7, Fragment as _Fragment12, openBlock as _openBlock17, createElementBlock as _createElementBlock16, createCommentVNode as _createCommentVNode11, toDisplayString as _toDisplayString8, createBlock as _createBlock8 } from "vue";
|
|
2308
2524
|
var _hoisted_115 = {
|
|
2309
2525
|
key: 0,
|
|
2310
2526
|
class: "incremark-footnotes"
|
|
2311
2527
|
};
|
|
2312
|
-
var
|
|
2313
|
-
var
|
|
2314
|
-
var
|
|
2315
|
-
var
|
|
2316
|
-
var
|
|
2317
|
-
var
|
|
2318
|
-
function
|
|
2319
|
-
return $setup.hasFootnotes ? (
|
|
2320
|
-
_cache[0] || (_cache[0] =
|
|
2528
|
+
var _hoisted_28 = { class: "incremark-footnotes-list" };
|
|
2529
|
+
var _hoisted_37 = ["id"];
|
|
2530
|
+
var _hoisted_45 = { class: "incremark-footnote-content" };
|
|
2531
|
+
var _hoisted_55 = { class: "incremark-footnote-number" };
|
|
2532
|
+
var _hoisted_65 = { class: "incremark-footnote-body" };
|
|
2533
|
+
var _hoisted_74 = ["href"];
|
|
2534
|
+
function render17(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2535
|
+
return $setup.hasFootnotes ? (_openBlock17(), _createElementBlock16("section", _hoisted_115, [
|
|
2536
|
+
_cache[0] || (_cache[0] = _createElementVNode11(
|
|
2321
2537
|
"hr",
|
|
2322
2538
|
{ class: "incremark-footnotes-divider" },
|
|
2323
2539
|
null,
|
|
2324
2540
|
-1
|
|
2325
2541
|
/* CACHED */
|
|
2326
2542
|
)),
|
|
2327
|
-
|
|
2328
|
-
(
|
|
2329
|
-
|
|
2543
|
+
_createElementVNode11("ol", _hoisted_28, [
|
|
2544
|
+
(_openBlock17(true), _createElementBlock16(
|
|
2545
|
+
_Fragment12,
|
|
2330
2546
|
null,
|
|
2331
2547
|
_renderList7($setup.orderedFootnotes, (item, index) => {
|
|
2332
|
-
return
|
|
2548
|
+
return _openBlock17(), _createElementBlock16("li", {
|
|
2333
2549
|
key: item.identifier,
|
|
2334
2550
|
id: `fn-${item.identifier}`,
|
|
2335
2551
|
class: "incremark-footnote-item"
|
|
2336
2552
|
}, [
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2553
|
+
_createElementVNode11("div", _hoisted_45, [
|
|
2554
|
+
_createCommentVNode11(" \u811A\u6CE8\u5E8F\u53F7 "),
|
|
2555
|
+
_createElementVNode11(
|
|
2340
2556
|
"span",
|
|
2341
|
-
|
|
2342
|
-
|
|
2557
|
+
_hoisted_55,
|
|
2558
|
+
_toDisplayString8(index + 1) + ".",
|
|
2343
2559
|
1
|
|
2344
2560
|
/* TEXT */
|
|
2345
2561
|
),
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
(
|
|
2349
|
-
|
|
2562
|
+
_createCommentVNode11(" \u811A\u6CE8\u5185\u5BB9 "),
|
|
2563
|
+
_createElementVNode11("div", _hoisted_65, [
|
|
2564
|
+
(_openBlock17(true), _createElementBlock16(
|
|
2565
|
+
_Fragment12,
|
|
2350
2566
|
null,
|
|
2351
2567
|
_renderList7(item.definition.children, (child, childIndex) => {
|
|
2352
|
-
return
|
|
2568
|
+
return _openBlock17(), _createBlock8($setup["IncremarkRenderer"], {
|
|
2353
2569
|
key: childIndex,
|
|
2354
2570
|
node: child
|
|
2355
2571
|
}, null, 8, ["node"]);
|
|
@@ -2359,28 +2575,28 @@ function render14(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2359
2575
|
))
|
|
2360
2576
|
])
|
|
2361
2577
|
]),
|
|
2362
|
-
|
|
2363
|
-
|
|
2578
|
+
_createCommentVNode11(" \u8FD4\u56DE\u94FE\u63A5 "),
|
|
2579
|
+
_createElementVNode11("a", {
|
|
2364
2580
|
href: `#fnref-${item.identifier}`,
|
|
2365
2581
|
class: "incremark-footnote-backref",
|
|
2366
2582
|
"aria-label": "\u8FD4\u56DE\u5F15\u7528\u4F4D\u7F6E"
|
|
2367
|
-
}, " \u21A9 ", 8,
|
|
2368
|
-
], 8,
|
|
2583
|
+
}, " \u21A9 ", 8, _hoisted_74)
|
|
2584
|
+
], 8, _hoisted_37);
|
|
2369
2585
|
}),
|
|
2370
2586
|
128
|
|
2371
2587
|
/* KEYED_FRAGMENT */
|
|
2372
2588
|
))
|
|
2373
2589
|
])
|
|
2374
|
-
])) :
|
|
2590
|
+
])) : _createCommentVNode11("v-if", true);
|
|
2375
2591
|
}
|
|
2376
2592
|
|
|
2377
2593
|
// src/components/IncremarkFootnotes.vue
|
|
2378
|
-
IncremarkFootnotes_default.render =
|
|
2594
|
+
IncremarkFootnotes_default.render = render17;
|
|
2379
2595
|
IncremarkFootnotes_default.__file = "src/components/IncremarkFootnotes.vue";
|
|
2380
2596
|
var IncremarkFootnotes_default2 = IncremarkFootnotes_default;
|
|
2381
2597
|
|
|
2382
2598
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/Incremark.vue?type=script
|
|
2383
|
-
var Incremark_default = /* @__PURE__ */
|
|
2599
|
+
var Incremark_default = /* @__PURE__ */ _defineComponent18({
|
|
2384
2600
|
__name: "Incremark",
|
|
2385
2601
|
props: {
|
|
2386
2602
|
blocks: { type: Array, required: false, default: () => [] },
|
|
@@ -2400,8 +2616,8 @@ var Incremark_default = /* @__PURE__ */ _defineComponent15({
|
|
|
2400
2616
|
const {
|
|
2401
2617
|
footnoteReferenceOrder
|
|
2402
2618
|
} = useDefinationsContext();
|
|
2403
|
-
const actualBlocks =
|
|
2404
|
-
const actualIsDisplayComplete =
|
|
2619
|
+
const actualBlocks = computed14(() => props.incremark?.blocks.value || props.blocks || []);
|
|
2620
|
+
const actualIsDisplayComplete = computed14(() => {
|
|
2405
2621
|
if (props.incremark) {
|
|
2406
2622
|
return props.incremark.isDisplayComplete.value;
|
|
2407
2623
|
}
|
|
@@ -2414,24 +2630,24 @@ var Incremark_default = /* @__PURE__ */ _defineComponent15({
|
|
|
2414
2630
|
});
|
|
2415
2631
|
|
|
2416
2632
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/Incremark.vue?type=template
|
|
2417
|
-
import { createCommentVNode as
|
|
2633
|
+
import { createCommentVNode as _createCommentVNode12, renderList as _renderList8, Fragment as _Fragment13, openBlock as _openBlock18, createElementBlock as _createElementBlock17, createVNode as _createVNode11, normalizeClass as _normalizeClass6, createBlock as _createBlock9 } from "vue";
|
|
2418
2634
|
var _hoisted_116 = { class: "incremark" };
|
|
2419
|
-
function
|
|
2420
|
-
return
|
|
2421
|
-
|
|
2422
|
-
(
|
|
2423
|
-
|
|
2635
|
+
function render18(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2636
|
+
return _openBlock18(), _createElementBlock17("div", _hoisted_116, [
|
|
2637
|
+
_createCommentVNode12(" \u4E3B\u8981\u5185\u5BB9\u5757 "),
|
|
2638
|
+
(_openBlock18(true), _createElementBlock17(
|
|
2639
|
+
_Fragment13,
|
|
2424
2640
|
null,
|
|
2425
2641
|
_renderList8($setup.actualBlocks, (block) => {
|
|
2426
|
-
return
|
|
2427
|
-
|
|
2642
|
+
return _openBlock18(), _createElementBlock17(
|
|
2643
|
+
_Fragment13,
|
|
2428
2644
|
null,
|
|
2429
2645
|
[
|
|
2430
|
-
block.node.type !== "definition" && block.node.type !== "footnoteDefinition" ? (
|
|
2646
|
+
block.node.type !== "definition" && block.node.type !== "footnoteDefinition" ? (_openBlock18(), _createElementBlock17(
|
|
2431
2647
|
"div",
|
|
2432
2648
|
{
|
|
2433
2649
|
key: block.id,
|
|
2434
|
-
class:
|
|
2650
|
+
class: _normalizeClass6([
|
|
2435
2651
|
"incremark-block",
|
|
2436
2652
|
block.status === "completed" ? $props.completedClass : $props.pendingClass,
|
|
2437
2653
|
{ "incremark-show-status": $props.showBlockStatus },
|
|
@@ -2439,8 +2655,8 @@ function render15(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2439
2655
|
])
|
|
2440
2656
|
},
|
|
2441
2657
|
[
|
|
2442
|
-
|
|
2443
|
-
|
|
2658
|
+
_createCommentVNode12(" \u4F7F\u7528 IncremarkRenderer \u7EDF\u4E00\u5904\u7406\u6240\u6709\u8282\u70B9\u7C7B\u578B "),
|
|
2659
|
+
_createVNode11($setup["IncremarkRenderer"], {
|
|
2444
2660
|
node: block.node,
|
|
2445
2661
|
"block-status": block.status,
|
|
2446
2662
|
"custom-containers": $props.customContainers,
|
|
@@ -2451,7 +2667,7 @@ function render15(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2451
2667
|
],
|
|
2452
2668
|
2
|
|
2453
2669
|
/* CLASS */
|
|
2454
|
-
)) :
|
|
2670
|
+
)) : _createCommentVNode12("v-if", true)
|
|
2455
2671
|
],
|
|
2456
2672
|
64
|
|
2457
2673
|
/* STABLE_FRAGMENT */
|
|
@@ -2460,20 +2676,20 @@ function render15(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2460
2676
|
256
|
|
2461
2677
|
/* UNKEYED_FRAGMENT */
|
|
2462
2678
|
)),
|
|
2463
|
-
|
|
2464
|
-
$setup.actualIsDisplayComplete && $setup.footnoteReferenceOrder.length > 0 ? (
|
|
2679
|
+
_createCommentVNode12(" \u811A\u6CE8\u5217\u8868\uFF08\u4EC5\u5728\u5185\u5BB9\u5B8C\u5168\u663E\u793A\u540E\u663E\u793A\uFF09 "),
|
|
2680
|
+
$setup.actualIsDisplayComplete && $setup.footnoteReferenceOrder.length > 0 ? (_openBlock18(), _createBlock9($setup["IncremarkFootnotes"], { key: 0 })) : _createCommentVNode12("v-if", true)
|
|
2465
2681
|
]);
|
|
2466
2682
|
}
|
|
2467
2683
|
|
|
2468
2684
|
// src/components/Incremark.vue
|
|
2469
|
-
Incremark_default.render =
|
|
2685
|
+
Incremark_default.render = render18;
|
|
2470
2686
|
Incremark_default.__file = "src/components/Incremark.vue";
|
|
2471
2687
|
var Incremark_default2 = Incremark_default;
|
|
2472
2688
|
|
|
2473
2689
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkContent.vue?type=script
|
|
2474
|
-
import { defineComponent as
|
|
2475
|
-
import { computed as
|
|
2476
|
-
var IncremarkContent_default = /* @__PURE__ */
|
|
2690
|
+
import { defineComponent as _defineComponent19 } from "vue";
|
|
2691
|
+
import { computed as computed15, watch as watch7 } from "vue";
|
|
2692
|
+
var IncremarkContent_default = /* @__PURE__ */ _defineComponent19({
|
|
2477
2693
|
__name: "IncremarkContent",
|
|
2478
2694
|
props: {
|
|
2479
2695
|
stream: { type: Function, required: false },
|
|
@@ -2490,15 +2706,15 @@ var IncremarkContent_default = /* @__PURE__ */ _defineComponent16({
|
|
|
2490
2706
|
setup(__props, { expose: __expose }) {
|
|
2491
2707
|
__expose();
|
|
2492
2708
|
const props = __props;
|
|
2493
|
-
const incremarkOptions =
|
|
2709
|
+
const incremarkOptions = computed15(() => ({
|
|
2494
2710
|
gfm: true,
|
|
2495
2711
|
htmlTree: true,
|
|
2496
2712
|
containers: true,
|
|
2497
2713
|
math: true,
|
|
2498
2714
|
...props.incremarkOptions
|
|
2499
2715
|
}));
|
|
2500
|
-
const { blocks, append, finalize, render:
|
|
2501
|
-
const isStreamMode =
|
|
2716
|
+
const { blocks, append, finalize, render: render23, reset, isDisplayComplete, markdown } = useIncremark(incremarkOptions);
|
|
2717
|
+
const isStreamMode = computed15(() => typeof props.stream === "function");
|
|
2502
2718
|
async function handleStreamInput() {
|
|
2503
2719
|
if (!props.stream) return;
|
|
2504
2720
|
try {
|
|
@@ -2523,10 +2739,10 @@ var IncremarkContent_default = /* @__PURE__ */ _defineComponent16({
|
|
|
2523
2739
|
const delta = newContent.slice((oldContent || "").length);
|
|
2524
2740
|
append(delta);
|
|
2525
2741
|
} else {
|
|
2526
|
-
|
|
2742
|
+
render23(newContent);
|
|
2527
2743
|
}
|
|
2528
2744
|
}
|
|
2529
|
-
|
|
2745
|
+
watch7(() => props.content, async (newContent, oldContent) => {
|
|
2530
2746
|
if (isStreamMode.value) {
|
|
2531
2747
|
await handleStreamInput();
|
|
2532
2748
|
return;
|
|
@@ -2534,21 +2750,21 @@ var IncremarkContent_default = /* @__PURE__ */ _defineComponent16({
|
|
|
2534
2750
|
handleContentInput(newContent, oldContent);
|
|
2535
2751
|
}
|
|
2536
2752
|
}, { immediate: true });
|
|
2537
|
-
|
|
2753
|
+
watch7(() => props.isFinished, (newIsFinished) => {
|
|
2538
2754
|
if (newIsFinished && props.content === markdown.value) {
|
|
2539
2755
|
finalize();
|
|
2540
2756
|
}
|
|
2541
2757
|
}, { immediate: true });
|
|
2542
|
-
const __returned__ = { props, incremarkOptions, blocks, append, finalize, render:
|
|
2758
|
+
const __returned__ = { props, incremarkOptions, blocks, append, finalize, render: render23, reset, isDisplayComplete, markdown, isStreamMode, handleStreamInput, handleContentInput, Incremark: Incremark_default2 };
|
|
2543
2759
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
2544
2760
|
return __returned__;
|
|
2545
2761
|
}
|
|
2546
2762
|
});
|
|
2547
2763
|
|
|
2548
2764
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/IncremarkContent.vue?type=template
|
|
2549
|
-
import { openBlock as
|
|
2550
|
-
function
|
|
2551
|
-
return
|
|
2765
|
+
import { openBlock as _openBlock19, createBlock as _createBlock10 } from "vue";
|
|
2766
|
+
function render19(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2767
|
+
return _openBlock19(), _createBlock10($setup["Incremark"], {
|
|
2552
2768
|
blocks: $setup.blocks,
|
|
2553
2769
|
"pending-class": $props.pendingClass,
|
|
2554
2770
|
"is-display-complete": $setup.isDisplayComplete,
|
|
@@ -2561,14 +2777,14 @@ function render16(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2561
2777
|
}
|
|
2562
2778
|
|
|
2563
2779
|
// src/components/IncremarkContent.vue
|
|
2564
|
-
IncremarkContent_default.render =
|
|
2780
|
+
IncremarkContent_default.render = render19;
|
|
2565
2781
|
IncremarkContent_default.__file = "src/components/IncremarkContent.vue";
|
|
2566
2782
|
var IncremarkContent_default2 = IncremarkContent_default;
|
|
2567
2783
|
|
|
2568
2784
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/AutoScrollContainer.vue?type=script
|
|
2569
|
-
import { defineComponent as
|
|
2570
|
-
import { ref as
|
|
2571
|
-
var AutoScrollContainer_default = /* @__PURE__ */
|
|
2785
|
+
import { defineComponent as _defineComponent20 } from "vue";
|
|
2786
|
+
import { ref as ref8, onMounted as onMounted2, onUnmounted as onUnmounted7, nextTick } from "vue";
|
|
2787
|
+
var AutoScrollContainer_default = /* @__PURE__ */ _defineComponent20({
|
|
2572
2788
|
__name: "AutoScrollContainer",
|
|
2573
2789
|
props: {
|
|
2574
2790
|
enabled: { type: Boolean, required: false, default: true },
|
|
@@ -2577,8 +2793,8 @@ var AutoScrollContainer_default = /* @__PURE__ */ _defineComponent17({
|
|
|
2577
2793
|
},
|
|
2578
2794
|
setup(__props, { expose: __expose }) {
|
|
2579
2795
|
const props = __props;
|
|
2580
|
-
const containerRef =
|
|
2581
|
-
const isUserScrolledUp =
|
|
2796
|
+
const containerRef = ref8(null);
|
|
2797
|
+
const isUserScrolledUp = ref8(false);
|
|
2582
2798
|
let lastScrollTop = 0;
|
|
2583
2799
|
let lastScrollHeight = 0;
|
|
2584
2800
|
function isNearBottom() {
|
|
@@ -2646,7 +2862,7 @@ var AutoScrollContainer_default = /* @__PURE__ */ _defineComponent17({
|
|
|
2646
2862
|
characterData: true
|
|
2647
2863
|
});
|
|
2648
2864
|
});
|
|
2649
|
-
|
|
2865
|
+
onUnmounted7(() => {
|
|
2650
2866
|
observer?.disconnect();
|
|
2651
2867
|
});
|
|
2652
2868
|
__expose({
|
|
@@ -2676,9 +2892,9 @@ var AutoScrollContainer_default = /* @__PURE__ */ _defineComponent17({
|
|
|
2676
2892
|
});
|
|
2677
2893
|
|
|
2678
2894
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/AutoScrollContainer.vue?type=template
|
|
2679
|
-
import { renderSlot as _renderSlot, openBlock as
|
|
2680
|
-
function
|
|
2681
|
-
return
|
|
2895
|
+
import { renderSlot as _renderSlot, openBlock as _openBlock20, createElementBlock as _createElementBlock18 } from "vue";
|
|
2896
|
+
function render20(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2897
|
+
return _openBlock20(), _createElementBlock18(
|
|
2682
2898
|
"div",
|
|
2683
2899
|
{
|
|
2684
2900
|
ref: "containerRef",
|
|
@@ -2694,15 +2910,16 @@ function render17(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2694
2910
|
}
|
|
2695
2911
|
|
|
2696
2912
|
// src/components/AutoScrollContainer.vue
|
|
2697
|
-
AutoScrollContainer_default.render =
|
|
2913
|
+
AutoScrollContainer_default.render = render20;
|
|
2698
2914
|
AutoScrollContainer_default.__file = "src/components/AutoScrollContainer.vue";
|
|
2699
2915
|
var AutoScrollContainer_default2 = AutoScrollContainer_default;
|
|
2700
2916
|
|
|
2701
2917
|
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/ThemeProvider.vue?type=script
|
|
2702
|
-
import { defineComponent as
|
|
2703
|
-
import { ref as
|
|
2918
|
+
import { defineComponent as _defineComponent21 } from "vue";
|
|
2919
|
+
import { ref as ref9, watch as watch9 } from "vue";
|
|
2704
2920
|
import { applyTheme } from "@incremark/theme";
|
|
2705
|
-
|
|
2921
|
+
import { isServer } from "@incremark/shared";
|
|
2922
|
+
var ThemeProvider_default = /* @__PURE__ */ _defineComponent21({
|
|
2706
2923
|
__name: "ThemeProvider",
|
|
2707
2924
|
props: {
|
|
2708
2925
|
theme: { type: null, required: true },
|
|
@@ -2711,10 +2928,11 @@ var ThemeProvider_default = /* @__PURE__ */ _defineComponent18({
|
|
|
2711
2928
|
setup(__props, { expose: __expose }) {
|
|
2712
2929
|
__expose();
|
|
2713
2930
|
const props = __props;
|
|
2714
|
-
const containerRef =
|
|
2715
|
-
|
|
2931
|
+
const containerRef = ref9();
|
|
2932
|
+
watch9(
|
|
2716
2933
|
() => props.theme,
|
|
2717
2934
|
(theme) => {
|
|
2935
|
+
if (isServer()) return;
|
|
2718
2936
|
if (containerRef.value) {
|
|
2719
2937
|
applyTheme(containerRef.value, theme);
|
|
2720
2938
|
}
|
|
@@ -2728,13 +2946,13 @@ var ThemeProvider_default = /* @__PURE__ */ _defineComponent18({
|
|
|
2728
2946
|
});
|
|
2729
2947
|
|
|
2730
2948
|
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/ThemeProvider.vue?type=template
|
|
2731
|
-
import { renderSlot as _renderSlot2, normalizeClass as
|
|
2732
|
-
function
|
|
2733
|
-
return
|
|
2949
|
+
import { renderSlot as _renderSlot2, normalizeClass as _normalizeClass7, openBlock as _openBlock21, createElementBlock as _createElementBlock19 } from "vue";
|
|
2950
|
+
function render21(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2951
|
+
return _openBlock21(), _createElementBlock19(
|
|
2734
2952
|
"div",
|
|
2735
2953
|
{
|
|
2736
2954
|
ref: "containerRef",
|
|
2737
|
-
class:
|
|
2955
|
+
class: _normalizeClass7([$setup.props.class, "incremark-theme-provider"])
|
|
2738
2956
|
},
|
|
2739
2957
|
[
|
|
2740
2958
|
_renderSlot2(_ctx.$slots, "default")
|
|
@@ -2745,10 +2963,49 @@ function render18(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2745
2963
|
}
|
|
2746
2964
|
|
|
2747
2965
|
// src/ThemeProvider.vue
|
|
2748
|
-
ThemeProvider_default.render =
|
|
2966
|
+
ThemeProvider_default.render = render21;
|
|
2749
2967
|
ThemeProvider_default.__file = "src/ThemeProvider.vue";
|
|
2750
2968
|
var ThemeProvider_default2 = ThemeProvider_default;
|
|
2751
2969
|
|
|
2970
|
+
// sfc-script:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/ConfigProvider.vue?type=script
|
|
2971
|
+
import { defineComponent as _defineComponent22 } from "vue";
|
|
2972
|
+
import { provide as provide2, ref as ref10, watch as watch10 } from "vue";
|
|
2973
|
+
var ConfigProvider_default = /* @__PURE__ */ _defineComponent22({
|
|
2974
|
+
__name: "ConfigProvider",
|
|
2975
|
+
props: {
|
|
2976
|
+
locale: { type: null, required: false, default: () => enShared }
|
|
2977
|
+
},
|
|
2978
|
+
setup(__props, { expose: __expose }) {
|
|
2979
|
+
__expose();
|
|
2980
|
+
const props = __props;
|
|
2981
|
+
const localeRef = ref10(props.locale);
|
|
2982
|
+
provide2(LOCALE_KEY, localeRef);
|
|
2983
|
+
watch10(
|
|
2984
|
+
() => props.locale,
|
|
2985
|
+
(newLocale) => {
|
|
2986
|
+
if (newLocale) {
|
|
2987
|
+
localeRef.value = newLocale;
|
|
2988
|
+
}
|
|
2989
|
+
},
|
|
2990
|
+
{ deep: true }
|
|
2991
|
+
);
|
|
2992
|
+
const __returned__ = { props, localeRef };
|
|
2993
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
2994
|
+
return __returned__;
|
|
2995
|
+
}
|
|
2996
|
+
});
|
|
2997
|
+
|
|
2998
|
+
// sfc-template:/Users/yishuai/develop/ai/markdown/packages/vue/src/components/ConfigProvider.vue?type=template
|
|
2999
|
+
import { renderSlot as _renderSlot3 } from "vue";
|
|
3000
|
+
function render22(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3001
|
+
return _renderSlot3(_ctx.$slots, "default");
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
// src/components/ConfigProvider.vue
|
|
3005
|
+
ConfigProvider_default.render = render22;
|
|
3006
|
+
ConfigProvider_default.__file = "src/components/ConfigProvider.vue";
|
|
3007
|
+
var ConfigProvider_default2 = ConfigProvider_default;
|
|
3008
|
+
|
|
2752
3009
|
// src/index.ts
|
|
2753
3010
|
import {
|
|
2754
3011
|
BlockTransformer as BlockTransformer2,
|
|
@@ -2772,9 +3029,11 @@ import {
|
|
|
2772
3029
|
mergeTheme,
|
|
2773
3030
|
applyTheme as applyTheme2
|
|
2774
3031
|
} from "@incremark/theme";
|
|
3032
|
+
import { en as enShared, zhCN as zhCNShared } from "@incremark/shared";
|
|
2775
3033
|
export {
|
|
2776
3034
|
AutoScrollContainer_default2 as AutoScrollContainer,
|
|
2777
3035
|
BlockTransformer2 as BlockTransformer,
|
|
3036
|
+
ConfigProvider_default2 as ConfigProvider,
|
|
2778
3037
|
Incremark_default2 as Incremark,
|
|
2779
3038
|
IncremarkBlockquote_default2 as IncremarkBlockquote,
|
|
2780
3039
|
IncremarkCode_default2 as IncremarkCode,
|
|
@@ -2801,6 +3060,7 @@ export {
|
|
|
2801
3060
|
darkTheme,
|
|
2802
3061
|
defaultPlugins2 as defaultPlugins,
|
|
2803
3062
|
defaultTheme,
|
|
3063
|
+
enShared as en,
|
|
2804
3064
|
generateCSSVars,
|
|
2805
3065
|
imagePlugin,
|
|
2806
3066
|
mathPlugin,
|
|
@@ -2812,8 +3072,10 @@ export {
|
|
|
2812
3072
|
useDefinationsContext,
|
|
2813
3073
|
useDevTools,
|
|
2814
3074
|
useIncremark,
|
|
3075
|
+
useLocale,
|
|
2815
3076
|
useProvideDefinations,
|
|
2816
|
-
useStreamRenderer
|
|
3077
|
+
useStreamRenderer,
|
|
3078
|
+
zhCNShared as zhCN
|
|
2817
3079
|
};
|
|
2818
3080
|
/**
|
|
2819
3081
|
* @file Cursor Utils - 光标工具函数
|