@univerjs/action-recorder 0.5.0-nightly.202411181606

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/README.md +16 -0
  2. package/lib/cjs/index.js +9 -0
  3. package/lib/cjs/locale/en-US.js +1 -0
  4. package/lib/cjs/locale/fa-IR.js +1 -0
  5. package/lib/cjs/locale/ru-RU.js +1 -0
  6. package/lib/cjs/locale/vi-VN.js +1 -0
  7. package/lib/cjs/locale/zh-CN.js +1 -0
  8. package/lib/cjs/locale/zh-TW.js +1 -0
  9. package/lib/es/index.js +538 -0
  10. package/lib/es/locale/en-US.js +12 -0
  11. package/lib/es/locale/fa-IR.js +12 -0
  12. package/lib/es/locale/ru-RU.js +12 -0
  13. package/lib/es/locale/vi-VN.js +12 -0
  14. package/lib/es/locale/zh-CN.js +12 -0
  15. package/lib/es/locale/zh-TW.js +12 -0
  16. package/lib/index.css +1 -0
  17. package/lib/types/commands/commands/record.command.d.ts +8 -0
  18. package/lib/types/commands/commands/replay.command.d.ts +4 -0
  19. package/lib/types/commands/operations/operation.d.ts +3 -0
  20. package/lib/types/controllers/action-recorder.controller.d.ts +16 -0
  21. package/lib/types/controllers/action-recorder.menu.d.ts +9 -0
  22. package/lib/types/controllers/config.schema.d.ts +8 -0
  23. package/lib/types/index.d.ts +18 -0
  24. package/lib/types/locale/en-US.d.ts +3 -0
  25. package/lib/types/locale/fa-IR.d.ts +3 -0
  26. package/lib/types/locale/ru-RU.d.ts +3 -0
  27. package/lib/types/locale/vi-VN.d.ts +3 -0
  28. package/lib/types/locale/zh-CN.d.ts +25 -0
  29. package/lib/types/locale/zh-TW.d.ts +3 -0
  30. package/lib/types/plugin.d.ts +15 -0
  31. package/lib/types/services/action-recorder.service.d.ts +30 -0
  32. package/lib/types/services/replay.service.d.ts +35 -0
  33. package/lib/types/views/components/RecorderPanel.d.ts +2 -0
  34. package/lib/umd/index.js +9 -0
  35. package/lib/umd/locale/en-US.js +1 -0
  36. package/lib/umd/locale/fa-IR.js +1 -0
  37. package/lib/umd/locale/ru-RU.js +1 -0
  38. package/lib/umd/locale/vi-VN.js +1 -0
  39. package/lib/umd/locale/zh-CN.js +1 -0
  40. package/lib/umd/locale/zh-TW.js +1 -0
  41. package/package.json +99 -0
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # @univerjs/action-recorder
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@univerjs/action-recorder)](https://npmjs.org/packages/@univerjs/action-recorder)
4
+ [![license](https://img.shields.io/npm/l/@univerjs/action-recorder)](https://img.shields.io/npm/l/@univerjs/action-recorder)
5
+
6
+ ## Introduction
7
+
8
+ This plugin is used to record user actions and it can also replay them.
9
+
10
+ ## Usage
11
+
12
+ ### Installation
13
+
14
+ ```shell
15
+ npm i @univerjs/action-recorder
16
+ ```
@@ -0,0 +1,9 @@
1
+ "use strict";var Z=Object.defineProperty;var K=(e,n,r)=>n in e?Z(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var v=(e,n,r)=>K(e,typeof n!="symbol"?n+"":n,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@univerjs/core"),s=require("@univerjs/sheets"),T=require("@univerjs/sheets-filter"),m=require("@univerjs/sheets-ui"),d=require("@univerjs/ui"),A=require("rxjs"),C=require("@univerjs/design"),S=require("react");var p=function(){return p=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},p.apply(this,arguments)},Y=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},L=S.forwardRef(function(e,n){var r=e.icon,t=e.id,o=e.className,c=e.extend,i=Y(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(t," ").concat(o||"").trim(),l=S.useRef("_".concat(ee()));return B(r,"".concat(t),{defIds:r.defIds,idSuffix:l.current},p({ref:n,className:u},i),c)});function B(e,n,r,t,o){return S.createElement(e.tag,p(p({key:n},Q(e,r,o)),t),(X(e,r).children||[]).map(function(c,i){return B(c,"".concat(n,"-").concat(e.tag,"-").concat(i),r,void 0,o)}))}function Q(e,n,r){var t=p({},e.attrs);r!=null&&r.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=r.colorChannel1);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(c){var i=c[0],u=c[1];typeof u=="string"&&(t[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function X(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)?p(p({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&t&&t.indexOf(o.attrs.id)>-1?p(p({},o),{attrs:p(p({},o.attrs),{id:o.attrs.id+n.idSuffix})}):o})}):e}function ee(){return Math.random().toString(36).substring(2,8)}L.displayName="UniverIcon";var re={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"]},U=S.forwardRef(function(e,n){return S.createElement(L,Object.assign({},e,{id:"record-single",ref:n,icon:re}))});U.displayName="RecordSingle";var te=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,oe=(e,n,r,t)=>{for(var o=t>1?void 0:t?ne(n,r):n,c=e.length-1,i;c>=0;c--)(i=e[c])&&(o=(t?i(n,r,o):i(o))||o);return t&&o&&te(n,r,o),o},P=(e,n)=>(r,t)=>n(r,t,e);exports.ActionRecorderService=class extends a.Disposable{constructor(r,t,o,c){super();v(this,"_shouldRecordCommands",new Set);v(this,"_panelOpened$",new A.BehaviorSubject(!1));v(this,"panelOpened$",this._panelOpened$.asObservable());v(this,"_recorder",null);v(this,"_recording$",new A.BehaviorSubject(!1));v(this,"recording$",this._recording$.asObservable());v(this,"_recorded$",new A.BehaviorSubject([]));v(this,"_recordedCommands$",new A.BehaviorSubject([]));v(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=r,this._logService=t,this._localFileService=o,this._instanceService=c}get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}registerRecordedCommand(r){if(r.type===a.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(r.id)}togglePanel(r){this._panelOpened$.next(r),r===!1&&this.stopRecording()}startRecording(r=!1){this._recorder=this._commandSrv.onCommandExecuted(t=>{var o,c;if(this._shouldRecordCommands.has(t.id)){const i=this._recorded,u=this._recordedCommands;let l={...t};const _=(o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId(),{unitId:h=_,subUnitId:f}=l==null?void 0:l.params;if(r&&h&&f){const x=(c=this._instanceService.getUnit(h).getSheetBySheetId(f))==null?void 0:c.getName();l={...l,params:{...l.params,subUnitId:x}}}l.id===s.SetSelectionsOperation.id&&i.length>0&&i[i.length-1].id===s.SetSelectionsOperation.id?i[i.length-1]=l:(i.push(l),this._recorded$.next(i),l.type===a.CommandType.COMMAND&&(u.push(l),this._recordedCommands$.next(u)))}}),this._recording$.next(!0)}stopRecording(){var r;(r=this._recorder)==null||r.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const r=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(r,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",r),this.stopRecording()}};exports.ActionRecorderService=oe([P(0,a.ICommandService),P(1,a.ILogService),P(2,d.ILocalFileService),P(3,a.IUniverInstanceService)],exports.ActionRecorderService);const V={id:"action-recorder.command.start-recording",type:a.CommandType.COMMAND,handler:(e,n)=>(e.get(exports.ActionRecorderService).startRecording(!!(n!=null&&n.replaceId)),!0)},W={id:"action-recorder.command.complete-recording",type:a.CommandType.COMMAND,handler:e=>(e.get(exports.ActionRecorderService).completeRecording(),!0)},q={id:"action-recorder.command.stop-recording",type:a.CommandType.COMMAND,handler:e=>(e.get(exports.ActionRecorderService).completeRecording(),!0)};var ce=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=(e,n,r,t)=>{for(var o=t>1?void 0:t?ie(n,r):n,c=e.length-1,i;c>=0;c--)(i=e[c])&&(o=(t?i(n,r,o):i(o))||o);return t&&o&&ce(n,r,o),o},I=(e,n)=>(r,t)=>n(r,t,e),N=(e=>(e.DEFAULT="default",e.NAME="name",e.ACTIVE="active",e))(N||{});exports.ActionReplayService=class extends a.Disposable{constructor(n,r,t,o,c){super(),this._messageService=n,this._instanceService=r,this._localFileService=t,this._logService=o,this._commandService=c}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 c,i,u;const t=(c=this._instanceService.getFocusedUnit())==null?void 0:c.getUnitId();t||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode:o}=r||{};for(const l of n){const{id:_,params:h}=l,f=h;if(f){if(typeof f.unitId<"u"&&(f.unitId=t),o==="name"&&f.subUnitId!=="undefined"){const R=(i=this._instanceService.getFocusedUnit().getSheetBySheetName(f.subUnitId))==null?void 0:i.getSheetId();R?f.subUnitId=R:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${f.subUnitId}`)}if(o==="active"&&f.subUnitId!=="undefined"){const R=(u=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:u.getSheetId();R?f.subUnitId=R:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(_,h))return!1}else if(!await this._commandService.executeCommand(_))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 a.awaitTime(se());const{id:c,params:i}=o;if(i){if(typeof i.unitId<"u"&&(i.unitId=r),!await this._commandService.executeCommand(c,i))return!1}else if(!await this._commandService.executeCommand(c))return!1}return!0}};exports.ActionReplayService=ae([I(0,d.IMessageService),I(1,a.IUniverInstanceService),I(2,d.ILocalFileService),I(3,a.ILogService),I(4,a.ICommandService)],exports.ActionReplayService);function se(){return Math.floor(Math.random()*800)+200}const w={id:"action-recorder.command.replay-local-records",type:a.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}},$={id:"action-recorder.command.replay-local-records-name",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON(N.NAME);return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},F={id:"action-recorder.command.replay-local-records-active",type:a.CommandType.COMMAND,handler:async e=>{const r=await e.get(exports.ActionReplayService).replayLocalJSON(N.ACTIVE);return r&&e.get(d.IMessageService).show({type:C.MessageType.Success,content:"Successfully replayed local records"}),r}},E={id:"action-recorder.operation.open-panel",type:a.CommandType.OPERATION,handler(e){return e.get(exports.ActionRecorderService).togglePanel(!0),!0}},z={id:"action-recorder.operation.close-panel",type:a.CommandType.OPERATION,handler(e){return e.get(exports.ActionRecorderService).togglePanel(!1),!0}};var k={exports:{}},M={};/**
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 de=S,le=Symbol.for("react.element"),me=Symbol.for("react.fragment"),ue=Object.prototype.hasOwnProperty,fe=de.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pe={key:!0,ref:!0,__self:!0,__source:!0};function H(e,n,r){var t,o={},c=null,i=null;r!==void 0&&(c=""+r),n.key!==void 0&&(c=""+n.key),n.ref!==void 0&&(i=n.ref);for(t in n)ue.call(n,t)&&!pe.hasOwnProperty(t)&&(o[t]=n[t]);if(e&&e.defaultProps)for(t in n=e.defaultProps,n)o[t]===void 0&&(o[t]=n[t]);return{$$typeof:le,type:e,key:c,ref:i,props:o,_owner:fe.current}}M.Fragment=me;M.jsx=H;M.jsxs=H;k.exports=M;var g=k.exports;function J(e){var n,r,t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(r=J(e[n]))&&(t&&(t+=" "),t+=r)}else for(r in e)e[r]&&(t&&(t+=" "),t+=r);return t}function ve(){for(var e,n,r=0,t="",o=arguments.length;r<o;r++)(e=arguments[r])&&(n=J(e))&&(t&&(t+=" "),t+=n);return t}const Se="univer-action-recorder-panel",ge="univer-action-recorder-panel-icon",he="univer-action-recorder-panel-icon-recording",Ce="univer-recording",_e="univer-action-recorder-panel-title",ye="univer-action-recorder-panel-actions",O={actionRecorderPanel:Se,actionRecorderPanelIcon:ge,actionRecorderPanelIconRecording:he,recording:Ce,actionRecorderPanelTitle:_e,actionRecorderPanelActions:ye};function Re(){const e=a.useDependency(exports.ActionRecorderService);return d.useObservable(e.panelOpened$)?g.jsx(Ie,{}):null}function Ie(){var h;const e=a.useDependency(a.ICommandService),n=a.useDependency(exports.ActionRecorderService),r=d.useObservable(n.recording$),t=d.useObservable(n.recordedCommands$),o=(h=t==null?void 0:t.length)!=null?h:0,c=S.useCallback(()=>{r||e.executeCommand(z.id)},[e,r]),i=S.useCallback(f=>{r||e.executeCommand(V.id,{replaceId:f})},[e,r]),u=S.useCallback(()=>{r&&e.executeCommand(W.id)},[e,r]),l=S.useCallback(()=>{r&&e.executeCommand(q.id)},[e,r]),_=r?o===0?"Recording...":`${o}: ${t[o-1].id}`:"Start Recording";return g.jsxs("div",{className:O.actionRecorderPanel,children:[g.jsx("div",{className:ve(O.actionRecorderPanelIcon,r?O.actionRecorderPanelIconRecording:!1),children:g.jsx(U,{})}),g.jsx("div",{className:O.actionRecorderPanelTitle,children:_}),g.jsxs("div",{className:O.actionRecorderPanelActions,children:[g.jsx(C.Button,{type:"default",size:"small",onClick:r?l:c,children:r?"Cancel":"Close"}),g.jsx(C.Button,{type:"primary",size:"small",onClick:r?u:()=>i(),children:r?"Save":"Start"}),!r&&g.jsx(C.Button,{type:"primary",size:"small",onClick:()=>i(!0),children:"Start(N)"})]})]})}const G="RECORD_MENU_ITEM";function Oe(){return{id:G,type:d.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}function Ae(e){const n=e.get(exports.ActionRecorderService);return{id:E.id,title:"action-recorder.menu.record",type:d.MenuItemType.BUTTON,disabled$:n.panelOpened$}}function Pe(){return{id:w.id,title:"action-recorder.menu.replay-local",type:d.MenuItemType.BUTTON}}function be(){return{id:$.id,title:"action-recorder.menu.replay-local-name",type:d.MenuItemType.BUTTON}}function Me(){return{id:F.id,title:"action-recorder.menu.replay-local-active",type:d.MenuItemType.BUTTON}}const xe={[d.RibbonStartGroup.OTHERS]:{[G]:{order:10,menuItemFactory:Oe,[E.id]:{order:1,menuItemFactory:Ae},[w.id]:{order:2,menuItemFactory:Pe},[$.id]:{order:3,menuItemFactory:be},[F.id]:{order:4,menuItemFactory:Me}}}};var Te=Object.defineProperty,je=Object.getOwnPropertyDescriptor,Ue=(e,n,r,t)=>{for(var o=t>1?void 0:t?je(n,r):n,c=e.length-1,i;c>=0;c--)(i=e[c])&&(o=(t?i(n,r,o):i(o))||o);return t&&o&&Te(n,r,o),o},y=(e,n)=>(r,t)=>n(r,t,e);let b=class extends a.Disposable{constructor(e,n,r,t,o,c){super(),this._commandSrv=e,this._uiPartsSrv=n,this._menuManagerService=r,this._componentManager=t,this._actionRecorderService=o,this._injector=c,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[V,q,W,E,z,w,$,F].forEach(e=>this._commandSrv.registerCommand(e))}_initUI(){this._uiPartsSrv.registerComponent(d.BuiltInUIPart.GLOBAL,()=>a.connectInjector(Re,this._injector)),this._componentManager.register("RecordSingle",U),this._menuManagerService.mergeMenu(xe)}_initSheetsCommands(){[s.CopySheetCommand,s.DeleteRangeMoveLeftCommand,s.DeleteRangeMoveUpCommand,s.DeltaColumnWidthCommand,s.DeltaRowHeightCommand,s.InsertSheetCommand,s.InsertColAfterCommand,s.InsertColBeforeCommand,s.InsertRowAfterCommand,s.InsertRowBeforeCommand,s.RemoveSheetCommand,s.SetStyleCommand,s.AddWorksheetMergeCommand,s.AddWorksheetMergeAllCommand,s.AddWorksheetMergeVerticalCommand,s.AddWorksheetMergeHorizontalCommand,s.SetFrozenCommand,s.CancelFrozenCommand,s.SetHorizontalTextAlignCommand,s.SetOverlineCommand,m.SetRangeBoldCommand,m.SetRangeFontFamilyCommand,m.SetRangeFontSizeCommand,m.SetRangeItalicCommand,m.SetRangeStrickThroughCommand,m.SetRangeSubscriptCommand,m.SetRangeSuperscriptCommand,m.SetRangeTextColorCommand,m.SetRangeUnderlineCommand,s.SetRangeValuesCommand,s.SetStrikeThroughCommand,s.SetTextColorCommand,s.SetTextRotationCommand,s.SetTextWrapCommand,s.SetVerticalTextAlignCommand,m.SheetCopyCommand,m.SheetCutCommand,m.SheetPasteBesidesBorderCommand,m.SheetPasteColWidthCommand,m.SheetPasteCommand,m.SheetPasteFormatCommand,m.SheetPasteShortKeyCommand,m.SheetPasteValueCommand,s.SetWorksheetActivateCommand,s.SetWorksheetActiveOperation,s.SetSelectionsOperation,T.SetSheetFilterRangeCommand,T.SetSheetsFilterCriteriaCommand,T.RemoveSheetFilterCommand].forEach(e=>this._actionRecorderService.registerRecordedCommand(e))}_initDocsCommands(){}};b=Ue([y(0,a.ICommandService),y(1,d.IUIPartsService),y(2,d.IMenuManagerService),y(3,a.Inject(d.ComponentManager)),y(4,a.Inject(exports.ActionRecorderService)),y(5,a.Inject(a.Injector))],b);const Ne="action-recorder.config",we={};var $e=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,Ee=(e,n,r,t)=>{for(var o=t>1?void 0:t?Fe(n,r):n,c=e.length-1,i;c>=0;c--)(i=e[c])&&(o=(t?i(n,r,o):i(o))||o);return t&&o&&$e(n,r,o),o},D=(e,n)=>(r,t)=>n(r,t,e),j;exports.UniverActionRecorderPlugin=(j=class extends a.Plugin{constructor(n=we,r,t){super(),this._config=n,this._injector=r,this._configService=t;const{menu:o,...c}=this._config;o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(Ne,c)}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)}},v(j,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),j);exports.UniverActionRecorderPlugin=Ee([D(1,a.Inject(a.Injector)),D(2,a.IConfigService)],exports.UniverActionRecorderPlugin);
@@ -0,0 +1 @@
1
+ "use strict";const c={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=c;
@@ -0,0 +1 @@
1
+ "use strict";const e={"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت..."}}};module.exports=e;
@@ -0,0 +1 @@
1
+ "use strict";const c={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=c;
@@ -0,0 +1 @@
1
+ "use strict";const c={"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}};module.exports=c;
@@ -0,0 +1 @@
1
+ "use strict";const e={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=e;
@@ -0,0 +1 @@
1
+ "use strict";const e={"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}};module.exports=e;
@@ -0,0 +1,538 @@
1
+ var se = Object.defineProperty;
2
+ var de = (e, r, t) => r in e ? se(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var m = (e, r, t) => de(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { Disposable as F, CommandType as u, ICommandService as M, ILogService as k, IUniverInstanceService as G, awaitTime as le, useDependency as j, Inject as x, Injector as Z, connectInjector as me, Plugin as ue, IConfigService as fe } from "@univerjs/core";
5
+ import { SetSelectionsOperation as T, CopySheetCommand as pe, DeleteRangeMoveLeftCommand as ge, DeleteRangeMoveUpCommand as he, DeltaColumnWidthCommand as ve, DeltaRowHeightCommand as Se, InsertSheetCommand as _e, InsertColAfterCommand as Ce, InsertColBeforeCommand as ye, InsertRowAfterCommand as Re, InsertRowBeforeCommand as Ie, RemoveSheetCommand as Oe, SetStyleCommand as Pe, AddWorksheetMergeCommand as xe, AddWorksheetMergeAllCommand as be, AddWorksheetMergeVerticalCommand as Me, AddWorksheetMergeHorizontalCommand as Ne, SetFrozenCommand as Ue, CancelFrozenCommand as Ae, SetHorizontalTextAlignCommand as we, SetOverlineCommand as $e, SetRangeValuesCommand as je, SetStrikeThroughCommand as Te, SetTextColorCommand as Ee, SetTextRotationCommand as Fe, SetTextWrapCommand as De, SetVerticalTextAlignCommand as Le, SetWorksheetActivateCommand as Be, SetWorksheetActiveOperation as Ve } from "@univerjs/sheets";
6
+ import { SetSheetFilterRangeCommand as We, SetSheetsFilterCriteriaCommand as ze, RemoveSheetFilterCommand as He } from "@univerjs/sheets-filter";
7
+ import { SetRangeBoldCommand as Je, SetRangeFontFamilyCommand as ke, SetRangeFontSizeCommand as Ge, SetRangeItalicCommand as Ze, SetRangeStrickThroughCommand as qe, SetRangeSubscriptCommand as Ke, SetRangeSuperscriptCommand as Ye, SetRangeTextColorCommand as Qe, SetRangeUnderlineCommand as Xe, SheetCopyCommand as er, SheetCutCommand as rr, SheetPasteBesidesBorderCommand as tr, SheetPasteColWidthCommand as nr, SheetPasteCommand as or, SheetPasteFormatCommand as ir, SheetPasteShortKeyCommand as cr, SheetPasteValueCommand as ar } from "@univerjs/sheets-ui";
8
+ import { ILocalFileService as q, IMessageService as N, useObservable as E, RibbonStartGroup as sr, MenuItemType as R, ComponentManager as dr, IUIPartsService as lr, IMenuManagerService as mr, BuiltInUIPart as ur } from "@univerjs/ui";
9
+ import { BehaviorSubject as I } from "rxjs";
10
+ import { MessageType as U, Button as w } from "@univerjs/design";
11
+ import fr, { forwardRef as K, useRef as pr, createElement as Y, useCallback as O } from "react";
12
+ var d = function() {
13
+ return d = Object.assign || function(e) {
14
+ for (var r, t = 1, n = arguments.length; t < n; t++) {
15
+ r = arguments[t];
16
+ for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]);
17
+ }
18
+ return e;
19
+ }, d.apply(this, arguments);
20
+ }, gr = function(e, r) {
21
+ var t = {};
22
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
23
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
24
+ for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
25
+ r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (t[n[o]] = e[n[o]]);
26
+ return t;
27
+ }, Q = K(function(e, r) {
28
+ var t = e.icon, n = e.id, o = e.className, i = e.extend, c = gr(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), p = pr("_".concat(Sr()));
29
+ return X(t, "".concat(n), { defIds: t.defIds, idSuffix: p.current }, d({ ref: r, className: a }, c), i);
30
+ });
31
+ function X(e, r, t, n, o) {
32
+ return Y(e.tag, d(d({ key: r }, hr(e, t, o)), n), (vr(e, t).children || []).map(function(i, c) {
33
+ return X(i, "".concat(r, "-").concat(e.tag, "-").concat(c), t, void 0, o);
34
+ }));
35
+ }
36
+ function hr(e, r, t) {
37
+ var n = d({}, e.attrs);
38
+ t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
39
+ var o = r.defIds;
40
+ return !o || o.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + r.idSuffix), Object.entries(n).forEach(function(i) {
41
+ var c = i[0], a = i[1];
42
+ typeof a == "string" && (n[c] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(r.idSuffix, ")")));
43
+ })), n;
44
+ }
45
+ function vr(e, r) {
46
+ var t, n = r.defIds;
47
+ return !n || n.length === 0 ? e : e.tag === "defs" && (!((t = e.children) === null || t === void 0) && t.length) ? d(d({}, e), { children: e.children.map(function(o) {
48
+ 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 + r.idSuffix }) }) : o;
49
+ }) }) : e;
50
+ }
51
+ function Sr() {
52
+ return Math.random().toString(36).substring(2, 8);
53
+ }
54
+ Q.displayName = "UniverIcon";
55
+ var _r = { 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"] }, D = K(function(e, r) {
56
+ return Y(Q, Object.assign({}, e, {
57
+ id: "record-single",
58
+ ref: r,
59
+ icon: _r
60
+ }));
61
+ });
62
+ D.displayName = "RecordSingle";
63
+ var Cr = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, Rr = (e, r, t, n) => {
64
+ for (var o = n > 1 ? void 0 : n ? yr(r, t) : r, i = e.length - 1, c; i >= 0; i--)
65
+ (c = e[i]) && (o = (n ? c(r, t, o) : c(o)) || o);
66
+ return n && o && Cr(r, t, o), o;
67
+ }, P = (e, r) => (t, n) => r(t, n, e);
68
+ let l = class extends F {
69
+ constructor(r, t, n, o) {
70
+ super();
71
+ m(this, "_shouldRecordCommands", /* @__PURE__ */ new Set());
72
+ m(this, "_panelOpened$", new I(!1));
73
+ m(this, "panelOpened$", this._panelOpened$.asObservable());
74
+ m(this, "_recorder", null);
75
+ m(this, "_recording$", new I(!1));
76
+ m(this, "recording$", this._recording$.asObservable());
77
+ m(this, "_recorded$", new I([]));
78
+ m(this, "_recordedCommands$", new I([]));
79
+ m(this, "recordedCommands$", this._recordedCommands$.asObservable());
80
+ this._commandSrv = r, this._logService = t, this._localFileService = n, this._instanceService = o;
81
+ }
82
+ get recording() {
83
+ return this._recording$.getValue();
84
+ }
85
+ get _recorded() {
86
+ return this._recorded$.getValue();
87
+ }
88
+ get _recordedCommands() {
89
+ return this._recordedCommands$.getValue();
90
+ }
91
+ registerRecordedCommand(r) {
92
+ if (r.type === u.MUTATION) throw new Error("[CommandRecorderService] Cannot record mutation commands.");
93
+ this._shouldRecordCommands.add(r.id);
94
+ }
95
+ togglePanel(r) {
96
+ this._panelOpened$.next(r), r === !1 && this.stopRecording();
97
+ }
98
+ startRecording(r = !1) {
99
+ this._recorder = this._commandSrv.onCommandExecuted((t) => {
100
+ var n, o;
101
+ if (this._shouldRecordCommands.has(t.id)) {
102
+ const i = this._recorded, c = this._recordedCommands;
103
+ let a = { ...t };
104
+ const p = (n = this._instanceService.getFocusedUnit()) == null ? void 0 : n.getUnitId(), { unitId: g = p, subUnitId: s } = a == null ? void 0 : a.params;
105
+ if (r && g && s) {
106
+ const S = (o = this._instanceService.getUnit(g).getSheetBySheetId(s)) == null ? void 0 : o.getName();
107
+ a = {
108
+ ...a,
109
+ params: {
110
+ ...a.params,
111
+ subUnitId: S
112
+ }
113
+ };
114
+ }
115
+ a.id === T.id && i.length > 0 && i[i.length - 1].id === T.id ? i[i.length - 1] = a : (i.push(a), this._recorded$.next(i), a.type === u.COMMAND && (c.push(a), this._recordedCommands$.next(c)));
116
+ }
117
+ }), this._recording$.next(!0);
118
+ }
119
+ stopRecording() {
120
+ var r;
121
+ (r = this._recorder) == null || r.dispose(), this._recorder = null, this._recorded$.next([]), this._recordedCommands$.next([]), this._recording$.next(!1);
122
+ }
123
+ completeRecording() {
124
+ const r = this._recorded.slice();
125
+ this._localFileService.downloadFile(new Blob([JSON.stringify(r, null, 2)]), "recorded-commands.json"), this._logService.error("Recorded commands:", r), this.stopRecording();
126
+ }
127
+ };
128
+ l = Rr([
129
+ P(0, M),
130
+ P(1, k),
131
+ P(2, q),
132
+ P(3, G)
133
+ ], l);
134
+ const ee = {
135
+ id: "action-recorder.command.start-recording",
136
+ type: u.COMMAND,
137
+ handler: (e, r) => (e.get(l).startRecording(!!(r != null && r.replaceId)), !0)
138
+ }, re = {
139
+ id: "action-recorder.command.complete-recording",
140
+ type: u.COMMAND,
141
+ handler: (e) => (e.get(l).completeRecording(), !0)
142
+ }, te = {
143
+ id: "action-recorder.command.stop-recording",
144
+ type: u.COMMAND,
145
+ handler: (e) => (e.get(l).completeRecording(), !0)
146
+ };
147
+ var Ir = Object.defineProperty, Or = Object.getOwnPropertyDescriptor, Pr = (e, r, t, n) => {
148
+ for (var o = n > 1 ? void 0 : n ? Or(r, t) : r, i = e.length - 1, c; i >= 0; i--)
149
+ (c = e[i]) && (o = (n ? c(r, t, o) : c(o)) || o);
150
+ return n && o && Ir(r, t, o), o;
151
+ }, C = (e, r) => (t, n) => r(t, n, e), L = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.NAME = "name", e.ACTIVE = "active", e))(L || {});
152
+ let h = class extends F {
153
+ constructor(e, r, t, n, o) {
154
+ super(), this._messageService = e, this._instanceService = r, this._localFileService = t, this._logService = n, this._commandService = o;
155
+ }
156
+ /**
157
+ * Read a local file and try to replay commands in this JSON.
158
+ */
159
+ async replayLocalJSON(e = "default") {
160
+ const r = await this._localFileService.openFile({ multiple: !1, accept: ".json" });
161
+ if (r.length !== 1) return !1;
162
+ const t = r[0];
163
+ try {
164
+ return this.replayCommands(JSON.parse(await t.text()), { mode: e });
165
+ } catch {
166
+ return this._messageService.show({
167
+ type: U.Error,
168
+ content: `Failed to replay commands from local file ${t.name}.`
169
+ }), !1;
170
+ }
171
+ }
172
+ /**
173
+ * Replay a list of commands. Note that `unitId` of these commands would be changed to the focused unit.
174
+ * @param commands - The commands to replay.
175
+ * @returns If the replay is successful.
176
+ */
177
+ async replayCommands(e, r) {
178
+ var o, i, c;
179
+ const t = (o = this._instanceService.getFocusedUnit()) == null ? void 0 : o.getUnitId();
180
+ t || this._logService.error("[ReplayService]", "no focused unit to replay commands");
181
+ const { mode: n } = r || {};
182
+ for (const a of e) {
183
+ const { id: p, params: g } = a, s = g;
184
+ if (s) {
185
+ if (typeof s.unitId < "u" && (s.unitId = t), n === "name" && s.subUnitId !== "undefined") {
186
+ const _ = (i = this._instanceService.getFocusedUnit().getSheetBySheetName(s.subUnitId)) == null ? void 0 : i.getSheetId();
187
+ _ ? s.subUnitId = _ : this._logService.error("[ReplayService]", `failed to find subunit by subUnitName = ${s.subUnitId}`);
188
+ }
189
+ if (n === "active" && s.subUnitId !== "undefined") {
190
+ const _ = (c = this._instanceService.getFocusedUnit().getActiveSheet()) == null ? void 0 : c.getSheetId();
191
+ _ ? s.subUnitId = _ : this._logService.error("[ReplayService]", "failed to find active subunit");
192
+ }
193
+ if (!await this._commandService.executeCommand(p, g)) return !1;
194
+ } else if (!await this._commandService.executeCommand(p)) return !1;
195
+ }
196
+ return !0;
197
+ }
198
+ /**
199
+ * Replay a list of commands with a random delay between each command.
200
+ * @param commands - The commands to replay.
201
+ */
202
+ async replayCommandsWithDelay(e) {
203
+ var t;
204
+ const r = (t = this._instanceService.getFocusedUnit()) == null ? void 0 : t.getUnitId();
205
+ r || this._logService.error("[ReplayService]", "no focused unit to replay commands");
206
+ for (const n of e) {
207
+ await le(xr());
208
+ const { id: o, params: i } = n;
209
+ if (i) {
210
+ if (typeof i.unitId < "u" && (i.unitId = r), !await this._commandService.executeCommand(o, i)) return !1;
211
+ } else if (!await this._commandService.executeCommand(o)) return !1;
212
+ }
213
+ return !0;
214
+ }
215
+ };
216
+ h = Pr([
217
+ C(0, N),
218
+ C(1, G),
219
+ C(2, q),
220
+ C(3, k),
221
+ C(4, M)
222
+ ], h);
223
+ function xr() {
224
+ return Math.floor(Math.random() * 800) + 200;
225
+ }
226
+ const B = {
227
+ id: "action-recorder.command.replay-local-records",
228
+ type: u.COMMAND,
229
+ handler: async (e) => {
230
+ const t = await e.get(h).replayLocalJSON();
231
+ return t && e.get(N).show({
232
+ type: U.Success,
233
+ content: "Successfully replayed local records"
234
+ }), t;
235
+ }
236
+ }, V = {
237
+ id: "action-recorder.command.replay-local-records-name",
238
+ type: u.COMMAND,
239
+ handler: async (e) => {
240
+ const t = await e.get(h).replayLocalJSON(L.NAME);
241
+ return t && e.get(N).show({
242
+ type: U.Success,
243
+ content: "Successfully replayed local records"
244
+ }), t;
245
+ }
246
+ }, W = {
247
+ id: "action-recorder.command.replay-local-records-active",
248
+ type: u.COMMAND,
249
+ handler: async (e) => {
250
+ const t = await e.get(h).replayLocalJSON(L.ACTIVE);
251
+ return t && e.get(N).show({
252
+ type: U.Success,
253
+ content: "Successfully replayed local records"
254
+ }), t;
255
+ }
256
+ }, z = {
257
+ id: "action-recorder.operation.open-panel",
258
+ type: u.OPERATION,
259
+ handler(e) {
260
+ return e.get(l).togglePanel(!0), !0;
261
+ }
262
+ }, ne = {
263
+ id: "action-recorder.operation.close-panel",
264
+ type: u.OPERATION,
265
+ handler(e) {
266
+ return e.get(l).togglePanel(!1), !0;
267
+ }
268
+ };
269
+ var oe = { exports: {} }, A = {};
270
+ /**
271
+ * @license React
272
+ * react-jsx-runtime.production.min.js
273
+ *
274
+ * Copyright (c) Facebook, Inc. and its affiliates.
275
+ *
276
+ * This source code is licensed under the MIT license found in the
277
+ * LICENSE file in the root directory of this source tree.
278
+ */
279
+ var br = fr, Mr = Symbol.for("react.element"), Nr = Symbol.for("react.fragment"), Ur = Object.prototype.hasOwnProperty, Ar = br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, wr = { key: !0, ref: !0, __self: !0, __source: !0 };
280
+ function ie(e, r, t) {
281
+ var n, o = {}, i = null, c = null;
282
+ t !== void 0 && (i = "" + t), r.key !== void 0 && (i = "" + r.key), r.ref !== void 0 && (c = r.ref);
283
+ for (n in r) Ur.call(r, n) && !wr.hasOwnProperty(n) && (o[n] = r[n]);
284
+ if (e && e.defaultProps) for (n in r = e.defaultProps, r) o[n] === void 0 && (o[n] = r[n]);
285
+ return { $$typeof: Mr, type: e, key: i, ref: c, props: o, _owner: Ar.current };
286
+ }
287
+ A.Fragment = Nr;
288
+ A.jsx = ie;
289
+ A.jsxs = ie;
290
+ oe.exports = A;
291
+ var f = oe.exports;
292
+ function ce(e) {
293
+ var r, t, n = "";
294
+ if (typeof e == "string" || typeof e == "number") n += e;
295
+ else if (typeof e == "object") if (Array.isArray(e)) {
296
+ var o = e.length;
297
+ for (r = 0; r < o; r++) e[r] && (t = ce(e[r])) && (n && (n += " "), n += t);
298
+ } else for (t in e) e[t] && (n && (n += " "), n += t);
299
+ return n;
300
+ }
301
+ function $r() {
302
+ for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = ce(e)) && (n && (n += " "), n += r);
303
+ return n;
304
+ }
305
+ const jr = "univer-action-recorder-panel", Tr = "univer-action-recorder-panel-icon", Er = "univer-action-recorder-panel-icon-recording", Fr = "univer-recording", Dr = "univer-action-recorder-panel-title", Lr = "univer-action-recorder-panel-actions", y = {
306
+ actionRecorderPanel: jr,
307
+ actionRecorderPanelIcon: Tr,
308
+ actionRecorderPanelIconRecording: Er,
309
+ recording: Fr,
310
+ actionRecorderPanelTitle: Dr,
311
+ actionRecorderPanelActions: Lr
312
+ };
313
+ function Br() {
314
+ const e = j(l);
315
+ return E(e.panelOpened$) ? /* @__PURE__ */ f.jsx(Vr, {}) : null;
316
+ }
317
+ function Vr() {
318
+ var s;
319
+ const e = j(M), r = j(l), t = E(r.recording$), n = E(r.recordedCommands$), o = (s = n == null ? void 0 : n.length) != null ? s : 0, i = O(() => {
320
+ t || e.executeCommand(ne.id);
321
+ }, [e, t]), c = O((S) => {
322
+ t || e.executeCommand(ee.id, { replaceId: S });
323
+ }, [e, t]), a = O(() => {
324
+ t && e.executeCommand(re.id);
325
+ }, [e, t]), p = O(() => {
326
+ t && e.executeCommand(te.id);
327
+ }, [e, t]), g = t ? o === 0 ? "Recording..." : `${o}: ${n[o - 1].id}` : "Start Recording";
328
+ return /* @__PURE__ */ f.jsxs("div", { className: y.actionRecorderPanel, children: [
329
+ /* @__PURE__ */ f.jsx("div", { className: $r(y.actionRecorderPanelIcon, t ? y.actionRecorderPanelIconRecording : !1), children: /* @__PURE__ */ f.jsx(D, {}) }),
330
+ /* @__PURE__ */ f.jsx("div", { className: y.actionRecorderPanelTitle, children: g }),
331
+ /* @__PURE__ */ f.jsxs("div", { className: y.actionRecorderPanelActions, children: [
332
+ /* @__PURE__ */ f.jsx(w, { type: "default", size: "small", onClick: t ? p : i, children: t ? "Cancel" : "Close" }),
333
+ /* @__PURE__ */ f.jsx(w, { type: "primary", size: "small", onClick: t ? a : () => c(), children: t ? "Save" : "Start" }),
334
+ !t && /* @__PURE__ */ f.jsx(w, { type: "primary", size: "small", onClick: () => c(!0), children: "Start(N)" })
335
+ ] })
336
+ ] });
337
+ }
338
+ const ae = "RECORD_MENU_ITEM";
339
+ function Wr() {
340
+ return {
341
+ id: ae,
342
+ type: R.SUBITEMS,
343
+ icon: "RecordSingle",
344
+ tooltip: "action-recorder.menu.title"
345
+ };
346
+ }
347
+ function zr(e) {
348
+ const r = e.get(l);
349
+ return {
350
+ id: z.id,
351
+ title: "action-recorder.menu.record",
352
+ type: R.BUTTON,
353
+ disabled$: r.panelOpened$
354
+ };
355
+ }
356
+ function Hr() {
357
+ return {
358
+ id: B.id,
359
+ title: "action-recorder.menu.replay-local",
360
+ type: R.BUTTON
361
+ };
362
+ }
363
+ function Jr() {
364
+ return {
365
+ id: V.id,
366
+ title: "action-recorder.menu.replay-local-name",
367
+ type: R.BUTTON
368
+ };
369
+ }
370
+ function kr() {
371
+ return {
372
+ id: W.id,
373
+ title: "action-recorder.menu.replay-local-active",
374
+ type: R.BUTTON
375
+ };
376
+ }
377
+ const Gr = {
378
+ [sr.OTHERS]: {
379
+ [ae]: {
380
+ order: 10,
381
+ menuItemFactory: Wr,
382
+ [z.id]: {
383
+ order: 1,
384
+ menuItemFactory: zr
385
+ },
386
+ [B.id]: {
387
+ order: 2,
388
+ menuItemFactory: Hr
389
+ },
390
+ [V.id]: {
391
+ order: 3,
392
+ menuItemFactory: Jr
393
+ },
394
+ [W.id]: {
395
+ order: 4,
396
+ menuItemFactory: kr
397
+ }
398
+ }
399
+ }
400
+ };
401
+ var Zr = Object.defineProperty, qr = Object.getOwnPropertyDescriptor, Kr = (e, r, t, n) => {
402
+ for (var o = n > 1 ? void 0 : n ? qr(r, t) : r, i = e.length - 1, c; i >= 0; i--)
403
+ (c = e[i]) && (o = (n ? c(r, t, o) : c(o)) || o);
404
+ return n && o && Zr(r, t, o), o;
405
+ }, v = (e, r) => (t, n) => r(t, n, e);
406
+ let b = class extends F {
407
+ constructor(e, r, t, n, o, i) {
408
+ super(), this._commandSrv = e, this._uiPartsSrv = r, this._menuManagerService = t, this._componentManager = n, this._actionRecorderService = o, this._injector = i, this._initCommands(), this._initUI(), this._initSheetsCommands(), this._initDocsCommands();
409
+ }
410
+ _initCommands() {
411
+ [
412
+ ee,
413
+ te,
414
+ re,
415
+ z,
416
+ ne,
417
+ B,
418
+ V,
419
+ W
420
+ ].forEach((e) => this._commandSrv.registerCommand(e));
421
+ }
422
+ _initUI() {
423
+ this._uiPartsSrv.registerComponent(ur.GLOBAL, () => me(Br, this._injector)), this._componentManager.register("RecordSingle", D), this._menuManagerService.mergeMenu(Gr);
424
+ }
425
+ _initSheetsCommands() {
426
+ [
427
+ // InsertColCommand,
428
+ // InsertRowCommand,
429
+ // #region basic commands
430
+ pe,
431
+ ge,
432
+ he,
433
+ ve,
434
+ Se,
435
+ _e,
436
+ Ce,
437
+ ye,
438
+ Re,
439
+ Ie,
440
+ Oe,
441
+ Pe,
442
+ xe,
443
+ be,
444
+ Me,
445
+ Ne,
446
+ // ResetBackgroundColorCommand,
447
+ // ResetTextColorCommand,
448
+ // SetBackgroundColorCommand,
449
+ // SetBoldCommand,
450
+ // SetFontFamilyCommand,
451
+ // SetFontSizeCommand,
452
+ Ue,
453
+ Ae,
454
+ we,
455
+ // SetItalicCommand,
456
+ $e,
457
+ Je,
458
+ ke,
459
+ Ge,
460
+ Ze,
461
+ qe,
462
+ Ke,
463
+ Ye,
464
+ Qe,
465
+ Xe,
466
+ je,
467
+ Te,
468
+ Ee,
469
+ Fe,
470
+ De,
471
+ // SetUnderlineCommand,
472
+ Le,
473
+ er,
474
+ rr,
475
+ tr,
476
+ nr,
477
+ or,
478
+ ir,
479
+ cr,
480
+ ar,
481
+ Be,
482
+ Ve,
483
+ T,
484
+ // #endregion
485
+ // #region data validation command
486
+ // #endregion
487
+ // #region conditional formatting command
488
+ // #endregion
489
+ // #region filter command
490
+ We,
491
+ ze,
492
+ He
493
+ // #endregion
494
+ ].forEach((e) => this._actionRecorderService.registerRecordedCommand(e));
495
+ }
496
+ _initDocsCommands() {
497
+ }
498
+ };
499
+ b = Kr([
500
+ v(0, M),
501
+ v(1, lr),
502
+ v(2, mr),
503
+ v(3, x(dr)),
504
+ v(4, x(l)),
505
+ v(5, x(Z))
506
+ ], b);
507
+ const Yr = "action-recorder.config", Qr = {};
508
+ var Xr = Object.defineProperty, et = Object.getOwnPropertyDescriptor, rt = (e, r, t, n) => {
509
+ for (var o = n > 1 ? void 0 : n ? et(r, t) : r, i = e.length - 1, c; i >= 0; i--)
510
+ (c = e[i]) && (o = (n ? c(r, t, o) : c(o)) || o);
511
+ return n && o && Xr(r, t, o), o;
512
+ }, H = (e, r) => (t, n) => r(t, n, e), $;
513
+ let J = ($ = class extends ue {
514
+ constructor(e = Qr, r, t) {
515
+ super(), this._config = e, this._injector = r, this._configService = t;
516
+ const { menu: n, ...o } = this._config;
517
+ n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Yr, o);
518
+ }
519
+ onStarting() {
520
+ (this._config.replayOnly ? [[h]] : [
521
+ [l],
522
+ [h],
523
+ [b]
524
+ ]).forEach((r) => this._injector.add(r));
525
+ }
526
+ onSteady() {
527
+ this._config.replayOnly || this._injector.get(b);
528
+ }
529
+ }, m($, "pluginName", "UNIVER_ACTION_RECORDER_PLUGIN"), $);
530
+ J = rt([
531
+ H(1, x(Z)),
532
+ H(2, fe)
533
+ ], J);
534
+ export {
535
+ l as ActionRecorderService,
536
+ h as ActionReplayService,
537
+ J as UniverActionRecorderPlugin
538
+ };
@@ -0,0 +1,12 @@
1
+ const e = {
2
+ "action-recorder": {
3
+ menu: {
4
+ title: "Record Actions",
5
+ record: "Record Actions...",
6
+ "replay-local": "Replace Local Record..."
7
+ }
8
+ }
9
+ };
10
+ export {
11
+ e as default
12
+ };
@@ -0,0 +1,12 @@
1
+ const e = {
2
+ "action-recorder": {
3
+ menu: {
4
+ title: "ثبت اقدامات",
5
+ record: "ثبت اقدامات...",
6
+ "replay-local": "بازپخش محلی ثبت..."
7
+ }
8
+ }
9
+ };
10
+ export {
11
+ e as default
12
+ };
@@ -0,0 +1,12 @@
1
+ const e = {
2
+ "action-recorder": {
3
+ menu: {
4
+ title: "Record Actions",
5
+ record: "Record Actions...",
6
+ "replay-local": "Replace Local Record..."
7
+ }
8
+ }
9
+ };
10
+ export {
11
+ e as default
12
+ };
@@ -0,0 +1,12 @@
1
+ const e = {
2
+ "action-recorder": {
3
+ menu: {
4
+ title: "Record Actions",
5
+ record: "Record Actions...",
6
+ "replay-local": "Replace Local Record..."
7
+ }
8
+ }
9
+ };
10
+ export {
11
+ e as default
12
+ };
@@ -0,0 +1,12 @@
1
+ const e = {
2
+ "action-recorder": {
3
+ menu: {
4
+ title: "操作录制",
5
+ record: "录制操作...",
6
+ "replay-local": "回放本地录制..."
7
+ }
8
+ }
9
+ };
10
+ export {
11
+ e as default
12
+ };
@@ -0,0 +1,12 @@
1
+ const e = {
2
+ "action-recorder": {
3
+ menu: {
4
+ title: "操作录制",
5
+ record: "录制操作...",
6
+ "replay-local": "回放本地录制..."
7
+ }
8
+ }
9
+ };
10
+ export {
11
+ e as default
12
+ };
package/lib/index.css ADDED
@@ -0,0 +1 @@
1
+ .univer-action-recorder-panel{position:fixed;bottom:80px;width:512px;height:64px;border-radius:var(--border-radius-xl);background-color:rgb(var(--bg-color-secondary));z-index:1000;left:50%;transform:translate(-50%);box-shadow:var(--box-shadow-lg);padding-left:var(--padding-xl);padding-right:var(--padding-xl);display:flex;align-items:center}.univer-action-recorder-panel-icon{flex-grow:0;flex-shrink:0;font-size:var(--font-size-xxl);width:var(--font-size-xxl);height:var(--font-size-xxl);margin-right:var(--margin-xs)}@keyframes univer-recording{0%{color:rgb(var(--text-color))}40%{color:red}60%{color:red}to{color:rgb(var(--text-color))}}.univer-action-recorder-panel-icon-recording>svg>g>path:first-of-type{animation:univer-recording 2s infinite}.univer-action-recorder-panel-title{flex-grow:1;font-size:var(--font-size-xs)}.univer-action-recorder-panel-actions{display:flex;flex-grow:0;flex-shrink:0;width:260px;justify-content:space-between}.univer-action-recorder-panel-actions>button{width:80px}
@@ -0,0 +1,8 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ interface IStartRecordingActionCommandParams {
3
+ replaceId?: boolean;
4
+ }
5
+ export declare const StartRecordingActionCommand: ICommand<IStartRecordingActionCommandParams>;
6
+ export declare const CompleteRecordingActionCommand: ICommand;
7
+ export declare const StopRecordingActionCommand: ICommand;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const ReplayLocalRecordCommand: ICommand;
3
+ export declare const ReplayLocalRecordOnNamesakeCommand: ICommand;
4
+ export declare const ReplayLocalRecordOnActiveCommand: ICommand;
@@ -0,0 +1,3 @@
1
+ import { IOperation } from '@univerjs/core';
2
+ export declare const OpenRecordPanelOperation: IOperation;
3
+ export declare const CloseRecordPanelOperation: IOperation;
@@ -0,0 +1,16 @@
1
+ import { Disposable, ICommandService, Injector } from '@univerjs/core';
2
+ import { ComponentManager, IMenuManagerService, IUIPartsService } from '@univerjs/ui';
3
+ import { ActionRecorderService } from '../services/action-recorder.service';
4
+ export declare class ActionRecorderController extends Disposable {
5
+ private readonly _commandSrv;
6
+ private readonly _uiPartsSrv;
7
+ private readonly _menuManagerService;
8
+ private readonly _componentManager;
9
+ private readonly _actionRecorderService;
10
+ private readonly _injector;
11
+ constructor(_commandSrv: ICommandService, _uiPartsSrv: IUIPartsService, _menuManagerService: IMenuManagerService, _componentManager: ComponentManager, _actionRecorderService: ActionRecorderService, _injector: Injector);
12
+ private _initCommands;
13
+ private _initUI;
14
+ private _initSheetsCommands;
15
+ private _initDocsCommands;
16
+ }
@@ -0,0 +1,9 @@
1
+ import { IAccessor } from '@univerjs/core';
2
+ import { IMenuButtonItem, IMenuSelectorItem, MenuSchemaType } from '@univerjs/ui';
3
+ export declare const RECORD_MENU_ITEM_ID = "RECORD_MENU_ITEM";
4
+ export declare function RecordMenuItemFactory(): IMenuSelectorItem;
5
+ export declare function OpenRecorderMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
6
+ export declare function ReplayLocalRecordMenuItemFactory(): IMenuButtonItem;
7
+ export declare function ReplayLocalRecordOnNamesakeMenuItemFactory(): IMenuButtonItem;
8
+ export declare function ReplayLocalRecordOnActiveMenuItemFactory(): IMenuButtonItem;
9
+ export declare const menuSchema: MenuSchemaType;
@@ -0,0 +1,8 @@
1
+ import { MenuConfig } from '@univerjs/ui';
2
+ export declare const PLUGIN_CONFIG_KEY = "action-recorder.config";
3
+ export declare const configSymbol: unique symbol;
4
+ export interface IUniverActionRecorderConfig {
5
+ menu?: MenuConfig;
6
+ replayOnly?: boolean;
7
+ }
8
+ export declare const defaultPluginConfig: IUniverActionRecorderConfig;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { UniverActionRecorderPlugin } from './plugin';
17
+ export { ActionRecorderService } from './services/action-recorder.service';
18
+ export { ActionReplayService } from './services/replay.service';
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ declare const locale: {
17
+ 'action-recorder': {
18
+ menu: {
19
+ title: string;
20
+ record: string;
21
+ 'replay-local': string;
22
+ };
23
+ };
24
+ };
25
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,15 @@
1
+ import { IUniverActionRecorderConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin } from '@univerjs/core';
3
+ /**
4
+ * This plugin provides a recorder for user's interactions with Univer,
5
+ * it only records commands (and some special operations) so that it can be replayed later.
6
+ */
7
+ export declare class UniverActionRecorderPlugin extends Plugin {
8
+ private readonly _config;
9
+ protected readonly _injector: Injector;
10
+ private readonly _configService;
11
+ static pluginName: string;
12
+ constructor(_config: Partial<IUniverActionRecorderConfig> | undefined, _injector: Injector, _configService: IConfigService);
13
+ onStarting(): void;
14
+ onSteady(): void;
15
+ }
@@ -0,0 +1,30 @@
1
+ import { ICommand, ICommandInfo, Disposable, ICommandService, ILogService, IUniverInstanceService } from '@univerjs/core';
2
+ import { ILocalFileService } from '@univerjs/ui';
3
+ /**
4
+ * This service is for recording commands. What commands should be recorded can be configured by other
5
+ * plugins.
6
+ */
7
+ export declare class ActionRecorderService extends Disposable {
8
+ private readonly _commandSrv;
9
+ private readonly _logService;
10
+ private readonly _localFileService;
11
+ private readonly _instanceService;
12
+ private readonly _shouldRecordCommands;
13
+ private readonly _panelOpened$;
14
+ readonly panelOpened$: import('rxjs').Observable<boolean>;
15
+ private _recorder;
16
+ private readonly _recording$;
17
+ readonly recording$: import('rxjs').Observable<boolean>;
18
+ get recording(): boolean;
19
+ private _recorded$;
20
+ private get _recorded();
21
+ private _recordedCommands$;
22
+ readonly recordedCommands$: import('rxjs').Observable<ICommandInfo<object>[]>;
23
+ private get _recordedCommands();
24
+ constructor(_commandSrv: ICommandService, _logService: ILogService, _localFileService: ILocalFileService, _instanceService: IUniverInstanceService);
25
+ registerRecordedCommand(command: ICommand): void;
26
+ togglePanel(visible: boolean): void;
27
+ startRecording(replaceId?: boolean): void;
28
+ stopRecording(): void;
29
+ completeRecording(): void;
30
+ }
@@ -0,0 +1,35 @@
1
+ import { ICommandInfo, Disposable, ICommandService, ILogService, IUniverInstanceService } from '@univerjs/core';
2
+ import { ILocalFileService, IMessageService } from '@univerjs/ui';
3
+ export declare enum ReplayMode {
4
+ DEFAULT = "default",
5
+ NAME = "name",
6
+ ACTIVE = "active"
7
+ }
8
+ /**
9
+ * This service is for replaying user actions.
10
+ */
11
+ export declare class ActionReplayService extends Disposable {
12
+ private readonly _messageService;
13
+ private readonly _instanceService;
14
+ private readonly _localFileService;
15
+ private readonly _logService;
16
+ private readonly _commandService;
17
+ constructor(_messageService: IMessageService, _instanceService: IUniverInstanceService, _localFileService: ILocalFileService, _logService: ILogService, _commandService: ICommandService);
18
+ /**
19
+ * Read a local file and try to replay commands in this JSON.
20
+ */
21
+ replayLocalJSON(mode?: ReplayMode): Promise<boolean>;
22
+ /**
23
+ * Replay a list of commands. Note that `unitId` of these commands would be changed to the focused unit.
24
+ * @param commands - The commands to replay.
25
+ * @returns If the replay is successful.
26
+ */
27
+ replayCommands(commands: ICommandInfo[], options?: {
28
+ mode: ReplayMode;
29
+ }): Promise<boolean>;
30
+ /**
31
+ * Replay a list of commands with a random delay between each command.
32
+ * @param commands - The commands to replay.
33
+ */
34
+ replayCommandsWithDelay(commands: ICommandInfo[]): Promise<boolean>;
35
+ }
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare function RecorderPanel(): React.JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ (function(a,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-filter"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/design"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-filter","@univerjs/sheets-ui","@univerjs/ui","rxjs","@univerjs/design","react"],i):(a=typeof globalThis<"u"?globalThis:a||self,i(a.UniverActionRecorder={},a.UniverCore,a.UniverSheets,a.UniverSheetsFilter,a.UniverSheetsUi,a.UniverUi,a.rxjs,a.UniverDesign,a.React))})(this,function(a,i,s,T,m,l,A,_,g){"use strict";var Ne=Object.defineProperty;var we=(a,i,s)=>i in a?Ne(a,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[i]=s;var p=(a,i,s)=>we(a,typeof i!="symbol"?i+"":i,s);var F;var S=function(){return S=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},S.apply(this,arguments)},Y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},B=g.forwardRef(function(e,t){var n=e.icon,r=e.id,o=e.className,c=e.extend,d=Y(e,["icon","id","className","extend"]),f="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),u=g.useRef("_".concat(X()));return $(n,"".concat(r),{defIds:n.defIds,idSuffix:u.current},S({ref:t,className:f},d),c)});function $(e,t,n,r,o){return g.createElement(e.tag,S(S({key:t},q(e,n,o)),r),(Q(e,n).children||[]).map(function(c,d){return $(c,"".concat(t,"-").concat(e.tag,"-").concat(d),n,void 0,o)}))}function q(e,t,n){var r=S({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var o=t.defIds;return!o||o.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(c){var d=c[0],f=c[1];typeof f=="string"&&(r[d]=f.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Q(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?S(S({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.indexOf(o.attrs.id)>-1?S(S({},o),{attrs:S(S({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function X(){return Math.random().toString(36).substring(2,8)}B.displayName="UniverIcon";var ee={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=g.forwardRef(function(e,t){return g.createElement(B,Object.assign({},e,{id:"record-single",ref:t,icon:ee}))});N.displayName="RecordSingle";var ne=Object.defineProperty,re=Object.getOwnPropertyDescriptor,te=(e,t,n,r)=>{for(var o=r>1?void 0:r?re(t,n):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(o=(r?d(t,n,o):d(o))||o);return r&&o&&ne(t,n,o),o},j=(e,t)=>(n,r)=>t(n,r,e);a.ActionRecorderService=class extends i.Disposable{constructor(n,r,o,c){super();p(this,"_shouldRecordCommands",new Set);p(this,"_panelOpened$",new A.BehaviorSubject(!1));p(this,"panelOpened$",this._panelOpened$.asObservable());p(this,"_recorder",null);p(this,"_recording$",new A.BehaviorSubject(!1));p(this,"recording$",this._recording$.asObservable());p(this,"_recorded$",new A.BehaviorSubject([]));p(this,"_recordedCommands$",new A.BehaviorSubject([]));p(this,"recordedCommands$",this._recordedCommands$.asObservable());this._commandSrv=n,this._logService=r,this._localFileService=o,this._instanceService=c}get recording(){return this._recording$.getValue()}get _recorded(){return this._recorded$.getValue()}get _recordedCommands(){return this._recordedCommands$.getValue()}registerRecordedCommand(n){if(n.type===i.CommandType.MUTATION)throw new Error("[CommandRecorderService] Cannot record mutation commands.");this._shouldRecordCommands.add(n.id)}togglePanel(n){this._panelOpened$.next(n),n===!1&&this.stopRecording()}startRecording(n=!1){this._recorder=this._commandSrv.onCommandExecuted(r=>{var o,c;if(this._shouldRecordCommands.has(r.id)){const d=this._recorded,f=this._recordedCommands;let u={...r};const R=(o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId(),{unitId:y=R,subUnitId:v}=u==null?void 0:u.params;if(n&&y&&v){const L=(c=this._instanceService.getUnit(y).getSheetBySheetId(v))==null?void 0:c.getName();u={...u,params:{...u.params,subUnitId:L}}}u.id===s.SetSelectionsOperation.id&&d.length>0&&d[d.length-1].id===s.SetSelectionsOperation.id?d[d.length-1]=u:(d.push(u),this._recorded$.next(d),u.type===i.CommandType.COMMAND&&(f.push(u),this._recordedCommands$.next(f)))}}),this._recording$.next(!0)}stopRecording(){var n;(n=this._recorder)==null||n.dispose(),this._recorder=null,this._recorded$.next([]),this._recordedCommands$.next([]),this._recording$.next(!1)}completeRecording(){const n=this._recorded.slice();this._localFileService.downloadFile(new Blob([JSON.stringify(n,null,2)]),"recorded-commands.json"),this._logService.error("Recorded commands:",n),this.stopRecording()}},a.ActionRecorderService=te([j(0,i.ICommandService),j(1,i.ILogService),j(2,l.ILocalFileService),j(3,i.IUniverInstanceService)],a.ActionRecorderService);const V={id:"action-recorder.command.start-recording",type:i.CommandType.COMMAND,handler:(e,t)=>(e.get(a.ActionRecorderService).startRecording(!!(t!=null&&t.replaceId)),!0)},W={id:"action-recorder.command.complete-recording",type:i.CommandType.COMMAND,handler:e=>(e.get(a.ActionRecorderService).completeRecording(),!0)},z={id:"action-recorder.command.stop-recording",type:i.CommandType.COMMAND,handler:e=>(e.get(a.ActionRecorderService).completeRecording(),!0)};var oe=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ce=(e,t,n,r)=>{for(var o=r>1?void 0:r?ie(t,n):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(o=(r?d(t,n,o):d(o))||o);return r&&o&&oe(t,n,o),o},I=(e,t)=>(n,r)=>t(n,r,e),w=(e=>(e.DEFAULT="default",e.NAME="name",e.ACTIVE="active",e))(w||{});a.ActionReplayService=class extends i.Disposable{constructor(t,n,r,o,c){super(),this._messageService=t,this._instanceService=n,this._localFileService=r,this._logService=o,this._commandService=c}async replayLocalJSON(t="default"){const n=await this._localFileService.openFile({multiple:!1,accept:".json"});if(n.length!==1)return!1;const r=n[0];try{return this.replayCommands(JSON.parse(await r.text()),{mode:t})}catch{return this._messageService.show({type:_.MessageType.Error,content:`Failed to replay commands from local file ${r.name}.`}),!1}}async replayCommands(t,n){var c,d,f;const r=(c=this._instanceService.getFocusedUnit())==null?void 0:c.getUnitId();r||this._logService.error("[ReplayService]","no focused unit to replay commands");const{mode:o}=n||{};for(const u of t){const{id:R,params:y}=u,v=y;if(v){if(typeof v.unitId<"u"&&(v.unitId=r),o==="name"&&v.subUnitId!=="undefined"){const P=(d=this._instanceService.getFocusedUnit().getSheetBySheetName(v.subUnitId))==null?void 0:d.getSheetId();P?v.subUnitId=P:this._logService.error("[ReplayService]",`failed to find subunit by subUnitName = ${v.subUnitId}`)}if(o==="active"&&v.subUnitId!=="undefined"){const P=(f=this._instanceService.getFocusedUnit().getActiveSheet())==null?void 0:f.getSheetId();P?v.subUnitId=P:this._logService.error("[ReplayService]","failed to find active subunit")}if(!await this._commandService.executeCommand(R,y))return!1}else if(!await this._commandService.executeCommand(R))return!1}return!0}async replayCommandsWithDelay(t){var r;const n=(r=this._instanceService.getFocusedUnit())==null?void 0:r.getUnitId();n||this._logService.error("[ReplayService]","no focused unit to replay commands");for(const o of t){await i.awaitTime(ae());const{id:c,params:d}=o;if(d){if(typeof d.unitId<"u"&&(d.unitId=n),!await this._commandService.executeCommand(c,d))return!1}else if(!await this._commandService.executeCommand(c))return!1}return!0}},a.ActionReplayService=ce([I(0,l.IMessageService),I(1,i.IUniverInstanceService),I(2,l.ILocalFileService),I(3,i.ILogService),I(4,i.ICommandService)],a.ActionReplayService);function ae(){return Math.floor(Math.random()*800)+200}const U={id:"action-recorder.command.replay-local-records",type:i.CommandType.COMMAND,handler:async e=>{const n=await e.get(a.ActionReplayService).replayLocalJSON();return n&&e.get(l.IMessageService).show({type:_.MessageType.Success,content:"Successfully replayed local records"}),n}},x={id:"action-recorder.command.replay-local-records-name",type:i.CommandType.COMMAND,handler:async e=>{const n=await e.get(a.ActionReplayService).replayLocalJSON(w.NAME);return n&&e.get(l.IMessageService).show({type:_.MessageType.Success,content:"Successfully replayed local records"}),n}},D={id:"action-recorder.command.replay-local-records-active",type:i.CommandType.COMMAND,handler:async e=>{const n=await e.get(a.ActionReplayService).replayLocalJSON(w.ACTIVE);return n&&e.get(l.IMessageService).show({type:_.MessageType.Success,content:"Successfully replayed local records"}),n}},E={id:"action-recorder.operation.open-panel",type:i.CommandType.OPERATION,handler(e){return e.get(a.ActionRecorderService).togglePanel(!0),!0}},k={id:"action-recorder.operation.close-panel",type:i.CommandType.OPERATION,handler(e){return e.get(a.ActionRecorderService).togglePanel(!1),!0}};var H={exports:{}},b={};/**
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 de=g,se=Symbol.for("react.element"),le=Symbol.for("react.fragment"),me=Object.prototype.hasOwnProperty,ue=de.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,fe={key:!0,ref:!0,__self:!0,__source:!0};function J(e,t,n){var r,o={},c=null,d=null;n!==void 0&&(c=""+n),t.key!==void 0&&(c=""+t.key),t.ref!==void 0&&(d=t.ref);for(r in t)me.call(t,r)&&!fe.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:se,type:e,key:c,ref:d,props:o,_owner:ue.current}}b.Fragment=le,b.jsx=J,b.jsxs=J,H.exports=b;var C=H.exports;function G(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=G(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ve(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=G(e))&&(r&&(r+=" "),r+=t);return r}const O={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"};function Se(){const e=i.useDependency(a.ActionRecorderService);return l.useObservable(e.panelOpened$)?C.jsx(pe,{}):null}function pe(){var y;const e=i.useDependency(i.ICommandService),t=i.useDependency(a.ActionRecorderService),n=l.useObservable(t.recording$),r=l.useObservable(t.recordedCommands$),o=(y=r==null?void 0:r.length)!=null?y:0,c=g.useCallback(()=>{n||e.executeCommand(k.id)},[e,n]),d=g.useCallback(v=>{n||e.executeCommand(V.id,{replaceId:v})},[e,n]),f=g.useCallback(()=>{n&&e.executeCommand(W.id)},[e,n]),u=g.useCallback(()=>{n&&e.executeCommand(z.id)},[e,n]),R=n?o===0?"Recording...":`${o}: ${r[o-1].id}`:"Start Recording";return C.jsxs("div",{className:O.actionRecorderPanel,children:[C.jsx("div",{className:ve(O.actionRecorderPanelIcon,n?O.actionRecorderPanelIconRecording:!1),children:C.jsx(N,{})}),C.jsx("div",{className:O.actionRecorderPanelTitle,children:R}),C.jsxs("div",{className:O.actionRecorderPanelActions,children:[C.jsx(_.Button,{type:"default",size:"small",onClick:n?u:c,children:n?"Cancel":"Close"}),C.jsx(_.Button,{type:"primary",size:"small",onClick:n?f:()=>d(),children:n?"Save":"Start"}),!n&&C.jsx(_.Button,{type:"primary",size:"small",onClick:()=>d(!0),children:"Start(N)"})]})]})}const Z="RECORD_MENU_ITEM";function ge(){return{id:Z,type:l.MenuItemType.SUBITEMS,icon:"RecordSingle",tooltip:"action-recorder.menu.title"}}function Ce(e){const t=e.get(a.ActionRecorderService);return{id:E.id,title:"action-recorder.menu.record",type:l.MenuItemType.BUTTON,disabled$:t.panelOpened$}}function ye(){return{id:U.id,title:"action-recorder.menu.replay-local",type:l.MenuItemType.BUTTON}}function _e(){return{id:x.id,title:"action-recorder.menu.replay-local-name",type:l.MenuItemType.BUTTON}}function he(){return{id:D.id,title:"action-recorder.menu.replay-local-active",type:l.MenuItemType.BUTTON}}const Re={[l.RibbonStartGroup.OTHERS]:{[Z]:{order:10,menuItemFactory:ge,[E.id]:{order:1,menuItemFactory:Ce},[U.id]:{order:2,menuItemFactory:ye},[x.id]:{order:3,menuItemFactory:_e},[D.id]:{order:4,menuItemFactory:he}}}};var Ie=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Pe=(e,t,n,r)=>{for(var o=r>1?void 0:r?Oe(t,n):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(o=(r?d(t,n,o):d(o))||o);return r&&o&&Ie(t,n,o),o},h=(e,t)=>(n,r)=>t(n,r,e);let M=class extends i.Disposable{constructor(e,t,n,r,o,c){super(),this._commandSrv=e,this._uiPartsSrv=t,this._menuManagerService=n,this._componentManager=r,this._actionRecorderService=o,this._injector=c,this._initCommands(),this._initUI(),this._initSheetsCommands(),this._initDocsCommands()}_initCommands(){[V,z,W,E,k,U,x,D].forEach(e=>this._commandSrv.registerCommand(e))}_initUI(){this._uiPartsSrv.registerComponent(l.BuiltInUIPart.GLOBAL,()=>i.connectInjector(Se,this._injector)),this._componentManager.register("RecordSingle",N),this._menuManagerService.mergeMenu(Re)}_initSheetsCommands(){[s.CopySheetCommand,s.DeleteRangeMoveLeftCommand,s.DeleteRangeMoveUpCommand,s.DeltaColumnWidthCommand,s.DeltaRowHeightCommand,s.InsertSheetCommand,s.InsertColAfterCommand,s.InsertColBeforeCommand,s.InsertRowAfterCommand,s.InsertRowBeforeCommand,s.RemoveSheetCommand,s.SetStyleCommand,s.AddWorksheetMergeCommand,s.AddWorksheetMergeAllCommand,s.AddWorksheetMergeVerticalCommand,s.AddWorksheetMergeHorizontalCommand,s.SetFrozenCommand,s.CancelFrozenCommand,s.SetHorizontalTextAlignCommand,s.SetOverlineCommand,m.SetRangeBoldCommand,m.SetRangeFontFamilyCommand,m.SetRangeFontSizeCommand,m.SetRangeItalicCommand,m.SetRangeStrickThroughCommand,m.SetRangeSubscriptCommand,m.SetRangeSuperscriptCommand,m.SetRangeTextColorCommand,m.SetRangeUnderlineCommand,s.SetRangeValuesCommand,s.SetStrikeThroughCommand,s.SetTextColorCommand,s.SetTextRotationCommand,s.SetTextWrapCommand,s.SetVerticalTextAlignCommand,m.SheetCopyCommand,m.SheetCutCommand,m.SheetPasteBesidesBorderCommand,m.SheetPasteColWidthCommand,m.SheetPasteCommand,m.SheetPasteFormatCommand,m.SheetPasteShortKeyCommand,m.SheetPasteValueCommand,s.SetWorksheetActivateCommand,s.SetWorksheetActiveOperation,s.SetSelectionsOperation,T.SetSheetFilterRangeCommand,T.SetSheetsFilterCriteriaCommand,T.RemoveSheetFilterCommand].forEach(e=>this._actionRecorderService.registerRecordedCommand(e))}_initDocsCommands(){}};M=Pe([h(0,i.ICommandService),h(1,l.IUIPartsService),h(2,l.IMenuManagerService),h(3,i.Inject(l.ComponentManager)),h(4,i.Inject(a.ActionRecorderService)),h(5,i.Inject(i.Injector))],M);const Ae="action-recorder.config",je={};var be=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,Te=(e,t,n,r)=>{for(var o=r>1?void 0:r?Me(t,n):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(o=(r?d(t,n,o):d(o))||o);return r&&o&&be(t,n,o),o},K=(e,t)=>(n,r)=>t(n,r,e);a.UniverActionRecorderPlugin=(F=class extends i.Plugin{constructor(t=je,n,r){super(),this._config=t,this._injector=n,this._configService=r;const{menu:o,...c}=this._config;o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(Ae,c)}onStarting(){(this._config.replayOnly?[[a.ActionReplayService]]:[[a.ActionRecorderService],[a.ActionReplayService],[M]]).forEach(n=>this._injector.add(n))}onSteady(){this._config.replayOnly||this._injector.get(M)}},p(F,"pluginName","UNIVER_ACTION_RECORDER_PLUGIN"),F),a.UniverActionRecorderPlugin=Te([K(1,i.Inject(i.Injector)),K(2,i.IConfigService)],a.UniverActionRecorderPlugin),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1 @@
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderEnUS=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}}});
@@ -0,0 +1 @@
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderFaIR=n())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"ثبت اقدامات",record:"ثبت اقدامات...","replay-local":"بازپخش محلی ثبت..."}}}});
@@ -0,0 +1 @@
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderRuRU=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}}});
@@ -0,0 +1 @@
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderViVN=o())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"Record Actions",record:"Record Actions...","replay-local":"Replace Local Record..."}}}});
@@ -0,0 +1 @@
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderZhCN=n())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}}});
@@ -0,0 +1 @@
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverActionRecorderZhTW=n())})(this,function(){"use strict";return{"action-recorder":{menu:{title:"操作录制",record:"录制操作...","replay-local":"回放本地录制..."}}}});
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@univerjs/action-recorder",
3
+ "version": "0.5.0-nightly.202411181606",
4
+ "private": false,
5
+ "description": "",
6
+ "author": "DreamNum <developer@univer.ai>",
7
+ "license": "Apache-2.0",
8
+ "funding": {
9
+ "type": "opencollective",
10
+ "url": "https://opencollective.com/univer"
11
+ },
12
+ "homepage": "https://univer.ai",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/dream-num/univer"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/dream-num/univer/issues"
19
+ },
20
+ "keywords": [],
21
+ "exports": {
22
+ ".": {
23
+ "import": "./lib/es/index.js",
24
+ "require": "./lib/cjs/index.js",
25
+ "types": "./lib/types/index.d.ts"
26
+ },
27
+ "./*": {
28
+ "import": "./lib/es/*",
29
+ "require": "./lib/cjs/*",
30
+ "types": "./lib/types/index.d.ts"
31
+ },
32
+ "./locale/*": {
33
+ "import": "./lib/es/locale/*.js",
34
+ "require": "./lib/cjs/locale/*.js",
35
+ "types": "./lib/types/locale/*.d.ts"
36
+ },
37
+ "./lib/*": "./lib/*"
38
+ },
39
+ "main": "./lib/es/index.js",
40
+ "types": "./lib/types/index.d.ts",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "directories": {
45
+ "lib": "lib"
46
+ },
47
+ "files": [
48
+ "lib"
49
+ ],
50
+ "peerDependencies": {
51
+ "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
52
+ "rxjs": ">=7.0.0"
53
+ },
54
+ "dependencies": {
55
+ "@univerjs/icons": "^0.2.5",
56
+ "clsx": "^2.1.1",
57
+ "@univerjs/core": "0.5.0-nightly.202411181606",
58
+ "@univerjs/design": "0.5.0-nightly.202411181606",
59
+ "@univerjs/sheets": "0.5.0-nightly.202411181606",
60
+ "@univerjs/sheets-filter": "0.5.0-nightly.202411181606",
61
+ "@univerjs/sheets-ui": "0.5.0-nightly.202411181606",
62
+ "@univerjs/ui": "0.5.0-nightly.202411181606"
63
+ },
64
+ "devDependencies": {
65
+ "less": "^4.2.0",
66
+ "react": "18.3.1",
67
+ "rxjs": "^7.8.1",
68
+ "typescript": "^5.6.3",
69
+ "vite": "^5.4.11",
70
+ "vitest": "^2.1.5",
71
+ "@univerjs-infra/shared": "0.5.0-beta.1"
72
+ },
73
+ "space": {
74
+ ".": {
75
+ "import": "./lib/es/index.js",
76
+ "require": "./lib/cjs/index.js",
77
+ "types": "./lib/types/index.d.ts"
78
+ },
79
+ "./*": {
80
+ "import": "./lib/es/*",
81
+ "require": "./lib/cjs/*",
82
+ "types": "./lib/types/index.d.ts"
83
+ },
84
+ "./locale/*": {
85
+ "import": "./lib/es/locale/*.js",
86
+ "require": "./lib/cjs/locale/*.js",
87
+ "types": "./lib/types/locale/*.d.ts"
88
+ },
89
+ "./lib/*": "./lib/*"
90
+ },
91
+ "scripts": {
92
+ "test": "vitest run",
93
+ "test:watch": "vitest",
94
+ "coverage": "vitest run --coverage",
95
+ "lint:types": "tsc --noEmit",
96
+ "build": "univer-cli build"
97
+ },
98
+ "module": "./lib/es/index.js"
99
+ }