@duxweb/dvha-pro 1.1.11 → 1.1.13
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/editor/aiEditor.cjs +1 -1
- package/dist/cjs/components/form/formItem.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +1 -1
- package/dist/esm/components/editor/aiEditor.js +62 -54
- package/dist/esm/components/form/formItem.js +1 -1
- package/dist/esm/theme/uno.css.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),g=require("@duxweb/dvha-core"),U=require("@vueuse/core"),x=require("aieditor"),$=require("naive-ui");require("vue-router");require("@overlastic/vue");require("clsx");require("vue-echarts");require("vue3-ace-editor");require("ace-builds/src-noconflict/mode-vue");require("ace-builds/src-noconflict/mode-javascript");require("ace-builds/src-noconflict/mode-html");require("ace-builds/src-noconflict/mode-json");require("ace-builds/src-noconflict/mode-json5");require("ace-builds/src-noconflict/theme-tomorrow_night");require("ace-builds/src-noconflict/theme-tomorrow");require("ace-builds/src-noconflict/ext-searchbox");require("ace-builds/src-noconflict/ext-language_tools");require("ace-builds/src-noconflict/mode-snippets");require("vue-cropper");require("jinrishici");require("lodash-es");require("vue-draggable-plus");require("@vee-validate/i18n");require("colorizr");require("echarts");require("highlight.js/lib/core");require("highlight.js/lib/languages/bash");require("highlight.js/lib/languages/css");require("highlight.js/lib/languages/go");require("highlight.js/lib/languages/java");require("highlight.js/lib/languages/javascript");require("highlight.js/lib/languages/json");require("highlight.js/lib/languages/markdown");require("highlight.js/lib/languages/php");require("highlight.js/lib/languages/python");require("highlight.js/lib/languages/shell");require("highlight.js/lib/languages/sql");require("highlight.js/lib/languages/typescript");require("highlight.js/lib/languages/xml");require("@ant-design/colors");require("@unocss/preset-icons/browser");require("@unocss/preset-typography");require("unocss/preset-wind4");require("@vee-validate/i18n/dist/locale/en.json");require("@vee-validate/i18n/dist/locale/zh_CN.json");require("vee-validate");require("vue-command-palette");require("@duxweb/dvha-naiveui");require("../../pages/page404.cjs");require("short-unique-id");const E=require("../upload/config.cjs");require("@vue-flow/core");require("@vue-flow/background");;/* empty css */const L=require("../../hooks/modal.cjs");require("mime");require("@iconify-json/tabler/icons.json");require("../posterEditor/elements/index.cjs");require("fabric");require("dayjs");require("@tanstack/vue-query");require("pinia");const V=u.defineComponent({name:"DuxAiEditor",props:{value:String,defaultValue:String,uploadPath:String,uploadHeaders:Object,editorType:{type:String,default:"richtext"},aiPath:String,fileManager:{type:Boolean,default:!0},fileManagerType:{type:String,default:"all"},height:{type:String,default:"500px"},onUpdateValue:Function},setup(r,{emit:y,expose:k}){const o=u.ref();let a=null;k({get aiEditor(){return a}});let l=!1;const f=g.useTheme(),{config:v}=g.useManage(),M=g.useGetAuth(),{t:h}=g.useI18n(),C=$.useMessage(),b=L.useModal(),H=r.value??r.defaultValue??"",d=U.useVModel(r,"value",y),s=u.computed(()=>r.uploadPath||v.apiPath?.upload||"upload"),m=g.useUpload({path:s.value,autoUpload:!1}),{managePath:P,method:S}=E.useUploadConfig();u.watch(()=>r.value,e=>{!a||l||(r.editorType==="markdown"?a.setMarkdownContent(e||""):a.setContent(e||""))},{immediate:!0,flush:"post"});const q=e=>new Promise((t,n)=>{m.addFiles([e],"file").then(()=>{m.trigger().then(i=>{i.forEach(c=>{const p=c?.data?.data;t({errorCode:0,data:{src:p?.url,alt:c?.filename}})})}).catch(i=>{C.error(i.message),n(i)}).finally(()=>{m.clearFiles()})})}),T=e=>{const t=String(e?.filetype||""),n=String(e?.url||"");return/^image\//i.test(t)||/\.(?:png|jpe?g|gif|bmp|webp|svg)$/i.test(n)?"image":/^video\//i.test(t)||/\.(?:mp4|webm|ogg|mov|m4v)$/i.test(n)?"video":"attachment"};return u.onMounted(()=>{a=new x.AiEditor({theme:f.isDark.value?"dark":"light",element:o.value,placeholder:h("components.editor.placeholder"),content:H,contentIsMarkdown:r.editorType==="markdown",onChange:e=>{l=!0,d.value=r.editorType==="markdown"?e.getMarkdown():e.getHtml(),l=!1},onBlur:e=>{l=!0,d.value=r.editorType==="markdown"?e.getMarkdown():e.getHtml(),l=!1},image:{uploadUrl:s.value,uploadHeaders:r.uploadHeaders||{},uploader:q,defaultSize:"auto"},video:{uploadUrl:s.value,uploadHeaders:r.uploadHeaders||{},uploader:q},attachment:{uploadUrl:s.value,uploadHeaders:r.uploadHeaders||{},uploader:q},ai:{models:{custom:{url:r.aiPath||v.apiPath?.ai||"ai",headers:()=>({"Content-Type":"application/json",Authorization:M.token}),wrapPayload:e=>JSON.stringify({prompt:e}),parseMessage:e=>{const t=JSON.parse(e);return{role:"assistant",content:t.message,index:t.number,status:t.status}},protocol:"sse"}}},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",...r.fileManager?[{id:"dux-file-manager-image",tip:h("components.upload.fileManager"),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>',onClick:(e,t)=>{b.show({title:h("components.uploadManage.title")||h("components.upload.fileManager"),width:"800px",component:()=>Promise.resolve().then(()=>require("../upload/manager.cjs")),componentProps:{path:P.value,type:r.fileManagerType||"all",multiple:!0,uploadParams:{path:s.value,accept:"*/*",method:S.value}}}).then(n=>{n?.forEach?.(i=>{const c=T(i),p=i?.filename||"";if(c==="image")t.insert({type:"image",attrs:{src:i.url,alt:p,width:"auto"}});else if(c==="video")t.insert({type:"video",attrs:{src:i.url,controls:"true",width:350}});else{const w=i?.filename||i?.name||"file";r.editorType==="markdown"?t.insertMarkdown(`[${w}](${i.url})`):t.insert(`<a href="${i.url}" target="_blank">${w}</a>`)}})})}}]:[],"image","video","attachment","quote","container","code-block","table","divider","printer","fullscreen","ai"]}),d.value!=null&&(r.editorType==="markdown"?a.setMarkdownContent(d.value||""):a.setContent(d.value||""))}),u.onUnmounted(()=>{a?.destroy()}),u.watch(f.isDark,e=>{o.value&&(o.value.classList.remove("aie-theme-dark","aie-theme-light"),o.value.classList.add(e?"aie-theme-dark":"aie-theme-light"))},{immediate:!0}),()=>u.createVNode("div",{ref:o,style:`height: ${r.height}; width:100%`},null)}});exports.DuxAiEditor=V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),b=require("@vueuse/core"),x=require("naive-ui"),h=require("vee-validate"),y=t.defineComponent({name:"DuxFormItem",props:{label:String,description:[String,Object],tooltip:String,path:String,labelPlacement:{type:String},labelAlign:{type:String},labelWidth:{type:Number},required:{type:Boolean,default:!1},rule:[String,Object],message:[String,Object]},setup(e,{slots:d}){const n=t.toRef(e.message),c=t.computed(()=>typeof e.rule=="object"?{...e.rule,required:!!e.required}:typeof e.rule=="string"?e.rule?.includes("required")?e.rule:e.rule?`${e.rule}|required`:"required":e.rule),{errorMessage:u,value:o,setErrors:s,validate:f}=h.useField(e.path||"",c.value||{},{label:e.label}),v=t.computed(()=>e.required?!0:e.rule?typeof e.rule=="string"?e.rule.includes("required"):typeof e.rule=="object"?"required"in e.rule:!1:!1),i=t.computed(()=>u.value&&(n.value||u.value));t.watch(i,r=>{r&&s(r)},{immediate:!0}),b.watchThrottled(o,r=>{r&&f()},{throttle:300,deep:!0});const a=t.inject("dux.form",{labelPlacement:t.ref("left"),labelAlign:t.ref("left"),labelWidth:t.ref(70),divider:t.ref(!1)}),l=t.computed(()=>e.labelPlacement||a.labelPlacement.value),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),b=require("@vueuse/core"),x=require("naive-ui"),h=require("vee-validate"),y=t.defineComponent({name:"DuxFormItem",props:{label:String,description:[String,Object],tooltip:String,path:String,labelPlacement:{type:String},labelAlign:{type:String},labelWidth:{type:Number},required:{type:Boolean,default:!1},rule:[String,Object],message:[String,Object]},setup(e,{slots:d}){const n=t.toRef(e.message),c=t.computed(()=>typeof e.rule=="object"?{...e.rule,required:!!e.required}:typeof e.rule=="string"?e.rule?.includes("required")?e.rule:e.rule?`${e.rule}|required`:"required":e.rule),{errorMessage:u,value:o,setErrors:s,validate:f}=h.useField(e.path||"",c.value||{},{label:e.label}),v=t.computed(()=>e.required?!0:e.rule?typeof e.rule=="string"?e.rule.includes("required"):typeof e.rule=="object"?"required"in e.rule:!1:!1),i=t.computed(()=>u.value&&(n.value||u.value));t.watch(i,r=>{r&&s(r)},{immediate:!0}),b.watchThrottled(o,r=>{r&&f()},{throttle:300,deep:!0});const a=t.inject("dux.form",{labelPlacement:t.ref("left"),labelAlign:t.ref("left"),labelWidth:t.ref(70),divider:t.ref(!1)}),l=t.computed(()=>e.labelPlacement||a.labelPlacement.value),m=t.computed(()=>{let r=e.labelWidth||a.labelWidth.value||70;return typeof r=="number"&&(r=`${r}px`),l.value!=="left"?"auto":r}),g=t.computed(()=>a.divider.value||l.value==="page");return()=>t.createVNode("div",{class:[l.value!=="top"?"md:flex-row gap-2 lg:items-start":"gap-1",g.value?"py-6":"",l.value==="setting"?"md:justify-between md:items-start md:gap-4":"",l.value==="page"?"grid grid-cols-1 lg:grid-cols-4 px-4":"flex flex-col"]},[e.label&&t.createVNode("div",{class:[l.value==="left"?"flex lg:items-center lg:pt-1.5":"md:mb-1",l.value==="left"&&a.labelAlign.value==="right"?"justify-end":""],style:{width:m.value}},[t.createVNode("div",{class:"flex flex-col"},[t.createVNode("div",null,[t.createVNode("span",{class:"relative flex items-center gap-1"},[e.label,e.tooltip&&t.createVNode(x.NTooltip,{trigger:"hover"},{trigger:()=>t.createVNode("div",{class:"i-tabler:help size-4 text-muted"},null),default:()=>e.tooltip}),v.value&&t.createVNode("span",{class:"text-error font-mono text-xs"},[t.createTextVNode("*")])])]),e.description&&(l.value==="setting"||l.value==="page")&&t.createVNode("div",{class:"text-sm text-muted"},[e.description])])]),t.createVNode("div",{class:["flex flex-col gap-1 min-w-0",l.value==="setting"?"flex-none md:w-40%":"flex-1",l.value==="page"?"col-span-3":""]},[t.createVNode("div",{class:l.value==="setting"?"flex-1 lg:flex lg:justify-end":""},[d?.default?.()]),e.description&&(l.value==="left"||l.value==="top")&&t.createVNode("div",{class:"text-sm text-muted"},[e.description]),i.value&&t.createVNode("div",{class:"text-error"},[i.value])])])}});exports.DuxFormItem=y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=`/* layer: properties */
|
|
2
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-text-opacity:100%;--un-bg-opacity:100%;--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-
|
|
2
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-text-opacity:100%;--un-bg-opacity:100%;--un-from-opacity:100%;--un-shadow-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-ease:initial;--un-border-opacity:100%;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-to-opacity:100%;--un-outline-style:solid;--un-fill-opacity:100%;--un-space-y-reverse:initial;}}
|
|
3
3
|
@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
4
4
|
@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
5
5
|
@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
@@ -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 x, ref as U, computed as E, watch as w, onMounted as L, onUnmounted as V, createVNode as $ } from "vue";
|
|
2
|
+
import { useTheme as A, useManage as j, useGetAuth as D, useI18n as F, useUpload as z } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as B } from "@vueuse/core";
|
|
4
|
+
import { AiEditor as N } from "aieditor";
|
|
5
|
+
import { useMessage as O } from "naive-ui";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
8
|
import "clsx";
|
|
@@ -50,11 +50,11 @@ import "vue-command-palette";
|
|
|
50
50
|
import "@duxweb/dvha-naiveui";
|
|
51
51
|
import "../../pages/page404.js";
|
|
52
52
|
import "short-unique-id";
|
|
53
|
-
import { useUploadConfig as
|
|
53
|
+
import { useUploadConfig as Z } from "../upload/config.js";
|
|
54
54
|
import "@vue-flow/core";
|
|
55
55
|
import "@vue-flow/background";
|
|
56
56
|
/* empty css */
|
|
57
|
-
import { useModal as
|
|
57
|
+
import { useModal as I } from "../../hooks/modal.js";
|
|
58
58
|
import "mime";
|
|
59
59
|
import "@iconify-json/tabler/icons.json";
|
|
60
60
|
import "../posterEditor/elements/index.js";
|
|
@@ -62,7 +62,7 @@ import "fabric";
|
|
|
62
62
|
import "dayjs";
|
|
63
63
|
import "@tanstack/vue-query";
|
|
64
64
|
import "pinia";
|
|
65
|
-
const
|
|
65
|
+
const et = /* @__PURE__ */ x({
|
|
66
66
|
name: "DuxAiEditor",
|
|
67
67
|
props: {
|
|
68
68
|
value: String,
|
|
@@ -90,85 +90,93 @@ const Ye = /* @__PURE__ */ T({
|
|
|
90
90
|
onUpdateValue: Function
|
|
91
91
|
},
|
|
92
92
|
setup(t, {
|
|
93
|
-
emit: y
|
|
93
|
+
emit: y,
|
|
94
|
+
expose: k
|
|
94
95
|
}) {
|
|
95
|
-
const n =
|
|
96
|
-
let r = null
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
const n = U();
|
|
97
|
+
let r = null;
|
|
98
|
+
k({
|
|
99
|
+
get aiEditor() {
|
|
100
|
+
return r;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
let l = !1;
|
|
104
|
+
const g = A(), {
|
|
105
|
+
config: f
|
|
106
|
+
} = j(), M = D(), {
|
|
107
|
+
t: u
|
|
108
|
+
} = F(), C = O(), H = I(), b = t.value ?? t.defaultValue ?? "", d = B(t, "value", y), m = E(() => t.uploadPath || f.apiPath?.upload || "upload"), s = z({
|
|
109
|
+
path: m.value,
|
|
105
110
|
autoUpload: !1
|
|
106
111
|
}), {
|
|
107
|
-
managePath:
|
|
108
|
-
method:
|
|
109
|
-
} =
|
|
110
|
-
w(
|
|
111
|
-
!r ||
|
|
112
|
+
managePath: P,
|
|
113
|
+
method: S
|
|
114
|
+
} = Z();
|
|
115
|
+
w(() => t.value, (e) => {
|
|
116
|
+
!r || l || (t.editorType === "markdown" ? r.setMarkdownContent(e || "") : r.setContent(e || ""));
|
|
112
117
|
}, {
|
|
113
118
|
immediate: !0,
|
|
114
119
|
flush: "post"
|
|
115
120
|
});
|
|
116
121
|
const c = (e) => new Promise((o, a) => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
i.forEach((
|
|
120
|
-
const h =
|
|
122
|
+
s.addFiles([e], "file").then(() => {
|
|
123
|
+
s.trigger().then((i) => {
|
|
124
|
+
i.forEach((p) => {
|
|
125
|
+
const h = p?.data?.data;
|
|
121
126
|
o({
|
|
122
127
|
errorCode: 0,
|
|
123
128
|
data: {
|
|
124
129
|
src: h?.url,
|
|
125
|
-
alt:
|
|
130
|
+
alt: p?.filename
|
|
126
131
|
}
|
|
127
132
|
});
|
|
128
133
|
});
|
|
129
134
|
}).catch((i) => {
|
|
130
|
-
|
|
135
|
+
C.error(i.message), a(i);
|
|
131
136
|
}).finally(() => {
|
|
132
|
-
|
|
137
|
+
s.clearFiles();
|
|
133
138
|
});
|
|
134
139
|
});
|
|
135
|
-
}),
|
|
140
|
+
}), T = (e) => {
|
|
136
141
|
const o = String(e?.filetype || ""), a = String(e?.url || "");
|
|
137
142
|
return /^image\//i.test(o) || /\.(?:png|jpe?g|gif|bmp|webp|svg)$/i.test(a) ? "image" : /^video\//i.test(o) || /\.(?:mp4|webm|ogg|mov|m4v)$/i.test(a) ? "video" : "attachment";
|
|
138
143
|
};
|
|
139
144
|
return L(() => {
|
|
140
|
-
r = new
|
|
141
|
-
theme:
|
|
145
|
+
r = new N({
|
|
146
|
+
theme: g.isDark.value ? "dark" : "light",
|
|
142
147
|
element: n.value,
|
|
143
|
-
placeholder:
|
|
144
|
-
content:
|
|
148
|
+
placeholder: u("components.editor.placeholder"),
|
|
149
|
+
content: b,
|
|
145
150
|
contentIsMarkdown: t.editorType === "markdown",
|
|
151
|
+
onChange: (e) => {
|
|
152
|
+
l = !0, d.value = t.editorType === "markdown" ? e.getMarkdown() : e.getHtml(), l = !1;
|
|
153
|
+
},
|
|
146
154
|
onBlur: (e) => {
|
|
147
|
-
|
|
155
|
+
l = !0, d.value = t.editorType === "markdown" ? e.getMarkdown() : e.getHtml(), l = !1;
|
|
148
156
|
},
|
|
149
157
|
image: {
|
|
150
|
-
uploadUrl:
|
|
158
|
+
uploadUrl: m.value,
|
|
151
159
|
uploadHeaders: t.uploadHeaders || {},
|
|
152
160
|
uploader: c,
|
|
153
161
|
defaultSize: "auto"
|
|
154
162
|
},
|
|
155
163
|
video: {
|
|
156
|
-
uploadUrl:
|
|
164
|
+
uploadUrl: m.value,
|
|
157
165
|
uploadHeaders: t.uploadHeaders || {},
|
|
158
166
|
uploader: c
|
|
159
167
|
},
|
|
160
168
|
attachment: {
|
|
161
|
-
uploadUrl:
|
|
169
|
+
uploadUrl: m.value,
|
|
162
170
|
uploadHeaders: t.uploadHeaders || {},
|
|
163
171
|
uploader: c
|
|
164
172
|
},
|
|
165
173
|
ai: {
|
|
166
174
|
models: {
|
|
167
175
|
custom: {
|
|
168
|
-
url: t.aiPath ||
|
|
176
|
+
url: t.aiPath || f.apiPath?.ai || "ai",
|
|
169
177
|
headers: () => ({
|
|
170
178
|
"Content-Type": "application/json",
|
|
171
|
-
Authorization:
|
|
179
|
+
Authorization: M.token
|
|
172
180
|
}),
|
|
173
181
|
wrapPayload: (e) => JSON.stringify({
|
|
174
182
|
prompt: e
|
|
@@ -188,27 +196,27 @@ const Ye = /* @__PURE__ */ T({
|
|
|
188
196
|
},
|
|
189
197
|
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 ? [{
|
|
190
198
|
id: "dux-file-manager-image",
|
|
191
|
-
tip:
|
|
199
|
+
tip: u("components.upload.fileManager"),
|
|
192
200
|
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>',
|
|
193
201
|
onClick: (e, o) => {
|
|
194
|
-
|
|
195
|
-
title:
|
|
202
|
+
H.show({
|
|
203
|
+
title: u("components.uploadManage.title") || u("components.upload.fileManager"),
|
|
196
204
|
width: "800px",
|
|
197
205
|
component: () => import("../upload/manager.js"),
|
|
198
206
|
componentProps: {
|
|
199
|
-
path:
|
|
207
|
+
path: P.value,
|
|
200
208
|
type: t.fileManagerType || "all",
|
|
201
209
|
multiple: !0,
|
|
202
210
|
uploadParams: {
|
|
203
|
-
path:
|
|
211
|
+
path: m.value,
|
|
204
212
|
accept: "*/*",
|
|
205
|
-
method:
|
|
213
|
+
method: S.value
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
216
|
}).then((a) => {
|
|
209
217
|
a?.forEach?.((i) => {
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
218
|
+
const p = T(i), h = i?.filename || "";
|
|
219
|
+
if (p === "image")
|
|
212
220
|
o.insert({
|
|
213
221
|
type: "image",
|
|
214
222
|
attrs: {
|
|
@@ -217,7 +225,7 @@ const Ye = /* @__PURE__ */ T({
|
|
|
217
225
|
width: "auto"
|
|
218
226
|
}
|
|
219
227
|
});
|
|
220
|
-
else if (
|
|
228
|
+
else if (p === "video")
|
|
221
229
|
o.insert({
|
|
222
230
|
type: "video",
|
|
223
231
|
attrs: {
|
|
@@ -234,10 +242,10 @@ const Ye = /* @__PURE__ */ T({
|
|
|
234
242
|
});
|
|
235
243
|
}
|
|
236
244
|
}] : [], "image", "video", "attachment", "quote", "container", "code-block", "table", "divider", "printer", "fullscreen", "ai"]
|
|
237
|
-
}),
|
|
245
|
+
}), d.value != null && (t.editorType === "markdown" ? r.setMarkdownContent(d.value || "") : r.setContent(d.value || ""));
|
|
238
246
|
}), V(() => {
|
|
239
247
|
r?.destroy();
|
|
240
|
-
}), w(
|
|
248
|
+
}), w(g.isDark, (e) => {
|
|
241
249
|
n.value && (n.value.classList.remove("aie-theme-dark", "aie-theme-light"), n.value.classList.add(e ? "aie-theme-dark" : "aie-theme-light"));
|
|
242
250
|
}, {
|
|
243
251
|
immediate: !0
|
|
@@ -248,5 +256,5 @@ const Ye = /* @__PURE__ */ T({
|
|
|
248
256
|
}
|
|
249
257
|
});
|
|
250
258
|
export {
|
|
251
|
-
|
|
259
|
+
et as DuxAiEditor
|
|
252
260
|
};
|
|
@@ -81,7 +81,7 @@ const T = /* @__PURE__ */ h({
|
|
|
81
81
|
}, [S("*")])])]), e.description && (t.value === "setting" || t.value === "page") && l("div", {
|
|
82
82
|
class: "text-sm text-muted"
|
|
83
83
|
}, [e.description])])]), l("div", {
|
|
84
|
-
class: ["flex flex-col gap-1", t.value === "setting" ? "flex-none md:w-40%" : "flex-1", t.value === "page" ? "col-span-3" : ""]
|
|
84
|
+
class: ["flex flex-col gap-1 min-w-0", t.value === "setting" ? "flex-none md:w-40%" : "flex-1", t.value === "page" ? "col-span-3" : ""]
|
|
85
85
|
}, [l("div", {
|
|
86
86
|
class: t.value === "setting" ? "flex-1 lg:flex lg:justify-end" : ""
|
|
87
87
|
}, [s?.default?.()]), e.description && (t.value === "left" || t.value === "top") && l("div", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const r = `/* layer: properties */
|
|
2
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-text-opacity:100%;--un-bg-opacity:100%;--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-
|
|
2
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-text-opacity:100%;--un-bg-opacity:100%;--un-from-opacity:100%;--un-shadow-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-ease:initial;--un-border-opacity:100%;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-to-opacity:100%;--un-outline-style:solid;--un-fill-opacity:100%;--un-space-y-reverse:initial;}}
|
|
3
3
|
@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
4
4
|
@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
5
5
|
@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duxweb/dvha-pro",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.13",
|
|
5
5
|
"author": "DuxWeb",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ant-design/colors": "^7.2.1",
|
|
36
|
-
"@duxweb/dvha-core": "^1.1.
|
|
37
|
-
"@duxweb/dvha-naiveui": "^1.1.
|
|
36
|
+
"@duxweb/dvha-core": "^1.1.13",
|
|
37
|
+
"@duxweb/dvha-naiveui": "^1.1.13",
|
|
38
38
|
"@iconify-json/tabler": "^1.2.23",
|
|
39
39
|
"@overlastic/vue": "^0.8.3",
|
|
40
40
|
"@tanstack/vue-query": "^5.90.7",
|