@asyra/core 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 (444) hide show
  1. package/.turbo/turbo-test$colon$ci.log +132 -0
  2. package/.turbo/turbo-test$colon$local.log +30 -0
  3. package/.turbo/turbo-test.log +0 -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 +991 -0
  8. package/coverage/coverage-final.json +14952 -0
  9. package/coverage/favicon.png +0 -0
  10. package/coverage/index.html +236 -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/apis/element-selection.ts.html +133 -0
  16. package/coverage/src/apis/index.html +266 -0
  17. package/coverage/src/apis/index.ts.html +175 -0
  18. package/coverage/src/apis/input-system.ts.html +121 -0
  19. package/coverage/src/apis/interaction-core.ts.html +190 -0
  20. package/coverage/src/apis/props.ts.html +124 -0
  21. package/coverage/src/apis/render.ts.html +130 -0
  22. package/coverage/src/apis/scene-tree.ts.html +292 -0
  23. package/coverage/src/apis/system-context.ts.html +154 -0
  24. package/coverage/src/apis/transaction.ts.html +124 -0
  25. package/coverage/src/apis/undo.ts.html +124 -0
  26. package/coverage/src/apis/viewport.ts.html +193 -0
  27. package/coverage/src/combinations.ts.html +223 -0
  28. package/coverage/src/core.ts.html +559 -0
  29. package/coverage/src/index.html +146 -0
  30. package/coverage/src/index.ts.html +97 -0
  31. package/coverage/src/requests/factory.ts.html +127 -0
  32. package/coverage/src/requests/index.html +206 -0
  33. package/coverage/src/requests/index.ts.html +154 -0
  34. package/coverage/src/requests/props.ts.html +133 -0
  35. package/coverage/src/requests/render.ts.html +187 -0
  36. package/coverage/src/requests/scene-tree.ts.html +163 -0
  37. package/coverage/src/requests/selection.ts.html +127 -0
  38. package/coverage/src/requests/system-context.ts.html +130 -0
  39. package/coverage/src/subscribes/index.html +116 -0
  40. package/coverage/src/subscribes/index.ts.html +109 -0
  41. package/coverage/src/subscribes/input-system/index.html +176 -0
  42. package/coverage/src/subscribes/input-system/index.ts.html +226 -0
  43. package/coverage/src/subscribes/input-system/primary-tool.ts.html +160 -0
  44. package/coverage/src/subscribes/input-system/render.ts.html +484 -0
  45. package/coverage/src/subscribes/input-system/undo.ts.html +172 -0
  46. package/coverage/src/subscribes/input-system/viewport.ts.html +259 -0
  47. package/coverage/src/subscribes/interaction-core/create-element.ts.html +151 -0
  48. package/coverage/src/subscribes/interaction-core/index.html +236 -0
  49. package/coverage/src/subscribes/interaction-core/index.ts.html +289 -0
  50. package/coverage/src/subscribes/interaction-core/primary-tool.ts.html +109 -0
  51. package/coverage/src/subscribes/interaction-core/reset-element-size.ts.html +127 -0
  52. package/coverage/src/subscribes/interaction-core/resize-element.ts.html +181 -0
  53. package/coverage/src/subscribes/interaction-core/select-elements.ts.html +109 -0
  54. package/coverage/src/subscribes/interaction-core/transaction.ts.html +130 -0
  55. package/coverage/src/subscribes/interaction-core/undoredo.ts.html +133 -0
  56. package/coverage/src/subscribes/interaction-core/viewport.ts.html +193 -0
  57. package/coverage/src/types/deps.ts.html +118 -0
  58. package/coverage/src/types/element-selection.ts.html +100 -0
  59. package/coverage/src/types/index.html +266 -0
  60. package/coverage/src/types/index.ts.html +385 -0
  61. package/coverage/src/types/input-system.ts.html +100 -0
  62. package/coverage/src/types/interaction-core.ts.html +127 -0
  63. package/coverage/src/types/props.ts.html +109 -0
  64. package/coverage/src/types/render.ts.html +106 -0
  65. package/coverage/src/types/requests/factory.ts.html +127 -0
  66. package/coverage/src/types/requests/index.html +206 -0
  67. package/coverage/src/types/requests/index.ts.html +214 -0
  68. package/coverage/src/types/requests/props.ts.html +133 -0
  69. package/coverage/src/types/requests/render.ts.html +139 -0
  70. package/coverage/src/types/requests/scene-tree.ts.html +133 -0
  71. package/coverage/src/types/requests/selection.ts.html +127 -0
  72. package/coverage/src/types/requests/system-context.ts.html +142 -0
  73. package/coverage/src/types/scene-tree.ts.html +178 -0
  74. package/coverage/src/types/system-context/index.html +161 -0
  75. package/coverage/src/types/system-context/index.ts.html +112 -0
  76. package/coverage/src/types/system-context/key-state.ts.html +106 -0
  77. package/coverage/src/types/system-context/mouse-state.ts.html +106 -0
  78. package/coverage/src/types/system-context/primary-tool.ts.html +112 -0
  79. package/coverage/src/types/transaction.ts.html +103 -0
  80. package/coverage/src/types/undo.ts.html +103 -0
  81. package/coverage/src/types/viewport.ts.html +127 -0
  82. package/dist/__tests__/core.test.d.ts +2 -0
  83. package/dist/__tests__/core.test.d.ts.map +1 -0
  84. package/dist/__tests__/core.test.js +122 -0
  85. package/dist/__tests__/core.test.js.map +1 -0
  86. package/dist/apis/element-selection.d.ts +3 -0
  87. package/dist/apis/element-selection.d.ts.map +1 -0
  88. package/dist/apis/element-selection.js +11 -0
  89. package/dist/apis/element-selection.js.map +1 -0
  90. package/dist/apis/index.d.ts +3 -0
  91. package/dist/apis/index.d.ts.map +1 -0
  92. package/dist/apis/index.js +25 -0
  93. package/dist/apis/index.js.map +1 -0
  94. package/dist/apis/input-system.d.ts +3 -0
  95. package/dist/apis/input-system.d.ts.map +1 -0
  96. package/dist/apis/input-system.js +11 -0
  97. package/dist/apis/input-system.js.map +1 -0
  98. package/dist/apis/interaction-core.d.ts +3 -0
  99. package/dist/apis/interaction-core.d.ts.map +1 -0
  100. package/dist/apis/interaction-core.js +22 -0
  101. package/dist/apis/interaction-core.js.map +1 -0
  102. package/dist/apis/props.d.ts +3 -0
  103. package/dist/apis/props.d.ts.map +1 -0
  104. package/dist/apis/props.js +11 -0
  105. package/dist/apis/props.js.map +1 -0
  106. package/dist/apis/render.d.ts +3 -0
  107. package/dist/apis/render.d.ts.map +1 -0
  108. package/dist/apis/render.js +12 -0
  109. package/dist/apis/render.js.map +1 -0
  110. package/dist/apis/scene-tree.d.ts +3 -0
  111. package/dist/apis/scene-tree.d.ts.map +1 -0
  112. package/dist/apis/scene-tree.js +39 -0
  113. package/dist/apis/scene-tree.js.map +1 -0
  114. package/dist/apis/system-context.d.ts +3 -0
  115. package/dist/apis/system-context.d.ts.map +1 -0
  116. package/dist/apis/system-context.js +16 -0
  117. package/dist/apis/system-context.js.map +1 -0
  118. package/dist/apis/transaction.d.ts +3 -0
  119. package/dist/apis/transaction.d.ts.map +1 -0
  120. package/dist/apis/transaction.js +12 -0
  121. package/dist/apis/transaction.js.map +1 -0
  122. package/dist/apis/undo.d.ts +3 -0
  123. package/dist/apis/undo.d.ts.map +1 -0
  124. package/dist/apis/undo.js +12 -0
  125. package/dist/apis/undo.js.map +1 -0
  126. package/dist/apis/viewport.d.ts +4 -0
  127. package/dist/apis/viewport.d.ts.map +1 -0
  128. package/dist/apis/viewport.js +27 -0
  129. package/dist/apis/viewport.js.map +1 -0
  130. package/dist/combinations.d.ts +4 -0
  131. package/dist/combinations.d.ts.map +1 -0
  132. package/dist/combinations.js +42 -0
  133. package/dist/combinations.js.map +1 -0
  134. package/dist/core.d.ts +68 -0
  135. package/dist/core.d.ts.map +1 -0
  136. package/dist/core.js +76 -0
  137. package/dist/core.js.map +1 -0
  138. package/dist/index.d.ts +4 -0
  139. package/dist/index.d.ts.map +1 -0
  140. package/dist/index.js +4 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/requests/factory copy.d.ts +7 -0
  143. package/dist/requests/factory copy.d.ts.map +1 -0
  144. package/dist/requests/factory copy.js +10 -0
  145. package/dist/requests/factory copy.js.map +1 -0
  146. package/dist/requests/factory.d.ts +7 -0
  147. package/dist/requests/factory.d.ts.map +1 -0
  148. package/dist/requests/factory.js +10 -0
  149. package/dist/requests/factory.js.map +1 -0
  150. package/dist/requests/index.d.ts +3 -0
  151. package/dist/requests/index.d.ts.map +1 -0
  152. package/dist/requests/index.js +21 -0
  153. package/dist/requests/index.js.map +1 -0
  154. package/dist/requests/primary-tool.d.ts +7 -0
  155. package/dist/requests/primary-tool.d.ts.map +1 -0
  156. package/dist/requests/primary-tool.js +13 -0
  157. package/dist/requests/primary-tool.js.map +1 -0
  158. package/dist/requests/props copy.d.ts +7 -0
  159. package/dist/requests/props copy.d.ts.map +1 -0
  160. package/dist/requests/props copy.js +13 -0
  161. package/dist/requests/props copy.js.map +1 -0
  162. package/dist/requests/props.d.ts +7 -0
  163. package/dist/requests/props.d.ts.map +1 -0
  164. package/dist/requests/props.js +13 -0
  165. package/dist/requests/props.js.map +1 -0
  166. package/dist/requests/render.d.ts +3 -0
  167. package/dist/requests/render.d.ts.map +1 -0
  168. package/dist/requests/render.js +22 -0
  169. package/dist/requests/render.js.map +1 -0
  170. package/dist/requests/scene-tree.d.ts +7 -0
  171. package/dist/requests/scene-tree.d.ts.map +1 -0
  172. package/dist/requests/scene-tree.js +17 -0
  173. package/dist/requests/scene-tree.js.map +1 -0
  174. package/dist/requests/selection.d.ts +7 -0
  175. package/dist/requests/selection.d.ts.map +1 -0
  176. package/dist/requests/selection.js +10 -0
  177. package/dist/requests/selection.js.map +1 -0
  178. package/dist/requests/system-context copy.d.ts +7 -0
  179. package/dist/requests/system-context copy.d.ts.map +1 -0
  180. package/dist/requests/system-context copy.js +19 -0
  181. package/dist/requests/system-context copy.js.map +1 -0
  182. package/dist/requests/system-context.d.ts +7 -0
  183. package/dist/requests/system-context.d.ts.map +1 -0
  184. package/dist/requests/system-context.js +10 -0
  185. package/dist/requests/system-context.js.map +1 -0
  186. package/dist/requests/types.d.ts +7 -0
  187. package/dist/requests/types.d.ts.map +1 -0
  188. package/dist/requests/types.js +4 -0
  189. package/dist/requests/types.js.map +1 -0
  190. package/dist/requests/viewport.d.ts +19 -0
  191. package/dist/requests/viewport.d.ts.map +1 -0
  192. package/dist/requests/viewport.js +6 -0
  193. package/dist/requests/viewport.js.map +1 -0
  194. package/dist/subscribes/index.d.ts +3 -0
  195. package/dist/subscribes/index.d.ts.map +1 -0
  196. package/dist/subscribes/index.js +7 -0
  197. package/dist/subscribes/index.js.map +1 -0
  198. package/dist/subscribes/input-system/index.d.ts +3 -0
  199. package/dist/subscribes/input-system/index.d.ts.map +1 -0
  200. package/dist/subscribes/input-system/index.js +26 -0
  201. package/dist/subscribes/input-system/index.js.map +1 -0
  202. package/dist/subscribes/input-system/primary-tool.d.ts +10 -0
  203. package/dist/subscribes/input-system/primary-tool.d.ts.map +1 -0
  204. package/dist/subscribes/input-system/primary-tool.js +15 -0
  205. package/dist/subscribes/input-system/primary-tool.js.map +1 -0
  206. package/dist/subscribes/input-system/render.d.ts +16 -0
  207. package/dist/subscribes/input-system/render.d.ts.map +1 -0
  208. package/dist/subscribes/input-system/render.js +97 -0
  209. package/dist/subscribes/input-system/render.js.map +1 -0
  210. package/dist/subscribes/input-system/undo.d.ts +10 -0
  211. package/dist/subscribes/input-system/undo.d.ts.map +1 -0
  212. package/dist/subscribes/input-system/undo.js +18 -0
  213. package/dist/subscribes/input-system/undo.js.map +1 -0
  214. package/dist/subscribes/input-system/viewport.d.ts +11 -0
  215. package/dist/subscribes/input-system/viewport.d.ts.map +1 -0
  216. package/dist/subscribes/input-system/viewport.js +36 -0
  217. package/dist/subscribes/input-system/viewport.js.map +1 -0
  218. package/dist/subscribes/interaction-core/create-and-resize.d.ts +5 -0
  219. package/dist/subscribes/interaction-core/create-and-resize.d.ts.map +1 -0
  220. package/dist/subscribes/interaction-core/create-and-resize.js +86 -0
  221. package/dist/subscribes/interaction-core/create-and-resize.js.map +1 -0
  222. package/dist/subscribes/interaction-core/create-element copy.d.ts +3 -0
  223. package/dist/subscribes/interaction-core/create-element copy.d.ts.map +1 -0
  224. package/dist/subscribes/interaction-core/create-element copy.js +17 -0
  225. package/dist/subscribes/interaction-core/create-element copy.js.map +1 -0
  226. package/dist/subscribes/interaction-core/create-element.d.ts +3 -0
  227. package/dist/subscribes/interaction-core/create-element.d.ts.map +1 -0
  228. package/dist/subscribes/interaction-core/create-element.js +17 -0
  229. package/dist/subscribes/interaction-core/create-element.js.map +1 -0
  230. package/dist/subscribes/interaction-core/index.d.ts +3 -0
  231. package/dist/subscribes/interaction-core/index.d.ts.map +1 -0
  232. package/dist/subscribes/interaction-core/index.js +42 -0
  233. package/dist/subscribes/interaction-core/index.js.map +1 -0
  234. package/dist/subscribes/interaction-core/input-to-decision.d.ts +5 -0
  235. package/dist/subscribes/interaction-core/input-to-decision.d.ts.map +1 -0
  236. package/dist/subscribes/interaction-core/input-to-decision.js +48 -0
  237. package/dist/subscribes/interaction-core/input-to-decision.js.map +1 -0
  238. package/dist/subscribes/interaction-core/primary-tool.d.ts +3 -0
  239. package/dist/subscribes/interaction-core/primary-tool.d.ts.map +1 -0
  240. package/dist/subscribes/interaction-core/primary-tool.js +7 -0
  241. package/dist/subscribes/interaction-core/primary-tool.js.map +1 -0
  242. package/dist/subscribes/interaction-core/reset-element-size.d.ts +5 -0
  243. package/dist/subscribes/interaction-core/reset-element-size.d.ts.map +1 -0
  244. package/dist/subscribes/interaction-core/reset-element-size.js +9 -0
  245. package/dist/subscribes/interaction-core/reset-element-size.js.map +1 -0
  246. package/dist/subscribes/interaction-core/resize-element.d.ts +3 -0
  247. package/dist/subscribes/interaction-core/resize-element.d.ts.map +1 -0
  248. package/dist/subscribes/interaction-core/resize-element.js +25 -0
  249. package/dist/subscribes/interaction-core/resize-element.js.map +1 -0
  250. package/dist/subscribes/interaction-core/select-elements.d.ts +3 -0
  251. package/dist/subscribes/interaction-core/select-elements.d.ts.map +1 -0
  252. package/dist/subscribes/interaction-core/select-elements.js +7 -0
  253. package/dist/subscribes/interaction-core/select-elements.js.map +1 -0
  254. package/dist/subscribes/interaction-core/transaction.d.ts +3 -0
  255. package/dist/subscribes/interaction-core/transaction.d.ts.map +1 -0
  256. package/dist/subscribes/interaction-core/transaction.js +10 -0
  257. package/dist/subscribes/interaction-core/transaction.js.map +1 -0
  258. package/dist/subscribes/interaction-core/undoredo.d.ts +3 -0
  259. package/dist/subscribes/interaction-core/undoredo.d.ts.map +1 -0
  260. package/dist/subscribes/interaction-core/undoredo.js +15 -0
  261. package/dist/subscribes/interaction-core/undoredo.js.map +1 -0
  262. package/dist/subscribes/interaction-core/viewport.d.ts +3 -0
  263. package/dist/subscribes/interaction-core/viewport.d.ts.map +1 -0
  264. package/dist/subscribes/interaction-core/viewport.js +29 -0
  265. package/dist/subscribes/interaction-core/viewport.js.map +1 -0
  266. package/dist/subscribes/render.d.ts +6 -0
  267. package/dist/subscribes/render.d.ts.map +1 -0
  268. package/dist/subscribes/render.js +28 -0
  269. package/dist/subscribes/render.js.map +1 -0
  270. package/dist/types/deps.d.ts +11 -0
  271. package/dist/types/deps.d.ts.map +1 -0
  272. package/dist/types/deps.js +2 -0
  273. package/dist/types/deps.js.map +1 -0
  274. package/dist/types/element-selection.d.ts +5 -0
  275. package/dist/types/element-selection.d.ts.map +1 -0
  276. package/dist/types/element-selection.js +2 -0
  277. package/dist/types/element-selection.js.map +1 -0
  278. package/dist/types/index.d.ts +15 -0
  279. package/dist/types/index.d.ts.map +1 -0
  280. package/dist/types/index.js +2 -0
  281. package/dist/types/index.js.map +1 -0
  282. package/dist/types/input-system.d.ts +5 -0
  283. package/dist/types/input-system.d.ts.map +1 -0
  284. package/dist/types/input-system.js +2 -0
  285. package/dist/types/input-system.js.map +1 -0
  286. package/dist/types/interaction-core.d.ts +11 -0
  287. package/dist/types/interaction-core.d.ts.map +1 -0
  288. package/dist/types/interaction-core.js +2 -0
  289. package/dist/types/interaction-core.js.map +1 -0
  290. package/dist/types/props.d.ts +7 -0
  291. package/dist/types/props.d.ts.map +1 -0
  292. package/dist/types/props.js +2 -0
  293. package/dist/types/props.js.map +1 -0
  294. package/dist/types/render.d.ts +6 -0
  295. package/dist/types/render.d.ts.map +1 -0
  296. package/dist/types/render.js +2 -0
  297. package/dist/types/render.js.map +1 -0
  298. package/dist/types/requests/factory copy.d.ts +12 -0
  299. package/dist/types/requests/factory copy.d.ts.map +1 -0
  300. package/dist/types/requests/factory copy.js +2 -0
  301. package/dist/types/requests/factory copy.js.map +1 -0
  302. package/dist/types/requests/factory.d.ts +12 -0
  303. package/dist/types/requests/factory.d.ts.map +1 -0
  304. package/dist/types/requests/factory.js +2 -0
  305. package/dist/types/requests/factory.js.map +1 -0
  306. package/dist/types/requests/index.d.ts +17 -0
  307. package/dist/types/requests/index.d.ts.map +1 -0
  308. package/dist/types/requests/index.js +4 -0
  309. package/dist/types/requests/index.js.map +1 -0
  310. package/dist/types/requests/primary-tool.d.ts +13 -0
  311. package/dist/types/requests/primary-tool.d.ts.map +1 -0
  312. package/dist/types/requests/primary-tool.js +2 -0
  313. package/dist/types/requests/primary-tool.js.map +1 -0
  314. package/dist/types/requests/props copy.d.ts +14 -0
  315. package/dist/types/requests/props copy.d.ts.map +1 -0
  316. package/dist/types/requests/props copy.js +2 -0
  317. package/dist/types/requests/props copy.js.map +1 -0
  318. package/dist/types/requests/props.d.ts +14 -0
  319. package/dist/types/requests/props.d.ts.map +1 -0
  320. package/dist/types/requests/props.js +2 -0
  321. package/dist/types/requests/props.js.map +1 -0
  322. package/dist/types/requests/render.d.ts +15 -0
  323. package/dist/types/requests/render.d.ts.map +1 -0
  324. package/dist/types/requests/render.js +2 -0
  325. package/dist/types/requests/render.js.map +1 -0
  326. package/dist/types/requests/scene-tree.d.ts +14 -0
  327. package/dist/types/requests/scene-tree.d.ts.map +1 -0
  328. package/dist/types/requests/scene-tree.js +2 -0
  329. package/dist/types/requests/scene-tree.js.map +1 -0
  330. package/dist/types/requests/selection.d.ts +12 -0
  331. package/dist/types/requests/selection.d.ts.map +1 -0
  332. package/dist/types/requests/selection.js +2 -0
  333. package/dist/types/requests/selection.js.map +1 -0
  334. package/dist/types/requests/system-context.d.ts +17 -0
  335. package/dist/types/requests/system-context.d.ts.map +1 -0
  336. package/dist/types/requests/system-context.js +2 -0
  337. package/dist/types/requests/system-context.js.map +1 -0
  338. package/dist/types/requests/system.d.ts +13 -0
  339. package/dist/types/requests/system.d.ts.map +1 -0
  340. package/dist/types/requests/system.js +2 -0
  341. package/dist/types/requests/system.js.map +1 -0
  342. package/dist/types/requests/viewport.d.ts +20 -0
  343. package/dist/types/requests/viewport.d.ts.map +1 -0
  344. package/dist/types/requests/viewport.js +6 -0
  345. package/dist/types/requests/viewport.js.map +1 -0
  346. package/dist/types/requests.d.ts +8 -0
  347. package/dist/types/requests.d.ts.map +1 -0
  348. package/dist/types/requests.js +2 -0
  349. package/dist/types/requests.js.map +1 -0
  350. package/dist/types/scene-tree.d.ts +15 -0
  351. package/dist/types/scene-tree.d.ts.map +1 -0
  352. package/dist/types/scene-tree.js +2 -0
  353. package/dist/types/scene-tree.js.map +1 -0
  354. package/dist/types/system-context/index.d.ts +8 -0
  355. package/dist/types/system-context/index.d.ts.map +1 -0
  356. package/dist/types/system-context/index.js +4 -0
  357. package/dist/types/system-context/index.js.map +1 -0
  358. package/dist/types/system-context/key-state.d.ts +6 -0
  359. package/dist/types/system-context/key-state.d.ts.map +1 -0
  360. package/dist/types/system-context/key-state.js +2 -0
  361. package/dist/types/system-context/key-state.js.map +1 -0
  362. package/dist/types/system-context/mouse-state.d.ts +6 -0
  363. package/dist/types/system-context/mouse-state.d.ts.map +1 -0
  364. package/dist/types/system-context/mouse-state.js +2 -0
  365. package/dist/types/system-context/mouse-state.js.map +1 -0
  366. package/dist/types/system-context/primary-tool.d.ts +8 -0
  367. package/dist/types/system-context/primary-tool.d.ts.map +1 -0
  368. package/dist/types/system-context/primary-tool.js +2 -0
  369. package/dist/types/system-context/primary-tool.js.map +1 -0
  370. package/dist/types/transaction.d.ts +6 -0
  371. package/dist/types/transaction.d.ts.map +1 -0
  372. package/dist/types/transaction.js +2 -0
  373. package/dist/types/transaction.js.map +1 -0
  374. package/dist/types/undo.d.ts +6 -0
  375. package/dist/types/undo.d.ts.map +1 -0
  376. package/dist/types/undo.js +2 -0
  377. package/dist/types/undo.js.map +1 -0
  378. package/dist/types/viewport.d.ts +12 -0
  379. package/dist/types/viewport.d.ts.map +1 -0
  380. package/dist/types/viewport.js +2 -0
  381. package/dist/types/viewport.js.map +1 -0
  382. package/package.json +37 -0
  383. package/src/__tests__/core.test.ts +153 -0
  384. package/src/apis/element-selection.ts +16 -0
  385. package/src/apis/index.ts +30 -0
  386. package/src/apis/input-system.ts +12 -0
  387. package/src/apis/interaction-core.ts +35 -0
  388. package/src/apis/props.ts +13 -0
  389. package/src/apis/render.ts +15 -0
  390. package/src/apis/scene-tree.ts +69 -0
  391. package/src/apis/system-context.ts +23 -0
  392. package/src/apis/transaction.ts +13 -0
  393. package/src/apis/undo.ts +13 -0
  394. package/src/apis/viewport.ts +36 -0
  395. package/src/combinations.ts +46 -0
  396. package/src/core.ts +158 -0
  397. package/src/index.ts +4 -0
  398. package/src/requests/factory.ts +14 -0
  399. package/src/requests/index.ts +23 -0
  400. package/src/requests/props.ts +16 -0
  401. package/src/requests/render.ts +34 -0
  402. package/src/requests/scene-tree.ts +26 -0
  403. package/src/requests/selection.ts +14 -0
  404. package/src/requests/system-context.ts +15 -0
  405. package/src/subscribes/index.ts +8 -0
  406. package/src/subscribes/input-system/index.ts +47 -0
  407. package/src/subscribes/input-system/primary-tool.ts +25 -0
  408. package/src/subscribes/input-system/render.ts +133 -0
  409. package/src/subscribes/input-system/undo.ts +29 -0
  410. package/src/subscribes/input-system/viewport.ts +58 -0
  411. package/src/subscribes/interaction-core/create-element.ts +22 -0
  412. package/src/subscribes/interaction-core/index.ts +68 -0
  413. package/src/subscribes/interaction-core/primary-tool.ts +8 -0
  414. package/src/subscribes/interaction-core/reset-element-size.ts +12 -0
  415. package/src/subscribes/interaction-core/resize-element.ts +31 -0
  416. package/src/subscribes/interaction-core/select-elements.ts +8 -0
  417. package/src/subscribes/interaction-core/transaction.ts +15 -0
  418. package/src/subscribes/interaction-core/undoredo.ts +16 -0
  419. package/src/subscribes/interaction-core/viewport.ts +35 -0
  420. package/src/types/deps.ts +11 -0
  421. package/src/types/element-selection.ts +5 -0
  422. package/src/types/index.ts +100 -0
  423. package/src/types/input-system.ts +5 -0
  424. package/src/types/interaction-core.ts +14 -0
  425. package/src/types/props.ts +8 -0
  426. package/src/types/render.ts +7 -0
  427. package/src/types/requests/factory.ts +14 -0
  428. package/src/types/requests/index.ts +43 -0
  429. package/src/types/requests/props.ts +16 -0
  430. package/src/types/requests/render.ts +18 -0
  431. package/src/types/requests/scene-tree.ts +16 -0
  432. package/src/types/requests/selection.ts +14 -0
  433. package/src/types/requests/system-context.ts +19 -0
  434. package/src/types/scene-tree.ts +31 -0
  435. package/src/types/system-context/index.ts +9 -0
  436. package/src/types/system-context/key-state.ts +7 -0
  437. package/src/types/system-context/mouse-state.ts +7 -0
  438. package/src/types/system-context/primary-tool.ts +9 -0
  439. package/src/types/transaction.ts +6 -0
  440. package/src/types/undo.ts +6 -0
  441. package/src/types/viewport.ts +14 -0
  442. package/test-setup.ts +6 -0
  443. package/tsconfig.json +22 -0
  444. package/vitest.config.ts +8 -0
@@ -0,0 +1,132 @@
1
+
2
+ The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
3
+
4
+  RUN  v2.1.9 /Users/asa/Desktop/workspace/asyra/packages/core
5
+ Coverage enabled with v8
6
+
7
+ [?25l · src/__tests__/core.test.ts (7)
8
+ · Core (7)
9
+ · should load data correctly and call appropriate methods
10
+ · should call sceneTreeInit if no sceneTree data is provided
11
+ · should save data correctly and call appropriate methods
12
+ · should delegate startTransaction to factory
13
+ · should delegate switchPrimaryTool to systemContext
14
+ · should delegate addRectangle to sceneTree
15
+ · should call executeAction without error
16
+ [?25l[?25l ✓ src/__tests__/core.test.ts (7)
17
+ ✓ Core (7)
18
+ ✓ should load data correctly and call appropriate methods
19
+ ✓ should call sceneTreeInit if no sceneTree data is provided
20
+ ✓ should save data correctly and call appropriate methods
21
+ ✓ should delegate startTransaction to factory
22
+ ✓ should delegate switchPrimaryTool to systemContext
23
+ ✓ should delegate addRectangle to sceneTree
24
+ ✓ should call executeAction without error
25
+ [?25l[?25l[?25l[?25l ✓ src/__tests__/core.test.ts (7)
26
+ ✓ Core (7)
27
+ ✓ should load data correctly and call appropriate methods
28
+ ✓ should call sceneTreeInit if no sceneTree data is provided
29
+ ✓ should save data correctly and call appropriate methods
30
+ ✓ should delegate startTransaction to factory
31
+ ✓ should delegate switchPrimaryTool to systemContext
32
+ ✓ should delegate addRectangle to sceneTree
33
+ ✓ should call executeAction without error
34
+
35
+  Test Files  1 passed (1)
36
+  Tests  7 passed (7)
37
+  Start at  02:50:33
38
+  Duration  4.00s (transform 1.28s, setup 20ms, collect 2.09s, tests 7ms, environment 727ms, prepare 443ms)
39
+
40
+ <?xml version="1.0" encoding="UTF-8" ?>
41
+ <testsuites name="vitest tests" tests="7" failures="0" errors="0" time="4.004">
42
+ <testsuite name="src/__tests__/core.test.ts" timestamp="2026-01-20T18:50:38.375Z" hostname="Mac.home" tests="7" failures="0" errors="0" skipped="0" time="0.007402417">
43
+ <testcase classname="src/__tests__/core.test.ts" name="Core &gt; should load data correctly and call appropriate methods" time="0.002315375">
44
+ </testcase>
45
+ <testcase classname="src/__tests__/core.test.ts" name="Core &gt; should call sceneTreeInit if no sceneTree data is provided" time="0.003507792">
46
+ </testcase>
47
+ <testcase classname="src/__tests__/core.test.ts" name="Core &gt; should save data correctly and call appropriate methods" time="0.000318209">
48
+ </testcase>
49
+ <testcase classname="src/__tests__/core.test.ts" name="Core &gt; should delegate startTransaction to factory" time="0.000150958">
50
+ </testcase>
51
+ <testcase classname="src/__tests__/core.test.ts" name="Core &gt; should delegate switchPrimaryTool to systemContext" time="0.000167375">
52
+ </testcase>
53
+ <testcase classname="src/__tests__/core.test.ts" name="Core &gt; should delegate addRectangle to sceneTree" time="0.000173458">
54
+ </testcase>
55
+ <testcase classname="src/__tests__/core.test.ts" name="Core &gt; should call executeAction without error" time="0.000175375">
56
+ </testcase>
57
+ </testsuite>
58
+ </testsuites>
59
+  % Coverage report from v8
60
+ ---------------------------------|---------|----------|---------|---------|----------------------------
61
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
62
+ ---------------------------------|---------|----------|---------|---------|----------------------------
63
+ All files  |  59.69 |  88.88 |  46.26 |  59.69 |  
64
+  src  |  96.36 |  62.5 |  75 |  96.36 |  
65
+  combinations.ts  |  100 |  100 |  100 |  100 |  
66
+  core.ts  |  96.87 |  66.66 |  100 |  96.87 | 115-116 
67
+  index.ts  |  0 |  0 |  0 |  0 | 1-4 
68
+  src/apis  |  56 |  86.66 |  33.33 |  56 |  
69
+  element-selection.ts  |  60 |  100 |  50 |  60 | 11-14 
70
+  index.ts  |  100 |  100 |  100 |  100 |  
71
+  input-system.ts  |  60 |  100 |  50 |  60 | 7-10 
72
+  interaction-core.ts  |  40.74 |  100 |  20 |  40.74 | 15-18,20-23,25-28,30-33 
73
+  props.ts  |  80 |  100 |  66.66 |  80 | 10-11 
74
+  render.ts  |  69.23 |  100 |  33.33 |  69.23 | 9-10,12-13 
75
+  scene-tree.ts  |  32.6 |  100 |  14.28 |  32.6 | ...40-41,43-48,50-54,56-67
76
+  system-context.ts  |  53.33 |  100 |  25 |  53.33 | 13-15,17-18,20-21 
77
+  transaction.ts  |  63.63 |  100 |  33.33 |  63.63 | 7-8,10-11 
78
+  undo.ts  |  63.63 |  100 |  33.33 |  63.63 | 7-8,10-11 
79
+  viewport.ts  |  57.14 |  50 |  33.33 |  57.14 | ...18-19,24-26,29-30,32-34
80
+  src/requests  |  58.33 |  100 |  47.05 |  58.33 |  
81
+  factory.ts  |  71.42 |  100 |  50 |  71.42 | 12-13 
82
+  index.ts  |  100 |  100 |  100 |  100 |  
83
+  props.ts  |  75 |  100 |  66.66 |  75 | 14-15 
84
+  render.ts  |  34.78 |  100 |  25 |  34.78 | 14-27,29-30,32-33 
85
+  scene-tree.ts  |  36.84 |  100 |  33.33 |  36.84 | 13-14,16-25 
86
+  selection.ts  |  71.42 |  100 |  50 |  71.42 | 12-13 
87
+  system-context.ts  |  71.42 |  100 |  50 |  71.42 | 13-14 
88
+  src/subscribes  |  100 |  100 |  100 |  100 |  
89
+  index.ts  |  100 |  100 |  100 |  100 |  
90
+  src/subscribes/input-system  |  48.86 |  100 |  33.33 |  48.86 |  
91
+  index.ts  |  66.66 |  100 |  8.33 |  66.66 | ...25,27,32,34,36,38,40,45
92
+  primary-tool.ts  |  76.19 |  100 |  66.66 |  76.19 | 20-24 
93
+  render.ts  |  32.03 |  100 |  40 |  32.03 | 52-79,82-107,110-132 
94
+  undo.ts  |  76.19 |  100 |  66.66 |  76.19 | 24-28 
95
+  viewport.ts  |  48.83 |  100 |  50 |  48.83 | 34-35,38-57 
96
+  src/subscribes/interaction-core |  55.69 |  100 |  37.5 |  55.69 |  
97
+  create-element.ts  |  44.44 |  100 |  100 |  44.44 | 10-20 
98
+  index.ts  |  82.22 |  100 |  6.25 |  82.22 | 29,38,40-43,48,62 
99
+  primary-tool.ts  |  83.33 |  100 |  100 |  83.33 | 6 
100
+  reset-element-size.ts  |  66.66 |  100 |  100 |  66.66 | 8-12 
101
+  resize-element.ts  |  30.76 |  100 |  100 |  30.76 | 10-30 
102
+  select-elements.ts  |  83.33 |  100 |  100 |  83.33 | 6 
103
+  transaction.ts  |  77.77 |  100 |  100 |  77.77 | 9,13 
104
+  undoredo.ts  |  38.46 |  100 |  100 |  38.46 | 7-14 
105
+  viewport.ts  |  26.92 |  100 |  100 |  26.92 | 10,15-34 
106
+  src/types  |  0 |  90.9 |  90.9 |  0 |  
107
+ deps.ts | 0 | 0 | 0 | 0 |  
108
+ element-selection.ts | 0 | 0 | 0 | 0 |  
109
+  index.ts  |  0 |  0 |  0 |  0 | 1 
110
+ input-system.ts | 0 | 0 | 0 | 0 |  
111
+ interaction-core.ts | 0 | 0 | 0 | 0 |  
112
+ props.ts | 0 | 0 | 0 | 0 |  
113
+ render.ts | 0 | 0 | 0 | 0 |  
114
+ scene-tree.ts | 0 | 0 | 0 | 0 |  
115
+ transaction.ts | 0 | 0 | 0 | 0 |  
116
+ undo.ts | 0 | 0 | 0 | 0 |  
117
+ viewport.ts | 0 | 0 | 0 | 0 |  
118
+  src/types/requests  |  0 |  85.71 |  85.71 |  0 |  
119
+ factory.ts | 0 | 0 | 0 | 0 |  
120
+  index.ts  |  0 |  0 |  0 |  0 | 1 
121
+ props.ts | 0 | 0 | 0 | 0 |  
122
+ render.ts | 0 | 0 | 0 | 0 |  
123
+ scene-tree.ts | 0 | 0 | 0 | 0 |  
124
+ selection.ts | 0 | 0 | 0 | 0 |  
125
+ system-context.ts | 0 | 0 | 0 | 0 |  
126
+  src/types/system-context  |  0 |  75 |  75 |  0 |  
127
+  index.ts  |  0 |  0 |  0 |  0 | 1-7 
128
+ key-state.ts | 0 | 0 | 0 | 0 |  
129
+ mouse-state.ts | 0 | 0 | 0 | 0 |  
130
+ primary-tool.ts | 0 | 0 | 0 | 0 |  
131
+ ---------------------------------|---------|----------|---------|---------|----------------------------
132
+ [?25h[?25h
@@ -0,0 +1,30 @@
1
+
2
+ The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
3
+
4
+  RUN  v2.1.9 /Users/asa/Desktop/workspace/asra/packages/core
5
+
6
+ [?25l ✓ src/__tests__/core.test.ts (7)
7
+ ✓ Core (7)
8
+ ✓ should load data correctly and call appropriate methods
9
+ ✓ should call sceneTreeInit if no sceneTree data is provided
10
+ ✓ should save data correctly and call appropriate methods
11
+ ✓ should delegate startTransaction to factory
12
+ ✓ should delegate switchPrimaryTool to systemContext
13
+ ✓ should delegate addRectangle to sceneTree
14
+ ✓ should call executeAction without error
15
+  ✓ src/__tests__/core.test.ts (7)
16
+ ✓ Core (7)
17
+ ✓ should load data correctly and call appropriate methods
18
+ ✓ should call sceneTreeInit if no sceneTree data is provided
19
+ ✓ should save data correctly and call appropriate methods
20
+ ✓ should delegate startTransaction to factory
21
+ ✓ should delegate switchPrimaryTool to systemContext
22
+ ✓ should delegate addRectangle to sceneTree
23
+ ✓ should call executeAction without error
24
+
25
+  Test Files  1 passed (1)
26
+  Tests  7 passed (7)
27
+  Start at  01:58:32
28
+  Duration  1.82s (transform 466ms, setup 22ms, collect 890ms, tests 10ms, environment 244ms, prepare 139ms)
29
+
30
+ [?25h[?25h
Binary file
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Core
@@ -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);