@playpilot/tpi 8.29.9 → 8.29.11

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.
@@ -138,12 +138,16 @@
138
138
 
139
139
  {#if value?.length}
140
140
  {#if Array.isArray(value)}
141
- {#each value as { label, data }}
142
- <div class="item">
143
- <span class="label">{label}</span>:
144
- <span class="data">{JSON.stringify(data)}</span>
145
- </div>
146
- {/each}
141
+ <table border="0" cellpadding="0">
142
+ <tbody>
143
+ {#each value as { label, data }}
144
+ <tr>
145
+ <td><span class="label">{label}</span></td>
146
+ <td><span class="data">{JSON.stringify(data)}</span></td>
147
+ </tr>
148
+ {/each}
149
+ </tbody>
150
+ </table>
147
151
  {/if}
148
152
  {:else}
149
153
  No data
@@ -293,12 +297,21 @@
293
297
  color: theme(primary);
294
298
  }
295
299
 
296
- .item {
300
+ table {
301
+ display: block;
302
+ max-width: 100%;
303
+ max-height: 15lh;
297
304
  white-space: nowrap;
298
305
  overflow-x: auto;
299
306
  scrollbar-width: thin;
300
307
  }
301
308
 
309
+ tr {
310
+ &:hover {
311
+ background: rgba(255, 255, 255, 0.15);
312
+ }
313
+ }
314
+
302
315
  .form-group {
303
316
  display: flex;
304
317
  align-items: center;
@@ -468,6 +468,17 @@ describe('injection.ts', () => {
468
468
  expect(results[3].failed_message).toBe('Injection was manually removed.')
469
469
  })
470
470
 
471
+ it('Should return sentence message if text was found in full body text but not in individual elements', () => {
472
+ document.body.innerHTML = '<article><p>Some sentence</p><p>that is broken in two</p></main>'
473
+
474
+ const elements = Array.from(document.body.querySelectorAll('p'))
475
+ const linkInjections = [generateInjection('Some sentence that is broken in two', 'broken')]
476
+
477
+ const results = injectLinksInDocument(elements, { aiInjections: linkInjections, manualInjections: [] })
478
+
479
+ expect(results[0].failed_message).toBe('Given sentence was not found in the article.')
480
+ })
481
+
471
482
  it('Should disregard spaces and special characters in failed message', () => {
472
483
  const sentence = 'This is a &amp; sentence with an injection.'
473
484
  document.body.innerHTML = `<p>${sentence}</p>`