@playkit-js/moderation 2.1.1 → 2.2.0-canary.2-223f8a4
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/CHANGELOG.md +7 -0
- package/LICENSE +5 -5
- package/README.md +105 -8
- package/dist/3758875b5327755db91c.svg +3 -0
- package/dist/4e88e84bb6cd6f386467.svg +9 -0
- package/{src/components/moderation/assets/down.svg → dist/699b282225ecacccffd9.svg} +2 -2
- package/dist/f4a8c73d84c247e719f8.svg +3 -0
- package/dist/playkit-moderation.js +1 -23
- package/dist/playkit-moderation.js.map +1 -1
- package/package.json +49 -54
- package/src/components/a11y-wrapper/a11y-wrapper.tsx +26 -0
- package/src/components/a11y-wrapper/index.ts +1 -0
- package/src/components/icons/index.ts +9 -0
- package/src/components/moderation/moderation.scss +25 -7
- package/src/components/moderation/moderation.tsx +64 -104
- package/src/components/plugin-button/plugin-button.scss +14 -14
- package/src/components/plugin-button/plugin-button.tsx +26 -3
- package/src/components/popover/index.ts +1 -0
- package/src/components/popover/popover-menu.scss +4 -0
- package/src/components/popover/popover-menu.tsx +57 -0
- package/src/components/popover/popover.scss +30 -0
- package/src/components/popover/popover.tsx +224 -0
- package/src/contrib-services/common-types.ts +2 -0
- package/src/contrib-services/contrib-services.ts +80 -0
- package/src/contrib-services/contrib-utils.ts +16 -0
- package/src/contrib-services/events-manager.ts +59 -0
- package/src/contrib-services/floating-item-data.tsx +31 -0
- package/src/contrib-services/floating-item.tsx +116 -0
- package/src/contrib-services/floating-manager.tsx +224 -0
- package/src/contrib-services/index.ts +2 -0
- package/src/contrib-services/injected-component/index.ts +1 -0
- package/src/contrib-services/injected-component/injected-component.scss +5 -0
- package/src/contrib-services/injected-component/injected-component.tsx +58 -0
- package/src/contrib-services/kaltura-player-utils.ts +18 -0
- package/src/contrib-services/managed-component/_managed-component.scss +8 -0
- package/src/contrib-services/managed-component/index.ts +1 -0
- package/src/contrib-services/managed-component/managed-component.tsx +71 -0
- package/src/contrib-services/object-utils.ts +157 -0
- package/src/contrib-services/player-contrib-registry.ts +34 -0
- package/src/contrib-services/player-utils.ts +37 -0
- package/src/contrib-services/preset-item-data.tsx +43 -0
- package/src/contrib-services/preset-item.tsx +113 -0
- package/src/contrib-services/preset-manager.tsx +153 -0
- package/src/contrib-services/presets-utils.ts +27 -0
- package/src/contrib-services/toast/_toast.scss +93 -0
- package/src/contrib-services/toast/assets/close.svg +9 -0
- package/src/contrib-services/toast/index.ts +1 -0
- package/src/contrib-services/toast/toast.tsx +67 -0
- package/src/contrib-services/toast-manager.tsx +121 -0
- package/src/contrib-services/toasts-container/_toasts-container.scss +21 -0
- package/src/contrib-services/toasts-container/index.ts +1 -0
- package/src/contrib-services/toasts-container/toasts-container.tsx +23 -0
- package/src/contrib-services/ui-player-adapter/index.tsx +1 -0
- package/src/contrib-services/ui-player-adapter/ui-player-adapter.tsx +27 -0
- package/src/contrib-services/uuid.ts +6 -0
- package/src/global.d.ts +6 -6
- package/src/index.ts +13 -1
- package/src/moderation-plugin.scss +12 -12
- package/src/moderation-plugin.tsx +123 -160
- package/src/providers/index.ts +2 -0
- package/src/providers/report-loader.ts +69 -0
- package/src/providers/response-types/index.ts +2 -0
- package/src/providers/response-types/kaltura-moderation-flag-response.ts +13 -0
- package/src/providers/response-types/kaltura-moderation-flag.ts +51 -0
- package/src/variables.scss +4 -1
- package/src/assets/.gitkeep +0 -0
- package/src/assets/close.svg +0 -10
- package/src/assets/flag.svg +0 -6
- package/src/components/.gitkeep +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.2-223f8a4](https://github.com/kaltura/playkit-js-moderation/compare/v2.1.1...v2.2.0-canary.2-223f8a4) (2022-07-12)
|
|
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
|
+
|
|
5
12
|
### [2.1.1](https://github.com/kaltura/playkit-js-moderation/compare/v2.0.11...v2.1.1) (2022-01-19)
|
|
6
13
|
|
|
7
14
|
### [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. <
|
|
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
|
|
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 <
|
|
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
|
-
<
|
|
661
|
+
<https://www.gnu.org/licenses/>.
|
package/README.md
CHANGED
|
@@ -1,12 +1,109 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PlayKit JS Moderation - plugin for the [PlayKit JS Player]
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
PlayKit JS Moderation is written in [ECMAScript6], statically analysed using [Typescript] and transpiled in ECMAScript5 using [Babel].
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
[typescript]: https://www.typescriptlang.org/
|
|
6
|
+
[ecmascript6]: https://github.com/ericdouglas/ES6-Learning#articles--tutorials
|
|
7
|
+
[babel]: https://babeljs.io
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
-
> this section will be added soon
|
|
9
|
+
## Getting Started
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
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](docs/configuration.md)**
|
|
68
|
+
|
|
69
|
+
## Running the tests
|
|
70
|
+
|
|
71
|
+
Tests can be run locally via [Karma], which will run on Chrome, Firefox and Safari
|
|
72
|
+
|
|
73
|
+
[karma]: https://karma-runner.github.io/1.0/index.html
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
yarn run test
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
You can test individual browsers:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
yarn run test:chrome
|
|
83
|
+
yarn run test:firefox
|
|
84
|
+
yarn run test:safari
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### And coding style tests
|
|
88
|
+
|
|
89
|
+
We use ESLint [recommended set](http://eslint.org/docs/rules/) with some additions for enforcing [Flow] types and other rules.
|
|
90
|
+
|
|
91
|
+
See [ESLint config](.eslintrc.json) for full configuration.
|
|
92
|
+
|
|
93
|
+
We also use [.editorconfig](.editorconfig) to maintain consistent coding styles and settings, please make sure you comply with the styling.
|
|
94
|
+
|
|
95
|
+
## Compatibility
|
|
96
|
+
|
|
97
|
+
TBD
|
|
98
|
+
|
|
99
|
+
## Contributing
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
## Versioning
|
|
104
|
+
|
|
105
|
+
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).
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
This project is licensed under the AGPL-3.0 License - see the [LICENSE.md](LICENSE.md) file for details
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
+
<path fill="#CCC" fill-rule="evenodd" d="M8 2c3.314 0 6 2.686 6 6s-2.686 6-6 6-6-2.686-6-6 2.686-6 6-6zm0 8c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1zm0-6c-.552 0-1 .444-1 1v3c0 .513.383.936.883.993L8 9c.552 0 1-.444 1-1V5c0-.513-.383-.936-.883-.993L8 4z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 57.1 (83088) - https://sketch.com -->
|
|
4
|
+
<title>Icons/16/Close</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<g id="Icons/16/Close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
+
<path d="M8.8497789,8 L11.824005,10.9742261 C12.058665,11.2088861 12.058665,11.5893451 11.824005,11.824005 C11.5893451,12.058665 11.2088861,12.058665 10.9742261,11.824005 L8,8.8497789 L5.02577387,11.824005 C4.7911139,12.058665 4.41065493,12.058665 4.17599497,11.824005 C3.94133501,11.5893451 3.94133501,11.2088861 4.17599497,10.9742261 L7.1502211,8 L4.17599497,5.02577387 C3.94133501,4.7911139 3.94133501,4.41065493 4.17599497,4.17599497 C4.41065493,3.94133501 4.7911139,3.94133501 5.02577387,4.17599497 L8,7.1502211 L10.9742261,4.17599497 C11.2088861,3.94133501 11.5893451,3.94133501 11.824005,4.17599497 C12.058665,4.41065493 12.058665,4.7911139 11.824005,5.02577387 L8.8497789,8 Z" id="Path" fill="#cccccc"></path>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
<title>Icons/16/Arrow/down</title>
|
|
5
5
|
<desc>Created with Sketch.</desc>
|
|
6
6
|
<g id="Icons/16/Arrow/down" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
-
<path d="M4.78325732,5.37830235 C4.43990319,4.94572127 3.81088342,4.87338855 3.37830235,5.21674268 C2.94572127,5.56009681 2.87338855,6.18911658 3.21674268,6.62169765 L7.21674268,11.6611718 C7.61710439,12.165575 8.38289561,12.165575 8.78325732,11.6611718 L12.7832573,6.62169765 C13.1266115,6.18911658 13.0542787,5.56009681 12.6216977,5.21674268 C12.1891166,4.87338855 11.5600968,4.94572127 11.2167427,5.37830235 L8,9.43097528 L4.78325732,5.37830235 Z" id="Path-2" fill="#
|
|
7
|
+
<path d="M4.78325732,5.37830235 C4.43990319,4.94572127 3.81088342,4.87338855 3.37830235,5.21674268 C2.94572127,5.56009681 2.87338855,6.18911658 3.21674268,6.62169765 L7.21674268,11.6611718 C7.61710439,12.165575 8.38289561,12.165575 8.78325732,11.6611718 L12.7832573,6.62169765 C13.1266115,6.18911658 13.0542787,5.56009681 12.6216977,5.21674268 C12.1891166,4.87338855 11.5600968,4.94572127 11.2167427,5.37830235 L8,9.43097528 L4.78325732,5.37830235 Z" id="Path-2" fill="#ffffff"></path>
|
|
8
8
|
</g>
|
|
9
|
-
</svg>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
+
<path fill="#CCC" fill-rule="evenodd" d="M3.292 1.488L6.69 14.172c.086.32-.076.646-.371.774l-.093.032c-.35.094-.712-.122-.805-.466L2.023 1.828c-.086-.32.076-.646.371-.774l.093-.032c.35-.094.712.122.805.466zm8.868-.055c1.233 0 1.832 1.065 1.208 2.127l-.91 1.55 1.93 2.132c.87.961.373 2.071-.923 2.071H6.76c-.297 0-.558-.2-.635-.486l-1.76-6.568c-.111-.417.203-.826.635-.826h7.16z"/>
|
|
3
|
+
</svg>
|