@asyra/scene-tree 0.2.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 (117) hide show
  1. package/.turbo/turbo-test$colon$ci.log +134 -0
  2. package/.turbo/turbo-test$colon$local.log +46 -0
  3. package/.turbo/turbo-test.log +53 -0
  4. package/README.md +1 -0
  5. package/coverage/base.css +224 -0
  6. package/coverage/block-navigation.js +87 -0
  7. package/coverage/clover.xml +778 -0
  8. package/coverage/coverage-final.json +10478 -0
  9. package/coverage/favicon.png +0 -0
  10. package/coverage/index.html +131 -0
  11. package/coverage/prettify.css +1 -0
  12. package/coverage/prettify.js +2 -0
  13. package/coverage/sort-arrow-sprite.png +0 -0
  14. package/coverage/sorter.js +196 -0
  15. package/coverage/src/components/computed.ts.html +313 -0
  16. package/coverage/src/components/element-change-handler.ts.html +145 -0
  17. package/coverage/src/components/element.ts.html +586 -0
  18. package/coverage/src/components/frame.ts.html +169 -0
  19. package/coverage/src/components/group.ts.html +295 -0
  20. package/coverage/src/components/index.html +236 -0
  21. package/coverage/src/components/index.ts.html +103 -0
  22. package/coverage/src/components/props.ts.html +355 -0
  23. package/coverage/src/components/rectangle.ts.html +169 -0
  24. package/coverage/src/components/workspace.ts.html +433 -0
  25. package/coverage/src/index.html +161 -0
  26. package/coverage/src/index.ts.html +103 -0
  27. package/coverage/src/sceneTree.ts.html +853 -0
  28. package/coverage/src/subscribes.ts.html +295 -0
  29. package/coverage/src/utils.ts.html +328 -0
  30. package/dist/__tests__/sceneTree.test.d.ts +2 -0
  31. package/dist/__tests__/sceneTree.test.d.ts.map +1 -0
  32. package/dist/__tests__/sceneTree.test.js +261 -0
  33. package/dist/__tests__/sceneTree.test.js.map +1 -0
  34. package/dist/components/computed.d.ts +13 -0
  35. package/dist/components/computed.d.ts.map +1 -0
  36. package/dist/components/computed.js +52 -0
  37. package/dist/components/computed.js.map +1 -0
  38. package/dist/components/element-change-handler.d.ts +10 -0
  39. package/dist/components/element-change-handler.d.ts.map +1 -0
  40. package/dist/components/element-change-handler.js +14 -0
  41. package/dist/components/element-change-handler.js.map +1 -0
  42. package/dist/components/element.d.ts +22 -0
  43. package/dist/components/element.d.ts.map +1 -0
  44. package/dist/components/element.js +114 -0
  45. package/dist/components/element.js.map +1 -0
  46. package/dist/components/frame.d.ts +11 -0
  47. package/dist/components/frame.d.ts.map +1 -0
  48. package/dist/components/frame.js +21 -0
  49. package/dist/components/frame.js.map +1 -0
  50. package/dist/components/group.d.ts +14 -0
  51. package/dist/components/group.d.ts.map +1 -0
  52. package/dist/components/group.js +48 -0
  53. package/dist/components/group.js.map +1 -0
  54. package/dist/components/index.d.ts +6 -0
  55. package/dist/components/index.d.ts.map +1 -0
  56. package/dist/components/index.js +6 -0
  57. package/dist/components/index.js.map +1 -0
  58. package/dist/components/legacy-element.d.ts +22 -0
  59. package/dist/components/legacy-element.d.ts.map +1 -0
  60. package/dist/components/legacy-element.js +120 -0
  61. package/dist/components/legacy-element.js.map +1 -0
  62. package/dist/components/polygon.d.ts +11 -0
  63. package/dist/components/polygon.d.ts.map +1 -0
  64. package/dist/components/polygon.js +21 -0
  65. package/dist/components/polygon.js.map +1 -0
  66. package/dist/components/props.d.ts +16 -0
  67. package/dist/components/props.d.ts.map +1 -0
  68. package/dist/components/props.js +63 -0
  69. package/dist/components/props.js.map +1 -0
  70. package/dist/components/rectangle.d.ts +11 -0
  71. package/dist/components/rectangle.d.ts.map +1 -0
  72. package/dist/components/rectangle.js +21 -0
  73. package/dist/components/rectangle.js.map +1 -0
  74. package/dist/components/shape-entity.d.ts +16 -0
  75. package/dist/components/shape-entity.d.ts.map +1 -0
  76. package/dist/components/shape-entity.js +42 -0
  77. package/dist/components/shape-entity.js.map +1 -0
  78. package/dist/components/shape.d.ts +40 -0
  79. package/dist/components/shape.d.ts.map +1 -0
  80. package/dist/components/shape.js +105 -0
  81. package/dist/components/shape.js.map +1 -0
  82. package/dist/components/workspace.d.ts +14 -0
  83. package/dist/components/workspace.d.ts.map +1 -0
  84. package/dist/components/workspace.js +89 -0
  85. package/dist/components/workspace.js.map +1 -0
  86. package/dist/index.d.ts +3 -0
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +5 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/sceneTree.d.ts +34 -0
  91. package/dist/sceneTree.d.ts.map +1 -0
  92. package/dist/sceneTree.js +185 -0
  93. package/dist/sceneTree.js.map +1 -0
  94. package/dist/subscribes.d.ts +2 -0
  95. package/dist/subscribes.d.ts.map +1 -0
  96. package/dist/subscribes.js +38 -0
  97. package/dist/subscribes.js.map +1 -0
  98. package/dist/utils.d.ts +19 -0
  99. package/dist/utils.d.ts.map +1 -0
  100. package/dist/utils.js +61 -0
  101. package/dist/utils.js.map +1 -0
  102. package/package.json +30 -0
  103. package/src/__tests__/sceneTree.test.ts +339 -0
  104. package/src/components/computed.ts +76 -0
  105. package/src/components/element-change-handler.ts +20 -0
  106. package/src/components/element.ts +167 -0
  107. package/src/components/frame.ts +28 -0
  108. package/src/components/group.ts +70 -0
  109. package/src/components/index.ts +6 -0
  110. package/src/components/props.ts +90 -0
  111. package/src/components/rectangle.ts +28 -0
  112. package/src/components/workspace.ts +116 -0
  113. package/src/index.ts +6 -0
  114. package/src/sceneTree.ts +256 -0
  115. package/src/subscribes.ts +70 -0
  116. package/src/utils.ts +81 -0
  117. package/tsconfig.json +17 -0
@@ -0,0 +1,134 @@
1
+
2
+ 
3
+  RUN  v2.1.9 /Users/asa/Desktop/workspace/asyra/packages/scene-tree
4
+ Coverage enabled with v8
5
+
6
+ [?25l · src/__tests__/sceneTree.test.ts (18)
7
+ · SceneTree (18)
8
+ · should initialize with a new workspace if none exists
9
+ · should not create a new workspace if one already exists
10
+ · should create a new element and add a change for it
11
+ · should not create a workspace element using createElement
12
+ · should add an element to the map
13
+ · should remove an element from the map
14
+ · should get an element by ID
15
+ · should add a change to the changes array
16
+ · should clean all changes
17
+ · should add a change for adding an element
18
+ · should add a change for removing an element
19
+ · should add an element to the deleted map
20
+ · should remove an element from the deleted map
21
+ · should restore an element from the deleted map and add a change
22
+ · should call addNewElement on the current workspace
23
+ · should call updateComputedData on the element
24
+ · should load data correctly
25
+ · should save data correctly
26
+ [?25l ✓ src/__tests__/sceneTree.test.ts (18)
27
+ ✓ SceneTree (18)
28
+ ✓ should initialize with a new workspace if none exists
29
+ ✓ should not create a new workspace if one already exists
30
+ ✓ should create a new element and add a change for it
31
+ ✓ should not create a workspace element using createElement
32
+ ✓ should add an element to the map
33
+ ✓ should remove an element from the map
34
+ ✓ should get an element by ID
35
+ ✓ should add a change to the changes array
36
+ ✓ should clean all changes
37
+ ✓ should add a change for adding an element
38
+ ✓ should add a change for removing an element
39
+ ✓ should add an element to the deleted map
40
+ ✓ should remove an element from the deleted map
41
+ ✓ should restore an element from the deleted map and add a change
42
+ ✓ should call addNewElement on the current workspace
43
+ ✓ should call updateComputedData on the element
44
+ ✓ should load data correctly
45
+ ✓ should save data correctly
46
+ [?25l[?25l ✓ src/__tests__/sceneTree.test.ts (18)
47
+ ✓ SceneTree (18)
48
+ ✓ should initialize with a new workspace if none exists
49
+ ✓ should not create a new workspace if one already exists
50
+ ✓ should create a new element and add a change for it
51
+ ✓ should not create a workspace element using createElement
52
+ ✓ should add an element to the map
53
+ ✓ should remove an element from the map
54
+ ✓ should get an element by ID
55
+ ✓ should add a change to the changes array
56
+ ✓ should clean all changes
57
+ ✓ should add a change for adding an element
58
+ ✓ should add a change for removing an element
59
+ ✓ should add an element to the deleted map
60
+ ✓ should remove an element from the deleted map
61
+ ✓ should restore an element from the deleted map and add a change
62
+ ✓ should call addNewElement on the current workspace
63
+ ✓ should call updateComputedData on the element
64
+ ✓ should load data correctly
65
+ ✓ should save data correctly
66
+
67
+  Test Files  1 passed (1)
68
+  Tests  18 passed (18)
69
+  Start at  02:50:38
70
+  Duration  531ms (transform 151ms, setup 0ms, collect 256ms, tests 6ms, environment 0ms, prepare 38ms)
71
+
72
+ <?xml version="1.0" encoding="UTF-8" ?>
73
+ <testsuites name="vitest tests" tests="18" failures="0" errors="0" time="0.531">
74
+ <testsuite name="src/__tests__/sceneTree.test.ts" timestamp="2026-01-20T18:50:39.162Z" hostname="Mac.home" tests="18" failures="0" errors="0" skipped="0" time="0.006012833">
75
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should initialize with a new workspace if none exists" time="0.001306042">
76
+ </testcase>
77
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should not create a new workspace if one already exists" time="0.000232875">
78
+ </testcase>
79
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should create a new element and add a change for it" time="0.000745084">
80
+ </testcase>
81
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should not create a workspace element using createElement" time="0.0001055">
82
+ </testcase>
83
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should add an element to the map" time="0.000091583">
84
+ </testcase>
85
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should remove an element from the map" time="0.000122834">
86
+ </testcase>
87
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should get an element by ID" time="0.000088333">
88
+ </testcase>
89
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should add a change to the changes array" time="0.000085958">
90
+ </testcase>
91
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should clean all changes" time="0.000074583">
92
+ </testcase>
93
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should add a change for adding an element" time="0.000116875">
94
+ </testcase>
95
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should add a change for removing an element" time="0.000122917">
96
+ </testcase>
97
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should add an element to the deleted map" time="0.000081292">
98
+ </testcase>
99
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should remove an element from the deleted map" time="0.000078375">
100
+ </testcase>
101
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should restore an element from the deleted map and add a change" time="0.000134042">
102
+ </testcase>
103
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should call addNewElement on the current workspace" time="0.00083425">
104
+ </testcase>
105
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should call updateComputedData on the element" time="0.000473709">
106
+ </testcase>
107
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should load data correctly" time="0.000391833">
108
+ </testcase>
109
+ <testcase classname="src/__tests__/sceneTree.test.ts" name="SceneTree &gt; should save data correctly" time="0.0002475">
110
+ </testcase>
111
+ </testsuite>
112
+ </testsuites>
113
+  % Coverage report from v8
114
+ ----------------------------|---------|----------|---------|---------|---------------------------------
115
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
116
+ ----------------------------|---------|----------|---------|---------|---------------------------------
117
+ All files  |  23.1 |  61.22 |  61.76 |  23.1 |  
118
+  src  |  56.94 |  75 |  84 |  56.94 |  
119
+  index.ts  |  0 |  0 |  0 |  0 | 1-3 
120
+  sceneTree.ts  |  86.59 |  81.08 |  95.45 |  86.59 | ...-181,187,209,213-230,239-240
121
+  subscribes.ts  |  0 |  0 |  0 |  0 | 1-70 
122
+  utils.ts  |  0 |  0 |  0 |  0 | 1-81 
123
+  src/components  |  0 |  0 |  0 |  0 |  
124
+  computed.ts  |  0 |  0 |  0 |  0 | 1-76 
125
+  element-change-handler.ts |  0 |  0 |  0 |  0 | 1-20 
126
+  element.ts  |  0 |  0 |  0 |  0 | 1-167 
127
+  frame.ts  |  0 |  0 |  0 |  0 | 1-28 
128
+  group.ts  |  0 |  0 |  0 |  0 | 1-70 
129
+  index.ts  |  0 |  0 |  0 |  0 | 1 
130
+  props.ts  |  0 |  0 |  0 |  0 | 1-90 
131
+  rectangle.ts  |  0 |  0 |  0 |  0 | 1-28 
132
+  workspace.ts  |  0 |  0 |  0 |  0 | 1-116 
133
+ ----------------------------|---------|----------|---------|---------|---------------------------------
134
+ [?25h[?25h
@@ -0,0 +1,46 @@
1
+
2
+ 
3
+  RUN  v2.1.9 /Users/asa/Desktop/workspace/asra/packages/scene-tree
4
+
5
+ [?25l ✓ should not create a workspace element using createElement
6
+ ✓ should add an element to the map
7
+ ✓ should remove an element from the map
8
+ ✓ should get an element by ID
9
+ ✓ should add a change to the changes array
10
+ ✓ should clean all changes
11
+ ✓ should add a change for adding an element
12
+ ✓ should add a change for removing an element
13
+ ✓ should add an element to the deleted map
14
+ ✓ should remove an element from the deleted map
15
+ ✓ should restore an element from the deleted map and add a change
16
+ ✓ should call addNewElement on the current workspace
17
+ ✓ should call updateComputedData on the element
18
+ ✓ should load data correctly
19
+ ✓ should save data correctly
20
+  ✓ src/__tests__/sceneTree.test.ts (18)
21
+ ✓ SceneTree (18)
22
+ ✓ should initialize with a new workspace if none exists
23
+ ✓ should not create a new workspace if one already exists
24
+ ✓ should create a new element and add a change for it
25
+ ✓ should not create a workspace element using createElement
26
+ ✓ should add an element to the map
27
+ ✓ should remove an element from the map
28
+ ✓ should get an element by ID
29
+ ✓ should add a change to the changes array
30
+ ✓ should clean all changes
31
+ ✓ should add a change for adding an element
32
+ ✓ should add a change for removing an element
33
+ ✓ should add an element to the deleted map
34
+ ✓ should remove an element from the deleted map
35
+ ✓ should restore an element from the deleted map and add a change
36
+ ✓ should call addNewElement on the current workspace
37
+ ✓ should call updateComputedData on the element
38
+ ✓ should load data correctly
39
+ ✓ should save data correctly
40
+
41
+  Test Files  1 passed (1)
42
+  Tests  18 passed (18)
43
+  Start at  01:58:31
44
+  Duration  2.32s (transform 1.30s, setup 0ms, collect 2.10s, tests 6ms, environment 0ms, prepare 34ms)
45
+
46
+ [?25h[?25h
@@ -0,0 +1,53 @@
1
+
2
+ 
3
+  DEV  v2.1.9 /Users/asa/Desktop/workspace/asyra/packages/scene-tree
4
+
5
+ [?25l ✓ src/__tests__/sceneTree.test.ts (18)
6
+ ✓ SceneTree (18)
7
+ ↓ should initialize with a new workspace if none exists [skipped]
8
+ ↓ should not create a new workspace if one already exists [skipped]
9
+ ↓ should create a new element and add a change for it [skipped]
10
+ ↓ should not create a workspace element using createElement [skipped]
11
+ ↓ should add an element to the map [skipped]
12
+ ↓ should remove an element from the map [skipped]
13
+ ↓ should get an element by ID [skipped]
14
+ ↓ should add a change to the changes array [skipped]
15
+ ↓ should clean all changes [skipped]
16
+ ↓ should add a change for adding an element [skipped]
17
+ ↓ should add a change for removing an element [skipped]
18
+ ↓ should add an element to the deleted map [skipped]
19
+ ↓ should remove an element from the deleted map [skipped]
20
+ ↓ should restore an element from the deleted map and add a change [skipped]
21
+ ✓ should call addNewElement on the current workspace
22
+ ↓ should call updateComputedData on the element [skipped]
23
+ ↓ should load data correctly [skipped]
24
+ ↓ should save data correctly [skipped]
25
+  ✓ src/__tests__/sceneTree.test.ts (18)
26
+ ✓ SceneTree (18)
27
+ ↓ should initialize with a new workspace if none exists [skipped]
28
+ ↓ should not create a new workspace if one already exists [skipped]
29
+ ↓ should create a new element and add a change for it [skipped]
30
+ ↓ should not create a workspace element using createElement [skipped]
31
+ ↓ should add an element to the map [skipped]
32
+ ↓ should remove an element from the map [skipped]
33
+ ↓ should get an element by ID [skipped]
34
+ ↓ should add a change to the changes array [skipped]
35
+ ↓ should clean all changes [skipped]
36
+ ↓ should add a change for adding an element [skipped]
37
+ ↓ should add a change for removing an element [skipped]
38
+ ↓ should add an element to the deleted map [skipped]
39
+ ↓ should remove an element from the deleted map [skipped]
40
+ ↓ should restore an element from the deleted map and add a change [skipped]
41
+ ✓ should call addNewElement on the current workspace
42
+ ↓ should call updateComputedData on the element [skipped]
43
+ ↓ should load data correctly [skipped]
44
+ ↓ should save data correctly [skipped]
45
+
46
+  Test Files  1 passed (1)
47
+  Tests  1 passed | 17 skipped (18)
48
+  Start at  17:40:16
49
+  Duration  2.28s (transform 1.33s, setup 0ms, collect 1.96s, tests 2ms, environment 0ms, prepare 59ms)
50
+
51
+  PASS  Waiting for file changes...
52
+ press h to show help, press q to quit
53
+ [?25hNo test files found. Skipping test.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # SceneTree
@@ -0,0 +1,224 @@
1
+ body, html {
2
+ margin:0; padding: 0;
3
+ height: 100%;
4
+ }
5
+ body {
6
+ font-family: Helvetica Neue, Helvetica, Arial;
7
+ font-size: 14px;
8
+ color:#333;
9
+ }
10
+ .small { font-size: 12px; }
11
+ *, *:after, *:before {
12
+ -webkit-box-sizing:border-box;
13
+ -moz-box-sizing:border-box;
14
+ box-sizing:border-box;
15
+ }
16
+ h1 { font-size: 20px; margin: 0;}
17
+ h2 { font-size: 14px; }
18
+ pre {
19
+ font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
20
+ margin: 0;
21
+ padding: 0;
22
+ -moz-tab-size: 2;
23
+ -o-tab-size: 2;
24
+ tab-size: 2;
25
+ }
26
+ a { color:#0074D9; text-decoration:none; }
27
+ a:hover { text-decoration:underline; }
28
+ .strong { font-weight: bold; }
29
+ .space-top1 { padding: 10px 0 0 0; }
30
+ .pad2y { padding: 20px 0; }
31
+ .pad1y { padding: 10px 0; }
32
+ .pad2x { padding: 0 20px; }
33
+ .pad2 { padding: 20px; }
34
+ .pad1 { padding: 10px; }
35
+ .space-left2 { padding-left:55px; }
36
+ .space-right2 { padding-right:20px; }
37
+ .center { text-align:center; }
38
+ .clearfix { display:block; }
39
+ .clearfix:after {
40
+ content:'';
41
+ display:block;
42
+ height:0;
43
+ clear:both;
44
+ visibility:hidden;
45
+ }
46
+ .fl { float: left; }
47
+ @media only screen and (max-width:640px) {
48
+ .col3 { width:100%; max-width:100%; }
49
+ .hide-mobile { display:none!important; }
50
+ }
51
+
52
+ .quiet {
53
+ color: #7f7f7f;
54
+ color: rgba(0,0,0,0.5);
55
+ }
56
+ .quiet a { opacity: 0.7; }
57
+
58
+ .fraction {
59
+ font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
60
+ font-size: 10px;
61
+ color: #555;
62
+ background: #E8E8E8;
63
+ padding: 4px 5px;
64
+ border-radius: 3px;
65
+ vertical-align: middle;
66
+ }
67
+
68
+ div.path a:link, div.path a:visited { color: #333; }
69
+ table.coverage {
70
+ border-collapse: collapse;
71
+ margin: 10px 0 0 0;
72
+ padding: 0;
73
+ }
74
+
75
+ table.coverage td {
76
+ margin: 0;
77
+ padding: 0;
78
+ vertical-align: top;
79
+ }
80
+ table.coverage td.line-count {
81
+ text-align: right;
82
+ padding: 0 5px 0 20px;
83
+ }
84
+ table.coverage td.line-coverage {
85
+ text-align: right;
86
+ padding-right: 10px;
87
+ min-width:20px;
88
+ }
89
+
90
+ table.coverage td span.cline-any {
91
+ display: inline-block;
92
+ padding: 0 5px;
93
+ width: 100%;
94
+ }
95
+ .missing-if-branch {
96
+ display: inline-block;
97
+ margin-right: 5px;
98
+ border-radius: 3px;
99
+ position: relative;
100
+ padding: 0 4px;
101
+ background: #333;
102
+ color: yellow;
103
+ }
104
+
105
+ .skip-if-branch {
106
+ display: none;
107
+ margin-right: 10px;
108
+ position: relative;
109
+ padding: 0 4px;
110
+ background: #ccc;
111
+ color: white;
112
+ }
113
+ .missing-if-branch .typ, .skip-if-branch .typ {
114
+ color: inherit !important;
115
+ }
116
+ .coverage-summary {
117
+ border-collapse: collapse;
118
+ width: 100%;
119
+ }
120
+ .coverage-summary tr { border-bottom: 1px solid #bbb; }
121
+ .keyline-all { border: 1px solid #ddd; }
122
+ .coverage-summary td, .coverage-summary th { padding: 10px; }
123
+ .coverage-summary tbody { border: 1px solid #bbb; }
124
+ .coverage-summary td { border-right: 1px solid #bbb; }
125
+ .coverage-summary td:last-child { border-right: none; }
126
+ .coverage-summary th {
127
+ text-align: left;
128
+ font-weight: normal;
129
+ white-space: nowrap;
130
+ }
131
+ .coverage-summary th.file { border-right: none !important; }
132
+ .coverage-summary th.pct { }
133
+ .coverage-summary th.pic,
134
+ .coverage-summary th.abs,
135
+ .coverage-summary td.pct,
136
+ .coverage-summary td.abs { text-align: right; }
137
+ .coverage-summary td.file { white-space: nowrap; }
138
+ .coverage-summary td.pic { min-width: 120px !important; }
139
+ .coverage-summary tfoot td { }
140
+
141
+ .coverage-summary .sorter {
142
+ height: 10px;
143
+ width: 7px;
144
+ display: inline-block;
145
+ margin-left: 0.5em;
146
+ background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147
+ }
148
+ .coverage-summary .sorted .sorter {
149
+ background-position: 0 -20px;
150
+ }
151
+ .coverage-summary .sorted-desc .sorter {
152
+ background-position: 0 -10px;
153
+ }
154
+ .status-line { height: 10px; }
155
+ /* yellow */
156
+ .cbranch-no { background: yellow !important; color: #111; }
157
+ /* dark red */
158
+ .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
159
+ .low .chart { border:1px solid #C21F39 }
160
+ .highlighted,
161
+ .highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
162
+ background: #C21F39 !important;
163
+ }
164
+ /* medium red */
165
+ .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
166
+ /* light red */
167
+ .low, .cline-no { background:#FCE1E5 }
168
+ /* light green */
169
+ .high, .cline-yes { background:rgb(230,245,208) }
170
+ /* medium green */
171
+ .cstat-yes { background:rgb(161,215,106) }
172
+ /* dark green */
173
+ .status-line.high, .high .cover-fill { background:rgb(77,146,33) }
174
+ .high .chart { border:1px solid rgb(77,146,33) }
175
+ /* dark yellow (gold) */
176
+ .status-line.medium, .medium .cover-fill { background: #f9cd0b; }
177
+ .medium .chart { border:1px solid #f9cd0b; }
178
+ /* light yellow */
179
+ .medium { background: #fff4c2; }
180
+
181
+ .cstat-skip { background: #ddd; color: #111; }
182
+ .fstat-skip { background: #ddd; color: #111 !important; }
183
+ .cbranch-skip { background: #ddd !important; color: #111; }
184
+
185
+ span.cline-neutral { background: #eaeaea; }
186
+
187
+ .coverage-summary td.empty {
188
+ opacity: .5;
189
+ padding-top: 4px;
190
+ padding-bottom: 4px;
191
+ line-height: 1;
192
+ color: #888;
193
+ }
194
+
195
+ .cover-fill, .cover-empty {
196
+ display:inline-block;
197
+ height: 12px;
198
+ }
199
+ .chart {
200
+ line-height: 0;
201
+ }
202
+ .cover-empty {
203
+ background: white;
204
+ }
205
+ .cover-full {
206
+ border-right: none !important;
207
+ }
208
+ pre.prettyprint {
209
+ border: none !important;
210
+ padding: 0 !important;
211
+ margin: 0 !important;
212
+ }
213
+ .com { color: #999 !important; }
214
+ .ignore-none { color: #999; font-weight: normal; }
215
+
216
+ .wrapper {
217
+ min-height: 100%;
218
+ height: auto !important;
219
+ height: 100%;
220
+ margin: 0 auto -48px;
221
+ }
222
+ .footer, .push {
223
+ height: 48px;
224
+ }
@@ -0,0 +1,87 @@
1
+ /* eslint-disable */
2
+ var jumpToCode = (function init() {
3
+ // Classes of code we would like to highlight in the file view
4
+ var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
5
+
6
+ // Elements to highlight in the file listing view
7
+ var fileListingElements = ['td.pct.low'];
8
+
9
+ // We don't want to select elements that are direct descendants of another match
10
+ var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
11
+
12
+ // Selecter that finds elements on the page to which we can jump
13
+ var selector =
14
+ fileListingElements.join(', ') +
15
+ ', ' +
16
+ notSelector +
17
+ missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
18
+
19
+ // The NodeList of matching elements
20
+ var missingCoverageElements = document.querySelectorAll(selector);
21
+
22
+ var currentIndex;
23
+
24
+ function toggleClass(index) {
25
+ missingCoverageElements
26
+ .item(currentIndex)
27
+ .classList.remove('highlighted');
28
+ missingCoverageElements.item(index).classList.add('highlighted');
29
+ }
30
+
31
+ function makeCurrent(index) {
32
+ toggleClass(index);
33
+ currentIndex = index;
34
+ missingCoverageElements.item(index).scrollIntoView({
35
+ behavior: 'smooth',
36
+ block: 'center',
37
+ inline: 'center'
38
+ });
39
+ }
40
+
41
+ function goToPrevious() {
42
+ var nextIndex = 0;
43
+ if (typeof currentIndex !== 'number' || currentIndex === 0) {
44
+ nextIndex = missingCoverageElements.length - 1;
45
+ } else if (missingCoverageElements.length > 1) {
46
+ nextIndex = currentIndex - 1;
47
+ }
48
+
49
+ makeCurrent(nextIndex);
50
+ }
51
+
52
+ function goToNext() {
53
+ var nextIndex = 0;
54
+
55
+ if (
56
+ typeof currentIndex === 'number' &&
57
+ currentIndex < missingCoverageElements.length - 1
58
+ ) {
59
+ nextIndex = currentIndex + 1;
60
+ }
61
+
62
+ makeCurrent(nextIndex);
63
+ }
64
+
65
+ return function jump(event) {
66
+ if (
67
+ document.getElementById('fileSearch') === document.activeElement &&
68
+ document.activeElement != null
69
+ ) {
70
+ // if we're currently focused on the search input, we don't want to navigate
71
+ return;
72
+ }
73
+
74
+ switch (event.which) {
75
+ case 78: // n
76
+ case 74: // j
77
+ goToNext();
78
+ break;
79
+ case 66: // b
80
+ case 75: // k
81
+ case 80: // p
82
+ goToPrevious();
83
+ break;
84
+ }
85
+ };
86
+ })();
87
+ window.addEventListener('keydown', jumpToCode);