@ray-js/ipc-player-integration 0.0.53-beta.9 → 0.0.55-beta.0

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 (42) hide show
  1. package/lib/ctx/ctx.composition.js +3 -13
  2. package/lib/ctx/ctx.js +32 -160
  3. package/lib/i18n/index.d.ts +0 -32
  4. package/lib/i18n/strings.d.ts +0 -16
  5. package/lib/i18n/strings.js +0 -16
  6. package/lib/interface.d.ts +4 -19
  7. package/lib/ui/ui.js +25 -75
  8. package/lib/utils/authorize/album.d.ts +1 -0
  9. package/lib/utils/authorize/album.js +39 -0
  10. package/lib/utils/authorize/album.test.js +82 -0
  11. package/lib/utils/ttt.d.ts +0 -26
  12. package/lib/utils/ttt.js +2 -109
  13. package/lib/widgets/index.d.ts +0 -1
  14. package/lib/widgets/index.js +1 -2
  15. package/lib/widgets/recordVideo/recordVideo.js +40 -50
  16. package/lib/widgets/recordVideo/recordVideo.less +74 -17
  17. package/lib/widgets/recordVideo/recordVideo.test.js +58 -0
  18. package/lib/widgets/resolution/resolution.js +1 -0
  19. package/lib/widgets/screenshot/screenshot.js +44 -97
  20. package/lib/widgets/screenshot/screenshot.less +40 -1
  21. package/lib/widgets/videoBitKBP/videoBitKBP.js +9 -38
  22. package/lib/widgets/videoBitKBP/videoBitKBP.less +0 -6
  23. package/package.json +2 -2
  24. package/lib/ctx/ctx.autoClarity.test.js +0 -150
  25. package/lib/ui/absoluteContent.d.ts +0 -2
  26. package/lib/ui/absoluteContent.js +0 -3
  27. package/lib/utils/captureResult.d.ts +0 -14
  28. package/lib/utils/captureResult.js +0 -70
  29. package/lib/utils/captureResult.test.js +0 -117
  30. package/lib/utils/ttt.autoClarity.test.d.ts +0 -1
  31. package/lib/utils/ttt.autoClarity.test.js +0 -75
  32. package/lib/widgets/captureResult/captureResult.d.ts +0 -16
  33. package/lib/widgets/captureResult/captureResult.js +0 -85
  34. package/lib/widgets/captureResult/captureResult.less +0 -144
  35. package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
  36. package/lib/widgets/captureResult/captureResult.test.js +0 -80
  37. package/lib/widgets/captureResult/index.d.ts +0 -2
  38. package/lib/widgets/captureResult/index.js +0 -2
  39. package/lib/widgets/videoBitKBP/videoBitKBP.test.d.ts +0 -1
  40. package/lib/widgets/videoBitKBP/videoBitKBP.test.js +0 -81
  41. /package/lib/{ctx/ctx.autoClarity.test.d.ts → utils/authorize/album.test.d.ts} +0 -0
  42. /package/lib/{utils/captureResult.test.d.ts → widgets/recordVideo/recordVideo.test.d.ts} +0 -0
@@ -1,80 +0,0 @@
1
- import React from 'react';
2
- import { renderToStaticMarkup } from 'react-dom/server';
3
- jest.mock('@ray-js/ray', () => {
4
- const React = require('react');
5
- return {
6
- Image: _ref => {
7
- let {
8
- className,
9
- src
10
- } = _ref;
11
- return /*#__PURE__*/React.createElement("img", {
12
- alt: "",
13
- className: className,
14
- src: src
15
- });
16
- },
17
- Text: _ref2 => {
18
- let {
19
- children,
20
- className
21
- } = _ref2;
22
- return /*#__PURE__*/React.createElement("span", {
23
- className: className
24
- }, children);
25
- },
26
- View: _ref3 => {
27
- let {
28
- children,
29
- className
30
- } = _ref3;
31
- return /*#__PURE__*/React.createElement("div", {
32
- className: className
33
- }, children);
34
- }
35
- };
36
- });
37
- jest.mock('../../i18n', () => ({
38
- __esModule: true,
39
- default: {
40
- getLang: key => key,
41
- formatString: (template, count) => `${template}:${count}`
42
- }
43
- }));
44
- jest.mock('./captureResult.less', () => ({}));
45
- const {
46
- CaptureResultToast
47
- } = require('./captureResult');
48
- const renderToast = count => renderToStaticMarkup(/*#__PURE__*/React.createElement(CaptureResultToast, {
49
- brandColor: "#ff592a",
50
- count: count,
51
- kind: "screenshot",
52
- onCheck: () => undefined,
53
- thumbnailPath: "thingfile://capture.jpg"
54
- }));
55
- const countClass = (markup, className) => [...markup.matchAll(/class="([^"]*)"/g)].filter(_ref4 => {
56
- let [, names] = _ref4;
57
- return names.split(/\s+/).includes(className);
58
- }).length;
59
- describe('CaptureResultToast', () => {
60
- it('keeps the single-item thumbnail unchanged', () => {
61
- const markup = renderToast(1);
62
- expect(countClass(markup, 'ipc-player-plugin-capture-result-backdrop')).toBe(0);
63
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image-front')).toBe(0);
64
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image')).toBe(1);
65
- });
66
- it('renders both backdrops for two captured items', () => {
67
- const markup = renderToast(2);
68
- expect(countClass(markup, 'ipc-player-plugin-capture-result-backdrop')).toBe(2);
69
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image-back')).toBe(1);
70
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image-middle')).toBe(1);
71
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image-front')).toBe(1);
72
- });
73
- it('caps the backdrop count at two', () => {
74
- const markup = renderToast(4);
75
- expect(countClass(markup, 'ipc-player-plugin-capture-result-backdrop')).toBe(2);
76
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image-back')).toBe(1);
77
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image-middle')).toBe(1);
78
- expect(countClass(markup, 'ipc-player-plugin-capture-result-image-front')).toBe(1);
79
- });
80
- });
@@ -1,2 +0,0 @@
1
- export * from './captureResult';
2
- export type { CaptureResultToastProps, CaptureKind } from './captureResult';
@@ -1,2 +0,0 @@
1
- export * from './captureResult';
2
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,81 +0,0 @@
1
- import React from 'react';
2
- import { renderToStaticMarkup } from 'react-dom/server';
3
- let mockStoreState;
4
- jest.mock('@ray-js/ray', () => ({
5
- View: _ref => {
6
- let {
7
- children,
8
- className
9
- } = _ref;
10
- return /*#__PURE__*/React.createElement("div", {
11
- className: className
12
- }, children);
13
- },
14
- Text: _ref2 => {
15
- let {
16
- children,
17
- className
18
- } = _ref2;
19
- return /*#__PURE__*/React.createElement("span", {
20
- className: className
21
- }, children);
22
- },
23
- usePageEvent: () => undefined
24
- }));
25
- jest.mock('@ray-js/ray-ipc-utils', () => ({
26
- getVideoBitrateKbps: jest.fn(),
27
- requestWifiSignal: jest.fn()
28
- }));
29
- jest.mock('@ray-js/ray-ipc-utils/lib/interface', () => ({
30
- ClarityType: {
31
- SS: 'SS',
32
- SD: 'SD',
33
- HD: 'HD',
34
- UD: 'UD',
35
- SSP: 'SSP',
36
- AUTO: 'AUTO',
37
- AUDIO: 'AUDIO'
38
- }
39
- }));
40
- jest.mock('../../ctx/store', () => ({
41
- useStore: () => mockStoreState
42
- }));
43
- jest.mock('../../i18n', () => ({
44
- __esModule: true,
45
- default: {
46
- getLang: key => key
47
- }
48
- }));
49
- jest.mock('./videoBitKBP.less', () => ({}));
50
- const {
51
- VideoBitKBP
52
- } = require('./videoBitKBP');
53
- const renderWidget = function (resolution, autoClarity) {
54
- let playState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
55
- mockStoreState = {
56
- resolution,
57
- autoClarity,
58
- playState
59
- };
60
- return renderToStaticMarkup(/*#__PURE__*/React.createElement(VideoBitKBP, {
61
- devId: 'device',
62
- playState: {},
63
- resolution: {},
64
- autoClarity: {},
65
- hideKbsMenu: true,
66
- hideSignalMenu: true
67
- }));
68
- };
69
- describe('VideoBitKBP auto clarity', () => {
70
- it('shows actual clarity independently of bitrate, signal and play state', () => {
71
- const markup = renderWidget('AUTO', 'HD', 2);
72
- expect(markup).toContain('ipc_player_resolution_HD');
73
- expect(markup).not.toContain('KB/S');
74
- });
75
- it('does not show clarity outside auto mode', () => {
76
- expect(renderWidget('SD', 'HD')).toBe('');
77
- });
78
- it('waits for the native clarity report in auto mode', () => {
79
- expect(renderWidget('AUTO', null)).toBe('');
80
- });
81
- });