@vnejs/plugins.text.meet 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "@vnejs/contracts.text";
2
2
  import "@vnejs/contracts.text.meet";
3
3
  import { regPlugin } from "@vnejs/shared";
4
- import { PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.text.meet";
4
+ import { CONSTANTS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.text.meet";
5
5
  import { TextMeet } from "./modules/meet.js";
6
- regPlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS }, [TextMeet]);
6
+ regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS }, [TextMeet]);
@@ -13,7 +13,7 @@ export class TextMeet extends ModuleCore {
13
13
  this.emit(this.EVENTS.SCENARIO.NEXT);
14
14
  };
15
15
  onMeet = ({ speaker = "", value = 1 } = {}) => {
16
- this.emitLog({ speaker, value });
16
+ this.emit(this.EVENTS.LOGS.EMIT, { action: this.CONST.TEXT_MEET.LOGS_ACTIONS.MEET, speaker, value });
17
17
  const prev = getTextSpeakerInfo(this.globalState["text.speaker"], speaker);
18
18
  const meet = (prev.meet ?? 0) + Number(value);
19
19
  return this.emit(this.EVENTS.TEXT.SPEAKER_INFO_UPDATE, { speaker, info: { meet } });
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
2
2
  import type { PluginName as TextPluginName, SubscribeEvents as TextSubscribeEvents } from "@vnejs/contracts.text";
3
- import type { PluginName, SubscribeEvents } from "@vnejs/contracts.text.meet";
3
+ import type { Constants, PluginName, SubscribeEvents } from "@vnejs/contracts.text.meet";
4
4
  export type TextMeetPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<TextPluginName, TextSubscribeEvents>;
5
- export type TextMeetPluginConstants = ModuleCoreConstants;
5
+ export type TextMeetPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
6
6
  export type TextMeetPluginSettings = ModuleCoreSettings;
7
7
  export type TextMeetPluginParams = ModuleCoreParams;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.text.meet",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -2,8 +2,8 @@ import "@vnejs/contracts.text";
2
2
  import "@vnejs/contracts.text.meet";
3
3
 
4
4
  import { regPlugin } from "@vnejs/shared";
5
- import { PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.text.meet";
5
+ import { CONSTANTS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.text.meet";
6
6
 
7
7
  import { TextMeet } from "./modules/meet.js";
8
8
 
9
- regPlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS }, [TextMeet]);
9
+ regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS }, [TextMeet]);
@@ -25,7 +25,7 @@ export class TextMeet extends ModuleCore<TextMeetPluginEvents, TextMeetPluginCon
25
25
  };
26
26
 
27
27
  onMeet = ({ speaker = "", value = 1 }: TextMeetPayload = {}) => {
28
- this.emitLog({ speaker, value });
28
+ this.emit(this.EVENTS.LOGS.EMIT, { action: this.CONST.TEXT_MEET.LOGS_ACTIONS.MEET, speaker, value });
29
29
 
30
30
  const prev = getTextSpeakerInfo(this.globalState["text.speaker"], speaker);
31
31
  const meet = (prev.meet ?? 0) + Number(value);
@@ -1,11 +1,11 @@
1
1
  import { CONSTANTS as TEXT_CONST, PLUGIN_NAME as TEXT, SUBSCRIBE_EVENTS as TEXT_EVENTS } from "@vnejs/contracts.text";
2
- import { PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.text.meet";
2
+ import { CONSTANTS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.text.meet";
3
3
  import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin } from "@vnejs/test-utils";
4
4
 
5
5
  export const registerTextMeetPluginVne = () => {
6
6
  registerCoreVne();
7
- registerVnePlugin(TEXT, { events: TEXT_EVENTS });
8
- registerVnePlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS });
7
+ registerVnePlugin(TEXT, { events: TEXT_EVENTS, constants: TEXT_CONST });
8
+ registerVnePlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS });
9
9
  };
10
10
 
11
11
  export const createTextMeetTestModule = <T extends Parameters<typeof baseCreateTestModule>[0]>(
@@ -17,4 +17,4 @@ export const createTextMeetTestModule = <T extends Parameters<typeof baseCreateT
17
17
  ...options,
18
18
  });
19
19
 
20
- export { SUBSCRIBE_EVENTS, TEXT_EVENTS, PLUGIN_NAME };
20
+ export { SUBSCRIBE_EVENTS, TEXT_EVENTS, PLUGIN_NAME, CONSTANTS };
package/src/types.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
2
2
  import type { PluginName as TextPluginName, SubscribeEvents as TextSubscribeEvents } from "@vnejs/contracts.text";
3
- import type { PluginName, SubscribeEvents } from "@vnejs/contracts.text.meet";
3
+ import type { Constants, PluginName, SubscribeEvents } from "@vnejs/contracts.text.meet";
4
4
 
5
5
  export type TextMeetPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<TextPluginName, TextSubscribeEvents>;
6
6
 
7
- export type TextMeetPluginConstants = ModuleCoreConstants;
7
+ export type TextMeetPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
8
8
 
9
9
  export type TextMeetPluginSettings = ModuleCoreSettings;
10
10