@asyra/system-context 0.2.5 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -1
  3. package/dist/apis/index.d.ts +11 -10
  4. package/dist/apis/index.js +3 -11
  5. package/dist/apis/managed-property-state.d.ts +39 -0
  6. package/dist/apis/managed-property-state.js +53 -0
  7. package/dist/apis/root.d.ts +1 -1
  8. package/dist/apis/root.js +18 -11
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/states/index.d.ts +2 -6
  12. package/dist/states/index.js +2 -6
  13. package/dist/states/managed-property-state.d.ts +46 -0
  14. package/dist/states/managed-property-state.js +192 -0
  15. package/dist/system-context.d.ts +11 -11
  16. package/dist/system-context.js +13 -20
  17. package/dist/types/deps.d.ts +2 -10
  18. package/dist/types/index.d.ts +5 -9
  19. package/dist/types/index.js +1 -1
  20. package/dist/types/managed-property-state.d.ts +15 -0
  21. package/package.json +30 -6
  22. package/.turbo/turbo-test$colon$ci.log +0 -77
  23. package/.turbo/turbo-test$colon$local.log +0 -23
  24. package/.turbo/turbo-test.log +0 -359
  25. package/CHANGELOG.md +0 -46
  26. package/coverage/base.css +0 -224
  27. package/coverage/block-navigation.js +0 -87
  28. package/coverage/clover.xml +0 -345
  29. package/coverage/coverage-final.json +0 -5831
  30. package/coverage/favicon.png +0 -0
  31. package/coverage/index.html +0 -176
  32. package/coverage/prettify.css +0 -1
  33. package/coverage/prettify.js +0 -2
  34. package/coverage/sort-arrow-sprite.png +0 -0
  35. package/coverage/sorter.js +0 -196
  36. package/coverage/src/apis/index.html +0 -206
  37. package/coverage/src/apis/index.ts.html +0 -133
  38. package/coverage/src/apis/key-state.ts.html +0 -124
  39. package/coverage/src/apis/mouse-state.ts.html +0 -124
  40. package/coverage/src/apis/primary-tool-state.ts.html +0 -124
  41. package/coverage/src/apis/root.ts.html +0 -139
  42. package/coverage/src/apis/system-state.ts.html +0 -112
  43. package/coverage/src/apis/target-state.ts.html +0 -121
  44. package/coverage/src/index.html +0 -131
  45. package/coverage/src/index.ts.html +0 -97
  46. package/coverage/src/states/index.html +0 -191
  47. package/coverage/src/states/index.ts.html +0 -139
  48. package/coverage/src/states/key-state.ts.html +0 -148
  49. package/coverage/src/states/mouse-state.ts.html +0 -184
  50. package/coverage/src/states/primary-tool-state.ts.html +0 -130
  51. package/coverage/src/states/system-state.ts.html +0 -130
  52. package/coverage/src/states/target-state.ts.html +0 -154
  53. package/coverage/src/subscribe/index.html +0 -191
  54. package/coverage/src/subscribe/index.ts.html +0 -187
  55. package/coverage/src/subscribe/key-state.ts.html +0 -109
  56. package/coverage/src/subscribe/mouse-state.ts.html +0 -109
  57. package/coverage/src/subscribe/primary-tool-state.ts.html +0 -136
  58. package/coverage/src/subscribe/system-state.ts.html +0 -94
  59. package/coverage/src/subscribe/target-state.ts.html +0 -109
  60. package/coverage/src/system-context.ts.html +0 -247
  61. package/coverage/src/types/deps.ts.html +0 -145
  62. package/coverage/src/types/index.html +0 -221
  63. package/coverage/src/types/index.ts.html +0 -157
  64. package/coverage/src/types/key-state.ts.html +0 -118
  65. package/coverage/src/types/mouse-state.ts.html +0 -118
  66. package/coverage/src/types/primary-tool-state.ts.html +0 -121
  67. package/coverage/src/types/root.ts.html +0 -106
  68. package/coverage/src/types/system-state.ts.html +0 -106
  69. package/coverage/src/types/target-state.ts.html +0 -118
  70. package/dist/__tests__/system-context.test.js +0 -63
  71. package/dist/apis/key-state.d.ts +0 -2
  72. package/dist/apis/key-state.js +0 -8
  73. package/dist/apis/mouse-state copy.d.ts +0 -2
  74. package/dist/apis/mouse-state copy.js +0 -8
  75. package/dist/apis/mouse-state.d.ts +0 -2
  76. package/dist/apis/mouse-state.js +0 -8
  77. package/dist/apis/primary-tool-state.d.ts +0 -2
  78. package/dist/apis/primary-tool-state.js +0 -8
  79. package/dist/apis/system-state.d.ts +0 -2
  80. package/dist/apis/system-state.js +0 -5
  81. package/dist/apis/target-state.d.ts +0 -2
  82. package/dist/apis/target-state.js +0 -8
  83. package/dist/states/key-state.d.ts +0 -9
  84. package/dist/states/key-state.js +0 -16
  85. package/dist/states/mouse-state copy.d.ts +0 -9
  86. package/dist/states/mouse-state copy.js +0 -28
  87. package/dist/states/mouse-state.d.ts +0 -9
  88. package/dist/states/mouse-state.js +0 -28
  89. package/dist/states/primary-tool-state.d.ts +0 -8
  90. package/dist/states/primary-tool-state.js +0 -11
  91. package/dist/states/system-state.d.ts +0 -8
  92. package/dist/states/system-state.js +0 -11
  93. package/dist/states/target-state.d.ts +0 -9
  94. package/dist/states/target-state.js +0 -17
  95. package/dist/subscribe/index.d.ts +0 -2
  96. package/dist/subscribe/index.js +0 -24
  97. package/dist/subscribe/key-state.d.ts +0 -2
  98. package/dist/subscribe/key-state.js +0 -6
  99. package/dist/subscribe/mouse-state copy.d.ts +0 -2
  100. package/dist/subscribe/mouse-state copy.js +0 -6
  101. package/dist/subscribe/mouse-state.d.ts +0 -2
  102. package/dist/subscribe/mouse-state.js +0 -6
  103. package/dist/subscribe/primary-tool-state.d.ts +0 -2
  104. package/dist/subscribe/primary-tool-state.js +0 -10
  105. package/dist/subscribe/root.d.ts +0 -2
  106. package/dist/subscribe/root.js +0 -7
  107. package/dist/subscribe/system-state.d.ts +0 -1
  108. package/dist/subscribe/system-state.js +0 -3
  109. package/dist/subscribe/target-state.d.ts +0 -2
  110. package/dist/subscribe/target-state.js +0 -6
  111. package/dist/types/key-state.d.ts +0 -8
  112. package/dist/types/key-state.js +0 -1
  113. package/dist/types/mouse-state copy.d.ts +0 -8
  114. package/dist/types/mouse-state copy.js +0 -1
  115. package/dist/types/mouse-state.d.ts +0 -8
  116. package/dist/types/mouse-state.js +0 -1
  117. package/dist/types/primary-tool-state.d.ts +0 -8
  118. package/dist/types/primary-tool-state.js +0 -1
  119. package/dist/types/system-state.d.ts +0 -5
  120. package/dist/types/system-state.js +0 -1
  121. package/dist/types/target-state.d.ts +0 -8
  122. package/dist/types/target-state.js +0 -1
  123. package/src/__tests__/system-context.test.ts +0 -79
  124. package/src/apis/index.ts +0 -16
  125. package/src/apis/key-state.ts +0 -13
  126. package/src/apis/mouse-state.ts +0 -13
  127. package/src/apis/primary-tool-state.ts +0 -13
  128. package/src/apis/root.ts +0 -18
  129. package/src/apis/system-state.ts +0 -9
  130. package/src/apis/target-state.ts +0 -12
  131. package/src/index.ts +0 -4
  132. package/src/states/index.ts +0 -18
  133. package/src/states/key-state.ts +0 -21
  134. package/src/states/mouse-state.ts +0 -33
  135. package/src/states/primary-tool-state.ts +0 -15
  136. package/src/states/system-state.ts +0 -15
  137. package/src/states/target-state.ts +0 -23
  138. package/src/subscribe/index.ts +0 -34
  139. package/src/subscribe/key-state.ts +0 -8
  140. package/src/subscribe/mouse-state.ts +0 -8
  141. package/src/subscribe/primary-tool-state.ts +0 -17
  142. package/src/subscribe/system-state.ts +0 -3
  143. package/src/subscribe/target-state.ts +0 -8
  144. package/src/system-context.ts +0 -54
  145. package/src/types/deps.ts +0 -20
  146. package/src/types/index.ts +0 -24
  147. package/src/types/key-state.ts +0 -11
  148. package/src/types/mouse-state.ts +0 -11
  149. package/src/types/primary-tool-state.ts +0 -12
  150. package/src/types/root.ts +0 -7
  151. package/src/types/system-state.ts +0 -7
  152. package/src/types/target-state.ts +0 -11
  153. package/tsconfig.json +0 -17
  154. /package/dist/{__tests__/system-context.test.d.ts → types/managed-property-state.js} +0 -0
@@ -1,121 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for src/types/primary-tool-state.ts</title>
7
- <meta charset="utf-8" />
8
- <link rel="stylesheet" href="../../prettify.css" />
9
- <link rel="stylesheet" href="../../base.css" />
10
- <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <style type='text/css'>
13
- .coverage-summary .sorter {
14
- background-image: url(../../sort-arrow-sprite.png);
15
- }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <div class='wrapper'>
21
- <div class='pad1'>
22
- <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> primary-tool-state.ts</h1>
23
- <div class='clearfix'>
24
-
25
- <div class='fl pad1y space-right2'>
26
- <span class="strong">0% </span>
27
- <span class="quiet">Statements</span>
28
- <span class='fraction'>0/0</span>
29
- </div>
30
-
31
-
32
- <div class='fl pad1y space-right2'>
33
- <span class="strong">0% </span>
34
- <span class="quiet">Branches</span>
35
- <span class='fraction'>1/1</span>
36
- </div>
37
-
38
-
39
- <div class='fl pad1y space-right2'>
40
- <span class="strong">0% </span>
41
- <span class="quiet">Functions</span>
42
- <span class='fraction'>1/1</span>
43
- </div>
44
-
45
-
46
- <div class='fl pad1y space-right2'>
47
- <span class="strong">0% </span>
48
- <span class="quiet">Lines</span>
49
- <span class='fraction'>0/0</span>
50
- </div>
51
-
52
-
53
- </div>
54
- <p class="quiet">
55
- Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
- </p>
57
- <template id="filterTemplate">
58
- <div class="quiet">
59
- Filter:
60
- <input type="search" id="fileSearch">
61
- </div>
62
- </template>
63
- </div>
64
- <div class='status-line low'></div>
65
- <pre><table class="coverage">
66
- <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
- <a name='L2'></a><a href='#L2'>2</a>
68
- <a name='L3'></a><a href='#L3'>3</a>
69
- <a name='L4'></a><a href='#L4'>4</a>
70
- <a name='L5'></a><a href='#L5'>5</a>
71
- <a name='L6'></a><a href='#L6'>6</a>
72
- <a name='L7'></a><a href='#L7'>7</a>
73
- <a name='L8'></a><a href='#L8'>8</a>
74
- <a name='L9'></a><a href='#L9'>9</a>
75
- <a name='L10'></a><a href='#L10'>10</a>
76
- <a name='L11'></a><a href='#L11'>11</a>
77
- <a name='L12'></a><a href='#L12'>12</a>
78
- <a name='L13'></a><a href='#L13'>13</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
79
- <span class="cline-any cline-neutral">&nbsp;</span>
80
- <span class="cline-any cline-neutral">&nbsp;</span>
81
- <span class="cline-any cline-neutral">&nbsp;</span>
82
- <span class="cline-any cline-neutral">&nbsp;</span>
83
- <span class="cline-any cline-neutral">&nbsp;</span>
84
- <span class="cline-any cline-neutral">&nbsp;</span>
85
- <span class="cline-any cline-neutral">&nbsp;</span>
86
- <span class="cline-any cline-neutral">&nbsp;</span>
87
- <span class="cline-any cline-neutral">&nbsp;</span>
88
- <span class="cline-any cline-neutral">&nbsp;</span>
89
- <span class="cline-any cline-neutral">&nbsp;</span>
90
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { PrimaryToolType } from '@asyra/utils'
91
- &nbsp;
92
- export interface PrimaryToolStateRawAPIs {
93
- getCurrentPrimaryTool: () =&gt; PrimaryToolType
94
- }
95
- &nbsp;
96
- export interface PrimaryToolStateActionAPIs {
97
- switchPrimaryTool: (tool: PrimaryToolType) =&gt; void
98
- }
99
- &nbsp;
100
- export type PrimaryToolStateAPIs = PrimaryToolStateRawAPIs &amp;
101
- PrimaryToolStateActionAPIs
102
- &nbsp;</pre></td></tr></table></pre>
103
-
104
- <div class='push'></div><!-- for sticky footer -->
105
- </div><!-- /wrapper -->
106
- <div class='footer quiet pad2 space-top1 center small'>
107
- Code coverage generated by
108
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
109
- at 2026-01-20T18:50:39.117Z
110
- </div>
111
- <script src="../../prettify.js"></script>
112
- <script>
113
- window.onload = function () {
114
- prettyPrint();
115
- };
116
- </script>
117
- <script src="../../sorter.js"></script>
118
- <script src="../../block-navigation.js"></script>
119
- </body>
120
- </html>
121
-
@@ -1,106 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for src/types/root.ts</title>
7
- <meta charset="utf-8" />
8
- <link rel="stylesheet" href="../../prettify.css" />
9
- <link rel="stylesheet" href="../../base.css" />
10
- <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <style type='text/css'>
13
- .coverage-summary .sorter {
14
- background-image: url(../../sort-arrow-sprite.png);
15
- }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <div class='wrapper'>
21
- <div class='pad1'>
22
- <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> root.ts</h1>
23
- <div class='clearfix'>
24
-
25
- <div class='fl pad1y space-right2'>
26
- <span class="strong">0% </span>
27
- <span class="quiet">Statements</span>
28
- <span class='fraction'>0/0</span>
29
- </div>
30
-
31
-
32
- <div class='fl pad1y space-right2'>
33
- <span class="strong">0% </span>
34
- <span class="quiet">Branches</span>
35
- <span class='fraction'>1/1</span>
36
- </div>
37
-
38
-
39
- <div class='fl pad1y space-right2'>
40
- <span class="strong">0% </span>
41
- <span class="quiet">Functions</span>
42
- <span class='fraction'>1/1</span>
43
- </div>
44
-
45
-
46
- <div class='fl pad1y space-right2'>
47
- <span class="strong">0% </span>
48
- <span class="quiet">Lines</span>
49
- <span class='fraction'>0/0</span>
50
- </div>
51
-
52
-
53
- </div>
54
- <p class="quiet">
55
- Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
- </p>
57
- <template id="filterTemplate">
58
- <div class="quiet">
59
- Filter:
60
- <input type="search" id="fileSearch">
61
- </div>
62
- </template>
63
- </div>
64
- <div class='status-line low'></div>
65
- <pre><table class="coverage">
66
- <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
- <a name='L2'></a><a href='#L2'>2</a>
68
- <a name='L3'></a><a href='#L3'>3</a>
69
- <a name='L4'></a><a href='#L4'>4</a>
70
- <a name='L5'></a><a href='#L5'>5</a>
71
- <a name='L6'></a><a href='#L6'>6</a>
72
- <a name='L7'></a><a href='#L7'>7</a>
73
- <a name='L8'></a><a href='#L8'>8</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
74
- <span class="cline-any cline-neutral">&nbsp;</span>
75
- <span class="cline-any cline-neutral">&nbsp;</span>
76
- <span class="cline-any cline-neutral">&nbsp;</span>
77
- <span class="cline-any cline-neutral">&nbsp;</span>
78
- <span class="cline-any cline-neutral">&nbsp;</span>
79
- <span class="cline-any cline-neutral">&nbsp;</span>
80
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { SystemContextSnapshot } from '@asyra/utils'
81
- &nbsp;
82
- export interface RootRawAPIs {
83
- getSystemContextSnapshot: () =&gt; SystemContextSnapshot
84
- }
85
- &nbsp;
86
- export type RootAPIs = RootRawAPIs
87
- &nbsp;</pre></td></tr></table></pre>
88
-
89
- <div class='push'></div><!-- for sticky footer -->
90
- </div><!-- /wrapper -->
91
- <div class='footer quiet pad2 space-top1 center small'>
92
- Code coverage generated by
93
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
94
- at 2026-01-20T18:50:39.117Z
95
- </div>
96
- <script src="../../prettify.js"></script>
97
- <script>
98
- window.onload = function () {
99
- prettyPrint();
100
- };
101
- </script>
102
- <script src="../../sorter.js"></script>
103
- <script src="../../block-navigation.js"></script>
104
- </body>
105
- </html>
106
-
@@ -1,106 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for src/types/system-state.ts</title>
7
- <meta charset="utf-8" />
8
- <link rel="stylesheet" href="../../prettify.css" />
9
- <link rel="stylesheet" href="../../base.css" />
10
- <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <style type='text/css'>
13
- .coverage-summary .sorter {
14
- background-image: url(../../sort-arrow-sprite.png);
15
- }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <div class='wrapper'>
21
- <div class='pad1'>
22
- <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> system-state.ts</h1>
23
- <div class='clearfix'>
24
-
25
- <div class='fl pad1y space-right2'>
26
- <span class="strong">0% </span>
27
- <span class="quiet">Statements</span>
28
- <span class='fraction'>0/0</span>
29
- </div>
30
-
31
-
32
- <div class='fl pad1y space-right2'>
33
- <span class="strong">0% </span>
34
- <span class="quiet">Branches</span>
35
- <span class='fraction'>1/1</span>
36
- </div>
37
-
38
-
39
- <div class='fl pad1y space-right2'>
40
- <span class="strong">0% </span>
41
- <span class="quiet">Functions</span>
42
- <span class='fraction'>1/1</span>
43
- </div>
44
-
45
-
46
- <div class='fl pad1y space-right2'>
47
- <span class="strong">0% </span>
48
- <span class="quiet">Lines</span>
49
- <span class='fraction'>0/0</span>
50
- </div>
51
-
52
-
53
- </div>
54
- <p class="quiet">
55
- Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
- </p>
57
- <template id="filterTemplate">
58
- <div class="quiet">
59
- Filter:
60
- <input type="search" id="fileSearch">
61
- </div>
62
- </template>
63
- </div>
64
- <div class='status-line low'></div>
65
- <pre><table class="coverage">
66
- <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
- <a name='L2'></a><a href='#L2'>2</a>
68
- <a name='L3'></a><a href='#L3'>3</a>
69
- <a name='L4'></a><a href='#L4'>4</a>
70
- <a name='L5'></a><a href='#L5'>5</a>
71
- <a name='L6'></a><a href='#L6'>6</a>
72
- <a name='L7'></a><a href='#L7'>7</a>
73
- <a name='L8'></a><a href='#L8'>8</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
74
- <span class="cline-any cline-neutral">&nbsp;</span>
75
- <span class="cline-any cline-neutral">&nbsp;</span>
76
- <span class="cline-any cline-neutral">&nbsp;</span>
77
- <span class="cline-any cline-neutral">&nbsp;</span>
78
- <span class="cline-any cline-neutral">&nbsp;</span>
79
- <span class="cline-any cline-neutral">&nbsp;</span>
80
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { SystemMode } from '@asyra/utils'
81
- &nbsp;
82
- export interface SystemStateRawAPIs {
83
- getSystemMode: () =&gt; SystemMode
84
- }
85
- &nbsp;
86
- export type SystemStateAPIs = SystemStateRawAPIs
87
- &nbsp;</pre></td></tr></table></pre>
88
-
89
- <div class='push'></div><!-- for sticky footer -->
90
- </div><!-- /wrapper -->
91
- <div class='footer quiet pad2 space-top1 center small'>
92
- Code coverage generated by
93
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
94
- at 2026-01-20T18:50:39.117Z
95
- </div>
96
- <script src="../../prettify.js"></script>
97
- <script>
98
- window.onload = function () {
99
- prettyPrint();
100
- };
101
- </script>
102
- <script src="../../sorter.js"></script>
103
- <script src="../../block-navigation.js"></script>
104
- </body>
105
- </html>
106
-
@@ -1,118 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for src/types/target-state.ts</title>
7
- <meta charset="utf-8" />
8
- <link rel="stylesheet" href="../../prettify.css" />
9
- <link rel="stylesheet" href="../../base.css" />
10
- <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <style type='text/css'>
13
- .coverage-summary .sorter {
14
- background-image: url(../../sort-arrow-sprite.png);
15
- }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <div class='wrapper'>
21
- <div class='pad1'>
22
- <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> target-state.ts</h1>
23
- <div class='clearfix'>
24
-
25
- <div class='fl pad1y space-right2'>
26
- <span class="strong">0% </span>
27
- <span class="quiet">Statements</span>
28
- <span class='fraction'>0/0</span>
29
- </div>
30
-
31
-
32
- <div class='fl pad1y space-right2'>
33
- <span class="strong">0% </span>
34
- <span class="quiet">Branches</span>
35
- <span class='fraction'>1/1</span>
36
- </div>
37
-
38
-
39
- <div class='fl pad1y space-right2'>
40
- <span class="strong">0% </span>
41
- <span class="quiet">Functions</span>
42
- <span class='fraction'>1/1</span>
43
- </div>
44
-
45
-
46
- <div class='fl pad1y space-right2'>
47
- <span class="strong">0% </span>
48
- <span class="quiet">Lines</span>
49
- <span class='fraction'>0/0</span>
50
- </div>
51
-
52
-
53
- </div>
54
- <p class="quiet">
55
- Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
- </p>
57
- <template id="filterTemplate">
58
- <div class="quiet">
59
- Filter:
60
- <input type="search" id="fileSearch">
61
- </div>
62
- </template>
63
- </div>
64
- <div class='status-line low'></div>
65
- <pre><table class="coverage">
66
- <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
- <a name='L2'></a><a href='#L2'>2</a>
68
- <a name='L3'></a><a href='#L3'>3</a>
69
- <a name='L4'></a><a href='#L4'>4</a>
70
- <a name='L5'></a><a href='#L5'>5</a>
71
- <a name='L6'></a><a href='#L6'>6</a>
72
- <a name='L7'></a><a href='#L7'>7</a>
73
- <a name='L8'></a><a href='#L8'>8</a>
74
- <a name='L9'></a><a href='#L9'>9</a>
75
- <a name='L10'></a><a href='#L10'>10</a>
76
- <a name='L11'></a><a href='#L11'>11</a>
77
- <a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
78
- <span class="cline-any cline-neutral">&nbsp;</span>
79
- <span class="cline-any cline-neutral">&nbsp;</span>
80
- <span class="cline-any cline-neutral">&nbsp;</span>
81
- <span class="cline-any cline-neutral">&nbsp;</span>
82
- <span class="cline-any cline-neutral">&nbsp;</span>
83
- <span class="cline-any cline-neutral">&nbsp;</span>
84
- <span class="cline-any cline-neutral">&nbsp;</span>
85
- <span class="cline-any cline-neutral">&nbsp;</span>
86
- <span class="cline-any cline-neutral">&nbsp;</span>
87
- <span class="cline-any cline-neutral">&nbsp;</span>
88
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { TargetSnapshot } from '@asyra/utils'
89
- &nbsp;
90
- export interface TargetStateRawAPIs {
91
- getTargetState: () =&gt; TargetSnapshot
92
- }
93
- &nbsp;
94
- export interface TargetStateActionAPIs {
95
- updateHoveredElementId: (elementId: string | null) =&gt; void
96
- }
97
- &nbsp;
98
- export type TargetStateAPIs = TargetStateActionAPIs &amp; TargetStateRawAPIs
99
- &nbsp;</pre></td></tr></table></pre>
100
-
101
- <div class='push'></div><!-- for sticky footer -->
102
- </div><!-- /wrapper -->
103
- <div class='footer quiet pad2 space-top1 center small'>
104
- Code coverage generated by
105
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
106
- at 2026-01-20T18:50:39.117Z
107
- </div>
108
- <script src="../../prettify.js"></script>
109
- <script>
110
- window.onload = function () {
111
- prettyPrint();
112
- };
113
- </script>
114
- <script src="../../sorter.js"></script>
115
- <script src="../../block-navigation.js"></script>
116
- </body>
117
- </html>
118
-
@@ -1,63 +0,0 @@
1
- import { describe, it, expect, beforeEach } from 'vitest';
2
- import { SystemContext } from '../system-context';
3
- import { KeyState } from '../states/key-state';
4
- import { MouseState } from '../states/mouse-state';
5
- import { PrimaryToolState } from '../states/primary-tool-state';
6
- import { SystemState } from '../states/system-state';
7
- import { TargetState } from '../states/target-state';
8
- import { DefaultKeySnapshot, DefaultPosition, MouseButton, PrimaryToolType } from '@asyra/utils';
9
- describe('SystemContext', () => {
10
- let systemContext;
11
- let keyState;
12
- let mouseState;
13
- let primaryToolState;
14
- let systemState;
15
- let targetState;
16
- beforeEach(() => {
17
- keyState = new KeyState();
18
- mouseState = new MouseState();
19
- primaryToolState = new PrimaryToolState();
20
- systemState = new SystemState();
21
- targetState = new TargetState();
22
- systemContext = new SystemContext({
23
- keyState,
24
- mouseState,
25
- primaryToolState,
26
- systemState,
27
- targetState
28
- });
29
- });
30
- it('should initialize with the correct default state', () => {
31
- expect(systemContext.getKeyState()).toEqual(DefaultKeySnapshot);
32
- expect(systemContext.getMouseState()).toEqual({
33
- dragStart: DefaultPosition,
34
- position: DefaultPosition,
35
- delta: DefaultPosition,
36
- button: MouseButton.NONE,
37
- down: false,
38
- dragging: false
39
- });
40
- expect(systemContext.getCurrentPrimaryTool()).toEqual(PrimaryToolType.SELECT);
41
- });
42
- it('should update mouse state correctly', () => {
43
- const newMouseSnapshot = {
44
- position: { x: 100, y: 200 },
45
- delta: { x: 1, y: 1 },
46
- button: MouseButton.LEFT,
47
- down: true,
48
- dragging: true,
49
- dragStart: { x: 99, y: 199 }
50
- };
51
- systemContext.updateMouseState(newMouseSnapshot);
52
- expect(systemContext.getMouseState()).toEqual(newMouseSnapshot);
53
- });
54
- it('should update tool state correctly', () => {
55
- systemContext.switchPrimaryTool(PrimaryToolType.RECTANGLE);
56
- expect(systemContext.getCurrentPrimaryTool()).toEqual(PrimaryToolType.RECTANGLE);
57
- });
58
- it('should update key state correctly', () => {
59
- const newKeySnapshot = { ...DefaultKeySnapshot, shift: true };
60
- systemContext.updateKeyState(newKeySnapshot);
61
- expect(systemContext.getKeyState()).toEqual(newKeySnapshot);
62
- });
63
- });
@@ -1,2 +0,0 @@
1
- import { HandlerDeps, KeyStateAPIs } from '../types';
2
- export declare const createKeyStateAPIs: (keyState: HandlerDeps["keyState"]) => KeyStateAPIs;
@@ -1,8 +0,0 @@
1
- export const createKeyStateAPIs = (keyState) => ({
2
- updateKeyState(keySnapshot) {
3
- keyState.set(keySnapshot);
4
- },
5
- getKeyState() {
6
- return keyState.current;
7
- }
8
- });
@@ -1,2 +0,0 @@
1
- import { HandlerDeps, MouseStateAPIs } from '../types';
2
- export declare const createMouseStateAPIs: (mouseState: HandlerDeps["mouseState"]) => MouseStateAPIs;
@@ -1,8 +0,0 @@
1
- export const createMouseStateAPIs = (mouseState) => ({
2
- updateMouseState(mouseSnapshot) {
3
- mouseState.set(mouseSnapshot);
4
- },
5
- getMouseState() {
6
- return mouseState.current;
7
- }
8
- });
@@ -1,2 +0,0 @@
1
- import { HandlerDeps, MouseStateAPIs } from '../types';
2
- export declare const createMouseStateAPIs: (mouseState: HandlerDeps["mouseState"]) => MouseStateAPIs;
@@ -1,8 +0,0 @@
1
- export const createMouseStateAPIs = (mouseState) => ({
2
- updateMouseState(mouseSnapshot) {
3
- mouseState.set(mouseSnapshot);
4
- },
5
- getMouseState() {
6
- return mouseState.current;
7
- }
8
- });
@@ -1,2 +0,0 @@
1
- import { HandlerDeps, PrimaryToolStateAPIs } from '../types';
2
- export declare const createPrimaryToolStateAPIs: (primaryToolState: HandlerDeps["primaryToolState"]) => PrimaryToolStateAPIs;
@@ -1,8 +0,0 @@
1
- export const createPrimaryToolStateAPIs = (primaryToolState) => ({
2
- getCurrentPrimaryTool() {
3
- return primaryToolState.current;
4
- },
5
- switchPrimaryTool(tool) {
6
- primaryToolState.set(tool);
7
- }
8
- });
@@ -1,2 +0,0 @@
1
- import { HandlerDeps, SystemStateAPIs } from '../types';
2
- export declare const createSystemAPIs: (systemState: HandlerDeps["systemState"]) => SystemStateAPIs;
@@ -1,5 +0,0 @@
1
- export const createSystemAPIs = (systemState) => ({
2
- getSystemMode() {
3
- return systemState.mode;
4
- }
5
- });
@@ -1,2 +0,0 @@
1
- import { HandlerDeps, TargetStateAPIs } from '../types';
2
- export declare const createTargetStateAPIs: (targetState: HandlerDeps["targetState"]) => TargetStateAPIs;
@@ -1,8 +0,0 @@
1
- export const createTargetStateAPIs = (targetState) => ({
2
- updateHoveredElementId(elementId) {
3
- targetState.updateHoveredElementId(elementId);
4
- },
5
- getTargetState() {
6
- return targetState.current;
7
- }
8
- });
@@ -1,9 +0,0 @@
1
- import { KeySnapshot } from '@asyra/utils';
2
- export declare class KeyState {
3
- private _state;
4
- constructor();
5
- set(keySnapshot: KeySnapshot): void;
6
- get current(): import("@asyra/utils").ModifierKeys;
7
- }
8
- declare const _default: KeyState;
9
- export default _default;
@@ -1,16 +0,0 @@
1
- import { DefaultKeySnapshot } from '@asyra/utils';
2
- export class KeyState {
3
- _state;
4
- constructor() {
5
- this._state = {
6
- ...DefaultKeySnapshot
7
- };
8
- }
9
- set(keySnapshot) {
10
- this._state = { ...keySnapshot };
11
- }
12
- get current() {
13
- return this._state;
14
- }
15
- }
16
- export default new KeyState();
@@ -1,9 +0,0 @@
1
- import { MouseSnapshot } from '@asyra/utils';
2
- export declare class MouseState {
3
- private _state;
4
- constructor();
5
- set(mouseSnapshot: MouseSnapshot): void;
6
- get current(): MouseSnapshot;
7
- }
8
- declare const _default: MouseState;
9
- export default _default;