@ibiz-template/vue3-components 0.7.41-alpha.4 → 0.7.41-alpha.6
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/ibiz-markdown-editor-V31Pwvs_.js +1 -0
- package/dist/index-2Djp0sQl.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-kEzIt0zV.js +1 -0
- package/dist/{xlsx-util-GVd_ca5q.js → xlsx-util-_VPcoWqm.js} +1 -1
- package/es/common/data-import2/data-import2.mjs +3 -2
- package/es/control/grid/grid/grid.css +1 -1
- package/es/editor/code/monaco-editor/monaco-editor.mjs +2 -8
- package/es/editor/html/wang-editor/wang-editor.mjs +5 -10
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +2 -2
- package/es/editor/text-box/input/input.mjs +2 -8
- package/es/editor/upload/use/use-iview-upload.mjs +3 -4
- package/es/util/app-util/app-util.mjs +2 -8
- package/es/util/notification-util/upload-manager/upload-manager.mjs +1 -5
- package/es/web-app/util/unauthorized-handler/unauthorized-handler.mjs +1 -1
- package/lib/common/data-import2/data-import2.cjs +2 -1
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +1 -7
- package/lib/editor/html/wang-editor/wang-editor.cjs +4 -9
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +2 -2
- package/lib/editor/text-box/input/input.cjs +1 -7
- package/lib/editor/upload/use/use-iview-upload.cjs +2 -3
- package/lib/util/app-util/app-util.cjs +1 -7
- package/lib/util/notification-util/upload-manager/upload-manager.cjs +1 -5
- package/lib/web-app/util/unauthorized-handler/unauthorized-handler.cjs +1 -1
- package/package.json +4 -4
- package/dist/ibiz-markdown-editor--ivCvp3a.js +0 -1
- package/dist/index-u5jvzY6s.js +0 -4
- package/dist/wang-editor--AXyy3P_.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["vue","@wangeditor/editor-for-vue","qx-util","ramda","@ibiz-template/vue3-util","@ibiz-template/core","@ibiz-template/runtime","element-plus","./index-u5jvzY6s.js","lodash-es","@floating-ui/dom","interactjs","dayjs","qs","vuedraggable","@wangeditor/editor","vue-router","@ibiz-template/devtool","axios","dayjs/plugin/customParseFormat","vue-i18n","@ibiz-template/model-helper"],(function(e,t){"use strict";var a,n,o,l,i,s,r,c,u,d,m,p,v,h,f,b,g,y,C,S,w,E,T,z,A,I,x;return{setters:[function(e){a=e.defineComponent,n=e.ref,o=e.shallowRef,l=e.watch,i=e.onBeforeUnmount,s=e.onMounted,r=e.nextTick,c=e.onUnmounted,u=e.createVNode,d=e.resolveComponent},function(e){m=e.Toolbar,p=e.Editor},function(e){v=e.createUUID},function(e){h=e.isNil},function(e){f=e.getHtmlProps,b=e.getEditorEmits,g=e.useNamespace,y=e.useUIStore},function(e){C=e.getAppCookie,S=e.CoreConst,w=e.awaitTimeout,E=e.StringUtil,T=e.IBizContext},function(e){z=e.UIActionUtil,A=e.SysUIActionTag},function(e){I=e.ElMessageBox},function(e){x=e.c},null,null,null,null,null,null,null,null,null,null,null,null,null],execute:function(){e("default",a({name:"IBizHtml",props:f(),emits:b(),setup(e,{emit:a}){const d=g("html"),f=e.controller,b=n(),U=n({});let F=null,k=0;const P=n(),R=o(),O=n(""),D=n({["".concat(ibiz.env.tokenHeader,"Authorization")]:"".concat(ibiz.env.tokenPrefix,"Bearer ").concat(C(S.TOKEN))}),H=n(""),N=n(""),M=n(!0),B=n(!1),L=n(!1),V=n(!1),j=n(!1),q=f.model;q.editorParams&&(q.editorParams.enableEdit&&(B.value=!0,L.value=!0,M.value=f.toBoolean(q.editorParams.enableEdit)&&!e.readonly&&!e.disabled),q.editorParams.enableFullScreen&&(V.value=f.toBoolean(q.editorParams.enableFullScreen))),e.readonly&&(B.value=!1,L.value=!0),l((()=>e.data),(e=>{if(e){const t=ibiz.util.file.calcFileUpDownUrl(f.context,f.params,e,f.editorParams);H.value=t.uploadUrl,N.value=t.downloadUrl}}),{immediate:!0,deep:!0});const K=(e,t)=>{if(t)return!0},J=e=>e,Q={excludeKeys:["group-video","emotion"],insertKeys:{index:60,keys:f.chatCompletion?["emoji","|","aichart"]:["emoji"]}},_={placeholder:f.placeHolder,readOnly:B.value?L.value:e.readonly,MENU_CONF:{uploadImage:{server:H.value,fieldName:"file",maxFileSize:10485760,maxNumberOfFiles:10,allowedFileTypes:[],headers:D.value,withCredentials:!0,onBeforeUpload:e=>e,onProgress(e){console.log("progress",e)},onSuccess(e,t){console.log("".concat(e.name," 上传成功"),t)},onFailed(e,t){console.log("".concat(e.name," 上传失败"),t)},onError(e,t,a){console.log("".concat(e.name," 上传出错"),t,a)},async customInsert(e,t){t(N.value.replace("%fileId%",e.id),e.filename,"")}},insertLink:{checkLink:K,parseLinkUrl:J},editLink:{checkLink:K,parseLinkUrl:J}}};let G;i((()=>{const e=R.value;null!=e&&e.destroy()}));const W=n=>{R.value=n,f.onCreated(R.value),n.setHtml(O.value),n.on("aiClick",(()=>{(async()=>{const n=f.model.appDataEntityId;if(!n||!f.deACMode)return;const{contentToolbarItems:o,footerToolbarItems:l,questionToolbarItems:i,otherToolbarItems:s}=x(f.deACMode),{zIndex:r}=y(),c=r.increment(),u=await t.import("@ibiz-template-plugin/ai-chat");G=u.chat||u.default.chat;let d,m="";G.create({containerOptions:{zIndex:c},chatOptions:{caption:f.deACMode.logicName,context:{...f.context},params:{...f.params,srfactag:f.deACMode.codeName},appDataEntityId:n,contentToolbarItems:o,footerToolbarItems:l,questionToolbarItems:i,otherToolbarItems:s,appendCurData:"true"===f.editorParams.srfaiappendcurdata?e.data:void 0,appendCurContent:f.editorParams.srfaiappendcurcontent?E.fill(f.editorParams.srfaiappendcurcontent,f.context,f.params,e.data):void 0,question:async(e,t,a,n,o)=>{m=v(),d=new AbortController;const l=await ibiz.hub.getApp(t.srfappid).deService.getService(t,n.appDataEntityId);try{await l.aiChatSse((t=>{if(20===t.actionstate&&t.actionresult)e.addMessage({messageid:m,state:t.actionstate,type:"DEFAULT",role:"ASSISTANT",content:t.actionresult});else if(30===t.actionstate&&t.actionresult){const a=JSON.parse(t.actionresult).choices;a&&a.length>0&&e.replaceMessage({messageid:m,state:t.actionstate,type:"DEFAULT",role:"ASSISTANT",content:a[0].content||""})}else 40===t.actionstate&&e.replaceMessage({messageid:m,state:t.actionstate,type:"ERROR",role:"ASSISTANT",content:t.actionresult})}),d,t,a,{messages:o})}catch(t){e.replaceMessage({messageid:m,state:40,type:"ERROR",role:"ASSISTANT",content:t.message||ibiz.i18n.t("app.aiError")}),null==d||d.abort()}finally{return e.completeMessage(m,!0),!0}},abortQuestion:async e=>{null==d||d.abort(),await e.stopMessage({messageid:m,state:30,type:"DEFAULT",role:"ASSISTANT",content:""}),await e.completeMessage(m,!0)},action:(e,t)=>{"backfill"===e&&(B.value?O.value=t.realcontent||"":a("change",t.realcontent))},history:async(e,t,a)=>{const n=await ibiz.hub.getApp(e.srfappid).deService.getService(e,a.appDataEntityId),o=a.appendCurData?a.appendCurData:{},l=await n.aiChatHistory(e,t,o);if(l.data&&Array.isArray(l.data)){let e;l.data.forEach((t=>{if("TOOL"===t.role)e&&t.content&&G.aiChat.updateRecommendPrompt(e,t.content);else{const a={messageid:v(),state:30,type:"DEFAULT",role:t.role,content:t.content,completed:!0};e=a,G.aiChat.addMessage(a)}}))}return!0},recommendPrompt:async(e,t,a)=>{const n=await ibiz.hub.getApp(e.srfappid).deService.getService(e,a.appDataEntityId),o=await n.aiChatRecommendPrompt(e,t,a.message);if(o.ok&&o.data){const e=o.data.choices;return e&&e.length>0?e[0]:null}return null},uploader:{onUpload:async(e,t,a)=>{const n=ibiz.util.file.calcFileUpDownUrl((null==a?void 0:a.context)||f.context,(null==a?void 0:a.params)||f.params,{}),o={},l=C(S.TOKEN);l&&Object.assign(o,{["".concat(ibiz.env.tokenHeader,"Authorization")]:"".concat(ibiz.env.tokenPrefix,"Bearer ").concat(l)});const i=new FormData;return i.append("file",e),(await ibiz.net.axios({url:n.uploadUrl,method:"post",headers:o,data:i,onUploadProgress:e=>{const a=e.loaded/e.total*100;t(a)}})).data}},extendToolbarClick:async(e,t,a,n,o)=>{var l,i;const s=await z.exec(t.id,{view:f.view,ctrl:f.ctrl,context:T.create(a),params:n,data:[o],event:e},t.appId);if(s.closeView)f.view.closeView({ok:!0});else if(s.refresh)switch(s.refreshMode){case 1:f.view.callUIAction(A.REFRESH);break;case 2:null==(l=f.view.parentView)||l.callUIAction(A.REFRESH);break;case 3:null==(i=f.view.getTopView())||i.callUIAction(A.REFRESH)}return s}}})})()}))},X=t=>{const n=t.getHtml(),o="<p><br></p>"===n?"":n;o===e.value||""===o&&h(e.value)||!B.value&&t.isFocused()&&a("change",o)},Y=e=>{},Z=e=>{a("focus")},$=e=>{a("blur")},ee=(e,t)=>{alert("【".concat(ibiz.i18n.t("editor.html.wangEditor.customTips"),"】").concat(t," - ").concat(e))},te=(e,t,a)=>{a(!0)},ae=()=>{const e=R.value;null!=e&&e.disable()},ne=()=>{const e=R.value;null!=e&&e.enable()};s((()=>{l((()=>e.value),((t,a)=>{t===a||"string"!=typeof e.value&&null!=t||r(null==t?()=>{O.value=""}:()=>{O.value=t})}),{immediate:!0}),l((()=>e.disabled),((e,t)=>{e!==t&&(!0===e?ae():ne())}),{immediate:!0})}));const oe=()=>{L.value=!L.value,L.value?ae():(ne(),R.value.focus(),(()=>{var t,a;if(e.value){const n=e.value.indexOf("</p>");if(n>=0){const e=null==(t=R.value.selection.anchor)?void 0:t.offset,o=null==(a=R.value.selection.anchor)?void 0:a.path;0===e&&o.length>0&&0===o[0]&&R.value.move(n-3)}}})())},le=()=>{j.value=!j.value,r((()=>{L.value?ae():(ne(),R.value.focus())}))};return s((()=>{w(0,(()=>{if(b.value&&P.value){const e=b.value.offsetHeight;F=new ResizeObserver((t=>{const a=t[0].contentRect.height;if(a!==k){const n={height:"".concat(e-t[0].contentRect.height+(0!==a?300:0),"px")};U.value=d.cssVarBlock(n),k=a}})),F.observe(P.value.selector)}}))})),c((()=>{f.onDestroyed(),F&&F.disconnect(),G&&G.close()})),{ns:d,editorRef:R,mode:"default",valueHtml:O,toolbarConfig:Q,editorConfig:_,handleCreated:W,handleChange:X,handleDestroyed:Y,handleFocus:Z,handleBlur:$,customAlert:ee,customPaste:te,insertText:e=>{const t=R.value;null!=t&&t.insertText(e)},printHtml:()=>{const e=R.value;null!=e&&console.log(e.getHtml())},disable:ae,enable:ne,renderHeaserToolbar:()=>B.value||V.value?u("div",{class:d.b("custom-toolbar")},[B.value&&M.value&&L.value?u("i",{class:"fa fa-edit","aria-hidden":"true",title:ibiz.i18n.t("editor.html.enableedit"),onClick:()=>oe()},null):null,V.value?j.value?u("i",{class:"fa fa-compress","aria-hidden":"true",title:ibiz.i18n.t("editor.html.reduce"),onClick:()=>le()},null):u("i",{class:"fa fa-expand","aria-hidden":"true",title:ibiz.i18n.t("editor.html.expand"),onClick:()=>le()},null):null]):null,renderEditorContent:()=>u("div",{class:d.b("content"),ref:"htmlContent",style:U.value},[u(m,{ref:"toolbarRef",editor:R.value,"default-config":Q,mode:"default",class:d.b("toolbar")},null),u(p,{class:[d.b("editor"),d.is("readonly",L.value)],modelValue:O.value,"onUpdate:modelValue":e=>O.value=e,"default-config":_,mode:"default",onOnCreated:W,onOnChange:X,onOnDestroyed:Y,onOnFocus:Z,onOnBlur:$,oncustomAlert:ee,oncustomPaste:te},null)]),renderFooter:()=>B.value?u("div",{class:[d.b("footer"),{[d.b("footer-dialog")]:j.value}]},[u("div",{class:d.be("footer","cancel"),onClick:()=>{e.value!==O.value?I({title:ibiz.i18n.t("editor.common.confirmCancel"),type:"warning",customClass:d.b("message"),message:u("div",{class:d.be("message","message-content")},[u("p",null,[ibiz.i18n.t("editor.common.confirmCancelPrompt")]),u("p",{class:d.bem("message","message-content","message-tip")},[ibiz.i18n.t("editor.common.cancelEditPrompt")])]),showCancelButton:!0,cancelButtonClass:d.be("message","message-cancel"),confirmButtonClass:d.be("message","message-comfire")}).then((()=>{O.value=e.value||"",oe()})).catch((()=>{R.value.focus()})):oe()}},[ibiz.i18n.t("app.cancel")]),u("div",{class:d.be("footer","save"),onClick:()=>(()=>{L.value=!0,R.value.disable();const e=O.value;a("change",e),j.value&&(j.value=!1)})()},[ibiz.i18n.t("app.save")])]):null,htmlContent:b,hasEnableEdit:B,cssVars:U,toolbarRef:P,isFullScreen:j,readonlyState:L,changeFullScreenState:le}},render(){return this.isFullScreen?u(d("el-dialog"),{modelValue:this.isFullScreen,"onUpdate:modelValue":e=>this.isFullScreen=e,width:"80%",top:"10vh",class:this.ns.b("dialog-full-screen"),onClose:()=>this.changeFullScreenState()},{default:()=>[u("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState}]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])]}):u("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState},this.ns.is("show-ai",!0)]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])}}))}}}));
|