@playkit-js/moderation 2.1.1 → 2.2.0-canary.10-af41e17

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 (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +5 -5
  3. package/README.md +174 -8
  4. package/dist/playkit-moderation.js +1 -23
  5. package/dist/playkit-moderation.js.map +1 -1
  6. package/package.json +51 -53
  7. package/src/components/icons/error-icon.tsx +11 -0
  8. package/src/components/icons/index.ts +9 -0
  9. package/src/components/icons/success-icon.tsx +11 -0
  10. package/src/components/moderation/down-icon.tsx +12 -0
  11. package/src/components/moderation/moderation.scss +46 -25
  12. package/src/components/moderation/moderation.tsx +67 -104
  13. package/src/components/plugin-button/plugin-button.scss +14 -14
  14. package/src/components/plugin-button/plugin-button.tsx +26 -3
  15. package/src/components/popover/index.ts +1 -0
  16. package/src/components/popover/popover-menu.scss +4 -0
  17. package/src/components/popover/popover-menu.tsx +57 -0
  18. package/src/components/popover/popover.scss +30 -0
  19. package/src/components/popover/popover.tsx +224 -0
  20. package/src/global.d.ts +6 -6
  21. package/src/index.ts +14 -1
  22. package/src/moderation-plugin.scss +4 -12
  23. package/src/moderation-plugin.tsx +132 -161
  24. package/src/providers/index.ts +2 -0
  25. package/src/providers/report-loader.ts +69 -0
  26. package/src/providers/response-types/index.ts +2 -0
  27. package/src/providers/response-types/kaltura-moderation-flag-response.ts +13 -0
  28. package/src/providers/response-types/kaltura-moderation-flag.ts +51 -0
  29. package/src/variables.scss +4 -1
  30. package/src/assets/.gitkeep +0 -0
  31. package/src/assets/close.svg +0 -10
  32. package/src/assets/down.svg +0 -9
  33. package/src/assets/error.svg +0 -3
  34. package/src/assets/flag.svg +0 -6
  35. package/src/assets/report.svg +0 -3
  36. package/src/components/.gitkeep +0 -0
  37. package/src/components/moderation/assets/down.svg +0 -9
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.2.0-canary.10-af41e17](https://github.com/kaltura/playkit-js-moderation/compare/v2.1.1...v2.2.0-canary.10-af41e17) (2022-09-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * **FEV-1274:** moderation plugin move contrib kitchen sink to core side panels ([#24](https://github.com/kaltura/playkit-js-moderation/issues/24)) ([4290705](https://github.com/kaltura/playkit-js-moderation/commit/42907058f9449d0f6c35f4e8320e1595460cfc82))
11
+ * **FEV-1274:** use ui managers from @playkit-js/common repo ([#26](https://github.com/kaltura/playkit-js-moderation/issues/26)) ([71fcdc0](https://github.com/kaltura/playkit-js-moderation/commit/71fcdc049dc8f294fa9dd0bef1f1bb428de3b098))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **FEV-1398:** moderation style fixes ([#29](https://github.com/kaltura/playkit-js-moderation/issues/29)) ([f255db1](https://github.com/kaltura/playkit-js-moderation/commit/f255db10115e2d003cd7328e8b8a255680d80f41))
17
+ * revert plugin name to playkit-js-moderation ([#30](https://github.com/kaltura/playkit-js-moderation/issues/30)) ([af41e17](https://github.com/kaltura/playkit-js-moderation/commit/af41e1791669802d780fe8a034855484d6c85253))
18
+
5
19
  ### [2.1.1](https://github.com/kaltura/playkit-js-moderation/compare/v2.0.11...v2.1.1) (2022-01-19)
6
20
 
7
21
  ### [2.0.11](https://github.com/kaltura/playkit-js-moderation/compare/v2.0.10...v2.0.11) (2021-12-06)
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  GNU AFFERO GENERAL PUBLIC LICENSE
2
2
  Version 3, 19 November 2007
3
3
 
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
5
  Everyone is permitted to copy and distribute verbatim copies
6
6
  of this license document, but changing it is not allowed.
7
7
 
@@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found.
633
633
  Copyright (C) <year> <name of author>
634
634
 
635
635
  This program is free software: you can redistribute it and/or modify
636
- it under the terms of the GNU Affero General Public License as published by
637
- the Free Software Foundation, either version 3 of the License, or
636
+ it under the terms of the GNU Affero General Public License as published
637
+ by the Free Software Foundation, either version 3 of the License, or
638
638
  (at your option) any later version.
639
639
 
640
640
  This program is distributed in the hope that it will be useful,
@@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found.
643
643
  GNU Affero General Public License for more details.
644
644
 
645
645
  You should have received a copy of the GNU Affero General Public License
646
- along with this program. If not, see <http://www.gnu.org/licenses/>.
646
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
647
647
 
648
648
  Also add information on how to contact you by electronic and paper mail.
649
649
 
@@ -658,4 +658,4 @@ specific requirements.
658
658
  You should also get your employer (if you work as a programmer) or school,
659
659
  if any, to sign a "copyright disclaimer" for the program, if necessary.
660
660
  For more information on this, and how to apply and follow the GNU AGPL, see
661
- <http://www.gnu.org/licenses/>.
661
+ <https://www.gnu.org/licenses/>.
package/README.md CHANGED
@@ -1,12 +1,178 @@
1
- # Kaltura Player V7 - Moderation plugin
1
+ # PlayKit JS Moderation - plugin for the [PlayKit JS Player]
2
2
 
3
- [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
3
+ PlayKit JS Moderation is written in [ECMAScript6], statically analysed using [Typescript] and transpiled in ECMAScript5 using [Babel].
4
4
 
5
- ## Overview
6
- > this section will be added soon
5
+ [typescript]: https://www.typescriptlang.org/
6
+ [ecmascript6]: https://github.com/ericdouglas/ES6-Learning#articles--tutorials
7
+ [babel]: https://babeljs.io
7
8
 
8
- ## Project structure
9
- > this section will be added soon
9
+ ## Getting Started
10
10
 
11
- ## Commands
12
- > this section will be added soon
11
+ ### Prerequisites
12
+
13
+ The plugin requires [Kaltura Player] to be loaded first.
14
+
15
+ [kaltura player]: https://github.com/kaltura/kaltura-player-js
16
+
17
+ ### Installing
18
+
19
+ First, clone and run [yarn] to install dependencies:
20
+
21
+ [yarn]: https://yarnpkg.com/lang/en/
22
+
23
+ ```
24
+ git clone https://github.com/kaltura/playkit-js-moderation.git
25
+ cd playkit-js-moderation
26
+ yarn install
27
+ ```
28
+
29
+ ### Building
30
+
31
+ Then, build the player
32
+
33
+ ```javascript
34
+ yarn run build
35
+ ```
36
+
37
+ ### Embed the library in your test page
38
+
39
+ Finally, add the bundle as a script tag in your page, and initialize the player
40
+
41
+ ```html
42
+ <script type="text/javascript" src="/PATH/TO/FILE/kaltura-player.js"></script>
43
+ <!--Kaltura player-->
44
+ <script type="text/javascript" src="/PATH/TO/FILE/playkit-moderation.js"></script>
45
+ <!--PlayKit moderation plugin-->
46
+ <div id="player-placeholder" style="height:360px; width:640px">
47
+ <script type="text/javascript">
48
+ var playerContainer = document.querySelector("#player-placeholder");
49
+ var config = {
50
+ ...
51
+ targetId: 'player-placeholder',
52
+ plugins: {
53
+ moderation: { ... }
54
+ }
55
+ ...
56
+ };
57
+ var player = KalturaPlayer.setup(config);
58
+ player.loadMedia(...);
59
+ </script>
60
+ </div>
61
+ ```
62
+
63
+ ## Documentation
64
+
65
+ Moderation plugin configuration can been found here:
66
+
67
+ - **[Configuration](#configuration)**
68
+
69
+ ### And coding style tests
70
+
71
+ We use ESLint [recommended set](http://eslint.org/docs/rules/) with some additions for enforcing [Flow] types and other rules.
72
+
73
+ See [ESLint config](.eslintrc.json) for full configuration.
74
+
75
+ We also use [.editorconfig](.editorconfig) to maintain consistent coding styles and settings, please make sure you comply with the styling.
76
+
77
+ ## Contributing
78
+
79
+ Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
80
+
81
+ ## Versioning
82
+
83
+ We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/kaltura/playkit-js-moderation/tags).
84
+
85
+ ## License
86
+
87
+ This project is licensed under the AGPL-3.0 License - see the [LICENSE.md](LICENSE.md) file for details
88
+
89
+ <a name="configuration"></a>
90
+ ## Configuration
91
+
92
+ #### Configuration Structure
93
+
94
+ ```js
95
+ //Default configuration
96
+ "moderation" = {};
97
+ //Plugin params
98
+ "moderation" = {
99
+ reportLength?: number, // optional
100
+ onReportSentMessage?: string, // optional
101
+ onReportErrorMessage?: string, // optional
102
+ subtitle?: string, // optional
103
+ tooltipMessage?: string, // optional
104
+ notificatonDuration?: number, // optional
105
+ moderateOptions?: Array< {id: number, label: string} > // optional
106
+ }
107
+ ```
108
+
109
+ ##
110
+
111
+ > ### config.reportLength
112
+ >
113
+ > ##### Type: `number`
114
+ >
115
+ > ##### Default: `500`
116
+ >
117
+
118
+ ##
119
+
120
+ > ### config.onReportSentMessage
121
+ >
122
+ > ##### Type: `string`
123
+ >
124
+ > ##### Default: `The report sent`
125
+ >
126
+
127
+ ##
128
+
129
+ > ### config.onReportErrorMessage
130
+ >
131
+ > ##### Type: `string`
132
+ >
133
+ > ##### Default: `The report failed to send`
134
+ >
135
+
136
+ ##
137
+
138
+ > ### config.subtitle
139
+ >
140
+ > ##### Type: `string`
141
+ >
142
+ > ##### Default: `-`
143
+ >
144
+
145
+ ##
146
+
147
+ > ### config.tooltipMessage
148
+ >
149
+ > ##### Type: `string`
150
+ >
151
+ > ##### Default: `Send report`
152
+ >
153
+
154
+ ##
155
+
156
+ > ### config.notificatonDuration
157
+ >
158
+ > ##### Type: `number`
159
+ >
160
+ > ##### Default: `5000`
161
+ >
162
+
163
+ ##
164
+
165
+ > ### config.moderateOptions
166
+ >
167
+ > ##### Type: `Array< {id: number, label: string} >`
168
+ >
169
+ > ##### Default:
170
+ ```js
171
+ moderateOptions = [
172
+ {id: 1, label: 'Sexual Content'},
173
+ {id: 2, label: 'Violent Or Repulsive'},
174
+ {id: 3, label: 'Harmful Or Dangerous Act'},
175
+ {id: 4, label: 'Spam / Commercials'}
176
+ ]
177
+ ```
178
+ >