@citolab/tspci 2.4.0 → 2.4.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citolab/tspci",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
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": "3f39a92aa0d565cb5a0fc4b4f2d3102aab9402dc"
49
+ "gitHead": "c8d87c1b9f0270864b9df9dc3afcf1937e6583d4"
50
50
  }
@@ -55,7 +55,7 @@ class App implements IMSpci<PropTypes> {
55
55
  getState = () =>
56
56
  JSON.stringify({
57
57
  state: this.store.getState(),
58
- log: this.logActions,
58
+ log: this.store.getActions(),
59
59
  });
60
60
 
61
61
  getResponse = () => {
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
- base: {
142
- string: response,
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
- localStorage.setItem(item.typeIdentifier + "_response", item.getResponse().base.string);
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()}">save</button>
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-5 d-flex flex-column gap-2">
289
- <div class="d-flex justify-content-between">
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
- <span>${currentRangeValue}</span>
296
- </div>
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
  }