@univerjs/action-recorder 0.7.0 → 0.8.0-beta.0

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 z=Object.defineProperty;var H=(e,n,r)=>n in e?z(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var S=(e,n,r)=>H(e,typeof n!="symbol"?n+"":n,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@univerjs/core"),a=require("@univerjs/sheets"),M=require("@univerjs/sheets-filter"),l=require("@univerjs/sheets-ui"),d=require("@univerjs/ui"),O=require("rxjs"),C=require("@univerjs/design"),f=require("react/jsx-runtime"),h=require("react");var g=function(){return g=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},g.apply(this,arguments)},J=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},E=h.forwardRef(function(e,n){var r=e.icon,t=e.id,i=e.className,o=e.extend,c=J(e,["icon","id","className","extend"]),m="univerjs-icon univerjs-icon-".concat(t," ").concat(i||"").trim(),u=h.useRef("_".concat(K()));return L(r,"".concat(t),{defIds:r.defIds,idSuffix:u.current},g({ref:n,className:m},c),o)});function L(e,n,r,t,i){return h.createElement(e.tag,g(g({key:n},G(e,r,i)),t),(Z(e,r).children||[]).map(function(o,c){return L(o,"".concat(n,"-").concat(e.tag,"-").concat(c),r,void 0,i)}))}function G(e,n,r){var t=g({},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(o){var c=o[0],m=o[1];c==="mask"&&typeof m=="string"&&(t[c]=m.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(o){var c=o[0],m=o[1];typeof m=="string"&&(t[c]=m.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function Z(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)?g(g({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&t&&t.indexOf(i.attrs.id)>-1?g(g({},i),{attrs:g(g({},i.attrs),{id:i.attrs.id+n.idSuffix})}):i})}):e}function K(){return Math.random().toString(36).substring(2,8)}E.displayName="UniverIcon";var Y={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#record-single_clip0_1559_19)"},children:[{tag:"path",attrs:{d:"M7.60303 10C8.7076 10 9.60303 9.10457 9.60303 8C9.60303 6.89543 8.7076 6 7.60303 6C6.49846 6 5.60303 6.89543 5.60303 8C5.60303 9.10457 6.49846 10 7.60303 10Z"}},{tag:"path",attrs:{d:"M1.66943 5.29023C1.66941 3.85426 2.83349 2.69017 4.26946 2.69019L10.9362 2.69026C12.3192 2.69028 13.45 3.77008 13.5315 5.13259L14.5692 4.55638C15.3024 4.14929 16.2032 4.67947 16.2032 5.51809V10.4819C16.2032 11.3205 15.3024 11.8507 14.5692 11.4436L13.5315 10.8674C13.45 12.2299 12.3192 13.3097 10.9362 13.3097H4.26953C2.83361 13.3097 1.66956 12.1457 1.66953 10.7098L1.66943 5.29023ZM13.5362 9.49743L15.0032 10.312V5.68799L13.5362 6.50254V9.49743ZM4.26945 3.89019C3.49623 3.89018 2.86942 4.517 2.86943 5.29021L2.86953 10.7098C2.86955 11.483 3.49634 12.1097 4.26953 12.1097H10.9362C11.7094 12.1097 12.3362 11.4829 12.3362 10.7097V5.29026C12.3362 4.51707 11.7094 3.89027 10.9362 3.89026L4.26945 3.89019Z",fillRule:"evenodd",clipRule:"evenodd"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"record-single_clip0_1559_19"},children:[{tag:"path",attrs:{fill:"#fff",d:"M0 0H16V16H0z",transform:"translate(.94)"}}]}]}],defIds:["record-single_clip0_1559_19"]},T=h.forwardRef(function(e,n){return h.createElement(E,Object.assign({},e,{id:"record-single",ref:n,icon:Y}))});T.displayName="RecordSingle";var Q=Object.getOwnPropertyDescriptor,X=(e,n,r,t)=>{for(var i=t>1?void 0:t?Q(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},A=(e,n)=>(r,t)=>n(r,t,e);exports.ActionRecorderService=class extends s.Disposable{constructor(r,t,i,o){super();S(this,"_shouldRecordCommands",new Set);S(this,"_panelOpened$",new O.BehaviorSubject(!1));S(this,"panelOpened$",this._panelOpened$.asObservable());S(this,"_recorder",null);S(this,"_recording$",new O.BehaviorSubject(!1));S(this,"recording$",this._recording$.asObservable());S(this,"_recorded$",new O.BehaviorSubject([]));S(this,"_recordedCommands$",new O.BehaviorSubject([]));S(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=r,this._logService=t,this._localFileService=i,this._instanceService=o}get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}registerRecordedCommand(r){if(r.type===s.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(r.id)}togglePanel(r){this._panelOpened$.next(r),r===!1&&this.stopRecording()}startRecording(r=!1){this._recorder=this._commandSrv.onCommandExecuted(t=>{var i,o;if(this._shouldRecordCommands.has(t.id)){const c=this._recorded,m=this._recordedCommands;let u={...t};const y=(i=this._instanceService.getFocusedUnit())==null?void 0:i.getUnitId(),{unitId:p=y,subUnitId:v}=u==null?void 0:u.params;if(r&&p&&v){const x=(o=this._instanceService.getUnit(p).getSheetBySheetId(v))==null?void 0:o.getName();u={...u,params:{...u.params,subUnitId:x}}}u.id===a.SetSelectionsOperation.id&&c.length>0&&c[c.length-1].id===a.SetSelectionsOperation.id?c[c.length-1]=u:(c.push(u),this._recorded$.next(c),u.type===s.CommandType.COMMAND&&(m.push(u),this._recordedCommands$.next(m)))}}),this._recording$.next(!0)}stopRecording(){var r;(r=this._recorder)==null||r.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const r=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(r,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",r),this.stopRecording()}};exports.ActionRecorderService=X([A(0,s.ICommandService),A(1,s.ILogService),A(2,d.ILocalFileService),A(3,s.IUniverInstanceService)],exports.ActionRecorderService);const B={id:"action-recorder.command.start-recording",type:s.CommandType.COMMAND,handler:(e,n)=>(e.get(exports.ActionRecorderService).startRecording(!!(n!=null&&n.replaceId)),!0)},k={id:"action-recorder.command.complete-recording",type:s.CommandType.COMMAND,handler:e=>(e.get(exports.ActionRecorderService).completeRecording(),!0)},V={id:"action-recorder.command.stop-recording",type:s.CommandType.COMMAND,handler:e=>(e.get(exports.ActionRecorderService).completeRecording(),!0)};var ee=Object.getOwnPropertyDescriptor,re=(e,n,r,t)=>{for(var i=t>1?void 0:t?ee(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},I=(e,n)=>(r,t)=>n(r,t,e),U=(e=>(e.DEFAULT="default",e.NAME="name",e.ACTIVE="active",e))(U||{});exports.ActionReplayService=class extends s.Disposable{constructor(n,r,t,i,o){super(),this._messageService=n,this._instanceService=r,this._localFileService=t,this._logService=i,this._commandService=o}async replayLocalJSON(n="default"){const r=await this._localFileService.openFile({multiple:!1,accept:".json"});if(r.length!==1)return!1;const t=r[0];try{return this.replayCommands(JSON.parse(await t.text()),{mode:n})}catch{return this._messageService.show({type:C.MessageType.Error,content:`Failed to replay commands from local file ${t.name}.`}),!1}}async replayCommands(n,r){var o,c,m;const t=(o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId();t||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode:i}=r||{};for(const u of n){const{id:y,params:p}=u,v=p;if(v){if(typeof v.unitId<"u"&&(v.unitId=t),i==="name"&&v.subUnitId!=="undefined"){const R=(c=this._instanceService.getFocusedUnit().getSheetBySheetName(v.subUnitId))==null?void 0:c.getSheetId();R?v.subUnitId=R:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${v.subUnitId}`)}if(i==="active"&&v.subUnitId!=="undefined"){const R=(m=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:m.getSheetId();R?v.subUnitId=R:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(y,p))return!1}else if(!await this._commandService.executeCommand(y))return!1}return!0}async replayCommandsWithDelay(n){var t;const r=(t=this._instanceService.getFocusedUnit())==null?void 0:t.getUnitId();r||this._logService.error("[ReplayService]","no focused unit to replay commands");for(const i of n){await s.awaitTime(te());const{id:o,params:c}=i;if(c){if(typeof c.unitId<"u"&&(c.unitId=r),!await this._commandService.executeCommand(o,c))return!1}else if(!await this._commandService.executeCommand(o))return!1}return!0}};exports.ActionReplayService=re([I(0,d.IMessageService),I(1,s.IUniverInstanceService),I(2,d.ILocalFileService),I(3,s.ILogService),I(4,s.ICommandService)],exports.ActionReplayService);function te(){return Math.floor(Math.random()*800)+200}const N={id:"action-recorder.command.replay-local-records",type:s.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON();return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},j={id:"action-recorder.command.replay-local-records-name",type:s.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON(U.NAME);return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},P={id:"action-recorder.command.replay-local-records-active",type:s.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON(U.ACTIVE);return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},$={id:"action-recorder.operation.open-panel",type:s.CommandType.OPERATION,handler(e){return e.get(exports.ActionRecorderService).togglePanel(!0),!0}},W={id:"action-recorder.operation.close-panel",type:s.CommandType.OPERATION,handler(e){return e.get(exports.ActionRecorderService).togglePanel(!1),!0}};function ne(){const e=d.useDependency(exports.ActionRecorderService);return d.useObservable(e.panelOpened$)?f.jsx(ie,{}):null}function ie(){var p;const e=d.useDependency(s.ICommandService),n=d.useDependency(exports.ActionRecorderService),r=d.useObservable(n.recording$),t=d.useObservable(n.recordedCommands$),i=(p=t==null?void 0:t.length)!=null?p:0,o=h.useCallback(()=>{r||e.executeCommand(W.id)},[e,r]),c=h.useCallback(v=>{r||e.executeCommand(B.id,{replaceId:v})},[e,r]),m=h.useCallback(()=>{r&&e.executeCommand(k.id)},[e,r]),u=h.useCallback(()=>{r&&e.executeCommand(V.id)},[e,r]),y=r?i===0?"Recording...":`${i}: ${t[i-1].id}`:"Start Recording";return f.jsxs("div",{className:"univer-fixed univer-bottom-20 univer-left-1/2 univer-z-[1000] univer-flex univer-h-16 univer-w-[512px] -univer-translate-x-1/2 univer-items-center univer-rounded-lg univer-bg-white univer-px-5 univer-shadow-lg",children:[f.jsx("div",{className:"univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl",children:f.jsx(T,{})}),f.jsx("div",{className:"univer-flex-1 univer-text-sm",children:y}),f.jsxs("div",{className:"univer-flex univer-w-64 univer-shrink-0 univer-grow-0 univer-justify-between",children:[f.jsx(C.Button,{className:"univer-w-20",onClick:r?u:o,children:r?"Cancel":"Close"}),f.jsx(C.Button,{className:"univer-w-20",variant:"primary",onClick:r?m:()=>c(),children:r?"Save":"Start"}),!r&&f.jsx(C.Button,{variant:"primary",onClick:()=>c(!0),children:"Start(N)"})]})]})}const q="RECORD_MENU_ITEM";function oe(){return{id:q,type:d.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}function ce(e){const n=e.get(exports.ActionRecorderService);return{id:$.id,title:"action-recorder.menu.record",type:d.MenuItemType.BUTTON,disabled$:n.panelOpened$}}function ae(){return{id:N.id,title:"action-recorder.menu.replay-local",type:d.MenuItemType.BUTTON}}function se(){return{id:j.id,title:"action-recorder.menu.replay-local-name",type:d.MenuItemType.BUTTON}}function de(){return{id:P.id,title:"action-recorder.menu.replay-local-active",type:d.MenuItemType.BUTTON}}const le={[d.RibbonStartGroup.OTHERS]:{[q]:{order:10,menuItemFactory:oe,[$.id]:{order:1,menuItemFactory:ce},[N.id]:{order:2,menuItemFactory:ae},[j.id]:{order:3,menuItemFactory:se},[P.id]:{order:4,menuItemFactory:de}}}};var me=Object.getOwnPropertyDescriptor,ue=(e,n,r,t)=>{for(var i=t>1?void 0:t?me(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},_=(e,n)=>(r,t)=>n(r,t,e);let b=class extends s.Disposable{constructor(e,n,r,t,i,o){super(),this._commandSrv=e,this._uiPartsSrv=n,this._menuManagerService=r,this._componentManager=t,this._actionRecorderService=i,this._injector=o,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[B,V,k,$,W,N,j,P].forEach(e=>this._commandSrv.registerCommand(e))}_initUI(){this._uiPartsSrv.registerComponent(d.BuiltInUIPart.GLOBAL,()=>d.connectInjector(ne,this._injector)),this._componentManager.register("RecordSingle",T),this._menuManagerService.mergeMenu(le)}_initSheetsCommands(){[a.CopySheetCommand,a.DeleteRangeMoveLeftCommand,a.DeleteRangeMoveUpCommand,a.DeltaColumnWidthCommand,a.DeltaRowHeightCommand,a.InsertSheetCommand,a.InsertColAfterCommand,a.InsertColBeforeCommand,a.InsertRowAfterCommand,a.InsertRowBeforeCommand,a.RemoveSheetCommand,a.SetStyleCommand,a.AddWorksheetMergeCommand,a.AddWorksheetMergeAllCommand,a.AddWorksheetMergeVerticalCommand,a.AddWorksheetMergeHorizontalCommand,a.SetFrozenCommand,a.CancelFrozenCommand,a.SetHorizontalTextAlignCommand,a.SetOverlineCommand,l.SetRangeBoldCommand,l.SetRangeFontFamilyCommand,l.SetRangeFontSizeCommand,l.SetRangeItalicCommand,l.SetRangeStrickThroughCommand,l.SetRangeSubscriptCommand,l.SetRangeSuperscriptCommand,l.SetRangeTextColorCommand,l.SetRangeUnderlineCommand,a.SetRangeValuesCommand,a.SetStrikeThroughCommand,a.SetTextColorCommand,a.SetTextRotationCommand,a.SetTextWrapCommand,a.SetVerticalTextAlignCommand,l.SheetCopyCommand,l.SheetCutCommand,l.SheetPasteBesidesBorderCommand,l.SheetPasteColWidthCommand,l.SheetPasteCommand,l.SheetPasteFormatCommand,l.SheetPasteShortKeyCommand,l.SheetPasteValueCommand,l.AutoFillCommand,l.RefillCommand,a.SetWorksheetActivateCommand,a.SetWorksheetActiveOperation,a.SetSelectionsOperation,M.SetSheetFilterRangeCommand,M.SetSheetsFilterCriteriaCommand,M.RemoveSheetFilterCommand].forEach(e=>this._actionRecorderService.registerRecordedCommand(e))}_initDocsCommands(){}};b=ue([_(0,s.ICommandService),_(1,d.IUIPartsService),_(2,d.IMenuManagerService),_(3,s.Inject(d.ComponentManager)),_(4,s.Inject(exports.ActionRecorderService)),_(5,s.Inject(s.Injector))],b);const ve="action-recorder.config",F={};var ge=Object.getOwnPropertyDescriptor,Se=(e,n,r,t)=>{for(var i=t>1?void 0:t?ge(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},D=(e,n)=>(r,t)=>n(r,t,e),w;exports.UniverActionRecorderPlugin=(w=class extends s.Plugin{constructor(n=F,r,t){super(),this._config=n,this._injector=r,this._configService=t;const{menu:i,...o}=s.merge({},F,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(ve,o)}onStarting(){(this._config.replayOnly?[[exports.ActionReplayService]]:[[exports.ActionRecorderService],[exports.ActionReplayService],[b]]).forEach(r=>this._injector.add(r))}onSteady(){this._config.replayOnly||this._injector.get(b)}},S(w,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),w);exports.UniverActionRecorderPlugin=Se([D(1,s.Inject(s.Injector)),D(2,s.IConfigService)],exports.UniverActionRecorderPlugin);
1
+ "use strict";var z=Object.defineProperty;var H=(e,n,r)=>n in e?z(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var S=(e,n,r)=>H(e,typeof n!="symbol"?n+"":n,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@univerjs/core"),a=require("@univerjs/sheets"),M=require("@univerjs/sheets-filter"),l=require("@univerjs/sheets-ui"),d=require("@univerjs/ui"),O=require("rxjs"),C=require("@univerjs/design"),f=require("react/jsx-runtime"),h=require("react");var g=function(){return g=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},g.apply(this,arguments)},J=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},E=h.forwardRef(function(e,n){var r=e.icon,t=e.id,i=e.className,o=e.extend,c=J(e,["icon","id","className","extend"]),m="univerjs-icon univerjs-icon-".concat(t," ").concat(i||"").trim(),u=h.useRef("_".concat(K()));return L(r,"".concat(t),{defIds:r.defIds,idSuffix:u.current},g({ref:n,className:m},c),o)});function L(e,n,r,t,i){return h.createElement(e.tag,g(g({key:n},G(e,r,i)),t),(Z(e,r).children||[]).map(function(o,c){return L(o,"".concat(n,"-").concat(e.tag,"-").concat(c),r,void 0,i)}))}function G(e,n,r){var t=g({},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(o){var c=o[0],m=o[1];c==="mask"&&typeof m=="string"&&(t[c]=m.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(o){var c=o[0],m=o[1];typeof m=="string"&&(t[c]=m.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function Z(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)?g(g({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&t&&t.indexOf(i.attrs.id)>-1?g(g({},i),{attrs:g(g({},i.attrs),{id:i.attrs.id+n.idSuffix})}):i})}):e}function K(){return Math.random().toString(36).substring(2,8)}E.displayName="UniverIcon";var Y={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#record-single_clip0_1559_19)"},children:[{tag:"path",attrs:{d:"M7.60303 10C8.7076 10 9.60303 9.10457 9.60303 8C9.60303 6.89543 8.7076 6 7.60303 6C6.49846 6 5.60303 6.89543 5.60303 8C5.60303 9.10457 6.49846 10 7.60303 10Z"}},{tag:"path",attrs:{d:"M1.66943 5.29023C1.66941 3.85426 2.83349 2.69017 4.26946 2.69019L10.9362 2.69026C12.3192 2.69028 13.45 3.77008 13.5315 5.13259L14.5692 4.55638C15.3024 4.14929 16.2032 4.67947 16.2032 5.51809V10.4819C16.2032 11.3205 15.3024 11.8507 14.5692 11.4436L13.5315 10.8674C13.45 12.2299 12.3192 13.3097 10.9362 13.3097H4.26953C2.83361 13.3097 1.66956 12.1457 1.66953 10.7098L1.66943 5.29023ZM13.5362 9.49743L15.0032 10.312V5.68799L13.5362 6.50254V9.49743ZM4.26945 3.89019C3.49623 3.89018 2.86942 4.517 2.86943 5.29021L2.86953 10.7098C2.86955 11.483 3.49634 12.1097 4.26953 12.1097H10.9362C11.7094 12.1097 12.3362 11.4829 12.3362 10.7097V5.29026C12.3362 4.51707 11.7094 3.89027 10.9362 3.89026L4.26945 3.89019Z",fillRule:"evenodd",clipRule:"evenodd"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"record-single_clip0_1559_19"},children:[{tag:"path",attrs:{fill:"#fff",d:"M0 0H16V16H0z",transform:"translate(.94)"}}]}]}],defIds:["record-single_clip0_1559_19"]},T=h.forwardRef(function(e,n){return h.createElement(E,Object.assign({},e,{id:"record-single",ref:n,icon:Y}))});T.displayName="RecordSingle";var Q=Object.getOwnPropertyDescriptor,X=(e,n,r,t)=>{for(var i=t>1?void 0:t?Q(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},A=(e,n)=>(r,t)=>n(r,t,e);exports.ActionRecorderService=class extends s.Disposable{constructor(r,t,i,o){super();S(this,"_shouldRecordCommands",new Set);S(this,"_panelOpened$",new O.BehaviorSubject(!1));S(this,"panelOpened$",this._panelOpened$.asObservable());S(this,"_recorder",null);S(this,"_recording$",new O.BehaviorSubject(!1));S(this,"recording$",this._recording$.asObservable());S(this,"_recorded$",new O.BehaviorSubject([]));S(this,"_recordedCommands$",new O.BehaviorSubject([]));S(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=r,this._logService=t,this._localFileService=i,this._instanceService=o}get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}registerRecordedCommand(r){if(r.type===s.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(r.id)}togglePanel(r){this._panelOpened$.next(r),r===!1&&this.stopRecording()}startRecording(r=!1){this._recorder=this._commandSrv.onCommandExecuted(t=>{var i,o;if(this._shouldRecordCommands.has(t.id)){const c=this._recorded,m=this._recordedCommands;let u={...t};const y=(i=this._instanceService.getFocusedUnit())==null?void 0:i.getUnitId(),{unitId:p=y,subUnitId:v}=u==null?void 0:u.params;if(r&&p&&v){const x=(o=this._instanceService.getUnit(p).getSheetBySheetId(v))==null?void 0:o.getName();u={...u,params:{...u.params,subUnitId:x}}}u.id===a.SetSelectionsOperation.id&&c.length>0&&c[c.length-1].id===a.SetSelectionsOperation.id?c[c.length-1]=u:(c.push(u),this._recorded$.next(c),u.type===s.CommandType.COMMAND&&(m.push(u),this._recordedCommands$.next(m)))}}),this._recording$.next(!0)}stopRecording(){var r;(r=this._recorder)==null||r.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const r=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(r,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",r),this.stopRecording()}};exports.ActionRecorderService=X([A(0,s.ICommandService),A(1,s.ILogService),A(2,d.ILocalFileService),A(3,s.IUniverInstanceService)],exports.ActionRecorderService);const B={id:"action-recorder.command.start-recording",type:s.CommandType.COMMAND,handler:(e,n)=>(e.get(exports.ActionRecorderService).startRecording(!!(n!=null&&n.replaceId)),!0)},k={id:"action-recorder.command.complete-recording",type:s.CommandType.COMMAND,handler:e=>(e.get(exports.ActionRecorderService).completeRecording(),!0)},V={id:"action-recorder.command.stop-recording",type:s.CommandType.COMMAND,handler:e=>(e.get(exports.ActionRecorderService).completeRecording(),!0)};var ee=Object.getOwnPropertyDescriptor,re=(e,n,r,t)=>{for(var i=t>1?void 0:t?ee(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},I=(e,n)=>(r,t)=>n(r,t,e),U=(e=>(e.DEFAULT="default",e.NAME="name",e.ACTIVE="active",e))(U||{});exports.ActionReplayService=class extends s.Disposable{constructor(n,r,t,i,o){super(),this._messageService=n,this._instanceService=r,this._localFileService=t,this._logService=i,this._commandService=o}async replayLocalJSON(n="default"){const r=await this._localFileService.openFile({multiple:!1,accept:".json"});if(r.length!==1)return!1;const t=r[0];try{return this.replayCommands(JSON.parse(await t.text()),{mode:n})}catch{return this._messageService.show({type:C.MessageType.Error,content:`Failed to replay commands from local file ${t.name}.`}),!1}}async replayCommands(n,r){var o,c,m;const t=(o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId();t||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode:i}=r||{};for(const u of n){const{id:y,params:p}=u,v=p;if(v){if(typeof v.unitId<"u"&&(v.unitId=t),i==="name"&&v.subUnitId!=="undefined"){const R=(c=this._instanceService.getFocusedUnit().getSheetBySheetName(v.subUnitId))==null?void 0:c.getSheetId();R?v.subUnitId=R:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${v.subUnitId}`)}if(i==="active"&&v.subUnitId!=="undefined"){const R=(m=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:m.getSheetId();R?v.subUnitId=R:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(y,p))return!1}else if(!await this._commandService.executeCommand(y))return!1}return!0}async replayCommandsWithDelay(n){var t;const r=(t=this._instanceService.getFocusedUnit())==null?void 0:t.getUnitId();r||this._logService.error("[ReplayService]","no focused unit to replay commands");for(const i of n){await s.awaitTime(te());const{id:o,params:c}=i;if(c){if(typeof c.unitId<"u"&&(c.unitId=r),!await this._commandService.executeCommand(o,c))return!1}else if(!await this._commandService.executeCommand(o))return!1}return!0}};exports.ActionReplayService=re([I(0,d.IMessageService),I(1,s.IUniverInstanceService),I(2,d.ILocalFileService),I(3,s.ILogService),I(4,s.ICommandService)],exports.ActionReplayService);function te(){return Math.floor(Math.random()*800)+200}const N={id:"action-recorder.command.replay-local-records",type:s.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON();return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},j={id:"action-recorder.command.replay-local-records-name",type:s.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON(U.NAME);return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},P={id:"action-recorder.command.replay-local-records-active",type:s.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON(U.ACTIVE);return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},$={id:"action-recorder.operation.open-panel",type:s.CommandType.OPERATION,handler(e){return e.get(exports.ActionRecorderService).togglePanel(!0),!0}},W={id:"action-recorder.operation.close-panel",type:s.CommandType.OPERATION,handler(e){return e.get(exports.ActionRecorderService).togglePanel(!1),!0}};function ne(){const e=d.useDependency(exports.ActionRecorderService);return d.useObservable(e.panelOpened$)?f.jsx(ie,{}):null}function ie(){var p;const e=d.useDependency(s.ICommandService),n=d.useDependency(exports.ActionRecorderService),r=d.useObservable(n.recording$),t=d.useObservable(n.recordedCommands$),i=(p=t==null?void 0:t.length)!=null?p:0,o=h.useCallback(()=>{r||e.executeCommand(W.id)},[e,r]),c=h.useCallback(v=>{r||e.executeCommand(B.id,{replaceId:v})},[e,r]),m=h.useCallback(()=>{r&&e.executeCommand(k.id)},[e,r]),u=h.useCallback(()=>{r&&e.executeCommand(V.id)},[e,r]),y=r?i===0?"Recording...":`${i}: ${t[i-1].id}`:"Start Recording";return f.jsxs("div",{className:"univer-fixed univer-bottom-20 univer-left-1/2 univer-z-[1000] univer-flex univer-h-16 univer-w-[512px] -univer-translate-x-1/2 univer-items-center univer-rounded-lg univer-bg-white univer-px-5 univer-shadow-lg",children:[f.jsx("div",{className:"univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl",children:f.jsx(T,{})}),f.jsx("div",{className:"univer-flex-1 univer-text-sm",children:y}),f.jsxs("div",{className:"univer-flex univer-w-64 univer-shrink-0 univer-grow-0 univer-justify-between",children:[f.jsx(C.Button,{className:"univer-w-20",onClick:r?u:o,children:r?"Cancel":"Close"}),f.jsx(C.Button,{className:"univer-w-20",variant:"primary",onClick:r?m:()=>c(),children:r?"Save":"Start"}),!r&&f.jsx(C.Button,{variant:"primary",onClick:()=>c(!0),children:"Start(N)"})]})]})}const q="RECORD_MENU_ITEM";function oe(){return{id:q,type:d.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}function ce(e){const n=e.get(exports.ActionRecorderService);return{id:$.id,title:"action-recorder.menu.record",type:d.MenuItemType.BUTTON,disabled$:n.panelOpened$}}function ae(){return{id:N.id,title:"action-recorder.menu.replay-local",type:d.MenuItemType.BUTTON}}function se(){return{id:j.id,title:"action-recorder.menu.replay-local-name",type:d.MenuItemType.BUTTON}}function de(){return{id:P.id,title:"action-recorder.menu.replay-local-active",type:d.MenuItemType.BUTTON}}const le={[d.RibbonStartGroup.OTHERS]:{[q]:{order:2,menuItemFactory:oe,[$.id]:{order:1,menuItemFactory:ce},[N.id]:{order:2,menuItemFactory:ae},[j.id]:{order:3,menuItemFactory:se},[P.id]:{order:4,menuItemFactory:de}}}};var me=Object.getOwnPropertyDescriptor,ue=(e,n,r,t)=>{for(var i=t>1?void 0:t?me(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},_=(e,n)=>(r,t)=>n(r,t,e);let b=class extends s.Disposable{constructor(e,n,r,t,i,o){super(),this._commandSrv=e,this._uiPartsSrv=n,this._menuManagerService=r,this._componentManager=t,this._actionRecorderService=i,this._injector=o,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[B,V,k,$,W,N,j,P].forEach(e=>this._commandSrv.registerCommand(e))}_initUI(){this._uiPartsSrv.registerComponent(d.BuiltInUIPart.GLOBAL,()=>d.connectInjector(ne,this._injector)),this.disposeWithMe(this._componentManager.register("RecordSingle",T)),this._menuManagerService.mergeMenu(le)}_initSheetsCommands(){[a.CopySheetCommand,a.DeleteRangeMoveLeftCommand,a.DeleteRangeMoveUpCommand,a.DeltaColumnWidthCommand,a.DeltaRowHeightCommand,a.InsertSheetCommand,a.InsertColAfterCommand,a.InsertColBeforeCommand,a.InsertRowAfterCommand,a.InsertRowBeforeCommand,a.RemoveSheetCommand,a.SetStyleCommand,a.AddWorksheetMergeCommand,a.AddWorksheetMergeAllCommand,a.AddWorksheetMergeVerticalCommand,a.AddWorksheetMergeHorizontalCommand,a.SetFrozenCommand,a.CancelFrozenCommand,a.SetHorizontalTextAlignCommand,a.SetOverlineCommand,l.SetRangeBoldCommand,l.SetRangeFontFamilyCommand,l.SetRangeFontSizeCommand,l.SetRangeItalicCommand,l.SetRangeStrickThroughCommand,l.SetRangeSubscriptCommand,l.SetRangeSuperscriptCommand,l.SetRangeTextColorCommand,l.SetRangeUnderlineCommand,a.SetRangeValuesCommand,a.SetStrikeThroughCommand,a.SetTextColorCommand,a.SetTextRotationCommand,a.SetTextWrapCommand,a.SetVerticalTextAlignCommand,l.SheetCopyCommand,l.SheetCutCommand,l.SheetPasteBesidesBorderCommand,l.SheetPasteColWidthCommand,l.SheetPasteCommand,l.SheetPasteFormatCommand,l.SheetPasteShortKeyCommand,l.SheetPasteValueCommand,l.AutoFillCommand,l.RefillCommand,a.SetWorksheetActivateCommand,a.SetWorksheetActiveOperation,a.SetSelectionsOperation,M.SetSheetFilterRangeCommand,M.SetSheetsFilterCriteriaCommand,M.RemoveSheetFilterCommand].forEach(e=>this._actionRecorderService.registerRecordedCommand(e))}_initDocsCommands(){}};b=ue([_(0,s.ICommandService),_(1,d.IUIPartsService),_(2,d.IMenuManagerService),_(3,s.Inject(d.ComponentManager)),_(4,s.Inject(exports.ActionRecorderService)),_(5,s.Inject(s.Injector))],b);const ve="action-recorder.config",F={};var ge=Object.getOwnPropertyDescriptor,Se=(e,n,r,t)=>{for(var i=t>1?void 0:t?ge(n,r):n,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},D=(e,n)=>(r,t)=>n(r,t,e),w;exports.UniverActionRecorderPlugin=(w=class extends s.Plugin{constructor(n=F,r,t){super(),this._config=n,this._injector=r,this._configService=t;const{menu:i,...o}=s.merge({},F,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(ve,o)}onStarting(){(this._config.replayOnly?[[exports.ActionReplayService]]:[[exports.ActionRecorderService],[exports.ActionReplayService],[b]]).forEach(r=>this._injector.add(r))}onSteady(){this._config.replayOnly||this._injector.get(b)}},S(w,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),w);exports.UniverActionRecorderPlugin=Se([D(1,s.Inject(s.Injector)),D(2,s.IConfigService)],exports.UniverActionRecorderPlugin);
@@ -1 +1 @@
1
- "use strict";const c={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=c;
1
+ "use strict";const e={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record...","replay-local-name":"Replace Local Record by Subunit...","replay-local-active":"Replace Local Record by Current Subunit..."}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت..."}}};module.exports=e;
1
+ "use strict";const e={"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت...","replay-local-name":"بازپخش محلی ثبت بر اساس نام زیر واحد...","replay-local-active":"بازپخش محلی ثبت بر اساس زیر واحد فعلی..."}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={"action-recorder":{menu:{title:"Enregistrer les actions",record:"Enregistrer les actions...","replay-local":"Lecture de l'enregistrement local..."}}};module.exports=e;
1
+ "use strict";const e={"action-recorder":{menu:{title:"Enregistrer les actions",record:"Enregistrer les actions...","replay-local":"Lecture de l'enregistrement local...","replay-local-name":"Remplacer l'enregistrement local par le sous-unité...","replay-local-active":"Remplacer l'enregistrement local par le sous-unité actuel..."}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const c={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=c;
1
+ "use strict";const e={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record...","replay-local-name":"Replace Local Record by Subunit...","replay-local-active":"Replace Local Record by Current Subunit..."}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const c={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=c;
1
+ "use strict";const e={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record...","replay-local-name":"Replace Local Record by Subunit...","replay-local-active":"Replace Local Record by Current Subunit..."}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=e;
1
+ "use strict";const e={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制...","replay-local-name":"根据子表名回放本地录制...","replay-local-active":"根据当前子表回放本地录制..."}}};module.exports=e;
@@ -1 +1 @@
1
- "use strict";const e={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=e;
1
+ "use strict";const e={"action-recorder":{menu:{title:"操作錄製",record:"錄製操作...","replay-local":"回放本地錄製...","replay-local-name":"根據子表名回放本地錄製...","replay-local-active":"根據當前子表回放本地錄製..."}}};module.exports=e;
package/lib/es/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  var ie = Object.defineProperty;
2
2
  var ae = (e, t, r) => t in e ? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var m = (e, t, r) => ae(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { Disposable as T, CommandType as u, ICommandService as b, ILogService as J, IUniverInstanceService as G, awaitTime as ce, Inject as x, Injector as Z, IConfigService as se, Plugin as de, merge as le } from "@univerjs/core";
5
- import { SetSelectionsOperation as $, CopySheetCommand as me, DeleteRangeMoveLeftCommand as ue, DeleteRangeMoveUpCommand as fe, DeltaColumnWidthCommand as ge, DeltaRowHeightCommand as he, InsertSheetCommand as ve, InsertColAfterCommand as Se, InsertColBeforeCommand as pe, InsertRowAfterCommand as Ce, InsertRowBeforeCommand as _e, RemoveSheetCommand as ye, SetStyleCommand as Re, AddWorksheetMergeCommand as Ie, AddWorksheetMergeAllCommand as Oe, AddWorksheetMergeVerticalCommand as xe, AddWorksheetMergeHorizontalCommand as we, SetFrozenCommand as be, CancelFrozenCommand as Me, SetHorizontalTextAlignCommand as Ne, SetOverlineCommand as Ue, SetRangeValuesCommand as Ae, SetStrikeThroughCommand as $e, SetTextColorCommand as Pe, SetTextRotationCommand as Fe, SetTextWrapCommand as Te, SetVerticalTextAlignCommand as Ee, SetWorksheetActivateCommand as De, SetWorksheetActiveOperation as je } from "@univerjs/sheets";
4
+ import { Disposable as T, CommandType as u, ICommandService as M, ILogService as J, IUniverInstanceService as G, awaitTime as ce, Inject as x, Injector as Z, IConfigService as se, Plugin as de, merge as le } from "@univerjs/core";
5
+ import { SetSelectionsOperation as $, CopySheetCommand as me, DeleteRangeMoveLeftCommand as ue, DeleteRangeMoveUpCommand as fe, DeltaColumnWidthCommand as ge, DeltaRowHeightCommand as he, InsertSheetCommand as ve, InsertColAfterCommand as Se, InsertColBeforeCommand as pe, InsertRowAfterCommand as Ce, InsertRowBeforeCommand as _e, RemoveSheetCommand as ye, SetStyleCommand as Re, AddWorksheetMergeCommand as Ie, AddWorksheetMergeAllCommand as Oe, AddWorksheetMergeVerticalCommand as xe, AddWorksheetMergeHorizontalCommand as we, SetFrozenCommand as Me, CancelFrozenCommand as be, SetHorizontalTextAlignCommand as Ne, SetOverlineCommand as Ue, SetRangeValuesCommand as Ae, SetStrikeThroughCommand as $e, SetTextColorCommand as Pe, SetTextRotationCommand as Fe, SetTextWrapCommand as Te, SetVerticalTextAlignCommand as Ee, SetWorksheetActivateCommand as De, SetWorksheetActiveOperation as je } from "@univerjs/sheets";
6
6
  import { SetSheetFilterRangeCommand as Le, SetSheetsFilterCriteriaCommand as ke, RemoveSheetFilterCommand as Be } from "@univerjs/sheets-filter";
7
7
  import { SetRangeBoldCommand as Ve, SetRangeFontFamilyCommand as We, SetRangeFontSizeCommand as ze, SetRangeItalicCommand as He, SetRangeStrickThroughCommand as Je, SetRangeSubscriptCommand as Ge, SetRangeSuperscriptCommand as Ze, SetRangeTextColorCommand as Ke, SetRangeUnderlineCommand as Ye, SheetCopyCommand as qe, SheetCutCommand as Qe, SheetPasteBesidesBorderCommand as Xe, SheetPasteColWidthCommand as et, SheetPasteCommand as tt, SheetPasteFormatCommand as rt, SheetPasteShortKeyCommand as nt, SheetPasteValueCommand as ot, AutoFillCommand as it, RefillCommand as at } from "@univerjs/sheets-ui";
8
- import { ILocalFileService as K, IMessageService as M, useDependency as P, useObservable as F, RibbonStartGroup as ct, MenuItemType as y, IUIPartsService as st, IMenuManagerService as dt, ComponentManager as lt, BuiltInUIPart as mt, connectInjector as ut } from "@univerjs/ui";
8
+ import { ILocalFileService as K, IMessageService as b, useDependency as P, useObservable as F, RibbonStartGroup as ct, MenuItemType as y, IUIPartsService as st, IMenuManagerService as dt, ComponentManager as lt, BuiltInUIPart as mt, connectInjector as ut } from "@univerjs/ui";
9
9
  import { BehaviorSubject as R } from "rxjs";
10
10
  import { MessageType as N, Button as U } from "@univerjs/design";
11
11
  import { jsx as h, jsxs as V } from "react/jsx-runtime";
@@ -130,7 +130,7 @@ let l = class extends T {
130
130
  }
131
131
  };
132
132
  l = _t([
133
- O(0, b),
133
+ O(0, M),
134
134
  O(1, J),
135
135
  O(2, K),
136
136
  O(3, G)
@@ -218,11 +218,11 @@ let v = class extends T {
218
218
  }
219
219
  };
220
220
  v = Rt([
221
- _(0, M),
221
+ _(0, b),
222
222
  _(1, G),
223
223
  _(2, K),
224
224
  _(3, J),
225
- _(4, b)
225
+ _(4, M)
226
226
  ], v);
227
227
  function It() {
228
228
  return Math.floor(Math.random() * 800) + 200;
@@ -232,7 +232,7 @@ const j = {
232
232
  type: u.COMMAND,
233
233
  handler: async (e) => {
234
234
  const r = await e.get(v).replayLocalJSON();
235
- return r && e.get(M).show({
235
+ return r && e.get(b).show({
236
236
  type: N.Success,
237
237
  content: "Successfully replayed local records"
238
238
  }), r;
@@ -242,7 +242,7 @@ const j = {
242
242
  type: u.COMMAND,
243
243
  handler: async (e) => {
244
244
  const r = await e.get(v).replayLocalJSON(D.NAME);
245
- return r && e.get(M).show({
245
+ return r && e.get(b).show({
246
246
  type: N.Success,
247
247
  content: "Successfully replayed local records"
248
248
  }), r;
@@ -252,7 +252,7 @@ const j = {
252
252
  type: u.COMMAND,
253
253
  handler: async (e) => {
254
254
  const r = await e.get(v).replayLocalJSON(D.ACTIVE);
255
- return r && e.get(M).show({
255
+ return r && e.get(b).show({
256
256
  type: N.Success,
257
257
  content: "Successfully replayed local records"
258
258
  }), r;
@@ -276,7 +276,7 @@ function Ot() {
276
276
  }
277
277
  function xt() {
278
278
  var s;
279
- const e = P(b), t = P(l), r = F(t.recording$), n = F(t.recordedCommands$), o = (s = n == null ? void 0 : n.length) != null ? s : 0, i = I(() => {
279
+ const e = P(M), t = P(l), r = F(t.recording$), n = F(t.recordedCommands$), o = (s = n == null ? void 0 : n.length) != null ? s : 0, i = I(() => {
280
280
  r || e.executeCommand(ne.id);
281
281
  }, [e, r]), a = I((p) => {
282
282
  r || e.executeCommand(ee.id, { replaceId: p });
@@ -325,7 +325,7 @@ function wt() {
325
325
  tooltip: "action-recorder.menu.title"
326
326
  };
327
327
  }
328
- function bt(e) {
328
+ function Mt(e) {
329
329
  const t = e.get(l);
330
330
  return {
331
331
  id: B.id,
@@ -334,7 +334,7 @@ function bt(e) {
334
334
  disabled$: t.panelOpened$
335
335
  };
336
336
  }
337
- function Mt() {
337
+ function bt() {
338
338
  return {
339
339
  id: j.id,
340
340
  title: "action-recorder.menu.replay-local",
@@ -358,15 +358,15 @@ function Ut() {
358
358
  const At = {
359
359
  [ct.OTHERS]: {
360
360
  [oe]: {
361
- order: 10,
361
+ order: 2,
362
362
  menuItemFactory: wt,
363
363
  [B.id]: {
364
364
  order: 1,
365
- menuItemFactory: bt
365
+ menuItemFactory: Mt
366
366
  },
367
367
  [j.id]: {
368
368
  order: 2,
369
- menuItemFactory: Mt
369
+ menuItemFactory: bt
370
370
  },
371
371
  [L.id]: {
372
372
  order: 3,
@@ -401,7 +401,9 @@ let w = class extends T {
401
401
  ].forEach((e) => this._commandSrv.registerCommand(e));
402
402
  }
403
403
  _initUI() {
404
- this._uiPartsSrv.registerComponent(mt.GLOBAL, () => ut(Ot, this._injector)), this._componentManager.register("RecordSingle", E), this._menuManagerService.mergeMenu(At);
404
+ this._uiPartsSrv.registerComponent(mt.GLOBAL, () => ut(Ot, this._injector)), this.disposeWithMe(
405
+ this._componentManager.register("RecordSingle", E)
406
+ ), this._menuManagerService.mergeMenu(At);
405
407
  }
406
408
  _initSheetsCommands() {
407
409
  [
@@ -430,8 +432,8 @@ let w = class extends T {
430
432
  // SetBoldCommand,
431
433
  // SetFontFamilyCommand,
432
434
  // SetFontSizeCommand,
433
- be,
434
435
  Me,
436
+ be,
435
437
  Ne,
436
438
  // SetItalicCommand,
437
439
  Ue,
@@ -480,7 +482,7 @@ let w = class extends T {
480
482
  }
481
483
  };
482
484
  w = Pt([
483
- S(0, b),
485
+ S(0, M),
484
486
  S(1, st),
485
487
  S(2, dt),
486
488
  S(3, x(lt)),
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Record Actions",
5
5
  record: "Record Actions...",
6
- "replay-local": "Replace Local Record..."
6
+ "replay-local": "Replace Local Record...",
7
+ "replay-local-name": "Replace Local Record by Subunit...",
8
+ "replay-local-active": "Replace Local Record by Current Subunit..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "ثبت اقدامات",
5
5
  record: "ثبت اقدامات...",
6
- "replay-local": "بازپخش محلی ثبت..."
6
+ "replay-local": "بازپخش محلی ثبت...",
7
+ "replay-local-name": "بازپخش محلی ثبت بر اساس نام زیر واحد...",
8
+ "replay-local-active": "بازپخش محلی ثبت بر اساس زیر واحد فعلی..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Enregistrer les actions",
5
5
  record: "Enregistrer les actions...",
6
- "replay-local": "Lecture de l'enregistrement local..."
6
+ "replay-local": "Lecture de l'enregistrement local...",
7
+ "replay-local-name": "Remplacer l'enregistrement local par le sous-unité...",
8
+ "replay-local-active": "Remplacer l'enregistrement local par le sous-unité actuel..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Record Actions",
5
5
  record: "Record Actions...",
6
- "replay-local": "Replace Local Record..."
6
+ "replay-local": "Replace Local Record...",
7
+ "replay-local-name": "Replace Local Record by Subunit...",
8
+ "replay-local-active": "Replace Local Record by Current Subunit..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Record Actions",
5
5
  record: "Record Actions...",
6
- "replay-local": "Replace Local Record..."
6
+ "replay-local": "Replace Local Record...",
7
+ "replay-local-name": "Replace Local Record by Subunit...",
8
+ "replay-local-active": "Replace Local Record by Current Subunit..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "操作录制",
5
5
  record: "录制操作...",
6
- "replay-local": "回放本地录制..."
6
+ "replay-local": "回放本地录制...",
7
+ "replay-local-name": "根据子表名回放本地录制...",
8
+ "replay-local-active": "根据当前子表回放本地录制..."
7
9
  }
8
10
  }
9
11
  };
@@ -1,9 +1,11 @@
1
1
  const e = {
2
2
  "action-recorder": {
3
3
  menu: {
4
- title: "操作录制",
5
- record: "录制操作...",
6
- "replay-local": "回放本地录制..."
4
+ title: "操作錄製",
5
+ record: "錄製操作...",
6
+ "replay-local": "回放本地錄製...",
7
+ "replay-local-name": "根據子表名回放本地錄製...",
8
+ "replay-local-active": "根據當前子表回放本地錄製..."
7
9
  }
8
10
  }
9
11
  };
package/lib/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  var ie = Object.defineProperty;
2
2
  var ae = (e, t, r) => t in e ? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var m = (e, t, r) => ae(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { Disposable as T, CommandType as u, ICommandService as b, ILogService as J, IUniverInstanceService as G, awaitTime as ce, Inject as x, Injector as Z, IConfigService as se, Plugin as de, merge as le } from "@univerjs/core";
5
- import { SetSelectionsOperation as $, CopySheetCommand as me, DeleteRangeMoveLeftCommand as ue, DeleteRangeMoveUpCommand as fe, DeltaColumnWidthCommand as ge, DeltaRowHeightCommand as he, InsertSheetCommand as ve, InsertColAfterCommand as Se, InsertColBeforeCommand as pe, InsertRowAfterCommand as Ce, InsertRowBeforeCommand as _e, RemoveSheetCommand as ye, SetStyleCommand as Re, AddWorksheetMergeCommand as Ie, AddWorksheetMergeAllCommand as Oe, AddWorksheetMergeVerticalCommand as xe, AddWorksheetMergeHorizontalCommand as we, SetFrozenCommand as be, CancelFrozenCommand as Me, SetHorizontalTextAlignCommand as Ne, SetOverlineCommand as Ue, SetRangeValuesCommand as Ae, SetStrikeThroughCommand as $e, SetTextColorCommand as Pe, SetTextRotationCommand as Fe, SetTextWrapCommand as Te, SetVerticalTextAlignCommand as Ee, SetWorksheetActivateCommand as De, SetWorksheetActiveOperation as je } from "@univerjs/sheets";
4
+ import { Disposable as T, CommandType as u, ICommandService as M, ILogService as J, IUniverInstanceService as G, awaitTime as ce, Inject as x, Injector as Z, IConfigService as se, Plugin as de, merge as le } from "@univerjs/core";
5
+ import { SetSelectionsOperation as $, CopySheetCommand as me, DeleteRangeMoveLeftCommand as ue, DeleteRangeMoveUpCommand as fe, DeltaColumnWidthCommand as ge, DeltaRowHeightCommand as he, InsertSheetCommand as ve, InsertColAfterCommand as Se, InsertColBeforeCommand as pe, InsertRowAfterCommand as Ce, InsertRowBeforeCommand as _e, RemoveSheetCommand as ye, SetStyleCommand as Re, AddWorksheetMergeCommand as Ie, AddWorksheetMergeAllCommand as Oe, AddWorksheetMergeVerticalCommand as xe, AddWorksheetMergeHorizontalCommand as we, SetFrozenCommand as Me, CancelFrozenCommand as be, SetHorizontalTextAlignCommand as Ne, SetOverlineCommand as Ue, SetRangeValuesCommand as Ae, SetStrikeThroughCommand as $e, SetTextColorCommand as Pe, SetTextRotationCommand as Fe, SetTextWrapCommand as Te, SetVerticalTextAlignCommand as Ee, SetWorksheetActivateCommand as De, SetWorksheetActiveOperation as je } from "@univerjs/sheets";
6
6
  import { SetSheetFilterRangeCommand as Le, SetSheetsFilterCriteriaCommand as ke, RemoveSheetFilterCommand as Be } from "@univerjs/sheets-filter";
7
7
  import { SetRangeBoldCommand as Ve, SetRangeFontFamilyCommand as We, SetRangeFontSizeCommand as ze, SetRangeItalicCommand as He, SetRangeStrickThroughCommand as Je, SetRangeSubscriptCommand as Ge, SetRangeSuperscriptCommand as Ze, SetRangeTextColorCommand as Ke, SetRangeUnderlineCommand as Ye, SheetCopyCommand as qe, SheetCutCommand as Qe, SheetPasteBesidesBorderCommand as Xe, SheetPasteColWidthCommand as et, SheetPasteCommand as tt, SheetPasteFormatCommand as rt, SheetPasteShortKeyCommand as nt, SheetPasteValueCommand as ot, AutoFillCommand as it, RefillCommand as at } from "@univerjs/sheets-ui";
8
- import { ILocalFileService as K, IMessageService as M, useDependency as P, useObservable as F, RibbonStartGroup as ct, MenuItemType as y, IUIPartsService as st, IMenuManagerService as dt, ComponentManager as lt, BuiltInUIPart as mt, connectInjector as ut } from "@univerjs/ui";
8
+ import { ILocalFileService as K, IMessageService as b, useDependency as P, useObservable as F, RibbonStartGroup as ct, MenuItemType as y, IUIPartsService as st, IMenuManagerService as dt, ComponentManager as lt, BuiltInUIPart as mt, connectInjector as ut } from "@univerjs/ui";
9
9
  import { BehaviorSubject as R } from "rxjs";
10
10
  import { MessageType as N, Button as U } from "@univerjs/design";
11
11
  import { jsx as h, jsxs as V } from "react/jsx-runtime";
@@ -130,7 +130,7 @@ let l = class extends T {
130
130
  }
131
131
  };
132
132
  l = _t([
133
- O(0, b),
133
+ O(0, M),
134
134
  O(1, J),
135
135
  O(2, K),
136
136
  O(3, G)
@@ -218,11 +218,11 @@ let v = class extends T {
218
218
  }
219
219
  };
220
220
  v = Rt([
221
- _(0, M),
221
+ _(0, b),
222
222
  _(1, G),
223
223
  _(2, K),
224
224
  _(3, J),
225
- _(4, b)
225
+ _(4, M)
226
226
  ], v);
227
227
  function It() {
228
228
  return Math.floor(Math.random() * 800) + 200;
@@ -232,7 +232,7 @@ const j = {
232
232
  type: u.COMMAND,
233
233
  handler: async (e) => {
234
234
  const r = await e.get(v).replayLocalJSON();
235
- return r && e.get(M).show({
235
+ return r && e.get(b).show({
236
236
  type: N.Success,
237
237
  content: "Successfully replayed local records"
238
238
  }), r;
@@ -242,7 +242,7 @@ const j = {
242
242
  type: u.COMMAND,
243
243
  handler: async (e) => {
244
244
  const r = await e.get(v).replayLocalJSON(D.NAME);
245
- return r && e.get(M).show({
245
+ return r && e.get(b).show({
246
246
  type: N.Success,
247
247
  content: "Successfully replayed local records"
248
248
  }), r;
@@ -252,7 +252,7 @@ const j = {
252
252
  type: u.COMMAND,
253
253
  handler: async (e) => {
254
254
  const r = await e.get(v).replayLocalJSON(D.ACTIVE);
255
- return r && e.get(M).show({
255
+ return r && e.get(b).show({
256
256
  type: N.Success,
257
257
  content: "Successfully replayed local records"
258
258
  }), r;
@@ -276,7 +276,7 @@ function Ot() {
276
276
  }
277
277
  function xt() {
278
278
  var s;
279
- const e = P(b), t = P(l), r = F(t.recording$), n = F(t.recordedCommands$), o = (s = n == null ? void 0 : n.length) != null ? s : 0, i = I(() => {
279
+ const e = P(M), t = P(l), r = F(t.recording$), n = F(t.recordedCommands$), o = (s = n == null ? void 0 : n.length) != null ? s : 0, i = I(() => {
280
280
  r || e.executeCommand(ne.id);
281
281
  }, [e, r]), a = I((p) => {
282
282
  r || e.executeCommand(ee.id, { replaceId: p });
@@ -325,7 +325,7 @@ function wt() {
325
325
  tooltip: "action-recorder.menu.title"
326
326
  };
327
327
  }
328
- function bt(e) {
328
+ function Mt(e) {
329
329
  const t = e.get(l);
330
330
  return {
331
331
  id: B.id,
@@ -334,7 +334,7 @@ function bt(e) {
334
334
  disabled$: t.panelOpened$
335
335
  };
336
336
  }
337
- function Mt() {
337
+ function bt() {
338
338
  return {
339
339
  id: j.id,
340
340
  title: "action-recorder.menu.replay-local",
@@ -358,15 +358,15 @@ function Ut() {
358
358
  const At = {
359
359
  [ct.OTHERS]: {
360
360
  [oe]: {
361
- order: 10,
361
+ order: 2,
362
362
  menuItemFactory: wt,
363
363
  [B.id]: {
364
364
  order: 1,
365
- menuItemFactory: bt
365
+ menuItemFactory: Mt
366
366
  },
367
367
  [j.id]: {
368
368
  order: 2,
369
- menuItemFactory: Mt
369
+ menuItemFactory: bt
370
370
  },
371
371
  [L.id]: {
372
372
  order: 3,
@@ -401,7 +401,9 @@ let w = class extends T {
401
401
  ].forEach((e) => this._commandSrv.registerCommand(e));
402
402
  }
403
403
  _initUI() {
404
- this._uiPartsSrv.registerComponent(mt.GLOBAL, () => ut(Ot, this._injector)), this._componentManager.register("RecordSingle", E), this._menuManagerService.mergeMenu(At);
404
+ this._uiPartsSrv.registerComponent(mt.GLOBAL, () => ut(Ot, this._injector)), this.disposeWithMe(
405
+ this._componentManager.register("RecordSingle", E)
406
+ ), this._menuManagerService.mergeMenu(At);
405
407
  }
406
408
  _initSheetsCommands() {
407
409
  [
@@ -430,8 +432,8 @@ let w = class extends T {
430
432
  // SetBoldCommand,
431
433
  // SetFontFamilyCommand,
432
434
  // SetFontSizeCommand,
433
- be,
434
435
  Me,
436
+ be,
435
437
  Ne,
436
438
  // SetItalicCommand,
437
439
  Ue,
@@ -480,7 +482,7 @@ let w = class extends T {
480
482
  }
481
483
  };
482
484
  w = Pt([
483
- S(0, b),
485
+ S(0, M),
484
486
  S(1, st),
485
487
  S(2, dt),
486
488
  S(3, x(lt)),
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Record Actions",
5
5
  record: "Record Actions...",
6
- "replay-local": "Replace Local Record..."
6
+ "replay-local": "Replace Local Record...",
7
+ "replay-local-name": "Replace Local Record by Subunit...",
8
+ "replay-local-active": "Replace Local Record by Current Subunit..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "ثبت اقدامات",
5
5
  record: "ثبت اقدامات...",
6
- "replay-local": "بازپخش محلی ثبت..."
6
+ "replay-local": "بازپخش محلی ثبت...",
7
+ "replay-local-name": "بازپخش محلی ثبت بر اساس نام زیر واحد...",
8
+ "replay-local-active": "بازپخش محلی ثبت بر اساس زیر واحد فعلی..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Enregistrer les actions",
5
5
  record: "Enregistrer les actions...",
6
- "replay-local": "Lecture de l'enregistrement local..."
6
+ "replay-local": "Lecture de l'enregistrement local...",
7
+ "replay-local-name": "Remplacer l'enregistrement local par le sous-unité...",
8
+ "replay-local-active": "Remplacer l'enregistrement local par le sous-unité actuel..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Record Actions",
5
5
  record: "Record Actions...",
6
- "replay-local": "Replace Local Record..."
6
+ "replay-local": "Replace Local Record...",
7
+ "replay-local-name": "Replace Local Record by Subunit...",
8
+ "replay-local-active": "Replace Local Record by Current Subunit..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "Record Actions",
5
5
  record: "Record Actions...",
6
- "replay-local": "Replace Local Record..."
6
+ "replay-local": "Replace Local Record...",
7
+ "replay-local-name": "Replace Local Record by Subunit...",
8
+ "replay-local-active": "Replace Local Record by Current Subunit..."
7
9
  }
8
10
  }
9
11
  };
@@ -3,7 +3,9 @@ const e = {
3
3
  menu: {
4
4
  title: "操作录制",
5
5
  record: "录制操作...",
6
- "replay-local": "回放本地录制..."
6
+ "replay-local": "回放本地录制...",
7
+ "replay-local-name": "根据子表名回放本地录制...",
8
+ "replay-local-active": "根据当前子表回放本地录制..."
7
9
  }
8
10
  }
9
11
  };
@@ -1,9 +1,11 @@
1
1
  const e = {
2
2
  "action-recorder": {
3
3
  menu: {
4
- title: "操作录制",
5
- record: "录制操作...",
6
- "replay-local": "回放本地录制..."
4
+ title: "操作錄製",
5
+ record: "錄製操作...",
6
+ "replay-local": "回放本地錄製...",
7
+ "replay-local-name": "根據子表名回放本地錄製...",
8
+ "replay-local-active": "根據當前子表回放本地錄製..."
7
9
  }
8
10
  }
9
11
  };
@@ -1,3 +1,27 @@
1
- import { default as zhCN } from './zh-CN';
2
- declare const locale: typeof zhCN;
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ declare const locale: {
17
+ 'action-recorder': {
18
+ menu: {
19
+ title: string;
20
+ record: string;
21
+ 'replay-local': string;
22
+ 'replay-local-name': string;
23
+ 'replay-local-active': string;
24
+ };
25
+ };
26
+ };
3
27
  export default locale;
@@ -1,3 +1,3 @@
1
- import { default as zhCN } from './zh-CN';
2
- declare const locale: typeof zhCN;
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
3
  export default locale;
@@ -1,3 +1,3 @@
1
- import { default as zhCN } from './zh-CN';
2
- declare const locale: typeof zhCN;
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
3
  export default locale;
@@ -1,3 +1,3 @@
1
- import { default as zhCN } from './zh-CN';
2
- declare const locale: typeof zhCN;
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
3
  export default locale;
@@ -1,25 +1,3 @@
1
- /**
2
- * Copyright 2023-present DreamNum Co., Ltd.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- declare const locale: {
17
- 'action-recorder': {
18
- menu: {
19
- title: string;
20
- record: string;
21
- 'replay-local': string;
22
- };
23
- };
24
- };
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
25
3
  export default locale;
@@ -1,3 +1,3 @@
1
- import { default as zhCN } from './zh-CN';
2
- declare const locale: typeof zhCN;
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
3
  export default locale;
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(o,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-filter"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/design"),require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-filter","@univerjs/sheets-ui","@univerjs/ui","rxjs","@univerjs/design","react/jsx-runtime","react"],a):(o=typeof globalThis<"u"?globalThis:o||self,a(o.UniverActionRecorder={},o.UniverCore,o.UniverSheets,o.UniverSheetsFilter,o.UniverSheetsUi,o.UniverUi,o.rxjs,o.UniverDesign,o.React,o.React))})(this,function(o,a,s,T,m,l,A,y,p,C){"use strict";var Se=Object.defineProperty;var ge=(o,a,s)=>a in o?Se(o,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[a]=s;var g=(o,a,s)=>ge(o,typeof a!="symbol"?a+"":a,s);var D;var S=function(){return S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},S.apply(this,arguments)},H=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},x=C.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,c=e.extend,d=H(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=C.useRef("_".concat(Z()));return E(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},S({ref:t,className:u},d),c)});function E(e,t,r,n,i){return C.createElement(e.tag,S(S({key:t},J(e,r,i)),n),(G(e,r).children||[]).map(function(c,d){return E(c,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function J(e,t,r){var n=S({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(c){var d=c[0],u=c[1];d==="mask"&&typeof u=="string"&&(n[d]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(c){var d=c[0],u=c[1];typeof u=="string"&&(n[d]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function G(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?S(S({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?S(S({},i),{attrs:S(S({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function Z(){return Math.random().toString(36).substring(2,8)}x.displayName="UniverIcon";var K={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#record-single_clip0_1559_19)"},children:[{tag:"path",attrs:{d:"M7.60303 10C8.7076 10 9.60303 9.10457 9.60303 8C9.60303 6.89543 8.7076 6 7.60303 6C6.49846 6 5.60303 6.89543 5.60303 8C5.60303 9.10457 6.49846 10 7.60303 10Z"}},{tag:"path",attrs:{d:"M1.66943 5.29023C1.66941 3.85426 2.83349 2.69017 4.26946 2.69019L10.9362 2.69026C12.3192 2.69028 13.45 3.77008 13.5315 5.13259L14.5692 4.55638C15.3024 4.14929 16.2032 4.67947 16.2032 5.51809V10.4819C16.2032 11.3205 15.3024 11.8507 14.5692 11.4436L13.5315 10.8674C13.45 12.2299 12.3192 13.3097 10.9362 13.3097H4.26953C2.83361 13.3097 1.66956 12.1457 1.66953 10.7098L1.66943 5.29023ZM13.5362 9.49743L15.0032 10.312V5.68799L13.5362 6.50254V9.49743ZM4.26945 3.89019C3.49623 3.89018 2.86942 4.517 2.86943 5.29021L2.86953 10.7098C2.86955 11.483 3.49634 12.1097 4.26953 12.1097H10.9362C11.7094 12.1097 12.3362 11.4829 12.3362 10.7097V5.29026C12.3362 4.51707 11.7094 3.89027 10.9362 3.89026L4.26945 3.89019Z",fillRule:"evenodd",clipRule:"evenodd"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"record-single_clip0_1559_19"},children:[{tag:"path",attrs:{fill:"#fff",d:"M0 0H16V16H0z",transform:"translate(.94)"}}]}]}],defIds:["record-single_clip0_1559_19"]},w=C.forwardRef(function(e,t){return C.createElement(x,Object.assign({},e,{id:"record-single",ref:t,icon:K}))});w.displayName="RecordSingle";var Y=Object.getOwnPropertyDescriptor,Q=(e,t,r,n)=>{for(var i=n>1?void 0:n?Y(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},M=(e,t)=>(r,n)=>t(r,n,e);o.ActionRecorderService=class extends a.Disposable{constructor(r,n,i,c){super();g(this,"_shouldRecordCommands",new Set);g(this,"_panelOpened$",new A.BehaviorSubject(!1));g(this,"panelOpened$",this._panelOpened$.asObservable());g(this,"_recorder",null);g(this,"_recording$",new A.BehaviorSubject(!1));g(this,"recording$",this._recording$.asObservable());g(this,"_recorded$",new A.BehaviorSubject([]));g(this,"_recordedCommands$",new A.BehaviorSubject([]));g(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=r,this._logService=n,this._localFileService=i,this._instanceService=c}get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}registerRecordedCommand(r){if(r.type===a.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(r.id)}togglePanel(r){this._panelOpened$.next(r),r===!1&&this.stopRecording()}startRecording(r=!1){this._recorder=this._commandSrv.onCommandExecuted(n=>{var i,c;if(this._shouldRecordCommands.has(n.id)){const d=this._recorded,u=this._recordedCommands;let v={...n};const R=(i=this._instanceService.getFocusedUnit())==null?void 0:i.getUnitId(),{unitId:h=R,subUnitId:f}=v==null?void 0:v.params;if(r&&h&&f){const F=(c=this._instanceService.getUnit(h).getSheetBySheetId(f))==null?void 0:c.getName();v={...v,params:{...v.params,subUnitId:F}}}v.id===s.SetSelectionsOperation.id&&d.length>0&&d[d.length-1].id===s.SetSelectionsOperation.id?d[d.length-1]=v:(d.push(v),this._recorded$.next(d),v.type===a.CommandType.COMMAND&&(u.push(v),this._recordedCommands$.next(u)))}}),this._recording$.next(!0)}stopRecording(){var r;(r=this._recorder)==null||r.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const r=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(r,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",r),this.stopRecording()}},o.ActionRecorderService=Q([M(0,a.ICommandService),M(1,a.ILogService),M(2,l.ILocalFileService),M(3,a.IUniverInstanceService)],o.ActionRecorderService);const L={id:"action-recorder.command.start-recording",type:a.CommandType.COMMAND,handler:(e,t)=>(e.get(o.ActionRecorderService).startRecording(!!(t!=null&&t.replaceId)),!0)},B={id:"action-recorder.command.complete-recording",type:a.CommandType.COMMAND,handler:e=>(e.get(o.ActionRecorderService).completeRecording(),!0)},k={id:"action-recorder.command.stop-recording",type:a.CommandType.COMMAND,handler:e=>(e.get(o.ActionRecorderService).completeRecording(),!0)};var X=Object.getOwnPropertyDescriptor,ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?X(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},I=(e,t)=>(r,n)=>t(r,n,e),j=(e=>(e.DEFAULT="default",e.NAME="name",e.ACTIVE="active",e))(j||{});o.ActionReplayService=class extends a.Disposable{constructor(t,r,n,i,c){super(),this._messageService=t,this._instanceService=r,this._localFileService=n,this._logService=i,this._commandService=c}async replayLocalJSON(t="default"){const r=await this._localFileService.openFile({multiple:!1,accept:".json"});if(r.length!==1)return!1;const n=r[0];try{return this.replayCommands(JSON.parse(await n.text()),{mode:t})}catch{return this._messageService.show({type:y.MessageType.Error,content:`Failed to replay commands from local file ${n.name}.`}),!1}}async replayCommands(t,r){var c,d,u;const n=(c=this._instanceService.getFocusedUnit())==null?void 0:c.getUnitId();n||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode:i}=r||{};for(const v of t){const{id:R,params:h}=v,f=h;if(f){if(typeof f.unitId<"u"&&(f.unitId=n),i==="name"&&f.subUnitId!=="undefined"){const O=(d=this._instanceService.getFocusedUnit().getSheetBySheetName(f.subUnitId))==null?void 0:d.getSheetId();O?f.subUnitId=O:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${f.subUnitId}`)}if(i==="active"&&f.subUnitId!=="undefined"){const O=(u=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:u.getSheetId();O?f.subUnitId=O:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(R,h))return!1}else if(!await this._commandService.executeCommand(R))return!1}return!0}async replayCommandsWithDelay(t){var n;const r=(n=this._instanceService.getFocusedUnit())==null?void 0:n.getUnitId();r||this._logService.error("[ReplayService]","no focused unit to replay commands");for(const i of t){await a.awaitTime(re());const{id:c,params:d}=i;if(d){if(typeof d.unitId<"u"&&(d.unitId=r),!await this._commandService.executeCommand(c,d))return!1}else if(!await this._commandService.executeCommand(c))return!1}return!0}},o.ActionReplayService=ee([I(0,l.IMessageService),I(1,a.IUniverInstanceService),I(2,l.ILocalFileService),I(3,a.ILogService),I(4,a.ICommandService)],o.ActionReplayService);function re(){return Math.floor(Math.random()*800)+200}const N={id:"action-recorder.command.replay-local-records",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(o.ActionReplayService).replayLocalJSON();return r&&e.get(l.IMessageService).show({type:y.MessageType.Success,content:"Successfully replayed local records"}),r}},P={id:"action-recorder.command.replay-local-records-name",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(o.ActionReplayService).replayLocalJSON(j.NAME);return r&&e.get(l.IMessageService).show({type:y.MessageType.Success,content:"Successfully replayed local records"}),r}},U={id:"action-recorder.command.replay-local-records-active",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(o.ActionReplayService).replayLocalJSON(j.ACTIVE);return r&&e.get(l.IMessageService).show({type:y.MessageType.Success,content:"Successfully replayed local records"}),r}},$={id:"action-recorder.operation.open-panel",type:a.CommandType.OPERATION,handler(e){return e.get(o.ActionRecorderService).togglePanel(!0),!0}},V={id:"action-recorder.operation.close-panel",type:a.CommandType.OPERATION,handler(e){return e.get(o.ActionRecorderService).togglePanel(!1),!0}};function ne(){const e=l.useDependency(o.ActionRecorderService);return l.useObservable(e.panelOpened$)?p.jsx(te,{}):null}function te(){var h;const e=l.useDependency(a.ICommandService),t=l.useDependency(o.ActionRecorderService),r=l.useObservable(t.recording$),n=l.useObservable(t.recordedCommands$),i=(h=n==null?void 0:n.length)!=null?h:0,c=C.useCallback(()=>{r||e.executeCommand(V.id)},[e,r]),d=C.useCallback(f=>{r||e.executeCommand(L.id,{replaceId:f})},[e,r]),u=C.useCallback(()=>{r&&e.executeCommand(B.id)},[e,r]),v=C.useCallback(()=>{r&&e.executeCommand(k.id)},[e,r]),R=r?i===0?"Recording...":`${i}: ${n[i-1].id}`:"Start Recording";return p.jsxs("div",{className:"univer-fixed univer-bottom-20 univer-left-1/2 univer-z-[1000] univer-flex univer-h-16 univer-w-[512px] -univer-translate-x-1/2 univer-items-center univer-rounded-lg univer-bg-white univer-px-5 univer-shadow-lg",children:[p.jsx("div",{className:"univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl",children:p.jsx(w,{})}),p.jsx("div",{className:"univer-flex-1 univer-text-sm",children:R}),p.jsxs("div",{className:"univer-flex univer-w-64 univer-shrink-0 univer-grow-0 univer-justify-between",children:[p.jsx(y.Button,{className:"univer-w-20",onClick:r?v:c,children:r?"Cancel":"Close"}),p.jsx(y.Button,{className:"univer-w-20",variant:"primary",onClick:r?u:()=>d(),children:r?"Save":"Start"}),!r&&p.jsx(y.Button,{variant:"primary",onClick:()=>d(!0),children:"Start(N)"})]})]})}const W="RECORD_MENU_ITEM";function ie(){return{id:W,type:l.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}function oe(e){const t=e.get(o.ActionRecorderService);return{id:$.id,title:"action-recorder.menu.record",type:l.MenuItemType.BUTTON,disabled$:t.panelOpened$}}function ce(){return{id:N.id,title:"action-recorder.menu.replay-local",type:l.MenuItemType.BUTTON}}function ae(){return{id:P.id,title:"action-recorder.menu.replay-local-name",type:l.MenuItemType.BUTTON}}function de(){return{id:U.id,title:"action-recorder.menu.replay-local-active",type:l.MenuItemType.BUTTON}}const se={[l.RibbonStartGroup.OTHERS]:{[W]:{order:10,menuItemFactory:ie,[$.id]:{order:1,menuItemFactory:oe},[N.id]:{order:2,menuItemFactory:ce},[P.id]:{order:3,menuItemFactory:ae},[U.id]:{order:4,menuItemFactory:de}}}};var le=Object.getOwnPropertyDescriptor,me=(e,t,r,n)=>{for(var i=n>1?void 0:n?le(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},_=(e,t)=>(r,n)=>t(r,n,e);let b=class extends a.Disposable{constructor(e,t,r,n,i,c){super(),this._commandSrv=e,this._uiPartsSrv=t,this._menuManagerService=r,this._componentManager=n,this._actionRecorderService=i,this._injector=c,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[L,k,B,$,V,N,P,U].forEach(e=>this._commandSrv.registerCommand(e))}_initUI(){this._uiPartsSrv.registerComponent(l.BuiltInUIPart.GLOBAL,()=>l.connectInjector(ne,this._injector)),this._componentManager.register("RecordSingle",w),this._menuManagerService.mergeMenu(se)}_initSheetsCommands(){[s.CopySheetCommand,s.DeleteRangeMoveLeftCommand,s.DeleteRangeMoveUpCommand,s.DeltaColumnWidthCommand,s.DeltaRowHeightCommand,s.InsertSheetCommand,s.InsertColAfterCommand,s.InsertColBeforeCommand,s.InsertRowAfterCommand,s.InsertRowBeforeCommand,s.RemoveSheetCommand,s.SetStyleCommand,s.AddWorksheetMergeCommand,s.AddWorksheetMergeAllCommand,s.AddWorksheetMergeVerticalCommand,s.AddWorksheetMergeHorizontalCommand,s.SetFrozenCommand,s.CancelFrozenCommand,s.SetHorizontalTextAlignCommand,s.SetOverlineCommand,m.SetRangeBoldCommand,m.SetRangeFontFamilyCommand,m.SetRangeFontSizeCommand,m.SetRangeItalicCommand,m.SetRangeStrickThroughCommand,m.SetRangeSubscriptCommand,m.SetRangeSuperscriptCommand,m.SetRangeTextColorCommand,m.SetRangeUnderlineCommand,s.SetRangeValuesCommand,s.SetStrikeThroughCommand,s.SetTextColorCommand,s.SetTextRotationCommand,s.SetTextWrapCommand,s.SetVerticalTextAlignCommand,m.SheetCopyCommand,m.SheetCutCommand,m.SheetPasteBesidesBorderCommand,m.SheetPasteColWidthCommand,m.SheetPasteCommand,m.SheetPasteFormatCommand,m.SheetPasteShortKeyCommand,m.SheetPasteValueCommand,m.AutoFillCommand,m.RefillCommand,s.SetWorksheetActivateCommand,s.SetWorksheetActiveOperation,s.SetSelectionsOperation,T.SetSheetFilterRangeCommand,T.SetSheetsFilterCriteriaCommand,T.RemoveSheetFilterCommand].forEach(e=>this._actionRecorderService.registerRecordedCommand(e))}_initDocsCommands(){}};b=me([_(0,a.ICommandService),_(1,l.IUIPartsService),_(2,l.IMenuManagerService),_(3,a.Inject(l.ComponentManager)),_(4,a.Inject(o.ActionRecorderService)),_(5,a.Inject(a.Injector))],b);const ue="action-recorder.config",q={};var ve=Object.getOwnPropertyDescriptor,fe=(e,t,r,n)=>{for(var i=n>1?void 0:n?ve(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},z=(e,t)=>(r,n)=>t(r,n,e);o.UniverActionRecorderPlugin=(D=class extends a.Plugin{constructor(t=q,r,n){super(),this._config=t,this._injector=r,this._configService=n;const{menu:i,...c}=a.merge({},q,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(ue,c)}onStarting(){(this._config.replayOnly?[[o.ActionReplayService]]:[[o.ActionRecorderService],[o.ActionReplayService],[b]]).forEach(r=>this._injector.add(r))}onSteady(){this._config.replayOnly||this._injector.get(b)}},g(D,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),D),o.UniverActionRecorderPlugin=fe([z(1,a.Inject(a.Injector)),z(2,a.IConfigService)],o.UniverActionRecorderPlugin),Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-filter"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/design"),require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-filter","@univerjs/sheets-ui","@univerjs/ui","rxjs","@univerjs/design","react/jsx-runtime","react"],a):(o=typeof globalThis<"u"?globalThis:o||self,a(o.UniverActionRecorder={},o.UniverCore,o.UniverSheets,o.UniverSheetsFilter,o.UniverSheetsUi,o.UniverUi,o.rxjs,o.UniverDesign,o.React,o.React))})(this,function(o,a,s,T,m,l,A,y,p,C){"use strict";var Se=Object.defineProperty;var ge=(o,a,s)=>a in o?Se(o,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[a]=s;var g=(o,a,s)=>ge(o,typeof a!="symbol"?a+"":a,s);var D;var S=function(){return S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},S.apply(this,arguments)},H=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},x=C.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,c=e.extend,d=H(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=C.useRef("_".concat(Z()));return E(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},S({ref:t,className:u},d),c)});function E(e,t,r,n,i){return C.createElement(e.tag,S(S({key:t},J(e,r,i)),n),(G(e,r).children||[]).map(function(c,d){return E(c,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function J(e,t,r){var n=S({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(c){var d=c[0],u=c[1];d==="mask"&&typeof u=="string"&&(n[d]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(c){var d=c[0],u=c[1];typeof u=="string"&&(n[d]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function G(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?S(S({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?S(S({},i),{attrs:S(S({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function Z(){return Math.random().toString(36).substring(2,8)}x.displayName="UniverIcon";var K={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#record-single_clip0_1559_19)"},children:[{tag:"path",attrs:{d:"M7.60303 10C8.7076 10 9.60303 9.10457 9.60303 8C9.60303 6.89543 8.7076 6 7.60303 6C6.49846 6 5.60303 6.89543 5.60303 8C5.60303 9.10457 6.49846 10 7.60303 10Z"}},{tag:"path",attrs:{d:"M1.66943 5.29023C1.66941 3.85426 2.83349 2.69017 4.26946 2.69019L10.9362 2.69026C12.3192 2.69028 13.45 3.77008 13.5315 5.13259L14.5692 4.55638C15.3024 4.14929 16.2032 4.67947 16.2032 5.51809V10.4819C16.2032 11.3205 15.3024 11.8507 14.5692 11.4436L13.5315 10.8674C13.45 12.2299 12.3192 13.3097 10.9362 13.3097H4.26953C2.83361 13.3097 1.66956 12.1457 1.66953 10.7098L1.66943 5.29023ZM13.5362 9.49743L15.0032 10.312V5.68799L13.5362 6.50254V9.49743ZM4.26945 3.89019C3.49623 3.89018 2.86942 4.517 2.86943 5.29021L2.86953 10.7098C2.86955 11.483 3.49634 12.1097 4.26953 12.1097H10.9362C11.7094 12.1097 12.3362 11.4829 12.3362 10.7097V5.29026C12.3362 4.51707 11.7094 3.89027 10.9362 3.89026L4.26945 3.89019Z",fillRule:"evenodd",clipRule:"evenodd"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"record-single_clip0_1559_19"},children:[{tag:"path",attrs:{fill:"#fff",d:"M0 0H16V16H0z",transform:"translate(.94)"}}]}]}],defIds:["record-single_clip0_1559_19"]},w=C.forwardRef(function(e,t){return C.createElement(x,Object.assign({},e,{id:"record-single",ref:t,icon:K}))});w.displayName="RecordSingle";var Y=Object.getOwnPropertyDescriptor,Q=(e,t,r,n)=>{for(var i=n>1?void 0:n?Y(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},M=(e,t)=>(r,n)=>t(r,n,e);o.ActionRecorderService=class extends a.Disposable{constructor(r,n,i,c){super();g(this,"_shouldRecordCommands",new Set);g(this,"_panelOpened$",new A.BehaviorSubject(!1));g(this,"panelOpened$",this._panelOpened$.asObservable());g(this,"_recorder",null);g(this,"_recording$",new A.BehaviorSubject(!1));g(this,"recording$",this._recording$.asObservable());g(this,"_recorded$",new A.BehaviorSubject([]));g(this,"_recordedCommands$",new A.BehaviorSubject([]));g(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=r,this._logService=n,this._localFileService=i,this._instanceService=c}get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}registerRecordedCommand(r){if(r.type===a.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(r.id)}togglePanel(r){this._panelOpened$.next(r),r===!1&&this.stopRecording()}startRecording(r=!1){this._recorder=this._commandSrv.onCommandExecuted(n=>{var i,c;if(this._shouldRecordCommands.has(n.id)){const d=this._recorded,u=this._recordedCommands;let v={...n};const R=(i=this._instanceService.getFocusedUnit())==null?void 0:i.getUnitId(),{unitId:h=R,subUnitId:f}=v==null?void 0:v.params;if(r&&h&&f){const F=(c=this._instanceService.getUnit(h).getSheetBySheetId(f))==null?void 0:c.getName();v={...v,params:{...v.params,subUnitId:F}}}v.id===s.SetSelectionsOperation.id&&d.length>0&&d[d.length-1].id===s.SetSelectionsOperation.id?d[d.length-1]=v:(d.push(v),this._recorded$.next(d),v.type===a.CommandType.COMMAND&&(u.push(v),this._recordedCommands$.next(u)))}}),this._recording$.next(!0)}stopRecording(){var r;(r=this._recorder)==null||r.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const r=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(r,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",r),this.stopRecording()}},o.ActionRecorderService=Q([M(0,a.ICommandService),M(1,a.ILogService),M(2,l.ILocalFileService),M(3,a.IUniverInstanceService)],o.ActionRecorderService);const L={id:"action-recorder.command.start-recording",type:a.CommandType.COMMAND,handler:(e,t)=>(e.get(o.ActionRecorderService).startRecording(!!(t!=null&&t.replaceId)),!0)},B={id:"action-recorder.command.complete-recording",type:a.CommandType.COMMAND,handler:e=>(e.get(o.ActionRecorderService).completeRecording(),!0)},k={id:"action-recorder.command.stop-recording",type:a.CommandType.COMMAND,handler:e=>(e.get(o.ActionRecorderService).completeRecording(),!0)};var X=Object.getOwnPropertyDescriptor,ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?X(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},I=(e,t)=>(r,n)=>t(r,n,e),j=(e=>(e.DEFAULT="default",e.NAME="name",e.ACTIVE="active",e))(j||{});o.ActionReplayService=class extends a.Disposable{constructor(t,r,n,i,c){super(),this._messageService=t,this._instanceService=r,this._localFileService=n,this._logService=i,this._commandService=c}async replayLocalJSON(t="default"){const r=await this._localFileService.openFile({multiple:!1,accept:".json"});if(r.length!==1)return!1;const n=r[0];try{return this.replayCommands(JSON.parse(await n.text()),{mode:t})}catch{return this._messageService.show({type:y.MessageType.Error,content:`Failed to replay commands from local file ${n.name}.`}),!1}}async replayCommands(t,r){var c,d,u;const n=(c=this._instanceService.getFocusedUnit())==null?void 0:c.getUnitId();n||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode:i}=r||{};for(const v of t){const{id:R,params:h}=v,f=h;if(f){if(typeof f.unitId<"u"&&(f.unitId=n),i==="name"&&f.subUnitId!=="undefined"){const O=(d=this._instanceService.getFocusedUnit().getSheetBySheetName(f.subUnitId))==null?void 0:d.getSheetId();O?f.subUnitId=O:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${f.subUnitId}`)}if(i==="active"&&f.subUnitId!=="undefined"){const O=(u=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:u.getSheetId();O?f.subUnitId=O:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(R,h))return!1}else if(!await this._commandService.executeCommand(R))return!1}return!0}async replayCommandsWithDelay(t){var n;const r=(n=this._instanceService.getFocusedUnit())==null?void 0:n.getUnitId();r||this._logService.error("[ReplayService]","no focused unit to replay commands");for(const i of t){await a.awaitTime(re());const{id:c,params:d}=i;if(d){if(typeof d.unitId<"u"&&(d.unitId=r),!await this._commandService.executeCommand(c,d))return!1}else if(!await this._commandService.executeCommand(c))return!1}return!0}},o.ActionReplayService=ee([I(0,l.IMessageService),I(1,a.IUniverInstanceService),I(2,l.ILocalFileService),I(3,a.ILogService),I(4,a.ICommandService)],o.ActionReplayService);function re(){return Math.floor(Math.random()*800)+200}const N={id:"action-recorder.command.replay-local-records",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(o.ActionReplayService).replayLocalJSON();return r&&e.get(l.IMessageService).show({type:y.MessageType.Success,content:"Successfully replayed local records"}),r}},P={id:"action-recorder.command.replay-local-records-name",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(o.ActionReplayService).replayLocalJSON(j.NAME);return r&&e.get(l.IMessageService).show({type:y.MessageType.Success,content:"Successfully replayed local records"}),r}},U={id:"action-recorder.command.replay-local-records-active",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(o.ActionReplayService).replayLocalJSON(j.ACTIVE);return r&&e.get(l.IMessageService).show({type:y.MessageType.Success,content:"Successfully replayed local records"}),r}},$={id:"action-recorder.operation.open-panel",type:a.CommandType.OPERATION,handler(e){return e.get(o.ActionRecorderService).togglePanel(!0),!0}},V={id:"action-recorder.operation.close-panel",type:a.CommandType.OPERATION,handler(e){return e.get(o.ActionRecorderService).togglePanel(!1),!0}};function ne(){const e=l.useDependency(o.ActionRecorderService);return l.useObservable(e.panelOpened$)?p.jsx(te,{}):null}function te(){var h;const e=l.useDependency(a.ICommandService),t=l.useDependency(o.ActionRecorderService),r=l.useObservable(t.recording$),n=l.useObservable(t.recordedCommands$),i=(h=n==null?void 0:n.length)!=null?h:0,c=C.useCallback(()=>{r||e.executeCommand(V.id)},[e,r]),d=C.useCallback(f=>{r||e.executeCommand(L.id,{replaceId:f})},[e,r]),u=C.useCallback(()=>{r&&e.executeCommand(B.id)},[e,r]),v=C.useCallback(()=>{r&&e.executeCommand(k.id)},[e,r]),R=r?i===0?"Recording...":`${i}: ${n[i-1].id}`:"Start Recording";return p.jsxs("div",{className:"univer-fixed univer-bottom-20 univer-left-1/2 univer-z-[1000] univer-flex univer-h-16 univer-w-[512px] -univer-translate-x-1/2 univer-items-center univer-rounded-lg univer-bg-white univer-px-5 univer-shadow-lg",children:[p.jsx("div",{className:"univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl",children:p.jsx(w,{})}),p.jsx("div",{className:"univer-flex-1 univer-text-sm",children:R}),p.jsxs("div",{className:"univer-flex univer-w-64 univer-shrink-0 univer-grow-0 univer-justify-between",children:[p.jsx(y.Button,{className:"univer-w-20",onClick:r?v:c,children:r?"Cancel":"Close"}),p.jsx(y.Button,{className:"univer-w-20",variant:"primary",onClick:r?u:()=>d(),children:r?"Save":"Start"}),!r&&p.jsx(y.Button,{variant:"primary",onClick:()=>d(!0),children:"Start(N)"})]})]})}const W="RECORD_MENU_ITEM";function ie(){return{id:W,type:l.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}function oe(e){const t=e.get(o.ActionRecorderService);return{id:$.id,title:"action-recorder.menu.record",type:l.MenuItemType.BUTTON,disabled$:t.panelOpened$}}function ce(){return{id:N.id,title:"action-recorder.menu.replay-local",type:l.MenuItemType.BUTTON}}function ae(){return{id:P.id,title:"action-recorder.menu.replay-local-name",type:l.MenuItemType.BUTTON}}function de(){return{id:U.id,title:"action-recorder.menu.replay-local-active",type:l.MenuItemType.BUTTON}}const se={[l.RibbonStartGroup.OTHERS]:{[W]:{order:2,menuItemFactory:ie,[$.id]:{order:1,menuItemFactory:oe},[N.id]:{order:2,menuItemFactory:ce},[P.id]:{order:3,menuItemFactory:ae},[U.id]:{order:4,menuItemFactory:de}}}};var le=Object.getOwnPropertyDescriptor,me=(e,t,r,n)=>{for(var i=n>1?void 0:n?le(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},_=(e,t)=>(r,n)=>t(r,n,e);let b=class extends a.Disposable{constructor(e,t,r,n,i,c){super(),this._commandSrv=e,this._uiPartsSrv=t,this._menuManagerService=r,this._componentManager=n,this._actionRecorderService=i,this._injector=c,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[L,k,B,$,V,N,P,U].forEach(e=>this._commandSrv.registerCommand(e))}_initUI(){this._uiPartsSrv.registerComponent(l.BuiltInUIPart.GLOBAL,()=>l.connectInjector(ne,this._injector)),this.disposeWithMe(this._componentManager.register("RecordSingle",w)),this._menuManagerService.mergeMenu(se)}_initSheetsCommands(){[s.CopySheetCommand,s.DeleteRangeMoveLeftCommand,s.DeleteRangeMoveUpCommand,s.DeltaColumnWidthCommand,s.DeltaRowHeightCommand,s.InsertSheetCommand,s.InsertColAfterCommand,s.InsertColBeforeCommand,s.InsertRowAfterCommand,s.InsertRowBeforeCommand,s.RemoveSheetCommand,s.SetStyleCommand,s.AddWorksheetMergeCommand,s.AddWorksheetMergeAllCommand,s.AddWorksheetMergeVerticalCommand,s.AddWorksheetMergeHorizontalCommand,s.SetFrozenCommand,s.CancelFrozenCommand,s.SetHorizontalTextAlignCommand,s.SetOverlineCommand,m.SetRangeBoldCommand,m.SetRangeFontFamilyCommand,m.SetRangeFontSizeCommand,m.SetRangeItalicCommand,m.SetRangeStrickThroughCommand,m.SetRangeSubscriptCommand,m.SetRangeSuperscriptCommand,m.SetRangeTextColorCommand,m.SetRangeUnderlineCommand,s.SetRangeValuesCommand,s.SetStrikeThroughCommand,s.SetTextColorCommand,s.SetTextRotationCommand,s.SetTextWrapCommand,s.SetVerticalTextAlignCommand,m.SheetCopyCommand,m.SheetCutCommand,m.SheetPasteBesidesBorderCommand,m.SheetPasteColWidthCommand,m.SheetPasteCommand,m.SheetPasteFormatCommand,m.SheetPasteShortKeyCommand,m.SheetPasteValueCommand,m.AutoFillCommand,m.RefillCommand,s.SetWorksheetActivateCommand,s.SetWorksheetActiveOperation,s.SetSelectionsOperation,T.SetSheetFilterRangeCommand,T.SetSheetsFilterCriteriaCommand,T.RemoveSheetFilterCommand].forEach(e=>this._actionRecorderService.registerRecordedCommand(e))}_initDocsCommands(){}};b=me([_(0,a.ICommandService),_(1,l.IUIPartsService),_(2,l.IMenuManagerService),_(3,a.Inject(l.ComponentManager)),_(4,a.Inject(o.ActionRecorderService)),_(5,a.Inject(a.Injector))],b);const ue="action-recorder.config",q={};var ve=Object.getOwnPropertyDescriptor,fe=(e,t,r,n)=>{for(var i=n>1?void 0:n?ve(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=d(i)||i);return i},z=(e,t)=>(r,n)=>t(r,n,e);o.UniverActionRecorderPlugin=(D=class extends a.Plugin{constructor(t=q,r,n){super(),this._config=t,this._injector=r,this._configService=n;const{menu:i,...c}=a.merge({},q,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(ue,c)}onStarting(){(this._config.replayOnly?[[o.ActionReplayService]]:[[o.ActionRecorderService],[o.ActionReplayService],[b]]).forEach(r=>this._injector.add(r))}onSteady(){this._config.replayOnly||this._injector.get(b)}},g(D,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),D),o.UniverActionRecorderPlugin=fe([z(1,a.Inject(a.Injector)),z(2,a.IConfigService)],o.UniverActionRecorderPlugin),Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderEnUS=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}}});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderEnUS=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record...","replay-local-name":"Replace Local Record by Subunit...","replay-local-active":"Replace Local Record by Current Subunit..."}}}});
@@ -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.UniverActionRecorderFaIR=n())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت..."}}}});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderFaIR=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت...","replay-local-name":"بازپخش محلی ثبت بر اساس نام زیر واحد...","replay-local-active":"بازپخش محلی ثبت بر اساس زیر واحد فعلی..."}}}});
@@ -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.UniverActionRecorderFrFR=n())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Enregistrer les actions",record:"Enregistrer les actions...","replay-local":"Lecture de l'enregistrement local..."}}}});
1
+ (function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l():typeof define=="function"&&define.amd?define(l):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderFrFR=l())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Enregistrer les actions",record:"Enregistrer les actions...","replay-local":"Lecture de l'enregistrement local...","replay-local-name":"Remplacer l'enregistrement local par le sous-unité...","replay-local-active":"Remplacer l'enregistrement local par le sous-unité actuel..."}}}});
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderRuRU=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}}});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderRuRU=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record...","replay-local-name":"Replace Local Record by Subunit...","replay-local-active":"Replace Local Record by Current Subunit..."}}}});
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderViVN=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}}});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderViVN=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record...","replay-local-name":"Replace Local Record by Subunit...","replay-local-active":"Replace Local Record by Current Subunit..."}}}});
@@ -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.UniverActionRecorderZhCN=n())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}}});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderZhCN=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制...","replay-local-name":"根据子表名回放本地录制...","replay-local-active":"根据当前子表回放本地录制..."}}}});
@@ -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.UniverActionRecorderZhTW=n())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}}});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderZhTW=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"操作錄製",record:"錄製操作...","replay-local":"回放本地錄製...","replay-local-name":"根據子表名回放本地錄製...","replay-local-active":"根據當前子表回放本地錄製..."}}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/action-recorder",
3
- "version": "0.7.0",
3
+ "version": "0.8.0-beta.0",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -53,12 +53,12 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@univerjs/icons": "^0.3.24",
56
- "@univerjs/core": "0.7.0",
57
- "@univerjs/sheets": "0.7.0",
58
- "@univerjs/sheets-filter": "0.7.0",
59
- "@univerjs/ui": "0.7.0",
60
- "@univerjs/sheets-ui": "0.7.0",
61
- "@univerjs/design": "0.7.0"
56
+ "@univerjs/core": "0.8.0-beta.0",
57
+ "@univerjs/design": "0.8.0-beta.0",
58
+ "@univerjs/sheets": "0.8.0-beta.0",
59
+ "@univerjs/sheets-filter": "0.8.0-beta.0",
60
+ "@univerjs/sheets-ui": "0.8.0-beta.0",
61
+ "@univerjs/ui": "0.8.0-beta.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "react": "18.3.1",
@@ -66,8 +66,8 @@
66
66
  "tailwindcss": "^3.4.17",
67
67
  "typescript": "^5.8.3",
68
68
  "vite": "^6.3.5",
69
- "vitest": "^3.1.3",
70
- "@univerjs-infra/shared": "0.7.0"
69
+ "vitest": "^3.1.4",
70
+ "@univerjs-infra/shared": "0.8.0-beta.0"
71
71
  },
72
72
  "scripts": {
73
73
  "test": "vitest run",