@playkit-js/moderation 3.2.12 → 3.2.13-canary.0-5376147

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/moderation",
3
- "version": "3.2.12",
3
+ "version": "3.2.13-canary.0-5376147",
4
4
  "main": "dist/playkit-moderation.js",
5
5
  "private": false,
6
6
  "bugs": {
@@ -44,7 +44,8 @@
44
44
  "README.md",
45
45
  "CHANGELOG.md",
46
46
  "src",
47
- "translations"
47
+ "translations",
48
+ "types"
48
49
  ],
49
50
  "scripts": {
50
51
  "clean": "rm -rf ./dist",
@@ -0,0 +1,2 @@
1
+ import {ModerationEvent} from './moderation-event';
2
+ export {ModerationEvent};
@@ -0,0 +1,4 @@
1
+ export namespace ModerationEvent {
2
+ const REPORT_CLICKED: string;
3
+ const REPORT_SUBMITTED: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ const ModerationEvent = {
2
+ REPORT_CLICKED: 'report_clicked',
3
+ REPORT_SUBMITTED: 'report_submitted'
4
+ };
5
+
6
+ export {ModerationEvent};
@@ -10,6 +10,9 @@ import {UpperBarManager} from '@playkit-js/ui-managers';
10
10
  import {ReportLoader, KalturaModerationFlag} from './providers';
11
11
  import {ErrorIcon} from './components/icons/error-icon';
12
12
  import {SuccessIcon} from './components/icons/success-icon';
13
+ import {ModerationEvent} from './event';
14
+ // @ts-ignore
15
+ import {FakeEvent} from '@playkit-js/playkit-js';
13
16
 
14
17
  const {ReservedPresetAreas, ReservedPresetNames} = ui;
15
18
  const {Text} = ui.preacti18n;
@@ -64,6 +67,7 @@ export class ModerationPlugin extends KalturaPlayer.core.BasePlugin {
64
67
  }
65
68
 
66
69
  private _sentReport = (contentType: number, content: string, callback?: () => void) => {
70
+ this.player.dispatchEvent(new FakeEvent(ModerationEvent.REPORT_SUBMITTED, {reportType: contentType}))
67
71
  const {sources} = this._player;
68
72
  return this._player.provider
69
73
  .doRequest([{loader: ReportLoader, params: {comments: content, flagType: contentType, flaggedEntryId: sources.id}}])
@@ -176,6 +180,8 @@ export class ModerationPlugin extends KalturaPlayer.core.BasePlugin {
176
180
  />
177
181
  )
178
182
  });
183
+
184
+ this.dispatchEvent(ModerationEvent.REPORT_CLICKED);
179
185
  };
180
186
 
181
187
  private _addPluginIcon(): void {
package/types/index.js ADDED
@@ -0,0 +1 @@
1
+ export {ModerationEvent} from '../src/event/moderation-event';