@ibiz-template/vue3-components 0.7.41-alpha.46 → 0.7.41-alpha.47
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-DlU-04L2.js +1 -0
- package/dist/index-BniHS_Fs.js +11 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-CRTv7Ujm.js → wang-editor-Bx-SzrX-.js} +1 -1
- package/dist/{xlsx-util-CqW4WJ9G.js → xlsx-util-DgYbktap.js} +1 -1
- package/es/control/drbar/drbar.controller.mjs +6 -1
- package/es/control/drbar/drbar.mjs +5 -5
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/drtab/drtab.controller.mjs +6 -1
- package/es/control/drtab/drtab.mjs +5 -5
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.mjs +14 -3
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.mjs +2 -2
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.state.mjs +6 -0
- package/es/editor/code/monaco-editor/monaco-editor.mjs +2 -2
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +10 -6
- package/es/util/ai-chat-util/ai-chat-util.mjs +36 -2
- package/es/view-engine/edit-view.engine.mjs +6 -1
- package/es/view-engine/opt-view.engine.mjs +6 -1
- package/lib/control/drbar/drbar.cjs +4 -4
- package/lib/control/drbar/drbar.controller.cjs +6 -1
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/drtab/drtab.cjs +4 -4
- package/lib/control/drtab/drtab.controller.cjs +6 -1
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.cjs +2 -2
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.cjs +14 -3
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.state.cjs +6 -0
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +2 -2
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +10 -6
- package/lib/util/ai-chat-util/ai-chat-util.cjs +36 -2
- package/lib/view-engine/edit-view.engine.cjs +6 -1
- package/lib/view-engine/opt-view.engine.cjs +6 -1
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-C7wR017-.js +0 -1
- package/dist/index-DTj1Yy9-.js +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["vue","@ibiz-template/vue3-util","qx-util","cherry-markdown"],function(e){"use strict";var t,n,i,l,o,a,r,s,c,d,u,m,h,v,p;return{setters:[function(e){t=e.nextTick,n=e.ref,i=e.onBeforeUnmount,l=e.createVNode,o=e.resolveComponent,a=e.defineComponent,r=e.watch,s=e.onMounted,c=e.onUnmounted},function(e){d=e.useUIStore,u=e.getEditorEmits,m=e.getMarkDownProps,h=e.useNamespace},function(e){v=e.createUUID},function(e){p=e.default}],execute:function(){function f(e,t){return!(!e||1!==e.nodeType||e.nodeName!==t)}function b(e){const a=n(""),r=n([]),s=n();let c=null;const d=async e=>{var n;if(a.value=e,r.value=[e],await t(),s.value){const{container:e}=s.value.$refs;e&&(null==(n=e.children[0])||n.click())}},u=e=>{"Escape"!==e.key&&27!==e.keyCode||(e.stopPropagation(),e.preventDefault(),r.value=[],h())},m=async()=>{var e;await t();const n=null==(e=s.value)?void 0:e.$refs.container;if(!n)return;const i=n.querySelector(".el-image-viewer__wrapper");null==i||i.addEventListener("keydown",u)},h=()=>{var e;const t=null==(e=s.value)?void 0:e.$refs.container;if(!t)return;const n=t.querySelector(".el-image-viewer__wrapper");null==n||n.removeEventListener("keydown",u)},v=e=>{const t=null==e?void 0:e.target;if(f(t,"IMG")&&t)return void d(t.src);const n=function(e){let t=e;for(;t;){if(t.classList.contains("cherry-previewer"))return null;const e=t.parentElement;if(f(t,"svg")&&e&&"mermaid"===e.dataset.type)return t;t=t.parentElement}return null}(t);n&&d(function(e){const t=e.cloneNode(!0),n=e.width.baseVal.value||e.clientWidth,i=e.height.baseVal.value||e.clientHeight;t.setAttribute("width",n),t.setAttribute("height",i),t.style.backgroundColor="white";const l=(new XMLSerializer).serializeToString(t),o=btoa(unescape(encodeURIComponent(l)));return"data:image/svg+xml;base64,".concat(o)}(n))};return i(()=>{c&&(c.removeEventListener("click",v),c=null),h()}),{renderImgPreview:()=>l(o("el-image"),{class:e.e("img-preview"),ref:s,"zoom-rate":1.1,src:a.value,"preview-src-list":r.value,"hide-on-click-modal":!0,onShow:m,fit:"cover"},null),onMDEditorCreated:e=>{var t,n;c=(null==(n=null==(t=null==e?void 0:e.previewer)?void 0:t.previewerBubble)?void 0:n.previewerDom)||null,null==c||c.addEventListener("click",v)}}}e("default",a({name:"IBizMarkDown",props:m(),emits:u(),setup(e,{emit:o,slots:a}){var u,m,f,g,w,C;const k=h("markdown"),y=e.controller,x=n("");let z=null;const M=v(),{onMDEditorCreated:I,renderImgPreview:E}=b(k),P=ibiz.util.file.getUploadHeaders(),A=n({...P}),U=n(""),D=(null==(u=null==y?void 0:y.editorParams)?void 0:u.customTheme)||(null==(m=null==y?void 0:y.editorParams)?void 0:m.customtheme),S="true"===(null==(f=null==y?void 0:y.editorParams)?void 0:f.enablenoaccess),{UIStore:T}=d(),B=n(D||T.theme),L=n(!1);let O="default";y&&(null==(g=y.editorParams)?void 0:g.showmode)&&(O=y.editorParams.showmode);const N=n(!1),V=n("editOnly");let R=null,H=null,q=0;const F=n({}),$=n({}),_=n("pure");let j=!1,W=!1;(null==(w=null==y?void 0:y.editorParams)?void 0:w.disabledirectory)&&(W="true"===y.editorParams.disabledirectory);let J="absolute";(null==(C=null==y?void 0:y.editorParams)?void 0:C.tocpos)&&(J="fixed"===y.editorParams.tocpos?"fixed":"absolute");const[Y,G]=function(e,n){const{props:i,isEditing:l,currentVal:o,emit:a}=n;let r=n.chatInstance;return[p.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:(n,i,l)=>{l.stopPropagation(),l.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 n=ibiz.inLineAIUtil.calcContextMenus(e.deACMode,t=>{e.doInLineAIUIAction(t,e.model.appId)});if(0===n.length)return;const{zIndex:i}=d(),l=i.increment();ibiz.inLineAIUtil.showContextMenus(t.left,t.top+43,n,{zIndex:l,onClose:()=>{i.decrement()}})}})}}),p.createMenuHook("AIChart",{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:async()=>{const t=e.model.appDataEntityId;if(!t||!e.deACMode)return;const{zIndex:n}=d(),s=n.increment();r=await ibiz.aiChatUtil.getAIChat();const{containerOptions:c,chatOptions:u}=await ibiz.aiChatUtil.getEditorExAIChatParams(e.editorParams,e.context,e.params,i.data,e.deACMode,{chatInstance:r,view:e.view,ctrl:e.ctrl}),m=await ibiz.aiChatUtil.getAIResourceOptions(e.context,e.params);r.create({resourceOptions:m,containerOptions:{zIndex:s,...c},chatOptions:{caption:e.deACMode.logicName,context:{...e.context},params:{...e.params,srfactag:e.deACMode.codeName},appDataEntityId:t,...u,action:(e,t)=>{"backfill"===e&&(l.value?o.value=t.realcontent||"":a("change",t.realcontent))}}})}})]}(y,{props:e,chatInstance:undefined,isEditing:L,currentVal:x,emit:o});r(()=>e.data,e=>{if(e&&y){const t={...y.editorParams,enableNoAccess:S};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams));const n=ibiz.util.file.calcFileUpDownUrl(y.context,y.params,e,t);U.value=n.uploadUrl}},{immediate:!0,deep:!0});const X=n(),K=async(t,n)=>{const i=await ibiz.util.file.fileUpload(U.value,t,A.value),l=((e,t)=>{if(!y)return"";const n={...y.editorParams,enableNoAccess:S};return n.exportparams&&(n.exportParams=JSON.parse(n.exportparams)),t&&t.folder&&(n.osscat=t.folder),ibiz.util.file.calcFileUpDownUrl(y.context,y.params,e,n).downloadUrl})(e.data||{},i.fileid);let o=l.replace("%fileId%",i.fileid);if(ibiz.config.common.enableDownloadTicket&&y&&y.editorParams&&!S){const t=await ibiz.util.file.getDownloadTicket(y.context,y.params,e.data||{},{fileId:i.fileid},y.downloadTicketParams);t&&t.ticket&&(o=l.replace("%fileId%",t.ticket),n(o))}else n(o)},Q=()=>null==z?void 0:z.getMarkdown(),Z=e=>{j=!0,null==z||z.setMarkdown(e,!0)};r(()=>e.value,(e,t)=>{e!==t&&(x.value=e||"")},{immediate:!0}),r(x,(e,t)=>{const n=Q();e!==t&&n!==e&&Z(e)});const ee=e=>{"manual"!==O&&(o("change",Q(),null==y?void 0:y.model.id,j),j=!1)},te=(e,t)=>({[e]:t}),ne=(e,t="")=>{const n=document.createElement(e);return n.className=t,n},ie=e=>ne("i","ch-icon ch-icon-".concat(e)),le=k.e("fullscreen"),oe=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},ae=()=>{if(z&&X.value){const e=z.editor.options.editorDom.parentElement;if(!e)return{};const t=e.classList,n=X.value.querySelector(".".concat(le));return n?{parentElement:e,cherryClass:t,fullscreenNode:n}:{}}return{}},re=()=>{const{parentElement:e,cherryClass:t,fullscreenNode:n}=ae();e&&t&&n&&(oe(n),n.appendChild(ie("fullscreen")),n.title=ibiz.i18n.t("editor.common.fullscreen"),t.remove("fullscreen"),null==e||e.blur(),e.setAttribute("tabindex","-1"))},se=()=>{const{cherryClass:e}=ae();return null==e?void 0:e.contains("fullscreen")},ce=()=>{z&&X.value&&(se()?(re(),z.toggleToc(_.value),N.value=!1):((()=>{const{parentElement:e,cherryClass:n,fullscreenNode:i}=ae();e&&n&&i&&(oe(i),i.appendChild(ie("minscreen")),n.add("fullscreen"),i.title=ibiz.i18n.t("editor.common.minimize"),e.setAttribute("tabindex","-1"),t(()=>null==e?void 0:e.focus()))})(),_.value=z.toc.model,z.toggleToc("full"),N.value=!0))},de=e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),se()&&(re(),z.toggleToc(_.value),N.value=!1))},ue=e=>{null==y||y.setCurrentEditorTheme(e)},me=e=>{var t,n;const{info:i}=e;let l=!0;const o=i.ranges&&i.ranges[0];if(o){const{anchor:e,head:t}=o;l=y.isPositionBefore(e,t)}else l=!0;const a=null==(t=y.mdeditor)?void 0:t.editor.editor.getCursor("start"),r=null==(n=y.mdeditor)?void 0:n.editor.editor.getCursor("end");y.setCursorPos(a,r),y.setSelectionDirection(l)};r(()=>T.theme,e=>{B.value=D||e,null==z||z.setTheme(B.value),null==z||z.setCodeBlockTheme(B.value)});const he=()=>{L.value=!0,V.value="editOnly",null==z||z.switchModel(V.value)},ve=()=>{L.value=!1,V.value="previewOnly",null==z||z.switchModel(V.value)},pe=()=>{Z(x.value),ve()},fe=()=>{o("change",Q(),null==y?void 0:y.model.id,j),j=!1,ve()},be=()=>{const e=document.getElementById(M);null==e||e.focus()};return s(()=>{var n;(e.disabled||e.readonly||"manual"===O)&&(V.value="previewOnly"),t(()=>{var t,n,i;const l=["bold","italic","underline","strikethrough","sub","sup","|","size","color"],o=["bold","italic","underline","strikethrough","|","color","header","|","list","image",{insert:["link","hr","br","code","formula","toc","table","line-table","bar-table"]},"settings","togglePreview"];y&&y.chatCompletion&&(o.unshift("AIChart"),l.unshift("AI")),z=new p({id:M,value:x.value,previewer:{enablePreviewerBubble:!(e.disabled||e.readonly)},themeSettings:{mainTheme:B.value,codeBlockTheme:B.value},fileUpload:K,emoji:{useUnicode:!0},header:{anchorStyle:"autonumber"},editor:{height:"100%",defaultModel:V.value,codemirror:{autofocus:!1}},toolbars:{toolbar:o,bubble:l,float:["h1","h2","h3","|","checklist","quote","quickTable","code"],customMenu:{AI:Y,AIChart:G},sidebar:["theme","copy"],toolbarRight:[],toc:!W&&{updateLocationHash:!1,defaultModel:"pure",showAutoNumber:!0,position:J,cssText:""}},callback:{afterChange:ee,beforeImageMounted:te},event:{changeMainTheme:ue,selectionChange:me},engine:{syntax:{table:{enableChart:!1,externals:["echarts"]}}}}),z.toggleToc("pure");const r=z.engine.makeHtml(x.value);z.previewer.update(r),null==(n=null==(t=z.toc)?void 0:t.updateTocList)||n.call(t),z.setTheme(B.value),D&&(z.setTheme(D),z.setCodeBlockTheme(D));const s=ne("span","".concat(le," cherry-toolbar-button"));s.title=ibiz.i18n.t("editor.common.fullscreen"),s.onclick=ce,s.appendChild(ie("fullscreen"));const c=e.disabled?z.editor.options.editorDom.parentElement:null==(i=z.editor.options.editorDom.parentElement)?void 0:i.querySelector(".cherry-toolbar>.toolbar-right");if(null==c||c.appendChild(s),null==y||y.setMDEditor(z),I(z),a.editorSwitchMenu&&window.ResizeObserver&&X.value){const e=X.value.querySelector(".cherry-toolbar");e&&(H=new ResizeObserver(e=>{var t;const n=null==(t=e[0])?void 0:t.contentRect.height;$.value=k.cssVarBlock({"toolbar-height":"".concat(n,"px")})}),H.observe(e))}}),(()=>{if(window.ResizeObserver&&X.value){const e={width:X.value.offsetWidth?"".concat(X.value.offsetWidth,"px"):"100%"};y&&"number"==typeof y.parent.model.height&&Object.assign(e,{height:"".concat(y.parent.model.height,"px")}),F.value=k.cssVarBlock(e),R=new ResizeObserver(e=>{const t=e[0].contentRect.width;if(t!==q){const n={width:"".concat(e[0].contentRect.width,"px")};y&&"number"==typeof y.parent.model.height&&Object.assign(n,{height:"".concat(y.parent.model.height,"px")}),F.value=k.cssVarBlock(n),q=t}}),R.observe(X.value)}})(),null==(n=X.value)||n.addEventListener("keydown",de.bind(this))}),i(()=>{var e;null==(e=X.value)||e.removeEventListener("keydown",de.bind(this))}),c(()=>{z=null,R&&R.disconnect(),H&&H.disconnect()}),{ns:k,currentVal:x,id:M,editor:z,markDownBox:X,headers:A,theme:B,UIStore:T,defaultModel:V,cssVars:F,isEditing:L,showmode:O,getCherryHtml:()=>null==z?void 0:z.getHtml(),getCherryContent:Q,setCherryContent:Z,renderHeader:()=>{if("manual"===O&&!L.value)return l("div",{onClick:be,class:[k.e("header"),k.is("fullscreen",N.value)]},[!e.disabled&&!e.readonly&&l("div",{class:k.em("header","edit"),onClick:he,title:ibiz.i18n.t("editor.markdown.edit")},[l("i",{class:"fa fa-edit","aria-hidden":"true"},null)]),l("div",{class:k.em("header","full"),onClick:ce},[N.value?l("i",{class:"fa fa-compress","aria-hidden":"true",title:ibiz.i18n.t("editor.html.reduce")},null):l("i",{class:"fa fa-expand","aria-hidden":"true",title:ibiz.i18n.t("editor.common.fullscreen")},null)])])},renderFooter:()=>{if("manual"===O&&L.value&&!e.disabled&&!e.readonly)return l("div",{onClick:be,class:[k.e("footer"),k.is("fullscreen",N.value)]},[l("div",{class:k.em("footer","cancel"),onClick:pe},[ibiz.i18n.t("editor.common.cancel")]),l("div",{class:k.em("footer","save"),onClick:fe},[ibiz.i18n.t("editor.common.confirm")])])},renderImgPreview:E,renderEditorSwitchMenu:()=>{var e;return l("div",{class:[k.b("menu"),k.is("fullscreen",N.value)],style:$.value},[null==(e=a.editorSwitchMenu)?void 0:e.call(a)])}}},render(){const e=!!this.$slots.editorSwitchMenu;return l("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(),l("div",{tabindex:"-1",id:this.id,style:this.cssVars,class:[this.ns.b("cherry"),this.ns.m("dark"===this.UIStore.theme?"dark":"light")]},null)])}}))}}});
|