@antdv-next/x 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/Actions.js +1 -1
- package/dist/actions/ActionsAudio.js +1 -1
- package/dist/actions/ActionsCopy.js +1 -1
- package/dist/actions/ActionsFeedback.js +1 -1
- package/dist/actions/ActionsItem.js +1 -1
- package/dist/attachments/index.js +1 -1
- package/dist/bubble/Bubble.js +1 -1
- package/dist/bubble/BubbleList.js +1 -1
- package/dist/bubble/Divider.js +1 -1
- package/dist/bubble/System.js +1 -1
- package/dist/code-highlighter/CodeHighlighter.js +3 -14
- package/dist/code-highlighter/shiki.d.ts +4 -0
- package/dist/code-highlighter/shiki.js +72 -0
- package/dist/conversations/Creation.js +1 -1
- package/dist/conversations/index.js +1 -1
- package/dist/file-card/FileCard.js +1 -1
- package/dist/file-card/List.js +1 -1
- package/dist/index.esm.js +1224 -118
- package/dist/index.js +0 -25
- package/dist/index.umd.js +1228 -121
- package/dist/mermaid/Mermaid.d.ts +1 -1
- package/dist/mermaid/Mermaid.js +5 -5
- package/dist/mermaid/loader.d.ts +6 -0
- package/dist/mermaid/loader.js +33 -0
- package/dist/mermaid/mermaid-core.d.js +0 -0
- package/dist/package.js +1 -1
- package/dist/prompts/Prompts.js +6 -4
- package/dist/sender/Sender.d.ts +25 -7
- package/dist/sender/Sender.js +60 -14
- package/dist/sender/SenderHeader.js +1 -1
- package/dist/sender/SenderSwitch.js +2 -2
- package/dist/sender/components/ActionButton.d.ts +0 -9
- package/dist/sender/components/ActionButton.js +1 -5
- package/dist/sender/components/Skill.d.ts +30 -0
- package/dist/sender/components/Skill.js +61 -0
- package/dist/sender/components/SlotTextArea.d.ts +20 -0
- package/dist/sender/components/SlotTextArea.js +747 -0
- package/dist/sender/components/TextArea.d.ts +1 -3
- package/dist/sender/context.d.ts +1 -0
- package/dist/sender/index.d.ts +2 -2
- package/dist/sender/interface.d.ts +2 -1
- package/dist/sender/style/index.d.ts +7 -0
- package/dist/sender/style/index.js +17 -1
- package/dist/sender/style/slot-textarea.d.ts +4 -0
- package/dist/sender/style/slot-textarea.js +187 -0
- package/dist/sources/Sources.js +1 -1
- package/dist/suggestion/Suggestion.js +1 -1
- package/dist/suggestion/useActive.js +4 -0
- package/dist/think/Think.js +1 -1
- package/dist/thought-chain/Item.js +1 -1
- package/dist/thought-chain/ThoughtChain.js +1 -1
- package/dist/welcome/index.js +1 -1
- package/dist/x-provider/index.js +1 -1
- package/global.d.ts +61 -18
- package/package.json +2 -2
package/dist/actions/Actions.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createVNode, defineComponent, mergeProps } from "vue";
|
|
|
3
3
|
import { MutedOutlined, SoundOutlined } from "@antdv-next/icons";
|
|
4
4
|
//#region components/actions/ActionsAudio.tsx
|
|
5
5
|
var XActionsAudio = /* @__PURE__ */ defineComponent({
|
|
6
|
-
name: "
|
|
6
|
+
name: "AxActionsAudio",
|
|
7
7
|
props: {
|
|
8
8
|
status: {
|
|
9
9
|
type: String,
|
|
@@ -10,7 +10,7 @@ var FEEDBACK_VALUE = /* @__PURE__ */ function(FEEDBACK_VALUE) {
|
|
|
10
10
|
return FEEDBACK_VALUE;
|
|
11
11
|
}(FEEDBACK_VALUE || {});
|
|
12
12
|
var XActionsFeedback = /* @__PURE__ */ defineComponent({
|
|
13
|
-
name: "
|
|
13
|
+
name: "AxActionsFeedback",
|
|
14
14
|
inheritAttrs: false,
|
|
15
15
|
props: {
|
|
16
16
|
value: {
|
|
@@ -11,7 +11,7 @@ var ACTIONS_ITEM_STATUS = /* @__PURE__ */ function(ACTIONS_ITEM_STATUS) {
|
|
|
11
11
|
return ACTIONS_ITEM_STATUS;
|
|
12
12
|
}({});
|
|
13
13
|
var XActionsItem = /* @__PURE__ */ defineComponent({
|
|
14
|
-
name: "
|
|
14
|
+
name: "AxActionsItem",
|
|
15
15
|
inheritAttrs: false,
|
|
16
16
|
props: {
|
|
17
17
|
status: {
|
|
@@ -12,7 +12,7 @@ function _isSlot(s) {
|
|
|
12
12
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
13
13
|
}
|
|
14
14
|
var XAttachments = /* @__PURE__ */ defineComponent({
|
|
15
|
-
name: "
|
|
15
|
+
name: "AxAttachments",
|
|
16
16
|
inheritAttrs: false,
|
|
17
17
|
props: {
|
|
18
18
|
prefixCls: {
|
package/dist/bubble/Bubble.js
CHANGED
package/dist/bubble/Divider.js
CHANGED
|
@@ -6,7 +6,7 @@ function _isSlot(s) {
|
|
|
6
6
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
7
7
|
}
|
|
8
8
|
var XBubbleDivider = /* @__PURE__ */ defineComponent({
|
|
9
|
-
name: "
|
|
9
|
+
name: "AxBubbleDivider",
|
|
10
10
|
props: {
|
|
11
11
|
prefixCls: {
|
|
12
12
|
type: String,
|
package/dist/bubble/System.js
CHANGED
|
@@ -2,7 +2,7 @@ import { XBubble } from "./Bubble.js";
|
|
|
2
2
|
import { createVNode, defineComponent, mergeProps, ref } from "vue";
|
|
3
3
|
//#region components/bubble/System.tsx
|
|
4
4
|
var XBubbleSystem = /* @__PURE__ */ defineComponent({
|
|
5
|
-
name: "
|
|
5
|
+
name: "AxBubbleSystem",
|
|
6
6
|
props: {
|
|
7
7
|
prefixCls: {
|
|
8
8
|
type: String,
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
+
import { codeToHtml } from "./shiki.js";
|
|
1
2
|
import style_default from "./style/index.js";
|
|
2
3
|
import { computed, createVNode, defineComponent, mergeProps, ref, shallowRef, useAttrs, watch } from "vue";
|
|
3
4
|
import { Button, Tooltip } from "antdv-next";
|
|
4
5
|
import { CheckOutlined, CopyOutlined, MoonOutlined, SunOutlined } from "@antdv-next/icons";
|
|
5
6
|
//#region components/code-highlighter/CodeHighlighter.tsx
|
|
6
|
-
var shikiHighlighter = null;
|
|
7
|
-
var shikiPromise = null;
|
|
8
|
-
async function initShiki() {
|
|
9
|
-
if (shikiHighlighter) return;
|
|
10
|
-
if (shikiPromise) return shikiPromise;
|
|
11
|
-
shikiPromise = (async () => {
|
|
12
|
-
shikiHighlighter = (await import("shiki")).codeToHtml;
|
|
13
|
-
})();
|
|
14
|
-
return shikiPromise;
|
|
15
|
-
}
|
|
16
7
|
var XCodeHighlighter = /* @__PURE__ */ defineComponent({
|
|
17
|
-
name: "
|
|
8
|
+
name: "AxCodeHighlighter",
|
|
18
9
|
inheritAttrs: false,
|
|
19
10
|
props: {
|
|
20
11
|
prefixCls: {
|
|
@@ -95,9 +86,7 @@ var XCodeHighlighter = /* @__PURE__ */ defineComponent({
|
|
|
95
86
|
const highlightedHtml = shallowRef("");
|
|
96
87
|
const highlightCode = async () => {
|
|
97
88
|
try {
|
|
98
|
-
await
|
|
99
|
-
if (!shikiHighlighter) return;
|
|
100
|
-
highlightedHtml.value = await shikiHighlighter(props.content, {
|
|
89
|
+
highlightedHtml.value = await codeToHtml(props.content, {
|
|
101
90
|
lang: props.language,
|
|
102
91
|
theme: props.theme === "dark" ? "vitesse-dark" : "vitesse-light"
|
|
103
92
|
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createHighlighterCore } from "shiki/core";
|
|
2
|
+
import darkTheme from "shiki/dist/themes/vitesse-dark.mjs";
|
|
3
|
+
import lightTheme from "shiki/dist/themes/vitesse-light.mjs";
|
|
4
|
+
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
5
|
+
//#region components/code-highlighter/shiki.ts
|
|
6
|
+
var SUPPORTED_LANG_ALIASES = {
|
|
7
|
+
ts: "typescript",
|
|
8
|
+
js: "javascript",
|
|
9
|
+
py: "python",
|
|
10
|
+
md: "markdown",
|
|
11
|
+
yml: "yaml",
|
|
12
|
+
shell: "bash",
|
|
13
|
+
zsh: "bash",
|
|
14
|
+
sh: "bash",
|
|
15
|
+
vue: "vue"
|
|
16
|
+
};
|
|
17
|
+
var LANG_LOADERS = {
|
|
18
|
+
javascript: () => import("shiki/dist/langs/javascript.mjs"),
|
|
19
|
+
typescript: () => import("shiki/dist/langs/typescript.mjs"),
|
|
20
|
+
jsx: () => import("shiki/dist/langs/jsx.mjs"),
|
|
21
|
+
tsx: () => import("shiki/dist/langs/tsx.mjs"),
|
|
22
|
+
json: () => import("shiki/dist/langs/json.mjs"),
|
|
23
|
+
bash: () => import("shiki/dist/langs/bash.mjs"),
|
|
24
|
+
markdown: () => import("shiki/dist/langs/markdown.mjs"),
|
|
25
|
+
html: () => import("shiki/dist/langs/html.mjs"),
|
|
26
|
+
css: () => import("shiki/dist/langs/css.mjs"),
|
|
27
|
+
vue: () => import("shiki/dist/langs/vue.mjs"),
|
|
28
|
+
"vue-html": () => import("shiki/dist/langs/vue-html.mjs"),
|
|
29
|
+
python: () => import("shiki/dist/langs/python.mjs"),
|
|
30
|
+
mermaid: () => import("shiki/dist/langs/mermaid.mjs"),
|
|
31
|
+
yaml: () => import("shiki/dist/langs/yaml.mjs"),
|
|
32
|
+
diff: () => import("shiki/dist/langs/diff.mjs")
|
|
33
|
+
};
|
|
34
|
+
var highlighter = null;
|
|
35
|
+
var highlighterPromise = null;
|
|
36
|
+
var loadedLangs = /* @__PURE__ */ new Set();
|
|
37
|
+
function normalizeLanguage(language) {
|
|
38
|
+
const input = (language || "text").toLowerCase();
|
|
39
|
+
return SUPPORTED_LANG_ALIASES[input] || input;
|
|
40
|
+
}
|
|
41
|
+
function escapeHtml(str) {
|
|
42
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
43
|
+
}
|
|
44
|
+
async function getHighlighter() {
|
|
45
|
+
if (highlighter) return highlighter;
|
|
46
|
+
if (!highlighterPromise) highlighterPromise = createHighlighterCore({
|
|
47
|
+
themes: [lightTheme, darkTheme],
|
|
48
|
+
langs: [],
|
|
49
|
+
engine: createJavaScriptRegexEngine()
|
|
50
|
+
});
|
|
51
|
+
highlighter = await highlighterPromise;
|
|
52
|
+
return highlighter;
|
|
53
|
+
}
|
|
54
|
+
async function loadLang(lang) {
|
|
55
|
+
const loader = LANG_LOADERS[lang];
|
|
56
|
+
if (!loader || loadedLangs.has(lang)) return false;
|
|
57
|
+
const instance = await getHighlighter();
|
|
58
|
+
const mod = await loader();
|
|
59
|
+
await instance.loadLanguage(mod.default);
|
|
60
|
+
loadedLangs.add(lang);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
async function codeToHtml(code, options = {}) {
|
|
64
|
+
const lang = normalizeLanguage(options.lang);
|
|
65
|
+
if (!await loadLang(lang)) return `<pre><code>${escapeHtml(code)}</code></pre>`;
|
|
66
|
+
return (await getHighlighter()).codeToHtml(code, {
|
|
67
|
+
lang,
|
|
68
|
+
theme: options.theme || "vitesse-light"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { codeToHtml };
|
|
@@ -2,7 +2,7 @@ import useCreation from "./hooks/useCreation.js";
|
|
|
2
2
|
import { computed, createVNode, defineComponent } from "vue";
|
|
3
3
|
//#region components/conversations/Creation.tsx
|
|
4
4
|
var Creation = /* @__PURE__ */ defineComponent({
|
|
5
|
-
name: "
|
|
5
|
+
name: "AxConversationsCreation",
|
|
6
6
|
props: {
|
|
7
7
|
label: {
|
|
8
8
|
type: [
|
|
@@ -17,7 +17,7 @@ function isTypingTarget(target) {
|
|
|
17
17
|
return tagName === "input" || tagName === "textarea" || tagName === "select";
|
|
18
18
|
}
|
|
19
19
|
var ConversationsWithSub = /* @__PURE__ */ defineComponent({
|
|
20
|
-
name: "
|
|
20
|
+
name: "AxConversations",
|
|
21
21
|
inheritAttrs: false,
|
|
22
22
|
props: {
|
|
23
23
|
items: {
|
package/dist/file-card/List.js
CHANGED
|
@@ -10,7 +10,7 @@ function _isSlot(s) {
|
|
|
10
10
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
11
11
|
}
|
|
12
12
|
var XFileCardList = /* @__PURE__ */ defineComponent({
|
|
13
|
-
name: "
|
|
13
|
+
name: "AxFileCardList",
|
|
14
14
|
props: {
|
|
15
15
|
prefixCls: {
|
|
16
16
|
type: String,
|