@king-design/vue 3.7.0 → 3.8.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/__snapshots__/Vue Next Demos.md +399 -0
- package/components/bubble/bubble.d.ts +61 -0
- package/components/bubble/bubble.js +81 -0
- package/components/bubble/bubble.vdt.js +85 -0
- package/components/bubble/index.d.ts +1 -0
- package/components/bubble/index.js +1 -0
- package/components/bubble/index.spec.d.ts +1 -0
- package/components/bubble/index.spec.js +771 -0
- package/components/bubble/styles.d.ts +5 -0
- package/components/bubble/styles.js +53 -0
- package/components/bubble/useBubbleDisplay.d.ts +18 -0
- package/components/bubble/useBubbleDisplay.js +300 -0
- package/components/bubbleList/bubbleList.d.ts +87 -0
- package/components/bubbleList/bubbleList.js +75 -0
- package/components/bubbleList/bubbleList.vdt.js +143 -0
- package/components/bubbleList/index.d.ts +1 -0
- package/components/bubbleList/index.js +1 -0
- package/components/bubbleList/index.spec.d.ts +1 -0
- package/components/bubbleList/index.spec.js +1268 -0
- package/components/bubbleList/item.d.ts +16 -0
- package/components/bubbleList/item.js +27 -0
- package/components/bubbleList/item.vdt.js +36 -0
- package/components/bubbleList/styles.d.ts +5 -0
- package/components/bubbleList/styles.js +33 -0
- package/components/bubbleList/useBubbleList.d.ts +28 -0
- package/components/bubbleList/useBubbleList.js +455 -0
- package/components/checkbox/index.d.ts +3 -3
- package/components/fileCard/fileCard.d.ts +65 -0
- package/components/fileCard/fileCard.js +72 -0
- package/components/fileCard/fileCard.vdt.js +161 -0
- package/components/fileCard/fileCardAssets.d.ts +1 -0
- package/components/fileCard/fileCardAssets.js +54 -0
- package/components/fileCard/fileCardUtils.d.ts +14 -0
- package/components/fileCard/fileCardUtils.js +94 -0
- package/components/fileCard/index.d.ts +2 -0
- package/components/fileCard/index.js +2 -0
- package/components/fileCard/index.spec.d.ts +1 -0
- package/components/fileCard/index.spec.js +1096 -0
- package/components/fileCard/list.d.ts +29 -0
- package/components/fileCard/list.js +46 -0
- package/components/fileCard/list.vdt.js +71 -0
- package/components/fileCard/styles.d.ts +5 -0
- package/components/fileCard/styles.js +83 -0
- package/components/fileCard/useFileCard.d.ts +45 -0
- package/components/fileCard/useFileCard.js +330 -0
- package/components/fileCard/useFileCardList.d.ts +14 -0
- package/components/fileCard/useFileCardList.js +49 -0
- package/components/form/form.js +2 -1
- package/components/media/context.d.ts +6 -0
- package/components/media/context.js +2 -0
- package/components/media/group.d.ts +12 -0
- package/components/media/group.js +32 -0
- package/components/media/group.vdt.js +50 -0
- package/components/media/index.d.ts +2 -0
- package/components/media/index.js +2 -0
- package/components/media/index.spec.d.ts +1 -0
- package/components/media/index.spec.js +1691 -0
- package/components/media/media.d.ts +37 -0
- package/components/media/media.js +67 -0
- package/components/media/media.vdt.js +202 -0
- package/components/media/mediaAssets.d.ts +4 -0
- package/components/media/mediaAssets.js +9 -0
- package/components/media/mediaUtils.d.ts +6 -0
- package/components/media/mediaUtils.js +66 -0
- package/components/media/styles.d.ts +13 -0
- package/components/media/styles.js +52 -0
- package/components/media/types.d.ts +37 -0
- package/components/media/types.js +1 -0
- package/components/media/useMedia.d.ts +70 -0
- package/components/media/useMedia.js +471 -0
- package/components/media/useMediaGroup.d.ts +15 -0
- package/components/media/useMediaGroup.js +136 -0
- package/components/media/useMediaViewer.d.ts +14 -0
- package/components/media/useMediaViewer.js +129 -0
- package/components/media/viewer.d.ts +24 -0
- package/components/media/viewer.js +54 -0
- package/components/media/viewer.vdt.js +100 -0
- package/components/radio/index.d.ts +3 -3
- package/components/sender/icons.d.ts +3 -0
- package/components/sender/icons.js +17 -0
- package/components/sender/index.d.ts +1 -0
- package/components/sender/index.js +1 -0
- package/components/sender/index.spec.d.ts +1 -0
- package/components/sender/index.spec.js +1597 -0
- package/components/sender/sender.d.ts +104 -0
- package/components/sender/sender.js +111 -0
- package/components/sender/sender.vdt.js +230 -0
- package/components/sender/styles.d.ts +5 -0
- package/components/sender/styles.js +56 -0
- package/components/sender/useAutoResize.d.ts +4 -0
- package/components/sender/useAutoResize.js +99 -0
- package/components/sender/useSenderDrag.d.ts +6 -0
- package/components/sender/useSenderDrag.js +320 -0
- package/components/sender/useSenderInput.d.ts +16 -0
- package/components/sender/useSenderInput.js +101 -0
- package/components/sender/useSenderPaste.d.ts +5 -0
- package/components/sender/useSenderPaste.js +36 -0
- package/components/sender/useSenderUpload.d.ts +11 -0
- package/components/sender/useSenderUpload.js +395 -0
- package/components/skeleton/skeleton.d.ts +2 -1
- package/components/skeleton/skeleton.js +1 -1
- package/components/think/index.d.ts +1 -0
- package/components/think/index.js +1 -0
- package/components/think/index.spec.d.ts +1 -0
- package/components/think/index.spec.js +345 -0
- package/components/think/index.vdt.js +82 -0
- package/components/think/styles.d.ts +5 -0
- package/components/think/styles.js +25 -0
- package/components/think/think.d.ts +28 -0
- package/components/think/think.js +48 -0
- package/components/think/useThinkExpand.d.ts +10 -0
- package/components/think/useThinkExpand.js +56 -0
- package/components/types.d.ts +4 -2
- package/components/upload/ajaxUploader.d.ts +1 -0
- package/components/upload/ajaxUploader.js +6 -0
- package/components/xmarkdown/index.d.ts +2 -0
- package/components/xmarkdown/index.js +1 -0
- package/components/xmarkdown/index.spec.d.ts +1 -0
- package/components/xmarkdown/index.spec.js +1666 -0
- package/components/xmarkdown/markdown/codeBlockRenderer.d.ts +8 -0
- package/components/xmarkdown/markdown/codeBlockRenderer.js +52 -0
- package/components/xmarkdown/markdown/codeblock.d.ts +8 -0
- package/components/xmarkdown/markdown/codeblock.js +74 -0
- package/components/xmarkdown/markdown/highlight.d.ts +17 -0
- package/components/xmarkdown/markdown/highlight.js +83 -0
- package/components/xmarkdown/markdown/index.d.ts +14 -0
- package/components/xmarkdown/markdown/index.js +14 -0
- package/components/xmarkdown/markdown/mermaid.d.ts +8 -0
- package/components/xmarkdown/markdown/mermaid.js +104 -0
- package/components/xmarkdown/markdown/renderTree.d.ts +54 -0
- package/components/xmarkdown/markdown/renderTree.js +386 -0
- package/components/xmarkdown/markdown/renderer.d.ts +18 -0
- package/components/xmarkdown/markdown/renderer.js +461 -0
- package/components/xmarkdown/markdown/streaming.d.ts +24 -0
- package/components/xmarkdown/markdown/streaming.js +513 -0
- package/components/xmarkdown/markdown/types.d.ts +124 -0
- package/components/xmarkdown/markdown/types.js +6 -0
- package/components/xmarkdown/markdown/utils.d.ts +7 -0
- package/components/xmarkdown/markdown/utils.js +9 -0
- package/components/xmarkdown/markdown.d.ts +1 -0
- package/components/xmarkdown/markdown.js +1 -0
- package/components/xmarkdown/styles.d.ts +5 -0
- package/components/xmarkdown/styles.js +50 -0
- package/components/xmarkdown/useMermaid.d.ts +27 -0
- package/components/xmarkdown/useMermaid.js +745 -0
- package/components/xmarkdown/useXMarkdownContent.d.ts +14 -0
- package/components/xmarkdown/useXMarkdownContent.js +218 -0
- package/components/xmarkdown/useXMarkdownDisplay.d.ts +26 -0
- package/components/xmarkdown/useXMarkdownDisplay.js +569 -0
- package/components/xmarkdown/xmarkdown.d.ts +61 -0
- package/components/xmarkdown/xmarkdown.js +109 -0
- package/components/xmarkdown/xmarkdown.vdt.js +43 -0
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/i18n/en-US.js +29 -1
- package/dist/i18n/en-US.js.map +1 -1
- package/dist/i18n/en-US.min.js +1 -1
- package/dist/index.js +100506 -37457
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1569 -1
- package/dist/kpc.css +4 -0
- package/dist/ksyun.css +4 -0
- package/i18n/en-US.d.ts +27 -0
- package/i18n/en-US.js +29 -1
- package/index.d.ts +9 -2
- package/index.js +9 -2
- package/package.json +8 -2
- package/styles/global.js +12 -6
- package/yarn-error.log +0 -1012
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 内容渲染和交互处理
|
|
3
|
+
*/
|
|
4
|
+
import type { XMarkdownRenderedBlock } from './markdown';
|
|
5
|
+
/**
|
|
6
|
+
* 管理内容区渲染后的交互能力
|
|
7
|
+
*/
|
|
8
|
+
export declare function useXMarkdownContent(getRenderedBlockData: (id: string) => XMarkdownRenderedBlock | undefined, getPrefixCls: () => string): {
|
|
9
|
+
rootRef: import('intact-vue-next').RefObject<HTMLDivElement>;
|
|
10
|
+
contentRef: import('intact-vue-next').RefObject<HTMLDivElement>;
|
|
11
|
+
onMounted: () => void;
|
|
12
|
+
onUpdated: () => void;
|
|
13
|
+
onBeforeUnmount: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
3
|
+
/**
|
|
4
|
+
* 内容渲染和交互处理
|
|
5
|
+
*/
|
|
6
|
+
import { createRef, useInstance } from 'intact-vue-next';
|
|
7
|
+
import { _$ } from '../../i18n';
|
|
8
|
+
import { useMermaid, copyText } from './useMermaid';
|
|
9
|
+
/**
|
|
10
|
+
* 管理内容区渲染后的交互能力
|
|
11
|
+
*/
|
|
12
|
+
export function useXMarkdownContent(getRenderedBlockData, getPrefixCls) {
|
|
13
|
+
var instance = useInstance();
|
|
14
|
+
var mermaid = useMermaid(getRenderedBlockData, getPrefixCls);
|
|
15
|
+
var rootRef = createRef();
|
|
16
|
+
var contentRef = createRef();
|
|
17
|
+
var activeContentElement = null;
|
|
18
|
+
/**
|
|
19
|
+
* 同步当前内容区的交互绑定和 Mermaid 渲染
|
|
20
|
+
*/
|
|
21
|
+
function syncInteractiveContent() {
|
|
22
|
+
bindContentElement();
|
|
23
|
+
var contentElement = contentRef.value;
|
|
24
|
+
if (contentElement) {
|
|
25
|
+
void mermaid.syncBlocks(contentElement);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 绑定内容区事件
|
|
30
|
+
*/
|
|
31
|
+
function bindContentElement() {
|
|
32
|
+
var contentElement = contentRef.value;
|
|
33
|
+
if (!contentElement) {
|
|
34
|
+
unbindContentElement();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (activeContentElement === contentElement) return;
|
|
38
|
+
unbindContentElement();
|
|
39
|
+
activeContentElement = contentElement;
|
|
40
|
+
contentElement.addEventListener('click', handleClick);
|
|
41
|
+
contentElement.addEventListener('wheel', handleWheel, {
|
|
42
|
+
passive: false
|
|
43
|
+
});
|
|
44
|
+
contentElement.addEventListener('pointerdown', handlePointerDown);
|
|
45
|
+
window.addEventListener('pointermove', handleWindowPointerMove);
|
|
46
|
+
window.addEventListener('pointerup', handleWindowPointerUp);
|
|
47
|
+
window.addEventListener('pointercancel', handleWindowPointerUp);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 解绑内容区事件
|
|
51
|
+
*/
|
|
52
|
+
function unbindContentElement() {
|
|
53
|
+
var _activeContentElement, _activeContentElement2, _activeContentElement3;
|
|
54
|
+
(_activeContentElement = activeContentElement) == null || _activeContentElement.removeEventListener('click', handleClick);
|
|
55
|
+
(_activeContentElement2 = activeContentElement) == null || _activeContentElement2.removeEventListener('wheel', handleWheel);
|
|
56
|
+
(_activeContentElement3 = activeContentElement) == null || _activeContentElement3.removeEventListener('pointerdown', handlePointerDown);
|
|
57
|
+
window.removeEventListener('pointermove', handleWindowPointerMove);
|
|
58
|
+
window.removeEventListener('pointerup', handleWindowPointerUp);
|
|
59
|
+
window.removeEventListener('pointercancel', handleWindowPointerUp);
|
|
60
|
+
mermaid.finishDrag();
|
|
61
|
+
activeContentElement = null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 处理内容区点击动作
|
|
65
|
+
*/
|
|
66
|
+
var handleClick = /*#__PURE__*/function () {
|
|
67
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(e) {
|
|
68
|
+
var _contentRef$value;
|
|
69
|
+
var target, actionElement, action, block, _block, _block2, success, _block3, blockId, renderedBlock, source, language, _success;
|
|
70
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
71
|
+
while (1) switch (_context.prev = _context.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
target = e.target;
|
|
74
|
+
actionElement = target == null ? void 0 : target.closest('[data-kpc-action]');
|
|
75
|
+
if (!(!actionElement || !((_contentRef$value = contentRef.value) != null && _contentRef$value.contains(actionElement)))) {
|
|
76
|
+
_context.next = 4;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
return _context.abrupt("return");
|
|
80
|
+
case 4:
|
|
81
|
+
action = actionElement.dataset.kpcAction;
|
|
82
|
+
if (action) {
|
|
83
|
+
_context.next = 7;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
return _context.abrupt("return");
|
|
87
|
+
case 7:
|
|
88
|
+
if (!(action === 'set-mermaid-view-diagram')) {
|
|
89
|
+
_context.next = 10;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
mermaid.setView(actionElement, 'diagram');
|
|
93
|
+
return _context.abrupt("return");
|
|
94
|
+
case 10:
|
|
95
|
+
if (!(action === 'set-mermaid-view-source')) {
|
|
96
|
+
_context.next = 13;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
mermaid.setView(actionElement, 'source');
|
|
100
|
+
return _context.abrupt("return");
|
|
101
|
+
case 13:
|
|
102
|
+
if (!(action === 'zoom-mermaid-in')) {
|
|
103
|
+
_context.next = 17;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
block = actionElement.closest('[data-kpc-mermaid="true"]');
|
|
107
|
+
if (block) mermaid.stepScale(block, 0.2);
|
|
108
|
+
return _context.abrupt("return");
|
|
109
|
+
case 17:
|
|
110
|
+
if (!(action === 'zoom-mermaid-out')) {
|
|
111
|
+
_context.next = 21;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
_block = actionElement.closest('[data-kpc-mermaid="true"]');
|
|
115
|
+
if (_block) mermaid.stepScale(_block, -0.2);
|
|
116
|
+
return _context.abrupt("return");
|
|
117
|
+
case 21:
|
|
118
|
+
if (!(action === 'reset-mermaid-zoom')) {
|
|
119
|
+
_context.next = 25;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
_block2 = actionElement.closest('[data-kpc-mermaid="true"]');
|
|
123
|
+
if (_block2) mermaid.resetScale(_block2);
|
|
124
|
+
return _context.abrupt("return");
|
|
125
|
+
case 25:
|
|
126
|
+
if (!(action === 'download-mermaid')) {
|
|
127
|
+
_context.next = 31;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
_context.next = 28;
|
|
131
|
+
return mermaid.download(actionElement);
|
|
132
|
+
case 28:
|
|
133
|
+
success = _context.sent;
|
|
134
|
+
mermaid.showFeedback(actionElement, success ? _$('已下载') : _$('下载失败'));
|
|
135
|
+
return _context.abrupt("return");
|
|
136
|
+
case 31:
|
|
137
|
+
if (!(action === 'copy-code' || action === 'copy-mermaid')) {
|
|
138
|
+
_context.next = 46;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
_block3 = actionElement.closest('[data-kpc-code-block="true"], [data-kpc-mermaid="true"]');
|
|
142
|
+
if (_block3) {
|
|
143
|
+
_context.next = 35;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
return _context.abrupt("return");
|
|
147
|
+
case 35:
|
|
148
|
+
blockId = _block3.dataset.kpcBlockId || '';
|
|
149
|
+
renderedBlock = getRenderedBlockData(blockId);
|
|
150
|
+
source = (renderedBlock == null ? void 0 : renderedBlock.source) || '';
|
|
151
|
+
language = (renderedBlock == null ? void 0 : renderedBlock.language) || _block3.dataset.kpcLanguage || '';
|
|
152
|
+
if (source) {
|
|
153
|
+
_context.next = 41;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
return _context.abrupt("return");
|
|
157
|
+
case 41:
|
|
158
|
+
_context.next = 43;
|
|
159
|
+
return copyText(source);
|
|
160
|
+
case 43:
|
|
161
|
+
_success = _context.sent;
|
|
162
|
+
mermaid.showFeedback(actionElement, _success ? _$('已复制') : _$('复制失败'));
|
|
163
|
+
if (_success) {
|
|
164
|
+
instance.trigger('codeCopy', source, language);
|
|
165
|
+
}
|
|
166
|
+
case 46:
|
|
167
|
+
case "end":
|
|
168
|
+
return _context.stop();
|
|
169
|
+
}
|
|
170
|
+
}, _callee);
|
|
171
|
+
}));
|
|
172
|
+
return function handleClick(_x) {
|
|
173
|
+
return _ref.apply(this, arguments);
|
|
174
|
+
};
|
|
175
|
+
}();
|
|
176
|
+
/**
|
|
177
|
+
* 处理 Mermaid 滚轮缩放
|
|
178
|
+
*/
|
|
179
|
+
var handleWheel = function handleWheel(e) {
|
|
180
|
+
var contentElement = contentRef.value;
|
|
181
|
+
if (!contentElement) return;
|
|
182
|
+
mermaid.handleWheel(e, contentElement);
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* 处理 Mermaid 拖拽开始
|
|
186
|
+
*/
|
|
187
|
+
var handlePointerDown = function handlePointerDown(e) {
|
|
188
|
+
var contentElement = contentRef.value;
|
|
189
|
+
if (!contentElement) return;
|
|
190
|
+
mermaid.handlePointerDown(e, contentElement);
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* 处理全局拖拽移动
|
|
194
|
+
*/
|
|
195
|
+
var handleWindowPointerMove = function handleWindowPointerMove(e) {
|
|
196
|
+
mermaid.handlePointerMove(e);
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* 处理全局拖拽结束
|
|
200
|
+
*/
|
|
201
|
+
var handleWindowPointerUp = function handleWindowPointerUp(e) {
|
|
202
|
+
mermaid.handlePointerUp(e);
|
|
203
|
+
};
|
|
204
|
+
return {
|
|
205
|
+
rootRef: rootRef,
|
|
206
|
+
contentRef: contentRef,
|
|
207
|
+
onMounted: function onMounted() {
|
|
208
|
+
syncInteractiveContent();
|
|
209
|
+
},
|
|
210
|
+
onUpdated: function onUpdated() {
|
|
211
|
+
syncInteractiveContent();
|
|
212
|
+
},
|
|
213
|
+
onBeforeUnmount: function onBeforeUnmount() {
|
|
214
|
+
unbindContentElement();
|
|
215
|
+
mermaid.clearFeedbackTimers();
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 内容显示逻辑
|
|
3
|
+
*
|
|
4
|
+
* 负责:
|
|
5
|
+
* - 打字动画效果
|
|
6
|
+
* - 流式渲染处理
|
|
7
|
+
* - Markdown 渲染和缓存
|
|
8
|
+
* - 数学公式运行时加载
|
|
9
|
+
*/
|
|
10
|
+
import { type XMarkdownRenderedBlock } from './markdown';
|
|
11
|
+
export declare function useXMarkdownDisplay(getPrefixCls: () => string): {
|
|
12
|
+
onMounted: () => void;
|
|
13
|
+
onBeforeUnmount: () => void;
|
|
14
|
+
hasContentProp: () => boolean;
|
|
15
|
+
hasNonEmptyContentProp: () => boolean;
|
|
16
|
+
hasVisibleContent: () => boolean;
|
|
17
|
+
shouldShowLoadingShell: () => boolean;
|
|
18
|
+
shouldShowEmpty: () => boolean;
|
|
19
|
+
getDisplayedContent: () => string;
|
|
20
|
+
getRenderedContent: () => any[];
|
|
21
|
+
getRenderedStableNodes: () => any;
|
|
22
|
+
getRenderedTailNodes: () => any;
|
|
23
|
+
getRenderedBlockData: (id: string) => XMarkdownRenderedBlock | undefined;
|
|
24
|
+
getRenderedNodes: () => any;
|
|
25
|
+
isTypingActive: () => boolean;
|
|
26
|
+
};
|