@univerjs/sheets-zen-editor 0.6.1 → 0.6.2

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 +1 @@
1
- "use strict";var G=Object.defineProperty;var X=(e,n,r)=>n in e?G(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var O=(e,n,r)=>X(e,typeof n!="symbol"?n+"":n,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@univerjs/core"),N=require("@univerjs/docs-ui"),F=require("@univerjs/engine-render"),S=require("@univerjs/sheets-ui"),d=require("@univerjs/ui"),E=require("react/jsx-runtime"),_=require("react"),$=require("rxjs"),T=require("@univerjs/sheets"),U={id:"zen-editor.command.open-zen-editor",type:s.CommandType.COMMAND,handler:async e=>{var D;const n=e.get(d.IZenZoneService),r=e.get(N.IEditorService),t=e.get(S.IEditorBridgeService),i=e.get(s.IUniverInstanceService),c=e.get(d.ISidebarService);c.visible&&(c.close(),await s.delayAnimationFrame()),n.open();const o=r.getEditor(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(o==null)return!1;const a=t.getLatestEditCellState();if(a==null)return!1;const l=(D=a.documentLayoutObject.documentModel)==null?void 0:D.getSnapshot();if(l==null)return!1;i.focusUnit(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY);const{body:f,drawings:m,drawingsOrder:g,tableSource:h,settings:C}=s.Tools.deepClone(l),p={...o.getDocumentData(),body:f,drawings:m,drawingsOrder:g,tableSource:h,settings:C},I=[{startOffset:0,endOffset:0,collapsed:!0}];return o.focus(),o.setDocumentData(p,I),o.clearUndoRedoHistory(),!0}},Z={id:"zen-editor.command.cancel-zen-edit",type:s.CommandType.COMMAND,handler:async e=>{const n=e.get(d.IZenZoneService),r=e.get(S.IEditorBridgeService),t=e.get(s.IUniverInstanceService),i=e.get(d.ISidebarService);i.visible&&(i.close(),await s.delayAnimationFrame()),n.close();const c=t.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);return c?(t.focusUnit(c.getUnitId()),r.refreshEditCellState(),!0):!1}},P={id:"zen-editor.command.confirm-zen-edit",type:s.CommandType.COMMAND,handler:async e=>{var f;const n=e.get(d.IZenZoneService),r=e.get(S.IEditorBridgeService),t=e.get(s.IUniverInstanceService),i=e.get(N.IEditorService),c=e.get(d.ISidebarService);c.visible&&(c.close(),await s.delayAnimationFrame()),n.close();const o=i.getEditor(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(o==null)return!1;const a=e.get(F.IRenderManagerService),l=t.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);if(l){const m=l.getUnitId(),g=(f=a.getRenderById(m))==null?void 0:f.with(S.EditingRenderController);if(g){const h=s.Tools.deepClone(o.getDocumentData());h.documentStyle.documentFlavor=s.DocumentFlavor.UNSPECIFIED,g.submitCellData(new s.DocumentDataModel(h))}return t.focusUnit(l.getUnitId()),r.refreshEditCellState(),!0}return!1}},J="sheets-zen-editor.config",k={};var u=function(){return u=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(this,arguments)},Q=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,t=Object.getOwnPropertySymbols(e);i<t.length;i++)n.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(r[t[i]]=e[t[i]]);return r},w=_.forwardRef(function(e,n){var r=e.icon,t=e.id,i=e.className,c=e.extend,o=Q(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(t," ").concat(i||"").trim(),l=_.useRef("_".concat(ne()));return V(r,"".concat(t),{defIds:r.defIds,idSuffix:l.current},u({ref:n,className:a},o),c)});function V(e,n,r,t,i){return _.createElement(e.tag,u(u({key:n},ee(e,r,i)),t),(te(e,r).children||[]).map(function(c,o){return V(c,"".concat(n,"-").concat(e.tag,"-").concat(o),r,void 0,i)}))}function ee(e,n,r){var t=u({},e.attrs);r!=null&&r.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=r.colorChannel1),e.tag==="mask"&&t.id&&(t.id=t.id+n.idSuffix),Object.entries(t).forEach(function(c){var o=c[0],a=c[1];o==="mask"&&typeof a=="string"&&(t[o]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))});var i=n.defIds;return!i||i.length===0||(e.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(c){var o=c[0],a=c[1];typeof a=="string"&&(t[o]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function te(e,n){var r,t=n.defIds;return!t||t.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?u(u({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&t&&t.indexOf(i.attrs.id)>-1?u(u({},i),{attrs:u(u({},i.attrs),{id:i.attrs.id+n.idSuffix})}):i})}):e}function ne(){return Math.random().toString(36).substring(2,8)}w.displayName="UniverIcon";var re={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"}}]},Y=_.forwardRef(function(e,n){return _.createElement(w,Object.assign({},e,{id:"check-mark-single",ref:n,icon:re}))});Y.displayName="CheckMarkSingle";var ie={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"}}]},W=_.forwardRef(function(e,n){return _.createElement(w,Object.assign({},e,{id:"close-single",ref:n,icon:ie}))});W.displayName="CloseSingle";function K(e){var n,r,t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(r=K(e[n]))&&(t&&(t+=" "),t+=r)}else for(r in e)e[r]&&(t&&(t+=" "),t+=r);return t}function A(){for(var e,n,r=0,t="",i=arguments.length;r<i;r++)(e=arguments[r])&&(n=K(e))&&(t&&(t+=" "),t+=n);return t}class oe{constructor(){O(this,"_position",null);O(this,"_position$",new $.BehaviorSubject(null));O(this,"position$",this._position$.asObservable())}dispose(){this._position$.complete(),this._position=null}setPosition(n){this._position=n,this._refresh(n)}getPosition(){return this._position}_refresh(n){this._position$.next(n)}}const j=s.createIdentifier("univer.sheet-zen-editor-manager.service"),se="univer-zen-editor",ce="univer-zen-editor-icon-wrapper",ae="univer-zen-editor-icon-container",de="univer-zen-editor-icon-success",le="univer-zen-editor-icon-error",ue="univer-zen-editor-canvas-container",v={zenEditor:se,zenEditorIconWrapper:ce,zenEditorIconContainer:ae,zenEditorIconSuccess:de,zenEditorIconError:le,zenEditorCanvasContainer:ue},ge="ZEN_EDITOR_PLUGIN_",fe=`${ge}ZEN_EDITOR_COMPONENT`,_e={id:s.DOCS_ZEN_EDITOR_UNIT_ID_KEY,body:{dataStream:`${s.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],tables:[],customBlocks:[],paragraphs:[{startIndex:0}],sectionBreaks:[{startIndex:1}]},tableSource:{},documentStyle:{pageSize:{width:595,height:Number.POSITIVE_INFINITY},documentFlavor:s.DocumentFlavor.MODERN,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,renderConfig:{vertexAngle:0,centerAngle:0}},drawings:{},drawingsOrder:[]};function he(){const e=_.useRef(null),n=d.useDependency(j),r=d.useDependency(N.IEditorService),t=d.useDependency(s.ICommandService);_.useEffect(()=>{const o=e.current;if(!o)return;const a=r.register({editorUnitId:s.DOCS_ZEN_EDITOR_UNIT_ID_KEY,initialSnapshot:_e,scrollBar:!0,backScrollOffset:100},o),l=new ResizeObserver(()=>{n.setPosition(o.getBoundingClientRect())});return l.observe(o),()=>{a.dispose(),l.unobserve(o)}},[]);function i(){const o=r.getEditor(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY);o==null||o.blur(),t.executeCommand(Z.id)}function c(){const o=r.getEditor(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY);o==null||o.blur(),t.executeCommand(P.id)}return E.jsxs("div",{className:v.zenEditor,children:[E.jsxs("div",{className:v.zenEditorIconWrapper,children:[E.jsx("span",{className:A(v.zenEditorIconContainer,v.zenEditorIconError),onClick:i,children:E.jsx(W,{style:{fontSize:"22px"}})}),E.jsx("span",{className:A(v.zenEditorIconContainer,v.zenEditorIconSuccess),onClick:c,children:E.jsx(Y,{style:{fontSize:"22px"}})})]}),E.jsx("div",{className:v.zenEditorCanvasContainer,ref:e})]})}function Ie(e){return{id:U.id,type:d.MenuItemType.BUTTON,title:"rightClick.zenEditor",icon:"AmplifySingle",hidden$:S.getCurrentExclusiveRangeInterest$(e),disabled$:S.getCurrentRangeDisable$(e,{workbookTypes:[T.WorkbookEditablePermission],worksheetTypes:[T.WorksheetEditPermission,T.WorksheetSetCellValuePermission,T.WorksheetSetCellStylePermission],rangeTypes:[T.RangeProtectionPermissionEditPoint]})}}const Ee={[d.ContextMenuPosition.MAIN_AREA]:{[d.ContextMenuGroup.OTHERS]:{[U.id]:{order:2,menuItemFactory:Ie}}}},ve={id:P.id,description:"shortcut.sheet.zen-edit-confirm",group:"4_sheet-edit",preconditions:e=>H(e),binding:d.KeyCode.ENTER|d.MetaKeys.ALT},Se={id:Z.id,description:"shortcut.sheet.zen-edit-cancel",group:"4_sheet-edit",preconditions:e=>H(e),binding:d.KeyCode.ESC};function H(e){return e.getContextValue(s.FOCUSING_DOC)&&e.getContextValue(s.FOCUSING_UNIVER_EDITOR)&&e.getContextValue(s.EDITOR_ACTIVATED)&&!e.getContextValue(s.FOCUSING_EDITOR_STANDALONE)}var me=Object.getOwnPropertyDescriptor,Ce=(e,n,r,t)=>{for(var i=t>1?void 0:t?me(n,r):n,c=e.length-1,o;c>=0;c--)(o=e[c])&&(i=o(i)||i);return i},b=(e,n)=>(r,t)=>n(r,t,e);let R=class extends s.Disposable{constructor(e,n,r,t){super(),this._zenZoneService=e,this._commandService=n,this._menuManagerService=r,this._shortcutService=t,this._initialize()}_initialize(){this._initCustomComponents(),this._initCommands(),this._initMenus(),this._initShortcuts()}_initCustomComponents(){this.disposeWithMe(this._zenZoneService.set(fe,he))}_initCommands(){[U,Z,P].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Ee)}_initShortcuts(){[ve,Se].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}};R=Ce([b(0,d.IZenZoneService),b(1,s.ICommandService),b(2,d.IMenuManagerService),b(3,d.IShortcutService)],R);var pe=Object.getOwnPropertyDescriptor,Oe=(e,n,r,t)=>{for(var i=t>1?void 0:t?pe(n,r):n,c=e.length-1,o;c>=0;c--)(o=e[c])&&(i=o(i)||i);return i},B=(e,n)=>(r,t)=>n(r,t,e);let M=class extends s.RxDisposable{constructor(e,n){super(),this._zenEditorManagerService=e,this._renderManagerService=n,this._initialize()}_initialize(){this._syncZenEditorSize()}_syncZenEditorSize(){this._zenEditorManagerService.position$.pipe($.takeUntil(this.dispose$)).subscribe(e=>{if(e==null)return;const{width:n,height:r}=e,t=S.getEditorObject(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY,this._renderManagerService);t!=null&&requestIdleCallback(()=>{t.engine.resizeBySize(n,r),this._calculatePagePosition(t),this._scrollToTop()})})}_calculatePagePosition(e){const{document:n,scene:r,docBackground:t}=e,i=r==null?void 0:r.getParent(),{width:c,height:o,pageMarginLeft:a,pageMarginTop:l}=n;if(i==null||c===Number.POSITIVE_INFINITY||o===Number.POSITIVE_INFINITY)return;const{width:f,height:m}=i;let g=0;const h=l;let C=0,y=0,p=Number.POSITIVE_INFINITY;const{scaleX:I,scaleY:D}=r.getAncestorScale();f>(c+a*2)*I?(g=f/2-c*I/2,g/=I,C=(f-a*2)/I,p=0):(g=a,C=c+a*2,p=(C-f/I)/2),m>o?y=(m-l*2)/D:y=o+l*2,r.resize(C,y),n.translate(g,h),t.translate(g,h);const x=r.getViewport(N.VIEWPORT_KEY.VIEW_MAIN);if(p!==Number.POSITIVE_INFINITY&&x!=null){const q=x.transScroll2ViewportScrollValue(p,0).x;x.scrollToBarPos({x:q})}return this}_scrollToTop(){var r;const e=(r=this._renderManagerService.getRenderById(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:r.with(N.DocBackScrollRenderController),n={startOffset:0,endOffset:0};e&&e.scrollToRange(n)}};M=Oe([B(0,j),B(1,F.IRenderManagerService)],M);var Te=Object.getOwnPropertyDescriptor,Ne=(e,n,r,t)=>{for(var i=t>1?void 0:t?Te(n,r):n,c=e.length-1,o;c>=0;c--)(o=e[c])&&(i=o(i)||i);return i},L=(e,n)=>(r,t)=>n(r,t,e),z;exports.UniverSheetsZenEditorPlugin=(z=class extends s.Plugin{constructor(n=k,r,t){super(),this._config=n,this._injector=r,this._configService=t;const{menu:i,...c}=s.merge({},k,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(J,c),this._initializeDependencies(this._injector)}_initializeDependencies(n){[[R],[M],[j,{useClass:oe}]].forEach(t=>n.add(t))}onReady(){this._injector.get(R)}onSteady(){this._injector.get(M)}},O(z,"pluginName","SHEET_ZEN_EDITOR_PLUGIN"),O(z,"type",s.UniverInstanceType.UNIVER_SHEET),z);exports.UniverSheetsZenEditorPlugin=Ne([L(1,s.Inject(s.Injector)),L(2,s.IConfigService)],exports.UniverSheetsZenEditorPlugin);exports.CancelZenEditCommand=Z;exports.ConfirmZenEditCommand=P;exports.OpenZenEditorCommand=U;
1
+ "use strict";var H=Object.defineProperty;var G=(e,t,i)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var O=(e,t,i)=>G(e,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@univerjs/core"),N=require("@univerjs/docs-ui"),$=require("@univerjs/engine-render"),I=require("@univerjs/sheets-ui"),d=require("@univerjs/ui"),v=require("react/jsx-runtime"),B=require("@univerjs/design"),E=require("react"),R=require("rxjs"),T=require("@univerjs/sheets"),Z={id:"zen-editor.command.open-zen-editor",type:c.CommandType.COMMAND,handler:async e=>{var D;const t=e.get(d.IZenZoneService),i=e.get(N.IEditorService),n=e.get(I.IEditorBridgeService),r=e.get(c.IUniverInstanceService),s=e.get(d.ISidebarService);s.visible&&(s.close(),await c.delayAnimationFrame()),t.open();const o=i.getEditor(c.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(o==null)return!1;const a=n.getLatestEditCellState();if(a==null)return!1;const l=(D=a.documentLayoutObject.documentModel)==null?void 0:D.getSnapshot();if(l==null)return!1;r.focusUnit(c.DOCS_ZEN_EDITOR_UNIT_ID_KEY);const{body:f,drawings:m,drawingsOrder:g,tableSource:_,settings:C}=c.Tools.deepClone(l),p={...o.getDocumentData(),body:f,drawings:m,drawingsOrder:g,tableSource:_,settings:C},h=[{startOffset:0,endOffset:0,collapsed:!0}];return o.focus(),o.setDocumentData(p,h),o.clearUndoRedoHistory(),!0}},x={id:"zen-editor.command.cancel-zen-edit",type:c.CommandType.COMMAND,handler:async e=>{const t=e.get(d.IZenZoneService),i=e.get(I.IEditorBridgeService),n=e.get(c.IUniverInstanceService),r=e.get(d.ISidebarService);r.visible&&(r.close(),await c.delayAnimationFrame()),t.close();const s=n.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);return s?(n.focusUnit(s.getUnitId()),i.refreshEditCellState(),!0):!1}},P={id:"zen-editor.command.confirm-zen-edit",type:c.CommandType.COMMAND,handler:async e=>{var f;const t=e.get(d.IZenZoneService),i=e.get(I.IEditorBridgeService),n=e.get(c.IUniverInstanceService),r=e.get(N.IEditorService),s=e.get(d.ISidebarService);s.visible&&(s.close(),await c.delayAnimationFrame()),t.close();const o=r.getEditor(c.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(o==null)return!1;const a=e.get($.IRenderManagerService),l=n.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(l){const m=l.getUnitId(),g=(f=a.getRenderById(m))==null?void 0:f.with(I.EditingRenderController);if(g){const _=c.Tools.deepClone(o.getDocumentData());_.documentStyle.documentFlavor=c.DocumentFlavor.UNSPECIFIED,g.submitCellData(new c.DocumentDataModel(_))}return n.focusUnit(l.getUnitId()),i.refreshEditCellState(),!0}return!1}},X="sheets-zen-editor.config",A={};var u=function(){return u=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u.apply(this,arguments)},J=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i},j=E.forwardRef(function(e,t){var i=e.icon,n=e.id,r=e.className,s=e.extend,o=J(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(r||"").trim(),l=E.useRef("_".concat(te()));return V(i,"".concat(n),{defIds:i.defIds,idSuffix:l.current},u({ref:t,className:a},o),s)});function V(e,t,i,n,r){return E.createElement(e.tag,u(u({key:t},Q(e,i,r)),n),(ee(e,i).children||[]).map(function(s,o){return V(s,"".concat(t,"-").concat(e.tag,"-").concat(o),i,void 0,r)}))}function Q(e,t,i){var n=u({},e.attrs);i!=null&&i.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=i.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(s){var o=s[0],a=s[1];o==="mask"&&typeof a=="string"&&(n[o]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var r=t.defIds;return!r||r.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var o=s[0],a=s[1];typeof a=="string"&&(n[o]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function ee(e,t){var i,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((i=e.children)===null||i===void 0)&&i.length)?u(u({},e),{children:e.children.map(function(r){return typeof r.attrs.id=="string"&&n&&n.indexOf(r.attrs.id)>-1?u(u({},r),{attrs:u(u({},r.attrs),{id:r.attrs.id+t.idSuffix})}):r})}):e}function te(){return Math.random().toString(36).substring(2,8)}j.displayName="UniverIcon";var ne={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"}}]},Y=E.forwardRef(function(e,t){return E.createElement(j,Object.assign({},e,{id:"check-mark-single",ref:t,icon:ne}))});Y.displayName="CheckMarkSingle";var ie={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"}}]},W=E.forwardRef(function(e,t){return E.createElement(j,Object.assign({},e,{id:"close-single",ref:t,icon:ie}))});W.displayName="CloseSingle";class re{constructor(){O(this,"_position",null);O(this,"_position$",new R.BehaviorSubject(null));O(this,"position$",this._position$.asObservable())}dispose(){this._position$.complete(),this._position=null}setPosition(t){this._position=t,this._refresh(t)}getPosition(){return this._position}_refresh(t){this._position$.next(t)}}const k=c.createIdentifier("univer.sheet-zen-editor-manager.service"),oe="univer-zen-editor",se="univer-zen-editor-icon-wrapper",ce="univer-zen-editor-icon-container",ae="univer-zen-editor-icon-success",de="univer-zen-editor-icon-error",le="univer-zen-editor-canvas-container",S={zenEditor:oe,zenEditorIconWrapper:se,zenEditorIconContainer:ce,zenEditorIconSuccess:ae,zenEditorIconError:de,zenEditorCanvasContainer:le},ue="ZEN_EDITOR_PLUGIN_",ge=`${ue}ZEN_EDITOR_COMPONENT`,fe={id:c.DOCS_ZEN_EDITOR_UNIT_ID_KEY,body:{dataStream:`${c.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],tables:[],customBlocks:[],paragraphs:[{startIndex:0}],sectionBreaks:[{startIndex:1}]},tableSource:{},documentStyle:{pageSize:{width:595,height:Number.POSITIVE_INFINITY},documentFlavor:c.DocumentFlavor.MODERN,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,renderConfig:{vertexAngle:0,centerAngle:0}},drawings:{},drawingsOrder:[]};function Ee(){const e=E.useRef(null),t=d.useDependency(k),i=d.useDependency(N.IEditorService),n=d.useDependency(c.ICommandService);E.useEffect(()=>{const o=e.current;if(!o)return;const a=i.register({editorUnitId:c.DOCS_ZEN_EDITOR_UNIT_ID_KEY,initialSnapshot:fe,scrollBar:!0,backScrollOffset:100},o),l=new ResizeObserver(()=>{t.setPosition(o.getBoundingClientRect())});return l.observe(o),()=>{a.dispose(),l.unobserve(o)}},[]);function r(){const o=i.getEditor(c.DOCS_ZEN_EDITOR_UNIT_ID_KEY);o==null||o.blur(),n.executeCommand(x.id)}function s(){const o=i.getEditor(c.DOCS_ZEN_EDITOR_UNIT_ID_KEY);o==null||o.blur(),n.executeCommand(P.id)}return v.jsxs("div",{className:S.zenEditor,children:[v.jsxs("div",{className:S.zenEditorIconWrapper,children:[v.jsx("span",{className:B.clsx(S.zenEditorIconContainer,S.zenEditorIconError),onClick:r,children:v.jsx(W,{style:{fontSize:"22px"}})}),v.jsx("span",{className:B.clsx(S.zenEditorIconContainer,S.zenEditorIconSuccess),onClick:s,children:v.jsx(Y,{style:{fontSize:"22px"}})})]}),v.jsx("div",{className:S.zenEditorCanvasContainer,ref:e})]})}function Ie(e){const t=e.get(I.IEditorBridgeService);return{id:Z.id,type:d.MenuItemType.BUTTON,title:"rightClick.zenEditor",icon:"AmplifySingle",hidden$:I.getCurrentExclusiveRangeInterest$(e),disabled$:t.currentEditCell$.pipe(R.switchMap(i=>I.getCurrentRangeDisable$(e,{workbookTypes:[T.WorkbookEditablePermission],worksheetTypes:[T.WorksheetEditPermission,T.WorksheetSetCellValuePermission,T.WorksheetSetCellStylePermission],rangeTypes:[T.RangeProtectionPermissionEditPoint]}).pipe(R.map(n=>{var r,s,o,a;return n||((a=(o=(s=(r=i==null?void 0:i.documentLayoutObject.documentModel)==null?void 0:r.getBody())==null?void 0:s.customBlocks)==null?void 0:o.length)!=null?a:0)>0}))))}}const _e={[d.ContextMenuPosition.MAIN_AREA]:{[d.ContextMenuGroup.OTHERS]:{[Z.id]:{order:2,menuItemFactory:Ie}}}},he={id:P.id,description:"shortcut.sheet.zen-edit-confirm",group:"4_sheet-edit",preconditions:e=>K(e),binding:d.KeyCode.ENTER|d.MetaKeys.ALT},ve={id:x.id,description:"shortcut.sheet.zen-edit-cancel",group:"4_sheet-edit",preconditions:e=>K(e),binding:d.KeyCode.ESC};function K(e){return e.getContextValue(c.FOCUSING_DOC)&&e.getContextValue(c.FOCUSING_UNIVER_EDITOR)&&e.getContextValue(c.EDITOR_ACTIVATED)&&!e.getContextValue(c.FOCUSING_EDITOR_STANDALONE)}var Se=Object.getOwnPropertyDescriptor,me=(e,t,i,n)=>{for(var r=n>1?void 0:n?Se(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=o(r)||r);return r},b=(e,t)=>(i,n)=>t(i,n,e);let M=class extends c.Disposable{constructor(e,t,i,n){super(),this._zenZoneService=e,this._commandService=t,this._menuManagerService=i,this._shortcutService=n,this._initialize()}_initialize(){this._initCustomComponents(),this._initCommands(),this._initMenus(),this._initShortcuts()}_initCustomComponents(){this.disposeWithMe(this._zenZoneService.set(ge,Ee))}_initCommands(){[Z,x,P].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(_e)}_initShortcuts(){[he,ve].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}};M=me([b(0,d.IZenZoneService),b(1,c.ICommandService),b(2,d.IMenuManagerService),b(3,d.IShortcutService)],M);var Ce=Object.getOwnPropertyDescriptor,pe=(e,t,i,n)=>{for(var r=n>1?void 0:n?Ce(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=o(r)||r);return r},L=(e,t)=>(i,n)=>t(i,n,e);let U=class extends c.RxDisposable{constructor(e,t){super(),this._zenEditorManagerService=e,this._renderManagerService=t,this._initialize()}_initialize(){this._syncZenEditorSize()}_syncZenEditorSize(){this._zenEditorManagerService.position$.pipe(R.takeUntil(this.dispose$)).subscribe(e=>{if(e==null)return;const{width:t,height:i}=e,n=I.getEditorObject(c.DOCS_ZEN_EDITOR_UNIT_ID_KEY,this._renderManagerService);n!=null&&requestIdleCallback(()=>{n.engine.resizeBySize(t,i),this._calculatePagePosition(n),this._scrollToTop()})})}_calculatePagePosition(e){const{document:t,scene:i,docBackground:n}=e,r=i==null?void 0:i.getParent(),{width:s,height:o,pageMarginLeft:a,pageMarginTop:l}=t;if(r==null||s===Number.POSITIVE_INFINITY||o===Number.POSITIVE_INFINITY)return;const{width:f,height:m}=r;let g=0;const _=l;let C=0,y=0,p=Number.POSITIVE_INFINITY;const{scaleX:h,scaleY:D}=i.getAncestorScale();f>(s+a*2)*h?(g=f/2-s*h/2,g/=h,C=(f-a*2)/h,p=0):(g=a,C=s+a*2,p=(C-f/h)/2),m>o?y=(m-l*2)/D:y=o+l*2,i.resize(C,y),t.translate(g,_),n.translate(g,_);const w=i.getViewport(N.VIEWPORT_KEY.VIEW_MAIN);if(p!==Number.POSITIVE_INFINITY&&w!=null){const q=w.transScroll2ViewportScrollValue(p,0).x;w.scrollToBarPos({x:q})}return this}_scrollToTop(){var i;const e=(i=this._renderManagerService.getRenderById(c.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:i.with(N.DocBackScrollRenderController),t={startOffset:0,endOffset:0};e&&e.scrollToRange(t)}};U=pe([L(0,k),L(1,$.IRenderManagerService)],U);var Oe=Object.getOwnPropertyDescriptor,Te=(e,t,i,n)=>{for(var r=n>1?void 0:n?Oe(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=o(r)||r);return r},F=(e,t)=>(i,n)=>t(i,n,e),z;exports.UniverSheetsZenEditorPlugin=(z=class extends c.Plugin{constructor(t=A,i,n){super(),this._config=t,this._injector=i,this._configService=n;const{menu:r,...s}=c.merge({},A,this._config);r&&this._configService.setConfig("menu",r,{merge:!0}),this._configService.setConfig(X,s),this._initializeDependencies(this._injector)}_initializeDependencies(t){[[M],[U],[k,{useClass:re}]].forEach(n=>t.add(n))}onReady(){this._injector.get(M)}onSteady(){this._injector.get(U)}},O(z,"pluginName","SHEET_ZEN_EDITOR_PLUGIN"),O(z,"type",c.UniverInstanceType.UNIVER_SHEET),z);exports.UniverSheetsZenEditorPlugin=Te([F(1,c.Inject(c.Injector)),F(2,c.IConfigService)],exports.UniverSheetsZenEditorPlugin);exports.CancelZenEditCommand=x;exports.ConfirmZenEditCommand=P;exports.OpenZenEditorCommand=Z;
@@ -1 +1 @@
1
- "use strict";const e={shortcut:{sheet:{"zen-edit-cancel":"Cancel Zen Edit","zen-edit-confirm":"Confirm Zen Edit"}}};module.exports=e;
1
+ "use strict";const e={rightClick:{zenEditor:"Full Screen Editor"},shortcut:{sheet:{"zen-edit-cancel":"Cancel Zen Edit","zen-edit-confirm":"Confirm Zen Edit"}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={shortcut:{sheet:{"zen-edit-cancel":"لغو ویرایش Zen","zen-edit-confirm":"تایید ویرایش Zen"}}};module.exports=e;
1
+ "use strict";const e={rightClick:{zenEditor:"ویرایشگر تمام صفحه"},shortcut:{sheet:{"zen-edit-cancel":"لغو ویرایش Zen","zen-edit-confirm":"تایید ویرایش Zen"}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={shortcut:{sheet:{"zen-edit-cancel":"Annuler l'édition plein écran","zen-edit-confirm":"Confirmer l'édition plein écran"}}};module.exports=e;
1
+ "use strict";const e={rightClick:{zenEditor:"Éditeur plein écran"},shortcut:{sheet:{"zen-edit-cancel":"Annuler l'édition plein écran","zen-edit-confirm":"Confirmer l'édition plein écran"}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={shortcut:{sheet:{"zen-edit-cancel":"Отменить Zen редактирование","zen-edit-confirm":"Подтвердить Zen редактирование"}}};module.exports=e;
1
+ "use strict";const e={rightClick:{zenEditor:"Редактор на весь экран"},shortcut:{sheet:{"zen-edit-cancel":"Отменить Zen редактирование","zen-edit-confirm":"Подтвердить Zen редактирование"}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={shortcut:{sheet:{"zen-edit-cancel":"Hủy chỉnh sửa (trạng thái Zen mode)","zen-edit-confirm":"Bỏ chỉnh sửa (trạng thái Zen mode)"}}};module.exports=e;
1
+ "use strict";const e={rightClick:{zenEditor:"Chế độ chỉnh sửa Zen"},shortcut:{sheet:{"zen-edit-cancel":"Hủy chỉnh sửa (trạng thái Zen mode)","zen-edit-confirm":"Bỏ chỉnh sửa (trạng thái Zen mode)"}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={shortcut:{sheet:{"zen-edit-cancel":"取消编辑(禅模式状态)","zen-edit-confirm":"放弃编辑(禅模式状态)"}}};module.exports=e;
1
+ "use strict";const e={rightClick:{zenEditor:"禅模式编辑"},shortcut:{sheet:{"zen-edit-cancel":"取消编辑(禅模式状态)","zen-edit-confirm":"放弃编辑(禅模式状态)"}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={shortcut:{sheet:{"zen-edit-cancel":"取消編輯(禪模式狀態)","zen-edit-confirm":"放棄編輯(禪模式狀態)"}}};module.exports=e;
1
+ "use strict";const e={rightClick:{zenEditor:"禪模式編輯"},shortcut:{sheet:{"zen-edit-cancel":"取消編輯(禪模式狀態)","zen-edit-confirm":"放棄編輯(禪模式狀態)"}}};module.exports=e;
package/lib/es/index.js CHANGED
@@ -1,38 +1,39 @@
1
- var ae = Object.defineProperty;
2
- var le = (e, n, r) => n in e ? ae(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
3
- var E = (e, n, r) => le(e, typeof n != "symbol" ? n + "" : n, r);
4
- import { CommandType as D, IUniverInstanceService as R, delayAnimationFrame as P, DOCS_ZEN_EDITOR_UNIT_ID_KEY as f, Tools as X, UniverInstanceType as x, DocumentFlavor as q, DocumentDataModel as de, createIdentifier as ue, ICommandService as J, DEFAULT_EMPTY_DOCUMENT_VALUE as fe, FOCUSING_DOC as ge, FOCUSING_UNIVER_EDITOR as he, EDITOR_ACTIVATED as me, FOCUSING_EDITOR_STANDALONE as ve, Disposable as pe, RxDisposable as Se, Plugin as Ee, merge as _e, Inject as Ie, Injector as Ce, IConfigService as Oe } from "@univerjs/core";
5
- import { IEditorService as w, VIEWPORT_KEY as ye, DocBackScrollRenderController as Ne } from "@univerjs/docs-ui";
1
+ var ce = Object.defineProperty;
2
+ var ae = (e, t, i) => t in e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
+ var E = (e, t, i) => ae(e, typeof t != "symbol" ? t + "" : t, i);
4
+ import { CommandType as R, IUniverInstanceService as P, delayAnimationFrame as w, DOCS_ZEN_EDITOR_UNIT_ID_KEY as g, Tools as X, UniverInstanceType as x, DocumentFlavor as q, DocumentDataModel as de, createIdentifier as le, ICommandService as J, DEFAULT_EMPTY_DOCUMENT_VALUE as ue, FOCUSING_DOC as ge, FOCUSING_UNIVER_EDITOR as fe, EDITOR_ACTIVATED as he, FOCUSING_EDITOR_STANDALONE as me, Disposable as ve, RxDisposable as pe, Plugin as Se, merge as Ee, Inject as _e, Injector as Ie, IConfigService as Ce } from "@univerjs/core";
5
+ import { IEditorService as k, VIEWPORT_KEY as Oe, DocBackScrollRenderController as ye } from "@univerjs/docs-ui";
6
6
  import { IRenderManagerService as Q } from "@univerjs/engine-render";
7
- import { IEditorBridgeService as U, EditingRenderController as be, getCurrentRangeDisable$ as Te, getCurrentExclusiveRangeInterest$ as ze, getEditorObject as Me } from "@univerjs/sheets-ui";
8
- import { IZenZoneService as T, ISidebarService as k, useDependency as M, MenuItemType as De, ContextMenuPosition as Re, ContextMenuGroup as Pe, KeyCode as ee, MetaKeys as xe, IMenuManagerService as we, IShortcutService as Ue } from "@univerjs/ui";
7
+ import { IEditorBridgeService as b, EditingRenderController as Ne, getCurrentExclusiveRangeInterest$ as Te, getCurrentRangeDisable$ as be, getEditorObject as ze } from "@univerjs/sheets-ui";
8
+ import { IZenZoneService as z, ISidebarService as U, useDependency as D, MenuItemType as Me, ContextMenuPosition as De, ContextMenuGroup as Re, KeyCode as ee, MetaKeys as Pe, IMenuManagerService as we, IShortcutService as xe } from "@univerjs/ui";
9
9
  import { jsxs as F, jsx as _ } from "react/jsx-runtime";
10
+ import { clsx as W } from "@univerjs/design";
10
11
  import { forwardRef as Z, useRef as te, createElement as j, useEffect as ke } from "react";
11
- import { BehaviorSubject as Ze, takeUntil as je } from "rxjs";
12
- import { RangeProtectionPermissionEditPoint as Ae, WorksheetEditPermission as Be, WorksheetSetCellValuePermission as Le, WorksheetSetCellStylePermission as $e, WorkbookEditablePermission as Ve } from "@univerjs/sheets";
13
- const A = {
12
+ import { BehaviorSubject as Ue, switchMap as Ze, map as je, takeUntil as Be } from "rxjs";
13
+ import { RangeProtectionPermissionEditPoint as Le, WorksheetEditPermission as Ae, WorksheetSetCellValuePermission as $e, WorksheetSetCellStylePermission as Ve, WorkbookEditablePermission as Fe } from "@univerjs/sheets";
14
+ const B = {
14
15
  id: "zen-editor.command.open-zen-editor",
15
- type: D.COMMAND,
16
+ type: R.COMMAND,
16
17
  handler: async (e) => {
17
18
  var C;
18
- const n = e.get(T), r = e.get(w), t = e.get(U), i = e.get(R), s = e.get(k);
19
- s.visible && (s.close(), await P()), n.open();
20
- const o = r.getEditor(f);
19
+ const t = e.get(z), i = e.get(k), n = e.get(b), r = e.get(P), s = e.get(U);
20
+ s.visible && (s.close(), await w()), t.open();
21
+ const o = i.getEditor(g);
21
22
  if (o == null)
22
23
  return !1;
23
- const c = t.getLatestEditCellState();
24
+ const c = n.getLatestEditCellState();
24
25
  if (c == null)
25
26
  return !1;
26
27
  const a = (C = c.documentLayoutObject.documentModel) == null ? void 0 : C.getSnapshot();
27
28
  if (a == null)
28
29
  return !1;
29
- i.focusUnit(f);
30
- const { body: u, drawings: v, drawingsOrder: d, tableSource: g, settings: p } = X.deepClone(a), S = {
30
+ r.focusUnit(g);
31
+ const { body: u, drawings: v, drawingsOrder: l, tableSource: f, settings: p } = X.deepClone(a), S = {
31
32
  ...o.getDocumentData(),
32
33
  body: u,
33
34
  drawings: v,
34
- drawingsOrder: d,
35
- tableSource: g,
35
+ drawingsOrder: l,
36
+ tableSource: f,
36
37
  settings: p
37
38
  }, h = [
38
39
  {
@@ -43,144 +44,131 @@ const A = {
43
44
  ];
44
45
  return o.focus(), o.setDocumentData(S, h), o.clearUndoRedoHistory(), !0;
45
46
  }
46
- }, B = {
47
+ }, L = {
47
48
  id: "zen-editor.command.cancel-zen-edit",
48
- type: D.COMMAND,
49
+ type: R.COMMAND,
49
50
  handler: async (e) => {
50
- const n = e.get(T), r = e.get(U), t = e.get(R), i = e.get(k);
51
- i.visible && (i.close(), await P()), n.close();
52
- const s = t.getCurrentUnitForType(x.UNIVER_SHEET);
53
- return s ? (t.focusUnit(s.getUnitId()), r.refreshEditCellState(), !0) : !1;
51
+ const t = e.get(z), i = e.get(b), n = e.get(P), r = e.get(U);
52
+ r.visible && (r.close(), await w()), t.close();
53
+ const s = n.getCurrentUnitForType(x.UNIVER_SHEET);
54
+ return s ? (n.focusUnit(s.getUnitId()), i.refreshEditCellState(), !0) : !1;
54
55
  }
55
- }, L = {
56
+ }, A = {
56
57
  id: "zen-editor.command.confirm-zen-edit",
57
- type: D.COMMAND,
58
+ type: R.COMMAND,
58
59
  handler: async (e) => {
59
60
  var u;
60
- const n = e.get(T), r = e.get(U), t = e.get(R), i = e.get(w), s = e.get(k);
61
- s.visible && (s.close(), await P()), n.close();
62
- const o = i.getEditor(f);
61
+ const t = e.get(z), i = e.get(b), n = e.get(P), r = e.get(k), s = e.get(U);
62
+ s.visible && (s.close(), await w()), t.close();
63
+ const o = r.getEditor(g);
63
64
  if (o == null)
64
65
  return !1;
65
- const c = e.get(Q), a = t.getCurrentUnitForType(x.UNIVER_SHEET);
66
+ const c = e.get(Q), a = n.getCurrentUnitForType(x.UNIVER_SHEET);
66
67
  if (a) {
67
- const v = a.getUnitId(), d = (u = c.getRenderById(v)) == null ? void 0 : u.with(be);
68
- if (d) {
69
- const g = X.deepClone(o.getDocumentData());
70
- g.documentStyle.documentFlavor = q.UNSPECIFIED, d.submitCellData(new de(g));
68
+ const v = a.getUnitId(), l = (u = c.getRenderById(v)) == null ? void 0 : u.with(Ne);
69
+ if (l) {
70
+ const f = X.deepClone(o.getDocumentData());
71
+ f.documentStyle.documentFlavor = q.UNSPECIFIED, l.submitCellData(new de(f));
71
72
  }
72
- return t.focusUnit(a.getUnitId()), r.refreshEditCellState(), !0;
73
+ return n.focusUnit(a.getUnitId()), i.refreshEditCellState(), !0;
73
74
  }
74
75
  return !1;
75
76
  }
76
- }, Fe = "sheets-zen-editor.config", W = {};
77
- var l = function() {
78
- return l = Object.assign || function(e) {
79
- for (var n, r = 1, t = arguments.length; r < t; r++) {
80
- n = arguments[r];
81
- for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
77
+ }, We = "sheets-zen-editor.config", H = {};
78
+ var d = function() {
79
+ return d = Object.assign || function(e) {
80
+ for (var t, i = 1, n = arguments.length; i < n; i++) {
81
+ t = arguments[i];
82
+ for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
82
83
  }
83
84
  return e;
84
- }, l.apply(this, arguments);
85
- }, We = function(e, n) {
86
- var r = {};
87
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
85
+ }, d.apply(this, arguments);
86
+ }, He = function(e, t) {
87
+ var i = {};
88
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (i[n] = e[n]);
88
89
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
89
- for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
90
- n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (r[t[i]] = e[t[i]]);
91
- return r;
92
- }, $ = Z(function(e, n) {
93
- var r = e.icon, t = e.id, i = e.className, s = e.extend, o = We(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(t, " ").concat(i || "").trim(), a = te("_".concat(Ge()));
94
- return ne(r, "".concat(t), { defIds: r.defIds, idSuffix: a.current }, l({ ref: n, className: c }, o), s);
90
+ for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
91
+ t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (i[n[r]] = e[n[r]]);
92
+ return i;
93
+ }, $ = Z(function(e, t) {
94
+ var i = e.icon, n = e.id, r = e.className, s = e.extend, o = He(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), a = te("_".concat(Ke()));
95
+ return ne(i, "".concat(n), { defIds: i.defIds, idSuffix: a.current }, d({ ref: t, className: c }, o), s);
95
96
  });
96
- function ne(e, n, r, t, i) {
97
- return j(e.tag, l(l({ key: n }, He(e, r, i)), t), (Ye(e, r).children || []).map(function(s, o) {
98
- return ne(s, "".concat(n, "-").concat(e.tag, "-").concat(o), r, void 0, i);
97
+ function ne(e, t, i, n, r) {
98
+ return j(e.tag, d(d({ key: t }, Ye(e, i, r)), n), (Ge(e, i).children || []).map(function(s, o) {
99
+ return ne(s, "".concat(t, "-").concat(e.tag, "-").concat(o), i, void 0, r);
99
100
  }));
100
101
  }
101
- function He(e, n, r) {
102
- var t = l({}, e.attrs);
103
- r != null && r.colorChannel1 && t.fill === "colorChannel1" && (t.fill = r.colorChannel1), e.tag === "mask" && t.id && (t.id = t.id + n.idSuffix), Object.entries(t).forEach(function(s) {
102
+ function Ye(e, t, i) {
103
+ var n = d({}, e.attrs);
104
+ i != null && i.colorChannel1 && n.fill === "colorChannel1" && (n.fill = i.colorChannel1), e.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
104
105
  var o = s[0], c = s[1];
105
- o === "mask" && typeof c == "string" && (t[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
106
+ o === "mask" && typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
106
107
  });
107
- var i = n.defIds;
108
- return !i || i.length === 0 || (e.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + n.idSuffix), Object.entries(t).forEach(function(s) {
108
+ var r = t.defIds;
109
+ return !r || r.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(s) {
109
110
  var o = s[0], c = s[1];
110
- typeof c == "string" && (t[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
111
- })), t;
111
+ typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
112
+ })), n;
112
113
  }
113
- function Ye(e, n) {
114
- var r, t = n.defIds;
115
- return !t || t.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? l(l({}, e), { children: e.children.map(function(i) {
116
- return typeof i.attrs.id == "string" && t && t.indexOf(i.attrs.id) > -1 ? l(l({}, i), { attrs: l(l({}, i.attrs), { id: i.attrs.id + n.idSuffix }) }) : i;
114
+ function Ge(e, t) {
115
+ var i, n = t.defIds;
116
+ return !n || n.length === 0 ? e : e.tag === "defs" && (!((i = e.children) === null || i === void 0) && i.length) ? d(d({}, e), { children: e.children.map(function(r) {
117
+ return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? d(d({}, r), { attrs: d(d({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
117
118
  }) }) : e;
118
119
  }
119
- function Ge() {
120
+ function Ke() {
120
121
  return Math.random().toString(36).substring(2, 8);
121
122
  }
122
123
  $.displayName = "UniverIcon";
123
- var Ke = { 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" } }] }, re = Z(function(e, n) {
124
+ var Xe = { 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" } }] }, ie = Z(function(e, t) {
124
125
  return j($, Object.assign({}, e, {
125
126
  id: "check-mark-single",
126
- ref: n,
127
- icon: Ke
127
+ ref: t,
128
+ icon: Xe
128
129
  }));
129
130
  });
130
- re.displayName = "CheckMarkSingle";
131
- var Xe = { 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" } }] }, ie = Z(function(e, n) {
131
+ ie.displayName = "CheckMarkSingle";
132
+ var qe = { 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" } }] }, re = Z(function(e, t) {
132
133
  return j($, Object.assign({}, e, {
133
134
  id: "close-single",
134
- ref: n,
135
- icon: Xe
135
+ ref: t,
136
+ icon: qe
136
137
  }));
137
138
  });
138
- ie.displayName = "CloseSingle";
139
- function oe(e) {
140
- var n, r, t = "";
141
- if (typeof e == "string" || typeof e == "number") t += e;
142
- else if (typeof e == "object") if (Array.isArray(e)) {
143
- var i = e.length;
144
- for (n = 0; n < i; n++) e[n] && (r = oe(e[n])) && (t && (t += " "), t += r);
145
- } else for (r in e) e[r] && (t && (t += " "), t += r);
146
- return t;
147
- }
148
- function H() {
149
- for (var e, n, r = 0, t = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (n = oe(e)) && (t && (t += " "), t += n);
150
- return t;
151
- }
152
- class qe {
139
+ re.displayName = "CloseSingle";
140
+ class Je {
153
141
  constructor() {
154
142
  E(this, "_position", null);
155
- E(this, "_position$", new Ze(null));
143
+ E(this, "_position$", new Ue(null));
156
144
  E(this, "position$", this._position$.asObservable());
157
145
  }
158
146
  dispose() {
159
147
  this._position$.complete(), this._position = null;
160
148
  }
161
- setPosition(n) {
162
- this._position = n, this._refresh(n);
149
+ setPosition(t) {
150
+ this._position = t, this._refresh(t);
163
151
  }
164
152
  getPosition() {
165
153
  return this._position;
166
154
  }
167
- _refresh(n) {
168
- this._position$.next(n);
155
+ _refresh(t) {
156
+ this._position$.next(t);
169
157
  }
170
158
  }
171
- const V = ue(
159
+ const V = le(
172
160
  "univer.sheet-zen-editor-manager.service"
173
- ), Je = "univer-zen-editor", Qe = "univer-zen-editor-icon-wrapper", et = "univer-zen-editor-icon-container", tt = "univer-zen-editor-icon-success", nt = "univer-zen-editor-icon-error", rt = "univer-zen-editor-canvas-container", m = {
174
- zenEditor: Je,
175
- zenEditorIconWrapper: Qe,
176
- zenEditorIconContainer: et,
177
- zenEditorIconSuccess: tt,
178
- zenEditorIconError: nt,
161
+ ), Qe = "univer-zen-editor", et = "univer-zen-editor-icon-wrapper", tt = "univer-zen-editor-icon-container", nt = "univer-zen-editor-icon-success", it = "univer-zen-editor-icon-error", rt = "univer-zen-editor-canvas-container", m = {
162
+ zenEditor: Qe,
163
+ zenEditorIconWrapper: et,
164
+ zenEditorIconContainer: tt,
165
+ zenEditorIconSuccess: nt,
166
+ zenEditorIconError: it,
179
167
  zenEditorCanvasContainer: rt
180
- }, it = "ZEN_EDITOR_PLUGIN_", ot = `${it}ZEN_EDITOR_COMPONENT`, st = {
181
- id: f,
168
+ }, ot = "ZEN_EDITOR_PLUGIN_", st = `${ot}ZEN_EDITOR_COMPONENT`, ct = {
169
+ id: g,
182
170
  body: {
183
- dataStream: `${fe}`,
171
+ dataStream: `${ue}`,
184
172
  textRuns: [],
185
173
  tables: [],
186
174
  customBlocks: [],
@@ -212,109 +200,115 @@ const V = ue(
212
200
  drawings: {},
213
201
  drawingsOrder: []
214
202
  };
215
- function ct() {
216
- const e = te(null), n = M(V), r = M(w), t = M(J);
203
+ function at() {
204
+ const e = te(null), t = D(V), i = D(k), n = D(J);
217
205
  ke(() => {
218
206
  const o = e.current;
219
207
  if (!o)
220
208
  return;
221
- const c = r.register(
209
+ const c = i.register(
222
210
  {
223
- editorUnitId: f,
224
- initialSnapshot: st,
211
+ editorUnitId: g,
212
+ initialSnapshot: ct,
225
213
  scrollBar: !0,
226
214
  backScrollOffset: 100
227
215
  },
228
216
  o
229
217
  ), a = new ResizeObserver(() => {
230
- n.setPosition(o.getBoundingClientRect());
218
+ t.setPosition(o.getBoundingClientRect());
231
219
  });
232
220
  return a.observe(o), () => {
233
221
  c.dispose(), a.unobserve(o);
234
222
  };
235
223
  }, []);
236
- function i() {
237
- const o = r.getEditor(f);
238
- o == null || o.blur(), t.executeCommand(B.id);
224
+ function r() {
225
+ const o = i.getEditor(g);
226
+ o == null || o.blur(), n.executeCommand(L.id);
239
227
  }
240
228
  function s() {
241
- const o = r.getEditor(f);
242
- o == null || o.blur(), t.executeCommand(L.id);
229
+ const o = i.getEditor(g);
230
+ o == null || o.blur(), n.executeCommand(A.id);
243
231
  }
244
232
  return /* @__PURE__ */ F("div", { className: m.zenEditor, children: [
245
233
  /* @__PURE__ */ F("div", { className: m.zenEditorIconWrapper, children: [
246
234
  /* @__PURE__ */ _(
247
235
  "span",
248
236
  {
249
- className: H(m.zenEditorIconContainer, m.zenEditorIconError),
250
- onClick: i,
251
- children: /* @__PURE__ */ _(ie, { style: { fontSize: "22px" } })
237
+ className: W(m.zenEditorIconContainer, m.zenEditorIconError),
238
+ onClick: r,
239
+ children: /* @__PURE__ */ _(re, { style: { fontSize: "22px" } })
252
240
  }
253
241
  ),
254
242
  /* @__PURE__ */ _(
255
243
  "span",
256
244
  {
257
- className: H(m.zenEditorIconContainer, m.zenEditorIconSuccess),
245
+ className: W(m.zenEditorIconContainer, m.zenEditorIconSuccess),
258
246
  onClick: s,
259
- children: /* @__PURE__ */ _(re, { style: { fontSize: "22px" } })
247
+ children: /* @__PURE__ */ _(ie, { style: { fontSize: "22px" } })
260
248
  }
261
249
  )
262
250
  ] }),
263
251
  /* @__PURE__ */ _("div", { className: m.zenEditorCanvasContainer, ref: e })
264
252
  ] });
265
253
  }
266
- function at(e) {
254
+ function dt(e) {
255
+ const t = e.get(b);
267
256
  return {
268
- id: A.id,
269
- type: De.BUTTON,
257
+ id: B.id,
258
+ type: Me.BUTTON,
270
259
  title: "rightClick.zenEditor",
271
260
  icon: "AmplifySingle",
272
- hidden$: ze(e),
273
- disabled$: Te(e, { workbookTypes: [Ve], worksheetTypes: [Be, Le, $e], rangeTypes: [Ae] })
261
+ hidden$: Te(e),
262
+ disabled$: t.currentEditCell$.pipe(
263
+ Ze((i) => be(e, { workbookTypes: [Fe], worksheetTypes: [Ae, $e, Ve], rangeTypes: [Le] }).pipe(je((n) => {
264
+ var r, s, o, c;
265
+ return n || ((c = (o = (s = (r = i == null ? void 0 : i.documentLayoutObject.documentModel) == null ? void 0 : r.getBody()) == null ? void 0 : s.customBlocks) == null ? void 0 : o.length) != null ? c : 0) > 0;
266
+ })))
267
+ )
274
268
  };
275
269
  }
276
270
  const lt = {
277
- [Re.MAIN_AREA]: {
278
- [Pe.OTHERS]: {
279
- [A.id]: {
271
+ [De.MAIN_AREA]: {
272
+ [Re.OTHERS]: {
273
+ [B.id]: {
280
274
  order: 2,
281
- menuItemFactory: at
275
+ menuItemFactory: dt
282
276
  }
283
277
  }
284
278
  }
285
- }, dt = {
286
- id: L.id,
279
+ }, ut = {
280
+ id: A.id,
287
281
  description: "shortcut.sheet.zen-edit-confirm",
288
282
  group: "4_sheet-edit",
289
- preconditions: (e) => se(e),
290
- binding: ee.ENTER | xe.ALT
291
- }, ut = {
292
- id: B.id,
283
+ preconditions: (e) => oe(e),
284
+ binding: ee.ENTER | Pe.ALT
285
+ }, gt = {
286
+ id: L.id,
293
287
  description: "shortcut.sheet.zen-edit-cancel",
294
288
  group: "4_sheet-edit",
295
- preconditions: (e) => se(e),
289
+ preconditions: (e) => oe(e),
296
290
  binding: ee.ESC
297
291
  };
298
- function se(e) {
299
- return e.getContextValue(ge) && e.getContextValue(he) && e.getContextValue(me) && !e.getContextValue(ve);
292
+ function oe(e) {
293
+ return e.getContextValue(ge) && e.getContextValue(fe) && e.getContextValue(he) && !e.getContextValue(me);
300
294
  }
301
- var ft = Object.getOwnPropertyDescriptor, gt = (e, n, r, t) => {
302
- for (var i = t > 1 ? void 0 : t ? ft(n, r) : n, s = e.length - 1, o; s >= 0; s--)
303
- (o = e[s]) && (i = o(i) || i);
304
- return i;
305
- }, O = (e, n) => (r, t) => n(r, t, e);
306
- let N = class extends pe {
307
- constructor(e, n, r, t) {
308
- super(), this._zenZoneService = e, this._commandService = n, this._menuManagerService = r, this._shortcutService = t, this._initialize();
295
+ var ft = Object.getOwnPropertyDescriptor, ht = (e, t, i, n) => {
296
+ for (var r = n > 1 ? void 0 : n ? ft(t, i) : t, s = e.length - 1, o; s >= 0; s--)
297
+ (o = e[s]) && (r = o(r) || r);
298
+ return r;
299
+ }, O = (e, t) => (i, n) => t(i, n, e);
300
+ let N = class extends ve {
301
+ constructor(e, t, i, n) {
302
+ super(), this._zenZoneService = e, this._commandService = t, this._menuManagerService = i, this._shortcutService = n, this._initialize();
309
303
  }
310
304
  _initialize() {
311
305
  this._initCustomComponents(), this._initCommands(), this._initMenus(), this._initShortcuts();
312
306
  }
313
307
  _initCustomComponents() {
314
- this.disposeWithMe(this._zenZoneService.set(ot, ct));
308
+ this.disposeWithMe(this._zenZoneService.set(st, at));
315
309
  }
316
310
  _initCommands() {
317
- [A, B, L].forEach((e) => {
311
+ [B, L, A].forEach((e) => {
318
312
  this.disposeWithMe(this._commandService.registerCommand(e));
319
313
  });
320
314
  }
@@ -322,108 +316,108 @@ let N = class extends pe {
322
316
  this._menuManagerService.mergeMenu(lt);
323
317
  }
324
318
  _initShortcuts() {
325
- [dt, ut].forEach((e) => {
319
+ [ut, gt].forEach((e) => {
326
320
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
327
321
  });
328
322
  }
329
323
  };
330
- N = gt([
331
- O(0, T),
324
+ N = ht([
325
+ O(0, z),
332
326
  O(1, J),
333
327
  O(2, we),
334
- O(3, Ue)
328
+ O(3, xe)
335
329
  ], N);
336
- var ht = Object.getOwnPropertyDescriptor, mt = (e, n, r, t) => {
337
- for (var i = t > 1 ? void 0 : t ? ht(n, r) : n, s = e.length - 1, o; s >= 0; s--)
338
- (o = e[s]) && (i = o(i) || i);
339
- return i;
340
- }, Y = (e, n) => (r, t) => n(r, t, e);
341
- let b = class extends Se {
342
- constructor(e, n) {
343
- super(), this._zenEditorManagerService = e, this._renderManagerService = n, this._initialize();
330
+ var mt = Object.getOwnPropertyDescriptor, vt = (e, t, i, n) => {
331
+ for (var r = n > 1 ? void 0 : n ? mt(t, i) : t, s = e.length - 1, o; s >= 0; s--)
332
+ (o = e[s]) && (r = o(r) || r);
333
+ return r;
334
+ }, Y = (e, t) => (i, n) => t(i, n, e);
335
+ let T = class extends pe {
336
+ constructor(e, t) {
337
+ super(), this._zenEditorManagerService = e, this._renderManagerService = t, this._initialize();
344
338
  }
345
339
  _initialize() {
346
340
  this._syncZenEditorSize();
347
341
  }
348
342
  // Listen to changes in the size of the zen editor container to set the size of the editor.
349
343
  _syncZenEditorSize() {
350
- this._zenEditorManagerService.position$.pipe(je(this.dispose$)).subscribe((e) => {
344
+ this._zenEditorManagerService.position$.pipe(Be(this.dispose$)).subscribe((e) => {
351
345
  if (e == null)
352
346
  return;
353
- const { width: n, height: r } = e, t = Me(f, this._renderManagerService);
354
- t != null && requestIdleCallback(() => {
355
- t.engine.resizeBySize(n, r), this._calculatePagePosition(t), this._scrollToTop();
347
+ const { width: t, height: i } = e, n = ze(g, this._renderManagerService);
348
+ n != null && requestIdleCallback(() => {
349
+ n.engine.resizeBySize(t, i), this._calculatePagePosition(n), this._scrollToTop();
356
350
  });
357
351
  });
358
352
  }
359
353
  _calculatePagePosition(e) {
360
- const { document: n, scene: r, docBackground: t } = e, i = r == null ? void 0 : r.getParent(), { width: s, height: o, pageMarginLeft: c, pageMarginTop: a } = n;
361
- if (i == null || s === Number.POSITIVE_INFINITY || o === Number.POSITIVE_INFINITY)
354
+ const { document: t, scene: i, docBackground: n } = e, r = i == null ? void 0 : i.getParent(), { width: s, height: o, pageMarginLeft: c, pageMarginTop: a } = t;
355
+ if (r == null || s === Number.POSITIVE_INFINITY || o === Number.POSITIVE_INFINITY)
362
356
  return;
363
- const { width: u, height: v } = i;
364
- let d = 0;
365
- const g = a;
357
+ const { width: u, height: v } = r;
358
+ let l = 0;
359
+ const f = a;
366
360
  let p = 0, I = 0, S = Number.POSITIVE_INFINITY;
367
- const { scaleX: h, scaleY: C } = r.getAncestorScale();
368
- u > (s + c * 2) * h ? (d = u / 2 - s * h / 2, d /= h, p = (u - c * 2) / h, S = 0) : (d = c, p = s + c * 2, S = (p - u / h) / 2), v > o ? I = (v - a * 2) / C : I = o + a * 2, r.resize(p, I), n.translate(d, g), t.translate(d, g);
369
- const z = r.getViewport(ye.VIEW_MAIN);
370
- if (S !== Number.POSITIVE_INFINITY && z != null) {
371
- const ce = z.transScroll2ViewportScrollValue(S, 0).x;
372
- z.scrollToBarPos({
373
- x: ce
361
+ const { scaleX: h, scaleY: C } = i.getAncestorScale();
362
+ u > (s + c * 2) * h ? (l = u / 2 - s * h / 2, l /= h, p = (u - c * 2) / h, S = 0) : (l = c, p = s + c * 2, S = (p - u / h) / 2), v > o ? I = (v - a * 2) / C : I = o + a * 2, i.resize(p, I), t.translate(l, f), n.translate(l, f);
363
+ const M = i.getViewport(Oe.VIEW_MAIN);
364
+ if (S !== Number.POSITIVE_INFINITY && M != null) {
365
+ const se = M.transScroll2ViewportScrollValue(S, 0).x;
366
+ M.scrollToBarPos({
367
+ x: se
374
368
  });
375
369
  }
376
370
  return this;
377
371
  }
378
372
  _scrollToTop() {
379
- var r;
380
- const e = (r = this._renderManagerService.getRenderById(f)) == null ? void 0 : r.with(Ne), n = {
373
+ var i;
374
+ const e = (i = this._renderManagerService.getRenderById(g)) == null ? void 0 : i.with(ye), t = {
381
375
  startOffset: 0,
382
376
  endOffset: 0
383
377
  };
384
- e && e.scrollToRange(n);
378
+ e && e.scrollToRange(t);
385
379
  }
386
380
  };
387
- b = mt([
381
+ T = vt([
388
382
  Y(0, V),
389
383
  Y(1, Q)
390
- ], b);
391
- var vt = Object.getOwnPropertyDescriptor, pt = (e, n, r, t) => {
392
- for (var i = t > 1 ? void 0 : t ? vt(n, r) : n, s = e.length - 1, o; s >= 0; s--)
393
- (o = e[s]) && (i = o(i) || i);
394
- return i;
395
- }, G = (e, n) => (r, t) => n(r, t, e), y;
396
- let K = (y = class extends Ee {
397
- constructor(e = W, n, r) {
398
- super(), this._config = e, this._injector = n, this._configService = r;
399
- const { menu: t, ...i } = _e(
384
+ ], T);
385
+ var pt = Object.getOwnPropertyDescriptor, St = (e, t, i, n) => {
386
+ for (var r = n > 1 ? void 0 : n ? pt(t, i) : t, s = e.length - 1, o; s >= 0; s--)
387
+ (o = e[s]) && (r = o(r) || r);
388
+ return r;
389
+ }, G = (e, t) => (i, n) => t(i, n, e), y;
390
+ let K = (y = class extends Se {
391
+ constructor(e = H, t, i) {
392
+ super(), this._config = e, this._injector = t, this._configService = i;
393
+ const { menu: n, ...r } = Ee(
400
394
  {},
401
- W,
395
+ H,
402
396
  this._config
403
397
  );
404
- t && this._configService.setConfig("menu", t, { merge: !0 }), this._configService.setConfig(Fe, i), this._initializeDependencies(this._injector);
398
+ n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(We, r), this._initializeDependencies(this._injector);
405
399
  }
406
400
  _initializeDependencies(e) {
407
401
  [
408
402
  [N],
409
- [b],
410
- [V, { useClass: qe }]
411
- ].forEach((r) => e.add(r));
403
+ [T],
404
+ [V, { useClass: Je }]
405
+ ].forEach((i) => e.add(i));
412
406
  }
413
407
  onReady() {
414
408
  this._injector.get(N);
415
409
  }
416
410
  onSteady() {
417
- this._injector.get(b);
411
+ this._injector.get(T);
418
412
  }
419
413
  }, E(y, "pluginName", "SHEET_ZEN_EDITOR_PLUGIN"), E(y, "type", x.UNIVER_SHEET), y);
420
- K = pt([
421
- G(1, Ie(Ce)),
422
- G(2, Oe)
414
+ K = St([
415
+ G(1, _e(Ie)),
416
+ G(2, Ce)
423
417
  ], K);
424
418
  export {
425
- B as CancelZenEditCommand,
426
- L as ConfirmZenEditCommand,
427
- A as OpenZenEditorCommand,
419
+ L as CancelZenEditCommand,
420
+ A as ConfirmZenEditCommand,
421
+ B as OpenZenEditorCommand,
428
422
  K as UniverSheetsZenEditorPlugin
429
423
  };
@@ -1,4 +1,7 @@
1
1
  const e = {
2
+ rightClick: {
3
+ zenEditor: "Full Screen Editor"
4
+ },
2
5
  shortcut: {
3
6
  sheet: {
4
7
  "zen-edit-cancel": "Cancel Zen Edit",
@@ -1,4 +1,7 @@
1
1
  const e = {
2
+ rightClick: {
3
+ zenEditor: "ویرایشگر تمام صفحه"
4
+ },
2
5
  shortcut: {
3
6
  sheet: {
4
7
  "zen-edit-cancel": "لغو ویرایش Zen",
@@ -1,4 +1,7 @@
1
1
  const e = {
2
+ rightClick: {
3
+ zenEditor: "Éditeur plein écran"
4
+ },
2
5
  shortcut: {
3
6
  sheet: {
4
7
  "zen-edit-cancel": "Annuler l'édition plein écran",
@@ -1,4 +1,7 @@
1
1
  const e = {
2
+ rightClick: {
3
+ zenEditor: "Редактор на весь экран"
4
+ },
2
5
  shortcut: {
3
6
  sheet: {
4
7
  "zen-edit-cancel": "Отменить Zen редактирование",
@@ -1,4 +1,7 @@
1
1
  const e = {
2
+ rightClick: {
3
+ zenEditor: "Chế độ chỉnh sửa Zen"
4
+ },
2
5
  shortcut: {
3
6
  sheet: {
4
7
  "zen-edit-cancel": "Hủy chỉnh sửa (trạng thái Zen mode)",
@@ -1,4 +1,7 @@
1
1
  const e = {
2
+ rightClick: {
3
+ zenEditor: "禅模式编辑"
4
+ },
2
5
  shortcut: {
3
6
  sheet: {
4
7
  "zen-edit-cancel": "取消编辑(禅模式状态)",
@@ -1,4 +1,7 @@
1
1
  const e = {
2
+ rightClick: {
3
+ zenEditor: "禪模式編輯"
4
+ },
2
5
  shortcut: {
3
6
  sheet: {
4
7
  "zen-edit-cancel": "取消編輯(禪模式狀態)",
@@ -5,10 +5,12 @@ import { FWorkbook } from '@univerjs/sheets/facade';
5
5
  export interface IFWorkbookSheetsZenEditorMixin {
6
6
  /**
7
7
  * Start the zen editing process
8
- * @returns A promise that resolves to a boolean indicating whether the zen editing process was started successfully.
8
+ * @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the zen editing process was started successfully.
9
9
  * @example
10
10
  * ```ts
11
- * univerAPI.getActiveWorkbook().startZenEditingAsync();
11
+ * const fWorkbook = univerAPI.getActiveWorkbook();
12
+ * const success = await fWorkbook.startZenEditingAsync();
13
+ * console.log(success);
12
14
  * ```
13
15
  */
14
16
  startZenEditingAsync(): Promise<boolean>;
@@ -16,10 +18,12 @@ export interface IFWorkbookSheetsZenEditorMixin {
16
18
  * End the zen editing process
17
19
  * @async
18
20
  * @param {boolean} save - Whether to save the changes, default is true
19
- * @returns A promise that resolves to a boolean indicating whether the zen editing process was ended successfully.
21
+ * @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the zen editing process was ended successfully.
20
22
  * @example
21
23
  * ```ts
22
- * univerAPI.getActiveWorkbook().endZenEditingAsync(false);
24
+ * const fWorkbook = univerAPI.getActiveWorkbook();
25
+ * const success = await fWorkbook.endZenEditingAsync(false);
26
+ * console.log(success);
23
27
  * ```
24
28
  */
25
29
  endZenEditingAsync(save?: boolean): Promise<boolean>;
@@ -14,6 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  declare const locale: {
17
+ rightClick: {
18
+ zenEditor: string;
19
+ };
17
20
  shortcut: {
18
21
  sheet: {
19
22
  'zen-edit-cancel': string;
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/docs-ui"),require("@univerjs/engine-render"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("rxjs"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs-ui","@univerjs/engine-render","@univerjs/sheets-ui","@univerjs/ui","react/jsx-runtime","react","rxjs","@univerjs/sheets"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverSheetsZenEditor={},c.UniverCore,c.UniverDocsUi,c.UniverEngineRender,c.UniverSheetsUi,c.UniverUi,c.React,c.React,c.rxjs,c.UniverSheets))})(this,function(c,o,g,A,_,l,h,E,B,y){"use strict";var he=Object.defineProperty;var Se=(c,o,g)=>o in c?he(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var N=(c,o,g)=>Se(c,typeof o!="symbol"?o+"":o,g);var P;const D={id:"zen-editor.command.open-zen-editor",type:o.CommandType.COMMAND,handler:async e=>{var j;const t=e.get(l.IZenZoneService),i=e.get(g.IEditorService),n=e.get(_.IEditorBridgeService),r=e.get(o.IUniverInstanceService),a=e.get(l.ISidebarService);a.visible&&(a.close(),await o.delayAnimationFrame()),t.open();const s=i.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(s==null)return!1;const d=n.getLatestEditCellState();if(d==null)return!1;const u=(j=d.documentLayoutObject.documentModel)==null?void 0:j.getSnapshot();if(u==null)return!1;r.focusUnit(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);const{body:I,drawings:p,drawingsOrder:v,tableSource:m,settings:O}=o.Tools.deepClone(u),T={...s.getDocumentData(),body:I,drawings:p,drawingsOrder:v,tableSource:m,settings:O},C=[{startOffset:0,endOffset:0,collapsed:!0}];return s.focus(),s.setDocumentData(T,C),s.clearUndoRedoHistory(),!0}},z={id:"zen-editor.command.cancel-zen-edit",type:o.CommandType.COMMAND,handler:async e=>{const t=e.get(l.IZenZoneService),i=e.get(_.IEditorBridgeService),n=e.get(o.IUniverInstanceService),r=e.get(l.ISidebarService);r.visible&&(r.close(),await o.delayAnimationFrame()),t.close();const a=n.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET);return a?(n.focusUnit(a.getUnitId()),i.refreshEditCellState(),!0):!1}},b={id:"zen-editor.command.confirm-zen-edit",type:o.CommandType.COMMAND,handler:async e=>{var I;const t=e.get(l.IZenZoneService),i=e.get(_.IEditorBridgeService),n=e.get(o.IUniverInstanceService),r=e.get(g.IEditorService),a=e.get(l.ISidebarService);a.visible&&(a.close(),await o.delayAnimationFrame()),t.close();const s=r.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(s==null)return!1;const d=e.get(A.IRenderManagerService),u=n.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET);if(u){const p=u.getUnitId(),v=(I=d.getRenderById(p))==null?void 0:I.with(_.EditingRenderController);if(v){const m=o.Tools.deepClone(s.getDocumentData());m.documentStyle.documentFlavor=o.DocumentFlavor.UNSPECIFIED,v.submitCellData(new o.DocumentDataModel(m))}return n.focusUnit(u.getUnitId()),i.refreshEditCellState(),!0}return!1}},G="sheets-zen-editor.config",L={};var f=function(){return f=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)},X=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i},w=E.forwardRef(function(e,t){var i=e.icon,n=e.id,r=e.className,a=e.extend,s=X(e,["icon","id","className","extend"]),d="univerjs-icon univerjs-icon-".concat(n," ").concat(r||"").trim(),u=E.useRef("_".concat(ee()));return F(i,"".concat(n),{defIds:i.defIds,idSuffix:u.current},f({ref:t,className:d},s),a)});function F(e,t,i,n,r){return E.createElement(e.tag,f(f({key:t},J(e,i,r)),n),(Q(e,i).children||[]).map(function(a,s){return F(a,"".concat(t,"-").concat(e.tag,"-").concat(s),i,void 0,r)}))}function J(e,t,i){var n=f({},e.attrs);i!=null&&i.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=i.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(a){var s=a[0],d=a[1];s==="mask"&&typeof d=="string"&&(n[s]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var r=t.defIds;return!r||r.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(a){var s=a[0],d=a[1];typeof d=="string"&&(n[s]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function Q(e,t){var i,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((i=e.children)===null||i===void 0)&&i.length)?f(f({},e),{children:e.children.map(function(r){return typeof r.attrs.id=="string"&&n&&n.indexOf(r.attrs.id)>-1?f(f({},r),{attrs:f(f({},r.attrs),{id:r.attrs.id+t.idSuffix})}):r})}):e}function ee(){return Math.random().toString(36).substring(2,8)}w.displayName="UniverIcon";var ne={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"}}]},$=E.forwardRef(function(e,t){return E.createElement(w,Object.assign({},e,{id:"check-mark-single",ref:t,icon:ne}))});$.displayName="CheckMarkSingle";var te={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"}}]},V=E.forwardRef(function(e,t){return E.createElement(w,Object.assign({},e,{id:"close-single",ref:t,icon:te}))});V.displayName="CloseSingle";function Y(e){var t,i,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(i=Y(e[t]))&&(n&&(n+=" "),n+=i)}else for(i in e)e[i]&&(n&&(n+=" "),n+=i);return n}function W(){for(var e,t,i=0,n="",r=arguments.length;i<r;i++)(e=arguments[i])&&(t=Y(e))&&(n&&(n+=" "),n+=t);return n}class ie{constructor(){N(this,"_position",null);N(this,"_position$",new B.BehaviorSubject(null));N(this,"position$",this._position$.asObservable())}dispose(){this._position$.complete(),this._position=null}setPosition(t){this._position=t,this._refresh(t)}getPosition(){return this._position}_refresh(t){this._position$.next(t)}}const x=o.createIdentifier("univer.sheet-zen-editor-manager.service"),S={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"},re="ZEN_EDITOR_PLUGIN_ZEN_EDITOR_COMPONENT",oe={id:o.DOCS_ZEN_EDITOR_UNIT_ID_KEY,body:{dataStream:`${o.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],tables:[],customBlocks:[],paragraphs:[{startIndex:0}],sectionBreaks:[{startIndex:1}]},tableSource:{},documentStyle:{pageSize:{width:595,height:Number.POSITIVE_INFINITY},documentFlavor:o.DocumentFlavor.MODERN,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,renderConfig:{vertexAngle:0,centerAngle:0}},drawings:{},drawingsOrder:[]};function se(){const e=E.useRef(null),t=l.useDependency(x),i=l.useDependency(g.IEditorService),n=l.useDependency(o.ICommandService);E.useEffect(()=>{const s=e.current;if(!s)return;const d=i.register({editorUnitId:o.DOCS_ZEN_EDITOR_UNIT_ID_KEY,initialSnapshot:oe,scrollBar:!0,backScrollOffset:100},s),u=new ResizeObserver(()=>{t.setPosition(s.getBoundingClientRect())});return u.observe(s),()=>{d.dispose(),u.unobserve(s)}},[]);function r(){const s=i.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);s==null||s.blur(),n.executeCommand(z.id)}function a(){const s=i.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);s==null||s.blur(),n.executeCommand(b.id)}return h.jsxs("div",{className:S.zenEditor,children:[h.jsxs("div",{className:S.zenEditorIconWrapper,children:[h.jsx("span",{className:W(S.zenEditorIconContainer,S.zenEditorIconError),onClick:r,children:h.jsx(V,{style:{fontSize:"22px"}})}),h.jsx("span",{className:W(S.zenEditorIconContainer,S.zenEditorIconSuccess),onClick:a,children:h.jsx($,{style:{fontSize:"22px"}})})]}),h.jsx("div",{className:S.zenEditorCanvasContainer,ref:e})]})}function ae(e){return{id:D.id,type:l.MenuItemType.BUTTON,title:"rightClick.zenEditor",icon:"AmplifySingle",hidden$:_.getCurrentExclusiveRangeInterest$(e),disabled$:_.getCurrentRangeDisable$(e,{workbookTypes:[y.WorkbookEditablePermission],worksheetTypes:[y.WorksheetEditPermission,y.WorksheetSetCellValuePermission,y.WorksheetSetCellStylePermission],rangeTypes:[y.RangeProtectionPermissionEditPoint]})}}const ce={[l.ContextMenuPosition.MAIN_AREA]:{[l.ContextMenuGroup.OTHERS]:{[D.id]:{order:2,menuItemFactory:ae}}}},de={id:b.id,description:"shortcut.sheet.zen-edit-confirm",group:"4_sheet-edit",preconditions:e=>K(e),binding:l.KeyCode.ENTER|l.MetaKeys.ALT},le={id:z.id,description:"shortcut.sheet.zen-edit-cancel",group:"4_sheet-edit",preconditions:e=>K(e),binding:l.KeyCode.ESC};function K(e){return e.getContextValue(o.FOCUSING_DOC)&&e.getContextValue(o.FOCUSING_UNIVER_EDITOR)&&e.getContextValue(o.EDITOR_ACTIVATED)&&!e.getContextValue(o.FOCUSING_EDITOR_STANDALONE)}var ue=Object.getOwnPropertyDescriptor,fe=(e,t,i,n)=>{for(var r=n>1?void 0:n?ue(t,i):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r},R=(e,t)=>(i,n)=>t(i,n,e);let M=class extends o.Disposable{constructor(e,t,i,n){super(),this._zenZoneService=e,this._commandService=t,this._menuManagerService=i,this._shortcutService=n,this._initialize()}_initialize(){this._initCustomComponents(),this._initCommands(),this._initMenus(),this._initShortcuts()}_initCustomComponents(){this.disposeWithMe(this._zenZoneService.set(re,se))}_initCommands(){[D,z,b].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(ce)}_initShortcuts(){[de,le].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}};M=fe([R(0,l.IZenZoneService),R(1,o.ICommandService),R(2,l.IMenuManagerService),R(3,l.IShortcutService)],M);var ge=Object.getOwnPropertyDescriptor,ve=(e,t,i,n)=>{for(var r=n>1?void 0:n?ge(t,i):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r},H=(e,t)=>(i,n)=>t(i,n,e);let Z=class extends o.RxDisposable{constructor(e,t){super(),this._zenEditorManagerService=e,this._renderManagerService=t,this._initialize()}_initialize(){this._syncZenEditorSize()}_syncZenEditorSize(){this._zenEditorManagerService.position$.pipe(B.takeUntil(this.dispose$)).subscribe(e=>{if(e==null)return;const{width:t,height:i}=e,n=_.getEditorObject(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY,this._renderManagerService);n!=null&&requestIdleCallback(()=>{n.engine.resizeBySize(t,i),this._calculatePagePosition(n),this._scrollToTop()})})}_calculatePagePosition(e){const{document:t,scene:i,docBackground:n}=e,r=i==null?void 0:i.getParent(),{width:a,height:s,pageMarginLeft:d,pageMarginTop:u}=t;if(r==null||a===Number.POSITIVE_INFINITY||s===Number.POSITIVE_INFINITY)return;const{width:I,height:p}=r;let v=0;const m=u;let O=0,U=0,T=Number.POSITIVE_INFINITY;const{scaleX:C,scaleY:j}=i.getAncestorScale();I>(a+d*2)*C?(v=I/2-a*C/2,v/=C,O=(I-d*2)/C,T=0):(v=d,O=a+d*2,T=(O-I/C)/2),p>s?U=(p-u*2)/j:U=s+u*2,i.resize(O,U),t.translate(v,m),n.translate(v,m);const k=i.getViewport(g.VIEWPORT_KEY.VIEW_MAIN);if(T!==Number.POSITIVE_INFINITY&&k!=null){const _e=k.transScroll2ViewportScrollValue(T,0).x;k.scrollToBarPos({x:_e})}return this}_scrollToTop(){var i;const e=(i=this._renderManagerService.getRenderById(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:i.with(g.DocBackScrollRenderController),t={startOffset:0,endOffset:0};e&&e.scrollToRange(t)}};Z=ve([H(0,x),H(1,A.IRenderManagerService)],Z);var Ee=Object.getOwnPropertyDescriptor,Ie=(e,t,i,n)=>{for(var r=n>1?void 0:n?Ee(t,i):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r},q=(e,t)=>(i,n)=>t(i,n,e);c.UniverSheetsZenEditorPlugin=(P=class extends o.Plugin{constructor(t=L,i,n){super(),this._config=t,this._injector=i,this._configService=n;const{menu:r,...a}=o.merge({},L,this._config);r&&this._configService.setConfig("menu",r,{merge:!0}),this._configService.setConfig(G,a),this._initializeDependencies(this._injector)}_initializeDependencies(t){[[M],[Z],[x,{useClass:ie}]].forEach(n=>t.add(n))}onReady(){this._injector.get(M)}onSteady(){this._injector.get(Z)}},N(P,"pluginName","SHEET_ZEN_EDITOR_PLUGIN"),N(P,"type",o.UniverInstanceType.UNIVER_SHEET),P),c.UniverSheetsZenEditorPlugin=Ie([q(1,o.Inject(o.Injector)),q(2,o.IConfigService)],c.UniverSheetsZenEditorPlugin),c.CancelZenEditCommand=z,c.ConfirmZenEditCommand=b,c.OpenZenEditorCommand=D,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/docs-ui"),require("@univerjs/engine-render"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("rxjs"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs-ui","@univerjs/engine-render","@univerjs/sheets-ui","@univerjs/ui","react/jsx-runtime","@univerjs/design","react","rxjs","@univerjs/sheets"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverSheetsZenEditor={},c.UniverCore,c.UniverDocsUi,c.UniverEngineRender,c.UniverSheetsUi,c.UniverUi,c.React,c.UniverDesign,c.React,c.rxjs,c.UniverSheets))})(this,function(c,o,g,A,_,l,S,L,E,D,y){"use strict";var _e=Object.defineProperty;var Se=(c,o,g)=>o in c?_e(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var N=(c,o,g)=>Se(c,typeof o!="symbol"?o+"":o,g);var U;const z={id:"zen-editor.command.open-zen-editor",type:o.CommandType.COMMAND,handler:async e=>{var w;const t=e.get(l.IZenZoneService),i=e.get(g.IEditorService),n=e.get(_.IEditorBridgeService),r=e.get(o.IUniverInstanceService),a=e.get(l.ISidebarService);a.visible&&(a.close(),await o.delayAnimationFrame()),t.open();const s=i.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(s==null)return!1;const d=n.getLatestEditCellState();if(d==null)return!1;const u=(w=d.documentLayoutObject.documentModel)==null?void 0:w.getSnapshot();if(u==null)return!1;r.focusUnit(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);const{body:I,drawings:p,drawingsOrder:v,tableSource:m,settings:O}=o.Tools.deepClone(u),T={...s.getDocumentData(),body:I,drawings:p,drawingsOrder:v,tableSource:m,settings:O},C=[{startOffset:0,endOffset:0,collapsed:!0}];return s.focus(),s.setDocumentData(T,C),s.clearUndoRedoHistory(),!0}},b={id:"zen-editor.command.cancel-zen-edit",type:o.CommandType.COMMAND,handler:async e=>{const t=e.get(l.IZenZoneService),i=e.get(_.IEditorBridgeService),n=e.get(o.IUniverInstanceService),r=e.get(l.ISidebarService);r.visible&&(r.close(),await o.delayAnimationFrame()),t.close();const a=n.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET);return a?(n.focusUnit(a.getUnitId()),i.refreshEditCellState(),!0):!1}},M={id:"zen-editor.command.confirm-zen-edit",type:o.CommandType.COMMAND,handler:async e=>{var I;const t=e.get(l.IZenZoneService),i=e.get(_.IEditorBridgeService),n=e.get(o.IUniverInstanceService),r=e.get(g.IEditorService),a=e.get(l.ISidebarService);a.visible&&(a.close(),await o.delayAnimationFrame()),t.close();const s=r.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(s==null)return!1;const d=e.get(A.IRenderManagerService),u=n.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET);if(u){const p=u.getUnitId(),v=(I=d.getRenderById(p))==null?void 0:I.with(_.EditingRenderController);if(v){const m=o.Tools.deepClone(s.getDocumentData());m.documentStyle.documentFlavor=o.DocumentFlavor.UNSPECIFIED,v.submitCellData(new o.DocumentDataModel(m))}return n.focusUnit(u.getUnitId()),i.refreshEditCellState(),!0}return!1}},H="sheets-zen-editor.config",F={};var f=function(){return f=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)},G=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i},x=E.forwardRef(function(e,t){var i=e.icon,n=e.id,r=e.className,a=e.extend,s=G(e,["icon","id","className","extend"]),d="univerjs-icon univerjs-icon-".concat(n," ").concat(r||"").trim(),u=E.useRef("_".concat(Q()));return $(i,"".concat(n),{defIds:i.defIds,idSuffix:u.current},f({ref:t,className:d},s),a)});function $(e,t,i,n,r){return E.createElement(e.tag,f(f({key:t},X(e,i,r)),n),(J(e,i).children||[]).map(function(a,s){return $(a,"".concat(t,"-").concat(e.tag,"-").concat(s),i,void 0,r)}))}function X(e,t,i){var n=f({},e.attrs);i!=null&&i.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=i.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(a){var s=a[0],d=a[1];s==="mask"&&typeof d=="string"&&(n[s]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var r=t.defIds;return!r||r.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(a){var s=a[0],d=a[1];typeof d=="string"&&(n[s]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function J(e,t){var i,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((i=e.children)===null||i===void 0)&&i.length)?f(f({},e),{children:e.children.map(function(r){return typeof r.attrs.id=="string"&&n&&n.indexOf(r.attrs.id)>-1?f(f({},r),{attrs:f(f({},r.attrs),{id:r.attrs.id+t.idSuffix})}):r})}):e}function Q(){return Math.random().toString(36).substring(2,8)}x.displayName="UniverIcon";var ee={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"}}]},V=E.forwardRef(function(e,t){return E.createElement(x,Object.assign({},e,{id:"check-mark-single",ref:t,icon:ee}))});V.displayName="CheckMarkSingle";var ne={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"}}]},Y=E.forwardRef(function(e,t){return E.createElement(x,Object.assign({},e,{id:"close-single",ref:t,icon:ne}))});Y.displayName="CloseSingle";class te{constructor(){N(this,"_position",null);N(this,"_position$",new D.BehaviorSubject(null));N(this,"position$",this._position$.asObservable())}dispose(){this._position$.complete(),this._position=null}setPosition(t){this._position=t,this._refresh(t)}getPosition(){return this._position}_refresh(t){this._position$.next(t)}}const k=o.createIdentifier("univer.sheet-zen-editor-manager.service"),h={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"},ie="ZEN_EDITOR_PLUGIN_ZEN_EDITOR_COMPONENT",re={id:o.DOCS_ZEN_EDITOR_UNIT_ID_KEY,body:{dataStream:`${o.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],tables:[],customBlocks:[],paragraphs:[{startIndex:0}],sectionBreaks:[{startIndex:1}]},tableSource:{},documentStyle:{pageSize:{width:595,height:Number.POSITIVE_INFINITY},documentFlavor:o.DocumentFlavor.MODERN,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,renderConfig:{vertexAngle:0,centerAngle:0}},drawings:{},drawingsOrder:[]};function oe(){const e=E.useRef(null),t=l.useDependency(k),i=l.useDependency(g.IEditorService),n=l.useDependency(o.ICommandService);E.useEffect(()=>{const s=e.current;if(!s)return;const d=i.register({editorUnitId:o.DOCS_ZEN_EDITOR_UNIT_ID_KEY,initialSnapshot:re,scrollBar:!0,backScrollOffset:100},s),u=new ResizeObserver(()=>{t.setPosition(s.getBoundingClientRect())});return u.observe(s),()=>{d.dispose(),u.unobserve(s)}},[]);function r(){const s=i.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);s==null||s.blur(),n.executeCommand(b.id)}function a(){const s=i.getEditor(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY);s==null||s.blur(),n.executeCommand(M.id)}return S.jsxs("div",{className:h.zenEditor,children:[S.jsxs("div",{className:h.zenEditorIconWrapper,children:[S.jsx("span",{className:L.clsx(h.zenEditorIconContainer,h.zenEditorIconError),onClick:r,children:S.jsx(Y,{style:{fontSize:"22px"}})}),S.jsx("span",{className:L.clsx(h.zenEditorIconContainer,h.zenEditorIconSuccess),onClick:a,children:S.jsx(V,{style:{fontSize:"22px"}})})]}),S.jsx("div",{className:h.zenEditorCanvasContainer,ref:e})]})}function se(e){const t=e.get(_.IEditorBridgeService);return{id:z.id,type:l.MenuItemType.BUTTON,title:"rightClick.zenEditor",icon:"AmplifySingle",hidden$:_.getCurrentExclusiveRangeInterest$(e),disabled$:t.currentEditCell$.pipe(D.switchMap(i=>_.getCurrentRangeDisable$(e,{workbookTypes:[y.WorkbookEditablePermission],worksheetTypes:[y.WorksheetEditPermission,y.WorksheetSetCellValuePermission,y.WorksheetSetCellStylePermission],rangeTypes:[y.RangeProtectionPermissionEditPoint]}).pipe(D.map(n=>{var r,a,s,d;return n||((d=(s=(a=(r=i==null?void 0:i.documentLayoutObject.documentModel)==null?void 0:r.getBody())==null?void 0:a.customBlocks)==null?void 0:s.length)!=null?d:0)>0}))))}}const ae={[l.ContextMenuPosition.MAIN_AREA]:{[l.ContextMenuGroup.OTHERS]:{[z.id]:{order:2,menuItemFactory:se}}}},ce={id:M.id,description:"shortcut.sheet.zen-edit-confirm",group:"4_sheet-edit",preconditions:e=>W(e),binding:l.KeyCode.ENTER|l.MetaKeys.ALT},de={id:b.id,description:"shortcut.sheet.zen-edit-cancel",group:"4_sheet-edit",preconditions:e=>W(e),binding:l.KeyCode.ESC};function W(e){return e.getContextValue(o.FOCUSING_DOC)&&e.getContextValue(o.FOCUSING_UNIVER_EDITOR)&&e.getContextValue(o.EDITOR_ACTIVATED)&&!e.getContextValue(o.FOCUSING_EDITOR_STANDALONE)}var le=Object.getOwnPropertyDescriptor,ue=(e,t,i,n)=>{for(var r=n>1?void 0:n?le(t,i):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r},R=(e,t)=>(i,n)=>t(i,n,e);let Z=class extends o.Disposable{constructor(e,t,i,n){super(),this._zenZoneService=e,this._commandService=t,this._menuManagerService=i,this._shortcutService=n,this._initialize()}_initialize(){this._initCustomComponents(),this._initCommands(),this._initMenus(),this._initShortcuts()}_initCustomComponents(){this.disposeWithMe(this._zenZoneService.set(ie,oe))}_initCommands(){[z,b,M].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(ae)}_initShortcuts(){[ce,de].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}};Z=ue([R(0,l.IZenZoneService),R(1,o.ICommandService),R(2,l.IMenuManagerService),R(3,l.IShortcutService)],Z);var fe=Object.getOwnPropertyDescriptor,ge=(e,t,i,n)=>{for(var r=n>1?void 0:n?fe(t,i):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r},K=(e,t)=>(i,n)=>t(i,n,e);let P=class extends o.RxDisposable{constructor(e,t){super(),this._zenEditorManagerService=e,this._renderManagerService=t,this._initialize()}_initialize(){this._syncZenEditorSize()}_syncZenEditorSize(){this._zenEditorManagerService.position$.pipe(D.takeUntil(this.dispose$)).subscribe(e=>{if(e==null)return;const{width:t,height:i}=e,n=_.getEditorObject(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY,this._renderManagerService);n!=null&&requestIdleCallback(()=>{n.engine.resizeBySize(t,i),this._calculatePagePosition(n),this._scrollToTop()})})}_calculatePagePosition(e){const{document:t,scene:i,docBackground:n}=e,r=i==null?void 0:i.getParent(),{width:a,height:s,pageMarginLeft:d,pageMarginTop:u}=t;if(r==null||a===Number.POSITIVE_INFINITY||s===Number.POSITIVE_INFINITY)return;const{width:I,height:p}=r;let v=0;const m=u;let O=0,j=0,T=Number.POSITIVE_INFINITY;const{scaleX:C,scaleY:w}=i.getAncestorScale();I>(a+d*2)*C?(v=I/2-a*C/2,v/=C,O=(I-d*2)/C,T=0):(v=d,O=a+d*2,T=(O-I/C)/2),p>s?j=(p-u*2)/w:j=s+u*2,i.resize(O,j),t.translate(v,m),n.translate(v,m);const B=i.getViewport(g.VIEWPORT_KEY.VIEW_MAIN);if(T!==Number.POSITIVE_INFINITY&&B!=null){const Ie=B.transScroll2ViewportScrollValue(T,0).x;B.scrollToBarPos({x:Ie})}return this}_scrollToTop(){var i;const e=(i=this._renderManagerService.getRenderById(o.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:i.with(g.DocBackScrollRenderController),t={startOffset:0,endOffset:0};e&&e.scrollToRange(t)}};P=ge([K(0,k),K(1,A.IRenderManagerService)],P);var ve=Object.getOwnPropertyDescriptor,Ee=(e,t,i,n)=>{for(var r=n>1?void 0:n?ve(t,i):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r},q=(e,t)=>(i,n)=>t(i,n,e);c.UniverSheetsZenEditorPlugin=(U=class extends o.Plugin{constructor(t=F,i,n){super(),this._config=t,this._injector=i,this._configService=n;const{menu:r,...a}=o.merge({},F,this._config);r&&this._configService.setConfig("menu",r,{merge:!0}),this._configService.setConfig(H,a),this._initializeDependencies(this._injector)}_initializeDependencies(t){[[Z],[P],[k,{useClass:te}]].forEach(n=>t.add(n))}onReady(){this._injector.get(Z)}onSteady(){this._injector.get(P)}},N(U,"pluginName","SHEET_ZEN_EDITOR_PLUGIN"),N(U,"type",o.UniverInstanceType.UNIVER_SHEET),U),c.UniverSheetsZenEditorPlugin=Ee([q(1,o.Inject(o.Injector)),q(2,o.IConfigService)],c.UniverSheetsZenEditorPlugin),c.CancelZenEditCommand=b,c.ConfirmZenEditCommand=M,c.OpenZenEditorCommand=z,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorEnUS=n())})(this,function(){"use strict";return{shortcut:{sheet:{"zen-edit-cancel":"Cancel Zen Edit","zen-edit-confirm":"Confirm Zen Edit"}}}});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorEnUS=n())})(this,function(){"use strict";return{rightClick:{zenEditor:"Full Screen Editor"},shortcut:{sheet:{"zen-edit-cancel":"Cancel Zen Edit","zen-edit-confirm":"Confirm Zen Edit"}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorFaIR=n())})(this,function(){"use strict";return{shortcut:{sheet:{"zen-edit-cancel":"لغو ویرایش Zen","zen-edit-confirm":"تایید ویرایش Zen"}}}});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorFaIR=n())})(this,function(){"use strict";return{rightClick:{zenEditor:"ویرایشگر تمام صفحه"},shortcut:{sheet:{"zen-edit-cancel":"لغو ویرایش Zen","zen-edit-confirm":"تایید ویرایش Zen"}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorFrFR=n())})(this,function(){"use strict";return{shortcut:{sheet:{"zen-edit-cancel":"Annuler l'édition plein écran","zen-edit-confirm":"Confirmer l'édition plein écran"}}}});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorFrFR=n())})(this,function(){"use strict";return{rightClick:{zenEditor:"Éditeur plein écran"},shortcut:{sheet:{"zen-edit-cancel":"Annuler l'édition plein écran","zen-edit-confirm":"Confirmer l'édition plein écran"}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorRuRU=n())})(this,function(){"use strict";return{shortcut:{sheet:{"zen-edit-cancel":"Отменить Zen редактирование","zen-edit-confirm":"Подтвердить Zen редактирование"}}}});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorRuRU=n())})(this,function(){"use strict";return{rightClick:{zenEditor:"Редактор на весь экран"},shortcut:{sheet:{"zen-edit-cancel":"Отменить Zen редактирование","zen-edit-confirm":"Подтвердить Zen редактирование"}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorViVN=n())})(this,function(){"use strict";return{shortcut:{sheet:{"zen-edit-cancel":"Hủy chỉnh sửa (trạng thái Zen mode)","zen-edit-confirm":"Bỏ chỉnh sửa (trạng thái Zen mode)"}}}});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorViVN=n())})(this,function(){"use strict";return{rightClick:{zenEditor:"Chế độ chỉnh sửa Zen"},shortcut:{sheet:{"zen-edit-cancel":"Hủy chỉnh sửa (trạng thái Zen mode)","zen-edit-confirm":"Bỏ chỉnh sửa (trạng thái Zen mode)"}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorZhCN=n())})(this,function(){"use strict";return{shortcut:{sheet:{"zen-edit-cancel":"取消编辑(禅模式状态)","zen-edit-confirm":"放弃编辑(禅模式状态)"}}}});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorZhCN=n())})(this,function(){"use strict";return{rightClick:{zenEditor:"禅模式编辑"},shortcut:{sheet:{"zen-edit-cancel":"取消编辑(禅模式状态)","zen-edit-confirm":"放弃编辑(禅模式状态)"}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorZhTW=n())})(this,function(){"use strict";return{shortcut:{sheet:{"zen-edit-cancel":"取消編輯(禪模式狀態)","zen-edit-confirm":"放棄編輯(禪模式狀態)"}}}});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsZenEditorZhTW=n())})(this,function(){"use strict";return{rightClick:{zenEditor:"禪模式編輯"},shortcut:{sheet:{"zen-edit-cancel":"取消編輯(禪模式狀態)","zen-edit-confirm":"放棄編輯(禪模式狀態)"}}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-zen-editor",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "private": false,
5
5
  "description": "Zen Editor plugin for Univer Sheets.",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -60,14 +60,14 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@univerjs/icons": "^0.2.20",
63
- "clsx": "^2.1.1",
64
- "@univerjs/docs": "0.6.1",
65
- "@univerjs/docs-ui": "0.6.1",
66
- "@univerjs/core": "0.6.1",
67
- "@univerjs/sheets": "0.6.1",
68
- "@univerjs/engine-render": "0.6.1",
69
- "@univerjs/sheets-ui": "0.6.1",
70
- "@univerjs/ui": "0.6.1"
63
+ "@univerjs/core": "0.6.2",
64
+ "@univerjs/design": "0.6.2",
65
+ "@univerjs/docs": "0.6.2",
66
+ "@univerjs/docs-ui": "0.6.2",
67
+ "@univerjs/sheets": "0.6.2",
68
+ "@univerjs/sheets-ui": "0.6.2",
69
+ "@univerjs/engine-render": "0.6.2",
70
+ "@univerjs/ui": "0.6.2"
71
71
  },
72
72
  "devDependencies": {
73
73
  "less": "^4.2.2",
@@ -76,9 +76,9 @@
76
76
  "rxjs": "^7.8.1",
77
77
  "tailwindcss": "^3.4.17",
78
78
  "typescript": "^5.7.3",
79
- "vite": "^6.1.1",
80
- "vitest": "^3.0.6",
81
- "@univerjs-infra/shared": "0.6.1"
79
+ "vite": "^6.2.0",
80
+ "vitest": "^3.0.7",
81
+ "@univerjs-infra/shared": "0.6.2"
82
82
  },
83
83
  "scripts": {
84
84
  "test": "vitest run",