@kylincloud/flamegraph 0.35.6

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 (267) hide show
  1. package/CHANGELOG.md +1211 -0
  2. package/LICENSE +202 -0
  3. package/README.md +251 -0
  4. package/dist/FlameGraph/FlameGraphComponent/CheckIcon.d.ts +2 -0
  5. package/dist/FlameGraph/FlameGraphComponent/CheckIcon.d.ts.map +1 -0
  6. package/dist/FlameGraph/FlameGraphComponent/ContextMenu.d.ts +17 -0
  7. package/dist/FlameGraph/FlameGraphComponent/ContextMenu.d.ts.map +1 -0
  8. package/dist/FlameGraph/FlameGraphComponent/ContextMenuHighlight.d.ts +14 -0
  9. package/dist/FlameGraph/FlameGraphComponent/ContextMenuHighlight.d.ts.map +1 -0
  10. package/dist/FlameGraph/FlameGraphComponent/DiffLegend.d.ts +9 -0
  11. package/dist/FlameGraph/FlameGraphComponent/DiffLegend.d.ts.map +1 -0
  12. package/dist/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.d.ts +8 -0
  13. package/dist/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.d.ts.map +1 -0
  14. package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts +96 -0
  15. package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts.map +1 -0
  16. package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts +27 -0
  17. package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts.map +1 -0
  18. package/dist/FlameGraph/FlameGraphComponent/GraphVizPane.d.ts +7 -0
  19. package/dist/FlameGraph/FlameGraphComponent/GraphVizPane.d.ts.map +1 -0
  20. package/dist/FlameGraph/FlameGraphComponent/Header.d.ts +12 -0
  21. package/dist/FlameGraph/FlameGraphComponent/Header.d.ts.map +1 -0
  22. package/dist/FlameGraph/FlameGraphComponent/Highlight.d.ts +18 -0
  23. package/dist/FlameGraph/FlameGraphComponent/Highlight.d.ts.map +1 -0
  24. package/dist/FlameGraph/FlameGraphComponent/LogoLink.d.ts +2 -0
  25. package/dist/FlameGraph/FlameGraphComponent/LogoLink.d.ts.map +1 -0
  26. package/dist/FlameGraph/FlameGraphComponent/color.d.ts +20 -0
  27. package/dist/FlameGraph/FlameGraphComponent/color.d.ts.map +1 -0
  28. package/dist/FlameGraph/FlameGraphComponent/colorPalette.d.ts +11 -0
  29. package/dist/FlameGraph/FlameGraphComponent/colorPalette.d.ts.map +1 -0
  30. package/dist/FlameGraph/FlameGraphComponent/constants.d.ts +6 -0
  31. package/dist/FlameGraph/FlameGraphComponent/constants.d.ts.map +1 -0
  32. package/dist/FlameGraph/FlameGraphComponent/index.d.ts +37 -0
  33. package/dist/FlameGraph/FlameGraphComponent/index.d.ts.map +1 -0
  34. package/dist/FlameGraph/FlameGraphComponent/murmur3.d.ts +2 -0
  35. package/dist/FlameGraph/FlameGraphComponent/murmur3.d.ts.map +1 -0
  36. package/dist/FlameGraph/FlameGraphComponent/testData.d.ts +53 -0
  37. package/dist/FlameGraph/FlameGraphComponent/testData.d.ts.map +1 -0
  38. package/dist/FlameGraph/FlameGraphComponent/utils.d.ts +6 -0
  39. package/dist/FlameGraph/FlameGraphComponent/utils.d.ts.map +1 -0
  40. package/dist/FlameGraph/FlameGraphComponent/viewTypes.d.ts +2 -0
  41. package/dist/FlameGraph/FlameGraphComponent/viewTypes.d.ts.map +1 -0
  42. package/dist/FlameGraph/FlameGraphRenderer.d.ts +86 -0
  43. package/dist/FlameGraph/FlameGraphRenderer.d.ts.map +1 -0
  44. package/dist/FlameGraph/decode.d.ts +27 -0
  45. package/dist/FlameGraph/decode.d.ts.map +1 -0
  46. package/dist/FlameGraph/normalize.d.ts +6 -0
  47. package/dist/FlameGraph/normalize.d.ts.map +1 -0
  48. package/dist/FlameGraph/uniqueness.d.ts +3 -0
  49. package/dist/FlameGraph/uniqueness.d.ts.map +1 -0
  50. package/dist/FlamegraphRenderer.d.ts +19 -0
  51. package/dist/FlamegraphRenderer.d.ts.map +1 -0
  52. package/dist/Icons.d.ts +9 -0
  53. package/dist/Icons.d.ts.map +1 -0
  54. package/dist/ProfilerTable.d.ts +21 -0
  55. package/dist/ProfilerTable.d.ts.map +1 -0
  56. package/dist/SharedQueryInput.d.ts +10 -0
  57. package/dist/SharedQueryInput.d.ts.map +1 -0
  58. package/dist/Toolbar.d.ts +31 -0
  59. package/dist/Toolbar.d.ts.map +1 -0
  60. package/dist/Tooltip/FlamegraphTooltip.d.ts +59 -0
  61. package/dist/Tooltip/FlamegraphTooltip.d.ts.map +1 -0
  62. package/dist/Tooltip/LeftClickIcon.d.ts +2 -0
  63. package/dist/Tooltip/LeftClickIcon.d.ts.map +1 -0
  64. package/dist/Tooltip/RightClickIcon.d.ts +2 -0
  65. package/dist/Tooltip/RightClickIcon.d.ts.map +1 -0
  66. package/dist/Tooltip/TableTooltip.d.ts +12 -0
  67. package/dist/Tooltip/TableTooltip.d.ts.map +1 -0
  68. package/dist/Tooltip/Tooltip.d.ts +29 -0
  69. package/dist/Tooltip/Tooltip.d.ts.map +1 -0
  70. package/dist/convert/convertJaegerTraceToProfile.d.ts +3 -0
  71. package/dist/convert/convertJaegerTraceToProfile.d.ts.map +1 -0
  72. package/dist/convert/diffTwoProfiles.d.ts +3 -0
  73. package/dist/convert/diffTwoProfiles.d.ts.map +1 -0
  74. package/dist/convert/flamebearersToTree.d.ts +11 -0
  75. package/dist/convert/flamebearersToTree.d.ts.map +1 -0
  76. package/dist/convert/sandwichViewProfiles.d.ts +14 -0
  77. package/dist/convert/sandwichViewProfiles.d.ts.map +1 -0
  78. package/dist/convert/subtract.d.ts +3 -0
  79. package/dist/convert/subtract.d.ts.map +1 -0
  80. package/dist/convert/testData.d.ts +50 -0
  81. package/dist/convert/testData.d.ts.map +1 -0
  82. package/dist/convert/toGraphviz.d.ts +3 -0
  83. package/dist/convert/toGraphviz.d.ts.map +1 -0
  84. package/dist/fitMode/fitMode.d.ts +42 -0
  85. package/dist/fitMode/fitMode.d.ts.map +1 -0
  86. package/dist/format/format.d.ts +42 -0
  87. package/dist/format/format.d.ts.map +1 -0
  88. package/dist/i18n.d.ts +55 -0
  89. package/dist/i18n.d.ts.map +1 -0
  90. package/dist/index.cjs.css +792 -0
  91. package/dist/index.cjs.js +5087 -0
  92. package/dist/index.d.ts +4 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.esm.css +792 -0
  95. package/dist/index.esm.js +5079 -0
  96. package/dist/index.node.d.ts +9 -0
  97. package/dist/index.node.d.ts.map +1 -0
  98. package/dist/logo-v3-small-T5VXIMRR.svg +32 -0
  99. package/dist/models/decode.d.ts +3 -0
  100. package/dist/models/decode.d.ts.map +1 -0
  101. package/dist/models/flamebearer.d.ts +63 -0
  102. package/dist/models/flamebearer.d.ts.map +1 -0
  103. package/dist/models/groups.d.ts +37 -0
  104. package/dist/models/groups.d.ts.map +1 -0
  105. package/dist/models/index.d.ts +8 -0
  106. package/dist/models/index.d.ts.map +1 -0
  107. package/dist/models/profile.d.ts +152 -0
  108. package/dist/models/profile.d.ts.map +1 -0
  109. package/dist/models/spyName.d.ts +8 -0
  110. package/dist/models/spyName.d.ts.map +1 -0
  111. package/dist/models/trace.d.ts +357 -0
  112. package/dist/models/trace.d.ts.map +1 -0
  113. package/dist/models/units.d.ts +6 -0
  114. package/dist/models/units.d.ts.map +1 -0
  115. package/dist/search.d.ts +2 -0
  116. package/dist/search.d.ts.map +1 -0
  117. package/dist/shims/Box.d.ts +38 -0
  118. package/dist/shims/Box.d.ts.map +1 -0
  119. package/dist/shims/Button.d.ts +26 -0
  120. package/dist/shims/Button.d.ts.map +1 -0
  121. package/dist/shims/Dropdown.d.ts +30 -0
  122. package/dist/shims/Dropdown.d.ts.map +1 -0
  123. package/dist/shims/Input.d.ts +19 -0
  124. package/dist/shims/Input.d.ts.map +1 -0
  125. package/dist/shims/LoadingSpinner.d.ts +7 -0
  126. package/dist/shims/LoadingSpinner.d.ts.map +1 -0
  127. package/dist/shims/Menu.d.ts +4 -0
  128. package/dist/shims/Menu.d.ts.map +1 -0
  129. package/dist/shims/NoData.d.ts +2 -0
  130. package/dist/shims/NoData.d.ts.map +1 -0
  131. package/dist/shims/Table.d.ts +52 -0
  132. package/dist/shims/Table.d.ts.map +1 -0
  133. package/dist/shims/Tooltip.d.ts +9 -0
  134. package/dist/shims/Tooltip.d.ts.map +1 -0
  135. package/package.json +84 -0
  136. package/src/FlameGraph/FlameGraphComponent/CheckIcon.tsx +27 -0
  137. package/src/FlameGraph/FlameGraphComponent/ContextMenu.module.scss +10 -0
  138. package/src/FlameGraph/FlameGraphComponent/ContextMenu.spec.tsx +84 -0
  139. package/src/FlameGraph/FlameGraphComponent/ContextMenu.tsx +86 -0
  140. package/src/FlameGraph/FlameGraphComponent/ContextMenuHighlight.module.css +8 -0
  141. package/src/FlameGraph/FlameGraphComponent/ContextMenuHighlight.tsx +47 -0
  142. package/src/FlameGraph/FlameGraphComponent/DiffLegend.module.css +21 -0
  143. package/src/FlameGraph/FlameGraphComponent/DiffLegend.tsx +52 -0
  144. package/src/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.module.css +40 -0
  145. package/src/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.tsx +129 -0
  146. package/src/FlameGraph/FlameGraphComponent/Flamegraph.spec.ts +552 -0
  147. package/src/FlameGraph/FlameGraphComponent/Flamegraph.ts +446 -0
  148. package/src/FlameGraph/FlameGraphComponent/Flamegraph_render.spec.tsx +233 -0
  149. package/src/FlameGraph/FlameGraphComponent/Flamegraph_render.ts +478 -0
  150. package/src/FlameGraph/FlameGraphComponent/GraphVizPane.tsx +56 -0
  151. package/src/FlameGraph/FlameGraphComponent/GraphVizPanel.module.scss +55 -0
  152. package/src/FlameGraph/FlameGraphComponent/Header.module.css +27 -0
  153. package/src/FlameGraph/FlameGraphComponent/Header.tsx +71 -0
  154. package/src/FlameGraph/FlameGraphComponent/Highlight.module.css +7 -0
  155. package/src/FlameGraph/FlameGraphComponent/Highlight.spec.tsx +53 -0
  156. package/src/FlameGraph/FlameGraphComponent/Highlight.tsx +94 -0
  157. package/src/FlameGraph/FlameGraphComponent/LogoLink.module.scss +10 -0
  158. package/src/FlameGraph/FlameGraphComponent/LogoLink.tsx +101 -0
  159. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-collapses-small-blocks-into-one-1-snap.png +0 -0
  160. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-diff-mode-1-snap.png +0 -0
  161. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-highlighted-flamegraph-1-snap.png +0 -0
  162. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-normal-flamegraph-1-snap.png +0 -0
  163. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-selected-node-1-snap.png +0 -0
  164. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-also-zooms-1-snap.png +0 -0
  165. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-in-the-beginning-1-snap.png +0 -0
  166. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-when-node-is-not-in-the-beginning-1-snap.png +0 -0
  167. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-zoom-top-level-1-snap.png +0 -0
  168. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-complex-flamegraph-1-snap.png +0 -0
  169. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-double-diff-flamegraph-1-snap.png +0 -0
  170. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-highlighted-double-flamegraph-1-snap.png +0 -0
  171. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-highlighted-flamegraph-1-snap.png +0 -0
  172. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-simple-flamegraph-1-snap.png +0 -0
  173. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-simple-tree-1-snap.png +0 -0
  174. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-zoomed-flamegraph-1-snap.png +0 -0
  175. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-zoomed-with-fit-mode-tail-1-snap.png +0 -0
  176. package/src/FlameGraph/FlameGraphComponent/canvas.module.css +6 -0
  177. package/src/FlameGraph/FlameGraphComponent/color.spec.ts +308 -0
  178. package/src/FlameGraph/FlameGraphComponent/color.ts +167 -0
  179. package/src/FlameGraph/FlameGraphComponent/colorPalette.ts +58 -0
  180. package/src/FlameGraph/FlameGraphComponent/constants.ts +5 -0
  181. package/src/FlameGraph/FlameGraphComponent/index.spec.tsx +291 -0
  182. package/src/FlameGraph/FlameGraphComponent/index.tsx +411 -0
  183. package/src/FlameGraph/FlameGraphComponent/murmur3.ts +97 -0
  184. package/src/FlameGraph/FlameGraphComponent/styles.module.scss +10 -0
  185. package/src/FlameGraph/FlameGraphComponent/testData.ts +427 -0
  186. package/src/FlameGraph/FlameGraphComponent/utils.ts +31 -0
  187. package/src/FlameGraph/FlameGraphComponent/viewTypes.ts +6 -0
  188. package/src/FlameGraph/FlameGraphRenderer.tsx +603 -0
  189. package/src/FlameGraph/FlamegraphRenderer.module.scss +93 -0
  190. package/src/FlameGraph/decode.ts +78 -0
  191. package/src/FlameGraph/normalize.spec.ts +76 -0
  192. package/src/FlameGraph/normalize.ts +60 -0
  193. package/src/FlameGraph/testData.json +423 -0
  194. package/src/FlameGraph/uniqueness.spec.ts +16 -0
  195. package/src/FlameGraph/uniqueness.ts +84 -0
  196. package/src/FlamegraphRenderer.tsx +61 -0
  197. package/src/Icons.tsx +74 -0
  198. package/src/ProfilerTable.tsx +527 -0
  199. package/src/SharedQueryInput.module.scss +82 -0
  200. package/src/SharedQueryInput.tsx +127 -0
  201. package/src/Toolbar.module.scss +117 -0
  202. package/src/Toolbar.spec.tsx +217 -0
  203. package/src/Toolbar.tsx +471 -0
  204. package/src/Tooltip/FlamegraphTooltip.spec.tsx +81 -0
  205. package/src/Tooltip/FlamegraphTooltip.tsx +257 -0
  206. package/src/Tooltip/LeftClickIcon.tsx +18 -0
  207. package/src/Tooltip/RightClickIcon.tsx +18 -0
  208. package/src/Tooltip/TableTooltip.spec.tsx +44 -0
  209. package/src/Tooltip/TableTooltip.tsx +145 -0
  210. package/src/Tooltip/Tooltip.module.scss +71 -0
  211. package/src/Tooltip/Tooltip.spec.tsx +395 -0
  212. package/src/Tooltip/Tooltip.tsx +336 -0
  213. package/src/__snapshots__/Toolbar.spec.tsx.snap +297 -0
  214. package/src/convert/convertJaegerTraceToProfile.ts +97 -0
  215. package/src/convert/diffTwoProfiles.ts +81 -0
  216. package/src/convert/flamebearersToTree.ts +78 -0
  217. package/src/convert/sandwichViewProfiles.spec.ts +65 -0
  218. package/src/convert/sandwichViewProfiles.ts +191 -0
  219. package/src/convert/subtract.ts +87 -0
  220. package/src/convert/testData.ts +145 -0
  221. package/src/convert/toGraphviz.ts +485 -0
  222. package/src/fitMode/fitMode.spec.ts +93 -0
  223. package/src/fitMode/fitMode.ts +122 -0
  224. package/src/format/format.spec.ts +291 -0
  225. package/src/format/format.ts +303 -0
  226. package/src/globals.d.ts +13 -0
  227. package/src/i18n.tsx +293 -0
  228. package/src/index.node.ts +19 -0
  229. package/src/index.spec.tsx +383 -0
  230. package/src/index.tsx +10 -0
  231. package/src/logo-v3-small.svg +32 -0
  232. package/src/models/decode.ts +45 -0
  233. package/src/models/flamebearer.ts +86 -0
  234. package/src/models/groups.ts +14 -0
  235. package/src/models/index.ts +7 -0
  236. package/src/models/profile.spec.ts +32 -0
  237. package/src/models/profile.ts +48 -0
  238. package/src/models/spyName.spec.ts +18 -0
  239. package/src/models/spyName.ts +32 -0
  240. package/src/models/trace.ts +45 -0
  241. package/src/models/units.spec.ts +21 -0
  242. package/src/models/units.ts +24 -0
  243. package/src/sass/_common.scss +206 -0
  244. package/src/sass/_css-variables.scss +201 -0
  245. package/src/sass/_mixins.scss +15 -0
  246. package/src/sass/_sanitize.scss +407 -0
  247. package/src/sass/_variables.scss +53 -0
  248. package/src/sass/flamegraph.scss +18 -0
  249. package/src/search.spec.ts +11 -0
  250. package/src/search.ts +4 -0
  251. package/src/shameful-any.d.ts +2 -0
  252. package/src/shims/Box.module.scss +57 -0
  253. package/src/shims/Box.tsx +105 -0
  254. package/src/shims/Button.module.scss +129 -0
  255. package/src/shims/Button.tsx +128 -0
  256. package/src/shims/Dropdown.module.scss +63 -0
  257. package/src/shims/Dropdown.tsx +96 -0
  258. package/src/shims/Input.module.scss +15 -0
  259. package/src/shims/Input.tsx +55 -0
  260. package/src/shims/LoadingSpinner.tsx +19 -0
  261. package/src/shims/Menu.tsx +9 -0
  262. package/src/shims/NoData.module.scss +6 -0
  263. package/src/shims/NoData.tsx +11 -0
  264. package/src/shims/Table.module.scss +82 -0
  265. package/src/shims/Table.spec.tsx +121 -0
  266. package/src/shims/Table.tsx +252 -0
  267. package/src/shims/Tooltip.tsx +51 -0
@@ -0,0 +1,407 @@
1
+ // ==========================================================================
2
+ // Sanitize - CSS Reset & Normalize (合并自 sanitize.css)
3
+ // ==========================================================================
4
+
5
+ // --------------------------------------------------------------------------
6
+ // Document
7
+ // --------------------------------------------------------------------------
8
+
9
+ // Add border box sizing in all browsers (opinionated).
10
+ *,
11
+ ::before,
12
+ ::after {
13
+ box-sizing: border-box;
14
+ }
15
+
16
+ // 1. Add text decoration inheritance in all browsers (opinionated).
17
+ // 2. Add vertical alignment inheritance in all browsers (opinionated).
18
+ ::before,
19
+ ::after {
20
+ text-decoration: inherit;
21
+ vertical-align: inherit;
22
+ }
23
+
24
+ // 1. Use the default cursor in all browsers (opinionated).
25
+ // 2. Change the line height in all browsers (opinionated).
26
+ // 3. Use a 4-space tab width in all browsers (opinionated).
27
+ // 4. Remove the grey highlight on links in iOS (opinionated).
28
+ // 5. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
29
+ // 6. Breaks words to prevent overflow in all browsers (opinionated).
30
+ html {
31
+ cursor: default;
32
+ line-height: 1.5;
33
+ -moz-tab-size: 4;
34
+ tab-size: 4;
35
+ -webkit-tap-highlight-color: transparent;
36
+ -ms-text-size-adjust: 100%;
37
+ -webkit-text-size-adjust: 100%;
38
+ word-break: break-word;
39
+ }
40
+
41
+ // --------------------------------------------------------------------------
42
+ // Sections
43
+ // --------------------------------------------------------------------------
44
+
45
+ body {
46
+ margin: 0;
47
+ }
48
+
49
+ h1 {
50
+ font-size: 2em;
51
+ margin: 0.67em 0;
52
+ }
53
+
54
+ // --------------------------------------------------------------------------
55
+ // Grouping content
56
+ // --------------------------------------------------------------------------
57
+
58
+ // Remove the margin on nested lists
59
+ dl dl, dl ol, dl ul,
60
+ ol dl, ul dl,
61
+ ol ol, ol ul,
62
+ ul ol, ul ul {
63
+ margin: 0;
64
+ }
65
+
66
+ hr {
67
+ height: 0;
68
+ overflow: visible;
69
+ }
70
+
71
+ main {
72
+ display: block;
73
+ }
74
+
75
+ nav ol,
76
+ nav ul {
77
+ list-style: none;
78
+ padding: 0;
79
+ }
80
+
81
+ pre {
82
+ font-family: monospace, monospace;
83
+ font-size: 1em;
84
+ }
85
+
86
+ // --------------------------------------------------------------------------
87
+ // Text-level semantics
88
+ // --------------------------------------------------------------------------
89
+
90
+ a {
91
+ background-color: transparent;
92
+ }
93
+
94
+ abbr[title] {
95
+ text-decoration: underline;
96
+ text-decoration: underline dotted;
97
+ }
98
+
99
+ b,
100
+ strong {
101
+ font-weight: bolder;
102
+ }
103
+
104
+ code,
105
+ kbd,
106
+ samp {
107
+ font-family: monospace, monospace;
108
+ font-size: 1em;
109
+ }
110
+
111
+ small {
112
+ font-size: 80%;
113
+ }
114
+
115
+ // --------------------------------------------------------------------------
116
+ // Embedded content
117
+ // --------------------------------------------------------------------------
118
+
119
+ audio,
120
+ canvas,
121
+ iframe,
122
+ img,
123
+ svg,
124
+ video {
125
+ vertical-align: middle;
126
+ }
127
+
128
+ audio,
129
+ video {
130
+ display: inline-block;
131
+ }
132
+
133
+ audio:not([controls]) {
134
+ display: none;
135
+ height: 0;
136
+ }
137
+
138
+ iframe {
139
+ border-style: none;
140
+ }
141
+
142
+ img {
143
+ border-style: none;
144
+ }
145
+
146
+ svg:not([fill]) {
147
+ fill: currentColor;
148
+ }
149
+
150
+ svg:not(:root) {
151
+ overflow: hidden;
152
+ }
153
+
154
+ // --------------------------------------------------------------------------
155
+ // Tabular data
156
+ // --------------------------------------------------------------------------
157
+
158
+ table {
159
+ border-collapse: collapse;
160
+ }
161
+
162
+ // --------------------------------------------------------------------------
163
+ // Forms
164
+ // --------------------------------------------------------------------------
165
+
166
+ button,
167
+ input,
168
+ select {
169
+ margin: 0;
170
+ }
171
+
172
+ button {
173
+ overflow: visible;
174
+ text-transform: none;
175
+ }
176
+
177
+ button,
178
+ [type='button'],
179
+ [type='reset'],
180
+ [type='submit'] {
181
+ -webkit-appearance: button;
182
+ }
183
+
184
+ fieldset {
185
+ border: 1px solid #a0a0a0;
186
+ padding: 0.35em 0.75em 0.625em;
187
+ }
188
+
189
+ input {
190
+ overflow: visible;
191
+ }
192
+
193
+ legend {
194
+ color: inherit;
195
+ display: table;
196
+ max-width: 100%;
197
+ white-space: normal;
198
+ }
199
+
200
+ progress {
201
+ display: inline-block;
202
+ vertical-align: baseline;
203
+ }
204
+
205
+ select {
206
+ text-transform: none;
207
+ }
208
+
209
+ textarea {
210
+ margin: 0;
211
+ overflow: auto;
212
+ resize: vertical;
213
+ }
214
+
215
+ [type='checkbox'],
216
+ [type='radio'] {
217
+ padding: 0;
218
+ }
219
+
220
+ [type='search'] {
221
+ -webkit-appearance: textfield;
222
+ outline-offset: -2px;
223
+ }
224
+
225
+ ::-webkit-inner-spin-button,
226
+ ::-webkit-outer-spin-button {
227
+ height: auto;
228
+ }
229
+
230
+ ::-webkit-input-placeholder {
231
+ color: inherit;
232
+ opacity: 0.54;
233
+ }
234
+
235
+ ::-webkit-search-decoration {
236
+ -webkit-appearance: none;
237
+ }
238
+
239
+ ::-webkit-file-upload-button {
240
+ -webkit-appearance: button;
241
+ font: inherit;
242
+ }
243
+
244
+ ::-moz-focus-inner {
245
+ border-style: none;
246
+ padding: 0;
247
+ }
248
+
249
+ :-moz-focusring {
250
+ outline: 1px dotted ButtonText;
251
+ }
252
+
253
+ :-moz-ui-invalid {
254
+ box-shadow: none;
255
+ }
256
+
257
+ // --------------------------------------------------------------------------
258
+ // Forms - Enhanced (from forms.css)
259
+ // --------------------------------------------------------------------------
260
+
261
+ button,
262
+ input,
263
+ select,
264
+ textarea {
265
+ background-color: transparent;
266
+ border: 1px solid WindowFrame;
267
+ color: inherit;
268
+ font: inherit;
269
+ letter-spacing: inherit;
270
+ padding: 0.25em 0.375em;
271
+ }
272
+
273
+ select {
274
+ -moz-appearance: none;
275
+ -webkit-appearance: none;
276
+ background: no-repeat right center / 1em;
277
+ border-radius: 0;
278
+ padding-right: 1em;
279
+ }
280
+
281
+ select:not([multiple]):not([size]) {
282
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E");
283
+ }
284
+
285
+ ::-ms-expand {
286
+ display: none;
287
+ }
288
+
289
+ :-ms-input-placeholder {
290
+ color: rgba(0, 0, 0, 0.54);
291
+ }
292
+
293
+ // --------------------------------------------------------------------------
294
+ // Interactive
295
+ // --------------------------------------------------------------------------
296
+
297
+ details {
298
+ display: block;
299
+ }
300
+
301
+ dialog {
302
+ background-color: white;
303
+ border: solid;
304
+ color: black;
305
+ display: block;
306
+ height: fit-content;
307
+ left: 0;
308
+ margin: auto;
309
+ padding: 1em;
310
+ position: absolute;
311
+ right: 0;
312
+ width: fit-content;
313
+ }
314
+
315
+ dialog:not([open]) {
316
+ display: none;
317
+ }
318
+
319
+ summary {
320
+ display: list-item;
321
+ }
322
+
323
+ // --------------------------------------------------------------------------
324
+ // Scripting
325
+ // --------------------------------------------------------------------------
326
+
327
+ canvas {
328
+ display: inline-block;
329
+ }
330
+
331
+ template {
332
+ display: none;
333
+ }
334
+
335
+ // --------------------------------------------------------------------------
336
+ // User interaction
337
+ // --------------------------------------------------------------------------
338
+
339
+ a,
340
+ area,
341
+ button,
342
+ input,
343
+ label,
344
+ select,
345
+ summary,
346
+ textarea,
347
+ [tabindex] {
348
+ -ms-touch-action: manipulation;
349
+ touch-action: manipulation;
350
+ }
351
+
352
+ [hidden] {
353
+ display: none;
354
+ }
355
+
356
+ // --------------------------------------------------------------------------
357
+ // Accessibility
358
+ // --------------------------------------------------------------------------
359
+
360
+ [aria-busy='true'] {
361
+ cursor: progress;
362
+ }
363
+
364
+ [aria-controls] {
365
+ cursor: pointer;
366
+ }
367
+
368
+ [aria-disabled='true'],
369
+ [disabled] {
370
+ cursor: not-allowed;
371
+ }
372
+
373
+ [aria-hidden='false'][hidden] {
374
+ display: initial;
375
+ }
376
+
377
+ [aria-hidden='false'][hidden]:not(:focus) {
378
+ clip: rect(0, 0, 0, 0);
379
+ position: absolute;
380
+ }
381
+
382
+ // --------------------------------------------------------------------------
383
+ // Typography (from typography.css)
384
+ // --------------------------------------------------------------------------
385
+
386
+ html {
387
+ font-family: system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Ubuntu',
388
+ 'Cantarell', 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
389
+ 'Segoe UI Symbol', 'Noto Color Emoji';
390
+ }
391
+
392
+ code,
393
+ kbd,
394
+ samp,
395
+ pre {
396
+ font-family: 'Menlo', 'Consolas', 'Roboto Mono', 'Ubuntu Monospace',
397
+ 'Noto Mono', 'Oxygen Mono', 'Liberation Mono', monospace,
398
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
399
+ }
400
+
401
+ // --------------------------------------------------------------------------
402
+ // Focus visible
403
+ // --------------------------------------------------------------------------
404
+
405
+ :focus-visible {
406
+ outline: revert !important;
407
+ }
@@ -0,0 +1,53 @@
1
+ // ==========================================================================
2
+ // SCSS Variables - 颜色变量定义
3
+ // ==========================================================================
4
+
5
+ // 基础背景色
6
+ $bg-color: #1b1b1b;
7
+ $btn-color: #272727;
8
+ $btn-hover-color: #3b3b3b;
9
+
10
+ // --------------------------------------------------------------------------
11
+ // 调色板集合 (可根据需要切换)
12
+ // --------------------------------------------------------------------------
13
+
14
+ // Bdazzled Blue Palette
15
+ $bdazzled-blue: #3d5a80ff;
16
+ $pale-cerulean: #98c1d9ff;
17
+ $light-cyan: #e0fbfcff;
18
+ $burnt-sienna: #ee6c4dff;
19
+ $gunmetal: #293241ff;
20
+
21
+ // Floral White Palette
22
+ $floral-white: #fffcf2ff;
23
+ $pale-silver: #ccc5b9ff;
24
+ $black-olive: #403d39ff;
25
+ $eerie-black: #252422ff;
26
+ $flame: #eb5e28ff;
27
+
28
+ // Space Cadet Palette
29
+ $space-cadet: #2d3142ff;
30
+ $silver: #bfc0c0ff;
31
+ $white: #ffffffff;
32
+ $mandarin: #ef8354ff;
33
+ $independence: #4f5d75ff;
34
+
35
+ // Black Coral Palette
36
+ $black-coral: #495867ff;
37
+ $blue-yonder: #577399ff;
38
+ $beau-blue: #bdd5eaff;
39
+ $ghost-white: #f7f7ffff;
40
+ $orange-red-crayola: #fe5f55ff;
41
+
42
+ // Rich Black Palette
43
+ $rich-black-fogra-29: #0d1b2aff;
44
+ $oxford-blue: #1b263bff;
45
+ $shadow-blue: #778da9ff;
46
+ $platinum: #e0e1ddff;
47
+
48
+ // Davys Grey Palette
49
+ $davys-grey: #484a47ff;
50
+ $cadet: #5c6d70ff;
51
+ $burnished-brown: #a37774ff;
52
+ $middle-red: #e88873ff;
53
+ $melon: #e0ac9dff;
@@ -0,0 +1,18 @@
1
+ // ==========================================================================
2
+ // Flamegraph Styles - 主入口文件
3
+ // ==========================================================================
4
+
5
+ // 1. 基础变量和工具
6
+ @use './mixins' as *;
7
+ @use './variables' as *; // 替换 @import './variables';
8
+ @use './css-variables' as *; // 替换 @import './css-variables';
9
+ @use './sanitize'; // 替换 @import './sanitize';
10
+ @use './common'; // 替换 @import './common';
11
+
12
+ // 2. 自定义元素基础样式
13
+ pyro-flamegraph {
14
+ color: var(--ps-neutral-2);
15
+ -webkit-font-smoothing: antialiased;
16
+ font: 400 16px/1.7 -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
17
+ Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
18
+ }
@@ -0,0 +1,11 @@
1
+ import { isMatch } from './search';
2
+
3
+ describe('search', () => {
4
+ it('matches substrings', () => {
5
+ expect(isMatch('foo', 'foobar')).toBe(true);
6
+ });
7
+
8
+ it('ignores cases', () => {
9
+ expect(isMatch('foo', 'FOOBAR')).toBe(true);
10
+ });
11
+ });
package/src/search.ts ADDED
@@ -0,0 +1,4 @@
1
+ // Whether a query matches a node
2
+ export function isMatch(query: string, nodeName: string) {
3
+ return nodeName.toLowerCase().includes(query.toLowerCase());
4
+ }
@@ -0,0 +1,2 @@
1
+ // src/types/shameful-any.d.ts
2
+ type ShamefulAny = any;
@@ -0,0 +1,57 @@
1
+ .box {
2
+ background-color: var(--ps-ui-foreground);
3
+ border: 1px solid var(--ps-ui-border);
4
+ border-radius: 4px;
5
+
6
+ position: relative;
7
+ }
8
+
9
+ .padding {
10
+ margin-bottom: 10px;
11
+ padding: 10px;
12
+ }
13
+
14
+ .collapseBox {
15
+ @extend .box;
16
+ margin-bottom: 10px;
17
+
18
+ .box {
19
+ background-color: transparent;
20
+ border: none;
21
+ border-radius: 0;
22
+ padding-bottom: 0;
23
+ height: auto;
24
+
25
+ &.collapsedContent {
26
+ height: 0;
27
+ margin: 0;
28
+ padding: 0;
29
+ overflow: hidden;
30
+ }
31
+ }
32
+ }
33
+
34
+ .collapseTitle {
35
+ font-weight: 500;
36
+ font-size: 18px;
37
+ cursor: pointer;
38
+ padding: 5px 10px;
39
+ display: flex;
40
+ justify-content: space-between;
41
+ align-items: center;
42
+ height: 40px;
43
+
44
+ &:hover {
45
+ background-color: var(--ps-ui-border);
46
+ }
47
+ }
48
+
49
+ .collapseIcon {
50
+ display: flex;
51
+ transition: transform 0.1s;
52
+
53
+ &.collapsed {
54
+ transform: rotate(90deg);
55
+ display: flex;
56
+ }
57
+ }
@@ -0,0 +1,105 @@
1
+ // src/shims/Box.tsx
2
+ import React, { useState } from 'react';
3
+ import classNames from 'classnames/bind';
4
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
+ import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
6
+ import styles from './Box.module.scss';
7
+
8
+ const cx = classNames.bind(styles);
9
+
10
+ /**
11
+ * Box 支持的主题类型
12
+ * - dark : 原 Pyroscope 深色风格(默认)
13
+ * - light : 原 light 主题
14
+ * - kylin : 贴近 antd 白色系的主题(在 _css-variables.scss 里定义)
15
+ */
16
+ export type BoxTheme = 'dark' | 'light' | 'kylin';
17
+
18
+ /**
19
+ * Box renders its children with a box around it
20
+ */
21
+ export interface BoxProps {
22
+ children: React.ReactNode;
23
+ /**
24
+ * 关闭 padding,默认 false
25
+ */
26
+ noPadding?: boolean;
27
+
28
+ /**
29
+ * 额外 className(来自宿主项目)
30
+ */
31
+ className?: string;
32
+
33
+ /**
34
+ * Box 使用的主题,默认 'dark'
35
+ */
36
+ theme?: BoxTheme;
37
+ }
38
+
39
+ export default function Box(props: BoxProps) {
40
+ const {
41
+ children,
42
+ noPadding,
43
+ className = '',
44
+ theme = 'dark', // ✅ 默认保持原来的 dark 风格
45
+ } = props;
46
+
47
+ const paddingClass = noPadding ? '' : styles.padding;
48
+
49
+ return (
50
+ <div
51
+ className={`${styles.box} ${paddingClass} ${className}`}
52
+ // ✅ 把主题挂在 Box 自己身上,作为 CSS 变量的“局部根”
53
+ data-theme={theme}
54
+ >
55
+ {children}
56
+ </div>
57
+ );
58
+ }
59
+
60
+ // ===================== 折叠盒子 =====================
61
+
62
+ export interface CollapseBoxProps {
63
+ /** 标题(必填) */
64
+ title: string;
65
+ children: React.ReactNode;
66
+ /**
67
+ * 折叠 Box 的主题,默认也用 dark
68
+ */
69
+ theme?: BoxTheme;
70
+ }
71
+
72
+ export function CollapseBox({ title, children, theme = 'dark' }: CollapseBoxProps) {
73
+ const [collapsed, toggleCollapse] = useState(false);
74
+
75
+ return (
76
+ <div
77
+ className={styles.collapseBox}
78
+ // ✅ 外层也挂一个 theme,保证边框/背景色跟 Box 一致
79
+ data-theme={theme}
80
+ >
81
+ <div
82
+ onClick={() => toggleCollapse((c) => !c)}
83
+ className={styles.collapseTitle}
84
+ aria-hidden
85
+ >
86
+ <div>{title}</div>
87
+ <FontAwesomeIcon
88
+ className={cx({
89
+ [styles.collapseIcon]: true,
90
+ [styles.collapsed]: collapsed,
91
+ })}
92
+ icon={faChevronDown}
93
+ />
94
+ </div>
95
+ <Box
96
+ theme={theme}
97
+ className={cx({
98
+ [styles.collapsedContent]: collapsed,
99
+ })}
100
+ >
101
+ {children}
102
+ </Box>
103
+ </div>
104
+ );
105
+ }