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

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 g=(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 S=function(){return S=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},S.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 o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]]);return r},E=h.forwardRef(function(e,n){var r=e.icon,t=e.id,o=e.className,i=e.extend,c=J(e,["icon","id","className","extend"]),m="univerjs-icon univerjs-icon-".concat(t," ").concat(o||"").trim(),u=h.useRef("_".concat(K()));return L(r,"".concat(t),{defIds:r.defIds,idSuffix:u.current},S({ref:n,className:m},c),i)});function L(e,n,r,t,o){return h.createElement(e.tag,S(S({key:n},G(e,r,o)),t),(Z(e,r).children||[]).map(function(i,c){return L(i,"".concat(n,"-").concat(e.tag,"-").concat(c),r,void 0,o)}))}function G(e,n,r){var t=S({},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(i){var c=i[0],m=i[1];c==="mask"&&typeof m=="string"&&(t[c]=m.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))});var o=n.defIds;return!o||o.length===0||(e.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(i){var c=i[0],m=i[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)?S(S({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&t&&t.includes(o.attrs.id)?S(S({},o),{attrs:S(S({},o.attrs),{id:o.attrs.id+n.idSuffix})}):o})}):e}function K(){return Math.random().toString(36).substring(2,8)}E.displayName="UniverIcon";var Y={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#record-icon_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-icon_clip0_1559_19"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.94)"}}]}]}],defIds:["record-icon_clip0_1559_19"]},T=h.forwardRef(function(e,n){return h.createElement(E,Object.assign({},e,{id:"record-icon",ref:n,icon:Y}))});T.displayName="RecordIcon";var Q=Object.getOwnPropertyDescriptor,X=(e,n,r,t)=>{for(var o=t>1?void 0:t?Q(n,r):n,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o},A=(e,n)=>(r,t)=>n(r,t,e);exports.ActionRecorderService=class extends s.Disposable{constructor(r,t,o,i){super();g(this,"_shouldRecordCommands",new Set);g(this,"_panelOpened$",new O.BehaviorSubject(!1));g(this,"panelOpened$",this._panelOpened$.asObservable());g(this,"_recorder",null);g(this,"_recording$",new O.BehaviorSubject(!1));g(this,"recording$",this._recording$.asObservable());g(this,"_recorded$",new O.BehaviorSubject([]));g(this,"_recordedCommands$",new O.BehaviorSubject([]));g(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=r,this._logService=t,this._localFileService=o,this._instanceService=i}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 o,i;if(this._shouldRecordCommands.has(t.id)){const c=this._recorded,m=this._recordedCommands;let u={...t};const y=(o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId(),{unitId:p=y,subUnitId:v}=u==null?void 0:u.params;if(r&&p&&v){const x=(i=this._instanceService.getUnit(p).getSheetBySheetId(v))==null?void 0:i.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 o=t>1?void 0:t?ee(n,r):n,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o},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,o,i){super(),this._messageService=n,this._instanceService=r,this._localFileService=t,this._logService=o,this._commandService=i}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 i,c,m;const t=(i=this._instanceService.getFocusedUnit())==null?void 0:i.getUnitId();t||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode:o}=r||{};for(const u of n){const{id:y,params:p}=u,v=p;if(v){if(typeof v.unitId<"u"&&(v.unitId=t),o==="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(o==="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 o of n){await s.awaitTime(te());const{id:i,params:c}=o;if(c){if(typeof c.unitId<"u"&&(c.unitId=r),!await this._commandService.executeCommand(i,c))return!1}else if(!await this._commandService.executeCommand(i))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(oe,{}):null}function oe(){var p;const e=d.useDependency(s.ICommandService),n=d.useDependency(exports.ActionRecorderService),r=d.useObservable(n.recording$),t=d.useObservable(n.recordedCommands$),o=(p=t==null?void 0:t.length)!=null?p:0,i=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?o===0?"Recording...":`${o}: ${t[o-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:i,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 ie(){return{id:q,type:d.MenuItemType.SUBITEMS,icon:"RecordIcon",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:ie,[$.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 o=t>1?void 0:t?me(n,r):n,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o},_=(e,n)=>(r,t)=>n(r,t,e);let b=class extends s.Disposable{constructor(e,n,r,t,o,i){super(),this._commandSrv=e,this._uiPartsSrv=n,this._menuManagerService=r,this._componentManager=t,this._actionRecorderService=o,this._injector=i,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("RecordIcon",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 Se=Object.getOwnPropertyDescriptor,ge=(e,n,r,t)=>{for(var o=t>1?void 0:t?Se(n,r):n,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o},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:o,...i}=s.merge({},F,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(ve,i)}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)}},g(w,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),w);exports.UniverActionRecorderPlugin=ge([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,14 +1,14 @@
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 w, 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 he, DeltaRowHeightCommand as ge, InsertSheetCommand as ve, InsertColAfterCommand as pe, InsertColBeforeCommand as Se, InsertRowAfterCommand as Ce, InsertRowBeforeCommand as _e, RemoveSheetCommand as ye, SetStyleCommand as Re, AddWorksheetMergeCommand as Ie, AddWorksheetMergeAllCommand as Oe, AddWorksheetMergeVerticalCommand as we, AddWorksheetMergeHorizontalCommand as xe, 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
- import { jsx as h, jsxs as V } from "react/jsx-runtime";
11
+ import { jsx as g, jsxs as V } from "react/jsx-runtime";
12
12
  import { forwardRef as Y, useRef as ft, createElement as q, useCallback as I } from "react";
13
13
  var d = function() {
14
14
  return d = Object.assign || function(e) {
@@ -18,7 +18,7 @@ var d = function() {
18
18
  }
19
19
  return e;
20
20
  }, d.apply(this, arguments);
21
- }, gt = function(e, t) {
21
+ }, ht = function(e, t) {
22
22
  var r = {};
23
23
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
24
24
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
@@ -26,15 +26,15 @@ var d = function() {
26
26
  t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (r[n[o]] = e[n[o]]);
27
27
  return r;
28
28
  }, Q = Y(function(e, t) {
29
- var r = e.icon, n = e.id, o = e.className, i = e.extend, a = gt(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), f = ft("_".concat(St()));
29
+ var r = e.icon, n = e.id, o = e.className, i = e.extend, a = ht(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), f = ft("_".concat(pt()));
30
30
  return X(r, "".concat(n), { defIds: r.defIds, idSuffix: f.current }, d({ ref: t, className: c }, a), i);
31
31
  });
32
32
  function X(e, t, r, n, o) {
33
- return q(e.tag, d(d({ key: t }, ht(e, r, o)), n), (vt(e, r).children || []).map(function(i, a) {
33
+ return q(e.tag, d(d({ key: t }, gt(e, r, o)), n), (vt(e, r).children || []).map(function(i, a) {
34
34
  return X(i, "".concat(t, "-").concat(e.tag, "-").concat(a), r, void 0, o);
35
35
  }));
36
36
  }
37
- function ht(e, t, r) {
37
+ function gt(e, t, r) {
38
38
  var n = d({}, e.attrs);
39
39
  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(i) {
40
40
  var a = i[0], c = i[1];
@@ -49,21 +49,21 @@ function ht(e, t, r) {
49
49
  function vt(e, t) {
50
50
  var r, n = t.defIds;
51
51
  return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? d(d({}, e), { children: e.children.map(function(o) {
52
- return typeof o.attrs.id == "string" && n && n.indexOf(o.attrs.id) > -1 ? d(d({}, o), { attrs: d(d({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
52
+ return typeof o.attrs.id == "string" && n && n.includes(o.attrs.id) ? d(d({}, o), { attrs: d(d({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
53
53
  }) }) : e;
54
54
  }
55
- function St() {
55
+ function pt() {
56
56
  return Math.random().toString(36).substring(2, 8);
57
57
  }
58
58
  Q.displayName = "UniverIcon";
59
- var pt = { 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"] }, E = Y(function(e, t) {
59
+ var St = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { fill: "currentColor", clipPath: "url(#record-icon_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-icon_clip0_1559_19" }, children: [{ tag: "path", attrs: { fill: "white", d: "M0 0H16V16H0z", transform: "translate(.94)" } }] }] }], defIds: ["record-icon_clip0_1559_19"] }, E = Y(function(e, t) {
60
60
  return q(Q, Object.assign({}, e, {
61
- id: "record-single",
61
+ id: "record-icon",
62
62
  ref: t,
63
- icon: pt
63
+ icon: St
64
64
  }));
65
65
  });
66
- E.displayName = "RecordSingle";
66
+ E.displayName = "RecordIcon";
67
67
  var Ct = Object.getOwnPropertyDescriptor, _t = (e, t, r, n) => {
68
68
  for (var o = n > 1 ? void 0 : n ? Ct(t, r) : t, i = e.length - 1, a; i >= 0; i--)
69
69
  (a = e[i]) && (o = a(o) || o);
@@ -105,14 +105,14 @@ let l = class extends T {
105
105
  if (this._shouldRecordCommands.has(r.id)) {
106
106
  const i = this._recorded, a = this._recordedCommands;
107
107
  let c = { ...r };
108
- const f = (n = this._instanceService.getFocusedUnit()) == null ? void 0 : n.getUnitId(), { unitId: g = f, subUnitId: s } = c == null ? void 0 : c.params;
109
- if (t && g && s) {
110
- const p = (o = this._instanceService.getUnit(g).getSheetBySheetId(s)) == null ? void 0 : o.getName();
108
+ const f = (n = this._instanceService.getFocusedUnit()) == null ? void 0 : n.getUnitId(), { unitId: h = f, subUnitId: s } = c == null ? void 0 : c.params;
109
+ if (t && h && s) {
110
+ const S = (o = this._instanceService.getUnit(h).getSheetBySheetId(s)) == null ? void 0 : o.getName();
111
111
  c = {
112
112
  ...c,
113
113
  params: {
114
114
  ...c.params,
115
- subUnitId: p
115
+ subUnitId: S
116
116
  }
117
117
  };
118
118
  }
@@ -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)
@@ -184,7 +184,7 @@ let v = class extends T {
184
184
  r || this._logService.error("[ReplayService]", "no focused unit to replay commands");
185
185
  const { mode: n } = t || {};
186
186
  for (const c of e) {
187
- const { id: f, params: g } = c, s = g;
187
+ const { id: f, params: h } = c, s = h;
188
188
  if (s) {
189
189
  if (typeof s.unitId < "u" && (s.unitId = r), n === "name" && s.subUnitId !== "undefined") {
190
190
  const C = (i = this._instanceService.getFocusedUnit().getSheetBySheetName(s.subUnitId)) == null ? void 0 : i.getSheetId();
@@ -194,7 +194,7 @@ let v = class extends T {
194
194
  const C = (a = this._instanceService.getFocusedUnit().getActiveSheet()) == null ? void 0 : a.getSheetId();
195
195
  C ? s.subUnitId = C : this._logService.error("[ReplayService]", "failed to find active subunit");
196
196
  }
197
- if (!await this._commandService.executeCommand(f, g)) return !1;
197
+ if (!await this._commandService.executeCommand(f, h)) return !1;
198
198
  } else if (!await this._commandService.executeCommand(f)) return !1;
199
199
  }
200
200
  return !0;
@@ -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;
@@ -272,28 +272,28 @@ const j = {
272
272
  };
273
273
  function Ot() {
274
274
  const e = P(l);
275
- return F(e.panelOpened$) ? /* @__PURE__ */ h(xt, {}) : null;
275
+ return F(e.panelOpened$) ? /* @__PURE__ */ g(wt, {}) : null;
276
276
  }
277
- function xt() {
277
+ function wt() {
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
- }, [e, r]), a = I((p) => {
282
- r || e.executeCommand(ee.id, { replaceId: p });
281
+ }, [e, r]), a = I((S) => {
282
+ r || e.executeCommand(ee.id, { replaceId: S });
283
283
  }, [e, r]), c = I(() => {
284
284
  r && e.executeCommand(te.id);
285
285
  }, [e, r]), f = I(() => {
286
286
  r && e.executeCommand(re.id);
287
- }, [e, r]), g = r ? o === 0 ? "Recording..." : `${o}: ${n[o - 1].id}` : "Start Recording";
287
+ }, [e, r]), h = r ? o === 0 ? "Recording..." : `${o}: ${n[o - 1].id}` : "Start Recording";
288
288
  return /* @__PURE__ */ V(
289
289
  "div",
290
290
  {
291
291
  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",
292
292
  children: [
293
- /* @__PURE__ */ h("div", { className: "univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl", children: /* @__PURE__ */ h(E, {}) }),
294
- /* @__PURE__ */ h("div", { className: "univer-flex-1 univer-text-sm", children: g }),
293
+ /* @__PURE__ */ g("div", { className: "univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl", children: /* @__PURE__ */ g(E, {}) }),
294
+ /* @__PURE__ */ g("div", { className: "univer-flex-1 univer-text-sm", children: h }),
295
295
  /* @__PURE__ */ V("div", { className: "univer-flex univer-w-64 univer-shrink-0 univer-grow-0 univer-justify-between", children: [
296
- /* @__PURE__ */ h(
296
+ /* @__PURE__ */ g(
297
297
  U,
298
298
  {
299
299
  className: "univer-w-20",
@@ -301,7 +301,7 @@ function xt() {
301
301
  children: r ? "Cancel" : "Close"
302
302
  }
303
303
  ),
304
- /* @__PURE__ */ h(
304
+ /* @__PURE__ */ g(
305
305
  U,
306
306
  {
307
307
  className: "univer-w-20",
@@ -310,22 +310,22 @@ function xt() {
310
310
  children: r ? "Save" : "Start"
311
311
  }
312
312
  ),
313
- !r && /* @__PURE__ */ h(U, { variant: "primary", onClick: () => a(!0), children: "Start(N)" })
313
+ !r && /* @__PURE__ */ g(U, { variant: "primary", onClick: () => a(!0), children: "Start(N)" })
314
314
  ] })
315
315
  ]
316
316
  }
317
317
  );
318
318
  }
319
319
  const oe = "RECORD_MENU_ITEM";
320
- function wt() {
320
+ function xt() {
321
321
  return {
322
322
  id: oe,
323
323
  type: y.SUBITEMS,
324
- icon: "RecordSingle",
324
+ icon: "RecordIcon",
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,
362
- menuItemFactory: wt,
361
+ order: 2,
362
+ menuItemFactory: xt,
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,
@@ -383,8 +383,8 @@ var $t = Object.getOwnPropertyDescriptor, Pt = (e, t, r, n) => {
383
383
  for (var o = n > 1 ? void 0 : n ? $t(t, r) : t, i = e.length - 1, a; i >= 0; i--)
384
384
  (a = e[i]) && (o = a(o) || o);
385
385
  return o;
386
- }, S = (e, t) => (r, n) => t(r, n, e);
387
- let w = class extends T {
386
+ }, p = (e, t) => (r, n) => t(r, n, e);
387
+ let x = class extends T {
388
388
  constructor(e, t, r, n, o, i) {
389
389
  super(), this._commandSrv = e, this._uiPartsSrv = t, this._menuManagerService = r, this._componentManager = n, this._actionRecorderService = o, this._injector = i, this._initCommands(), this._initUI(), this._initSheetsCommands(), this._initDocsCommands();
390
390
  }
@@ -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("RecordIcon", E)
406
+ ), this._menuManagerService.mergeMenu(At);
405
407
  }
406
408
  _initSheetsCommands() {
407
409
  [
@@ -411,27 +413,27 @@ let w = class extends T {
411
413
  me,
412
414
  ue,
413
415
  fe,
414
- ge,
415
416
  he,
417
+ ge,
416
418
  ve,
417
- Se,
418
419
  pe,
420
+ Se,
419
421
  Ce,
420
422
  _e,
421
423
  ye,
422
424
  Re,
423
425
  Ie,
424
426
  Oe,
425
- xe,
426
427
  we,
428
+ xe,
427
429
  // ResetBackgroundColorCommand,
428
430
  // ResetTextColorCommand,
429
431
  // SetBackgroundColorCommand,
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,
@@ -479,14 +481,14 @@ let w = class extends T {
479
481
  _initDocsCommands() {
480
482
  }
481
483
  };
482
- w = Pt([
483
- S(0, b),
484
- S(1, st),
485
- S(2, dt),
486
- S(3, x(lt)),
487
- S(4, x(l)),
488
- S(5, x(Z))
489
- ], w);
484
+ x = Pt([
485
+ p(0, M),
486
+ p(1, st),
487
+ p(2, dt),
488
+ p(3, w(lt)),
489
+ p(4, w(l)),
490
+ p(5, w(Z))
491
+ ], x);
490
492
  const Ft = "action-recorder.config", W = {};
491
493
  var Tt = Object.getOwnPropertyDescriptor, Et = (e, t, r, n) => {
492
494
  for (var o = n > 1 ? void 0 : n ? Tt(t, r) : t, i = e.length - 1, a; i >= 0; i--)
@@ -507,15 +509,15 @@ let H = (A = class extends de {
507
509
  (this._config.replayOnly ? [[v]] : [
508
510
  [l],
509
511
  [v],
510
- [w]
512
+ [x]
511
513
  ]).forEach((t) => this._injector.add(t));
512
514
  }
513
515
  onSteady() {
514
- this._config.replayOnly || this._injector.get(w);
516
+ this._config.replayOnly || this._injector.get(x);
515
517
  }
516
518
  }, m(A, "pluginName", "UNIVER_ACTION_RECORDER_PLUGIN"), A);
517
519
  H = Et([
518
- z(1, x(Z)),
520
+ z(1, w(Z)),
519
521
  z(2, se)
520
522
  ], H);
521
523
  export {
@@ -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
  };