@citolab/tspci 2.4.1 → 2.4.3
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/package.json +2 -2
- package/preset/preact/src/index.tsx +1 -1
- package/preset/preact/src/store.ts +1 -1
- package/public/index.html +22 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citolab/tspci",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "an opiniated typescript ims-pci builder with tao integration",
|
|
5
5
|
"author": "patrick <patrick.deklein@cito.nl>",
|
|
6
6
|
"repository": "@citolab/tspci",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"help": "tspci --help",
|
|
47
47
|
"init": "tspci init --force --path=../../pcis"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "332d6bc561050b4bd827c8abf9d9c0376b6870d7"
|
|
50
50
|
}
|
|
@@ -4,7 +4,7 @@ export type ActionType = "SET_INPUT" | "RESTORE_STATE";
|
|
|
4
4
|
export type StateModel = { input: number };
|
|
5
5
|
|
|
6
6
|
export const initStore = (initialState: StateModel, restoreData?: {
|
|
7
|
-
state
|
|
7
|
+
state?: StateModel;
|
|
8
8
|
actions: { type: string; payload: any; timestamp?: number }[];
|
|
9
9
|
}) => {
|
|
10
10
|
const store = new Store<StateModel>(initialState, restoreData);
|
package/public/index.html
CHANGED
|
@@ -137,18 +137,24 @@
|
|
|
137
137
|
function setResponse() {
|
|
138
138
|
const response = localStorage.getItem(item.typeIdentifier + "_response");
|
|
139
139
|
if (response) {
|
|
140
|
-
item.setResponse
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
if (item.setResponse) {
|
|
141
|
+
item.setResponse({
|
|
142
|
+
base: {
|
|
143
|
+
string: response,
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
alert("load response only when TAO interface is implemented");
|
|
149
|
+
}
|
|
145
150
|
} else {
|
|
146
151
|
alert("no response stored");
|
|
147
152
|
}
|
|
148
153
|
}
|
|
149
154
|
|
|
150
155
|
function saveResponse() {
|
|
151
|
-
|
|
156
|
+
const saveResponse = item.getResponse().base.string;
|
|
157
|
+
localStorage.setItem(item.typeIdentifier + "_response", saveResponse);
|
|
152
158
|
}
|
|
153
159
|
|
|
154
160
|
function compareResponse() {
|
|
@@ -182,7 +188,7 @@
|
|
|
182
188
|
|
|
183
189
|
function changeConfig(key, value) {
|
|
184
190
|
item.config.properties[key] = value;
|
|
185
|
-
item.trigger(`change${key}`, value);
|
|
191
|
+
item.trigger && item.trigger(`change${key}`, value);
|
|
186
192
|
}
|
|
187
193
|
|
|
188
194
|
function reConfig(key, value) {
|
|
@@ -258,7 +264,9 @@
|
|
|
258
264
|
<div class="d-flex flex-column">
|
|
259
265
|
<small class="text-muted">scoring TAO (match correct string)</small>
|
|
260
266
|
<div class="btn-group me-2 shadow-sm" role="group" aria-label="Basic checkbox toggle button group">
|
|
261
|
-
<button class="btn btn-outline-secondary" onClick="${() => saveResponse()}">
|
|
267
|
+
<button class="btn btn-outline-secondary position-relative" onClick="${() => saveResponse()}">
|
|
268
|
+
save
|
|
269
|
+
</button>
|
|
262
270
|
<button class="btn btn-outline-secondary" onClick="${() => compareResponse()}">compare</button>
|
|
263
271
|
<button class="btn btn-outline-secondary" onClick="${() => setResponse()}">load</button>
|
|
264
272
|
<button
|
|
@@ -285,27 +293,22 @@
|
|
|
285
293
|
</div>
|
|
286
294
|
</div>
|
|
287
295
|
</div>
|
|
288
|
-
${store && html`<div class="mt-
|
|
289
|
-
<div class="d-flex
|
|
296
|
+
${store && html`<div class="mt-3 d-flex flex-column gap-2">
|
|
297
|
+
<div class="d-flex gap-2 align-items-center">
|
|
290
298
|
<button class="btn btn-outline-secondary" onClick="${() => playState()}">
|
|
291
299
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play" viewBox="0 0 16 16">
|
|
292
300
|
<path d="M3.905 14.21a1 1 0 0 1-1.555-.832V2.622a1 1 0 0 1 1.555-.832l9.066 5.293a1 1 0 0 1 0 1.664l-9.066 5.293zm-.57-1.664L11.4 8 3.335 2.454v10.092z"/>
|
|
293
301
|
</svg>
|
|
294
302
|
</button>
|
|
295
|
-
<
|
|
296
|
-
|
|
297
|
-
<div class="d-flex gap-2">
|
|
298
|
-
<span>0</span>
|
|
299
|
-
<input
|
|
300
|
-
class="form-control-range flex-grow-1"
|
|
303
|
+
<div class="w-100 d-flex"><input
|
|
304
|
+
class="form-control-range w-100"
|
|
301
305
|
type="range"
|
|
302
306
|
min="0"
|
|
303
307
|
max="${maxRange}"
|
|
304
308
|
value=${currentRangeValue}
|
|
305
309
|
onInput=${(e) => scrubRange(e.target.value)}
|
|
306
310
|
step="1"
|
|
307
|
-
|
|
308
|
-
<span>${maxRange}</span>
|
|
311
|
+
/><div>${maxRange}</div></div>
|
|
309
312
|
</div>
|
|
310
313
|
</div>` }
|
|
311
314
|
|
|
@@ -335,7 +338,7 @@
|
|
|
335
338
|
item.getInstance(dom, config, state);
|
|
336
339
|
|
|
337
340
|
if (item.getResponse() !== undefined) {
|
|
338
|
-
document.getElementById("noresponse").style.display = "block";
|
|
341
|
+
// document.getElementById("noresponse").style.display = "block";
|
|
339
342
|
}
|
|
340
343
|
localStorage.removeItem(item.typeIdentifier + "_state");
|
|
341
344
|
}
|