@univerjs/docs-ui 0.10.4 → 0.10.5
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/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- 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 +11 -11
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/core/facade","@univerjs/docs-ui","@univerjs/engine-render"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.UniverDocsUiFacade={},n.UniverCore,n.UniverCoreFacade,n.UniverDocsUi,n.UniverEngineRender))})(this,function(n,e,a,v,h){"use strict";var D=Object.defineProperty;var U=(n,e,a)=>e in n?D(n,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[e]=a;var m=(n,e,a)=>U(n,typeof e!="symbol"?e+"":e,a);var _=Object.getOwnPropertyDescriptor,g=(o,t,r,i)=>{for(var s=i>1?void 0:i?_(t,r):t,c=o.length-1,u;c>=0;c--)(u=o[c])&&(s=u(s)||s);return s},d=(o,t)=>(r,i)=>t(r,i,o);n.FDocument=class{constructor(t,r,i,s,c,u){m(this,"id");this._documentDataModel=t,this._injector=r,this._univerInstanceService=i,this._commandService=s,this._resourceManagerService=c,this._renderManagerService=u,this.id=this._documentDataModel.getUnitId()}getId(){return this._documentDataModel.getUnitId()}getName(){return this.getSnapshot().title||""}getSnapshot(){const t=this._resourceManagerService.getResourcesByType(this.id,e.UniverInstanceType.UNIVER_DOC),r=this._documentDataModel.getSnapshot();return r.resources=t,r}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(e.UndoCommand.id)}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(e.RedoCommand.id)}appendText(t){const r=this.id,{body:i}=this.getSnapshot();if(!i)throw new Error("The document body is empty");const s=i.dataStream.length-2,c={startOffset:s,endOffset:s,collapsed:!0,segmentId:""},{segmentId:u}=c;return this._commandService.executeCommand(v.InsertCommand.id,{unitId:r,body:{dataStream:t},range:c,segmentId:u})}setSelection(t,r){var s;const i=(s=this._renderManagerService.getRenderById(this.getId()))==null?void 0:s.with(v.DocSelectionRenderService);i==null||i.removeAllRanges(),i==null||i.addDocRanges([{startOffset:t,endOffset:r,rangeType:e.DOC_RANGE_TYPE.TEXT}],!0)}},n.FDocument=g([d(1,e.Inject(e.Injector)),d(2,e.IUniverInstanceService),d(3,e.ICommandService),d(4,e.IResourceManagerService),d(5,h.IRenderManagerService)],n.FDocument);class I extends a.FUniver{createUniverDoc(t){const r=this._univerInstanceService.createUnit(e.UniverInstanceType.UNIVER_DOC,t);return this._injector.createInstance(n.FDocument,r)}getActiveDocument(){const t=this._univerInstanceService.getCurrentUnitForType(e.UniverInstanceType.UNIVER_DOC);return t?this._injector.createInstance(n.FDocument,t):null}getUniverDoc(t){const r=this._univerInstanceService.getUniverDocInstance(t);return r?this._injector.createInstance(n.FDocument,r):null}}a.FUniver.extend(I),Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/core/facade","@univerjs/docs-ui","@univerjs/engine-render"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.UniverDocsUiFacade={},n.UniverCore,n.UniverCoreFacade,n.UniverDocsUi,n.UniverEngineRender))})(this,(function(n,e,a,v,h){"use strict";var D=Object.defineProperty;var U=(n,e,a)=>e in n?D(n,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[e]=a;var m=(n,e,a)=>U(n,typeof e!="symbol"?e+"":e,a);var _=Object.getOwnPropertyDescriptor,g=(o,t,r,i)=>{for(var s=i>1?void 0:i?_(t,r):t,c=o.length-1,u;c>=0;c--)(u=o[c])&&(s=u(s)||s);return s},d=(o,t)=>(r,i)=>t(r,i,o);n.FDocument=class{constructor(t,r,i,s,c,u){m(this,"id");this._documentDataModel=t,this._injector=r,this._univerInstanceService=i,this._commandService=s,this._resourceManagerService=c,this._renderManagerService=u,this.id=this._documentDataModel.getUnitId()}getId(){return this._documentDataModel.getUnitId()}getName(){return this.getSnapshot().title||""}getSnapshot(){const t=this._resourceManagerService.getResourcesByType(this.id,e.UniverInstanceType.UNIVER_DOC),r=this._documentDataModel.getSnapshot();return r.resources=t,r}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(e.UndoCommand.id)}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(e.RedoCommand.id)}appendText(t){const r=this.id,{body:i}=this.getSnapshot();if(!i)throw new Error("The document body is empty");const s=i.dataStream.length-2,c={startOffset:s,endOffset:s,collapsed:!0,segmentId:""},{segmentId:u}=c;return this._commandService.executeCommand(v.InsertCommand.id,{unitId:r,body:{dataStream:t},range:c,segmentId:u})}setSelection(t,r){var s;const i=(s=this._renderManagerService.getRenderById(this.getId()))==null?void 0:s.with(v.DocSelectionRenderService);i==null||i.removeAllRanges(),i==null||i.addDocRanges([{startOffset:t,endOffset:r,rangeType:e.DOC_RANGE_TYPE.TEXT}],!0)}},n.FDocument=g([d(1,e.Inject(e.Injector)),d(2,e.IUniverInstanceService),d(3,e.ICommandService),d(4,e.IResourceManagerService),d(5,h.IRenderManagerService)],n.FDocument);class I extends a.FUniver{createUniverDoc(t){const r=this._univerInstanceService.createUnit(e.UniverInstanceType.UNIVER_DOC,t);return this._injector.createInstance(n.FDocument,r)}getActiveDocument(){const t=this._univerInstanceService.getCurrentUnitForType(e.UniverInstanceType.UNIVER_DOC);return t?this._injector.createInstance(n.FDocument,t):null}getUniverDoc(t){const r=this._univerInstanceService.getUniverDocInstance(t);return r?this._injector.createInstance(n.FDocument,r):null}}a.FUniver.extend(I),Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/umd/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(y,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/drawing"),require("rxjs"),require("rxjs/operators"),require("react/jsx-runtime"),require("react"),require("@univerjs/design")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/engine-render","@univerjs/ui","@univerjs/drawing","rxjs","rxjs/operators","react/jsx-runtime","react","@univerjs/design"],a):(y=typeof globalThis<"u"?globalThis:y||self,a(y.UniverDocsUi={},y.UniverCore,y.UniverDocs,y.UniverEngineRender,y.UniverUi,y.UniverDrawing,y.rxjs,y.rxjs.operators,y.React,y.React,y.UniverDesign))})(this,function(y,a,D,_,I,xn,L,dt,P,w,J){"use strict";var DA=Object.defineProperty;var BA=(y,a,D)=>a in y?DA(y,a,{enumerable:!0,configurable:!0,writable:!0,value:D}):y[a]=D;var B=(y,a,D)=>BA(y,typeof a!="symbol"?a+"":a,D);var ms=Object.getOwnPropertyDescriptor,ps=(i,t,e,n)=>{for(var o=n>1?void 0:n?ms(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},no=(i,t)=>(e,n)=>t(e,n,i);y.DocAutoFormatService=class extends a.Disposable{constructor(e,n){super();B(this,"_matches",new Map);this._univerInstanceService=e,this._textSelectionManagerService=n}registerAutoFormat(e){const n=this._matches.get(e.id);return n?(n.push(e),n.sort((o,s)=>{var r,c;return((r=s.priority)!=null?r:0)-((c=o.priority)!=null?c:0)})):this._matches.set(e.id,[e]),a.toDisposable(()=>{const o=this._matches.get(e.id);if(o){const s=o.findIndex(r=>r===e);s>=0&&o.splice(s,1)}})}onAutoFormat(e,n){var l,A,d,u,m,h,g,p,f;const o=(l=this._matches.get(e))!=null?l:[],s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),r=this._textSelectionManagerService.getDocRanges(),c=(A=r.find(S=>S.isActive))!=null?A:r[0];if(s&&c){const S=s.getSelfOrHeaderFooterModel(c.segmentId),E={unit:S,selection:c,isBody:!c.segmentId,paragraphs:a.BuildTextUtils.range.getParagraphsInRange(c,(u=(d=S.getBody())==null?void 0:d.paragraphs)!=null?u:[],(h=(m=S.getBody())==null?void 0:m.dataStream)!=null?h:""),customRanges:a.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(c,(p=(g=S.getBody())==null?void 0:g.customRanges)!=null?p:[]),commandId:e,commandParams:n},C=o.find(T=>T.match(E));return(f=C==null?void 0:C.getMutations(E))!=null?f:[]}return[]}},y.DocAutoFormatService=ps([no(0,a.IUniverInstanceService),no(1,a.Inject(D.DocSelectionManagerService))],y.DocAutoFormatService);const io={undo:!0,redo:!0,font:!0,fontSize:!0,bold:!0,italic:!0,strikethrough:!0,underline:!0,textColor:!0,fillColor:!0,horizontalAlignMode:!0,verticalAlignMode:!0,textWrapMode:!0,textRotateMode:!0},oo={outerLeft:!1,outerRight:!1,header:!0,footer:!0,innerLeft:!1,innerRight:!1,frozenHeaderLT:!1,frozenHeaderRT:!1,frozenHeaderLM:!1,frozenContent:!1,infoBar:!0,toolbar:!0},ao="DOC_UI_PLUGIN";var Ae=(i=>(i.MAIN="__Document_Render_Main__",i.BACKGROUND="__Document_Render_Background__",i))(Ae||{}),se=(i=>(i.VIEW_MAIN="viewMain",i.VIEW_TOP="viewTop",i.VIEW_LEFT="viewLeft",i.VIEW_LEFT_TOP="viewLeftTop",i))(se||{});const so=0,Ut=2,ro=4,Dn=10,fs="normalTextSelectionPluginName";function Ie(i){const{mainComponent:t,scene:e,engine:n,components:o}=i,s=t,r=o.get(Ae.BACKGROUND);return{document:s,docBackground:r,scene:e,engine:n}}function co(i,t){const e=i.getCurrentUnitOfType(a.UniverInstanceType.UNIVER_DOC);if(!e)return null;const n=e.getUnitId(),o=t.getRenderById(n);if(o==null)return;const{mainComponent:s,scene:r,engine:c,components:l}=o,A=s,d=l.get(Ae.BACKGROUND);return{document:A,docBackground:d,scene:r,engine:c}}function Ss(i,t){const e=t.getRenderById(i);if(e==null)return;const{mainComponent:n,scene:o,engine:s,components:r}=e,c=n,l=r.get(Ae.BACKGROUND);return{document:c,docBackground:l,scene:o,engine:s}}function lo(i){const{unitId:t,ranges:e,id:n,type:o,segmentId:s}=i,r={id:D.RichTextEditingMutation.id,params:{unitId:t,actions:[],textRanges:void 0,segmentId:s}},c=a.JSONX.getInstance(),l=a.BuildTextUtils.customDecoration.add({ranges:e,id:n,type:o});return r.params.actions=c.editOp(l.serialize()),r}function Is(i,t){const{segmentId:e,id:n,type:o,unitId:s}=t,r=i.get(D.DocSelectionManagerService),c=i.get(a.IUniverInstanceService),l=s?c.getUnit(s,a.UniverInstanceType.UNIVER_DOC):c.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);if(!l)return!1;const A=l.getUnitId(),d=r.getTextRanges({unitId:A,subUnitId:A});return!d||!l.getBody()?!1:lo({unitId:A,ranges:d,id:n,type:o,segmentId:e})}function vs(i,t){const{unitId:e,id:n,segmentId:o}=t,r=i.get(a.IUniverInstanceService).getUnit(e);if(!r)return!1;const c={id:D.RichTextEditingMutation.id,params:{unitId:e,actions:[],textRanges:void 0,segmentId:o}},l=a.BuildTextUtils.customDecoration.delete({id:n,segmentId:o,documentDataModel:r});if(!l)return!1;const A=a.JSONX.getInstance();return c.params.actions=A.editOp(l.serialize()),c}function Es(i,t){return t.some(e=>i.startIndex>e.startIndex&&i.startIndex<e.endIndex)}function Lt(i,t,e,n,o){const{textRuns:s=[],dataStream:r}=i,c=o&&r.startsWith("="),l={st:0,ed:0,ts:{}};if(c)return l;for(let A=s.length-1;A>=0;A--){const d=s[A],{st:u,ed:m}=d;t>u&&t<=m&&(l.st=u,l.ed=m,l.ts={...l.ts,...d.ts})}if(t===0){const A=s==null?void 0:s[0];A&&A.st===0&&(l.ts={...l.ts,...A.ts})}return n&&(l.ts={...l.ts,...n}),l}function Bn(i,t,e){if(e){const o=i.find(s=>t>=s.startIndex&&t<=s.endIndex+1);return o!=null&&o.wholeEntity?null:o}const n=i.find(o=>t>o.startIndex&&t<=o.endIndex);return n!=null&&n.wholeEntity?null:n}function _n(i,t){return i.filter(e=>t>e.startIndex&&t<=e.endIndex)}function Cs(i){return{left:i.positionH.posOffset,top:i.positionV.posOffset,width:i.size.width,height:i.size.height}}function Ts(i,t=0,e=0){return{size:{width:i.width,height:i.height},positionH:{relativeFrom:a.ObjectRelativeFromH.MARGIN,posOffset:(i.left||0)-t},positionV:{relativeFrom:a.ObjectRelativeFromV.PAGE,posOffset:(i.top||0)-e},angle:i.angle||0}}const ke={id:"doc.command.tab",type:a.CommandType.COMMAND,async handler(i,t){const n=i.get(y.DocAutoFormatService).onAutoFormat(ke.id,t);return(await a.sequenceExecuteAsync(n,i.get(a.ICommandService))).result}},At={id:"doc.command.after-space",type:a.CommandType.COMMAND,async handler(i){const e=i.get(y.DocAutoFormatService).onAutoFormat(At.id);return(await a.sequenceExecuteAsync(e,i.get(a.ICommandService))).result}},Ye={id:"doc.command.enter",type:a.CommandType.COMMAND,async handler(i){const e=i.get(y.DocAutoFormatService).onAutoFormat(Ye.id);return(await a.sequenceExecuteAsync(e,i.get(a.ICommandService))).result}};var ys=Object.getOwnPropertyDescriptor,bs=(i,t,e,n)=>{for(var o=n>1?void 0:n?ys(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Nn=(i,t)=>(e,n)=>t(e,n,i);const Os=11,Rs=9,Qt={ff:"Arial",fs:Os};let ve=class extends a.Disposable{constructor(t,e,n){super();B(this,"_cacheStyle",null);this._textSelectionManagerService=t,this._univerInstanceService=e,this._renderManagerService=n,this._init()}_init(){this._listenDocRangeChange()}_listenDocRangeChange(){this.disposeWithMe(this._textSelectionManagerService.textSelection$.subscribe(()=>{this._clearStyleCache()}))}getStyleCache(){return this._cacheStyle}getDefaultStyle(){var r;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);if(t==null)return{...Qt};const e=t==null?void 0:t.getUnitId(),n=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.with(D.DocSkeletonManagerService),o=n==null?void 0:n.getViewModel();return o==null?{...Qt}:o.getEditArea()===_.DocumentEditArea.BODY?{...Qt}:{...Qt,fs:Rs}}setStyleCache(t){this._cacheStyle={...this._cacheStyle,...t}}_clearStyleCache(){this._cacheStyle=null}};ve=bs([Nn(0,a.Inject(D.DocSelectionManagerService)),Nn(1,a.IUniverInstanceService),Nn(2,_.IRenderManagerService)],ve);function re(i,t){var n;return(n=i.get(_.IRenderManagerService).getRenderById(t))==null?void 0:n.with(D.DocSkeletonManagerService)}function Z(i,t=""){if(!t)return["body"];const{headers:e,footers:n}=i.getSnapshot();if(e==null&&n==null)throw new Error("Document data model must have headers or footers when update by segment id");if((e==null?void 0:e[t])!=null)return["headers",t,"body"];if((n==null?void 0:n[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}function Pn(i,t,e){const n=[];for(let o=0,s=i.length;o<s;o++)i[o]===a.DataStreamTreeTokenType.PARAGRAPH&&n.push({startIndex:o});if(t)for(const o of n)t.bullet&&(o.bullet=a.Tools.deepClone(t.bullet)),t.paragraphStyle&&(o.paragraphStyle=a.Tools.deepClone(t.paragraphStyle),delete o.paragraphStyle.borderBottom,t.paragraphStyle.headingId&&(o.paragraphStyle.headingId=a.generateRandomId(6)));if(e)for(const o of n)o.paragraphStyle||(o.paragraphStyle={}),o.paragraphStyle.borderBottom=e;return n}const Ft={id:"doc.command.break-line",type:a.CommandType.COMMAND,handler:(i,t)=>{var Q,X,j,k,W;const e=i.get(D.DocSelectionManagerService),n=i.get(a.IUniverInstanceService),o=i.get(a.ICommandService),s=i.get(ve),r=(Q=t==null?void 0:t.textRange)!=null?Q:e.getActiveTextRange(),c=e.getRectRanges();if(r==null)return!1;if(c&&c.length){const{startOffset:G}=r;return e.replaceDocRanges([{startOffset:G,endOffset:G}]),!0}const{horizontalLine:l}=t!=null?t:{},{segmentId:A}=r,d=n.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),u=d==null?void 0:d.getSelfOrHeaderFooterModel(A!=null?A:"").getBody();if(d==null||u==null)return!1;const m=d.getUnitId(),{startOffset:h,endOffset:g}=r,f=((X=u.paragraphs)!=null?X:[]).find(G=>G.startIndex>=h);if(!f)return!1;const S=h===f.startIndex,E=f.startIndex,C=s.getDefaultStyle(),T=s.getStyleCache(),R=Lt(u,g,C,T),v={dataStream:a.DataStreamTreeTokenType.PARAGRAPH,paragraphs:Pn(a.DataStreamTreeTokenType.PARAGRAPH,f,l),textRuns:[{st:0,ed:1,ts:{...R.ts}}]};if(d==null)return!1;const O=e.getActiveTextRange();if(u==null)return!1;const{collapsed:M}=r,b=v.dataStream.length,N=[{startOffset:h+b,endOffset:h+b,style:O==null?void 0:O.style,collapsed:M}],x={id:D.RichTextEditingMutation.id,params:{unitId:m,actions:[],textRanges:N,debounce:!0}},U=new a.TextX,F=a.JSONX.getInstance();if(M)h>0&&U.push({t:a.TextXActionType.RETAIN,len:h}),U.push({t:a.TextXActionType.INSERT,body:v,len:v.dataStream.length});else{const G=a.BuildTextUtils.selection.delete([r],u,0,v);U.push(...G)}(((j=f.bullet)==null?void 0:j.listType)===a.PresetListType.CHECK_LIST_CHECKED||(k=f.paragraphStyle)!=null&&k.headingId)&&(r.endOffset<E&&U.push({t:a.TextXActionType.RETAIN,len:E-r.endOffset}),U.push({t:a.TextXActionType.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...f,paragraphStyle:{...f.paragraphStyle,...S?{headingId:void 0,namedStyleType:void 0}:null},startIndex:0,bullet:(W=f.paragraphStyle)!=null&&W.headingId?void 0:{...f.bullet,listType:a.PresetListType.CHECK_LIST}}]},coverType:a.UpdateDocsAttributeType.REPLACE})),x.params.textRanges=[{startOffset:h+b,endOffset:h+b,collapsed:M}];const V=Z(d,A);return x.params.actions=F.editOp(U.serialize(),V),!!o.syncExecuteCommand(x.id,x.params)}};var Ht=(i=>(i[i.ABOVE=0]="ABOVE",i[i.BELLOW=1]="BELLOW",i))(Ht||{}),wn=(i=>(i[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT",i))(wn||{});function Ms(i,t){let e=a.DataStreamTreeTokenType.TABLE_START;const n=[],o=[];for(let s=0;s<i;s++){e+=a.DataStreamTreeTokenType.TABLE_ROW_START;for(let r=0;r<t;r++)e+=`${a.DataStreamTreeTokenType.TABLE_CELL_START}\r
|
|
1
|
+
(function(y,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/drawing"),require("rxjs"),require("rxjs/operators"),require("react/jsx-runtime"),require("react"),require("@univerjs/design")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/engine-render","@univerjs/ui","@univerjs/drawing","rxjs","rxjs/operators","react/jsx-runtime","react","@univerjs/design"],a):(y=typeof globalThis<"u"?globalThis:y||self,a(y.UniverDocsUi={},y.UniverCore,y.UniverDocs,y.UniverEngineRender,y.UniverUi,y.UniverDrawing,y.rxjs,y.rxjs.operators,y.React,y.React,y.UniverDesign))})(this,(function(y,a,D,_,I,xn,L,dt,P,w,J){"use strict";var DA=Object.defineProperty;var BA=(y,a,D)=>a in y?DA(y,a,{enumerable:!0,configurable:!0,writable:!0,value:D}):y[a]=D;var B=(y,a,D)=>BA(y,typeof a!="symbol"?a+"":a,D);var ms=Object.getOwnPropertyDescriptor,ps=(i,t,e,n)=>{for(var o=n>1?void 0:n?ms(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},no=(i,t)=>(e,n)=>t(e,n,i);y.DocAutoFormatService=class extends a.Disposable{constructor(e,n){super();B(this,"_matches",new Map);this._univerInstanceService=e,this._textSelectionManagerService=n}registerAutoFormat(e){const n=this._matches.get(e.id);return n?(n.push(e),n.sort((o,s)=>{var r,c;return((r=s.priority)!=null?r:0)-((c=o.priority)!=null?c:0)})):this._matches.set(e.id,[e]),a.toDisposable(()=>{const o=this._matches.get(e.id);if(o){const s=o.findIndex(r=>r===e);s>=0&&o.splice(s,1)}})}onAutoFormat(e,n){var l,A,d,u,m,h,g,p,f;const o=(l=this._matches.get(e))!=null?l:[],s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),r=this._textSelectionManagerService.getDocRanges(),c=(A=r.find(S=>S.isActive))!=null?A:r[0];if(s&&c){const S=s.getSelfOrHeaderFooterModel(c.segmentId),E={unit:S,selection:c,isBody:!c.segmentId,paragraphs:a.BuildTextUtils.range.getParagraphsInRange(c,(u=(d=S.getBody())==null?void 0:d.paragraphs)!=null?u:[],(h=(m=S.getBody())==null?void 0:m.dataStream)!=null?h:""),customRanges:a.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(c,(p=(g=S.getBody())==null?void 0:g.customRanges)!=null?p:[]),commandId:e,commandParams:n},C=o.find(T=>T.match(E));return(f=C==null?void 0:C.getMutations(E))!=null?f:[]}return[]}},y.DocAutoFormatService=ps([no(0,a.IUniverInstanceService),no(1,a.Inject(D.DocSelectionManagerService))],y.DocAutoFormatService);const io={undo:!0,redo:!0,font:!0,fontSize:!0,bold:!0,italic:!0,strikethrough:!0,underline:!0,textColor:!0,fillColor:!0,horizontalAlignMode:!0,verticalAlignMode:!0,textWrapMode:!0,textRotateMode:!0},oo={outerLeft:!1,outerRight:!1,header:!0,footer:!0,innerLeft:!1,innerRight:!1,frozenHeaderLT:!1,frozenHeaderRT:!1,frozenHeaderLM:!1,frozenContent:!1,infoBar:!0,toolbar:!0},ao="DOC_UI_PLUGIN";var Ae=(i=>(i.MAIN="__Document_Render_Main__",i.BACKGROUND="__Document_Render_Background__",i))(Ae||{}),se=(i=>(i.VIEW_MAIN="viewMain",i.VIEW_TOP="viewTop",i.VIEW_LEFT="viewLeft",i.VIEW_LEFT_TOP="viewLeftTop",i))(se||{});const so=0,Ut=2,ro=4,Dn=10,fs="normalTextSelectionPluginName";function Ie(i){const{mainComponent:t,scene:e,engine:n,components:o}=i,s=t,r=o.get(Ae.BACKGROUND);return{document:s,docBackground:r,scene:e,engine:n}}function co(i,t){const e=i.getCurrentUnitOfType(a.UniverInstanceType.UNIVER_DOC);if(!e)return null;const n=e.getUnitId(),o=t.getRenderById(n);if(o==null)return;const{mainComponent:s,scene:r,engine:c,components:l}=o,A=s,d=l.get(Ae.BACKGROUND);return{document:A,docBackground:d,scene:r,engine:c}}function Ss(i,t){const e=t.getRenderById(i);if(e==null)return;const{mainComponent:n,scene:o,engine:s,components:r}=e,c=n,l=r.get(Ae.BACKGROUND);return{document:c,docBackground:l,scene:o,engine:s}}function lo(i){const{unitId:t,ranges:e,id:n,type:o,segmentId:s}=i,r={id:D.RichTextEditingMutation.id,params:{unitId:t,actions:[],textRanges:void 0,segmentId:s}},c=a.JSONX.getInstance(),l=a.BuildTextUtils.customDecoration.add({ranges:e,id:n,type:o});return r.params.actions=c.editOp(l.serialize()),r}function Is(i,t){const{segmentId:e,id:n,type:o,unitId:s}=t,r=i.get(D.DocSelectionManagerService),c=i.get(a.IUniverInstanceService),l=s?c.getUnit(s,a.UniverInstanceType.UNIVER_DOC):c.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);if(!l)return!1;const A=l.getUnitId(),d=r.getTextRanges({unitId:A,subUnitId:A});return!d||!l.getBody()?!1:lo({unitId:A,ranges:d,id:n,type:o,segmentId:e})}function vs(i,t){const{unitId:e,id:n,segmentId:o}=t,r=i.get(a.IUniverInstanceService).getUnit(e);if(!r)return!1;const c={id:D.RichTextEditingMutation.id,params:{unitId:e,actions:[],textRanges:void 0,segmentId:o}},l=a.BuildTextUtils.customDecoration.delete({id:n,segmentId:o,documentDataModel:r});if(!l)return!1;const A=a.JSONX.getInstance();return c.params.actions=A.editOp(l.serialize()),c}function Es(i,t){return t.some(e=>i.startIndex>e.startIndex&&i.startIndex<e.endIndex)}function Lt(i,t,e,n,o){const{textRuns:s=[],dataStream:r}=i,c=o&&r.startsWith("="),l={st:0,ed:0,ts:{}};if(c)return l;for(let A=s.length-1;A>=0;A--){const d=s[A],{st:u,ed:m}=d;t>u&&t<=m&&(l.st=u,l.ed=m,l.ts={...l.ts,...d.ts})}if(t===0){const A=s==null?void 0:s[0];A&&A.st===0&&(l.ts={...l.ts,...A.ts})}return n&&(l.ts={...l.ts,...n}),l}function Bn(i,t,e){if(e){const o=i.find(s=>t>=s.startIndex&&t<=s.endIndex+1);return o!=null&&o.wholeEntity?null:o}const n=i.find(o=>t>o.startIndex&&t<=o.endIndex);return n!=null&&n.wholeEntity?null:n}function _n(i,t){return i.filter(e=>t>e.startIndex&&t<=e.endIndex)}function Cs(i){return{left:i.positionH.posOffset,top:i.positionV.posOffset,width:i.size.width,height:i.size.height}}function Ts(i,t=0,e=0){return{size:{width:i.width,height:i.height},positionH:{relativeFrom:a.ObjectRelativeFromH.MARGIN,posOffset:(i.left||0)-t},positionV:{relativeFrom:a.ObjectRelativeFromV.PAGE,posOffset:(i.top||0)-e},angle:i.angle||0}}const ke={id:"doc.command.tab",type:a.CommandType.COMMAND,async handler(i,t){const n=i.get(y.DocAutoFormatService).onAutoFormat(ke.id,t);return(await a.sequenceExecuteAsync(n,i.get(a.ICommandService))).result}},At={id:"doc.command.after-space",type:a.CommandType.COMMAND,async handler(i){const e=i.get(y.DocAutoFormatService).onAutoFormat(At.id);return(await a.sequenceExecuteAsync(e,i.get(a.ICommandService))).result}},Ye={id:"doc.command.enter",type:a.CommandType.COMMAND,async handler(i){const e=i.get(y.DocAutoFormatService).onAutoFormat(Ye.id);return(await a.sequenceExecuteAsync(e,i.get(a.ICommandService))).result}};var ys=Object.getOwnPropertyDescriptor,bs=(i,t,e,n)=>{for(var o=n>1?void 0:n?ys(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Nn=(i,t)=>(e,n)=>t(e,n,i);const Os=11,Rs=9,Qt={ff:"Arial",fs:Os};let ve=class extends a.Disposable{constructor(t,e,n){super();B(this,"_cacheStyle",null);this._textSelectionManagerService=t,this._univerInstanceService=e,this._renderManagerService=n,this._init()}_init(){this._listenDocRangeChange()}_listenDocRangeChange(){this.disposeWithMe(this._textSelectionManagerService.textSelection$.subscribe(()=>{this._clearStyleCache()}))}getStyleCache(){return this._cacheStyle}getDefaultStyle(){var r;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);if(t==null)return{...Qt};const e=t==null?void 0:t.getUnitId(),n=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.with(D.DocSkeletonManagerService),o=n==null?void 0:n.getViewModel();return o==null?{...Qt}:o.getEditArea()===_.DocumentEditArea.BODY?{...Qt}:{...Qt,fs:Rs}}setStyleCache(t){this._cacheStyle={...this._cacheStyle,...t}}_clearStyleCache(){this._cacheStyle=null}};ve=bs([Nn(0,a.Inject(D.DocSelectionManagerService)),Nn(1,a.IUniverInstanceService),Nn(2,_.IRenderManagerService)],ve);function re(i,t){var n;return(n=i.get(_.IRenderManagerService).getRenderById(t))==null?void 0:n.with(D.DocSkeletonManagerService)}function Z(i,t=""){if(!t)return["body"];const{headers:e,footers:n}=i.getSnapshot();if(e==null&&n==null)throw new Error("Document data model must have headers or footers when update by segment id");if((e==null?void 0:e[t])!=null)return["headers",t,"body"];if((n==null?void 0:n[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}function Pn(i,t,e){const n=[];for(let o=0,s=i.length;o<s;o++)i[o]===a.DataStreamTreeTokenType.PARAGRAPH&&n.push({startIndex:o});if(t)for(const o of n)t.bullet&&(o.bullet=a.Tools.deepClone(t.bullet)),t.paragraphStyle&&(o.paragraphStyle=a.Tools.deepClone(t.paragraphStyle),delete o.paragraphStyle.borderBottom,t.paragraphStyle.headingId&&(o.paragraphStyle.headingId=a.generateRandomId(6)));if(e)for(const o of n)o.paragraphStyle||(o.paragraphStyle={}),o.paragraphStyle.borderBottom=e;return n}const Ft={id:"doc.command.break-line",type:a.CommandType.COMMAND,handler:(i,t)=>{var Q,X,j,k,W;const e=i.get(D.DocSelectionManagerService),n=i.get(a.IUniverInstanceService),o=i.get(a.ICommandService),s=i.get(ve),r=(Q=t==null?void 0:t.textRange)!=null?Q:e.getActiveTextRange(),c=e.getRectRanges();if(r==null)return!1;if(c&&c.length){const{startOffset:G}=r;return e.replaceDocRanges([{startOffset:G,endOffset:G}]),!0}const{horizontalLine:l}=t!=null?t:{},{segmentId:A}=r,d=n.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),u=d==null?void 0:d.getSelfOrHeaderFooterModel(A!=null?A:"").getBody();if(d==null||u==null)return!1;const m=d.getUnitId(),{startOffset:h,endOffset:g}=r,f=((X=u.paragraphs)!=null?X:[]).find(G=>G.startIndex>=h);if(!f)return!1;const S=h===f.startIndex,E=f.startIndex,C=s.getDefaultStyle(),T=s.getStyleCache(),R=Lt(u,g,C,T),v={dataStream:a.DataStreamTreeTokenType.PARAGRAPH,paragraphs:Pn(a.DataStreamTreeTokenType.PARAGRAPH,f,l),textRuns:[{st:0,ed:1,ts:{...R.ts}}]};if(d==null)return!1;const O=e.getActiveTextRange();if(u==null)return!1;const{collapsed:M}=r,b=v.dataStream.length,N=[{startOffset:h+b,endOffset:h+b,style:O==null?void 0:O.style,collapsed:M}],x={id:D.RichTextEditingMutation.id,params:{unitId:m,actions:[],textRanges:N,debounce:!0}},U=new a.TextX,F=a.JSONX.getInstance();if(M)h>0&&U.push({t:a.TextXActionType.RETAIN,len:h}),U.push({t:a.TextXActionType.INSERT,body:v,len:v.dataStream.length});else{const G=a.BuildTextUtils.selection.delete([r],u,0,v);U.push(...G)}(((j=f.bullet)==null?void 0:j.listType)===a.PresetListType.CHECK_LIST_CHECKED||(k=f.paragraphStyle)!=null&&k.headingId)&&(r.endOffset<E&&U.push({t:a.TextXActionType.RETAIN,len:E-r.endOffset}),U.push({t:a.TextXActionType.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...f,paragraphStyle:{...f.paragraphStyle,...S?{headingId:void 0,namedStyleType:void 0}:null},startIndex:0,bullet:(W=f.paragraphStyle)!=null&&W.headingId?void 0:{...f.bullet,listType:a.PresetListType.CHECK_LIST}}]},coverType:a.UpdateDocsAttributeType.REPLACE})),x.params.textRanges=[{startOffset:h+b,endOffset:h+b,collapsed:M}];const V=Z(d,A);return x.params.actions=F.editOp(U.serialize(),V),!!o.syncExecuteCommand(x.id,x.params)}};var Ht=(i=>(i[i.ABOVE=0]="ABOVE",i[i.BELLOW=1]="BELLOW",i))(Ht||{}),wn=(i=>(i[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT",i))(wn||{});function Ms(i,t){let e=a.DataStreamTreeTokenType.TABLE_START;const n=[],o=[];for(let s=0;s<i;s++){e+=a.DataStreamTreeTokenType.TABLE_ROW_START;for(let r=0;r<t;r++)e+=`${a.DataStreamTreeTokenType.TABLE_CELL_START}\r
|
|
2
2
|
${a.DataStreamTreeTokenType.TABLE_CELL_END}`,n.push({startIndex:e.length-3,paragraphStyle:{spaceAbove:{v:3},lineSpacing:2,spaceBelow:{v:0}}}),o.push({startIndex:e.length-2});e+=a.DataStreamTreeTokenType.TABLE_ROW_END}return e+=a.DataStreamTreeTokenType.TABLE_END,{dataStream:e,paragraphs:n,sectionBreaks:o}}function kt(){return{margin:{start:{v:10},end:{v:10},top:{v:5},bottom:{v:5}}}}function Vt(i){const t=kt();return{tableCells:[...new Array(i).fill(null).map(()=>a.Tools.deepClone(t))],trHeight:{val:{v:30},hRule:a.TableRowHeightRule.AUTO}}}function Wt(i){return{size:{type:a.TableSizeType.SPECIFIED,width:{v:i}}}}function Un(i,t,e){const n=Wt(e/t),o=Vt(t),s=[...new Array(i).fill(null).map(()=>a.Tools.deepClone(o))],r=[...new Array(t).fill(null).map(()=>a.Tools.deepClone(n))],c=a.generateRandomId(6);return{tableRows:s,tableColumns:r,tableId:c,align:a.TableAlignmentType.START,indent:{v:0},textWrap:a.TableTextWrapType.NONE,position:{positionH:{relativeFrom:a.ObjectRelativeFromH.PAGE,posOffset:0},positionV:{relativeFrom:a.ObjectRelativeFromV.PAGE,posOffset:0}},dist:{distB:0,distL:0,distR:0,distT:0},cellMargin:{start:{v:10},end:{v:10},top:{v:5},bottom:{v:5}},size:{type:a.TableSizeType.UNSPECIFIED,width:{v:e}}}}function ut(i,t){if(!i&&!t)return null;if(t&&t.length>0){let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;const o="";for(const s of t){const{startOffset:r,endOffset:c,segmentId:l}=s;r==null||c==null||l==null||(e=Math.min(e,r),n=Math.max(n,c))}if(Number.isFinite(e)&&Number.isFinite(n))return{startOffset:e,endOffset:n,segmentId:o}}else if(i){const{startOffset:e,endOffset:n,segmentId:o}=i;return e==null||n==null||o==null?null:{startOffset:e,endOffset:n,segmentId:o}}}function xs(i){let t=a.DataStreamTreeTokenType.TABLE_ROW_START;const e=[],n=[];for(let o=0;o<i;o++)t+=`${a.DataStreamTreeTokenType.TABLE_CELL_START}\r
|
|
3
3
|
${a.DataStreamTreeTokenType.TABLE_CELL_END}`,e.push({startIndex:t.length-3,paragraphStyle:{spaceAbove:{v:3},lineSpacing:2,spaceBelow:{v:0}}}),n.push({startIndex:t.length-2});return t+=a.DataStreamTreeTokenType.TABLE_ROW_END,{dataStream:t,paragraphs:e,sectionBreaks:n}}function Ds(){const i=`${a.DataStreamTreeTokenType.TABLE_CELL_START}\r
|
|
4
4
|
${a.DataStreamTreeTokenType.TABLE_CELL_END}`,t=[],e=[];return t.push({startIndex:1,paragraphStyle:{spaceAbove:{v:3},lineSpacing:2,spaceBelow:{v:0}}}),e.push({startIndex:2}),{dataStream:i,paragraphs:t,sectionBreaks:e}}function Bs(i,t,e){var u,m,h;const{startOffset:n,endOffset:o,segmentId:s}=i,r=e.getSelfOrHeaderFooterViewModel(s),c=t===0?n:o;let l=null;const A=(h=(m=(u=e.getBody())==null?void 0:u.tables)==null?void 0:m.find(g=>c>=g.startIndex&&c<=g.endIndex))==null?void 0:h.tableId;let d=0;for(const g of r.getChildren()){for(const p of g.children){const{children:f}=p,S=f[0];if(S){for(const E of S.children)if(E.startIndex<=c&&c<=E.endIndex){d=S.children.indexOf(E),l=E;break}}if(l)break}if(l)break}return l==null||A==null?null:{offset:t===0?l.startIndex:l.endIndex+1,colCount:l.children.length,tableId:A,insertRowIndex:t===0?d:d+1}}function _s(i,t,e){var h,g,p;const{startOffset:n,endOffset:o,segmentId:s}=i,r=e.getSelfOrHeaderFooterViewModel(s),c=t===0?n:o,l=(p=(g=(h=e.getBody())==null?void 0:h.tables)==null?void 0:g.find(f=>c>=f.startIndex&&c<=f.endIndex))==null?void 0:p.tableId,A=[];let d=null,u=-1;for(const f of r.getChildren()){for(const S of f.children){const{children:E}=S,C=E[0];if(C){if(c<C.startIndex||c>C.endIndex)continue;d=C;for(const T of C.children){for(const R of T.children){const v=T.children.indexOf(R);if(c>=R.startIndex&&c<=R.endIndex){u=v;break}}if(u!==-1)break}}if(d)break}if(d)break}if(d==null||l==null||u===-1)return null;let m=0;for(const f of d.children){const S=f.children[u],E=t===0?S.startIndex:S.endIndex+1;A.push(E-m),m=E}return{offsets:A,tableId:l,columnIndex:u,rowCount:d.children.length}}function Ns(i,t,e){const n=[];let o=t[e].size.width.v,s=0;for(let r=0;r<t.length;r++)s+=t[r].size.width.v;s+=o;for(let r=0;r<t.length;r++)n.push(t[r].size.width.v/s*i);return o=o/s*i,{widths:n,newColWidth:o}}function Ao(i,t){var m,h,g;const{startOffset:e,endOffset:n,segmentId:o}=i,s=t.getSelfOrHeaderFooterViewModel(o),r=(g=(h=(m=t.getBody())==null?void 0:m.tables)==null?void 0:h.find(p=>e>=p.startIndex&&n<=p.endIndex))==null?void 0:g.tableId,c=[];let l=-1,A=0,d=-1,u=!1;for(const p of s.getChildren()){for(const f of p.children){const{children:S}=f,E=S[0];if(E){if(e<E.startIndex||n>E.endIndex)continue;d=E.startIndex+3;for(const C of E.children){const T=E.children.indexOf(C),{startIndex:R,endIndex:v}=C;e>=R&&e<=v?(l=R,c.push(T),A+=v-R+1):(R>e&&v<n||n>=R&&n<=v)&&(c.push(T),A+=v-R+1),c.length===E.children.length&&(u=!0)}}if(c.length)break}if(c.length)break}return r==null||c.length===0?null:{tableId:r,rowIndexes:c,offset:l,len:A,cursor:d,selectWholeTable:u}}function Ps(i,t){var g,p,f;const{startOffset:e,endOffset:n,segmentId:o}=i,s=t.getSelfOrHeaderFooterViewModel(o),r=(f=(p=(g=t.getBody())==null?void 0:g.tables)==null?void 0:p.find(S=>e>=S.startIndex&&n<=S.endIndex))==null?void 0:f.tableId,c=[];let l=null;const A=[];let d=-1,u=-1,m=-1;for(const S of s.getChildren()){for(const E of S.children){const{children:C}=E,T=C[0];if(T){if(e<T.startIndex||n>T.endIndex)continue;l=T;for(const R of T.children)for(const v of R.children){const O=R.children.indexOf(v);e>=v.startIndex&&e<=v.endIndex&&(u=O),n>=v.startIndex&&n<=v.endIndex&&(m=O)}}if(l)break}if(l)break}if(l==null||r==null)return null;for(let S=u;S<=m;S++)A.push(S);let h=0;for(const S of l.children){const E=S.children[u],C=S.children[m];c.push({retain:E.startIndex-h,delete:C.endIndex-E.startIndex+1}),h=C.endIndex+1}return d=l.startIndex+3,{offsets:c,tableId:r,columnIndexes:A,cursor:d,selectWholeTable:A.length===l.children[0].children.length,rowCount:l.children.length}}function uo(i,t){var d,u,m;const{startOffset:e,endOffset:n,segmentId:o}=i,s=t.getSelfOrHeaderFooterViewModel(o),r=(m=(u=(d=t.getBody())==null?void 0:d.tables)==null?void 0:u.find(h=>e>=h.startIndex&&n<=h.endIndex))==null?void 0:m.tableId;let c=-1,l=0,A=-1;for(const h of s.getChildren()){for(const g of h.children){const{children:p}=g,f=p[0];if(f){if(e<f.startIndex||n>f.endIndex)continue;c=f.startIndex,l=f.endIndex-f.startIndex+1,A=f.startIndex}if(f)break}if(l>0)break}return r==null?null:{tableId:r,offset:c,len:l,cursor:A}}function ws(i,t){var g,p,f;const{startOffset:e,endOffset:n,segmentId:o}=i,s=t.getSelfOrHeaderFooterViewModel(o),r=(f=(p=(g=t.getBody())==null?void 0:g.tables)==null?void 0:p.find(S=>e>=S.startIndex&&n<=S.endIndex))==null?void 0:f.tableId,c=[];let l=null,A=-1,d=-1,u=-1,m=-1;for(const S of s.getChildren()){for(const E of S.children){const{children:C}=E,T=C[0];if(T){if(e<T.startIndex||n>T.endIndex)continue;l=T;for(const R of T.children){const v=T.children.indexOf(R);for(const O of R.children){const M=R.children.indexOf(O);e>=O.startIndex&&e<=O.endIndex&&(d=v,u=M),n>=O.startIndex&&n<=O.endIndex&&(m=M)}}}if(l)break}if(l)break}if(l==null||r==null||d===-1)return null;const h=l.children[d];for(let S=u;S<=m;S++){const E=h.children[S];c.push({retain:E.startIndex+1,delete:E.endIndex-E.startIndex-3})}return A=l.startIndex+3,{offsets:c,tableId:r,cursor:A,rowCount:l.children.length}}var Ln=(i=>(i[i.NEXT=0]="NEXT",i[i.PREV=1]="PREV",i))(Ln||{});function ho(i,t,e){const{startOffset:n}=t;let o=null;for(const A of i.getChildren()){for(const d of A.children){const u=d.children[0];if(u&&n>u.startIndex&&n<u.endIndex){o=u;break}}if(o)break}if(o==null)return null;let s=-1,r=-1,c=null;for(const A of o.children){for(const d of A.children)if(n>d.startIndex&&n<d.endIndex){s=A.children.indexOf(d),r=o.children.indexOf(A),c=A;break}if(s>-1)break}if(s===-1||r===-1||c==null)return null;let l=null;if(e===0){if(l=c.children[s+1],!l){const A=o.children[r+1];A&&(l=A.children[0])}}else if(l=c.children[s-1],!l){const A=o.children[r-1];A&&(l=A.children[A.children.length-1])}if(l){const{startIndex:A,endIndex:d}=l;return{startOffset:A+1,endOffset:d-2}}}function go(i,t){const e=[],{customBlocks:n=[]}=i;for(const o of t){const{startOffset:s,endOffset:r}=o;if(!(s==null||r==null))for(const c of n){const{startIndex:l}=c;l>=s&&l<r&&e.push(c.blockId)}}return e}function Us(i){return i.some(t=>{const{startNodePosition:e}=t;return e?(e==null?void 0:e.path.indexOf("cells"))>-1:!1})}const Ls=a.SHEET_EDITOR_UNITS,Qn={id:"doc.command.inner-paste",type:a.CommandType.COMMAND,handler:async(i,t)=>{var b,N,x,U,F,V;const{segmentId:e,textRanges:n,doc:o}=t,s=i.get(a.ICommandService),r=i.get(D.DocSelectionManagerService),c=i.get(a.IUniverInstanceService),l=r.getTextRanges(),A=r.getRectRanges(),{body:d,tableSource:u,drawings:m}=o;if(!Array.isArray(l)||l.length===0||d==null)return!1;const h=c.getCurrentUniverDocInstance(),g=h==null?void 0:h.getSelfOrHeaderFooterModel(e).getBody();if(h==null||g==null)return!1;const p=h.getUnitId(),f={id:D.RichTextEditingMutation.id,params:{unitId:p,actions:[],textRanges:n,segmentId:e}},S=new a.MemoryCursor;S.reset();const E=new a.TextX,C=a.JSONX.getInstance(),T=[],R=!!((b=d.tables)!=null&&b.length),v=!!((N=d.customBlocks)!=null&&N.length);if(R&&e||R&&Us(l)||l.length&&(A!=null&&A.length))return!1;for(let H=0;H<l.length;H++){const Q=l[H],{startOffset:X,endOffset:j,collapsed:k}=Q,W=X-S.cursor,G=a.Tools.deepClone(d);if(R)for(const q of G.tables){const{tableId:z}=q,$=a.generateRandomId(6);q.tableId=$;const oe=a.Tools.deepClone(u[z]);oe.tableId=$;const fe=C.insertOp(["tableSource",$],oe);T.push(fe)}if(v&&m){const q=(U=(x=h.getSnapshot().drawingsOrder)==null?void 0:x.length)!=null?U:0;for(const z of G.customBlocks){const{blockId:$}=z,oe=a.generateRandomId(6);z.blockId=oe;const fe=a.Tools.deepClone(m[$]);fe.drawingId=oe;const He=C.insertOp(["drawings",oe],fe),Se=C.insertOp(["drawingsOrder",q],oe);T.push(He),T.push(Se)}}const K=Bn((F=g.customRanges)!=null?F:[],j,Ls.includes(p)),Y=_n((V=g.customDecorations)!=null?V:[],j);if(K&&(G.customRanges=[{...K,startIndex:0,endIndex:d.dataStream.length-1}]),Y.length&&(G.customDecorations=Y.map(q=>({...q,startIndex:0,endIndex:d.dataStream.length-1}))),k)E.push({t:a.TextXActionType.RETAIN,len:W}),E.push({t:a.TextXActionType.INSERT,body:G,len:d.dataStream.length});else{const q=a.BuildTextUtils.selection.delete([Q],d,S.cursor,G,l.length===1);E.push(...q)}S.reset(),S.moveCursor(j)}const O=Z(h,e);return T.push(C.editOp(E.serialize(),O)),f.params.actions=T.reduce((H,Q)=>a.JSONX.compose(H,Q),null),!!s.syncExecuteCommand(f.id,f.params)}};function Qs(i,t){const{startOffset:e,endOffset:n}=i,o=t.some(r=>r.startIndex===n),s=Math.max(e,o?n-1:n);return{...i,endOffset:s,collapsed:e===s}}function Fs(i,t,e){var g,p;const n=t.getSelfOrHeaderFooterModel(e).getBody(),o=new a.TextX,s=a.JSONX.getInstance(),r=[];if(n==null)return r;const{tables:c=[]}=n,l=new a.MemoryCursor;l.reset();for(let f=0;f<i.length;f++){const S=Qs(i[f],c),{startOffset:E,endOffset:C,collapsed:T}=S,R=E-l.cursor;T?o.push({t:a.TextXActionType.RETAIN,len:R}):o.push(...a.BuildTextUtils.selection.delete([S],n,l.cursor,null,!1)),l.reset(),l.moveCursor(C)}const A=Z(t,e);r.push(s.editOp(o.serialize(),A));const d=go(n,i),u=(g=t.getDrawings())!=null?g:{},m=(p=t.getDrawingsOrder())!=null?p:[],h=d.sort((f,S)=>m.indexOf(f)>m.indexOf(S)?-1:m.indexOf(f)<m.indexOf(S)?1:0);if(h.length>0)for(const f of h){const S=u[f],E=m.indexOf(f);if(S==null||E<0)continue;const C=s.removeOp(["drawings",f],S),T=s.removeOp(["drawingsOrder",E],f);r.push(C),r.push(T)}return r.reduce((f,S)=>a.JSONX.compose(f,S),null)}function Hs(i,t,e,n){const o=[];if(t.getSelfOrHeaderFooterModel(n).getBody()==null)return o;const r=new a.TextX,c=a.JSONX.getInstance(),l=new a.MemoryCursor;l.reset();for(const d of i){const{startOffset:u,endOffset:m,spanEntireRow:h,spanEntireTable:g}=d;if(!(u==null||m==null))if(g){const p=uo({startOffset:u,endOffset:m,segmentId:n},e);if(p==null)continue;const{offset:f,len:S,tableId:E}=p;f-l.cursor>0&&r.push({t:a.TextXActionType.RETAIN,len:f-l.cursor}),r.push({t:a.TextXActionType.DELETE,len:S});const C=c.removeOp(["tableSource",E]);o.push(C),l.moveCursorTo(f+S)}else if(h){const p=Ao({startOffset:u,endOffset:m,segmentId:n},e);if(p==null)continue;const{offset:f,rowIndexes:S,len:E,tableId:C}=p;f-l.cursor>0&&r.push({t:a.TextXActionType.RETAIN,len:f-l.cursor}),r.push({t:a.TextXActionType.DELETE,len:E});for(const T of S.reverse()){const R=c.removeOp(["tableSource",C,"tableRows",T]);o.push(R)}l.moveCursorTo(f+E)}else{const p=ws({startOffset:u,endOffset:m,segmentId:n},e);if(p==null)continue;const{offsets:f}=p;for(const S of f){const{retain:E,delete:C}=S;E-l.cursor>0&&r.push({t:a.TextXActionType.RETAIN,len:E-l.cursor}),r.push({t:a.TextXActionType.DELETE,len:C}),l.moveCursorTo(E+C)}}}const A=Z(t,n);return o.push(c.editOp(r.serialize(),A)),o.reduce((d,u)=>a.JSONX.compose(d,u),null)}function mo(i,t,e,n,o){let s=[];if(Array.isArray(i)&&(i==null?void 0:i.length)!==0&&(s=Fs(i,e,o)),Array.isArray(t)&&(t==null?void 0:t.length)!==0){const r=Hs(t,e,n,o);s==null||s.length===0?s=r:s=a.JSONX.compose(s,a.JSONX.transform(r,s,"right"))}return s}const Ve={id:"doc.command.inner-cut",type:a.CommandType.COMMAND,handler:(i,t)=>{var p;const e=i.get(D.DocSelectionManagerService),n=i.get(a.ICommandService),o=i.get(a.IUniverInstanceService),{segmentId:s,textRanges:r,selections:c=e.getTextRanges(),rectRanges:l=e.getRectRanges()}=t;if((!Array.isArray(c)||c.length===0)&&(!Array.isArray(l)||l.length===0))return!1;const A=(p=o.getCurrentUniverDocInstance())==null?void 0:p.getUnitId();if(!A)return!1;const d=o.getUniverDocInstance(A);if(d==null)return!1;const u=re(i,A);if(u==null)return!1;const m=u.getViewModel(),h={id:D.RichTextEditingMutation.id,params:{unitId:A,actions:[],textRanges:r}};return h.params.actions=mo(c,l,d,m,s),!!n.syncExecuteCommand(h.id,h.params)}};var ie=(i=>(i[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT",i))(ie||{});const po="doc.command.insert-text",Fn={id:po,type:a.CommandType.COMMAND,handler:async(i,t)=>{var v;const e=i.get(a.ICommandService),{range:n,segmentId:o,body:s,unitId:r,cursorOffset:c}=t,l=i.get(D.DocSelectionManagerService),d=i.get(a.IUniverInstanceService).getUnit(r,a.UniverInstanceType.UNIVER_DOC);if(d==null)return!1;const u=l.getActiveTextRange(),m=d.getSelfOrHeaderFooterModel((v=u==null?void 0:u.segmentId)!=null?v:"").getBody();if(m==null)return!1;const{startOffset:h,collapsed:g}=n,p=c!=null?c:s.dataStream.length,f=[{startOffset:h+p,endOffset:h+p,style:u==null?void 0:u.style,collapsed:g}],S={id:D.RichTextEditingMutation.id,params:{unitId:r,actions:[],textRanges:f,debounce:!0}},E=new a.TextX,C=a.JSONX.getInstance();if(g)h>0&&E.push({t:a.TextXActionType.RETAIN,len:h}),E.push({t:a.TextXActionType.INSERT,body:s,len:s.dataStream.length});else{const O=a.BuildTextUtils.selection.delete([n],m,0,s);E.push(...O)}S.params.textRanges=[{startOffset:h+p,endOffset:h+p,collapsed:g}];const T=Z(d,o);return S.params.actions=C.editOp(E.serialize(),T),!!e.syncExecuteCommand(S.id,S.params)}},qe={id:"doc.command.delete-text",type:a.CommandType.COMMAND,handler:async(i,t)=>{var R;const e=i.get(a.ICommandService),n=i.get(a.IUniverInstanceService),{range:o,segmentId:s,unitId:r,direction:c,len:l=1}=t,A=n.getUnit(r,a.UniverInstanceType.UNIVER_DOC),d=A==null?void 0:A.getSelfOrHeaderFooterModel(s).getBody();if(A==null||d==null)return!1;const{startOffset:u}=o;let m=c===ie.LEFT?u-l:u,h=c===ie.LEFT?u-1:u+l-1;const g=(R=d.customRanges)==null?void 0:R.find(v=>v.startIndex<=m&&v.endIndex>=h);g!=null&&g.wholeEntity&&(m=g.startIndex,h=Math.max(h,g.endIndex));const p={id:D.RichTextEditingMutation.id,params:{unitId:r,actions:[],textRanges:[{startOffset:m,endOffset:m,collapsed:!0}],debounce:!0}},f=new a.TextX,S=a.JSONX.getInstance();f.push({t:a.TextXActionType.RETAIN,len:m-0}),f.push({t:a.TextXActionType.DELETE,len:h-m+1});const C=Z(A,s);return p.params.actions=S.editOp(f.serialize(),C),!!e.syncExecuteCommand(p.id,p.params)}},Hn={id:"doc.command.update-text",type:a.CommandType.COMMAND,handler:async(i,t)=>{const{range:e,segmentId:n,updateBody:o,coverType:s,unitId:r,textRanges:c}=t,l=i.get(a.ICommandService),d=i.get(a.IUniverInstanceService).getCurrentUniverDocInstance();if(d==null)return!1;const u={id:D.RichTextEditingMutation.id,params:{unitId:r,actions:[],textRanges:c}},m=new a.TextX,h=a.JSONX.getInstance(),{startOffset:g,endOffset:p}=e;m.push({t:a.TextXActionType.RETAIN,len:g}),m.push({t:a.TextXActionType.RETAIN,body:o,len:p-g,coverType:s});const f=Z(d,n);return u.params.actions=h.editOp(m.serialize(),f),!!l.syncExecuteCommand(u.id,u.params)}};function ht(i){var r,c,l,A;const t=i.get(a.IUniverInstanceService),n=i.get(D.DocSelectionManagerService).getActiveTextRange(),o=t.getCurrentUnitOfType(a.UniverInstanceType.UNIVER_DOC);return!n||!n.collapsed||!o||n.segmentId?!1:a.BuildTextUtils.range.getParagraphsInRange(n,(c=(r=o.getBody())==null?void 0:r.paragraphs)!=null?c:[],(A=(l=o.getBody())==null?void 0:l.dataStream)!=null?A:"")[0]}const Gt={id:"doc.command.delete-custom-block",type:a.CommandType.COMMAND,handler:async(i,t)=>{var x;const e=i.get(D.DocSelectionManagerService),n=i.get(a.IUniverInstanceService),o=i.get(a.ICommandService),s=e.getActiveTextRange(),r=n.getCurrentUniverDocInstance();if(s==null||r==null)return!1;const{direction:c,range:l,unitId:A,drawingId:d}=t,{startOffset:u,segmentId:m,style:h}=s,g=c===ie.LEFT?u-1:u,p=[{startOffset:g,endOffset:g,style:h}],f={id:D.RichTextEditingMutation.id,params:{unitId:A,actions:[],textRanges:p,prevTextRanges:[l]}},S=new a.TextX,E=a.JSONX.getInstance(),C=[];u>0&&S.push({t:a.TextXActionType.RETAIN,len:c===ie.LEFT?u-1:u}),S.push({t:a.TextXActionType.DELETE,len:1});const T=Z(r,m);C.push(E.editOp(S.serialize(),T));const R=((x=r.getDrawings())!=null?x:{})[d],O=r.getDrawingsOrder().indexOf(d),M=E.removeOp(["drawings",d],R),b=E.removeOp(["drawingsOrder",O],d);return C.push(M),C.push(b),f.params.actions=C.reduce((U,F)=>a.JSONX.compose(U,F),null),!!o.syncExecuteCommand(f.id,f.params)}},jt={id:"doc.command.merge-two-paragraph",type:a.CommandType.COMMAND,handler:async(i,t)=>{const e=i.get(D.DocSelectionManagerService),n=i.get(a.IUniverInstanceService),o=i.get(a.ICommandService),{direction:s,range:r}=t,c=e.getActiveTextRange(),l=e.getTextRanges();if(c==null||l==null)return!1;const{segmentId:A,style:d}=c,u=n.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),m=u==null?void 0:u.getSelfOrHeaderFooterModel(A).getBody();if(u==null||m==null)return!1;const h=m.dataStream,g=c,p=u.getUnitId(),{startOffset:f,collapsed:S}=g;if(!S)return!1;const E=s===ie.LEFT?f:f+1;let C,T;for(const V of m.paragraphs){if(V.startIndex>=E){T=V;break}C=V}if(C==null||T==null)return!1;const R=s===ie.LEFT?f-1:f,v=[{startOffset:R,endOffset:R,style:d}],O={id:D.RichTextEditingMutation.id,params:{unitId:p,actions:[],textRanges:v,prevTextRanges:[r]}},M=new a.TextX,b=a.JSONX.getInstance();C.startIndex>0&&M.push({t:a.TextXActionType.RETAIN,len:C.startIndex}),M.push({t:a.TextXActionType.DELETE,len:1}),T.startIndex>C.startIndex+1&&M.push({t:a.TextXActionType.RETAIN,len:T.startIndex-C.startIndex-1});const N=Object.values(a.DataStreamTreeTokenType),x=h[C.startIndex-1];(x&&!N.includes(x)||x===" ")&&M.push({t:a.TextXActionType.RETAIN,len:1,coverType:a.UpdateDocsAttributeType.REPLACE,body:{dataStream:"",paragraphs:[{...a.Tools.deepClone(C),startIndex:0}]}});const U=Z(u,A);return O.params.actions=b.editOp(M.serialize(),U),!!o.syncExecuteCommand(O.id,O.params)}},fo={id:"doc.command.remove-horizontal-line",type:a.CommandType.COMMAND,handler:async i=>{var R;const t=i.get(D.DocSelectionManagerService),e=i.get(a.IUniverInstanceService),n=i.get(a.ICommandService),o=t.getActiveTextRange(),s=t.getTextRanges();if(o==null||s==null)return!1;const{segmentId:r,style:c}=o,l=e.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),A=l==null?void 0:l.getSelfOrHeaderFooterModel(r).getBody();if(l==null||A==null)return!1;const d=o,u=l.getUnitId(),{startOffset:m,collapsed:h}=d;if(!h)return!1;const g=(R=A.paragraphs)==null?void 0:R.find(v=>v.startIndex===m-1);if(g==null)return!1;const p=[{startOffset:m,endOffset:m,style:c}],f={id:D.RichTextEditingMutation.id,params:{unitId:u,actions:[],textRanges:p}},S=new a.TextX,E=a.JSONX.getInstance();g.startIndex>0&&S.push({t:a.TextXActionType.RETAIN,len:g.startIndex}),S.push({t:a.TextXActionType.RETAIN,len:1,coverType:a.UpdateDocsAttributeType.REPLACE,body:{dataStream:"",paragraphs:[{...a.Tools.deepClone({...g,paragraphStyle:{...g.paragraphStyle,borderBottom:void 0}}),startIndex:0}]}});const C=Z(l,r);return f.params.actions=E.editOp(S.serialize(),C),!!n.syncExecuteCommand(f.id,f.params)}};function Xt(i,t){let e=0;if(i==null||i.length===0){if(typeof t[0].startOffset=="number"){const n=t[0],{spanEntireRow:o,spanEntireTable:s}=n;s?e=n.startOffset-3:o?n.startRow>0?e=n.startOffset-6:e=n.startOffset:e=t[0].startOffset}}else if(i.length>0&&t.length>0){const n=i[0],o=t[0];if(n.startOffset!=null&&o.startOffset!=null){if(n.startOffset<o.startOffset)e=n.startOffset;else if(n.startOffset>=o.startOffset){const{spanEntireRow:s,spanEntireTable:r}=o;r?e=o.startOffset-3:s&&(e=o.startOffset-6)}}}return e}const gt={id:"doc.command.delete-left",type:a.CommandType.COMMAND,handler:async i=>{var b,N,x,U,F,V;const t=i.get(D.DocSelectionManagerService),e=i.get(a.IUniverInstanceService),n=i.get(a.ICommandService);let o=!0;const s=e.getCurrentUniverDocInstance();if(s==null)return!1;const r=s.getUnitId(),c=re(i,r),l=t.getActiveTextRange(),A=t.getRectRanges(),d=t.getTextRanges(),u=c==null?void 0:c.getSkeleton();if(u==null)return!1;if(A!=null&&A.length){const H=Xt(d,A),Q=A[0].segmentId,X=[{startOffset:H,endOffset:H}];return n.executeCommand(Ve.id,{segmentId:Q,textRanges:X})}if(l==null||d==null)return!1;const{segmentId:m,style:h,segmentPage:g}=l,p=s.getSelfOrHeaderFooterModel(m).getBody();if(p==null)return!1;const f=l,{startOffset:S,collapsed:E}=f,C=u.findNodeByCharIndex(S,m,g),T=_.hasListGlyph(C),R=_.isIndentByGlyph(C,p);let v=S;const O=u.findNodeByCharIndex(S-1,m,g);if(_.isFirstGlyph(C)&&O!==C&&(T===!0||R===!0)&&E){const H=_.getParagraphByGlyph(C,p);if(H==null)return!1;const Q=H==null?void 0:H.startIndex,X={startIndex:0},j=H.paragraphStyle;if(T===!0){const W=H.paragraphStyle;if(W){X.paragraphStyle=W;const{hanging:G}=W;G&&(X.paragraphStyle.indentStart=G,X.paragraphStyle.hanging=void 0)}}else if(R===!0){const W=H.bullet;W&&(X.bullet=W),j!=null&&(X.paragraphStyle={...j},delete X.paragraphStyle.hanging,delete X.paragraphStyle.indentStart)}const k=[{startOffset:v,endOffset:v,style:h}];o=await n.executeCommand(Hn.id,{unitId:s.getUnitId(),updateBody:{dataStream:"",paragraphs:[{...X}]},range:{startOffset:Q,endOffset:Q+1},textRanges:k,coverType:a.UpdateDocsAttributeType.REPLACE,segmentId:m})}else if(E===!0){if(O==null)return!0;if(O.content==="\r"){const H=(b=p.paragraphs)==null?void 0:b.find(Q=>Q.startIndex===S-1);(N=H==null?void 0:H.paragraphStyle)!=null&&N.borderBottom?o=await n.executeCommand(fo.id):o=await n.executeCommand(jt.id,{direction:ie.LEFT,range:f})}else if(O.streamType==="\b"){const H=(U=s.getSnapshot().drawings)==null?void 0:U[(x=O.drawingId)!=null?x:""];if(H==null)return!0;const Q=(V=(F=s.getBody())==null?void 0:F.customBlocks)==null?void 0:V.find(j=>j.blockId===O.drawingId);if(H.layoutType===a.PositionedObjectLayoutType.INLINE||(Q==null?void 0:Q.blockType)===a.BlockType.CUSTOM){const j=s.getUnitId();o=await n.executeCommand(Gt.id,{direction:ie.LEFT,range:l,unitId:j,drawingId:O.drawingId})}else{const j=u.findNodeByCharIndex(S-2);if(j==null)return!0;v-=O.count,v-=j.count;const k=[{startOffset:v,endOffset:v,style:h}];o=await n.executeCommand(qe.id,{unitId:s.getUnitId(),range:{...l,startOffset:l.startOffset-1,endOffset:l.endOffset-1},segmentId:m,direction:ie.LEFT,len:j.count,textRanges:k})}}else v-=O.count,o=await n.executeCommand(qe.id,{unitId:s.getUnitId(),range:f,segmentId:m,direction:ie.LEFT,len:O.count})}else{const H=So(f,[f]);o=await n.executeCommand(Ve.id,{segmentId:m,textRanges:H,selections:[f]})}return o}},kn={id:"doc.command.delete-right",type:a.CommandType.COMMAND,handler:async i=>{var C,T;const t=i.get(D.DocSelectionManagerService),n=i.get(a.IUniverInstanceService).getCurrentUniverDocInstance();if(!n)return!1;const o=re(i,n.getUnitId()),s=i.get(a.ICommandService),r=t.getActiveTextRange(),c=t.getRectRanges(),l=t.getTextRanges(),A=o==null?void 0:o.getSkeleton();if(c!=null&&c.length){const R=Xt(l,c),v=c[0].segmentId,O=[{startOffset:R,endOffset:R}];return s.executeCommand(Ve.id,{segmentId:v,textRanges:O})}if(r==null||A==null||l==null)return!1;const{segmentId:d,style:u,segmentPage:m}=r,h=n==null?void 0:n.getSelfOrHeaderFooterModel(d).getBody();if(!n||!h)return!1;const g=r,{startOffset:p,endOffset:f,collapsed:S}=g;if(p===h.dataStream.length-2&&S)return!0;let E=!1;if(S===!0){const R=A.findNodeByCharIndex(p,d,m),v=A.findNodeByCharIndex(p+1);if(R.streamType===a.DataStreamTreeTokenType.PARAGRAPH&&(v==null?void 0:v.streamType)===a.DataStreamTreeTokenType.SECTION_BREAK)return!1;if(R.content==="\r")E=await s.executeCommand(jt.id,{direction:ie.RIGHT,range:r});else if(R.streamType==="\b"){const O=(T=n.getSnapshot().drawings)==null?void 0:T[(C=R.drawingId)!=null?C:""];if(O==null)return!0;if(O.layoutType===a.PositionedObjectLayoutType.INLINE){const b=n.getUnitId();E=await s.executeCommand(Gt.id,{direction:ie.RIGHT,range:r,unitId:b,drawingId:R.drawingId})}else{if(v==null)return!0;const b=[{startOffset:p+1,endOffset:p+1,style:u}];E=await s.executeCommand(qe.id,{unitId:n.getUnitId(),range:{...r,startOffset:p+1,endOffset:f+1},segmentId:d,direction:ie.RIGHT,textRanges:b,len:v.count})}}else{const O=[{startOffset:p,endOffset:p,style:u}];E=await s.executeCommand(qe.id,{unitId:n.getUnitId(),range:g,segmentId:d,direction:ie.RIGHT,textRanges:O,len:R.count})}}else{const R=So(g,[g]);E=await s.executeCommand(Ve.id,{segmentId:d,textRanges:R,selections:[g]})}return E}};function So(i,t){let e=i.endOffset;for(const o of t){const{startOffset:s,endOffset:r}=o;s==null||r==null||r<=i.endOffset&&(e-=r-s)}return[{startOffset:e,endOffset:e,style:i.style}]}const Vn={id:"doc.command.delete-current-paragraph",type:a.CommandType.COMMAND,handler:async i=>{var A,d;const t=i.get(a.IUniverInstanceService),e=i.get(a.ICommandService),n=t.getCurrentUnitOfType(a.UniverInstanceType.UNIVER_DOC);if(!n)return!1;const o=(d=(A=n.getBody())==null?void 0:A.dataStream)!=null?d:"",s=ht(i);if(!s)return!1;const r=a.BuildTextUtils.selection.delete([{startOffset:s.paragraphStart,endOffset:o[s.paragraphEnd+1]===`
|
|
@@ -33,4 +33,4 @@ ${a.DataStreamTreeTokenType.TABLE_CELL_END}`;break}}}_processBeforeLink(t,e){ret
|
|
|
33
33
|
univer-flex-col univer-px-4 univer-pb-4 univer-pt-14 univer-transition-all univer-duration-300
|
|
34
34
|
`,{"univer-rounded-r-2xl univer-bg-white univer-shadow univer-backdrop-blur-[10px] dark:!univer-bg-gray-900":f}),style:{...s,transform:A?"translateX(0)":"translateX(-100%)",maxHeight:c,opacity:A?1:0,maxWidth:u!=null?u:r==="side-bar"?320:180,paddingRight:r==="float"?void 0:0},children:P.jsx("div",{ref:S,className:J.clsx("univer-flex-1 univer-overflow-y-auto univer-overflow-x-hidden",J.scrollbarClassName),children:e==null?void 0:e.map(T=>P.jsx("div",{id:`univer-side-menu-${T.id}`,className:J.clsx(bl,{[Ol]:T.isTitle,[Rl]:T.level===1,[Ml]:T.level>1,"univer-text-gray-500 dark:!univer-text-gray-400":T.id!==l,"univer-text-gray-800 dark:!univer-text-gray-200":T.id===l}),style:{paddingLeft:(T.level-1)*12},onClick:()=>{n==null||n(T)},children:T.text},T.id))})})]})}),Dl=i=>{switch(i){case a.NamedStyleType.HEADING_1:return 1;case a.NamedStyleType.HEADING_2:return 2;case a.NamedStyleType.HEADING_3:return 3;case a.NamedStyleType.HEADING_4:return 4;case a.NamedStyleType.HEADING_5:return 5;case a.NamedStyleType.TITLE:return 1;default:return 1}};function Bl(i,t,e,n){var c,l;if(!i)return;const o=Array.from(i.values()),s=o.findIndex(A=>A.paragraphStart!==A.paragraphEnd&&A.rect.top<n&&A.rect.bottom>e);if(s===-1)return;const r=o==null?void 0:o.findLastIndex(A=>A.paragraphStart!==A.paragraphEnd&&A.rect.top<n&&A.rect.bottom>e);for(let A=s;A<=r;A++){const d=o[A],u=t.get(d.startIndex);if((c=u==null?void 0:u.paragraphStyle)!=null&&c.headingId)return u.paragraphStyle.headingId}for(let A=s;A>=0;A--){const d=o[A],u=t.get(d.startIndex);if((l=u==null?void 0:u.paragraphStyle)!=null&&l.headingId)return u.paragraphStyle.headingId}}const ja="__title";function _l(){var t,e,n;const i=I.useConfigValue(fn);return(n=(e=(t=i==null?void 0:i.layout)==null?void 0:t.docContainerConfig)==null?void 0:e.sideMenu)==null||n?P.jsx(Nl,{}):null}function Nl(){var N,x,U,F,V,H,Q,X,j;const i=I.useDependency(a.ICommandService),t=I.useDependency(a.IUniverInstanceService),e=I.useObservable(w.useMemo(()=>t.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_DOC),[])),n=I.useDependency(_.IRenderManagerService),o=(x=(N=e==null?void 0:e.getBody())==null?void 0:N.dataStream)!=null?x:"",[s,r]=w.useState(0),[c,l]=w.useState(void 0),A=(U=e==null?void 0:e.getUnitId())!=null?U:"",d=n.getRenderById(A),u=e==null?void 0:e.getTitle(),m=d==null?void 0:d.with(y.DocEventManagerService),h=m==null?void 0:m.paragraphBounds,g=(V=(F=d==null?void 0:d.mainComponent)==null?void 0:F.left)!=null?V:0,p=(H=d==null?void 0:d.engine.height)!=null?H:0,f=(Q=d==null?void 0:d.scene.scaleY)!=null?Q:1,S=(j=(X=e==null?void 0:e.getBody())==null?void 0:X.paragraphs)!=null?j:[],E=w.useMemo(()=>{const k=new Map;return S.forEach(W=>{k.set(W.startIndex,W)}),k},[S]);I.useObservable(w.useMemo(()=>d!=null&&d.engine.onTransformChange$?a.fromEventSubject(d==null?void 0:d.engine.onTransformChange$).pipe(L.throttleTime(33)):L.of(null),[d==null?void 0:d.engine.onTransformChange$]));const C=g<180?"float":"side-bar",T=S==null?void 0:S.filter(k=>{var W;return((W=k.paragraphStyle)==null?void 0:W.namedStyleType)!==void 0&&k.paragraphStyle.namedStyleType!==a.NamedStyleType.SUBTITLE&&k.paragraphStyle.namedStyleType!==a.NamedStyleType.NORMAL_TEXT}).map(k=>{var q;const W=Dl(k.paragraphStyle.namedStyleType),G=h==null?void 0:h.get(k.startIndex);if(!G)return null;const{paragraphStart:K,paragraphEnd:Y}=G;return{id:k.paragraphStyle.headingId,text:a.getPlainText(o.slice(K,Y)),level:W,isTitle:((q=k.paragraphStyle)==null?void 0:q.namedStyleType)===a.NamedStyleType.TITLE}}).filter(k=>k==null?void 0:k.text),R=I.useEvent(k=>{const W=k.viewportScrollY,G=W+p/f,K=Bl(h,E,W,G);K&&l(K)}),v=T!=null&&T.find(k=>k.isTitle)?T:[...u?[{id:ja,text:u,level:1,isTitle:!0}]:[],...T!=null?T:[]].filter(Boolean),[O,M]=w.useState(!0);w.useEffect(()=>{const k=a.debounce(r,100),W=i.onCommandExecuted(G=>{G.id===D.RichTextEditingMutation.id&&G.params.unitId===(e==null?void 0:e.getUnitId())&&k(Y=>Y+1)});return()=>{W.dispose()}},[i,e]),w.useEffect(()=>{const k=d==null?void 0:d.scene.getViewport(se.VIEW_MAIN);if(!k)return;const W=a.fromEventSubject(k.onScrollAfter$).pipe(L.throttleTime(33)).subscribe(R);return()=>{W.unsubscribe()}},[d]);const b=I.useEvent(k=>{const W=d==null?void 0:d.scene.getViewport(se.VIEW_MAIN);if(!W)return;if(k.id===ja){W.scrollToViewportPos({viewportScrollY:0});return}const G=S.find(Y=>{var q;return((q=Y.paragraphStyle)==null?void 0:q.headingId)===k.id});if(!G)return;const K=h==null?void 0:h.get(G.startIndex);K&&(W.scrollToViewportPos({viewportScrollY:K.rect.top}),l(k.id))});return!e||a.isInternalEditorID(A)||!(v!=null&&v.length)?null:P.jsx("div",{className:"univer-absolute univer-bottom-0 univer-left-0 univer-top-0 univer-z-[100] univer-w-[0px]",children:P.jsx(xl,{menus:v,open:O,onOpenChange:M,mode:C,maxWidth:C==="float"?void 0:Math.floor(g),wrapperClass:"univer-mt-12",activeId:c,onClick:b,maxHeight:p-48})})}const pe={id:"doc-paragraph-setting.command",type:a.CommandType.COMMAND,handler:async(i,t)=>{var C,T,R,v,O;const e=i.get(D.DocSelectionManagerService),n=i.get(a.IUniverInstanceService),o=i.get(a.ICommandService),s=n.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),r=e.getDocRanges();if(!s||r.length===0||!t)return!1;const c=r[0].segmentId,l=s.getUnitId(),A=s.getSelfOrHeaderFooterModel(c),d=(T=(C=A.getBody())==null?void 0:C.paragraphs)!=null?T:[],u=(v=(R=A.getBody())==null?void 0:R.dataStream)!=null?v:"",m=(O=a.BuildTextUtils.range.getParagraphsInRanges(r,d,u))!=null?O:[],h={id:D.RichTextEditingMutation.id,params:{unitId:l,actions:[],textRanges:r}},g=new a.MemoryCursor;g.reset();const p=new a.TextX,f=a.JSONX.getInstance();for(const M of m){const{startIndex:b}=M;p.push({t:a.TextXActionType.RETAIN,len:b-g.cursor});const N={...M.paragraphStyle,...t.paragraph};p.push({t:a.TextXActionType.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...M,paragraphStyle:N,startIndex:0}]},coverType:a.UpdateDocsAttributeType.REPLACE}),g.moveCursorTo(b+1)}const S=Z(s,c);return h.params.actions=f.editOp(p.serialize(),S),!!o.syncExecuteCommand(h.id,h.params)}},Pl=()=>{const i=I.useDependency(D.DocSelectionManagerService),t=I.useDependency(st),e=w.useMemo(()=>i.getDocRanges(),[]);return w.useEffect(()=>{e.length||t.closePanel()},[e]),e},wl=()=>{var l,A,d,u,m;const t=I.useDependency(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC),e=Pl();if(!t||e.length===0)return[];const n=e[0].segmentId,o=t.getSelfOrHeaderFooterModel(n),s=(A=(l=o.getBody())==null?void 0:l.paragraphs)!=null?A:[],r=(u=(d=o.getBody())==null?void 0:d.dataStream)!=null?u:"";return(m=a.BuildTextUtils.range.getParagraphsInRanges(e,s,r))!=null?m:[]},Ul=(i,t)=>{const e=I.useDependency(a.ICommandService),[n,o]=w.useState(()=>{var c,l;const r=i[0];return r?String((l=(c=r.paragraphStyle)==null?void 0:c.horizontalAlign)!=null?l:t):t});return[n,r=>(o(r),e.executeCommand(pe.id,{paragraph:{horizontalAlign:Number(r)}}))]},Ll=i=>{const t=I.useDependency(a.ICommandService),[e,n]=w.useState(()=>{var r;const s=i[0];return s?_.getNumberUnitValue((r=s.paragraphStyle)==null?void 0:r.indentStart,0):0});return[e,s=>(n(s),t.executeCommand(pe.id,{paragraph:{indentStart:{v:s}}}))]},Ql=i=>{const t=I.useDependency(a.ICommandService),[e,n]=w.useState(()=>{var r;const s=i[0];return s?_.getNumberUnitValue((r=s.paragraphStyle)==null?void 0:r.indentEnd,0):0});return[e,s=>(n(s),t.executeCommand(pe.id,{paragraph:{indentEnd:{v:s}}}))]},Fl=i=>{const t=I.useDependency(a.ICommandService),[e,n]=w.useState(()=>{var r;const s=i[0];return s?_.getNumberUnitValue((r=s.paragraphStyle)==null?void 0:r.indentFirstLine,0):0});return[e,s=>(n(s),t.executeCommand(pe.id,{paragraph:{indentFirstLine:{v:s}}}))]},Hl=i=>{const t=I.useDependency(a.ICommandService),[e,n]=w.useState(()=>{var r;const s=i[0];return s?_.getNumberUnitValue((r=s.paragraphStyle)==null?void 0:r.hanging,0):0});return[e,s=>(n(s),t.executeCommand(pe.id,{paragraph:{hanging:{v:s}}}))]},kl=i=>{const t=I.useDependency(a.ICommandService),[e,n]=w.useState(()=>{var r;const s=i[0];return s?_.getNumberUnitValue((r=s.paragraphStyle)==null?void 0:r.spaceAbove,0):0});return[e,s=>(n(s),t.executeCommand(pe.id,{paragraph:{spaceAbove:{v:s}}}))]},Vl=i=>{const t=I.useDependency(a.ICommandService),[e,n]=w.useState(()=>{var r;const s=i[0];return s?_.getNumberUnitValue((r=s.paragraphStyle)==null?void 0:r.spaceBelow,0):0});return[e,s=>(n(s),t.executeCommand(pe.id,{paragraph:{spaceBelow:{v:s}}}))]},Wl=i=>{const t=I.useDependency(a.ICommandService),e=I.useDependency(_.IRenderManagerService),n=I.useDependency(a.IUniverInstanceService),o=w.useMemo(()=>{var g;const h=n.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);if(h)return(g=e.getRenderById(h==null?void 0:h.getUnitId()))==null?void 0:g.with(D.DocSkeletonManagerService).getSkeleton()},[]),s=w.useMemo(()=>new L.BehaviorSubject({}),[]),[r,c]=w.useState(()=>{var g,p;const h=i[0];return h&&(p=(g=h.paragraphStyle)==null?void 0:g.lineSpacing)!=null?p:1}),l=w.useRef(r),[A,d]=w.useState(()=>{var g,p;const h=i[0];return h&&(p=(g=h.paragraphStyle)==null?void 0:g.spacingRule)!=null?p:a.SpacingRule.AUTO}),u=async h=>{c(h),s.next({lineSpacing:h,spacingRule:A})},m=async h=>{if(h!==A){let g=l.current;if(h===a.SpacingRule.AT_LEAST){const p=o==null?void 0:o.findNodeByCharIndex(i[0].startIndex),f=p==null?void 0:p.parent,S=f==null?void 0:f.parent;(S==null?void 0:S.contentHeight)!==void 0&&(g=Math.max(S.contentHeight,g))}else g>5&&(g=2);l.current=r,u(g),d(h),s.next({spacingRule:h})}};return w.useEffect(()=>{const h=s.pipe(dt.filter(g=>!!Object.keys(g).length),dt.bufferTime(16),dt.filter(g=>!!g.length),dt.map(g=>g.reduce((p,f)=>(Object.keys(f).forEach(S=>{p[S]=f[S]}),p),{}))).subscribe(g=>t.executeCommand(pe.id,{paragraph:{...g}}));return()=>h.unsubscribe()},[]),{lineSpacing:[r,u],spacingRule:[A,m]}},ze=i=>{const{value:t,onChange:e,className:n="",min:o=0,max:s=100,step:r=1}=i,c=w.useRef(null);return P.jsx(J.InputNumber,{step:r,ref:c,min:o,max:s,value:t,onChange:l=>{e(l!=null?l:0).finally(()=>{setTimeout(()=>{var A;(A=c.current)==null||A.focus()},30)})},className:n})};function Gl(){const i=I.useDependency(a.LocaleService),t=w.useMemo(()=>[{label:i.t("toolbar.alignLeft"),value:String(a.HorizontalAlign.LEFT),icon:P.jsx(fa,{})},{label:i.t("toolbar.alignCenter"),value:String(a.HorizontalAlign.CENTER),icon:P.jsx(ma,{})},{label:i.t("toolbar.alignRight"),value:String(a.HorizontalAlign.RIGHT),icon:P.jsx(Sa,{})},{label:i.t("toolbar.alignJustify"),value:String(a.HorizontalAlign.JUSTIFIED),icon:P.jsx(oa,{})}],[]),e=wl(),[n,o]=Ul(e,t[0].value),[s,r]=Ll(e),[c,l]=Ql(e),[A,d]=Fl(e),[u,m]=Hl(e),[h,g]=kl(e),[p,f]=Vl(e),{lineSpacing:[S,E],spacingRule:[C,T]}=Wl(e),R=w.useMemo(()=>C===a.SpacingRule.AUTO?{min:1,max:5,step:S<2?.5:1}:{min:1,max:100},[C,S]);return P.jsxs("div",{children:[P.jsx("div",{className:"univer-t-4 univer-text-sm univer-font-medium",children:i.t("doc.paragraphSetting.alignment")}),P.jsx("div",{className:J.clsx("univer-mt-4 univer-box-border univer-flex univer-w-full univer-items-center univer-justify-between univer-gap-1 univer-rounded-md univer-p-1",J.borderClassName),children:t.map(v=>P.jsx(J.Tooltip,{title:v.label,placement:"bottom",children:P.jsx("span",{className:J.clsx("hover:univer-bg-black/60 univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-none univer-px-3 univer-py-1",{"univer-bg-blend-color-dodge/90":n===v.value}),onClick:()=>o(v.value),children:v.icon})},v.value))}),P.jsx("div",{className:"univer-t-4 univer-text-sm univer-font-medium",children:i.t("doc.paragraphSetting.indentation")}),P.jsxs("div",{children:[P.jsxs("div",{className:"univer-item-center univer-flex univer-justify-between",children:[P.jsxs("div",{className:"univer-mt-3 univer-text-xs",children:[i.t("doc.paragraphSetting.left"),"(px)"]}),P.jsx(ze,{className:"univer-mt-4",value:s,onChange:v=>r(v!=null?v:0)})]}),P.jsxs("div",{className:"univer-item-center univer-flex univer-justify-between",children:[P.jsxs("div",{className:"univer-mt-3 univer-text-xs",children:[i.t("doc.paragraphSetting.right"),"(px)"]}),P.jsx(ze,{className:"univer-mt-4",value:c,onChange:v=>l(v!=null?v:0)})]}),P.jsxs("div",{className:"univer-item-center univer-flex univer-justify-between",children:[P.jsxs("div",{className:"univer-mt-3 univer-text-xs",children:[i.t("doc.paragraphSetting.firstLine"),"(px)"]}),P.jsx(ze,{className:"univer-mt-4",value:A,onChange:v=>d(v!=null?v:0)})]}),P.jsxs("div",{className:"univer-item-center univer-flex univer-justify-between",children:[P.jsxs("div",{className:"univer-mt-3 univer-text-xs",children:[i.t("doc.paragraphSetting.hanging"),"(px)"]}),P.jsx(ze,{className:"univer-mt-4",value:u,onChange:v=>m(v!=null?v:0)})]})]}),P.jsx("div",{className:"univer-t-4 univer-text-sm univer-font-medium",children:i.t("doc.paragraphSetting.spacing")}),P.jsxs("div",{children:[P.jsxs("div",{className:"univer-justify-betweenuniver-item-center univer-flex",children:[P.jsxs("div",{className:"univer-mt-3 univer-text-xs",children:[i.t("doc.paragraphSetting.before"),"(px)"]}),P.jsx(ze,{className:"univer-mt-4",value:h,onChange:v=>g(v!=null?v:0)})]}),P.jsxs("div",{className:"univer-item-center univer-flex univer-justify-between",children:[P.jsxs("div",{className:"univer-mt-3 univer-text-xs",children:[i.t("doc.paragraphSetting.after"),"(px)"]}),P.jsx(ze,{className:"univer-mt-4",value:p,onChange:v=>f(v!=null?v:0)})]}),P.jsxs("div",{className:"item-center univer-flex univer-justify-between",children:[P.jsx("div",{className:"univer-mt-3 univer-text-xs",children:i.t("doc.paragraphSetting.lineSpace")}),P.jsxs("div",{className:"univer-mt-4 univer-flex univer-w-[162px] univer-flex-col univer-gap-1.5",children:[P.jsx(J.Select,{value:`${C}`,options:[{label:i.t("doc.paragraphSetting.multiSpace"),value:`${a.SpacingRule.AUTO}`},{label:i.t("doc.paragraphSetting.fixedValue"),value:`${a.SpacingRule.AT_LEAST}`}],onChange:v=>T(Number(v))}),P.jsx(ze,{...R,value:S,onChange:v=>E(v!=null?v:0)})]})]})]})]})}const jl=(i,t)=>t.length===i.length&&i.some(e=>t.some(n=>n.startOffset===e.startOffset&&n.endOffset===e.endOffset));function Xl(){const i=I.useDependency(a.ICommandService),t=I.useDependency(a.LocaleService),e=I.useObservable(t.currentLocale$),[n,o]=w.useState(""),s=w.useMemo(()=>a.debounce(()=>o(a.generateRandomId(4)),300),[]),r=w.useRef([]);return w.useEffect(()=>{const c=i.onCommandExecuted(l=>{if(D.SetTextSelectionsOperation.id===l.id){const A=l.params.ranges;jl(A,r.current)||o(a.generateRandomId(4)),r.current=A}D.RichTextEditingMutation.id===l.id&&l.params.trigger!==pe.id&&s()});return()=>c.dispose()},[s]),w.useEffect(()=>{o(a.generateRandomId(4))},[e]),w.useEffect(()=>()=>s.cancel(),[s]),P.jsx(Gl,{},n)}var Kl=Object.getOwnPropertyDescriptor,zl=(i,t,e,n)=>{for(var o=n>1?void 0:n?Kl(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},ki=(i,t)=>(e,n)=>t(e,n,i);const Xa="doc_ui_paragraph-setting-panel";let st=class extends a.Disposable{constructor(t,e,n){super();B(this,"_id");this._commandService=t,this._componentManager=e,this._sidebarService=n,this._init()}_init(){this.disposeWithMe(this._componentManager.register(Xa,Xl))}openPanel(){const t={header:{title:"doc.slider.paragraphSetting"},id:this._id,children:{label:Xa},width:300};this._sidebarService.open(t)}closePanel(){this._sidebarService.close(this._id)}};st=zl([ki(0,a.ICommandService),ki(1,a.Inject(I.ComponentManager)),ki(2,a.Inject(I.ISidebarService))],st);const Vi={id:"sidebar.operation.doc-paragraph-setting-panel",type:a.CommandType.OPERATION,handler:i=>(i.get(st).openPanel(),!0)},Wi=i=>{const t=i.get(D.DocSelectionManagerService);return new L.Observable(e=>{const n=t.textSelection$.subscribe(()=>{t.getDocRanges().some(r=>r.collapsed===!1||r.rangeType===a.DOC_RANGE_TYPE.RECT)?e.next(!1):e.next(!0)});return()=>n.unsubscribe()})};function Yl(i){if(i.length<2)return!0;const t=i.map(e=>e.tableId);return t.every(e=>e===t[0])}function Ka(i,t,e){var s;const n=t.getRectRanges(),o=t.getActiveTextRange();if(n&&n.length&&Yl(n)&&o==null){i.next(!1);return}if(o&&(n==null||n.length===0)){const{segmentId:r,startOffset:c,endOffset:l}=o,A=e.getCurrentUniverDocInstance(),d=(s=A==null?void 0:A.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:s.tables;if(d&&d.length&&d.some(u=>{const{startIndex:m,endIndex:h}=u;return c>m&&c<h||l>m&&l<h})){i.next(!1);return}}i.next(!0)}const Oe=i=>{const t=i.get(D.DocSelectionManagerService),e=i.get(a.IUniverInstanceService);return new L.Observable(n=>{const o=t.textSelection$.subscribe(()=>{Ka(n,t,e)});return Ka(n,t,e),()=>o.unsubscribe()})},ql=i=>({id:pt.name,commandId:pt.id,type:I.MenuItemType.BUTTON,icon:"CopyDoubleIcon",title:"rightClick.copy",disabled$:Wi(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}),Jl=i=>({id:Vi.id,type:I.MenuItemType.BUTTON,icon:"MenuIcon",title:"doc.menu.paragraphSetting",hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}),Zl=i=>({id:zt.id,type:I.MenuItemType.BUTTON,icon:"CopyDoubleIcon",title:"rightClick.cut",disabled$:Wi(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}),$l=i=>({id:Yt.id,type:I.MenuItemType.BUTTON,icon:"PasteSpecialDoubleIcon",title:"rightClick.paste",hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}),ed=i=>({id:gt.id,type:I.MenuItemType.BUTTON,icon:"PasteSpecialDoubleIcon",title:"rightClick.delete",disabled$:Wi(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}),za="doc.menu.table-insert";function td(i){return{id:za,type:I.MenuItemType.SUBITEMS,title:"table.insert",icon:"InsertDoubleIcon",hidden$:L.combineLatest(I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC),Oe(i),(t,e)=>t||e)}}function nd(i){return{id:sn.id,type:I.MenuItemType.BUTTON,title:"table.insertRowAbove",icon:"InsertRowAboveDoubleIcon",disabled$:Oe(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}}function id(i){return{id:rn.id,type:I.MenuItemType.BUTTON,title:"table.insertRowBelow",icon:"InsertRowBelowDoubleIcon",disabled$:Oe(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}}function od(i){return{id:cn.id,type:I.MenuItemType.BUTTON,title:"table.insertColumnLeft",icon:"LeftInsertColumnDoubleIcon",disabled$:Oe(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}}function ad(i){return{id:ln.id,type:I.MenuItemType.BUTTON,title:"table.insertColumnRight",icon:"RightInsertColumnDoubleIcon",disabled$:Oe(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}}const Ya="doc.menu.table-delete";function sd(i){return{id:Ya,type:I.MenuItemType.SUBITEMS,title:"table.delete",icon:"ReduceDoubleIcon",hidden$:L.combineLatest(I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC),Oe(i),(t,e)=>t||e)}}function rd(i){return{id:on.id,type:I.MenuItemType.BUTTON,title:"table.deleteRows",icon:"DeleteRowDoubleIcon",disabled$:Oe(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}}function cd(i){return{id:an.id,type:I.MenuItemType.BUTTON,title:"table.deleteColumns",icon:"DeleteColumnDoubleIcon",disabled$:Oe(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}}function ld(i){return{id:at.id,type:I.MenuItemType.BUTTON,title:"table.deleteTable",icon:"GridIcon",disabled$:Oe(i),hidden$:I.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_DOC)}}const qa={[I.RibbonStartGroup.FORMAT]:{[xe.id]:{order:0,menuItemFactory:ac},[De.id]:{order:1,menuItemFactory:sc},[Be.id]:{order:2,menuItemFactory:rc},[_e.id]:{order:3,menuItemFactory:cc},[Ee.id]:{order:4,menuItemFactory:lc},[Ne.id]:{order:5,menuItemFactory:dc},[ce.id]:{order:5.5,menuItemFactory:hc},[ge.id]:{order:6,menuItemFactory:uc},[We.id]:{order:7,menuItemFactory:Ac},[Pe.id]:{order:8,menuItemFactory:gc},[we.id]:{order:9,menuItemFactory:Oc,[$e.id]:{order:0,menuItemFactory:bc}}},[I.RibbonStartGroup.LAYOUT]:{[Ct.id]:{order:2,menuItemFactory:Ic},[Tt.id]:{order:3,menuItemFactory:vc},[yt.id]:{order:4,menuItemFactory:Ec},[bt.id]:{order:5,menuItemFactory:Cc},[ft.id]:{order:6,menuItemFactory:Tc},[nt.id]:{order:7,menuItemFactory:Pa},[tt.id]:{order:8,menuItemFactory:wa},[Et.id]:{order:9,menuItemFactory:Ua},[Ui.id]:{order:10,menuItemFactory:mc},[Mt.id]:{order:11,menuItemFactory:yc},[Fi.id]:{order:12,menuItemFactory:Rc}},[I.RibbonInsertGroup.MEDIA]:{[Na]:{order:2,menuItemFactory:fc,[dn.id]:{order:0,menuItemFactory:Sc}}},[I.ContextMenuPosition.MAIN_AREA]:{[I.ContextMenuGroup.FORMAT]:{[pt.name]:{order:0,menuItemFactory:ql},[zt.id]:{order:1,menuItemFactory:Zl},[Yt.id]:{order:2,menuItemFactory:$l},[gt.id]:{order:3,menuItemFactory:ed}},[I.ContextMenuGroup.LAYOUT]:{[Vi.id]:{order:0,menuItemFactory:Jl},[za]:{order:1,menuItemFactory:td,[sn.id]:{order:1,menuItemFactory:nd},[rn.id]:{order:2,menuItemFactory:id},[cn.id]:{order:3,menuItemFactory:od},[ln.id]:{order:4,menuItemFactory:ad}},[Ya]:{order:2,menuItemFactory:sd,[on.id]:{order:1,menuItemFactory:rd},[an.id]:{order:2,menuItemFactory:cd},[at.id]:{order:3,menuItemFactory:ld}}}},[I.ContextMenuPosition.PARAGRAPH]:{[I.ContextMenuGroup.QUICK]:{[li.id]:{order:0,menuItemFactory:xc},[di.id]:{order:1,menuItemFactory:Dc},[Ai.id]:{order:2,menuItemFactory:Bc},[ui.id]:{order:3,menuItemFactory:_c},[hi.id]:{order:4,menuItemFactory:Nc},[Jt.id]:{order:5,menuItemFactory:Pc},[nt.id]:{order:6,menuItemFactory:Pa},[tt.id]:{order:7,menuItemFactory:wa},[Et.id]:{order:8,menuItemFactory:Ua}},[I.ContextMenuGroup.FORMAT]:{[zn.id]:{order:0,menuItemFactory:wc},[Yn.id]:{order:1,menuItemFactory:Uc},[Vn.id]:{order:2,menuItemFactory:Lc}},[I.ContextMenuGroup.LAYOUT]:{[Qa]:{menuItemFactory:Vc,[ai.id]:{order:0,menuItemFactory:Qc},[si.id]:{order:1,menuItemFactory:Fc},[ri.id]:{order:2,menuItemFactory:Hc},[qn.id]:{order:3,menuItemFactory:kc}}}}};var dd=Object.getOwnPropertyDescriptor,Ad=(i,t,e,n)=>{for(var o=n>1?void 0:n?dd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Re=(i,t)=>(e,n)=>t(e,n,i);y.DocUIController=class extends a.Disposable{constructor(t,e,n,o,s,r,c,l,A){super(),this._injector=t,this._componentManager=e,this._commandService=n,this._layoutService=o,this._menuManagerService=s,this._uiPartsService=r,this._univerInstanceService=c,this._shortcutService=l,this._configService=A,this._init()}_initCustomComponents(){[[Ba,$r],[Da,Jr],["TodoListDoubleIcon",Ia],["doc.paragraph.menu",ol],["CutIcon",sa],["DeleteIcon",ra],[Qi,tc],["DocumentSettingIcon",ca]].forEach(([t,e])=>{this.disposeWithMe(this._componentManager.register(t,e))})}_initUiParts(){this.disposeWithMe(this._uiPartsService.registerComponent(I.BuiltInUIPart.FOOTER,()=>I.connectInjector(yl,this._injector))),this.disposeWithMe(this._uiPartsService.registerComponent(I.BuiltInUIPart.CONTENT,()=>I.connectInjector(_l,this._injector)))}_initMenus(){this._menuManagerService.mergeMenu(qa)}_initShortCut(){[cl,ll,dl,Al,ul,hl,pl,fl,ml,gl,Sl,Il,sl].forEach(t=>{this.disposeWithMe(this._shortcutService.registerShortcut(t))})}_init(){this._initCustomComponents(),this._initMenus(),this._initFocusHandler(),this._initCommands(),this._initUiParts(),this._initShortCut()}_initCommands(){[Ra,Ui,Pi].forEach(t=>this.disposeWithMe(this._commandService.registerCommand(t)))}_initFocusHandler(){this.disposeWithMe(this._layoutService.registerFocusHandler(a.UniverInstanceType.UNIVER_DOC,t=>{this._injector.get(_.IRenderManagerService).getRenderById(t).with(y.DocSelectionRenderService).focus()}))}},y.DocUIController=Ad([Re(0,a.Inject(a.Injector)),Re(1,a.Inject(I.ComponentManager)),Re(2,a.ICommandService),Re(3,I.ILayoutService),Re(4,I.IMenuManagerService),Re(5,I.IUIPartsService),Re(6,a.IUniverInstanceService),Re(7,I.IShortcutService),Re(8,a.IConfigService)],y.DocUIController);var ud=Object.getOwnPropertyDescriptor,hd=(i,t,e,n)=>{for(var o=n>1?void 0:n?ud(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Gi=(i,t)=>(e,n)=>t(e,n,i);const Ja=1.5;y.DocBackScrollRenderController=class extends a.RxDisposable{constructor(t,e,n,o){super(),this._context=t,this._textSelectionManagerService=e,this._editorService=n,this._docSkeletonManagerService=o,this._init()}_init(){this._textSelectionManagerService.textSelection$.pipe(L.takeUntil(this.dispose$)).subscribe(t=>{if(t==null)return;const{isEditing:e,unitId:n}=t;n!==this._context.unitId||!e||this._context.unitId!==a.DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&this._scrollToSelection()})}scrollToRange(t){const e=this._docSkeletonManagerService.getSkeleton();if(!e)return;const{startOffset:n}=t,o=e.findNodePositionByCharIndex(n);o&&this.scrollToNode(o)}scrollToNode(t){var N;const{unitId:e,scene:n,mainComponent:o}=this._context,s=this._docSkeletonManagerService.getSkeleton();if(o==null||s==null)return;const r=o.getOffsetConfig(),{docsLeft:c,docsTop:l}=r,A=new Te(r,s),{contentBoxPointGroup:d}=A.getRangePointData(t,t),{left:u,top:m,height:h}=Rt(d),g=u+c,p=m+l,f=n.getViewport(se.VIEW_MAIN),S=this._editorService.getEditor(e);if(f==null)return;const{left:E,top:C,right:T,bottom:R}=f.getBounding().viewBound;let v=0,O=0;const M=S?(N=S.params.backScrollOffset)!=null?N:0:100;p<C?v=p-C-M:p>R-h&&(v=p-R+h+M),g<E?O=g-E:g>T-Ja&&(O=g-T+Ja);const b=f.transViewportScroll2ScrollValue(O,v);f.scrollByBarDeltaValue(b)}_scrollToSelection(){const t=this._textSelectionManagerService.getActiveTextRange();if(t==null)return;const{collapsed:e,startNodePosition:n}=t;e&&this.scrollToNode(n)}},y.DocBackScrollRenderController=hd([Gi(1,a.Inject(D.DocSelectionManagerService)),Gi(2,de),Gi(3,a.Inject(D.DocSkeletonManagerService))],y.DocBackScrollRenderController);var gd=Object.getOwnPropertyDescriptor,md=(i,t,e,n)=>{for(var o=n>1?void 0:n?gd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},rt=(i,t)=>(e,n)=>t(e,n,i);y.DocRenderController=class extends a.RxDisposable{constructor(t,e,n,o,s,r,c){super(),this._context=t,this._commandService=e,this._docSelectionRenderService=n,this._docSkeletonManagerService=o,this._editorService=s,this._renderManagerService=r,this._univerInstanceService=c,this._addNewRender(),this._initRenderRefresh(),this._initCommandListener()}reRender(t){var r,c;const e=(r=this._renderManagerService.getRenderById(t))==null?void 0:r.with(D.DocSkeletonManagerService),n=e==null?void 0:e.getSkeleton();if(!n||!!n.getViewModel().getDataModel().getSnapshot().disabled)return;n.calculate();const s=this._editorService.getEditor(t);if(this._editorService.isEditor(t)&&!(s!=null&&s.params.scrollBar)){(c=this._context.mainComponent)==null||c.makeDirty();return}this._recalculateSizeBySkeleton(n)}_addNewRender(){const{scene:t,engine:e}=this._context,n=new _.Viewport(se.VIEW_MAIN,t,{left:0,top:0,bottom:0,right:0,isWheelPreventDefaultX:!0});t.attachControl(),t.onMouseWheel$.subscribeEvent((s,r)=>{const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);if((c==null?void 0:c.getUnitId())!==this._context.unitId)return;const l=s;if(l.ctrlKey){const A=Math.abs(l.deltaX);let d=A<40?.2:A<80?.4:.2;d*=l.deltaY>0?-1:1,t.scaleX<1&&(d/=2),t.scaleX+d>4?t.scale(4,4):t.scaleX+d<.1?t.scale(.1,.1):l.preventDefault()}else n.onMouseWheel(l,r)}),new _.ScrollBar(n),t.addLayer(new _.Layer(t,[],Ut),new _.Layer(t,[],ro)),this._addComponent();const o=()=>t.render();this.disposeWithMe(this._context.activated$.subscribe(s=>{s?e.runRenderLoop(o):e.stopRenderLoop(o)})),this._docSelectionRenderService.__attachScrollEvent()}_addComponent(){const{scene:t,unit:e,components:n}=this._context,r={pageMarginLeft:20,pageMarginTop:20},c=new _.Documents(Ae.MAIN,void 0,r);c.zIndex=Dn;const l=new _.DocBackground(Ae.BACKGROUND,void 0,r);l.zIndex=Dn,this._context.mainComponent=c,n.set(Ae.MAIN,c),n.set(Ae.BACKGROUND,l),t.addObjects([c],Ut),t.addObjects([l],so),this._editorService.getEditor(e.getUnitId())==null&&t.enableLayerCache(Ut)}_initRenderRefresh(){this._docSkeletonManagerService.currentSkeletonBefore$.pipe(L.takeUntil(this.dispose$)).subscribe(t=>{this._create(t)})}_create(t){var l;if(!t)return;const{mainComponent:e,components:n}=this._context,o=e,s=n.get(Ae.BACKGROUND);o.changeSkeleton(t),s.changeSkeleton(t);const{unitId:r}=this._context,c=this._editorService.getEditor(r);if(this._editorService.isEditor(r)&&!(c!=null&&c.params.scrollBar)){(l=this._context.mainComponent)==null||l.makeDirty();return}this._recalculateSizeBySkeleton(t)}_initCommandListener(){const t=[D.RichTextEditingMutation.id];this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(t.includes(e.id)){const n=e.params,{unitId:o}=n;this.reRender(o)}}))}_recalculateSizeBySkeleton(t){var g;const{mainComponent:e,scene:n,unitId:o,components:s}=this._context,r=e,c=s.get(Ae.BACKGROUND),l=(g=t.getSkeletonData())==null?void 0:g.pages;if(l==null)return;let A=0,d=0;const m=this._context.unit.getSnapshot().documentStyle.documentFlavor;for(let p=0,f=l.length;p<f;p++){const S=l[p];let{pageWidth:E,pageHeight:C}=S;if(m===a.DocumentFlavor.MODERN){const T=pd(S);E=T.pageWidth,C=T.pageHeight}r.pageLayoutType===_.PageLayoutType.VERTICAL?(d+=C,d+=r.pageMarginTop,p===f-1&&(d+=r.pageMarginTop),A=Math.max(A,E)):r.pageLayoutType===_.PageLayoutType.HORIZONTAL&&(A+=E,p!==f-1&&(A+=r.pageMarginLeft),d=Math.max(d,C))}r.resize(A,d),c.resize(A,d);const h=this._editorService.getEditor(o);(!this._editorService.isEditor(o)||h!=null&&h.params.scrollBar)&&n.resize(A,d)}},y.DocRenderController=md([rt(1,a.ICommandService),rt(2,a.Inject(y.DocSelectionRenderService)),rt(3,a.Inject(D.DocSkeletonManagerService)),rt(4,de),rt(5,_.IRenderManagerService),rt(6,a.IUniverInstanceService)],y.DocRenderController);function pd(i){let{pageWidth:t,pageHeight:e}=i;const{marginLeft:n,marginRight:o,marginTop:s,marginBottom:r,skeDrawings:c,skeTables:l}=i;t===Number.POSITIVE_INFINITY&&(t=i.width+n+o),e===Number.POSITIVE_INFINITY&&(e=i.height+s+r);for(const A of c.values())t=Math.max(t,A.aLeft+A.width+n+o),e=Math.max(e,A.aTop+A.height+s+r);for(const A of l.values())t=Math.max(t,A.left+A.width+n+o),e=Math.max(e,A.top+A.height+s+r);return{pageWidth:t,pageHeight:e}}var fd=Object.getOwnPropertyDescriptor,Sd=(i,t,e,n)=>{for(var o=n>1?void 0:n?fd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},ji=(i,t)=>(e,n)=>t(e,n,i);let Xi=class{constructor(i,t,e){B(this,"_docContainer");B(this,"getComponent",i=>{if(this._docContainer=i,!i.getContentRef().current)throw new Error("container is not ready")});B(this,"changeLocale",i=>{this._localeService.setLocale(i)});this._localeService=i,this._injector=t,this._configService=e}getUIConfig(){return{injector:this._injector,config:this._configService.getConfig(fn),changeLocale:this.changeLocale,getComponent:this.getComponent}}getContentRef(){return this._docContainer.getContentRef()}UIDidMount(i){if(this._docContainer)return i(this._docContainer)}getDocContainer(){return this._docContainer}};Xi=Sd([ji(0,a.Inject(a.LocaleService)),ji(1,a.Inject(a.Injector)),ji(2,a.IConfigService)],Xi);var Id=Object.getOwnPropertyDescriptor,vd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Id(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Ed=(i,t)=>(e,n)=>t(e,n,i);let Sn=class extends a.RxDisposable{constructor(t){super();B(this,"_docContainerController");this._injector=t,this._docContainerController=this._injector.createInstance(Xi)}};Sn=vd([Ed(0,a.Inject(a.Injector))],Sn);var Cd=Object.getOwnPropertyDescriptor,Td=(i,t,e,n)=>{for(var o=n>1?void 0:n?Cd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Za=(i,t)=>(e,n)=>t(e,n,i);let In=class extends a.Disposable{constructor(i,t){super(),this._docAutoFormatService=i,this._renderManagerService=t,this._initListTabAutoFormat(),this._initSpaceAutoFormat(),this._initDefaultEnterFormat(),this._initExitListAutoFormat()}_initListTabAutoFormat(){this.disposeWithMe(this._docAutoFormatService.registerAutoFormat({id:ke.id,match:i=>{var o;const{selection:t,paragraphs:e,unit:n}=i;if(e.length===1&&t.startOffset===e[0].paragraphStart&&e[0].bullet){const s=(o=n.getBody())==null?void 0:o.paragraphs,r=s==null?void 0:s.filter(c=>{var l;return((l=c.bullet)==null?void 0:l.listId)===e[0].bullet.listId});return(r==null?void 0:r.findIndex(c=>c.startIndex===e[0].startIndex))!==0}else if(e.length>1&&e.some(s=>s.bullet))return!0;return!1},getMutations(i){const t=i.commandParams;return[{id:qt.id,params:{type:t!=null&&t.shift?vt.decrease:vt.increase}}]},priority:100})),this.disposeWithMe(this._docAutoFormatService.registerAutoFormat({id:ke.id,match:i=>{const{selection:t,unit:e}=i,{startNodePosition:n,endNodePosition:o}=t,s=this._renderManagerService.getRenderById(e.getUnitId()),r=s==null?void 0:s.with(D.DocSkeletonManagerService).getSkeleton();return r==null?!1:!!(n&&o&&qo(r,n,o)||n&&!o&&n.path.indexOf("cells")>-1)},getMutations(i){const t=i.commandParams;return[{id:xi.id,params:{shift:!!(t!=null&&t.shift)}}]},priority:99}))}_initSpaceAutoFormat(){this.disposeWithMe(this._docAutoFormatService.registerAutoFormat({id:At.id,match:i=>{var s;const{selection:t,paragraphs:e,unit:n}=i;if(!t.collapsed||e.length!==1||!t.collapsed)return!1;const o=(s=n.getBody())==null?void 0:s.dataStream.slice(e[0].paragraphStart,t.startOffset-1);return!!(o&&(Object.keys(a.QuickListTypeMap).includes(o)||Object.keys(ci).includes(o)))},getMutations(i){var s;const{paragraphs:t,unit:e,selection:n}=i,o=(s=e.getBody())==null?void 0:s.dataStream.slice(t[0].paragraphStart,n.startOffset-1);if(o&&Object.keys(a.QuickListTypeMap).includes(o)){const r=a.QuickListTypeMap[o];return[{id:ii.id,params:{listType:r,paragraph:t[0]}}]}if(o&&Object.keys(ci).includes(o)){const r=ci[o];return[{id:Xo.id,params:{value:r}}]}return[]}}))}_initExitListAutoFormat(){this.disposeWithMe(this._docAutoFormatService.registerAutoFormat({id:Ye.id,match:i=>{const{paragraphs:t}=i;return!!(t.length===1&&t[0].bullet&&t[0].paragraphStart===t[0].paragraphEnd)},getMutations:i=>{const t=i.paragraphs[0].bullet;return t?t.nestingLevel>0?[{id:qt.id,params:{type:vt.decrease}}]:[{id:et.id,params:{listType:i.paragraphs[0].bullet.listType}}]:[]}}))}_initDefaultEnterFormat(){this.disposeWithMe(this._docAutoFormatService.registerAutoFormat({id:Ye.id,match:()=>!0,getMutations(){return[{id:Ft.id}]},priority:-9999}))}};In=Td([Za(0,a.Inject(y.DocAutoFormatService)),Za(1,_.IRenderManagerService)],In);function yd(i){return i.rows[0].cells[0].sections[0].columns[0].lines[0]}function bd(i){const t=i.rows[i.rows.length-1],e=t.cells[t.cells.length-1];return _.getLastLine(e)}function Od(i,t){const{ed:e}=i,{skeTables:n}=t;let o=null;for(const s of n.values())if(s.st===e+1){o=s;break}return o}function $a(i){const t=i==null?void 0:i.parent;let e=null,n=null;if(i==null||t==null)return{lineBeforeTable:e,lineAfterTable:n};const{st:o,ed:s}=i,r=t.type===_.DocumentSkeletonPageType.CELL?[t]:t.parent.pages;return _.lineIterator(r,c=>{c.st===s+1?n=c:c.ed===o-1&&(e=c)}),{lineBeforeTable:e,lineAfterTable:n}}function es(i){return i.sections[0].columns[0].lines.length===0}function ts(i){var r,c;const t=i.parent,e=t==null?void 0:t.parent,n=e==null?void 0:e.tableId;if(t==null||e==null)return;const o=t.cells.indexOf(i);let s=e.rows[e.rows.indexOf(t)+1];if(s==null&&n.indexOf("#-#")){const[l,A]=n.split("#-#"),d=(c=(r=e.parent)==null?void 0:r.parent)==null?void 0:c.pages,u=`${l}#-#${Number.parseInt(A)+1}`;if(d)for(const m of d){const{skeTables:h}=m;if(h.has(u)){const g=h.get(u);if(g!=null&&g.rows.length){s=g.rows.find(p=>!p.isRepeatRow);break}}}}if(s!=null){const l=s.cells[o];return es(l)?ts(l):l}}function ns(i){var s,r;const t=i.parent,e=t==null?void 0:t.parent;if(t==null||e==null)return;let n=e.rows[e.rows.indexOf(t)-1];const o=t.cells.indexOf(i);if((n==null||n.isRepeatRow)&&e.tableId.indexOf("#-#")){const[c,l]=e.tableId.split("#-#"),A=(r=(s=e.parent)==null?void 0:s.parent)==null?void 0:r.pages,d=`${c}#-#${Number.parseInt(l)-1}`;if(A)for(const u of A){const{skeTables:m}=u;if(m.has(d)){const h=m.get(d);if(h!=null&&h.rows.length){n=h.rows[h.rows.length-1];break}}}}if(n!=null){const c=n.cells[o];return es(c)?ns(c):c}}function Rd(i,t){const{st:e}=i,{skeTables:n}=t;let o=null;for(const s of n.values())if(s.ed===e-1){o=s;break}return o}function Md(i){return i.sections[0].columns[0].lines[0]}function xd(i){const t=_.getLastColumn(i);return t.lines[t.lines.length-1]}var Dd=Object.getOwnPropertyDescriptor,Bd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Dd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},vn=(i,t)=>(e,n)=>t(e,n,i);let En=class extends a.Disposable{constructor(t,e,n,o){super();B(this,"_onInputSubscription");this._univerInstanceService=t,this._renderManagerService=e,this._textSelectionManagerService=n,this._commandService=o,this._commandExecutedListener()}dispose(){var t;super.dispose(),(t=this._onInputSubscription)==null||t.unsubscribe()}_commandExecutedListener(){const t=[ye.id,be.id];this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(!t.includes(e.id))return;const n=e.params;switch(e.id){case ye.id:return this._handleMoveCursor(n.direction);case be.id:return this._handleShiftMoveSelection(n.direction);default:throw new Error("Unknown command")}}))}_handleShiftMoveSelection(t){var C,T,R;const e=this._textSelectionManagerService.getActiveTextRange(),n=this._textSelectionManagerService.getTextRanges(),o=this._univerInstanceService.getCurrentUniverDocInstance();if(o==null)return;const s=(C=this._renderManagerService.getRenderById(o.getUnitId()))==null?void 0:C.with(D.DocSkeletonManagerService).getSkeleton(),r=this._getDocObject();if(e==null||s==null||r==null)return;const{startOffset:c,endOffset:l,style:A,collapsed:d,direction:u,segmentId:m,startNodePosition:h,endNodePosition:g,segmentPage:p}=e;if(n.length>1){let v=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(const M of n)v=Math.min(v,M.startOffset),O=Math.max(O,M.endOffset);this._textSelectionManagerService.replaceTextRanges([{startOffset:t===a.Direction.LEFT||t===a.Direction.UP?O:v,endOffset:t===a.Direction.LEFT||t===a.Direction.UP?v:O,style:A}],!1);return}const f=d||u===a.RANGE_DIRECTION.FORWARD?c:l;let S=d||u===a.RANGE_DIRECTION.FORWARD?l:c;const E=(T=o.getSelfOrHeaderFooterModel(m).getBody().dataStream.length)!=null?T:Number.POSITIVE_INFINITY;if(t===a.Direction.LEFT||t===a.Direction.RIGHT){const v=s.findNodeByCharIndex(S-1,m,p),O=s.findNodeByCharIndex(S,m,p);S=t===a.Direction.RIGHT?S+O.count:S-((R=v==null?void 0:v.count)!=null?R:0),S=Math.min(E-2,Math.max(0,S)),this._textSelectionManagerService.replaceTextRanges([{startOffset:f,endOffset:S,style:A}],!1),this._scrollToFocusNodePosition(o.getUnitId(),S)}else{const v=s.findNodeByCharIndex(S,m,p),O=r.document.getOffsetConfig(),M=d?h:u===a.RANGE_DIRECTION.FORWARD?g:h,b=this._getTopOrBottomPosition(s,v,M,t===a.Direction.DOWN,!0);if(b==null){const x=t===a.Direction.UP?0:E-2;if(x===S)return;this._textSelectionManagerService.replaceTextRanges([{startOffset:f,endOffset:x,style:A}],!1);return}const N=new Te(O,s).getRangePointData(b,b).cursorList[0];this._textSelectionManagerService.replaceTextRanges([{startOffset:f,endOffset:N.endOffset,style:A}],!1),this._scrollToFocusNodePosition(o.getUnitId(),N.endOffset)}}_handleMoveCursor(t){var E,C,T,R;const e=this._textSelectionManagerService.getActiveTextRange(),n=this._textSelectionManagerService.getTextRanges(),o=this._univerInstanceService.getCurrentUniverDocInstance();if(o==null)return!1;const s=(E=this._renderManagerService.getRenderById(o.getUnitId()))==null?void 0:E.with(D.DocSkeletonManagerService).getSkeleton(),r=this._getDocObject();if(e==null||s==null||r==null||n==null)return;const{startOffset:c,endOffset:l,style:A,collapsed:d,segmentId:u,startNodePosition:m,endNodePosition:h,segmentPage:g}=e,p=o.getSelfOrHeaderFooterModel(u).getBody();if(p==null)return;const f=(C=p.dataStream.length)!=null?C:Number.POSITIVE_INFINITY,S=(T=o.getCustomRanges())!=null?T:[];if(t===a.Direction.LEFT||t===a.Direction.RIGHT){let v;if(!e.collapsed||n.length>1){let b=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY;for(const x of n)b=Math.min(b,x.startOffset),N=Math.max(N,x.endOffset);v=t===a.Direction.LEFT?b:N}else{const b=s.findNodeByCharIndex(c-1,u,g),N=s.findNodeByCharIndex(c,u,g),x=s.findNodeByCharIndex(c+1,u,g);t===a.Direction.LEFT?v=Math.max(0,c-((R=b==null?void 0:b.count)!=null?R:1)):v=Math.min(f-2,l+N.count+((x==null?void 0:x.streamType)===a.DataStreamTreeTokenType.SECTION_BREAK?1:0))}const O=[a.DataStreamTreeTokenType.TABLE_START,a.DataStreamTreeTokenType.TABLE_END,a.DataStreamTreeTokenType.TABLE_ROW_START,a.DataStreamTreeTokenType.TABLE_ROW_END,a.DataStreamTreeTokenType.TABLE_CELL_START,a.DataStreamTreeTokenType.TABLE_CELL_END,a.DataStreamTreeTokenType.SECTION_BREAK];if(t===a.Direction.LEFT)for(;O.includes(p.dataStream[v]);)v--;else for(;O.includes(p.dataStream[v]);)v++;S.filter(b=>b.wholeEntity&&b.startIndex<v&&b.endIndex>=v).forEach(b=>{t===a.Direction.LEFT?v=Math.min(b.startIndex,v):v=Math.max(b.endIndex+1,v)}),this._textSelectionManagerService.replaceTextRanges([{startOffset:Math.max(0,v),endOffset:Math.max(0,v),style:A}],!1),this._scrollToFocusNodePosition(o.getUnitId(),v)}else{const v=s.findNodeByCharIndex(c,u,g),O=s.findNodeByCharIndex(l,u,g),M=r.document.getOffsetConfig(),b=this._getTopOrBottomPosition(s,t===a.Direction.UP||d?v:O,t===a.Direction.UP||d?m:h,t===a.Direction.DOWN);if(b==null){let x;d?x=t===a.Direction.UP?0:f-2:x=t===a.Direction.UP?c:l,this._textSelectionManagerService.replaceTextRanges([{startOffset:Math.max(0,x),endOffset:Math.max(0,x),style:A}],!1);return}const N=new Te(M,s).getRangePointData(b,b).cursorList[0];this._textSelectionManagerService.replaceTextRanges([{...N,style:A}],!1),this._scrollToFocusNodePosition(o.getUnitId(),N.endOffset)}}_getTopOrBottomPosition(t,e,n,o,s=!1){if(e==null||n==null)return;const r=this._getGlyphLeftOffsetInLine(e),c=this._getNextOrPrevLine(e,o,s);if(c==null)return;const l=this._matchPositionByLeftOffset(t,c,r,n);if(l!=null)return{...l,isBack:!0}}_getGlyphLeftOffsetInLine(t){const e=t.parent;if(e==null)return Number.NEGATIVE_INFINITY;const n=e.left,{left:o}=t;return n+o}_matchPositionByLeftOffset(t,e,n,o){const s={distance:Number.POSITIVE_INFINITY};for(const c of e.divides){const l=c.left;for(const A of c.glyphGroup){if(A.streamType===a.DataStreamTreeTokenType.SECTION_BREAK)continue;const{left:d}=A,u=l+d,m=Math.abs(n-u);m<s.distance&&(s.glyph=A,s.distance=m)}}if(s.glyph==null)return;const{segmentPage:r}=o;return t.findPositionByGlyph(s.glyph,r)}_getNextOrPrevLine(t,e,n=!1){var p,f,S,E,C,T,R,v,O,M,b,N;const o=t.parent,s=o==null?void 0:o.parent,r=s==null?void 0:s.parent,c=r==null?void 0:r.parent,l=c==null?void 0:c.parent;if(o==null||s==null||r==null||c==null||l==null)return;const A=r.lines.indexOf(s);if(A===-1)return;let d;if(l.type===_.DocumentSkeletonPageType.CELL&&n){const x=is(l,e);if(x)return x}if(e===!0){d=r.lines[A+1];const x=Od(s,l);if(x){const U=yd(x);U&&(d=U)}}else{d=r.lines[A-1];const x=Rd(s,l);if(x){const U=bd(x);U&&(d=U)}}if(d!=null)return d;const u=c.columns.indexOf(r);if(u===-1)return;if(e===!0)d=(p=c.columns[u+1])==null?void 0:p.lines[0];else{const x=(S=(f=c.columns)==null?void 0:f[u-1])==null?void 0:S.lines;d=x==null?void 0:x[x.length-1]}if(d!=null)return d;const m=l.sections.indexOf(c);if(m===-1)return;if(e===!0)d=(C=(E=l.sections[m-1])==null?void 0:E.columns[0])==null?void 0:C.lines[0];else{const x=(R=(T=l.sections)==null?void 0:T[m-1])==null?void 0:R.columns,U=x==null?void 0:x[x.length-1],F=U==null?void 0:U.lines;d=F==null?void 0:F[F.length-1]}if(d!=null)return d;if(l.type===_.DocumentSkeletonPageType.CELL)return is(l,e);const h=l.parent;if(h==null)return;const g=h.pages.indexOf(l);if(g!==-1){if(e===!0)d=(M=(O=(v=h.pages[g+1])==null?void 0:v.sections[0])==null?void 0:O.columns[0])==null?void 0:M.lines[0];else{const x=(b=h.pages[g-1])==null?void 0:b.sections;if(x==null)return;const U=(N=x[x.length-1])==null?void 0:N.columns,F=U[U.length-1],V=F==null?void 0:F.lines;d=V[V.length-1]}if(d!=null)return d}}_scrollToFocusNodePosition(t,e){var o;const n=(o=this._renderManagerService.getRenderById(t))==null?void 0:o.with(y.DocBackScrollRenderController);n!=null&&n.scrollToRange({startOffset:e,endOffset:e,collapsed:!0})}_getDocObject(){return co(this._univerInstanceService,this._renderManagerService)}};En=Bd([vn(0,a.IUniverInstanceService),vn(1,_.IRenderManagerService),vn(2,a.Inject(D.DocSelectionManagerService)),vn(3,a.ICommandService)],En);function is(i,t){var n,o;let e=null;if(t===!0){const s=ts(i);if(s)e=Md(s);else{const r=(n=i.parent)==null?void 0:n.parent,{lineAfterTable:c}=$a(r);c&&(e=c)}}else{const s=ns(i);if(s)e=xd(s);else{const r=(o=i.parent)==null?void 0:o.parent,{lineBeforeTable:c}=$a(r);c&&(e=c)}}return e}const _d=({handleRowColChange:i,tableCreateParams:t})=>{const e=I.useDependency(a.LocaleService),[n,o]=w.useState(3),[s,r]=w.useState(5);function c(l,A){o(l),r(A),i(l,A)}return w.useEffect(()=>{o(t.rowCount),r(t.colCount)},[t]),P.jsxs("div",{className:"univer-flex univer-items-center univer-justify-between",children:[P.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2",children:[P.jsx("span",{children:e.t("toolbar.table.rowCount")}),P.jsx(J.InputNumber,{className:"univer-w-28",min:1,max:20,precision:0,value:n,onChange:l=>{c(l,s)}})]}),P.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2",children:[P.jsx("span",{children:e.t("toolbar.table.colCount")}),P.jsx(J.InputNumber,{className:"univer-w-28",min:1,max:20,precision:0,value:s,onChange:l=>{c(n,l)}})]})]})};var Nd=Object.getOwnPropertyDescriptor,Pd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Nd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},os=(i,t)=>(e,n)=>t(e,n,i);let Cn=class extends a.Disposable{constructor(i,t){super(),this._commandService=i,this._componentManager=t,this._initialize()}_initialize(){this._init(),this._registerCommands(),this._initCustomComponents()}_registerCommands(){[dn].forEach(i=>this.disposeWithMe(this._commandService.registerCommand(i)))}_initCustomComponents(){const i=this._componentManager;this.disposeWithMe(i.register(na,_d))}_init(){}};Cn=Pd([os(0,a.ICommandService),os(1,a.Inject(I.ComponentManager))],Cn);var wd=Object.getOwnPropertyDescriptor,Ud=(i,t,e,n)=>{for(var o=n>1?void 0:n?wd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Tn=(i,t)=>(e,n)=>t(e,n,i);let Ki=class extends a.Disposable{constructor(i,t,e,n,o){super(),this._context=i,this._docSkeletonManagerService=t,this._commandService=e,this._docEventManagerService=n,this._textSelectionManagerService=o,this._initPointerDownObserver(),this._initHoverCursor()}_initPointerDownObserver(){this._docEventManagerService.clickBullets$.subscribe(i=>{const t=this._textSelectionManagerService.getTextRanges();this._commandService.executeCommand(ni.id,{index:i.paragraph.startIndex,segmentId:i.segmentId,textRanges:t})})}_initHoverCursor(){this.disposeWithMe(this._docEventManagerService.hoverBullet$.subscribe(i=>{i?this._context.mainComponent.setCursor(_.CURSOR_TYPE.POINTER):this._context.mainComponent.setCursor(_.CURSOR_TYPE.TEXT)}))}_getTransformCoordForDocumentOffset(i,t,e,n){const{documentTransform:o}=i.getOffsetConfig(),s=t.transformVector2SceneCoord(_.Vector2.FromArray([e,n]));if(s)return o.clone().invert().applyPoint(s)}};Ki=Ud([Tn(1,a.Inject(D.DocSkeletonManagerService)),Tn(2,a.ICommandService),Tn(3,a.Inject(y.DocEventManagerService)),Tn(4,a.Inject(D.DocSelectionManagerService))],Ki);var Ld=Object.getOwnPropertyDescriptor,Qd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Ld(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Nt=(i,t)=>(e,n)=>t(e,n,i);let yn=class extends a.RxDisposable{constructor(i,t,e,n,o,s){super(),this._context=i,this._commandService=t,this._docClipboardService=e,this._docSelectionRenderService=n,this._contextService=o,this._editorService=s,this._init()}_init(){this._initLegacyPasteCommand()}_initLegacyPasteCommand(){var i;(i=this._docSelectionRenderService)==null||i.onPaste$.pipe(L.takeUntil(this.dispose$)).subscribe(t=>{var c,l,A;if(!Kt(this._contextService))return;t.event.preventDefault();const e=t.event;let n=(c=e.clipboardData)==null?void 0:c.getData(I.HTML_CLIPBOARD_MIME_TYPE);const o=(l=e.clipboardData)==null?void 0:l.getData(I.PLAIN_TEXT_CLIPBOARD_MIME_TYPE),s=[...((A=e.clipboardData)==null?void 0:A.items)||[]].filter(d=>I.imageMimeTypeSet.has(d.type)).map(d=>d.getAsFile()).filter(d=>!!d);this._editorService.getEditor(this._context.unitId)&&(n!=null?n:"").indexOf("</table>")>-1&&(n=""),this._docClipboardService.legacyPaste({html:n,text:o,files:s})})}};yn=Qd([Nt(1,a.ICommandService),Nt(2,Me),Nt(3,a.Inject(y.DocSelectionRenderService)),Nt(4,a.IContextService),Nt(5,de)],yn);var Fd=Object.getOwnPropertyDescriptor,Hd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Fd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},as=(i,t)=>(e,n)=>t(e,n,i);const kd=[a.DEFAULT_EMPTY_DOCUMENT_VALUE,a.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,a.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,a.DOCS_ZEN_EDITOR_UNIT_ID_KEY];let zi=class extends a.Disposable{constructor(i,t,e){super(),this._context=i,this._contextMenuService=t,this._commandService=e,kd.includes(this._context.unitId)||(this._initPointerDown(),this._initEditChange())}_initPointerDown(){var e,n;const t=((n=(e=this._context)==null?void 0:e.mainComponent)==null?void 0:n.onPointerDown$).subscribeEvent(o=>{o.button===2&&this._contextMenuService.triggerContextMenu(o,I.ContextMenuPosition.MAIN_AREA)});this.disposeWithMe(t)}_initEditChange(){this.disposeWithMe(this._commandService.onCommandExecuted(i=>{i.id===D.RichTextEditingMutation.id&&this._contextMenuService.visible&&this._contextMenuService.hideContextMenu()}))}};zi=Hd([as(1,I.IContextMenuService),as(2,a.ICommandService)],zi);var Vd=Object.getOwnPropertyDescriptor,Wd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Vd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},ct=(i,t)=>(e,n)=>t(e,n,i);let bn=class extends a.Disposable{constructor(t,e,n,o,s,r,c){super();B(this,"_initialEditors",new Set);this._context=t,this._univerInstanceService=e,this._editorService=n,this._commandService=o,this._docSelectionRenderService=s,this._docSkeletonManagerService=r,this._renderManagerService=c,this._initialize()}_initialize(){this._editorService.getAllEditor().forEach(t=>{const e=t.getEditorId();e===this._context.unitId&&(this._initialEditors.has(e)||(this._initialEditors.add(e),this._resize(e)))}),this._commandExecutedListener(),this._initialBlur(),this._initialFocus()}_resize(t){if(t==null)return;const e=this._editorService.getEditor(t);if((e==null?void 0:e.cancelDefaultResizeListener)===!0)return;const n=this._univerInstanceService.getUniverDocInstance(t);if(!n)return;const o=this._docSkeletonManagerService.getSkeleton();if(e==null||e.render==null||o==null||n==null)return;o.calculate();const{marginTop:s=0,marginBottom:r=0,marginLeft:c=0,marginRight:l=0}=n.getSnapshot().documentStyle,{scene:A,mainComponent:d}=e.render;let{actualHeight:u,actualWidth:m}=o.getActualSize();u+=s+r,m+=c+l;const{width:h,height:g}=e.getBoundingClientRect(),p=Math.max(m,h),f=Math.max(u,g);A.transformByState({width:p,height:f}),d==null||d.resize(p,f)}_initialBlur(){this.disposeWithMe(this._editorService.blur$.subscribe(()=>{this._docSelectionRenderService.blur()})),this.disposeWithMe(this._docSelectionRenderService.onBlur$.subscribe(()=>{const{unitId:t}=this._context,e=this._editorService.getEditor(t),n=this._editorService.getFocusEditor();e==null||e.isSheetEditor()||n&&n.getEditorId()===t||t.includes("range_selector")||t.includes("embedding_formula_editor")||this._editorService.blur()}))}_initialFocus(){const t=["univer-formula-search","univer-formula-help","formula-help-decorator","univer-formula-help-param"];this.disposeWithMe(L.fromEvent(window,"mousedown").subscribe(n=>{const s=n.target.classList[0]||"";a.checkForSubstrings(s,t)&&n.stopPropagation()}));const e=new a.DisposableCollection;this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{if(e.dispose(),!n)return;const o=n.getUnitId(),s=this._renderManagerService.getRenderById(o),r=s==null?void 0:s.engine.getCanvas().getCanvasEle();if(r==null)return;const c=L.fromEvent(r,"mousedown").subscribe(l=>{l.stopPropagation()});e.add(c)})),this.disposeWithMe(()=>e.dispose())}_commandExecutedListener(){const t=[D.RichTextEditingMutation.id];this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(t.includes(e.id)){const n=e.params,{unitId:o}=n;if(this._editorService.isSheetEditor(o)||o!==this._context.unitId)return;const s=this._editorService.getEditor(o);s&&!s.params.scrollBar&&this._resize(o)}}))}};bn=Wd([ct(1,a.IUniverInstanceService),ct(2,de),ct(3,a.ICommandService),ct(4,a.Inject(y.DocSelectionRenderService)),ct(5,a.Inject(D.DocSkeletonManagerService)),ct(6,_.IRenderManagerService)],bn);var Gd=Object.getOwnPropertyDescriptor,jd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Gd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},On=(i,t)=>(e,n)=>t(e,n,i);let Yi=class extends a.Disposable{constructor(t,e,n,o,s){super();B(this,"_previousIMEContent","");B(this,"_isCompositionStart",!0);B(this,"_onStartSubscription");B(this,"_onUpdateSubscription");B(this,"_onEndSubscription");this._context=t,this._docSelectionRenderService=e,this._docImeInputManagerService=n,this._docSkeletonManagerService=o,this._commandService=s,this._initialize()}dispose(){var t,e,n;(t=this._onStartSubscription)==null||t.unsubscribe(),(e=this._onUpdateSubscription)==null||e.unsubscribe(),(n=this._onEndSubscription)==null||n.unsubscribe()}_initialize(){this._initialOnCompositionstart(),this._initialOnCompositionUpdate(),this._initialOnCompositionend()}_initialOnCompositionstart(){this._onStartSubscription=this._docSelectionRenderService.onCompositionstart$.subscribe(t=>{if(t==null)return;this._resetIME();const{activeRange:e}=t;e!=null&&this._docImeInputManagerService.setActiveRange(a.Tools.deepClone(e))})}_initialOnCompositionUpdate(){this._onUpdateSubscription=this._docSelectionRenderService.onCompositionupdate$.subscribe(t=>{this._updateContent(t,!0)})}_initialOnCompositionend(){this._onEndSubscription=this._docSelectionRenderService.onCompositionend$.subscribe(t=>{this._updateContent(t,!1)})}async _updateContent(t,e){if(t==null)return;const n=this._context.unitId,o=this._docSkeletonManagerService.getSkeleton(),{event:s,activeRange:r}=t;if(o==null||r==null)return;const l=s.data;l===this._previousIMEContent&&e||(await this._commandService.executeCommand(Zn.id,{unitId:n,newText:l,oldTextLen:this._previousIMEContent.length,isCompositionStart:this._isCompositionStart,isCompositionEnd:!e}),e?(this._isCompositionStart&&(this._isCompositionStart=!1),this._previousIMEContent=l):this._resetIME())}_resetIME(){this._previousIMEContent="",this._isCompositionStart=!0,this._docImeInputManagerService.clearUndoRedoMutationParamsCache(),this._docImeInputManagerService.setActiveRange(null)}};Yi=jd([On(1,a.Inject(y.DocSelectionRenderService)),On(2,a.Inject(St)),On(3,a.Inject(D.DocSkeletonManagerService)),On(4,a.ICommandService)],Yi);var Xd=Object.getOwnPropertyDescriptor,Kd=(i,t,e,n)=>{for(var o=n>1?void 0:n?Xd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Rn=(i,t)=>(e,n)=>t(e,n,i);let qi=class extends a.Disposable{constructor(t,e,n,o,s){super();B(this,"_onInputSubscription");this._context=t,this._docSelectionRenderService=e,this._docSkeletonManagerService=n,this._commandService=o,this._docMenuStyleService=s,this._init()}dispose(){var t;super.dispose(),(t=this._onInputSubscription)==null||t.unsubscribe()}_init(){this._initialNormalInput()}_initialNormalInput(){this._onInputSubscription=this._docSelectionRenderService.onInput$.subscribe(async t=>{var f,S;if(t==null)return;const{unitId:e}=this._context,{event:n,content:o="",activeRange:s}=t,r=n,c=this._docSkeletonManagerService.getSkeleton();if(r.data==null||c==null||s==null)return;const{segmentId:l}=s,d=this._context.unit.getSelfOrHeaderFooterModel(l).getBody(),u=this._docMenuStyleService.getDefaultStyle(),m=this._docMenuStyleService.getStyleCache(),h=Bn((f=d==null?void 0:d.customRanges)!=null?f:[],s.endOffset,a.SHEET_EDITOR_UNITS.includes(e)),g=Lt(d,s.endOffset,u,m,a.SHEET_EDITOR_UNITS.includes(e)),p=_n((S=d==null?void 0:d.customDecorations)!=null?S:[],s.endOffset);await this._commandService.executeCommand(Fn.id,{unitId:e,body:{dataStream:o,textRuns:g?[{...g,st:0,ed:o.length}]:[],customRanges:h?[{...h,startIndex:0,endIndex:o.length-1}]:[],customDecorations:p.map(E=>({...E,startIndex:0,endIndex:o.length-1}))},range:s,segmentId:l}),o===" "&&await this._commandService.executeCommand(At.id)})}};qi=Kd([Rn(1,a.Inject(y.DocSelectionRenderService)),Rn(2,a.Inject(D.DocSkeletonManagerService)),Rn(3,a.ICommandService),Rn(4,a.Inject(ve))],qi);class Ji extends a.Disposable{constructor(t){super(),this._context=t}calculatePagePosition(){var T,R;const t=Ie(this._context),n=(R=(T=this._context.unit.getSettings())==null?void 0:T.zoomRatio)!=null?R:1,{document:o,scene:s,docBackground:r}=t,c=s==null?void 0:s.getParent(),{width:l,height:A,pageMarginLeft:d,pageMarginTop:u}=o;if(c==null||l===Number.POSITIVE_INFINITY||A===Number.POSITIVE_INFINITY)return;const{width:m,height:h}=c;let g=0,p=u,f=0,S=0,E=Number.POSITIVE_INFINITY;m>(l+d*2)*n?(g=m/2-l*n/2,g/=n,f=(m-d*2)/n,E=0):(g=d,f=l+d*2,E=(f-m/n)/2),h>A?S=(h-u*2)/n:S=A+u*2,s.resize(f,S),m<=1&&(g=-1e4,p=-1e4),o.translate(g,p),r.translate(g,p);const C=s.getViewport(se.VIEW_MAIN);return E!==Number.POSITIVE_INFINITY&&C!=null&&C.scrollToViewportPos({viewportScrollX:E}),this}}var zd=Object.getOwnPropertyDescriptor,Yd=(i,t,e,n)=>{for(var o=n>1?void 0:n?zd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},ss=(i,t)=>(e,n)=>t(e,n,i);let Zi=class extends a.Disposable{constructor(i,t,e){super(),this._context=i,this._docPageLayoutService=t,this._textSelectionManagerService=e;const n=this._context.unitId;if(a.isInternalEditorID(n)&&n!==a.DOCS_ZEN_EDITOR_UNIT_ID_KEY)return this;this._initResize()}_initResize(){this.disposeWithMe(a.fromEventSubject(this._context.engine.onTransformChange$).pipe(L.filter(i=>i.type===_.TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize),L.throttleTime(0,L.animationFrameScheduler)).subscribe(()=>{this._docPageLayoutService.calculatePagePosition(),this._textSelectionManagerService.refreshSelection()}))}};Zi=Yd([ss(1,a.Inject(Ji)),ss(2,a.Inject(D.DocSelectionManagerService))],Zi);var qd=Object.getOwnPropertyDescriptor,Jd=(i,t,e,n)=>{for(var o=n>1?void 0:n?qd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},lt=(i,t)=>(e,n)=>t(e,n,i);let $i=class extends a.Disposable{constructor(t,e,n,o,s,r,c){super();B(this,"_loadedMap",new WeakSet);this._context=t,this._commandService=e,this._editorService=n,this._instanceSrv=o,this._docSelectionRenderService=s,this._docSkeletonManagerService=r,this._docSelectionManagerService=c,this._initialize()}_initialize(){this._init(),this._skeletonListener(),this._commandExecutedListener(),this._refreshListener(),this._syncSelection()}_init(){const{unitId:t}=this._context,e=Ie(this._context);e==null||e.document==null||this._loadedMap.has(e.document)||(this._initialMain(t),this._loadedMap.add(e.document))}_refreshListener(){this.disposeWithMe(this._docSelectionManagerService.refreshSelection$.subscribe(t=>{if(t==null)return;const{unitId:e,docRanges:n,isEditing:o,options:s}=t;e===this._context.unitId&&(this._docSelectionRenderService.removeAllRanges(),this._docSelectionRenderService.addDocRanges(n,o,s))}))}_syncSelection(){this.disposeWithMe(this._docSelectionRenderService.textSelectionInner$.subscribe(t=>{t!=null&&this._docSelectionManagerService.__replaceTextRangesWithNoRefresh(t,{unitId:this._context.unitId,subUnitId:this._context.unitId})}))}_initialMain(t){const e=Ie(this._context),{document:n,scene:o}=e;this.disposeWithMe(n.onPointerEnter$.subscribeEvent(()=>{this._isEditorReadOnly(t)||(n.cursor=_.CURSOR_TYPE.TEXT)})),this.disposeWithMe(n.onPointerLeave$.subscribeEvent(()=>{n.cursor=_.CURSOR_TYPE.DEFAULT,o.resetCursor()})),this.disposeWithMe(n.onPointerDown$.subscribeEvent((s,r)=>{if(this._isEditorReadOnly(t))return;const c=this._instanceSrv.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);(c==null?void 0:c.getUnitId())!==t&&this._instanceSrv.setCurrentUnitForType(t);const l=this._docSkeletonManagerService.getSkeleton(),{offsetX:A,offsetY:d}=s,u=this._getTransformCoordForDocumentOffset(A,d);if(u!=null){const{pageLayoutType:m=_.PageLayoutType.VERTICAL,pageMarginLeft:h,pageMarginTop:g}=n.getOffsetConfig(),{editArea:p}=l.findEditAreaByCoord(u,m,h,g),f=this._docSkeletonManagerService.getViewModel(),S=f.getEditArea();S!==_.DocumentEditArea.BODY&&p!==_.DocumentEditArea.BODY&&p!==S&&f.setEditArea(p)}if(this._docSelectionRenderService.__onPointDown(s),this._editorService.getEditor(t)){this._setEditorFocus(t);const{offsetX:m,offsetY:h}=s;setTimeout(()=>{t===this._editorService.getFocusId()||this._docSelectionRenderService.isOnPointerEvent||(this._setEditorFocus(t),this._docSelectionRenderService.setCursorManually(m,h))},0)}s.button!==2&&r.stopPropagation()})),this.disposeWithMe(n.onDblclick$.subscribeEvent(s=>{this._isEditorReadOnly(t)||this._docSelectionRenderService.__handleDblClick(s)})),this.disposeWithMe(n.onTripleClick$.subscribeEvent(s=>{this._isEditorReadOnly(t)||this._docSelectionRenderService.__handleTripleClick(s)}))}_getTransformCoordForDocumentOffset(t,e){const n=Ie(this._context),{document:o,scene:s}=n,{documentTransform:r}=o.getOffsetConfig(),c=s.getViewports()[0];if(c==null)return;const l=c.transformVector2SceneCoord(_.Vector2.FromArray([t,e]));return r.clone().invert().applyPoint(l)}_isEditorReadOnly(t){const e=this._editorService.getEditor(t);return e?e.isReadOnly():!1}_setEditorFocus(t){this._editorService.focus(t)}_commandExecutedListener(){const t=[he.id];this.disposeWithMe(this._commandService.onCommandExecuted(e=>{var n;if(t.includes(e.id)){const o=e.params,{unitId:s}=o,r=(n=this._docSelectionManagerService.__getCurrentSelection())==null?void 0:n.unitId;if(s!==r)return;this._docSelectionManagerService.refreshSelection()}}))}_skeletonListener(){this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe(t=>{if(!t)return;const{unitId:e}=this._context;if(!a.isInternalEditorID(e)){this._docSelectionRenderService.focus();const s=this._context.unit.getSnapshot(),r=va(s);this._docSelectionManagerService.replaceDocRanges([{startOffset:r,endOffset:r}],{unitId:e,subUnitId:e},!1)}}))}};$i=Jd([lt(1,a.ICommandService),lt(2,de),lt(3,a.IUniverInstanceService),lt(4,a.Inject(y.DocSelectionRenderService)),lt(5,a.Inject(D.DocSkeletonManagerService)),lt(6,a.Inject(D.DocSelectionManagerService))],$i);var Zd=Object.getOwnPropertyDescriptor,$d=(i,t,e,n)=>{for(var o=n>1?void 0:n?Zd(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Fe=(i,t)=>(e,n)=>t(e,n,i);let eo=class extends a.Disposable{constructor(t,e,n,o,s,r,c,l,A){super();B(this,"_isSheetEditor",!1);this._context=t,this._contextService=e,this._docSkeletonManagerService=n,this._univerInstanceService=o,this._commandService=s,this._textSelectionManagerService=r,this._editorService=c,this._docPageLayoutService=l,this._renderManagerService=A,this._initSkeletonListener(),this._initCommandExecutedListener(),this._initRenderRefresher(),this._isSheetEditor=this._context.unitId===a.DOCS_NORMAL_EDITOR_UNIT_ID_KEY;const d=this._univerInstanceService.getCurrentUnitOfType(a.UniverInstanceType.UNIVER_SHEET),u=d&&this._renderManagerService.getRenderById(d.getUnitId());setTimeout(()=>this.updateViewZoom(u&&this._isSheetEditor?u.scene.scaleX:1,!0),20),a.isInternalEditorID(this._context.unitId)||this._initZoomEventListener()}_initRenderRefresher(){this._docSkeletonManagerService.currentSkeleton$.subscribe(t=>{if(t==null)return;const{unitId:e,scene:n}=this._context;this._editorService.isEditor(e)||this.disposeWithMe(n.onMouseWheel$.subscribeEvent(o=>{if(!o.ctrlKey||!this._contextService.getContextValue(a.FOCUSING_DOC))return;const s=this._univerInstanceService.getCurrentUniverDocInstance();if(!s)return;const{documentFlavor:r}=s.getSnapshot().documentStyle;if(r===a.DocumentFlavor.MODERN)return;const c=Math.abs(o.deltaX);let l=c<40?.2:c<80?.4:.2;l*=o.deltaY>0?-1:1,n.scaleX<1&&(l/=2);const A=s.zoomRatio;let d=+Number.parseFloat(`${A+l}`).toFixed(1);d=d>=4?4:d<=.1?.1:d,this._commandService.executeCommand(Ot.id,{zoomRatio:d,unitId:s.getUnitId()}),o.preventDefault()}))})}_initSkeletonListener(){this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe(t=>{if(t==null)return;const e=this._univerInstanceService.getCurrentUniverDocInstance();e&&setTimeout(()=>{const n=this._univerInstanceService.getCurrentUnitOfType(a.UniverInstanceType.UNIVER_SHEET),o=n&&this._renderManagerService.getRenderById(n.getUnitId()),s=this._isSheetEditor?(o==null?void 0:o.scene.scaleX)||1:e.zoomRatio;this.updateViewZoom(s,!1)})}))}_initCommandExecutedListener(){const t=[he.id];this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(t.includes(e.id)&&e.params.unitId===this._context.unitId){const o=this._context.unit.zoomRatio||1;this.updateViewZoom(o)}})),this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===Mt.id&&this._commandService.executeCommand(Ot.id,{zoomRatio:1,unitId:this._context.unitId})}))}updateViewZoom(t,e=!0){var o;const n=Ie(this._context);n.scene.scale(t,t),this._editorService.isEditor(this._context.unitId)||this._docPageLayoutService.calculatePagePosition(),e&&!this._editorService.isEditor(this._context.unitId)&&this._textSelectionManagerService.refreshSelection(),(o=n.scene.getTransformer())==null||o.clearSelectedObjects()}_initZoomEventListener(){const t=this._context.scene;this.disposeWithMe(t.onMouseWheel$.subscribeEvent(e=>{if(!e.ctrlKey)return;const n=Math.abs(e.deltaX);let o=n<40?.2:n<80?.4:.2;o*=e.deltaY>0?-1:1,t.scaleX<1&&(o/=2);const s=this._context.unit.zoomRatio;let r=+Number.parseFloat(`${s+o}`).toFixed(1);r=r>=4?4:r<=.1?.1:r,this._commandService.executeCommand(Ot.id,{zoomRatio:Math.round(r*10)/10,documentId:this._context.unitId}),e.preventDefault()}))}};eo=$d([Fe(1,a.IContextService),Fe(2,a.Inject(D.DocSkeletonManagerService)),Fe(3,a.IUniverInstanceService),Fe(4,a.ICommandService),Fe(5,a.Inject(D.DocSelectionManagerService)),Fe(6,de),Fe(7,a.Inject(Ji)),Fe(8,_.IRenderManagerService)],eo);const eA=a.createInterceptorKey("PRINTING_COMPONENT_COLLECT"),tA=a.createInterceptorKey("PRINTING_DOM_COLLECT");class rs extends a.Disposable{constructor(){super();B(this,"_printComponentMap",new Map);B(this,"interceptor",new a.InterceptorManager({PRINTING_COMPONENT_COLLECT:eA,PRINTING_DOM_COLLECT:tA}));this.disposeWithMe(this.interceptor.intercept(this.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,{priority:-1,handler:e=>e})),this.disposeWithMe(this.interceptor.intercept(this.interceptor.getInterceptPoints().PRINTING_DOM_COLLECT,{priority:-1,handler:e=>e}))}registerPrintComponent(e,n){this._printComponentMap.set(e,n)}getPrintComponent(e){return this._printComponentMap.get(e)}}var nA=Object.getOwnPropertyDescriptor,iA=(i,t,e,n)=>{for(var o=n>1?void 0:n?nA(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},Pt=(i,t)=>(e,n)=>t(e,n,i);const cs=300;y.DocStateChangeManagerService=class extends a.RxDisposable{constructor(e,n,o,s,r){super();B(this,"_docStateChange$",new L.BehaviorSubject(null));B(this,"docStateChange$",this._docStateChange$.asObservable());B(this,"_historyStateCache",new Map);B(this,"_changeStateCache",new Map);B(this,"_historyTimer",null);B(this,"_changeStateCacheTimer",null);this._undoRedoService=e,this._commandService=n,this._univerInstanceService=o,this._docStateEmitService=s,this._renderManagerService=r,this._initialize(),this._listenDocStateChange()}getStateCache(e){var n,o;return{history:(n=this._historyStateCache.get(e))!=null?n:[],collaboration:(o=this._changeStateCache.get(e))!=null?o:[]}}setStateCache(e,n){this._historyStateCache.set(e,n.history),this._changeStateCache.set(e,n.collaboration)}_setChangeState(e){this._cacheChangeState(e,"history"),this._cacheChangeState(e,"collaboration")}_initialize(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{if(e.id===a.UndoCommandId||e.id===a.RedoCommandId){const n=this._univerInstanceService.getCurrentUniverDocInstance();if(n==null)return;const o=n.getUnitId();this._pushHistory(o),this._emitChangeState(o)}}))}_listenDocStateChange(){this._docStateEmitService.docStateChangeParams$.pipe(L.takeUntil(this.dispose$)).subscribe(e=>{var l;if(e==null)return;const{isCompositionEnd:n,isSync:o,syncer:s,...r}=e,c=(l=this._renderManagerService.getRenderById(o?s:e.unitId))==null?void 0:l.with(St);if(c!=null){if(n){const A=c.fetchComposedUndoRedoMutationParams();if(A==null)throw new Error("historyParams is null in RichTextEditingMutation");const{undoMutationParams:d,redoMutationParams:u,previousActiveRange:m}=A;r.redoState.actions=u.actions,r.undoState.actions=d.actions,r.undoState.textRanges=[m]}this._setChangeState(r)}})}_cacheChangeState(e,n="history"){const{trigger:o,unitId:s,noHistory:r,debounce:c=!1}=e;if(r||o==null||n==="history"&&(o===a.RedoCommandId||o===a.UndoCommandId))return;const l=n==="history"?this._historyStateCache:this._changeStateCache,A=n==="history"?this._pushHistory.bind(this):this._emitChangeState.bind(this);if(l.has(s)){const d=l.get(s);d==null||d.push(e)}else l.set(s,[e]);c?n==="history"?(this._historyTimer&&clearTimeout(this._historyTimer),this._historyTimer=setTimeout(()=>{A(s)},cs)):(this._changeStateCacheTimer&&clearTimeout(this._changeStateCacheTimer),this._changeStateCacheTimer=setTimeout(()=>{A(s)},cs)):A(s)}_pushHistory(e){const n=this._undoRedoService,o=this._historyStateCache.get(e);if(!Array.isArray(o)||o.length===0)return;const s=o.length,r=o[0].commandId,c=o[0],l=o[s-1],A={unitId:e,actions:o.reduce((u,m)=>a.JSONX.compose(u,m.redoState.actions),null),textRanges:l.redoState.textRanges},d={unitId:e,actions:o.reverse().reduce((u,m)=>a.JSONX.compose(u,m.undoState.actions),null),textRanges:c.undoState.textRanges};n.pushUndoRedo({unitID:e,undoMutations:[{id:r,params:d}],redoMutations:[{id:r,params:A}]}),o.length=0}_emitChangeState(e){const n=this._changeStateCache.get(e);if(!Array.isArray(n)||n.length===0)return;const o=n.length,{commandId:s,trigger:r,segmentId:c,noHistory:l,debounce:A}=n[0],d=n[0],u=n[o-1],m={unitId:e,actions:n.reduce((p,f)=>a.JSONX.compose(p,f.redoState.actions),null),textRanges:u.redoState.textRanges},h={unitId:e,actions:n.reverse().reduce((p,f)=>a.JSONX.compose(p,f.undoState.actions),null),textRanges:d.undoState.textRanges},g={commandId:s,unitId:e,trigger:r,redoState:m,undoState:h,segmentId:c,noHistory:l,debounce:A};n.length=0,this._docStateChange$.next(g)}},y.DocStateChangeManagerService=iA([Pt(0,a.Inject(a.IUndoRedoService)),Pt(1,a.ICommandService),Pt(2,a.IUniverInstanceService),Pt(3,a.Inject(D.DocStateEmitService)),Pt(4,_.IRenderManagerService)],y.DocStateChangeManagerService);var oA=Object.getOwnPropertyDescriptor,aA=(i,t,e,n)=>{for(var o=n>1?void 0:n?oA(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},ls=(i,t)=>(e,n)=>t(e,n,i);const ds="univer-doc-main-canvas";y.DocsRenderService=class extends a.RxDisposable{constructor(t,e){super(),this._instanceSrv=t,this._renderManagerService=e,this._init()}_init(){this._renderManagerService.createRender$.pipe(L.takeUntil(this.dispose$)).subscribe(t=>this._createRenderWithId(t)),this._instanceSrv.getAllUnitsForType(a.UniverInstanceType.UNIVER_DOC).forEach(t=>this._createRenderer(t)),this._instanceSrv.getTypeOfUnitAdded$(a.UniverInstanceType.UNIVER_DOC).pipe(L.takeUntil(this.dispose$)).subscribe(t=>this._createRenderer(t)),this._instanceSrv.getTypeOfUnitDisposed$(a.UniverInstanceType.UNIVER_DOC).pipe(L.takeUntil(this.dispose$)).subscribe(t=>this._disposeRenderer(t))}_createRenderer(t){var o;const e=t.getUnitId(),n=(o=this._instanceSrv.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC))==null?void 0:o.getUnitId();this._renderManagerService.created$.subscribe(s=>{s.unitId===n&&(s.engine.getCanvas().setId(ds),s.engine.getCanvas().getContext().setId(ds))}),this._renderManagerService.has(e)||this._createRenderWithId(e)}_createRenderWithId(t){this._renderManagerService.createRender(t)}_disposeRenderer(t){const e=t.getUnitId();this._renderManagerService.removeRender(e)}},y.DocsRenderService=aA([ls(0,a.IUniverInstanceService),ls(1,_.IRenderManagerService)],y.DocsRenderService);const sA={id:Ye.id,preconditions:al,binding:I.KeyCode.ENTER},rA={id:gt.id,preconditions:ee,binding:I.KeyCode.BACKSPACE},cA={id:kn.id,preconditions:ee,binding:I.KeyCode.DELETE},lA={id:ye.id,binding:I.KeyCode.ARROW_UP,preconditions:ee,staticParameters:{direction:a.Direction.UP}},dA={id:ye.id,binding:I.KeyCode.ARROW_DOWN,preconditions:ee,staticParameters:{direction:a.Direction.DOWN}},AA={id:ye.id,binding:I.KeyCode.ARROW_LEFT,preconditions:ee,staticParameters:{direction:a.Direction.LEFT}},uA={id:ye.id,binding:I.KeyCode.ARROW_RIGHT,preconditions:ee,staticParameters:{direction:a.Direction.RIGHT}},hA={id:be.id,binding:I.KeyCode.ARROW_UP|I.MetaKeys.SHIFT,preconditions:ee,staticParameters:{direction:a.Direction.UP}},gA={id:be.id,binding:I.KeyCode.ARROW_DOWN|I.MetaKeys.SHIFT,preconditions:ee,staticParameters:{direction:a.Direction.DOWN}},mA={id:be.id,binding:I.KeyCode.ARROW_LEFT|I.MetaKeys.SHIFT,preconditions:ee,staticParameters:{direction:a.Direction.LEFT}},pA={id:be.id,binding:I.KeyCode.ARROW_RIGHT|I.MetaKeys.SHIFT,preconditions:ee,staticParameters:{direction:a.Direction.RIGHT}},fA={id:Jn.id,binding:I.KeyCode.A|I.MetaKeys.CTRL_COMMAND,preconditions:i=>i.getContextValue(a.FOCUSING_UNIVER_EDITOR)&&(i.getContextValue(a.FOCUSING_DOC)||i.getContextValue(a.EDITOR_ACTIVATED))};var SA=Object.defineProperty,IA=Object.getOwnPropertyDescriptor,vA=(i,t,e)=>t in i?SA(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,EA=(i,t,e,n)=>{for(var o=n>1?void 0:n?IA(t,e):t,s=i.length-1,r;s>=0;s--)(r=i[s])&&(o=r(o)||o);return o},wt=(i,t)=>(e,n)=>t(e,n,i),CA=(i,t,e)=>vA(i,t+"",e);y.UniverDocsUIPlugin=class extends a.Plugin{constructor(t=Ga,e,n,o,s,r){super(),this._config=t,this._injector=e,this._renderManagerSrv=n,this._commandService=o,this._logService=s,this._configService=r;const{menu:c,...l}=a.merge({},Ga,this._config);c&&this._configService.setConfig("menu",c,{merge:!0}),this._configService.setConfig(fn,l),this._initDependencies(e),this._initializeShortcut(),this._initCommand()}onReady(){this._initRenderBasics(),this._markDocAsFocused(),a.touchDependencies(this._injector,[[y.DocStateChangeManagerService],[y.DocsRenderService]])}onRendered(){this._initUI(),this._initRenderModules(),a.touchDependencies(this._injector,[[In],[En],[st],[Cn],[y.DocUIController]])}_initCommand(){[gt,kn,xe,De,Be,_e,Ee,Ne,ge,We,Pe,$e,we,Ce,Ft,Fn,qe,Gt,Hn,jt,fo,he,nt,tt,et,Ct,Tt,yt,me,bt,ft,bi,Mi,sn,rn,ta,cn,ln,on,an,at,Li,xi,ke,At,Ye,qt,It,Et,ni,ii,Zn,Mt,pe,Qn,Ve,ko,ei,Vo,Ot,Jn,Vi,ye,be,Go,ti,jo,ce,Xo,Vn,zn,Yn,li,di,Ai,ui,hi,Jt,Ko,zo,ai,si,ri,qn,_a,Fi].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))}),[pt,zt,Yt].forEach(t=>this.disposeWithMe(this._commandService.registerMultipleCommand(t)))}_initializeShortcut(){[lA,dA,uA,AA,hA,gA,mA,pA,fA,rA,cA,sA,rl].forEach(t=>{this._injector.get(I.IShortcutService).registerShortcut(t)})}_initDependencies(t){a.mergeOverrideWithDependencies([[rs],[yn],[bn],[y.DocUIController],[In],[Cn],[En],[Sn],[st],[de,{useClass:y.EditorService}],[Me,{useClass:Xn}],[y.DocCanvasPopManagerService],[y.DocsRenderService],[y.DocStateChangeManagerService],[y.DocAutoFormatService],[ve]],this._config.override).forEach(n=>t.add(n))}_markDocAsFocused(){const t=this._injector.get(a.IUniverInstanceService),e=this._injector.get(de);try{const n=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_DOC);if(!n)return;const o=n.getUnitId();e.isEditor(o)||t.focusUnit(n.getUnitId())}catch(n){this._logService.warn(n)}}_initUI(){this._injector.get(Sn)}_initRenderBasics(){[[D.DocSkeletonManagerService],[y.DocSelectionRenderService],[D.DocInterceptorService],[Ji],[St],[y.DocRenderController],[eo]].forEach(t=>{this._renderManagerSrv.registerRenderModule(a.UniverInstanceType.UNIVER_DOC,t)})}_initRenderModules(){[[y.DocEventManagerService],[mn],[pn],[y.DocBackScrollRenderController],[$i],[Ni],[Zi],[zi],[Ki],[yn],[qi],[Yi],[bn]].forEach(t=>{this._renderManagerSrv.registerRenderModule(a.UniverInstanceType.UNIVER_DOC,t)})}},CA(y.UniverDocsUIPlugin,"pluginName",ao),y.UniverDocsUIPlugin=EA([a.DependentOn(_.UniverRenderEnginePlugin),wt(1,a.Inject(a.Injector)),wt(2,_.IRenderManagerService),wt(3,a.ICommandService),wt(4,a.ILogService),wt(5,a.IConfigService)],y.UniverDocsUIPlugin);function As(i,t,e){const n=I.useDependency(a.ICommandService),o=I.useDependency(I.IShortcutService),s=w.useMemo(()=>a.generateRandomId(4),[]);w.useEffect(()=>{if(!e||!i||!t)return;const c=`sheet.operation.editor-${e.getEditorId()}-keyboard-${s}`,l=new a.DisposableCollection;return l.add(n.registerCommand({id:c,type:a.CommandType.OPERATION,handler(A,d){const{keyCode:u,metaKey:m}=d;t.handler(u,m)}})),t.keyCodes.map(A=>({id:c,binding:A.metaKey?A.keyCode|A.metaKey:A.keyCode,preconditions:()=>!0,priority:901,staticParameters:{eventType:_.DeviceInputEventType.Keyboard,keyCode:A.keyCode,metaKey:A.metaKey}})).forEach(A=>{l.add(o.registerShortcut(A))}),()=>{l.dispose()}},[n,t,e,i,s,o])}const us=(i,t=!0,e,n)=>{const o=w.useCallback(()=>{if(i){const{scene:r,mainComponent:c}=i.render,l=i.render.with(D.DocSkeletonManagerService),{width:A,height:d}=i.getBoundingClientRect();l.getViewModel().getDataModel().updateDocumentDataPageSize(t?1/0:A,1/0),r.transformByState({width:A,height:d}),c==null||c.resize(A,d)}},[i,t]),s=w.useMemo(()=>a.debounce(()=>{var E,C;if(!e||!i||!e)return;const c=i.render.with(D.DocSkeletonManagerService).getSkeleton(),{scene:l,mainComponent:A}=i.render,d=l.getViewport(se.VIEW_MAIN),{actualWidth:u,actualHeight:m}=c.getActualSize(),{width:h,height:g}=i.getBoundingClientRect();let p=d==null?void 0:d.getScrollBar();const f=Math.max(u,h),S=Math.max(m,g);l.transformByState({width:f,height:S}),A==null||A.resize(f,S),t?u>h?(p==null?d&&new _.ScrollBar(d,{barSize:8,enableVertical:!1,enableHorizontal:!0,minThumbSizeV:8}):d==null||d.resetCanvasSizeAndUpdateScroll(),n&&(d==null||d.scrollToBarPos({x:1/0,y:0}))):(p=null,d==null||d.scrollToBarPos({x:0,y:0}),(C=d==null?void 0:d.getScrollBar())==null||C.dispose()):m>g?(p==null?d&&(p=new _.ScrollBar(d,{enableHorizontal:!1,enableVertical:!0,barSize:8,minThumbSizeV:8})):d==null||d.resetCanvasSizeAndUpdateScroll(),n&&(d==null||d.scrollToBarPos({x:0,y:1/0}))):(p=null,d==null||d.scrollToBarPos({x:0,y:0}),(E=d==null?void 0:d.getScrollBar())==null||E.dispose())},30),[i,e,t,n]);return w.useEffect(()=>{if(e&&i){const r=setTimeout(()=>{o(),s()},500);return()=>{clearTimeout(r)}}},[i,e,o,s]),w.useEffect(()=>{if(e&&i){const r=i.input$.subscribe(()=>{s()});return()=>{r.unsubscribe()}}},[i,e,s]),{resize:o,checkScrollBar:s}};function TA(i){const{editorId:t,initialValue:e,container:n,autoFocus:o,isSingle:s}=i,r=w.useMemo(()=>o!=null?o:!1,[]),[c,l]=w.useState(),A=I.useDependency(de);return w.useLayoutEffect(()=>{var d,u;if(n.current){const m=typeof e=="string"?void 0:a.Tools.deepClone(e),h={body:{dataStream:typeof e=="string"?`${e}\r
|
|
35
35
|
`:`\r
|
|
36
|
-
`,textRuns:[],customBlocks:[],customDecorations:[],customRanges:[],paragraphs:[{startIndex:0}]},...m,documentStyle:{...m==null?void 0:m.documentStyle,pageSize:{width:s?1/0:n.current.clientWidth,height:1/0}},id:t},g=A.register({autofocus:!0,editorUnitId:t,initialSnapshot:h},n.current),p=A.getEditor(t);if(l(p),r){p.focus();const f=((u=(d=h.body)==null?void 0:d.dataStream.length)!=null?u:2)-2;p.setSelectionRanges([{startOffset:f,endOffset:f}])}return()=>{g==null||g.dispose()}}},[]),c}const yA=(i,t,e,n)=>{const o=I.useDependency(a.ICommandService),s=I.useDependency(I.IShortcutService),r=w.useRef(t);r.current=t;const c=w.useRef(n);c.current=n,w.useEffect(()=>{if(!e||!i)return;const A=`sheet.formula-embedding-editor.${e.getEditorId()}`,d=new a.DisposableCollection,u=(h,g)=>{if(c.current){c.current(h,g);return}let p=a.Direction.LEFT;h===I.KeyCode.ARROW_DOWN?p=a.Direction.DOWN:h===I.KeyCode.ARROW_UP?p=a.Direction.UP:h===I.KeyCode.ARROW_RIGHT&&(p=a.Direction.RIGHT),g===I.MetaKeys.SHIFT?o.executeCommand(be.id,{direction:p}):o.executeCommand(ye.id,{direction:p})};return d.add(o.registerCommand({id:A,type:a.CommandType.OPERATION,handler(h,g){const{keyCode:p}=g;u(p)}})),[{keyCode:I.KeyCode.ARROW_DOWN},{keyCode:I.KeyCode.ARROW_LEFT},{keyCode:I.KeyCode.ARROW_RIGHT},{keyCode:I.KeyCode.ARROW_UP},{keyCode:I.KeyCode.ARROW_DOWN,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_LEFT,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_RIGHT,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_UP,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_DOWN,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_LEFT,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_RIGHT,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_UP,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_DOWN,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_LEFT,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_RIGHT,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_UP,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT}].map(({keyCode:h,metaKey:g})=>({id:A,binding:g?h|g:h,preconditions:()=>!0,priority:900,staticParameters:{eventType:_.DeviceInputEventType.Keyboard,keyCode:h}})).forEach(h=>{d.add(s.registerShortcut(h))}),()=>{d.dispose()}},[o,e,i,s])};function bA(i,t){const e=I.useDependency(a.ICommandService);w.useEffect(()=>{if(!i)return;const n=e.onCommandExecuted(o=>{var s,r;if(o.id===D.RichTextEditingMutation.id){if(o.params.unitId!==i.getEditorId())return;const l=i.getDocumentData();t(l,a.getPlainText((r=(s=l.body)==null?void 0:s.dataStream)!=null?r:""))}});return()=>{n.dispose()}},[i,t,e])}const OA=i=>{var W;const{className:t,autoFocus:e,onFocusChange:n,initialValue:o,onClickOutside:s,keyboardEventConfig:r,moveCursor:c=!0,style:l,isSingle:A,editorId:d,onHeightChange:u,onChange:m,defaultHeight:h=32,maxHeight:g=32,icon:p,editorRef:f,placeholder:S}=i,E=I.useDependency(de),C=I.useEvent(n),T=I.useEvent(s),[R,v]=w.useState(h),O=w.useRef(null),M=w.useMemo(()=>d!=null?d:a.createInternalEditorID(`RICH_TEXT_EDITOR-${a.generateRandomId(4)}`),[d]),b=TA({editorId:M,initialValue:o,container:O,autoFocus:e,isSingle:A}),x=I.useDependency(_.IRenderManagerService).getRenderById(M),U=x==null?void 0:x.with(y.DocSelectionRenderService),F=I.useObservable(U==null?void 0:U.textSelectionInner$),V=!!((W=U==null?void 0:U.isFocusing)!=null&&W&&(F!=null&&F.textRanges.some(G=>G.collapsed))),H=w.useRef(null),[Q,X]=w.useState(()=>{var G,K;return!a.BuildTextUtils.transform.getPlainText((K=(G=b==null?void 0:b.getDocumentData().body)==null?void 0:G.dataStream)!=null?K:"")}),{checkScrollBar:j}=us(b,A,!0,!0);w.useLayoutEffect(()=>{if(!(!f||!b)){if(typeof f=="function"){f(b);return}f.current=b}},[b]);const k=I.useEvent(G=>{var q,z;const K=x==null?void 0:x.with(D.DocSkeletonManagerService),Y=K==null?void 0:K.getSkeleton().getActualSize();Y&&(u==null||u(Y.actualHeight),v(Math.max(h,Math.min(Y.actualHeight+10,g)))),m==null||m(G,a.getPlainText((z=(q=G.body)==null?void 0:q.dataStream)!=null?z:"")),j()});return w.useEffect(()=>{var K,Y;X(!a.BuildTextUtils.transform.getPlainText((Y=(K=b==null?void 0:b.getDocumentData().body)==null?void 0:K.dataStream)!=null?Y:""));const G=b==null?void 0:b.selectionChange$.subscribe(()=>{var q,z;X(!a.BuildTextUtils.transform.getPlainText((z=(q=b==null?void 0:b.getDocumentData().body)==null?void 0:q.dataStream)!=null?z:""))});return()=>G==null?void 0:G.unsubscribe()},[b]),I.useObservable(b==null?void 0:b.blur$),I.useObservable(b==null?void 0:b.focus$),w.useEffect(()=>{var K,Y;const G=b==null?void 0:b.getDocumentData();C==null||C(V,a.getPlainText((Y=(K=G==null?void 0:G.body)==null?void 0:K.dataStream)!=null?Y:""))},[V,C]),w.useEffect(()=>{const G=Y=>{var z,$;E.getFocusId()!==M||(($=(z=Y.target)==null?void 0:z.dataset)==null?void 0:$.editorid)===M||H.current&&!H.current.contains(Y.target)&&(T==null||T())},K=setTimeout(()=>{document.addEventListener("click",G)},100);return()=>{document.removeEventListener("click",G),clearTimeout(K)}},[b,M,E,T]),yA(V&&c,!1,b),As(V,r,b),bA(b,k),P.jsx("div",{className:t,style:l,children:P.jsxs("div",{className:J.clsx("univer-relative univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-around univer-gap-2 univer-rounded-md univer-pb-0.5 univer-pl-1.5 univer-pr-2 univer-pt-1.5",J.borderClassName,{"univer-border-primary-500":V}),style:{height:R},ref:H,children:[P.jsx("div",{ref:O,className:"univer-relative univer-size-full",onMouseUp:()=>b==null?void 0:b.focus()}),p,Q?P.jsx("div",{className:"univer-absolute univer-left-[5px] univer-top-[5px] univer-text-sm univer-text-gray-500",children:S}):null]})})};y.AfterSpaceCommand=At,y.AlignCenterCommand=Tt,y.AlignJustifyCommand=bt,y.AlignLeftCommand=Ct,y.AlignOperationCommand=me,y.AlignRightCommand=yt,y.BreakLineCommand=Ft,y.BulletListCommand=tt,y.ChangeListNestingLevelCommand=qt,y.ChangeListNestingLevelType=vt,y.ChangeListTypeCommand=It,y.CheckListCommand=Et,y.CoverContentCommand=Vo,y.CreateDocTableCommand=bi,y.CutContentCommand=Ve,y.DOCS_COMPONENT_BACKGROUND_LAYER_INDEX=so,y.DOCS_COMPONENT_DEFAULT_Z_INDEX=Dn,y.DOCS_COMPONENT_HEADER_LAYER_INDEX=ro,y.DOCS_COMPONENT_MAIN_LAYER_INDEX=Ut,y.DOCS_VIEW_KEY=Ae,y.DOC_UI_PLUGIN_NAME=ao,y.DOC_VERTICAL_PADDING=Hi,y.DefaultDocContainerConfig=oo,y.DefaultToolbarConfig=io,y.DeleteCommand=qe,y.DeleteCustomBlockCommand=Gt,y.DeleteLeftCommand=gt,y.DeleteRightCommand=kn,y.DocCopyCommand=pt,y.DocCreateTableOperation=dn,y.DocCutCommand=zt,y.DocIMEInputManagerService=St,y.DocPasteCommand=Yt,y.DocPrintInterceptorService=rs,y.DocSelectAllCommand=Jn,y.DocTableDeleteColumnsCommand=an,y.DocTableDeleteRowsCommand=on,y.DocTableDeleteTableCommand=at,y.DocTableInsertColumnCommand=ta,y.DocTableInsertColumnLeftCommand=cn,y.DocTableInsertColumnRightCommand=ln,y.DocTableInsertRowAboveCommand=sn,y.DocTableInsertRowBellowCommand=rn,y.DocTableInsertRowCommand=Mi,y.DocTableTabCommand=xi,y.DocsUIMenuSchema=qa,y.Editor=Ea,y.EditorInsertTextCommandId=po,y.EnterCommand=Ye,y.HorizontalLineCommand=ft,y.IDocClipboardService=Me,y.IEditorService=de,y.IMEInputCommand=Zn,y.InnerPasteCommand=Qn,y.InsertCommand=Fn,y.InsertCustomRangeCommand=jo,y.ListOperationCommand=et,y.MergeTwoParagraphCommand=jt,y.MoveCursorOperation=ye,y.MoveSelectionOperation=be,y.NORMAL_TEXT_SELECTION_PLUGIN_NAME=fs,y.NodePositionConvertToCursor=Te,y.NodePositionConvertToRectRange=vi,y.OrderListCommand=nt,y.PastePluginLark=Eo,y.PastePluginUniver=To,y.PastePluginWord=yo,y.QuickListCommand=ii,y.RectRange=Ci,y.ReplaceContentCommand=ko,y.ReplaceSelectionCommand=ti,y.ReplaceSnapshotCommand=ei,y.ReplaceTextRunsCommand=Go,y.ResetInlineFormatTextBackgroundColorCommand=$e,y.RichTextEditor=OA,y.SetDocZoomRatioCommand=Ot,y.SetDocZoomRatioOperation=he,y.SetInlineFormatBoldCommand=xe,y.SetInlineFormatCommand=Ce,y.SetInlineFormatFontFamilyCommand=We,y.SetInlineFormatFontSizeCommand=ge,y.SetInlineFormatItalicCommand=De,y.SetInlineFormatStrikethroughCommand=_e,y.SetInlineFormatSubscriptCommand=Ee,y.SetInlineFormatSuperscriptCommand=Ne,y.SetInlineFormatTextBackgroundColorCommand=we,y.SetInlineFormatTextColorCommand=Pe,y.SetInlineFormatUnderlineCommand=Be,y.SetParagraphNamedStyleCommand=ce,y.SwitchDocModeCommand=Mt,y.TEXT_RANGE_LAYER_INDEX=$t,y.TabCommand=ke,y.TextRange=Ge,y.ToggleCheckListCommand=ni,y.UpdateCommand=Hn,y.VIEWPORT_KEY=se,y.addCustomDecorationBySelectionFactory=Is,y.addCustomDecorationFactory=lo,y.calcDocRangePositions=gn,y.convertBodyToHtml=Oo,y.convertPositionsToRectRanges=tn,y.deleteCustomDecorationFactory=vs,y.docDrawingPositionToTransform=Cs,y.genTableSource=Un,y.generateParagraphs=Pn,y.getAnchorBounding=Rt,y.getCanvasOffsetByEngine=$o,y.getCommandSkeleton=re,y.getCursorWhenDelete=Xt,y.getCustomBlockIdsInSelections=go,y.getCutActionsFromDocRanges=mo,y.getDocObject=co,y.getDocObjectById=Ss,y.getEmptyTableCell=kt,y.getEmptyTableRow=Vt,y.getLineBounding=en,y.getOneTextSelectionRange=pi,y.getRichTextEditPath=Z,y.getTableColumn=Wt,y.hasParagraphInTable=Es,y.isInSameTableCell=Si,y.isValidRectRange=Yo,y.neoGetDocObject=Ie,y.transformToDocDrawingPosition=Ts,y.useKeyboardEvent=As,y.useResize=us,y.whenDocAndEditorFocused=ee,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|
|
36
|
+
`,textRuns:[],customBlocks:[],customDecorations:[],customRanges:[],paragraphs:[{startIndex:0}]},...m,documentStyle:{...m==null?void 0:m.documentStyle,pageSize:{width:s?1/0:n.current.clientWidth,height:1/0}},id:t},g=A.register({autofocus:!0,editorUnitId:t,initialSnapshot:h},n.current),p=A.getEditor(t);if(l(p),r){p.focus();const f=((u=(d=h.body)==null?void 0:d.dataStream.length)!=null?u:2)-2;p.setSelectionRanges([{startOffset:f,endOffset:f}])}return()=>{g==null||g.dispose()}}},[]),c}const yA=(i,t,e,n)=>{const o=I.useDependency(a.ICommandService),s=I.useDependency(I.IShortcutService),r=w.useRef(t);r.current=t;const c=w.useRef(n);c.current=n,w.useEffect(()=>{if(!e||!i)return;const A=`sheet.formula-embedding-editor.${e.getEditorId()}`,d=new a.DisposableCollection,u=(h,g)=>{if(c.current){c.current(h,g);return}let p=a.Direction.LEFT;h===I.KeyCode.ARROW_DOWN?p=a.Direction.DOWN:h===I.KeyCode.ARROW_UP?p=a.Direction.UP:h===I.KeyCode.ARROW_RIGHT&&(p=a.Direction.RIGHT),g===I.MetaKeys.SHIFT?o.executeCommand(be.id,{direction:p}):o.executeCommand(ye.id,{direction:p})};return d.add(o.registerCommand({id:A,type:a.CommandType.OPERATION,handler(h,g){const{keyCode:p}=g;u(p)}})),[{keyCode:I.KeyCode.ARROW_DOWN},{keyCode:I.KeyCode.ARROW_LEFT},{keyCode:I.KeyCode.ARROW_RIGHT},{keyCode:I.KeyCode.ARROW_UP},{keyCode:I.KeyCode.ARROW_DOWN,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_LEFT,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_RIGHT,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_UP,metaKey:I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_DOWN,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_LEFT,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_RIGHT,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_UP,metaKey:I.MetaKeys.CTRL_COMMAND},{keyCode:I.KeyCode.ARROW_DOWN,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_LEFT,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_RIGHT,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT},{keyCode:I.KeyCode.ARROW_UP,metaKey:I.MetaKeys.CTRL_COMMAND|I.MetaKeys.SHIFT}].map(({keyCode:h,metaKey:g})=>({id:A,binding:g?h|g:h,preconditions:()=>!0,priority:900,staticParameters:{eventType:_.DeviceInputEventType.Keyboard,keyCode:h}})).forEach(h=>{d.add(s.registerShortcut(h))}),()=>{d.dispose()}},[o,e,i,s])};function bA(i,t){const e=I.useDependency(a.ICommandService);w.useEffect(()=>{if(!i)return;const n=e.onCommandExecuted(o=>{var s,r;if(o.id===D.RichTextEditingMutation.id){if(o.params.unitId!==i.getEditorId())return;const l=i.getDocumentData();t(l,a.getPlainText((r=(s=l.body)==null?void 0:s.dataStream)!=null?r:""))}});return()=>{n.dispose()}},[i,t,e])}const OA=i=>{var W;const{className:t,autoFocus:e,onFocusChange:n,initialValue:o,onClickOutside:s,keyboardEventConfig:r,moveCursor:c=!0,style:l,isSingle:A,editorId:d,onHeightChange:u,onChange:m,defaultHeight:h=32,maxHeight:g=32,icon:p,editorRef:f,placeholder:S}=i,E=I.useDependency(de),C=I.useEvent(n),T=I.useEvent(s),[R,v]=w.useState(h),O=w.useRef(null),M=w.useMemo(()=>d!=null?d:a.createInternalEditorID(`RICH_TEXT_EDITOR-${a.generateRandomId(4)}`),[d]),b=TA({editorId:M,initialValue:o,container:O,autoFocus:e,isSingle:A}),x=I.useDependency(_.IRenderManagerService).getRenderById(M),U=x==null?void 0:x.with(y.DocSelectionRenderService),F=I.useObservable(U==null?void 0:U.textSelectionInner$),V=!!((W=U==null?void 0:U.isFocusing)!=null&&W&&(F!=null&&F.textRanges.some(G=>G.collapsed))),H=w.useRef(null),[Q,X]=w.useState(()=>{var G,K;return!a.BuildTextUtils.transform.getPlainText((K=(G=b==null?void 0:b.getDocumentData().body)==null?void 0:G.dataStream)!=null?K:"")}),{checkScrollBar:j}=us(b,A,!0,!0);w.useLayoutEffect(()=>{if(!(!f||!b)){if(typeof f=="function"){f(b);return}f.current=b}},[b]);const k=I.useEvent(G=>{var q,z;const K=x==null?void 0:x.with(D.DocSkeletonManagerService),Y=K==null?void 0:K.getSkeleton().getActualSize();Y&&(u==null||u(Y.actualHeight),v(Math.max(h,Math.min(Y.actualHeight+10,g)))),m==null||m(G,a.getPlainText((z=(q=G.body)==null?void 0:q.dataStream)!=null?z:"")),j()});return w.useEffect(()=>{var K,Y;X(!a.BuildTextUtils.transform.getPlainText((Y=(K=b==null?void 0:b.getDocumentData().body)==null?void 0:K.dataStream)!=null?Y:""));const G=b==null?void 0:b.selectionChange$.subscribe(()=>{var q,z;X(!a.BuildTextUtils.transform.getPlainText((z=(q=b==null?void 0:b.getDocumentData().body)==null?void 0:q.dataStream)!=null?z:""))});return()=>G==null?void 0:G.unsubscribe()},[b]),I.useObservable(b==null?void 0:b.blur$),I.useObservable(b==null?void 0:b.focus$),w.useEffect(()=>{var K,Y;const G=b==null?void 0:b.getDocumentData();C==null||C(V,a.getPlainText((Y=(K=G==null?void 0:G.body)==null?void 0:K.dataStream)!=null?Y:""))},[V,C]),w.useEffect(()=>{const G=Y=>{var z,$;E.getFocusId()!==M||(($=(z=Y.target)==null?void 0:z.dataset)==null?void 0:$.editorid)===M||H.current&&!H.current.contains(Y.target)&&(T==null||T())},K=setTimeout(()=>{document.addEventListener("click",G)},100);return()=>{document.removeEventListener("click",G),clearTimeout(K)}},[b,M,E,T]),yA(V&&c,!1,b),As(V,r,b),bA(b,k),P.jsx("div",{className:t,style:l,children:P.jsxs("div",{className:J.clsx("univer-relative univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-around univer-gap-2 univer-rounded-md univer-pb-0.5 univer-pl-1.5 univer-pr-2 univer-pt-1.5",J.borderClassName,{"univer-border-primary-500":V}),style:{height:R},ref:H,children:[P.jsx("div",{ref:O,className:"univer-relative univer-size-full",onMouseUp:()=>b==null?void 0:b.focus()}),p,Q?P.jsx("div",{className:"univer-absolute univer-left-[5px] univer-top-[5px] univer-text-sm univer-text-gray-500",children:S}):null]})})};y.AfterSpaceCommand=At,y.AlignCenterCommand=Tt,y.AlignJustifyCommand=bt,y.AlignLeftCommand=Ct,y.AlignOperationCommand=me,y.AlignRightCommand=yt,y.BreakLineCommand=Ft,y.BulletListCommand=tt,y.ChangeListNestingLevelCommand=qt,y.ChangeListNestingLevelType=vt,y.ChangeListTypeCommand=It,y.CheckListCommand=Et,y.CoverContentCommand=Vo,y.CreateDocTableCommand=bi,y.CutContentCommand=Ve,y.DOCS_COMPONENT_BACKGROUND_LAYER_INDEX=so,y.DOCS_COMPONENT_DEFAULT_Z_INDEX=Dn,y.DOCS_COMPONENT_HEADER_LAYER_INDEX=ro,y.DOCS_COMPONENT_MAIN_LAYER_INDEX=Ut,y.DOCS_VIEW_KEY=Ae,y.DOC_UI_PLUGIN_NAME=ao,y.DOC_VERTICAL_PADDING=Hi,y.DefaultDocContainerConfig=oo,y.DefaultToolbarConfig=io,y.DeleteCommand=qe,y.DeleteCustomBlockCommand=Gt,y.DeleteLeftCommand=gt,y.DeleteRightCommand=kn,y.DocCopyCommand=pt,y.DocCreateTableOperation=dn,y.DocCutCommand=zt,y.DocIMEInputManagerService=St,y.DocPasteCommand=Yt,y.DocPrintInterceptorService=rs,y.DocSelectAllCommand=Jn,y.DocTableDeleteColumnsCommand=an,y.DocTableDeleteRowsCommand=on,y.DocTableDeleteTableCommand=at,y.DocTableInsertColumnCommand=ta,y.DocTableInsertColumnLeftCommand=cn,y.DocTableInsertColumnRightCommand=ln,y.DocTableInsertRowAboveCommand=sn,y.DocTableInsertRowBellowCommand=rn,y.DocTableInsertRowCommand=Mi,y.DocTableTabCommand=xi,y.DocsUIMenuSchema=qa,y.Editor=Ea,y.EditorInsertTextCommandId=po,y.EnterCommand=Ye,y.HorizontalLineCommand=ft,y.IDocClipboardService=Me,y.IEditorService=de,y.IMEInputCommand=Zn,y.InnerPasteCommand=Qn,y.InsertCommand=Fn,y.InsertCustomRangeCommand=jo,y.ListOperationCommand=et,y.MergeTwoParagraphCommand=jt,y.MoveCursorOperation=ye,y.MoveSelectionOperation=be,y.NORMAL_TEXT_SELECTION_PLUGIN_NAME=fs,y.NodePositionConvertToCursor=Te,y.NodePositionConvertToRectRange=vi,y.OrderListCommand=nt,y.PastePluginLark=Eo,y.PastePluginUniver=To,y.PastePluginWord=yo,y.QuickListCommand=ii,y.RectRange=Ci,y.ReplaceContentCommand=ko,y.ReplaceSelectionCommand=ti,y.ReplaceSnapshotCommand=ei,y.ReplaceTextRunsCommand=Go,y.ResetInlineFormatTextBackgroundColorCommand=$e,y.RichTextEditor=OA,y.SetDocZoomRatioCommand=Ot,y.SetDocZoomRatioOperation=he,y.SetInlineFormatBoldCommand=xe,y.SetInlineFormatCommand=Ce,y.SetInlineFormatFontFamilyCommand=We,y.SetInlineFormatFontSizeCommand=ge,y.SetInlineFormatItalicCommand=De,y.SetInlineFormatStrikethroughCommand=_e,y.SetInlineFormatSubscriptCommand=Ee,y.SetInlineFormatSuperscriptCommand=Ne,y.SetInlineFormatTextBackgroundColorCommand=we,y.SetInlineFormatTextColorCommand=Pe,y.SetInlineFormatUnderlineCommand=Be,y.SetParagraphNamedStyleCommand=ce,y.SwitchDocModeCommand=Mt,y.TEXT_RANGE_LAYER_INDEX=$t,y.TabCommand=ke,y.TextRange=Ge,y.ToggleCheckListCommand=ni,y.UpdateCommand=Hn,y.VIEWPORT_KEY=se,y.addCustomDecorationBySelectionFactory=Is,y.addCustomDecorationFactory=lo,y.calcDocRangePositions=gn,y.convertBodyToHtml=Oo,y.convertPositionsToRectRanges=tn,y.deleteCustomDecorationFactory=vs,y.docDrawingPositionToTransform=Cs,y.genTableSource=Un,y.generateParagraphs=Pn,y.getAnchorBounding=Rt,y.getCanvasOffsetByEngine=$o,y.getCommandSkeleton=re,y.getCursorWhenDelete=Xt,y.getCustomBlockIdsInSelections=go,y.getCutActionsFromDocRanges=mo,y.getDocObject=co,y.getDocObjectById=Ss,y.getEmptyTableCell=kt,y.getEmptyTableRow=Vt,y.getLineBounding=en,y.getOneTextSelectionRange=pi,y.getRichTextEditPath=Z,y.getTableColumn=Wt,y.hasParagraphInTable=Es,y.isInSameTableCell=Si,y.isValidRectRange=Yo,y.neoGetDocObject=Ie,y.transformToDocDrawingPosition=Ts,y.useKeyboardEvent=As,y.useResize=us,y.whenDocAndEditorFocused=ee,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/umd/locale/ca-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsUiCaES=a())})(this,function(){"use strict";return{toolbar:{undo:"Desfer",redo:"Refer",font:"Tipus de lletra",fontSize:"Mida de lletra",bold:"Negreta",italic:"Cursiva",strikethrough:"Ratllat",subscript:"Subíndex",superscript:"Superíndex",underline:"Subratllat",textColor:{main:"Color del text",right:"Escull color"},fillColor:{main:"Color de fons del text",right:"Escull color"},table:{main:"Taula",insert:"Insereix taula",colCount:"Nombre de columnes",rowCount:"Nombre de files"},resetColor:"Restableix",order:"Llista ordenada",unorder:"Llista desordenada",checklist:"Llista de tasques",documentFlavor:"Mode modern",alignLeft:"Alinea a l'esquerra",alignCenter:"Centra",alignRight:"Alinea a la dreta",alignJustify:"Justifica",horizontalLine:"Línia horitzontal",headerFooter:"Capçalera i peu de pàgina",pageSetup:"Configuració de pàgina"},table:{insert:"Insereix",insertRowAbove:"Insereix fila a sobre",insertRowBelow:"Insereix fila a sota",insertColumnLeft:"Insereix columna a l'esquerra",insertColumnRight:"Insereix columna a la dreta",delete:"Elimina taula",deleteRows:"Elimina fila",deleteColumns:"Elimina columna",deleteTable:"Elimina taula"},headerFooter:{header:"Capçalera",footer:"Peu de pàgina",panel:"Configuració de capçalera i peu de pàgina",firstPageCheckBox:"Primera pàgina diferent",oddEvenCheckBox:"Pàgines senars i parells diferents",headerTopMargin:"Marge superior de la capçalera (px)",footerBottomMargin:"Marge inferior del peu de pàgina (px)",closeHeaderFooter:"Tanca capçalera i peu de pàgina",disableText:"La configuració de capçalera i peu de pàgina està desactivada"},doc:{menu:{paragraphSetting:"Configuració de paràgraf"},slider:{paragraphSetting:"Configuració de paràgraf"},paragraphSetting:{alignment:"Alineació",indentation:"Sagnat",left:"Esquerra",right:"Dreta",firstLine:"Primera línia",hanging:"Penjant",spacing:"Espaiat",before:"Abans",after:"Després",lineSpace:"Espai entre línies",multiSpace:"Espai múltiple",fixedValue:"Valor fix (px)"}},rightClick:{copy:"Copia",cut:"Retalla",paste:"Enganxa",delete:"Elimina",bulletList:"Llista de pics",orderList:"Llista ordenada",checkList:"Llista de tasques",insertBellow:"Insereix a sota"},"page-settings":{"document-setting":"Configuració de document","paper-size":"Mida del paper","page-size":{main:"Mida del paper",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Carta",legal:"Legal",tabloid:"Tabloide",statement:"Declaració",executive:"Executiu",folio:"Foli"},orientation:"Orientació",portrait:"Vertical",landscape:"Horitzontal","custom-paper-size":"Mida de paper personalitzada",top:"Superior",bottom:"Inferior",left:"Esquerra",right:"Dreta",cancel:"Cancel·la",confirm:"Confirma"}}});
|
|
1
|
+
(function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsUiCaES=a())})(this,(function(){"use strict";return{toolbar:{undo:"Desfer",redo:"Refer",font:"Tipus de lletra",fontSize:"Mida de lletra",bold:"Negreta",italic:"Cursiva",strikethrough:"Ratllat",subscript:"Subíndex",superscript:"Superíndex",underline:"Subratllat",textColor:{main:"Color del text",right:"Escull color"},fillColor:{main:"Color de fons del text",right:"Escull color"},table:{main:"Taula",insert:"Insereix taula",colCount:"Nombre de columnes",rowCount:"Nombre de files"},resetColor:"Restableix",order:"Llista ordenada",unorder:"Llista desordenada",checklist:"Llista de tasques",documentFlavor:"Mode modern",alignLeft:"Alinea a l'esquerra",alignCenter:"Centra",alignRight:"Alinea a la dreta",alignJustify:"Justifica",horizontalLine:"Línia horitzontal",headerFooter:"Capçalera i peu de pàgina",pageSetup:"Configuració de pàgina"},table:{insert:"Insereix",insertRowAbove:"Insereix fila a sobre",insertRowBelow:"Insereix fila a sota",insertColumnLeft:"Insereix columna a l'esquerra",insertColumnRight:"Insereix columna a la dreta",delete:"Elimina taula",deleteRows:"Elimina fila",deleteColumns:"Elimina columna",deleteTable:"Elimina taula"},headerFooter:{header:"Capçalera",footer:"Peu de pàgina",panel:"Configuració de capçalera i peu de pàgina",firstPageCheckBox:"Primera pàgina diferent",oddEvenCheckBox:"Pàgines senars i parells diferents",headerTopMargin:"Marge superior de la capçalera (px)",footerBottomMargin:"Marge inferior del peu de pàgina (px)",closeHeaderFooter:"Tanca capçalera i peu de pàgina",disableText:"La configuració de capçalera i peu de pàgina està desactivada"},doc:{menu:{paragraphSetting:"Configuració de paràgraf"},slider:{paragraphSetting:"Configuració de paràgraf"},paragraphSetting:{alignment:"Alineació",indentation:"Sagnat",left:"Esquerra",right:"Dreta",firstLine:"Primera línia",hanging:"Penjant",spacing:"Espaiat",before:"Abans",after:"Després",lineSpace:"Espai entre línies",multiSpace:"Espai múltiple",fixedValue:"Valor fix (px)"}},rightClick:{copy:"Copia",cut:"Retalla",paste:"Enganxa",delete:"Elimina",bulletList:"Llista de pics",orderList:"Llista ordenada",checkList:"Llista de tasques",insertBellow:"Insereix a sota"},"page-settings":{"document-setting":"Configuració de document","paper-size":"Mida del paper","page-size":{main:"Mida del paper",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Carta",legal:"Legal",tabloid:"Tabloide",statement:"Declaració",executive:"Executiu",folio:"Foli"},orientation:"Orientació",portrait:"Vertical",landscape:"Horitzontal","custom-paper-size":"Mida de paper personalitzada",top:"Superior",bottom:"Inferior",left:"Esquerra",right:"Dreta",cancel:"Cancel·la",confirm:"Confirma"}}}));
|
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.UniverDocsUiEnUS=t())})(this,function(){"use strict";return{toolbar:{undo:"Undo",redo:"Redo",font:"Font",fontSize:"Font size",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",underline:"Underline",textColor:{main:"Text color",right:"Choose color"},fillColor:{main:"Text Background color",right:"Choose color"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"Reset",order:"Ordered list",unorder:"Unordered list",checklist:"Task list",documentFlavor:"Modern Mode",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Justify",horizontalLine:"Horizontal line",headerFooter:"Header & Footer",pageSetup:"Page Setup"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"Header",footer:"Footer",panel:"Header & Footer Settings",firstPageCheckBox:"Different first page",oddEvenCheckBox:"Different odd and even pages",headerTopMargin:"Header top margin(px)",footerBottomMargin:"Footer bottom margin(px)",closeHeaderFooter:"Close header & footer",disableText:"Header & footer settings are disabled"},doc:{menu:{paragraphSetting:"Paragraph Settings"},slider:{paragraphSetting:"Paragraph Settings"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"Copy",cut:"Cut",paste:"Paste",delete:"Delete",bulletList:"Bullet list",orderList:"Ordered list",checkList:"Task list",insertBellow:"Insert below"},"page-settings":{"document-setting":"Document Setting","paper-size":"Paper size","page-size":{main:"Paper size",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Letter",legal:"Legal",tabloid:"Tabloid",statement:"Statement",executive:"Executive",folio:"Folio"},orientation:"Orientation",portrait:"Portrait",landscape:"Landscape","custom-paper-size":"Custom Paper size",top:"Top",bottom:"Bottom",left:"Left",right:"Right",cancel:"Cancel",confirm:"Confirm"}}});
|
|
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.UniverDocsUiEnUS=t())})(this,(function(){"use strict";return{toolbar:{undo:"Undo",redo:"Redo",font:"Font",fontSize:"Font size",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",underline:"Underline",textColor:{main:"Text color",right:"Choose color"},fillColor:{main:"Text Background color",right:"Choose color"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"Reset",order:"Ordered list",unorder:"Unordered list",checklist:"Task list",documentFlavor:"Modern Mode",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Justify",horizontalLine:"Horizontal line",headerFooter:"Header & Footer",pageSetup:"Page Setup"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"Header",footer:"Footer",panel:"Header & Footer Settings",firstPageCheckBox:"Different first page",oddEvenCheckBox:"Different odd and even pages",headerTopMargin:"Header top margin(px)",footerBottomMargin:"Footer bottom margin(px)",closeHeaderFooter:"Close header & footer",disableText:"Header & footer settings are disabled"},doc:{menu:{paragraphSetting:"Paragraph Settings"},slider:{paragraphSetting:"Paragraph Settings"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"Copy",cut:"Cut",paste:"Paste",delete:"Delete",bulletList:"Bullet list",orderList:"Ordered list",checkList:"Task list",insertBellow:"Insert below"},"page-settings":{"document-setting":"Document Setting","paper-size":"Paper size","page-size":{main:"Paper size",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Letter",legal:"Legal",tabloid:"Tabloid",statement:"Statement",executive:"Executive",folio:"Folio"},orientation:"Orientation",portrait:"Portrait",landscape:"Landscape","custom-paper-size":"Custom Paper size",top:"Top",bottom:"Bottom",left:"Left",right:"Right",cancel:"Cancel",confirm:"Confirm"}}}));
|
package/lib/umd/locale/es-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsUiEsES=a())})(this,function(){"use strict";return{toolbar:{undo:"Deshacer",redo:"Rehacer",font:"Fuente",fontSize:"Tamaño de fuente",bold:"Negrita",italic:"Cursiva",strikethrough:"Tachado",subscript:"Subíndice",superscript:"Superíndice",underline:"Subrayado",textColor:{main:"Color de texto",right:"Elegir color"},fillColor:{main:"Color de fondo de texto",right:"Elegir color"},table:{main:"Tabla",insert:"Insertar tabla",colCount:"Número de columnas",rowCount:"Número de filas"},resetColor:"Restablecer",order:"Lista ordenada",unorder:"Lista desordenada",checklist:"Lista de tareas",documentFlavor:"Modo moderno",alignLeft:"Alinear a la izquierda",alignCenter:"Centrar",alignRight:"Alinear a la derecha",alignJustify:"Justificar",horizontalLine:"Línea horizontal",headerFooter:"Encabezado y pie de página",pageSetup:"Configuración de página"},table:{insert:"Insertar",insertRowAbove:"Insertar fila arriba",insertRowBelow:"Insertar fila abajo",insertColumnLeft:"Insertar columna a la izquierda",insertColumnRight:"Insertar columna a la derecha",delete:"Eliminar tabla",deleteRows:"Eliminar fila",deleteColumns:"Eliminar columna",deleteTable:"Eliminar tabla"},headerFooter:{header:"Encabezado",footer:"Pie de página",panel:"Configuración de encabezado y pie de página",firstPageCheckBox:"Primera página diferente",oddEvenCheckBox:"Páginas impares y pares diferentes",headerTopMargin:"Margen superior del encabezado (px)",footerBottomMargin:"Margen inferior del pie de página (px)",closeHeaderFooter:"Cerrar encabezado y pie de página",disableText:"La configuración de encabezado y pie de página está deshabilitada"},doc:{menu:{paragraphSetting:"Configuración de párrafo"},slider:{paragraphSetting:"Configuración de párrafo"},paragraphSetting:{alignment:"Alineación",indentation:"Sangría",left:"Izquierda",right:"Derecha",firstLine:"Primera línea",hanging:"Colgante",spacing:"Espaciado",before:"Antes",after:"Después",lineSpace:"Espacio entre líneas",multiSpace:"Espacio múltiple",fixedValue:"Valor fijo (px)"}},rightClick:{copy:"Copiar",cut:"Cortar",paste:"Pegar",delete:"Eliminar",bulletList:"Lista de viñetas",orderList:"Lista ordenada",checkList:"Lista de tareas",insertBellow:"Insertar debajo"},"page-settings":{"document-setting":"Configuración de documento","paper-size":"Tamaño de papel","page-size":{main:"Tamaño de papel",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Carta",legal:"Legal",tabloid:"Tabloide",statement:"Declaración",executive:"Ejecutivo",folio:"Folio"},orientation:"Orientación",portrait:"Vertical",landscape:"Horizontal","custom-paper-size":"Tamaño de papel personalizado",top:"Superior",bottom:"Inferior",left:"Izquierda",right:"Derecha",cancel:"Cancelar",confirm:"Confirmar"}}});
|
|
1
|
+
(function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsUiEsES=a())})(this,(function(){"use strict";return{toolbar:{undo:"Deshacer",redo:"Rehacer",font:"Fuente",fontSize:"Tamaño de fuente",bold:"Negrita",italic:"Cursiva",strikethrough:"Tachado",subscript:"Subíndice",superscript:"Superíndice",underline:"Subrayado",textColor:{main:"Color de texto",right:"Elegir color"},fillColor:{main:"Color de fondo de texto",right:"Elegir color"},table:{main:"Tabla",insert:"Insertar tabla",colCount:"Número de columnas",rowCount:"Número de filas"},resetColor:"Restablecer",order:"Lista ordenada",unorder:"Lista desordenada",checklist:"Lista de tareas",documentFlavor:"Modo moderno",alignLeft:"Alinear a la izquierda",alignCenter:"Centrar",alignRight:"Alinear a la derecha",alignJustify:"Justificar",horizontalLine:"Línea horizontal",headerFooter:"Encabezado y pie de página",pageSetup:"Configuración de página"},table:{insert:"Insertar",insertRowAbove:"Insertar fila arriba",insertRowBelow:"Insertar fila abajo",insertColumnLeft:"Insertar columna a la izquierda",insertColumnRight:"Insertar columna a la derecha",delete:"Eliminar tabla",deleteRows:"Eliminar fila",deleteColumns:"Eliminar columna",deleteTable:"Eliminar tabla"},headerFooter:{header:"Encabezado",footer:"Pie de página",panel:"Configuración de encabezado y pie de página",firstPageCheckBox:"Primera página diferente",oddEvenCheckBox:"Páginas impares y pares diferentes",headerTopMargin:"Margen superior del encabezado (px)",footerBottomMargin:"Margen inferior del pie de página (px)",closeHeaderFooter:"Cerrar encabezado y pie de página",disableText:"La configuración de encabezado y pie de página está deshabilitada"},doc:{menu:{paragraphSetting:"Configuración de párrafo"},slider:{paragraphSetting:"Configuración de párrafo"},paragraphSetting:{alignment:"Alineación",indentation:"Sangría",left:"Izquierda",right:"Derecha",firstLine:"Primera línea",hanging:"Colgante",spacing:"Espaciado",before:"Antes",after:"Después",lineSpace:"Espacio entre líneas",multiSpace:"Espacio múltiple",fixedValue:"Valor fijo (px)"}},rightClick:{copy:"Copiar",cut:"Cortar",paste:"Pegar",delete:"Eliminar",bulletList:"Lista de viñetas",orderList:"Lista ordenada",checkList:"Lista de tareas",insertBellow:"Insertar debajo"},"page-settings":{"document-setting":"Configuración de documento","paper-size":"Tamaño de papel","page-size":{main:"Tamaño de papel",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Carta",legal:"Legal",tabloid:"Tabloide",statement:"Declaración",executive:"Ejecutivo",folio:"Folio"},orientation:"Orientación",portrait:"Vertical",landscape:"Horizontal","custom-paper-size":"Tamaño de papel personalizado",top:"Superior",bottom:"Inferior",left:"Izquierda",right:"Derecha",cancel:"Cancelar",confirm:"Confirmar"}}}));
|
package/lib/umd/locale/fa-IR.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.UniverDocsUiFaIR=t())})(this,function(){"use strict";return{toolbar:{undo:"بازگرداندن",redo:"تکرار",font:"فونت",fontSize:"اندازه فونت",bold:"پررنگ",italic:"ایتالیک",strikethrough:"خطدار",subscript:"زیرنویس",superscript:"بالانویس",underline:"خطکشی",textColor:{main:"رنگ متن",right:"انتخاب رنگ"},fillColor:{main:"رنگ پسزمینه متن",right:"انتخاب رنگ"},table:{main:"جدول",insert:"درج جدول",colCount:"تعداد ستون",rowCount:"تعداد سطر"},resetColor:"بازنشانی",order:"لیست شمارهدار",unorder:"لیست بدون شماره",checklist:"لیست وظیفه",documentFlavor:"Modern Mode",alignLeft:"تراز چپ",alignCenter:"تراز وسط",alignRight:"تراز راست",alignJustify:"توجیه",horizontalLine:"Horizontal line",headerFooter:"هدر و فوتر",pageSetup:"تنظیمات صفحه"},table:{insert:"درج",insertRowAbove:"درج سطر بالاتر",insertRowBelow:"درج سطر پایینتر",insertColumnLeft:"درج ستون چپ",insertColumnRight:"درج ستون راست",delete:"حذف جدول",deleteRows:"حذف سطر",deleteColumns:"حذف ستون",deleteTable:"حذف جدول"},headerFooter:{header:"هدر",footer:"فوتر",panel:"تنظیمات هدر و فوتر",firstPageCheckBox:"صفحه اول متفاوت",oddEvenCheckBox:"صفحات فرد و زوج متفاوت",headerTopMargin:"حاشیه بالای هدر(px)",footerBottomMargin:"حاشیه پایینی فوتر(px)",closeHeaderFooter:"بستن هدر و فوتر",disableText:"تنظیمات هدر و فوتر غیرفعال است"},doc:{menu:{paragraphSetting:"تنظیمات پاراگراف"},slider:{paragraphSetting:"تنظیمات پاراگراف"},paragraphSetting:{alignment:"تراز",indentation:"تورفتگی",left:"چپ",right:"راست",firstLine:"خط اول",hanging:"آویز",spacing:"فاصلهگذاری",before:"قبل",after:"بعد",lineSpace:"فاصله خط",multiSpace:"فاصله چندگانه",fixedValue:"مقدار ثابت(px)"}},rightClick:{copy:"کپی",cut:"برش",paste:"چسباندن",delete:"حذف",bulletList:"لیست بدون شماره",orderList:"لیست شمارهدار",checkList:"لیست وظیفه",insertBellow:"درج در پایین"},"page-settings":{"document-setting":"تنظیمات سند","page-size":{main:"اندازه کاغذ",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"نامه آمریکایی",legal:"نامه حقوقی",tabloid:"روزنامه",statement:"کاغذ اظهارنامه",executive:"کاغذ اجرایی",folio:"کاغذ فولیو"},"paper-size":"اندازه کاغذ",orientation:"جهت",portrait:"عمودی",landscape:"افقی","custom-paper-size":"اندازه کاغذ سفارشی",top:"بالا",bottom:"پایین",left:"چپ",right:"راست",cancel:"لغو",confirm:"تایید"}}});
|
|
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.UniverDocsUiFaIR=t())})(this,(function(){"use strict";return{toolbar:{undo:"بازگرداندن",redo:"تکرار",font:"فونت",fontSize:"اندازه فونت",bold:"پررنگ",italic:"ایتالیک",strikethrough:"خطدار",subscript:"زیرنویس",superscript:"بالانویس",underline:"خطکشی",textColor:{main:"رنگ متن",right:"انتخاب رنگ"},fillColor:{main:"رنگ پسزمینه متن",right:"انتخاب رنگ"},table:{main:"جدول",insert:"درج جدول",colCount:"تعداد ستون",rowCount:"تعداد سطر"},resetColor:"بازنشانی",order:"لیست شمارهدار",unorder:"لیست بدون شماره",checklist:"لیست وظیفه",documentFlavor:"Modern Mode",alignLeft:"تراز چپ",alignCenter:"تراز وسط",alignRight:"تراز راست",alignJustify:"توجیه",horizontalLine:"Horizontal line",headerFooter:"هدر و فوتر",pageSetup:"تنظیمات صفحه"},table:{insert:"درج",insertRowAbove:"درج سطر بالاتر",insertRowBelow:"درج سطر پایینتر",insertColumnLeft:"درج ستون چپ",insertColumnRight:"درج ستون راست",delete:"حذف جدول",deleteRows:"حذف سطر",deleteColumns:"حذف ستون",deleteTable:"حذف جدول"},headerFooter:{header:"هدر",footer:"فوتر",panel:"تنظیمات هدر و فوتر",firstPageCheckBox:"صفحه اول متفاوت",oddEvenCheckBox:"صفحات فرد و زوج متفاوت",headerTopMargin:"حاشیه بالای هدر(px)",footerBottomMargin:"حاشیه پایینی فوتر(px)",closeHeaderFooter:"بستن هدر و فوتر",disableText:"تنظیمات هدر و فوتر غیرفعال است"},doc:{menu:{paragraphSetting:"تنظیمات پاراگراف"},slider:{paragraphSetting:"تنظیمات پاراگراف"},paragraphSetting:{alignment:"تراز",indentation:"تورفتگی",left:"چپ",right:"راست",firstLine:"خط اول",hanging:"آویز",spacing:"فاصلهگذاری",before:"قبل",after:"بعد",lineSpace:"فاصله خط",multiSpace:"فاصله چندگانه",fixedValue:"مقدار ثابت(px)"}},rightClick:{copy:"کپی",cut:"برش",paste:"چسباندن",delete:"حذف",bulletList:"لیست بدون شماره",orderList:"لیست شمارهدار",checkList:"لیست وظیفه",insertBellow:"درج در پایین"},"page-settings":{"document-setting":"تنظیمات سند","page-size":{main:"اندازه کاغذ",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"نامه آمریکایی",legal:"نامه حقوقی",tabloid:"روزنامه",statement:"کاغذ اظهارنامه",executive:"کاغذ اجرایی",folio:"کاغذ فولیو"},"paper-size":"اندازه کاغذ",orientation:"جهت",portrait:"عمودی",landscape:"افقی","custom-paper-size":"اندازه کاغذ سفارشی",top:"بالا",bottom:"پایین",left:"چپ",right:"راست",cancel:"لغو",confirm:"تایید"}}}));
|
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.UniverDocsUiFrFR=t())})(this,function(){"use strict";return{toolbar:{undo:"Annuler",redo:"Rétablir",font:"Police",fontSize:"Taille de la police",bold:"Gras",italic:"Italique",strikethrough:"Barré",subscript:"Indice",superscript:"Exposant",underline:"Souligné",textColor:{main:"Couleur du texte",right:"Choisir une couleur"},fillColor:{main:"Couleur de fond du texte",right:"Choisir une couleur"},table:{main:"Tableau",insert:"Insérer un tableau",colCount:"Nombre de colonnes",rowCount:"Nombre de lignes"},resetColor:"Réinitialiser",order:"Liste ordonnée",unorder:"Liste non ordonnée",checklist:"Liste de tâches",documentFlavor:"Modern Mode",alignLeft:"Aligner à gauche",alignCenter:"Aligner au centre",alignRight:"Aligner à droite",alignJustify:"Justifier",horizontalLine:"Horizontal line",headerFooter:"En-tête et pied de page",pageSetup:"Paramètres de page"},table:{insert:"Insérer",insertRowAbove:"Insérer une ligne au-dessus",insertRowBelow:"Insérer une ligne en dessous",insertColumnLeft:"Insérer une colonne à gauche",insertColumnRight:"Insérer une colonne à droite",delete:"Supprimer",deleteRows:"Supprimer une ligne",deleteColumns:"Supprimer une colonne",deleteTable:"Supprimer le tableau"},headerFooter:{header:"En-tête",footer:"Pied de page",panel:"En-tête et pied de page",firstPageCheckBox:"Différente la première page",oddEvenCheckBox:"Différente les pages impaires et paires",headerTopMargin:"Marge en haut de l'en-tête(px)",footerBottomMargin:"Marge en bas du pied de page(px)",closeHeaderFooter:"Fermer l'en-tête et le pied de page",disableText:"Les paramètres de l'en-tête et du pied de page sont désactivés"},doc:{menu:{paragraphSetting:"Paramètres de paragraphe"},slider:{paragraphSetting:"Paramètres de paragraphe"},paragraphSetting:{alignment:"Alignement",indentation:"Indentation",left:"Gauche",right:"Droite",firstLine:"Première ligne",hanging:"Retrait",spacing:"Espacement",before:"Avant",after:"Après",lineSpace:"Espacement de ligne",multiSpace:"Espacement multiple",fixedValue:"Valeur fixe(px)"}},rightClick:{copy:"Copier",cut:"Couper",paste:"Coller",delete:"Supprimer",bulletList:"Liste non ordonnée",orderList:"Liste ordonnée",checkList:"Liste de tâches",insertBellow:"Insérer dans le bas"},"page-settings":{"document-setting":"Paramètres du document","paper-size":"Format du papier","page-size":{main:"Format du papier",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Format Lettre US",legal:"Format Légal US",tabloid:"Format Tabloïd",statement:"Format Déclaration",executive:"Format Exécutif",folio:"Format Folio"},orientation:"Orientation",portrait:"Portrait",landscape:"Paysage","custom-paper-size":"Format de papier personnalisé",top:"Haut",bottom:"Bas",left:"Gauche",right:"Droite",cancel:"Annuler",confirm:"Confirmer"}}});
|
|
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.UniverDocsUiFrFR=t())})(this,(function(){"use strict";return{toolbar:{undo:"Annuler",redo:"Rétablir",font:"Police",fontSize:"Taille de la police",bold:"Gras",italic:"Italique",strikethrough:"Barré",subscript:"Indice",superscript:"Exposant",underline:"Souligné",textColor:{main:"Couleur du texte",right:"Choisir une couleur"},fillColor:{main:"Couleur de fond du texte",right:"Choisir une couleur"},table:{main:"Tableau",insert:"Insérer un tableau",colCount:"Nombre de colonnes",rowCount:"Nombre de lignes"},resetColor:"Réinitialiser",order:"Liste ordonnée",unorder:"Liste non ordonnée",checklist:"Liste de tâches",documentFlavor:"Modern Mode",alignLeft:"Aligner à gauche",alignCenter:"Aligner au centre",alignRight:"Aligner à droite",alignJustify:"Justifier",horizontalLine:"Horizontal line",headerFooter:"En-tête et pied de page",pageSetup:"Paramètres de page"},table:{insert:"Insérer",insertRowAbove:"Insérer une ligne au-dessus",insertRowBelow:"Insérer une ligne en dessous",insertColumnLeft:"Insérer une colonne à gauche",insertColumnRight:"Insérer une colonne à droite",delete:"Supprimer",deleteRows:"Supprimer une ligne",deleteColumns:"Supprimer une colonne",deleteTable:"Supprimer le tableau"},headerFooter:{header:"En-tête",footer:"Pied de page",panel:"En-tête et pied de page",firstPageCheckBox:"Différente la première page",oddEvenCheckBox:"Différente les pages impaires et paires",headerTopMargin:"Marge en haut de l'en-tête(px)",footerBottomMargin:"Marge en bas du pied de page(px)",closeHeaderFooter:"Fermer l'en-tête et le pied de page",disableText:"Les paramètres de l'en-tête et du pied de page sont désactivés"},doc:{menu:{paragraphSetting:"Paramètres de paragraphe"},slider:{paragraphSetting:"Paramètres de paragraphe"},paragraphSetting:{alignment:"Alignement",indentation:"Indentation",left:"Gauche",right:"Droite",firstLine:"Première ligne",hanging:"Retrait",spacing:"Espacement",before:"Avant",after:"Après",lineSpace:"Espacement de ligne",multiSpace:"Espacement multiple",fixedValue:"Valeur fixe(px)"}},rightClick:{copy:"Copier",cut:"Couper",paste:"Coller",delete:"Supprimer",bulletList:"Liste non ordonnée",orderList:"Liste ordonnée",checkList:"Liste de tâches",insertBellow:"Insérer dans le bas"},"page-settings":{"document-setting":"Paramètres du document","paper-size":"Format du papier","page-size":{main:"Format du papier",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Format Lettre US",legal:"Format Légal US",tabloid:"Format Tabloïd",statement:"Format Déclaration",executive:"Format Exécutif",folio:"Format Folio"},orientation:"Orientation",portrait:"Portrait",landscape:"Paysage","custom-paper-size":"Format de papier personnalisé",top:"Haut",bottom:"Bas",left:"Gauche",right:"Droite",cancel:"Annuler",confirm:"Confirmer"}}}));
|
package/lib/umd/locale/ko-KR.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.UniverDocsUiKoKR=t())})(this,function(){"use strict";return{toolbar:{undo:"실행 취소",redo:"다시 실행",font:"글꼴",fontSize:"글꼴 크기",bold:"굵게",italic:"기울임꼴",strikethrough:"취소선",subscript:"아래 첨자",superscript:"위 첨자",underline:"밑줄",textColor:{main:"글자 색상",right:"색상 선택"},fillColor:{main:"글자 배경색",right:"색상 선택"},table:{main:"표",insert:"표 삽입",colCount:"열 개수",rowCount:"행 개수"},resetColor:"기본색으로 재설정",order:"번호 매기기",unorder:"글머리 기호",checklist:"할 일 목록",documentFlavor:"모던 모드",alignLeft:"왼쪽 정렬",alignCenter:"가운데 정렬",alignRight:"오른쪽 정렬",alignJustify:"양쪽 맞춤",horizontalLine:"가로줄 삽입",headerFooter:"머리글 및 바닥글",pageSetup:"페이지 설정"},table:{insert:"삽입",insertRowAbove:"위에 행 삽입",insertRowBelow:"아래에 행 삽입",insertColumnLeft:"왼쪽에 열 삽입",insertColumnRight:"오른쪽에 열 삽입",delete:"표 삭제",deleteRows:"행 삭제",deleteColumns:"열 삭제",deleteTable:"표 삭제"},headerFooter:{header:"머리글",footer:"바닥글",panel:"머리글 및 바닥글 설정",firstPageCheckBox:"첫 페이지 다르게 설정",oddEvenCheckBox:"홀짝 페이지 다르게 설정",headerTopMargin:"머리글 위쪽 여백(px)",footerBottomMargin:"바닥글 아래쪽 여백(px)",closeHeaderFooter:"머리글 및 바닥글 닫기",disableText:"머리글 및 바닥글 설정이 비활성화되었습니다"},doc:{menu:{paragraphSetting:"문단 설정"},slider:{paragraphSetting:"문단 설정"},paragraphSetting:{alignment:"정렬",indentation:"들여쓰기",left:"왼쪽",right:"오른쪽",firstLine:"첫 줄",hanging:"내어쓰기",spacing:"간격",before:"위 간격",after:"아래 간격",lineSpace:"줄 간격",multiSpace:"복수 줄 간격",fixedValue:"고정 값(px)"}},rightClick:{copy:"복사",cut:"잘라내기",paste:"붙여넣기",delete:"삭제",bulletList:"글머리 기호 목록",orderList:"번호 매기기 목록",checkList:"할 일 목록",insertBellow:"아래에 삽입"},"page-settings":{"document-setting":"문서 설정","paper-size":"용지 크기","page-size":{main:"용지 크기",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Letter",legal:"Legal",tabloid:"Tabloid",statement:"Statement",executive:"Executive",folio:"Folio"},orientation:"방향",portrait:"세로",landscape:"가로","custom-paper-size":"사용자 정의 용지 크기",top:"위",bottom:"아래",left:"왼쪽",right:"오른쪽",cancel:"취소",confirm:"확인"}}});
|
|
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.UniverDocsUiKoKR=t())})(this,(function(){"use strict";return{toolbar:{undo:"실행 취소",redo:"다시 실행",font:"글꼴",fontSize:"글꼴 크기",bold:"굵게",italic:"기울임꼴",strikethrough:"취소선",subscript:"아래 첨자",superscript:"위 첨자",underline:"밑줄",textColor:{main:"글자 색상",right:"색상 선택"},fillColor:{main:"글자 배경색",right:"색상 선택"},table:{main:"표",insert:"표 삽입",colCount:"열 개수",rowCount:"행 개수"},resetColor:"기본색으로 재설정",order:"번호 매기기",unorder:"글머리 기호",checklist:"할 일 목록",documentFlavor:"모던 모드",alignLeft:"왼쪽 정렬",alignCenter:"가운데 정렬",alignRight:"오른쪽 정렬",alignJustify:"양쪽 맞춤",horizontalLine:"가로줄 삽입",headerFooter:"머리글 및 바닥글",pageSetup:"페이지 설정"},table:{insert:"삽입",insertRowAbove:"위에 행 삽입",insertRowBelow:"아래에 행 삽입",insertColumnLeft:"왼쪽에 열 삽입",insertColumnRight:"오른쪽에 열 삽입",delete:"표 삭제",deleteRows:"행 삭제",deleteColumns:"열 삭제",deleteTable:"표 삭제"},headerFooter:{header:"머리글",footer:"바닥글",panel:"머리글 및 바닥글 설정",firstPageCheckBox:"첫 페이지 다르게 설정",oddEvenCheckBox:"홀짝 페이지 다르게 설정",headerTopMargin:"머리글 위쪽 여백(px)",footerBottomMargin:"바닥글 아래쪽 여백(px)",closeHeaderFooter:"머리글 및 바닥글 닫기",disableText:"머리글 및 바닥글 설정이 비활성화되었습니다"},doc:{menu:{paragraphSetting:"문단 설정"},slider:{paragraphSetting:"문단 설정"},paragraphSetting:{alignment:"정렬",indentation:"들여쓰기",left:"왼쪽",right:"오른쪽",firstLine:"첫 줄",hanging:"내어쓰기",spacing:"간격",before:"위 간격",after:"아래 간격",lineSpace:"줄 간격",multiSpace:"복수 줄 간격",fixedValue:"고정 값(px)"}},rightClick:{copy:"복사",cut:"잘라내기",paste:"붙여넣기",delete:"삭제",bulletList:"글머리 기호 목록",orderList:"번호 매기기 목록",checkList:"할 일 목록",insertBellow:"아래에 삽입"},"page-settings":{"document-setting":"문서 설정","paper-size":"용지 크기","page-size":{main:"용지 크기",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Letter",legal:"Legal",tabloid:"Tabloid",statement:"Statement",executive:"Executive",folio:"Folio"},orientation:"방향",portrait:"세로",landscape:"가로","custom-paper-size":"사용자 정의 용지 크기",top:"위",bottom:"아래",left:"왼쪽",right:"오른쪽",cancel:"취소",confirm:"확인"}}}));
|
package/lib/umd/locale/ru-RU.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.UniverDocsUiRuRU=t())})(this,function(){"use strict";return{toolbar:{undo:"Отменить",redo:"Повторить",font:"Шрифт",fontSize:"Размер шрифта",bold:"Полужирный",italic:"Курсив",strikethrough:"Зачеркнутый",subscript:"Нижний индекс",superscript:"Верхний индекс",underline:"Подчеркнутый",textColor:{main:"Цвет текста",right:"Выбрать цвет"},fillColor:{main:"Цвет фона текста",right:"Выбрать цвет"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"Сбросить",order:"Упорядоченный список",unorder:"Неупорядоченный список",alignLeft:"Выровнять по левому краю",alignCenter:"Выровнять по центру",alignRight:"Выровнять по правому краю",alignJustify:"Выровнять по ширине",horizontalLine:"Горизонтальная линия",headerFooter:"Шапка и подвал",checklist:"Список задач",documentFlavor:"Современный режим",pageSetup:"Настройки страницы"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"Header",footer:"Footer",panel:"Header & Footer Settings",firstPageCheckBox:"Different first page",oddEvenCheckBox:"Different odd and even pages",headerTopMargin:"Header top margin(px)",footerBottomMargin:"Footer bottom margin(px)",closeHeaderFooter:"Close header & footer",disableText:"Header & footer settings are disabled"},doc:{menu:{paragraphSetting:"Paragraph Setting"},slider:{paragraphSetting:"Paragraph Setting"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"Копировать",cut:"Вырезать",paste:"Вставить",delete:"Удалить",bulletList:"Неупорядоченный список",orderList:"Упорядоченный список",checkList:"Список задач",insertBellow:"Вставить ниже"},"page-settings":{"document-setting":"Настройки документа","page-size":{main:"Размер бумаги",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Американский формат",legal:"Юридический формат",tabloid:"Таблоидный формат",statement:"Формат заявления",executive:"Исполнительный формат",folio:"Формат фолио"},"paper-size":"Размер бумаги",orientation:"Ориентация",portrait:"Книжная",landscape:"Альбомная","custom-paper-size":"Пользовательский размер бумаги",top:"Верх",bottom:"Низ",left:"Слева",right:"Справа",cancel:"Отмена",confirm:"Подтвердить"}}});
|
|
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.UniverDocsUiRuRU=t())})(this,(function(){"use strict";return{toolbar:{undo:"Отменить",redo:"Повторить",font:"Шрифт",fontSize:"Размер шрифта",bold:"Полужирный",italic:"Курсив",strikethrough:"Зачеркнутый",subscript:"Нижний индекс",superscript:"Верхний индекс",underline:"Подчеркнутый",textColor:{main:"Цвет текста",right:"Выбрать цвет"},fillColor:{main:"Цвет фона текста",right:"Выбрать цвет"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"Сбросить",order:"Упорядоченный список",unorder:"Неупорядоченный список",alignLeft:"Выровнять по левому краю",alignCenter:"Выровнять по центру",alignRight:"Выровнять по правому краю",alignJustify:"Выровнять по ширине",horizontalLine:"Горизонтальная линия",headerFooter:"Шапка и подвал",checklist:"Список задач",documentFlavor:"Современный режим",pageSetup:"Настройки страницы"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"Header",footer:"Footer",panel:"Header & Footer Settings",firstPageCheckBox:"Different first page",oddEvenCheckBox:"Different odd and even pages",headerTopMargin:"Header top margin(px)",footerBottomMargin:"Footer bottom margin(px)",closeHeaderFooter:"Close header & footer",disableText:"Header & footer settings are disabled"},doc:{menu:{paragraphSetting:"Paragraph Setting"},slider:{paragraphSetting:"Paragraph Setting"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"Копировать",cut:"Вырезать",paste:"Вставить",delete:"Удалить",bulletList:"Неупорядоченный список",orderList:"Упорядоченный список",checkList:"Список задач",insertBellow:"Вставить ниже"},"page-settings":{"document-setting":"Настройки документа","page-size":{main:"Размер бумаги",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Американский формат",legal:"Юридический формат",tabloid:"Таблоидный формат",statement:"Формат заявления",executive:"Исполнительный формат",folio:"Формат фолио"},"paper-size":"Размер бумаги",orientation:"Ориентация",portrait:"Книжная",landscape:"Альбомная","custom-paper-size":"Пользовательский размер бумаги",top:"Верх",bottom:"Низ",left:"Слева",right:"Справа",cancel:"Отмена",confirm:"Подтвердить"}}}));
|
package/lib/umd/locale/vi-VN.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.UniverDocsUiViVN=t())})(this,function(){"use strict";return{toolbar:{undo:"Hoàn tác",redo:"Làm lại",font:"Phông chữ",fontSize:"Cỡ chữ",bold:"In đậm",italic:"In nghiêng",strikethrough:"Gạch ngang",subscript:"Chỉ số dưới",superscript:"Chỉ số trên",underline:"Gạch chân",textColor:{main:"Màu chữ",right:"Chọn màu"},fillColor:{main:"Màu nền văn bản",right:"Chọn màu nền"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"Đặt lại màu",order:"Danh sách có thứ tự",unorder:"Danh sách không thứ tự",alignLeft:"Căn trái",alignCenter:"Căn giữa",alignRight:"Căn phải",alignJustify:"Căn đều hai bên",horizontalLine:"Horizontal line",headerFooter:"Đầu trang và chân trang",checklist:"Task list",documentFlavor:"Modern Mode",pageSetup:"Cài đặt trang"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"Đầu trang",footer:"Chân trang",panel:"Cài đặt đầu trang và chân trang",firstPageCheckBox:"Trang đầu khác biệt",oddEvenCheckBox:"Trang lẻ chẵn khác biệt",headerTopMargin:"Khoảng cách đầu trang từ trên cùng (px)",footerBottomMargin:"Khoảng cách chân trang từ dưới cùng (px)",closeHeaderFooter:"Đóng đầu trang và chân trang",disableText:"Cài đặt đầu trang và chân trang không khả dụng"},doc:{menu:{paragraphSetting:"Paragraph Setting"},slider:{paragraphSetting:"Paragraph Setting"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"Sao chép",cut:"Cắt",paste:"Dán",delete:"Xóa",bulletList:"Danh sách không thứ tự",orderList:"Danh sách có thứ tự",checkList:"Danh sách công việc",insertBellow:"Chèn dưới"},"page-settings":{"document-setting":"Cài đặt tài liệu","paper-size":"Kích thước giấy","page-size":{main:"Kích thước giấy",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Giấy thư Mỹ",legal:"Giấy pháp lý Mỹ",tabloid:"Khổ báo",statement:"Giấy tuyên bố",executive:"Giấy hành chính",folio:"Giấy folio"},orientation:"Hướng",portrait:"Dọc",landscape:"Ngang","custom-paper-size":"Kích thước giấy tùy chỉnh",top:"Trên",bottom:"Dưới",left:"Trái",right:"Phải",cancel:"Hủy",confirm:"Xác nhận"}}});
|
|
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.UniverDocsUiViVN=t())})(this,(function(){"use strict";return{toolbar:{undo:"Hoàn tác",redo:"Làm lại",font:"Phông chữ",fontSize:"Cỡ chữ",bold:"In đậm",italic:"In nghiêng",strikethrough:"Gạch ngang",subscript:"Chỉ số dưới",superscript:"Chỉ số trên",underline:"Gạch chân",textColor:{main:"Màu chữ",right:"Chọn màu"},fillColor:{main:"Màu nền văn bản",right:"Chọn màu nền"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"Đặt lại màu",order:"Danh sách có thứ tự",unorder:"Danh sách không thứ tự",alignLeft:"Căn trái",alignCenter:"Căn giữa",alignRight:"Căn phải",alignJustify:"Căn đều hai bên",horizontalLine:"Horizontal line",headerFooter:"Đầu trang và chân trang",checklist:"Task list",documentFlavor:"Modern Mode",pageSetup:"Cài đặt trang"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"Đầu trang",footer:"Chân trang",panel:"Cài đặt đầu trang và chân trang",firstPageCheckBox:"Trang đầu khác biệt",oddEvenCheckBox:"Trang lẻ chẵn khác biệt",headerTopMargin:"Khoảng cách đầu trang từ trên cùng (px)",footerBottomMargin:"Khoảng cách chân trang từ dưới cùng (px)",closeHeaderFooter:"Đóng đầu trang và chân trang",disableText:"Cài đặt đầu trang và chân trang không khả dụng"},doc:{menu:{paragraphSetting:"Paragraph Setting"},slider:{paragraphSetting:"Paragraph Setting"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"Sao chép",cut:"Cắt",paste:"Dán",delete:"Xóa",bulletList:"Danh sách không thứ tự",orderList:"Danh sách có thứ tự",checkList:"Danh sách công việc",insertBellow:"Chèn dưới"},"page-settings":{"document-setting":"Cài đặt tài liệu","paper-size":"Kích thước giấy","page-size":{main:"Kích thước giấy",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"Giấy thư Mỹ",legal:"Giấy pháp lý Mỹ",tabloid:"Khổ báo",statement:"Giấy tuyên bố",executive:"Giấy hành chính",folio:"Giấy folio"},orientation:"Hướng",portrait:"Dọc",landscape:"Ngang","custom-paper-size":"Kích thước giấy tùy chỉnh",top:"Trên",bottom:"Dưới",left:"Trái",right:"Phải",cancel:"Hủy",confirm:"Xác nhận"}}}));
|
package/lib/umd/locale/zh-CN.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.UniverDocsUiZhCN=t())})(this,function(){"use strict";return{toolbar:{undo:"撤销",redo:"重做",font:"字体",fontSize:"字号",bold:"粗体",italic:"斜体",strikethrough:"删除线",subscript:"下标",superscript:"上标",underline:"下划线",textColor:{main:"文本颜色",right:"颜色选择"},fillColor:{main:"文本背景色",right:"背景色选择"},table:{main:"表格",insert:"插入表格",colCount:"列数",rowCount:"行数"},resetColor:"重置颜色",order:"有序列表",unorder:"无序列表",checklist:"任务列表",documentFlavor:"现代模式",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",alignJustify:"两端对齐",horizontalLine:"水平分割线",headerFooter:"页眉页脚",pageSetup:"页面设置"},table:{insert:"插入",insertRowAbove:"上方插入行",insertRowBelow:"下方插入行",insertColumnLeft:"左方插入列",insertColumnRight:"右方插入列",delete:"表格删除",deleteRows:"删除行",deleteColumns:"删除列",deleteTable:"删除表格"},headerFooter:{header:"页眉",footer:"页脚",panel:"页眉页脚设置",firstPageCheckBox:"首页不同",oddEvenCheckBox:"奇偶页不同",headerTopMargin:"页眉顶端距离",footerBottomMargin:"页脚底端距离",closeHeaderFooter:"关闭页眉页脚",disableText:"页眉页脚设置不可用"},doc:{menu:{paragraphSetting:"段落设置"},slider:{paragraphSetting:"段落设置"},paragraphSetting:{alignment:"对齐方式",indentation:"缩进",left:"左边距",right:"右边距",firstLine:"首行",hanging:"悬挂",spacing:"间距",before:"段落前",after:"段落后",lineSpace:"行距",multiSpace:"多倍行距",fixedValue:"固定值(px)"}},rightClick:{copy:"复制",cut:"剪切",paste:"粘贴",delete:"删除",bulletList:"无序列表",orderList:"有序列表",checkList:"任务列表",insertBellow:"在下方插入"},"page-settings":{"document-setting":"文档设置","page-size":{main:"纸张大小",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"美式信纸",legal:"美式法律用纸",tabloid:"小报尺寸",statement:"声明用纸",executive:"行政用纸",folio:"对开纸"},"paper-size":"纸张大小",orientation:"方向",portrait:"纵向",landscape:"横向","custom-paper-size":"自定义纸张大小",top:"上",bottom:"下",left:"左",right:"右",cancel:"取消",confirm:"确认"}}});
|
|
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.UniverDocsUiZhCN=t())})(this,(function(){"use strict";return{toolbar:{undo:"撤销",redo:"重做",font:"字体",fontSize:"字号",bold:"粗体",italic:"斜体",strikethrough:"删除线",subscript:"下标",superscript:"上标",underline:"下划线",textColor:{main:"文本颜色",right:"颜色选择"},fillColor:{main:"文本背景色",right:"背景色选择"},table:{main:"表格",insert:"插入表格",colCount:"列数",rowCount:"行数"},resetColor:"重置颜色",order:"有序列表",unorder:"无序列表",checklist:"任务列表",documentFlavor:"现代模式",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",alignJustify:"两端对齐",horizontalLine:"水平分割线",headerFooter:"页眉页脚",pageSetup:"页面设置"},table:{insert:"插入",insertRowAbove:"上方插入行",insertRowBelow:"下方插入行",insertColumnLeft:"左方插入列",insertColumnRight:"右方插入列",delete:"表格删除",deleteRows:"删除行",deleteColumns:"删除列",deleteTable:"删除表格"},headerFooter:{header:"页眉",footer:"页脚",panel:"页眉页脚设置",firstPageCheckBox:"首页不同",oddEvenCheckBox:"奇偶页不同",headerTopMargin:"页眉顶端距离",footerBottomMargin:"页脚底端距离",closeHeaderFooter:"关闭页眉页脚",disableText:"页眉页脚设置不可用"},doc:{menu:{paragraphSetting:"段落设置"},slider:{paragraphSetting:"段落设置"},paragraphSetting:{alignment:"对齐方式",indentation:"缩进",left:"左边距",right:"右边距",firstLine:"首行",hanging:"悬挂",spacing:"间距",before:"段落前",after:"段落后",lineSpace:"行距",multiSpace:"多倍行距",fixedValue:"固定值(px)"}},rightClick:{copy:"复制",cut:"剪切",paste:"粘贴",delete:"删除",bulletList:"无序列表",orderList:"有序列表",checkList:"任务列表",insertBellow:"在下方插入"},"page-settings":{"document-setting":"文档设置","page-size":{main:"纸张大小",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"美式信纸",legal:"美式法律用纸",tabloid:"小报尺寸",statement:"声明用纸",executive:"行政用纸",folio:"对开纸"},"paper-size":"纸张大小",orientation:"方向",portrait:"纵向",landscape:"横向","custom-paper-size":"自定义纸张大小",top:"上",bottom:"下",left:"左",right:"右",cancel:"取消",confirm:"确认"}}}));
|
package/lib/umd/locale/zh-TW.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.UniverDocsUiZhTW=t())})(this,function(){"use strict";return{toolbar:{undo:"撤銷",redo:"重做",font:"字體",fontSize:"字號",bold:"粗體",italic:"斜體",strikethrough:"刪除線",subscript:"下標",superscript:"上標",underline:"底線",textColor:{main:"文字顏色",right:"顏色選擇"},fillColor:{main:"文字背景色",right:"背景色選擇"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"重置顏色",order:"有序列表",unorder:"無序列表",alignLeft:"左對齊",alignCenter:"居中對齊",alignRight:"右對齊",alignJustify:"兩端對齊",horizontalLine:"Horizontal line",headerFooter:"頁眉頁腳",checklist:"任務列表",documentFlavor:"现代模式",pageSetup:"頁面設置"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"頁眉",footer:"頁腳",panel:"頁眉頁腳設置",firstPageCheckBox:"首頁不同",oddEvenCheckBox:"奇偶頁不同",headerTopMargin:"頁眉頂端距離(px)",footerBottomMargin:"頁腳底端距離(px)",closeHeaderFooter:"關閉頁眉頁腳",disableText:"頁眉頁腳設置不可用"},doc:{menu:{paragraphSetting:"Paragraph Setting"},slider:{paragraphSetting:"Paragraph Setting"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"複製",cut:"剪切",paste:"貼上",delete:"刪除",bulletList:"無序列表",orderList:"有序列表",checkList:"任務列表",insertBellow:"在下方插入"},"page-settings":{"document-setting":"文檔設置","page-size":{main:"紙張大小",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"美式信紙",legal:"美式法律用紙",tabloid:"小報尺寸",statement:"聲明用紙",executive:"行政用紙",folio:"對開紙"},"paper-size":"紙張大小",orientation:"方向",portrait:"縱向",landscape:"橫向","custom-paper-size":"自定義紙張大小",top:"上",bottom:"下",left:"左",right:"右",cancel:"取消",confirm:"確認"}}});
|
|
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.UniverDocsUiZhTW=t())})(this,(function(){"use strict";return{toolbar:{undo:"撤銷",redo:"重做",font:"字體",fontSize:"字號",bold:"粗體",italic:"斜體",strikethrough:"刪除線",subscript:"下標",superscript:"上標",underline:"底線",textColor:{main:"文字顏色",right:"顏色選擇"},fillColor:{main:"文字背景色",right:"背景色選擇"},table:{main:"Table",insert:"Insert Table",colCount:"Column count",rowCount:"Row count"},resetColor:"重置顏色",order:"有序列表",unorder:"無序列表",alignLeft:"左對齊",alignCenter:"居中對齊",alignRight:"右對齊",alignJustify:"兩端對齊",horizontalLine:"Horizontal line",headerFooter:"頁眉頁腳",checklist:"任務列表",documentFlavor:"现代模式",pageSetup:"頁面設置"},table:{insert:"Insert",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",delete:"Table delete",deleteRows:"Delete row",deleteColumns:"Delete column",deleteTable:"Delete table"},headerFooter:{header:"頁眉",footer:"頁腳",panel:"頁眉頁腳設置",firstPageCheckBox:"首頁不同",oddEvenCheckBox:"奇偶頁不同",headerTopMargin:"頁眉頂端距離(px)",footerBottomMargin:"頁腳底端距離(px)",closeHeaderFooter:"關閉頁眉頁腳",disableText:"頁眉頁腳設置不可用"},doc:{menu:{paragraphSetting:"Paragraph Setting"},slider:{paragraphSetting:"Paragraph Setting"},paragraphSetting:{alignment:"Alignment",indentation:"Indentation",left:"Left",right:"Right",firstLine:"First Line",hanging:"Hanging",spacing:"Spacing",before:"Before",after:"After",lineSpace:"Line Space",multiSpace:"Multi Space",fixedValue:"Fixed Value(px)"}},rightClick:{copy:"複製",cut:"剪切",paste:"貼上",delete:"刪除",bulletList:"無序列表",orderList:"有序列表",checkList:"任務列表",insertBellow:"在下方插入"},"page-settings":{"document-setting":"文檔設置","page-size":{main:"紙張大小",a4:"A4",a3:"A3",a5:"A5",b4:"B4",b5:"B5",letter:"美式信紙",legal:"美式法律用紙",tabloid:"小報尺寸",statement:"聲明用紙",executive:"行政用紙",folio:"對開紙"},"paper-size":"紙張大小",orientation:"方向",portrait:"縱向",landscape:"橫向","custom-paper-size":"自定義紙張大小",top:"上",bottom:"下",left:"左",right:"右",cancel:"取消",confirm:"確認"}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs-ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Univer normal ui-plugin-docs",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@univerjs/icons": "^0.4.6",
|
|
68
|
-
"@univerjs/core": "0.10.
|
|
69
|
-
"@univerjs/
|
|
70
|
-
"@univerjs/
|
|
71
|
-
"@univerjs/docs": "0.10.
|
|
72
|
-
"@univerjs/engine-render": "0.10.
|
|
73
|
-
"@univerjs/ui": "0.10.
|
|
68
|
+
"@univerjs/core": "0.10.5",
|
|
69
|
+
"@univerjs/drawing": "0.10.5",
|
|
70
|
+
"@univerjs/design": "0.10.5",
|
|
71
|
+
"@univerjs/docs": "0.10.5",
|
|
72
|
+
"@univerjs/engine-render": "0.10.5",
|
|
73
|
+
"@univerjs/ui": "0.10.5"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"jest-canvas-mock": "^2.5.2",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
"react": "18.3.1",
|
|
80
80
|
"rxjs": "^7.8.2",
|
|
81
81
|
"tailwindcss": "3.4.17",
|
|
82
|
-
"typescript": "^5.
|
|
83
|
-
"vite": "^7.
|
|
82
|
+
"typescript": "^5.9.2",
|
|
83
|
+
"vite": "^7.1.3",
|
|
84
84
|
"vitest": "^3.2.4",
|
|
85
|
-
"@univerjs-infra/shared": "0.10.
|
|
86
|
-
"@univerjs/docs-drawing": "0.10.
|
|
85
|
+
"@univerjs-infra/shared": "0.10.5",
|
|
86
|
+
"@univerjs/docs-drawing": "0.10.5"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"test": "vitest run",
|