@ibiz-template/vue3-components 0.7.41-alpha.40 → 0.7.41-alpha.41
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-DEV-iSvz.js +1 -0
- package/dist/index-Bv2fgePf.js +11 -0
- package/dist/{index-BewO9StC.js → index-CD2XM6M6.js} +1 -1
- package/dist/{index-ClxO69TM.js → index-CaWTEUU1.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-4cNAgOaJ.js +1 -0
- package/dist/{xlsx-util-Cg5zMYCC.js → xlsx-util-Dvg2kWh7.js} +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.mjs +2 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.mjs +12 -2
- package/es/editor/code/monaco-editor/monaco-editor.mjs +41 -32
- package/es/editor/html/wang-editor/config/index.mjs +3 -0
- package/es/editor/html/wang-editor/config/toolbar.mjs +90 -0
- package/es/editor/html/wang-editor/constants/svg.mjs +8 -0
- package/es/editor/html/wang-editor/wang-editor.css +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +52 -39
- package/es/editor/markdown/ibiz-markdown-editor/custom-menu.mjs +264 -2
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +38 -6
- package/es/editor/markdown/ibiz-markdown-editor/render-util.mjs +33 -4
- package/es/editor/text-box/input/input.mjs +41 -32
- package/es/index.mjs +1 -1
- package/es/locale/en/index.mjs +3 -1
- package/es/locale/zh-CN/index.mjs +3 -1
- package/es/util/ai-chat-util/ai-chat-util.mjs +216 -0
- package/es/util/app-util/app-util.mjs +20 -48
- package/es/util/index.mjs +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/icon.mjs +75 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +136 -43
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.mjs +130 -48
- package/es/util/inline-ai-util/inline-ai-util.mjs +2 -1
- package/es/web-app/main.mjs +2 -0
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.cjs +12 -2
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.cjs +2 -1
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +40 -31
- package/lib/editor/html/wang-editor/config/index.cjs +7 -0
- package/lib/editor/html/wang-editor/config/toolbar.cjs +92 -0
- package/lib/editor/html/wang-editor/constants/svg.cjs +14 -0
- package/lib/editor/html/wang-editor/wang-editor.cjs +51 -38
- package/lib/editor/html/wang-editor/wang-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/custom-menu.cjs +264 -2
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +38 -6
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/render-util.cjs +33 -4
- package/lib/editor/text-box/input/input.cjs +40 -31
- package/lib/index.cjs +2 -2
- package/lib/locale/en/index.cjs +3 -1
- package/lib/locale/zh-CN/index.cjs +3 -1
- package/lib/util/ai-chat-util/ai-chat-util.cjs +218 -0
- package/lib/util/app-util/app-util.cjs +19 -47
- package/lib/util/index.cjs +2 -2
- package/lib/util/inline-ai-util/inline-ai-textarea/icon.cjs +78 -0
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.cjs +129 -47
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +135 -42
- package/lib/util/inline-ai-util/inline-ai-util.cjs +2 -1
- package/lib/web-app/main.cjs +2 -0
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-CxFS8frQ.js +0 -1
- package/dist/index-2eZnbrr4.js +0 -11
- package/dist/wang-editor-BPl509oX.js +0 -1
- package/es/util/ai-util/ai-util.mjs +0 -68
- package/lib/util/ai-util/ai-util.cjs +0 -71
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["vue","@ibiz-template/vue3-util","qx-util","cherry-markdown"],function(e){"use strict";var t,l,n,i,o,r,a,s,d,c,u,m,v,h,f;return{setters:[function(e){t=e.nextTick,l=e.ref,n=e.onBeforeUnmount,i=e.createVNode,o=e.resolveComponent,r=e.defineComponent,a=e.watch,s=e.onMounted,d=e.onUnmounted},function(e){c=e.getEditorEmits,u=e.getMarkDownProps,m=e.useNamespace,v=e.useUIStore},function(e){h=e.createUUID},function(e){f=e.default}],execute:function(){function p(e){const r=l(""),a=l([]),s=l();let d=null;const c=e=>{"Escape"!==e.key&&27!==e.keyCode||(e.stopPropagation(),e.preventDefault(),a.value=[],m())},u=async()=>{var e;await t();const l=null==(e=s.value)?void 0:e.$refs.container;if(!l)return;const n=l.querySelector(".el-image-viewer__wrapper");null==n||n.addEventListener("keydown",c)},m=()=>{var e;const t=null==(e=s.value)?void 0:e.$refs.container;if(!t)return;const l=t.querySelector(".el-image-viewer__wrapper");null==l||l.removeEventListener("keydown",c)},v=e=>{var l;const n=null==(l=null==e?void 0:e.target)?void 0:l.src;var i,o;i=null==e?void 0:e.target,o="IMG",i&&1===i.nodeType&&i.nodeName===o&&n&&(async e=>{var l;if(r.value=e,a.value=[e],await t(),s.value){const{container:e}=s.value.$refs;e&&(null==(l=e.children[0])||l.click())}})(n)};return n(()=>{d&&(d.removeEventListener("click",v),d=null),m()}),{renderImgPreview:()=>i(o("el-image"),{class:e.e("img-preview"),ref:s,"zoom-rate":1.1,src:r.value,"preview-src-list":a.value,"hide-on-click-modal":!0,onShow:u,fit:"cover"},null),onMDEditorCreated:e=>{var t,l;d=(null==(l=null==(t=null==e?void 0:e.previewer)?void 0:t.previewerBubble)?void 0:l.previewerDom)||null,null==d||d.addEventListener("click",v)}}}e("default",r({name:"IBizMarkDown",props:u(),emits:c(),setup(e,{emit:o,slots:r}){var c,u,b;const g=m("markdown"),w=e.controller,k=l("");let y=null;const C=h(),[M]=function(e){return[f.createMenuHook("AI",{icon:{type:"svg",content:"<svg\n viewBox='0 0 16 16'\n xmlns='http://www.w3.org/2000/svg'\n fill='currentColor'\n height='1em'\n width='1em'\n preserveAspectRatio='xMidYMid meet'\n focusable='false'\n >\n <g\n id='aae1.Base基础/1.icon图标/2.normal/ai-star'\n stroke-width='1'\n fill-rule='evenodd'\n >\n <path\n d='M5.817 1.53l3.158 8.797h.054v.152l1.443 4.021-1.402.001-1.041-2.982H2.495l-1.03 2.982L0 14.5 4.671 1.533l1.146-.003zm7.86 5.424V14.5h-1.213V6.954h1.212zM5.248 3.549l-2.342 6.778h4.706L5.249 3.55zM13.046 0c.075 0 .147.02.204.071a.318.318 0 01.094.181l.064.273c.097.417.17.727.255.968.084.24.177.4.31.523.134.124.318.218.599.306.281.088.65.166 1.15.265a.358.358 0 01.195.095c.056.057.083.13.083.213a.289.289 0 01-.083.21.362.362 0 01-.197.094c-.528.093-.918.167-1.214.255-.295.088-.485.187-.621.324-.137.138-.23.324-.31.606-.08.283-.145.651-.23 1.147a.329.329 0 01-.093.184.293.293 0 01-.206.075.308.308 0 01-.207-.072.322.322 0 01-.1-.188l-.006-.033c-.085-.486-.149-.845-.228-1.12-.079-.274-.17-.452-.305-.585-.135-.133-.323-.23-.618-.32s-.683-.168-1.21-.273a.353.353 0 01-.2-.096.29.29 0 01-.08-.208c0-.079.023-.153.079-.211a.35.35 0 01.2-.097c.5-.098.869-.176 1.15-.263.282-.087.465-.18.597-.302.132-.12.224-.278.306-.511.082-.236.151-.539.244-.947l.071-.312a.312.312 0 01.102-.183.311.311 0 01.205-.069z'\n id='aae形状结合'\n ></path>\n </g>\n </svg>\n "},onClick:(l,n,i)=>{i.stopPropagation(),i.preventDefault(),t(()=>{var t;if(null==(t=e.mdeditor)?void 0:t.bubble){e.mdeditor.bubble.showBubble();const t=e.mdeditor.bubble.bubbleDom.getBoundingClientRect();if(!t||!t.left||!t.top)return;const l=ibiz.inLineAIUtil.calcContextMenus(e.deACMode,t=>{e.doInLineAIUIAction(t,e.model.appId)});if(0===l.length)return;ibiz.inLineAIUtil.showContextMenus(t.left,t.top+43,l)}})}})]}(w),{onMDEditorCreated:x,renderImgPreview:z}=p(g),E=ibiz.util.file.getUploadHeaders(),I=l({...E}),D=l(""),P=(null==(c=null==w?void 0:w.editorParams)?void 0:c.customTheme)||(null==(u=null==w?void 0:w.editorParams)?void 0:u.customtheme),{UIStore:T}=v(),U=l(P||T.theme),B=l(!1);let S="default";w&&(null==(b=w.editorParams)?void 0:b.showmode)&&(S=w.editorParams.showmode);const L=l(!1),A=l("editOnly");let N=null,O=0;const H=l({}),V=l("full");let q=!1;a(()=>e.data,e=>{if(e&&w){const t={...w.editorParams};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams));const l=ibiz.util.file.calcFileUpDownUrl(w.context,w.params,e,t);D.value=l.uploadUrl}},{immediate:!0,deep:!0});const R=l(),F=async(t,l)=>{const n=await ibiz.util.file.fileUpload(D.value,t,I.value),i=((e,t)=>{if(!w)return"";const l={...w.editorParams};return l.exportparams&&(l.exportParams=JSON.parse(l.exportparams)),t&&t.folder&&(l.osscat=t.folder),ibiz.util.file.calcFileUpDownUrl(w.context,w.params,e,l).downloadUrl})(e.data||{},n.fileid);let o=i.replace("%fileId%",n.fileid);if(ibiz.config.common.enableDownloadTicket&&w){const t=await ibiz.util.file.getDownloadTicket(w.context,w.params,e.data||{},{fileId:n.fileid},w.downloadTicketParams);t&&t.ticket&&(o=i.replace("%fileId%",t.ticket),l(o))}else l(o)},$=()=>null==y?void 0:y.getMarkdown(),_=e=>{q=!0,null==y||y.setMarkdown(e,!0)};a(()=>e.value,(e,t)=>{e!==t&&(k.value=e||"")},{immediate:!0}),a(k,(e,t)=>{const l=$();e!==t&&l!==e&&_(e)});const j=e=>{"manual"!==S&&(o("change",$(),null==w?void 0:w.model.id,q),q=!1)},J=(e,t)=>({[e]:t}),W=(e,t="")=>{const l=document.createElement(e);return l.className=t,l},G=e=>W("i","ch-icon ch-icon-".concat(e)),Y=g.e("fullscreen"),K=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},Q=()=>{if(y&&R.value){const e=y.editor.options.editorDom.parentElement;if(!e)return{};const t=e.classList,l=R.value.querySelector(".".concat(Y));return l?{parentElement:e,cherryClass:t,fullscreenNode:l}:{}}return{}},X=()=>{const{parentElement:e,cherryClass:t,fullscreenNode:l}=Q();e&&t&&l&&(K(l),l.appendChild(G("fullscreen")),l.title=ibiz.i18n.t("editor.common.fullscreen"),t.remove("fullscreen"),null==e||e.blur(),e.setAttribute("tabindex","-1"))},Z=()=>{const{cherryClass:e}=Q();return null==e?void 0:e.contains("fullscreen")},ee=()=>{y&&R.value&&(Z()?(X(),y.toggleToc(V.value),L.value=!1):((()=>{const{parentElement:e,cherryClass:l,fullscreenNode:n}=Q();e&&l&&n&&(K(n),n.appendChild(G("minscreen")),l.add("fullscreen"),n.title=ibiz.i18n.t("editor.common.minimize"),e.setAttribute("tabindex","-1"),t(()=>null==e?void 0:e.focus()))})(),V.value=y.toc.model,y.toggleToc("full"),L.value=!0))},te=e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),Z()&&(X(),y.toggleToc(V.value),L.value=!1))},le=e=>{null==w||w.setCurrentEditorTheme(e)},ne=e=>{var t,l;const{info:n}=e;let i=!0;const o=n.ranges&&n.ranges[0];if(o){const{anchor:e,head:t}=o;i=w.isPositionBefore(e,t)}else i=!0;const r=null==(t=w.mdeditor)?void 0:t.editor.editor.getCursor("start"),a=null==(l=w.mdeditor)?void 0:l.editor.editor.getCursor("end");w.setCursorPos(r,a),w.setSelectionDirection(i)};a(()=>T.theme,e=>{U.value=P||e,null==y||y.setTheme(U.value),null==y||y.setCodeBlockTheme(U.value)});const ie=()=>{B.value=!0,A.value="editOnly",null==y||y.switchModel(A.value)},oe=()=>{B.value=!1,A.value="previewOnly",null==y||y.switchModel(A.value)},re=()=>{_(k.value),oe()},ae=()=>{o("change",$(),null==w?void 0:w.model.id,q),q=!1,oe()},se=()=>{const e=document.getElementById(C);null==e||e.focus()};return s(()=>{var l;(e.disabled||e.readonly||"manual"===S)&&(A.value="previewOnly"),t(()=>{var t;const l=["bold","italic","underline","strikethrough","sub","sup","|","size","color"];w&&w.chatCompletion&&l.unshift("AI"),y=new f({id:C,value:k.value,previewer:{enablePreviewerBubble:!(e.disabled||e.readonly)},themeSettings:{mainTheme:U.value,codeBlockTheme:U.value},fileUpload:F,emoji:{useUnicode:!0},header:{anchorStyle:"autonumber"},editor:{height:"100%",defaultModel:A.value,codemirror:{autofocus:!1}},toolbars:{toolbar:["bold","italic","underline","strikethrough","|","color","header","|","list","image",{insert:["link","hr","br","code","formula","toc","table","line-table","bar-table"]},"settings","togglePreview"],bubble:l,float:["h1","h2","h3","|","checklist","quote","quickTable","code"],customMenu:{AI:M},sidebar:["theme","copy"],toolbarRight:[],toc:{updateLocationHash:!1,defaultModel:"pure",showAutoNumber:!0,position:"absolute",cssText:""}},callback:{afterChange:j,beforeImageMounted:J},event:{changeMainTheme:le,selectionChange:ne},engine:{syntax:{table:{enableChart:!1,externals:["echarts"]}}}}),y.setTheme(U.value),P&&(y.setTheme(P),y.setCodeBlockTheme(P));const n=W("span","".concat(Y," cherry-toolbar-button"));n.title=ibiz.i18n.t("editor.common.fullscreen"),n.onclick=ee,n.appendChild(G("fullscreen"));const i=e.disabled?y.editor.options.editorDom.parentElement:null==(t=y.editor.options.editorDom.parentElement)?void 0:t.querySelector(".cherry-toolbar>.toolbar-right");null==i||i.appendChild(n),null==w||w.setMDEditor(y),x(y)}),(()=>{if(window.ResizeObserver&&R.value){const e={width:R.value.offsetWidth?"".concat(R.value.offsetWidth,"px"):"100%"};w&&"number"==typeof w.parent.model.height&&Object.assign(e,{height:"".concat(w.parent.model.height,"px")}),H.value=g.cssVarBlock(e),N=new ResizeObserver(e=>{const t=e[0].contentRect.width;if(t!==O){const l={width:"".concat(e[0].contentRect.width,"px")};w&&"number"==typeof w.parent.model.height&&Object.assign(l,{height:"".concat(w.parent.model.height,"px")}),H.value=g.cssVarBlock(l),O=t}}),N.observe(R.value)}})(),null==(l=R.value)||l.addEventListener("keydown",te.bind(this))}),n(()=>{var e;null==(e=R.value)||e.removeEventListener("keydown",te.bind(this))}),d(()=>{y=null,N&&N.disconnect()}),{ns:g,currentVal:k,id:C,editor:y,markDownBox:R,headers:I,theme:U,defaultModel:A,cssVars:H,isEditing:B,showmode:S,getCherryHtml:()=>null==y?void 0:y.getHtml(),getCherryContent:$,setCherryContent:_,renderHeader:()=>{if("manual"===S&&!B.value)return i("div",{onClick:se,class:[g.e("header"),g.is("fullscreen",L.value)]},[!e.disabled&&!e.readonly&&i("div",{class:g.em("header","edit"),onClick:ie,title:ibiz.i18n.t("editor.markdown.edit")},[i("i",{class:"fa fa-edit","aria-hidden":"true"},null)]),i("div",{class:g.em("header","full"),onClick:ee},[L.value?i("i",{class:"fa fa-compress","aria-hidden":"true",title:ibiz.i18n.t("editor.html.reduce")},null):i("i",{class:"fa fa-expand","aria-hidden":"true",title:ibiz.i18n.t("editor.common.fullscreen")},null)])])},renderFooter:()=>{if("manual"===S&&B.value&&!e.disabled&&!e.readonly)return i("div",{onClick:se,class:[g.e("footer"),g.is("fullscreen",L.value)]},[i("div",{class:g.em("footer","cancel"),onClick:re},[ibiz.i18n.t("editor.common.cancel")]),i("div",{class:g.em("footer","save"),onClick:ae},[ibiz.i18n.t("editor.common.confirm")])])},renderImgPreview:z,renderEditorSwitchMenu:()=>{var e;return i("div",{class:[g.b("menu"),g.is("fullscreen",L.value)]},[null==(e=r.editorSwitchMenu)?void 0:e.call(r)])}}},render(){const e=!!this.$slots.editorSwitchMenu;return i("div",{ref:"markDownBox",class:[this.ns.b(),this.ns.is("disabled",this.disabled),this.ns.is("manual","manual"===this.showmode),this.ns.is("editing",this.isEditing),this.ns.is("show-editor-switch-menu",e)]},[e?this.renderEditorSwitchMenu():null,this.renderHeader(),this.renderFooter(),this.renderImgPreview(),i("div",{tabindex:"-1",id:this.id,style:this.cssVars,class:[this.ns.b("cherry"),this.ns.m("dark"===this.theme?"dark":"light")]},null)])}}))}}});
|