@univerjs/docs 0.3.0-alpha.1 → 0.3.0-nightly.202410101606
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/cjs/index.js +1 -1
- package/lib/es/index.js +1 -474
- package/lib/types/doc-plugin.d.ts +3 -1
- package/lib/umd/index.js +1 -1
- package/package.json +7 -8
- package/LICENSE +0 -176
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@univerjs/core"),engineRender=require("@univerjs/engine-render"),rxjs=require("rxjs"),SetTextSelectionsOperation={id:"doc.operation.set-selections",type:core.CommandType.OPERATION,handler:__name((_,__)=>!0,"handler")};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__decorateClass$4=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$4(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$4(target,key,result),result},"__decorateClass$4"),__decorateParam$4=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$4"),_a;exports.DocSelectionManagerService=(_a=class extends core.RxDisposable{constructor(_commandService,_univerInstanceService){super();__publicField(this,"_currentSelection",null);__publicField(this,"_textSelectionInfo",new Map);__publicField(this,"_textSelection$",new rxjs.BehaviorSubject(null));__publicField(this,"textSelection$",this._textSelection$.asObservable());__publicField(this,"_refreshSelection$",new rxjs.BehaviorSubject(null));__publicField(this,"refreshSelection$",this._refreshSelection$.asObservable());this._commandService=_commandService,this._univerInstanceService=_univerInstanceService,this._listenCurrentUnit()}_listenCurrentUnit(){this._univerInstanceService.getCurrentTypeOfUnit$(core.UniverInstanceType.UNIVER_DOC).pipe(rxjs.takeUntil(this.dispose$)).subscribe(documentModel=>{if(documentModel==null)return;const unitId=documentModel.getUnitId();this._setCurrentSelectionNotRefresh({unitId,subUnitId:unitId})})}__getCurrentSelection(){return this._currentSelection}getSelectionInfo(params=this._currentSelection){return this._getTextRanges(params)}refreshSelection(params=this._currentSelection){params!=null&&this._refresh(params)}__TEST_ONLY_setCurrentSelection(param){this._currentSelection=param,this._refresh(param)}getTextRanges(params=this._currentSelection){var _a6;return(_a6=this._getTextRanges(params))==null?void 0:_a6.textRanges}getRectRanges(params=this._currentSelection){var _a6;return(_a6=this._getTextRanges(params))==null?void 0:_a6.rectRanges}getDocRanges(params=this._currentSelection){var _a6,_b;const textRanges=(_a6=this.getTextRanges(params))!=null?_a6:[],rectRanges=(_b=this.getRectRanges(params))!=null?_b:[];return[...textRanges,...rectRanges].filter(range=>range.startOffset!=null&&range.endOffset!=null).sort((a,b)=>a.startOffset>b.startOffset?1:a.startOffset<b.startOffset?-1:0)}getActiveTextRange(){const selectionInfo=this._getTextRanges(this._currentSelection);if(selectionInfo==null)return;const{textRanges}=selectionInfo;return textRanges.find(textRange=>textRange.isActive)}getActiveRectRange(){const selectionInfo=this._getTextRanges(this._currentSelection);if(selectionInfo==null)return;const{rectRanges}=selectionInfo;return rectRanges.find(rectRange=>rectRange.isActive)}__TEST_ONLY_add(textRanges,isEditing=!0){this._currentSelection!=null&&this._addByParam({...this._currentSelection,textRanges,rectRanges:[],segmentId:"",segmentPage:-1,isEditing,style:engineRender.NORMAL_TEXT_SELECTION_PLUGIN_STYLE})}replaceTextRanges(docRanges,isEditing=!0,options){return this.replaceDocRanges(docRanges,this._currentSelection,isEditing,options)}replaceDocRanges(docRanges,params=this._currentSelection,isEditing=!0,options){if(params==null)return;const{unitId,subUnitId}=params;this._refreshSelection$.next({unitId,subUnitId,docRanges,isEditing,options})}__replaceTextRangesWithNoRefresh(textSelectionInfo){if(this._currentSelection==null)return;const params={...this._currentSelection,...textSelectionInfo};this._replaceByParam(params),this._textSelection$.next(params);const{unitId,subUnitId,segmentId,style,textRanges,rectRanges,isEditing}=params,ranges=[...textRanges,...rectRanges].filter(range=>range.startOffset!=null&&range.endOffset!=null).sort((a,b)=>a.startOffset>b.startOffset?1:a.startOffset<b.startOffset?-1:0);this._commandService.executeCommand(SetTextSelectionsOperation.id,{unitId,subUnitId,segmentId,style,isEditing,ranges})}dispose(){this._textSelection$.complete()}_setCurrentSelectionNotRefresh(param){this._currentSelection=param}_getTextRanges(param){var _a6;if(param==null)return;const{unitId,subUnitId=""}=param;return(_a6=this._textSelectionInfo.get(unitId))==null?void 0:_a6.get(subUnitId)}_refresh(param){const allTextSelectionInfo=this._getTextRanges(param);if(allTextSelectionInfo==null)return;const{textRanges,rectRanges}=allTextSelectionInfo,docRanges=[...textRanges,...rectRanges],{unitId,subUnitId}=param;this._refreshSelection$.next({unitId,subUnitId,docRanges,isEditing:!1})}_replaceByParam(insertParam){const{unitId,subUnitId,...selectionInsertParam}=insertParam;this._textSelectionInfo.has(unitId)||this._textSelectionInfo.set(unitId,new Map),this._textSelectionInfo.get(unitId).set(subUnitId,{...selectionInsertParam})}_addByParam(insertParam){const{unitId,subUnitId,...selectionInsertParam}=insertParam;this._textSelectionInfo.has(unitId)||this._textSelectionInfo.set(unitId,new Map);const unitTextRange=this._textSelectionInfo.get(unitId);unitTextRange.has(subUnitId)?unitTextRange.get(subUnitId).textRanges.push(...insertParam.textRanges):unitTextRange.set(subUnitId,{...selectionInsertParam})}},__name(_a,"DocSelectionManagerService"),_a);exports.DocSelectionManagerService=__decorateClass$4([__decorateParam$4(0,core.ICommandService),__decorateParam$4(1,core.IUniverInstanceService)],exports.DocSelectionManagerService);var __defProp$3=Object.defineProperty,__getOwnPropDesc$3=Object.getOwnPropertyDescriptor,__decorateClass$3=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$3(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$3(target,key,result),result},"__decorateClass$3"),__decorateParam$3=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$3"),_a2;exports.DocSkeletonManagerService=(_a2=class extends core.RxDisposable{constructor(_context,_localeService,_univerInstanceService){super();__publicField(this,"_skeleton");__publicField(this,"_docViewModel");__publicField(this,"_currentSkeleton$",new rxjs.BehaviorSubject(null));__publicField(this,"currentSkeleton$",this._currentSkeleton$.asObservable());__publicField(this,"_currentSkeletonBefore$",new rxjs.BehaviorSubject(null));__publicField(this,"currentSkeletonBefore$",this._currentSkeletonBefore$.asObservable());__publicField(this,"_currentViewModel$",new rxjs.BehaviorSubject(null));__publicField(this,"currentViewModel$",this._currentViewModel$.asObservable());this._context=_context,this._localeService=_localeService,this._univerInstanceService=_univerInstanceService,this._init(),this._univerInstanceService.getCurrentTypeOfUnit$(core.UniverInstanceType.UNIVER_DOC).pipe(rxjs.takeUntil(this.dispose$)).subscribe(documentModel=>{documentModel&&documentModel.getUnitId()===this._context.unitId&&this._update(documentModel)})}dispose(){super.dispose(),this._currentSkeletonBefore$.complete(),this._currentSkeleton$.complete()}getSkeleton(){return this._skeleton}getViewModel(){return this._docViewModel}_init(){const documentDataModel=this._context.unit;this._update(documentDataModel)}_update(documentDataModel){const unitId=this._context.unitId;if(documentDataModel.getBody()==null)return;this._docViewModel&&core.isInternalEditorID(unitId)?(this._docViewModel.reset(documentDataModel),this._context.unit=documentDataModel):this._docViewModel||(this._docViewModel=this._buildDocViewModel(documentDataModel)),this._skeleton||(this._skeleton=this._buildSkeleton(this._docViewModel));const skeleton=this._skeleton;skeleton.calculate(),this._currentSkeletonBefore$.next(skeleton),this._currentSkeleton$.next(skeleton),this._currentViewModel$.next(this._docViewModel)}_buildSkeleton(documentViewModel){return engineRender.DocumentSkeleton.create(documentViewModel,this._localeService)}_buildDocViewModel(documentDataModel){return new engineRender.DocumentViewModel(documentDataModel)}},__name(_a2,"DocSkeletonManagerService"),_a2);exports.DocSkeletonManagerService=__decorateClass$3([__decorateParam$3(1,core.Inject(core.LocaleService)),__decorateParam$3(2,core.IUniverInstanceService)],exports.DocSkeletonManagerService);const _DocStateEmitService=class _DocStateEmitService extends core.RxDisposable{constructor(){super();__publicField(this,"_docStateChangeParams$",new rxjs.BehaviorSubject(null));__publicField(this,"docStateChangeParams$",this._docStateChangeParams$.asObservable())}emitStateChangeInfo(params){this._docStateChangeParams$.next(params)}dispose(){super.dispose(),this._docStateChangeParams$.complete()}};__name(_DocStateEmitService,"DocStateEmitService");let DocStateEmitService=_DocStateEmitService;const RichTextEditingMutationId="doc.mutation.rich-text-editing",RichTextEditingMutation={id:RichTextEditingMutationId,type:core.CommandType.MUTATION,handler:__name((accessor,params)=>{var _a6,_b;const{unitId,segmentId="",actions,textRanges,prevTextRanges,trigger,noHistory,isCompositionEnd,noNeedSetTextRange,debounce}=params,univerInstanceService=accessor.get(core.IUniverInstanceService),renderManagerService=accessor.get(engineRender.IRenderManagerService),docStateEmitService=accessor.get(DocStateEmitService),documentDataModel=univerInstanceService.getUniverDocInstance(unitId),documentViewModel=(_a6=renderManagerService.getRenderById(unitId))==null?void 0:_a6.with(exports.DocSkeletonManagerService).getViewModel();if(documentDataModel==null||documentViewModel==null)throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${unitId}`);const docSelectionManagerService=accessor.get(exports.DocSelectionManagerService),docRanges=(_b=docSelectionManagerService.getDocRanges())!=null?_b:[],disabled=!!documentDataModel.getSnapshot().disabled;if(core.JSONX.isNoop(actions)||actions&&actions.length===0||disabled)return{unitId,actions:[],textRanges:docRanges};const undoActions=core.JSONX.invertWithDoc(actions,documentDataModel.getSnapshot());documentDataModel.apply(actions),documentViewModel.reset(documentDataModel),!noNeedSetTextRange&&textRanges&&trigger!=null&&queueMicrotask(()=>{docSelectionManagerService.replaceTextRanges(textRanges,!0,params.options)});const changeState={commandId:RichTextEditingMutationId,unitId,segmentId,trigger,noHistory,debounce,redoState:{actions,textRanges},undoState:{actions:undoActions,textRanges:prevTextRanges!=null?prevTextRanges:docRanges},isCompositionEnd};return docStateEmitService.emitStateChangeInfo(changeState),{unitId,actions:undoActions,textRanges:docRanges}},"handler")},DocsRenameMutation={id:"doc.mutation.rename-doc",type:core.CommandType.MUTATION,handler:__name((accessor,params)=>{const doc=accessor.get(core.IUniverInstanceService).getUnit(params.unitId,core.UniverInstanceType.UNIVER_DOC);return doc?(doc.setName(params.name),!0):!1},"handler")},PLUGIN_CONFIG_KEY="docs.config",defaultPluginConfig={};var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$2(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$2(target,key,result),result},"__decorateClass$2"),__decorateParam$2=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$2"),_a3;let DocCustomRangeController=(_a3=class extends core.Disposable{constructor(_commandService,_textSelectionManagerService,_univerInstanceService){super(),this._commandService=_commandService,this._textSelectionManagerService=_textSelectionManagerService,this._univerInstanceService=_univerInstanceService,this._initSelectionChange()}_transformCustomRange(doc,selection){var _a6;const{startOffset,endOffset,collapsed}=selection,customRanges=(_a6=doc.getCustomRanges())==null?void 0:_a6.filter(range=>!range.wholeEntity||startOffset<=range.startIndex&&endOffset>range.endIndex?!1:collapsed?range.startIndex<startOffset&&range.endIndex>=endOffset:core.BuildTextUtils.range.isIntersects(startOffset,endOffset-1,range.startIndex,range.endIndex));if(customRanges!=null&&customRanges.length){let start=startOffset,end=endOffset;return customRanges.forEach(range=>{start=Math.min(range.startIndex,start),end=Math.max(range.endIndex+1,end)}),{...selection,startOffset:start,endOffset:end,collapsed:start===end}}return selection}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(commandInfo=>{if(commandInfo.id===SetTextSelectionsOperation.id){const params=commandInfo.params,{unitId,ranges,isEditing}=params,doc=this._univerInstanceService.getUnit(unitId);if(!doc)return;const transformedRanges=ranges.map(range=>this._transformCustomRange(doc,range));transformedRanges.some((range,i)=>ranges[i]!==range)&&this._textSelectionManagerService.replaceTextRanges(transformedRanges,isEditing)}}))}},__name(_a3,"DocCustomRangeController"),_a3);DocCustomRangeController=__decorateClass$2([core.OnLifecycle(core.LifecycleStages.Ready,DocCustomRangeController),__decorateParam$2(0,core.ICommandService),__decorateParam$2(1,core.Inject(exports.DocSelectionManagerService)),__decorateParam$2(2,core.IUniverInstanceService)],DocCustomRangeController);var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const PLUGIN_NAME="DOCS_PLUGIN";var _a4;exports.UniverDocsPlugin=(_a4=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest),this._initializeDependencies(_injector),this._initializeCommands()}_initializeCommands(){[RichTextEditingMutation,DocsRenameMutation,SetTextSelectionsOperation].forEach(command=>{this._injector.get(core.ICommandService).registerCommand(command)})}_initializeDependencies(docInjector){[[exports.DocSelectionManagerService],[DocStateEmitService],[DocCustomRangeController]].forEach(d=>docInjector.add(d))}},__name(_a4,"UniverDocsPlugin"),__publicField(_a4,"pluginName",PLUGIN_NAME),_a4);exports.UniverDocsPlugin=__decorateClass$1([__decorateParam$1(1,core.Inject(core.Injector)),__decorateParam$1(2,core.IConfigService)],exports.UniverDocsPlugin);const CUSTOM_RANGE=core.createInterceptorKey("CUSTOM_RANGE"),CUSTOM_DECORATION=core.createInterceptorKey("CUSTOM_DECORATION"),DOC_INTERCEPTOR_POINT={CUSTOM_RANGE,CUSTOM_DECORATION};var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam"),_a5;exports.DocInterceptorService=(_a5=class extends core.Disposable{constructor(_context,_docSkeletonManagerService){super();__publicField(this,"_interceptorsByName",new Map);this._context=_context,this._docSkeletonManagerService=_docSkeletonManagerService;const viewModel=this._docSkeletonManagerService.getViewModel(),unitId=viewModel.getDataModel().getUnitId();if(unitId===core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY||unitId===core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)return;this.disposeWithMe(this.interceptDocumentViewModel(viewModel)),this.disposeWithMe(this.intercept(DOC_INTERCEPTOR_POINT.CUSTOM_RANGE,{priority:-1,handler:__name((data,pos,next)=>next(data),"handler")}));let disposableCollection=new core.DisposableCollection;viewModel.segmentViewModels$.subscribe(segmentViewModels=>{disposableCollection.dispose(),disposableCollection=new core.DisposableCollection,segmentViewModels.forEach(segmentViewModel=>{disposableCollection.add(this.interceptDocumentViewModel(segmentViewModel))})}),this.disposeWithMe(disposableCollection)}intercept(name,interceptor){const key=name;this._interceptorsByName.has(key)||this._interceptorsByName.set(key,[]);const interceptors=this._interceptorsByName.get(key);return interceptors.push(interceptor),this._interceptorsByName.set(key,interceptors.sort((a,b)=>{var _a6,_b;return((_a6=b.priority)!=null?_a6:0)-((_b=a.priority)!=null?_b:0)})),this.disposeWithMe(core.toDisposable(()=>core.remove(this._interceptorsByName.get(key),interceptor)))}fetchThroughInterceptors(name){const key=name,interceptors=this._interceptorsByName.get(key);return core.composeInterceptors(interceptors||[])}interceptDocumentViewModel(viewModel){const disposableCollection=new core.DisposableCollection;return disposableCollection.add(viewModel.registerCustomRangeInterceptor({getCustomRange:__name(index=>{var _a6;return this.fetchThroughInterceptors(DOC_INTERCEPTOR_POINT.CUSTOM_RANGE)(viewModel.getCustomRangeRaw(index),{index,unitId:viewModel.getDataModel().getUnitId(),customRanges:(_a6=viewModel.getDataModel().getCustomRanges())!=null?_a6:[]})},"getCustomRange"),getCustomDecoration:__name(index=>{var _a6;return this.fetchThroughInterceptors(DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION)(viewModel.getCustomDecorationRaw(index),{index,unitId:viewModel.getDataModel().getUnitId(),customDecorations:(_a6=viewModel.getDataModel().getCustomDecorations())!=null?_a6:[]})},"getCustomDecoration")})),disposableCollection}},__name(_a5,"DocInterceptorService"),_a5);exports.DocInterceptorService=__decorateClass([core.OnLifecycle(core.LifecycleStages.Starting,exports.DocInterceptorService),__decorateParam(1,core.Inject(exports.DocSkeletonManagerService))],exports.DocInterceptorService);exports.DOC_INTERCEPTOR_POINT=DOC_INTERCEPTOR_POINT;exports.DocStateEmitService=DocStateEmitService;exports.RichTextEditingMutation=RichTextEditingMutation;exports.SetTextSelectionsOperation=SetTextSelectionsOperation;
|
|
1
|
+
'use strict';const _0x2bfa9a=_0x5297;(function(_0x31a17f,_0x22478d){const _0xcacb41=_0x5297,_0x5255ec=_0x31a17f();while(!![]){try{const _0x2bbc5a=parseInt(_0xcacb41(0x241))/0x1*(parseInt(_0xcacb41(0x20a))/0x2)+-parseInt(_0xcacb41(0x257))/0x3*(parseInt(_0xcacb41(0x1fd))/0x4)+parseInt(_0xcacb41(0x1f2))/0x5*(parseInt(_0xcacb41(0x204))/0x6)+-parseInt(_0xcacb41(0x268))/0x7+parseInt(_0xcacb41(0x227))/0x8+parseInt(_0xcacb41(0x25a))/0x9*(-parseInt(_0xcacb41(0x200))/0xa)+-parseInt(_0xcacb41(0x24b))/0xb*(-parseInt(_0xcacb41(0x250))/0xc);if(_0x2bbc5a===_0x22478d)break;else _0x5255ec['push'](_0x5255ec['shift']());}catch(_0x4ac5f3){_0x5255ec['push'](_0x5255ec['shift']());}}}(_0x59ec,0xe8c14));var __defProp=Object[_0x2bfa9a(0x236)],__defNormalProp=(_0x322d1f,_0x275ee4,_0xaf4268)=>_0x275ee4 in _0x322d1f?__defProp(_0x322d1f,_0x275ee4,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xaf4268}):_0x322d1f[_0x275ee4]=_0xaf4268,__name=(_0xa501f5,_0x4553db)=>__defProp(_0xa501f5,'name',{'value':_0x4553db,'configurable':!0x0}),__publicField=(_0x293659,_0x1c431b,_0x489b98)=>__defNormalProp(_0x293659,typeof _0x1c431b!=_0x2bfa9a(0x21b)?_0x1c431b+'':_0x1c431b,_0x489b98);Object[_0x2bfa9a(0x236)](exports,Symbol['toStringTag'],{'value':_0x2bfa9a(0x1b7)});const core=require(_0x2bfa9a(0x1da)),engineRender=require('@univerjs/engine-render'),rxjs=require(_0x2bfa9a(0x212)),SetTextSelectionsOperation={'id':_0x2bfa9a(0x23d),'type':core[_0x2bfa9a(0x1c8)][_0x2bfa9a(0x239)],'handler':__name((_0x522a19,_0x5ade76)=>!0x0,_0x2bfa9a(0x23e))};var __defProp$4=Object[_0x2bfa9a(0x236)],__getOwnPropDesc$4=Object['getOwnPropertyDescriptor'],__decorateClass$4=__name((_0xd6ba95,_0x27afe9,_0x1b4d29,_0x47a9da)=>{const _0x3c5ef0=_0x2bfa9a;for(var _0x1c62eb=_0x47a9da>0x1?void 0x0:_0x47a9da?__getOwnPropDesc$4(_0x27afe9,_0x1b4d29):_0x27afe9,_0x109e62=_0xd6ba95[_0x3c5ef0(0x24d)]-0x1,_0x144250;_0x109e62>=0x0;_0x109e62--)(_0x144250=_0xd6ba95[_0x109e62])&&(_0x1c62eb=(_0x47a9da?_0x144250(_0x27afe9,_0x1b4d29,_0x1c62eb):_0x144250(_0x1c62eb))||_0x1c62eb);return _0x47a9da&&_0x1c62eb&&__defProp$4(_0x27afe9,_0x1b4d29,_0x1c62eb),_0x1c62eb;},_0x2bfa9a(0x209)),__decorateParam$4=__name((_0x47bffd,_0x5eeac6)=>(_0x15c085,_0x250600)=>_0x5eeac6(_0x15c085,_0x250600,_0x47bffd),_0x2bfa9a(0x21f)),_a;exports[_0x2bfa9a(0x231)]=(_a=class extends core[_0x2bfa9a(0x214)]{constructor(_0x581430,_0x346162){const _0x39744d=_0x2bfa9a;super(),__publicField(this,_0x39744d(0x243),null),__publicField(this,_0x39744d(0x210),new Map()),__publicField(this,_0x39744d(0x1d6),new rxjs[(_0x39744d(0x24f))](null)),__publicField(this,_0x39744d(0x1c5),this[_0x39744d(0x1d6)][_0x39744d(0x242)]()),__publicField(this,'_refreshSelection$',new rxjs[(_0x39744d(0x24f))](null)),__publicField(this,_0x39744d(0x258),this[_0x39744d(0x1fb)][_0x39744d(0x242)]()),(this[_0x39744d(0x25d)]=_0x581430,this[_0x39744d(0x1e7)]=_0x346162,this[_0x39744d(0x1d4)]());}[_0x2bfa9a(0x1d4)](){const _0xdd665b=_0x2bfa9a;this[_0xdd665b(0x1e7)][_0xdd665b(0x25c)](core[_0xdd665b(0x256)][_0xdd665b(0x22b)])[_0xdd665b(0x1ba)](rxjs[_0xdd665b(0x254)](this[_0xdd665b(0x1db)]))[_0xdd665b(0x1cb)](_0x59a70e=>{const _0x448a35=_0xdd665b;if(_0x59a70e==null)return;const _0x583f2c=_0x59a70e[_0x448a35(0x1d3)]();this['_setCurrentSelectionNotRefresh']({'unitId':_0x583f2c,'subUnitId':_0x583f2c});});}[_0x2bfa9a(0x1c0)](){const _0x3f4476=_0x2bfa9a;return this[_0x3f4476(0x243)];}[_0x2bfa9a(0x1d8)](_0x167b58=this[_0x2bfa9a(0x243)]){const _0xefde42=_0x2bfa9a;return this[_0xefde42(0x207)](_0x167b58);}['refreshSelection'](_0x3c5071=this[_0x2bfa9a(0x243)]){_0x3c5071!=null&&this['_refresh'](_0x3c5071);}[_0x2bfa9a(0x253)](_0x8ae013){const _0xdfd936=_0x2bfa9a;this[_0xdfd936(0x243)]=_0x8ae013,this[_0xdfd936(0x262)](_0x8ae013);}[_0x2bfa9a(0x1ca)](_0x523771=this[_0x2bfa9a(0x243)]){const _0x3033da=_0x2bfa9a;var _0x17ac41;return(_0x17ac41=this[_0x3033da(0x207)](_0x523771))==null?void 0x0:_0x17ac41[_0x3033da(0x20e)];}[_0x2bfa9a(0x1fe)](_0x7ed671=this[_0x2bfa9a(0x243)]){const _0x4cc0d1=_0x2bfa9a;var _0x57669e;return(_0x57669e=this[_0x4cc0d1(0x207)](_0x7ed671))==null?void 0x0:_0x57669e[_0x4cc0d1(0x1c3)];}['getDocRanges'](_0xf46417=this[_0x2bfa9a(0x243)]){const _0x3aaf74=_0x2bfa9a;var _0x47b439,_0x22cf61;const _0x38da47=(_0x47b439=this['getTextRanges'](_0xf46417))!=null?_0x47b439:[],_0x8f5788=(_0x22cf61=this[_0x3aaf74(0x1fe)](_0xf46417))!=null?_0x22cf61:[];return[..._0x38da47,..._0x8f5788]['filter'](_0x524ba3=>_0x524ba3['startOffset']!=null&&_0x524ba3[_0x3aaf74(0x1ec)]!=null)[_0x3aaf74(0x213)]((_0x31a650,_0x3e6214)=>_0x31a650['startOffset']>_0x3e6214[_0x3aaf74(0x249)]?0x1:_0x31a650[_0x3aaf74(0x249)]<_0x3e6214[_0x3aaf74(0x249)]?-0x1:0x0);}[_0x2bfa9a(0x266)](){const _0x447905=_0x2bfa9a,_0x159877=this[_0x447905(0x207)](this[_0x447905(0x243)]);if(_0x159877==null)return;const {textRanges:_0x3b13ed}=_0x159877;return _0x3b13ed['find'](_0x1f3e63=>_0x1f3e63[_0x447905(0x1d7)]);}[_0x2bfa9a(0x1e9)](){const _0x1c20e7=_0x2bfa9a,_0x4cab49=this[_0x1c20e7(0x207)](this[_0x1c20e7(0x243)]);if(_0x4cab49==null)return;const {rectRanges:_0x22047f}=_0x4cab49;return _0x22047f[_0x1c20e7(0x235)](_0x4df08d=>_0x4df08d[_0x1c20e7(0x1d7)]);}[_0x2bfa9a(0x1bc)](_0x5f4249,_0x139dde=!0x0){const _0x170b74=_0x2bfa9a;this[_0x170b74(0x243)]!=null&&this[_0x170b74(0x202)]({...this[_0x170b74(0x243)],'textRanges':_0x5f4249,'rectRanges':[],'segmentId':'','segmentPage':-0x1,'isEditing':_0x139dde,'style':engineRender[_0x170b74(0x217)]});}[_0x2bfa9a(0x1f1)](_0x1f5958,_0xd34f87=!0x0,_0x2f5def){const _0x20e6e5=_0x2bfa9a;return this['replaceDocRanges'](_0x1f5958,this[_0x20e6e5(0x243)],_0xd34f87,_0x2f5def);}[_0x2bfa9a(0x22f)](_0x15fe29,_0x2c1496=this[_0x2bfa9a(0x243)],_0x592bea=!0x0,_0x13647b){const _0x550fc8=_0x2bfa9a;if(_0x2c1496==null)return;const {unitId:_0x53b404,subUnitId:_0x228c8a}=_0x2c1496;this[_0x550fc8(0x1fb)][_0x550fc8(0x22c)]({'unitId':_0x53b404,'subUnitId':_0x228c8a,'docRanges':_0x15fe29,'isEditing':_0x592bea,'options':_0x13647b});}[_0x2bfa9a(0x20c)](_0x2c7c01){const _0x5d47ee=_0x2bfa9a;if(this[_0x5d47ee(0x243)]==null)return;const _0x3e060e={...this[_0x5d47ee(0x243)],..._0x2c7c01};this[_0x5d47ee(0x1ee)](_0x3e060e),this[_0x5d47ee(0x1d6)][_0x5d47ee(0x22c)](_0x3e060e);const {unitId:_0x2ccfea,subUnitId:_0x223298,segmentId:_0x3e17ef,style:_0x4f5b66,textRanges:_0x4c40dc,rectRanges:_0x2d30fa,isEditing:_0x37f233}=_0x3e060e,_0x3ec167=[..._0x4c40dc,..._0x2d30fa][_0x5d47ee(0x1e1)](_0x2fa9f5=>_0x2fa9f5[_0x5d47ee(0x249)]!=null&&_0x2fa9f5[_0x5d47ee(0x1ec)]!=null)[_0x5d47ee(0x213)]((_0x608fe1,_0x1e26d4)=>_0x608fe1[_0x5d47ee(0x249)]>_0x1e26d4[_0x5d47ee(0x249)]?0x1:_0x608fe1[_0x5d47ee(0x249)]<_0x1e26d4[_0x5d47ee(0x249)]?-0x1:0x0);this[_0x5d47ee(0x25d)]['executeCommand'](SetTextSelectionsOperation['id'],{'unitId':_0x2ccfea,'subUnitId':_0x223298,'segmentId':_0x3e17ef,'style':_0x4f5b66,'isEditing':_0x37f233,'ranges':_0x3ec167});}['dispose'](){const _0x29e9aa=_0x2bfa9a;this[_0x29e9aa(0x1d6)][_0x29e9aa(0x1c6)]();}[_0x2bfa9a(0x264)](_0x478bd6){const _0x3420ec=_0x2bfa9a;this[_0x3420ec(0x243)]=_0x478bd6;}[_0x2bfa9a(0x207)](_0x2cff11){const _0x46a462=_0x2bfa9a;var _0x41978f;if(_0x2cff11==null)return;const {unitId:_0x389bb7,subUnitId:subUnitId=''}=_0x2cff11;return(_0x41978f=this[_0x46a462(0x210)][_0x46a462(0x1d1)](_0x389bb7))==null?void 0x0:_0x41978f[_0x46a462(0x1d1)](subUnitId);}['_refresh'](_0x3a7a6d){const _0x1edb10=_0x2bfa9a,_0xd7865e=this[_0x1edb10(0x207)](_0x3a7a6d);if(_0xd7865e==null)return;const {textRanges:_0x31a4d5,rectRanges:_0x9c4f75}=_0xd7865e,_0xb76594=[..._0x31a4d5,..._0x9c4f75],{unitId:_0x2cd018,subUnitId:_0x515b45}=_0x3a7a6d;this['_refreshSelection$'][_0x1edb10(0x22c)]({'unitId':_0x2cd018,'subUnitId':_0x515b45,'docRanges':_0xb76594,'isEditing':!0x1});}[_0x2bfa9a(0x1ee)](_0x1c81bb){const _0x9d60a7=_0x2bfa9a,{unitId:_0x11855d,subUnitId:_0xdb252a,..._0x31d0b0}=_0x1c81bb;this['_textSelectionInfo'][_0x9d60a7(0x1ce)](_0x11855d)||this['_textSelectionInfo'][_0x9d60a7(0x234)](_0x11855d,new Map()),this['_textSelectionInfo'][_0x9d60a7(0x1d1)](_0x11855d)['set'](_0xdb252a,{..._0x31d0b0});}[_0x2bfa9a(0x202)](_0x3475eb){const _0x3f793f=_0x2bfa9a,{unitId:_0xdba89e,subUnitId:_0xe5fea9,..._0x594aea}=_0x3475eb;this[_0x3f793f(0x210)][_0x3f793f(0x1ce)](_0xdba89e)||this[_0x3f793f(0x210)][_0x3f793f(0x234)](_0xdba89e,new Map());const _0x49a951=this['_textSelectionInfo']['get'](_0xdba89e);_0x49a951['has'](_0xe5fea9)?_0x49a951[_0x3f793f(0x1d1)](_0xe5fea9)[_0x3f793f(0x20e)]['push'](..._0x3475eb[_0x3f793f(0x20e)]):_0x49a951[_0x3f793f(0x234)](_0xe5fea9,{..._0x594aea});}},__name(_a,'DocSelectionManagerService'),_a),exports['DocSelectionManagerService']=__decorateClass$4([__decorateParam$4(0x0,core[_0x2bfa9a(0x23c)]),__decorateParam$4(0x1,core[_0x2bfa9a(0x225)])],exports[_0x2bfa9a(0x231)]);var __defProp$3=Object['defineProperty'],__getOwnPropDesc$3=Object['getOwnPropertyDescriptor'],__decorateClass$3=__name((_0x638ec9,_0x19ce9f,_0x1c7005,_0x5869e1)=>{const _0x4dad15=_0x2bfa9a;for(var _0x561e46=_0x5869e1>0x1?void 0x0:_0x5869e1?__getOwnPropDesc$3(_0x19ce9f,_0x1c7005):_0x19ce9f,_0x2d8c69=_0x638ec9[_0x4dad15(0x24d)]-0x1,_0x5c1c67;_0x2d8c69>=0x0;_0x2d8c69--)(_0x5c1c67=_0x638ec9[_0x2d8c69])&&(_0x561e46=(_0x5869e1?_0x5c1c67(_0x19ce9f,_0x1c7005,_0x561e46):_0x5c1c67(_0x561e46))||_0x561e46);return _0x5869e1&&_0x561e46&&__defProp$3(_0x19ce9f,_0x1c7005,_0x561e46),_0x561e46;},_0x2bfa9a(0x226)),__decorateParam$3=__name((_0x424618,_0x6e0cf)=>(_0x58f92a,_0x554839)=>_0x6e0cf(_0x58f92a,_0x554839,_0x424618),_0x2bfa9a(0x25b)),_a2;exports['DocSkeletonManagerService']=(_a2=class extends core[_0x2bfa9a(0x214)]{constructor(_0x391846,_0x338899,_0x231e08){const _0x4271f8=_0x2bfa9a;super(),__publicField(this,_0x4271f8(0x1e4)),__publicField(this,_0x4271f8(0x261)),__publicField(this,_0x4271f8(0x1cd),new rxjs[(_0x4271f8(0x24f))](null)),__publicField(this,_0x4271f8(0x20d),this[_0x4271f8(0x1cd)][_0x4271f8(0x242)]()),__publicField(this,_0x4271f8(0x220),new rxjs[(_0x4271f8(0x24f))](null)),__publicField(this,_0x4271f8(0x252),this[_0x4271f8(0x220)]['asObservable']()),__publicField(this,_0x4271f8(0x1ff),new rxjs[(_0x4271f8(0x24f))](null)),__publicField(this,_0x4271f8(0x24e),this[_0x4271f8(0x1ff)]['asObservable']()),(this[_0x4271f8(0x263)]=_0x391846,this[_0x4271f8(0x259)]=_0x338899,this[_0x4271f8(0x1e7)]=_0x231e08,this[_0x4271f8(0x1ea)](),this[_0x4271f8(0x1e7)][_0x4271f8(0x25c)](core[_0x4271f8(0x256)][_0x4271f8(0x22b)])[_0x4271f8(0x1ba)](rxjs['takeUntil'](this[_0x4271f8(0x1db)]))[_0x4271f8(0x1cb)](_0x28a95f=>{const _0x356b16=_0x4271f8;_0x28a95f&&_0x28a95f[_0x356b16(0x1d3)]()===this[_0x356b16(0x263)][_0x356b16(0x20b)]&&this[_0x356b16(0x1f3)](_0x28a95f);}));}[_0x2bfa9a(0x248)](){const _0x5cf5bf=_0x2bfa9a;super['dispose'](),this[_0x5cf5bf(0x220)]['complete'](),this[_0x5cf5bf(0x1cd)]['complete']();}[_0x2bfa9a(0x22d)](){const _0x239e5b=_0x2bfa9a;return this[_0x239e5b(0x1e4)];}[_0x2bfa9a(0x23a)](){const _0x2e250e=_0x2bfa9a;return this[_0x2e250e(0x261)];}[_0x2bfa9a(0x1ea)](){const _0x1a6200=_0x2bfa9a,_0x1c8b4f=this[_0x1a6200(0x263)][_0x1a6200(0x21a)];this[_0x1a6200(0x1f3)](_0x1c8b4f);}[_0x2bfa9a(0x1f3)](_0x2ff912){const _0x3102fd=_0x2bfa9a,_0x482e81=this[_0x3102fd(0x263)][_0x3102fd(0x20b)];if(_0x2ff912[_0x3102fd(0x24c)]()==null)return;this['_docViewModel']&&core['isInternalEditorID'](_0x482e81)?(this[_0x3102fd(0x261)][_0x3102fd(0x229)](_0x2ff912),this[_0x3102fd(0x263)][_0x3102fd(0x21a)]=_0x2ff912):this['_docViewModel']||(this[_0x3102fd(0x261)]=this[_0x3102fd(0x265)](_0x2ff912)),this[_0x3102fd(0x1e4)]||(this[_0x3102fd(0x1e4)]=this[_0x3102fd(0x1fa)](this[_0x3102fd(0x261)]));const _0x3c3e41=this['_skeleton'];_0x3c3e41[_0x3102fd(0x1d2)](),this['_currentSkeletonBefore$']['next'](_0x3c3e41),this[_0x3102fd(0x1cd)]['next'](_0x3c3e41),this[_0x3102fd(0x1ff)][_0x3102fd(0x22c)](this[_0x3102fd(0x261)]);}[_0x2bfa9a(0x1fa)](_0x133ecb){const _0x44d0b8=_0x2bfa9a;return engineRender[_0x44d0b8(0x1f4)][_0x44d0b8(0x1f6)](_0x133ecb,this[_0x44d0b8(0x259)]);}['_buildDocViewModel'](_0x50c5a8){const _0x1842bb=_0x2bfa9a;return new engineRender[(_0x1842bb(0x1fc))](_0x50c5a8);}},__name(_a2,_0x2bfa9a(0x1d0)),_a2),exports[_0x2bfa9a(0x1d0)]=__decorateClass$3([__decorateParam$3(0x1,core['Inject'](core[_0x2bfa9a(0x25e)])),__decorateParam$3(0x2,core[_0x2bfa9a(0x225)])],exports[_0x2bfa9a(0x1d0)]);const _DocStateEmitService=class _DocStateEmitService extends core[_0x2bfa9a(0x214)]{constructor(){const _0x5e32c0=_0x2bfa9a;super(),__publicField(this,'_docStateChangeParams$',new rxjs[(_0x5e32c0(0x24f))](null)),__publicField(this,_0x5e32c0(0x233),this['_docStateChangeParams$']['asObservable']());}['emitStateChangeInfo'](_0x352cc4){const _0x5687e4=_0x2bfa9a;this[_0x5687e4(0x269)][_0x5687e4(0x22c)](_0x352cc4);}[_0x2bfa9a(0x248)](){const _0x13ecee=_0x2bfa9a;super[_0x13ecee(0x248)](),this[_0x13ecee(0x269)][_0x13ecee(0x1c6)]();}};__name(_DocStateEmitService,_0x2bfa9a(0x260));let DocStateEmitService=_DocStateEmitService;const RichTextEditingMutationId=_0x2bfa9a(0x230),RichTextEditingMutation={'id':RichTextEditingMutationId,'type':core[_0x2bfa9a(0x1c8)][_0x2bfa9a(0x24a)],'handler':__name((_0x431064,_0x44f47c)=>{const _0x20e28b=_0x2bfa9a;var _0x24bf57,_0x371335;const {unitId:_0x5c0742,segmentId:segmentId='',actions:_0x451321,textRanges:_0x5c4b10,prevTextRanges:_0x407015,trigger:_0x5c59f0,noHistory:_0x203703,isCompositionEnd:_0x3ded69,noNeedSetTextRange:_0xab1fc1,debounce:_0x4b22a7}=_0x44f47c,_0x203dd0=_0x431064['get'](core[_0x20e28b(0x225)]),_0xfd81fc=_0x431064[_0x20e28b(0x1d1)](engineRender[_0x20e28b(0x1bb)]),_0x4feb7f=_0x431064[_0x20e28b(0x1d1)](DocStateEmitService),_0x3c4e26=_0x203dd0['getUniverDocInstance'](_0x5c0742),_0x59513c=(_0x24bf57=_0xfd81fc['getRenderById'](_0x5c0742))==null?void 0x0:_0x24bf57['with'](exports['DocSkeletonManagerService'])['getViewModel']();if(_0x3c4e26==null||_0x59513c==null)throw new Error(_0x20e28b(0x246)+_0x5c0742);const _0x2c7ef7=_0x431064['get'](exports[_0x20e28b(0x231)]),_0x276f68=(_0x371335=_0x2c7ef7[_0x20e28b(0x1e3)]())!=null?_0x371335:[],_0xdde2e2=!!_0x3c4e26[_0x20e28b(0x244)]()[_0x20e28b(0x1b9)];if(core['JSONX']['isNoop'](_0x451321)||_0x451321&&_0x451321['length']===0x0||_0xdde2e2)return{'unitId':_0x5c0742,'actions':[],'textRanges':_0x276f68};const _0x289767=core[_0x20e28b(0x1bf)][_0x20e28b(0x1e8)](_0x451321,_0x3c4e26['getSnapshot']());_0x3c4e26[_0x20e28b(0x20f)](_0x451321),_0x59513c[_0x20e28b(0x229)](_0x3c4e26),!_0xab1fc1&&_0x5c4b10&&_0x5c59f0!=null&&queueMicrotask(()=>{_0x2c7ef7['replaceTextRanges'](_0x5c4b10,!0x0,_0x44f47c['options']);});const _0x1e1f24={'commandId':RichTextEditingMutationId,'unitId':_0x5c0742,'segmentId':segmentId,'trigger':_0x5c59f0,'noHistory':_0x203703,'debounce':_0x4b22a7,'redoState':{'actions':_0x451321,'textRanges':_0x5c4b10},'undoState':{'actions':_0x289767,'textRanges':_0x407015!=null?_0x407015:_0x276f68},'isCompositionEnd':_0x3ded69};return _0x4feb7f[_0x20e28b(0x215)](_0x1e1f24),{'unitId':_0x5c0742,'actions':_0x289767,'textRanges':_0x276f68};},_0x2bfa9a(0x23e))},DocsRenameMutation={'id':_0x2bfa9a(0x237),'type':core[_0x2bfa9a(0x1c8)][_0x2bfa9a(0x24a)],'handler':__name((_0x2fa33b,_0x56c1e1)=>{const _0x5526a1=_0x2bfa9a,_0x2b1aa4=_0x2fa33b[_0x5526a1(0x1d1)](core[_0x5526a1(0x225)])[_0x5526a1(0x1f0)](_0x56c1e1['unitId'],core[_0x5526a1(0x256)][_0x5526a1(0x22b)]);return _0x2b1aa4?(_0x2b1aa4['setName'](_0x56c1e1['name']),!0x0):!0x1;},_0x2bfa9a(0x23e))},PLUGIN_CONFIG_KEY=_0x2bfa9a(0x1d9),defaultPluginConfig={};var __defProp$2=Object[_0x2bfa9a(0x236)],__getOwnPropDesc$2=Object[_0x2bfa9a(0x245)],__decorateClass$2=__name((_0x54ef25,_0x457d36,_0x1faf61,_0x2e9b6f)=>{const _0x5e45e3=_0x2bfa9a;for(var _0x2c62ae=_0x2e9b6f>0x1?void 0x0:_0x2e9b6f?__getOwnPropDesc$2(_0x457d36,_0x1faf61):_0x457d36,_0x5e8744=_0x54ef25[_0x5e45e3(0x24d)]-0x1,_0xe5756c;_0x5e8744>=0x0;_0x5e8744--)(_0xe5756c=_0x54ef25[_0x5e8744])&&(_0x2c62ae=(_0x2e9b6f?_0xe5756c(_0x457d36,_0x1faf61,_0x2c62ae):_0xe5756c(_0x2c62ae))||_0x2c62ae);return _0x2e9b6f&&_0x2c62ae&&__defProp$2(_0x457d36,_0x1faf61,_0x2c62ae),_0x2c62ae;},_0x2bfa9a(0x1f7)),__decorateParam$2=__name((_0x4a1547,_0x5641db)=>(_0x29edc9,_0x54f255)=>_0x5641db(_0x29edc9,_0x54f255,_0x4a1547),_0x2bfa9a(0x1f5)),_a3;let DocCustomRangeController=(_a3=class extends core[_0x2bfa9a(0x25f)]{constructor(_0x172f40,_0x13d67a,_0x20057a){const _0x19a018=_0x2bfa9a;super(),this['_commandService']=_0x172f40,this['_textSelectionManagerService']=_0x13d67a,this['_univerInstanceService']=_0x20057a,this[_0x19a018(0x238)]();}[_0x2bfa9a(0x1b8)](_0x577fa5,_0x192abf){const _0x4da7ae=_0x2bfa9a;var _0x55460c;const {startOffset:_0x56f7c6,endOffset:_0x37d741,collapsed:_0x4d8cd1}=_0x192abf,_0x48f768=(_0x55460c=_0x577fa5['getCustomRanges']())==null?void 0x0:_0x55460c[_0x4da7ae(0x1e1)](_0x191bbb=>!_0x191bbb[_0x4da7ae(0x208)]||_0x56f7c6<=_0x191bbb[_0x4da7ae(0x21d)]&&_0x37d741>_0x191bbb[_0x4da7ae(0x1cc)]?!0x1:_0x4d8cd1?_0x191bbb[_0x4da7ae(0x21d)]<_0x56f7c6&&_0x191bbb[_0x4da7ae(0x1cc)]>=_0x37d741:core['BuildTextUtils'][_0x4da7ae(0x1e0)]['isIntersects'](_0x56f7c6,_0x37d741-0x1,_0x191bbb[_0x4da7ae(0x21d)],_0x191bbb['endIndex']));if(_0x48f768!=null&&_0x48f768['length']){let _0x2018fb=_0x56f7c6,_0x22a4d5=_0x37d741;return _0x48f768['forEach'](_0x12662d=>{const _0x44403c=_0x4da7ae;_0x2018fb=Math[_0x44403c(0x22e)](_0x12662d[_0x44403c(0x21d)],_0x2018fb),_0x22a4d5=Math['max'](_0x12662d[_0x44403c(0x1cc)]+0x1,_0x22a4d5);}),{..._0x192abf,'startOffset':_0x2018fb,'endOffset':_0x22a4d5,'collapsed':_0x2018fb===_0x22a4d5};}return _0x192abf;}['_initSelectionChange'](){const _0x22759e=_0x2bfa9a;this['disposeWithMe'](this['_commandService'][_0x22759e(0x1c2)](_0x59bd16=>{const _0xe3a4ac=_0x22759e;if(_0x59bd16['id']===SetTextSelectionsOperation['id']){const _0x3ba290=_0x59bd16[_0xe3a4ac(0x1ed)],{unitId:_0xa59214,ranges:_0x2c9195,isEditing:_0x3ec296}=_0x3ba290,_0x302468=this[_0xe3a4ac(0x1e7)][_0xe3a4ac(0x1f0)](_0xa59214);if(!_0x302468)return;const _0x2bb2b7=_0x2c9195[_0xe3a4ac(0x23f)](_0x19cc3f=>this['_transformCustomRange'](_0x302468,_0x19cc3f));_0x2bb2b7[_0xe3a4ac(0x206)]((_0x4afa58,_0x26ee8e)=>_0x2c9195[_0x26ee8e]!==_0x4afa58)&&this[_0xe3a4ac(0x1e6)][_0xe3a4ac(0x1f1)](_0x2bb2b7,_0x3ec296);}}));}},__name(_a3,'DocCustomRangeController'),_a3);DocCustomRangeController=__decorateClass$2([__decorateParam$2(0x0,core[_0x2bfa9a(0x23c)]),__decorateParam$2(0x1,core[_0x2bfa9a(0x1c4)](exports['DocSelectionManagerService'])),__decorateParam$2(0x2,core['IUniverInstanceService'])],DocCustomRangeController);var __defProp$1=Object[_0x2bfa9a(0x236)],__getOwnPropDesc$1=Object[_0x2bfa9a(0x245)],__decorateClass$1=__name((_0x21da4f,_0x12ee8c,_0xa4303b,_0x3b8b3d)=>{const _0x61b22b=_0x2bfa9a;for(var _0x590a6a=_0x3b8b3d>0x1?void 0x0:_0x3b8b3d?__getOwnPropDesc$1(_0x12ee8c,_0xa4303b):_0x12ee8c,_0xfa8c9e=_0x21da4f[_0x61b22b(0x24d)]-0x1,_0x53b074;_0xfa8c9e>=0x0;_0xfa8c9e--)(_0x53b074=_0x21da4f[_0xfa8c9e])&&(_0x590a6a=(_0x3b8b3d?_0x53b074(_0x12ee8c,_0xa4303b,_0x590a6a):_0x53b074(_0x590a6a))||_0x590a6a);return _0x3b8b3d&&_0x590a6a&&__defProp$1(_0x12ee8c,_0xa4303b,_0x590a6a),_0x590a6a;},_0x2bfa9a(0x21c)),__decorateParam$1=__name((_0x4b1e90,_0x36f66b)=>(_0x4ed96d,_0xf20166)=>_0x36f66b(_0x4ed96d,_0xf20166,_0x4b1e90),_0x2bfa9a(0x1e2));function _0x59ec(){const _0x945c73=['_docStateChangeParams$','Module','_transformCustomRange','disabled','pipe','IRenderManagerService','__TEST_ONLY_add','CUSTOM_RANGE','getCustomDecorations','JSONX','__getCurrentSelection','SetTextSelectionsOperation','onCommandExecuted','rectRanges','Inject','textSelection$','complete','getDataModel','CommandType','intercept','getTextRanges','subscribe','endIndex','_currentSkeleton$','has','_injector','DocSkeletonManagerService','get','calculate','getUnitId','_listenCurrentUnit','_initializeDependencies','_textSelection$','isActive','getSelectionInfo','docs.config','@univerjs/core','dispose$','composeInterceptors','IConfigService','DisposableCollection','_config','range','filter','__decorateParam$1','getDocRanges','_skeleton','__decorateParam','_textSelectionManagerService','_univerInstanceService','invertWithDoc','getActiveRectRange','_init','getCustomRange','endOffset','params','_replaceByParam','add','getUnit','replaceTextRanges','35DBsLxx','_update','DocumentSkeleton','__decorateParam$2','create','__decorateClass$2','pluginName','forEach','_buildSkeleton','_refreshSelection$','DocumentViewModel','4DOWxsB','getRectRanges','_currentViewModel$','160uOqowP','push','_addByParam','onStarting','188766ZhZxpK','getCustomDecorationRaw','some','_getTextRanges','wholeEntity','__decorateClass$4','72jGvoSK','unitId','__replaceTextRangesWithNoRefresh','currentSkeleton$','textRanges','apply','_textSelectionInfo','_docSkeletonManagerService','rxjs','sort','RxDisposable','emitStateChangeInfo','DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY','NORMAL_TEXT_SELECTION_PLUGIN_STYLE','UniverDocsPlugin','CUSTOM_DECORATION','unit','symbol','__decorateClass$1','startIndex','setConfig','__decorateParam$4','_currentSkeletonBefore$','remove','DOC_INTERCEPTOR_POINT','_interceptorsByName','getCustomDecoration','IUniverInstanceService','__decorateClass$3','10475624hiFHPL','toDisposable','reset','registerCustomRangeInterceptor','UNIVER_DOC','next','getSkeleton','min','replaceDocRanges','doc.mutation.rich-text-editing','DocSelectionManagerService','interceptDocumentViewModel','docStateChangeParams$','set','find','defineProperty','doc.mutation.rename-doc','_initSelectionChange','OPERATION','getViewModel','disposeWithMe','ICommandService','doc.operation.set-selections','handler','map','DocInterceptorService','23794LISbRV','asObservable','_currentSelection','getSnapshot','getOwnPropertyDescriptor','DocumentDataModel\x20or\x20documentViewModel\x20not\x20found\x20for\x20unitId:\x20','createInterceptorKey','dispose','startOffset','MUTATION','1881zTMcjr','getBody','length','currentViewModel$','BehaviorSubject','138804bGYPnK','fetchThroughInterceptors','currentSkeletonBefore$','__TEST_ONLY_setCurrentSelection','takeUntil','_configService','UniverInstanceType','3436515Zrhztg','refreshSelection$','_localeService','835722cPLvBU','__decorateParam$3','getCurrentTypeOfUnit$','_commandService','LocaleService','Disposable','DocStateEmitService','_docViewModel','_refresh','_context','_setCurrentSelectionNotRefresh','_buildDocViewModel','getActiveTextRange','__decorateClass','5457368bHzHQs'];_0x59ec=function(){return _0x945c73;};return _0x59ec();}const PLUGIN_NAME='DOCS_PLUGIN';var _a4;exports[_0x2bfa9a(0x218)]=(_a4=class extends core['Plugin']{constructor(_0x5a02b3=defaultPluginConfig,_0x11be40,_0x500371){const _0x16bec7=_0x2bfa9a;super(),this[_0x16bec7(0x1df)]=_0x5a02b3,this[_0x16bec7(0x1cf)]=_0x11be40,this[_0x16bec7(0x255)]=_0x500371;const {..._0x42dfe5}=this[_0x16bec7(0x1df)];this['_configService'][_0x16bec7(0x21e)](PLUGIN_CONFIG_KEY,_0x42dfe5);}[_0x2bfa9a(0x203)](){this['_initializeDependencies'](),this['_initializeCommands']();}['_initializeCommands'](){const _0x84a48=_0x2bfa9a;[RichTextEditingMutation,DocsRenameMutation,SetTextSelectionsOperation][_0x84a48(0x1f9)](_0x8086ed=>{const _0x1b07c2=_0x84a48;this['_injector']['get'](core[_0x1b07c2(0x23c)])['registerCommand'](_0x8086ed);});}[_0x2bfa9a(0x1d5)](){const _0x543aaa=_0x2bfa9a;[[exports[_0x543aaa(0x231)]],[DocStateEmitService],[DocCustomRangeController]]['forEach'](_0x24d23a=>this[_0x543aaa(0x1cf)][_0x543aaa(0x1ef)](_0x24d23a));}['onReady'](){const _0x45d402=_0x2bfa9a;this[_0x45d402(0x1cf)][_0x45d402(0x1d1)](DocCustomRangeController);}},__name(_a4,_0x2bfa9a(0x218)),__publicField(_a4,_0x2bfa9a(0x1f8),PLUGIN_NAME),_a4),exports[_0x2bfa9a(0x218)]=__decorateClass$1([__decorateParam$1(0x1,core['Inject'](core['Injector'])),__decorateParam$1(0x2,core[_0x2bfa9a(0x1dd)])],exports[_0x2bfa9a(0x218)]);const CUSTOM_RANGE=core[_0x2bfa9a(0x247)](_0x2bfa9a(0x1bd)),CUSTOM_DECORATION=core[_0x2bfa9a(0x247)](_0x2bfa9a(0x219)),DOC_INTERCEPTOR_POINT={'CUSTOM_RANGE':CUSTOM_RANGE,'CUSTOM_DECORATION':CUSTOM_DECORATION};var __defProp2=Object['defineProperty'],__getOwnPropDesc=Object[_0x2bfa9a(0x245)],__decorateClass=__name((_0x2cd519,_0x5d9eb3,_0x4688ce,_0x5dd1f1)=>{const _0x10f6ab=_0x2bfa9a;for(var _0x3b90dc=_0x5dd1f1>0x1?void 0x0:_0x5dd1f1?__getOwnPropDesc(_0x5d9eb3,_0x4688ce):_0x5d9eb3,_0x276fcc=_0x2cd519[_0x10f6ab(0x24d)]-0x1,_0x2c3575;_0x276fcc>=0x0;_0x276fcc--)(_0x2c3575=_0x2cd519[_0x276fcc])&&(_0x3b90dc=(_0x5dd1f1?_0x2c3575(_0x5d9eb3,_0x4688ce,_0x3b90dc):_0x2c3575(_0x3b90dc))||_0x3b90dc);return _0x5dd1f1&&_0x3b90dc&&__defProp2(_0x5d9eb3,_0x4688ce,_0x3b90dc),_0x3b90dc;},_0x2bfa9a(0x267)),__decorateParam=__name((_0x238cd9,_0x2ef8e7)=>(_0x2fbbd6,_0x5af57c)=>_0x2ef8e7(_0x2fbbd6,_0x5af57c,_0x238cd9),_0x2bfa9a(0x1e5)),_a5;function _0x5297(_0x1a0186,_0xd80c3d){const _0x59ec4a=_0x59ec();return _0x5297=function(_0x529794,_0x74c380){_0x529794=_0x529794-0x1b7;let _0x10707a=_0x59ec4a[_0x529794];return _0x10707a;},_0x5297(_0x1a0186,_0xd80c3d);}exports[_0x2bfa9a(0x240)]=(_a5=class extends core[_0x2bfa9a(0x25f)]{constructor(_0x341cc7,_0x3f7f61){const _0x46f421=_0x2bfa9a;super(),__publicField(this,'_interceptorsByName',new Map()),(this['_context']=_0x341cc7,this[_0x46f421(0x211)]=_0x3f7f61);const _0x4b1079=this[_0x46f421(0x211)][_0x46f421(0x23a)](),_0x4ff87a=_0x4b1079[_0x46f421(0x1c7)]()[_0x46f421(0x1d3)]();if(_0x4ff87a===core['DOCS_NORMAL_EDITOR_UNIT_ID_KEY']||_0x4ff87a===core[_0x46f421(0x216)])return;this[_0x46f421(0x23b)](this[_0x46f421(0x232)](_0x4b1079)),this[_0x46f421(0x23b)](this['intercept'](DOC_INTERCEPTOR_POINT['CUSTOM_RANGE'],{'priority':-0x1,'handler':__name((_0x2b9be8,_0x4d6755,_0x2adb38)=>_0x2adb38(_0x2b9be8),'handler')}));let _0x30bfaf=new core[(_0x46f421(0x1de))]();_0x4b1079['segmentViewModels$'][_0x46f421(0x1cb)](_0xe3c7d0=>{const _0xf54a88=_0x46f421;_0x30bfaf[_0xf54a88(0x248)](),_0x30bfaf=new core[(_0xf54a88(0x1de))](),_0xe3c7d0[_0xf54a88(0x1f9)](_0xa0d853=>{const _0x3d5a95=_0xf54a88;_0x30bfaf[_0x3d5a95(0x1ef)](this[_0x3d5a95(0x232)](_0xa0d853));});}),this[_0x46f421(0x23b)](_0x30bfaf);}[_0x2bfa9a(0x1c9)](_0x2dd8b1,_0x1b4b7f){const _0x14cdd1=_0x2bfa9a,_0xdf1d62=_0x2dd8b1;this[_0x14cdd1(0x223)][_0x14cdd1(0x1ce)](_0xdf1d62)||this[_0x14cdd1(0x223)][_0x14cdd1(0x234)](_0xdf1d62,[]);const _0x44aedb=this[_0x14cdd1(0x223)]['get'](_0xdf1d62);return _0x44aedb[_0x14cdd1(0x201)](_0x1b4b7f),this[_0x14cdd1(0x223)][_0x14cdd1(0x234)](_0xdf1d62,_0x44aedb[_0x14cdd1(0x213)]((_0x144172,_0x540652)=>{var _0x1e2e80,_0x1ce601;return((_0x1e2e80=_0x540652['priority'])!=null?_0x1e2e80:0x0)-((_0x1ce601=_0x144172['priority'])!=null?_0x1ce601:0x0);})),this['disposeWithMe'](core[_0x14cdd1(0x228)](()=>core[_0x14cdd1(0x221)](this['_interceptorsByName'][_0x14cdd1(0x1d1)](_0xdf1d62),_0x1b4b7f)));}[_0x2bfa9a(0x251)](_0x174fee){const _0x19413f=_0x2bfa9a,_0x4ce13d=_0x174fee,_0x4cb89e=this['_interceptorsByName'][_0x19413f(0x1d1)](_0x4ce13d);return core[_0x19413f(0x1dc)](_0x4cb89e||[]);}[_0x2bfa9a(0x232)](_0x3efa6c){const _0x1b0574=_0x2bfa9a,_0x1b340d=new core[(_0x1b0574(0x1de))]();return _0x1b340d[_0x1b0574(0x1ef)](_0x3efa6c[_0x1b0574(0x22a)]({'getCustomRange':__name(_0x2cde1a=>{const _0x2ddeaa=_0x1b0574;var _0x5c8320;return this[_0x2ddeaa(0x251)](DOC_INTERCEPTOR_POINT[_0x2ddeaa(0x1bd)])(_0x3efa6c['getCustomRangeRaw'](_0x2cde1a),{'index':_0x2cde1a,'unitId':_0x3efa6c['getDataModel']()['getUnitId'](),'customRanges':(_0x5c8320=_0x3efa6c[_0x2ddeaa(0x1c7)]()['getCustomRanges']())!=null?_0x5c8320:[]});},_0x1b0574(0x1eb)),'getCustomDecoration':__name(_0x432384=>{const _0x51ed53=_0x1b0574;var _0x2de288;return this[_0x51ed53(0x251)](DOC_INTERCEPTOR_POINT[_0x51ed53(0x219)])(_0x3efa6c[_0x51ed53(0x205)](_0x432384),{'index':_0x432384,'unitId':_0x3efa6c[_0x51ed53(0x1c7)]()[_0x51ed53(0x1d3)](),'customDecorations':(_0x2de288=_0x3efa6c[_0x51ed53(0x1c7)]()[_0x51ed53(0x1be)]())!=null?_0x2de288:[]});},_0x1b0574(0x224))})),_0x1b340d;}},__name(_a5,'DocInterceptorService'),_a5),exports[_0x2bfa9a(0x240)]=__decorateClass([__decorateParam(0x1,core[_0x2bfa9a(0x1c4)](exports['DocSkeletonManagerService']))],exports[_0x2bfa9a(0x240)]),exports[_0x2bfa9a(0x222)]=DOC_INTERCEPTOR_POINT,exports[_0x2bfa9a(0x260)]=DocStateEmitService,exports['RichTextEditingMutation']=RichTextEditingMutation,exports[_0x2bfa9a(0x1c1)]=SetTextSelectionsOperation;
|
package/lib/es/index.js
CHANGED
|
@@ -1,474 +1 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
-
import { CommandType, RxDisposable, UniverInstanceType, ICommandService, IUniverInstanceService, Inject, LocaleService, isInternalEditorID, JSONX, OnLifecycle, LifecycleStages, Disposable, BuildTextUtils, Injector, Plugin, IConfigService, createInterceptorKey, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DisposableCollection, toDisposable, remove, composeInterceptors } from "@univerjs/core";
|
|
6
|
-
import { NORMAL_TEXT_SELECTION_PLUGIN_STYLE, DocumentSkeleton, DocumentViewModel, IRenderManagerService } from "@univerjs/engine-render";
|
|
7
|
-
import { BehaviorSubject, takeUntil } from "rxjs";
|
|
8
|
-
const SetTextSelectionsOperation = {
|
|
9
|
-
id: "doc.operation.set-selections",
|
|
10
|
-
type: CommandType.OPERATION,
|
|
11
|
-
handler: /* @__PURE__ */ __name((_, __) => !0, "handler")
|
|
12
|
-
};
|
|
13
|
-
var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
14
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
15
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
16
|
-
return kind && result && __defProp$4(target, key, result), result;
|
|
17
|
-
}, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$4"), _a;
|
|
18
|
-
let DocSelectionManagerService = (_a = class extends RxDisposable {
|
|
19
|
-
constructor(_commandService, _univerInstanceService) {
|
|
20
|
-
super();
|
|
21
|
-
__publicField(this, "_currentSelection", null);
|
|
22
|
-
__publicField(this, "_textSelectionInfo", /* @__PURE__ */ new Map());
|
|
23
|
-
__publicField(this, "_textSelection$", new BehaviorSubject(null));
|
|
24
|
-
__publicField(this, "textSelection$", this._textSelection$.asObservable());
|
|
25
|
-
__publicField(this, "_refreshSelection$", new BehaviorSubject(null));
|
|
26
|
-
__publicField(this, "refreshSelection$", this._refreshSelection$.asObservable());
|
|
27
|
-
this._commandService = _commandService, this._univerInstanceService = _univerInstanceService, this._listenCurrentUnit();
|
|
28
|
-
}
|
|
29
|
-
_listenCurrentUnit() {
|
|
30
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_DOC).pipe(takeUntil(this.dispose$)).subscribe((documentModel) => {
|
|
31
|
-
if (documentModel == null)
|
|
32
|
-
return;
|
|
33
|
-
const unitId = documentModel.getUnitId();
|
|
34
|
-
this._setCurrentSelectionNotRefresh({
|
|
35
|
-
unitId,
|
|
36
|
-
subUnitId: unitId
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
__getCurrentSelection() {
|
|
41
|
-
return this._currentSelection;
|
|
42
|
-
}
|
|
43
|
-
getSelectionInfo(params = this._currentSelection) {
|
|
44
|
-
return this._getTextRanges(params);
|
|
45
|
-
}
|
|
46
|
-
refreshSelection(params = this._currentSelection) {
|
|
47
|
-
params != null && this._refresh(params);
|
|
48
|
-
}
|
|
49
|
-
// **Only used in test case** because this does not go through the render layer.
|
|
50
|
-
__TEST_ONLY_setCurrentSelection(param) {
|
|
51
|
-
this._currentSelection = param, this._refresh(param);
|
|
52
|
-
}
|
|
53
|
-
getTextRanges(params = this._currentSelection) {
|
|
54
|
-
var _a6;
|
|
55
|
-
return (_a6 = this._getTextRanges(params)) == null ? void 0 : _a6.textRanges;
|
|
56
|
-
}
|
|
57
|
-
getRectRanges(params = this._currentSelection) {
|
|
58
|
-
var _a6;
|
|
59
|
-
return (_a6 = this._getTextRanges(params)) == null ? void 0 : _a6.rectRanges;
|
|
60
|
-
}
|
|
61
|
-
getDocRanges(params = this._currentSelection) {
|
|
62
|
-
var _a6, _b;
|
|
63
|
-
const textRanges = (_a6 = this.getTextRanges(params)) != null ? _a6 : [], rectRanges = (_b = this.getRectRanges(params)) != null ? _b : [];
|
|
64
|
-
return [...textRanges, ...rectRanges].filter((range) => range.startOffset != null && range.endOffset != null).sort((a, b) => a.startOffset > b.startOffset ? 1 : a.startOffset < b.startOffset ? -1 : 0);
|
|
65
|
-
}
|
|
66
|
-
getActiveTextRange() {
|
|
67
|
-
const selectionInfo = this._getTextRanges(this._currentSelection);
|
|
68
|
-
if (selectionInfo == null)
|
|
69
|
-
return;
|
|
70
|
-
const { textRanges } = selectionInfo;
|
|
71
|
-
return textRanges.find((textRange) => textRange.isActive);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
*
|
|
75
|
-
* @deprecated
|
|
76
|
-
*/
|
|
77
|
-
getActiveRectRange() {
|
|
78
|
-
const selectionInfo = this._getTextRanges(this._currentSelection);
|
|
79
|
-
if (selectionInfo == null)
|
|
80
|
-
return;
|
|
81
|
-
const { rectRanges } = selectionInfo;
|
|
82
|
-
return rectRanges.find((rectRange) => rectRange.isActive);
|
|
83
|
-
}
|
|
84
|
-
// **Only used in test case** because this does not go through the render layer.
|
|
85
|
-
__TEST_ONLY_add(textRanges, isEditing = !0) {
|
|
86
|
-
this._currentSelection != null && this._addByParam({
|
|
87
|
-
...this._currentSelection,
|
|
88
|
-
textRanges,
|
|
89
|
-
rectRanges: [],
|
|
90
|
-
segmentId: "",
|
|
91
|
-
segmentPage: -1,
|
|
92
|
-
isEditing,
|
|
93
|
-
style: NORMAL_TEXT_SELECTION_PLUGIN_STYLE
|
|
94
|
-
// mock style.
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
// Use to replace the current editor selection.
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated pls use replaceDocRanges.
|
|
100
|
-
*/
|
|
101
|
-
replaceTextRanges(docRanges, isEditing = !0, options) {
|
|
102
|
-
return this.replaceDocRanges(
|
|
103
|
-
docRanges,
|
|
104
|
-
this._currentSelection,
|
|
105
|
-
isEditing,
|
|
106
|
-
options
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
replaceDocRanges(docRanges, params = this._currentSelection, isEditing = !0, options) {
|
|
110
|
-
if (params == null)
|
|
111
|
-
return;
|
|
112
|
-
const { unitId, subUnitId } = params;
|
|
113
|
-
this._refreshSelection$.next({
|
|
114
|
-
unitId,
|
|
115
|
-
subUnitId,
|
|
116
|
-
docRanges,
|
|
117
|
-
isEditing,
|
|
118
|
-
options
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
// Only use in doc-selection-render.controller.ts
|
|
122
|
-
__replaceTextRangesWithNoRefresh(textSelectionInfo) {
|
|
123
|
-
if (this._currentSelection == null)
|
|
124
|
-
return;
|
|
125
|
-
const params = {
|
|
126
|
-
...this._currentSelection,
|
|
127
|
-
...textSelectionInfo
|
|
128
|
-
};
|
|
129
|
-
this._replaceByParam(params), this._textSelection$.next(params);
|
|
130
|
-
const { unitId, subUnitId, segmentId, style, textRanges, rectRanges, isEditing } = params, ranges = [...textRanges, ...rectRanges].filter((range) => range.startOffset != null && range.endOffset != null).sort((a, b) => a.startOffset > b.startOffset ? 1 : a.startOffset < b.startOffset ? -1 : 0);
|
|
131
|
-
this._commandService.executeCommand(SetTextSelectionsOperation.id, {
|
|
132
|
-
unitId,
|
|
133
|
-
subUnitId,
|
|
134
|
-
segmentId,
|
|
135
|
-
style,
|
|
136
|
-
isEditing,
|
|
137
|
-
ranges
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
dispose() {
|
|
141
|
-
this._textSelection$.complete();
|
|
142
|
-
}
|
|
143
|
-
_setCurrentSelectionNotRefresh(param) {
|
|
144
|
-
this._currentSelection = param;
|
|
145
|
-
}
|
|
146
|
-
_getTextRanges(param) {
|
|
147
|
-
var _a6;
|
|
148
|
-
if (param == null)
|
|
149
|
-
return;
|
|
150
|
-
const { unitId, subUnitId = "" } = param;
|
|
151
|
-
return (_a6 = this._textSelectionInfo.get(unitId)) == null ? void 0 : _a6.get(subUnitId);
|
|
152
|
-
}
|
|
153
|
-
_refresh(param) {
|
|
154
|
-
const allTextSelectionInfo = this._getTextRanges(param);
|
|
155
|
-
if (allTextSelectionInfo == null)
|
|
156
|
-
return;
|
|
157
|
-
const { textRanges, rectRanges } = allTextSelectionInfo, docRanges = [...textRanges, ...rectRanges], { unitId, subUnitId } = param;
|
|
158
|
-
this._refreshSelection$.next({
|
|
159
|
-
unitId,
|
|
160
|
-
subUnitId,
|
|
161
|
-
docRanges,
|
|
162
|
-
isEditing: !1
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
_replaceByParam(insertParam) {
|
|
166
|
-
const { unitId, subUnitId, ...selectionInsertParam } = insertParam;
|
|
167
|
-
this._textSelectionInfo.has(unitId) || this._textSelectionInfo.set(unitId, /* @__PURE__ */ new Map()), this._textSelectionInfo.get(unitId).set(subUnitId, { ...selectionInsertParam });
|
|
168
|
-
}
|
|
169
|
-
_addByParam(insertParam) {
|
|
170
|
-
const { unitId, subUnitId, ...selectionInsertParam } = insertParam;
|
|
171
|
-
this._textSelectionInfo.has(unitId) || this._textSelectionInfo.set(unitId, /* @__PURE__ */ new Map());
|
|
172
|
-
const unitTextRange = this._textSelectionInfo.get(unitId);
|
|
173
|
-
unitTextRange.has(subUnitId) ? unitTextRange.get(subUnitId).textRanges.push(...insertParam.textRanges) : unitTextRange.set(subUnitId, { ...selectionInsertParam });
|
|
174
|
-
}
|
|
175
|
-
}, __name(_a, "DocSelectionManagerService"), _a);
|
|
176
|
-
DocSelectionManagerService = __decorateClass$4([
|
|
177
|
-
__decorateParam$4(0, ICommandService),
|
|
178
|
-
__decorateParam$4(1, IUniverInstanceService)
|
|
179
|
-
], DocSelectionManagerService);
|
|
180
|
-
var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
181
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
182
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
183
|
-
return kind && result && __defProp$3(target, key, result), result;
|
|
184
|
-
}, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$3"), _a2;
|
|
185
|
-
let DocSkeletonManagerService = (_a2 = class extends RxDisposable {
|
|
186
|
-
constructor(_context, _localeService, _univerInstanceService) {
|
|
187
|
-
super();
|
|
188
|
-
__publicField(this, "_skeleton");
|
|
189
|
-
__publicField(this, "_docViewModel");
|
|
190
|
-
__publicField(this, "_currentSkeleton$", new BehaviorSubject(null));
|
|
191
|
-
__publicField(this, "currentSkeleton$", this._currentSkeleton$.asObservable());
|
|
192
|
-
// CurrentSkeletonBefore for pre-triggered logic during registration
|
|
193
|
-
__publicField(this, "_currentSkeletonBefore$", new BehaviorSubject(null));
|
|
194
|
-
__publicField(this, "currentSkeletonBefore$", this._currentSkeletonBefore$.asObservable());
|
|
195
|
-
__publicField(this, "_currentViewModel$", new BehaviorSubject(null));
|
|
196
|
-
__publicField(this, "currentViewModel$", this._currentViewModel$.asObservable());
|
|
197
|
-
this._context = _context, this._localeService = _localeService, this._univerInstanceService = _univerInstanceService, this._init(), this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_DOC).pipe(takeUntil(this.dispose$)).subscribe((documentModel) => {
|
|
198
|
-
documentModel && documentModel.getUnitId() === this._context.unitId && this._update(documentModel);
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
dispose() {
|
|
202
|
-
super.dispose(), this._currentSkeletonBefore$.complete(), this._currentSkeleton$.complete();
|
|
203
|
-
}
|
|
204
|
-
getSkeleton() {
|
|
205
|
-
return this._skeleton;
|
|
206
|
-
}
|
|
207
|
-
getViewModel() {
|
|
208
|
-
return this._docViewModel;
|
|
209
|
-
}
|
|
210
|
-
_init() {
|
|
211
|
-
const documentDataModel = this._context.unit;
|
|
212
|
-
this._update(documentDataModel);
|
|
213
|
-
}
|
|
214
|
-
_update(documentDataModel) {
|
|
215
|
-
const unitId = this._context.unitId;
|
|
216
|
-
if (documentDataModel.getBody() == null)
|
|
217
|
-
return;
|
|
218
|
-
this._docViewModel && isInternalEditorID(unitId) ? (this._docViewModel.reset(documentDataModel), this._context.unit = documentDataModel) : this._docViewModel || (this._docViewModel = this._buildDocViewModel(documentDataModel)), this._skeleton || (this._skeleton = this._buildSkeleton(this._docViewModel));
|
|
219
|
-
const skeleton = this._skeleton;
|
|
220
|
-
skeleton.calculate(), this._currentSkeletonBefore$.next(skeleton), this._currentSkeleton$.next(skeleton), this._currentViewModel$.next(this._docViewModel);
|
|
221
|
-
}
|
|
222
|
-
_buildSkeleton(documentViewModel) {
|
|
223
|
-
return DocumentSkeleton.create(documentViewModel, this._localeService);
|
|
224
|
-
}
|
|
225
|
-
_buildDocViewModel(documentDataModel) {
|
|
226
|
-
return new DocumentViewModel(documentDataModel);
|
|
227
|
-
}
|
|
228
|
-
}, __name(_a2, "DocSkeletonManagerService"), _a2);
|
|
229
|
-
DocSkeletonManagerService = __decorateClass$3([
|
|
230
|
-
__decorateParam$3(1, Inject(LocaleService)),
|
|
231
|
-
__decorateParam$3(2, IUniverInstanceService)
|
|
232
|
-
], DocSkeletonManagerService);
|
|
233
|
-
const _DocStateEmitService = class _DocStateEmitService extends RxDisposable {
|
|
234
|
-
constructor() {
|
|
235
|
-
super();
|
|
236
|
-
__publicField(this, "_docStateChangeParams$", new BehaviorSubject(null));
|
|
237
|
-
__publicField(this, "docStateChangeParams$", this._docStateChangeParams$.asObservable());
|
|
238
|
-
}
|
|
239
|
-
emitStateChangeInfo(params) {
|
|
240
|
-
this._docStateChangeParams$.next(params);
|
|
241
|
-
}
|
|
242
|
-
dispose() {
|
|
243
|
-
super.dispose(), this._docStateChangeParams$.complete();
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
__name(_DocStateEmitService, "DocStateEmitService");
|
|
247
|
-
let DocStateEmitService = _DocStateEmitService;
|
|
248
|
-
const RichTextEditingMutationId = "doc.mutation.rich-text-editing", RichTextEditingMutation = {
|
|
249
|
-
id: RichTextEditingMutationId,
|
|
250
|
-
type: CommandType.MUTATION,
|
|
251
|
-
handler: /* @__PURE__ */ __name((accessor, params) => {
|
|
252
|
-
var _a6, _b;
|
|
253
|
-
const {
|
|
254
|
-
unitId,
|
|
255
|
-
segmentId = "",
|
|
256
|
-
actions,
|
|
257
|
-
textRanges,
|
|
258
|
-
prevTextRanges,
|
|
259
|
-
trigger,
|
|
260
|
-
noHistory,
|
|
261
|
-
isCompositionEnd,
|
|
262
|
-
noNeedSetTextRange,
|
|
263
|
-
debounce
|
|
264
|
-
} = params, univerInstanceService = accessor.get(IUniverInstanceService), renderManagerService = accessor.get(IRenderManagerService), docStateEmitService = accessor.get(DocStateEmitService), documentDataModel = univerInstanceService.getUniverDocInstance(unitId), documentViewModel = (_a6 = renderManagerService.getRenderById(unitId)) == null ? void 0 : _a6.with(DocSkeletonManagerService).getViewModel();
|
|
265
|
-
if (documentDataModel == null || documentViewModel == null)
|
|
266
|
-
throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${unitId}`);
|
|
267
|
-
const docSelectionManagerService = accessor.get(DocSelectionManagerService), docRanges = (_b = docSelectionManagerService.getDocRanges()) != null ? _b : [], disabled = !!documentDataModel.getSnapshot().disabled;
|
|
268
|
-
if (JSONX.isNoop(actions) || actions && actions.length === 0 || disabled)
|
|
269
|
-
return {
|
|
270
|
-
unitId,
|
|
271
|
-
actions: [],
|
|
272
|
-
textRanges: docRanges
|
|
273
|
-
};
|
|
274
|
-
const undoActions = JSONX.invertWithDoc(actions, documentDataModel.getSnapshot());
|
|
275
|
-
documentDataModel.apply(actions), documentViewModel.reset(documentDataModel), !noNeedSetTextRange && textRanges && trigger != null && queueMicrotask(() => {
|
|
276
|
-
docSelectionManagerService.replaceTextRanges(textRanges, !0, params.options);
|
|
277
|
-
});
|
|
278
|
-
const changeState = {
|
|
279
|
-
commandId: RichTextEditingMutationId,
|
|
280
|
-
unitId,
|
|
281
|
-
segmentId,
|
|
282
|
-
trigger,
|
|
283
|
-
noHistory,
|
|
284
|
-
debounce,
|
|
285
|
-
redoState: {
|
|
286
|
-
actions,
|
|
287
|
-
textRanges
|
|
288
|
-
},
|
|
289
|
-
undoState: {
|
|
290
|
-
actions: undoActions,
|
|
291
|
-
textRanges: prevTextRanges != null ? prevTextRanges : docRanges
|
|
292
|
-
},
|
|
293
|
-
isCompositionEnd
|
|
294
|
-
};
|
|
295
|
-
return docStateEmitService.emitStateChangeInfo(changeState), {
|
|
296
|
-
unitId,
|
|
297
|
-
actions: undoActions,
|
|
298
|
-
textRanges: docRanges
|
|
299
|
-
};
|
|
300
|
-
}, "handler")
|
|
301
|
-
}, DocsRenameMutation = {
|
|
302
|
-
id: "doc.mutation.rename-doc",
|
|
303
|
-
type: CommandType.MUTATION,
|
|
304
|
-
handler: /* @__PURE__ */ __name((accessor, params) => {
|
|
305
|
-
const doc = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_DOC);
|
|
306
|
-
return doc ? (doc.setName(params.name), !0) : !1;
|
|
307
|
-
}, "handler")
|
|
308
|
-
}, PLUGIN_CONFIG_KEY = "docs.config", defaultPluginConfig = {};
|
|
309
|
-
var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
310
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
311
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
312
|
-
return kind && result && __defProp$2(target, key, result), result;
|
|
313
|
-
}, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a3;
|
|
314
|
-
let DocCustomRangeController = (_a3 = class extends Disposable {
|
|
315
|
-
constructor(_commandService, _textSelectionManagerService, _univerInstanceService) {
|
|
316
|
-
super(), this._commandService = _commandService, this._textSelectionManagerService = _textSelectionManagerService, this._univerInstanceService = _univerInstanceService, this._initSelectionChange();
|
|
317
|
-
}
|
|
318
|
-
_transformCustomRange(doc, selection) {
|
|
319
|
-
var _a6;
|
|
320
|
-
const { startOffset, endOffset, collapsed } = selection, customRanges = (_a6 = doc.getCustomRanges()) == null ? void 0 : _a6.filter((range) => !range.wholeEntity || startOffset <= range.startIndex && endOffset > range.endIndex ? !1 : collapsed ? range.startIndex < startOffset && range.endIndex >= endOffset : BuildTextUtils.range.isIntersects(startOffset, endOffset - 1, range.startIndex, range.endIndex));
|
|
321
|
-
if (customRanges != null && customRanges.length) {
|
|
322
|
-
let start = startOffset, end = endOffset;
|
|
323
|
-
return customRanges.forEach((range) => {
|
|
324
|
-
start = Math.min(range.startIndex, start), end = Math.max(range.endIndex + 1, end);
|
|
325
|
-
}), {
|
|
326
|
-
...selection,
|
|
327
|
-
startOffset: start,
|
|
328
|
-
endOffset: end,
|
|
329
|
-
collapsed: start === end
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
return selection;
|
|
333
|
-
}
|
|
334
|
-
_initSelectionChange() {
|
|
335
|
-
this.disposeWithMe(this._commandService.onCommandExecuted((commandInfo) => {
|
|
336
|
-
if (commandInfo.id === SetTextSelectionsOperation.id) {
|
|
337
|
-
const params = commandInfo.params, { unitId, ranges, isEditing } = params, doc = this._univerInstanceService.getUnit(unitId);
|
|
338
|
-
if (!doc)
|
|
339
|
-
return;
|
|
340
|
-
const transformedRanges = ranges.map((range) => this._transformCustomRange(doc, range));
|
|
341
|
-
transformedRanges.some((range, i) => ranges[i] !== range) && this._textSelectionManagerService.replaceTextRanges(transformedRanges, isEditing);
|
|
342
|
-
}
|
|
343
|
-
}));
|
|
344
|
-
}
|
|
345
|
-
}, __name(_a3, "DocCustomRangeController"), _a3);
|
|
346
|
-
DocCustomRangeController = __decorateClass$2([
|
|
347
|
-
OnLifecycle(LifecycleStages.Ready, DocCustomRangeController),
|
|
348
|
-
__decorateParam$2(0, ICommandService),
|
|
349
|
-
__decorateParam$2(1, Inject(DocSelectionManagerService)),
|
|
350
|
-
__decorateParam$2(2, IUniverInstanceService)
|
|
351
|
-
], DocCustomRangeController);
|
|
352
|
-
var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
353
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
354
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
355
|
-
return kind && result && __defProp$1(target, key, result), result;
|
|
356
|
-
}, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1");
|
|
357
|
-
const PLUGIN_NAME = "DOCS_PLUGIN";
|
|
358
|
-
var _a4;
|
|
359
|
-
let UniverDocsPlugin = (_a4 = class extends Plugin {
|
|
360
|
-
// static override type = UniverInstanceType.UNIVER_DOC;
|
|
361
|
-
constructor(_config = defaultPluginConfig, _injector, _configService) {
|
|
362
|
-
super(), this._config = _config, this._injector = _injector, this._configService = _configService;
|
|
363
|
-
const { ...rest } = this._config;
|
|
364
|
-
this._configService.setConfig(PLUGIN_CONFIG_KEY, rest), this._initializeDependencies(_injector), this._initializeCommands();
|
|
365
|
-
}
|
|
366
|
-
_initializeCommands() {
|
|
367
|
-
[
|
|
368
|
-
RichTextEditingMutation,
|
|
369
|
-
DocsRenameMutation,
|
|
370
|
-
SetTextSelectionsOperation
|
|
371
|
-
].forEach((command) => {
|
|
372
|
-
this._injector.get(ICommandService).registerCommand(command);
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
_initializeDependencies(docInjector) {
|
|
376
|
-
[
|
|
377
|
-
// services
|
|
378
|
-
[DocSelectionManagerService],
|
|
379
|
-
[DocStateEmitService],
|
|
380
|
-
// controllers
|
|
381
|
-
[DocCustomRangeController]
|
|
382
|
-
].forEach((d) => docInjector.add(d));
|
|
383
|
-
}
|
|
384
|
-
}, __name(_a4, "UniverDocsPlugin"), __publicField(_a4, "pluginName", PLUGIN_NAME), _a4);
|
|
385
|
-
UniverDocsPlugin = __decorateClass$1([
|
|
386
|
-
__decorateParam$1(1, Inject(Injector)),
|
|
387
|
-
__decorateParam$1(2, IConfigService)
|
|
388
|
-
], UniverDocsPlugin);
|
|
389
|
-
const CUSTOM_RANGE = createInterceptorKey("CUSTOM_RANGE"), CUSTOM_DECORATION = createInterceptorKey("CUSTOM_DECORATION"), DOC_INTERCEPTOR_POINT = {
|
|
390
|
-
CUSTOM_RANGE,
|
|
391
|
-
CUSTOM_DECORATION
|
|
392
|
-
};
|
|
393
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
394
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
395
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
396
|
-
return kind && result && __defProp2(target, key, result), result;
|
|
397
|
-
}, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), _a5;
|
|
398
|
-
let DocInterceptorService = (_a5 = class extends Disposable {
|
|
399
|
-
constructor(_context, _docSkeletonManagerService) {
|
|
400
|
-
super();
|
|
401
|
-
__publicField(this, "_interceptorsByName", /* @__PURE__ */ new Map());
|
|
402
|
-
this._context = _context, this._docSkeletonManagerService = _docSkeletonManagerService;
|
|
403
|
-
const viewModel = this._docSkeletonManagerService.getViewModel(), unitId = viewModel.getDataModel().getUnitId();
|
|
404
|
-
if (unitId === DOCS_NORMAL_EDITOR_UNIT_ID_KEY || unitId === DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)
|
|
405
|
-
return;
|
|
406
|
-
this.disposeWithMe(this.interceptDocumentViewModel(viewModel)), this.disposeWithMe(this.intercept(DOC_INTERCEPTOR_POINT.CUSTOM_RANGE, {
|
|
407
|
-
priority: -1,
|
|
408
|
-
handler: /* @__PURE__ */ __name((data, pos, next) => next(data), "handler")
|
|
409
|
-
}));
|
|
410
|
-
let disposableCollection = new DisposableCollection();
|
|
411
|
-
viewModel.segmentViewModels$.subscribe((segmentViewModels) => {
|
|
412
|
-
disposableCollection.dispose(), disposableCollection = new DisposableCollection(), segmentViewModels.forEach((segmentViewModel) => {
|
|
413
|
-
disposableCollection.add(this.interceptDocumentViewModel(segmentViewModel));
|
|
414
|
-
});
|
|
415
|
-
}), this.disposeWithMe(disposableCollection);
|
|
416
|
-
}
|
|
417
|
-
intercept(name, interceptor) {
|
|
418
|
-
const key = name;
|
|
419
|
-
this._interceptorsByName.has(key) || this._interceptorsByName.set(key, []);
|
|
420
|
-
const interceptors = this._interceptorsByName.get(key);
|
|
421
|
-
return interceptors.push(interceptor), this._interceptorsByName.set(
|
|
422
|
-
key,
|
|
423
|
-
interceptors.sort((a, b) => {
|
|
424
|
-
var _a6, _b;
|
|
425
|
-
return ((_a6 = b.priority) != null ? _a6 : 0) - ((_b = a.priority) != null ? _b : 0);
|
|
426
|
-
})
|
|
427
|
-
), this.disposeWithMe(toDisposable(() => remove(this._interceptorsByName.get(key), interceptor)));
|
|
428
|
-
}
|
|
429
|
-
fetchThroughInterceptors(name) {
|
|
430
|
-
const key = name, interceptors = this._interceptorsByName.get(key);
|
|
431
|
-
return composeInterceptors(interceptors || []);
|
|
432
|
-
}
|
|
433
|
-
interceptDocumentViewModel(viewModel) {
|
|
434
|
-
const disposableCollection = new DisposableCollection();
|
|
435
|
-
return disposableCollection.add(viewModel.registerCustomRangeInterceptor({
|
|
436
|
-
getCustomRange: /* @__PURE__ */ __name((index) => {
|
|
437
|
-
var _a6;
|
|
438
|
-
return this.fetchThroughInterceptors(DOC_INTERCEPTOR_POINT.CUSTOM_RANGE)(
|
|
439
|
-
viewModel.getCustomRangeRaw(index),
|
|
440
|
-
{
|
|
441
|
-
index,
|
|
442
|
-
unitId: viewModel.getDataModel().getUnitId(),
|
|
443
|
-
customRanges: (_a6 = viewModel.getDataModel().getCustomRanges()) != null ? _a6 : []
|
|
444
|
-
}
|
|
445
|
-
);
|
|
446
|
-
}, "getCustomRange"),
|
|
447
|
-
getCustomDecoration: /* @__PURE__ */ __name((index) => {
|
|
448
|
-
var _a6;
|
|
449
|
-
return this.fetchThroughInterceptors(DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION)(
|
|
450
|
-
viewModel.getCustomDecorationRaw(index),
|
|
451
|
-
{
|
|
452
|
-
index,
|
|
453
|
-
unitId: viewModel.getDataModel().getUnitId(),
|
|
454
|
-
customDecorations: (_a6 = viewModel.getDataModel().getCustomDecorations()) != null ? _a6 : []
|
|
455
|
-
}
|
|
456
|
-
);
|
|
457
|
-
}, "getCustomDecoration")
|
|
458
|
-
})), disposableCollection;
|
|
459
|
-
}
|
|
460
|
-
}, __name(_a5, "DocInterceptorService"), _a5);
|
|
461
|
-
DocInterceptorService = __decorateClass([
|
|
462
|
-
OnLifecycle(LifecycleStages.Starting, DocInterceptorService),
|
|
463
|
-
__decorateParam(1, Inject(DocSkeletonManagerService))
|
|
464
|
-
], DocInterceptorService);
|
|
465
|
-
export {
|
|
466
|
-
DOC_INTERCEPTOR_POINT,
|
|
467
|
-
DocInterceptorService,
|
|
468
|
-
DocSelectionManagerService,
|
|
469
|
-
DocSkeletonManagerService,
|
|
470
|
-
DocStateEmitService,
|
|
471
|
-
RichTextEditingMutation,
|
|
472
|
-
SetTextSelectionsOperation,
|
|
473
|
-
UniverDocsPlugin
|
|
474
|
-
};
|
|
1
|
+
const _0x15d651=_0xb3b1;(function(_0x3c6774,_0xef1204){const _0x1e1225=_0xb3b1,_0x4e427d=_0x3c6774();while(!![]){try{const _0x52fb93=-parseInt(_0x1e1225(0xc1))/0x1*(parseInt(_0x1e1225(0xaf))/0x2)+parseInt(_0x1e1225(0x12b))/0x3+parseInt(_0x1e1225(0x121))/0x4+-parseInt(_0x1e1225(0xff))/0x5+parseInt(_0x1e1225(0xcf))/0x6+-parseInt(_0x1e1225(0x126))/0x7+parseInt(_0x1e1225(0xcc))/0x8*(-parseInt(_0x1e1225(0xbf))/0x9);if(_0x52fb93===_0xef1204)break;else _0x4e427d['push'](_0x4e427d['shift']());}catch(_0x23144f){_0x4e427d['push'](_0x4e427d['shift']());}}}(_0xae95,0x65b59));var __defProp=Object[_0x15d651(0x137)],__defNormalProp=(_0x211aff,_0x3617dd,_0x386c4e)=>_0x3617dd in _0x211aff?__defProp(_0x211aff,_0x3617dd,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x386c4e}):_0x211aff[_0x3617dd]=_0x386c4e,__name=(_0x2b9678,_0xad33c4)=>__defProp(_0x2b9678,_0x15d651(0x102),{'value':_0xad33c4,'configurable':!0x0}),__publicField=(_0x1f7fbb,_0xe676f9,_0x183397)=>__defNormalProp(_0x1f7fbb,typeof _0xe676f9!=_0x15d651(0xf6)?_0xe676f9+'':_0xe676f9,_0x183397);import{CommandType,RxDisposable,UniverInstanceType,ICommandService,IUniverInstanceService,Inject,LocaleService,isInternalEditorID,JSONX,Disposable,BuildTextUtils,Injector,Plugin,IConfigService,createInterceptorKey,DOCS_NORMAL_EDITOR_UNIT_ID_KEY,DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,DisposableCollection,toDisposable,remove,composeInterceptors}from'@univerjs/core';import{NORMAL_TEXT_SELECTION_PLUGIN_STYLE,DocumentSkeleton,DocumentViewModel,IRenderManagerService}from'@univerjs/engine-render';import{BehaviorSubject,takeUntil}from'rxjs';function _0xae95(){const _0x2e6321=['with','_initializeDependencies','getViewModel','_initSelectionChange','onReady','fetchThroughInterceptors','invertWithDoc','DocCustomRangeController','priority','OPERATION','docs.config','registerCustomRangeInterceptor','intercept','params','7820397fzafBi','_skeleton','41jLSABi','complete','isActive','currentSkeletonBefore$','_textSelectionManagerService','dispose$','_interceptorsByName','unit','getSnapshot','replaceDocRanges','find','8aKNnTP','getCustomDecorationRaw','rectRanges','2451420BHPnyL','doc.mutation.rich-text-editing','__decorateClass$3','DocSkeletonManagerService','get','getTextRanges','getDataModel','push','getCustomRangeRaw','getCustomDecoration','some','isIntersects','_transformCustomRange','doc.operation.set-selections','_textSelection$','_context','_addByParam','_buildSkeleton','_univerInstanceService','__decorateClass$2','__decorateParam$2','subscribe','__getCurrentSelection','docStateChangeParams$','unitId','setConfig','getCustomRanges','UNIVER_DOC','getCurrentTypeOfUnit$','_refreshSelection$','DocSelectionManagerService','UniverDocsPlugin','_listenCurrentUnit','pipe','_initializeCommands','create','set','_currentSelection','getOwnPropertyDescriptor','symbol','endOffset','max','apply','_getTextRanges','_refresh','startIndex','_replaceByParam','getUnit','47655qujzRn','has','_textSelectionInfo','name','__decorateClass$4','CUSTOM_RANGE','reset','startOffset','getBody','_buildDocViewModel','_docViewModel','__decorateParam$1','calculate','asObservable','_setCurrentSelectionNotRefresh','_currentSkeleton$','disabled','_commandService','_config','_currentViewModel$','getCustomRange','doc.mutation.rename-doc','length','_currentSkeletonBefore$','__decorateParam$3','__TEST_ONLY_add','handler','dispose','add','onCommandExecuted','getUnitId','_update','textSelection$','disposeWithMe','2738668mYzCDV','getSkeleton','__TEST_ONLY_setCurrentSelection','_configService','endIndex','1479499vFcSqE','onStarting','getSelectionInfo','sort','next','1665504wmelbh','_injector','refreshSelection$','interceptDocumentViewModel','CUSTOM_DECORATION','map','MUTATION','_localeService','getActiveRectRange','filter','getDocRanges','_docSkeletonManagerService','defineProperty','__replaceTextRangesWithNoRefresh','textRanges','__decorateParam','DocInterceptorService','setName','_init','emitStateChangeInfo','getUniverDocInstance','isNoop','getRenderById','replaceTextRanges','min','forEach','6926iRaZkh','getRectRanges'];_0xae95=function(){return _0x2e6321;};return _0xae95();}const SetTextSelectionsOperation={'id':_0x15d651(0xdc),'type':CommandType[_0x15d651(0xba)],'handler':__name((_0x3f5ad3,_0x28bdfb)=>!0x0,_0x15d651(0x119))};var __defProp$4=Object[_0x15d651(0x137)],__getOwnPropDesc$4=Object[_0x15d651(0xf5)],__decorateClass$4=__name((_0xa2e12b,_0x29d422,_0x5ee18e,_0x316e75)=>{const _0x955c9d=_0x15d651;for(var _0x23df94=_0x316e75>0x1?void 0x0:_0x316e75?__getOwnPropDesc$4(_0x29d422,_0x5ee18e):_0x29d422,_0x43f3c8=_0xa2e12b[_0x955c9d(0x115)]-0x1,_0x1541ed;_0x43f3c8>=0x0;_0x43f3c8--)(_0x1541ed=_0xa2e12b[_0x43f3c8])&&(_0x23df94=(_0x316e75?_0x1541ed(_0x29d422,_0x5ee18e,_0x23df94):_0x1541ed(_0x23df94))||_0x23df94);return _0x316e75&&_0x23df94&&__defProp$4(_0x29d422,_0x5ee18e,_0x23df94),_0x23df94;},_0x15d651(0x103)),__decorateParam$4=__name((_0x1033ca,_0x506707)=>(_0xac4f5,_0x45eab9)=>_0x506707(_0xac4f5,_0x45eab9,_0x1033ca),'__decorateParam$4'),_a;let DocSelectionManagerService=(_a=class extends RxDisposable{constructor(_0x469294,_0x1333db){const _0x411aa7=_0x15d651;super(),__publicField(this,_0x411aa7(0xf4),null),__publicField(this,_0x411aa7(0x101),new Map()),__publicField(this,_0x411aa7(0xdd),new BehaviorSubject(null)),__publicField(this,_0x411aa7(0x11f),this['_textSelection$'][_0x411aa7(0x10c)]()),__publicField(this,_0x411aa7(0xec),new BehaviorSubject(null)),__publicField(this,_0x411aa7(0x12d),this[_0x411aa7(0xec)]['asObservable']()),(this[_0x411aa7(0x110)]=_0x469294,this[_0x411aa7(0xe1)]=_0x1333db,this[_0x411aa7(0xef)]());}[_0x15d651(0xef)](){const _0x38d43f=_0x15d651;this[_0x38d43f(0xe1)][_0x38d43f(0xeb)](UniverInstanceType[_0x38d43f(0xea)])[_0x38d43f(0xf0)](takeUntil(this['dispose$']))[_0x38d43f(0xe4)](_0x1b1d8b=>{const _0x3ded0e=_0x38d43f;if(_0x1b1d8b==null)return;const _0x2f81f6=_0x1b1d8b[_0x3ded0e(0x11d)]();this[_0x3ded0e(0x10d)]({'unitId':_0x2f81f6,'subUnitId':_0x2f81f6});});}[_0x15d651(0xe5)](){const _0x4bfbb2=_0x15d651;return this[_0x4bfbb2(0xf4)];}[_0x15d651(0x128)](_0x2f72b2=this[_0x15d651(0xf4)]){return this['_getTextRanges'](_0x2f72b2);}['refreshSelection'](_0x52d46f=this[_0x15d651(0xf4)]){const _0x319f49=_0x15d651;_0x52d46f!=null&&this[_0x319f49(0xfb)](_0x52d46f);}[_0x15d651(0x123)](_0x2ac0d9){const _0x2b5d62=_0x15d651;this[_0x2b5d62(0xf4)]=_0x2ac0d9,this[_0x2b5d62(0xfb)](_0x2ac0d9);}[_0x15d651(0xd4)](_0xc711f4=this['_currentSelection']){const _0x1a4dce=_0x15d651;var _0x15758d;return(_0x15758d=this['_getTextRanges'](_0xc711f4))==null?void 0x0:_0x15758d[_0x1a4dce(0x139)];}[_0x15d651(0xb0)](_0x890ac5=this[_0x15d651(0xf4)]){const _0x32c64f=_0x15d651;var _0x29e114;return(_0x29e114=this['_getTextRanges'](_0x890ac5))==null?void 0x0:_0x29e114[_0x32c64f(0xce)];}[_0x15d651(0x135)](_0xc25929=this[_0x15d651(0xf4)]){const _0x3af97a=_0x15d651;var _0x5d7bbc,_0x30999c;const _0x1bc3fb=(_0x5d7bbc=this[_0x3af97a(0xd4)](_0xc25929))!=null?_0x5d7bbc:[],_0x1d5293=(_0x30999c=this['getRectRanges'](_0xc25929))!=null?_0x30999c:[];return[..._0x1bc3fb,..._0x1d5293]['filter'](_0x20c0ac=>_0x20c0ac[_0x3af97a(0x106)]!=null&&_0x20c0ac['endOffset']!=null)['sort']((_0x3a1d90,_0x39b128)=>_0x3a1d90[_0x3af97a(0x106)]>_0x39b128[_0x3af97a(0x106)]?0x1:_0x3a1d90[_0x3af97a(0x106)]<_0x39b128[_0x3af97a(0x106)]?-0x1:0x0);}['getActiveTextRange'](){const _0xb0874c=_0x15d651,_0x3eb7f3=this[_0xb0874c(0xfa)](this[_0xb0874c(0xf4)]);if(_0x3eb7f3==null)return;const {textRanges:_0x1a7f53}=_0x3eb7f3;return _0x1a7f53[_0xb0874c(0xcb)](_0x1dc0d5=>_0x1dc0d5[_0xb0874c(0xc3)]);}[_0x15d651(0x133)](){const _0x920f80=_0x15d651,_0x4a5d69=this[_0x920f80(0xfa)](this[_0x920f80(0xf4)]);if(_0x4a5d69==null)return;const {rectRanges:_0x5ce13f}=_0x4a5d69;return _0x5ce13f['find'](_0x173315=>_0x173315[_0x920f80(0xc3)]);}[_0x15d651(0x118)](_0x262b30,_0x370ae5=!0x0){const _0x38824b=_0x15d651;this[_0x38824b(0xf4)]!=null&&this['_addByParam']({...this[_0x38824b(0xf4)],'textRanges':_0x262b30,'rectRanges':[],'segmentId':'','segmentPage':-0x1,'isEditing':_0x370ae5,'style':NORMAL_TEXT_SELECTION_PLUGIN_STYLE});}[_0x15d651(0xac)](_0x373248,_0x516747=!0x0,_0x34f993){const _0x45a420=_0x15d651;return this[_0x45a420(0xca)](_0x373248,this[_0x45a420(0xf4)],_0x516747,_0x34f993);}[_0x15d651(0xca)](_0x27a13b,_0x4dd6ca=this[_0x15d651(0xf4)],_0x1766f3=!0x0,_0x450ee2){const _0x316468=_0x15d651;if(_0x4dd6ca==null)return;const {unitId:_0x360374,subUnitId:_0x5d5103}=_0x4dd6ca;this['_refreshSelection$'][_0x316468(0x12a)]({'unitId':_0x360374,'subUnitId':_0x5d5103,'docRanges':_0x27a13b,'isEditing':_0x1766f3,'options':_0x450ee2});}[_0x15d651(0x138)](_0x373674){const _0xee73c4=_0x15d651;if(this['_currentSelection']==null)return;const _0x53efb4={...this['_currentSelection'],..._0x373674};this[_0xee73c4(0xfd)](_0x53efb4),this[_0xee73c4(0xdd)]['next'](_0x53efb4);const {unitId:_0x40e5fb,subUnitId:_0x1ad0be,segmentId:_0x56fc10,style:_0x27ff98,textRanges:_0x2a5ceb,rectRanges:_0x562b9b,isEditing:_0x58f778}=_0x53efb4,_0x2c0688=[..._0x2a5ceb,..._0x562b9b][_0xee73c4(0x134)](_0x16f057=>_0x16f057['startOffset']!=null&&_0x16f057[_0xee73c4(0xf7)]!=null)['sort']((_0x366508,_0x7bef3f)=>_0x366508[_0xee73c4(0x106)]>_0x7bef3f[_0xee73c4(0x106)]?0x1:_0x366508[_0xee73c4(0x106)]<_0x7bef3f[_0xee73c4(0x106)]?-0x1:0x0);this[_0xee73c4(0x110)]['executeCommand'](SetTextSelectionsOperation['id'],{'unitId':_0x40e5fb,'subUnitId':_0x1ad0be,'segmentId':_0x56fc10,'style':_0x27ff98,'isEditing':_0x58f778,'ranges':_0x2c0688});}[_0x15d651(0x11a)](){const _0x557560=_0x15d651;this[_0x557560(0xdd)][_0x557560(0xc2)]();}['_setCurrentSelectionNotRefresh'](_0x534250){const _0x54db76=_0x15d651;this[_0x54db76(0xf4)]=_0x534250;}[_0x15d651(0xfa)](_0x18b52c){const _0x24be08=_0x15d651;var _0x9622eb;if(_0x18b52c==null)return;const {unitId:_0x46dc63,subUnitId:subUnitId=''}=_0x18b52c;return(_0x9622eb=this[_0x24be08(0x101)]['get'](_0x46dc63))==null?void 0x0:_0x9622eb['get'](subUnitId);}['_refresh'](_0x3b9664){const _0x10f816=_0x15d651,_0x2546fc=this['_getTextRanges'](_0x3b9664);if(_0x2546fc==null)return;const {textRanges:_0x490240,rectRanges:_0x59b5c8}=_0x2546fc,_0x5f4b5d=[..._0x490240,..._0x59b5c8],{unitId:_0x124488,subUnitId:_0xe1cc0a}=_0x3b9664;this['_refreshSelection$'][_0x10f816(0x12a)]({'unitId':_0x124488,'subUnitId':_0xe1cc0a,'docRanges':_0x5f4b5d,'isEditing':!0x1});}[_0x15d651(0xfd)](_0x130876){const _0x5ebd8a=_0x15d651,{unitId:_0x48e4d7,subUnitId:_0x2fa0c4,..._0xb7f183}=_0x130876;this[_0x5ebd8a(0x101)][_0x5ebd8a(0x100)](_0x48e4d7)||this[_0x5ebd8a(0x101)][_0x5ebd8a(0xf3)](_0x48e4d7,new Map()),this[_0x5ebd8a(0x101)][_0x5ebd8a(0xd3)](_0x48e4d7)[_0x5ebd8a(0xf3)](_0x2fa0c4,{..._0xb7f183});}[_0x15d651(0xdf)](_0x3dbb91){const _0x389028=_0x15d651,{unitId:_0x118350,subUnitId:_0x535923,..._0x5dc243}=_0x3dbb91;this[_0x389028(0x101)][_0x389028(0x100)](_0x118350)||this[_0x389028(0x101)][_0x389028(0xf3)](_0x118350,new Map());const _0x38446f=this['_textSelectionInfo']['get'](_0x118350);_0x38446f[_0x389028(0x100)](_0x535923)?_0x38446f[_0x389028(0xd3)](_0x535923)[_0x389028(0x139)][_0x389028(0xd6)](..._0x3dbb91[_0x389028(0x139)]):_0x38446f[_0x389028(0xf3)](_0x535923,{..._0x5dc243});}},__name(_a,_0x15d651(0xed)),_a);DocSelectionManagerService=__decorateClass$4([__decorateParam$4(0x0,ICommandService),__decorateParam$4(0x1,IUniverInstanceService)],DocSelectionManagerService);var __defProp$3=Object[_0x15d651(0x137)],__getOwnPropDesc$3=Object[_0x15d651(0xf5)],__decorateClass$3=__name((_0x3df6be,_0x57a983,_0x1f8d95,_0x5ea20f)=>{const _0x56ae2a=_0x15d651;for(var _0x193a4b=_0x5ea20f>0x1?void 0x0:_0x5ea20f?__getOwnPropDesc$3(_0x57a983,_0x1f8d95):_0x57a983,_0x5dc250=_0x3df6be[_0x56ae2a(0x115)]-0x1,_0x17ad77;_0x5dc250>=0x0;_0x5dc250--)(_0x17ad77=_0x3df6be[_0x5dc250])&&(_0x193a4b=(_0x5ea20f?_0x17ad77(_0x57a983,_0x1f8d95,_0x193a4b):_0x17ad77(_0x193a4b))||_0x193a4b);return _0x5ea20f&&_0x193a4b&&__defProp$3(_0x57a983,_0x1f8d95,_0x193a4b),_0x193a4b;},_0x15d651(0xd1)),__decorateParam$3=__name((_0x23fe1a,_0x5e0346)=>(_0x3f6486,_0xdd9b3)=>_0x5e0346(_0x3f6486,_0xdd9b3,_0x23fe1a),_0x15d651(0x117)),_a2;let DocSkeletonManagerService=(_a2=class extends RxDisposable{constructor(_0x516f43,_0xd52037,_0x427c92){const _0x433e75=_0x15d651;super(),__publicField(this,_0x433e75(0xc0)),__publicField(this,_0x433e75(0x109)),__publicField(this,_0x433e75(0x10e),new BehaviorSubject(null)),__publicField(this,'currentSkeleton$',this[_0x433e75(0x10e)][_0x433e75(0x10c)]()),__publicField(this,_0x433e75(0x116),new BehaviorSubject(null)),__publicField(this,_0x433e75(0xc4),this['_currentSkeletonBefore$']['asObservable']()),__publicField(this,_0x433e75(0x112),new BehaviorSubject(null)),__publicField(this,'currentViewModel$',this['_currentViewModel$'][_0x433e75(0x10c)]()),(this[_0x433e75(0xde)]=_0x516f43,this[_0x433e75(0x132)]=_0xd52037,this[_0x433e75(0xe1)]=_0x427c92,this[_0x433e75(0xa7)](),this['_univerInstanceService'][_0x433e75(0xeb)](UniverInstanceType[_0x433e75(0xea)])['pipe'](takeUntil(this[_0x433e75(0xc6)]))[_0x433e75(0xe4)](_0xb7fc01=>{const _0xfd2a2a=_0x433e75;_0xb7fc01&&_0xb7fc01['getUnitId']()===this[_0xfd2a2a(0xde)][_0xfd2a2a(0xe7)]&&this[_0xfd2a2a(0x11e)](_0xb7fc01);}));}[_0x15d651(0x11a)](){const _0x210574=_0x15d651;super[_0x210574(0x11a)](),this['_currentSkeletonBefore$']['complete'](),this['_currentSkeleton$'][_0x210574(0xc2)]();}[_0x15d651(0x122)](){const _0x49cff4=_0x15d651;return this[_0x49cff4(0xc0)];}['getViewModel'](){const _0x11e435=_0x15d651;return this[_0x11e435(0x109)];}[_0x15d651(0xa7)](){const _0xb45cf1=_0x15d651,_0xe251b7=this[_0xb45cf1(0xde)][_0xb45cf1(0xc8)];this[_0xb45cf1(0x11e)](_0xe251b7);}[_0x15d651(0x11e)](_0x267f66){const _0x45642f=_0x15d651,_0x5b0c6f=this['_context'][_0x45642f(0xe7)];if(_0x267f66[_0x45642f(0x107)]()==null)return;this['_docViewModel']&&isInternalEditorID(_0x5b0c6f)?(this['_docViewModel'][_0x45642f(0x105)](_0x267f66),this[_0x45642f(0xde)][_0x45642f(0xc8)]=_0x267f66):this[_0x45642f(0x109)]||(this[_0x45642f(0x109)]=this['_buildDocViewModel'](_0x267f66)),this[_0x45642f(0xc0)]||(this[_0x45642f(0xc0)]=this['_buildSkeleton'](this['_docViewModel']));const _0x17ad9c=this[_0x45642f(0xc0)];_0x17ad9c[_0x45642f(0x10b)](),this[_0x45642f(0x116)][_0x45642f(0x12a)](_0x17ad9c),this[_0x45642f(0x10e)][_0x45642f(0x12a)](_0x17ad9c),this['_currentViewModel$'][_0x45642f(0x12a)](this[_0x45642f(0x109)]);}[_0x15d651(0xe0)](_0x592fbf){const _0x20d6ce=_0x15d651;return DocumentSkeleton[_0x20d6ce(0xf2)](_0x592fbf,this[_0x20d6ce(0x132)]);}[_0x15d651(0x108)](_0x4f53cd){return new DocumentViewModel(_0x4f53cd);}},__name(_a2,_0x15d651(0xd2)),_a2);DocSkeletonManagerService=__decorateClass$3([__decorateParam$3(0x1,Inject(LocaleService)),__decorateParam$3(0x2,IUniverInstanceService)],DocSkeletonManagerService);const _DocStateEmitService=class _DocStateEmitService extends RxDisposable{constructor(){const _0x38cf95=_0x15d651;super(),__publicField(this,'_docStateChangeParams$',new BehaviorSubject(null)),__publicField(this,_0x38cf95(0xe6),this['_docStateChangeParams$'][_0x38cf95(0x10c)]());}[_0x15d651(0xa8)](_0x125deb){const _0x351a73=_0x15d651;this['_docStateChangeParams$'][_0x351a73(0x12a)](_0x125deb);}['dispose'](){const _0x3fa740=_0x15d651;super['dispose'](),this['_docStateChangeParams$'][_0x3fa740(0xc2)]();}};__name(_DocStateEmitService,'DocStateEmitService');let DocStateEmitService=_DocStateEmitService;const RichTextEditingMutationId=_0x15d651(0xd0),RichTextEditingMutation={'id':RichTextEditingMutationId,'type':CommandType[_0x15d651(0x131)],'handler':__name((_0x3815d0,_0x267e30)=>{const _0x115c42=_0x15d651;var _0x488722,_0x1ffa7c;const {unitId:_0x95e5b8,segmentId:segmentId='',actions:_0x22e8e8,textRanges:_0x5ca13b,prevTextRanges:_0x43ad7b,trigger:_0x1f3d0a,noHistory:_0x8d344e,isCompositionEnd:_0x1cb612,noNeedSetTextRange:_0x5015ba,debounce:_0x460a65}=_0x267e30,_0x233440=_0x3815d0[_0x115c42(0xd3)](IUniverInstanceService),_0x3c67bb=_0x3815d0[_0x115c42(0xd3)](IRenderManagerService),_0x20457d=_0x3815d0[_0x115c42(0xd3)](DocStateEmitService),_0x34a9dd=_0x233440[_0x115c42(0xa9)](_0x95e5b8),_0x4b37bc=(_0x488722=_0x3c67bb[_0x115c42(0xab)](_0x95e5b8))==null?void 0x0:_0x488722[_0x115c42(0xb1)](DocSkeletonManagerService)[_0x115c42(0xb3)]();if(_0x34a9dd==null||_0x4b37bc==null)throw new Error('DocumentDataModel\x20or\x20documentViewModel\x20not\x20found\x20for\x20unitId:\x20'+_0x95e5b8);const _0x543fd0=_0x3815d0[_0x115c42(0xd3)](DocSelectionManagerService),_0x3ead2c=(_0x1ffa7c=_0x543fd0[_0x115c42(0x135)]())!=null?_0x1ffa7c:[],_0x42622e=!!_0x34a9dd[_0x115c42(0xc9)]()[_0x115c42(0x10f)];if(JSONX[_0x115c42(0xaa)](_0x22e8e8)||_0x22e8e8&&_0x22e8e8['length']===0x0||_0x42622e)return{'unitId':_0x95e5b8,'actions':[],'textRanges':_0x3ead2c};const _0x1e4519=JSONX[_0x115c42(0xb7)](_0x22e8e8,_0x34a9dd[_0x115c42(0xc9)]());_0x34a9dd[_0x115c42(0xf9)](_0x22e8e8),_0x4b37bc['reset'](_0x34a9dd),!_0x5015ba&&_0x5ca13b&&_0x1f3d0a!=null&&queueMicrotask(()=>{const _0x30a7b1=_0x115c42;_0x543fd0[_0x30a7b1(0xac)](_0x5ca13b,!0x0,_0x267e30['options']);});const _0x3acd5f={'commandId':RichTextEditingMutationId,'unitId':_0x95e5b8,'segmentId':segmentId,'trigger':_0x1f3d0a,'noHistory':_0x8d344e,'debounce':_0x460a65,'redoState':{'actions':_0x22e8e8,'textRanges':_0x5ca13b},'undoState':{'actions':_0x1e4519,'textRanges':_0x43ad7b!=null?_0x43ad7b:_0x3ead2c},'isCompositionEnd':_0x1cb612};return _0x20457d[_0x115c42(0xa8)](_0x3acd5f),{'unitId':_0x95e5b8,'actions':_0x1e4519,'textRanges':_0x3ead2c};},'handler')},DocsRenameMutation={'id':_0x15d651(0x114),'type':CommandType[_0x15d651(0x131)],'handler':__name((_0x5762dc,_0x2899bf)=>{const _0x178e73=_0x15d651,_0x4b97f0=_0x5762dc[_0x178e73(0xd3)](IUniverInstanceService)[_0x178e73(0xfe)](_0x2899bf['unitId'],UniverInstanceType[_0x178e73(0xea)]);return _0x4b97f0?(_0x4b97f0[_0x178e73(0xa6)](_0x2899bf[_0x178e73(0x102)]),!0x0):!0x1;},_0x15d651(0x119))},PLUGIN_CONFIG_KEY=_0x15d651(0xbb),defaultPluginConfig={};var __defProp$2=Object[_0x15d651(0x137)],__getOwnPropDesc$2=Object[_0x15d651(0xf5)],__decorateClass$2=__name((_0x54e925,_0xf46275,_0x35c456,_0x3f85bd)=>{const _0x524e66=_0x15d651;for(var _0x5cc694=_0x3f85bd>0x1?void 0x0:_0x3f85bd?__getOwnPropDesc$2(_0xf46275,_0x35c456):_0xf46275,_0x384257=_0x54e925[_0x524e66(0x115)]-0x1,_0x2a31db;_0x384257>=0x0;_0x384257--)(_0x2a31db=_0x54e925[_0x384257])&&(_0x5cc694=(_0x3f85bd?_0x2a31db(_0xf46275,_0x35c456,_0x5cc694):_0x2a31db(_0x5cc694))||_0x5cc694);return _0x3f85bd&&_0x5cc694&&__defProp$2(_0xf46275,_0x35c456,_0x5cc694),_0x5cc694;},_0x15d651(0xe2)),__decorateParam$2=__name((_0x38f490,_0x14650f)=>(_0x36d00d,_0x280a2f)=>_0x14650f(_0x36d00d,_0x280a2f,_0x38f490),_0x15d651(0xe3)),_a3;let DocCustomRangeController=(_a3=class extends Disposable{constructor(_0x387e0a,_0x22e1af,_0x57d5d5){const _0x77330f=_0x15d651;super(),this[_0x77330f(0x110)]=_0x387e0a,this['_textSelectionManagerService']=_0x22e1af,this[_0x77330f(0xe1)]=_0x57d5d5,this[_0x77330f(0xb4)]();}[_0x15d651(0xdb)](_0x245114,_0x2d9b55){const _0x123275=_0x15d651;var _0x1e4a34;const {startOffset:_0x343dc9,endOffset:_0x36658e,collapsed:_0x349603}=_0x2d9b55,_0x51028e=(_0x1e4a34=_0x245114[_0x123275(0xe9)]())==null?void 0x0:_0x1e4a34['filter'](_0x40e829=>!_0x40e829['wholeEntity']||_0x343dc9<=_0x40e829[_0x123275(0xfc)]&&_0x36658e>_0x40e829[_0x123275(0x125)]?!0x1:_0x349603?_0x40e829[_0x123275(0xfc)]<_0x343dc9&&_0x40e829[_0x123275(0x125)]>=_0x36658e:BuildTextUtils['range'][_0x123275(0xda)](_0x343dc9,_0x36658e-0x1,_0x40e829[_0x123275(0xfc)],_0x40e829[_0x123275(0x125)]));if(_0x51028e!=null&&_0x51028e[_0x123275(0x115)]){let _0x253789=_0x343dc9,_0x434830=_0x36658e;return _0x51028e[_0x123275(0xae)](_0xaad7a8=>{const _0x3c3d48=_0x123275;_0x253789=Math[_0x3c3d48(0xad)](_0xaad7a8[_0x3c3d48(0xfc)],_0x253789),_0x434830=Math[_0x3c3d48(0xf8)](_0xaad7a8[_0x3c3d48(0x125)]+0x1,_0x434830);}),{..._0x2d9b55,'startOffset':_0x253789,'endOffset':_0x434830,'collapsed':_0x253789===_0x434830};}return _0x2d9b55;}['_initSelectionChange'](){const _0x4bac2e=_0x15d651;this[_0x4bac2e(0x120)](this[_0x4bac2e(0x110)][_0x4bac2e(0x11c)](_0x135555=>{const _0x1e1531=_0x4bac2e;if(_0x135555['id']===SetTextSelectionsOperation['id']){const _0x16600b=_0x135555[_0x1e1531(0xbe)],{unitId:_0x3fba24,ranges:_0x979cdf,isEditing:_0x225adc}=_0x16600b,_0x52ad7a=this[_0x1e1531(0xe1)]['getUnit'](_0x3fba24);if(!_0x52ad7a)return;const _0x59d6bf=_0x979cdf[_0x1e1531(0x130)](_0x44a775=>this['_transformCustomRange'](_0x52ad7a,_0x44a775));_0x59d6bf[_0x1e1531(0xd9)]((_0x53f3a4,_0x57a8c6)=>_0x979cdf[_0x57a8c6]!==_0x53f3a4)&&this[_0x1e1531(0xc5)]['replaceTextRanges'](_0x59d6bf,_0x225adc);}}));}},__name(_a3,_0x15d651(0xb8)),_a3);DocCustomRangeController=__decorateClass$2([__decorateParam$2(0x0,ICommandService),__decorateParam$2(0x1,Inject(DocSelectionManagerService)),__decorateParam$2(0x2,IUniverInstanceService)],DocCustomRangeController);var __defProp$1=Object['defineProperty'],__getOwnPropDesc$1=Object['getOwnPropertyDescriptor'],__decorateClass$1=__name((_0x546b64,_0x45d1bb,_0x3fc108,_0x2b36e2)=>{const _0x2907b1=_0x15d651;for(var _0x7ec911=_0x2b36e2>0x1?void 0x0:_0x2b36e2?__getOwnPropDesc$1(_0x45d1bb,_0x3fc108):_0x45d1bb,_0x279087=_0x546b64[_0x2907b1(0x115)]-0x1,_0x5bc1bf;_0x279087>=0x0;_0x279087--)(_0x5bc1bf=_0x546b64[_0x279087])&&(_0x7ec911=(_0x2b36e2?_0x5bc1bf(_0x45d1bb,_0x3fc108,_0x7ec911):_0x5bc1bf(_0x7ec911))||_0x7ec911);return _0x2b36e2&&_0x7ec911&&__defProp$1(_0x45d1bb,_0x3fc108,_0x7ec911),_0x7ec911;},'__decorateClass$1'),__decorateParam$1=__name((_0x4a2d70,_0x3bf3cc)=>(_0xac3098,_0x8cb13e)=>_0x3bf3cc(_0xac3098,_0x8cb13e,_0x4a2d70),_0x15d651(0x10a));const PLUGIN_NAME='DOCS_PLUGIN';var _a4;let UniverDocsPlugin=(_a4=class extends Plugin{constructor(_0x2cf1cc=defaultPluginConfig,_0x25c4a4,_0x2af4bf){const _0x368e38=_0x15d651;super(),this[_0x368e38(0x111)]=_0x2cf1cc,this[_0x368e38(0x12c)]=_0x25c4a4,this[_0x368e38(0x124)]=_0x2af4bf;const {..._0x578899}=this[_0x368e38(0x111)];this[_0x368e38(0x124)][_0x368e38(0xe8)](PLUGIN_CONFIG_KEY,_0x578899);}[_0x15d651(0x127)](){const _0x4aa3ff=_0x15d651;this[_0x4aa3ff(0xb2)](),this[_0x4aa3ff(0xf1)]();}['_initializeCommands'](){[RichTextEditingMutation,DocsRenameMutation,SetTextSelectionsOperation]['forEach'](_0x363a23=>{const _0x3ba9f5=_0xb3b1;this[_0x3ba9f5(0x12c)][_0x3ba9f5(0xd3)](ICommandService)['registerCommand'](_0x363a23);});}[_0x15d651(0xb2)](){const _0x18951c=_0x15d651;[[DocSelectionManagerService],[DocStateEmitService],[DocCustomRangeController]][_0x18951c(0xae)](_0x12730a=>this[_0x18951c(0x12c)][_0x18951c(0x11b)](_0x12730a));}[_0x15d651(0xb5)](){this['_injector']['get'](DocCustomRangeController);}},__name(_a4,_0x15d651(0xee)),__publicField(_a4,'pluginName',PLUGIN_NAME),_a4);UniverDocsPlugin=__decorateClass$1([__decorateParam$1(0x1,Inject(Injector)),__decorateParam$1(0x2,IConfigService)],UniverDocsPlugin);const CUSTOM_RANGE=createInterceptorKey('CUSTOM_RANGE'),CUSTOM_DECORATION=createInterceptorKey(_0x15d651(0x12f)),DOC_INTERCEPTOR_POINT={'CUSTOM_RANGE':CUSTOM_RANGE,'CUSTOM_DECORATION':CUSTOM_DECORATION};var __defProp2=Object[_0x15d651(0x137)],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__decorateClass=__name((_0x20b8ed,_0x3f9b15,_0x3d38f0,_0x903cbe)=>{const _0x1116d6=_0x15d651;for(var _0x322cfd=_0x903cbe>0x1?void 0x0:_0x903cbe?__getOwnPropDesc(_0x3f9b15,_0x3d38f0):_0x3f9b15,_0x2e8e10=_0x20b8ed[_0x1116d6(0x115)]-0x1,_0x2cb64f;_0x2e8e10>=0x0;_0x2e8e10--)(_0x2cb64f=_0x20b8ed[_0x2e8e10])&&(_0x322cfd=(_0x903cbe?_0x2cb64f(_0x3f9b15,_0x3d38f0,_0x322cfd):_0x2cb64f(_0x322cfd))||_0x322cfd);return _0x903cbe&&_0x322cfd&&__defProp2(_0x3f9b15,_0x3d38f0,_0x322cfd),_0x322cfd;},'__decorateClass'),__decorateParam=__name((_0x1b5f68,_0x228d59)=>(_0x23e81e,_0x2638e2)=>_0x228d59(_0x23e81e,_0x2638e2,_0x1b5f68),_0x15d651(0x13a)),_a5;let DocInterceptorService=(_a5=class extends Disposable{constructor(_0x1d3e65,_0x231b36){const _0xbaca23=_0x15d651;super(),__publicField(this,_0xbaca23(0xc7),new Map()),(this[_0xbaca23(0xde)]=_0x1d3e65,this[_0xbaca23(0x136)]=_0x231b36);const _0x35361a=this[_0xbaca23(0x136)]['getViewModel'](),_0x1b49ec=_0x35361a[_0xbaca23(0xd5)]()['getUnitId']();if(_0x1b49ec===DOCS_NORMAL_EDITOR_UNIT_ID_KEY||_0x1b49ec===DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)return;this[_0xbaca23(0x120)](this[_0xbaca23(0x12e)](_0x35361a)),this[_0xbaca23(0x120)](this[_0xbaca23(0xbd)](DOC_INTERCEPTOR_POINT[_0xbaca23(0x104)],{'priority':-0x1,'handler':__name((_0x18bc5b,_0x1473ba,_0x1e26c5)=>_0x1e26c5(_0x18bc5b),'handler')}));let _0xdc4cdd=new DisposableCollection();_0x35361a['segmentViewModels$'][_0xbaca23(0xe4)](_0x52d98b=>{const _0x21e011=_0xbaca23;_0xdc4cdd[_0x21e011(0x11a)](),_0xdc4cdd=new DisposableCollection(),_0x52d98b[_0x21e011(0xae)](_0x41191f=>{_0xdc4cdd['add'](this['interceptDocumentViewModel'](_0x41191f));});}),this[_0xbaca23(0x120)](_0xdc4cdd);}[_0x15d651(0xbd)](_0x143895,_0x5a64c1){const _0x5d5acd=_0x15d651,_0x4fdc80=_0x143895;this[_0x5d5acd(0xc7)]['has'](_0x4fdc80)||this['_interceptorsByName'][_0x5d5acd(0xf3)](_0x4fdc80,[]);const _0x12554f=this[_0x5d5acd(0xc7)]['get'](_0x4fdc80);return _0x12554f[_0x5d5acd(0xd6)](_0x5a64c1),this['_interceptorsByName'][_0x5d5acd(0xf3)](_0x4fdc80,_0x12554f[_0x5d5acd(0x129)]((_0x1ae5b6,_0x5e5761)=>{const _0x10958a=_0x5d5acd;var _0x50d189,_0x53cf63;return((_0x50d189=_0x5e5761['priority'])!=null?_0x50d189:0x0)-((_0x53cf63=_0x1ae5b6[_0x10958a(0xb9)])!=null?_0x53cf63:0x0);})),this[_0x5d5acd(0x120)](toDisposable(()=>remove(this[_0x5d5acd(0xc7)]['get'](_0x4fdc80),_0x5a64c1)));}[_0x15d651(0xb6)](_0x22c9dc){const _0x1c520d=_0x22c9dc,_0x15aa43=this['_interceptorsByName']['get'](_0x1c520d);return composeInterceptors(_0x15aa43||[]);}['interceptDocumentViewModel'](_0x2cea07){const _0x27225d=_0x15d651,_0x9167c3=new DisposableCollection();return _0x9167c3['add'](_0x2cea07[_0x27225d(0xbc)]({'getCustomRange':__name(_0x246112=>{const _0x104172=_0x27225d;var _0x3da794;return this[_0x104172(0xb6)](DOC_INTERCEPTOR_POINT['CUSTOM_RANGE'])(_0x2cea07[_0x104172(0xd7)](_0x246112),{'index':_0x246112,'unitId':_0x2cea07[_0x104172(0xd5)]()[_0x104172(0x11d)](),'customRanges':(_0x3da794=_0x2cea07[_0x104172(0xd5)]()[_0x104172(0xe9)]())!=null?_0x3da794:[]});},_0x27225d(0x113)),'getCustomDecoration':__name(_0x11d413=>{const _0x314a69=_0x27225d;var _0x12cd08;return this['fetchThroughInterceptors'](DOC_INTERCEPTOR_POINT[_0x314a69(0x12f)])(_0x2cea07[_0x314a69(0xcd)](_0x11d413),{'index':_0x11d413,'unitId':_0x2cea07[_0x314a69(0xd5)]()['getUnitId'](),'customDecorations':(_0x12cd08=_0x2cea07[_0x314a69(0xd5)]()['getCustomDecorations']())!=null?_0x12cd08:[]});},_0x27225d(0xd8))})),_0x9167c3;}},__name(_a5,_0x15d651(0xa5)),_a5);function _0xb3b1(_0x99db7e,_0x30f26a){const _0xae9534=_0xae95();return _0xb3b1=function(_0xb3b189,_0x48253c){_0xb3b189=_0xb3b189-0xa5;let _0x190183=_0xae9534[_0xb3b189];return _0x190183;},_0xb3b1(_0x99db7e,_0x30f26a);}DocInterceptorService=__decorateClass([__decorateParam(0x1,Inject(DocSkeletonManagerService))],DocInterceptorService);export{DOC_INTERCEPTOR_POINT,DocInterceptorService,DocSelectionManagerService,DocSkeletonManagerService,DocStateEmitService,RichTextEditingMutation,SetTextSelectionsOperation,UniverDocsPlugin};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
2
1
|
import { IUniverDocsConfig } from './controllers/config.schema';
|
|
2
|
+
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
3
3
|
export declare class UniverDocsPlugin extends Plugin {
|
|
4
4
|
private readonly _config;
|
|
5
5
|
_injector: Injector;
|
|
6
6
|
private readonly _configService;
|
|
7
7
|
static pluginName: string;
|
|
8
8
|
constructor(_config: Partial<IUniverDocsConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
9
|
+
onStarting(): void;
|
|
9
10
|
private _initializeCommands;
|
|
10
11
|
private _initializeDependencies;
|
|
12
|
+
onReady(): void;
|
|
11
13
|
}
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","rxjs"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverDocs={},global.UniverCore,global.UniverEngineRender,global.rxjs))})(this,function(exports2,core,engineRender,rxjs){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b,_c,_d,_e;const SetTextSelectionsOperation={id:"doc.operation.set-selections",type:core.CommandType.OPERATION,handler:__name((_,__)=>!0,"handler")};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__decorateClass$4=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$4(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$4(target,key,result),result},"__decorateClass$4"),__decorateParam$4=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$4");exports2.DocSelectionManagerService=(_a=class extends core.RxDisposable{constructor(_commandService,_univerInstanceService){super();__publicField(this,"_currentSelection",null);__publicField(this,"_textSelectionInfo",new Map);__publicField(this,"_textSelection$",new rxjs.BehaviorSubject(null));__publicField(this,"textSelection$",this._textSelection$.asObservable());__publicField(this,"_refreshSelection$",new rxjs.BehaviorSubject(null));__publicField(this,"refreshSelection$",this._refreshSelection$.asObservable());this._commandService=_commandService,this._univerInstanceService=_univerInstanceService,this._listenCurrentUnit()}_listenCurrentUnit(){this._univerInstanceService.getCurrentTypeOfUnit$(core.UniverInstanceType.UNIVER_DOC).pipe(rxjs.takeUntil(this.dispose$)).subscribe(documentModel=>{if(documentModel==null)return;const unitId=documentModel.getUnitId();this._setCurrentSelectionNotRefresh({unitId,subUnitId:unitId})})}__getCurrentSelection(){return this._currentSelection}getSelectionInfo(params=this._currentSelection){return this._getTextRanges(params)}refreshSelection(params=this._currentSelection){params!=null&&this._refresh(params)}__TEST_ONLY_setCurrentSelection(param){this._currentSelection=param,this._refresh(param)}getTextRanges(params=this._currentSelection){var _a2;return(_a2=this._getTextRanges(params))==null?void 0:_a2.textRanges}getRectRanges(params=this._currentSelection){var _a2;return(_a2=this._getTextRanges(params))==null?void 0:_a2.rectRanges}getDocRanges(params=this._currentSelection){var _a2,_b2;const textRanges=(_a2=this.getTextRanges(params))!=null?_a2:[],rectRanges=(_b2=this.getRectRanges(params))!=null?_b2:[];return[...textRanges,...rectRanges].filter(range=>range.startOffset!=null&&range.endOffset!=null).sort((a,b)=>a.startOffset>b.startOffset?1:a.startOffset<b.startOffset?-1:0)}getActiveTextRange(){const selectionInfo=this._getTextRanges(this._currentSelection);if(selectionInfo==null)return;const{textRanges}=selectionInfo;return textRanges.find(textRange=>textRange.isActive)}getActiveRectRange(){const selectionInfo=this._getTextRanges(this._currentSelection);if(selectionInfo==null)return;const{rectRanges}=selectionInfo;return rectRanges.find(rectRange=>rectRange.isActive)}__TEST_ONLY_add(textRanges,isEditing=!0){this._currentSelection!=null&&this._addByParam({...this._currentSelection,textRanges,rectRanges:[],segmentId:"",segmentPage:-1,isEditing,style:engineRender.NORMAL_TEXT_SELECTION_PLUGIN_STYLE})}replaceTextRanges(docRanges,isEditing=!0,options){return this.replaceDocRanges(docRanges,this._currentSelection,isEditing,options)}replaceDocRanges(docRanges,params=this._currentSelection,isEditing=!0,options){if(params==null)return;const{unitId,subUnitId}=params;this._refreshSelection$.next({unitId,subUnitId,docRanges,isEditing,options})}__replaceTextRangesWithNoRefresh(textSelectionInfo){if(this._currentSelection==null)return;const params={...this._currentSelection,...textSelectionInfo};this._replaceByParam(params),this._textSelection$.next(params);const{unitId,subUnitId,segmentId,style,textRanges,rectRanges,isEditing}=params,ranges=[...textRanges,...rectRanges].filter(range=>range.startOffset!=null&&range.endOffset!=null).sort((a,b)=>a.startOffset>b.startOffset?1:a.startOffset<b.startOffset?-1:0);this._commandService.executeCommand(SetTextSelectionsOperation.id,{unitId,subUnitId,segmentId,style,isEditing,ranges})}dispose(){this._textSelection$.complete()}_setCurrentSelectionNotRefresh(param){this._currentSelection=param}_getTextRanges(param){var _a2;if(param==null)return;const{unitId,subUnitId=""}=param;return(_a2=this._textSelectionInfo.get(unitId))==null?void 0:_a2.get(subUnitId)}_refresh(param){const allTextSelectionInfo=this._getTextRanges(param);if(allTextSelectionInfo==null)return;const{textRanges,rectRanges}=allTextSelectionInfo,docRanges=[...textRanges,...rectRanges],{unitId,subUnitId}=param;this._refreshSelection$.next({unitId,subUnitId,docRanges,isEditing:!1})}_replaceByParam(insertParam){const{unitId,subUnitId,...selectionInsertParam}=insertParam;this._textSelectionInfo.has(unitId)||this._textSelectionInfo.set(unitId,new Map),this._textSelectionInfo.get(unitId).set(subUnitId,{...selectionInsertParam})}_addByParam(insertParam){const{unitId,subUnitId,...selectionInsertParam}=insertParam;this._textSelectionInfo.has(unitId)||this._textSelectionInfo.set(unitId,new Map);const unitTextRange=this._textSelectionInfo.get(unitId);unitTextRange.has(subUnitId)?unitTextRange.get(subUnitId).textRanges.push(...insertParam.textRanges):unitTextRange.set(subUnitId,{...selectionInsertParam})}},__name(_a,"DocSelectionManagerService"),_a),exports2.DocSelectionManagerService=__decorateClass$4([__decorateParam$4(0,core.ICommandService),__decorateParam$4(1,core.IUniverInstanceService)],exports2.DocSelectionManagerService);var __defProp$3=Object.defineProperty,__getOwnPropDesc$3=Object.getOwnPropertyDescriptor,__decorateClass$3=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$3(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$3(target,key,result),result},"__decorateClass$3"),__decorateParam$3=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$3");exports2.DocSkeletonManagerService=(_b=class extends core.RxDisposable{constructor(_context,_localeService,_univerInstanceService){super();__publicField(this,"_skeleton");__publicField(this,"_docViewModel");__publicField(this,"_currentSkeleton$",new rxjs.BehaviorSubject(null));__publicField(this,"currentSkeleton$",this._currentSkeleton$.asObservable());__publicField(this,"_currentSkeletonBefore$",new rxjs.BehaviorSubject(null));__publicField(this,"currentSkeletonBefore$",this._currentSkeletonBefore$.asObservable());__publicField(this,"_currentViewModel$",new rxjs.BehaviorSubject(null));__publicField(this,"currentViewModel$",this._currentViewModel$.asObservable());this._context=_context,this._localeService=_localeService,this._univerInstanceService=_univerInstanceService,this._init(),this._univerInstanceService.getCurrentTypeOfUnit$(core.UniverInstanceType.UNIVER_DOC).pipe(rxjs.takeUntil(this.dispose$)).subscribe(documentModel=>{documentModel&&documentModel.getUnitId()===this._context.unitId&&this._update(documentModel)})}dispose(){super.dispose(),this._currentSkeletonBefore$.complete(),this._currentSkeleton$.complete()}getSkeleton(){return this._skeleton}getViewModel(){return this._docViewModel}_init(){const documentDataModel=this._context.unit;this._update(documentDataModel)}_update(documentDataModel){const unitId=this._context.unitId;if(documentDataModel.getBody()==null)return;this._docViewModel&&core.isInternalEditorID(unitId)?(this._docViewModel.reset(documentDataModel),this._context.unit=documentDataModel):this._docViewModel||(this._docViewModel=this._buildDocViewModel(documentDataModel)),this._skeleton||(this._skeleton=this._buildSkeleton(this._docViewModel));const skeleton=this._skeleton;skeleton.calculate(),this._currentSkeletonBefore$.next(skeleton),this._currentSkeleton$.next(skeleton),this._currentViewModel$.next(this._docViewModel)}_buildSkeleton(documentViewModel){return engineRender.DocumentSkeleton.create(documentViewModel,this._localeService)}_buildDocViewModel(documentDataModel){return new engineRender.DocumentViewModel(documentDataModel)}},__name(_b,"DocSkeletonManagerService"),_b),exports2.DocSkeletonManagerService=__decorateClass$3([__decorateParam$3(1,core.Inject(core.LocaleService)),__decorateParam$3(2,core.IUniverInstanceService)],exports2.DocSkeletonManagerService);const _DocStateEmitService=class _DocStateEmitService extends core.RxDisposable{constructor(){super();__publicField(this,"_docStateChangeParams$",new rxjs.BehaviorSubject(null));__publicField(this,"docStateChangeParams$",this._docStateChangeParams$.asObservable())}emitStateChangeInfo(params){this._docStateChangeParams$.next(params)}dispose(){super.dispose(),this._docStateChangeParams$.complete()}};__name(_DocStateEmitService,"DocStateEmitService");let DocStateEmitService=_DocStateEmitService;const RichTextEditingMutationId="doc.mutation.rich-text-editing",RichTextEditingMutation={id:RichTextEditingMutationId,type:core.CommandType.MUTATION,handler:__name((accessor,params)=>{var _a2,_b2;const{unitId,segmentId="",actions,textRanges,prevTextRanges,trigger,noHistory,isCompositionEnd,noNeedSetTextRange,debounce}=params,univerInstanceService=accessor.get(core.IUniverInstanceService),renderManagerService=accessor.get(engineRender.IRenderManagerService),docStateEmitService=accessor.get(DocStateEmitService),documentDataModel=univerInstanceService.getUniverDocInstance(unitId),documentViewModel=(_a2=renderManagerService.getRenderById(unitId))==null?void 0:_a2.with(exports2.DocSkeletonManagerService).getViewModel();if(documentDataModel==null||documentViewModel==null)throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${unitId}`);const docSelectionManagerService=accessor.get(exports2.DocSelectionManagerService),docRanges=(_b2=docSelectionManagerService.getDocRanges())!=null?_b2:[],disabled=!!documentDataModel.getSnapshot().disabled;if(core.JSONX.isNoop(actions)||actions&&actions.length===0||disabled)return{unitId,actions:[],textRanges:docRanges};const undoActions=core.JSONX.invertWithDoc(actions,documentDataModel.getSnapshot());documentDataModel.apply(actions),documentViewModel.reset(documentDataModel),!noNeedSetTextRange&&textRanges&&trigger!=null&&queueMicrotask(()=>{docSelectionManagerService.replaceTextRanges(textRanges,!0,params.options)});const changeState={commandId:RichTextEditingMutationId,unitId,segmentId,trigger,noHistory,debounce,redoState:{actions,textRanges},undoState:{actions:undoActions,textRanges:prevTextRanges!=null?prevTextRanges:docRanges},isCompositionEnd};return docStateEmitService.emitStateChangeInfo(changeState),{unitId,actions:undoActions,textRanges:docRanges}},"handler")},DocsRenameMutation={id:"doc.mutation.rename-doc",type:core.CommandType.MUTATION,handler:__name((accessor,params)=>{const doc=accessor.get(core.IUniverInstanceService).getUnit(params.unitId,core.UniverInstanceType.UNIVER_DOC);return doc?(doc.setName(params.name),!0):!1},"handler")},PLUGIN_CONFIG_KEY="docs.config",defaultPluginConfig={};var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$2(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$2(target,key,result),result},"__decorateClass$2"),__decorateParam$2=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$2");let DocCustomRangeController=(_c=class extends core.Disposable{constructor(_commandService,_textSelectionManagerService,_univerInstanceService){super(),this._commandService=_commandService,this._textSelectionManagerService=_textSelectionManagerService,this._univerInstanceService=_univerInstanceService,this._initSelectionChange()}_transformCustomRange(doc,selection){var _a2;const{startOffset,endOffset,collapsed}=selection,customRanges=(_a2=doc.getCustomRanges())==null?void 0:_a2.filter(range=>!range.wholeEntity||startOffset<=range.startIndex&&endOffset>range.endIndex?!1:collapsed?range.startIndex<startOffset&&range.endIndex>=endOffset:core.BuildTextUtils.range.isIntersects(startOffset,endOffset-1,range.startIndex,range.endIndex));if(customRanges!=null&&customRanges.length){let start=startOffset,end=endOffset;return customRanges.forEach(range=>{start=Math.min(range.startIndex,start),end=Math.max(range.endIndex+1,end)}),{...selection,startOffset:start,endOffset:end,collapsed:start===end}}return selection}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(commandInfo=>{if(commandInfo.id===SetTextSelectionsOperation.id){const params=commandInfo.params,{unitId,ranges,isEditing}=params,doc=this._univerInstanceService.getUnit(unitId);if(!doc)return;const transformedRanges=ranges.map(range=>this._transformCustomRange(doc,range));transformedRanges.some((range,i)=>ranges[i]!==range)&&this._textSelectionManagerService.replaceTextRanges(transformedRanges,isEditing)}}))}},__name(_c,"DocCustomRangeController"),_c);DocCustomRangeController=__decorateClass$2([core.OnLifecycle(core.LifecycleStages.Ready,DocCustomRangeController),__decorateParam$2(0,core.ICommandService),__decorateParam$2(1,core.Inject(exports2.DocSelectionManagerService)),__decorateParam$2(2,core.IUniverInstanceService)],DocCustomRangeController);var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const PLUGIN_NAME="DOCS_PLUGIN";exports2.UniverDocsPlugin=(_d=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest),this._initializeDependencies(_injector),this._initializeCommands()}_initializeCommands(){[RichTextEditingMutation,DocsRenameMutation,SetTextSelectionsOperation].forEach(command=>{this._injector.get(core.ICommandService).registerCommand(command)})}_initializeDependencies(docInjector){[[exports2.DocSelectionManagerService],[DocStateEmitService],[DocCustomRangeController]].forEach(d=>docInjector.add(d))}},__name(_d,"UniverDocsPlugin"),__publicField(_d,"pluginName",PLUGIN_NAME),_d),exports2.UniverDocsPlugin=__decorateClass$1([__decorateParam$1(1,core.Inject(core.Injector)),__decorateParam$1(2,core.IConfigService)],exports2.UniverDocsPlugin);const CUSTOM_RANGE=core.createInterceptorKey("CUSTOM_RANGE"),CUSTOM_DECORATION=core.createInterceptorKey("CUSTOM_DECORATION"),DOC_INTERCEPTOR_POINT={CUSTOM_RANGE,CUSTOM_DECORATION};var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam");exports2.DocInterceptorService=(_e=class extends core.Disposable{constructor(_context,_docSkeletonManagerService){super();__publicField(this,"_interceptorsByName",new Map);this._context=_context,this._docSkeletonManagerService=_docSkeletonManagerService;const viewModel=this._docSkeletonManagerService.getViewModel(),unitId=viewModel.getDataModel().getUnitId();if(unitId===core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY||unitId===core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)return;this.disposeWithMe(this.interceptDocumentViewModel(viewModel)),this.disposeWithMe(this.intercept(DOC_INTERCEPTOR_POINT.CUSTOM_RANGE,{priority:-1,handler:__name((data,pos,next)=>next(data),"handler")}));let disposableCollection=new core.DisposableCollection;viewModel.segmentViewModels$.subscribe(segmentViewModels=>{disposableCollection.dispose(),disposableCollection=new core.DisposableCollection,segmentViewModels.forEach(segmentViewModel=>{disposableCollection.add(this.interceptDocumentViewModel(segmentViewModel))})}),this.disposeWithMe(disposableCollection)}intercept(name,interceptor){const key=name;this._interceptorsByName.has(key)||this._interceptorsByName.set(key,[]);const interceptors=this._interceptorsByName.get(key);return interceptors.push(interceptor),this._interceptorsByName.set(key,interceptors.sort((a,b)=>{var _a2,_b2;return((_a2=b.priority)!=null?_a2:0)-((_b2=a.priority)!=null?_b2:0)})),this.disposeWithMe(core.toDisposable(()=>core.remove(this._interceptorsByName.get(key),interceptor)))}fetchThroughInterceptors(name){const key=name,interceptors=this._interceptorsByName.get(key);return core.composeInterceptors(interceptors||[])}interceptDocumentViewModel(viewModel){const disposableCollection=new core.DisposableCollection;return disposableCollection.add(viewModel.registerCustomRangeInterceptor({getCustomRange:__name(index=>{var _a2;return this.fetchThroughInterceptors(DOC_INTERCEPTOR_POINT.CUSTOM_RANGE)(viewModel.getCustomRangeRaw(index),{index,unitId:viewModel.getDataModel().getUnitId(),customRanges:(_a2=viewModel.getDataModel().getCustomRanges())!=null?_a2:[]})},"getCustomRange"),getCustomDecoration:__name(index=>{var _a2;return this.fetchThroughInterceptors(DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION)(viewModel.getCustomDecorationRaw(index),{index,unitId:viewModel.getDataModel().getUnitId(),customDecorations:(_a2=viewModel.getDataModel().getCustomDecorations())!=null?_a2:[]})},"getCustomDecoration")})),disposableCollection}},__name(_e,"DocInterceptorService"),_e),exports2.DocInterceptorService=__decorateClass([core.OnLifecycle(core.LifecycleStages.Starting,exports2.DocInterceptorService),__decorateParam(1,core.Inject(exports2.DocSkeletonManagerService))],exports2.DocInterceptorService),exports2.DOC_INTERCEPTOR_POINT=DOC_INTERCEPTOR_POINT,exports2.DocStateEmitService=DocStateEmitService,exports2.RichTextEditingMutation=RichTextEditingMutation,exports2.SetTextSelectionsOperation=SetTextSelectionsOperation,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
function _0x55ab(_0x12252a,_0x4da860){const _0x57f0b7=_0x57f0();return _0x55ab=function(_0x55ab05,_0xc87daa){_0x55ab05=_0x55ab05-0xcf;let _0x4f60d4=_0x57f0b7[_0x55ab05];return _0x4f60d4;},_0x55ab(_0x12252a,_0x4da860);}function _0x57f0(){const _0x2f70b9=['registerCustomRangeInterceptor','_config','CUSTOM_RANGE','isActive','getCustomRanges','reset','_buildDocViewModel','Disposable','_docStateChangeParams$','_context','_interceptorsByName','doc.mutation.rich-text-editing','_setCurrentSelectionNotRefresh','textRanges','object','dispose','range','docStateChangeParams$','dispose$','3650652rLlJqs','disposeWithMe','getCustomRange','_initSelectionChange','getOwnPropertyDescriptor','_transformCustomRange','__decorateClass$1','4021032MZKrRR','getCustomDecorations','rxjs','DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY','DocSelectionManagerService','subscribe','ICommandService','UniverDocsPlugin','_textSelectionInfo','getCurrentTypeOfUnit$','getCustomDecorationRaw','exports','getUnitId','endIndex','intercept','_configService','DocSkeletonManagerService','__decorateClass$3','DocCustomRangeController','_localeService','RxDisposable','_currentSkeleton$','map','getSnapshot','_skeleton','getActiveTextRange','wholeEntity','DOC_INTERCEPTOR_POINT','__decorateParam$4','fetchThroughInterceptors','startIndex','UNIVER_DOC','_docViewModel','_listenCurrentUnit','getTextRanges','DisposableCollection','docs.config','segmentViewModels$','replaceDocRanges','add','defineProperty','_getTextRanges','min','some','Module','_initializeDependencies','92ubzYfo','__replaceTextRangesWithNoRefresh','_currentViewModel$','35718JOayCf','push','createInterceptorKey','UniverEngineRender','length','function','Injector','5mhaCwE','currentViewModel$','refreshSelection$','remove','textSelection$','DOCS_NORMAL_EDITOR_UNIT_ID_KEY','getActiveRectRange','_addByParam','NORMAL_TEXT_SELECTION_PLUGIN_STYLE','filter','_refresh','8VbmGRa','unit','startOffset','onStarting','replaceTextRanges','UniverCore','registerCommand','endOffset','next','_buildSkeleton','sort','_textSelectionManagerService','pluginName','setConfig','doc.operation.set-selections','__decorateClass$4','__decorateParam$1','_currentSkeletonBefore$','get','JSONX','675730aEeFPc','getUniverDocInstance','BehaviorSubject','CUSTOM_DECORATION','symbol','_refreshSelection$','pipe','__TEST_ONLY_add','_textSelection$','getDataModel','RichTextEditingMutation','Plugin','getRectRanges','complete','calculate','getViewModel','getUnit','has','_currentSelection','@univerjs/core','name','__decorateClass','getDocRanges','getSkeleton','onCommandExecuted','_injector','composeInterceptors','isInternalEditorID','_commandService','UniverDocs','asObservable','takeUntil','IUniverInstanceService','set','emitStateChangeInfo','_docSkeletonManagerService','Inject','forEach','priority','MUTATION','interceptDocumentViewModel','45764IyCcyY','handler','refreshSelection','21511420QKmIBl','_update','currentSkeleton$','UniverInstanceType','__decorateParam$3','unitId','getRenderById','_univerInstanceService','5330535mRxeEV','toStringTag','CommandType','_initializeCommands','IRenderManagerService','toDisposable','_replaceByParam','getCustomRangeRaw','invertWithDoc','disabled','DocInterceptorService','DocStateEmitService','find','onReady','apply','__TEST_ONLY_setCurrentSelection'];_0x57f0=function(){return _0x2f70b9;};return _0x57f0();}(function(_0x5a38ca,_0x2be335){const _0x445e79=_0x55ab,_0x831a98=_0x5a38ca();while(!![]){try{const _0x28eda1=-parseInt(_0x445e79(0x16e))/0x1+-parseInt(_0x445e79(0x145))/0x2*(parseInt(_0x445e79(0x148))/0x3)+-parseInt(_0x445e79(0xe2))/0x4*(parseInt(_0x445e79(0x14f))/0x5)+parseInt(_0x445e79(0x117))/0x6+parseInt(_0x445e79(0xed))/0x7*(-parseInt(_0x445e79(0x15a))/0x8)+-parseInt(_0x445e79(0x110))/0x9+parseInt(_0x445e79(0xe5))/0xa;if(_0x28eda1===_0x2be335)break;else _0x831a98['push'](_0x831a98['shift']());}catch(_0x1a498a){_0x831a98['push'](_0x831a98['shift']());}}}(_0x57f0,0x66606),function(_0x1a8b22,_0x26b40b){const _0xc83f8f=_0x55ab;typeof exports==_0xc83f8f(0x10b)&&typeof module<'u'?_0x26b40b(exports,require(_0xc83f8f(0x181)),require('@univerjs/engine-render'),require(_0xc83f8f(0x119))):typeof define==_0xc83f8f(0x14d)&&define['amd']?define([_0xc83f8f(0x122),_0xc83f8f(0x181),'@univerjs/engine-render',_0xc83f8f(0x119)],_0x26b40b):(_0x1a8b22=typeof globalThis<'u'?globalThis:_0x1a8b22||self,_0x26b40b(_0x1a8b22[_0xc83f8f(0xd6)]={},_0x1a8b22[_0xc83f8f(0x15f)],_0x1a8b22[_0xc83f8f(0x14b)],_0x1a8b22[_0xc83f8f(0x119)]));}(this,function(_0x1f2621,_0x5f1d22,_0xae8a34,_0x2bcb67){'use strict';const _0x5685c8=_0x55ab;var _0x12dbab=Object[_0x5685c8(0x13f)],_0x259a12=(_0x2d57ec,_0x4d42eb,_0x11ae79)=>_0x4d42eb in _0x2d57ec?_0x12dbab(_0x2d57ec,_0x4d42eb,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x11ae79}):_0x2d57ec[_0x4d42eb]=_0x11ae79,_0x443f70=(_0x1f852e,_0x559eba)=>_0x12dbab(_0x1f852e,_0x5685c8(0x182),{'value':_0x559eba,'configurable':!0x0}),_0x41f9d6=(_0x3d70f1,_0x4d9a8b,_0x3513b1)=>_0x259a12(_0x3d70f1,typeof _0x4d9a8b!=_0x5685c8(0x172)?_0x4d9a8b+'':_0x4d9a8b,_0x3513b1),_0x50998a,_0x226800,_0x3c34af,_0x352e6c,_0x421302;const _0x124062={'id':_0x5685c8(0x168),'type':_0x5f1d22[_0x5685c8(0xef)]['OPERATION'],'handler':_0x443f70((_0x537e57,_0x41b333)=>!0x0,'handler')};var _0x379b39=Object[_0x5685c8(0x13f)],_0x2e19a7=Object[_0x5685c8(0x114)],_0x1d4e7f=_0x443f70((_0x29d95,_0x1e530d,_0x364ec2,_0x3483b1)=>{const _0x3cdc1d=_0x5685c8;for(var _0x278d56=_0x3483b1>0x1?void 0x0:_0x3483b1?_0x2e19a7(_0x1e530d,_0x364ec2):_0x1e530d,_0x1e15a7=_0x29d95[_0x3cdc1d(0x14c)]-0x1,_0x40515e;_0x1e15a7>=0x0;_0x1e15a7--)(_0x40515e=_0x29d95[_0x1e15a7])&&(_0x278d56=(_0x3483b1?_0x40515e(_0x1e530d,_0x364ec2,_0x278d56):_0x40515e(_0x278d56))||_0x278d56);return _0x3483b1&&_0x278d56&&_0x379b39(_0x1e530d,_0x364ec2,_0x278d56),_0x278d56;},_0x5685c8(0x169)),_0x107eb1=_0x443f70((_0x5cde12,_0xcca127)=>(_0x4879e2,_0x4ee4cd)=>_0xcca127(_0x4879e2,_0x4ee4cd,_0x5cde12),_0x5685c8(0x133));_0x1f2621['DocSelectionManagerService']=(_0x50998a=class extends _0x5f1d22[_0x5685c8(0x12b)]{constructor(_0x506f5b,_0x23092e){const _0x3b752f=_0x5685c8;super(),_0x41f9d6(this,'_currentSelection',null),_0x41f9d6(this,_0x3b752f(0x11f),new Map()),_0x41f9d6(this,_0x3b752f(0x176),new _0x2bcb67[(_0x3b752f(0x170))](null)),_0x41f9d6(this,_0x3b752f(0x153),this[_0x3b752f(0x176)]['asObservable']()),_0x41f9d6(this,_0x3b752f(0x173),new _0x2bcb67[(_0x3b752f(0x170))](null)),_0x41f9d6(this,_0x3b752f(0x151),this[_0x3b752f(0x173)][_0x3b752f(0xd7)]()),(this[_0x3b752f(0xd5)]=_0x506f5b,this[_0x3b752f(0xec)]=_0x23092e,this[_0x3b752f(0x138)]());}[_0x5685c8(0x138)](){const _0x239a29=_0x5685c8;this['_univerInstanceService'][_0x239a29(0x120)](_0x5f1d22[_0x239a29(0xe8)][_0x239a29(0x136)])[_0x239a29(0x174)](_0x2bcb67['takeUntil'](this[_0x239a29(0x10f)]))[_0x239a29(0x11c)](_0x3b51e2=>{const _0x13f0d8=_0x239a29;if(_0x3b51e2==null)return;const _0x1f92cd=_0x3b51e2[_0x13f0d8(0x123)]();this[_0x13f0d8(0x109)]({'unitId':_0x1f92cd,'subUnitId':_0x1f92cd});});}['__getCurrentSelection'](){const _0x529083=_0x5685c8;return this[_0x529083(0x180)];}['getSelectionInfo'](_0x66cceb=this['_currentSelection']){const _0x431529=_0x5685c8;return this[_0x431529(0x140)](_0x66cceb);}[_0x5685c8(0xe4)](_0x454a16=this[_0x5685c8(0x180)]){_0x454a16!=null&&this['_refresh'](_0x454a16);}[_0x5685c8(0xfc)](_0x433b08){const _0x57f77d=_0x5685c8;this[_0x57f77d(0x180)]=_0x433b08,this['_refresh'](_0x433b08);}[_0x5685c8(0x139)](_0x667c72=this[_0x5685c8(0x180)]){const _0x5d761b=_0x5685c8;var _0x201cc5;return(_0x201cc5=this[_0x5d761b(0x140)](_0x667c72))==null?void 0x0:_0x201cc5[_0x5d761b(0x10a)];}[_0x5685c8(0x17a)](_0x16f8a9=this[_0x5685c8(0x180)]){const _0x602bf7=_0x5685c8;var _0x46ddc9;return(_0x46ddc9=this[_0x602bf7(0x140)](_0x16f8a9))==null?void 0x0:_0x46ddc9['rectRanges'];}[_0x5685c8(0xcf)](_0x4c7e4c=this['_currentSelection']){const _0x378eb0=_0x5685c8;var _0x11d00b,_0x22a344;const _0x326fd7=(_0x11d00b=this[_0x378eb0(0x139)](_0x4c7e4c))!=null?_0x11d00b:[],_0x1da309=(_0x22a344=this['getRectRanges'](_0x4c7e4c))!=null?_0x22a344:[];return[..._0x326fd7,..._0x1da309]['filter'](_0xd15739=>_0xd15739['startOffset']!=null&&_0xd15739['endOffset']!=null)[_0x378eb0(0x164)]((_0x213efa,_0x30e79a)=>_0x213efa['startOffset']>_0x30e79a[_0x378eb0(0x15c)]?0x1:_0x213efa[_0x378eb0(0x15c)]<_0x30e79a['startOffset']?-0x1:0x0);}[_0x5685c8(0x130)](){const _0x31136e=_0x5685c8,_0x4192e3=this[_0x31136e(0x140)](this[_0x31136e(0x180)]);if(_0x4192e3==null)return;const {textRanges:_0x581454}=_0x4192e3;return _0x581454['find'](_0x20ff8b=>_0x20ff8b['isActive']);}[_0x5685c8(0x155)](){const _0x221d65=_0x5685c8,_0x3ef28e=this[_0x221d65(0x140)](this['_currentSelection']);if(_0x3ef28e==null)return;const {rectRanges:_0x4180ad}=_0x3ef28e;return _0x4180ad[_0x221d65(0xf9)](_0x21d73e=>_0x21d73e[_0x221d65(0x100)]);}[_0x5685c8(0x175)](_0x410366,_0x4d40ad=!0x0){const _0x1824ec=_0x5685c8;this[_0x1824ec(0x180)]!=null&&this['_addByParam']({...this[_0x1824ec(0x180)],'textRanges':_0x410366,'rectRanges':[],'segmentId':'','segmentPage':-0x1,'isEditing':_0x4d40ad,'style':_0xae8a34[_0x1824ec(0x157)]});}[_0x5685c8(0x15e)](_0x245f4b,_0x5e9b7c=!0x0,_0x2f6954){const _0x540567=_0x5685c8;return this[_0x540567(0x13d)](_0x245f4b,this[_0x540567(0x180)],_0x5e9b7c,_0x2f6954);}[_0x5685c8(0x13d)](_0x546599,_0x579fad=this[_0x5685c8(0x180)],_0x11131f=!0x0,_0x20c3b1){const _0x4c2b2b=_0x5685c8;if(_0x579fad==null)return;const {unitId:_0x597155,subUnitId:_0x4b889c}=_0x579fad;this[_0x4c2b2b(0x173)][_0x4c2b2b(0x162)]({'unitId':_0x597155,'subUnitId':_0x4b889c,'docRanges':_0x546599,'isEditing':_0x11131f,'options':_0x20c3b1});}[_0x5685c8(0x146)](_0x4e5212){const _0x117c2e=_0x5685c8;if(this['_currentSelection']==null)return;const _0x420911={...this['_currentSelection'],..._0x4e5212};this[_0x117c2e(0xf3)](_0x420911),this[_0x117c2e(0x176)][_0x117c2e(0x162)](_0x420911);const {unitId:_0x150b64,subUnitId:_0x105484,segmentId:_0x2b8831,style:_0x1e083f,textRanges:_0x42ebb3,rectRanges:_0x2d0ed8,isEditing:_0x470637}=_0x420911,_0x558bb2=[..._0x42ebb3,..._0x2d0ed8][_0x117c2e(0x158)](_0x4ceb22=>_0x4ceb22['startOffset']!=null&&_0x4ceb22[_0x117c2e(0x161)]!=null)[_0x117c2e(0x164)]((_0x13b0a5,_0xcf7d1)=>_0x13b0a5[_0x117c2e(0x15c)]>_0xcf7d1['startOffset']?0x1:_0x13b0a5[_0x117c2e(0x15c)]<_0xcf7d1[_0x117c2e(0x15c)]?-0x1:0x0);this['_commandService']['executeCommand'](_0x124062['id'],{'unitId':_0x150b64,'subUnitId':_0x105484,'segmentId':_0x2b8831,'style':_0x1e083f,'isEditing':_0x470637,'ranges':_0x558bb2});}[_0x5685c8(0x10c)](){const _0x147732=_0x5685c8;this[_0x147732(0x176)][_0x147732(0x17b)]();}['_setCurrentSelectionNotRefresh'](_0x4e8582){const _0x439c72=_0x5685c8;this[_0x439c72(0x180)]=_0x4e8582;}[_0x5685c8(0x140)](_0x3f098e){const _0x26cd68=_0x5685c8;var _0x3d1f02;if(_0x3f098e==null)return;const {unitId:_0x53c43a,subUnitId:subUnitId=''}=_0x3f098e;return(_0x3d1f02=this[_0x26cd68(0x11f)]['get'](_0x53c43a))==null?void 0x0:_0x3d1f02[_0x26cd68(0x16c)](subUnitId);}[_0x5685c8(0x159)](_0x3288c5){const _0x2df292=_0x5685c8,_0x28dca2=this[_0x2df292(0x140)](_0x3288c5);if(_0x28dca2==null)return;const {textRanges:_0x427f59,rectRanges:_0x6679}=_0x28dca2,_0x2611c4=[..._0x427f59,..._0x6679],{unitId:_0x19f1cc,subUnitId:_0x4859ca}=_0x3288c5;this[_0x2df292(0x173)][_0x2df292(0x162)]({'unitId':_0x19f1cc,'subUnitId':_0x4859ca,'docRanges':_0x2611c4,'isEditing':!0x1});}[_0x5685c8(0xf3)](_0x286603){const _0x767160=_0x5685c8,{unitId:_0x56ffec,subUnitId:_0x193623,..._0xf2b8ea}=_0x286603;this[_0x767160(0x11f)][_0x767160(0x17f)](_0x56ffec)||this[_0x767160(0x11f)][_0x767160(0xda)](_0x56ffec,new Map()),this['_textSelectionInfo'][_0x767160(0x16c)](_0x56ffec)[_0x767160(0xda)](_0x193623,{..._0xf2b8ea});}[_0x5685c8(0x156)](_0x1d2d35){const _0x3cd7a5=_0x5685c8,{unitId:_0x14fffe,subUnitId:_0x397d02,..._0x5d4439}=_0x1d2d35;this[_0x3cd7a5(0x11f)][_0x3cd7a5(0x17f)](_0x14fffe)||this[_0x3cd7a5(0x11f)][_0x3cd7a5(0xda)](_0x14fffe,new Map());const _0x1583e6=this[_0x3cd7a5(0x11f)][_0x3cd7a5(0x16c)](_0x14fffe);_0x1583e6[_0x3cd7a5(0x17f)](_0x397d02)?_0x1583e6[_0x3cd7a5(0x16c)](_0x397d02)[_0x3cd7a5(0x10a)][_0x3cd7a5(0x149)](..._0x1d2d35[_0x3cd7a5(0x10a)]):_0x1583e6[_0x3cd7a5(0xda)](_0x397d02,{..._0x5d4439});}},_0x443f70(_0x50998a,_0x5685c8(0x11b)),_0x50998a),_0x1f2621[_0x5685c8(0x11b)]=_0x1d4e7f([_0x107eb1(0x0,_0x5f1d22[_0x5685c8(0x11d)]),_0x107eb1(0x1,_0x5f1d22[_0x5685c8(0xd9)])],_0x1f2621[_0x5685c8(0x11b)]);var _0x3d345e=Object['defineProperty'],_0x2d07af=Object[_0x5685c8(0x114)],_0x35561a=_0x443f70((_0x4c734a,_0x5f5a0f,_0x43edc3,_0x5765b3)=>{const _0x5dfed2=_0x5685c8;for(var _0x3487af=_0x5765b3>0x1?void 0x0:_0x5765b3?_0x2d07af(_0x5f5a0f,_0x43edc3):_0x5f5a0f,_0x3200cc=_0x4c734a[_0x5dfed2(0x14c)]-0x1,_0xb0e6cf;_0x3200cc>=0x0;_0x3200cc--)(_0xb0e6cf=_0x4c734a[_0x3200cc])&&(_0x3487af=(_0x5765b3?_0xb0e6cf(_0x5f5a0f,_0x43edc3,_0x3487af):_0xb0e6cf(_0x3487af))||_0x3487af);return _0x5765b3&&_0x3487af&&_0x3d345e(_0x5f5a0f,_0x43edc3,_0x3487af),_0x3487af;},_0x5685c8(0x128)),_0x1d0246=_0x443f70((_0x482c12,_0x1eaed2)=>(_0xea9457,_0x169e04)=>_0x1eaed2(_0xea9457,_0x169e04,_0x482c12),_0x5685c8(0xe9));_0x1f2621['DocSkeletonManagerService']=(_0x226800=class extends _0x5f1d22[_0x5685c8(0x12b)]{constructor(_0xabc28c,_0x55e0d0,_0x6b9601){const _0x119c6a=_0x5685c8;super(),_0x41f9d6(this,_0x119c6a(0x12f)),_0x41f9d6(this,'_docViewModel'),_0x41f9d6(this,'_currentSkeleton$',new _0x2bcb67[(_0x119c6a(0x170))](null)),_0x41f9d6(this,_0x119c6a(0xe7),this['_currentSkeleton$'][_0x119c6a(0xd7)]()),_0x41f9d6(this,'_currentSkeletonBefore$',new _0x2bcb67[(_0x119c6a(0x170))](null)),_0x41f9d6(this,'currentSkeletonBefore$',this[_0x119c6a(0x16b)][_0x119c6a(0xd7)]()),_0x41f9d6(this,'_currentViewModel$',new _0x2bcb67[(_0x119c6a(0x170))](null)),_0x41f9d6(this,_0x119c6a(0x150),this[_0x119c6a(0x147)]['asObservable']()),(this[_0x119c6a(0x106)]=_0xabc28c,this[_0x119c6a(0x12a)]=_0x55e0d0,this[_0x119c6a(0xec)]=_0x6b9601,this['_init'](),this['_univerInstanceService'][_0x119c6a(0x120)](_0x5f1d22[_0x119c6a(0xe8)][_0x119c6a(0x136)])[_0x119c6a(0x174)](_0x2bcb67[_0x119c6a(0xd8)](this['dispose$']))[_0x119c6a(0x11c)](_0x539006=>{const _0x56ddc5=_0x119c6a;_0x539006&&_0x539006['getUnitId']()===this['_context'][_0x56ddc5(0xea)]&&this[_0x56ddc5(0xe6)](_0x539006);}));}[_0x5685c8(0x10c)](){const _0x2abf9a=_0x5685c8;super['dispose'](),this[_0x2abf9a(0x16b)][_0x2abf9a(0x17b)](),this[_0x2abf9a(0x12c)][_0x2abf9a(0x17b)]();}[_0x5685c8(0xd0)](){const _0x556e18=_0x5685c8;return this[_0x556e18(0x12f)];}[_0x5685c8(0x17d)](){const _0x3dcc02=_0x5685c8;return this[_0x3dcc02(0x137)];}['_init'](){const _0x19bc69=_0x5685c8,_0x289133=this[_0x19bc69(0x106)][_0x19bc69(0x15b)];this[_0x19bc69(0xe6)](_0x289133);}['_update'](_0x162013){const _0x3dd697=_0x5685c8,_0x37547d=this[_0x3dd697(0x106)][_0x3dd697(0xea)];if(_0x162013['getBody']()==null)return;this[_0x3dd697(0x137)]&&_0x5f1d22[_0x3dd697(0xd4)](_0x37547d)?(this[_0x3dd697(0x137)][_0x3dd697(0x102)](_0x162013),this[_0x3dd697(0x106)][_0x3dd697(0x15b)]=_0x162013):this[_0x3dd697(0x137)]||(this['_docViewModel']=this[_0x3dd697(0x103)](_0x162013)),this['_skeleton']||(this[_0x3dd697(0x12f)]=this[_0x3dd697(0x163)](this[_0x3dd697(0x137)]));const _0x257a43=this[_0x3dd697(0x12f)];_0x257a43[_0x3dd697(0x17c)](),this[_0x3dd697(0x16b)]['next'](_0x257a43),this[_0x3dd697(0x12c)][_0x3dd697(0x162)](_0x257a43),this[_0x3dd697(0x147)]['next'](this[_0x3dd697(0x137)]);}[_0x5685c8(0x163)](_0x1a7e49){const _0x13a194=_0x5685c8;return _0xae8a34['DocumentSkeleton']['create'](_0x1a7e49,this[_0x13a194(0x12a)]);}['_buildDocViewModel'](_0x432cd4){return new _0xae8a34['DocumentViewModel'](_0x432cd4);}},_0x443f70(_0x226800,_0x5685c8(0x127)),_0x226800),_0x1f2621[_0x5685c8(0x127)]=_0x35561a([_0x1d0246(0x1,_0x5f1d22[_0x5685c8(0xdd)](_0x5f1d22['LocaleService'])),_0x1d0246(0x2,_0x5f1d22['IUniverInstanceService'])],_0x1f2621[_0x5685c8(0x127)]);const _0x579e65=class _0x454ca2 extends _0x5f1d22[_0x5685c8(0x12b)]{constructor(){const _0x3ad324=_0x5685c8;super(),_0x41f9d6(this,_0x3ad324(0x105),new _0x2bcb67['BehaviorSubject'](null)),_0x41f9d6(this,_0x3ad324(0x10e),this[_0x3ad324(0x105)]['asObservable']());}[_0x5685c8(0xdb)](_0x1d19fd){const _0xab5b9d=_0x5685c8;this[_0xab5b9d(0x105)][_0xab5b9d(0x162)](_0x1d19fd);}[_0x5685c8(0x10c)](){const _0x41ed75=_0x5685c8;super[_0x41ed75(0x10c)](),this[_0x41ed75(0x105)][_0x41ed75(0x17b)]();}};_0x443f70(_0x579e65,_0x5685c8(0xf8));let _0x24acd8=_0x579e65;const _0x42ab23=_0x5685c8(0x108),_0x93f62c={'id':_0x42ab23,'type':_0x5f1d22['CommandType'][_0x5685c8(0xe0)],'handler':_0x443f70((_0x4b66e1,_0x216ad4)=>{const _0x5314a8=_0x5685c8;var _0x571844,_0x3f8cb6;const {unitId:_0x289024,segmentId:segmentId='',actions:_0x4d3ecb,textRanges:_0x2bd06c,prevTextRanges:_0x5b7eb9,trigger:_0x154ece,noHistory:_0x3f070a,isCompositionEnd:_0x30fdcf,noNeedSetTextRange:_0x421fec,debounce:_0x40e665}=_0x216ad4,_0x4c3993=_0x4b66e1[_0x5314a8(0x16c)](_0x5f1d22[_0x5314a8(0xd9)]),_0x53fcb6=_0x4b66e1['get'](_0xae8a34[_0x5314a8(0xf1)]),_0x22c152=_0x4b66e1[_0x5314a8(0x16c)](_0x24acd8),_0x244ff1=_0x4c3993[_0x5314a8(0x16f)](_0x289024),_0x271cea=(_0x571844=_0x53fcb6[_0x5314a8(0xeb)](_0x289024))==null?void 0x0:_0x571844['with'](_0x1f2621[_0x5314a8(0x127)])[_0x5314a8(0x17d)]();if(_0x244ff1==null||_0x271cea==null)throw new Error('DocumentDataModel\x20or\x20documentViewModel\x20not\x20found\x20for\x20unitId:\x20'+_0x289024);const _0x41aaf6=_0x4b66e1[_0x5314a8(0x16c)](_0x1f2621[_0x5314a8(0x11b)]),_0x5f1984=(_0x3f8cb6=_0x41aaf6[_0x5314a8(0xcf)]())!=null?_0x3f8cb6:[],_0x40f756=!!_0x244ff1[_0x5314a8(0x12e)]()[_0x5314a8(0xf6)];if(_0x5f1d22[_0x5314a8(0x16d)]['isNoop'](_0x4d3ecb)||_0x4d3ecb&&_0x4d3ecb['length']===0x0||_0x40f756)return{'unitId':_0x289024,'actions':[],'textRanges':_0x5f1984};const _0x3bac13=_0x5f1d22['JSONX'][_0x5314a8(0xf5)](_0x4d3ecb,_0x244ff1['getSnapshot']());_0x244ff1[_0x5314a8(0xfb)](_0x4d3ecb),_0x271cea[_0x5314a8(0x102)](_0x244ff1),!_0x421fec&&_0x2bd06c&&_0x154ece!=null&&queueMicrotask(()=>{_0x41aaf6['replaceTextRanges'](_0x2bd06c,!0x0,_0x216ad4['options']);});const _0x9d1767={'commandId':_0x42ab23,'unitId':_0x289024,'segmentId':segmentId,'trigger':_0x154ece,'noHistory':_0x3f070a,'debounce':_0x40e665,'redoState':{'actions':_0x4d3ecb,'textRanges':_0x2bd06c},'undoState':{'actions':_0x3bac13,'textRanges':_0x5b7eb9!=null?_0x5b7eb9:_0x5f1984},'isCompositionEnd':_0x30fdcf};return _0x22c152['emitStateChangeInfo'](_0x9d1767),{'unitId':_0x289024,'actions':_0x3bac13,'textRanges':_0x5f1984};},_0x5685c8(0xe3))},_0x40be37={'id':'doc.mutation.rename-doc','type':_0x5f1d22['CommandType'][_0x5685c8(0xe0)],'handler':_0x443f70((_0x37572f,_0x1c8037)=>{const _0x281e99=_0x5685c8,_0x75c698=_0x37572f[_0x281e99(0x16c)](_0x5f1d22['IUniverInstanceService'])[_0x281e99(0x17e)](_0x1c8037[_0x281e99(0xea)],_0x5f1d22['UniverInstanceType'][_0x281e99(0x136)]);return _0x75c698?(_0x75c698['setName'](_0x1c8037[_0x281e99(0x182)]),!0x0):!0x1;},_0x5685c8(0xe3))},_0x21d796=_0x5685c8(0x13b),_0x41a6c1={};var _0x5606c0=Object[_0x5685c8(0x13f)],_0x2d9c1c=Object['getOwnPropertyDescriptor'],_0x211b77=_0x443f70((_0x3ff018,_0x111c66,_0x5e79f2,_0x4336ef)=>{const _0x4afb5c=_0x5685c8;for(var _0xdf1fb2=_0x4336ef>0x1?void 0x0:_0x4336ef?_0x2d9c1c(_0x111c66,_0x5e79f2):_0x111c66,_0x33ce63=_0x3ff018[_0x4afb5c(0x14c)]-0x1,_0xacf567;_0x33ce63>=0x0;_0x33ce63--)(_0xacf567=_0x3ff018[_0x33ce63])&&(_0xdf1fb2=(_0x4336ef?_0xacf567(_0x111c66,_0x5e79f2,_0xdf1fb2):_0xacf567(_0xdf1fb2))||_0xdf1fb2);return _0x4336ef&&_0xdf1fb2&&_0x5606c0(_0x111c66,_0x5e79f2,_0xdf1fb2),_0xdf1fb2;},'__decorateClass$2'),_0x3af95e=_0x443f70((_0x2ce014,_0x35ec22)=>(_0x573029,_0x550033)=>_0x35ec22(_0x573029,_0x550033,_0x2ce014),'__decorateParam$2');let _0x4502b7=(_0x3c34af=class extends _0x5f1d22['Disposable']{constructor(_0x5e4481,_0x35fe09,_0x2b1239){super(),this['_commandService']=_0x5e4481,this['_textSelectionManagerService']=_0x35fe09,this['_univerInstanceService']=_0x2b1239,this['_initSelectionChange']();}[_0x5685c8(0x115)](_0x49c961,_0x337a27){const _0x8b9892=_0x5685c8;var _0xf013c9;const {startOffset:_0x54daca,endOffset:_0x3331d7,collapsed:_0x54febd}=_0x337a27,_0xc6af7c=(_0xf013c9=_0x49c961[_0x8b9892(0x101)]())==null?void 0x0:_0xf013c9[_0x8b9892(0x158)](_0x46ab54=>!_0x46ab54[_0x8b9892(0x131)]||_0x54daca<=_0x46ab54[_0x8b9892(0x135)]&&_0x3331d7>_0x46ab54[_0x8b9892(0x124)]?!0x1:_0x54febd?_0x46ab54['startIndex']<_0x54daca&&_0x46ab54[_0x8b9892(0x124)]>=_0x3331d7:_0x5f1d22['BuildTextUtils'][_0x8b9892(0x10d)]['isIntersects'](_0x54daca,_0x3331d7-0x1,_0x46ab54[_0x8b9892(0x135)],_0x46ab54['endIndex']));if(_0xc6af7c!=null&&_0xc6af7c[_0x8b9892(0x14c)]){let _0x50754e=_0x54daca,_0x51710c=_0x3331d7;return _0xc6af7c[_0x8b9892(0xde)](_0x367461=>{const _0x37718c=_0x8b9892;_0x50754e=Math[_0x37718c(0x141)](_0x367461[_0x37718c(0x135)],_0x50754e),_0x51710c=Math['max'](_0x367461[_0x37718c(0x124)]+0x1,_0x51710c);}),{..._0x337a27,'startOffset':_0x50754e,'endOffset':_0x51710c,'collapsed':_0x50754e===_0x51710c};}return _0x337a27;}[_0x5685c8(0x113)](){const _0x5c5f0e=_0x5685c8;this[_0x5c5f0e(0x111)](this[_0x5c5f0e(0xd5)][_0x5c5f0e(0xd1)](_0x4ff3da=>{const _0x3d8ed9=_0x5c5f0e;if(_0x4ff3da['id']===_0x124062['id']){const _0x1c174e=_0x4ff3da['params'],{unitId:_0x325fdc,ranges:_0x1c0eac,isEditing:_0x55de4a}=_0x1c174e,_0xc468f2=this['_univerInstanceService'][_0x3d8ed9(0x17e)](_0x325fdc);if(!_0xc468f2)return;const _0x2532f2=_0x1c0eac[_0x3d8ed9(0x12d)](_0x325ee6=>this[_0x3d8ed9(0x115)](_0xc468f2,_0x325ee6));_0x2532f2[_0x3d8ed9(0x142)]((_0xddb4b6,_0x4b2758)=>_0x1c0eac[_0x4b2758]!==_0xddb4b6)&&this[_0x3d8ed9(0x165)]['replaceTextRanges'](_0x2532f2,_0x55de4a);}}));}},_0x443f70(_0x3c34af,_0x5685c8(0x129)),_0x3c34af);_0x4502b7=_0x211b77([_0x3af95e(0x0,_0x5f1d22[_0x5685c8(0x11d)]),_0x3af95e(0x1,_0x5f1d22[_0x5685c8(0xdd)](_0x1f2621[_0x5685c8(0x11b)])),_0x3af95e(0x2,_0x5f1d22[_0x5685c8(0xd9)])],_0x4502b7);var _0x8544ef=Object[_0x5685c8(0x13f)],_0x4429cd=Object[_0x5685c8(0x114)],_0x4352b8=_0x443f70((_0x1f0b6f,_0x129f6c,_0x5cf6b5,_0x344efd)=>{const _0x557d69=_0x5685c8;for(var _0xc41bde=_0x344efd>0x1?void 0x0:_0x344efd?_0x4429cd(_0x129f6c,_0x5cf6b5):_0x129f6c,_0x33d7ec=_0x1f0b6f[_0x557d69(0x14c)]-0x1,_0x47af91;_0x33d7ec>=0x0;_0x33d7ec--)(_0x47af91=_0x1f0b6f[_0x33d7ec])&&(_0xc41bde=(_0x344efd?_0x47af91(_0x129f6c,_0x5cf6b5,_0xc41bde):_0x47af91(_0xc41bde))||_0xc41bde);return _0x344efd&&_0xc41bde&&_0x8544ef(_0x129f6c,_0x5cf6b5,_0xc41bde),_0xc41bde;},_0x5685c8(0x116)),_0x37fb60=_0x443f70((_0x4ecc21,_0x2960ea)=>(_0xa29d53,_0x1bfa89)=>_0x2960ea(_0xa29d53,_0x1bfa89,_0x4ecc21),_0x5685c8(0x16a));const _0x3062d5='DOCS_PLUGIN';_0x1f2621[_0x5685c8(0x11e)]=(_0x352e6c=class extends _0x5f1d22[_0x5685c8(0x179)]{constructor(_0x6f59da=_0x41a6c1,_0x376102,_0xd38b0e){const _0x41f6bd=_0x5685c8;super(),this[_0x41f6bd(0xfe)]=_0x6f59da,this['_injector']=_0x376102,this[_0x41f6bd(0x126)]=_0xd38b0e;const {..._0x1ac9b7}=this[_0x41f6bd(0xfe)];this['_configService'][_0x41f6bd(0x167)](_0x21d796,_0x1ac9b7);}[_0x5685c8(0x15d)](){const _0x5d6b7a=_0x5685c8;this[_0x5d6b7a(0x144)](),this[_0x5d6b7a(0xf0)]();}[_0x5685c8(0xf0)](){const _0x711eaa=_0x5685c8;[_0x93f62c,_0x40be37,_0x124062][_0x711eaa(0xde)](_0x1ca03a=>{const _0x47b478=_0x711eaa;this[_0x47b478(0xd2)]['get'](_0x5f1d22['ICommandService'])[_0x47b478(0x160)](_0x1ca03a);});}[_0x5685c8(0x144)](){const _0x52be36=_0x5685c8;[[_0x1f2621[_0x52be36(0x11b)]],[_0x24acd8],[_0x4502b7]][_0x52be36(0xde)](_0x5edd6c=>this['_injector'][_0x52be36(0x13e)](_0x5edd6c));}[_0x5685c8(0xfa)](){this['_injector']['get'](_0x4502b7);}},_0x443f70(_0x352e6c,_0x5685c8(0x11e)),_0x41f9d6(_0x352e6c,_0x5685c8(0x166),_0x3062d5),_0x352e6c),_0x1f2621[_0x5685c8(0x11e)]=_0x4352b8([_0x37fb60(0x1,_0x5f1d22['Inject'](_0x5f1d22[_0x5685c8(0x14e)])),_0x37fb60(0x2,_0x5f1d22['IConfigService'])],_0x1f2621[_0x5685c8(0x11e)]);const _0x246a35=_0x5f1d22[_0x5685c8(0x14a)](_0x5685c8(0xff)),_0xe0665b=_0x5f1d22[_0x5685c8(0x14a)](_0x5685c8(0x171)),_0x4c8e14={'CUSTOM_RANGE':_0x246a35,'CUSTOM_DECORATION':_0xe0665b};var _0x2cdd64=Object[_0x5685c8(0x13f)],_0x1d4cbd=Object['getOwnPropertyDescriptor'],_0x31cf6f=_0x443f70((_0x2508f1,_0x322588,_0x589126,_0x1b5e60)=>{const _0x2af878=_0x5685c8;for(var _0x144f7d=_0x1b5e60>0x1?void 0x0:_0x1b5e60?_0x1d4cbd(_0x322588,_0x589126):_0x322588,_0x4256ef=_0x2508f1[_0x2af878(0x14c)]-0x1,_0x35836c;_0x4256ef>=0x0;_0x4256ef--)(_0x35836c=_0x2508f1[_0x4256ef])&&(_0x144f7d=(_0x1b5e60?_0x35836c(_0x322588,_0x589126,_0x144f7d):_0x35836c(_0x144f7d))||_0x144f7d);return _0x1b5e60&&_0x144f7d&&_0x2cdd64(_0x322588,_0x589126,_0x144f7d),_0x144f7d;},_0x5685c8(0x183)),_0x560da9=_0x443f70((_0x287284,_0x541190)=>(_0x3c532f,_0x5cf012)=>_0x541190(_0x3c532f,_0x5cf012,_0x287284),'__decorateParam');_0x1f2621[_0x5685c8(0xf7)]=(_0x421302=class extends _0x5f1d22[_0x5685c8(0x104)]{constructor(_0x32171f,_0x35856a){const _0xc7221c=_0x5685c8;super(),_0x41f9d6(this,'_interceptorsByName',new Map()),(this[_0xc7221c(0x106)]=_0x32171f,this[_0xc7221c(0xdc)]=_0x35856a);const _0x2b0366=this[_0xc7221c(0xdc)][_0xc7221c(0x17d)](),_0x1eb805=_0x2b0366[_0xc7221c(0x177)]()[_0xc7221c(0x123)]();if(_0x1eb805===_0x5f1d22[_0xc7221c(0x154)]||_0x1eb805===_0x5f1d22[_0xc7221c(0x11a)])return;this[_0xc7221c(0x111)](this['interceptDocumentViewModel'](_0x2b0366)),this[_0xc7221c(0x111)](this[_0xc7221c(0x125)](_0x4c8e14['CUSTOM_RANGE'],{'priority':-0x1,'handler':_0x443f70((_0xba47b5,_0x3d339a,_0x13fdbb)=>_0x13fdbb(_0xba47b5),_0xc7221c(0xe3))}));let _0x1b94d1=new _0x5f1d22[(_0xc7221c(0x13a))]();_0x2b0366[_0xc7221c(0x13c)]['subscribe'](_0x217b21=>{const _0xcb5bfc=_0xc7221c;_0x1b94d1['dispose'](),_0x1b94d1=new _0x5f1d22[(_0xcb5bfc(0x13a))](),_0x217b21['forEach'](_0x3a6d96=>{_0x1b94d1['add'](this['interceptDocumentViewModel'](_0x3a6d96));});}),this[_0xc7221c(0x111)](_0x1b94d1);}[_0x5685c8(0x125)](_0x5f2914,_0x54d9a7){const _0x187c21=_0x5685c8,_0x763e8c=_0x5f2914;this[_0x187c21(0x107)][_0x187c21(0x17f)](_0x763e8c)||this[_0x187c21(0x107)][_0x187c21(0xda)](_0x763e8c,[]);const _0x35bb1c=this[_0x187c21(0x107)][_0x187c21(0x16c)](_0x763e8c);return _0x35bb1c[_0x187c21(0x149)](_0x54d9a7),this[_0x187c21(0x107)][_0x187c21(0xda)](_0x763e8c,_0x35bb1c[_0x187c21(0x164)]((_0x5934de,_0x49b3dd)=>{const _0x5f4bb5=_0x187c21;var _0x4e869d,_0x299d06;return((_0x4e869d=_0x49b3dd[_0x5f4bb5(0xdf)])!=null?_0x4e869d:0x0)-((_0x299d06=_0x5934de['priority'])!=null?_0x299d06:0x0);})),this[_0x187c21(0x111)](_0x5f1d22[_0x187c21(0xf2)](()=>_0x5f1d22[_0x187c21(0x152)](this[_0x187c21(0x107)][_0x187c21(0x16c)](_0x763e8c),_0x54d9a7)));}[_0x5685c8(0x134)](_0x30f79d){const _0xb81617=_0x5685c8,_0x3814e3=_0x30f79d,_0x27d498=this[_0xb81617(0x107)][_0xb81617(0x16c)](_0x3814e3);return _0x5f1d22[_0xb81617(0xd3)](_0x27d498||[]);}[_0x5685c8(0xe1)](_0x453b4a){const _0x1c40a9=_0x5685c8,_0xb2599d=new _0x5f1d22[(_0x1c40a9(0x13a))]();return _0xb2599d[_0x1c40a9(0x13e)](_0x453b4a[_0x1c40a9(0xfd)]({'getCustomRange':_0x443f70(_0x14690b=>{const _0x232a48=_0x1c40a9;var _0x75ac57;return this[_0x232a48(0x134)](_0x4c8e14[_0x232a48(0xff)])(_0x453b4a[_0x232a48(0xf4)](_0x14690b),{'index':_0x14690b,'unitId':_0x453b4a[_0x232a48(0x177)]()[_0x232a48(0x123)](),'customRanges':(_0x75ac57=_0x453b4a[_0x232a48(0x177)]()[_0x232a48(0x101)]())!=null?_0x75ac57:[]});},_0x1c40a9(0x112)),'getCustomDecoration':_0x443f70(_0x422af8=>{const _0x1338f=_0x1c40a9;var _0x1413a4;return this[_0x1338f(0x134)](_0x4c8e14[_0x1338f(0x171)])(_0x453b4a[_0x1338f(0x121)](_0x422af8),{'index':_0x422af8,'unitId':_0x453b4a[_0x1338f(0x177)]()[_0x1338f(0x123)](),'customDecorations':(_0x1413a4=_0x453b4a[_0x1338f(0x177)]()[_0x1338f(0x118)]())!=null?_0x1413a4:[]});},'getCustomDecoration')})),_0xb2599d;}},_0x443f70(_0x421302,_0x5685c8(0xf7)),_0x421302),_0x1f2621[_0x5685c8(0xf7)]=_0x31cf6f([_0x560da9(0x1,_0x5f1d22['Inject'](_0x1f2621[_0x5685c8(0x127)]))],_0x1f2621[_0x5685c8(0xf7)]),_0x1f2621[_0x5685c8(0x132)]=_0x4c8e14,_0x1f2621[_0x5685c8(0xf8)]=_0x24acd8,_0x1f2621[_0x5685c8(0x178)]=_0x93f62c,_0x1f2621['SetTextSelectionsOperation']=_0x124062,Object[_0x5685c8(0x13f)](_0x1f2621,Symbol[_0x5685c8(0xee)],{'value':_0x5685c8(0x143)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs",
|
|
3
|
-
"version": "0.3.0-
|
|
3
|
+
"version": "0.3.0-nightly.202410101606",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UniverSheet normal base-docs",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -47,19 +47,19 @@
|
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"rxjs": ">=7.0.0",
|
|
50
|
-
"@univerjs/core": "0.3.0-
|
|
51
|
-
"@univerjs/engine-render": "0.3.0-
|
|
50
|
+
"@univerjs/core": "0.3.0-nightly.202410101606",
|
|
51
|
+
"@univerjs/engine-render": "0.3.0-nightly.202410101606"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@univerjs/
|
|
55
|
-
"@univerjs/
|
|
54
|
+
"@univerjs/core": "0.3.0-nightly.202410101606",
|
|
55
|
+
"@univerjs/engine-render": "0.3.0-nightly.202410101606"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"rxjs": "^7.8.1",
|
|
59
59
|
"typescript": "^5.6.2",
|
|
60
60
|
"vite": "^5.4.8",
|
|
61
61
|
"vitest": "^2.1.1",
|
|
62
|
-
"@univerjs-infra/shared": "0.3.0
|
|
62
|
+
"@univerjs-infra/shared": "0.3.0"
|
|
63
63
|
},
|
|
64
64
|
"univerSpace": {
|
|
65
65
|
".": {
|
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
"test:watch": "vitest",
|
|
80
80
|
"coverage": "vitest run --coverage",
|
|
81
81
|
"lint:types": "tsc --noEmit",
|
|
82
|
-
"build": "tsc && vite build"
|
|
83
|
-
"sync:cnpm": "cnpm sync"
|
|
82
|
+
"build": "tsc && vite build"
|
|
84
83
|
}
|
|
85
84
|
}
|
package/LICENSE
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|