@univerjs/action-recorder 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/cjs/index.js +657 -1
  2. package/lib/cjs/locale/ca-ES.js +12 -1
  3. package/lib/cjs/locale/en-US.js +27 -1
  4. package/lib/cjs/locale/es-ES.js +12 -1
  5. package/lib/cjs/locale/fa-IR.js +12 -1
  6. package/lib/cjs/locale/fr-FR.js +12 -1
  7. package/lib/cjs/locale/ja-JP.js +12 -1
  8. package/lib/cjs/locale/ko-KR.js +12 -1
  9. package/lib/cjs/locale/ru-RU.js +12 -1
  10. package/lib/cjs/locale/sk-SK.js +12 -1
  11. package/lib/cjs/locale/vi-VN.js +12 -1
  12. package/lib/cjs/locale/zh-CN.js +12 -1
  13. package/lib/cjs/locale/zh-TW.js +12 -1
  14. package/lib/es/index.js +639 -1
  15. package/lib/es/locale/ca-ES.js +11 -1
  16. package/lib/es/locale/en-US.js +26 -1
  17. package/lib/es/locale/es-ES.js +11 -1
  18. package/lib/es/locale/fa-IR.js +11 -1
  19. package/lib/es/locale/fr-FR.js +11 -1
  20. package/lib/es/locale/ja-JP.js +11 -1
  21. package/lib/es/locale/ko-KR.js +11 -1
  22. package/lib/es/locale/ru-RU.js +11 -1
  23. package/lib/es/locale/sk-SK.js +11 -1
  24. package/lib/es/locale/vi-VN.js +11 -1
  25. package/lib/es/locale/zh-CN.js +11 -1
  26. package/lib/es/locale/zh-TW.js +11 -1
  27. package/lib/index.js +639 -1
  28. package/lib/locale/ca-ES.js +11 -1
  29. package/lib/locale/en-US.js +26 -1
  30. package/lib/locale/es-ES.js +11 -1
  31. package/lib/locale/fa-IR.js +11 -1
  32. package/lib/locale/fr-FR.js +11 -1
  33. package/lib/locale/ja-JP.js +11 -1
  34. package/lib/locale/ko-KR.js +11 -1
  35. package/lib/locale/ru-RU.js +11 -1
  36. package/lib/locale/sk-SK.js +11 -1
  37. package/lib/locale/vi-VN.js +11 -1
  38. package/lib/locale/zh-CN.js +11 -1
  39. package/lib/locale/zh-TW.js +11 -1
  40. package/lib/umd/index.js +1 -1
  41. package/package.json +9 -9
package/lib/es/index.js CHANGED
@@ -1 +1,639 @@
1
- import{CommandType as e,Disposable as t,ICommandService as n,IConfigService as r,ILogService as i,IUniverInstanceService as a,Inject as o,Injector as s,Plugin as c,awaitTime as l,merge as u}from"@univerjs/core";import{RecordIcon as d}from"@univerjs/icons";import{AddWorksheetMergeAllCommand as f,AddWorksheetMergeCommand as ee,AddWorksheetMergeHorizontalCommand as te,AddWorksheetMergeVerticalCommand as ne,AutoFillCommand as re,CancelFrozenCommand as p,CopySheetCommand as ie,DeleteRangeMoveLeftCommand as ae,DeleteRangeMoveUpCommand as oe,DeltaColumnWidthCommand as se,DeltaRowHeightCommand as ce,InsertColAfterCommand as le,InsertColBeforeCommand as ue,InsertRowAfterCommand as de,InsertRowBeforeCommand as fe,InsertSheetCommand as pe,RefillCommand as me,RemoveSheetCommand as he,SetFrozenCommand as ge,SetHorizontalTextAlignCommand as _e,SetOverlineCommand as ve,SetRangeValuesCommand as ye,SetSelectionsOperation as m,SetStrikeThroughCommand as be,SetStyleCommand as xe,SetTextColorCommand as Se,SetTextRotationCommand as Ce,SetTextWrapCommand as we,SetVerticalTextAlignCommand as Te,SetWorksheetActivateCommand as Ee,SetWorksheetActiveOperation as De}from"@univerjs/sheets";import{RemoveSheetFilterCommand as Oe,SetSheetFilterRangeCommand as ke,SetSheetsFilterCriteriaCommand as Ae}from"@univerjs/sheets-filter";import{SetRangeBoldCommand as je,SetRangeFontFamilyCommand as h,SetRangeFontSizeCommand as g,SetRangeItalicCommand as _,SetRangeStrickThroughCommand as v,SetRangeSubscriptCommand as y,SetRangeSuperscriptCommand as b,SetRangeTextColorCommand as x,SetRangeUnderlineCommand as S,SheetCopyCommand as Me,SheetCutCommand as Ne,SheetPasteBesidesBorderCommand as Pe,SheetPasteColWidthCommand as Fe,SheetPasteCommand as Ie,SheetPasteFormatCommand as Le,SheetPasteShortKeyCommand as Re,SheetPasteValueCommand as ze}from"@univerjs/sheets-ui";import{BuiltInUIPart as Be,ComponentManager as Ve,ILocalFileService as C,IMenuManagerService as He,IMessageService as w,IUIPartsService as Ue,MenuItemType as T,RibbonOthersGroup as We,connectInjector as Ge,useDependency as E,useObservable as D}from"@univerjs/ui";import{BehaviorSubject as O}from"rxjs";import{Button as k,MessageType as A}from"@univerjs/design";import{useCallback as j}from"react";import{jsx as M,jsxs as N}from"react/jsx-runtime";var Ke=`@univerjs/action-recorder`,qe=`0.20.1`;const P=`action-recorder.config`;Symbol(P);const F={};function I(e){"@babel/helpers - typeof";return I=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},I(e)}function Je(e,t){if(I(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(I(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ye(e){var t=Je(e,`string`);return I(t)==`symbol`?t:t+``}function L(e,t,n){return(t=Ye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e,t){return function(n,r){t(n,r,e)}}function z(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let B=class extends t{get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}constructor(e,t,n,r){super(),this._commandSrv=e,this._logService=t,this._localFileService=n,this._instanceService=r,L(this,`_shouldRecordCommands`,new Set),L(this,`_panelOpened$`,new O(!1)),L(this,`panelOpened$`,this._panelOpened$.asObservable()),L(this,`_recorder`,null),L(this,`_recording$`,new O(!1)),L(this,`recording$`,this._recording$.asObservable()),L(this,`_recorded$`,new O([])),L(this,`_recordedCommands$`,new O([])),L(this,`recordedCommands$`,this._recordedCommands$.asObservable())}registerRecordedCommand(t){if(t.type===e.MUTATION)throw Error(`[CommandRecorderService] Cannot record mutation commands.`);this._shouldRecordCommands.add(t.id)}togglePanel(e){this._panelOpened$.next(e),e===!1&&this.stopRecording()}startRecording(t=!1){this._recorder=this._commandSrv.onCommandExecuted(n=>{if(this._shouldRecordCommands.has(n.id)){var r;let a=this._recorded,o=this._recordedCommands,s={...n},c=(r=this._instanceService.getFocusedUnit())==null?void 0:r.getUnitId(),{unitId:l=c,subUnitId:u}=s==null?void 0:s.params;if(t&&l&&u){var i;let e=(i=this._instanceService.getUnit(l).getSheetBySheetId(u))==null?void 0:i.getName();s={...s,params:{...s.params,subUnitId:e}}}s.id===m.id&&a.length>0&&a[a.length-1].id===m.id?a[a.length-1]=s:(a.push(s),this._recorded$.next(a),s.type===e.COMMAND&&(o.push(s),this._recordedCommands$.next(o)))}}),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(){let 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()}};B=z([R(0,n),R(1,i),R(2,C),R(3,a)],B);const V={id:`action-recorder.command.start-recording`,type:e.COMMAND,handler:(e,t)=>(e.get(B).startRecording(!!(t!=null&&t.replaceId)),!0)},H={id:`action-recorder.command.complete-recording`,type:e.COMMAND,handler:e=>(e.get(B).completeRecording(),!0)},U={id:`action-recorder.command.stop-recording`,type:e.COMMAND,handler:e=>(e.get(B).completeRecording(),!0)};let W=function(e){return e.DEFAULT=`default`,e.NAME=`name`,e.ACTIVE=`active`,e}({}),G=class extends t{constructor(e,t,n,r,i){super(),this._messageService=e,this._instanceService=t,this._localFileService=n,this._logService=r,this._commandService=i}async replayLocalJSON(e=W.DEFAULT){let t=await this._localFileService.openFile({multiple:!1,accept:`.json`});if(t.length!==1)return!1;let n=t[0];try{return this.replayCommands(JSON.parse(await n.text()),{mode:e})}catch{return this._messageService.show({type:A.Error,content:`Failed to replay commands from local file ${n.name}.`}),!1}}async replayCommands(e,t){var n;let r=(n=this._instanceService.getFocusedUnit())==null?void 0:n.getUnitId();r||this._logService.error(`[ReplayService]`,`no focused unit to replay commands`);let{mode:i}=t||{};for(let t of e){let{id:e,params:n}=t,s=n;if(s){if(s.unitId!==void 0&&(s.unitId=r),i===W.NAME&&s.subUnitId!==`undefined`){var a;let e=(a=this._instanceService.getFocusedUnit().getSheetBySheetName(s.subUnitId))==null?void 0:a.getSheetId();e?s.subUnitId=e:this._logService.error(`[ReplayService]`,`failed to find subunit by subUnitName = ${s.subUnitId}`)}if(i===W.ACTIVE&&s.subUnitId!==`undefined`){var o;let e=(o=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:o.getSheetId();e?s.subUnitId=e:this._logService.error(`[ReplayService]`,`failed to find active subunit`)}if(!await this._commandService.executeCommand(e,n))return!1}else if(!await this._commandService.executeCommand(e))return!1}return!0}async replayCommandsWithDelay(e){var t;let n=(t=this._instanceService.getFocusedUnit())==null?void 0:t.getUnitId();n||this._logService.error(`[ReplayService]`,`no focused unit to replay commands`);for(let t of e){await l(Xe());let{id:e,params:r}=t;if(r){if(r.unitId!==void 0&&(r.unitId=n),!await this._commandService.executeCommand(e,r))return!1}else if(!await this._commandService.executeCommand(e))return!1}return!0}};G=z([R(0,w),R(1,a),R(2,C),R(3,i),R(4,n)],G);function Xe(){return Math.floor(Math.random()*800)+200}const K={id:`action-recorder.command.replay-local-records`,type:e.COMMAND,handler:async e=>{let t=await e.get(G).replayLocalJSON();return t&&e.get(w).show({type:A.Success,content:`Successfully replayed local records`}),t}},q={id:`action-recorder.command.replay-local-records-name`,type:e.COMMAND,handler:async e=>{let t=await e.get(G).replayLocalJSON(W.NAME);return t&&e.get(w).show({type:A.Success,content:`Successfully replayed local records`}),t}},J={id:`action-recorder.command.replay-local-records-active`,type:e.COMMAND,handler:async e=>{let t=await e.get(G).replayLocalJSON(W.ACTIVE);return t&&e.get(w).show({type:A.Success,content:`Successfully replayed local records`}),t}},Y={id:`action-recorder.operation.open-panel`,type:e.OPERATION,handler(e){return e.get(B).togglePanel(!0),!0}},X={id:`action-recorder.operation.close-panel`,type:e.OPERATION,handler(e){return e.get(B).togglePanel(!1),!0}},Z=`RECORD_MENU_ITEM`;function Ze(){return{id:Z,type:T.SUBITEMS,icon:`RecordIcon`,tooltip:`action-recorder.menu.title`}}function Qe(e){let t=e.get(B);return{id:Y.id,title:`action-recorder.menu.record`,type:T.BUTTON,disabled$:t.panelOpened$}}function $e(){return{id:K.id,title:`action-recorder.menu.replay-local`,type:T.BUTTON}}function et(){return{id:q.id,title:`action-recorder.menu.replay-local-name`,type:T.BUTTON}}function tt(){return{id:J.id,title:`action-recorder.menu.replay-local-active`,type:T.BUTTON}}const nt={[We.OTHERS]:{[Z]:{order:1,menuItemFactory:Ze,[Y.id]:{order:1,menuItemFactory:Qe},[K.id]:{order:2,menuItemFactory:$e},[q.id]:{order:3,menuItemFactory:et},[J.id]:{order:4,menuItemFactory:tt}}}};function rt(){return D(E(B).panelOpened$)?M(it,{}):null}function it(){var e;let t=E(n),r=E(B),i=D(r.recording$),a=D(r.recordedCommands$),o=(e=a==null?void 0:a.length)==null?0:e,s=j(()=>{i||t.executeCommand(X.id)},[t,i]),c=j(e=>{i||t.executeCommand(V.id,{replaceId:e})},[t,i]),l=j(()=>{i&&t.executeCommand(H.id)},[t,i]),u=j(()=>{i&&t.executeCommand(U.id)},[t,i]),f=i?o===0?`Recording...`:`${o}: ${a[o-1].id}`:`Start Recording`;return N(`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:[M(`div`,{className:`univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl`,children:M(d,{})}),M(`div`,{className:`univer-flex-1 univer-text-sm`,children:f}),N(`div`,{className:`univer-flex univer-w-64 univer-shrink-0 univer-grow-0 univer-justify-between`,children:[M(k,{className:`univer-w-20`,onClick:i?u:s,children:i?`Cancel`:`Close`}),M(k,{className:`univer-w-20`,variant:`primary`,onClick:i?l:()=>c(),children:i?`Save`:`Start`}),!i&&M(k,{variant:`primary`,onClick:()=>c(!0),children:`Start(N)`})]})]})}let Q=class extends t{constructor(e,t,n,r,i,a){super(),this._commandSrv=e,this._uiPartsSrv=t,this._menuManagerService=n,this._componentManager=r,this._actionRecorderService=i,this._injector=a,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[V,U,H,Y,X,K,q,J].forEach(e=>this._commandSrv.registerCommand(e))}_initUI(){this._uiPartsSrv.registerComponent(Be.GLOBAL,()=>Ge(rt,this._injector)),this.disposeWithMe(this._componentManager.register(`RecordIcon`,d)),this._menuManagerService.mergeMenu(nt)}_initSheetsCommands(){[ie,ae,oe,se,ce,pe,le,ue,de,fe,he,xe,ee,f,ne,te,ge,p,_e,ve,je,h,g,_,v,y,b,x,S,ye,be,Se,Ce,we,Te,Me,Ne,Pe,Fe,Ie,Le,Re,ze,re,me,Ee,De,m,ke,Ae,Oe].forEach(e=>this._actionRecorderService.registerRecordedCommand(e))}_initDocsCommands(){}};Q=z([R(0,n),R(1,Ue),R(2,He),R(3,o(Ve)),R(4,o(B)),R(5,o(s))],Q);let $=class extends c{constructor(e=F,t,n){super(),this._config=e,this._injector=t,this._configService=n;let{menu:r,...i}=u({},F,this._config);r&&this._configService.setConfig(`menu`,r,{merge:!0}),this._configService.setConfig(P,i)}onStarting(){(this._config.replayOnly?[[G]]:[[B],[G],[Q]]).forEach(e=>this._injector.add(e))}onSteady(){this._config.replayOnly||this._injector.get(Q)}};L($,`pluginName`,`UNIVER_ACTION_RECORDER_PLUGIN`),L($,`packageName`,Ke),L($,`version`,qe),$=z([R(1,o(s)),R(2,r)],$);export{B as ActionRecorderService,G as ActionReplayService,$ as UniverActionRecorderPlugin};
1
+ import { CommandType, Disposable, ICommandService, IConfigService, ILogService, IUniverInstanceService, Inject, Injector, Plugin, awaitTime, merge } from "@univerjs/core";
2
+ import { RecordIcon } from "@univerjs/icons";
3
+ import { AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeVerticalCommand, AutoFillCommand, CancelFrozenCommand, CopySheetCommand, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeltaColumnWidthCommand, DeltaRowHeightCommand, InsertColAfterCommand, InsertColBeforeCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertSheetCommand, RefillCommand, RemoveSheetCommand, SetFrozenCommand, SetHorizontalTextAlignCommand, SetOverlineCommand, SetRangeValuesCommand, SetSelectionsOperation, SetStrikeThroughCommand, SetStyleCommand, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetVerticalTextAlignCommand, SetWorksheetActivateCommand, SetWorksheetActiveOperation } from "@univerjs/sheets";
4
+ import { RemoveSheetFilterCommand, SetSheetFilterRangeCommand, SetSheetsFilterCriteriaCommand } from "@univerjs/sheets-filter";
5
+ import { SetRangeBoldCommand, SetRangeFontFamilyCommand, SetRangeFontSizeCommand, SetRangeItalicCommand, SetRangeStrickThroughCommand, SetRangeSubscriptCommand, SetRangeSuperscriptCommand, SetRangeTextColorCommand, SetRangeUnderlineCommand, SheetCopyCommand, SheetCutCommand, SheetPasteBesidesBorderCommand, SheetPasteColWidthCommand, SheetPasteCommand, SheetPasteFormatCommand, SheetPasteShortKeyCommand, SheetPasteValueCommand } from "@univerjs/sheets-ui";
6
+ import { BuiltInUIPart, ComponentManager, ILocalFileService, IMenuManagerService, IMessageService, IUIPartsService, MenuItemType, RibbonOthersGroup, connectInjector, useDependency, useObservable } from "@univerjs/ui";
7
+ import { BehaviorSubject } from "rxjs";
8
+ import { Button, MessageType } from "@univerjs/design";
9
+ import { useCallback } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+
12
+ //#region package.json
13
+ var name = "@univerjs/action-recorder";
14
+ var version = "0.21.0";
15
+
16
+ //#endregion
17
+ //#region src/config/config.ts
18
+ const ACTION_RECORDER_PLUGIN_CONFIG_KEY = "action-recorder.config";
19
+ const configSymbol = Symbol(ACTION_RECORDER_PLUGIN_CONFIG_KEY);
20
+ const defaultPluginConfig = {};
21
+
22
+ //#endregion
23
+ //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
24
+ function _typeof(o) {
25
+ "@babel/helpers - typeof";
26
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
27
+ return typeof o;
28
+ } : function(o) {
29
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
30
+ }, _typeof(o);
31
+ }
32
+
33
+ //#endregion
34
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
35
+ function toPrimitive(t, r) {
36
+ if ("object" != _typeof(t) || !t) return t;
37
+ var e = t[Symbol.toPrimitive];
38
+ if (void 0 !== e) {
39
+ var i = e.call(t, r || "default");
40
+ if ("object" != _typeof(i)) return i;
41
+ throw new TypeError("@@toPrimitive must return a primitive value.");
42
+ }
43
+ return ("string" === r ? String : Number)(t);
44
+ }
45
+
46
+ //#endregion
47
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
48
+ function toPropertyKey(t) {
49
+ var i = toPrimitive(t, "string");
50
+ return "symbol" == _typeof(i) ? i : i + "";
51
+ }
52
+
53
+ //#endregion
54
+ //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
55
+ function _defineProperty(e, r, t) {
56
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
57
+ value: t,
58
+ enumerable: !0,
59
+ configurable: !0,
60
+ writable: !0
61
+ }) : e[r] = t, e;
62
+ }
63
+
64
+ //#endregion
65
+ //#region \0@oxc-project+runtime@0.124.0/helpers/decorateParam.js
66
+ function __decorateParam(paramIndex, decorator) {
67
+ return function(target, key) {
68
+ decorator(target, key, paramIndex);
69
+ };
70
+ }
71
+
72
+ //#endregion
73
+ //#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
74
+ function __decorate(decorators, target, key, desc) {
75
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
76
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
77
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
78
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
79
+ }
80
+
81
+ //#endregion
82
+ //#region src/services/action-recorder.service.ts
83
+ let ActionRecorderService = class ActionRecorderService extends Disposable {
84
+ get recording() {
85
+ return this._recording$.getValue();
86
+ }
87
+ get _recorded() {
88
+ return this._recorded$.getValue();
89
+ }
90
+ get _recordedCommands() {
91
+ return this._recordedCommands$.getValue();
92
+ }
93
+ constructor(_commandSrv, _logService, _localFileService, _instanceService) {
94
+ super();
95
+ this._commandSrv = _commandSrv;
96
+ this._logService = _logService;
97
+ this._localFileService = _localFileService;
98
+ this._instanceService = _instanceService;
99
+ _defineProperty(this, "_shouldRecordCommands", /* @__PURE__ */ new Set());
100
+ _defineProperty(this, "_panelOpened$", new BehaviorSubject(false));
101
+ _defineProperty(this, "panelOpened$", this._panelOpened$.asObservable());
102
+ _defineProperty(this, "_recorder", null);
103
+ _defineProperty(this, "_recording$", new BehaviorSubject(false));
104
+ _defineProperty(this, "recording$", this._recording$.asObservable());
105
+ _defineProperty(this, "_recorded$", new BehaviorSubject([]));
106
+ _defineProperty(this, "_recordedCommands$", new BehaviorSubject([]));
107
+ _defineProperty(this, "recordedCommands$", this._recordedCommands$.asObservable());
108
+ }
109
+ registerRecordedCommand(command) {
110
+ if (command.type === CommandType.MUTATION) throw new Error("[CommandRecorderService] Cannot record mutation commands.");
111
+ this._shouldRecordCommands.add(command.id);
112
+ }
113
+ togglePanel(visible) {
114
+ this._panelOpened$.next(visible);
115
+ if (visible === false) this.stopRecording();
116
+ }
117
+ startRecording(replaceId = false) {
118
+ this._recorder = this._commandSrv.onCommandExecuted((rawCommandInfo) => {
119
+ if (this._shouldRecordCommands.has(rawCommandInfo.id)) {
120
+ var _this$_instanceServic;
121
+ const recorded = this._recorded;
122
+ const commands = this._recordedCommands;
123
+ let commandInfo = { ...rawCommandInfo };
124
+ const focusUnitId = (_this$_instanceServic = this._instanceService.getFocusedUnit()) === null || _this$_instanceServic === void 0 ? void 0 : _this$_instanceServic.getUnitId();
125
+ const { unitId = focusUnitId, subUnitId } = commandInfo === null || commandInfo === void 0 ? void 0 : commandInfo.params;
126
+ if (replaceId && unitId && subUnitId) {
127
+ var _getSheetBySheetId;
128
+ const subUnitName = (_getSheetBySheetId = this._instanceService.getUnit(unitId).getSheetBySheetId(subUnitId)) === null || _getSheetBySheetId === void 0 ? void 0 : _getSheetBySheetId.getName();
129
+ commandInfo = {
130
+ ...commandInfo,
131
+ params: {
132
+ ...commandInfo.params,
133
+ subUnitId: subUnitName
134
+ }
135
+ };
136
+ }
137
+ if (commandInfo.id === SetSelectionsOperation.id && recorded.length > 0 && recorded[recorded.length - 1].id === SetSelectionsOperation.id) recorded[recorded.length - 1] = commandInfo;
138
+ else {
139
+ recorded.push(commandInfo);
140
+ this._recorded$.next(recorded);
141
+ if (commandInfo.type === CommandType.COMMAND) {
142
+ commands.push(commandInfo);
143
+ this._recordedCommands$.next(commands);
144
+ }
145
+ }
146
+ }
147
+ });
148
+ this._recording$.next(true);
149
+ }
150
+ stopRecording() {
151
+ var _this$_recorder;
152
+ (_this$_recorder = this._recorder) === null || _this$_recorder === void 0 || _this$_recorder.dispose();
153
+ this._recorder = null;
154
+ this._recorded$.next([]);
155
+ this._recordedCommands$.next([]);
156
+ this._recording$.next(false);
157
+ }
158
+ completeRecording() {
159
+ const commands = this._recorded.slice();
160
+ this._localFileService.downloadFile(new Blob([JSON.stringify(commands, null, 2)]), "recorded-commands.json");
161
+ this._logService.error("Recorded commands:", commands);
162
+ this.stopRecording();
163
+ }
164
+ };
165
+ ActionRecorderService = __decorate([
166
+ __decorateParam(0, ICommandService),
167
+ __decorateParam(1, ILogService),
168
+ __decorateParam(2, ILocalFileService),
169
+ __decorateParam(3, IUniverInstanceService)
170
+ ], ActionRecorderService);
171
+
172
+ //#endregion
173
+ //#region src/commands/commands/record.command.ts
174
+ const StartRecordingActionCommand = {
175
+ id: "action-recorder.command.start-recording",
176
+ type: CommandType.COMMAND,
177
+ handler: (accessor, params) => {
178
+ accessor.get(ActionRecorderService).startRecording(!!(params === null || params === void 0 ? void 0 : params.replaceId));
179
+ return true;
180
+ }
181
+ };
182
+ const CompleteRecordingActionCommand = {
183
+ id: "action-recorder.command.complete-recording",
184
+ type: CommandType.COMMAND,
185
+ handler: (accessor) => {
186
+ accessor.get(ActionRecorderService).completeRecording();
187
+ return true;
188
+ }
189
+ };
190
+ const StopRecordingActionCommand = {
191
+ id: "action-recorder.command.stop-recording",
192
+ type: CommandType.COMMAND,
193
+ handler: (accessor) => {
194
+ accessor.get(ActionRecorderService).completeRecording();
195
+ return true;
196
+ }
197
+ };
198
+
199
+ //#endregion
200
+ //#region src/services/replay.service.ts
201
+ let ReplayMode = /* @__PURE__ */ function(ReplayMode) {
202
+ ReplayMode["DEFAULT"] = "default";
203
+ ReplayMode["NAME"] = "name";
204
+ ReplayMode["ACTIVE"] = "active";
205
+ return ReplayMode;
206
+ }({});
207
+ let ActionReplayService = class ActionReplayService extends Disposable {
208
+ constructor(_messageService, _instanceService, _localFileService, _logService, _commandService) {
209
+ super();
210
+ this._messageService = _messageService;
211
+ this._instanceService = _instanceService;
212
+ this._localFileService = _localFileService;
213
+ this._logService = _logService;
214
+ this._commandService = _commandService;
215
+ }
216
+ /**
217
+ * Read a local file and try to replay commands in this JSON.
218
+ */
219
+ async replayLocalJSON(mode = ReplayMode.DEFAULT) {
220
+ const files = await this._localFileService.openFile({
221
+ multiple: false,
222
+ accept: ".json"
223
+ });
224
+ if (files.length !== 1) return false;
225
+ const file = files[0];
226
+ try {
227
+ return this.replayCommands(JSON.parse(await file.text()), { mode });
228
+ } catch {
229
+ this._messageService.show({
230
+ type: MessageType.Error,
231
+ content: `Failed to replay commands from local file ${file.name}.`
232
+ });
233
+ return false;
234
+ }
235
+ }
236
+ /**
237
+ * Replay a list of commands. Note that `unitId` of these commands would be changed to the focused unit.
238
+ * @param commands - The commands to replay.
239
+ * @returns If the replay is successful.
240
+ */
241
+ async replayCommands(commands, options) {
242
+ var _this$_instanceServic;
243
+ const focusedUnitId = (_this$_instanceServic = this._instanceService.getFocusedUnit()) === null || _this$_instanceServic === void 0 ? void 0 : _this$_instanceServic.getUnitId();
244
+ if (!focusedUnitId) this._logService.error("[ReplayService]", "no focused unit to replay commands");
245
+ const { mode } = options || {};
246
+ for (const command of commands) {
247
+ const { id, params } = command;
248
+ const commandParams = params;
249
+ if (commandParams) {
250
+ if (typeof commandParams.unitId !== "undefined") commandParams.unitId = focusedUnitId;
251
+ if (mode === ReplayMode.NAME && commandParams.subUnitId !== "undefined") {
252
+ var _getSheetBySheetName;
253
+ const realSubUnitId = (_getSheetBySheetName = this._instanceService.getFocusedUnit().getSheetBySheetName(commandParams.subUnitId)) === null || _getSheetBySheetName === void 0 ? void 0 : _getSheetBySheetName.getSheetId();
254
+ if (realSubUnitId) commandParams.subUnitId = realSubUnitId;
255
+ else this._logService.error("[ReplayService]", `failed to find subunit by subUnitName = ${commandParams.subUnitId}`);
256
+ }
257
+ if (mode === ReplayMode.ACTIVE && commandParams.subUnitId !== "undefined") {
258
+ var _getActiveSheet;
259
+ const realSubUnitId = (_getActiveSheet = this._instanceService.getFocusedUnit().getActiveSheet()) === null || _getActiveSheet === void 0 ? void 0 : _getActiveSheet.getSheetId();
260
+ if (realSubUnitId) commandParams.subUnitId = realSubUnitId;
261
+ else this._logService.error("[ReplayService]", "failed to find active subunit");
262
+ }
263
+ if (!await this._commandService.executeCommand(id, params)) return false;
264
+ } else if (!await this._commandService.executeCommand(id)) return false;
265
+ }
266
+ return true;
267
+ }
268
+ /**
269
+ * Replay a list of commands with a random delay between each command.
270
+ * @param commands - The commands to replay.
271
+ */
272
+ async replayCommandsWithDelay(commands) {
273
+ var _this$_instanceServic2;
274
+ const focusedUnitId = (_this$_instanceServic2 = this._instanceService.getFocusedUnit()) === null || _this$_instanceServic2 === void 0 ? void 0 : _this$_instanceServic2.getUnitId();
275
+ if (!focusedUnitId) this._logService.error("[ReplayService]", "no focused unit to replay commands");
276
+ for (const command of commands) {
277
+ await awaitTime(randomBetween200And1k());
278
+ const { id, params } = command;
279
+ if (params) {
280
+ if (typeof params.unitId !== "undefined") params.unitId = focusedUnitId;
281
+ if (!await this._commandService.executeCommand(id, params)) return false;
282
+ } else if (!await this._commandService.executeCommand(id)) return false;
283
+ }
284
+ return true;
285
+ }
286
+ };
287
+ ActionReplayService = __decorate([
288
+ __decorateParam(0, IMessageService),
289
+ __decorateParam(1, IUniverInstanceService),
290
+ __decorateParam(2, ILocalFileService),
291
+ __decorateParam(3, ILogService),
292
+ __decorateParam(4, ICommandService)
293
+ ], ActionReplayService);
294
+ function randomBetween200And1k() {
295
+ return Math.floor(Math.random() * 800) + 200;
296
+ }
297
+
298
+ //#endregion
299
+ //#region src/commands/commands/replay.command.ts
300
+ const ReplayLocalRecordCommand = {
301
+ id: "action-recorder.command.replay-local-records",
302
+ type: CommandType.COMMAND,
303
+ handler: async (accessor) => {
304
+ const result = await accessor.get(ActionReplayService).replayLocalJSON();
305
+ if (result) accessor.get(IMessageService).show({
306
+ type: MessageType.Success,
307
+ content: "Successfully replayed local records"
308
+ });
309
+ return result;
310
+ }
311
+ };
312
+ const ReplayLocalRecordOnNamesakeCommand = {
313
+ id: "action-recorder.command.replay-local-records-name",
314
+ type: CommandType.COMMAND,
315
+ handler: async (accessor) => {
316
+ const result = await accessor.get(ActionReplayService).replayLocalJSON(ReplayMode.NAME);
317
+ if (result) accessor.get(IMessageService).show({
318
+ type: MessageType.Success,
319
+ content: "Successfully replayed local records"
320
+ });
321
+ return result;
322
+ }
323
+ };
324
+ const ReplayLocalRecordOnActiveCommand = {
325
+ id: "action-recorder.command.replay-local-records-active",
326
+ type: CommandType.COMMAND,
327
+ handler: async (accessor) => {
328
+ const result = await accessor.get(ActionReplayService).replayLocalJSON(ReplayMode.ACTIVE);
329
+ if (result) accessor.get(IMessageService).show({
330
+ type: MessageType.Success,
331
+ content: "Successfully replayed local records"
332
+ });
333
+ return result;
334
+ }
335
+ };
336
+
337
+ //#endregion
338
+ //#region src/commands/operations/operation.ts
339
+ const OpenRecordPanelOperation = {
340
+ id: "action-recorder.operation.open-panel",
341
+ type: CommandType.OPERATION,
342
+ handler(accessor) {
343
+ accessor.get(ActionRecorderService).togglePanel(true);
344
+ return true;
345
+ }
346
+ };
347
+ const CloseRecordPanelOperation = {
348
+ id: "action-recorder.operation.close-panel",
349
+ type: CommandType.OPERATION,
350
+ handler(accessor) {
351
+ accessor.get(ActionRecorderService).togglePanel(false);
352
+ return true;
353
+ }
354
+ };
355
+
356
+ //#endregion
357
+ //#region src/menu/action-recorder.menu.ts
358
+ const RECORD_MENU_ITEM_ID = "RECORD_MENU_ITEM";
359
+ function RecordMenuItemFactory() {
360
+ return {
361
+ id: RECORD_MENU_ITEM_ID,
362
+ type: MenuItemType.SUBITEMS,
363
+ icon: "RecordIcon",
364
+ tooltip: "action-recorder.menu.title"
365
+ };
366
+ }
367
+ function OpenRecorderMenuItemFactory(accessor) {
368
+ const actionRecorderService = accessor.get(ActionRecorderService);
369
+ return {
370
+ id: OpenRecordPanelOperation.id,
371
+ title: "action-recorder.menu.record",
372
+ type: MenuItemType.BUTTON,
373
+ disabled$: actionRecorderService.panelOpened$
374
+ };
375
+ }
376
+ function ReplayLocalRecordMenuItemFactory() {
377
+ return {
378
+ id: ReplayLocalRecordCommand.id,
379
+ title: "action-recorder.menu.replay-local",
380
+ type: MenuItemType.BUTTON
381
+ };
382
+ }
383
+ function ReplayLocalRecordOnNamesakeMenuItemFactory() {
384
+ return {
385
+ id: ReplayLocalRecordOnNamesakeCommand.id,
386
+ title: "action-recorder.menu.replay-local-name",
387
+ type: MenuItemType.BUTTON
388
+ };
389
+ }
390
+ function ReplayLocalRecordOnActiveMenuItemFactory() {
391
+ return {
392
+ id: ReplayLocalRecordOnActiveCommand.id,
393
+ title: "action-recorder.menu.replay-local-active",
394
+ type: MenuItemType.BUTTON
395
+ };
396
+ }
397
+ const menuSchema = { [RibbonOthersGroup.OTHERS]: { [RECORD_MENU_ITEM_ID]: {
398
+ order: 1,
399
+ menuItemFactory: RecordMenuItemFactory,
400
+ [OpenRecordPanelOperation.id]: {
401
+ order: 1,
402
+ menuItemFactory: OpenRecorderMenuItemFactory
403
+ },
404
+ [ReplayLocalRecordCommand.id]: {
405
+ order: 2,
406
+ menuItemFactory: ReplayLocalRecordMenuItemFactory
407
+ },
408
+ [ReplayLocalRecordOnNamesakeCommand.id]: {
409
+ order: 3,
410
+ menuItemFactory: ReplayLocalRecordOnNamesakeMenuItemFactory
411
+ },
412
+ [ReplayLocalRecordOnActiveCommand.id]: {
413
+ order: 4,
414
+ menuItemFactory: ReplayLocalRecordOnActiveMenuItemFactory
415
+ }
416
+ } } };
417
+
418
+ //#endregion
419
+ //#region src/views/components/RecorderPanel.tsx
420
+ /**
421
+ * Copyright 2023-present DreamNum Co., Ltd.
422
+ *
423
+ * Licensed under the Apache License, Version 2.0 (the "License");
424
+ * you may not use this file except in compliance with the License.
425
+ * You may obtain a copy of the License at
426
+ *
427
+ * http://www.apache.org/licenses/LICENSE-2.0
428
+ *
429
+ * Unless required by applicable law or agreed to in writing, software
430
+ * distributed under the License is distributed on an "AS IS" BASIS,
431
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
432
+ * See the License for the specific language governing permissions and
433
+ * limitations under the License.
434
+ */
435
+ function RecorderPanel() {
436
+ if (!useObservable(useDependency(ActionRecorderService).panelOpened$)) return null;
437
+ return /* @__PURE__ */ jsx(RecordPanelImpl, {});
438
+ }
439
+ function RecordPanelImpl() {
440
+ var _recordedCommands$len;
441
+ const commandService = useDependency(ICommandService);
442
+ const actionRecorderService = useDependency(ActionRecorderService);
443
+ const recording = useObservable(actionRecorderService.recording$);
444
+ const recordedCommands = useObservable(actionRecorderService.recordedCommands$);
445
+ const len = (_recordedCommands$len = recordedCommands === null || recordedCommands === void 0 ? void 0 : recordedCommands.length) !== null && _recordedCommands$len !== void 0 ? _recordedCommands$len : 0;
446
+ const closePanel = useCallback(() => {
447
+ if (!recording) commandService.executeCommand(CloseRecordPanelOperation.id);
448
+ }, [commandService, recording]);
449
+ const startRecording = useCallback((replaceId) => {
450
+ if (!recording) commandService.executeCommand(StartRecordingActionCommand.id, { replaceId });
451
+ }, [commandService, recording]);
452
+ const completeRecording = useCallback(() => {
453
+ if (recording) commandService.executeCommand(CompleteRecordingActionCommand.id);
454
+ }, [commandService, recording]);
455
+ const stopRecording = useCallback(() => {
456
+ if (recording) commandService.executeCommand(StopRecordingActionCommand.id);
457
+ }, [commandService, recording]);
458
+ const titleText = recording ? len === 0 ? "Recording..." : `${len}: ${recordedCommands[len - 1].id}` : "Start Recording";
459
+ return /* @__PURE__ */ jsxs("div", {
460
+ 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",
461
+ children: [
462
+ /* @__PURE__ */ jsx("div", {
463
+ className: "univer-mr-2 univer-size-5 univer-shrink-0 univer-grow-0 univer-text-xl",
464
+ children: /* @__PURE__ */ jsx(RecordIcon, {})
465
+ }),
466
+ /* @__PURE__ */ jsx("div", {
467
+ className: "univer-flex-1 univer-text-sm",
468
+ children: titleText
469
+ }),
470
+ /* @__PURE__ */ jsxs("div", {
471
+ className: "univer-flex univer-w-64 univer-shrink-0 univer-grow-0 univer-justify-between",
472
+ children: [
473
+ /* @__PURE__ */ jsx(Button, {
474
+ className: "univer-w-20",
475
+ onClick: recording ? stopRecording : closePanel,
476
+ children: recording ? "Cancel" : "Close"
477
+ }),
478
+ /* @__PURE__ */ jsx(Button, {
479
+ className: "univer-w-20",
480
+ variant: "primary",
481
+ onClick: recording ? completeRecording : () => startRecording(),
482
+ children: recording ? "Save" : "Start"
483
+ }),
484
+ !recording && /* @__PURE__ */ jsx(Button, {
485
+ variant: "primary",
486
+ onClick: () => startRecording(true),
487
+ children: "Start(N)"
488
+ })
489
+ ]
490
+ })
491
+ ]
492
+ });
493
+ }
494
+
495
+ //#endregion
496
+ //#region src/controllers/action-recorder.controller.tsx
497
+ /**
498
+ * Copyright 2023-present DreamNum Co., Ltd.
499
+ *
500
+ * Licensed under the Apache License, Version 2.0 (the "License");
501
+ * you may not use this file except in compliance with the License.
502
+ * You may obtain a copy of the License at
503
+ *
504
+ * http://www.apache.org/licenses/LICENSE-2.0
505
+ *
506
+ * Unless required by applicable law or agreed to in writing, software
507
+ * distributed under the License is distributed on an "AS IS" BASIS,
508
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
509
+ * See the License for the specific language governing permissions and
510
+ * limitations under the License.
511
+ */
512
+ let ActionRecorderController = class ActionRecorderController extends Disposable {
513
+ constructor(_commandSrv, _uiPartsSrv, _menuManagerService, _componentManager, _actionRecorderService, _injector) {
514
+ super();
515
+ this._commandSrv = _commandSrv;
516
+ this._uiPartsSrv = _uiPartsSrv;
517
+ this._menuManagerService = _menuManagerService;
518
+ this._componentManager = _componentManager;
519
+ this._actionRecorderService = _actionRecorderService;
520
+ this._injector = _injector;
521
+ this._initCommands();
522
+ this._initUI();
523
+ this._initSheetsCommands();
524
+ this._initDocsCommands();
525
+ }
526
+ _initCommands() {
527
+ [
528
+ StartRecordingActionCommand,
529
+ StopRecordingActionCommand,
530
+ CompleteRecordingActionCommand,
531
+ OpenRecordPanelOperation,
532
+ CloseRecordPanelOperation,
533
+ ReplayLocalRecordCommand,
534
+ ReplayLocalRecordOnNamesakeCommand,
535
+ ReplayLocalRecordOnActiveCommand
536
+ ].forEach((command) => this._commandSrv.registerCommand(command));
537
+ }
538
+ _initUI() {
539
+ this._uiPartsSrv.registerComponent(BuiltInUIPart.GLOBAL, () => connectInjector(RecorderPanel, this._injector));
540
+ this.disposeWithMe(this._componentManager.register("RecordIcon", RecordIcon));
541
+ this._menuManagerService.mergeMenu(menuSchema);
542
+ }
543
+ _initSheetsCommands() {
544
+ [
545
+ CopySheetCommand,
546
+ DeleteRangeMoveLeftCommand,
547
+ DeleteRangeMoveUpCommand,
548
+ DeltaColumnWidthCommand,
549
+ DeltaRowHeightCommand,
550
+ InsertSheetCommand,
551
+ InsertColAfterCommand,
552
+ InsertColBeforeCommand,
553
+ InsertRowAfterCommand,
554
+ InsertRowBeforeCommand,
555
+ RemoveSheetCommand,
556
+ SetStyleCommand,
557
+ AddWorksheetMergeCommand,
558
+ AddWorksheetMergeAllCommand,
559
+ AddWorksheetMergeVerticalCommand,
560
+ AddWorksheetMergeHorizontalCommand,
561
+ SetFrozenCommand,
562
+ CancelFrozenCommand,
563
+ SetHorizontalTextAlignCommand,
564
+ SetOverlineCommand,
565
+ SetRangeBoldCommand,
566
+ SetRangeFontFamilyCommand,
567
+ SetRangeFontSizeCommand,
568
+ SetRangeItalicCommand,
569
+ SetRangeStrickThroughCommand,
570
+ SetRangeSubscriptCommand,
571
+ SetRangeSuperscriptCommand,
572
+ SetRangeTextColorCommand,
573
+ SetRangeUnderlineCommand,
574
+ SetRangeValuesCommand,
575
+ SetStrikeThroughCommand,
576
+ SetTextColorCommand,
577
+ SetTextRotationCommand,
578
+ SetTextWrapCommand,
579
+ SetVerticalTextAlignCommand,
580
+ SheetCopyCommand,
581
+ SheetCutCommand,
582
+ SheetPasteBesidesBorderCommand,
583
+ SheetPasteColWidthCommand,
584
+ SheetPasteCommand,
585
+ SheetPasteFormatCommand,
586
+ SheetPasteShortKeyCommand,
587
+ SheetPasteValueCommand,
588
+ AutoFillCommand,
589
+ RefillCommand,
590
+ SetWorksheetActivateCommand,
591
+ SetWorksheetActiveOperation,
592
+ SetSelectionsOperation,
593
+ SetSheetFilterRangeCommand,
594
+ SetSheetsFilterCriteriaCommand,
595
+ RemoveSheetFilterCommand
596
+ ].forEach((command) => this._actionRecorderService.registerRecordedCommand(command));
597
+ }
598
+ _initDocsCommands() {}
599
+ };
600
+ ActionRecorderController = __decorate([
601
+ __decorateParam(0, ICommandService),
602
+ __decorateParam(1, IUIPartsService),
603
+ __decorateParam(2, IMenuManagerService),
604
+ __decorateParam(3, Inject(ComponentManager)),
605
+ __decorateParam(4, Inject(ActionRecorderService)),
606
+ __decorateParam(5, Inject(Injector))
607
+ ], ActionRecorderController);
608
+
609
+ //#endregion
610
+ //#region src/plugin.ts
611
+ let UniverActionRecorderPlugin = class UniverActionRecorderPlugin extends Plugin {
612
+ constructor(_config = defaultPluginConfig, _injector, _configService) {
613
+ super();
614
+ this._config = _config;
615
+ this._injector = _injector;
616
+ this._configService = _configService;
617
+ const { menu, ...rest } = merge({}, defaultPluginConfig, this._config);
618
+ if (menu) this._configService.setConfig("menu", menu, { merge: true });
619
+ this._configService.setConfig(ACTION_RECORDER_PLUGIN_CONFIG_KEY, rest);
620
+ }
621
+ onStarting() {
622
+ (this._config.replayOnly ? [[ActionReplayService]] : [
623
+ [ActionRecorderService],
624
+ [ActionReplayService],
625
+ [ActionRecorderController]
626
+ ]).forEach((d) => this._injector.add(d));
627
+ }
628
+ onSteady() {
629
+ if (this._config.replayOnly) return;
630
+ this._injector.get(ActionRecorderController);
631
+ }
632
+ };
633
+ _defineProperty(UniverActionRecorderPlugin, "pluginName", "UNIVER_ACTION_RECORDER_PLUGIN");
634
+ _defineProperty(UniverActionRecorderPlugin, "packageName", name);
635
+ _defineProperty(UniverActionRecorderPlugin, "version", version);
636
+ UniverActionRecorderPlugin = __decorate([__decorateParam(1, Inject(Injector)), __decorateParam(2, IConfigService)], UniverActionRecorderPlugin);
637
+
638
+ //#endregion
639
+ export { ActionRecorderService, ActionReplayService, UniverActionRecorderPlugin };
@@ -1 +1,11 @@
1
- const e={"action-recorder":{menu:{title:`Grava accions`,record:`Grava accions...`,"replay-local":`Reemplaça gravació local...`,"replay-local-name":`Reemplaça gravació local per subunitat...`,"replay-local-active":`Reemplaça gravació local per subunitat actual...`}}};export{e as default};
1
+ //#region src/locale/ca-ES.ts
2
+ const locale = { "action-recorder": { menu: {
3
+ title: "Grava accions",
4
+ record: "Grava accions...",
5
+ "replay-local": "Reemplaça gravació local...",
6
+ "replay-local-name": "Reemplaça gravació local per subunitat...",
7
+ "replay-local-active": "Reemplaça gravació local per subunitat actual..."
8
+ } } };
9
+
10
+ //#endregion
11
+ export { locale as default };