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

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 (36) hide show
  1. package/lib/ctx/ctx.composition.js +3 -13
  2. package/lib/ctx/ctx.js +67 -71
  3. package/lib/i18n/index.d.ts +0 -12
  4. package/lib/i18n/strings.d.ts +0 -6
  5. package/lib/i18n/strings.js +0 -6
  6. package/lib/interface.d.ts +3 -16
  7. package/lib/ui/ui.js +25 -34
  8. package/lib/ui/useOfflineShownNotification.d.ts +1 -0
  9. package/lib/ui/useOfflineShownNotification.js +32 -0
  10. package/lib/ui/useOfflineShownNotification.test.js +98 -0
  11. package/lib/utils/ttt.js +5 -2
  12. package/lib/utils/ttt.notifyOfflineShown.test.js +30 -0
  13. package/lib/widgets/index.d.ts +0 -1
  14. package/lib/widgets/index.js +1 -2
  15. package/lib/widgets/recordVideo/recordVideo.js +36 -50
  16. package/lib/widgets/recordVideo/recordVideo.less +74 -17
  17. package/lib/widgets/screenshot/screenshot.js +66 -68
  18. package/lib/widgets/screenshot/screenshot.less +40 -1
  19. package/lib/widgets/videoBitKBP/videoBitKBP.js +29 -28
  20. package/lib/widgets/videoBitKBP/videoBitKBP.less +17 -14
  21. package/lib/widgets/videoBitKBP/videoBitKBP.test.js +76 -1
  22. package/lib/widgets/zoomTurntable/lensSkill.js +1 -4
  23. package/package.json +2 -2
  24. package/lib/ui/absoluteContent.d.ts +0 -2
  25. package/lib/ui/absoluteContent.js +0 -3
  26. package/lib/utils/captureResult.d.ts +0 -14
  27. package/lib/utils/captureResult.js +0 -70
  28. package/lib/utils/captureResult.test.js +0 -117
  29. package/lib/widgets/captureResult/captureResult.d.ts +0 -16
  30. package/lib/widgets/captureResult/captureResult.js +0 -85
  31. package/lib/widgets/captureResult/captureResult.less +0 -144
  32. package/lib/widgets/captureResult/captureResult.test.js +0 -80
  33. package/lib/widgets/captureResult/index.d.ts +0 -2
  34. package/lib/widgets/captureResult/index.js +0 -2
  35. /package/lib/{utils/captureResult.test.d.ts → ui/useOfflineShownNotification.test.d.ts} +0 -0
  36. /package/lib/{widgets/captureResult/captureResult.test.d.ts → utils/ttt.notifyOfflineShown.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 {};