Skip to content

Commit

Permalink
feat: add replay-only mode to actionRecordPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongz committed Oct 10, 2024
1 parent a2f2215 commit 7759b35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const configSymbol = Symbol(PLUGIN_CONFIG_KEY);

export interface IUniverActionRecorderConfig {
menu?: MenuConfig;
replayOnly?: boolean;
}

export const defaultPluginConfig: IUniverActionRecorderConfig = {};
7 changes: 5 additions & 2 deletions packages-experimental/action-recorder/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

import { IConfigService, Inject, Injector, Plugin } from '@univerjs/core';
import type { Dependency } from '@univerjs/core';
import type { IUniverActionRecorderConfig } from './controllers/config.schema';
import { IConfigService, Inject, Injector, Plugin } from '@univerjs/core';
import { ActionRecorderController } from './controllers/action-recorder.controller';
import { defaultPluginConfig, PLUGIN_CONFIG_KEY } from './controllers/config.schema';
import { ActionRecorderService } from './services/action-recorder.service';
import { ActionReplayService } from './services/replay.service';
import type { IUniverActionRecorderConfig } from './controllers/config.schema';

/**
* This plugin provides a recorder for user's interactions with Univer,
Expand Down Expand Up @@ -53,6 +53,9 @@ export class UniverActionRecorderPlugin extends Plugin {
}

override onSteady(): void {
if (this._config.replayOnly) {
return;
}
this._injector.get(ActionRecorderController);
}
}

0 comments on commit 7759b35

Please sign in to comment.