@midscene/visualizer 0.0.1

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 (92) hide show
  1. package/.eslintrc.js +9 -0
  2. package/README.md +24 -0
  3. package/dist/es/assets/logo-plain.16842bbc.svg +70 -0
  4. package/dist/es/assets/logo-plain2.16842bbc.svg +70 -0
  5. package/dist/es/component/blackboard.css +25 -0
  6. package/dist/es/component/blackboard.js +256 -0
  7. package/dist/es/component/color.js +34 -0
  8. package/dist/es/component/common.css +0 -0
  9. package/dist/es/component/detail-panel.css +34 -0
  10. package/dist/es/component/detail-panel.js +106 -0
  11. package/dist/es/component/detail-side.css +99 -0
  12. package/dist/es/component/detail-side.js +285 -0
  13. package/dist/es/component/global-hover-preview.css +19 -0
  14. package/dist/es/component/global-hover-preview.js +44 -0
  15. package/dist/es/component/misc.js +24 -0
  16. package/dist/es/component/panel-title.css +8 -0
  17. package/dist/es/component/panel-title.js +9 -0
  18. package/dist/es/component/side-item.js +0 -0
  19. package/dist/es/component/sidebar.css +87 -0
  20. package/dist/es/component/sidebar.js +175 -0
  21. package/dist/es/component/store.js +128 -0
  22. package/dist/es/component/timeline.css +18 -0
  23. package/dist/es/component/timeline.js +438 -0
  24. package/dist/es/index.css +89 -0
  25. package/dist/es/index.js +174 -0
  26. package/dist/es/utils.js +76 -0
  27. package/dist/lib/assets/logo-plain.16842bbc.svg +70 -0
  28. package/dist/lib/assets/logo-plain2.16842bbc.svg +70 -0
  29. package/dist/lib/component/blackboard.css +25 -0
  30. package/dist/lib/component/blackboard.js +286 -0
  31. package/dist/lib/component/color.js +59 -0
  32. package/dist/lib/component/common.css +0 -0
  33. package/dist/lib/component/detail-panel.css +34 -0
  34. package/dist/lib/component/detail-panel.js +136 -0
  35. package/dist/lib/component/detail-side.css +99 -0
  36. package/dist/lib/component/detail-side.js +313 -0
  37. package/dist/lib/component/global-hover-preview.css +19 -0
  38. package/dist/lib/component/global-hover-preview.js +64 -0
  39. package/dist/lib/component/misc.js +48 -0
  40. package/dist/lib/component/panel-title.css +8 -0
  41. package/dist/lib/component/panel-title.js +29 -0
  42. package/dist/lib/component/side-item.js +1 -0
  43. package/dist/lib/component/sidebar.css +87 -0
  44. package/dist/lib/component/sidebar.js +198 -0
  45. package/dist/lib/component/store.js +153 -0
  46. package/dist/lib/component/timeline.css +18 -0
  47. package/dist/lib/component/timeline.js +466 -0
  48. package/dist/lib/index.css +89 -0
  49. package/dist/lib/index.js +202 -0
  50. package/dist/lib/utils.js +111 -0
  51. package/dist/types/component/blackboard.d.ts +4 -0
  52. package/dist/types/component/color.d.ts +2 -0
  53. package/dist/types/component/detail-panel.d.ts +4 -0
  54. package/dist/types/component/detail-side.d.ts +4 -0
  55. package/dist/types/component/global-hover-preview.d.ts +4 -0
  56. package/dist/types/component/misc.d.ts +2 -0
  57. package/dist/types/component/panel-title.d.ts +6 -0
  58. package/dist/types/component/side-item.d.ts +0 -0
  59. package/dist/types/component/sidebar.d.ts +4 -0
  60. package/dist/types/component/store.d.ts +35 -0
  61. package/dist/types/component/timeline.d.ts +4 -0
  62. package/dist/types/index.d.ts +4 -0
  63. package/dist/types/utils.d.ts +5 -0
  64. package/docs/index.tsx +6 -0
  65. package/modern.config.ts +15 -0
  66. package/package.json +46 -0
  67. package/src/component/assets/logo-plain.svg +70 -0
  68. package/src/component/assets/logo-plain2.svg +70 -0
  69. package/src/component/blackboard.less +37 -0
  70. package/src/component/blackboard.tsx +293 -0
  71. package/src/component/color.tsx +34 -0
  72. package/src/component/common.less +21 -0
  73. package/src/component/detail-panel.less +47 -0
  74. package/src/component/detail-panel.tsx +124 -0
  75. package/src/component/detail-side.less +131 -0
  76. package/src/component/detail-side.tsx +361 -0
  77. package/src/component/global-hover-preview.less +23 -0
  78. package/src/component/global-hover-preview.tsx +50 -0
  79. package/src/component/misc.tsx +20 -0
  80. package/src/component/panel-title.less +11 -0
  81. package/src/component/panel-title.tsx +11 -0
  82. package/src/component/side-item.tsx +0 -0
  83. package/src/component/sidebar.less +122 -0
  84. package/src/component/sidebar.tsx +205 -0
  85. package/src/component/store.tsx +151 -0
  86. package/src/component/timeline.less +25 -0
  87. package/src/component/timeline.tsx +486 -0
  88. package/src/global.d.ts +11 -0
  89. package/src/index.less +113 -0
  90. package/src/index.tsx +210 -0
  91. package/src/utils.ts +58 -0
  92. package/tsconfig.json +24 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ root: true,
3
+ rules: {
4
+ '@typescript-eslint/no-explicit-any': 'warn',
5
+ '@typescript-eslint/no-magic-numbers': 'off',
6
+ '@typescript-eslint/no-parameter-properties': 'off',
7
+ },
8
+ extends: ['@modern-js'],
9
+ };
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # visualizer
2
+
3
+ ## Get Started
4
+
5
+ 按开发环境的要求,运行和调试项目
6
+
7
+ 运行和调试组件
8
+
9
+ ```
10
+ pnpm run dev
11
+ ```
12
+
13
+ 按照社区规范和最佳实践,生成构建产物
14
+
15
+ ```
16
+ pnpm run build
17
+ ```
18
+
19
+ 继续创建更多项目要素
20
+
21
+ ```
22
+ pnpm run new
23
+ ```
24
+
@@ -0,0 +1,70 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <!-- Creator: CorelDRAW 2019 (64-Bit) -->
4
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="141.563mm" height="53.8692mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
5
+ viewBox="0 0 16897.65 6430.11"
6
+ xmlns:xlink="http://www.w3.org/1999/xlink"
7
+ xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
8
+ <defs>
9
+ <style type="text/css">
10
+ <![CDATA[
11
+ .str0 {stroke:#E62129;stroke-width:23.87;stroke-miterlimit:22.9256}
12
+ .str1 {stroke:#06B1AB;stroke-width:9.1;stroke-miterlimit:22.9256}
13
+ .fil0 {fill:none}
14
+ .fil8 {fill:#FEFEFE}
15
+ .fil1 {fill:#332C2B}
16
+ .fil12 {fill:#F7B873}
17
+ .fil5 {fill:#F3A04E}
18
+ .fil9 {fill:#52C2F1}
19
+ .fil13 {fill:#06B1AB}
20
+ .fil2 {fill:#F63D55}
21
+ .fil11 {fill:#F9483E}
22
+ .fil6 {fill:url(#id0)}
23
+ .fil4 {fill:url(#id1)}
24
+ .fil10 {fill:url(#id2)}
25
+ .fil3 {fill:url(#id3)}
26
+ .fil7 {fill:url(#id4)}
27
+ ]]>
28
+ </style>
29
+ <linearGradient id="id0" gradientUnits="userSpaceOnUse" x1="11103.21" y1="5027.34" x2="10930.41" y2="1211.98">
30
+ <stop offset="0" style="stop-opacity:1; stop-color:#0A77D4"/>
31
+ <stop offset="1" style="stop-opacity:1; stop-color:#00B1E0"/>
32
+ </linearGradient>
33
+ <linearGradient id="id1" gradientUnits="userSpaceOnUse" xlink:href="#id0" x1="11407.32" y1="5023.83" x2="11286.4" y2="1215.5">
34
+ </linearGradient>
35
+ <linearGradient id="id2" gradientUnits="userSpaceOnUse" x1="6311.87" y1="4699.25" x2="3547.5" y2="1677.39">
36
+ <stop offset="0" style="stop-opacity:1; stop-color:#F65926"/>
37
+ <stop offset="1" style="stop-opacity:1; stop-color:#F0AB1F"/>
38
+ </linearGradient>
39
+ <linearGradient id="id3" gradientUnits="userSpaceOnUse" x1="3105.35" y1="5075.61" x2="2612.67" y2="1311.04">
40
+ <stop offset="0" style="stop-opacity:1; stop-color:#E52652"/>
41
+ <stop offset="1" style="stop-opacity:1; stop-color:#FF4956"/>
42
+ </linearGradient>
43
+ <linearGradient id="id4" gradientUnits="userSpaceOnUse" x1="14599.77" y1="4808.34" x2="12000" y2="1573.25">
44
+ <stop offset="0" style="stop-opacity:1; stop-color:#02C0A7"/>
45
+ <stop offset="1" style="stop-opacity:1; stop-color:#02E097"/>
46
+ </linearGradient>
47
+ </defs>
48
+ <g id="图层_x0020_1">
49
+ <metadata id="CorelCorpID_0Corel-Layer"/>
50
+ <g id="_1978240863120">
51
+ <path class="fil0 str0" d="M2921.92 814.37l2943.46 0c660.05,0 1200.11,540.04 1200.11,1200.11l0 669.56c-180.23,1562.84 -842.69,2686.31 -2539.2,2867.65l-656.9 0c-1403.42,-112.59 -2125.37,-923.3 -2147.58,-2450.77l0 -1086.44c0,-660.07 540.04,-1200.11 1200.11,-1200.11z"/>
52
+ <path class="fil1" d="M908.05 649.1c172.38,0 312.1,139.73 312.1,312.1 0,172.38 -139.73,312.1 -312.1,312.1 -172.38,0 -312.1,-139.73 -312.1,-312.1 0,-172.38 139.73,-312.1 312.1,-312.1zm15081.56 0c-172.38,0 -312.1,139.73 -312.1,312.1 0,172.38 139.73,312.1 312.1,312.1 172.38,0 312.1,-139.73 312.1,-312.1 0,-172.38 -139.73,-312.1 -312.1,-312.1zm315.15 -649.07l-4739.56 0c-332.34,-0.73 -635.61,30.83 -892.17,114.33 -1164.61,314.95 -1684.86,539.69 -2204.5,542.55 -529.24,2.92 -1057.71,-221.77 -2243.89,-542.55 -256.56,-83.5 -559.83,-115.06 -892.17,-114.33l-4739.56 0c-326.11,0 -592.9,266.79 -592.9,592.9l0 727.65c0,326.11 262.25,574.15 588.16,562.9 244.44,-8.44 379.43,161.6 368.56,407.41l0 1401.3c844.04,3884.05 6459.63,3705.54 6872.25,-983.68 37.55,-479.97 225.37,-745.7 619.85,-795.03 394.48,49.33 582.3,315.06 619.85,795.03 221.1,2512.67 1570.99,3564.6 3624.76,3705.62 1575.25,-121.99 2822.57,-766.6 3247.49,-2721.94l0 -1401.3c-10.86,-245.81 124.13,-415.84 368.56,-407.41 325.91,11.24 588.16,-236.8 588.16,-562.9l0 -727.65c0,-326.11 -266.79,-592.9 -592.9,-592.9z"/>
53
+ <path class="fil2" d="M4404.53 5551.69l138.96 0c1696.5,-181.34 2358.97,-1304.82 2539.2,-2867.65l0 -669.56c0,-660.07 -540.06,-1200.11 -1200.11,-1200.11l-2261.28 0 -682.18 0c-660.07,0 -1200.11,540.04 -1200.11,1200.11l0 1086.44c22.21,1527.47 744.16,2338.19 2147.58,2450.77l517.94 0z"/>
54
+ <path class="fil3" d="M2884.03 3833.6c-562.03,-552.91 337.59,-1229.84 756.52,-784.77l-668.1 -718.53c-248.45,-631.92 -96.85,-1153.5 631.64,-1515.94l-682.18 0c-660.07,0 -1200.11,540.04 -1200.11,1200.11l0 1086.44c22.21,1527.47 744.16,2338.19 2147.58,2450.77l517.94 0c447.09,-261.52 828.85,-610.16 1124.32,-1073.8 -192.91,108.48 -371.35,123.1 -530.58,12.63 -269.77,225.61 -533.22,868.1 -809.3,676.82l-1287.75 -1333.74z"/>
55
+ <path class="fil4" d="M12967.79 5585.01c1654.02,-184.97 2231.4,-1330.91 2306.7,-2925.01l-43.57 -682.94c-42.95,-673.27 -608.37,-1224.11 -1256.49,-1224.11l-2220.38 0 -669.84 0c-648.13,0 -1143.27,550.85 -1100.32,1224.11l70.69 1108.16c121.19,1558.01 882.83,2384.94 2268.19,2499.78l645.03 0z"/>
56
+ <circle class="fil5" cx="3266.42" cy="4767.17" r="119.53"/>
57
+ <path class="fil6 str1" d="M11243.45 3832.57c-587.85,-563.96 251.45,-1254.43 691.78,-800.45l-702.77 -732.9c-285.07,-644.56 -170.14,-1176.57 521.59,-1546.26l-669.84 0c-648.13,0 -1143.27,550.85 -1100.32,1224.11l70.69 1108.16c121.19,1558.01 882.83,2384.94 2268.19,2499.78l508.57 0c422,-266.75 774.17,-622.36 1034.13,-1095.27 -182.37,110.65 -356.62,125.56 -520.16,12.88 -250.21,230.12 -467.1,885.46 -750.63,690.36l-1351.23 -1360.42z"/>
58
+ <path class="fil7" d="M11754.05 752.96c-691.73,369.69 -806.66,901.7 -521.59,1546.26l702.77 732.9c-440.33,-453.98 -1279.63,236.49 -691.78,800.45 1571.66,1582.35 780.78,887.85 1587.88,1752.45l136.46 0c1654.02,-184.97 2231.4,-1330.91 2306.7,-2925.01l-43.57 -682.94c-42.95,-673.27 -608.37,-1224.11 -1256.49,-1224.11l-2220.38 0z"/>
59
+ <circle class="fil8" cx="13725.89" cy="2247.09" r="867.65"/>
60
+ <circle class="fil9" cx="11745.99" cy="4944.33" r="119.53"/>
61
+ <path class="fil10" d="M3604.1 814.37c-728.5,362.44 -880.09,884.02 -631.64,1515.94l668.1 718.53c-418.94,-445.08 -1318.56,231.85 -756.52,784.77l1503.3 1718.08 138.96 0c1696.5,-181.34 2358.97,-1304.82 2539.2,-2867.65l0 -669.56c0,-660.07 -540.06,-1200.11 -1200.11,-1200.11l-2261.28 0z"/>
62
+ <path class="fil11" d="M3602.42 3012.57l-2.01 -1.79 -1.22 -1c-433.3,-363.07 -1259.33,288.49 -715.16,823.82l1503.3 1718.08 138.96 0c366.16,-39.14 684.05,-122.25 959.42,-244.11l-1883.3 -2295z"/>
63
+ <circle class="fil8" cx="5652.09" cy="2247.09" r="867.65"/>
64
+ <circle class="fil12" cx="5669.32" cy="4261.82" r="86.65"/>
65
+ <circle class="fil8" cx="3775.08" cy="4120.55" r="174.77"/>
66
+ <path class="fil13" d="M11770.33 2919.17l123.64 74.69c7.2,5.99 14.32,12.27 21.35,18.8l1988.29 2318.88c-264.55,126.79 -574.49,213.07 -935.82,253.47l-136.46 0c-807.1,-864.6 -16.22,-170.1 -1587.88,-1752.45 -520.29,-499.15 77.34,-1097.23 526.88,-913.39z"/>
67
+ <circle class="fil8" cx="12254.65" cy="4297.71" r="174.77"/>
68
+ </g>
69
+ </g>
70
+ </svg>
@@ -0,0 +1,70 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <!-- Creator: CorelDRAW 2019 (64-Bit) -->
4
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="141.563mm" height="53.8692mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
5
+ viewBox="0 0 16897.65 6430.11"
6
+ xmlns:xlink="http://www.w3.org/1999/xlink"
7
+ xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
8
+ <defs>
9
+ <style type="text/css">
10
+ <![CDATA[
11
+ .str0 {stroke:#E62129;stroke-width:23.87;stroke-miterlimit:22.9256}
12
+ .str1 {stroke:#06B1AB;stroke-width:9.1;stroke-miterlimit:22.9256}
13
+ .fil0 {fill:none}
14
+ .fil8 {fill:#FEFEFE}
15
+ .fil1 {fill:#332C2B}
16
+ .fil12 {fill:#F7B873}
17
+ .fil5 {fill:#F3A04E}
18
+ .fil9 {fill:#52C2F1}
19
+ .fil13 {fill:#06B1AB}
20
+ .fil2 {fill:#F63D55}
21
+ .fil11 {fill:#F9483E}
22
+ .fil6 {fill:url(#id0)}
23
+ .fil4 {fill:url(#id1)}
24
+ .fil10 {fill:url(#id2)}
25
+ .fil3 {fill:url(#id3)}
26
+ .fil7 {fill:url(#id4)}
27
+ ]]>
28
+ </style>
29
+ <linearGradient id="id0" gradientUnits="userSpaceOnUse" x1="11103.21" y1="5027.34" x2="10930.41" y2="1211.98">
30
+ <stop offset="0" style="stop-opacity:1; stop-color:#0A77D4"/>
31
+ <stop offset="1" style="stop-opacity:1; stop-color:#00B1E0"/>
32
+ </linearGradient>
33
+ <linearGradient id="id1" gradientUnits="userSpaceOnUse" xlink:href="#id0" x1="11407.32" y1="5023.83" x2="11286.4" y2="1215.5">
34
+ </linearGradient>
35
+ <linearGradient id="id2" gradientUnits="userSpaceOnUse" x1="6311.87" y1="4699.25" x2="3547.5" y2="1677.39">
36
+ <stop offset="0" style="stop-opacity:1; stop-color:#F65926"/>
37
+ <stop offset="1" style="stop-opacity:1; stop-color:#F0AB1F"/>
38
+ </linearGradient>
39
+ <linearGradient id="id3" gradientUnits="userSpaceOnUse" x1="3105.35" y1="5075.61" x2="2612.67" y2="1311.04">
40
+ <stop offset="0" style="stop-opacity:1; stop-color:#E52652"/>
41
+ <stop offset="1" style="stop-opacity:1; stop-color:#FF4956"/>
42
+ </linearGradient>
43
+ <linearGradient id="id4" gradientUnits="userSpaceOnUse" x1="14599.77" y1="4808.34" x2="12000" y2="1573.25">
44
+ <stop offset="0" style="stop-opacity:1; stop-color:#02C0A7"/>
45
+ <stop offset="1" style="stop-opacity:1; stop-color:#02E097"/>
46
+ </linearGradient>
47
+ </defs>
48
+ <g id="图层_x0020_1">
49
+ <metadata id="CorelCorpID_0Corel-Layer"/>
50
+ <g id="_1978240863120">
51
+ <path class="fil0 str0" d="M2921.92 814.37l2943.46 0c660.05,0 1200.11,540.04 1200.11,1200.11l0 669.56c-180.23,1562.84 -842.69,2686.31 -2539.2,2867.65l-656.9 0c-1403.42,-112.59 -2125.37,-923.3 -2147.58,-2450.77l0 -1086.44c0,-660.07 540.04,-1200.11 1200.11,-1200.11z"/>
52
+ <path class="fil1" d="M908.05 649.1c172.38,0 312.1,139.73 312.1,312.1 0,172.38 -139.73,312.1 -312.1,312.1 -172.38,0 -312.1,-139.73 -312.1,-312.1 0,-172.38 139.73,-312.1 312.1,-312.1zm15081.56 0c-172.38,0 -312.1,139.73 -312.1,312.1 0,172.38 139.73,312.1 312.1,312.1 172.38,0 312.1,-139.73 312.1,-312.1 0,-172.38 -139.73,-312.1 -312.1,-312.1zm315.15 -649.07l-4739.56 0c-332.34,-0.73 -635.61,30.83 -892.17,114.33 -1164.61,314.95 -1684.86,539.69 -2204.5,542.55 -529.24,2.92 -1057.71,-221.77 -2243.89,-542.55 -256.56,-83.5 -559.83,-115.06 -892.17,-114.33l-4739.56 0c-326.11,0 -592.9,266.79 -592.9,592.9l0 727.65c0,326.11 262.25,574.15 588.16,562.9 244.44,-8.44 379.43,161.6 368.56,407.41l0 1401.3c844.04,3884.05 6459.63,3705.54 6872.25,-983.68 37.55,-479.97 225.37,-745.7 619.85,-795.03 394.48,49.33 582.3,315.06 619.85,795.03 221.1,2512.67 1570.99,3564.6 3624.76,3705.62 1575.25,-121.99 2822.57,-766.6 3247.49,-2721.94l0 -1401.3c-10.86,-245.81 124.13,-415.84 368.56,-407.41 325.91,11.24 588.16,-236.8 588.16,-562.9l0 -727.65c0,-326.11 -266.79,-592.9 -592.9,-592.9z"/>
53
+ <path class="fil2" d="M4404.53 5551.69l138.96 0c1696.5,-181.34 2358.97,-1304.82 2539.2,-2867.65l0 -669.56c0,-660.07 -540.06,-1200.11 -1200.11,-1200.11l-2261.28 0 -682.18 0c-660.07,0 -1200.11,540.04 -1200.11,1200.11l0 1086.44c22.21,1527.47 744.16,2338.19 2147.58,2450.77l517.94 0z"/>
54
+ <path class="fil3" d="M2884.03 3833.6c-562.03,-552.91 337.59,-1229.84 756.52,-784.77l-668.1 -718.53c-248.45,-631.92 -96.85,-1153.5 631.64,-1515.94l-682.18 0c-660.07,0 -1200.11,540.04 -1200.11,1200.11l0 1086.44c22.21,1527.47 744.16,2338.19 2147.58,2450.77l517.94 0c447.09,-261.52 828.85,-610.16 1124.32,-1073.8 -192.91,108.48 -371.35,123.1 -530.58,12.63 -269.77,225.61 -533.22,868.1 -809.3,676.82l-1287.75 -1333.74z"/>
55
+ <path class="fil4" d="M12967.79 5585.01c1654.02,-184.97 2231.4,-1330.91 2306.7,-2925.01l-43.57 -682.94c-42.95,-673.27 -608.37,-1224.11 -1256.49,-1224.11l-2220.38 0 -669.84 0c-648.13,0 -1143.27,550.85 -1100.32,1224.11l70.69 1108.16c121.19,1558.01 882.83,2384.94 2268.19,2499.78l645.03 0z"/>
56
+ <circle class="fil5" cx="3266.42" cy="4767.17" r="119.53"/>
57
+ <path class="fil6 str1" d="M11243.45 3832.57c-587.85,-563.96 251.45,-1254.43 691.78,-800.45l-702.77 -732.9c-285.07,-644.56 -170.14,-1176.57 521.59,-1546.26l-669.84 0c-648.13,0 -1143.27,550.85 -1100.32,1224.11l70.69 1108.16c121.19,1558.01 882.83,2384.94 2268.19,2499.78l508.57 0c422,-266.75 774.17,-622.36 1034.13,-1095.27 -182.37,110.65 -356.62,125.56 -520.16,12.88 -250.21,230.12 -467.1,885.46 -750.63,690.36l-1351.23 -1360.42z"/>
58
+ <path class="fil7" d="M11754.05 752.96c-691.73,369.69 -806.66,901.7 -521.59,1546.26l702.77 732.9c-440.33,-453.98 -1279.63,236.49 -691.78,800.45 1571.66,1582.35 780.78,887.85 1587.88,1752.45l136.46 0c1654.02,-184.97 2231.4,-1330.91 2306.7,-2925.01l-43.57 -682.94c-42.95,-673.27 -608.37,-1224.11 -1256.49,-1224.11l-2220.38 0z"/>
59
+ <circle class="fil8" cx="13725.89" cy="2247.09" r="867.65"/>
60
+ <circle class="fil9" cx="11745.99" cy="4944.33" r="119.53"/>
61
+ <path class="fil10" d="M3604.1 814.37c-728.5,362.44 -880.09,884.02 -631.64,1515.94l668.1 718.53c-418.94,-445.08 -1318.56,231.85 -756.52,784.77l1503.3 1718.08 138.96 0c1696.5,-181.34 2358.97,-1304.82 2539.2,-2867.65l0 -669.56c0,-660.07 -540.06,-1200.11 -1200.11,-1200.11l-2261.28 0z"/>
62
+ <path class="fil11" d="M3602.42 3012.57l-2.01 -1.79 -1.22 -1c-433.3,-363.07 -1259.33,288.49 -715.16,823.82l1503.3 1718.08 138.96 0c366.16,-39.14 684.05,-122.25 959.42,-244.11l-1883.3 -2295z"/>
63
+ <circle class="fil8" cx="5652.09" cy="2247.09" r="867.65"/>
64
+ <circle class="fil12" cx="5669.32" cy="4261.82" r="86.65"/>
65
+ <circle class="fil8" cx="3775.08" cy="4120.55" r="174.77"/>
66
+ <path class="fil13" d="M11770.33 2919.17l123.64 74.69c7.2,5.99 14.32,12.27 21.35,18.8l1988.29 2318.88c-264.55,126.79 -574.49,213.07 -935.82,253.47l-136.46 0c-807.1,-864.6 -16.22,-170.1 -1587.88,-1752.45 -520.29,-499.15 77.34,-1097.23 526.88,-913.39z"/>
67
+ <circle class="fil8" cx="12254.65" cy="4297.71" r="174.77"/>
68
+ </g>
69
+ </g>
70
+ </svg>
@@ -0,0 +1,25 @@
1
+ .blackboard .footer {
2
+ color: #aaa;
3
+ }
4
+ .blackboard ul {
5
+ padding-left: 0px;
6
+ }
7
+ .blackboard li {
8
+ list-style: none;
9
+ }
10
+ .blackboard .bottom-tip {
11
+ height: 30px;
12
+ }
13
+ .blackboard .bottom-tip-item {
14
+ max-width: 500px;
15
+ color: #AAA;
16
+ text-overflow: ellipsis;
17
+ word-wrap: break-word;
18
+ }
19
+ .blackboard-filter {
20
+ margin: 10px 0;
21
+ }
22
+ .blackboard-main-content canvas {
23
+ width: 100%;
24
+ border: 1px solid #888;
25
+ }
@@ -0,0 +1,256 @@
1
+ "use client";
2
+ var __async = (__this, __arguments, generator) => {
3
+ return new Promise((resolve, reject) => {
4
+ var fulfilled = (value) => {
5
+ try {
6
+ step(generator.next(value));
7
+ } catch (e) {
8
+ reject(e);
9
+ }
10
+ };
11
+ var rejected = (value) => {
12
+ try {
13
+ step(generator.throw(value));
14
+ } catch (e) {
15
+ reject(e);
16
+ }
17
+ };
18
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19
+ step((generator = generator.apply(__this, __arguments)).next());
20
+ });
21
+ };
22
+ import { jsx, jsxs } from "react/jsx-runtime";
23
+ import * as PIXI from "pixi.js";
24
+ import { useEffect, useMemo, useRef, useState } from "react";
25
+ import { Checkbox } from "antd";
26
+ import { highlightColorForType, colorForName } from "./color";
27
+ import "./blackboard.css";
28
+ import { useBlackboardPreference, useInsightDump } from "./store";
29
+ const itemFillAlpha = 0.3;
30
+ const bgOnAlpha = 0.8;
31
+ const bgOffAlpha = 0.3;
32
+ const noop = () => {
33
+ };
34
+ const BlackBoard = () => {
35
+ const dump = useInsightDump((store) => store.data);
36
+ const setHighlightSectionNames = useInsightDump((store) => store.setHighlightSectionNames);
37
+ const setHighlightElements = useInsightDump((store) => store.setHighlightElements);
38
+ const highlightSectionNames = useInsightDump((store) => store.highlightSectionNames);
39
+ const highlightElements = useInsightDump((store) => store.highlightElements);
40
+ const { context, matchedSection: sections, matchedElement: elements } = dump;
41
+ const { size, screenshotBase64 } = context;
42
+ const screenWidth = size.width;
43
+ const screenHeight = size.height;
44
+ const domRef = useRef(null);
45
+ const app = useMemo(() => new PIXI.Application(), []);
46
+ const [appInitialed, setAppInitialed] = useState(false);
47
+ const itemMarkContainer = useMemo(() => new PIXI.Container(), []);
48
+ const textContainer = useMemo(() => new PIXI.Container(), []);
49
+ const pixiBgRef = useRef();
50
+ const { bgVisible, setBgVisible, textsVisible, setTextsVisible } = useBlackboardPreference();
51
+ useEffect(() => {
52
+ Promise.resolve(
53
+ (() => __async(void 0, null, function* () {
54
+ if (!domRef.current || !screenWidth) {
55
+ return;
56
+ }
57
+ yield app.init({ width: screenWidth, height: screenHeight, background: 16777215 });
58
+ const canvasEl = domRef.current;
59
+ domRef.current.appendChild(app.canvas);
60
+ const { clientWidth } = domRef.current.parentElement;
61
+ const targetHeight = window.innerHeight * 0.7;
62
+ const viewportRatio = clientWidth / targetHeight;
63
+ if (screenWidth / screenHeight <= viewportRatio) {
64
+ const ratio = targetHeight / screenHeight;
65
+ canvasEl.style.width = `${Math.floor(screenWidth * ratio)}px`;
66
+ canvasEl.style.height = `${Math.floor(screenHeight * ratio)}px`;
67
+ }
68
+ app.stage.addChild(itemMarkContainer);
69
+ app.stage.addChild(textContainer);
70
+ setAppInitialed(true);
71
+ }))()
72
+ );
73
+ return () => {
74
+ console.log("will destroy");
75
+ app == null ? void 0 : app.destroy(true, { children: true, texture: true });
76
+ };
77
+ }, [app, screenWidth, screenHeight]);
78
+ useEffect(() => {
79
+ if (!appInitialed) {
80
+ return;
81
+ }
82
+ const img = new Image();
83
+ img.src = screenshotBase64;
84
+ img.onload = () => {
85
+ const screenshotTexture = PIXI.Texture.from(img);
86
+ const screenshotSprite = new PIXI.Sprite(screenshotTexture);
87
+ screenshotSprite.x = 0;
88
+ screenshotSprite.y = 0;
89
+ screenshotSprite.width = screenWidth;
90
+ screenshotSprite.height = screenHeight;
91
+ app.stage.addChildAt(screenshotSprite, 0);
92
+ pixiBgRef.current = screenshotSprite;
93
+ screenshotSprite.alpha = bgVisible ? bgOnAlpha : bgOffAlpha;
94
+ };
95
+ }, [app.stage, appInitialed]);
96
+ const rectMarkForItem = (rect, name, themeColor, alpha, onPointOver, onPointerOut) => {
97
+ const { left, top, width, height } = rect;
98
+ const graphics = new PIXI.Graphics();
99
+ graphics.beginFill(themeColor, alpha);
100
+ graphics.lineStyle(1, themeColor, 1);
101
+ graphics.drawRect(left, top, width, height);
102
+ graphics.endFill();
103
+ graphics.interactive = true;
104
+ graphics.on("pointerover", onPointOver);
105
+ graphics.on("pointerout", onPointerOut);
106
+ const nameFontSize = 18;
107
+ const texts = new PIXI.Text(name, {
108
+ fontSize: nameFontSize,
109
+ fill: 0
110
+ });
111
+ texts.x = left;
112
+ texts.y = Math.max(top - (nameFontSize + 4), 0);
113
+ return [graphics, texts];
114
+ };
115
+ const { highlightSectionRects, highlightElementRects } = useMemo(() => {
116
+ const highlightSectionRects2 = [];
117
+ const highlightElementRects2 = [];
118
+ itemMarkContainer.removeChildren();
119
+ textContainer.removeChildren();
120
+ sections.forEach((section) => {
121
+ const ifHighlight = highlightSectionNames.includes(section.name);
122
+ if (ifHighlight) {
123
+ highlightSectionRects2.push(section.rect);
124
+ }
125
+ const [graphics, texts] = rectMarkForItem(
126
+ section.rect,
127
+ section.name,
128
+ ifHighlight ? highlightColorForType("section") : colorForName("section", section.name),
129
+ ifHighlight ? 1 : itemFillAlpha,
130
+ () => {
131
+ setHighlightSectionNames([section.name]);
132
+ },
133
+ () => {
134
+ setHighlightSectionNames([]);
135
+ }
136
+ );
137
+ itemMarkContainer.addChild(graphics);
138
+ textContainer.addChild(texts);
139
+ });
140
+ highlightElements.forEach((element) => {
141
+ const { rect } = element;
142
+ highlightElementRects2.push(rect);
143
+ if (elements.includes(element)) {
144
+ return;
145
+ }
146
+ const [graphics, texts] = rectMarkForItem(rect, "", highlightColorForType("element"), 1, noop, noop);
147
+ itemMarkContainer.addChild(graphics);
148
+ textContainer.addChild(texts);
149
+ });
150
+ elements.forEach((element) => {
151
+ const { rect, content } = element;
152
+ const ifHighlight = highlightElements.includes(element);
153
+ const [graphics, texts] = rectMarkForItem(
154
+ rect,
155
+ content,
156
+ ifHighlight ? highlightColorForType("element") : colorForName("element", content),
157
+ ifHighlight ? 1 : itemFillAlpha,
158
+ () => {
159
+ setHighlightElements([element]);
160
+ },
161
+ () => {
162
+ setHighlightElements([]);
163
+ }
164
+ );
165
+ itemMarkContainer.addChild(graphics);
166
+ textContainer.addChild(texts);
167
+ });
168
+ sections.forEach((section) => {
169
+ const { content } = section;
170
+ const ifHighlight = highlightSectionNames.includes(section.name);
171
+ const sectionTheme = ifHighlight ? "#FFFFFF" : colorForName("section", section.name);
172
+ content.forEach((text) => {
173
+ const { content: content2, rect } = text;
174
+ const { left, top } = rect;
175
+ const style = new PIXI.TextStyle({
176
+ wordWrap: true,
177
+ wordWrapWidth: rect.width,
178
+ fontSize: 18,
179
+ fill: sectionTheme
180
+ });
181
+ const textElement = new PIXI.Text(content2, style);
182
+ textElement.x = left;
183
+ textElement.y = top;
184
+ textContainer.addChild(textElement);
185
+ const textBorder = new PIXI.Graphics();
186
+ textBorder.beginFill(11184810, 0.2);
187
+ textBorder.lineStyle(1, 0, 1);
188
+ textBorder.drawRect(left, top, rect.width, rect.height);
189
+ textBorder.endFill();
190
+ textContainer.addChild(textBorder);
191
+ });
192
+ });
193
+ textContainer.visible = textsVisible;
194
+ return {
195
+ highlightSectionRects: highlightSectionRects2,
196
+ highlightElementRects: highlightElementRects2
197
+ };
198
+ }, [
199
+ app,
200
+ appInitialed,
201
+ sections,
202
+ highlightSectionNames,
203
+ highlightElements
204
+ // bgVisible,
205
+ // textsVisible,
206
+ ]);
207
+ const onSetBg = (e) => {
208
+ setBgVisible(e.target.checked);
209
+ if (pixiBgRef.current) {
210
+ pixiBgRef.current.alpha = e.target.checked ? bgOnAlpha : bgOffAlpha;
211
+ }
212
+ };
213
+ const onSetTextsVisible = (e) => {
214
+ setTextsVisible(e.target.checked);
215
+ textContainer.visible = e.target.checked;
216
+ };
217
+ let bottomTipA = null;
218
+ if (highlightElementRects.length === 1) {
219
+ bottomTipA = /* @__PURE__ */ jsx("div", { className: "bottom-tip", children: /* @__PURE__ */ jsxs("div", { className: "bottom-tip-item", children: [
220
+ "Element: ",
221
+ JSON.stringify(highlightElementRects[0])
222
+ ] }) });
223
+ } else if (highlightElementRects.length > 1) {
224
+ bottomTipA = /* @__PURE__ */ jsx("div", { className: "bottom-tip", children: /* @__PURE__ */ jsxs("div", { className: "bottom-tip-item", children: [
225
+ "Element: ",
226
+ JSON.stringify(highlightElementRects)
227
+ ] }) });
228
+ }
229
+ let bottomTipB = null;
230
+ if (highlightSectionRects.length === 1) {
231
+ bottomTipB = /* @__PURE__ */ jsx("div", { className: "bottom-tip", children: /* @__PURE__ */ jsxs("div", { className: "bottom-tip-item", children: [
232
+ "Section: ",
233
+ JSON.stringify(highlightSectionRects[0])
234
+ ] }) });
235
+ } else if (highlightSectionRects.length > 1) {
236
+ bottomTipB = /* @__PURE__ */ jsx("div", { className: "bottom-tip", children: /* @__PURE__ */ jsxs("div", { className: "bottom-tip-item", children: [
237
+ "Sections: ",
238
+ JSON.stringify(highlightSectionRects)
239
+ ] }) });
240
+ }
241
+ return /* @__PURE__ */ jsxs("div", { className: "blackboard", children: [
242
+ /* @__PURE__ */ jsx("div", { className: "blackboard-main-content", style: { width: "100%" }, ref: domRef }),
243
+ /* @__PURE__ */ jsx("div", { className: "blackboard-filter", children: /* @__PURE__ */ jsxs("div", { className: "overlay-control", children: [
244
+ /* @__PURE__ */ jsx(Checkbox, { checked: bgVisible, onChange: onSetBg, children: "Screenshot" }),
245
+ /* @__PURE__ */ jsx(Checkbox, { checked: textsVisible, onChange: onSetTextsVisible, children: "Text Mark" })
246
+ ] }) }),
247
+ /* @__PURE__ */ jsxs("div", { className: "bottom-tip", children: [
248
+ bottomTipA,
249
+ bottomTipB
250
+ ] })
251
+ ] });
252
+ };
253
+ var blackboard_default = BlackBoard;
254
+ export {
255
+ blackboard_default as default
256
+ };
@@ -0,0 +1,34 @@
1
+ const sectionColor = ["#028391"];
2
+ const elementColor = ["#fb6107"];
3
+ const highlightColorForSection = "#01204E";
4
+ const highlightColorForElement = "#F56824";
5
+ function djb2Hash(str) {
6
+ if (!str) {
7
+ console.warn("djb2Hash: empty string");
8
+ str = "unnamed";
9
+ }
10
+ let hash = 5381;
11
+ for (let i = 0; i < str.length; i++) {
12
+ hash = (hash << 5) + hash + str.charCodeAt(i);
13
+ }
14
+ return hash >>> 0;
15
+ }
16
+ function colorForName(type, name) {
17
+ const hashNumber = djb2Hash(name);
18
+ if (type === "section") {
19
+ return sectionColor[hashNumber % sectionColor.length];
20
+ } else {
21
+ return elementColor[hashNumber % elementColor.length];
22
+ }
23
+ }
24
+ function highlightColorForType(type) {
25
+ if (type === "section") {
26
+ return highlightColorForSection;
27
+ } else {
28
+ return highlightColorForElement;
29
+ }
30
+ }
31
+ export {
32
+ colorForName,
33
+ highlightColorForType
34
+ };
File without changes
@@ -0,0 +1,34 @@
1
+ .detail-panel {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ padding: 10px;
6
+ background: #FFF;
7
+ }
8
+ .detail-panel .ant-segmented {
9
+ padding: 0;
10
+ }
11
+ .detail-panel .view-switcher {
12
+ margin-bottom: 10px;
13
+ flex-shrink: 0;
14
+ }
15
+ .detail-panel .detail-content {
16
+ box-sizing: border-box;
17
+ justify-content: center;
18
+ flex-direction: column;
19
+ display: flex;
20
+ flex-grow: 1;
21
+ }
22
+ .detail-panel .blackboard {
23
+ margin: 0 auto;
24
+ }
25
+ .detail-panel .screenshot-item {
26
+ margin-bottom: 10px;
27
+ }
28
+ .detail-panel .screenshot-item .screenshot-item-title {
29
+ margin-bottom: 5px;
30
+ }
31
+ .detail-panel .screenshot-item img {
32
+ border: 1px solid #888;
33
+ max-width: 100%;
34
+ }
@@ -0,0 +1,106 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import "./detail-panel.css";
4
+ import { Segmented, ConfigProvider } from "antd";
5
+ import { CameraOutlined, FileTextOutlined, ScheduleOutlined } from "@ant-design/icons";
6
+ import { useEffect, useState } from "react";
7
+ import BlackBoard from "./blackboard";
8
+ import { useExecutionDump, useInsightDump } from "./store";
9
+ import { timeStr, filterBase64Value } from "../utils";
10
+ const ScreenshotItem = (props) => {
11
+ return /* @__PURE__ */ jsxs("div", { className: "screenshot-item", children: [
12
+ /* @__PURE__ */ jsx("div", { className: "screenshot-item-title", children: props.time }),
13
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("img", { src: props.img }) })
14
+ ] });
15
+ };
16
+ const VIEW_TYPE_SCREENSHOT = "screenshot";
17
+ const VIEW_TYPE_JSON = "json";
18
+ const VIEW_TYPE_BLACKBOARD = "blackboard";
19
+ const DetailPanel = () => {
20
+ var _a;
21
+ const dumpId = useInsightDump((store) => store._loadId);
22
+ const blackboardViewAvailable = Boolean(dumpId);
23
+ const activeTask = useExecutionDump((store) => store.activeTask);
24
+ const [preferredViewType, setViewType] = useState(dumpId ? VIEW_TYPE_BLACKBOARD : VIEW_TYPE_SCREENSHOT);
25
+ const viewType = preferredViewType === VIEW_TYPE_BLACKBOARD && !dumpId ? VIEW_TYPE_SCREENSHOT : preferredViewType;
26
+ let content;
27
+ if (!activeTask) {
28
+ content = /* @__PURE__ */ jsx("div", { children: "please select a task" });
29
+ } else if (viewType === VIEW_TYPE_JSON) {
30
+ content = /* @__PURE__ */ jsx("div", { className: "json-content", children: filterBase64Value(JSON.stringify(activeTask, void 0, 2)) });
31
+ } else if (viewType === VIEW_TYPE_BLACKBOARD) {
32
+ if (dumpId) {
33
+ content = /* @__PURE__ */ jsx(BlackBoard, {}, `${dumpId}`);
34
+ } else {
35
+ content = /* @__PURE__ */ jsx("div", { children: "invalid view" });
36
+ }
37
+ } else if (viewType === VIEW_TYPE_SCREENSHOT) {
38
+ if ((_a = activeTask.recorder) == null ? void 0 : _a.length) {
39
+ content = /* @__PURE__ */ jsx("div", { children: activeTask.recorder.filter((item) => item.screenshot).map((item, index) => {
40
+ const fullTime = timeStr(item.ts);
41
+ const str = item.timing ? `${fullTime} / ${item.timing}` : fullTime;
42
+ return /* @__PURE__ */ jsx(ScreenshotItem, { time: str, img: item.screenshot }, index);
43
+ }) });
44
+ } else {
45
+ content = /* @__PURE__ */ jsx("div", { children: "no screenshot" });
46
+ }
47
+ }
48
+ useEffect(() => {
49
+ const handleKeyDown = (e) => {
50
+ if (e.key === "Tab") {
51
+ if (viewType === VIEW_TYPE_BLACKBOARD) {
52
+ setViewType(VIEW_TYPE_SCREENSHOT);
53
+ } else if (viewType === VIEW_TYPE_SCREENSHOT) {
54
+ setViewType(VIEW_TYPE_JSON);
55
+ } else {
56
+ setViewType(blackboardViewAvailable ? VIEW_TYPE_BLACKBOARD : VIEW_TYPE_SCREENSHOT);
57
+ }
58
+ e.preventDefault();
59
+ }
60
+ };
61
+ document.addEventListener("keydown", handleKeyDown);
62
+ return () => {
63
+ document.removeEventListener("keydown", handleKeyDown);
64
+ };
65
+ });
66
+ const options = [
67
+ { label: "Screenshots", value: VIEW_TYPE_SCREENSHOT, icon: /* @__PURE__ */ jsx(CameraOutlined, {}) },
68
+ { label: "JSON View", value: VIEW_TYPE_JSON, icon: /* @__PURE__ */ jsx(FileTextOutlined, {}) }
69
+ ];
70
+ if (blackboardViewAvailable) {
71
+ options.unshift({ label: "Visualization", value: VIEW_TYPE_BLACKBOARD, icon: /* @__PURE__ */ jsx(ScheduleOutlined, {}) });
72
+ }
73
+ return /* @__PURE__ */ jsxs("div", { className: "detail-panel", children: [
74
+ /* @__PURE__ */ jsx("div", { className: "view-switcher", children: /* @__PURE__ */ jsx(
75
+ ConfigProvider,
76
+ {
77
+ theme: {
78
+ components: {
79
+ Segmented: {
80
+ itemSelectedBg: "#D7D7D7",
81
+ itemSelectedColor: "#000000"
82
+ // itemHoverColor: '#ffffff',
83
+ // itemHoverBg: '#A3D6D2', // @sub-blue
84
+ /* 这里是你的组件 token */
85
+ }
86
+ }
87
+ },
88
+ children: /* @__PURE__ */ jsx(
89
+ Segmented,
90
+ {
91
+ options,
92
+ value: viewType,
93
+ onChange: (value) => {
94
+ setViewType(value);
95
+ }
96
+ }
97
+ )
98
+ }
99
+ ) }),
100
+ /* @__PURE__ */ jsx("div", { className: "detail-content", children: content })
101
+ ] });
102
+ };
103
+ var detail_panel_default = DetailPanel;
104
+ export {
105
+ detail_panel_default as default
106
+ };