@duxweb/dvha-pro 1.1.11 → 1.1.12

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),c=require("@duxweb/dvha-core"),T=require("@vueuse/core"),U=require("aieditor"),x=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 $=require("../upload/config.cjs");require("@vue-flow/core");require("@vue-flow/background");;/* empty css */const E=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 L=a.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}){const o=a.ref();let u=null,q=!1;const f=c.useTheme(),{config:v}=c.useManage(),k=c.useGetAuth(),{t:h}=c.useI18n(),M=x.useMessage(),C=E.useModal(),b=r.value??r.defaultValue??"",l=T.useVModel(r,"value",y,{passive:!0}),d=a.computed(()=>r.uploadPath||v.apiPath?.upload||"upload"),g=c.useUpload({path:d.value,autoUpload:!1}),{managePath:H,method:P}=$.useUploadConfig();a.watch(l,e=>{!u||q||(r.editorType==="markdown"?u.setMarkdownContent(e||""):u.setContent(e||""))},{immediate:!0,flush:"post"});const m=e=>new Promise((t,n)=>{g.addFiles([e],"file").then(()=>{g.trigger().then(i=>{i.forEach(s=>{const p=s?.data?.data;t({errorCode:0,data:{src:p?.url,alt:s?.filename}})})}).catch(i=>{M.error(i.message),n(i)}).finally(()=>{g.clearFiles()})})}),S=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 a.onMounted(()=>{u=new U.AiEditor({theme:f.isDark.value?"dark":"light",element:o.value,placeholder:h("components.editor.placeholder"),content:b,contentIsMarkdown:r.editorType==="markdown",onBlur:e=>{q=!0,l.value=r.editorType==="markdown"?e.getMarkdown():e.getHtml(),q=!1},image:{uploadUrl:d.value,uploadHeaders:r.uploadHeaders||{},uploader:m,defaultSize:"auto"},video:{uploadUrl:d.value,uploadHeaders:r.uploadHeaders||{},uploader:m},attachment:{uploadUrl:d.value,uploadHeaders:r.uploadHeaders||{},uploader:m},ai:{models:{custom:{url:r.aiPath||v.apiPath?.ai||"ai",headers:()=>({"Content-Type":"application/json",Authorization:k.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)=>{C.show({title:h("components.uploadManage.title")||h("components.upload.fileManager"),width:"800px",component:()=>Promise.resolve().then(()=>require("../upload/manager.cjs")),componentProps:{path:H.value,type:r.fileManagerType||"all",multiple:!0,uploadParams:{path:d.value,accept:"*/*",method:P.value}}}).then(n=>{n?.forEach?.(i=>{const s=S(i),p=i?.filename||"";if(s==="image")t.insert({type:"image",attrs:{src:i.url,alt:p,width:"auto"}});else if(s==="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"]}),l.value!=null&&(r.editorType==="markdown"?u.setMarkdownContent(l.value||""):u.setContent(l.value||""))}),a.onUnmounted(()=>{u?.destroy()}),a.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}),()=>a.createVNode("div",{ref:o,style:`height: ${r.height}; width:100%`},null)}});exports.DuxAiEditor=L;
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,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-shadow-opacity:100%;--un-border-opacity:100%;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-ease:initial;--un-to-opacity:100%;--un-fill-opacity:100%;--un-outline-style:solid;--un-space-y-reverse:initial;}}
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-shadow-opacity:100%;--un-border-opacity:100%;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-ease: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 T, ref as x, computed as U, watch as w, onMounted as L, onUnmounted as V, createVNode as $ } from "vue";
2
- import { useTheme as E, useManage as A, useGetAuth as j, useI18n as D, useUpload as F } from "@duxweb/dvha-core";
3
- import { useVModel as z } from "@vueuse/core";
4
- import { AiEditor as B } from "aieditor";
5
- import { useMessage as N } from "naive-ui";
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 O } from "../upload/config.js";
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 Z } from "../../hooks/modal.js";
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 Ye = /* @__PURE__ */ T({
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 = x();
96
- let r = null, s = !1;
97
- const f = E(), {
98
- config: g
99
- } = A(), k = j(), {
100
- t: p
101
- } = D(), M = N(), C = Z(), H = t.value ?? t.defaultValue ?? "", l = z(t, "value", y, {
102
- passive: !0
103
- }), d = U(() => t.uploadPath || g.apiPath?.upload || "upload"), u = F({
104
- path: d.value,
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: b,
108
- method: P
109
- } = O();
110
- w(l, (e) => {
111
- !r || s || (t.editorType === "markdown" ? r.setMarkdownContent(e || "") : r.setContent(e || ""));
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
- u.addFiles([e], "file").then(() => {
118
- u.trigger().then((i) => {
119
- i.forEach((m) => {
120
- const h = m?.data?.data;
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: m?.filename
130
+ alt: p?.filename
126
131
  }
127
132
  });
128
133
  });
129
134
  }).catch((i) => {
130
- M.error(i.message), a(i);
135
+ C.error(i.message), a(i);
131
136
  }).finally(() => {
132
- u.clearFiles();
137
+ s.clearFiles();
133
138
  });
134
139
  });
135
- }), S = (e) => {
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 B({
141
- theme: f.isDark.value ? "dark" : "light",
145
+ r = new N({
146
+ theme: g.isDark.value ? "dark" : "light",
142
147
  element: n.value,
143
- placeholder: p("components.editor.placeholder"),
144
- content: H,
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
- s = !0, l.value = t.editorType === "markdown" ? e.getMarkdown() : e.getHtml(), s = !1;
155
+ l = !0, d.value = t.editorType === "markdown" ? e.getMarkdown() : e.getHtml(), l = !1;
148
156
  },
149
157
  image: {
150
- uploadUrl: d.value,
158
+ uploadUrl: m.value,
151
159
  uploadHeaders: t.uploadHeaders || {},
152
160
  uploader: c,
153
161
  defaultSize: "auto"
154
162
  },
155
163
  video: {
156
- uploadUrl: d.value,
164
+ uploadUrl: m.value,
157
165
  uploadHeaders: t.uploadHeaders || {},
158
166
  uploader: c
159
167
  },
160
168
  attachment: {
161
- uploadUrl: d.value,
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 || g.apiPath?.ai || "ai",
176
+ url: t.aiPath || f.apiPath?.ai || "ai",
169
177
  headers: () => ({
170
178
  "Content-Type": "application/json",
171
- Authorization: k.token
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: p("components.upload.fileManager"),
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
- C.show({
195
- title: p("components.uploadManage.title") || p("components.upload.fileManager"),
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: b.value,
207
+ path: P.value,
200
208
  type: t.fileManagerType || "all",
201
209
  multiple: !0,
202
210
  uploadParams: {
203
- path: d.value,
211
+ path: m.value,
204
212
  accept: "*/*",
205
- method: P.value
213
+ method: S.value
206
214
  }
207
215
  }
208
216
  }).then((a) => {
209
217
  a?.forEach?.((i) => {
210
- const m = S(i), h = i?.filename || "";
211
- if (m === "image")
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 (m === "video")
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
- }), l.value != null && (t.editorType === "markdown" ? r.setMarkdownContent(l.value || "") : r.setContent(l.value || ""));
245
+ }), d.value != null && (t.editorType === "markdown" ? r.setMarkdownContent(d.value || "") : r.setContent(d.value || ""));
238
246
  }), V(() => {
239
247
  r?.destroy();
240
- }), w(f.isDark, (e) => {
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
- Ye as DuxAiEditor
259
+ et as DuxAiEditor
252
260
  };
@@ -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-shadow-opacity:100%;--un-border-opacity:100%;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-ease:initial;--un-to-opacity:100%;--un-fill-opacity:100%;--un-outline-style:solid;--un-space-y-reverse:initial;}}
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-shadow-opacity:100%;--un-border-opacity:100%;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-ease: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.11",
4
+ "version": "1.1.12",
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.11",
37
- "@duxweb/dvha-naiveui": "^1.1.11",
36
+ "@duxweb/dvha-core": "^1.1.12",
37
+ "@duxweb/dvha-naiveui": "^1.1.12",
38
38
  "@iconify-json/tabler": "^1.2.23",
39
39
  "@overlastic/vue": "^0.8.3",
40
40
  "@tanstack/vue-query": "^5.90.7",