@univerjs/action-recorder 0.5.4 → 0.5.5-experimental.20250123-34738ff

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -1,9 +1 @@
1
- "use strict";var Y=Object.defineProperty;var Q=(r,n,e)=>n in r?Y(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var g=(r,n,e)=>Q(r,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@univerjs/core"),s=require("@univerjs/sheets"),T=require("@univerjs/sheets-filter"),u=require("@univerjs/sheets-ui"),f=require("@univerjs/ui"),b=require("rxjs"),R=require("@univerjs/design"),v=require("react");var S=function(){return S=Object.assign||function(r){for(var n,e=1,t=arguments.length;e<t;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},S.apply(this,arguments)},X=function(r,n){var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&n.indexOf(t)<0&&(e[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(r);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(r,t[o])&&(e[t[o]]=r[t[o]]);return e},J=v.forwardRef(function(r,n){var e=r.icon,t=r.id,o=r.className,i=r.extend,c=X(r,["icon","id","className","extend"]),l="univerjs-icon univerjs-icon-".concat(t," ").concat(o||"").trim(),d=v.useRef("_".concat(te()));return W(e,"".concat(t),{defIds:e.defIds,idSuffix:d.current},S({ref:n,className:l},c),i)});function W(r,n,e,t,o){return v.createElement(r.tag,S(S({key:n},ee(r,e,o)),t),(re(r,e).children||[]).map(function(i,c){return W(i,"".concat(n,"-").concat(r.tag,"-").concat(c),e,void 0,o)}))}function ee(r,n,e){var t=S({},r.attrs);e!=null&&e.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=e.colorChannel1);var o=n.defIds;return!o||o.length===0||(r.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(i){var c=i[0],l=i[1];typeof l=="string"&&(t[c]=l.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function re(r,n){var e,t=n.defIds;return!t||t.length===0?r:r.tag==="defs"&&(!((e=r.children)===null||e===void 0)&&e.length)?S(S({},r),{children:r.children.map(function(o){return typeof o.attrs.id=="string"&&t&&t.indexOf(o.attrs.id)>-1?S(S({},o),{attrs:S(S({},o.attrs),{id:o.attrs.id+n.idSuffix})}):o})}):r}function te(){return Math.random().toString(36).substring(2,8)}J.displayName="UniverIcon";var ne={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"]},N=v.forwardRef(function(r,n){return v.createElement(J,Object.assign({},r,{id:"record-single",ref:n,icon:ne}))});N.displayName="RecordSingle";var oe=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ce=(r,n,e,t)=>{for(var o=t>1?void 0:t?ie(n,e):n,i=r.length-1,c;i>=0;i--)(c=r[i])&&(o=(t?c(n,e,o):c(o))||o);return t&&o&&oe(n,e,o),o},x=(r,n)=>(e,t)=>n(e,t,r);exports.ActionRecorderService=class extends a.Disposable{constructor(e,t,o,i){super();g(this,"_shouldRecordCommands",new Set);g(this,"_panelOpened$",new b.BehaviorSubject(!1));g(this,"panelOpened$",this._panelOpened$.asObservable());g(this,"_recorder",null);g(this,"_recording$",new b.BehaviorSubject(!1));g(this,"recording$",this._recording$.asObservable());g(this,"_recorded$",new b.BehaviorSubject([]));g(this,"_recordedCommands$",new b.BehaviorSubject([]));g(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=e,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(e){if(e.type===a.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(e.id)}togglePanel(e){this._panelOpened$.next(e),e===!1&&this.stopRecording()}startRecording(e=!1){this._recorder=this._commandSrv.onCommandExecuted(t=>{var o,i;if(this._shouldRecordCommands.has(t.id)){const c=this._recorded,l=this._recordedCommands;let d={...t};const h=(o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId(),{unitId:p=h,subUnitId:m}=d==null?void 0:d.params;if(e&&p&&m){const y=(i=this._instanceService.getUnit(p).getSheetBySheetId(m))==null?void 0:i.getName();d={...d,params:{...d.params,subUnitId:y}}}d.id===s.SetSelectionsOperation.id&&c.length>0&&c[c.length-1].id===s.SetSelectionsOperation.id?c[c.length-1]=d:(c.push(d),this._recorded$.next(c),d.type===a.CommandType.COMMAND&&(l.push(d),this._recordedCommands$.next(l)))}}),this._recording$.next(!0)}stopRecording(){var e;(e=this._recorder)==null||e.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const e=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(e,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",e),this.stopRecording()}};exports.ActionRecorderService=ce([x(0,a.ICommandService),x(1,a.ILogService),x(2,f.ILocalFileService),x(3,a.IUniverInstanceService)],exports.ActionRecorderService);const z={id:"action-recorder.command.start-recording",type:a.CommandType.COMMAND,handler:(r,n)=>(r.get(exports.ActionRecorderService).startRecording(!!(n!=null&&n.replaceId)),!0)},k={id:"action-recorder.command.complete-recording",type:a.CommandType.COMMAND,handler:r=>(r.get(exports.ActionRecorderService).completeRecording(),!0)},H={id:"action-recorder.command.stop-recording",type:a.CommandType.COMMAND,handler:r=>(r.get(exports.ActionRecorderService).completeRecording(),!0)};var ae=Object.defineProperty,se=Object.getOwnPropertyDescriptor,de=(r,n,e,t)=>{for(var o=t>1?void 0:t?se(n,e):n,i=r.length-1,c;i>=0;i--)(c=r[i])&&(o=(t?c(n,e,o):c(o))||o);return t&&o&&ae(n,e,o),o},O=(r,n)=>(e,t)=>n(e,t,r),w=(r=>(r.DEFAULT="default",r.NAME="name",r.ACTIVE="active",r))(w||{});exports.ActionReplayService=class extends a.Disposable{constructor(n,e,t,o,i){super(),this._messageService=n,this._instanceService=e,this._localFileService=t,this._logService=o,this._commandService=i}async replayLocalJSON(n="default"){const e=await this._localFileService.openFile({multiple:!1,accept:".json"});if(e.length!==1)return!1;const t=e[0];try{return this.replayCommands(JSON.parse(await t.text()),{mode:n})}catch{return this._messageService.show({type:R.MessageType.Error,content:`Failed to replay commands from local file ${t.name}.`}),!1}}async replayCommands(n,e){var i,c,l;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}=e||{};for(const d of n){const{id:h,params:p}=d,m=p;if(m){if(typeof m.unitId<"u"&&(m.unitId=t),o==="name"&&m.subUnitId!=="undefined"){const _=(c=this._instanceService.getFocusedUnit().getSheetBySheetName(m.subUnitId))==null?void 0:c.getSheetId();_?m.subUnitId=_:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${m.subUnitId}`)}if(o==="active"&&m.subUnitId!=="undefined"){const _=(l=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:l.getSheetId();_?m.subUnitId=_:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(h,p))return!1}else if(!await this._commandService.executeCommand(h))return!1}return!0}async replayCommandsWithDelay(n){var t;const e=(t=this._instanceService.getFocusedUnit())==null?void 0:t.getUnitId();e||this._logService.error("[ReplayService]","no focused unit to replay commands");for(const o of n){await a.awaitTime(le());const{id:i,params:c}=o;if(c){if(typeof c.unitId<"u"&&(c.unitId=e),!await this._commandService.executeCommand(i,c))return!1}else if(!await this._commandService.executeCommand(i))return!1}return!0}};exports.ActionReplayService=de([O(0,f.IMessageService),O(1,a.IUniverInstanceService),O(2,f.ILocalFileService),O(3,a.ILogService),O(4,a.ICommandService)],exports.ActionReplayService);function le(){return Math.floor(Math.random()*800)+200}const $={id:"action-recorder.command.replay-local-records",type:a.CommandType.COMMAND,handler:async r=>{const e=await r.get(exports.ActionReplayService).replayLocalJSON();return e&&r.get(f.IMessageService).show({type:R.MessageType.Success,content:"Successfully replayed local records"}),e}},E={id:"action-recorder.command.replay-local-records-name",type:a.CommandType.COMMAND,handler:async r=>{const e=await r.get(exports.ActionReplayService).replayLocalJSON(w.NAME);return e&&r.get(f.IMessageService).show({type:R.MessageType.Success,content:"Successfully replayed local records"}),e}},F={id:"action-recorder.command.replay-local-records-active",type:a.CommandType.COMMAND,handler:async r=>{const e=await r.get(exports.ActionReplayService).replayLocalJSON(w.ACTIVE);return e&&r.get(f.IMessageService).show({type:R.MessageType.Success,content:"Successfully replayed local records"}),e}},D={id:"action-recorder.operation.open-panel",type:a.CommandType.OPERATION,handler(r){return r.get(exports.ActionRecorderService).togglePanel(!0),!0}},G={id:"action-recorder.operation.close-panel",type:a.CommandType.OPERATION,handler(r){return r.get(exports.ActionRecorderService).togglePanel(!1),!0}};var j={exports:{}},A={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var L;function me(){if(L)return A;L=1;var r=v,n=Symbol.for("react.element"),e=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(l,d,h){var p,m={},y=null,_=null;h!==void 0&&(y=""+h),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(_=d.ref);for(p in d)t.call(d,p)&&!i.hasOwnProperty(p)&&(m[p]=d[p]);if(l&&l.defaultProps)for(p in d=l.defaultProps,d)m[p]===void 0&&(m[p]=d[p]);return{$$typeof:n,type:l,key:y,ref:_,props:m,_owner:o.current}}return A.Fragment=e,A.jsx=c,A.jsxs=c,A}var B;function ue(){return B||(B=1,j.exports=me()),j.exports}var C=ue();function Z(r){var n,e,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(n=0;n<o;n++)r[n]&&(e=Z(r[n]))&&(t&&(t+=" "),t+=e)}else for(e in r)r[e]&&(t&&(t+=" "),t+=e);return t}function fe(){for(var r,n,e=0,t="",o=arguments.length;e<o;e++)(r=arguments[e])&&(n=Z(r))&&(t&&(t+=" "),t+=n);return t}const pe="univer-action-recorder-panel",Se="univer-action-recorder-panel-icon",ge="univer-action-recorder-panel-icon-recording",ve="univer-recording",he="univer-action-recorder-panel-title",Ce="univer-action-recorder-panel-actions",P={actionRecorderPanel:pe,actionRecorderPanelIcon:Se,actionRecorderPanelIconRecording:ge,recording:ve,actionRecorderPanelTitle:he,actionRecorderPanelActions:Ce};function _e(){const r=a.useDependency(exports.ActionRecorderService);return f.useObservable(r.panelOpened$)?C.jsx(ye,{}):null}function ye(){var p;const r=a.useDependency(a.ICommandService),n=a.useDependency(exports.ActionRecorderService),e=f.useObservable(n.recording$),t=f.useObservable(n.recordedCommands$),o=(p=t==null?void 0:t.length)!=null?p:0,i=v.useCallback(()=>{e||r.executeCommand(G.id)},[r,e]),c=v.useCallback(m=>{e||r.executeCommand(z.id,{replaceId:m})},[r,e]),l=v.useCallback(()=>{e&&r.executeCommand(k.id)},[r,e]),d=v.useCallback(()=>{e&&r.executeCommand(H.id)},[r,e]),h=e?o===0?"Recording...":`${o}: ${t[o-1].id}`:"Start Recording";return C.jsxs("div",{className:P.actionRecorderPanel,children:[C.jsx("div",{className:fe(P.actionRecorderPanelIcon,e?P.actionRecorderPanelIconRecording:!1),children:C.jsx(N,{})}),C.jsx("div",{className:P.actionRecorderPanelTitle,children:h}),C.jsxs("div",{className:P.actionRecorderPanelActions,children:[C.jsx(R.Button,{type:"default",size:"small",onClick:e?d:i,children:e?"Cancel":"Close"}),C.jsx(R.Button,{type:"primary",size:"small",onClick:e?l:()=>c(),children:e?"Save":"Start"}),!e&&C.jsx(R.Button,{type:"primary",size:"small",onClick:()=>c(!0),children:"Start(N)"})]})]})}const K="RECORD_MENU_ITEM";function Re(){return{id:K,type:f.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}function Ie(r){const n=r.get(exports.ActionRecorderService);return{id:D.id,title:"action-recorder.menu.record",type:f.MenuItemType.BUTTON,disabled$:n.panelOpened$}}function Oe(){return{id:$.id,title:"action-recorder.menu.replay-local",type:f.MenuItemType.BUTTON}}function Ae(){return{id:E.id,title:"action-recorder.menu.replay-local-name",type:f.MenuItemType.BUTTON}}function Pe(){return{id:F.id,title:"action-recorder.menu.replay-local-active",type:f.MenuItemType.BUTTON}}const be={[f.RibbonStartGroup.OTHERS]:{[K]:{order:10,menuItemFactory:Re,[D.id]:{order:1,menuItemFactory:Ie},[$.id]:{order:2,menuItemFactory:Oe},[E.id]:{order:3,menuItemFactory:Ae},[F.id]:{order:4,menuItemFactory:Pe}}}};var xe=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,Te=(r,n,e,t)=>{for(var o=t>1?void 0:t?Me(n,e):n,i=r.length-1,c;i>=0;i--)(c=r[i])&&(o=(t?c(n,e,o):c(o))||o);return t&&o&&xe(n,e,o),o},I=(r,n)=>(e,t)=>n(e,t,r);let M=class extends a.Disposable{constructor(r,n,e,t,o,i){super(),this._commandSrv=r,this._uiPartsSrv=n,this._menuManagerService=e,this._componentManager=t,this._actionRecorderService=o,this._injector=i,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[z,H,k,D,G,$,E,F].forEach(r=>this._commandSrv.registerCommand(r))}_initUI(){this._uiPartsSrv.registerComponent(f.BuiltInUIPart.GLOBAL,()=>a.connectInjector(_e,this._injector)),this._componentManager.register("RecordSingle",N),this._menuManagerService.mergeMenu(be)}_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,u.SetRangeBoldCommand,u.SetRangeFontFamilyCommand,u.SetRangeFontSizeCommand,u.SetRangeItalicCommand,u.SetRangeStrickThroughCommand,u.SetRangeSubscriptCommand,u.SetRangeSuperscriptCommand,u.SetRangeTextColorCommand,u.SetRangeUnderlineCommand,s.SetRangeValuesCommand,s.SetStrikeThroughCommand,s.SetTextColorCommand,s.SetTextRotationCommand,s.SetTextWrapCommand,s.SetVerticalTextAlignCommand,u.SheetCopyCommand,u.SheetCutCommand,u.SheetPasteBesidesBorderCommand,u.SheetPasteColWidthCommand,u.SheetPasteCommand,u.SheetPasteFormatCommand,u.SheetPasteShortKeyCommand,u.SheetPasteValueCommand,u.AutoFillCommand,u.RefillCommand,s.SetWorksheetActivateCommand,s.SetWorksheetActiveOperation,s.SetSelectionsOperation,T.SetSheetFilterRangeCommand,T.SetSheetsFilterCriteriaCommand,T.RemoveSheetFilterCommand].forEach(r=>this._actionRecorderService.registerRecordedCommand(r))}_initDocsCommands(){}};M=Te([I(0,a.ICommandService),I(1,f.IUIPartsService),I(2,f.IMenuManagerService),I(3,a.Inject(f.ComponentManager)),I(4,a.Inject(exports.ActionRecorderService)),I(5,a.Inject(a.Injector))],M);const je="action-recorder.config",V={};var Ue=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,we=(r,n,e,t)=>{for(var o=t>1?void 0:t?Ne(n,e):n,i=r.length-1,c;i>=0;i--)(c=r[i])&&(o=(t?c(n,e,o):c(o))||o);return t&&o&&Ue(n,e,o),o},q=(r,n)=>(e,t)=>n(e,t,r),U;exports.UniverActionRecorderPlugin=(U=class extends a.Plugin{constructor(n=V,e,t){super(),this._config=n,this._injector=e,this._configService=t;const{menu:o,...i}=a.merge({},V,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(je,i)}onStarting(){(this._config.replayOnly?[[exports.ActionReplayService]]:[[exports.ActionRecorderService],[exports.ActionReplayService],[M]]).forEach(e=>this._injector.add(e))}onSteady(){this._config.replayOnly||this._injector.get(M)}},g(U,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),U);exports.UniverActionRecorderPlugin=we([q(1,a.Inject(a.Injector)),q(2,a.IConfigService)],exports.UniverActionRecorderPlugin);
1
+ "use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@univerjs/core"),sheets=require("@univerjs/sheets"),sheetsFilter=require("@univerjs/sheets-filter"),sheetsUi=require("@univerjs/sheets-ui"),ui=require("@univerjs/ui"),rxjs=require("rxjs"),design=require("@univerjs/design"),jsxRuntime=require("react/jsx-runtime"),react=require("react");var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)},__rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},IconBase=react.forwardRef(function(props,ref){var icon=props.icon,id=props.id,className=props.className,extend=props.extend,restProps=__rest(props,["icon","id","className","extend"]),cls="univerjs-icon univerjs-icon-".concat(id," ").concat(className||"").trim(),idSuffix=react.useRef("_".concat(generateShortUuid()));return render(icon,"".concat(id),{defIds:icon.defIds,idSuffix:idSuffix.current},__assign({ref,className:cls},restProps),extend)});function render(node,id,runtimeProps,rootProps,extend){return react.createElement(node.tag,__assign(__assign({key:id},replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend)),rootProps),(replaceRuntimeIdsInDefs(node,runtimeProps).children||[]).map(function(child,index){return render(child,"".concat(id,"-").concat(node.tag,"-").concat(index),runtimeProps,void 0,extend)}))}__name(render,"render");function replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend){var attrs=__assign({},node.attrs);extend!=null&&extend.colorChannel1&&attrs.fill==="colorChannel1"&&(attrs.fill=extend.colorChannel1);var defIds=runtimeProps.defIds;return!defIds||defIds.length===0||(node.tag==="use"&&attrs["xlink:href"]&&(attrs["xlink:href"]=attrs["xlink:href"]+runtimeProps.idSuffix),Object.entries(attrs).forEach(function(_a5){var key=_a5[0],value=_a5[1];typeof value=="string"&&(attrs[key]=value.replace(/url\(#(.*)\)/,"url(#$1".concat(runtimeProps.idSuffix,")")))})),attrs}__name(replaceRuntimeIdsAndExtInAttrs,"replaceRuntimeIdsAndExtInAttrs");function replaceRuntimeIdsInDefs(node,runtimeProps){var _a5,defIds=runtimeProps.defIds;return!defIds||defIds.length===0?node:node.tag==="defs"&&(!((_a5=node.children)===null||_a5===void 0)&&_a5.length)?__assign(__assign({},node),{children:node.children.map(function(child){return typeof child.attrs.id=="string"&&defIds&&defIds.indexOf(child.attrs.id)>-1?__assign(__assign({},child),{attrs:__assign(__assign({},child.attrs),{id:child.attrs.id+runtimeProps.idSuffix})}):child})}):node}__name(replaceRuntimeIdsInDefs,"replaceRuntimeIdsInDefs");function generateShortUuid(){return Math.random().toString(36).substring(2,8)}__name(generateShortUuid,"generateShortUuid");IconBase.displayName="UniverIcon";var element={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"]},RecordSingle=react.forwardRef(function(props,ref){return react.createElement(IconBase,Object.assign({},props,{id:"record-single",ref,icon:element}))});RecordSingle.displayName="RecordSingle";var __defProp$3=Object.defineProperty,__getOwnPropDesc$3=Object.getOwnPropertyDescriptor,__decorateClass$3=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$3(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$3(target,key,result),result},"__decorateClass$3"),__decorateParam$3=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$3"),_a;exports.ActionRecorderService=(_a=class extends core.Disposable{constructor(_commandSrv,_logService,_localFileService,_instanceService){super();__publicField(this,"_shouldRecordCommands",new Set);__publicField(this,"_panelOpened$",new rxjs.BehaviorSubject(!1));__publicField(this,"panelOpened$",this._panelOpened$.asObservable());__publicField(this,"_recorder",null);__publicField(this,"_recording$",new rxjs.BehaviorSubject(!1));__publicField(this,"recording$",this._recording$.asObservable());__publicField(this,"_recorded$",new rxjs.BehaviorSubject([]));__publicField(this,"_recordedCommands$",new rxjs.BehaviorSubject([]));__publicField(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=_commandSrv,this._logService=_logService,this._localFileService=_localFileService,this._instanceService=_instanceService}get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}registerRecordedCommand(command){if(command.type===core.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(command.id)}togglePanel(visible){this._panelOpened$.next(visible),visible===!1&&this.stopRecording()}startRecording(replaceId=!1){this._recorder=this._commandSrv.onCommandExecuted(rawCommandInfo=>{var _a5,_b;if(this._shouldRecordCommands.has(rawCommandInfo.id)){const recorded=this._recorded,commands=this._recordedCommands;let commandInfo={...rawCommandInfo};const focusUnitId=(_a5=this._instanceService.getFocusedUnit())==null?void 0:_a5.getUnitId(),{unitId=focusUnitId,subUnitId}=commandInfo==null?void 0:commandInfo.params;if(replaceId&&unitId&&subUnitId){const subUnitName=(_b=this._instanceService.getUnit(unitId).getSheetBySheetId(subUnitId))==null?void 0:_b.getName();commandInfo={...commandInfo,params:{...commandInfo.params,subUnitId:subUnitName}}}commandInfo.id===sheets.SetSelectionsOperation.id&&recorded.length>0&&recorded[recorded.length-1].id===sheets.SetSelectionsOperation.id?recorded[recorded.length-1]=commandInfo:(recorded.push(commandInfo),this._recorded$.next(recorded),commandInfo.type===core.CommandType.COMMAND&&(commands.push(commandInfo),this._recordedCommands$.next(commands)))}}),this._recording$.next(!0)}stopRecording(){var _a5;(_a5=this._recorder)==null||_a5.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const commands=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(commands,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",commands),this.stopRecording()}},__name(_a,"ActionRecorderService"),_a);exports.ActionRecorderService=__decorateClass$3([__decorateParam$3(0,core.ICommandService),__decorateParam$3(1,core.ILogService),__decorateParam$3(2,ui.ILocalFileService),__decorateParam$3(3,core.IUniverInstanceService)],exports.ActionRecorderService);const StartRecordingActionCommand={id:"action-recorder.command.start-recording",type:core.CommandType.COMMAND,handler:__name((accessor,params)=>(accessor.get(exports.ActionRecorderService).startRecording(!!(params!=null&&params.replaceId)),!0),"handler")},CompleteRecordingActionCommand={id:"action-recorder.command.complete-recording",type:core.CommandType.COMMAND,handler:__name(accessor=>(accessor.get(exports.ActionRecorderService).completeRecording(),!0),"handler")},StopRecordingActionCommand={id:"action-recorder.command.stop-recording",type:core.CommandType.COMMAND,handler:__name(accessor=>(accessor.get(exports.ActionRecorderService).completeRecording(),!0),"handler")};var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$2(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$2(target,key,result),result},"__decorateClass$2"),__decorateParam$2=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$2"),ReplayMode=(ReplayMode2=>(ReplayMode2.DEFAULT="default",ReplayMode2.NAME="name",ReplayMode2.ACTIVE="active",ReplayMode2))(ReplayMode||{}),_a2;exports.ActionReplayService=(_a2=class extends core.Disposable{constructor(_messageService,_instanceService,_localFileService,_logService,_commandService){super(),this._messageService=_messageService,this._instanceService=_instanceService,this._localFileService=_localFileService,this._logService=_logService,this._commandService=_commandService}async replayLocalJSON(mode="default"){const files=await this._localFileService.openFile({multiple:!1,accept:".json"});if(files.length!==1)return!1;const file=files[0];try{return this.replayCommands(JSON.parse(await file.text()),{mode})}catch{return this._messageService.show({type:design.MessageType.Error,content:`Failed to replay commands from local file ${file.name}.`}),!1}}async replayCommands(commands,options){var _a5,_b,_c;const focusedUnitId=(_a5=this._instanceService.getFocusedUnit())==null?void 0:_a5.getUnitId();focusedUnitId||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode}=options||{};for(const command of commands){const{id,params}=command,commandParams=params;if(commandParams){if(typeof commandParams.unitId<"u"&&(commandParams.unitId=focusedUnitId),mode==="name"&&commandParams.subUnitId!=="undefined"){const realSubUnitId=(_b=this._instanceService.getFocusedUnit().getSheetBySheetName(commandParams.subUnitId))==null?void 0:_b.getSheetId();realSubUnitId?commandParams.subUnitId=realSubUnitId:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${commandParams.subUnitId}`)}if(mode==="active"&&commandParams.subUnitId!=="undefined"){const realSubUnitId=(_c=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:_c.getSheetId();realSubUnitId?commandParams.subUnitId=realSubUnitId:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(id,params))return!1}else if(!await this._commandService.executeCommand(id))return!1}return!0}async replayCommandsWithDelay(commands){var _a5;const focusedUnitId=(_a5=this._instanceService.getFocusedUnit())==null?void 0:_a5.getUnitId();focusedUnitId||this._logService.error("[ReplayService]","no focused unit to replay commands");for(const command of commands){await core.awaitTime(randomBetween200And1k());const{id,params}=command;if(params){if(typeof params.unitId<"u"&&(params.unitId=focusedUnitId),!await this._commandService.executeCommand(id,params))return!1}else if(!await this._commandService.executeCommand(id))return!1}return!0}},__name(_a2,"ActionReplayService"),_a2);exports.ActionReplayService=__decorateClass$2([__decorateParam$2(0,ui.IMessageService),__decorateParam$2(1,core.IUniverInstanceService),__decorateParam$2(2,ui.ILocalFileService),__decorateParam$2(3,core.ILogService),__decorateParam$2(4,core.ICommandService)],exports.ActionReplayService);function randomBetween200And1k(){return Math.floor(Math.random()*800)+200}__name(randomBetween200And1k,"randomBetween200And1k");const ReplayLocalRecordCommand={id:"action-recorder.command.replay-local-records",type:core.CommandType.COMMAND,handler:__name(async accessor=>{const result=await accessor.get(exports.ActionReplayService).replayLocalJSON();return result&&accessor.get(ui.IMessageService).show({type:design.MessageType.Success,content:"Successfully replayed local records"}),result},"handler")},ReplayLocalRecordOnNamesakeCommand={id:"action-recorder.command.replay-local-records-name",type:core.CommandType.COMMAND,handler:__name(async accessor=>{const result=await accessor.get(exports.ActionReplayService).replayLocalJSON(ReplayMode.NAME);return result&&accessor.get(ui.IMessageService).show({type:design.MessageType.Success,content:"Successfully replayed local records"}),result},"handler")},ReplayLocalRecordOnActiveCommand={id:"action-recorder.command.replay-local-records-active",type:core.CommandType.COMMAND,handler:__name(async accessor=>{const result=await accessor.get(exports.ActionReplayService).replayLocalJSON(ReplayMode.ACTIVE);return result&&accessor.get(ui.IMessageService).show({type:design.MessageType.Success,content:"Successfully replayed local records"}),result},"handler")},OpenRecordPanelOperation={id:"action-recorder.operation.open-panel",type:core.CommandType.OPERATION,handler(accessor){return accessor.get(exports.ActionRecorderService).togglePanel(!0),!0}},CloseRecordPanelOperation={id:"action-recorder.operation.close-panel",type:core.CommandType.OPERATION,handler(accessor){return accessor.get(exports.ActionRecorderService).togglePanel(!1),!0}};function r(e){var t,f,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}__name(r,"r");function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}__name(clsx,"clsx");const actionRecorderPanel="univer-action-recorder-panel",actionRecorderPanelIcon="univer-action-recorder-panel-icon",actionRecorderPanelIconRecording="univer-action-recorder-panel-icon-recording",recording="univer-recording",actionRecorderPanelTitle="univer-action-recorder-panel-title",actionRecorderPanelActions="univer-action-recorder-panel-actions",styles={actionRecorderPanel,actionRecorderPanelIcon,actionRecorderPanelIconRecording,recording,actionRecorderPanelTitle,actionRecorderPanelActions};function RecorderPanel(){const s=core.useDependency(exports.ActionRecorderService);return ui.useObservable(s.panelOpened$)?jsxRuntime.jsx(RecordPanelImpl,{}):null}__name(RecorderPanel,"RecorderPanel");function RecordPanelImpl(){var _a5;const commandService=core.useDependency(core.ICommandService),actionRecorderService=core.useDependency(exports.ActionRecorderService),recording2=ui.useObservable(actionRecorderService.recording$),recordedCommands=ui.useObservable(actionRecorderService.recordedCommands$),len=(_a5=recordedCommands==null?void 0:recordedCommands.length)!=null?_a5:0,closePanel=react.useCallback(()=>{recording2||commandService.executeCommand(CloseRecordPanelOperation.id)},[commandService,recording2]),startRecording=react.useCallback(replaceId=>{recording2||commandService.executeCommand(StartRecordingActionCommand.id,{replaceId})},[commandService,recording2]),completeRecording=react.useCallback(()=>{recording2&&commandService.executeCommand(CompleteRecordingActionCommand.id)},[commandService,recording2]),stopRecording=react.useCallback(()=>{recording2&&commandService.executeCommand(StopRecordingActionCommand.id)},[commandService,recording2]),titleText=recording2?len===0?"Recording...":`${len}: ${recordedCommands[len-1].id}`:"Start Recording";return jsxRuntime.jsxs("div",{className:styles.actionRecorderPanel,children:[jsxRuntime.jsx("div",{className:clsx(styles.actionRecorderPanelIcon,recording2?styles.actionRecorderPanelIconRecording:!1),children:jsxRuntime.jsx(RecordSingle,{})}),jsxRuntime.jsx("div",{className:styles.actionRecorderPanelTitle,children:titleText}),jsxRuntime.jsxs("div",{className:styles.actionRecorderPanelActions,children:[jsxRuntime.jsx(design.Button,{type:"default",size:"small",onClick:recording2?stopRecording:closePanel,children:recording2?"Cancel":"Close"}),jsxRuntime.jsx(design.Button,{type:"primary",size:"small",onClick:recording2?completeRecording:()=>startRecording(),children:recording2?"Save":"Start"}),!recording2&&jsxRuntime.jsx(design.Button,{type:"primary",size:"small",onClick:__name(()=>startRecording(!0),"onClick"),children:"Start(N)"})]})]})}__name(RecordPanelImpl,"RecordPanelImpl");const RECORD_MENU_ITEM_ID="RECORD_MENU_ITEM";function RecordMenuItemFactory(){return{id:RECORD_MENU_ITEM_ID,type:ui.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}__name(RecordMenuItemFactory,"RecordMenuItemFactory");function OpenRecorderMenuItemFactory(accessor){const actionRecorderService=accessor.get(exports.ActionRecorderService);return{id:OpenRecordPanelOperation.id,title:"action-recorder.menu.record",type:ui.MenuItemType.BUTTON,disabled$:actionRecorderService.panelOpened$}}__name(OpenRecorderMenuItemFactory,"OpenRecorderMenuItemFactory");function ReplayLocalRecordMenuItemFactory(){return{id:ReplayLocalRecordCommand.id,title:"action-recorder.menu.replay-local",type:ui.MenuItemType.BUTTON}}__name(ReplayLocalRecordMenuItemFactory,"ReplayLocalRecordMenuItemFactory");function ReplayLocalRecordOnNamesakeMenuItemFactory(){return{id:ReplayLocalRecordOnNamesakeCommand.id,title:"action-recorder.menu.replay-local-name",type:ui.MenuItemType.BUTTON}}__name(ReplayLocalRecordOnNamesakeMenuItemFactory,"ReplayLocalRecordOnNamesakeMenuItemFactory");function ReplayLocalRecordOnActiveMenuItemFactory(){return{id:ReplayLocalRecordOnActiveCommand.id,title:"action-recorder.menu.replay-local-active",type:ui.MenuItemType.BUTTON}}__name(ReplayLocalRecordOnActiveMenuItemFactory,"ReplayLocalRecordOnActiveMenuItemFactory");const menuSchema={[ui.RibbonStartGroup.OTHERS]:{[RECORD_MENU_ITEM_ID]:{order:10,menuItemFactory:RecordMenuItemFactory,[OpenRecordPanelOperation.id]:{order:1,menuItemFactory:OpenRecorderMenuItemFactory},[ReplayLocalRecordCommand.id]:{order:2,menuItemFactory:ReplayLocalRecordMenuItemFactory},[ReplayLocalRecordOnNamesakeCommand.id]:{order:3,menuItemFactory:ReplayLocalRecordOnNamesakeMenuItemFactory},[ReplayLocalRecordOnActiveCommand.id]:{order:4,menuItemFactory:ReplayLocalRecordOnActiveMenuItemFactory}}}};var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1"),_a3;let ActionRecorderController=(_a3=class extends core.Disposable{constructor(_commandSrv,_uiPartsSrv,_menuManagerService,_componentManager,_actionRecorderService,_injector){super(),this._commandSrv=_commandSrv,this._uiPartsSrv=_uiPartsSrv,this._menuManagerService=_menuManagerService,this._componentManager=_componentManager,this._actionRecorderService=_actionRecorderService,this._injector=_injector,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[StartRecordingActionCommand,StopRecordingActionCommand,CompleteRecordingActionCommand,OpenRecordPanelOperation,CloseRecordPanelOperation,ReplayLocalRecordCommand,ReplayLocalRecordOnNamesakeCommand,ReplayLocalRecordOnActiveCommand].forEach(command=>this._commandSrv.registerCommand(command))}_initUI(){this._uiPartsSrv.registerComponent(ui.BuiltInUIPart.GLOBAL,()=>core.connectInjector(RecorderPanel,this._injector)),this._componentManager.register("RecordSingle",RecordSingle),this._menuManagerService.mergeMenu(menuSchema)}_initSheetsCommands(){[sheets.CopySheetCommand,sheets.DeleteRangeMoveLeftCommand,sheets.DeleteRangeMoveUpCommand,sheets.DeltaColumnWidthCommand,sheets.DeltaRowHeightCommand,sheets.InsertSheetCommand,sheets.InsertColAfterCommand,sheets.InsertColBeforeCommand,sheets.InsertRowAfterCommand,sheets.InsertRowBeforeCommand,sheets.RemoveSheetCommand,sheets.SetStyleCommand,sheets.AddWorksheetMergeCommand,sheets.AddWorksheetMergeAllCommand,sheets.AddWorksheetMergeVerticalCommand,sheets.AddWorksheetMergeHorizontalCommand,sheets.SetFrozenCommand,sheets.CancelFrozenCommand,sheets.SetHorizontalTextAlignCommand,sheets.SetOverlineCommand,sheetsUi.SetRangeBoldCommand,sheetsUi.SetRangeFontFamilyCommand,sheetsUi.SetRangeFontSizeCommand,sheetsUi.SetRangeItalicCommand,sheetsUi.SetRangeStrickThroughCommand,sheetsUi.SetRangeSubscriptCommand,sheetsUi.SetRangeSuperscriptCommand,sheetsUi.SetRangeTextColorCommand,sheetsUi.SetRangeUnderlineCommand,sheets.SetRangeValuesCommand,sheets.SetStrikeThroughCommand,sheets.SetTextColorCommand,sheets.SetTextRotationCommand,sheets.SetTextWrapCommand,sheets.SetVerticalTextAlignCommand,sheetsUi.SheetCopyCommand,sheetsUi.SheetCutCommand,sheetsUi.SheetPasteBesidesBorderCommand,sheetsUi.SheetPasteColWidthCommand,sheetsUi.SheetPasteCommand,sheetsUi.SheetPasteFormatCommand,sheetsUi.SheetPasteShortKeyCommand,sheetsUi.SheetPasteValueCommand,sheetsUi.AutoFillCommand,sheetsUi.RefillCommand,sheets.SetWorksheetActivateCommand,sheets.SetWorksheetActiveOperation,sheets.SetSelectionsOperation,sheetsFilter.SetSheetFilterRangeCommand,sheetsFilter.SetSheetsFilterCriteriaCommand,sheetsFilter.RemoveSheetFilterCommand].forEach(command=>this._actionRecorderService.registerRecordedCommand(command))}_initDocsCommands(){}},__name(_a3,"ActionRecorderController"),_a3);ActionRecorderController=__decorateClass$1([__decorateParam$1(0,core.ICommandService),__decorateParam$1(1,ui.IUIPartsService),__decorateParam$1(2,ui.IMenuManagerService),__decorateParam$1(3,core.Inject(ui.ComponentManager)),__decorateParam$1(4,core.Inject(exports.ActionRecorderService)),__decorateParam$1(5,core.Inject(core.Injector))],ActionRecorderController);const ACTION_RECORDER_PLUGIN_CONFIG_KEY="action-recorder.config",defaultPluginConfig={};var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam"),_a4;exports.UniverActionRecorderPlugin=(_a4=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{menu,...rest}=core.merge({},defaultPluginConfig,this._config);menu&&this._configService.setConfig("menu",menu,{merge:!0}),this._configService.setConfig(ACTION_RECORDER_PLUGIN_CONFIG_KEY,rest)}onStarting(){(this._config.replayOnly?[[exports.ActionReplayService]]:[[exports.ActionRecorderService],[exports.ActionReplayService],[ActionRecorderController]]).forEach(d=>this._injector.add(d))}onSteady(){this._config.replayOnly||this._injector.get(ActionRecorderController)}},__name(_a4,"UniverActionRecorderPlugin"),__publicField(_a4,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),_a4);exports.UniverActionRecorderPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.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 locale={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const e={"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت..."}}};module.exports=e;
1
+ "use strict";const locale={"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت..."}}};module.exports=locale;
@@ -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 locale={"action-recorder":{menu:{title:"Enregistrer les actions",record:"Enregistrer les actions...","replay-local":"Lecture de l'enregistrement local..."}}};module.exports=locale;
@@ -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 locale={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=locale;
@@ -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 locale={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const e={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=e;
1
+ "use strict";const locale={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const e={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=e;
1
+ "use strict";const locale={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=locale;