shinkom 1.0.2 → 1.1.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.
- package/README.md +3 -2
- package/dist/bundles/_virtual/_rolldown/runtime.js +1 -1
- package/dist/bundles/core/constants.d.ts +1 -1
- package/dist/bundles/core/constants.js +5 -2
- package/dist/bundles/core/elements/compat-view-element.d.ts +100 -0
- package/dist/bundles/core/elements/compat-view-element.js +440 -0
- package/dist/bundles/core/elements/control-panel-element.d.ts +45 -0
- package/dist/bundles/core/elements/control-panel-element.js +99 -0
- package/dist/bundles/core/elements/index.d.ts +13 -0
- package/dist/bundles/core/elements/index.js +13 -0
- package/dist/bundles/core/elements/inspector-element.d.ts +27 -0
- package/dist/bundles/core/elements/inspector-element.js +58 -0
- package/dist/bundles/core/elements/recent-result-item.js +46 -0
- package/dist/bundles/core/elements/results-history-item.js +46 -0
- package/dist/bundles/core/elements/templates/compat-view.templates.js +462 -0
- package/dist/bundles/core/elements/templates/control-panel.templates.js +335 -0
- package/dist/bundles/core/elements/templates/root-styles.template.js +40 -0
- package/dist/bundles/core/event-bus.d.ts +19 -5
- package/dist/bundles/core/event-bus.js +21 -8
- package/dist/bundles/core/helpers.js +24 -2
- package/dist/bundles/core/index.d.ts +5 -2
- package/dist/bundles/core/index.js +6 -2
- package/dist/bundles/core/state-service.d.ts +24 -4
- package/dist/bundles/core/state-service.js +25 -5
- package/dist/bundles/core/ui-component.d.ts +25 -6
- package/dist/bundles/core/ui-component.js +31 -12
- package/dist/bundles/engine/engine.d.ts +57 -9
- package/dist/bundles/engine/engine.js +115 -31
- package/dist/bundles/engine/index.js +1 -1
- package/dist/bundles/gen/browser-data.js +36 -36
- package/dist/bundles/gen/browser-usage-data.js +224 -222
- package/dist/bundles/gen/compat-data.js +1 -1
- package/dist/bundles/gen/index.js +1 -1
- package/dist/bundles/index.d.ts +6 -2
- package/dist/bundles/index.js +8 -2
- package/dist/bundles/pkg/shinkore.d.ts +1 -1
- package/dist/bundles/pkg/shinkore.js +1 -1
- package/dist/bundles/pkg/shinkore_bg.wasm +0 -0
- package/dist/bundles/shinkom.d.ts +9 -1
- package/dist/bundles/shinkom.js +31 -6
- package/dist/bundles/types/public.d.ts +13 -29
- package/dist/bundles/types/types.d.ts +99 -0
- package/dist/bundles/ui/compat-ui/compat-ui.d.ts +12 -2
- package/dist/bundles/ui/compat-ui/compat-ui.js +12 -2
- package/dist/bundles/ui/compat-ui/index.js +8 -0
- package/dist/bundles/ui/compatibility-view/compatibility-view.d.ts +42 -0
- package/dist/bundles/ui/compatibility-view/compatibility-view.js +229 -0
- package/dist/bundles/ui/compatibility-view/index.js +8 -0
- package/dist/bundles/ui/control-panel/control-panel.d.ts +30 -16
- package/dist/bundles/ui/control-panel/control-panel.js +188 -277
- package/dist/bundles/ui/control-panel/index.js +8 -0
- package/dist/bundles/ui/index.d.ts +3 -2
- package/dist/bundles/ui/index.js +7 -2
- package/dist/bundles/ui/inspector/index.js +8 -0
- package/dist/bundles/ui/inspector/inspector.d.ts +60 -6
- package/dist/bundles/ui/inspector/inspector.js +149 -69
- package/dist/modules/core/constants.cjs +17 -1
- package/dist/modules/core/elements/compat-view-element.cjs +434 -0
- package/dist/modules/core/elements/control-panel-element.cjs +93 -0
- package/dist/modules/core/elements/index.cjs +11 -0
- package/dist/modules/core/elements/inspector-element.cjs +52 -0
- package/dist/modules/core/elements/recent-result-item.cjs +39 -0
- package/dist/modules/core/elements/results-history-item.cjs +39 -0
- package/dist/modules/core/elements/templates/compat-view.templates.cjs +458 -0
- package/dist/modules/core/elements/templates/control-panel.templates.cjs +332 -0
- package/dist/modules/core/elements/templates/root-styles.template.cjs +33 -0
- package/dist/modules/core/event-bus.cjs +43 -1
- package/dist/modules/core/helpers.cjs +41 -1
- package/dist/modules/core/index.cjs +16 -1
- package/dist/modules/core/state-service.cjs +74 -1
- package/dist/modules/core/ui-component.cjs +65 -1
- package/dist/modules/engine/engine.cjs +232 -1
- package/dist/modules/gen/browser-data.cjs +100 -1
- package/dist/modules/gen/browser-usage-data.cjs +675 -1
- package/dist/modules/gen/compat-data.cjs +31015 -1
- package/dist/modules/gen/index.cjs +7 -1
- package/dist/modules/index.cjs +27 -1
- package/dist/modules/pkg/shinkore.cjs +459 -1
- package/dist/modules/pkg/shinkore_bg.wasm +0 -0
- package/dist/modules/shinkom.cjs +73 -1
- package/dist/modules/ui/compat-ui/compat-ui.cjs +53 -1
- package/dist/modules/ui/compat-ui/index.cjs +1 -0
- package/dist/modules/ui/compatibility-view/compatibility-view.cjs +223 -0
- package/dist/modules/ui/compatibility-view/index.cjs +1 -0
- package/dist/modules/ui/control-panel/control-panel.cjs +314 -182
- package/dist/modules/ui/control-panel/index.cjs +1 -0
- package/dist/modules/ui/index.cjs +13 -1
- package/dist/modules/ui/inspector/index.cjs +1 -0
- package/dist/modules/ui/inspector/inspector.cjs +388 -1
- package/package.json +15 -8
- package/dist/bundles/node_modules/@mdn/browser-compat-data/types.d.ts +0 -78
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shinkom - core\elements\templates\control-panel
|
|
3
|
+
* @version 1.1.0
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright 2026 - OneilNvM
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
//#region src/core/elements/templates/control-panel.templates.js
|
|
9
|
+
const controlPanelHTML = `
|
|
10
|
+
<div style="position: relative">
|
|
11
|
+
<button id="sk-show-panel" class="sk-button-style sk-show-panel">
|
|
12
|
+
<svg style="display: block; pointer-events: none;" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
13
|
+
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
14
|
+
class="lucide lucide-panel-left-open-icon lucide-panel-left-open">
|
|
15
|
+
<rect width="18" height="18" x="3" y="3" rx="2" />
|
|
16
|
+
<path d="M9 3v18" />
|
|
17
|
+
<path d="m14 9 3 3-3 3" />
|
|
18
|
+
</svg>
|
|
19
|
+
</button>
|
|
20
|
+
<div part="control-panel" id="sk-control-panel" class="sk-control-panel" style="display: none;">
|
|
21
|
+
<div class="sk-control-panel-inner">
|
|
22
|
+
<nav class="sk-tabs-nav">
|
|
23
|
+
<button id="sk-inspector-tab" class="sk-tab-button">Inspector</button>
|
|
24
|
+
<div class="sk-tab-line"></div>
|
|
25
|
+
<button id="sk-compat-view-tab" class="sk-tab-button">Compatibility View</button>
|
|
26
|
+
</nav>
|
|
27
|
+
<hr class="sk-hr-line">
|
|
28
|
+
<main id="sk-control-panel-main" class="sk-control-panel-main"></main>
|
|
29
|
+
<hr class="sk-hr-line">
|
|
30
|
+
<footer class="sk-close">
|
|
31
|
+
<button id="sk-close-panel" class="sk-button-style">Close</button>
|
|
32
|
+
<span class="sk-copy">© 2026 Shinkom</span>
|
|
33
|
+
</footer>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
`;
|
|
38
|
+
const controlPanelInspectorTab = `
|
|
39
|
+
<div class="sk-multi-elements">
|
|
40
|
+
<p>Activate multi-element checking</p>
|
|
41
|
+
<label class="sk-multi-elements-checkbox-container">
|
|
42
|
+
<input id="sk-toggle-elements" type="checkbox">
|
|
43
|
+
<span class="sk-multi-elements-checkbox"></span>
|
|
44
|
+
</label>
|
|
45
|
+
<p>Enter a depth level</p>
|
|
46
|
+
<input id="sk-depth-level" class="sk-text-input" type="text" placeholder="depth_level">
|
|
47
|
+
</div>
|
|
48
|
+
<hr class="sk-hr-line">
|
|
49
|
+
<div class="sk-element-switching sk-section-grid">
|
|
50
|
+
<p>Toggle element switching</p>
|
|
51
|
+
<button id="sk-toggle-switching" class="sk-button-style">Disabled</button>
|
|
52
|
+
</div>
|
|
53
|
+
<hr class="sk-hr-line">
|
|
54
|
+
<div class="sk-inspector-toggling-container">
|
|
55
|
+
<div class="sk-inspector-toggling">
|
|
56
|
+
<p>Toggle the inspector</p>
|
|
57
|
+
<button id="sk-toggle-inspector" class="sk-button-style">Enabled</button>
|
|
58
|
+
</div>
|
|
59
|
+
<span class="sk-inspector-toggling-hint">Sets/ removes event listeners for the inspector, setting/
|
|
60
|
+
removing the override of click and
|
|
61
|
+
pointer events on the window object.</span>
|
|
62
|
+
</div>
|
|
63
|
+
<hr class="sk-hr-line">
|
|
64
|
+
<div class="sk-create-inspector-container sk-section-grid">
|
|
65
|
+
<p>Create inspector</p>
|
|
66
|
+
<button id="sk-create-inspector" class="sk-button-style">Create</button>
|
|
67
|
+
</div>
|
|
68
|
+
<hr class="sk-hr-line">
|
|
69
|
+
<div class="sk-reset-inspector-container sk-section-grid">
|
|
70
|
+
<p>Reset inspector</p>
|
|
71
|
+
<button id="sk-reset-inspector" class="sk-button-style">Reset</button>
|
|
72
|
+
</div>
|
|
73
|
+
<hr class="sk-hr-line">
|
|
74
|
+
<div class="sk-destroy-inspector-container sk-section-grid">
|
|
75
|
+
<p>Destroy inspector</p>
|
|
76
|
+
<button id="sk-destroy-inspector" class="sk-button-style">Destroy</button>
|
|
77
|
+
</div>
|
|
78
|
+
`;
|
|
79
|
+
const controlPanelCompatViewTab = `
|
|
80
|
+
<div class="sk-max-history-container sk-section-grid">
|
|
81
|
+
<p>Change maximum number of results stored in history</p>
|
|
82
|
+
<input id="sk-max-history" class="sk-text-input" type="text" placeholder="default is 10">
|
|
83
|
+
</div>
|
|
84
|
+
<hr class="sk-hr-line">
|
|
85
|
+
<div class="sk-clear-history-container sk-section-grid">
|
|
86
|
+
<p>Clear results history in localStorage</p>
|
|
87
|
+
<button id="sk-clear-history" class="sk-button-style">Clear</button>
|
|
88
|
+
</div>
|
|
89
|
+
`;
|
|
90
|
+
const controlPanelStyles = `
|
|
91
|
+
* {
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
margin: 0;
|
|
94
|
+
padding: 0;
|
|
95
|
+
}
|
|
96
|
+
.sk-control-panel {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
justify-content: space-evenly;
|
|
100
|
+
width: 30rem;
|
|
101
|
+
height: 40rem;
|
|
102
|
+
padding-block: 1rem;
|
|
103
|
+
background-image: linear-gradient(to bottom, var(--sk-primary) 0%, var(--sk-background-variant-1) 25% );
|
|
104
|
+
color: white;
|
|
105
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
106
|
+
border-radius: 1rem;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
}
|
|
109
|
+
.sk-control-panel * {
|
|
110
|
+
transition-property: color, background-color, border-color;
|
|
111
|
+
transition-duration: 300ms;
|
|
112
|
+
transition-timing-function: ease-in-out;
|
|
113
|
+
}
|
|
114
|
+
.sk-section-grid {
|
|
115
|
+
display: grid;
|
|
116
|
+
grid-template-columns: 1fr 1fr;
|
|
117
|
+
grid-template-rows: auto;
|
|
118
|
+
align-items: center;
|
|
119
|
+
padding-inline: 1rem;
|
|
120
|
+
padding-block: .5rem;
|
|
121
|
+
}
|
|
122
|
+
.sk-control-panel-inner {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
height: 100%;
|
|
126
|
+
}
|
|
127
|
+
.sk-tabs-nav {
|
|
128
|
+
position: relative;
|
|
129
|
+
display: grid;
|
|
130
|
+
grid-template-columns: 1fr 1fr;
|
|
131
|
+
grid-template-rows: auto;
|
|
132
|
+
align-items: center;
|
|
133
|
+
height: 2.5rem;
|
|
134
|
+
margin-bottom: 3rem;
|
|
135
|
+
}
|
|
136
|
+
.sk-tab-button {
|
|
137
|
+
color: white;
|
|
138
|
+
background: none;
|
|
139
|
+
border: none;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
font-size: var(--sk-text-xl);
|
|
142
|
+
}
|
|
143
|
+
.sk-tab-line {
|
|
144
|
+
position: absolute;
|
|
145
|
+
left: 50%;
|
|
146
|
+
top: 0;
|
|
147
|
+
height: 100%;
|
|
148
|
+
border-left: 1px solid var(--sk-accent);
|
|
149
|
+
}
|
|
150
|
+
.sk-button-style {
|
|
151
|
+
width: fit-content;
|
|
152
|
+
font-size: var(--sk-text-md);
|
|
153
|
+
color: white;
|
|
154
|
+
background-color: var(--sk-background-variant-2);
|
|
155
|
+
border: 1px solid var(--sk-secondary);
|
|
156
|
+
border-radius: .5rem;
|
|
157
|
+
padding-inline: 1.1rem;
|
|
158
|
+
padding-block: .3rem;
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
}
|
|
161
|
+
.sk-button-style:hover {
|
|
162
|
+
background-color: var(--sk-hover-color);
|
|
163
|
+
}
|
|
164
|
+
.sk-hr-line {
|
|
165
|
+
width: 100%;
|
|
166
|
+
border: 0px solid transparent;
|
|
167
|
+
border-top: 1px solid var(--sk-accent);
|
|
168
|
+
}
|
|
169
|
+
.sk-control-panel-main {
|
|
170
|
+
font-size: var(--sk-text-lg);
|
|
171
|
+
}
|
|
172
|
+
.sk-multi-elements {
|
|
173
|
+
display: grid;
|
|
174
|
+
grid-template-columns: 1fr 1fr;
|
|
175
|
+
grid-template-rows: auto;
|
|
176
|
+
align-items: center;
|
|
177
|
+
padding-inline: 1rem;
|
|
178
|
+
padding-block: 1.5rem;
|
|
179
|
+
gap: 1.1rem;
|
|
180
|
+
}
|
|
181
|
+
.sk-text-input {
|
|
182
|
+
width: 50%;
|
|
183
|
+
justify-self: center;
|
|
184
|
+
background-color: var(--sk-background-variant-2);
|
|
185
|
+
border: 1px solid var(--sk-secondary);
|
|
186
|
+
border-radius: .35rem;
|
|
187
|
+
padding: .25rem;
|
|
188
|
+
color: white;
|
|
189
|
+
text-align: center;
|
|
190
|
+
font-size: var(--sk-text-md);
|
|
191
|
+
}
|
|
192
|
+
.sk-multi-elements-checkbox-container {
|
|
193
|
+
width: fit-content;
|
|
194
|
+
height: fit-content;
|
|
195
|
+
justify-self: center;
|
|
196
|
+
padding: .1rem;
|
|
197
|
+
}
|
|
198
|
+
.sk-multi-elements-checkbox-container input {
|
|
199
|
+
position: absolute;
|
|
200
|
+
opacity: 0;
|
|
201
|
+
cursor: pointer;
|
|
202
|
+
height: 0;
|
|
203
|
+
width: 0;
|
|
204
|
+
}
|
|
205
|
+
.sk-multi-elements-checkbox-container:hover input ~ .sk-multi-elements-checkbox {
|
|
206
|
+
background-color: var(--sk-hover-color);
|
|
207
|
+
}
|
|
208
|
+
.sk-multi-elements-checkbox-container input:checked ~ .sk-multi-elements-checkbox::after {
|
|
209
|
+
position: absolute;
|
|
210
|
+
top: 5%;
|
|
211
|
+
left: 25%;
|
|
212
|
+
content: "✔";
|
|
213
|
+
color: white;
|
|
214
|
+
font-size: var(--sk-text-sm);
|
|
215
|
+
}
|
|
216
|
+
.sk-multi-elements-checkbox {
|
|
217
|
+
position: relative;
|
|
218
|
+
display: inline-block;
|
|
219
|
+
width: 1.5rem;
|
|
220
|
+
height: 1.5rem;
|
|
221
|
+
background-color: var(--sk-background-variant-2);
|
|
222
|
+
border: 1px solid var(--sk-secondary);
|
|
223
|
+
border-radius: .35rem;
|
|
224
|
+
}
|
|
225
|
+
.sk-element-switching {
|
|
226
|
+
gap: 1.1rem;
|
|
227
|
+
}
|
|
228
|
+
#sk-toggle-switching {
|
|
229
|
+
justify-self: center;
|
|
230
|
+
}
|
|
231
|
+
.sk-inspector-toggling-container {
|
|
232
|
+
padding-inline: 1rem;
|
|
233
|
+
padding-block: .5rem;
|
|
234
|
+
}
|
|
235
|
+
.sk-inspector-toggling {
|
|
236
|
+
display: grid;
|
|
237
|
+
grid-template-columns: 1fr 1fr;
|
|
238
|
+
grid-template-rows: auto;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 1.1rem;
|
|
241
|
+
}
|
|
242
|
+
#sk-toggle-inspector {
|
|
243
|
+
justify-self: center;
|
|
244
|
+
}
|
|
245
|
+
.sk-inspector-toggling-hint {
|
|
246
|
+
font-size: var(--sk-text-xs);
|
|
247
|
+
color: var(--sk-text-grey);
|
|
248
|
+
}
|
|
249
|
+
.sk-create-inspector-container {
|
|
250
|
+
gap: 1.1rem;
|
|
251
|
+
}
|
|
252
|
+
#sk-create-inspector {
|
|
253
|
+
justify-self: center;
|
|
254
|
+
}
|
|
255
|
+
.sk-reset-inspector-container {
|
|
256
|
+
gap: 1.1rem;
|
|
257
|
+
}
|
|
258
|
+
#sk-reset-inspector {
|
|
259
|
+
justify-self: center;
|
|
260
|
+
}
|
|
261
|
+
.sk-destroy-inspector-container {
|
|
262
|
+
gap: 1.1rem;
|
|
263
|
+
}
|
|
264
|
+
#sk-destroy-inspector {
|
|
265
|
+
justify-self: center;
|
|
266
|
+
}
|
|
267
|
+
.sk-close {
|
|
268
|
+
display: flex;
|
|
269
|
+
flex: 1 1 0%;
|
|
270
|
+
justify-content: space-between;
|
|
271
|
+
align-items: flex-end;
|
|
272
|
+
padding-inline: 1rem;
|
|
273
|
+
padding-top: 1.25rem;
|
|
274
|
+
}
|
|
275
|
+
.sk-copy {
|
|
276
|
+
color: var(--sk-text-grey);
|
|
277
|
+
}
|
|
278
|
+
.sk-show-panel {
|
|
279
|
+
width: fit-content;
|
|
280
|
+
position: absolute;
|
|
281
|
+
top: 1rem;
|
|
282
|
+
left: 1rem;
|
|
283
|
+
z-index: -1;
|
|
284
|
+
transition-property: color, background-color, border-color;
|
|
285
|
+
transition-duration: 300ms;
|
|
286
|
+
transition-timing-function: ease-in-out;
|
|
287
|
+
}
|
|
288
|
+
.sk-max-history-container {
|
|
289
|
+
gap: 1.1rem;
|
|
290
|
+
}
|
|
291
|
+
.sk-clear-history-container {
|
|
292
|
+
gap: 1.1rem;
|
|
293
|
+
}
|
|
294
|
+
#sk-clear-history {
|
|
295
|
+
justify-self: center;
|
|
296
|
+
}`;
|
|
297
|
+
const controlPanelTransitions = `
|
|
298
|
+
/* Control panel transition styles injected from Shinkom */
|
|
299
|
+
|
|
300
|
+
::part(control-panel) {
|
|
301
|
+
view-transition-name: control-panel;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@keyframes move-fade-in {
|
|
305
|
+
from {
|
|
306
|
+
opacity: 0;
|
|
307
|
+
transform: translateX(-2rem)
|
|
308
|
+
}
|
|
309
|
+
to {
|
|
310
|
+
opacity: 1;
|
|
311
|
+
transform: translateX(0rem)
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
@keyframes move-fade-out {
|
|
316
|
+
from {
|
|
317
|
+
opacity: 1;
|
|
318
|
+
transform: translateX(0rem);
|
|
319
|
+
}
|
|
320
|
+
to {
|
|
321
|
+
opacity: 0;
|
|
322
|
+
transform: translateX(-2rem);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
::view-transition-old(control-panel) {
|
|
327
|
+
animation: 300ms ease-out both move-fade-out;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
::view-transition-new(control-panel) {
|
|
331
|
+
animation: 300ms ease-out both move-fade-in;
|
|
332
|
+
}
|
|
333
|
+
`;
|
|
334
|
+
//#endregion
|
|
335
|
+
export { controlPanelCompatViewTab, controlPanelHTML, controlPanelInspectorTab, controlPanelStyles, controlPanelTransitions };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shinkom - core\elements\templates\root-styles
|
|
3
|
+
* @version 1.1.0
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright 2026 - OneilNvM
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
//#region src/core/elements/templates/root-styles.template.js
|
|
9
|
+
const hostStyles = `
|
|
10
|
+
:host {
|
|
11
|
+
--sk-primary: #050021;
|
|
12
|
+
--sk-secondary: #1E0074;
|
|
13
|
+
--sk-accent: #C9D1FF;
|
|
14
|
+
--sk-hover-color: #03001a;
|
|
15
|
+
--sk-background-variant-1: #191B1C;
|
|
16
|
+
--sk-background-variant-2: #1E1E1E;
|
|
17
|
+
--sk-background-variant-3: #0c0c0c;
|
|
18
|
+
|
|
19
|
+
--sk-text-grey: #5f5f5f;
|
|
20
|
+
--sk-results-blue-foreground: #3172ff;
|
|
21
|
+
--sk-results-yellow-foreground: #ffe600;
|
|
22
|
+
--sk-results-green-foreground: #40ff2f;
|
|
23
|
+
--sk-results-red-foreground: #ff2b2b;
|
|
24
|
+
--sk-indicator-green: #36ff46;
|
|
25
|
+
--sk-indicator-yellow: #fafe09;
|
|
26
|
+
--sk-indicator-red: #de291f;
|
|
27
|
+
--sk-indicator-blue: #1b72e4;
|
|
28
|
+
|
|
29
|
+
--sk-text-xs: 0.75rem;
|
|
30
|
+
--sk-text-sm: 0.875rem;
|
|
31
|
+
--sk-text-base: 1rem;
|
|
32
|
+
--sk-text-md: 1.075rem;
|
|
33
|
+
--sk-text-lg: 1.125rem;
|
|
34
|
+
--sk-text-xl: 1.25rem;
|
|
35
|
+
--sk-text-2xl: 1.5rem;
|
|
36
|
+
--sk-text-3xl: 2rem;
|
|
37
|
+
--sk-text-4xl: 3rem;
|
|
38
|
+
}`;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { hostStyles };
|
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shinkom - core
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - OneilNvM
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { ShinkomEventListener as ShinkomEventListener$1, ShinkomEventMap as ShinkomEventMap$1, ShinkomEventTarget as ShinkomEventTarget$1 } from "../types/
|
|
8
|
+
import { ShinkomEventListener as ShinkomEventListener$1, ShinkomEventMap as ShinkomEventMap$1, ShinkomEventTarget as ShinkomEventTarget$1 } from "../types/types.js";
|
|
9
9
|
|
|
10
10
|
//#region src/core/event-bus.d.ts
|
|
11
|
-
/**@typedef {import("../types/
|
|
12
|
-
/**@typedef {import("../types/
|
|
13
|
-
/**@typedef {import("../types/
|
|
11
|
+
/**@typedef {import("../types/types").ShinkomEventTarget} ShinkomEventTarget */
|
|
12
|
+
/**@typedef {import("../types/types").ShinkomEventMap} ShinkomEventMap */
|
|
13
|
+
/**@typedef {import("../types/types").ShinkomEventListener<keyof ShinkomEventMap>} ShinkomEventListener */
|
|
14
|
+
/**
|
|
15
|
+
* ShinkomBus is the application event bus used to coordinate cross-cutting
|
|
16
|
+
* actions across Shinkom UI components and the engine.
|
|
17
|
+
*
|
|
18
|
+
* It wraps a standard `EventTarget` and exposes a small typed API for
|
|
19
|
+
* emitting custom events and subscribing to them with cleanup support.
|
|
20
|
+
*/
|
|
14
21
|
declare class ShinkomBus {
|
|
15
22
|
/**
|
|
16
23
|
* Emits an event to the event bus.
|
|
24
|
+
*
|
|
17
25
|
* @param {string} event
|
|
18
26
|
* @param {object | undefined} detail
|
|
19
27
|
*/
|
|
20
28
|
emit(event: string, detail?: object | undefined): void;
|
|
21
29
|
/**
|
|
22
30
|
* Registers a listener on the event bus.
|
|
31
|
+
*
|
|
32
|
+
* The returned cleanup function removes the listener so callers can stop
|
|
33
|
+
* receiving events and avoid leaking handlers when the listener is no
|
|
34
|
+
* longer needed.
|
|
35
|
+
*
|
|
23
36
|
* @param {keyof ShinkomEventMap} eventName
|
|
24
37
|
* @param {Function} cb
|
|
38
|
+
* @returns {() => void} cleanup function
|
|
25
39
|
*/
|
|
26
40
|
on(eventName: keyof ShinkomEventMap, cb: Function): () => void;
|
|
27
41
|
#private;
|
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shinkom - core
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - OneilNvM
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
//#region src/core/event-bus.js
|
|
9
|
-
/**@typedef {import("../types/
|
|
10
|
-
/**@typedef {import("../types/
|
|
11
|
-
/**@typedef {import("../types/
|
|
9
|
+
/**@typedef {import("../types/types").ShinkomEventTarget} ShinkomEventTarget */
|
|
10
|
+
/**@typedef {import("../types/types").ShinkomEventMap} ShinkomEventMap */
|
|
11
|
+
/**@typedef {import("../types/types").ShinkomEventListener<keyof ShinkomEventMap>} ShinkomEventListener */
|
|
12
|
+
/**
|
|
13
|
+
* ShinkomBus is the application event bus used to coordinate cross-cutting
|
|
14
|
+
* actions across Shinkom UI components and the engine.
|
|
15
|
+
*
|
|
16
|
+
* It wraps a standard `EventTarget` and exposes a small typed API for
|
|
17
|
+
* emitting custom events and subscribing to them with cleanup support.
|
|
18
|
+
*/
|
|
12
19
|
var ShinkomBus = class {
|
|
13
|
-
/**@type {ShinkomEventTarget} */
|
|
14
20
|
#customEventTarget = new EventTarget();
|
|
15
21
|
/**
|
|
16
22
|
* Emits an event to the event bus.
|
|
17
|
-
*
|
|
18
|
-
* @param {
|
|
23
|
+
*
|
|
24
|
+
* @param {string} event
|
|
25
|
+
* @param {object | undefined} detail
|
|
19
26
|
*/
|
|
20
27
|
emit(event, detail = void 0) {
|
|
21
28
|
this.#customEventTarget.dispatchEvent(new CustomEvent(event, detail));
|
|
22
29
|
}
|
|
23
30
|
/**
|
|
24
31
|
* Registers a listener on the event bus.
|
|
25
|
-
*
|
|
32
|
+
*
|
|
33
|
+
* The returned cleanup function removes the listener so callers can stop
|
|
34
|
+
* receiving events and avoid leaking handlers when the listener is no
|
|
35
|
+
* longer needed.
|
|
36
|
+
*
|
|
37
|
+
* @param {keyof ShinkomEventMap} eventName
|
|
26
38
|
* @param {Function} cb
|
|
39
|
+
* @returns {() => void} cleanup function
|
|
27
40
|
*/
|
|
28
41
|
on(eventName, cb) {
|
|
29
42
|
/**@type {ShinkomEventListener} */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shinkom - core\helpers
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - OneilNvM
|
|
6
6
|
*/
|
|
@@ -21,5 +21,27 @@ const getModulePath = async (modulePath) => {
|
|
|
21
21
|
return path.pathToFileURL(__require.resolve(modulePath));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Splits a version string into parts.
|
|
26
|
+
* @param {string} version
|
|
27
|
+
* @returns {number[]} version number in parts
|
|
28
|
+
*/
|
|
29
|
+
function versionToParts(version) {
|
|
30
|
+
return version.replace(/^v/, "").split(".").map(Number);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates a CSSStyleSheet and applies styles to it.
|
|
34
|
+
* @param {CSSStyleSheet | null} cache
|
|
35
|
+
* @param {string} styles
|
|
36
|
+
* @returns {CSSStyleSheet | null} A CSS stylesheet
|
|
37
|
+
*/
|
|
38
|
+
function getStyleSheet(cache, styles) {
|
|
39
|
+
if (typeof window === "undefined") return null;
|
|
40
|
+
if (!cache) {
|
|
41
|
+
cache = new CSSStyleSheet();
|
|
42
|
+
cache.replaceSync(styles);
|
|
43
|
+
}
|
|
44
|
+
return cache;
|
|
45
|
+
}
|
|
24
46
|
//#endregion
|
|
25
|
-
export { getModulePath };
|
|
47
|
+
export { getModulePath, getStyleSheet, versionToParts };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shinkom - core
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - OneilNvM
|
|
6
6
|
*/
|
|
@@ -9,4 +9,7 @@ import { ShinkomBus } from "./event-bus.js";
|
|
|
9
9
|
import { DEFAULT_STATE } from "./constants.js";
|
|
10
10
|
import { ShinkomState } from "./state-service.js";
|
|
11
11
|
import { UIComponent } from "./ui-component.js";
|
|
12
|
-
|
|
12
|
+
import { CompatViewElement } from "./elements/compat-view-element.js";
|
|
13
|
+
import { CompatControlPanelElement } from "./elements/control-panel-element.js";
|
|
14
|
+
import { CompatInspectorElement } from "./elements/inspector-element.js";
|
|
15
|
+
export { CompatControlPanelElement, CompatInspectorElement, CompatViewElement, DEFAULT_STATE, ShinkomBus, ShinkomState, UIComponent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shinkom - core
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - OneilNvM
|
|
6
6
|
*/
|
|
@@ -9,4 +9,8 @@ import { ShinkomBus } from "./event-bus.js";
|
|
|
9
9
|
import { DEFAULT_STATE } from "./constants.js";
|
|
10
10
|
import { ShinkomState } from "./state-service.js";
|
|
11
11
|
import { UIComponent } from "./ui-component.js";
|
|
12
|
-
|
|
12
|
+
import { CompatViewElement } from "./elements/compat-view-element.js";
|
|
13
|
+
import { CompatControlPanelElement } from "./elements/control-panel-element.js";
|
|
14
|
+
import { CompatInspectorElement } from "./elements/inspector-element.js";
|
|
15
|
+
import "./elements/index.js";
|
|
16
|
+
export { CompatControlPanelElement, CompatInspectorElement, CompatViewElement, DEFAULT_STATE, ShinkomBus, ShinkomState, UIComponent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shinkom - core
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - OneilNvM
|
|
6
6
|
*/
|
|
@@ -8,8 +8,20 @@
|
|
|
8
8
|
import { UISharedState as UISharedState$1, UISharedStateProps as UISharedStateProps$1 } from "../types/public.js";
|
|
9
9
|
|
|
10
10
|
//#region src/core/state-service.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* ShinkomState provides shared UI state management for the application.
|
|
13
|
+
*
|
|
14
|
+
* It wraps a proxied state object and notifies subscribed listeners whenever
|
|
15
|
+
* a state property changes. Components can subscribe to update events and
|
|
16
|
+
* access the reactive state through `getState()`.
|
|
17
|
+
*/
|
|
11
18
|
declare class ShinkomState {
|
|
12
19
|
/**
|
|
20
|
+
* Initializes the shared state service.
|
|
21
|
+
*
|
|
22
|
+
* The returned state object is proxied so that property assignments
|
|
23
|
+
* automatically notify listeners when values change.
|
|
24
|
+
*
|
|
13
25
|
* @param {UISharedState} initalState
|
|
14
26
|
*/
|
|
15
27
|
constructor(initalState?: UISharedState);
|
|
@@ -19,13 +31,21 @@ declare class ShinkomState {
|
|
|
19
31
|
* @param {any} val
|
|
20
32
|
*/
|
|
21
33
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
34
|
+
* Subscribes a listener to state change notifications.
|
|
35
|
+
*
|
|
36
|
+
* When any property on the shared state changes, the callback receives the
|
|
37
|
+
* changed property and its new value.
|
|
38
|
+
*
|
|
24
39
|
* @param {Listener} callback
|
|
40
|
+
* @returns {() => void} cleanup function
|
|
25
41
|
*/
|
|
26
42
|
subscribe(callback: (prop: UISharedStateProps, val: any) => any): () => void;
|
|
27
43
|
/**
|
|
28
|
-
*
|
|
44
|
+
* Returns the proxied shared state object.
|
|
45
|
+
*
|
|
46
|
+
* Callers can read and write state properties directly, and writes will
|
|
47
|
+
* trigger listener notifications when values change.
|
|
48
|
+
*
|
|
29
49
|
* @returns {UISharedState}
|
|
30
50
|
*/
|
|
31
51
|
getState: () => UISharedState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shinkom - core
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - OneilNvM
|
|
6
6
|
*/
|
|
@@ -9,13 +9,25 @@ import { DEFAULT_STATE } from "./constants.js";
|
|
|
9
9
|
//#region src/core/state-service.js
|
|
10
10
|
/**@typedef {import('../types/public').UISharedState} UISharedState */
|
|
11
11
|
/**@typedef {import('../types/public').UISharedStateProps} UISharedStateProps */
|
|
12
|
+
/**
|
|
13
|
+
* ShinkomState provides shared UI state management for the application.
|
|
14
|
+
*
|
|
15
|
+
* It wraps a proxied state object and notifies subscribed listeners whenever
|
|
16
|
+
* a state property changes. Components can subscribe to update events and
|
|
17
|
+
* access the reactive state through `getState()`.
|
|
18
|
+
*/
|
|
12
19
|
var ShinkomState = class {
|
|
13
20
|
/**@type {UISharedState}*/
|
|
14
21
|
#state;
|
|
15
22
|
/**@type {function[]} */
|
|
16
23
|
#listeners = [];
|
|
17
24
|
/**
|
|
18
|
-
*
|
|
25
|
+
* Initializes the shared state service.
|
|
26
|
+
*
|
|
27
|
+
* The returned state object is proxied so that property assignments
|
|
28
|
+
* automatically notify listeners when values change.
|
|
29
|
+
*
|
|
30
|
+
* @param {UISharedState} initalState
|
|
19
31
|
*/
|
|
20
32
|
constructor(initalState = DEFAULT_STATE) {
|
|
21
33
|
const notify = (prop, val) => {
|
|
@@ -40,9 +52,13 @@ var ShinkomState = class {
|
|
|
40
52
|
* @param {any} val
|
|
41
53
|
*/
|
|
42
54
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
55
|
+
* Subscribes a listener to state change notifications.
|
|
56
|
+
*
|
|
57
|
+
* When any property on the shared state changes, the callback receives the
|
|
58
|
+
* changed property and its new value.
|
|
59
|
+
*
|
|
45
60
|
* @param {Listener} callback
|
|
61
|
+
* @returns {() => void} cleanup function
|
|
46
62
|
*/
|
|
47
63
|
subscribe(callback) {
|
|
48
64
|
this.#listeners.push(callback);
|
|
@@ -51,7 +67,11 @@ var ShinkomState = class {
|
|
|
51
67
|
};
|
|
52
68
|
}
|
|
53
69
|
/**
|
|
54
|
-
*
|
|
70
|
+
* Returns the proxied shared state object.
|
|
71
|
+
*
|
|
72
|
+
* Callers can read and write state properties directly, and writes will
|
|
73
|
+
* trigger listener notifications when values change.
|
|
74
|
+
*
|
|
55
75
|
* @returns {UISharedState}
|
|
56
76
|
*/
|
|
57
77
|
getState = () => this.#state;
|