@duxweb/dvha-pro 1.1.14 → 1.1.16
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/cjs/components/card/card.cjs +1 -1
- package/dist/cjs/components/chart/echart.cjs +1 -1
- package/dist/cjs/components/crop/imageCrop.cjs +1 -1
- package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/designEditor/components/grid.cjs +1 -1
- package/dist/cjs/components/designEditor/editor/setting.cjs +1 -1
- package/dist/cjs/components/editor/aiEditor.cjs +3 -1
- package/dist/cjs/components/flowEditor/components/setting.cjs +1 -1
- package/dist/cjs/components/flowEditor/nodes/endNode.cjs +1 -1
- package/dist/cjs/components/flowEditor/nodes/index.cjs +1 -1
- package/dist/cjs/components/flowEditor/nodes/processNode.cjs +1 -1
- package/dist/cjs/components/flowEditor/nodes/startNode.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/pageTabForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/formEditor/base/base.cjs +1 -1
- package/dist/cjs/components/formEditor/base/setting.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascader.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascaderAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/checkbox.cjs +1 -1
- package/dist/cjs/components/formEditor/components/color.cjs +1 -1
- package/dist/cjs/components/formEditor/components/date.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicInput.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicTags.cjs +1 -1
- package/dist/cjs/components/formEditor/components/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/components/fileUpload.cjs +1 -1
- package/dist/cjs/components/formEditor/components/imageUpload.cjs +1 -1
- package/dist/cjs/components/formEditor/components/input.cjs +1 -1
- package/dist/cjs/components/formEditor/components/inputNumber.cjs +1 -1
- package/dist/cjs/components/formEditor/components/mentionAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/radio.cjs +1 -1
- package/dist/cjs/components/formEditor/components/region.cjs +1 -1
- package/dist/cjs/components/formEditor/components/select.cjs +1 -1
- package/dist/cjs/components/formEditor/components/selectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/sider.cjs +1 -1
- package/dist/cjs/components/formEditor/components/switch.cjs +1 -1
- package/dist/cjs/components/formEditor/components/time.cjs +1 -1
- package/dist/cjs/components/formEditor/components/transferAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelect.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/renderer.cjs +1 -1
- package/dist/cjs/components/icon/icon.cjs +1 -1
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/layout/tools.cjs +1 -1
- package/dist/cjs/components/level/level.cjs +1 -1
- package/dist/cjs/components/posterEditor/pages/RightPanel.cjs +1 -1
- package/dist/cjs/components/posterEditor/posterEditor.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/upload/file.cjs +1 -1
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/components/upload/manage/item.cjs +1 -1
- package/dist/cjs/components/upload/manager.cjs +1 -1
- package/dist/cjs/config/uno.cjs +1 -1
- package/dist/cjs/hooks/dialog.cjs +1 -1
- package/dist/cjs/hooks/download.cjs +1 -1
- package/dist/cjs/hooks/drawer.cjs +1 -1
- package/dist/cjs/hooks/modal.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/media.cjs +1 -1
- package/dist/cjs/pages/layout/global.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/login.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/cmd.cjs +1 -1
- package/dist/cjs/pages/menu/menuApp.cjs +1 -1
- package/dist/cjs/pages/menu/menuMain.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/menu/notice.cjs +1 -1
- package/dist/cjs/pages/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +58 -112
- package/dist/esm/components/card/card.js +0 -1
- package/dist/esm/components/chart/echart.js +3 -5
- package/dist/esm/components/crop/imageCrop.js +3 -5
- package/dist/esm/components/data/dynamicSelect.js +3 -5
- package/dist/esm/components/data/selectModal.js +3 -5
- package/dist/esm/components/designEditor/components/grid.js +3 -5
- package/dist/esm/components/designEditor/editor/setting.js +5 -7
- package/dist/esm/components/editor/aiEditor.js +142 -125
- package/dist/esm/components/flowEditor/components/setting.js +13 -15
- package/dist/esm/components/flowEditor/nodes/endNode.js +3 -5
- package/dist/esm/components/flowEditor/nodes/index.js +3 -5
- package/dist/esm/components/flowEditor/nodes/processNode.js +3 -5
- package/dist/esm/components/flowEditor/nodes/startNode.js +3 -5
- package/dist/esm/components/form/drawerForm.js +3 -5
- package/dist/esm/components/form/modalForm.js +3 -5
- package/dist/esm/components/form/pageForm.js +3 -5
- package/dist/esm/components/form/pageTabForm.js +3 -5
- package/dist/esm/components/form/settingForm.js +3 -6
- package/dist/esm/components/formEditor/base/base.js +5 -7
- package/dist/esm/components/formEditor/base/setting.js +3 -5
- package/dist/esm/components/formEditor/components/cascader.js +3 -5
- package/dist/esm/components/formEditor/components/cascaderAsync.js +3 -5
- package/dist/esm/components/formEditor/components/checkbox.js +3 -5
- package/dist/esm/components/formEditor/components/color.js +3 -5
- package/dist/esm/components/formEditor/components/date.js +3 -5
- package/dist/esm/components/formEditor/components/dynamicInput.js +3 -5
- package/dist/esm/components/formEditor/components/dynamicTags.js +10 -12
- package/dist/esm/components/formEditor/components/editor.js +3 -5
- package/dist/esm/components/formEditor/components/fileUpload.js +3 -5
- package/dist/esm/components/formEditor/components/imageUpload.js +3 -5
- package/dist/esm/components/formEditor/components/input.js +3 -5
- package/dist/esm/components/formEditor/components/inputNumber.js +3 -5
- package/dist/esm/components/formEditor/components/mentionAsync.js +14 -16
- package/dist/esm/components/formEditor/components/radio.js +14 -16
- package/dist/esm/components/formEditor/components/region.js +16 -18
- package/dist/esm/components/formEditor/components/select.js +3 -5
- package/dist/esm/components/formEditor/components/selectAsync.js +3 -5
- package/dist/esm/components/formEditor/components/sider.js +3 -5
- package/dist/esm/components/formEditor/components/switch.js +19 -21
- package/dist/esm/components/formEditor/components/time.js +3 -5
- package/dist/esm/components/formEditor/components/transferAsync.js +23 -25
- package/dist/esm/components/formEditor/components/treeSelect.js +3 -5
- package/dist/esm/components/formEditor/components/treeSelectAsync.js +3 -5
- package/dist/esm/components/formEditor/editor.js +3 -5
- package/dist/esm/components/formEditor/renderer.js +3 -5
- package/dist/esm/components/icon/icon.js +3 -5
- package/dist/esm/components/layout/list.js +3 -5
- package/dist/esm/components/layout/table.js +23 -25
- package/dist/esm/components/layout/tools.js +3 -5
- package/dist/esm/components/level/level.js +3 -5
- package/dist/esm/components/posterEditor/pages/RightPanel.js +3 -5
- package/dist/esm/components/posterEditor/posterEditor.js +3 -5
- package/dist/esm/components/table/table.js +8 -10
- package/dist/esm/components/upload/file.js +3 -5
- package/dist/esm/components/upload/image.js +33 -35
- package/dist/esm/components/upload/manage/item.js +3 -5
- package/dist/esm/components/upload/manager.js +3 -5
- package/dist/esm/config/uno.js +6 -8
- package/dist/esm/hooks/dialog.js +3 -5
- package/dist/esm/hooks/download.js +57 -50
- package/dist/esm/hooks/drawer.js +3 -5
- package/dist/esm/hooks/modal.js +3 -5
- package/dist/esm/hooks/table/image.js +3 -5
- package/dist/esm/hooks/table/media.js +3 -5
- package/dist/esm/pages/layout/global.js +3 -5
- package/dist/esm/pages/layout/page.js +7 -9
- package/dist/esm/pages/login.js +8 -10
- package/dist/esm/pages/menu/avatar.js +19 -21
- package/dist/esm/pages/menu/button.js +3 -5
- package/dist/esm/pages/menu/cmd.js +11 -13
- package/dist/esm/pages/menu/menuApp.js +15 -17
- package/dist/esm/pages/menu/menuMain.js +3 -5
- package/dist/esm/pages/menu/mobile.js +3 -5
- package/dist/esm/pages/menu/notice.js +3 -5
- package/dist/esm/pages/page404.js +1 -3
- package/dist/esm/pages/pageStatus.js +3 -5
- package/dist/esm/theme/uno.css.js +58 -112
- package/dist/types/components/table/table.d.ts +5 -5
- package/dist/types/components/widget/avatar.d.ts +2 -2
- package/dist/types/components/widget/image.d.ts +1 -1
- package/dist/types/config/uno.d.ts +2 -2
- package/dist/types/hooks/action.d.ts +1 -1
- package/package.json +7 -8
|
@@ -39,9 +39,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
39
39
|
import "highlight.js/lib/languages/typescript";
|
|
40
40
|
import "highlight.js/lib/languages/xml";
|
|
41
41
|
import "@ant-design/colors";
|
|
42
|
-
import "
|
|
43
|
-
import "@unocss/preset-typography";
|
|
44
|
-
import "unocss/preset-wind4";
|
|
42
|
+
import "unocss";
|
|
45
43
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
46
44
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
47
45
|
import "vee-validate";
|
|
@@ -62,7 +60,7 @@ import "fabric";
|
|
|
62
60
|
import "dayjs";
|
|
63
61
|
import "@tanstack/vue-query";
|
|
64
62
|
import "pinia";
|
|
65
|
-
const
|
|
63
|
+
const Mt = /* @__PURE__ */ f({
|
|
66
64
|
name: "DuxDynamicSelect",
|
|
67
65
|
props: {
|
|
68
66
|
rowKey: {
|
|
@@ -135,5 +133,5 @@ const jt = /* @__PURE__ */ f({
|
|
|
135
133
|
}
|
|
136
134
|
});
|
|
137
135
|
export {
|
|
138
|
-
|
|
136
|
+
Mt as DuxDynamicSelect
|
|
139
137
|
};
|
|
@@ -40,9 +40,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
40
40
|
import "highlight.js/lib/languages/typescript";
|
|
41
41
|
import "highlight.js/lib/languages/xml";
|
|
42
42
|
import "@ant-design/colors";
|
|
43
|
-
import "
|
|
44
|
-
import "@unocss/preset-typography";
|
|
45
|
-
import "unocss/preset-wind4";
|
|
43
|
+
import "unocss";
|
|
46
44
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
47
45
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
48
46
|
import "vee-validate";
|
|
@@ -65,7 +63,7 @@ import "pinia";
|
|
|
65
63
|
function c(t) {
|
|
66
64
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !z(t);
|
|
67
65
|
}
|
|
68
|
-
const
|
|
66
|
+
const Bt = /* @__PURE__ */ y({
|
|
69
67
|
name: "Select",
|
|
70
68
|
props: {
|
|
71
69
|
path: String,
|
|
@@ -159,5 +157,5 @@ const It = /* @__PURE__ */ y({
|
|
|
159
157
|
}
|
|
160
158
|
});
|
|
161
159
|
export {
|
|
162
|
-
|
|
160
|
+
Bt as default
|
|
163
161
|
};
|
|
@@ -46,9 +46,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
46
46
|
import "highlight.js/lib/languages/typescript";
|
|
47
47
|
import "highlight.js/lib/languages/xml";
|
|
48
48
|
import "@ant-design/colors";
|
|
49
|
-
import "
|
|
50
|
-
import "@unocss/preset-typography";
|
|
51
|
-
import "unocss/preset-wind4";
|
|
49
|
+
import "unocss";
|
|
52
50
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
53
51
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
54
52
|
import "vue-command-palette";
|
|
@@ -171,7 +169,7 @@ function j(o) {
|
|
|
171
169
|
children: t
|
|
172
170
|
};
|
|
173
171
|
}
|
|
174
|
-
function
|
|
172
|
+
function It(o) {
|
|
175
173
|
return {
|
|
176
174
|
name: "dux-grid",
|
|
177
175
|
icon: "i-tabler:grid-4x4",
|
|
@@ -188,5 +186,5 @@ function Ut(o) {
|
|
|
188
186
|
};
|
|
189
187
|
}
|
|
190
188
|
export {
|
|
191
|
-
|
|
189
|
+
It as duxFormEditorGrid
|
|
192
190
|
};
|
|
@@ -44,9 +44,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
44
44
|
import "highlight.js/lib/languages/typescript";
|
|
45
45
|
import "highlight.js/lib/languages/xml";
|
|
46
46
|
import "@ant-design/colors";
|
|
47
|
-
import "
|
|
48
|
-
import "@unocss/preset-typography";
|
|
49
|
-
import "unocss/preset-wind4";
|
|
47
|
+
import "unocss";
|
|
50
48
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
51
49
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
52
50
|
import "vee-validate";
|
|
@@ -61,7 +59,7 @@ import "@vue-flow/background";
|
|
|
61
59
|
import "@iconify-json/tabler/icons.json";
|
|
62
60
|
import "../../posterEditor/elements/index.js";
|
|
63
61
|
import "fabric";
|
|
64
|
-
const
|
|
62
|
+
const xt = /* @__PURE__ */ m({
|
|
65
63
|
name: "WidgetEditorSetting",
|
|
66
64
|
props: {
|
|
67
65
|
actionRender: Function
|
|
@@ -87,7 +85,7 @@ const St = /* @__PURE__ */ m({
|
|
|
87
85
|
}
|
|
88
86
|
})]), e?.actionRender?.(t)])]);
|
|
89
87
|
}
|
|
90
|
-
}),
|
|
88
|
+
}), yt = /* @__PURE__ */ m({
|
|
91
89
|
name: "WidgetEditorSettingCard",
|
|
92
90
|
props: {
|
|
93
91
|
title: String,
|
|
@@ -110,6 +108,6 @@ const St = /* @__PURE__ */ m({
|
|
|
110
108
|
}
|
|
111
109
|
});
|
|
112
110
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
xt as WidgetEditorSetting,
|
|
112
|
+
yt as WidgetEditorSettingCard
|
|
115
113
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { useVModel as
|
|
4
|
-
import { AiEditor as
|
|
5
|
-
import { useMessage as
|
|
1
|
+
import { defineComponent as j, ref as F, computed as z, watch as M, onMounted as B, nextTick as H, onUnmounted as D, createVNode as I } from "vue";
|
|
2
|
+
import { useTheme as N, useManage as O, useGetAuth as Z, useI18n as J, useUpload as _ } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as q } from "@vueuse/core";
|
|
4
|
+
import { AiEditor as G } from "aieditor";
|
|
5
|
+
import { useMessage as K } from "naive-ui";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
8
|
import "clsx";
|
|
@@ -40,9 +40,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
40
40
|
import "highlight.js/lib/languages/typescript";
|
|
41
41
|
import "highlight.js/lib/languages/xml";
|
|
42
42
|
import "@ant-design/colors";
|
|
43
|
-
import "
|
|
44
|
-
import "@unocss/preset-typography";
|
|
45
|
-
import "unocss/preset-wind4";
|
|
43
|
+
import "unocss";
|
|
46
44
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
47
45
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
48
46
|
import "vee-validate";
|
|
@@ -50,11 +48,11 @@ import "vue-command-palette";
|
|
|
50
48
|
import "@duxweb/dvha-naiveui";
|
|
51
49
|
import "../../pages/page404.js";
|
|
52
50
|
import "short-unique-id";
|
|
53
|
-
import { useUploadConfig as
|
|
51
|
+
import { useUploadConfig as R } from "../upload/config.js";
|
|
54
52
|
import "@vue-flow/core";
|
|
55
53
|
import "@vue-flow/background";
|
|
56
54
|
/* empty css */
|
|
57
|
-
import { useModal as
|
|
55
|
+
import { useModal as Q } from "../../hooks/modal.js";
|
|
58
56
|
import "mime";
|
|
59
57
|
import "@iconify-json/tabler/icons.json";
|
|
60
58
|
import "../posterEditor/elements/index.js";
|
|
@@ -62,7 +60,7 @@ import "fabric";
|
|
|
62
60
|
import "dayjs";
|
|
63
61
|
import "@tanstack/vue-query";
|
|
64
62
|
import "pinia";
|
|
65
|
-
const
|
|
63
|
+
const ae = /* @__PURE__ */ j({
|
|
66
64
|
name: "DuxAiEditor",
|
|
67
65
|
props: {
|
|
68
66
|
value: String,
|
|
@@ -87,183 +85,202 @@ const at = /* @__PURE__ */ $({
|
|
|
87
85
|
default: "500px"
|
|
88
86
|
}
|
|
89
87
|
},
|
|
90
|
-
setup(
|
|
91
|
-
emit:
|
|
92
|
-
expose:
|
|
88
|
+
setup(t, {
|
|
89
|
+
emit: b,
|
|
90
|
+
expose: x
|
|
93
91
|
}) {
|
|
94
|
-
const
|
|
95
|
-
let
|
|
96
|
-
const
|
|
97
|
-
config:
|
|
98
|
-
} =
|
|
99
|
-
t:
|
|
100
|
-
} =
|
|
92
|
+
const d = F();
|
|
93
|
+
let o = null, g = !1;
|
|
94
|
+
const v = N(), {
|
|
95
|
+
config: y
|
|
96
|
+
} = O(), S = Z(), {
|
|
97
|
+
t: u
|
|
98
|
+
} = J(), P = K(), T = Q(), k = q(t, "value", b, {
|
|
101
99
|
passive: !0
|
|
102
|
-
}),
|
|
103
|
-
path:
|
|
100
|
+
}), s = z(() => t.uploadPath || y.apiPath?.upload || "upload"), f = _({
|
|
101
|
+
path: s.value,
|
|
104
102
|
autoUpload: !1
|
|
105
103
|
}), {
|
|
106
|
-
managePath:
|
|
107
|
-
method:
|
|
108
|
-
} =
|
|
109
|
-
if (!
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
if (!
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
managePath: E,
|
|
105
|
+
method: U
|
|
106
|
+
} = R(), A = () => {
|
|
107
|
+
if (!o || g) return;
|
|
108
|
+
const e = k.value || "";
|
|
109
|
+
t.editorType === "markdown" ? o.setMarkdownContent(e) : o.setContent(e);
|
|
110
|
+
}, w = () => {
|
|
111
|
+
if (!o) return;
|
|
112
|
+
g = !0;
|
|
113
|
+
const e = t.editorType === "markdown" ? o.getMarkdown() : o.getHtml();
|
|
114
|
+
k.value = e, H(() => {
|
|
115
|
+
g = !1;
|
|
118
116
|
});
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
l.forEach((
|
|
123
|
-
const
|
|
124
|
-
|
|
117
|
+
}, h = (e) => new Promise((n, i) => {
|
|
118
|
+
f.addFiles([e], "file").then(() => {
|
|
119
|
+
f.trigger().then((l) => {
|
|
120
|
+
l.forEach((p) => {
|
|
121
|
+
const m = p?.data?.data;
|
|
122
|
+
n({
|
|
125
123
|
errorCode: 0,
|
|
126
124
|
data: {
|
|
127
|
-
src:
|
|
128
|
-
alt:
|
|
125
|
+
src: m?.url,
|
|
126
|
+
alt: p?.filename
|
|
129
127
|
}
|
|
130
128
|
});
|
|
131
129
|
});
|
|
132
130
|
}).catch((l) => {
|
|
133
|
-
|
|
131
|
+
P.error(l.message), i(l);
|
|
134
132
|
}).finally(() => {
|
|
135
|
-
|
|
133
|
+
f.clearFiles();
|
|
136
134
|
});
|
|
137
135
|
});
|
|
138
|
-
}),
|
|
139
|
-
const
|
|
140
|
-
return /^image\//i.test(
|
|
141
|
-
},
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
element:
|
|
146
|
-
theme:
|
|
147
|
-
placeholder:
|
|
148
|
-
content:
|
|
149
|
-
contentIsMarkdown:
|
|
150
|
-
onChange:
|
|
151
|
-
onBlur:
|
|
136
|
+
}), C = (e) => {
|
|
137
|
+
const n = String(e?.filetype || ""), i = String(e?.url || "");
|
|
138
|
+
return /^image\//i.test(n) || /\.(?:png|jpe?g|gif|bmp|webp|svg)$/i.test(i) ? "image" : /^video\//i.test(n) || /\.(?:mp4|webm|ogg|mov|m4v)$/i.test(i) ? "video" : "attachment";
|
|
139
|
+
}, L = () => {
|
|
140
|
+
if (!d.value) return;
|
|
141
|
+
const e = t.value || t.defaultValue || "";
|
|
142
|
+
o = new G({
|
|
143
|
+
element: d.value,
|
|
144
|
+
theme: v.isDark.value ? "dark" : "light",
|
|
145
|
+
placeholder: u("components.editor.placeholder"),
|
|
146
|
+
content: e,
|
|
147
|
+
contentIsMarkdown: t.editorType === "markdown",
|
|
148
|
+
onChange: w,
|
|
149
|
+
onBlur: w,
|
|
152
150
|
image: {
|
|
153
|
-
uploadUrl:
|
|
154
|
-
uploadHeaders:
|
|
155
|
-
uploader:
|
|
151
|
+
uploadUrl: s.value,
|
|
152
|
+
uploadHeaders: t.uploadHeaders || {},
|
|
153
|
+
uploader: h,
|
|
156
154
|
defaultSize: "auto"
|
|
157
155
|
},
|
|
158
156
|
video: {
|
|
159
|
-
uploadUrl:
|
|
160
|
-
uploadHeaders:
|
|
161
|
-
uploader:
|
|
157
|
+
uploadUrl: s.value,
|
|
158
|
+
uploadHeaders: t.uploadHeaders || {},
|
|
159
|
+
uploader: h
|
|
162
160
|
},
|
|
163
161
|
attachment: {
|
|
164
|
-
uploadUrl:
|
|
165
|
-
uploadHeaders:
|
|
166
|
-
uploader:
|
|
162
|
+
uploadUrl: s.value,
|
|
163
|
+
uploadHeaders: t.uploadHeaders || {},
|
|
164
|
+
uploader: h
|
|
167
165
|
},
|
|
168
166
|
ai: {
|
|
169
167
|
models: {
|
|
170
168
|
custom: {
|
|
171
|
-
url:
|
|
169
|
+
url: t.aiPath || y.apiPath?.ai || "ai",
|
|
172
170
|
headers: () => ({
|
|
173
171
|
"Content-Type": "application/json",
|
|
174
|
-
Authorization:
|
|
172
|
+
Authorization: S.token
|
|
175
173
|
}),
|
|
176
|
-
wrapPayload: (
|
|
177
|
-
prompt:
|
|
174
|
+
wrapPayload: (n) => JSON.stringify({
|
|
175
|
+
prompt: n
|
|
178
176
|
}),
|
|
179
|
-
parseMessage: (
|
|
180
|
-
const
|
|
177
|
+
parseMessage: (n) => {
|
|
178
|
+
const i = JSON.parse(n);
|
|
181
179
|
return {
|
|
182
180
|
role: "assistant",
|
|
183
|
-
content:
|
|
184
|
-
index:
|
|
185
|
-
status:
|
|
181
|
+
content: i.message,
|
|
182
|
+
index: i.number,
|
|
183
|
+
status: i.status
|
|
186
184
|
};
|
|
187
185
|
},
|
|
188
186
|
protocol: "sse"
|
|
189
187
|
}
|
|
190
188
|
}
|
|
191
189
|
},
|
|
192
|
-
toolbarKeys: ["undo", "redo", "brush", "eraser", "divider", "heading", "font-family", "font-size", "divider", "bold", "italic", "underline", "strike", "link", "code", "subscript", "superscript", "hr", "todo", "emoji", "divider", "highlight", "font-color", "divider", "align", "line-height", "divider", "bullet-list", "ordered-list", "indent-decrease", "indent-increase", "break", "divider", ...
|
|
190
|
+
toolbarKeys: ["undo", "redo", "brush", "eraser", "divider", "heading", "font-family", "font-size", "divider", "bold", "italic", "underline", "strike", "link", "code", "subscript", "superscript", "hr", "todo", "emoji", "divider", "highlight", "font-color", "divider", "align", "line-height", "divider", "bullet-list", "ordered-list", "indent-decrease", "indent-increase", "break", "divider", ...t.fileManager ? [{
|
|
193
191
|
id: "dux-file-manager-image",
|
|
194
|
-
tip:
|
|
192
|
+
tip: u("components.upload.fileManager"),
|
|
195
193
|
icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3.08697 9H20.9134C21.4657 9 21.9134 9.44772 21.9134 10C21.9134 10.0277 21.9122 10.0554 21.9099 10.083L21.0766 20.083C21.0334 20.6013 20.6001 21 20.08 21H3.9203C3.40021 21 2.96695 20.6013 2.92376 20.083L2.09042 10.083C2.04456 9.53267 2.45355 9.04932 3.00392 9.00345C3.03155 9.00115 3.05925 9 3.08697 9ZM4.84044 19H19.1599L19.8266 11H4.17377L4.84044 19ZM13.4144 5H20.0002C20.5525 5 21.0002 5.44772 21.0002 6V7H3.00017V4C3.00017 3.44772 3.44789 3 4.00017 3H11.4144L13.4144 5Z"></path></svg>',
|
|
196
|
-
onClick: (
|
|
197
|
-
|
|
198
|
-
title:
|
|
194
|
+
onClick: (n, i) => {
|
|
195
|
+
T.show({
|
|
196
|
+
title: u("components.uploadManage.title") || u("components.upload.fileManager"),
|
|
199
197
|
width: "800px",
|
|
200
198
|
component: () => import("../upload/manager.js"),
|
|
201
199
|
componentProps: {
|
|
202
|
-
path:
|
|
203
|
-
type:
|
|
200
|
+
path: E.value,
|
|
201
|
+
type: t.fileManagerType || "all",
|
|
204
202
|
multiple: !0,
|
|
205
203
|
uploadParams: {
|
|
206
|
-
path:
|
|
204
|
+
path: s.value,
|
|
207
205
|
accept: "*/*",
|
|
208
|
-
method:
|
|
206
|
+
method: U.value
|
|
209
207
|
}
|
|
210
208
|
}
|
|
211
209
|
}).then((l) => {
|
|
212
|
-
l
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
210
|
+
const p = Array.isArray(l) ? [...l] : l ? [l] : [];
|
|
211
|
+
if (!p.length) return;
|
|
212
|
+
if (t.editorType === "markdown") {
|
|
213
|
+
const r = p.filter((a) => a?.url).map((a) => {
|
|
214
|
+
const c = a?.filename || a?.name || "file";
|
|
215
|
+
return C(a) === "image" ? `` : `[${c}](${a.url})`;
|
|
216
|
+
});
|
|
217
|
+
r.length && i.insertMarkdown(r.join(`
|
|
218
|
+
|
|
219
|
+
`));
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const m = p.filter((r) => r?.url).map((r) => {
|
|
223
|
+
const a = C(r), c = r?.filename || "";
|
|
224
|
+
return a === "image" ? {
|
|
225
|
+
type: "image",
|
|
226
|
+
attrs: {
|
|
227
|
+
src: r.url,
|
|
228
|
+
alt: c,
|
|
229
|
+
width: "auto"
|
|
230
|
+
}
|
|
231
|
+
} : a === "video" ? {
|
|
232
|
+
type: "video",
|
|
233
|
+
attrs: {
|
|
234
|
+
src: r.url,
|
|
235
|
+
controls: "true",
|
|
236
|
+
width: 350
|
|
237
|
+
}
|
|
238
|
+
} : {
|
|
239
|
+
type: "paragraph",
|
|
240
|
+
content: [{
|
|
241
|
+
type: "text",
|
|
242
|
+
text: r?.filename || r?.name || "file",
|
|
243
|
+
marks: [{
|
|
244
|
+
type: "link",
|
|
245
|
+
attrs: {
|
|
246
|
+
href: r.url,
|
|
247
|
+
target: "_blank"
|
|
248
|
+
}
|
|
249
|
+
}]
|
|
250
|
+
}]
|
|
251
|
+
};
|
|
236
252
|
});
|
|
253
|
+
m.length && i.insert(m.length === 1 ? m[0] : m);
|
|
237
254
|
});
|
|
238
255
|
}
|
|
239
256
|
}] : [], "image", "video", "attachment", "quote", "container", "code-block", "table", "divider", "printer", "fullscreen", "ai"]
|
|
240
257
|
});
|
|
241
|
-
},
|
|
242
|
-
|
|
258
|
+
}, V = () => {
|
|
259
|
+
o && (o.destroy(), o = null);
|
|
243
260
|
};
|
|
244
|
-
return
|
|
245
|
-
|
|
261
|
+
return M(() => t.value, A), M(() => v.isDark.value, (e) => {
|
|
262
|
+
d.value && (d.value.classList.toggle("aie-theme-dark", e), d.value.classList.toggle("aie-theme-light", !e));
|
|
246
263
|
}, {
|
|
247
264
|
immediate: !0
|
|
248
|
-
}),
|
|
265
|
+
}), x({
|
|
249
266
|
get aiEditor() {
|
|
250
|
-
return
|
|
267
|
+
return o;
|
|
251
268
|
}
|
|
252
|
-
}),
|
|
253
|
-
|
|
254
|
-
|
|
269
|
+
}), B(() => {
|
|
270
|
+
H(() => {
|
|
271
|
+
L();
|
|
255
272
|
});
|
|
256
|
-
}),
|
|
257
|
-
|
|
258
|
-
}), () =>
|
|
259
|
-
ref:
|
|
273
|
+
}), D(() => {
|
|
274
|
+
V();
|
|
275
|
+
}), () => I("div", {
|
|
276
|
+
ref: d,
|
|
260
277
|
style: {
|
|
261
|
-
height:
|
|
278
|
+
height: t.height,
|
|
262
279
|
width: "100%"
|
|
263
280
|
}
|
|
264
281
|
}, null);
|
|
265
282
|
}
|
|
266
283
|
});
|
|
267
284
|
export {
|
|
268
|
-
|
|
285
|
+
ae as DuxAiEditor
|
|
269
286
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as P, computed as w, ref as x, watch as
|
|
1
|
+
import { defineComponent as P, computed as w, ref as x, watch as c, createVNode as e } from "vue";
|
|
2
2
|
import { useI18n as T } from "@duxweb/dvha-core";
|
|
3
3
|
import { useVueFlow as U, MarkerType as z } from "@vue-flow/core";
|
|
4
4
|
import k from "clsx";
|
|
5
|
-
import { useMessage as A, NScrollbar as G, NButton as
|
|
5
|
+
import { useMessage as A, NScrollbar as G, NButton as m, NRadioGroup as H, NRadio as h } from "naive-ui";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
8
|
import "vue-echarts";
|
|
@@ -40,9 +40,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
40
40
|
import "highlight.js/lib/languages/typescript";
|
|
41
41
|
import "highlight.js/lib/languages/xml";
|
|
42
42
|
import "@ant-design/colors";
|
|
43
|
-
import "
|
|
44
|
-
import "@unocss/preset-typography";
|
|
45
|
-
import "unocss/preset-wind4";
|
|
43
|
+
import "unocss";
|
|
46
44
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
47
45
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
48
46
|
import "vee-validate";
|
|
@@ -82,7 +80,7 @@ const y = ({
|
|
|
82
80
|
class: "text-base font-medium"
|
|
83
81
|
}, [u]), o && e("p", {
|
|
84
82
|
class: "text-sm text-muted mt-1"
|
|
85
|
-
}, [o])])])]),
|
|
83
|
+
}, [o])])])]), tt = /* @__PURE__ */ P({
|
|
86
84
|
name: "FlowSetting",
|
|
87
85
|
props: {
|
|
88
86
|
nodes: {
|
|
@@ -123,19 +121,19 @@ const y = ({
|
|
|
123
121
|
const t = N.value;
|
|
124
122
|
return t.length === 1 ? t[0] : null;
|
|
125
123
|
}), a = w(() => !l.value || !l.value.type ? null : s.nodes[l.value.type]), p = x({}), n = x({});
|
|
126
|
-
|
|
124
|
+
c(l, (t) => {
|
|
127
125
|
t ? p.value = {
|
|
128
126
|
...t.data
|
|
129
127
|
} : p.value = {};
|
|
130
128
|
}, {
|
|
131
129
|
immediate: !0
|
|
132
|
-
}),
|
|
130
|
+
}), c(r, (t) => {
|
|
133
131
|
t ? n.value = {
|
|
134
132
|
...t.data
|
|
135
133
|
} : n.value = {};
|
|
136
134
|
}, {
|
|
137
135
|
immediate: !0
|
|
138
|
-
}),
|
|
136
|
+
}), c(p, (t) => {
|
|
139
137
|
l.value && (F(l.value.id, t), d("update:modelValue", {
|
|
140
138
|
nodes: f.value,
|
|
141
139
|
edges: v.value
|
|
@@ -143,7 +141,7 @@ const y = ({
|
|
|
143
141
|
}, {
|
|
144
142
|
deep: !0,
|
|
145
143
|
flush: "post"
|
|
146
|
-
}),
|
|
144
|
+
}), c(n, (t) => {
|
|
147
145
|
if (r.value) {
|
|
148
146
|
D(r.value.id, t);
|
|
149
147
|
const i = r.value;
|
|
@@ -232,7 +230,7 @@ const y = ({
|
|
|
232
230
|
class: "space-y-4"
|
|
233
231
|
}, [u.globalSettings?.(), e("div", {
|
|
234
232
|
class: "flex flex-col gap-2"
|
|
235
|
-
}, [e(
|
|
233
|
+
}, [e(m, {
|
|
236
234
|
onClick: M,
|
|
237
235
|
type: "default",
|
|
238
236
|
block: !0,
|
|
@@ -242,7 +240,7 @@ const y = ({
|
|
|
242
240
|
class: "i-tabler:code"
|
|
243
241
|
}, null),
|
|
244
242
|
default: () => o("components.flowEditor.editJSON") || ""
|
|
245
|
-
}), e(
|
|
243
|
+
}), e(m, {
|
|
246
244
|
onClick: B,
|
|
247
245
|
type: "primary",
|
|
248
246
|
block: !0,
|
|
@@ -252,7 +250,7 @@ const y = ({
|
|
|
252
250
|
class: "i-tabler:device-floppy"
|
|
253
251
|
}, null),
|
|
254
252
|
default: () => o("components.flowEditor.saveFlow") || ""
|
|
255
|
-
}), e(
|
|
253
|
+
}), e(m, {
|
|
256
254
|
onClick: j,
|
|
257
255
|
type: "warning",
|
|
258
256
|
block: !0,
|
|
@@ -299,7 +297,7 @@ const y = ({
|
|
|
299
297
|
})])]
|
|
300
298
|
})]
|
|
301
299
|
}), e(C, null, {
|
|
302
|
-
default: () => [e(
|
|
300
|
+
default: () => [e(m, {
|
|
303
301
|
onClick: R,
|
|
304
302
|
type: "error",
|
|
305
303
|
block: !0
|
|
@@ -315,5 +313,5 @@ const y = ({
|
|
|
315
313
|
}
|
|
316
314
|
});
|
|
317
315
|
export {
|
|
318
|
-
|
|
316
|
+
tt as FlowSetting
|
|
319
317
|
};
|
|
@@ -45,9 +45,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
45
45
|
import "highlight.js/lib/languages/typescript";
|
|
46
46
|
import "highlight.js/lib/languages/xml";
|
|
47
47
|
import "@ant-design/colors";
|
|
48
|
-
import "
|
|
49
|
-
import "@unocss/preset-typography";
|
|
50
|
-
import "unocss/preset-wind4";
|
|
48
|
+
import "unocss";
|
|
51
49
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
52
50
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
53
51
|
import "vee-validate";
|
|
@@ -114,7 +112,7 @@ const f = /* @__PURE__ */ d({
|
|
|
114
112
|
})]);
|
|
115
113
|
}
|
|
116
114
|
});
|
|
117
|
-
function
|
|
115
|
+
function Vo() {
|
|
118
116
|
const {
|
|
119
117
|
t: o
|
|
120
118
|
} = l();
|
|
@@ -140,5 +138,5 @@ function Io() {
|
|
|
140
138
|
export {
|
|
141
139
|
c as EndNode,
|
|
142
140
|
f as EndNodeSetting,
|
|
143
|
-
|
|
141
|
+
Vo as getEndNodeRegistry
|
|
144
142
|
};
|
|
@@ -45,9 +45,7 @@ import "highlight.js/lib/languages/sql";
|
|
|
45
45
|
import "highlight.js/lib/languages/typescript";
|
|
46
46
|
import "highlight.js/lib/languages/xml";
|
|
47
47
|
import "@ant-design/colors";
|
|
48
|
-
import "
|
|
49
|
-
import "@unocss/preset-typography";
|
|
50
|
-
import "unocss/preset-wind4";
|
|
48
|
+
import "unocss";
|
|
51
49
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
52
50
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
53
51
|
import "vee-validate";
|
|
@@ -60,7 +58,7 @@ import "@vue-flow/background";
|
|
|
60
58
|
import "@iconify-json/tabler/icons.json";
|
|
61
59
|
import "../../posterEditor/elements/index.js";
|
|
62
60
|
import "fabric";
|
|
63
|
-
const
|
|
61
|
+
const eo = {};
|
|
64
62
|
export {
|
|
65
|
-
|
|
63
|
+
eo as defaultNodes
|
|
66
64
|
};
|