@univerjs/docs-quick-insert-ui 0.10.3 → 0.10.4-nightly.202508220605
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/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +14 -14
- package/LICENSE +0 -176
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/ui"),require("@univerjs/engine-render"),require("rxjs"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("@univerjs/docs-drawing-ui"),require("@univerjs/docs-drawing"),require("@univerjs/drawing"),require("@univerjs/drawing-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/docs-ui","@univerjs/ui","@univerjs/engine-render","rxjs","react/jsx-runtime","@univerjs/design","react","@univerjs/docs-drawing-ui","@univerjs/docs-drawing","@univerjs/drawing","@univerjs/drawing-ui"],s):(c=typeof globalThis<"u"?globalThis:c||self,s(c.UniverDocsQuickInsertUi={},c.UniverCore,c.UniverDocs,c.UniverDocsUi,c.UniverUi,c.UniverEngineRender,c.rxjs,c.React,c.UniverDesign,c.React,c.UniverDocsDrawingUi,c.UniverDocsDrawing,c.UniverDrawing,c.UniverDrawingUi))})(this,function(c,s,O,_,p,Z,C,m,k,f,te,_e,Se,ye){"use strict";var Ve=Object.defineProperty;var Fe=(c,s,O)=>s in c?Ve(c,s,{enumerable:!0,configurable:!0,writable:!0,value:O}):c[s]=O;var P=(c,s,O)=>Fe(c,typeof s!="symbol"?s+"":s,O);const ne={id:"doc.command.delete-search-key",type:s.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(s.ICommandService),{start:t,end:r}=n;return e.syncExecuteCommand(_.CutContentCommand.id,{segmentId:"",textRanges:[{startOffset:t,endOffset:t,collapsed:!0}],selections:[{startOffset:t,endOffset:r,collapsed:!1,direction:s.RANGE_DIRECTION.FORWARD}]})}},ie="docs.quick.insert.keyword-input-placeholder",K=()=>{const i=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-translate-y-1.5 univer-text-sm univer-text-gray-500",children:i.t("docQuickInsert.keywordInputPlaceholder")})};K.componentKey=ie;const re="docs.quick.insert.placeholder",H=()=>{const i=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-flex univer-h-full univer-items-center univer-justify-center univer-rounded-lg univer-bg-white univer-px-12 univer-py-6 univer-text-gray-400 univer-shadow-lg",children:m.jsx("span",{children:i.t("docQuickInsert.placeholder")})})};H.componentKey=re;function V(i,n){return i.map(e=>({...e})).filter(e=>{if("children"in e)return e.children=V(e.children,n),e.children.length>0;const t=e.keywords;return t?t.some(r=>r.includes(n)):e.title.toLowerCase().includes(n)})}function se(i,n){return i.map(e=>{const t={...e};return"children"in t&&(t.children=se(t.children,n)),t.title=n.t(t.title),"keywords"in t&&(t.keywords=t.keywords.concat(t.title).map(r=>r.toLowerCase())),t})}const Pe=[p.KeyCode.ARROW_UP,p.KeyCode.ARROW_DOWN,p.KeyCode.ENTER],L=()=>{const i=p.useDependency(s.LocaleService),n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(p.ComponentManager),t=p.useDependency(p.IShortcutService),r=p.useDependency(s.ICommandService),o=f.useMemo(()=>s.generateRandomId(),[]),[u,v]=f.useState(0),I=f.useRef(null),a=f.useRef(0);a.current=0;const d=p.useObservable(n.filterKeyword$,""),l=p.useObservable(n.editPopup$),h=p.useObservable(l==null?void 0:l.popup.menus$,[]),w=f.useMemo(()=>se(h,i),[h]),[M,$]=f.useState(()=>V(w,d.toLowerCase()));f.useEffect(()=>{const S=requestIdleCallback(()=>{$(V(w,d.toLowerCase()))});return()=>{cancelIdleCallback(S)}},[w,d]);const b=S=>{n.emitMenuSelected(S),r.executeCommand(U.id)};f.useEffect(()=>{const S=new s.DisposableCollection;t.getAllShortcuts().filter(g=>g.binding&&Pe.includes(g.binding)).forEach(g=>{const R=g.preconditions;g.preconditions=()=>!1,S.add(s.toDisposable(()=>{g.preconditions=R}))});const x={id:`quick.insert.popup.enter.${o}`,type:s.CommandType.OPERATION,handler:()=>{const g=I.current;g&&b(g)}},T={id:`quick.insert.popup.move.cursor.up.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const R=g-1;return R>=0?R:a.current-1})}},Q={id:`quick.insert.popup.move.cursor.down.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const R=g+1;return R<=a.current-1?R:0})}};return S.add(r.registerCommand(T)),S.add(r.registerCommand(Q)),S.add(r.registerCommand(x)),S.add(t.registerShortcut({priority:1e3,id:T.id,binding:p.KeyCode.ARROW_UP,preconditions:()=>!0,staticParameters:{direction:s.Direction.UP}})),S.add(t.registerShortcut({priority:1e3,id:Q.id,binding:p.KeyCode.ARROW_DOWN,preconditions:()=>!0,staticParameters:{direction:s.Direction.DOWN}})),S.add(t.registerShortcut({priority:1e3,id:x.id,binding:p.KeyCode.ENTER,preconditions:()=>!0})),()=>{S.dispose()}},[]),f.useEffect(()=>{v(0)},[M]);const B=f.useRef(new Map);f.useEffect(()=>()=>{B.current.clear()},[]);function N(S){return S.map(y=>{const ee=y.icon,x=ee?e.get(ee):null;if("children"in y)return m.jsx(k.MenuItemGroup,{title:m.jsxs("div",{className:"univer-mb-2 univer-flex univer-items-center univer-text-xs univer-text-gray-400",children:[x&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(x,{})}),m.jsx("span",{children:y.title})]}),children:N(y.children)},y.id);const T=a.current,Q=u===T;if(Q){I.current=y;const g=B.current.get(y.id);g==null||g.scrollIntoView({block:"nearest"})}return a.current++,m.jsx(k.MenuItem,{ref:g=>{g&&B.current.set(y.id,g)},onMouseEnter:()=>v(T),onMouseLeave:()=>v(Number.NaN),className:k.clsx("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm",{"hover:univer-bg-transparent":!Q,"univer-bg-gray-100 dark:!univer-bg-gray-500":Q}),onClick:()=>{b(y)},children:m.jsxs("div",{className:"univer-flex univer-w-full univer-items-center univer-px-1",children:[x&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(x,{})}),m.jsx(k.Tooltip,{showIfEllipsis:!0,title:y.title,placement:"right",children:m.jsx("span",{className:"univer-truncate",children:y.title})})]})},y.id)})}const W=M.length>0,Ce=(l==null?void 0:l.popup.Placeholder)||e.get(H.componentKey);return m.jsx("div",{className:"univer-mt-2",children:W?m.jsx(k.Menu,{wrapperClass:k.clsx("univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden",k.scrollbarClassName),children:N(M)}):Ce&&m.jsx(Ce,{})})};L.componentKey="docs.quick.insert.popup";var De=Object.getOwnPropertyDescriptor,Oe=(i,n,e,t)=>{for(var r=t>1?void 0:t?De(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},E=(i,n)=>(e,t)=>n(e,t,i);const oe={dispose:()=>{}};c.DocQuickInsertPopupService=class extends s.Disposable{constructor(e,t,r,o,u){super();P(this,"_popups",new Set);P(this,"_editPopup$",new C.BehaviorSubject(void 0));P(this,"editPopup$",this._editPopup$.asObservable());P(this,"_isComposing$",new C.BehaviorSubject(!1));P(this,"isComposing$",this._isComposing$.asObservable());P(this,"_inputOffset$",new C.BehaviorSubject({start:0,end:0}));P(this,"inputOffset$",this._inputOffset$.asObservable());P(this,"filterKeyword$");P(this,"_menuSelectedCallbacks",new Set);P(this,"_inputPlaceholderRenderRoot",null);this._docCanvasPopupManagerService=e,this._univerInstanceService=t,this._commandService=r,this._renderManagerService=o,this._docSelectionManagerService=u,this.disposeWithMe(this._editPopup$);const v=(a,d)=>{var l,h;return(h=(l=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC))==null?void 0:l.getBody())==null?void 0:h.dataStream.slice(a,d)};let I="";this.filterKeyword$=this._inputOffset$.pipe(C.map(a=>{var l;const d=v(a.start,a.end);return(l=d==null?void 0:d.slice(1))!=null?l:""}),C.distinctUntilChanged(),C.tap(a=>{I=a})),this.disposeWithMe(C.combineLatest([this.filterKeyword$.pipe(C.tap(a=>{var d,l,h;a.length>0?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():(h=this._inputPlaceholderRenderRoot)==null||h.mount()})),this.isComposing$.pipe(C.tap(a=>{var d,l,h;a?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():I.length<=0&&((h=this._inputPlaceholderRenderRoot)==null||h.mount())})),this.editPopup$.pipe(C.tap(a=>{var d,l;a||((l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose(),this._inputPlaceholderRenderRoot=null)}))]).subscribe())}get popups(){return Array.from(this._popups)}get editPopup(){return this._editPopup$.value}get isComposing(){return this._isComposing$.value}setIsComposing(e){this._isComposing$.next(e)}get inputOffset(){return this._inputOffset$.value}setInputOffset(e){this._inputOffset$.next(e)}getDocEventManagerService(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(_.DocEventManagerService)}resolvePopup(e){return Array.from(this._popups).find(t=>t.keyword===e)}registerPopup(e){return this._popups.add(e),()=>{this._popups.delete(e)}}_createInputPlaceholderRenderRoot(e){return{isMounted:!1,mount(){if(this.isMounted)return;this.isMounted=!0;const r=e();this.unmount={dispose:()=>{r.dispose(),this.isMounted=!1}}}}}showPopup(e){var l,h;const{popup:t,index:r,unitId:o}=e;this.closePopup();const u=this._univerInstanceService.getUnit(o),v=(h=(l=u==null?void 0:u.getBody())==null?void 0:l.paragraphs)==null?void 0:h.find(w=>w.startIndex>r);if(!v)return;const I=this.getDocEventManagerService(o),a=I==null?void 0:I.findParagraphBoundByIndex(v.startIndex);if(!a)return;this._inputPlaceholderRenderRoot=this._createInputPlaceholderRenderRoot(()=>{var W;const w=(W=this._renderManagerService.getRenderById(o))==null?void 0:W.with(O.DocSkeletonManagerService),M=this._docSelectionManagerService.getActiveTextRange();if(!w||!M)return oe;const b=w.getSkeleton().findNodeByCharIndex(M.startOffset,M.segmentId,M.segmentPage);if(!((b==null?void 0:b.content)==="\r"))return oe;const N=this._docCanvasPopupManagerService.attachPopupToRange({startOffset:r+1,endOffset:r+1,collapsed:!1},{componentKey:K.componentKey,onClickOutside:()=>{N.dispose()},direction:"horizontal"},o);return N}),this._inputPlaceholderRenderRoot.mount();const d=this._docCanvasPopupManagerService.attachPopupToRect(a.firstLine,{componentKey:L.componentKey,onClickOutside:()=>{this.closePopup()},direction:"bottom"},o);this._editPopup$.next({disposable:d,popup:t,anchor:r,unitId:o})}closePopup(){this.editPopup&&(this.editPopup.disposable.dispose(),this._editPopup$.next(null))}onMenuSelected(e){return this._menuSelectedCallbacks.add(e),()=>{this._menuSelectedCallbacks.delete(e)}}emitMenuSelected(e){const{start:t,end:r}=this.inputOffset;this._commandService.syncExecuteCommand(ne.id,{start:t,end:r}),setTimeout(()=>{this._menuSelectedCallbacks.forEach(o=>o(e))},0)}},c.DocQuickInsertPopupService=Oe([E(0,s.Inject(_.DocCanvasPopManagerService)),E(1,s.Inject(s.IUniverInstanceService)),E(2,s.Inject(s.ICommandService)),E(3,s.Inject(Z.IRenderManagerService)),E(4,s.Inject(O.DocSelectionManagerService))],c.DocQuickInsertPopupService);const ce={type:s.CommandType.OPERATION,id:"doc.operation.show-quick-insert-popup",handler(i,n){const e=i.get(c.DocQuickInsertPopupService);return n?(e.showPopup(n),!0):!1}},U={type:s.CommandType.OPERATION,id:"doc.operation.close-quick-insert-popup",handler(i){return i.get(c.DocQuickInsertPopupService).closePopup(),!0}},ae={id:"quick-insert.text.menu",title:"docQuickInsert.menu.text",icon:"TextIcon",keywords:["text"]},ue={id:_.OrderListCommand.id,title:"docQuickInsert.menu.numberedList",icon:"OrderIcon",keywords:["numbered","list","ordered"]},de={id:_.BulletListCommand.id,title:"docQuickInsert.menu.bulletedList",icon:"UnorderIcon",keywords:["bulleted","list","unordered"]},pe={id:_.HorizontalLineCommand.id,title:"docQuickInsert.menu.divider",icon:"DividerIcon",keywords:["divider","line","separate"]},le={id:_.DocCreateTableOperation.id,title:"docQuickInsert.menu.table",icon:"GridIcon",keywords:["table","grid","spreadsheet"]},ve={id:te.InsertDocImageCommand.id,title:"docQuickInsert.menu.image",icon:"AdditionAndSubtractionIcon",keywords:["image","picture","photo"]},we=[{title:"docQuickInsert.group.basics",id:"quick.insert.group.basic",children:[ae,ue,de,pe,le,ve]}],Me=new Set([ue.id,de.id,pe.id,le.id,ve.id]);var be=Object.getOwnPropertyDescriptor,ke=(i,n,e,t)=>{for(var r=t>1?void 0:t?be(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},j=(i,n)=>(e,t)=>n(e,t,i);c.DocQuickInsertTriggerController=class extends s.Disposable{constructor(n,e,t,r,o){super(),this._commandService=n,this._textSelectionManagerService=e,this._docQuickInsertPopupService=t,this._shortcutService=r,this._univerInstanceService=o,this.disposeWithMe(this._shortcutService.registerShortcut({id:U.id,binding:p.KeyCode.ESC,preconditions:()=>!!this._docQuickInsertPopupService.editPopup,priority:1e3})),this._initTrigger(),this._initMenuHandler()}_initTrigger(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{var u,v,I;const{_docQuickInsertPopupService:e,_textSelectionManagerService:t,_commandService:r}=this,o=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC);if(!(o!=null&&o.getDisabled())){if(n.id===_.InsertCommand.id){const a=n.params;if(e.editPopup){e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset+1});return}const d=t.getActiveTextRange();if(!d)return;const l=e.resolvePopup(a.body.dataStream);if(!l||!(l.preconditions?l.preconditions(a):!0))return;e.setInputOffset({start:d.startOffset-1,end:d.startOffset}),setTimeout(()=>{r.executeCommand(ce.id,{index:d.startOffset-1,unitId:a.unitId,popup:l})},100)}if(n.id===_.IMEInputCommand.id){const a=n.params;!e.isComposing&&a.isCompositionStart&&e.setIsComposing(!0),e.isComposing&&a.isCompositionEnd&&e.setIsComposing(!1)}if(n.id===O.RichTextEditingMutation.id){const a=n.params;if(a.isCompositionEnd){const d=(v=(u=a.textRanges)==null?void 0:u[0])==null?void 0:v.endOffset;d&&e.setInputOffset({start:e.inputOffset.start,end:d})}}if(n.id===_.DeleteCommand.id){const a=n.params;if(e.editPopup&&a.direction===s.DeleteDirection.LEFT){const d=(I=a.len)!=null?I:0;e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset-d})}}if(n.id===_.MoveCursorOperation.id){const a=n.params;(a.direction===s.Direction.LEFT||a.direction===s.Direction.RIGHT)&&e.editPopup&&r.executeCommand(U.id)}if(n.id===_.DeleteLeftCommand.id){const a=t.getActiveTextRange();if(!e.editPopup||!a)return;a.endOffset<=e.editPopup.anchor&&r.executeCommand(U.id)}}}))}_initMenuHandler(){this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected(n=>{n.id!==ae.id&&Me.has(n.id)&&this._commandService.executeCommand(n.id)}))}},c.DocQuickInsertTriggerController=ke([j(0,s.ICommandService),j(1,s.Inject(O.DocSelectionManagerService)),j(2,s.Inject(c.DocQuickInsertPopupService)),j(3,s.Inject(p.IShortcutService)),j(4,s.Inject(s.IUniverInstanceService))],c.DocQuickInsertTriggerController);var D=function(){return D=Object.assign||function(i){for(var n,e=1,t=arguments.length;e<t;e++){n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},D.apply(this,arguments)},xe=function(i,n){var e={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&n.indexOf(t)<0&&(e[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,t=Object.getOwnPropertySymbols(i);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(i,t[r])&&(e[t[r]]=i[t[r]]);return e},q=f.forwardRef(function(i,n){var e=i.icon,t=i.id,r=i.className,o=i.extend,u=xe(i,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(t," ").concat(r||"").trim(),I=f.useRef("_".concat(Ee()));return he(e,"".concat(t),{defIds:e.defIds,idSuffix:I.current},D({ref:n,className:v},u),o)});function he(i,n,e,t,r){return f.createElement(i.tag,D(D({key:n},Re(i,e,r)),t),(Qe(i,e).children||[]).map(function(o,u){return he(o,"".concat(n,"-").concat(i.tag,"-").concat(u),e,void 0,r)}))}function Re(i,n,e){var t=D({},i.attrs);e!=null&&e.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=e.colorChannel1),i.tag==="mask"&&t.id&&(t.id=t.id+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];u==="mask"&&typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))});var r=n.defIds;return!r||r.length===0||(i.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function Qe(i,n){var e,t=n.defIds;return!t||t.length===0?i:i.tag==="defs"&&(!((e=i.children)===null||e===void 0)&&e.length)?D(D({},i),{children:i.children.map(function(r){return typeof r.attrs.id=="string"&&t&&t.includes(r.attrs.id)?D(D({},r),{attrs:D(D({},r.attrs),{id:r.attrs.id+n.idSuffix})}):r})}):i}function Ee(){return Math.random().toString(36).substring(2,8)}q.displayName="UniverIcon";var Ue={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.01953 3.13985C1.01953 2.77258 1.31726 2.47485 1.68453 2.47485H2.73713C3.1044 2.47485 3.40213 2.77258 3.40213 3.13985C3.40213 3.50712 3.1044 3.80485 2.73713 3.80485H1.68453C1.31726 3.80485 1.01953 3.50712 1.01953 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.17734 3.13985C4.17734 2.77258 4.47507 2.47485 4.84234 2.47485H6.94754C7.31481 2.47485 7.61254 2.77258 7.61254 3.13985C7.61254 3.50712 7.31481 3.80485 6.94754 3.80485H4.84234C4.47507 3.80485 4.17734 3.50712 4.17734 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.38775 3.13985C8.38775 2.77258 8.68548 2.47485 9.05275 2.47485H11.158C11.5252 2.47485 11.823 2.77258 11.823 3.13985C11.823 3.50712 11.5252 3.80485 11.158 3.80485H9.05275C8.68548 3.80485 8.38775 3.50712 8.38775 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.5982 3.13985C12.5982 2.77258 12.8959 2.47485 13.2632 2.47485H14.3158C14.683 2.47485 14.9808 2.77258 14.9808 3.13985C14.9808 3.50712 14.683 3.80485 14.3158 3.80485H13.2632C12.8959 3.80485 12.5982 3.50712 12.5982 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.01953 7.99972C1.01953 7.63245 1.31726 7.33472 1.68453 7.33472H14.3158C14.683 7.33472 14.9808 7.63245 14.9808 7.99972C14.9808 8.36699 14.683 8.66472 14.3158 8.66472H1.68453C1.31726 8.66472 1.01953 8.36699 1.01953 7.99972Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.68453 12.1951C1.31726 12.1951 1.01953 12.4928 1.01953 12.8601C1.01953 13.2273 1.31726 13.5251 1.68453 13.5251H2.73713C3.1044 13.5251 3.40213 13.2273 3.40213 12.8601C3.40213 12.4928 3.1044 12.1951 2.73713 12.1951H1.68453Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.84234 12.1951C4.47507 12.1951 4.17734 12.4928 4.17734 12.8601C4.17734 13.2273 4.47507 13.5251 4.84234 13.5251H6.94754C7.31481 13.5251 7.61254 13.2273 7.61254 12.8601C7.61254 12.4928 7.31481 12.1951 6.94754 12.1951H4.84234Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M9.05275 12.1951C8.68548 12.1951 8.38775 12.4928 8.38775 12.8601C8.38775 13.2273 8.68548 13.5251 9.05275 13.5251H11.158C11.5252 13.5251 11.823 13.2273 11.823 12.8601C11.823 12.4928 11.5252 12.1951 11.158 12.1951H9.05275Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13.2632 12.1951C12.8959 12.1951 12.5982 12.4928 12.5982 12.8601C12.5982 13.2273 12.8959 13.5251 13.2632 13.5251H14.3158C14.683 13.5251 14.9808 13.2273 14.9808 12.8601C14.9808 12.4928 14.683 12.1951 14.3158 12.1951H13.2632Z"}}]},F=f.forwardRef(function(i,n){return f.createElement(q,Object.assign({},i,{id:"divider-icon",ref:n,icon:Ue}))});F.displayName="DividerIcon";var je={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},fe=f.forwardRef(function(i,n){return f.createElement(q,Object.assign({},i,{id:"increase-icon",ref:n,icon:je}))});fe.displayName="IncreaseIcon";var $e={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#text-icon_clip0_1293_26)"},children:[{tag:"path",attrs:{d:"M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z"}},{tag:"path",attrs:{d:"M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"text-icon_clip0_1293_26"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.9)"}}]}]}],defIds:["text-icon_clip0_1293_26"]},G=f.forwardRef(function(i,n){return f.createElement(q,Object.assign({},i,{id:"text-icon",ref:n,icon:$e}))});G.displayName="TextIcon";const ge="doc.quick-insert.button";var Ne=Object.getOwnPropertyDescriptor,Te=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ne(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},z=(i,n)=>(e,t)=>n(e,t,i);let A=class extends s.Disposable{constructor(n,e,t,r){super();P(this,"_popup$",new C.BehaviorSubject(null));P(this,"popup$",this._popup$.asObservable());this._context=n,this._docEventManagerService=e,this._docQuickInsertPopupService=t,this._docCanvasPopManagerService=r,this._init()}get popup(){return this._popup$.value}_init(){this.disposeWithMe(C.combineLatest([this._docEventManagerService.hoverParagraphLeftRealTime$,this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([n,e])=>{var o;const t=n!=null?n:e,r=this._context.unit.getDisabled();if(!t||r){this._hideMenu(!0);return}if(t.paragraphStart===t.paragraphEnd){if(this._docQuickInsertPopupService.editPopup||t.startIndex===((o=this.popup)==null?void 0:o.startIndex))return;this._hideMenu(!0);const u=this._docCanvasPopManagerService.attachPopupToRect(t.firstLine,{componentKey:ge,direction:"left-center"},this._context.unit.getUnitId());this._popup$.next({startIndex:t.startIndex,disposable:u})}else this._hideMenu(!0)}))}_hideMenu(n){this._docQuickInsertPopupService.editPopup||this.popup&&(n||this.popup.disposable.canDispose())&&(this.popup.disposable.dispose(),this._popup$.next(null))}};A=Te([z(1,s.Inject(_.DocEventManagerService)),z(2,s.Inject(c.DocQuickInsertPopupService)),z(3,s.Inject(_.DocCanvasPopManagerService))],A);const Y=({className:i=""})=>{const n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(s.IUniverInstanceService),t=p.useDependency(Z.IRenderManagerService),r=p.useObservable(f.useMemo(()=>e.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_DOC),[e])),o=r&&t.getRenderById(r.getUnitId()),u=o==null?void 0:o.with(A),v=p.useDependency(p.ILayoutService),I=p.useDependency(O.DocSelectionManagerService),a=p.useObservable(n.editPopup$),d=p.useEvent(l=>{var $;const h=u==null?void 0:u.popup;if(!h)return;const w=n.popups,M={keyword:"",menus$:C.combineLatest(w.map(b=>b.menus$)).pipe(C.map(b=>b.flat()))};I.replaceDocRanges([{startOffset:h.startIndex,endOffset:h.startIndex}]),n.setInputOffset({start:h.startIndex-1,end:h.startIndex-1}),n.showPopup({popup:M,index:h.startIndex-1,unitId:($=r==null?void 0:r.getUnitId())!=null?$:""}),setTimeout(()=>{v.focus()})});return m.jsx("div",{className:k.clsx("univer-mr-1 univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-full univer-p-1.5 univer-shadow-sm hover:univer-bg-gray-100 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-700",k.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-700":a,"univer-bg-white dark:!univer-bg-gray-900":!a},i),role:"button",tabIndex:0,onClick:d,children:m.jsx(fe,{className:"univer-text-gray-800 dark:!univer-text-gray-200"})})};Y.componentKey=ge;var Ke=Object.getOwnPropertyDescriptor,He=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ke(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},J=(i,n)=>(e,t)=>n(e,t,i);c.DocQuickInsertUIController=class extends s.Disposable{constructor(n,e,t){super(),this._commandService=n,this._docQuickInsertPopupService=e,this._componentManager=t,this._initCommands(),this._initComponents(),this._initMenus()}_initCommands(){[ne,ce,U].forEach(n=>{this.disposeWithMe(this._commandService.registerCommand(n))})}_initComponents(){[[L.componentKey,L],[K.componentKey,K],[H.componentKey,H],[F.displayName,F],[G.displayName,G],[Y.componentKey,Y]].forEach(([e,t])=>{e&&this.disposeWithMe(this._componentManager.register(e,t))}),[{keyword:"/",menus$:C.of(we),preconditions:e=>{var t;return((t=e.range.startNodePosition)==null?void 0:t.glyph)===0}}].forEach(e=>{this.disposeWithMe(this._docQuickInsertPopupService.registerPopup(e))})}_initMenus(){}},c.DocQuickInsertUIController=He([J(0,s.ICommandService),J(1,s.Inject(c.DocQuickInsertPopupService)),J(2,s.Inject(p.ComponentManager))],c.DocQuickInsertUIController);const Le="docs-quick-insert-ui.config",me={};var qe=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,Be=(i,n,e)=>n in i?qe(i,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[n]=e,We=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ae(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},X=(i,n)=>(e,t)=>n(e,t,i),Ie=(i,n,e)=>Be(i,typeof n!="symbol"?n+"":n,e);const Ze="DOC_QUICK_INSERT_UI_PLUGIN";c.UniverDocsQuickInsertUIPlugin=class extends s.Plugin{constructor(n=me,e,t,r){super(),this._config=n,this._injector=e,this._renderManagerSrv=t,this._configService=r;const{menu:o,...u}=s.merge({},me,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(Le,u)}onStarting(){[[c.DocQuickInsertUIController],[c.DocQuickInsertTriggerController],[c.DocQuickInsertPopupService]].forEach(e=>this._injector.add(e)),this._injector.get(c.DocQuickInsertUIController)}onRendered(){this._injector.get(c.DocQuickInsertTriggerController),this._injector.get(c.DocQuickInsertPopupService),[[A]].forEach(n=>{this._renderManagerSrv.registerRenderModule(s.UniverInstanceType.UNIVER_DOC,n)})}},Ie(c.UniverDocsQuickInsertUIPlugin,"type",s.UniverInstanceType.UNIVER_DOC),Ie(c.UniverDocsQuickInsertUIPlugin,"pluginName",Ze),c.UniverDocsQuickInsertUIPlugin=We([s.DependentOn(ye.UniverDrawingUIPlugin,Se.UniverDrawingPlugin,te.UniverDocsDrawingUIPlugin,_e.UniverDocsDrawingPlugin,p.UniverUIPlugin),X(1,s.Inject(s.Injector)),X(2,s.Inject(Z.IRenderManagerService)),X(3,s.IConfigService)],c.UniverDocsQuickInsertUIPlugin),c.KeywordInputPlaceholderComponentKey=ie,c.QuickInsertPlaceholderComponentKey=re,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(c,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/ui"),require("@univerjs/engine-render"),require("rxjs"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("@univerjs/docs-drawing-ui"),require("@univerjs/docs-drawing"),require("@univerjs/drawing"),require("@univerjs/drawing-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/docs-ui","@univerjs/ui","@univerjs/engine-render","rxjs","react/jsx-runtime","@univerjs/design","react","@univerjs/docs-drawing-ui","@univerjs/docs-drawing","@univerjs/drawing","@univerjs/drawing-ui"],s):(c=typeof globalThis<"u"?globalThis:c||self,s(c.UniverDocsQuickInsertUi={},c.UniverCore,c.UniverDocs,c.UniverDocsUi,c.UniverUi,c.UniverEngineRender,c.rxjs,c.React,c.UniverDesign,c.React,c.UniverDocsDrawingUi,c.UniverDocsDrawing,c.UniverDrawing,c.UniverDrawingUi))})(this,(function(c,s,O,_,p,Z,C,m,k,f,te,_e,Se,ye){"use strict";var Ve=Object.defineProperty;var Fe=(c,s,O)=>s in c?Ve(c,s,{enumerable:!0,configurable:!0,writable:!0,value:O}):c[s]=O;var P=(c,s,O)=>Fe(c,typeof s!="symbol"?s+"":s,O);const ne={id:"doc.command.delete-search-key",type:s.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(s.ICommandService),{start:t,end:r}=n;return e.syncExecuteCommand(_.CutContentCommand.id,{segmentId:"",textRanges:[{startOffset:t,endOffset:t,collapsed:!0}],selections:[{startOffset:t,endOffset:r,collapsed:!1,direction:s.RANGE_DIRECTION.FORWARD}]})}},ie="docs.quick.insert.keyword-input-placeholder",K=()=>{const i=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-translate-y-1.5 univer-text-sm univer-text-gray-500",children:i.t("docQuickInsert.keywordInputPlaceholder")})};K.componentKey=ie;const re="docs.quick.insert.placeholder",H=()=>{const i=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-flex univer-h-full univer-items-center univer-justify-center univer-rounded-lg univer-bg-white univer-px-12 univer-py-6 univer-text-gray-400 univer-shadow-lg",children:m.jsx("span",{children:i.t("docQuickInsert.placeholder")})})};H.componentKey=re;function V(i,n){return i.map(e=>({...e})).filter(e=>{if("children"in e)return e.children=V(e.children,n),e.children.length>0;const t=e.keywords;return t?t.some(r=>r.includes(n)):e.title.toLowerCase().includes(n)})}function se(i,n){return i.map(e=>{const t={...e};return"children"in t&&(t.children=se(t.children,n)),t.title=n.t(t.title),"keywords"in t&&(t.keywords=t.keywords.concat(t.title).map(r=>r.toLowerCase())),t})}const Pe=[p.KeyCode.ARROW_UP,p.KeyCode.ARROW_DOWN,p.KeyCode.ENTER],L=()=>{const i=p.useDependency(s.LocaleService),n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(p.ComponentManager),t=p.useDependency(p.IShortcutService),r=p.useDependency(s.ICommandService),o=f.useMemo(()=>s.generateRandomId(),[]),[u,v]=f.useState(0),I=f.useRef(null),a=f.useRef(0);a.current=0;const d=p.useObservable(n.filterKeyword$,""),l=p.useObservable(n.editPopup$),h=p.useObservable(l==null?void 0:l.popup.menus$,[]),w=f.useMemo(()=>se(h,i),[h]),[M,$]=f.useState(()=>V(w,d.toLowerCase()));f.useEffect(()=>{const S=requestIdleCallback(()=>{$(V(w,d.toLowerCase()))});return()=>{cancelIdleCallback(S)}},[w,d]);const b=S=>{n.emitMenuSelected(S),r.executeCommand(U.id)};f.useEffect(()=>{const S=new s.DisposableCollection;t.getAllShortcuts().filter(g=>g.binding&&Pe.includes(g.binding)).forEach(g=>{const R=g.preconditions;g.preconditions=()=>!1,S.add(s.toDisposable(()=>{g.preconditions=R}))});const x={id:`quick.insert.popup.enter.${o}`,type:s.CommandType.OPERATION,handler:()=>{const g=I.current;g&&b(g)}},T={id:`quick.insert.popup.move.cursor.up.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const R=g-1;return R>=0?R:a.current-1})}},Q={id:`quick.insert.popup.move.cursor.down.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const R=g+1;return R<=a.current-1?R:0})}};return S.add(r.registerCommand(T)),S.add(r.registerCommand(Q)),S.add(r.registerCommand(x)),S.add(t.registerShortcut({priority:1e3,id:T.id,binding:p.KeyCode.ARROW_UP,preconditions:()=>!0,staticParameters:{direction:s.Direction.UP}})),S.add(t.registerShortcut({priority:1e3,id:Q.id,binding:p.KeyCode.ARROW_DOWN,preconditions:()=>!0,staticParameters:{direction:s.Direction.DOWN}})),S.add(t.registerShortcut({priority:1e3,id:x.id,binding:p.KeyCode.ENTER,preconditions:()=>!0})),()=>{S.dispose()}},[]),f.useEffect(()=>{v(0)},[M]);const B=f.useRef(new Map);f.useEffect(()=>()=>{B.current.clear()},[]);function N(S){return S.map(y=>{const ee=y.icon,x=ee?e.get(ee):null;if("children"in y)return m.jsx(k.MenuItemGroup,{title:m.jsxs("div",{className:"univer-mb-2 univer-flex univer-items-center univer-text-xs univer-text-gray-400",children:[x&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(x,{})}),m.jsx("span",{children:y.title})]}),children:N(y.children)},y.id);const T=a.current,Q=u===T;if(Q){I.current=y;const g=B.current.get(y.id);g==null||g.scrollIntoView({block:"nearest"})}return a.current++,m.jsx(k.MenuItem,{ref:g=>{g&&B.current.set(y.id,g)},onMouseEnter:()=>v(T),onMouseLeave:()=>v(Number.NaN),className:k.clsx("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm",{"hover:univer-bg-transparent":!Q,"univer-bg-gray-100 dark:!univer-bg-gray-500":Q}),onClick:()=>{b(y)},children:m.jsxs("div",{className:"univer-flex univer-w-full univer-items-center univer-px-1",children:[x&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(x,{})}),m.jsx(k.Tooltip,{showIfEllipsis:!0,title:y.title,placement:"right",children:m.jsx("span",{className:"univer-truncate",children:y.title})})]})},y.id)})}const W=M.length>0,Ce=(l==null?void 0:l.popup.Placeholder)||e.get(H.componentKey);return m.jsx("div",{className:"univer-mt-2",children:W?m.jsx(k.Menu,{wrapperClass:k.clsx("univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden",k.scrollbarClassName),children:N(M)}):Ce&&m.jsx(Ce,{})})};L.componentKey="docs.quick.insert.popup";var De=Object.getOwnPropertyDescriptor,Oe=(i,n,e,t)=>{for(var r=t>1?void 0:t?De(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},E=(i,n)=>(e,t)=>n(e,t,i);const oe={dispose:()=>{}};c.DocQuickInsertPopupService=class extends s.Disposable{constructor(e,t,r,o,u){super();P(this,"_popups",new Set);P(this,"_editPopup$",new C.BehaviorSubject(void 0));P(this,"editPopup$",this._editPopup$.asObservable());P(this,"_isComposing$",new C.BehaviorSubject(!1));P(this,"isComposing$",this._isComposing$.asObservable());P(this,"_inputOffset$",new C.BehaviorSubject({start:0,end:0}));P(this,"inputOffset$",this._inputOffset$.asObservable());P(this,"filterKeyword$");P(this,"_menuSelectedCallbacks",new Set);P(this,"_inputPlaceholderRenderRoot",null);this._docCanvasPopupManagerService=e,this._univerInstanceService=t,this._commandService=r,this._renderManagerService=o,this._docSelectionManagerService=u,this.disposeWithMe(this._editPopup$);const v=(a,d)=>{var l,h;return(h=(l=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC))==null?void 0:l.getBody())==null?void 0:h.dataStream.slice(a,d)};let I="";this.filterKeyword$=this._inputOffset$.pipe(C.map(a=>{var l;const d=v(a.start,a.end);return(l=d==null?void 0:d.slice(1))!=null?l:""}),C.distinctUntilChanged(),C.tap(a=>{I=a})),this.disposeWithMe(C.combineLatest([this.filterKeyword$.pipe(C.tap(a=>{var d,l,h;a.length>0?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():(h=this._inputPlaceholderRenderRoot)==null||h.mount()})),this.isComposing$.pipe(C.tap(a=>{var d,l,h;a?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():I.length<=0&&((h=this._inputPlaceholderRenderRoot)==null||h.mount())})),this.editPopup$.pipe(C.tap(a=>{var d,l;a||((l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose(),this._inputPlaceholderRenderRoot=null)}))]).subscribe())}get popups(){return Array.from(this._popups)}get editPopup(){return this._editPopup$.value}get isComposing(){return this._isComposing$.value}setIsComposing(e){this._isComposing$.next(e)}get inputOffset(){return this._inputOffset$.value}setInputOffset(e){this._inputOffset$.next(e)}getDocEventManagerService(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(_.DocEventManagerService)}resolvePopup(e){return Array.from(this._popups).find(t=>t.keyword===e)}registerPopup(e){return this._popups.add(e),()=>{this._popups.delete(e)}}_createInputPlaceholderRenderRoot(e){return{isMounted:!1,mount(){if(this.isMounted)return;this.isMounted=!0;const r=e();this.unmount={dispose:()=>{r.dispose(),this.isMounted=!1}}}}}showPopup(e){var l,h;const{popup:t,index:r,unitId:o}=e;this.closePopup();const u=this._univerInstanceService.getUnit(o),v=(h=(l=u==null?void 0:u.getBody())==null?void 0:l.paragraphs)==null?void 0:h.find(w=>w.startIndex>r);if(!v)return;const I=this.getDocEventManagerService(o),a=I==null?void 0:I.findParagraphBoundByIndex(v.startIndex);if(!a)return;this._inputPlaceholderRenderRoot=this._createInputPlaceholderRenderRoot(()=>{var W;const w=(W=this._renderManagerService.getRenderById(o))==null?void 0:W.with(O.DocSkeletonManagerService),M=this._docSelectionManagerService.getActiveTextRange();if(!w||!M)return oe;const b=w.getSkeleton().findNodeByCharIndex(M.startOffset,M.segmentId,M.segmentPage);if(!((b==null?void 0:b.content)==="\r"))return oe;const N=this._docCanvasPopupManagerService.attachPopupToRange({startOffset:r+1,endOffset:r+1,collapsed:!1},{componentKey:K.componentKey,onClickOutside:()=>{N.dispose()},direction:"horizontal"},o);return N}),this._inputPlaceholderRenderRoot.mount();const d=this._docCanvasPopupManagerService.attachPopupToRect(a.firstLine,{componentKey:L.componentKey,onClickOutside:()=>{this.closePopup()},direction:"bottom"},o);this._editPopup$.next({disposable:d,popup:t,anchor:r,unitId:o})}closePopup(){this.editPopup&&(this.editPopup.disposable.dispose(),this._editPopup$.next(null))}onMenuSelected(e){return this._menuSelectedCallbacks.add(e),()=>{this._menuSelectedCallbacks.delete(e)}}emitMenuSelected(e){const{start:t,end:r}=this.inputOffset;this._commandService.syncExecuteCommand(ne.id,{start:t,end:r}),setTimeout(()=>{this._menuSelectedCallbacks.forEach(o=>o(e))},0)}},c.DocQuickInsertPopupService=Oe([E(0,s.Inject(_.DocCanvasPopManagerService)),E(1,s.Inject(s.IUniverInstanceService)),E(2,s.Inject(s.ICommandService)),E(3,s.Inject(Z.IRenderManagerService)),E(4,s.Inject(O.DocSelectionManagerService))],c.DocQuickInsertPopupService);const ce={type:s.CommandType.OPERATION,id:"doc.operation.show-quick-insert-popup",handler(i,n){const e=i.get(c.DocQuickInsertPopupService);return n?(e.showPopup(n),!0):!1}},U={type:s.CommandType.OPERATION,id:"doc.operation.close-quick-insert-popup",handler(i){return i.get(c.DocQuickInsertPopupService).closePopup(),!0}},ae={id:"quick-insert.text.menu",title:"docQuickInsert.menu.text",icon:"TextIcon",keywords:["text"]},ue={id:_.OrderListCommand.id,title:"docQuickInsert.menu.numberedList",icon:"OrderIcon",keywords:["numbered","list","ordered"]},de={id:_.BulletListCommand.id,title:"docQuickInsert.menu.bulletedList",icon:"UnorderIcon",keywords:["bulleted","list","unordered"]},pe={id:_.HorizontalLineCommand.id,title:"docQuickInsert.menu.divider",icon:"DividerIcon",keywords:["divider","line","separate"]},le={id:_.DocCreateTableOperation.id,title:"docQuickInsert.menu.table",icon:"GridIcon",keywords:["table","grid","spreadsheet"]},ve={id:te.InsertDocImageCommand.id,title:"docQuickInsert.menu.image",icon:"AdditionAndSubtractionIcon",keywords:["image","picture","photo"]},we=[{title:"docQuickInsert.group.basics",id:"quick.insert.group.basic",children:[ae,ue,de,pe,le,ve]}],Me=new Set([ue.id,de.id,pe.id,le.id,ve.id]);var be=Object.getOwnPropertyDescriptor,ke=(i,n,e,t)=>{for(var r=t>1?void 0:t?be(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},j=(i,n)=>(e,t)=>n(e,t,i);c.DocQuickInsertTriggerController=class extends s.Disposable{constructor(n,e,t,r,o){super(),this._commandService=n,this._textSelectionManagerService=e,this._docQuickInsertPopupService=t,this._shortcutService=r,this._univerInstanceService=o,this.disposeWithMe(this._shortcutService.registerShortcut({id:U.id,binding:p.KeyCode.ESC,preconditions:()=>!!this._docQuickInsertPopupService.editPopup,priority:1e3})),this._initTrigger(),this._initMenuHandler()}_initTrigger(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{var u,v,I;const{_docQuickInsertPopupService:e,_textSelectionManagerService:t,_commandService:r}=this,o=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC);if(!(o!=null&&o.getDisabled())){if(n.id===_.InsertCommand.id){const a=n.params;if(e.editPopup){e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset+1});return}const d=t.getActiveTextRange();if(!d)return;const l=e.resolvePopup(a.body.dataStream);if(!l||!(l.preconditions?l.preconditions(a):!0))return;e.setInputOffset({start:d.startOffset-1,end:d.startOffset}),setTimeout(()=>{r.executeCommand(ce.id,{index:d.startOffset-1,unitId:a.unitId,popup:l})},100)}if(n.id===_.IMEInputCommand.id){const a=n.params;!e.isComposing&&a.isCompositionStart&&e.setIsComposing(!0),e.isComposing&&a.isCompositionEnd&&e.setIsComposing(!1)}if(n.id===O.RichTextEditingMutation.id){const a=n.params;if(a.isCompositionEnd){const d=(v=(u=a.textRanges)==null?void 0:u[0])==null?void 0:v.endOffset;d&&e.setInputOffset({start:e.inputOffset.start,end:d})}}if(n.id===_.DeleteCommand.id){const a=n.params;if(e.editPopup&&a.direction===s.DeleteDirection.LEFT){const d=(I=a.len)!=null?I:0;e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset-d})}}if(n.id===_.MoveCursorOperation.id){const a=n.params;(a.direction===s.Direction.LEFT||a.direction===s.Direction.RIGHT)&&e.editPopup&&r.executeCommand(U.id)}if(n.id===_.DeleteLeftCommand.id){const a=t.getActiveTextRange();if(!e.editPopup||!a)return;a.endOffset<=e.editPopup.anchor&&r.executeCommand(U.id)}}}))}_initMenuHandler(){this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected(n=>{n.id!==ae.id&&Me.has(n.id)&&this._commandService.executeCommand(n.id)}))}},c.DocQuickInsertTriggerController=ke([j(0,s.ICommandService),j(1,s.Inject(O.DocSelectionManagerService)),j(2,s.Inject(c.DocQuickInsertPopupService)),j(3,s.Inject(p.IShortcutService)),j(4,s.Inject(s.IUniverInstanceService))],c.DocQuickInsertTriggerController);var D=function(){return D=Object.assign||function(i){for(var n,e=1,t=arguments.length;e<t;e++){n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},D.apply(this,arguments)},xe=function(i,n){var e={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&n.indexOf(t)<0&&(e[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,t=Object.getOwnPropertySymbols(i);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(i,t[r])&&(e[t[r]]=i[t[r]]);return e},q=f.forwardRef(function(i,n){var e=i.icon,t=i.id,r=i.className,o=i.extend,u=xe(i,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(t," ").concat(r||"").trim(),I=f.useRef("_".concat(Ee()));return he(e,"".concat(t),{defIds:e.defIds,idSuffix:I.current},D({ref:n,className:v},u),o)});function he(i,n,e,t,r){return f.createElement(i.tag,D(D({key:n},Re(i,e,r)),t),(Qe(i,e).children||[]).map(function(o,u){return he(o,"".concat(n,"-").concat(i.tag,"-").concat(u),e,void 0,r)}))}function Re(i,n,e){var t=D({},i.attrs);e!=null&&e.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=e.colorChannel1),i.tag==="mask"&&t.id&&(t.id=t.id+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];u==="mask"&&typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))});var r=n.defIds;return!r||r.length===0||(i.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function Qe(i,n){var e,t=n.defIds;return!t||t.length===0?i:i.tag==="defs"&&(!((e=i.children)===null||e===void 0)&&e.length)?D(D({},i),{children:i.children.map(function(r){return typeof r.attrs.id=="string"&&t&&t.includes(r.attrs.id)?D(D({},r),{attrs:D(D({},r.attrs),{id:r.attrs.id+n.idSuffix})}):r})}):i}function Ee(){return Math.random().toString(36).substring(2,8)}q.displayName="UniverIcon";var Ue={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.01953 3.13985C1.01953 2.77258 1.31726 2.47485 1.68453 2.47485H2.73713C3.1044 2.47485 3.40213 2.77258 3.40213 3.13985C3.40213 3.50712 3.1044 3.80485 2.73713 3.80485H1.68453C1.31726 3.80485 1.01953 3.50712 1.01953 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.17734 3.13985C4.17734 2.77258 4.47507 2.47485 4.84234 2.47485H6.94754C7.31481 2.47485 7.61254 2.77258 7.61254 3.13985C7.61254 3.50712 7.31481 3.80485 6.94754 3.80485H4.84234C4.47507 3.80485 4.17734 3.50712 4.17734 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.38775 3.13985C8.38775 2.77258 8.68548 2.47485 9.05275 2.47485H11.158C11.5252 2.47485 11.823 2.77258 11.823 3.13985C11.823 3.50712 11.5252 3.80485 11.158 3.80485H9.05275C8.68548 3.80485 8.38775 3.50712 8.38775 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.5982 3.13985C12.5982 2.77258 12.8959 2.47485 13.2632 2.47485H14.3158C14.683 2.47485 14.9808 2.77258 14.9808 3.13985C14.9808 3.50712 14.683 3.80485 14.3158 3.80485H13.2632C12.8959 3.80485 12.5982 3.50712 12.5982 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.01953 7.99972C1.01953 7.63245 1.31726 7.33472 1.68453 7.33472H14.3158C14.683 7.33472 14.9808 7.63245 14.9808 7.99972C14.9808 8.36699 14.683 8.66472 14.3158 8.66472H1.68453C1.31726 8.66472 1.01953 8.36699 1.01953 7.99972Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.68453 12.1951C1.31726 12.1951 1.01953 12.4928 1.01953 12.8601C1.01953 13.2273 1.31726 13.5251 1.68453 13.5251H2.73713C3.1044 13.5251 3.40213 13.2273 3.40213 12.8601C3.40213 12.4928 3.1044 12.1951 2.73713 12.1951H1.68453Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.84234 12.1951C4.47507 12.1951 4.17734 12.4928 4.17734 12.8601C4.17734 13.2273 4.47507 13.5251 4.84234 13.5251H6.94754C7.31481 13.5251 7.61254 13.2273 7.61254 12.8601C7.61254 12.4928 7.31481 12.1951 6.94754 12.1951H4.84234Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M9.05275 12.1951C8.68548 12.1951 8.38775 12.4928 8.38775 12.8601C8.38775 13.2273 8.68548 13.5251 9.05275 13.5251H11.158C11.5252 13.5251 11.823 13.2273 11.823 12.8601C11.823 12.4928 11.5252 12.1951 11.158 12.1951H9.05275Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13.2632 12.1951C12.8959 12.1951 12.5982 12.4928 12.5982 12.8601C12.5982 13.2273 12.8959 13.5251 13.2632 13.5251H14.3158C14.683 13.5251 14.9808 13.2273 14.9808 12.8601C14.9808 12.4928 14.683 12.1951 14.3158 12.1951H13.2632Z"}}]},F=f.forwardRef(function(i,n){return f.createElement(q,Object.assign({},i,{id:"divider-icon",ref:n,icon:Ue}))});F.displayName="DividerIcon";var je={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},fe=f.forwardRef(function(i,n){return f.createElement(q,Object.assign({},i,{id:"increase-icon",ref:n,icon:je}))});fe.displayName="IncreaseIcon";var $e={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#text-icon_clip0_1293_26)"},children:[{tag:"path",attrs:{d:"M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z"}},{tag:"path",attrs:{d:"M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"text-icon_clip0_1293_26"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.9)"}}]}]}],defIds:["text-icon_clip0_1293_26"]},G=f.forwardRef(function(i,n){return f.createElement(q,Object.assign({},i,{id:"text-icon",ref:n,icon:$e}))});G.displayName="TextIcon";const ge="doc.quick-insert.button";var Ne=Object.getOwnPropertyDescriptor,Te=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ne(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},z=(i,n)=>(e,t)=>n(e,t,i);let A=class extends s.Disposable{constructor(n,e,t,r){super();P(this,"_popup$",new C.BehaviorSubject(null));P(this,"popup$",this._popup$.asObservable());this._context=n,this._docEventManagerService=e,this._docQuickInsertPopupService=t,this._docCanvasPopManagerService=r,this._init()}get popup(){return this._popup$.value}_init(){this.disposeWithMe(C.combineLatest([this._docEventManagerService.hoverParagraphLeftRealTime$,this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([n,e])=>{var o;const t=n!=null?n:e,r=this._context.unit.getDisabled();if(!t||r){this._hideMenu(!0);return}if(t.paragraphStart===t.paragraphEnd){if(this._docQuickInsertPopupService.editPopup||t.startIndex===((o=this.popup)==null?void 0:o.startIndex))return;this._hideMenu(!0);const u=this._docCanvasPopManagerService.attachPopupToRect(t.firstLine,{componentKey:ge,direction:"left-center"},this._context.unit.getUnitId());this._popup$.next({startIndex:t.startIndex,disposable:u})}else this._hideMenu(!0)}))}_hideMenu(n){this._docQuickInsertPopupService.editPopup||this.popup&&(n||this.popup.disposable.canDispose())&&(this.popup.disposable.dispose(),this._popup$.next(null))}};A=Te([z(1,s.Inject(_.DocEventManagerService)),z(2,s.Inject(c.DocQuickInsertPopupService)),z(3,s.Inject(_.DocCanvasPopManagerService))],A);const Y=({className:i=""})=>{const n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(s.IUniverInstanceService),t=p.useDependency(Z.IRenderManagerService),r=p.useObservable(f.useMemo(()=>e.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_DOC),[e])),o=r&&t.getRenderById(r.getUnitId()),u=o==null?void 0:o.with(A),v=p.useDependency(p.ILayoutService),I=p.useDependency(O.DocSelectionManagerService),a=p.useObservable(n.editPopup$),d=p.useEvent(l=>{var $;const h=u==null?void 0:u.popup;if(!h)return;const w=n.popups,M={keyword:"",menus$:C.combineLatest(w.map(b=>b.menus$)).pipe(C.map(b=>b.flat()))};I.replaceDocRanges([{startOffset:h.startIndex,endOffset:h.startIndex}]),n.setInputOffset({start:h.startIndex-1,end:h.startIndex-1}),n.showPopup({popup:M,index:h.startIndex-1,unitId:($=r==null?void 0:r.getUnitId())!=null?$:""}),setTimeout(()=>{v.focus()})});return m.jsx("div",{className:k.clsx("univer-mr-1 univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-full univer-p-1.5 univer-shadow-sm hover:univer-bg-gray-100 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-700",k.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-700":a,"univer-bg-white dark:!univer-bg-gray-900":!a},i),role:"button",tabIndex:0,onClick:d,children:m.jsx(fe,{className:"univer-text-gray-800 dark:!univer-text-gray-200"})})};Y.componentKey=ge;var Ke=Object.getOwnPropertyDescriptor,He=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ke(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},J=(i,n)=>(e,t)=>n(e,t,i);c.DocQuickInsertUIController=class extends s.Disposable{constructor(n,e,t){super(),this._commandService=n,this._docQuickInsertPopupService=e,this._componentManager=t,this._initCommands(),this._initComponents(),this._initMenus()}_initCommands(){[ne,ce,U].forEach(n=>{this.disposeWithMe(this._commandService.registerCommand(n))})}_initComponents(){[[L.componentKey,L],[K.componentKey,K],[H.componentKey,H],[F.displayName,F],[G.displayName,G],[Y.componentKey,Y]].forEach(([e,t])=>{e&&this.disposeWithMe(this._componentManager.register(e,t))}),[{keyword:"/",menus$:C.of(we),preconditions:e=>{var t;return((t=e.range.startNodePosition)==null?void 0:t.glyph)===0}}].forEach(e=>{this.disposeWithMe(this._docQuickInsertPopupService.registerPopup(e))})}_initMenus(){}},c.DocQuickInsertUIController=He([J(0,s.ICommandService),J(1,s.Inject(c.DocQuickInsertPopupService)),J(2,s.Inject(p.ComponentManager))],c.DocQuickInsertUIController);const Le="docs-quick-insert-ui.config",me={};var qe=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,Be=(i,n,e)=>n in i?qe(i,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[n]=e,We=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ae(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},X=(i,n)=>(e,t)=>n(e,t,i),Ie=(i,n,e)=>Be(i,typeof n!="symbol"?n+"":n,e);const Ze="DOC_QUICK_INSERT_UI_PLUGIN";c.UniverDocsQuickInsertUIPlugin=class extends s.Plugin{constructor(n=me,e,t,r){super(),this._config=n,this._injector=e,this._renderManagerSrv=t,this._configService=r;const{menu:o,...u}=s.merge({},me,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(Le,u)}onStarting(){[[c.DocQuickInsertUIController],[c.DocQuickInsertTriggerController],[c.DocQuickInsertPopupService]].forEach(e=>this._injector.add(e)),this._injector.get(c.DocQuickInsertUIController)}onRendered(){this._injector.get(c.DocQuickInsertTriggerController),this._injector.get(c.DocQuickInsertPopupService),[[A]].forEach(n=>{this._renderManagerSrv.registerRenderModule(s.UniverInstanceType.UNIVER_DOC,n)})}},Ie(c.UniverDocsQuickInsertUIPlugin,"type",s.UniverInstanceType.UNIVER_DOC),Ie(c.UniverDocsQuickInsertUIPlugin,"pluginName",Ze),c.UniverDocsQuickInsertUIPlugin=We([s.DependentOn(ye.UniverDrawingUIPlugin,Se.UniverDrawingPlugin,te.UniverDocsDrawingUIPlugin,_e.UniverDocsDrawingPlugin,p.UniverUIPlugin),X(1,s.Inject(s.Injector)),X(2,s.Inject(Z.IRenderManagerService)),X(3,s.IConfigService)],c.UniverDocsQuickInsertUIPlugin),c.KeywordInputPlaceholderComponentKey=ie,c.QuickInsertPlaceholderComponentKey=re,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/umd/locale/ca-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiCaES=t())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Llista numerada",bulletedList:"Llista amb vinyetes",divider:"Divisor",text:"Text",table:"Taula",image:"Imatge"},group:{basics:"Bàsics"},placeholder:"No s'han trobat resultats",keywordInputPlaceholder:"Introdueix paraules clau"}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiCaES=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Llista numerada",bulletedList:"Llista amb vinyetes",divider:"Divisor",text:"Text",table:"Taula",image:"Imatge"},group:{basics:"Bàsics"},placeholder:"No s'han trobat resultats",keywordInputPlaceholder:"Introdueix paraules clau"}}}));
|
package/lib/umd/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiEnUS=t())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Numbered List",bulletedList:"Bulleted List",divider:"Divider",text:"Text",table:"Table",image:"Image"},group:{basics:"Basics"},placeholder:"No results found",keywordInputPlaceholder:"Enter keywords"}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiEnUS=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Numbered List",bulletedList:"Bulleted List",divider:"Divider",text:"Text",table:"Table",image:"Image"},group:{basics:"Basics"},placeholder:"No results found",keywordInputPlaceholder:"Enter keywords"}}}));
|
package/lib/umd/locale/es-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiEsES=t())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Lista numerada",bulletedList:"Lista con viñetas",divider:"Divisor",text:"Texto",table:"Tabla",image:"Imagen"},group:{basics:"Básicos"},placeholder:"No se han encontrado resultados",keywordInputPlaceholder:"Introduce palabras clave"}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiEsES=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Lista numerada",bulletedList:"Lista con viñetas",divider:"Divisor",text:"Texto",table:"Tabla",image:"Imagen"},group:{basics:"Básicos"},placeholder:"No se han encontrado resultados",keywordInputPlaceholder:"Introduce palabras clave"}}}));
|
package/lib/umd/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiFaIR=i())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"لیست شمارهدار",bulletedList:"لیست نقطهدار",divider:"خط تقسیم",text:"متن",table:"جدول",image:"تصویر"},group:{basics:"بنیادی"},placeholder:"هیچ نتیجهای یافت نشد",keywordInputPlaceholder:"وارد کلمات کلیدی"}}});
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiFaIR=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"لیست شمارهدار",bulletedList:"لیست نقطهدار",divider:"خط تقسیم",text:"متن",table:"جدول",image:"تصویر"},group:{basics:"بنیادی"},placeholder:"هیچ نتیجهای یافت نشد",keywordInputPlaceholder:"وارد کلمات کلیدی"}}}));
|
package/lib/umd/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiFrFR=t())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Liste numérotée",bulletedList:"Liste à puces",divider:"Ligne de séparation",text:"Texte",table:"Tableau",image:"Image"},group:{basics:"Basiques"},placeholder:"Aucun résultat",keywordInputPlaceholder:"Entrez des mots clés"}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiFrFR=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Liste numérotée",bulletedList:"Liste à puces",divider:"Ligne de séparation",text:"Texte",table:"Tableau",image:"Image"},group:{basics:"Basiques"},placeholder:"Aucun résultat",keywordInputPlaceholder:"Entrez des mots clés"}}}));
|
package/lib/umd/locale/ko-KR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiKoKR=i())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"번호가 매겨진 목록",bulletedList:"글머리 기호 목록",divider:"구분선",text:"텍스트",table:"표",image:"이미지"},group:{basics:"기본"},placeholder:"결과가 없습니다",keywordInputPlaceholder:"키워드 입력"}}});
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiKoKR=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"번호가 매겨진 목록",bulletedList:"글머리 기호 목록",divider:"구분선",text:"텍스트",table:"표",image:"이미지"},group:{basics:"기본"},placeholder:"결과가 없습니다",keywordInputPlaceholder:"키워드 입력"}}}));
|
package/lib/umd/locale/ru-RU.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiRuRU=i())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Список с нумерацией",bulletedList:"Маркированный список",divider:"Разделительная линия",text:"Текст",table:"Таблица",image:"Изображение"},group:{basics:"Основные"},placeholder:"Нет результатов",keywordInputPlaceholder:"Введите ключевые слова"}}});
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiRuRU=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Список с нумерацией",bulletedList:"Маркированный список",divider:"Разделительная линия",text:"Текст",table:"Таблица",image:"Изображение"},group:{basics:"Основные"},placeholder:"Нет результатов",keywordInputPlaceholder:"Введите ключевые слова"}}}));
|
package/lib/umd/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiViVN=n())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Danh sách được đánh số",bulletedList:"Danh sách không được đánh số",divider:"Đường phân cách",text:"Văn bản",table:"Bảng",image:"Hình ảnh"},group:{basics:"Cơ bản"},placeholder:"Không có kết quả",keywordInputPlaceholder:"Nhập từ khóa"}}});
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiViVN=n())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Danh sách được đánh số",bulletedList:"Danh sách không được đánh số",divider:"Đường phân cách",text:"Văn bản",table:"Bảng",image:"Hình ảnh"},group:{basics:"Cơ bản"},placeholder:"Không có kết quả",keywordInputPlaceholder:"Nhập từ khóa"}}}));
|
package/lib/umd/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiZhCN=i())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"有序列表",bulletedList:"无序列表",divider:"分隔线",text:"文本",table:"表格",image:"图片"},group:{basics:"基础"},placeholder:"暂无结果",keywordInputPlaceholder:"输入关键词"}}});
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiZhCN=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"有序列表",bulletedList:"无序列表",divider:"分隔线",text:"文本",table:"表格",image:"图片"},group:{basics:"基础"},placeholder:"暂无结果",keywordInputPlaceholder:"输入关键词"}}}));
|
package/lib/umd/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiZhTW=i())})(this,function(){"use strict";return{docQuickInsert:{menu:{numberedList:"有序列表",bulletedList:"無序列表",divider:"分隔線",text:"文本",table:"表格",image:"圖片"},group:{basics:"基礎"},placeholder:"無結果",keywordInputPlaceholder:"輸入關鍵詞"}}});
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiZhTW=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"有序列表",bulletedList:"無序列表",divider:"分隔線",text:"文本",table:"表格",image:"圖片"},group:{basics:"基礎"},placeholder:"無結果",keywordInputPlaceholder:"輸入關鍵詞"}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs-quick-insert-ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4-nightly.202508220605",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -53,26 +53,26 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@univerjs/icons": "^0.4.6",
|
|
56
|
-
"@univerjs/core": "0.10.
|
|
57
|
-
"@univerjs/
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/docs-drawing": "0.10.
|
|
60
|
-
"@univerjs/docs-
|
|
61
|
-
"@univerjs/
|
|
62
|
-
"@univerjs/drawing
|
|
63
|
-
"@univerjs/drawing": "0.10.
|
|
64
|
-
"@univerjs/
|
|
65
|
-
"@univerjs/
|
|
56
|
+
"@univerjs/core": "0.10.4-nightly.202508220605",
|
|
57
|
+
"@univerjs/docs": "0.10.4-nightly.202508220605",
|
|
58
|
+
"@univerjs/design": "0.10.4-nightly.202508220605",
|
|
59
|
+
"@univerjs/docs-drawing-ui": "0.10.4-nightly.202508220605",
|
|
60
|
+
"@univerjs/docs-ui": "0.10.4-nightly.202508220605",
|
|
61
|
+
"@univerjs/drawing": "0.10.4-nightly.202508220605",
|
|
62
|
+
"@univerjs/docs-drawing": "0.10.4-nightly.202508220605",
|
|
63
|
+
"@univerjs/drawing-ui": "0.10.4-nightly.202508220605",
|
|
64
|
+
"@univerjs/engine-render": "0.10.4-nightly.202508220605",
|
|
65
|
+
"@univerjs/ui": "0.10.4-nightly.202508220605"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"postcss": "^8.5.6",
|
|
69
69
|
"react": "18.3.1",
|
|
70
70
|
"rxjs": "^7.8.2",
|
|
71
71
|
"tailwindcss": "3.4.17",
|
|
72
|
-
"typescript": "^5.
|
|
73
|
-
"vite": "^7.
|
|
72
|
+
"typescript": "^5.9.2",
|
|
73
|
+
"vite": "^7.1.3",
|
|
74
74
|
"vitest": "^3.2.4",
|
|
75
|
-
"@univerjs-infra/shared": "0.10.
|
|
75
|
+
"@univerjs-infra/shared": "0.10.4"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"test": "vitest run",
|
package/LICENSE
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|