@univerjs/sheets-zen-editor 0.3.0-alpha.0 → 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 CHANGED
@@ -1,9 +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"),docs=require("@univerjs/docs"),docsUi=require("@univerjs/docs-ui"),engineRender=require("@univerjs/engine-render"),sheetsUi=require("@univerjs/sheets-ui"),ui=require("@univerjs/ui"),rxjs=require("rxjs"),require$$0=require("react"),clsx=require("clsx"),sheets=require("@univerjs/sheets"),OpenZenEditorOperation={id:"zen-editor.operation.open-zen-editor",type:core.CommandType.OPERATION,handler:__name(accessor=>!0,"handler")},_ZenEditorManagerService=class _ZenEditorManagerService{constructor(){__publicField(this,"_position",null);__publicField(this,"_position$",new rxjs.BehaviorSubject(null));__publicField(this,"position$",this._position$.asObservable())}dispose(){this._position$.complete(),this._position=null}setPosition(param){this._position=param,this._refresh(param)}getPosition(){return this._position}_refresh(param){this._position$.next(param)}};__name(_ZenEditorManagerService,"ZenEditorManagerService");let ZenEditorManagerService=_ZenEditorManagerService;const IZenEditorManagerService=core.createIdentifier("univer.sheet-zen-editor-manager.service");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"),_a;let ZenEditorController=(_a=class extends core.RxDisposable{constructor(_univerInstanceService,_zenEditorManagerService,_renderManagerService,_commandService,_zenZoneService,_editorBridgeService,_undoRedoService,_textSelectionManagerService){super();__publicField(this,"_zenEditorInitialState",!1);this._univerInstanceService=_univerInstanceService,this._zenEditorManagerService=_zenEditorManagerService,this._renderManagerService=_renderManagerService,this._commandService=_commandService,this._zenZoneService=_zenZoneService,this._editorBridgeService=_editorBridgeService,this._undoRedoService=_undoRedoService,this._textSelectionManagerService=_textSelectionManagerService,this._initialize()}_initialize(){this._syncZenEditorSize(),this._commandExecutedListener()}_createZenEditorInstance(){const INITIAL_SNAPSHOT={id:core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,body:{dataStream:`${core.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],tables:[],customBlocks:[],paragraphs:[{startIndex:0}],sectionBreaks:[{startIndex:1}]},tableSource:{},documentStyle:{pageSize:{width:595,height:842},documentFlavor:core.DocumentFlavor.MODERN,marginTop:50,marginBottom:50,marginRight:40,marginLeft:40,renderConfig:{vertexAngle:0,centerAngle:0}},drawings:{},drawingsOrder:[]};return this._univerInstanceService.createUnit(core.UniverInstanceType.UNIVER_DOC,INITIAL_SNAPSHOT)}_syncZenEditorSize(){this._zenEditorManagerService.position$.pipe(rxjs.takeUntil(this.dispose$)).subscribe(position=>{var _a4;if(position==null)return;const editorObject=sheetsUi.getEditorObject(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,this._renderManagerService),zenEditorDataModel=this._univerInstanceService.getUniverDocInstance(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(editorObject==null||zenEditorDataModel==null)return;const{width,height}=position,{engine}=editorObject,skeleton=(_a4=this._renderManagerService.getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a4.with(docs.DocSkeletonManagerService).getSkeleton();requestIdleCallback(()=>{engine.resizeBySize(width,height),this._calculatePagePosition(editorObject),skeleton&&this._textSelectionManagerService.refreshSelection()})})}_handleOpenZenEditor(){var _a4,_b;this._zenEditorInitialState||(this._createZenEditorInstance(),this._zenEditorInitialState=!0),this._zenZoneService.open();const currentSheet=this._univerInstanceService.getCurrentUnitForType(core.UniverInstanceType.UNIVER_SHEET);this._undoRedoService.clearUndoRedo(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY),this._univerInstanceService.focusUnit(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY),this._univerInstanceService.setCurrentUnitForType(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY);const docSelectionRenderService=(_a4=this._renderManagerService.getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a4.with(docsUi.DocSelectionRenderService);docSelectionRenderService&&docSelectionRenderService.focus(),this._editorBridgeService.isVisible().visible===!1&&this._editorBridgeService.changeVisible({visible:!0,eventType:engineRender.DeviceInputEventType.PointerDown,unitId:(_b=currentSheet==null?void 0:currentSheet.getUnitId())!=null?_b:""});const editCellState=this._editorBridgeService.getLatestEditCellState();if(editCellState==null)return;this._editorSyncHandler(editCellState);const textRanges=[{startOffset:0,endOffset:0}];this._textSelectionManagerService.replaceTextRanges(textRanges,!1)}_editorSyncHandler(param){var _a4,_b,_c,_d;const body=(_a4=param.documentLayoutObject.documentModel)==null?void 0:_a4.getBody(),dataStream=body==null?void 0:body.dataStream,paragraphs=body==null?void 0:body.paragraphs,customBlocks=body==null?void 0:body.customBlocks,drawings=(_b=param.documentLayoutObject.documentModel)==null?void 0:_b.getDrawings(),drawingsOrder=(_c=param.documentLayoutObject.documentModel)==null?void 0:_c.getDrawingsOrder(),customRanges=body==null?void 0:body.customRanges;let textRuns=[];dataStream==null||!paragraphs&&!customRanges||((_d=body==null?void 0:body.textRuns)!=null&&_d.length&&(textRuns=body==null?void 0:body.textRuns),this._syncContentAndRender(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,dataStream,paragraphs!=null?paragraphs:[],textRuns,customBlocks,drawings,drawingsOrder,customRanges))}_syncContentAndRender(unitId,dataStream,paragraphs,textRuns=[],customBlocks=[],drawings={},drawingsOrder=[],customRanges=[]){var _a4;const INCLUDE_LIST=[core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY],docSkeletonManagerService=(_a4=this._renderManagerService.getRenderById(unitId))==null?void 0:_a4.with(docs.DocSkeletonManagerService),skeleton=docSkeletonManagerService==null?void 0:docSkeletonManagerService.getSkeleton(),docDataModel=this._univerInstanceService.getUniverDocInstance(unitId),docViewModel=docSkeletonManagerService==null?void 0:docSkeletonManagerService.getViewModel();if(docDataModel==null||docViewModel==null||skeleton==null)return;const docBody=docDataModel.getBody(),snapshot=docDataModel.getSnapshot();docBody.dataStream=dataStream,docBody.paragraphs=paragraphs,docBody.customBlocks=customBlocks,docBody.customRanges=customRanges,snapshot.drawings=drawings,snapshot.drawingsOrder=drawingsOrder,docBody.textRuns=textRuns,unitId===core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY&&(docBody.textRuns=[]),docViewModel.reset(docDataModel);const currentRender=this._getDocObject();currentRender!=null&&(skeleton.calculate(),INCLUDE_LIST.includes(unitId)&&currentRender.document.makeDirty())}_calculatePagePosition(currentRender){const{document:docsComponent,scene,docBackground}=currentRender,parent=scene==null?void 0:scene.getParent(),{width:docsWidth,height:docsHeight,pageMarginLeft,pageMarginTop}=docsComponent;if(parent==null||docsWidth===Number.POSITIVE_INFINITY||docsHeight===Number.POSITIVE_INFINITY)return;const{width:engineWidth,height:engineHeight}=parent;let docsLeft=0,docsTop=0,sceneWidth=0,sceneHeight=0,scrollToX=Number.POSITIVE_INFINITY;const{scaleX,scaleY}=scene.getAncestorScale();engineWidth>(docsWidth+pageMarginLeft*2)*scaleX?(docsLeft=engineWidth/2-docsWidth*scaleX/2,docsLeft/=scaleX,sceneWidth=(engineWidth-pageMarginLeft*2)/scaleX,scrollToX=0):(docsLeft=pageMarginLeft,sceneWidth=docsWidth+pageMarginLeft*2,scrollToX=(sceneWidth-engineWidth/scaleX)/2),engineHeight>docsHeight?(docsTop=engineHeight/2-docsHeight/2,sceneHeight=(engineHeight-pageMarginTop*2)/scaleY):(docsTop=pageMarginTop,sceneHeight=docsHeight+pageMarginTop*2),scene.resize(sceneWidth,sceneHeight+200),docsComponent.translate(docsLeft,docsTop),docBackground.translate(docsLeft,docsTop);const viewport=scene.getViewport(docsUi.VIEWPORT_KEY.VIEW_MAIN);if(scrollToX!==Number.POSITIVE_INFINITY&&viewport!=null){const actualX=viewport.transScroll2ViewportScrollValue(scrollToX,0).x;viewport.scrollToBarPos({x:actualX})}return this}_commandExecutedListener(){const updateCommandList=[OpenZenEditorOperation.id];this.disposeWithMe(this._commandService.onCommandExecuted(command=>{updateCommandList.includes(command.id)&&this._handleOpenZenEditor()}));const editCommandList=[docs.RichTextEditingMutation.id];this.disposeWithMe(this._commandService.onCommandExecuted(command=>{if(editCommandList.includes(command.id)){const params=command.params,{unitId}=params;if(unitId===core.DOCS_ZEN_EDITOR_UNIT_ID_KEY){const editorDocDataModel=this._univerInstanceService.getUniverDocInstance(unitId),docBody=editorDocDataModel==null?void 0:editorDocDataModel.getBody(),dataStream=docBody==null?void 0:docBody.dataStream,paragraphs=docBody==null?void 0:docBody.paragraphs,textRuns=docBody==null?void 0:docBody.textRuns,customBlocks=docBody==null?void 0:docBody.customBlocks,drawings=editorDocDataModel==null?void 0:editorDocDataModel.getDrawings(),drawingsOrder=editorDocDataModel==null?void 0:editorDocDataModel.getDrawingsOrder(),customRanges=editorDocDataModel==null?void 0:editorDocDataModel.getCustomRanges();if(this._editorBridgeService.changeEditorDirty(!0),dataStream==null||paragraphs==null)return;this._syncContentAndRender(core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,dataStream,paragraphs,textRuns,customBlocks,drawings,drawingsOrder,customRanges)}}}))}_getDocObject(){return docsUi.getDocObject(this._univerInstanceService,this._renderManagerService)}},__name(_a,"ZenEditorController"),_a);ZenEditorController=__decorateClass$2([core.OnLifecycle(core.LifecycleStages.Steady,ZenEditorController),__decorateParam$2(0,core.IUniverInstanceService),__decorateParam$2(1,IZenEditorManagerService),__decorateParam$2(2,engineRender.IRenderManagerService),__decorateParam$2(3,core.ICommandService),__decorateParam$2(4,ui.IZenZoneService),__decorateParam$2(5,sheetsUi.IEditorBridgeService),__decorateParam$2(6,core.IUndoRedoService),__decorateParam$2(7,core.Inject(docs.DocSelectionManagerService))],ZenEditorController);function scrollToTop(accessor){var _a4;const backScrollController=(_a4=accessor.get(engineRender.IRenderManagerService).getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a4.with(docsUi.DocBackScrollRenderController),textRange={startOffset:0,endOffset:0};backScrollController&&backScrollController.scrollToRange(textRange)}__name(scrollToTop,"scrollToTop");const CancelZenEditCommand={id:"zen-editor.command.cancel-zen-edit",type:core.CommandType.COMMAND,handler:__name(async accessor=>{const zenZoneEditorService=accessor.get(ui.IZenZoneService),editorBridgeService=accessor.get(sheetsUi.IEditorBridgeService),univerInstanceManager=accessor.get(core.IUniverInstanceService);editorBridgeService.isVisible().visible&&editorBridgeService.changeVisible({visible:!1,eventType:engineRender.DeviceInputEventType.Keyboard,keycode:ui.KeyCode.ESC,unitId:""}),zenZoneEditorService.close(),scrollToTop(accessor);const currentSheetInstance=univerInstanceManager.getCurrentUnitForType(core.UniverInstanceType.UNIVER_SHEET);return currentSheetInstance?(univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()),editorBridgeService.refreshEditCellState(),!0):!1},"handler")},ConfirmZenEditCommand={id:"zen-editor.command.confirm-zen-edit",type:core.CommandType.COMMAND,handler:__name(async accessor=>{const zenZoneEditorService=accessor.get(ui.IZenZoneService),editorBridgeService=accessor.get(sheetsUi.IEditorBridgeService),univerInstanceManager=accessor.get(core.IUniverInstanceService);editorBridgeService.isVisible().visible&&editorBridgeService.changeVisible({visible:!1,eventType:engineRender.DeviceInputEventType.PointerDown,unitId:""}),zenZoneEditorService.close(),scrollToTop(accessor);const currentSheetInstance=univerInstanceManager.getCurrentUnitForType(core.UniverInstanceType.UNIVER_SHEET);return currentSheetInstance?(univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()),editorBridgeService.refreshEditCellState(),!0):!1},"handler")};var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;g!==void 0&&(e=""+g),a.key!==void 0&&(e=""+a.key),a.ref!==void 0&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)d[b]===void 0&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}__name(q,"q");reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,__assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n2=arguments.length;i<n2;i++){s=arguments[i];for(var p2 in s)Object.prototype.hasOwnProperty.call(s,p2)&&(t[p2]=s[p2])}return t},__assign.apply(this,arguments)},__rest=function(s,e){var t={};for(var p2 in s)Object.prototype.hasOwnProperty.call(s,p2)&&e.indexOf(p2)<0&&(t[p2]=s[p2]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p2=Object.getOwnPropertySymbols(s);i<p2.length;i++)e.indexOf(p2[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p2[i])&&(t[p2[i]]=s[p2[i]]);return t},IconBase=require$$0.forwardRef(function(props,ref){var icon=props.icon,id=props.id,className=props.className,extend=props.extend,restProps=__rest(props,["icon","id","className","extend"]),cls="univerjs-icon univerjs-icon-".concat(id," ").concat(className||"").trim(),idSuffix=require$$0.useRef("_".concat(generateShortUuid()));return render(icon,"".concat(id),{defIds:icon.defIds,idSuffix:idSuffix.current},__assign({ref,className:cls},restProps),extend)});function render(node,id,runtimeProps,rootProps,extend){return require$$0.createElement(node.tag,__assign(__assign({key:id},replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend)),rootProps),(replaceRuntimeIdsInDefs(node,runtimeProps).children||[]).map(function(child,index){return render(child,"".concat(id,"-").concat(node.tag,"-").concat(index),runtimeProps,void 0,extend)}))}__name(render,"render");function replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend){var attrs=__assign({},node.attrs);extend!=null&&extend.colorChannel1&&attrs.fill==="colorChannel1"&&(attrs.fill=extend.colorChannel1);var defIds=runtimeProps.defIds;return!defIds||defIds.length===0||(node.tag==="use"&&attrs["xlink:href"]&&(attrs["xlink:href"]=attrs["xlink:href"]+runtimeProps.idSuffix),Object.entries(attrs).forEach(function(_a4){var key=_a4[0],value=_a4[1];typeof value=="string"&&(attrs[key]=value.replace(/url\(#(.*)\)/,"url(#$1".concat(runtimeProps.idSuffix,")")))})),attrs}__name(replaceRuntimeIdsAndExtInAttrs,"replaceRuntimeIdsAndExtInAttrs");function replaceRuntimeIdsInDefs(node,runtimeProps){var _a4,defIds=runtimeProps.defIds;return!defIds||defIds.length===0?node:node.tag==="defs"&&(!((_a4=node.children)===null||_a4===void 0)&&_a4.length)?__assign(__assign({},node),{children:node.children.map(function(child){return typeof child.attrs.id=="string"&&defIds&&defIds.indexOf(child.attrs.id)>-1?__assign(__assign({},child),{attrs:__assign(__assign({},child.attrs),{id:child.attrs.id+runtimeProps.idSuffix})}):child})}):node}__name(replaceRuntimeIdsInDefs,"replaceRuntimeIdsInDefs");function generateShortUuid(){return Math.random().toString(36).substring(2,8)}__name(generateShortUuid,"generateShortUuid");IconBase.displayName="UniverIcon";var element$1={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},CheckMarkSingle=require$$0.forwardRef(function(props,ref){return require$$0.createElement(IconBase,Object.assign({},props,{id:"check-mark-single",ref,icon:element$1}))});CheckMarkSingle.displayName="CheckMarkSingle";var element={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z"}}]},CloseSingle=require$$0.forwardRef(function(props,ref){return require$$0.createElement(IconBase,Object.assign({},props,{id:"close-single",ref,icon:element}))});CloseSingle.displayName="CloseSingle";const zenEditor="univer-zen-editor",zenEditorIconWrapper="univer-zen-editor-icon-wrapper",zenEditorIconContainer="univer-zen-editor-icon-container",zenEditorIconSuccess="univer-zen-editor-icon-success",zenEditorIconError="univer-zen-editor-icon-error",zenEditorCanvasContainer="univer-zen-editor-canvas-container",styles={zenEditor,zenEditorIconWrapper,zenEditorIconContainer,zenEditorIconSuccess,zenEditorIconError,zenEditorCanvasContainer},COMPONENT_PREFIX="ZEN_EDITOR_PLUGIN_",ZEN_EDITOR_COMPONENT=`${COMPONENT_PREFIX}ZEN_EDITOR_COMPONENT`;function ZenEditor(){const editorRef=require$$0.useRef(null),renderManagerService=core.useDependency(engineRender.IRenderManagerService),zenEditorManagerService=core.useDependency(IZenEditorManagerService),commandService=core.useDependency(core.ICommandService);require$$0.useEffect(()=>{const editor=editorRef.current;if(!editor)return;const renderSubscription=renderManagerService.currentRender$.subscribe(param=>{var _a4;if(param!==core.DOCS_ZEN_EDITOR_UNIT_ID_KEY)return;const engine=(_a4=renderManagerService.getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a4.engine;engine==null||engine.setContainer(editor)}),resizeObserver=new ResizeObserver(()=>{const editorRect=editor.getBoundingClientRect();zenEditorManagerService.setPosition(editorRect)});return resizeObserver.observe(editor),()=>{resizeObserver.unobserve(editor),renderSubscription.unsubscribe()}},[]);function handleCloseBtnClick(){commandService.executeCommand(CancelZenEditCommand.id)}__name(handleCloseBtnClick,"handleCloseBtnClick");function handleConfirmBtnClick(){commandService.executeCommand(ConfirmZenEditCommand.id)}return __name(handleConfirmBtnClick,"handleConfirmBtnClick"),jsxRuntimeExports.jsxs("div",{className:styles.zenEditor,children:[jsxRuntimeExports.jsxs("div",{className:styles.zenEditorIconWrapper,children:[jsxRuntimeExports.jsx("span",{className:clsx(styles.zenEditorIconContainer,styles.zenEditorIconError),onClick:handleCloseBtnClick,children:jsxRuntimeExports.jsx(CloseSingle,{style:{fontSize:"22px"}})}),jsxRuntimeExports.jsx("span",{className:clsx(styles.zenEditorIconContainer,styles.zenEditorIconSuccess),onClick:handleConfirmBtnClick,children:jsxRuntimeExports.jsx(CheckMarkSingle,{style:{fontSize:"22px"}})})]}),jsxRuntimeExports.jsx("div",{className:styles.zenEditorCanvasContainer,ref:editorRef})]})}__name(ZenEditor,"ZenEditor");const ZenEditorConfirmShortcut={id:ConfirmZenEditCommand.id,description:"shortcut.sheet.zen-edit-confirm",group:"4_sheet-edit",preconditions:__name(contextService=>whenZenEditorActivated(contextService),"preconditions"),binding:ui.KeyCode.ENTER|ui.MetaKeys.ALT},ZenEditorCancelShortcut={id:CancelZenEditCommand.id,description:"shortcut.sheet.zen-edit-cancel",group:"4_sheet-edit",preconditions:__name(contextService=>whenZenEditorActivated(contextService),"preconditions"),binding:ui.KeyCode.ESC};function whenZenEditorActivated(contextService){return contextService.getContextValue(core.FOCUSING_DOC)&&contextService.getContextValue(core.FOCUSING_UNIVER_EDITOR)&&contextService.getContextValue(core.EDITOR_ACTIVATED)&&!contextService.getContextValue(core.FOCUSING_EDITOR_STANDALONE)}__name(whenZenEditorActivated,"whenZenEditorActivated");function ZenEditorMenuItemFactory(accessor){return{id:OpenZenEditorOperation.id,type:ui.MenuItemType.BUTTON,title:"rightClick.zenEditor",icon:"AmplifySingle",hidden$:sheetsUi.getCurrentExclusiveRangeInterest$(accessor),disabled$:sheetsUi.getCurrentRangeDisable$(accessor,{workbookTypes:[sheets.WorkbookEditablePermission],worksheetTypes:[sheets.WorksheetEditPermission,sheets.WorksheetSetCellValuePermission,sheets.WorksheetSetCellStylePermission],rangeTypes:[sheets.RangeProtectionPermissionEditPoint]})}}__name(ZenEditorMenuItemFactory,"ZenEditorMenuItemFactory");const menuSchema={[ui.ContextMenuPosition.MAIN_AREA]:{[ui.ContextMenuGroup.OTHERS]:{[OpenZenEditorOperation.id]:{order:2,menuItemFactory:ZenEditorMenuItemFactory}}}};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"),_a2;let ZenEditorUIController=(_a2=class extends core.Disposable{constructor(_injector,_zenZoneService,_commandService,_menuManagerService,_shortcutService){super(),this._injector=_injector,this._zenZoneService=_zenZoneService,this._commandService=_commandService,this._menuManagerService=_menuManagerService,this._shortcutService=_shortcutService,this._initialize()}_initialize(){this._initCustomComponents(),this._initCommands(),this._initMenus(),this._initShortcuts()}_initCustomComponents(){this.disposeWithMe(this._zenZoneService.set(ZEN_EDITOR_COMPONENT,ZenEditor))}_initCommands(){[OpenZenEditorOperation,CancelZenEditCommand,ConfirmZenEditCommand].forEach(c=>{this.disposeWithMe(this._commandService.registerCommand(c))})}_initMenus(){this._menuManagerService.mergeMenu(menuSchema)}_initShortcuts(){[ZenEditorConfirmShortcut,ZenEditorCancelShortcut].forEach(item=>{this.disposeWithMe(this._shortcutService.registerShortcut(item))})}},__name(_a2,"ZenEditorUIController"),_a2);ZenEditorUIController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Rendered,ZenEditorUIController),__decorateParam$1(0,core.Inject(core.Injector)),__decorateParam$1(1,ui.IZenZoneService),__decorateParam$1(2,core.ICommandService),__decorateParam$1(3,ui.IMenuManagerService),__decorateParam$1(4,ui.IShortcutService)],ZenEditorUIController);const PLUGIN_CONFIG_KEY="sheets-zen-editor.config",defaultPluginConfig={};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"),_a3;exports.UniverSheetsZenEditorPlugin=(_a3=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{menu,...rest}=this._config;menu&&this._configService.setConfig("menu",menu,{merge:!0}),this._configService.setConfig(PLUGIN_CONFIG_KEY,rest),this._initializeDependencies(this._injector)}_initializeDependencies(injector){[[ZenEditorUIController],[ZenEditorController],[IZenEditorManagerService,{useClass:ZenEditorManagerService}]].forEach(dependency=>injector.add(dependency))}},__name(_a3,"UniverSheetsZenEditorPlugin"),__publicField(_a3,"pluginName","SHEET_ZEN_EDITOR_PLUGIN"),__publicField(_a3,"type",core.UniverInstanceType.UNIVER_SHEET),_a3);exports.UniverSheetsZenEditorPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IConfigService)],exports.UniverSheetsZenEditorPlugin);exports.CancelZenEditCommand=CancelZenEditCommand;exports.ConfirmZenEditCommand=ConfirmZenEditCommand;exports.OpenZenEditorOperation=OpenZenEditorOperation;
1
+ 'use strict';var _0x4d6dfb=_0x5861;(function(_0x1b17d0,_0x4d8e2c){var _0x530c82=_0x5861,_0x1d99cb=_0x1b17d0();while(!![]){try{var _0x31a21c=-parseInt(_0x530c82(0x1a2))/0x1*(-parseInt(_0x530c82(0x1fe))/0x2)+parseInt(_0x530c82(0x18b))/0x3+-parseInt(_0x530c82(0x175))/0x4+-parseInt(_0x530c82(0x16e))/0x5*(-parseInt(_0x530c82(0x1ef))/0x6)+parseInt(_0x530c82(0x243))/0x7+-parseInt(_0x530c82(0x20a))/0x8+parseInt(_0x530c82(0x1d2))/0x9*(-parseInt(_0x530c82(0x1c7))/0xa);if(_0x31a21c===_0x4d8e2c)break;else _0x1d99cb['push'](_0x1d99cb['shift']());}catch(_0x394fe9){_0x1d99cb['push'](_0x1d99cb['shift']());}}}(_0x1cbd,0x63f57));var __defProp=Object['defineProperty'],__defNormalProp=(_0x5631a8,_0x22d62e,_0x55ed50)=>_0x22d62e in _0x5631a8?__defProp(_0x5631a8,_0x22d62e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x55ed50}):_0x5631a8[_0x22d62e]=_0x55ed50,__name=(_0x27a182,_0x46c7d3)=>__defProp(_0x27a182,_0x4d6dfb(0x183),{'value':_0x46c7d3,'configurable':!0x0}),__publicField=(_0x1b7f8f,_0x9a3e40,_0x12cf4f)=>__defNormalProp(_0x1b7f8f,typeof _0x9a3e40!=_0x4d6dfb(0x235)?_0x9a3e40+'':_0x9a3e40,_0x12cf4f);Object['defineProperty'](exports,Symbol[_0x4d6dfb(0x1f4)],{'value':_0x4d6dfb(0x172)});const core=require(_0x4d6dfb(0x1b5)),docsUi=require('@univerjs/docs-ui'),engineRender=require(_0x4d6dfb(0x1fa)),sheetsUi=require(_0x4d6dfb(0x207)),ui=require('@univerjs/ui'),rxjs=require(_0x4d6dfb(0x206)),require$$0=require('react'),clsx=require(_0x4d6dfb(0x1ba)),sheets=require(_0x4d6dfb(0x1d1)),OpenZenEditorCommand={'id':_0x4d6dfb(0x246),'type':core['CommandType'][_0x4d6dfb(0x1a0)],'handler':__name(async _0x7c9712=>{var _0x4b8e5b=_0x4d6dfb,_0x260cd3;const _0x53ebad=_0x7c9712[_0x4b8e5b(0x15b)](ui[_0x4b8e5b(0x181)]),_0x4587e8=_0x7c9712[_0x4b8e5b(0x15b)](docsUi['IEditorService']),_0x371351=_0x7c9712[_0x4b8e5b(0x15b)](sheetsUi[_0x4b8e5b(0x15f)]),_0x4d32eb=_0x7c9712[_0x4b8e5b(0x15b)](core[_0x4b8e5b(0x232)]);_0x53ebad[_0x4b8e5b(0x17a)]();const _0x560746=_0x4587e8['getEditor'](core[_0x4b8e5b(0x20f)]);if(_0x560746==null)return!0x1;const _0x46efeb=_0x371351[_0x4b8e5b(0x1f5)]();if(_0x46efeb==null)return!0x1;const _0x45e88a=(_0x260cd3=_0x46efeb['documentLayoutObject'][_0x4b8e5b(0x230)])==null?void 0x0:_0x260cd3[_0x4b8e5b(0x169)]();if(_0x45e88a==null)return!0x1;_0x4d32eb[_0x4b8e5b(0x18c)](core[_0x4b8e5b(0x20f)]);const {body:_0x32dfe0,drawings:_0x1b58dc,drawingsOrder:_0x12d5ab,tableSource:_0x18c545,settings:_0x3c21f7}=core[_0x4b8e5b(0x1ee)][_0x4b8e5b(0x1e0)](_0x45e88a),_0x357e58={..._0x560746['getDocumentData'](),'body':_0x32dfe0,'drawings':_0x1b58dc,'drawingsOrder':_0x12d5ab,'tableSource':_0x18c545,'settings':_0x3c21f7},_0x24b184=[{'startOffset':0x0,'endOffset':0x0,'collapsed':!0x0}];return _0x560746['focus'](),_0x560746[_0x4b8e5b(0x1ac)](_0x357e58,_0x24b184),_0x560746[_0x4b8e5b(0x189)](),!0x0;},_0x4d6dfb(0x193))},CancelZenEditCommand={'id':_0x4d6dfb(0x1ec),'type':core[_0x4d6dfb(0x186)]['COMMAND'],'handler':__name(async _0x48bae2=>{var _0x1365af=_0x4d6dfb;const _0x2bcdb5=_0x48bae2[_0x1365af(0x15b)](ui['IZenZoneService']),_0x806532=_0x48bae2[_0x1365af(0x15b)](sheetsUi[_0x1365af(0x15f)]),_0x4c9471=_0x48bae2[_0x1365af(0x15b)](core[_0x1365af(0x232)]);_0x2bcdb5[_0x1365af(0x1c3)]();const _0x3ae12c=_0x4c9471[_0x1365af(0x1e3)](core[_0x1365af(0x174)][_0x1365af(0x21d)]);return _0x3ae12c?(_0x4c9471['focusUnit'](_0x3ae12c[_0x1365af(0x236)]()),_0x806532[_0x1365af(0x1ea)](),!0x0):!0x1;},'handler')},ConfirmZenEditCommand={'id':_0x4d6dfb(0x231),'type':core['CommandType'][_0x4d6dfb(0x1a0)],'handler':__name(async _0x4a7aa8=>{var _0xf9461d=_0x4d6dfb,_0x1f93d9;const _0xecf9c9=_0x4a7aa8[_0xf9461d(0x15b)](ui['IZenZoneService']),_0x30980=_0x4a7aa8[_0xf9461d(0x15b)](sheetsUi['IEditorBridgeService']),_0x79a602=_0x4a7aa8['get'](core[_0xf9461d(0x232)]),_0x193638=_0x4a7aa8['get'](docsUi[_0xf9461d(0x21f)]);_0xecf9c9['close']();const _0x499886=_0x193638[_0xf9461d(0x1ab)](core[_0xf9461d(0x20f)]);if(_0x499886==null)return!0x1;const _0x14d380=_0x4a7aa8[_0xf9461d(0x15b)](engineRender[_0xf9461d(0x1b6)]),_0x1b3a99=_0x79a602[_0xf9461d(0x1e3)](core['UniverInstanceType'][_0xf9461d(0x21d)]);if(_0x1b3a99){const _0x5dc5b6=_0x1b3a99['getUnitId'](),_0x502d98=(_0x1f93d9=_0x14d380['getRenderById'](_0x5dc5b6))==null?void 0x0:_0x1f93d9['with'](sheetsUi[_0xf9461d(0x15e)]);if(_0x502d98){const _0x455472=core[_0xf9461d(0x1ee)][_0xf9461d(0x1e0)](_0x499886['getDocumentData']());_0x502d98[_0xf9461d(0x177)](new core[(_0xf9461d(0x1f1))](_0x455472));}return _0x79a602[_0xf9461d(0x18c)](_0x1b3a99[_0xf9461d(0x236)]()),_0x30980[_0xf9461d(0x1ea)](),!0x0;}return!0x1;},_0x4d6dfb(0x193))},PLUGIN_CONFIG_KEY=_0x4d6dfb(0x20e),defaultPluginConfig={},_ZenEditorManagerService=class _ZenEditorManagerService{constructor(){var _0x1ecf39=_0x4d6dfb;__publicField(this,_0x1ecf39(0x1d4),null),__publicField(this,_0x1ecf39(0x16f),new rxjs[(_0x1ecf39(0x15d))](null)),__publicField(this,_0x1ecf39(0x22f),this[_0x1ecf39(0x16f)][_0x1ecf39(0x18f)]());}[_0x4d6dfb(0x20d)](){var _0x2ca50f=_0x4d6dfb;this[_0x2ca50f(0x16f)]['complete'](),this[_0x2ca50f(0x1d4)]=null;}[_0x4d6dfb(0x19e)](_0x13bee0){var _0x5323a4=_0x4d6dfb;this[_0x5323a4(0x1d4)]=_0x13bee0,this['_refresh'](_0x13bee0);}[_0x4d6dfb(0x217)](){var _0x2f532a=_0x4d6dfb;return this[_0x2f532a(0x1d4)];}[_0x4d6dfb(0x17c)](_0x484490){var _0xc2bb18=_0x4d6dfb;this['_position$'][_0xc2bb18(0x182)](_0x484490);}};function _0x5861(_0x56ec2b,_0x219294){var _0x1cbdd2=_0x1cbd();return _0x5861=function(_0x586184,_0x638be1){_0x586184=_0x586184-0x15a;var _0x33286b=_0x1cbdd2[_0x586184];return _0x33286b;},_0x5861(_0x56ec2b,_0x219294);}__name(_ZenEditorManagerService,_0x4d6dfb(0x1e9));let ZenEditorManagerService=_ZenEditorManagerService;const IZenEditorManagerService=core['createIdentifier'](_0x4d6dfb(0x220));var __defProp$2=Object[_0x4d6dfb(0x1a7)],__getOwnPropDesc$2=Object[_0x4d6dfb(0x211)],__decorateClass$2=__name((_0x220291,_0x5c693e,_0x4e5ebd,_0x43dce5)=>{var _0xc610fc=_0x4d6dfb;for(var _0xb23b6f=_0x43dce5>0x1?void 0x0:_0x43dce5?__getOwnPropDesc$2(_0x5c693e,_0x4e5ebd):_0x5c693e,_0x223492=_0x220291[_0xc610fc(0x229)]-0x1,_0x51dc2e;_0x223492>=0x0;_0x223492--)(_0x51dc2e=_0x220291[_0x223492])&&(_0xb23b6f=(_0x43dce5?_0x51dc2e(_0x5c693e,_0x4e5ebd,_0xb23b6f):_0x51dc2e(_0xb23b6f))||_0xb23b6f);return _0x43dce5&&_0xb23b6f&&__defProp$2(_0x5c693e,_0x4e5ebd,_0xb23b6f),_0xb23b6f;},_0x4d6dfb(0x15a)),__decorateParam$2=__name((_0x52a2f6,_0x2c9977)=>(_0x3d4e76,_0x37af7f)=>_0x2c9977(_0x3d4e76,_0x37af7f,_0x52a2f6),_0x4d6dfb(0x166)),_a;let ZenEditorController=(_a=class extends core[_0x4d6dfb(0x228)]{constructor(_0x1e8bbe,_0x24fb95){var _0x2e09ac=_0x4d6dfb;super(),this['_zenEditorManagerService']=_0x1e8bbe,this[_0x2e09ac(0x22b)]=_0x24fb95,this[_0x2e09ac(0x1ae)]();}[_0x4d6dfb(0x1ae)](){var _0x2c2fc7=_0x4d6dfb;this[_0x2c2fc7(0x201)]();}[_0x4d6dfb(0x201)](){var _0xdaf508=_0x4d6dfb;this[_0xdaf508(0x1da)][_0xdaf508(0x22f)][_0xdaf508(0x199)](rxjs[_0xdaf508(0x19f)](this['dispose$']))[_0xdaf508(0x171)](_0xc0264f=>{var _0x1fee6a=_0xdaf508;if(_0xc0264f==null)return;const {width:_0x1a93b4,height:_0x7ddb9b}=_0xc0264f,_0x528e65=sheetsUi[_0x1fee6a(0x17f)](core['DOCS_ZEN_EDITOR_UNIT_ID_KEY'],this[_0x1fee6a(0x22b)]);_0x528e65!=null&&requestIdleCallback(()=>{var _0x323ad0=_0x1fee6a;_0x528e65[_0x323ad0(0x233)][_0x323ad0(0x249)](_0x1a93b4,_0x7ddb9b),this[_0x323ad0(0x176)](_0x528e65),this[_0x323ad0(0x1b1)]();});});}[_0x4d6dfb(0x176)](_0x549854){var _0x2073fa=_0x4d6dfb;const {document:_0x509760,scene:_0x33e06b,docBackground:_0x5d2ab3}=_0x549854,_0x189abc=_0x33e06b==null?void 0x0:_0x33e06b['getParent'](),{width:_0x4aeb4c,height:_0x39d808,pageMarginLeft:_0x5d00b6,pageMarginTop:_0x4f5371}=_0x509760;if(_0x189abc==null||_0x4aeb4c===Number[_0x2073fa(0x1a4)]||_0x39d808===Number[_0x2073fa(0x1a4)])return;const {width:_0x24b2aa,height:_0x585c5b}=_0x189abc;let _0xfe3b82=0x0,_0x3a8ed6=0x0,_0x63298b=0x0,_0x5af570=0x0,_0x4bf388=Number['POSITIVE_INFINITY'];const {scaleX:_0x23a5e4,scaleY:_0x33ee0b}=_0x33e06b[_0x2073fa(0x212)]();_0x24b2aa>(_0x4aeb4c+_0x5d00b6*0x2)*_0x23a5e4?(_0xfe3b82=_0x24b2aa/0x2-_0x4aeb4c*_0x23a5e4/0x2,_0xfe3b82/=_0x23a5e4,_0x63298b=(_0x24b2aa-_0x5d00b6*0x2)/_0x23a5e4,_0x4bf388=0x0):(_0xfe3b82=_0x5d00b6,_0x63298b=_0x4aeb4c+_0x5d00b6*0x2,_0x4bf388=(_0x63298b-_0x24b2aa/_0x23a5e4)/0x2),_0x585c5b>_0x39d808?(_0x3a8ed6=_0x585c5b/0x2-_0x39d808/0x2,_0x5af570=(_0x585c5b-_0x4f5371*0x2)/_0x33ee0b):(_0x3a8ed6=_0x4f5371,_0x5af570=_0x39d808+_0x4f5371*0x2),_0x33e06b[_0x2073fa(0x1bb)](_0x63298b,_0x5af570+0xc8),_0x509760[_0x2073fa(0x1bf)](_0xfe3b82,_0x3a8ed6),_0x5d2ab3[_0x2073fa(0x1bf)](_0xfe3b82,_0x3a8ed6);const _0x25a93a=_0x33e06b[_0x2073fa(0x202)](docsUi[_0x2073fa(0x164)]['VIEW_MAIN']);if(_0x4bf388!==Number[_0x2073fa(0x1a4)]&&_0x25a93a!=null){const _0x2d8ed1=_0x25a93a[_0x2073fa(0x1ed)](_0x4bf388,0x0)['x'];_0x25a93a[_0x2073fa(0x1b0)]({'x':_0x2d8ed1});}return this;}[_0x4d6dfb(0x1b1)](){var _0x11d052=_0x4d6dfb,_0x48bd07;const _0x5a584a=(_0x48bd07=this[_0x11d052(0x22b)][_0x11d052(0x1e1)](core[_0x11d052(0x20f)]))==null?void 0x0:_0x48bd07['with'](docsUi[_0x11d052(0x163)]),_0x5ddc2b={'startOffset':0x0,'endOffset':0x0};_0x5a584a&&_0x5a584a[_0x11d052(0x23b)](_0x5ddc2b);}},__name(_a,_0x4d6dfb(0x238)),_a);ZenEditorController=__decorateClass$2([__decorateParam$2(0x0,IZenEditorManagerService),__decorateParam$2(0x1,engineRender['IRenderManagerService'])],ZenEditorController);var jsxRuntime={'exports':{}},reactJsxRuntime_production_min={},f=require$$0,k=Symbol['for'](_0x4d6dfb(0x1a8)),l=Symbol['for'](_0x4d6dfb(0x1c0)),m=Object[_0x4d6dfb(0x22d)][_0x4d6dfb(0x180)],n=f[_0x4d6dfb(0x18d)][_0x4d6dfb(0x1f0)],p={'key':!0x0,'ref':!0x0,'__self':!0x0,'__source':!0x0};function q(_0x13560c,_0x13432e,_0x36c5b1){var _0xf06c67=_0x4d6dfb,_0x1f4c27,_0xa24604={},_0x520b8e=null,_0x52af59=null;_0x36c5b1!==void 0x0&&(_0x520b8e=''+_0x36c5b1),_0x13432e['key']!==void 0x0&&(_0x520b8e=''+_0x13432e[_0xf06c67(0x161)]),_0x13432e[_0xf06c67(0x1d3)]!==void 0x0&&(_0x52af59=_0x13432e['ref']);for(_0x1f4c27 in _0x13432e)m['call'](_0x13432e,_0x1f4c27)&&!p['hasOwnProperty'](_0x1f4c27)&&(_0xa24604[_0x1f4c27]=_0x13432e[_0x1f4c27]);if(_0x13560c&&_0x13560c[_0xf06c67(0x1e4)]){for(_0x1f4c27 in(_0x13432e=_0x13560c[_0xf06c67(0x1e4)],_0x13432e))_0xa24604[_0x1f4c27]===void 0x0&&(_0xa24604[_0x1f4c27]=_0x13432e[_0x1f4c27]);}return{'$$typeof':k,'type':_0x13560c,'key':_0x520b8e,'ref':_0x52af59,'props':_0xa24604,'_owner':n[_0xf06c67(0x200)]};}__name(q,'q'),reactJsxRuntime_production_min[_0x4d6dfb(0x215)]=l,reactJsxRuntime_production_min[_0x4d6dfb(0x1b2)]=q,reactJsxRuntime_production_min[_0x4d6dfb(0x1d9)]=q,jsxRuntime['exports']=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime[_0x4d6dfb(0x1dc)],__assign=function(){var _0x54e7ea=_0x4d6dfb;return __assign=Object['assign']||function(_0x39a633){var _0x4595b6=_0x5861;for(var _0x362086,_0x32ba40=0x1,_0x40be70=arguments[_0x4595b6(0x229)];_0x32ba40<_0x40be70;_0x32ba40++){_0x362086=arguments[_0x32ba40];for(var _0x54ad8b in _0x362086)Object[_0x4595b6(0x22d)][_0x4595b6(0x180)][_0x4595b6(0x165)](_0x362086,_0x54ad8b)&&(_0x39a633[_0x54ad8b]=_0x362086[_0x54ad8b]);}return _0x39a633;},__assign[_0x54e7ea(0x191)](this,arguments);},__rest=function(_0xd57878,_0x6ede09){var _0x4d8a39=_0x4d6dfb,_0x44b0e2={};for(var _0x9ec1e6 in _0xd57878)Object['prototype']['hasOwnProperty'][_0x4d8a39(0x165)](_0xd57878,_0x9ec1e6)&&_0x6ede09['indexOf'](_0x9ec1e6)<0x0&&(_0x44b0e2[_0x9ec1e6]=_0xd57878[_0x9ec1e6]);if(_0xd57878!=null&&typeof Object[_0x4d8a39(0x1b3)]==_0x4d8a39(0x1d8)){for(var _0x49e1cb=0x0,_0x9ec1e6=Object[_0x4d8a39(0x1b3)](_0xd57878);_0x49e1cb<_0x9ec1e6[_0x4d8a39(0x229)];_0x49e1cb++)_0x6ede09[_0x4d8a39(0x223)](_0x9ec1e6[_0x49e1cb])<0x0&&Object[_0x4d8a39(0x22d)][_0x4d8a39(0x178)][_0x4d8a39(0x165)](_0xd57878,_0x9ec1e6[_0x49e1cb])&&(_0x44b0e2[_0x9ec1e6[_0x49e1cb]]=_0xd57878[_0x9ec1e6[_0x49e1cb]]);}return _0x44b0e2;},IconBase=require$$0[_0x4d6dfb(0x190)](function(_0xb9805f,_0x4b1cc4){var _0x252fea=_0x4d6dfb,_0x44f35b=_0xb9805f[_0x252fea(0x16d)],_0x49204c=_0xb9805f['id'],_0x856303=_0xb9805f[_0x252fea(0x1f8)],_0x1e1768=_0xb9805f[_0x252fea(0x196)],_0x215ef0=__rest(_0xb9805f,[_0x252fea(0x16d),'id','className',_0x252fea(0x196)]),_0x904b12=_0x252fea(0x1ca)[_0x252fea(0x241)](_0x49204c,'\x20')[_0x252fea(0x241)](_0x856303||'')[_0x252fea(0x1f2)](),_0x5c1763=require$$0[_0x252fea(0x1e6)]('_'[_0x252fea(0x241)](generateShortUuid()));return render(_0x44f35b,''[_0x252fea(0x241)](_0x49204c),{'defIds':_0x44f35b[_0x252fea(0x1df)],'idSuffix':_0x5c1763[_0x252fea(0x200)]},__assign({'ref':_0x4b1cc4,'className':_0x904b12},_0x215ef0),_0x1e1768);});function render(_0x1b26bf,_0x5ece76,_0x1838f0,_0x309d50,_0xa62d88){var _0x5d2c93=_0x4d6dfb;return require$$0[_0x5d2c93(0x216)](_0x1b26bf[_0x5d2c93(0x1f9)],__assign(__assign({'key':_0x5ece76},replaceRuntimeIdsAndExtInAttrs(_0x1b26bf,_0x1838f0,_0xa62d88)),_0x309d50),(replaceRuntimeIdsInDefs(_0x1b26bf,_0x1838f0)[_0x5d2c93(0x226)]||[])[_0x5d2c93(0x239)](function(_0x2cc33c,_0x1996d6){var _0xdeff71=_0x5d2c93;return render(_0x2cc33c,''[_0xdeff71(0x241)](_0x5ece76,'-')[_0xdeff71(0x241)](_0x1b26bf[_0xdeff71(0x1f9)],'-')[_0xdeff71(0x241)](_0x1996d6),_0x1838f0,void 0x0,_0xa62d88);}));}__name(render,_0x4d6dfb(0x1c1));function replaceRuntimeIdsAndExtInAttrs(_0x1e491b,_0xe3d337,_0x555fd3){var _0x5c19e9=_0x4d6dfb,_0x5acca9=__assign({},_0x1e491b[_0x5c19e9(0x244)]);_0x555fd3!=null&&_0x555fd3['colorChannel1']&&_0x5acca9[_0x5c19e9(0x204)]===_0x5c19e9(0x192)&&(_0x5acca9['fill']=_0x555fd3['colorChannel1']);var _0x4db88b=_0xe3d337[_0x5c19e9(0x1df)];return!_0x4db88b||_0x4db88b[_0x5c19e9(0x229)]===0x0||(_0x1e491b[_0x5c19e9(0x1f9)]===_0x5c19e9(0x247)&&_0x5acca9[_0x5c19e9(0x21b)]&&(_0x5acca9[_0x5c19e9(0x21b)]=_0x5acca9[_0x5c19e9(0x21b)]+_0xe3d337[_0x5c19e9(0x23a)]),Object[_0x5c19e9(0x1c2)](_0x5acca9)[_0x5c19e9(0x1db)](function(_0x44b341){var _0xfde5a5=_0x5c19e9,_0x5a114a=_0x44b341[0x0],_0x94ace2=_0x44b341[0x1];typeof _0x94ace2=='string'&&(_0x5acca9[_0x5a114a]=_0x94ace2[_0xfde5a5(0x22c)](/url\(#(.*)\)/,'url(#$1'[_0xfde5a5(0x241)](_0xe3d337['idSuffix'],')')));})),_0x5acca9;}__name(replaceRuntimeIdsAndExtInAttrs,_0x4d6dfb(0x1fc));function replaceRuntimeIdsInDefs(_0x52a125,_0x3a920c){var _0x26ad51=_0x4d6dfb,_0x246a8e,_0x48a286=_0x3a920c[_0x26ad51(0x1df)];return!_0x48a286||_0x48a286[_0x26ad51(0x229)]===0x0?_0x52a125:_0x52a125[_0x26ad51(0x1f9)]==='defs'&&(!((_0x246a8e=_0x52a125[_0x26ad51(0x226)])===null||_0x246a8e===void 0x0)&&_0x246a8e[_0x26ad51(0x229)])?__assign(__assign({},_0x52a125),{'children':_0x52a125[_0x26ad51(0x226)][_0x26ad51(0x239)](function(_0x456bf2){var _0xa125b4=_0x26ad51;return typeof _0x456bf2[_0xa125b4(0x244)]['id']==_0xa125b4(0x1f7)&&_0x48a286&&_0x48a286[_0xa125b4(0x223)](_0x456bf2[_0xa125b4(0x244)]['id'])>-0x1?__assign(__assign({},_0x456bf2),{'attrs':__assign(__assign({},_0x456bf2[_0xa125b4(0x244)]),{'id':_0x456bf2[_0xa125b4(0x244)]['id']+_0x3a920c[_0xa125b4(0x23a)]})}):_0x456bf2;})}):_0x52a125;}__name(replaceRuntimeIdsInDefs,_0x4d6dfb(0x1c5));function generateShortUuid(){var _0x5761fa=_0x4d6dfb;return Math[_0x5761fa(0x1bd)]()[_0x5761fa(0x210)](0x24)[_0x5761fa(0x218)](0x2,0x8);}__name(generateShortUuid,_0x4d6dfb(0x205)),IconBase[_0x4d6dfb(0x21c)]=_0x4d6dfb(0x1e2);var element$1={'tag':_0x4d6dfb(0x194),'attrs':{'fill':_0x4d6dfb(0x1d0),'viewBox':_0x4d6dfb(0x1cf),'width':'1em','height':_0x4d6dfb(0x1b9)},'children':[{'tag':'path','attrs':{'fill':_0x4d6dfb(0x188),'d':'M14.1544\x203.75557C14.3887\x203.98988\x2014.3887\x204.36978\x2014.1544\x204.6041L6.51409\x2012.2444C6.40157\x2012.3569\x206.24896\x2012.4201\x206.08983\x2012.4201C5.9307\x2012.4201\x205.77808\x2012.3569\x205.66556\x2012.2444L1.84541\x208.42425C1.6111\x208.18993\x201.6111\x207.81003\x201.84541\x207.57572C2.07973\x207.34141\x202.45963\x207.34141\x202.69394\x207.57572L6.08983\x2010.9716L13.3059\x203.75557C13.5402\x203.52126\x2013.9201\x203.52126\x2014.1544\x203.75557Z','fillRule':_0x4d6dfb(0x184),'clipRule':'evenodd'}}]},CheckMarkSingle=require$$0[_0x4d6dfb(0x190)](function(_0x255463,_0x549693){var _0x51315a=_0x4d6dfb;return require$$0[_0x51315a(0x216)](IconBase,Object[_0x51315a(0x23f)]({},_0x255463,{'id':_0x51315a(0x1be),'ref':_0x549693,'icon':element$1}));});CheckMarkSingle[_0x4d6dfb(0x21c)]=_0x4d6dfb(0x1b8);var element={'tag':_0x4d6dfb(0x194),'attrs':{'fill':_0x4d6dfb(0x1d0),'viewBox':_0x4d6dfb(0x1cf),'width':'1em','height':_0x4d6dfb(0x1b9)},'children':[{'tag':_0x4d6dfb(0x248),'attrs':{'fill':_0x4d6dfb(0x188),'d':_0x4d6dfb(0x245)}}]},CloseSingle=require$$0[_0x4d6dfb(0x190)](function(_0x20ccec,_0x59353d){var _0x59d758=_0x4d6dfb;return require$$0[_0x59d758(0x216)](IconBase,Object[_0x59d758(0x23f)]({},_0x20ccec,{'id':'close-single','ref':_0x59353d,'icon':element}));});CloseSingle['displayName']=_0x4d6dfb(0x227);const zenEditor=_0x4d6dfb(0x20c),zenEditorIconWrapper='univer-zen-editor-icon-wrapper',zenEditorIconContainer=_0x4d6dfb(0x1c9),zenEditorIconSuccess=_0x4d6dfb(0x225),zenEditorIconError=_0x4d6dfb(0x219),zenEditorCanvasContainer=_0x4d6dfb(0x1a9),styles={'zenEditor':zenEditor,'zenEditorIconWrapper':zenEditorIconWrapper,'zenEditorIconContainer':zenEditorIconContainer,'zenEditorIconSuccess':zenEditorIconSuccess,'zenEditorIconError':zenEditorIconError,'zenEditorCanvasContainer':zenEditorCanvasContainer},COMPONENT_PREFIX=_0x4d6dfb(0x1ce),ZEN_EDITOR_COMPONENT=COMPONENT_PREFIX+_0x4d6dfb(0x17e),INITIAL_SNAPSHOT={'id':core[_0x4d6dfb(0x20f)],'body':{'dataStream':''+core[_0x4d6dfb(0x1fd)],'textRuns':[],'tables':[],'customBlocks':[],'paragraphs':[{'startIndex':0x0}],'sectionBreaks':[{'startIndex':0x1}]},'tableSource':{},'documentStyle':{'pageSize':{'width':0x253,'height':0x34a},'documentFlavor':core[_0x4d6dfb(0x224)][_0x4d6dfb(0x185)],'marginTop':0x32,'marginBottom':0x32,'marginRight':0x28,'marginLeft':0x28,'renderConfig':{'vertexAngle':0x0,'centerAngle':0x0}},'drawings':{},'drawingsOrder':[]};function ZenEditor(){var _0x68a97f=_0x4d6dfb;const _0x5396ff=require$$0[_0x68a97f(0x1e6)](null),_0x1acbc8=core[_0x68a97f(0x1cd)](IZenEditorManagerService),_0x5bd1b9=core[_0x68a97f(0x1cd)](docsUi[_0x68a97f(0x21f)]),_0x40e465=core['useDependency'](core[_0x68a97f(0x203)]);require$$0[_0x68a97f(0x20b)](()=>{var _0x3a1f69=_0x68a97f;const _0x4fa4c8=_0x5396ff[_0x3a1f69(0x200)];if(!_0x4fa4c8)return;const _0x16fda7=_0x5bd1b9[_0x3a1f69(0x168)]({'editorUnitId':core[_0x3a1f69(0x20f)],'initialSnapshot':INITIAL_SNAPSHOT,'scrollBar':!0x0,'noNeedVerticalAlign':!0x0,'backScrollOffset':0x64},_0x4fa4c8),_0x55c0ae=new ResizeObserver(()=>{var _0x4be092=_0x3a1f69;_0x1acbc8[_0x4be092(0x19e)](_0x4fa4c8['getBoundingClientRect']());});return _0x55c0ae['observe'](_0x4fa4c8),()=>{var _0x2fb2c6=_0x3a1f69;_0x16fda7[_0x2fb2c6(0x20d)](),_0x55c0ae[_0x2fb2c6(0x1ff)](_0x4fa4c8);};},[]);function _0x5bc47a(){var _0x4e77f9=_0x68a97f;_0x40e465[_0x4e77f9(0x1bc)](CancelZenEditCommand['id']);}__name(_0x5bc47a,_0x68a97f(0x1a3));function _0x12695e(){_0x40e465['executeCommand'](ConfirmZenEditCommand['id']);}return __name(_0x12695e,_0x68a97f(0x1a5)),jsxRuntimeExports['jsxs']('div',{'className':styles[_0x68a97f(0x222)],'children':[jsxRuntimeExports[_0x68a97f(0x1d9)](_0x68a97f(0x22a),{'className':styles[_0x68a97f(0x208)],'children':[jsxRuntimeExports['jsx'](_0x68a97f(0x173),{'className':clsx(styles[_0x68a97f(0x1c4)],styles[_0x68a97f(0x1c8)]),'onClick':_0x5bc47a,'children':jsxRuntimeExports['jsx'](CloseSingle,{'style':{'fontSize':'22px'}})}),jsxRuntimeExports[_0x68a97f(0x1b2)]('span',{'className':clsx(styles[_0x68a97f(0x1c4)],styles['zenEditorIconSuccess']),'onClick':_0x12695e,'children':jsxRuntimeExports[_0x68a97f(0x1b2)](CheckMarkSingle,{'style':{'fontSize':_0x68a97f(0x22e)}})})]}),jsxRuntimeExports[_0x68a97f(0x1b2)](_0x68a97f(0x22a),{'className':styles['zenEditorCanvasContainer'],'ref':_0x5396ff})]});}__name(ZenEditor,_0x4d6dfb(0x1e7));function ZenEditorMenuItemFactory(_0x58d629){var _0x1d5af4=_0x4d6dfb;return{'id':OpenZenEditorCommand['id'],'type':ui[_0x1d5af4(0x1de)][_0x1d5af4(0x179)],'title':_0x1d5af4(0x195),'icon':_0x1d5af4(0x1b7),'hidden$':sheetsUi['getCurrentExclusiveRangeInterest$'](_0x58d629),'disabled$':sheetsUi[_0x1d5af4(0x16b)](_0x58d629,{'workbookTypes':[sheets[_0x1d5af4(0x16a)]],'worksheetTypes':[sheets[_0x1d5af4(0x214)],sheets['WorksheetSetCellValuePermission'],sheets[_0x1d5af4(0x160)]],'rangeTypes':[sheets[_0x1d5af4(0x23e)]]})};}function _0x1cbd(){var _0x535015=['name','evenodd','MODERN','CommandType','menu','currentColor','clearUndoRedoHistory','onSteady','574788lMTfYC','focusUnit','__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED','setConfig','asObservable','forwardRef','apply','colorChannel1','handler','svg','rightClick.zenEditor','extend','_initShortcuts','__decorateParam','pipe','disposeWithMe','onReady','whenZenEditorActivated','Disposable','setPosition','takeUntil','COMMAND','KeyCode','122379gvaJih','handleCloseBtnClick','POSITIVE_INFINITY','handleConfirmBtnClick','CancelZenEditCommand','defineProperty','react.element','univer-zen-editor-canvas-container','_initMenus','getEditor','setDocumentData','_configService','_initialize','mergeMenu','scrollToBarPos','_scrollToTop','jsx','getOwnPropertySymbols','ConfirmZenEditCommand','@univerjs/core','IRenderManagerService','AmplifySingle','CheckMarkSingle','1em','clsx','resize','executeCommand','random','check-mark-single','translate','react.fragment','render','entries','close','zenEditorIconContainer','replaceRuntimeIdsInDefs','_menuManagerService','17170ospPpB','zenEditorIconError','univer-zen-editor-icon-container','univerjs-icon\x20univerjs-icon-','UniverSheetsZenEditorPlugin','_shortcutService','useDependency','ZEN_EDITOR_PLUGIN_','0\x200\x2016\x2016','none','@univerjs/sheets','2403EHqcuh','ref','_position','IConfigService','__decorateClass','_injector','function','jsxs','_zenEditorManagerService','forEach','exports','ENTER','MenuItemType','defIds','deepClone','getRenderById','UniverIcon','getCurrentUnitForType','defaultProps','add','useRef','ZenEditor','_initializeDependencies','ZenEditorManagerService','refreshEditCellState','Plugin','zen-editor.command.cancel-zen-edit','transScroll2ViewportScrollValue','Tools','101982eWYpDP','ReactCurrentOwner','DocumentDataModel','trim','ESC','toStringTag','getLatestEditCellState','_initCustomComponents','string','className','tag','@univerjs/engine-render','__decorateParam$1','replaceRuntimeIdsAndExtInAttrs','DEFAULT_EMPTY_DOCUMENT_VALUE','6NqVpLv','unobserve','current','_syncZenEditorSize','getViewport','ICommandService','fill','generateShortUuid','rxjs','@univerjs/sheets-ui','zenEditorIconWrapper','ALT','2664528BqLziU','useEffect','univer-zen-editor','dispose','sheets-zen-editor.config','DOCS_ZEN_EDITOR_UNIT_ID_KEY','toString','getOwnPropertyDescriptor','getAncestorScale','MAIN_AREA','WorksheetEditPermission','Fragment','createElement','getPosition','substring','univer-zen-editor-icon-error','FOCUSING_DOC','xlink:href','displayName','UNIVER_SHEET','EDITOR_ACTIVATED','IEditorService','univer.sheet-zen-editor-manager.service','shortcut.sheet.zen-edit-confirm','zenEditor','indexOf','DocumentFlavor','univer-zen-editor-icon-success','children','CloseSingle','RxDisposable','length','div','_renderManagerService','replace','prototype','22px','position$','documentModel','zen-editor.command.confirm-zen-edit','IUniverInstanceService','engine','registerShortcut','symbol','getUnitId','IShortcutService','ZenEditorController','map','idSuffix','scrollToRange','_commandService','ZenEditorUIController','RangeProtectionPermissionEditPoint','assign','OpenZenEditorCommand','concat','preconditions','1566635QSsjzB','attrs','M3.71274\x202.86421C3.47843\x202.6299\x203.09853\x202.6299\x202.86421\x202.86421C2.6299\x203.09853\x202.6299\x203.47843\x202.86421\x203.71274L7.15154\x208.00007L2.86421\x2012.2874C2.6299\x2012.5217\x202.6299\x2012.9016\x202.86421\x2013.1359C3.09853\x2013.3702\x203.47843\x2013.3702\x203.71274\x2013.1359L8.00007\x208.84859L12.2874\x2013.1359C12.5217\x2013.3702\x2012.9016\x2013.3702\x2013.1359\x2013.1359C13.3702\x2012.9016\x2013.3702\x2012.5217\x2013.1359\x2012.2874L8.84859\x208.00007L13.1359\x203.71274C13.3702\x203.47843\x2013.3702\x203.09853\x2013.1359\x202.86421C12.9016\x202.6299\x2012.5217\x202.6299\x2012.2874\x202.86421L8.00007\x207.15154L3.71274\x202.86421Z','zen-editor.command.open-zen-editor','use','path','resizeBySize','__decorateClass$2','get','pluginName','BehaviorSubject','EditingRenderController','IEditorBridgeService','WorksheetSetCellStylePermission','key','getContextValue','DocBackScrollRenderController','VIEWPORT_KEY','call','__decorateParam$2','_config','register','getSnapshot','WorkbookEditablePermission','getCurrentRangeDisable$','_zenZoneService','icon','125MmPtDg','_position$','4_sheet-edit','subscribe','Module','span','UniverInstanceType','26108owGBwF','_calculatePagePosition','submitCellData','propertyIsEnumerable','BUTTON','open','SHEET_ZEN_EDITOR_PLUGIN','_refresh','_initCommands','ZEN_EDITOR_COMPONENT','getEditorObject','hasOwnProperty','IZenZoneService','next'];_0x1cbd=function(){return _0x535015;};return _0x1cbd();}__name(ZenEditorMenuItemFactory,'ZenEditorMenuItemFactory');const menuSchema={[ui['ContextMenuPosition'][_0x4d6dfb(0x213)]]:{[ui['ContextMenuGroup']['OTHERS']]:{[OpenZenEditorCommand['id']]:{'order':0x2,'menuItemFactory':ZenEditorMenuItemFactory}}}},ZenEditorConfirmShortcut={'id':ConfirmZenEditCommand['id'],'description':_0x4d6dfb(0x221),'group':_0x4d6dfb(0x170),'preconditions':__name(_0x294300=>whenZenEditorActivated(_0x294300),_0x4d6dfb(0x242)),'binding':ui[_0x4d6dfb(0x1a1)][_0x4d6dfb(0x1dd)]|ui['MetaKeys'][_0x4d6dfb(0x209)]},ZenEditorCancelShortcut={'id':CancelZenEditCommand['id'],'description':'shortcut.sheet.zen-edit-cancel','group':'4_sheet-edit','preconditions':__name(_0x456f2e=>whenZenEditorActivated(_0x456f2e),_0x4d6dfb(0x242)),'binding':ui[_0x4d6dfb(0x1a1)][_0x4d6dfb(0x1f3)]};function whenZenEditorActivated(_0xc363b9){var _0x123d77=_0x4d6dfb;return _0xc363b9[_0x123d77(0x162)](core[_0x123d77(0x21a)])&&_0xc363b9['getContextValue'](core['FOCUSING_UNIVER_EDITOR'])&&_0xc363b9[_0x123d77(0x162)](core[_0x123d77(0x21e)])&&!_0xc363b9[_0x123d77(0x162)](core['FOCUSING_EDITOR_STANDALONE']);}__name(whenZenEditorActivated,_0x4d6dfb(0x19c));var __defProp$1=Object[_0x4d6dfb(0x1a7)],__getOwnPropDesc$1=Object['getOwnPropertyDescriptor'],__decorateClass$1=__name((_0x262582,_0x22d617,_0x129c0e,_0x5447d0)=>{var _0xfcdf98=_0x4d6dfb;for(var _0x470d93=_0x5447d0>0x1?void 0x0:_0x5447d0?__getOwnPropDesc$1(_0x22d617,_0x129c0e):_0x22d617,_0x224c28=_0x262582[_0xfcdf98(0x229)]-0x1,_0x55dac6;_0x224c28>=0x0;_0x224c28--)(_0x55dac6=_0x262582[_0x224c28])&&(_0x470d93=(_0x5447d0?_0x55dac6(_0x22d617,_0x129c0e,_0x470d93):_0x55dac6(_0x470d93))||_0x470d93);return _0x5447d0&&_0x470d93&&__defProp$1(_0x22d617,_0x129c0e,_0x470d93),_0x470d93;},'__decorateClass$1'),__decorateParam$1=__name((_0x511968,_0x1a9567)=>(_0x29e8d9,_0x3524a5)=>_0x1a9567(_0x29e8d9,_0x3524a5,_0x511968),_0x4d6dfb(0x1fb)),_a2;let ZenEditorUIController=(_a2=class extends core[_0x4d6dfb(0x19d)]{constructor(_0x3a074,_0x43b2f9,_0x4efe6e,_0x5a6a4e){var _0x50f496=_0x4d6dfb;super(),this[_0x50f496(0x16c)]=_0x3a074,this[_0x50f496(0x23c)]=_0x43b2f9,this[_0x50f496(0x1c6)]=_0x4efe6e,this['_shortcutService']=_0x5a6a4e,this[_0x50f496(0x1ae)]();}[_0x4d6dfb(0x1ae)](){var _0x1b8594=_0x4d6dfb;this[_0x1b8594(0x1f6)](),this[_0x1b8594(0x17d)](),this[_0x1b8594(0x1aa)](),this[_0x1b8594(0x197)]();}[_0x4d6dfb(0x1f6)](){var _0x5f5ddb=_0x4d6dfb;this[_0x5f5ddb(0x19a)](this[_0x5f5ddb(0x16c)]['set'](ZEN_EDITOR_COMPONENT,ZenEditor));}[_0x4d6dfb(0x17d)](){var _0x131042=_0x4d6dfb;[OpenZenEditorCommand,CancelZenEditCommand,ConfirmZenEditCommand][_0x131042(0x1db)](_0x4056c7=>{this['disposeWithMe'](this['_commandService']['registerCommand'](_0x4056c7));});}[_0x4d6dfb(0x1aa)](){var _0x288f6e=_0x4d6dfb;this['_menuManagerService'][_0x288f6e(0x1af)](menuSchema);}[_0x4d6dfb(0x197)](){var _0x1c4f7b=_0x4d6dfb;[ZenEditorConfirmShortcut,ZenEditorCancelShortcut][_0x1c4f7b(0x1db)](_0x2fa16d=>{var _0x26ba8e=_0x1c4f7b;this[_0x26ba8e(0x19a)](this[_0x26ba8e(0x1cc)][_0x26ba8e(0x234)](_0x2fa16d));});}},__name(_a2,_0x4d6dfb(0x23d)),_a2);ZenEditorUIController=__decorateClass$1([__decorateParam$1(0x0,ui[_0x4d6dfb(0x181)]),__decorateParam$1(0x1,core['ICommandService']),__decorateParam$1(0x2,ui['IMenuManagerService']),__decorateParam$1(0x3,ui[_0x4d6dfb(0x237)])],ZenEditorUIController);var __defProp2=Object[_0x4d6dfb(0x1a7)],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__decorateClass=__name((_0x3668cf,_0x7ac0dc,_0x1d3c83,_0x3548a2)=>{var _0xedc013=_0x4d6dfb;for(var _0x2fcc74=_0x3548a2>0x1?void 0x0:_0x3548a2?__getOwnPropDesc(_0x7ac0dc,_0x1d3c83):_0x7ac0dc,_0x2ae3ff=_0x3668cf[_0xedc013(0x229)]-0x1,_0x3c498d;_0x2ae3ff>=0x0;_0x2ae3ff--)(_0x3c498d=_0x3668cf[_0x2ae3ff])&&(_0x2fcc74=(_0x3548a2?_0x3c498d(_0x7ac0dc,_0x1d3c83,_0x2fcc74):_0x3c498d(_0x2fcc74))||_0x2fcc74);return _0x3548a2&&_0x2fcc74&&__defProp2(_0x7ac0dc,_0x1d3c83,_0x2fcc74),_0x2fcc74;},_0x4d6dfb(0x1d6)),__decorateParam=__name((_0x14ee62,_0x46ee14)=>(_0x26f628,_0xafe762)=>_0x46ee14(_0x26f628,_0xafe762,_0x14ee62),_0x4d6dfb(0x198)),_a3;exports[_0x4d6dfb(0x1cb)]=(_a3=class extends core[_0x4d6dfb(0x1eb)]{constructor(_0x207833=defaultPluginConfig,_0x41bfd6,_0x1f8a4b){var _0x457059=_0x4d6dfb;super(),this['_config']=_0x207833,this['_injector']=_0x41bfd6,this['_configService']=_0x1f8a4b;const {menu:_0x27fd8c,..._0x246c5d}=this[_0x457059(0x167)];_0x27fd8c&&this[_0x457059(0x1ad)][_0x457059(0x18e)](_0x457059(0x187),_0x27fd8c,{'merge':!0x0}),this[_0x457059(0x1ad)]['setConfig'](PLUGIN_CONFIG_KEY,_0x246c5d),this[_0x457059(0x1e8)](this[_0x457059(0x1d7)]);}[_0x4d6dfb(0x1e8)](_0x4352a2){var _0x4395c7=_0x4d6dfb;[[ZenEditorUIController],[ZenEditorController],[IZenEditorManagerService,{'useClass':ZenEditorManagerService}]][_0x4395c7(0x1db)](_0x2e4736=>_0x4352a2[_0x4395c7(0x1e5)](_0x2e4736));}[_0x4d6dfb(0x19b)](){var _0xf891e0=_0x4d6dfb;this['_injector'][_0xf891e0(0x15b)](ZenEditorUIController);}[_0x4d6dfb(0x18a)](){var _0xd5b4e1=_0x4d6dfb;this['_injector'][_0xd5b4e1(0x15b)](ZenEditorController);}},__name(_a3,_0x4d6dfb(0x1cb)),__publicField(_a3,_0x4d6dfb(0x15c),_0x4d6dfb(0x17b)),__publicField(_a3,'type',core[_0x4d6dfb(0x174)]['UNIVER_SHEET']),_a3),exports[_0x4d6dfb(0x1cb)]=__decorateClass([__decorateParam(0x1,core['Inject'](core['Injector'])),__decorateParam(0x2,core[_0x4d6dfb(0x1d5)])],exports[_0x4d6dfb(0x1cb)]),exports[_0x4d6dfb(0x1a6)]=CancelZenEditCommand,exports[_0x4d6dfb(0x1b4)]=ConfirmZenEditCommand,exports[_0x4d6dfb(0x240)]=OpenZenEditorCommand;
package/lib/es/index.js CHANGED
@@ -1,492 +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, createIdentifier, OnLifecycle, LifecycleStages, Inject, RxDisposable, DOCS_ZEN_EDITOR_UNIT_ID_KEY, DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, UniverInstanceType, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, IUniverInstanceService, ICommandService, IUndoRedoService, useDependency, FOCUSING_DOC, FOCUSING_UNIVER_EDITOR, EDITOR_ACTIVATED, FOCUSING_EDITOR_STANDALONE, Injector, Disposable, Plugin, IConfigService } from "@univerjs/core";
6
- import { DocSelectionManagerService, DocSkeletonManagerService, RichTextEditingMutation } from "@univerjs/docs";
7
- import { DocSelectionRenderService, VIEWPORT_KEY, getDocObject, DocBackScrollRenderController } from "@univerjs/docs-ui";
8
- import { DeviceInputEventType, IRenderManagerService } from "@univerjs/engine-render";
9
- import { getEditorObject, IEditorBridgeService, getCurrentExclusiveRangeInterest$, getCurrentRangeDisable$ } from "@univerjs/sheets-ui";
10
- import { IZenZoneService, KeyCode, MetaKeys, MenuItemType, ContextMenuPosition, ContextMenuGroup, IMenuManagerService, IShortcutService } from "@univerjs/ui";
11
- import { BehaviorSubject, takeUntil } from "rxjs";
12
- import require$$0, { forwardRef, useRef, createElement, useEffect } from "react";
13
- import clsx from "clsx";
14
- import { WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetSetCellStylePermission, RangeProtectionPermissionEditPoint } from "@univerjs/sheets";
15
- const OpenZenEditorOperation = {
16
- id: "zen-editor.operation.open-zen-editor",
17
- type: CommandType.OPERATION,
18
- handler: /* @__PURE__ */ __name((accessor) => !0, "handler")
19
- }, _ZenEditorManagerService = class _ZenEditorManagerService {
20
- constructor() {
21
- __publicField(this, "_position", null);
22
- __publicField(this, "_position$", new BehaviorSubject(null));
23
- __publicField(this, "position$", this._position$.asObservable());
24
- }
25
- dispose() {
26
- this._position$.complete(), this._position = null;
27
- }
28
- setPosition(param) {
29
- this._position = param, this._refresh(param);
30
- }
31
- getPosition() {
32
- return this._position;
33
- }
34
- _refresh(param) {
35
- this._position$.next(param);
36
- }
37
- };
38
- __name(_ZenEditorManagerService, "ZenEditorManagerService");
39
- let ZenEditorManagerService = _ZenEditorManagerService;
40
- const IZenEditorManagerService = createIdentifier(
41
- "univer.sheet-zen-editor-manager.service"
42
- );
43
- var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
44
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
45
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
46
- return kind && result && __defProp$2(target, key, result), result;
47
- }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a;
48
- let ZenEditorController = (_a = class extends RxDisposable {
49
- constructor(_univerInstanceService, _zenEditorManagerService, _renderManagerService, _commandService, _zenZoneService, _editorBridgeService, _undoRedoService, _textSelectionManagerService) {
50
- super();
51
- __publicField(this, "_zenEditorInitialState", !1);
52
- this._univerInstanceService = _univerInstanceService, this._zenEditorManagerService = _zenEditorManagerService, this._renderManagerService = _renderManagerService, this._commandService = _commandService, this._zenZoneService = _zenZoneService, this._editorBridgeService = _editorBridgeService, this._undoRedoService = _undoRedoService, this._textSelectionManagerService = _textSelectionManagerService, this._initialize();
53
- }
54
- _initialize() {
55
- this._syncZenEditorSize(), this._commandExecutedListener();
56
- }
57
- _createZenEditorInstance() {
58
- const INITIAL_SNAPSHOT = {
59
- id: DOCS_ZEN_EDITOR_UNIT_ID_KEY,
60
- body: {
61
- dataStream: `${DEFAULT_EMPTY_DOCUMENT_VALUE}`,
62
- textRuns: [],
63
- tables: [],
64
- customBlocks: [],
65
- paragraphs: [
66
- {
67
- startIndex: 0
68
- }
69
- ],
70
- sectionBreaks: [{
71
- startIndex: 1
72
- }]
73
- },
74
- tableSource: {},
75
- documentStyle: {
76
- pageSize: {
77
- width: 595,
78
- height: 842
79
- },
80
- documentFlavor: DocumentFlavor.MODERN,
81
- marginTop: 50,
82
- marginBottom: 50,
83
- marginRight: 40,
84
- marginLeft: 40,
85
- renderConfig: {
86
- vertexAngle: 0,
87
- centerAngle: 0
88
- }
89
- },
90
- drawings: {},
91
- drawingsOrder: []
92
- };
93
- return this._univerInstanceService.createUnit(UniverInstanceType.UNIVER_DOC, INITIAL_SNAPSHOT);
94
- }
95
- // Listen to changes in the size of the zen editor container to set the size of the editor.
96
- _syncZenEditorSize() {
97
- this._zenEditorManagerService.position$.pipe(takeUntil(this.dispose$)).subscribe((position) => {
98
- var _a4;
99
- if (position == null)
100
- return;
101
- const editorObject = getEditorObject(DOCS_ZEN_EDITOR_UNIT_ID_KEY, this._renderManagerService), zenEditorDataModel = this._univerInstanceService.getUniverDocInstance(DOCS_ZEN_EDITOR_UNIT_ID_KEY);
102
- if (editorObject == null || zenEditorDataModel == null)
103
- return;
104
- const { width, height } = position, { engine } = editorObject, skeleton = (_a4 = this._renderManagerService.getRenderById(DOCS_ZEN_EDITOR_UNIT_ID_KEY)) == null ? void 0 : _a4.with(DocSkeletonManagerService).getSkeleton();
105
- requestIdleCallback(() => {
106
- engine.resizeBySize(width, height), this._calculatePagePosition(editorObject), skeleton && this._textSelectionManagerService.refreshSelection();
107
- });
108
- });
109
- }
110
- _handleOpenZenEditor() {
111
- var _a4, _b;
112
- this._zenEditorInitialState || (this._createZenEditorInstance(), this._zenEditorInitialState = !0), this._zenZoneService.open();
113
- const currentSheet = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
114
- this._undoRedoService.clearUndoRedo(DOCS_ZEN_EDITOR_UNIT_ID_KEY), this._univerInstanceService.focusUnit(DOCS_ZEN_EDITOR_UNIT_ID_KEY), this._univerInstanceService.setCurrentUnitForType(DOCS_ZEN_EDITOR_UNIT_ID_KEY);
115
- const docSelectionRenderService = (_a4 = this._renderManagerService.getRenderById(DOCS_ZEN_EDITOR_UNIT_ID_KEY)) == null ? void 0 : _a4.with(DocSelectionRenderService);
116
- docSelectionRenderService && docSelectionRenderService.focus(), this._editorBridgeService.isVisible().visible === !1 && this._editorBridgeService.changeVisible({
117
- visible: !0,
118
- eventType: DeviceInputEventType.PointerDown,
119
- unitId: (_b = currentSheet == null ? void 0 : currentSheet.getUnitId()) != null ? _b : ""
120
- });
121
- const editCellState = this._editorBridgeService.getLatestEditCellState();
122
- if (editCellState == null)
123
- return;
124
- this._editorSyncHandler(editCellState);
125
- const textRanges = [
126
- {
127
- startOffset: 0,
128
- endOffset: 0
129
- }
130
- ];
131
- this._textSelectionManagerService.replaceTextRanges(textRanges, !1);
132
- }
133
- _editorSyncHandler(param) {
134
- var _a4, _b, _c, _d;
135
- const body = (_a4 = param.documentLayoutObject.documentModel) == null ? void 0 : _a4.getBody(), dataStream = body == null ? void 0 : body.dataStream, paragraphs = body == null ? void 0 : body.paragraphs, customBlocks = body == null ? void 0 : body.customBlocks, drawings = (_b = param.documentLayoutObject.documentModel) == null ? void 0 : _b.getDrawings(), drawingsOrder = (_c = param.documentLayoutObject.documentModel) == null ? void 0 : _c.getDrawingsOrder(), customRanges = body == null ? void 0 : body.customRanges;
136
- let textRuns = [];
137
- dataStream == null || !paragraphs && !customRanges || ((_d = body == null ? void 0 : body.textRuns) != null && _d.length && (textRuns = body == null ? void 0 : body.textRuns), this._syncContentAndRender(DOCS_ZEN_EDITOR_UNIT_ID_KEY, dataStream, paragraphs != null ? paragraphs : [], textRuns, customBlocks, drawings, drawingsOrder, customRanges));
138
- }
139
- _syncContentAndRender(unitId, dataStream, paragraphs, textRuns = [], customBlocks = [], drawings = {}, drawingsOrder = [], customRanges = []) {
140
- var _a4;
141
- const INCLUDE_LIST = [
142
- DOCS_ZEN_EDITOR_UNIT_ID_KEY,
143
- DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
144
- DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY
145
- ], docSkeletonManagerService = (_a4 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a4.with(DocSkeletonManagerService), skeleton = docSkeletonManagerService == null ? void 0 : docSkeletonManagerService.getSkeleton(), docDataModel = this._univerInstanceService.getUniverDocInstance(unitId), docViewModel = docSkeletonManagerService == null ? void 0 : docSkeletonManagerService.getViewModel();
146
- if (docDataModel == null || docViewModel == null || skeleton == null)
147
- return;
148
- const docBody = docDataModel.getBody(), snapshot = docDataModel.getSnapshot();
149
- docBody.dataStream = dataStream, docBody.paragraphs = paragraphs, docBody.customBlocks = customBlocks, docBody.customRanges = customRanges, snapshot.drawings = drawings, snapshot.drawingsOrder = drawingsOrder, docBody.textRuns = textRuns, unitId === DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY && (docBody.textRuns = []), docViewModel.reset(docDataModel);
150
- const currentRender = this._getDocObject();
151
- currentRender != null && (skeleton.calculate(), INCLUDE_LIST.includes(unitId) && currentRender.document.makeDirty());
152
- }
153
- _calculatePagePosition(currentRender) {
154
- const { document: docsComponent, scene, docBackground } = currentRender, parent = scene == null ? void 0 : scene.getParent(), { width: docsWidth, height: docsHeight, pageMarginLeft, pageMarginTop } = docsComponent;
155
- if (parent == null || docsWidth === Number.POSITIVE_INFINITY || docsHeight === Number.POSITIVE_INFINITY)
156
- return;
157
- const { width: engineWidth, height: engineHeight } = parent;
158
- let docsLeft = 0, docsTop = 0, sceneWidth = 0, sceneHeight = 0, scrollToX = Number.POSITIVE_INFINITY;
159
- const { scaleX, scaleY } = scene.getAncestorScale();
160
- engineWidth > (docsWidth + pageMarginLeft * 2) * scaleX ? (docsLeft = engineWidth / 2 - docsWidth * scaleX / 2, docsLeft /= scaleX, sceneWidth = (engineWidth - pageMarginLeft * 2) / scaleX, scrollToX = 0) : (docsLeft = pageMarginLeft, sceneWidth = docsWidth + pageMarginLeft * 2, scrollToX = (sceneWidth - engineWidth / scaleX) / 2), engineHeight > docsHeight ? (docsTop = engineHeight / 2 - docsHeight / 2, sceneHeight = (engineHeight - pageMarginTop * 2) / scaleY) : (docsTop = pageMarginTop, sceneHeight = docsHeight + pageMarginTop * 2), scene.resize(sceneWidth, sceneHeight + 200), docsComponent.translate(docsLeft, docsTop), docBackground.translate(docsLeft, docsTop);
161
- const viewport = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
162
- if (scrollToX !== Number.POSITIVE_INFINITY && viewport != null) {
163
- const actualX = viewport.transScroll2ViewportScrollValue(scrollToX, 0).x;
164
- viewport.scrollToBarPos({
165
- x: actualX
166
- });
167
- }
168
- return this;
169
- }
170
- _commandExecutedListener() {
171
- const updateCommandList = [OpenZenEditorOperation.id];
172
- this.disposeWithMe(
173
- this._commandService.onCommandExecuted((command) => {
174
- updateCommandList.includes(command.id) && this._handleOpenZenEditor();
175
- })
176
- );
177
- const editCommandList = [RichTextEditingMutation.id];
178
- this.disposeWithMe(
179
- this._commandService.onCommandExecuted((command) => {
180
- if (editCommandList.includes(command.id)) {
181
- const params = command.params, { unitId } = params;
182
- if (unitId === DOCS_ZEN_EDITOR_UNIT_ID_KEY) {
183
- const editorDocDataModel = this._univerInstanceService.getUniverDocInstance(unitId), docBody = editorDocDataModel == null ? void 0 : editorDocDataModel.getBody(), dataStream = docBody == null ? void 0 : docBody.dataStream, paragraphs = docBody == null ? void 0 : docBody.paragraphs, textRuns = docBody == null ? void 0 : docBody.textRuns, customBlocks = docBody == null ? void 0 : docBody.customBlocks, drawings = editorDocDataModel == null ? void 0 : editorDocDataModel.getDrawings(), drawingsOrder = editorDocDataModel == null ? void 0 : editorDocDataModel.getDrawingsOrder(), customRanges = editorDocDataModel == null ? void 0 : editorDocDataModel.getCustomRanges();
184
- if (this._editorBridgeService.changeEditorDirty(!0), dataStream == null || paragraphs == null)
185
- return;
186
- this._syncContentAndRender(DOCS_NORMAL_EDITOR_UNIT_ID_KEY, dataStream, paragraphs, textRuns, customBlocks, drawings, drawingsOrder, customRanges);
187
- }
188
- }
189
- })
190
- );
191
- }
192
- _getDocObject() {
193
- return getDocObject(this._univerInstanceService, this._renderManagerService);
194
- }
195
- }, __name(_a, "ZenEditorController"), _a);
196
- ZenEditorController = __decorateClass$2([
197
- OnLifecycle(LifecycleStages.Steady, ZenEditorController),
198
- __decorateParam$2(0, IUniverInstanceService),
199
- __decorateParam$2(1, IZenEditorManagerService),
200
- __decorateParam$2(2, IRenderManagerService),
201
- __decorateParam$2(3, ICommandService),
202
- __decorateParam$2(4, IZenZoneService),
203
- __decorateParam$2(5, IEditorBridgeService),
204
- __decorateParam$2(6, IUndoRedoService),
205
- __decorateParam$2(7, Inject(DocSelectionManagerService))
206
- ], ZenEditorController);
207
- function scrollToTop(accessor) {
208
- var _a4;
209
- const backScrollController = (_a4 = accessor.get(IRenderManagerService).getRenderById(DOCS_ZEN_EDITOR_UNIT_ID_KEY)) == null ? void 0 : _a4.with(DocBackScrollRenderController), textRange = {
210
- startOffset: 0,
211
- endOffset: 0
212
- };
213
- backScrollController && backScrollController.scrollToRange(textRange);
214
- }
215
- __name(scrollToTop, "scrollToTop");
216
- const CancelZenEditCommand = {
217
- id: "zen-editor.command.cancel-zen-edit",
218
- type: CommandType.COMMAND,
219
- handler: /* @__PURE__ */ __name(async (accessor) => {
220
- const zenZoneEditorService = accessor.get(IZenZoneService), editorBridgeService = accessor.get(IEditorBridgeService), univerInstanceManager = accessor.get(IUniverInstanceService);
221
- editorBridgeService.isVisible().visible && editorBridgeService.changeVisible({
222
- visible: !1,
223
- eventType: DeviceInputEventType.Keyboard,
224
- keycode: KeyCode.ESC,
225
- unitId: ""
226
- }), zenZoneEditorService.close(), scrollToTop(accessor);
227
- const currentSheetInstance = univerInstanceManager.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
228
- return currentSheetInstance ? (univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()), editorBridgeService.refreshEditCellState(), !0) : !1;
229
- }, "handler")
230
- }, ConfirmZenEditCommand = {
231
- id: "zen-editor.command.confirm-zen-edit",
232
- type: CommandType.COMMAND,
233
- handler: /* @__PURE__ */ __name(async (accessor) => {
234
- const zenZoneEditorService = accessor.get(IZenZoneService), editorBridgeService = accessor.get(IEditorBridgeService), univerInstanceManager = accessor.get(IUniverInstanceService);
235
- editorBridgeService.isVisible().visible && editorBridgeService.changeVisible({
236
- visible: !1,
237
- eventType: DeviceInputEventType.PointerDown,
238
- unitId: ""
239
- }), zenZoneEditorService.close(), scrollToTop(accessor);
240
- const currentSheetInstance = univerInstanceManager.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
241
- return currentSheetInstance ? (univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()), editorBridgeService.refreshEditCellState(), !0) : !1;
242
- }, "handler")
243
- };
244
- var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
245
- /**
246
- * @license React
247
- * react-jsx-runtime.production.min.js
248
- *
249
- * Copyright (c) Facebook, Inc. and its affiliates.
250
- *
251
- * This source code is licensed under the MIT license found in the
252
- * LICENSE file in the root directory of this source tree.
253
- */
254
- var f = require$$0, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
255
- function q(c, a, g) {
256
- var b, d = {}, e = null, h = null;
257
- g !== void 0 && (e = "" + g), a.key !== void 0 && (e = "" + a.key), a.ref !== void 0 && (h = a.ref);
258
- for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
259
- if (c && c.defaultProps) for (b in a = c.defaultProps, a) d[b] === void 0 && (d[b] = a[b]);
260
- return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
261
- }
262
- __name(q, "q");
263
- reactJsxRuntime_production_min.Fragment = l;
264
- reactJsxRuntime_production_min.jsx = q;
265
- reactJsxRuntime_production_min.jsxs = q;
266
- jsxRuntime.exports = reactJsxRuntime_production_min;
267
- var jsxRuntimeExports = jsxRuntime.exports, __assign = function() {
268
- return __assign = Object.assign || function(t) {
269
- for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
270
- s = arguments[i];
271
- for (var p2 in s) Object.prototype.hasOwnProperty.call(s, p2) && (t[p2] = s[p2]);
272
- }
273
- return t;
274
- }, __assign.apply(this, arguments);
275
- }, __rest = function(s, e) {
276
- var t = {};
277
- for (var p2 in s) Object.prototype.hasOwnProperty.call(s, p2) && e.indexOf(p2) < 0 && (t[p2] = s[p2]);
278
- if (s != null && typeof Object.getOwnPropertySymbols == "function")
279
- for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++)
280
- e.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]) && (t[p2[i]] = s[p2[i]]);
281
- return t;
282
- }, IconBase = forwardRef(function(props, ref) {
283
- var icon = props.icon, id = props.id, className = props.className, extend = props.extend, restProps = __rest(props, ["icon", "id", "className", "extend"]), cls = "univerjs-icon univerjs-icon-".concat(id, " ").concat(className || "").trim(), idSuffix = useRef("_".concat(generateShortUuid()));
284
- return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
285
- });
286
- function render(node, id, runtimeProps, rootProps, extend) {
287
- return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
288
- return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
289
- }));
290
- }
291
- __name(render, "render");
292
- function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
293
- var attrs = __assign({}, node.attrs);
294
- extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
295
- var defIds = runtimeProps.defIds;
296
- return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a4) {
297
- var key = _a4[0], value = _a4[1];
298
- typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
299
- })), attrs;
300
- }
301
- __name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
302
- function replaceRuntimeIdsInDefs(node, runtimeProps) {
303
- var _a4, defIds = runtimeProps.defIds;
304
- return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a4 = node.children) === null || _a4 === void 0) && _a4.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
305
- return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
306
- }) }) : node;
307
- }
308
- __name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
309
- function generateShortUuid() {
310
- return Math.random().toString(36).substring(2, 8);
311
- }
312
- __name(generateShortUuid, "generateShortUuid");
313
- IconBase.displayName = "UniverIcon";
314
- var element$1 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, CheckMarkSingle = forwardRef(function(props, ref) {
315
- return createElement(IconBase, Object.assign({}, props, {
316
- id: "check-mark-single",
317
- ref,
318
- icon: element$1
319
- }));
320
- });
321
- CheckMarkSingle.displayName = "CheckMarkSingle";
322
- var element = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, CloseSingle = forwardRef(function(props, ref) {
323
- return createElement(IconBase, Object.assign({}, props, {
324
- id: "close-single",
325
- ref,
326
- icon: element
327
- }));
328
- });
329
- CloseSingle.displayName = "CloseSingle";
330
- const zenEditor = "univer-zen-editor", zenEditorIconWrapper = "univer-zen-editor-icon-wrapper", zenEditorIconContainer = "univer-zen-editor-icon-container", zenEditorIconSuccess = "univer-zen-editor-icon-success", zenEditorIconError = "univer-zen-editor-icon-error", zenEditorCanvasContainer = "univer-zen-editor-canvas-container", styles = {
331
- zenEditor,
332
- zenEditorIconWrapper,
333
- zenEditorIconContainer,
334
- zenEditorIconSuccess,
335
- zenEditorIconError,
336
- zenEditorCanvasContainer
337
- }, COMPONENT_PREFIX = "ZEN_EDITOR_PLUGIN_", ZEN_EDITOR_COMPONENT = `${COMPONENT_PREFIX}ZEN_EDITOR_COMPONENT`;
338
- function ZenEditor() {
339
- const editorRef = useRef(null), renderManagerService = useDependency(IRenderManagerService), zenEditorManagerService = useDependency(IZenEditorManagerService), commandService = useDependency(ICommandService);
340
- useEffect(() => {
341
- const editor = editorRef.current;
342
- if (!editor)
343
- return;
344
- const renderSubscription = renderManagerService.currentRender$.subscribe((param) => {
345
- var _a4;
346
- if (param !== DOCS_ZEN_EDITOR_UNIT_ID_KEY)
347
- return;
348
- const engine = (_a4 = renderManagerService.getRenderById(DOCS_ZEN_EDITOR_UNIT_ID_KEY)) == null ? void 0 : _a4.engine;
349
- engine == null || engine.setContainer(editor);
350
- }), resizeObserver = new ResizeObserver(() => {
351
- const editorRect = editor.getBoundingClientRect();
352
- zenEditorManagerService.setPosition(editorRect);
353
- });
354
- return resizeObserver.observe(editor), () => {
355
- resizeObserver.unobserve(editor), renderSubscription.unsubscribe();
356
- };
357
- }, []);
358
- function handleCloseBtnClick() {
359
- commandService.executeCommand(CancelZenEditCommand.id);
360
- }
361
- __name(handleCloseBtnClick, "handleCloseBtnClick");
362
- function handleConfirmBtnClick() {
363
- commandService.executeCommand(ConfirmZenEditCommand.id);
364
- }
365
- return __name(handleConfirmBtnClick, "handleConfirmBtnClick"), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.zenEditor, children: [
366
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.zenEditorIconWrapper, children: [
367
- /* @__PURE__ */ jsxRuntimeExports.jsx(
368
- "span",
369
- {
370
- className: clsx(styles.zenEditorIconContainer, styles.zenEditorIconError),
371
- onClick: handleCloseBtnClick,
372
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseSingle, { style: { fontSize: "22px" } })
373
- }
374
- ),
375
- /* @__PURE__ */ jsxRuntimeExports.jsx(
376
- "span",
377
- {
378
- className: clsx(styles.zenEditorIconContainer, styles.zenEditorIconSuccess),
379
- onClick: handleConfirmBtnClick,
380
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(CheckMarkSingle, { style: { fontSize: "22px" } })
381
- }
382
- )
383
- ] }),
384
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.zenEditorCanvasContainer, ref: editorRef })
385
- ] });
386
- }
387
- __name(ZenEditor, "ZenEditor");
388
- const ZenEditorConfirmShortcut = {
389
- id: ConfirmZenEditCommand.id,
390
- description: "shortcut.sheet.zen-edit-confirm",
391
- group: "4_sheet-edit",
392
- preconditions: /* @__PURE__ */ __name((contextService) => whenZenEditorActivated(contextService), "preconditions"),
393
- binding: KeyCode.ENTER | MetaKeys.ALT
394
- }, ZenEditorCancelShortcut = {
395
- id: CancelZenEditCommand.id,
396
- description: "shortcut.sheet.zen-edit-cancel",
397
- group: "4_sheet-edit",
398
- preconditions: /* @__PURE__ */ __name((contextService) => whenZenEditorActivated(contextService), "preconditions"),
399
- binding: KeyCode.ESC
400
- };
401
- function whenZenEditorActivated(contextService) {
402
- return contextService.getContextValue(FOCUSING_DOC) && contextService.getContextValue(FOCUSING_UNIVER_EDITOR) && contextService.getContextValue(EDITOR_ACTIVATED) && !contextService.getContextValue(FOCUSING_EDITOR_STANDALONE);
403
- }
404
- __name(whenZenEditorActivated, "whenZenEditorActivated");
405
- function ZenEditorMenuItemFactory(accessor) {
406
- return {
407
- id: OpenZenEditorOperation.id,
408
- type: MenuItemType.BUTTON,
409
- title: "rightClick.zenEditor",
410
- icon: "AmplifySingle",
411
- hidden$: getCurrentExclusiveRangeInterest$(accessor),
412
- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetSetCellStylePermission], rangeTypes: [RangeProtectionPermissionEditPoint] })
413
- };
414
- }
415
- __name(ZenEditorMenuItemFactory, "ZenEditorMenuItemFactory");
416
- const menuSchema = {
417
- [ContextMenuPosition.MAIN_AREA]: {
418
- [ContextMenuGroup.OTHERS]: {
419
- [OpenZenEditorOperation.id]: {
420
- order: 2,
421
- menuItemFactory: ZenEditorMenuItemFactory
422
- }
423
- }
424
- }
425
- };
426
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
427
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
428
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
429
- return kind && result && __defProp$1(target, key, result), result;
430
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a2;
431
- let ZenEditorUIController = (_a2 = class extends Disposable {
432
- constructor(_injector, _zenZoneService, _commandService, _menuManagerService, _shortcutService) {
433
- super(), this._injector = _injector, this._zenZoneService = _zenZoneService, this._commandService = _commandService, this._menuManagerService = _menuManagerService, this._shortcutService = _shortcutService, this._initialize();
434
- }
435
- _initialize() {
436
- this._initCustomComponents(), this._initCommands(), this._initMenus(), this._initShortcuts();
437
- }
438
- _initCustomComponents() {
439
- this.disposeWithMe(this._zenZoneService.set(ZEN_EDITOR_COMPONENT, ZenEditor));
440
- }
441
- _initCommands() {
442
- [OpenZenEditorOperation, CancelZenEditCommand, ConfirmZenEditCommand].forEach((c) => {
443
- this.disposeWithMe(this._commandService.registerCommand(c));
444
- });
445
- }
446
- _initMenus() {
447
- this._menuManagerService.mergeMenu(menuSchema);
448
- }
449
- _initShortcuts() {
450
- [ZenEditorConfirmShortcut, ZenEditorCancelShortcut].forEach((item) => {
451
- this.disposeWithMe(this._shortcutService.registerShortcut(item));
452
- });
453
- }
454
- }, __name(_a2, "ZenEditorUIController"), _a2);
455
- ZenEditorUIController = __decorateClass$1([
456
- OnLifecycle(LifecycleStages.Rendered, ZenEditorUIController),
457
- __decorateParam$1(0, Inject(Injector)),
458
- __decorateParam$1(1, IZenZoneService),
459
- __decorateParam$1(2, ICommandService),
460
- __decorateParam$1(3, IMenuManagerService),
461
- __decorateParam$1(4, IShortcutService)
462
- ], ZenEditorUIController);
463
- const PLUGIN_CONFIG_KEY = "sheets-zen-editor.config", defaultPluginConfig = {};
464
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
465
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
466
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
467
- return kind && result && __defProp2(target, key, result), result;
468
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), _a3;
469
- let UniverSheetsZenEditorPlugin = (_a3 = class extends Plugin {
470
- constructor(_config = defaultPluginConfig, _injector, _configService) {
471
- super(), this._config = _config, this._injector = _injector, this._configService = _configService;
472
- const { menu, ...rest } = this._config;
473
- menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest), this._initializeDependencies(this._injector);
474
- }
475
- _initializeDependencies(injector) {
476
- [
477
- [ZenEditorUIController],
478
- [ZenEditorController],
479
- [IZenEditorManagerService, { useClass: ZenEditorManagerService }]
480
- ].forEach((dependency) => injector.add(dependency));
481
- }
482
- }, __name(_a3, "UniverSheetsZenEditorPlugin"), __publicField(_a3, "pluginName", "SHEET_ZEN_EDITOR_PLUGIN"), __publicField(_a3, "type", UniverInstanceType.UNIVER_SHEET), _a3);
483
- UniverSheetsZenEditorPlugin = __decorateClass([
484
- __decorateParam(1, Inject(Injector)),
485
- __decorateParam(2, IConfigService)
486
- ], UniverSheetsZenEditorPlugin);
487
- export {
488
- CancelZenEditCommand,
489
- ConfirmZenEditCommand,
490
- OpenZenEditorOperation,
491
- UniverSheetsZenEditorPlugin
492
- };
1
+ var _0x59c684=_0x3362;(function(_0x302202,_0x136a1f){var _0x3c74a2=_0x3362,_0x461b91=_0x302202();while(!![]){try{var _0xaebd05=parseInt(_0x3c74a2(0x98))/0x1*(parseInt(_0x3c74a2(0x7f))/0x2)+-parseInt(_0x3c74a2(0xa8))/0x3+-parseInt(_0x3c74a2(0xe1))/0x4+-parseInt(_0x3c74a2(0x110))/0x5+parseInt(_0x3c74a2(0x100))/0x6*(-parseInt(_0x3c74a2(0xd6))/0x7)+-parseInt(_0x3c74a2(0x9c))/0x8+parseInt(_0x3c74a2(0x112))/0x9;if(_0xaebd05===_0x136a1f)break;else _0x461b91['push'](_0x461b91['shift']());}catch(_0x1fd187){_0x461b91['push'](_0x461b91['shift']());}}}(_0x1288,0x18813));var __defProp=Object[_0x59c684(0xdb)],__defNormalProp=(_0x53180a,_0x265692,_0x3fd759)=>_0x265692 in _0x53180a?__defProp(_0x53180a,_0x265692,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3fd759}):_0x53180a[_0x265692]=_0x3fd759,__name=(_0x1eae00,_0x15a957)=>__defProp(_0x1eae00,_0x59c684(0xa1),{'value':_0x15a957,'configurable':!0x0}),__publicField=(_0x42c7de,_0x4d5eac,_0x7101b)=>__defNormalProp(_0x42c7de,typeof _0x4d5eac!='symbol'?_0x4d5eac+'':_0x4d5eac,_0x7101b);import{CommandType,IUniverInstanceService,DOCS_ZEN_EDITOR_UNIT_ID_KEY,Tools,UniverInstanceType,DocumentDataModel,createIdentifier,RxDisposable,DEFAULT_EMPTY_DOCUMENT_VALUE,DocumentFlavor,useDependency,ICommandService,FOCUSING_DOC,FOCUSING_UNIVER_EDITOR,EDITOR_ACTIVATED,FOCUSING_EDITOR_STANDALONE,Disposable,Plugin,Inject,Injector,IConfigService}from'@univerjs/core';import{IEditorService,VIEWPORT_KEY,DocBackScrollRenderController}from'@univerjs/docs-ui';import{IRenderManagerService}from'@univerjs/engine-render';import{IEditorBridgeService,EditingRenderController,getEditorObject,getCurrentExclusiveRangeInterest$,getCurrentRangeDisable$}from'@univerjs/sheets-ui';import{IZenZoneService,MenuItemType,ContextMenuPosition,ContextMenuGroup,KeyCode,MetaKeys,IMenuManagerService,IShortcutService}from'@univerjs/ui';import{BehaviorSubject,takeUntil}from'rxjs';import _0x1576ba,{forwardRef,useRef,createElement,useEffect}from'react';import _0x2e7bd6 from'clsx';import{WorkbookEditablePermission,WorksheetEditPermission,WorksheetSetCellValuePermission,WorksheetSetCellStylePermission,RangeProtectionPermissionEditPoint}from'@univerjs/sheets';const OpenZenEditorCommand={'id':_0x59c684(0x111),'type':CommandType[_0x59c684(0xbd)],'handler':__name(async _0x42bc08=>{var _0x28f3e2=_0x59c684,_0x5d3c38;const _0x35ad6e=_0x42bc08['get'](IZenZoneService),_0x5ca90e=_0x42bc08[_0x28f3e2(0xc7)](IEditorService),_0x3d502b=_0x42bc08['get'](IEditorBridgeService),_0x5f38ba=_0x42bc08[_0x28f3e2(0xc7)](IUniverInstanceService);_0x35ad6e[_0x28f3e2(0xe2)]();const _0x350ac1=_0x5ca90e[_0x28f3e2(0xab)](DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(_0x350ac1==null)return!0x1;const _0x500470=_0x3d502b[_0x28f3e2(0x81)]();if(_0x500470==null)return!0x1;const _0x2bc37a=(_0x5d3c38=_0x500470[_0x28f3e2(0xe6)][_0x28f3e2(0x8d)])==null?void 0x0:_0x5d3c38['getSnapshot']();if(_0x2bc37a==null)return!0x1;_0x5f38ba[_0x28f3e2(0xc9)](DOCS_ZEN_EDITOR_UNIT_ID_KEY);const {body:_0x191f3a,drawings:_0xd7ec1b,drawingsOrder:_0x306b9b,tableSource:_0x39f136,settings:_0x19e9e3}=Tools[_0x28f3e2(0xbf)](_0x2bc37a),_0x2f9c6e={..._0x350ac1[_0x28f3e2(0xac)](),'body':_0x191f3a,'drawings':_0xd7ec1b,'drawingsOrder':_0x306b9b,'tableSource':_0x39f136,'settings':_0x19e9e3},_0x107ec1=[{'startOffset':0x0,'endOffset':0x0,'collapsed':!0x0}];return _0x350ac1['focus'](),_0x350ac1[_0x28f3e2(0xbb)](_0x2f9c6e,_0x107ec1),_0x350ac1[_0x28f3e2(0xf1)](),!0x0;},_0x59c684(0x116))},CancelZenEditCommand={'id':_0x59c684(0x122),'type':CommandType[_0x59c684(0xbd)],'handler':__name(async _0x3882fe=>{var _0x3540f8=_0x59c684;const _0x456f7d=_0x3882fe[_0x3540f8(0xc7)](IZenZoneService),_0x3aa73f=_0x3882fe[_0x3540f8(0xc7)](IEditorBridgeService),_0x486533=_0x3882fe[_0x3540f8(0xc7)](IUniverInstanceService);_0x456f7d[_0x3540f8(0x70)]();const _0x55b112=_0x486533[_0x3540f8(0xf7)](UniverInstanceType[_0x3540f8(0x8f)]);return _0x55b112?(_0x486533[_0x3540f8(0xc9)](_0x55b112[_0x3540f8(0x73)]()),_0x3aa73f[_0x3540f8(0x7b)](),!0x0):!0x1;},_0x59c684(0x116))},ConfirmZenEditCommand={'id':_0x59c684(0x128),'type':CommandType[_0x59c684(0xbd)],'handler':__name(async _0x108ef6=>{var _0x3cf93a=_0x59c684,_0x1828c7;const _0x5d73c6=_0x108ef6[_0x3cf93a(0xc7)](IZenZoneService),_0x19de84=_0x108ef6[_0x3cf93a(0xc7)](IEditorBridgeService),_0x3b8594=_0x108ef6[_0x3cf93a(0xc7)](IUniverInstanceService),_0x298895=_0x108ef6[_0x3cf93a(0xc7)](IEditorService);_0x5d73c6[_0x3cf93a(0x70)]();const _0x5c9f8b=_0x298895[_0x3cf93a(0xab)](DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(_0x5c9f8b==null)return!0x1;const _0x56c3f2=_0x108ef6[_0x3cf93a(0xc7)](IRenderManagerService),_0x266879=_0x3b8594[_0x3cf93a(0xf7)](UniverInstanceType[_0x3cf93a(0x8f)]);if(_0x266879){const _0xb742a8=_0x266879[_0x3cf93a(0x73)](),_0x14edbb=(_0x1828c7=_0x56c3f2[_0x3cf93a(0xfb)](_0xb742a8))==null?void 0x0:_0x1828c7[_0x3cf93a(0x96)](EditingRenderController);if(_0x14edbb){const _0x59ac0b=Tools[_0x3cf93a(0xbf)](_0x5c9f8b[_0x3cf93a(0xac)]());_0x14edbb[_0x3cf93a(0x10f)](new DocumentDataModel(_0x59ac0b));}return _0x3b8594[_0x3cf93a(0xc9)](_0x266879['getUnitId']()),_0x19de84[_0x3cf93a(0x7b)](),!0x0;}return!0x1;},_0x59c684(0x116))},PLUGIN_CONFIG_KEY=_0x59c684(0x8a),defaultPluginConfig={},_ZenEditorManagerService=class _ZenEditorManagerService{constructor(){var _0x2a5ccb=_0x59c684;__publicField(this,_0x2a5ccb(0xd2),null),__publicField(this,_0x2a5ccb(0x9f),new BehaviorSubject(null)),__publicField(this,'position$',this[_0x2a5ccb(0x9f)][_0x2a5ccb(0xce)]());}['dispose'](){var _0x33219d=_0x59c684;this[_0x33219d(0x9f)][_0x33219d(0x10a)](),this[_0x33219d(0xd2)]=null;}[_0x59c684(0x80)](_0x50404e){var _0x3b5b93=_0x59c684;this[_0x3b5b93(0xd2)]=_0x50404e,this[_0x3b5b93(0xcd)](_0x50404e);}[_0x59c684(0x97)](){var _0x54380b=_0x59c684;return this[_0x54380b(0xd2)];}[_0x59c684(0xcd)](_0x4900fa){var _0x17c772=_0x59c684;this[_0x17c772(0x9f)]['next'](_0x4900fa);}};__name(_ZenEditorManagerService,'ZenEditorManagerService');let ZenEditorManagerService=_ZenEditorManagerService;const IZenEditorManagerService=createIdentifier(_0x59c684(0x75));var __defProp$2=Object['defineProperty'],__getOwnPropDesc$2=Object[_0x59c684(0xf9)],__decorateClass$2=__name((_0x43a475,_0x5cf707,_0x34eec4,_0x4ddf2b)=>{var _0x2a06dc=_0x59c684;for(var _0x3706f0=_0x4ddf2b>0x1?void 0x0:_0x4ddf2b?__getOwnPropDesc$2(_0x5cf707,_0x34eec4):_0x5cf707,_0x5942b9=_0x43a475[_0x2a06dc(0x71)]-0x1,_0x461059;_0x5942b9>=0x0;_0x5942b9--)(_0x461059=_0x43a475[_0x5942b9])&&(_0x3706f0=(_0x4ddf2b?_0x461059(_0x5cf707,_0x34eec4,_0x3706f0):_0x461059(_0x3706f0))||_0x3706f0);return _0x4ddf2b&&_0x3706f0&&__defProp$2(_0x5cf707,_0x34eec4,_0x3706f0),_0x3706f0;},'__decorateClass$2'),__decorateParam$2=__name((_0x2d72c3,_0x36af76)=>(_0x345bf7,_0x3c11c1)=>_0x36af76(_0x345bf7,_0x3c11c1,_0x2d72c3),'__decorateParam$2'),_a;let ZenEditorController=(_a=class extends RxDisposable{constructor(_0x5efdf6,_0x4f895e){var _0x46f1a4=_0x59c684;super(),this[_0x46f1a4(0x12b)]=_0x5efdf6,this[_0x46f1a4(0x115)]=_0x4f895e,this[_0x46f1a4(0x10d)]();}[_0x59c684(0x10d)](){var _0xdfab0a=_0x59c684;this[_0xdfab0a(0x10e)]();}[_0x59c684(0x10e)](){var _0x54d973=_0x59c684;this[_0x54d973(0x12b)][_0x54d973(0x121)][_0x54d973(0xd4)](takeUntil(this[_0x54d973(0xae)]))[_0x54d973(0x82)](_0x51f772=>{var _0x4bb722=_0x54d973;if(_0x51f772==null)return;const {width:_0x5883e0,height:_0x41e06f}=_0x51f772,_0x4a060d=getEditorObject(DOCS_ZEN_EDITOR_UNIT_ID_KEY,this[_0x4bb722(0x115)]);_0x4a060d!=null&&requestIdleCallback(()=>{var _0x52fb49=_0x4bb722;_0x4a060d[_0x52fb49(0x8b)][_0x52fb49(0x11e)](_0x5883e0,_0x41e06f),this['_calculatePagePosition'](_0x4a060d),this['_scrollToTop']();});});}[_0x59c684(0xfa)](_0x308f32){var _0x3f8167=_0x59c684;const {document:_0x3b1d73,scene:_0x47cd57,docBackground:_0x530cbc}=_0x308f32,_0x293dc6=_0x47cd57==null?void 0x0:_0x47cd57[_0x3f8167(0x90)](),{width:_0x210642,height:_0x410e94,pageMarginLeft:_0x5318fc,pageMarginTop:_0x5f3c30}=_0x3b1d73;if(_0x293dc6==null||_0x210642===Number[_0x3f8167(0x10c)]||_0x410e94===Number['POSITIVE_INFINITY'])return;const {width:_0x294dd7,height:_0x266e99}=_0x293dc6;let _0x4bac9a=0x0,_0x23cb20=0x0,_0x3fbf28=0x0,_0x1a35dc=0x0,_0x178e5c=Number[_0x3f8167(0x10c)];const {scaleX:_0xad9894,scaleY:_0x37c950}=_0x47cd57[_0x3f8167(0x83)]();_0x294dd7>(_0x210642+_0x5318fc*0x2)*_0xad9894?(_0x4bac9a=_0x294dd7/0x2-_0x210642*_0xad9894/0x2,_0x4bac9a/=_0xad9894,_0x3fbf28=(_0x294dd7-_0x5318fc*0x2)/_0xad9894,_0x178e5c=0x0):(_0x4bac9a=_0x5318fc,_0x3fbf28=_0x210642+_0x5318fc*0x2,_0x178e5c=(_0x3fbf28-_0x294dd7/_0xad9894)/0x2),_0x266e99>_0x410e94?(_0x23cb20=_0x266e99/0x2-_0x410e94/0x2,_0x1a35dc=(_0x266e99-_0x5f3c30*0x2)/_0x37c950):(_0x23cb20=_0x5f3c30,_0x1a35dc=_0x410e94+_0x5f3c30*0x2),_0x47cd57[_0x3f8167(0x108)](_0x3fbf28,_0x1a35dc+0xc8),_0x3b1d73[_0x3f8167(0xa5)](_0x4bac9a,_0x23cb20),_0x530cbc[_0x3f8167(0xa5)](_0x4bac9a,_0x23cb20);const _0x4daa34=_0x47cd57[_0x3f8167(0xe5)](VIEWPORT_KEY[_0x3f8167(0xde)]);if(_0x178e5c!==Number['POSITIVE_INFINITY']&&_0x4daa34!=null){const _0x3aed69=_0x4daa34[_0x3f8167(0x11a)](_0x178e5c,0x0)['x'];_0x4daa34[_0x3f8167(0xc5)]({'x':_0x3aed69});}return this;}[_0x59c684(0xfc)](){var _0x3fd978=_0x59c684,_0x45eda9;const _0x230172=(_0x45eda9=this[_0x3fd978(0x115)]['getRenderById'](DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0x0:_0x45eda9['with'](DocBackScrollRenderController),_0x57ea1b={'startOffset':0x0,'endOffset':0x0};_0x230172&&_0x230172[_0x3fd978(0xb9)](_0x57ea1b);}},__name(_a,_0x59c684(0xc2)),_a);ZenEditorController=__decorateClass$2([__decorateParam$2(0x0,IZenEditorManagerService),__decorateParam$2(0x1,IRenderManagerService)],ZenEditorController);var jsxRuntime={'exports':{}},reactJsxRuntime_production_min={},f=_0x1576ba,k=Symbol[_0x59c684(0x88)](_0x59c684(0xa3)),l=Symbol[_0x59c684(0x88)](_0x59c684(0xc6)),m=Object[_0x59c684(0x8e)][_0x59c684(0x6e)],n=f['__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED'][_0x59c684(0x125)],p={'key':!0x0,'ref':!0x0,'__self':!0x0,'__source':!0x0};function q(_0xc8305a,_0x348383,_0x549d59){var _0x138eb3=_0x59c684,_0x42c0f4,_0x4efd1a={},_0x5b0f5b=null,_0x38339b=null;_0x549d59!==void 0x0&&(_0x5b0f5b=''+_0x549d59),_0x348383[_0x138eb3(0xf8)]!==void 0x0&&(_0x5b0f5b=''+_0x348383[_0x138eb3(0xf8)]),_0x348383[_0x138eb3(0x12a)]!==void 0x0&&(_0x38339b=_0x348383['ref']);for(_0x42c0f4 in _0x348383)m[_0x138eb3(0xda)](_0x348383,_0x42c0f4)&&!p['hasOwnProperty'](_0x42c0f4)&&(_0x4efd1a[_0x42c0f4]=_0x348383[_0x42c0f4]);if(_0xc8305a&&_0xc8305a[_0x138eb3(0xf4)]){for(_0x42c0f4 in(_0x348383=_0xc8305a[_0x138eb3(0xf4)],_0x348383))_0x4efd1a[_0x42c0f4]===void 0x0&&(_0x4efd1a[_0x42c0f4]=_0x348383[_0x42c0f4]);}return{'$$typeof':k,'type':_0xc8305a,'key':_0x5b0f5b,'ref':_0x38339b,'props':_0x4efd1a,'_owner':n[_0x138eb3(0xed)]};}__name(q,'q'),reactJsxRuntime_production_min[_0x59c684(0x7a)]=l,reactJsxRuntime_production_min[_0x59c684(0xe8)]=q,reactJsxRuntime_production_min[_0x59c684(0xad)]=q,jsxRuntime[_0x59c684(0x11d)]=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime[_0x59c684(0x11d)],__assign=function(){var _0x2f04bb=_0x59c684;return __assign=Object[_0x2f04bb(0x113)]||function(_0x395cd3){var _0x1fe5db=_0x2f04bb;for(var _0x11f174,_0x235e01=0x1,_0x2b8b13=arguments[_0x1fe5db(0x71)];_0x235e01<_0x2b8b13;_0x235e01++){_0x11f174=arguments[_0x235e01];for(var _0x5528d6 in _0x11f174)Object[_0x1fe5db(0x8e)]['hasOwnProperty']['call'](_0x11f174,_0x5528d6)&&(_0x395cd3[_0x5528d6]=_0x11f174[_0x5528d6]);}return _0x395cd3;},__assign['apply'](this,arguments);},__rest=function(_0x56a9bf,_0x41421b){var _0x40a4d2=_0x59c684,_0x557b60={};for(var _0x5ef819 in _0x56a9bf)Object[_0x40a4d2(0x8e)][_0x40a4d2(0x6e)]['call'](_0x56a9bf,_0x5ef819)&&_0x41421b['indexOf'](_0x5ef819)<0x0&&(_0x557b60[_0x5ef819]=_0x56a9bf[_0x5ef819]);if(_0x56a9bf!=null&&typeof Object[_0x40a4d2(0x117)]=='function'){for(var _0x2ae988=0x0,_0x5ef819=Object['getOwnPropertySymbols'](_0x56a9bf);_0x2ae988<_0x5ef819[_0x40a4d2(0x71)];_0x2ae988++)_0x41421b[_0x40a4d2(0x9e)](_0x5ef819[_0x2ae988])<0x0&&Object[_0x40a4d2(0x8e)][_0x40a4d2(0x11b)][_0x40a4d2(0xda)](_0x56a9bf,_0x5ef819[_0x2ae988])&&(_0x557b60[_0x5ef819[_0x2ae988]]=_0x56a9bf[_0x5ef819[_0x2ae988]]);}return _0x557b60;},IconBase=forwardRef(function(_0x1f6ac,_0xa78041){var _0x3b08e1=_0x59c684,_0x2cfed5=_0x1f6ac[_0x3b08e1(0xd1)],_0x12f77b=_0x1f6ac['id'],_0x3283ee=_0x1f6ac['className'],_0x48b008=_0x1f6ac[_0x3b08e1(0xcf)],_0x5e4293=__rest(_0x1f6ac,[_0x3b08e1(0xd1),'id',_0x3b08e1(0x7e),_0x3b08e1(0xcf)]),_0x4d69ad=_0x3b08e1(0xc8)['concat'](_0x12f77b,'\x20')[_0x3b08e1(0xca)](_0x3283ee||'')[_0x3b08e1(0x93)](),_0x1aec40=useRef('_'[_0x3b08e1(0xca)](generateShortUuid()));return render(_0x2cfed5,''['concat'](_0x12f77b),{'defIds':_0x2cfed5[_0x3b08e1(0xa7)],'idSuffix':_0x1aec40[_0x3b08e1(0xed)]},__assign({'ref':_0xa78041,'className':_0x4d69ad},_0x5e4293),_0x48b008);});function render(_0x4325d0,_0x4f8a3d,_0x344b41,_0x44c373,_0x151b38){var _0x1815f6=_0x59c684;return createElement(_0x4325d0[_0x1815f6(0xb0)],__assign(__assign({'key':_0x4f8a3d},replaceRuntimeIdsAndExtInAttrs(_0x4325d0,_0x344b41,_0x151b38)),_0x44c373),(replaceRuntimeIdsInDefs(_0x4325d0,_0x344b41)[_0x1815f6(0x9b)]||[])[_0x1815f6(0x129)](function(_0x115d9f,_0x2dd830){var _0x5707c0=_0x1815f6;return render(_0x115d9f,''['concat'](_0x4f8a3d,'-')[_0x5707c0(0xca)](_0x4325d0[_0x5707c0(0xb0)],'-')[_0x5707c0(0xca)](_0x2dd830),_0x344b41,void 0x0,_0x151b38);}));}__name(render,_0x59c684(0x76));function replaceRuntimeIdsAndExtInAttrs(_0xc74bc4,_0x3b1da5,_0x45f1fd){var _0x28871b=_0x59c684,_0x259dcf=__assign({},_0xc74bc4[_0x28871b(0x11f)]);_0x45f1fd!=null&&_0x45f1fd[_0x28871b(0x101)]&&_0x259dcf['fill']===_0x28871b(0x101)&&(_0x259dcf[_0x28871b(0x9d)]=_0x45f1fd[_0x28871b(0x101)]);var _0x29b3ec=_0x3b1da5[_0x28871b(0xa7)];return!_0x29b3ec||_0x29b3ec['length']===0x0||(_0xc74bc4[_0x28871b(0xb0)]===_0x28871b(0xff)&&_0x259dcf[_0x28871b(0xb7)]&&(_0x259dcf[_0x28871b(0xb7)]=_0x259dcf['xlink:href']+_0x3b1da5[_0x28871b(0xb6)]),Object[_0x28871b(0x99)](_0x259dcf)[_0x28871b(0xec)](function(_0x27030d){var _0x2fcb2f=_0x28871b,_0x1bf374=_0x27030d[0x0],_0xaf30b5=_0x27030d[0x1];typeof _0xaf30b5==_0x2fcb2f(0x105)&&(_0x259dcf[_0x1bf374]=_0xaf30b5[_0x2fcb2f(0xc1)](/url\(#(.*)\)/,'url(#$1'[_0x2fcb2f(0xca)](_0x3b1da5['idSuffix'],')')));})),_0x259dcf;}__name(replaceRuntimeIdsAndExtInAttrs,_0x59c684(0x7c));function replaceRuntimeIdsInDefs(_0x54fc14,_0x42958a){var _0x33671b=_0x59c684,_0x59942a,_0x5881a4=_0x42958a[_0x33671b(0xa7)];return!_0x5881a4||_0x5881a4[_0x33671b(0x71)]===0x0?_0x54fc14:_0x54fc14['tag']===_0x33671b(0xc4)&&(!((_0x59942a=_0x54fc14['children'])===null||_0x59942a===void 0x0)&&_0x59942a[_0x33671b(0x71)])?__assign(__assign({},_0x54fc14),{'children':_0x54fc14['children'][_0x33671b(0x129)](function(_0x19df5d){var _0x3b75df=_0x33671b;return typeof _0x19df5d['attrs']['id']==_0x3b75df(0x105)&&_0x5881a4&&_0x5881a4[_0x3b75df(0x9e)](_0x19df5d[_0x3b75df(0x11f)]['id'])>-0x1?__assign(__assign({},_0x19df5d),{'attrs':__assign(__assign({},_0x19df5d[_0x3b75df(0x11f)]),{'id':_0x19df5d[_0x3b75df(0x11f)]['id']+_0x42958a[_0x3b75df(0xb6)]})}):_0x19df5d;})}):_0x54fc14;}__name(replaceRuntimeIdsInDefs,_0x59c684(0xb8));function generateShortUuid(){var _0x35b3db=_0x59c684;return Math['random']()[_0x35b3db(0xa9)](0x24)[_0x35b3db(0xeb)](0x2,0x8);}__name(generateShortUuid,_0x59c684(0xa0)),IconBase[_0x59c684(0x86)]=_0x59c684(0x107);var element$1={'tag':_0x59c684(0x77),'attrs':{'fill':'none','viewBox':_0x59c684(0x119),'width':_0x59c684(0x114),'height':'1em'},'children':[{'tag':_0x59c684(0xd9),'attrs':{'fill':_0x59c684(0xb2),'d':_0x59c684(0xa4),'fillRule':_0x59c684(0x103),'clipRule':_0x59c684(0x103)}}]},CheckMarkSingle=forwardRef(function(_0x211e67,_0x1cd5df){var _0x38d319=_0x59c684;return createElement(IconBase,Object[_0x38d319(0x113)]({},_0x211e67,{'id':_0x38d319(0x7d),'ref':_0x1cd5df,'icon':element$1}));});CheckMarkSingle[_0x59c684(0x86)]='CheckMarkSingle';var element={'tag':_0x59c684(0x77),'attrs':{'fill':_0x59c684(0xb1),'viewBox':_0x59c684(0x119),'width':'1em','height':_0x59c684(0x114)},'children':[{'tag':'path','attrs':{'fill':'currentColor','d':_0x59c684(0xf2)}}]},CloseSingle=forwardRef(function(_0x116c1e,_0x3750b2){var _0x59b076=_0x59c684;return createElement(IconBase,Object[_0x59b076(0x113)]({},_0x116c1e,{'id':_0x59b076(0xd0),'ref':_0x3750b2,'icon':element}));});CloseSingle['displayName']='CloseSingle';const zenEditor='univer-zen-editor',zenEditorIconWrapper=_0x59c684(0xd3),zenEditorIconContainer='univer-zen-editor-icon-container',zenEditorIconSuccess=_0x59c684(0x118),zenEditorIconError=_0x59c684(0xdc),zenEditorCanvasContainer=_0x59c684(0xa6),styles={'zenEditor':zenEditor,'zenEditorIconWrapper':zenEditorIconWrapper,'zenEditorIconContainer':zenEditorIconContainer,'zenEditorIconSuccess':zenEditorIconSuccess,'zenEditorIconError':zenEditorIconError,'zenEditorCanvasContainer':zenEditorCanvasContainer},COMPONENT_PREFIX=_0x59c684(0x120),ZEN_EDITOR_COMPONENT=COMPONENT_PREFIX+_0x59c684(0x85),INITIAL_SNAPSHOT={'id':DOCS_ZEN_EDITOR_UNIT_ID_KEY,'body':{'dataStream':''+DEFAULT_EMPTY_DOCUMENT_VALUE,'textRuns':[],'tables':[],'customBlocks':[],'paragraphs':[{'startIndex':0x0}],'sectionBreaks':[{'startIndex':0x1}]},'tableSource':{},'documentStyle':{'pageSize':{'width':0x253,'height':0x34a},'documentFlavor':DocumentFlavor['MODERN'],'marginTop':0x32,'marginBottom':0x32,'marginRight':0x28,'marginLeft':0x28,'renderConfig':{'vertexAngle':0x0,'centerAngle':0x0}},'drawings':{},'drawingsOrder':[]};function ZenEditor(){var _0xbaf44a=_0x59c684;const _0x4d4422=useRef(null),_0x2c4e77=useDependency(IZenEditorManagerService),_0x1c5cad=useDependency(IEditorService),_0x5b11e9=useDependency(ICommandService);useEffect(()=>{var _0x2d229d=_0x3362;const _0x9d537d=_0x4d4422[_0x2d229d(0xed)];if(!_0x9d537d)return;const _0xc3093a=_0x1c5cad[_0x2d229d(0xf3)]({'editorUnitId':DOCS_ZEN_EDITOR_UNIT_ID_KEY,'initialSnapshot':INITIAL_SNAPSHOT,'scrollBar':!0x0,'noNeedVerticalAlign':!0x0,'backScrollOffset':0x64},_0x9d537d),_0x3b334b=new ResizeObserver(()=>{var _0xe13086=_0x2d229d;_0x2c4e77[_0xe13086(0x80)](_0x9d537d[_0xe13086(0x126)]());});return _0x3b334b[_0x2d229d(0xea)](_0x9d537d),()=>{var _0x1d3946=_0x2d229d;_0xc3093a[_0x1d3946(0xaa)](),_0x3b334b['unobserve'](_0x9d537d);};},[]);function _0x59ecdb(){var _0x23dc8e=_0x3362;_0x5b11e9[_0x23dc8e(0xe7)](CancelZenEditCommand['id']);}__name(_0x59ecdb,_0xbaf44a(0xdf));function _0x39205d(){var _0x34872e=_0xbaf44a;_0x5b11e9[_0x34872e(0xe7)](ConfirmZenEditCommand['id']);}return __name(_0x39205d,_0xbaf44a(0xf5)),jsxRuntimeExports[_0xbaf44a(0xad)](_0xbaf44a(0xf0),{'className':styles[_0xbaf44a(0xe4)],'children':[jsxRuntimeExports[_0xbaf44a(0xad)](_0xbaf44a(0xf0),{'className':styles[_0xbaf44a(0x8c)],'children':[jsxRuntimeExports[_0xbaf44a(0xe8)](_0xbaf44a(0x72),{'className':_0x2e7bd6(styles['zenEditorIconContainer'],styles[_0xbaf44a(0xf6)]),'onClick':_0x59ecdb,'children':jsxRuntimeExports[_0xbaf44a(0xe8)](CloseSingle,{'style':{'fontSize':_0xbaf44a(0xd8)}})}),jsxRuntimeExports[_0xbaf44a(0xe8)](_0xbaf44a(0x72),{'className':_0x2e7bd6(styles[_0xbaf44a(0xe0)],styles[_0xbaf44a(0xaf)]),'onClick':_0x39205d,'children':jsxRuntimeExports['jsx'](CheckMarkSingle,{'style':{'fontSize':_0xbaf44a(0xd8)}})})]}),jsxRuntimeExports[_0xbaf44a(0xe8)](_0xbaf44a(0xf0),{'className':styles[_0xbaf44a(0x106)],'ref':_0x4d4422})]});}function _0x3362(_0x230c0e,_0x35d6ae){var _0x1288e5=_0x1288();return _0x3362=function(_0x33626b,_0x443669){_0x33626b=_0x33626b-0x6e;var _0x334d39=_0x1288e5[_0x33626b];return _0x334d39;},_0x3362(_0x230c0e,_0x35d6ae);}__name(ZenEditor,_0x59c684(0xfd));function ZenEditorMenuItemFactory(_0xf41446){var _0x470da9=_0x59c684;return{'id':OpenZenEditorCommand['id'],'type':MenuItemType[_0x470da9(0x102)],'title':_0x470da9(0xd5),'icon':'AmplifySingle','hidden$':getCurrentExclusiveRangeInterest$(_0xf41446),'disabled$':getCurrentRangeDisable$(_0xf41446,{'workbookTypes':[WorkbookEditablePermission],'worksheetTypes':[WorksheetEditPermission,WorksheetSetCellValuePermission,WorksheetSetCellStylePermission],'rangeTypes':[RangeProtectionPermissionEditPoint]})};}__name(ZenEditorMenuItemFactory,_0x59c684(0xcc));const menuSchema={[ContextMenuPosition[_0x59c684(0x127)]]:{[ContextMenuGroup[_0x59c684(0x104)]]:{[OpenZenEditorCommand['id']]:{'order':0x2,'menuItemFactory':ZenEditorMenuItemFactory}}}},ZenEditorConfirmShortcut={'id':ConfirmZenEditCommand['id'],'description':'shortcut.sheet.zen-edit-confirm','group':_0x59c684(0x84),'preconditions':__name(_0x41bd78=>whenZenEditorActivated(_0x41bd78),_0x59c684(0xe3)),'binding':KeyCode[_0x59c684(0xdd)]|MetaKeys[_0x59c684(0xb4)]},ZenEditorCancelShortcut={'id':CancelZenEditCommand['id'],'description':_0x59c684(0xcb),'group':_0x59c684(0x84),'preconditions':__name(_0x478139=>whenZenEditorActivated(_0x478139),_0x59c684(0xe3)),'binding':KeyCode[_0x59c684(0xa2)]};function whenZenEditorActivated(_0x4dc90c){var _0x3c526a=_0x59c684;return _0x4dc90c[_0x3c526a(0x74)](FOCUSING_DOC)&&_0x4dc90c[_0x3c526a(0x74)](FOCUSING_UNIVER_EDITOR)&&_0x4dc90c[_0x3c526a(0x74)](EDITOR_ACTIVATED)&&!_0x4dc90c[_0x3c526a(0x74)](FOCUSING_EDITOR_STANDALONE);}__name(whenZenEditorActivated,_0x59c684(0x11c));var __defProp$1=Object['defineProperty'],__getOwnPropDesc$1=Object[_0x59c684(0xf9)],__decorateClass$1=__name((_0x3425e3,_0x433426,_0x717992,_0x26ee3c)=>{var _0x5b2449=_0x59c684;for(var _0x2f05b2=_0x26ee3c>0x1?void 0x0:_0x26ee3c?__getOwnPropDesc$1(_0x433426,_0x717992):_0x433426,_0x5e0b2b=_0x3425e3[_0x5b2449(0x71)]-0x1,_0xabf7a7;_0x5e0b2b>=0x0;_0x5e0b2b--)(_0xabf7a7=_0x3425e3[_0x5e0b2b])&&(_0x2f05b2=(_0x26ee3c?_0xabf7a7(_0x433426,_0x717992,_0x2f05b2):_0xabf7a7(_0x2f05b2))||_0x2f05b2);return _0x26ee3c&&_0x2f05b2&&__defProp$1(_0x433426,_0x717992,_0x2f05b2),_0x2f05b2;},_0x59c684(0x92)),__decorateParam$1=__name((_0x2fcf92,_0x389458)=>(_0x514213,_0x44972f)=>_0x389458(_0x514213,_0x44972f,_0x2fcf92),_0x59c684(0xc3)),_a2;let ZenEditorUIController=(_a2=class extends Disposable{constructor(_0x4d2450,_0x3b0f31,_0x313e64,_0x553d8d){var _0x50eb62=_0x59c684;super(),this['_zenZoneService']=_0x4d2450,this[_0x50eb62(0x78)]=_0x3b0f31,this[_0x50eb62(0xbc)]=_0x313e64,this[_0x50eb62(0x91)]=_0x553d8d,this['_initialize']();}[_0x59c684(0x10d)](){var _0x361085=_0x59c684;this[_0x361085(0x6f)](),this['_initCommands'](),this[_0x361085(0x87)](),this[_0x361085(0x109)]();}['_initCustomComponents'](){var _0xbbcffd=_0x59c684;this[_0xbbcffd(0x9a)](this[_0xbbcffd(0x10b)][_0xbbcffd(0xc0)](ZEN_EDITOR_COMPONENT,ZenEditor));}[_0x59c684(0xe9)](){var _0x4dd83a=_0x59c684;[OpenZenEditorCommand,CancelZenEditCommand,ConfirmZenEditCommand][_0x4dd83a(0xec)](_0x49436d=>{var _0x3f87e6=_0x4dd83a;this[_0x3f87e6(0x9a)](this[_0x3f87e6(0x78)][_0x3f87e6(0xd7)](_0x49436d));});}[_0x59c684(0x87)](){var _0x705893=_0x59c684;this[_0x705893(0xbc)]['mergeMenu'](menuSchema);}[_0x59c684(0x109)](){[ZenEditorConfirmShortcut,ZenEditorCancelShortcut]['forEach'](_0x366a9d=>{var _0x1720d5=_0x3362;this[_0x1720d5(0x9a)](this[_0x1720d5(0x91)][_0x1720d5(0x124)](_0x366a9d));});}},__name(_a2,_0x59c684(0x123)),_a2);ZenEditorUIController=__decorateClass$1([__decorateParam$1(0x0,IZenZoneService),__decorateParam$1(0x1,ICommandService),__decorateParam$1(0x2,IMenuManagerService),__decorateParam$1(0x3,IShortcutService)],ZenEditorUIController);function _0x1288(){var _0x5de986=['executeCommand','jsx','_initCommands','observe','substring','forEach','current','UniverSheetsZenEditorPlugin','_initializeDependencies','div','clearUndoRedoHistory','M3.71274\x202.86421C3.47843\x202.6299\x203.09853\x202.6299\x202.86421\x202.86421C2.6299\x203.09853\x202.6299\x203.47843\x202.86421\x203.71274L7.15154\x208.00007L2.86421\x2012.2874C2.6299\x2012.5217\x202.6299\x2012.9016\x202.86421\x2013.1359C3.09853\x2013.3702\x203.47843\x2013.3702\x203.71274\x2013.1359L8.00007\x208.84859L12.2874\x2013.1359C12.5217\x2013.3702\x2012.9016\x2013.3702\x2013.1359\x2013.1359C13.3702\x2012.9016\x2013.3702\x2012.5217\x2013.1359\x2012.2874L8.84859\x208.00007L13.1359\x203.71274C13.3702\x203.47843\x2013.3702\x203.09853\x2013.1359\x202.86421C12.9016\x202.6299\x2012.5217\x202.6299\x2012.2874\x202.86421L8.00007\x207.15154L3.71274\x202.86421Z','register','defaultProps','handleConfirmBtnClick','zenEditorIconError','getCurrentUnitForType','key','getOwnPropertyDescriptor','_calculatePagePosition','getRenderById','_scrollToTop','ZenEditor','pluginName','use','6cfPtaR','colorChannel1','BUTTON','evenodd','OTHERS','string','zenEditorCanvasContainer','UniverIcon','resize','_initShortcuts','complete','_zenZoneService','POSITIVE_INFINITY','_initialize','_syncZenEditorSize','submitCellData','160550QUHFun','zen-editor.command.open-zen-editor','1046232cILdua','assign','1em','_renderManagerService','handler','getOwnPropertySymbols','univer-zen-editor-icon-success','0\x200\x2016\x2016','transScroll2ViewportScrollValue','propertyIsEnumerable','whenZenEditorActivated','exports','resizeBySize','attrs','ZEN_EDITOR_PLUGIN_','position$','zen-editor.command.cancel-zen-edit','ZenEditorUIController','registerShortcut','ReactCurrentOwner','getBoundingClientRect','MAIN_AREA','zen-editor.command.confirm-zen-edit','map','ref','_zenEditorManagerService','hasOwnProperty','_initCustomComponents','close','length','span','getUnitId','getContextValue','univer.sheet-zen-editor-manager.service','render','svg','_commandService','add','Fragment','refreshEditCellState','replaceRuntimeIdsAndExtInAttrs','check-mark-single','className','2beXkUL','setPosition','getLatestEditCellState','subscribe','getAncestorScale','4_sheet-edit','ZEN_EDITOR_COMPONENT','displayName','_initMenus','for','menu','sheets-zen-editor.config','engine','zenEditorIconWrapper','documentModel','prototype','UNIVER_SHEET','getParent','_shortcutService','__decorateClass$1','trim','_configService','__decorateClass','with','getPosition','194119GPxsYH','entries','disposeWithMe','children','89040uhERdL','fill','indexOf','_position$','generateShortUuid','name','ESC','react.element','M14.1544\x203.75557C14.3887\x203.98988\x2014.3887\x204.36978\x2014.1544\x204.6041L6.51409\x2012.2444C6.40157\x2012.3569\x206.24896\x2012.4201\x206.08983\x2012.4201C5.9307\x2012.4201\x205.77808\x2012.3569\x205.66556\x2012.2444L1.84541\x208.42425C1.6111\x208.18993\x201.6111\x207.81003\x201.84541\x207.57572C2.07973\x207.34141\x202.45963\x207.34141\x202.69394\x207.57572L6.08983\x2010.9716L13.3059\x203.75557C13.5402\x203.52126\x2013.9201\x203.52126\x2014.1544\x203.75557Z','translate','univer-zen-editor-canvas-container','defIds','333093HxOsJs','toString','dispose','getEditor','getDocumentData','jsxs','dispose$','zenEditorIconSuccess','tag','none','currentColor','_injector','ALT','setConfig','idSuffix','xlink:href','replaceRuntimeIdsInDefs','scrollToRange','onReady','setDocumentData','_menuManagerService','COMMAND','_config','deepClone','set','replace','ZenEditorController','__decorateParam$1','defs','scrollToBarPos','react.fragment','get','univerjs-icon\x20univerjs-icon-','focusUnit','concat','shortcut.sheet.zen-edit-cancel','ZenEditorMenuItemFactory','_refresh','asObservable','extend','close-single','icon','_position','univer-zen-editor-icon-wrapper','pipe','rightClick.zenEditor','172613dUynTQ','registerCommand','22px','path','call','defineProperty','univer-zen-editor-icon-error','ENTER','VIEW_MAIN','handleCloseBtnClick','zenEditorIconContainer','124264tsYigU','open','preconditions','zenEditor','getViewport','documentLayoutObject'];_0x1288=function(){return _0x5de986;};return _0x1288();}var __defProp2=Object[_0x59c684(0xdb)],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__decorateClass=__name((_0x256ef3,_0x264eb9,_0x50dff0,_0x398ac4)=>{var _0x376bb2=_0x59c684;for(var _0x2318fe=_0x398ac4>0x1?void 0x0:_0x398ac4?__getOwnPropDesc(_0x264eb9,_0x50dff0):_0x264eb9,_0xbe8b6d=_0x256ef3[_0x376bb2(0x71)]-0x1,_0x5a9198;_0xbe8b6d>=0x0;_0xbe8b6d--)(_0x5a9198=_0x256ef3[_0xbe8b6d])&&(_0x2318fe=(_0x398ac4?_0x5a9198(_0x264eb9,_0x50dff0,_0x2318fe):_0x5a9198(_0x2318fe))||_0x2318fe);return _0x398ac4&&_0x2318fe&&__defProp2(_0x264eb9,_0x50dff0,_0x2318fe),_0x2318fe;},_0x59c684(0x95)),__decorateParam=__name((_0x4343a4,_0x5e9ddf)=>(_0x2fe9ec,_0x4481aa)=>_0x5e9ddf(_0x2fe9ec,_0x4481aa,_0x4343a4),'__decorateParam'),_a3;let UniverSheetsZenEditorPlugin=(_a3=class extends Plugin{constructor(_0x4eb00e=defaultPluginConfig,_0x25ae93,_0x5d86a0){var _0x2ac8ce=_0x59c684;super(),this[_0x2ac8ce(0xbe)]=_0x4eb00e,this[_0x2ac8ce(0xb3)]=_0x25ae93,this['_configService']=_0x5d86a0;const {menu:_0x350db2,..._0x400915}=this[_0x2ac8ce(0xbe)];_0x350db2&&this[_0x2ac8ce(0x94)]['setConfig'](_0x2ac8ce(0x89),_0x350db2,{'merge':!0x0}),this['_configService'][_0x2ac8ce(0xb5)](PLUGIN_CONFIG_KEY,_0x400915),this[_0x2ac8ce(0xef)](this[_0x2ac8ce(0xb3)]);}[_0x59c684(0xef)](_0x1f4e04){var _0x299694=_0x59c684;[[ZenEditorUIController],[ZenEditorController],[IZenEditorManagerService,{'useClass':ZenEditorManagerService}]][_0x299694(0xec)](_0x2e36cf=>_0x1f4e04[_0x299694(0x79)](_0x2e36cf));}[_0x59c684(0xba)](){var _0x24a69f=_0x59c684;this[_0x24a69f(0xb3)][_0x24a69f(0xc7)](ZenEditorUIController);}['onSteady'](){var _0x4ede1a=_0x59c684;this[_0x4ede1a(0xb3)][_0x4ede1a(0xc7)](ZenEditorController);}},__name(_a3,_0x59c684(0xee)),__publicField(_a3,_0x59c684(0xfe),'SHEET_ZEN_EDITOR_PLUGIN'),__publicField(_a3,'type',UniverInstanceType[_0x59c684(0x8f)]),_a3);UniverSheetsZenEditorPlugin=__decorateClass([__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,IConfigService)],UniverSheetsZenEditorPlugin);export{CancelZenEditCommand,ConfirmZenEditCommand,OpenZenEditorCommand,UniverSheetsZenEditorPlugin};
@@ -1,3 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
+ export declare const OpenZenEditorCommand: ICommand;
2
3
  export declare const CancelZenEditCommand: ICommand;
3
4
  export declare const ConfirmZenEditCommand: ICommand;
@@ -1,12 +1,11 @@
1
- import { Disposable, ICommandService, Injector } from '@univerjs/core';
1
+ import { Disposable, ICommandService } from '@univerjs/core';
2
2
  import { IMenuManagerService, IShortcutService, IZenZoneService } from '@univerjs/ui';
3
3
  export declare class ZenEditorUIController extends Disposable {
4
- private readonly _injector;
5
4
  private readonly _zenZoneService;
6
5
  private readonly _commandService;
7
6
  private readonly _menuManagerService;
8
7
  private readonly _shortcutService;
9
- constructor(_injector: Injector, _zenZoneService: IZenZoneService, _commandService: ICommandService, _menuManagerService: IMenuManagerService, _shortcutService: IShortcutService);
8
+ constructor(_zenZoneService: IZenZoneService, _commandService: ICommandService, _menuManagerService: IMenuManagerService, _shortcutService: IShortcutService);
10
9
  private _initialize;
11
10
  private _initCustomComponents;
12
11
  private _initCommands;
@@ -1,27 +1,12 @@
1
- import { ICommandService, IUndoRedoService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
2
- import { DocSelectionManagerService } from '@univerjs/docs';
1
+ import { RxDisposable } from '@univerjs/core';
3
2
  import { IRenderManagerService } from '@univerjs/engine-render';
4
- import { IEditorBridgeService } from '@univerjs/sheets-ui';
5
- import { IZenZoneService } from '@univerjs/ui';
6
3
  import { IZenEditorManagerService } from '../services/zen-editor.service';
7
4
  export declare class ZenEditorController extends RxDisposable {
8
- private readonly _univerInstanceService;
9
5
  private readonly _zenEditorManagerService;
10
6
  private readonly _renderManagerService;
11
- private readonly _commandService;
12
- private readonly _zenZoneService;
13
- private readonly _editorBridgeService;
14
- private readonly _undoRedoService;
15
- private readonly _textSelectionManagerService;
16
- constructor(_univerInstanceService: IUniverInstanceService, _zenEditorManagerService: IZenEditorManagerService, _renderManagerService: IRenderManagerService, _commandService: ICommandService, _zenZoneService: IZenZoneService, _editorBridgeService: IEditorBridgeService, _undoRedoService: IUndoRedoService, _textSelectionManagerService: DocSelectionManagerService);
7
+ constructor(_zenEditorManagerService: IZenEditorManagerService, _renderManagerService: IRenderManagerService);
17
8
  private _initialize;
18
- private _createZenEditorInstance;
19
9
  private _syncZenEditorSize;
20
- private _zenEditorInitialState;
21
- private _handleOpenZenEditor;
22
- private _editorSyncHandler;
23
- private _syncContentAndRender;
24
10
  private _calculatePagePosition;
25
- private _commandExecutedListener;
26
- private _getDocObject;
11
+ private _scrollToTop;
27
12
  }
@@ -13,6 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export { CancelZenEditCommand, ConfirmZenEditCommand, OpenZenEditorCommand } from './commands/commands/zen-editor.command';
16
17
  export { UniverSheetsZenEditorPlugin } from './plugin';
17
- export { OpenZenEditorOperation } from './commands/operations/zen-editor.operation';
18
- export { CancelZenEditCommand, ConfirmZenEditCommand } from './commands/commands/zen-editor.command';
@@ -1,5 +1,5 @@
1
- import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
1
  import { IUniverSheetsZenEditorConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
3
  export declare class UniverSheetsZenEditorPlugin extends Plugin {
4
4
  private readonly _config;
5
5
  readonly _injector: Injector;
@@ -8,4 +8,6 @@ export declare class UniverSheetsZenEditorPlugin extends Plugin {
8
8
  static type: UniverInstanceType;
9
9
  constructor(_config: Partial<IUniverSheetsZenEditorConfig> | undefined, _injector: Injector, _configService: IConfigService);
10
10
  private _initializeDependencies;
11
+ onReady(): void;
12
+ onSteady(): void;
11
13
  }
@@ -1,3 +1,3 @@
1
- import { IMenuButtonItem } from '@univerjs/ui';
2
1
  import { IAccessor } from '@univerjs/core';
2
+ import { IMenuButtonItem } from '@univerjs/ui';
3
3
  export declare function ZenEditorMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
package/lib/umd/index.js CHANGED
@@ -1,9 +1 @@
1
- (function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("react"),require("clsx"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render","@univerjs/sheets-ui","@univerjs/ui","rxjs","react","clsx","@univerjs/sheets"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverSheetsZenEditor={},global.UniverCore,global.UniverDocs,global.UniverDocsUi,global.UniverEngineRender,global.UniverSheetsUi,global.UniverUi,global.rxjs,global.React,global.clsx,global.UniverSheets))})(this,function(exports2,core,docs,docsUi,engineRender,sheetsUi,ui,rxjs,require$$0,clsx,sheets){"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;const OpenZenEditorOperation={id:"zen-editor.operation.open-zen-editor",type:core.CommandType.OPERATION,handler:__name(accessor=>!0,"handler")},_ZenEditorManagerService=class _ZenEditorManagerService{constructor(){__publicField(this,"_position",null);__publicField(this,"_position$",new rxjs.BehaviorSubject(null));__publicField(this,"position$",this._position$.asObservable())}dispose(){this._position$.complete(),this._position=null}setPosition(param){this._position=param,this._refresh(param)}getPosition(){return this._position}_refresh(param){this._position$.next(param)}};__name(_ZenEditorManagerService,"ZenEditorManagerService");let ZenEditorManagerService=_ZenEditorManagerService;const IZenEditorManagerService=core.createIdentifier("univer.sheet-zen-editor-manager.service");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 ZenEditorController=(_a=class extends core.RxDisposable{constructor(_univerInstanceService,_zenEditorManagerService,_renderManagerService,_commandService,_zenZoneService,_editorBridgeService,_undoRedoService,_textSelectionManagerService){super();__publicField(this,"_zenEditorInitialState",!1);this._univerInstanceService=_univerInstanceService,this._zenEditorManagerService=_zenEditorManagerService,this._renderManagerService=_renderManagerService,this._commandService=_commandService,this._zenZoneService=_zenZoneService,this._editorBridgeService=_editorBridgeService,this._undoRedoService=_undoRedoService,this._textSelectionManagerService=_textSelectionManagerService,this._initialize()}_initialize(){this._syncZenEditorSize(),this._commandExecutedListener()}_createZenEditorInstance(){const INITIAL_SNAPSHOT={id:core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,body:{dataStream:`${core.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],tables:[],customBlocks:[],paragraphs:[{startIndex:0}],sectionBreaks:[{startIndex:1}]},tableSource:{},documentStyle:{pageSize:{width:595,height:842},documentFlavor:core.DocumentFlavor.MODERN,marginTop:50,marginBottom:50,marginRight:40,marginLeft:40,renderConfig:{vertexAngle:0,centerAngle:0}},drawings:{},drawingsOrder:[]};return this._univerInstanceService.createUnit(core.UniverInstanceType.UNIVER_DOC,INITIAL_SNAPSHOT)}_syncZenEditorSize(){this._zenEditorManagerService.position$.pipe(rxjs.takeUntil(this.dispose$)).subscribe(position=>{var _a2;if(position==null)return;const editorObject=sheetsUi.getEditorObject(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,this._renderManagerService),zenEditorDataModel=this._univerInstanceService.getUniverDocInstance(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(editorObject==null||zenEditorDataModel==null)return;const{width,height}=position,{engine}=editorObject,skeleton=(_a2=this._renderManagerService.getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a2.with(docs.DocSkeletonManagerService).getSkeleton();requestIdleCallback(()=>{engine.resizeBySize(width,height),this._calculatePagePosition(editorObject),skeleton&&this._textSelectionManagerService.refreshSelection()})})}_handleOpenZenEditor(){var _a2,_b2;this._zenEditorInitialState||(this._createZenEditorInstance(),this._zenEditorInitialState=!0),this._zenZoneService.open();const currentSheet=this._univerInstanceService.getCurrentUnitForType(core.UniverInstanceType.UNIVER_SHEET);this._undoRedoService.clearUndoRedo(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY),this._univerInstanceService.focusUnit(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY),this._univerInstanceService.setCurrentUnitForType(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY);const docSelectionRenderService=(_a2=this._renderManagerService.getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a2.with(docsUi.DocSelectionRenderService);docSelectionRenderService&&docSelectionRenderService.focus(),this._editorBridgeService.isVisible().visible===!1&&this._editorBridgeService.changeVisible({visible:!0,eventType:engineRender.DeviceInputEventType.PointerDown,unitId:(_b2=currentSheet==null?void 0:currentSheet.getUnitId())!=null?_b2:""});const editCellState=this._editorBridgeService.getLatestEditCellState();if(editCellState==null)return;this._editorSyncHandler(editCellState);const textRanges=[{startOffset:0,endOffset:0}];this._textSelectionManagerService.replaceTextRanges(textRanges,!1)}_editorSyncHandler(param){var _a2,_b2,_c2,_d;const body=(_a2=param.documentLayoutObject.documentModel)==null?void 0:_a2.getBody(),dataStream=body==null?void 0:body.dataStream,paragraphs=body==null?void 0:body.paragraphs,customBlocks=body==null?void 0:body.customBlocks,drawings=(_b2=param.documentLayoutObject.documentModel)==null?void 0:_b2.getDrawings(),drawingsOrder=(_c2=param.documentLayoutObject.documentModel)==null?void 0:_c2.getDrawingsOrder(),customRanges=body==null?void 0:body.customRanges;let textRuns=[];dataStream==null||!paragraphs&&!customRanges||((_d=body==null?void 0:body.textRuns)!=null&&_d.length&&(textRuns=body==null?void 0:body.textRuns),this._syncContentAndRender(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,dataStream,paragraphs!=null?paragraphs:[],textRuns,customBlocks,drawings,drawingsOrder,customRanges))}_syncContentAndRender(unitId,dataStream,paragraphs,textRuns=[],customBlocks=[],drawings={},drawingsOrder=[],customRanges=[]){var _a2;const INCLUDE_LIST=[core.DOCS_ZEN_EDITOR_UNIT_ID_KEY,core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY],docSkeletonManagerService=(_a2=this._renderManagerService.getRenderById(unitId))==null?void 0:_a2.with(docs.DocSkeletonManagerService),skeleton=docSkeletonManagerService==null?void 0:docSkeletonManagerService.getSkeleton(),docDataModel=this._univerInstanceService.getUniverDocInstance(unitId),docViewModel=docSkeletonManagerService==null?void 0:docSkeletonManagerService.getViewModel();if(docDataModel==null||docViewModel==null||skeleton==null)return;const docBody=docDataModel.getBody(),snapshot=docDataModel.getSnapshot();docBody.dataStream=dataStream,docBody.paragraphs=paragraphs,docBody.customBlocks=customBlocks,docBody.customRanges=customRanges,snapshot.drawings=drawings,snapshot.drawingsOrder=drawingsOrder,docBody.textRuns=textRuns,unitId===core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY&&(docBody.textRuns=[]),docViewModel.reset(docDataModel);const currentRender=this._getDocObject();currentRender!=null&&(skeleton.calculate(),INCLUDE_LIST.includes(unitId)&&currentRender.document.makeDirty())}_calculatePagePosition(currentRender){const{document:docsComponent,scene,docBackground}=currentRender,parent=scene==null?void 0:scene.getParent(),{width:docsWidth,height:docsHeight,pageMarginLeft,pageMarginTop}=docsComponent;if(parent==null||docsWidth===Number.POSITIVE_INFINITY||docsHeight===Number.POSITIVE_INFINITY)return;const{width:engineWidth,height:engineHeight}=parent;let docsLeft=0,docsTop=0,sceneWidth=0,sceneHeight=0,scrollToX=Number.POSITIVE_INFINITY;const{scaleX,scaleY}=scene.getAncestorScale();engineWidth>(docsWidth+pageMarginLeft*2)*scaleX?(docsLeft=engineWidth/2-docsWidth*scaleX/2,docsLeft/=scaleX,sceneWidth=(engineWidth-pageMarginLeft*2)/scaleX,scrollToX=0):(docsLeft=pageMarginLeft,sceneWidth=docsWidth+pageMarginLeft*2,scrollToX=(sceneWidth-engineWidth/scaleX)/2),engineHeight>docsHeight?(docsTop=engineHeight/2-docsHeight/2,sceneHeight=(engineHeight-pageMarginTop*2)/scaleY):(docsTop=pageMarginTop,sceneHeight=docsHeight+pageMarginTop*2),scene.resize(sceneWidth,sceneHeight+200),docsComponent.translate(docsLeft,docsTop),docBackground.translate(docsLeft,docsTop);const viewport=scene.getViewport(docsUi.VIEWPORT_KEY.VIEW_MAIN);if(scrollToX!==Number.POSITIVE_INFINITY&&viewport!=null){const actualX=viewport.transScroll2ViewportScrollValue(scrollToX,0).x;viewport.scrollToBarPos({x:actualX})}return this}_commandExecutedListener(){const updateCommandList=[OpenZenEditorOperation.id];this.disposeWithMe(this._commandService.onCommandExecuted(command=>{updateCommandList.includes(command.id)&&this._handleOpenZenEditor()}));const editCommandList=[docs.RichTextEditingMutation.id];this.disposeWithMe(this._commandService.onCommandExecuted(command=>{if(editCommandList.includes(command.id)){const params=command.params,{unitId}=params;if(unitId===core.DOCS_ZEN_EDITOR_UNIT_ID_KEY){const editorDocDataModel=this._univerInstanceService.getUniverDocInstance(unitId),docBody=editorDocDataModel==null?void 0:editorDocDataModel.getBody(),dataStream=docBody==null?void 0:docBody.dataStream,paragraphs=docBody==null?void 0:docBody.paragraphs,textRuns=docBody==null?void 0:docBody.textRuns,customBlocks=docBody==null?void 0:docBody.customBlocks,drawings=editorDocDataModel==null?void 0:editorDocDataModel.getDrawings(),drawingsOrder=editorDocDataModel==null?void 0:editorDocDataModel.getDrawingsOrder(),customRanges=editorDocDataModel==null?void 0:editorDocDataModel.getCustomRanges();if(this._editorBridgeService.changeEditorDirty(!0),dataStream==null||paragraphs==null)return;this._syncContentAndRender(core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,dataStream,paragraphs,textRuns,customBlocks,drawings,drawingsOrder,customRanges)}}}))}_getDocObject(){return docsUi.getDocObject(this._univerInstanceService,this._renderManagerService)}},__name(_a,"ZenEditorController"),_a);ZenEditorController=__decorateClass$2([core.OnLifecycle(core.LifecycleStages.Steady,ZenEditorController),__decorateParam$2(0,core.IUniverInstanceService),__decorateParam$2(1,IZenEditorManagerService),__decorateParam$2(2,engineRender.IRenderManagerService),__decorateParam$2(3,core.ICommandService),__decorateParam$2(4,ui.IZenZoneService),__decorateParam$2(5,sheetsUi.IEditorBridgeService),__decorateParam$2(6,core.IUndoRedoService),__decorateParam$2(7,core.Inject(docs.DocSelectionManagerService))],ZenEditorController);function scrollToTop(accessor){var _a2;const backScrollController=(_a2=accessor.get(engineRender.IRenderManagerService).getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a2.with(docsUi.DocBackScrollRenderController),textRange={startOffset:0,endOffset:0};backScrollController&&backScrollController.scrollToRange(textRange)}__name(scrollToTop,"scrollToTop");const CancelZenEditCommand={id:"zen-editor.command.cancel-zen-edit",type:core.CommandType.COMMAND,handler:__name(async accessor=>{const zenZoneEditorService=accessor.get(ui.IZenZoneService),editorBridgeService=accessor.get(sheetsUi.IEditorBridgeService),univerInstanceManager=accessor.get(core.IUniverInstanceService);editorBridgeService.isVisible().visible&&editorBridgeService.changeVisible({visible:!1,eventType:engineRender.DeviceInputEventType.Keyboard,keycode:ui.KeyCode.ESC,unitId:""}),zenZoneEditorService.close(),scrollToTop(accessor);const currentSheetInstance=univerInstanceManager.getCurrentUnitForType(core.UniverInstanceType.UNIVER_SHEET);return currentSheetInstance?(univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()),editorBridgeService.refreshEditCellState(),!0):!1},"handler")},ConfirmZenEditCommand={id:"zen-editor.command.confirm-zen-edit",type:core.CommandType.COMMAND,handler:__name(async accessor=>{const zenZoneEditorService=accessor.get(ui.IZenZoneService),editorBridgeService=accessor.get(sheetsUi.IEditorBridgeService),univerInstanceManager=accessor.get(core.IUniverInstanceService);editorBridgeService.isVisible().visible&&editorBridgeService.changeVisible({visible:!1,eventType:engineRender.DeviceInputEventType.PointerDown,unitId:""}),zenZoneEditorService.close(),scrollToTop(accessor);const currentSheetInstance=univerInstanceManager.getCurrentUnitForType(core.UniverInstanceType.UNIVER_SHEET);return currentSheetInstance?(univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()),editorBridgeService.refreshEditCellState(),!0):!1},"handler")};var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;g!==void 0&&(e=""+g),a.key!==void 0&&(e=""+a.key),a.ref!==void 0&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)d[b]===void 0&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}__name(q,"q"),reactJsxRuntime_production_min.Fragment=l,reactJsxRuntime_production_min.jsx=q,reactJsxRuntime_production_min.jsxs=q,jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,__assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n2=arguments.length;i<n2;i++){s=arguments[i];for(var p2 in s)Object.prototype.hasOwnProperty.call(s,p2)&&(t[p2]=s[p2])}return t},__assign.apply(this,arguments)},__rest=function(s,e){var t={};for(var p2 in s)Object.prototype.hasOwnProperty.call(s,p2)&&e.indexOf(p2)<0&&(t[p2]=s[p2]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p2=Object.getOwnPropertySymbols(s);i<p2.length;i++)e.indexOf(p2[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p2[i])&&(t[p2[i]]=s[p2[i]]);return t},IconBase=require$$0.forwardRef(function(props,ref){var icon=props.icon,id=props.id,className=props.className,extend=props.extend,restProps=__rest(props,["icon","id","className","extend"]),cls="univerjs-icon univerjs-icon-".concat(id," ").concat(className||"").trim(),idSuffix=require$$0.useRef("_".concat(generateShortUuid()));return render(icon,"".concat(id),{defIds:icon.defIds,idSuffix:idSuffix.current},__assign({ref,className:cls},restProps),extend)});function render(node,id,runtimeProps,rootProps,extend){return require$$0.createElement(node.tag,__assign(__assign({key:id},replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend)),rootProps),(replaceRuntimeIdsInDefs(node,runtimeProps).children||[]).map(function(child,index){return render(child,"".concat(id,"-").concat(node.tag,"-").concat(index),runtimeProps,void 0,extend)}))}__name(render,"render");function replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend){var attrs=__assign({},node.attrs);extend!=null&&extend.colorChannel1&&attrs.fill==="colorChannel1"&&(attrs.fill=extend.colorChannel1);var defIds=runtimeProps.defIds;return!defIds||defIds.length===0||(node.tag==="use"&&attrs["xlink:href"]&&(attrs["xlink:href"]=attrs["xlink:href"]+runtimeProps.idSuffix),Object.entries(attrs).forEach(function(_a2){var key=_a2[0],value=_a2[1];typeof value=="string"&&(attrs[key]=value.replace(/url\(#(.*)\)/,"url(#$1".concat(runtimeProps.idSuffix,")")))})),attrs}__name(replaceRuntimeIdsAndExtInAttrs,"replaceRuntimeIdsAndExtInAttrs");function replaceRuntimeIdsInDefs(node,runtimeProps){var _a2,defIds=runtimeProps.defIds;return!defIds||defIds.length===0?node:node.tag==="defs"&&(!((_a2=node.children)===null||_a2===void 0)&&_a2.length)?__assign(__assign({},node),{children:node.children.map(function(child){return typeof child.attrs.id=="string"&&defIds&&defIds.indexOf(child.attrs.id)>-1?__assign(__assign({},child),{attrs:__assign(__assign({},child.attrs),{id:child.attrs.id+runtimeProps.idSuffix})}):child})}):node}__name(replaceRuntimeIdsInDefs,"replaceRuntimeIdsInDefs");function generateShortUuid(){return Math.random().toString(36).substring(2,8)}__name(generateShortUuid,"generateShortUuid"),IconBase.displayName="UniverIcon";var element$1={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},CheckMarkSingle=require$$0.forwardRef(function(props,ref){return require$$0.createElement(IconBase,Object.assign({},props,{id:"check-mark-single",ref,icon:element$1}))});CheckMarkSingle.displayName="CheckMarkSingle";var element={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z"}}]},CloseSingle=require$$0.forwardRef(function(props,ref){return require$$0.createElement(IconBase,Object.assign({},props,{id:"close-single",ref,icon:element}))});CloseSingle.displayName="CloseSingle";const styles={zenEditor:"univer-zen-editor",zenEditorIconWrapper:"univer-zen-editor-icon-wrapper",zenEditorIconContainer:"univer-zen-editor-icon-container",zenEditorIconSuccess:"univer-zen-editor-icon-success",zenEditorIconError:"univer-zen-editor-icon-error",zenEditorCanvasContainer:"univer-zen-editor-canvas-container"},ZEN_EDITOR_COMPONENT="ZEN_EDITOR_PLUGIN_ZEN_EDITOR_COMPONENT";function ZenEditor(){const editorRef=require$$0.useRef(null),renderManagerService=core.useDependency(engineRender.IRenderManagerService),zenEditorManagerService=core.useDependency(IZenEditorManagerService),commandService=core.useDependency(core.ICommandService);require$$0.useEffect(()=>{const editor=editorRef.current;if(!editor)return;const renderSubscription=renderManagerService.currentRender$.subscribe(param=>{var _a2;if(param!==core.DOCS_ZEN_EDITOR_UNIT_ID_KEY)return;const engine=(_a2=renderManagerService.getRenderById(core.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:_a2.engine;engine==null||engine.setContainer(editor)}),resizeObserver=new ResizeObserver(()=>{const editorRect=editor.getBoundingClientRect();zenEditorManagerService.setPosition(editorRect)});return resizeObserver.observe(editor),()=>{resizeObserver.unobserve(editor),renderSubscription.unsubscribe()}},[]);function handleCloseBtnClick(){commandService.executeCommand(CancelZenEditCommand.id)}__name(handleCloseBtnClick,"handleCloseBtnClick");function handleConfirmBtnClick(){commandService.executeCommand(ConfirmZenEditCommand.id)}return __name(handleConfirmBtnClick,"handleConfirmBtnClick"),jsxRuntimeExports.jsxs("div",{className:styles.zenEditor,children:[jsxRuntimeExports.jsxs("div",{className:styles.zenEditorIconWrapper,children:[jsxRuntimeExports.jsx("span",{className:clsx(styles.zenEditorIconContainer,styles.zenEditorIconError),onClick:handleCloseBtnClick,children:jsxRuntimeExports.jsx(CloseSingle,{style:{fontSize:"22px"}})}),jsxRuntimeExports.jsx("span",{className:clsx(styles.zenEditorIconContainer,styles.zenEditorIconSuccess),onClick:handleConfirmBtnClick,children:jsxRuntimeExports.jsx(CheckMarkSingle,{style:{fontSize:"22px"}})})]}),jsxRuntimeExports.jsx("div",{className:styles.zenEditorCanvasContainer,ref:editorRef})]})}__name(ZenEditor,"ZenEditor");const ZenEditorConfirmShortcut={id:ConfirmZenEditCommand.id,description:"shortcut.sheet.zen-edit-confirm",group:"4_sheet-edit",preconditions:__name(contextService=>whenZenEditorActivated(contextService),"preconditions"),binding:ui.KeyCode.ENTER|ui.MetaKeys.ALT},ZenEditorCancelShortcut={id:CancelZenEditCommand.id,description:"shortcut.sheet.zen-edit-cancel",group:"4_sheet-edit",preconditions:__name(contextService=>whenZenEditorActivated(contextService),"preconditions"),binding:ui.KeyCode.ESC};function whenZenEditorActivated(contextService){return contextService.getContextValue(core.FOCUSING_DOC)&&contextService.getContextValue(core.FOCUSING_UNIVER_EDITOR)&&contextService.getContextValue(core.EDITOR_ACTIVATED)&&!contextService.getContextValue(core.FOCUSING_EDITOR_STANDALONE)}__name(whenZenEditorActivated,"whenZenEditorActivated");function ZenEditorMenuItemFactory(accessor){return{id:OpenZenEditorOperation.id,type:ui.MenuItemType.BUTTON,title:"rightClick.zenEditor",icon:"AmplifySingle",hidden$:sheetsUi.getCurrentExclusiveRangeInterest$(accessor),disabled$:sheetsUi.getCurrentRangeDisable$(accessor,{workbookTypes:[sheets.WorkbookEditablePermission],worksheetTypes:[sheets.WorksheetEditPermission,sheets.WorksheetSetCellValuePermission,sheets.WorksheetSetCellStylePermission],rangeTypes:[sheets.RangeProtectionPermissionEditPoint]})}}__name(ZenEditorMenuItemFactory,"ZenEditorMenuItemFactory");const menuSchema={[ui.ContextMenuPosition.MAIN_AREA]:{[ui.ContextMenuGroup.OTHERS]:{[OpenZenEditorOperation.id]:{order:2,menuItemFactory:ZenEditorMenuItemFactory}}}};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");let ZenEditorUIController=(_b=class extends core.Disposable{constructor(_injector,_zenZoneService,_commandService,_menuManagerService,_shortcutService){super(),this._injector=_injector,this._zenZoneService=_zenZoneService,this._commandService=_commandService,this._menuManagerService=_menuManagerService,this._shortcutService=_shortcutService,this._initialize()}_initialize(){this._initCustomComponents(),this._initCommands(),this._initMenus(),this._initShortcuts()}_initCustomComponents(){this.disposeWithMe(this._zenZoneService.set(ZEN_EDITOR_COMPONENT,ZenEditor))}_initCommands(){[OpenZenEditorOperation,CancelZenEditCommand,ConfirmZenEditCommand].forEach(c=>{this.disposeWithMe(this._commandService.registerCommand(c))})}_initMenus(){this._menuManagerService.mergeMenu(menuSchema)}_initShortcuts(){[ZenEditorConfirmShortcut,ZenEditorCancelShortcut].forEach(item=>{this.disposeWithMe(this._shortcutService.registerShortcut(item))})}},__name(_b,"ZenEditorUIController"),_b);ZenEditorUIController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Rendered,ZenEditorUIController),__decorateParam$1(0,core.Inject(core.Injector)),__decorateParam$1(1,ui.IZenZoneService),__decorateParam$1(2,core.ICommandService),__decorateParam$1(3,ui.IMenuManagerService),__decorateParam$1(4,ui.IShortcutService)],ZenEditorUIController);const PLUGIN_CONFIG_KEY="sheets-zen-editor.config",defaultPluginConfig={};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.UniverSheetsZenEditorPlugin=(_c=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{menu,...rest}=this._config;menu&&this._configService.setConfig("menu",menu,{merge:!0}),this._configService.setConfig(PLUGIN_CONFIG_KEY,rest),this._initializeDependencies(this._injector)}_initializeDependencies(injector){[[ZenEditorUIController],[ZenEditorController],[IZenEditorManagerService,{useClass:ZenEditorManagerService}]].forEach(dependency=>injector.add(dependency))}},__name(_c,"UniverSheetsZenEditorPlugin"),__publicField(_c,"pluginName","SHEET_ZEN_EDITOR_PLUGIN"),__publicField(_c,"type",core.UniverInstanceType.UNIVER_SHEET),_c),exports2.UniverSheetsZenEditorPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IConfigService)],exports2.UniverSheetsZenEditorPlugin),exports2.CancelZenEditCommand=CancelZenEditCommand,exports2.ConfirmZenEditCommand=ConfirmZenEditCommand,exports2.OpenZenEditorOperation=OpenZenEditorOperation,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
1
+ function _0x4c1e(_0x4ef1de,_0x122489){var _0x53f217=_0x53f2();return _0x4c1e=function(_0x4c1e3b,_0x4670c9){_0x4c1e3b=_0x4c1e3b-0x18d;var _0x28f21f=_0x53f217[_0x4c1e3b];return _0x28f21f;},_0x4c1e(_0x4ef1de,_0x122489);}function _0x53f2(){var _0x4568de=['useRef','focus','forwardRef','React','SHEET_ZEN_EDITOR_PLUGIN','executeCommand','_initCommands','_shortcutService','__decorateParam$2','assign','_zenZoneService','IEditorBridgeService','ENTER','getLatestEditCellState','UniverSheetsUi','ZEN_EDITOR_PLUGIN_ZEN_EDITOR_COMPONENT','FOCUSING_DOC','indexOf','add','preconditions','_initialize','6208040BlpWoQ','_refresh','ICommandService','3609270oASpSH','whenZenEditorActivated','UniverUi','react','submitCellData','length','1295197vLAGKe','engine','UniverInstanceType','EditingRenderController','close','@univerjs/sheets-ui','__decorateClass$1','2358188BTXbZx','univerjs-icon\x20univerjs-icon-','jsxs','handler','focusUnit','getEditor','DocumentFlavor','resizeBySize','BUTTON','__decorateClass$2','rightClick.zenEditor','defineProperty','handleCloseBtnClick','tag','zenEditorIconSuccess','attrs','setPosition','1em','getContextValue','getCurrentExclusiveRangeInterest$','zen-editor.command.open-zen-editor','idSuffix','ZenEditorController','_commandService','_initShortcuts','RangeProtectionPermissionEditPoint','menu','with','WorkbookEditablePermission','defaultProps','span','defs','COMMAND','_menuManagerService','_syncZenEditorSize','registerCommand','@univerjs/ui','UniverIcon','_scrollToTop','_position$','ALT','Tools','disposeWithMe','prototype','defIds','UniverSheetsZenEditorPlugin','setConfig','key','MetaKeys','0\x200\x2016\x2016','IShortcutService','replaceRuntimeIdsAndExtInAttrs','WorksheetSetCellValuePermission','observe','className','complete','fill','BehaviorSubject','get','_initCustomComponents','IMenuManagerService','IRenderManagerService','IZenZoneService','POSITIVE_INFINITY','DocumentDataModel','none','2530386WnytsM','toString','propertyIsEnumerable','M14.1544\x203.75557C14.3887\x203.98988\x2014.3887\x204.36978\x2014.1544\x204.6041L6.51409\x2012.2444C6.40157\x2012.3569\x206.24896\x2012.4201\x206.08983\x2012.4201C5.9307\x2012.4201\x205.77808\x2012.3569\x205.66556\x2012.2444L1.84541\x208.42425C1.6111\x208.18993\x201.6111\x207.81003\x201.84541\x207.57572C2.07973\x207.34141\x202.45963\x207.34141\x202.69394\x207.57572L6.08983\x2010.9716L13.3059\x203.75557C13.5402\x203.52126\x2013.9201\x203.52126\x2014.1544\x203.75557Z','AmplifySingle','ZenEditor','M3.71274\x202.86421C3.47843\x202.6299\x203.09853\x202.6299\x202.86421\x202.86421C2.6299\x203.09853\x202.6299\x203.47843\x202.86421\x203.71274L7.15154\x208.00007L2.86421\x2012.2874C2.6299\x2012.5217\x202.6299\x2012.9016\x202.86421\x2013.1359C3.09853\x2013.3702\x203.47843\x2013.3702\x203.71274\x2013.1359L8.00007\x208.84859L12.2874\x2013.1359C12.5217\x2013.3702\x2012.9016\x2013.3702\x2013.1359\x2013.1359C13.3702\x2012.9016\x2013.3702\x2012.5217\x2013.1359\x2012.2874L8.84859\x208.00007L13.1359\x203.71274C13.3702\x203.47843\x2013.3702\x203.09853\x2013.1359\x202.86421C12.9016\x202.6299\x2012.5217\x202.6299\x2012.2874\x202.86421L8.00007\x207.15154L3.71274\x202.86421Z','position$','_initMenus','EDITOR_ACTIVATED','univer-zen-editor-icon-error','univer-zen-editor-icon-success','getSnapshot','scrollToBarPos','random','react.element','MenuItemType','displayName','takeUntil','_renderManagerService','_calculatePagePosition','jsx','pipe','WorksheetSetCellStylePermission','getOwnPropertyDescriptor','CloseSingle','KeyCode','xlink:href','@univerjs/engine-render','function','asObservable','current','MAIN_AREA','evenodd','_injector','render','map','type','UniverCore','getParent','onReady','UniverSheetsZenEditor','_position','6IzMABd','Fragment','2367ViOsac','string','zenEditorCanvasContainer','getUnitId','4_sheet-edit','path','DEFAULT_EMPTY_DOCUMENT_VALUE','object','set','div','shortcut.sheet.zen-edit-confirm','useDependency','CancelZenEditCommand','zen-editor.command.cancel-zen-edit','univer-zen-editor-icon-container','Module','__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED','rxjs','univer-zen-editor-canvas-container','mergeMenu','children','zenEditorIconError','IUniverInstanceService','next','deepClone','Disposable','refreshEditCellState','exports','clsx','ZenEditorMenuItemFactory','VIEW_MAIN','_initializeDependencies','univer-zen-editor-icon-wrapper','getBoundingClientRect','getAncestorScale','ref','getRenderById','CommandType','_config','setDocumentData','generateShortUuid','forEach','getCurrentRangeDisable$','22px','concat','currentColor','DocBackScrollRenderController','__decorateClass','entries','substring','createElement','UNIVER_SHEET','@univerjs/core','icon','extend','univer.sheet-zen-editor-manager.service','IConfigService','clearUndoRedoHistory','4958443UkToPV','_zenEditorManagerService','@univerjs/sheets','ContextMenuPosition','_configService','zenEditor','registerShortcut','shortcut.sheet.zen-edit-cancel','MODERN','amd','register','DOCS_ZEN_EDITOR_UNIT_ID_KEY','for','documentModel','OpenZenEditorCommand','ESC','@univerjs/docs-ui','hasOwnProperty','colorChannel1','close-single','zenEditorIconContainer','unobserve','UniverDocsUi','trim','getDocumentData','24584ggBmzq','getViewport','call','IEditorService','RxDisposable','Plugin','FOCUSING_UNIVER_EDITOR','zenEditorIconWrapper','name'];_0x53f2=function(){return _0x4568de;};return _0x53f2();}(function(_0x427781,_0x118bc8){var _0x124828=_0x4c1e,_0x49ea90=_0x427781();while(!![]){try{var _0x22921d=-parseInt(_0x124828(0x1bb))/0x1+-parseInt(_0x124828(0x204))/0x2+parseInt(_0x124828(0x1b5))/0x3+-parseInt(_0x124828(0x1c2))/0x4+parseInt(_0x124828(0x1b2))/0x5*(parseInt(_0x124828(0x22f))/0x6)+parseInt(_0x124828(0x26b))/0x7+-parseInt(_0x124828(0x194))/0x8*(-parseInt(_0x124828(0x231))/0x9);if(_0x22921d===_0x118bc8)break;else _0x49ea90['push'](_0x49ea90['shift']());}catch(_0x3e0b5e){_0x49ea90['push'](_0x49ea90['shift']());}}}(_0x53f2,0xc612d),function(_0x5c6581,_0x213c34){var _0x548550=_0x4c1e;typeof exports==_0x548550(0x238)&&typeof module<'u'?_0x213c34(exports,require(_0x548550(0x265)),require('@univerjs/docs-ui'),require(_0x548550(0x220)),require(_0x548550(0x1c0)),require(_0x548550(0x1e6)),require(_0x548550(0x242)),require(_0x548550(0x1b8)),require(_0x548550(0x24d)),require(_0x548550(0x26d))):typeof define==_0x548550(0x221)&&define[_0x548550(0x274)]?define([_0x548550(0x24c),'@univerjs/core',_0x548550(0x27b),'@univerjs/engine-render','@univerjs/sheets-ui','@univerjs/ui',_0x548550(0x242),'react',_0x548550(0x24d),_0x548550(0x26d)],_0x213c34):(_0x5c6581=typeof globalThis<'u'?globalThis:_0x5c6581||self,_0x213c34(_0x5c6581[_0x548550(0x22d)]={},_0x5c6581[_0x548550(0x22a)],_0x5c6581[_0x548550(0x191)],_0x5c6581['UniverEngineRender'],_0x5c6581[_0x548550(0x1ab)],_0x5c6581[_0x548550(0x1b7)],_0x5c6581[_0x548550(0x242)],_0x5c6581[_0x548550(0x1a0)],_0x5c6581['clsx'],_0x5c6581['UniverSheets']));}(this,function(_0x280494,_0xb395ea,_0x57a33a,_0x4ede2b,_0x149632,_0x6802a8,_0x28d825,_0x16cea7,_0x48006f,_0x30c8bd){'use strict';var _0x578b75=_0x4c1e;var _0x5178d2=Object[_0x578b75(0x1cd)],_0x100654=(_0x3cfe09,_0x213607,_0x451f8a)=>_0x213607 in _0x3cfe09?_0x5178d2(_0x3cfe09,_0x213607,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x451f8a}):_0x3cfe09[_0x213607]=_0x451f8a,_0x23ce67=(_0x4b6b99,_0x2c68a7)=>_0x5178d2(_0x4b6b99,_0x578b75(0x19c),{'value':_0x2c68a7,'configurable':!0x0}),_0x5cf51f=(_0x5db3e1,_0x559339,_0x3c1d00)=>_0x100654(_0x5db3e1,typeof _0x559339!='symbol'?_0x559339+'':_0x559339,_0x3c1d00),_0x7ffd4b,_0x13dab1,_0x3d4e0d;const _0x32ec28={'id':_0x578b75(0x1d6),'type':_0xb395ea[_0x578b75(0x256)]['COMMAND'],'handler':_0x23ce67(async _0x46bda2=>{var _0x4b83bc=_0x578b75,_0x12f386;const _0x89a05b=_0x46bda2[_0x4b83bc(0x1fc)](_0x6802a8[_0x4b83bc(0x200)]),_0x2c8e4a=_0x46bda2[_0x4b83bc(0x1fc)](_0x57a33a['IEditorService']),_0x5b67e3=_0x46bda2[_0x4b83bc(0x1fc)](_0x149632[_0x4b83bc(0x1a8)]),_0x143606=_0x46bda2[_0x4b83bc(0x1fc)](_0xb395ea['IUniverInstanceService']);_0x89a05b['open']();const _0x3dfe56=_0x2c8e4a['getEditor'](_0xb395ea[_0x4b83bc(0x276)]);if(_0x3dfe56==null)return!0x1;const _0x43ce37=_0x5b67e3[_0x4b83bc(0x1aa)]();if(_0x43ce37==null)return!0x1;const _0x5c4b9d=(_0x12f386=_0x43ce37['documentLayoutObject'][_0x4b83bc(0x278)])==null?void 0x0:_0x12f386[_0x4b83bc(0x210)]();if(_0x5c4b9d==null)return!0x1;_0x143606[_0x4b83bc(0x1c6)](_0xb395ea[_0x4b83bc(0x276)]);const {body:_0xc73bf,drawings:_0x1140ce,drawingsOrder:_0x3ad1ce,tableSource:_0x55c680,settings:_0x245eef}=_0xb395ea[_0x4b83bc(0x1eb)][_0x4b83bc(0x249)](_0x5c4b9d),_0x3bca4c={..._0x3dfe56[_0x4b83bc(0x193)](),'body':_0xc73bf,'drawings':_0x1140ce,'drawingsOrder':_0x3ad1ce,'tableSource':_0x55c680,'settings':_0x245eef},_0x19860a=[{'startOffset':0x0,'endOffset':0x0,'collapsed':!0x0}];return _0x3dfe56[_0x4b83bc(0x19e)](),_0x3dfe56[_0x4b83bc(0x258)](_0x3bca4c,_0x19860a),_0x3dfe56[_0x4b83bc(0x26a)](),!0x0;},'handler')},_0x2fd09d={'id':_0x578b75(0x23e),'type':_0xb395ea['CommandType']['COMMAND'],'handler':_0x23ce67(async _0x4d0768=>{var _0x587eae=_0x578b75;const _0x165cf6=_0x4d0768[_0x587eae(0x1fc)](_0x6802a8[_0x587eae(0x200)]),_0x35c867=_0x4d0768[_0x587eae(0x1fc)](_0x149632[_0x587eae(0x1a8)]),_0x22de15=_0x4d0768['get'](_0xb395ea['IUniverInstanceService']);_0x165cf6[_0x587eae(0x1bf)]();const _0x404305=_0x22de15['getCurrentUnitForType'](_0xb395ea[_0x587eae(0x1bd)][_0x587eae(0x264)]);return _0x404305?(_0x22de15[_0x587eae(0x1c6)](_0x404305[_0x587eae(0x234)]()),_0x35c867[_0x587eae(0x24b)](),!0x0):!0x1;},_0x578b75(0x1c5))},_0x309d24={'id':'zen-editor.command.confirm-zen-edit','type':_0xb395ea[_0x578b75(0x256)][_0x578b75(0x1e2)],'handler':_0x23ce67(async _0xb8e790=>{var _0x35445b=_0x578b75,_0x98e346;const _0x38d0b9=_0xb8e790[_0x35445b(0x1fc)](_0x6802a8[_0x35445b(0x200)]),_0x58a17d=_0xb8e790[_0x35445b(0x1fc)](_0x149632[_0x35445b(0x1a8)]),_0x5c6742=_0xb8e790[_0x35445b(0x1fc)](_0xb395ea[_0x35445b(0x247)]),_0x7a8a2f=_0xb8e790[_0x35445b(0x1fc)](_0x57a33a[_0x35445b(0x197)]);_0x38d0b9[_0x35445b(0x1bf)]();const _0x4ce2ff=_0x7a8a2f[_0x35445b(0x1c7)](_0xb395ea[_0x35445b(0x276)]);if(_0x4ce2ff==null)return!0x1;const _0x24d15d=_0xb8e790[_0x35445b(0x1fc)](_0x4ede2b[_0x35445b(0x1ff)]),_0x9c6d2a=_0x5c6742['getCurrentUnitForType'](_0xb395ea[_0x35445b(0x1bd)][_0x35445b(0x264)]);if(_0x9c6d2a){const _0xcba093=_0x9c6d2a[_0x35445b(0x234)](),_0x32fc1e=(_0x98e346=_0x24d15d[_0x35445b(0x255)](_0xcba093))==null?void 0x0:_0x98e346[_0x35445b(0x1dd)](_0x149632[_0x35445b(0x1be)]);if(_0x32fc1e){const _0x27ed37=_0xb395ea[_0x35445b(0x1eb)][_0x35445b(0x249)](_0x4ce2ff[_0x35445b(0x193)]());_0x32fc1e[_0x35445b(0x1b9)](new _0xb395ea[(_0x35445b(0x202))](_0x27ed37));}return _0x5c6742[_0x35445b(0x1c6)](_0x9c6d2a[_0x35445b(0x234)]()),_0x58a17d['refreshEditCellState'](),!0x0;}return!0x1;},_0x578b75(0x1c5))},_0x269ecd='sheets-zen-editor.config',_0x1e3a03={},_0x12845c=class _0x29d7fa{constructor(){var _0x4c44d0=_0x578b75;_0x5cf51f(this,_0x4c44d0(0x22e),null),_0x5cf51f(this,_0x4c44d0(0x1e9),new _0x28d825[(_0x4c44d0(0x1fb))](null)),_0x5cf51f(this,_0x4c44d0(0x20b),this['_position$'][_0x4c44d0(0x222)]());}['dispose'](){var _0x3b250c=_0x578b75;this[_0x3b250c(0x1e9)][_0x3b250c(0x1f9)](),this[_0x3b250c(0x22e)]=null;}['setPosition'](_0x16d640){var _0x4c73fb=_0x578b75;this[_0x4c73fb(0x22e)]=_0x16d640,this[_0x4c73fb(0x1b3)](_0x16d640);}['getPosition'](){var _0x3e1548=_0x578b75;return this[_0x3e1548(0x22e)];}[_0x578b75(0x1b3)](_0x1d5e83){var _0x1088dc=_0x578b75;this[_0x1088dc(0x1e9)][_0x1088dc(0x248)](_0x1d5e83);}};_0x23ce67(_0x12845c,'ZenEditorManagerService');let _0x242cb8=_0x12845c;const _0x10be18=_0xb395ea['createIdentifier'](_0x578b75(0x268));var _0x534b26=Object[_0x578b75(0x1cd)],_0x303316=Object[_0x578b75(0x21c)],_0x22cac9=_0x23ce67((_0x449989,_0x47c0df,_0x2934b1,_0x322b62)=>{var _0x3da6a5=_0x578b75;for(var _0x5b4b42=_0x322b62>0x1?void 0x0:_0x322b62?_0x303316(_0x47c0df,_0x2934b1):_0x47c0df,_0x31b080=_0x449989[_0x3da6a5(0x1ba)]-0x1,_0x2bc23d;_0x31b080>=0x0;_0x31b080--)(_0x2bc23d=_0x449989[_0x31b080])&&(_0x5b4b42=(_0x322b62?_0x2bc23d(_0x47c0df,_0x2934b1,_0x5b4b42):_0x2bc23d(_0x5b4b42))||_0x5b4b42);return _0x322b62&&_0x5b4b42&&_0x534b26(_0x47c0df,_0x2934b1,_0x5b4b42),_0x5b4b42;},_0x578b75(0x1cb)),_0x20911a=_0x23ce67((_0x4d489a,_0x37a2d3)=>(_0x51a220,_0x3efe16)=>_0x37a2d3(_0x51a220,_0x3efe16,_0x4d489a),_0x578b75(0x1a5));let _0x175395=(_0x7ffd4b=class extends _0xb395ea[_0x578b75(0x198)]{constructor(_0x4e7b51,_0x4dab4c){var _0x395bb3=_0x578b75;super(),this[_0x395bb3(0x26c)]=_0x4e7b51,this[_0x395bb3(0x217)]=_0x4dab4c,this[_0x395bb3(0x1b1)]();}['_initialize'](){var _0x4e0db9=_0x578b75;this[_0x4e0db9(0x1e4)]();}[_0x578b75(0x1e4)](){var _0x2d347b=_0x578b75;this[_0x2d347b(0x26c)]['position$'][_0x2d347b(0x21a)](_0x28d825[_0x2d347b(0x216)](this['dispose$']))['subscribe'](_0x444c2a=>{var _0x5a0cc0=_0x2d347b;if(_0x444c2a==null)return;const {width:_0x14b044,height:_0x3e0188}=_0x444c2a,_0x2dfe13=_0x149632['getEditorObject'](_0xb395ea[_0x5a0cc0(0x276)],this['_renderManagerService']);_0x2dfe13!=null&&requestIdleCallback(()=>{var _0x300452=_0x5a0cc0;_0x2dfe13[_0x300452(0x1bc)][_0x300452(0x1c9)](_0x14b044,_0x3e0188),this[_0x300452(0x218)](_0x2dfe13),this['_scrollToTop']();});});}[_0x578b75(0x218)](_0x4c93d4){var _0x4d58f9=_0x578b75;const {document:_0x3306d1,scene:_0x20adba,docBackground:_0x3e119b}=_0x4c93d4,_0xed5876=_0x20adba==null?void 0x0:_0x20adba[_0x4d58f9(0x22b)](),{width:_0x5665f5,height:_0x5a784c,pageMarginLeft:_0x21ec6e,pageMarginTop:_0x5db552}=_0x3306d1;if(_0xed5876==null||_0x5665f5===Number['POSITIVE_INFINITY']||_0x5a784c===Number[_0x4d58f9(0x201)])return;const {width:_0x139d9f,height:_0x771790}=_0xed5876;let _0x135977=0x0,_0x475aa3=0x0,_0x239b4d=0x0,_0x160b53=0x0,_0x30e5aa=Number[_0x4d58f9(0x201)];const {scaleX:_0x58687e,scaleY:_0x2c03f4}=_0x20adba[_0x4d58f9(0x253)]();_0x139d9f>(_0x5665f5+_0x21ec6e*0x2)*_0x58687e?(_0x135977=_0x139d9f/0x2-_0x5665f5*_0x58687e/0x2,_0x135977/=_0x58687e,_0x239b4d=(_0x139d9f-_0x21ec6e*0x2)/_0x58687e,_0x30e5aa=0x0):(_0x135977=_0x21ec6e,_0x239b4d=_0x5665f5+_0x21ec6e*0x2,_0x30e5aa=(_0x239b4d-_0x139d9f/_0x58687e)/0x2),_0x771790>_0x5a784c?(_0x475aa3=_0x771790/0x2-_0x5a784c/0x2,_0x160b53=(_0x771790-_0x5db552*0x2)/_0x2c03f4):(_0x475aa3=_0x5db552,_0x160b53=_0x5a784c+_0x5db552*0x2),_0x20adba['resize'](_0x239b4d,_0x160b53+0xc8),_0x3306d1['translate'](_0x135977,_0x475aa3),_0x3e119b['translate'](_0x135977,_0x475aa3);const _0x70819d=_0x20adba[_0x4d58f9(0x195)](_0x57a33a['VIEWPORT_KEY'][_0x4d58f9(0x24f)]);if(_0x30e5aa!==Number['POSITIVE_INFINITY']&&_0x70819d!=null){const _0x14651c=_0x70819d['transScroll2ViewportScrollValue'](_0x30e5aa,0x0)['x'];_0x70819d[_0x4d58f9(0x211)]({'x':_0x14651c});}return this;}[_0x578b75(0x1e8)](){var _0x2a4525=_0x578b75,_0x44b990;const _0x12bb2b=(_0x44b990=this[_0x2a4525(0x217)][_0x2a4525(0x255)](_0xb395ea[_0x2a4525(0x276)]))==null?void 0x0:_0x44b990[_0x2a4525(0x1dd)](_0x57a33a[_0x2a4525(0x25f)]),_0x259d01={'startOffset':0x0,'endOffset':0x0};_0x12bb2b&&_0x12bb2b['scrollToRange'](_0x259d01);}},_0x23ce67(_0x7ffd4b,_0x578b75(0x1d8)),_0x7ffd4b);_0x175395=_0x22cac9([_0x20911a(0x0,_0x10be18),_0x20911a(0x1,_0x4ede2b[_0x578b75(0x1ff)])],_0x175395);var _0xd1617b={'exports':{}},_0x2a732c={},_0x4f5c71=_0x16cea7,_0x38398f=Symbol[_0x578b75(0x277)](_0x578b75(0x213)),_0x1f7b06=Symbol[_0x578b75(0x277)]('react.fragment'),_0x1c7918=Object[_0x578b75(0x1ed)][_0x578b75(0x27c)],_0x48f351=_0x4f5c71[_0x578b75(0x241)]['ReactCurrentOwner'],_0x1e952c={'key':!0x0,'ref':!0x0,'__self':!0x0,'__source':!0x0};function _0x2d8650(_0x22c592,_0xe49b3d,_0x1e4e4a){var _0x3ec310=_0x578b75,_0x5501d6,_0x4133ad={},_0x3049e6=null,_0x2274ec=null;_0x1e4e4a!==void 0x0&&(_0x3049e6=''+_0x1e4e4a),_0xe49b3d[_0x3ec310(0x1f1)]!==void 0x0&&(_0x3049e6=''+_0xe49b3d['key']),_0xe49b3d[_0x3ec310(0x254)]!==void 0x0&&(_0x2274ec=_0xe49b3d['ref']);for(_0x5501d6 in _0xe49b3d)_0x1c7918[_0x3ec310(0x196)](_0xe49b3d,_0x5501d6)&&!_0x1e952c[_0x3ec310(0x27c)](_0x5501d6)&&(_0x4133ad[_0x5501d6]=_0xe49b3d[_0x5501d6]);if(_0x22c592&&_0x22c592[_0x3ec310(0x1df)]){for(_0x5501d6 in(_0xe49b3d=_0x22c592[_0x3ec310(0x1df)],_0xe49b3d))_0x4133ad[_0x5501d6]===void 0x0&&(_0x4133ad[_0x5501d6]=_0xe49b3d[_0x5501d6]);}return{'$$typeof':_0x38398f,'type':_0x22c592,'key':_0x3049e6,'ref':_0x2274ec,'props':_0x4133ad,'_owner':_0x48f351[_0x3ec310(0x223)]};}_0x23ce67(_0x2d8650,'q'),_0x2a732c[_0x578b75(0x230)]=_0x1f7b06,_0x2a732c[_0x578b75(0x219)]=_0x2d8650,_0x2a732c[_0x578b75(0x1c4)]=_0x2d8650,_0xd1617b['exports']=_0x2a732c;var _0xe09551=_0xd1617b[_0x578b75(0x24c)],_0x3519fa=function(){var _0x27cb94=_0x578b75;return _0x3519fa=Object[_0x27cb94(0x1a6)]||function(_0x35afe3){var _0x61aed5=_0x27cb94;for(var _0x19118c,_0x2c7f91=0x1,_0x277d87=arguments[_0x61aed5(0x1ba)];_0x2c7f91<_0x277d87;_0x2c7f91++){_0x19118c=arguments[_0x2c7f91];for(var _0x2753fe in _0x19118c)Object['prototype'][_0x61aed5(0x27c)][_0x61aed5(0x196)](_0x19118c,_0x2753fe)&&(_0x35afe3[_0x2753fe]=_0x19118c[_0x2753fe]);}return _0x35afe3;},_0x3519fa['apply'](this,arguments);},_0x2944d7=function(_0x4c9c95,_0x2faf58){var _0x36040f=_0x578b75,_0x703d8b={};for(var _0x50c691 in _0x4c9c95)Object['prototype']['hasOwnProperty']['call'](_0x4c9c95,_0x50c691)&&_0x2faf58[_0x36040f(0x1ae)](_0x50c691)<0x0&&(_0x703d8b[_0x50c691]=_0x4c9c95[_0x50c691]);if(_0x4c9c95!=null&&typeof Object['getOwnPropertySymbols']==_0x36040f(0x221)){for(var _0xbad399=0x0,_0x50c691=Object['getOwnPropertySymbols'](_0x4c9c95);_0xbad399<_0x50c691['length'];_0xbad399++)_0x2faf58[_0x36040f(0x1ae)](_0x50c691[_0xbad399])<0x0&&Object['prototype'][_0x36040f(0x206)][_0x36040f(0x196)](_0x4c9c95,_0x50c691[_0xbad399])&&(_0x703d8b[_0x50c691[_0xbad399]]=_0x4c9c95[_0x50c691[_0xbad399]]);}return _0x703d8b;},_0x3f802d=_0x16cea7[_0x578b75(0x19f)](function(_0x22116c,_0x543fbf){var _0x1dc63b=_0x578b75,_0xd0c1ea=_0x22116c[_0x1dc63b(0x266)],_0x16f95d=_0x22116c['id'],_0xad6b35=_0x22116c[_0x1dc63b(0x1f8)],_0x1f81cb=_0x22116c[_0x1dc63b(0x267)],_0x566e3c=_0x2944d7(_0x22116c,['icon','id',_0x1dc63b(0x1f8),_0x1dc63b(0x267)]),_0x4a328c=_0x1dc63b(0x1c3)[_0x1dc63b(0x25d)](_0x16f95d,'\x20')['concat'](_0xad6b35||'')[_0x1dc63b(0x192)](),_0x5769f1=_0x16cea7[_0x1dc63b(0x19d)]('_'[_0x1dc63b(0x25d)](_0x5bf469()));return _0x3140fc(_0xd0c1ea,''['concat'](_0x16f95d),{'defIds':_0xd0c1ea['defIds'],'idSuffix':_0x5769f1[_0x1dc63b(0x223)]},_0x3519fa({'ref':_0x543fbf,'className':_0x4a328c},_0x566e3c),_0x1f81cb);});function _0x3140fc(_0x2279d5,_0x3fb729,_0x39ba90,_0x316a61,_0x234140){var _0x5d5d9d=_0x578b75;return _0x16cea7[_0x5d5d9d(0x263)](_0x2279d5[_0x5d5d9d(0x1cf)],_0x3519fa(_0x3519fa({'key':_0x3fb729},_0x368b04(_0x2279d5,_0x39ba90,_0x234140)),_0x316a61),(_0xdf5f2c(_0x2279d5,_0x39ba90)[_0x5d5d9d(0x245)]||[])['map'](function(_0x52041d,_0x1de673){var _0x565eb6=_0x5d5d9d;return _0x3140fc(_0x52041d,''[_0x565eb6(0x25d)](_0x3fb729,'-')[_0x565eb6(0x25d)](_0x2279d5[_0x565eb6(0x1cf)],'-')[_0x565eb6(0x25d)](_0x1de673),_0x39ba90,void 0x0,_0x234140);}));}_0x23ce67(_0x3140fc,_0x578b75(0x227));function _0x368b04(_0xc9c2bb,_0x336a30,_0x2141a9){var _0x5f2e89=_0x578b75,_0x1418ef=_0x3519fa({},_0xc9c2bb[_0x5f2e89(0x1d1)]);_0x2141a9!=null&&_0x2141a9[_0x5f2e89(0x18d)]&&_0x1418ef[_0x5f2e89(0x1fa)]===_0x5f2e89(0x18d)&&(_0x1418ef[_0x5f2e89(0x1fa)]=_0x2141a9[_0x5f2e89(0x18d)]);var _0x58eb34=_0x336a30[_0x5f2e89(0x1ee)];return!_0x58eb34||_0x58eb34[_0x5f2e89(0x1ba)]===0x0||(_0xc9c2bb[_0x5f2e89(0x1cf)]==='use'&&_0x1418ef[_0x5f2e89(0x21f)]&&(_0x1418ef[_0x5f2e89(0x21f)]=_0x1418ef['xlink:href']+_0x336a30[_0x5f2e89(0x1d7)]),Object[_0x5f2e89(0x261)](_0x1418ef)[_0x5f2e89(0x25a)](function(_0x383269){var _0x10ab97=_0x5f2e89,_0x41dbf1=_0x383269[0x0],_0x474af1=_0x383269[0x1];typeof _0x474af1==_0x10ab97(0x232)&&(_0x1418ef[_0x41dbf1]=_0x474af1['replace'](/url\(#(.*)\)/,'url(#$1'[_0x10ab97(0x25d)](_0x336a30[_0x10ab97(0x1d7)],')')));})),_0x1418ef;}_0x23ce67(_0x368b04,_0x578b75(0x1f5));function _0xdf5f2c(_0x56ba45,_0x195012){var _0x4631b0=_0x578b75,_0x400465,_0x344592=_0x195012['defIds'];return!_0x344592||_0x344592[_0x4631b0(0x1ba)]===0x0?_0x56ba45:_0x56ba45[_0x4631b0(0x1cf)]===_0x4631b0(0x1e1)&&(!((_0x400465=_0x56ba45[_0x4631b0(0x245)])===null||_0x400465===void 0x0)&&_0x400465['length'])?_0x3519fa(_0x3519fa({},_0x56ba45),{'children':_0x56ba45['children'][_0x4631b0(0x228)](function(_0x375193){var _0x5cbf0f=_0x4631b0;return typeof _0x375193['attrs']['id']==_0x5cbf0f(0x232)&&_0x344592&&_0x344592[_0x5cbf0f(0x1ae)](_0x375193[_0x5cbf0f(0x1d1)]['id'])>-0x1?_0x3519fa(_0x3519fa({},_0x375193),{'attrs':_0x3519fa(_0x3519fa({},_0x375193[_0x5cbf0f(0x1d1)]),{'id':_0x375193[_0x5cbf0f(0x1d1)]['id']+_0x195012['idSuffix']})}):_0x375193;})}):_0x56ba45;}_0x23ce67(_0xdf5f2c,'replaceRuntimeIdsInDefs');function _0x5bf469(){var _0x3d1716=_0x578b75;return Math[_0x3d1716(0x212)]()[_0x3d1716(0x205)](0x24)[_0x3d1716(0x262)](0x2,0x8);}_0x23ce67(_0x5bf469,_0x578b75(0x259)),_0x3f802d['displayName']=_0x578b75(0x1e7);var _0x2aff1f={'tag':'svg','attrs':{'fill':_0x578b75(0x203),'viewBox':_0x578b75(0x1f3),'width':_0x578b75(0x1d3),'height':'1em'},'children':[{'tag':_0x578b75(0x236),'attrs':{'fill':_0x578b75(0x25e),'d':_0x578b75(0x207),'fillRule':_0x578b75(0x225),'clipRule':'evenodd'}}]},_0x691852=_0x16cea7[_0x578b75(0x19f)](function(_0x4320b3,_0x3d01b5){var _0x12d92c=_0x578b75;return _0x16cea7['createElement'](_0x3f802d,Object[_0x12d92c(0x1a6)]({},_0x4320b3,{'id':'check-mark-single','ref':_0x3d01b5,'icon':_0x2aff1f}));});_0x691852[_0x578b75(0x215)]='CheckMarkSingle';var _0x35bfa5={'tag':'svg','attrs':{'fill':'none','viewBox':'0\x200\x2016\x2016','width':_0x578b75(0x1d3),'height':_0x578b75(0x1d3)},'children':[{'tag':_0x578b75(0x236),'attrs':{'fill':_0x578b75(0x25e),'d':_0x578b75(0x20a)}}]},_0x2b7a85=_0x16cea7['forwardRef'](function(_0x4aa2d6,_0x1623df){var _0x27428e=_0x578b75;return _0x16cea7[_0x27428e(0x263)](_0x3f802d,Object[_0x27428e(0x1a6)]({},_0x4aa2d6,{'id':_0x27428e(0x18e),'ref':_0x1623df,'icon':_0x35bfa5}));});_0x2b7a85[_0x578b75(0x215)]=_0x578b75(0x21d);const _0x42b8ed={'zenEditor':'univer-zen-editor','zenEditorIconWrapper':_0x578b75(0x251),'zenEditorIconContainer':_0x578b75(0x23f),'zenEditorIconSuccess':_0x578b75(0x20f),'zenEditorIconError':_0x578b75(0x20e),'zenEditorCanvasContainer':_0x578b75(0x243)},_0x5cab6a=_0x578b75(0x1ac),_0x17bfc8={'id':_0xb395ea['DOCS_ZEN_EDITOR_UNIT_ID_KEY'],'body':{'dataStream':''+_0xb395ea[_0x578b75(0x237)],'textRuns':[],'tables':[],'customBlocks':[],'paragraphs':[{'startIndex':0x0}],'sectionBreaks':[{'startIndex':0x1}]},'tableSource':{},'documentStyle':{'pageSize':{'width':0x253,'height':0x34a},'documentFlavor':_0xb395ea[_0x578b75(0x1c8)][_0x578b75(0x273)],'marginTop':0x32,'marginBottom':0x32,'marginRight':0x28,'marginLeft':0x28,'renderConfig':{'vertexAngle':0x0,'centerAngle':0x0}},'drawings':{},'drawingsOrder':[]};function _0xf5cc9f(){var _0x1d9462=_0x578b75;const _0xa9c7d1=_0x16cea7[_0x1d9462(0x19d)](null),_0x526e69=_0xb395ea[_0x1d9462(0x23c)](_0x10be18),_0x42709c=_0xb395ea[_0x1d9462(0x23c)](_0x57a33a[_0x1d9462(0x197)]),_0x41cb22=_0xb395ea[_0x1d9462(0x23c)](_0xb395ea[_0x1d9462(0x1b4)]);_0x16cea7['useEffect'](()=>{var _0x2fa96e=_0x1d9462;const _0xa6a901=_0xa9c7d1[_0x2fa96e(0x223)];if(!_0xa6a901)return;const _0x435b49=_0x42709c[_0x2fa96e(0x275)]({'editorUnitId':_0xb395ea['DOCS_ZEN_EDITOR_UNIT_ID_KEY'],'initialSnapshot':_0x17bfc8,'scrollBar':!0x0,'noNeedVerticalAlign':!0x0,'backScrollOffset':0x64},_0xa6a901),_0x31116e=new ResizeObserver(()=>{var _0x30c997=_0x2fa96e;_0x526e69[_0x30c997(0x1d2)](_0xa6a901[_0x30c997(0x252)]());});return _0x31116e[_0x2fa96e(0x1f7)](_0xa6a901),()=>{var _0x480690=_0x2fa96e;_0x435b49['dispose'](),_0x31116e[_0x480690(0x190)](_0xa6a901);};},[]);function _0x40f882(){var _0x10eddc=_0x1d9462;_0x41cb22[_0x10eddc(0x1a2)](_0x2fd09d['id']);}_0x23ce67(_0x40f882,_0x1d9462(0x1ce));function _0x245a8e(){var _0x1fa27c=_0x1d9462;_0x41cb22[_0x1fa27c(0x1a2)](_0x309d24['id']);}return _0x23ce67(_0x245a8e,'handleConfirmBtnClick'),_0xe09551[_0x1d9462(0x1c4)]('div',{'className':_0x42b8ed[_0x1d9462(0x270)],'children':[_0xe09551[_0x1d9462(0x1c4)](_0x1d9462(0x23a),{'className':_0x42b8ed[_0x1d9462(0x19b)],'children':[_0xe09551[_0x1d9462(0x219)]('span',{'className':_0x48006f(_0x42b8ed[_0x1d9462(0x18f)],_0x42b8ed[_0x1d9462(0x246)]),'onClick':_0x40f882,'children':_0xe09551[_0x1d9462(0x219)](_0x2b7a85,{'style':{'fontSize':'22px'}})}),_0xe09551[_0x1d9462(0x219)](_0x1d9462(0x1e0),{'className':_0x48006f(_0x42b8ed[_0x1d9462(0x18f)],_0x42b8ed[_0x1d9462(0x1d0)]),'onClick':_0x245a8e,'children':_0xe09551['jsx'](_0x691852,{'style':{'fontSize':_0x1d9462(0x25c)}})})]}),_0xe09551['jsx'](_0x1d9462(0x23a),{'className':_0x42b8ed[_0x1d9462(0x233)],'ref':_0xa9c7d1})]});}_0x23ce67(_0xf5cc9f,_0x578b75(0x209));function _0x3e3444(_0x378188){var _0x1532f7=_0x578b75;return{'id':_0x32ec28['id'],'type':_0x6802a8[_0x1532f7(0x214)][_0x1532f7(0x1ca)],'title':_0x1532f7(0x1cc),'icon':_0x1532f7(0x208),'hidden$':_0x149632[_0x1532f7(0x1d5)](_0x378188),'disabled$':_0x149632[_0x1532f7(0x25b)](_0x378188,{'workbookTypes':[_0x30c8bd[_0x1532f7(0x1de)]],'worksheetTypes':[_0x30c8bd['WorksheetEditPermission'],_0x30c8bd[_0x1532f7(0x1f6)],_0x30c8bd[_0x1532f7(0x21b)]],'rangeTypes':[_0x30c8bd[_0x1532f7(0x1db)]]})};}_0x23ce67(_0x3e3444,_0x578b75(0x24e));const _0x2fd60e={[_0x6802a8[_0x578b75(0x26e)][_0x578b75(0x224)]]:{[_0x6802a8['ContextMenuGroup']['OTHERS']]:{[_0x32ec28['id']]:{'order':0x2,'menuItemFactory':_0x3e3444}}}},_0x427351={'id':_0x309d24['id'],'description':_0x578b75(0x23b),'group':_0x578b75(0x235),'preconditions':_0x23ce67(_0x3e5ddc=>_0x38c1d1(_0x3e5ddc),_0x578b75(0x1b0)),'binding':_0x6802a8[_0x578b75(0x21e)][_0x578b75(0x1a9)]|_0x6802a8[_0x578b75(0x1f2)][_0x578b75(0x1ea)]},_0x1a6d2c={'id':_0x2fd09d['id'],'description':_0x578b75(0x272),'group':'4_sheet-edit','preconditions':_0x23ce67(_0x172593=>_0x38c1d1(_0x172593),_0x578b75(0x1b0)),'binding':_0x6802a8['KeyCode'][_0x578b75(0x27a)]};function _0x38c1d1(_0x5b7429){var _0x5b2360=_0x578b75;return _0x5b7429[_0x5b2360(0x1d4)](_0xb395ea[_0x5b2360(0x1ad)])&&_0x5b7429[_0x5b2360(0x1d4)](_0xb395ea[_0x5b2360(0x19a)])&&_0x5b7429['getContextValue'](_0xb395ea[_0x5b2360(0x20d)])&&!_0x5b7429[_0x5b2360(0x1d4)](_0xb395ea['FOCUSING_EDITOR_STANDALONE']);}_0x23ce67(_0x38c1d1,_0x578b75(0x1b6));var _0xe5a608=Object[_0x578b75(0x1cd)],_0x42a160=Object['getOwnPropertyDescriptor'],_0x1d82ed=_0x23ce67((_0x3dfbeb,_0x169763,_0x542502,_0x3c49c6)=>{var _0x340440=_0x578b75;for(var _0x2670bb=_0x3c49c6>0x1?void 0x0:_0x3c49c6?_0x42a160(_0x169763,_0x542502):_0x169763,_0x98c3f5=_0x3dfbeb[_0x340440(0x1ba)]-0x1,_0xdd5e47;_0x98c3f5>=0x0;_0x98c3f5--)(_0xdd5e47=_0x3dfbeb[_0x98c3f5])&&(_0x2670bb=(_0x3c49c6?_0xdd5e47(_0x169763,_0x542502,_0x2670bb):_0xdd5e47(_0x2670bb))||_0x2670bb);return _0x3c49c6&&_0x2670bb&&_0xe5a608(_0x169763,_0x542502,_0x2670bb),_0x2670bb;},_0x578b75(0x1c1)),_0x50ef1e=_0x23ce67((_0x4d46b3,_0x29c68e)=>(_0x211c07,_0x3ffa96)=>_0x29c68e(_0x211c07,_0x3ffa96,_0x4d46b3),'__decorateParam$1');let _0x1c433a=(_0x13dab1=class extends _0xb395ea[_0x578b75(0x24a)]{constructor(_0x36d4d6,_0x56dc6b,_0x5319e4,_0x4e9d57){var _0x3e3cc2=_0x578b75;super(),this['_zenZoneService']=_0x36d4d6,this[_0x3e3cc2(0x1d9)]=_0x56dc6b,this['_menuManagerService']=_0x5319e4,this[_0x3e3cc2(0x1a4)]=_0x4e9d57,this['_initialize']();}[_0x578b75(0x1b1)](){var _0x236a67=_0x578b75;this[_0x236a67(0x1fd)](),this['_initCommands'](),this[_0x236a67(0x20c)](),this[_0x236a67(0x1da)]();}['_initCustomComponents'](){var _0x5957f4=_0x578b75;this['disposeWithMe'](this[_0x5957f4(0x1a7)][_0x5957f4(0x239)](_0x5cab6a,_0xf5cc9f));}[_0x578b75(0x1a3)](){var _0x58168e=_0x578b75;[_0x32ec28,_0x2fd09d,_0x309d24][_0x58168e(0x25a)](_0x3f8734=>{var _0x3ec07e=_0x58168e;this['disposeWithMe'](this[_0x3ec07e(0x1d9)][_0x3ec07e(0x1e5)](_0x3f8734));});}[_0x578b75(0x20c)](){var _0xe3dc1b=_0x578b75;this[_0xe3dc1b(0x1e3)][_0xe3dc1b(0x244)](_0x2fd60e);}[_0x578b75(0x1da)](){var _0x4bf34f=_0x578b75;[_0x427351,_0x1a6d2c][_0x4bf34f(0x25a)](_0x15de2a=>{var _0xb737d9=_0x4bf34f;this[_0xb737d9(0x1ec)](this[_0xb737d9(0x1a4)][_0xb737d9(0x271)](_0x15de2a));});}},_0x23ce67(_0x13dab1,'ZenEditorUIController'),_0x13dab1);_0x1c433a=_0x1d82ed([_0x50ef1e(0x0,_0x6802a8[_0x578b75(0x200)]),_0x50ef1e(0x1,_0xb395ea[_0x578b75(0x1b4)]),_0x50ef1e(0x2,_0x6802a8[_0x578b75(0x1fe)]),_0x50ef1e(0x3,_0x6802a8[_0x578b75(0x1f4)])],_0x1c433a);var _0x3d8fc7=Object[_0x578b75(0x1cd)],_0x528794=Object['getOwnPropertyDescriptor'],_0x28cf6d=_0x23ce67((_0x1d8865,_0x40b5c8,_0x219bec,_0x105522)=>{var _0x1278d8=_0x578b75;for(var _0x18d2ee=_0x105522>0x1?void 0x0:_0x105522?_0x528794(_0x40b5c8,_0x219bec):_0x40b5c8,_0x5d2b4e=_0x1d8865[_0x1278d8(0x1ba)]-0x1,_0x2eb284;_0x5d2b4e>=0x0;_0x5d2b4e--)(_0x2eb284=_0x1d8865[_0x5d2b4e])&&(_0x18d2ee=(_0x105522?_0x2eb284(_0x40b5c8,_0x219bec,_0x18d2ee):_0x2eb284(_0x18d2ee))||_0x18d2ee);return _0x105522&&_0x18d2ee&&_0x3d8fc7(_0x40b5c8,_0x219bec,_0x18d2ee),_0x18d2ee;},_0x578b75(0x260)),_0x3c13f9=_0x23ce67((_0x48b82e,_0x13fb49)=>(_0x3e7c7f,_0x5f33a4)=>_0x13fb49(_0x3e7c7f,_0x5f33a4,_0x48b82e),'__decorateParam');_0x280494[_0x578b75(0x1ef)]=(_0x3d4e0d=class extends _0xb395ea[_0x578b75(0x199)]{constructor(_0xc69bb1=_0x1e3a03,_0x5c750c,_0x15a58a){var _0x2e546c=_0x578b75;super(),this[_0x2e546c(0x257)]=_0xc69bb1,this['_injector']=_0x5c750c,this[_0x2e546c(0x26f)]=_0x15a58a;const {menu:_0x2fb232,..._0x5af5d1}=this['_config'];_0x2fb232&&this['_configService']['setConfig'](_0x2e546c(0x1dc),_0x2fb232,{'merge':!0x0}),this['_configService'][_0x2e546c(0x1f0)](_0x269ecd,_0x5af5d1),this['_initializeDependencies'](this[_0x2e546c(0x226)]);}[_0x578b75(0x250)](_0x5455c3){var _0x53bac4=_0x578b75;[[_0x1c433a],[_0x175395],[_0x10be18,{'useClass':_0x242cb8}]][_0x53bac4(0x25a)](_0x4773d6=>_0x5455c3[_0x53bac4(0x1af)](_0x4773d6));}[_0x578b75(0x22c)](){var _0x5e5798=_0x578b75;this['_injector'][_0x5e5798(0x1fc)](_0x1c433a);}['onSteady'](){this['_injector']['get'](_0x175395);}},_0x23ce67(_0x3d4e0d,'UniverSheetsZenEditorPlugin'),_0x5cf51f(_0x3d4e0d,'pluginName',_0x578b75(0x1a1)),_0x5cf51f(_0x3d4e0d,_0x578b75(0x229),_0xb395ea['UniverInstanceType'][_0x578b75(0x264)]),_0x3d4e0d),_0x280494['UniverSheetsZenEditorPlugin']=_0x28cf6d([_0x3c13f9(0x1,_0xb395ea['Inject'](_0xb395ea['Injector'])),_0x3c13f9(0x2,_0xb395ea[_0x578b75(0x269)])],_0x280494[_0x578b75(0x1ef)]),_0x280494[_0x578b75(0x23d)]=_0x2fd09d,_0x280494['ConfirmZenEditCommand']=_0x309d24,_0x280494[_0x578b75(0x279)]=_0x32ec28,Object[_0x578b75(0x1cd)](_0x280494,Symbol['toStringTag'],{'value':_0x578b75(0x240)});}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-zen-editor",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.0-nightly.202410101606",
4
4
  "private": false,
5
5
  "description": "Zen Editor plugin for Univer Sheets.",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -50,25 +50,24 @@
50
50
  "clsx": ">=2.0.0",
51
51
  "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
52
52
  "rxjs": ">=7.0.0",
53
- "@univerjs/core": "0.3.0-alpha.0",
54
- "@univerjs/docs": "0.3.0-alpha.0",
55
- "@univerjs/docs-ui": "0.3.0-alpha.0",
56
- "@univerjs/engine-render": "0.3.0-alpha.0",
57
- "@univerjs/sheets-ui": "0.3.0-alpha.0",
58
- "@univerjs/sheets": "0.3.0-alpha.0",
59
- "@univerjs/ui": "0.3.0-alpha.0"
53
+ "@univerjs/core": "0.3.0-nightly.202410101606",
54
+ "@univerjs/engine-render": "0.3.0-nightly.202410101606",
55
+ "@univerjs/sheets-ui": "0.3.0-nightly.202410101606",
56
+ "@univerjs/ui": "0.3.0-nightly.202410101606",
57
+ "@univerjs/sheets": "0.3.0-nightly.202410101606",
58
+ "@univerjs/docs-ui": "0.3.0-nightly.202410101606"
60
59
  },
61
60
  "dependencies": {
62
61
  "@univerjs/icons": "^0.1.78",
63
62
  "clsx": "^2.1.1",
64
- "@univerjs/core": "0.3.0-alpha.0",
65
- "@univerjs/design": "0.3.0-alpha.0",
66
- "@univerjs/docs": "0.3.0-alpha.0",
67
- "@univerjs/docs-ui": "0.3.0-alpha.0",
68
- "@univerjs/engine-render": "0.3.0-alpha.0",
69
- "@univerjs/sheets-ui": "0.3.0-alpha.0",
70
- "@univerjs/ui": "0.3.0-alpha.0",
71
- "@univerjs/sheets": "0.3.0-alpha.0"
63
+ "@univerjs/core": "0.3.0-nightly.202410101606",
64
+ "@univerjs/design": "0.3.0-nightly.202410101606",
65
+ "@univerjs/docs": "0.3.0-nightly.202410101606",
66
+ "@univerjs/docs-ui": "0.3.0-nightly.202410101606",
67
+ "@univerjs/sheets": "0.3.0-nightly.202410101606",
68
+ "@univerjs/engine-render": "0.3.0-nightly.202410101606",
69
+ "@univerjs/sheets-ui": "0.3.0-nightly.202410101606",
70
+ "@univerjs/ui": "0.3.0-nightly.202410101606"
72
71
  },
73
72
  "devDependencies": {
74
73
  "less": "^4.2.0",
@@ -77,7 +76,7 @@
77
76
  "typescript": "^5.6.2",
78
77
  "vite": "^5.4.8",
79
78
  "vitest": "^2.1.1",
80
- "@univerjs-infra/shared": "0.3.0-alpha.0"
79
+ "@univerjs-infra/shared": "0.3.0"
81
80
  },
82
81
  "univerSpace": {
83
82
  ".": {
@@ -98,7 +97,6 @@
98
97
  "test:watch": "vitest",
99
98
  "coverage": "vitest run --coverage",
100
99
  "lint:types": "tsc --noEmit",
101
- "build": "tsc && vite build",
102
- "sync:cnpm": "cnpm sync"
100
+ "build": "tsc && vite build"
103
101
  }
104
102
  }
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
@@ -1,2 +0,0 @@
1
- import { IOperation } from '@univerjs/core';
2
- export declare const OpenZenEditorOperation: IOperation;