@playpilot/tpi 8.29.7 → 8.29.9
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
package/src/lib/injection.ts
CHANGED
|
@@ -191,7 +191,7 @@ export function injectLinksInDocument(elements: HTMLElement[], injections: LinkI
|
|
|
191
191
|
|
|
192
192
|
const matchingElement = document.querySelector(`[${keyDataAttribute}="${injection.key}"]`)
|
|
193
193
|
const failed = isValidPlaylinkType(injection) && !injection.inactive && !injection.removed && !injection.after_article && !matchingElement
|
|
194
|
-
const containsSentence =
|
|
194
|
+
const containsSentence = fullText.includes(cleanPhrase(injection.sentence))
|
|
195
195
|
const failedMessage =
|
|
196
196
|
!failed ? '' :
|
|
197
197
|
failedMessages[injection.key] ||
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { fetchLinkInjections } from '$lib/api/externalPages'
|
|
2
3
|
import { Language } from '$lib/enums/Language'
|
|
3
4
|
import { SplitTest } from '$lib/enums/SplitTest'
|
|
4
5
|
import { destroyExplore, insertExplore, useExploreRouter } from '$lib/explore'
|
|
@@ -171,6 +172,12 @@
|
|
|
171
172
|
<hr />
|
|
172
173
|
|
|
173
174
|
<button onclick={onrerender}>Re-inject</button>
|
|
175
|
+
<button onclick={(event) => {
|
|
176
|
+
if (confirm('You sure? Rerunning the AI will take some time, refresh whenever')) {
|
|
177
|
+
fetchLinkInjections({ params: { run_ai: true }, method: 'POST' });
|
|
178
|
+
(event.target as HTMLButtonElement).disabled = true
|
|
179
|
+
}
|
|
180
|
+
}}>Re-run AI</button>
|
|
174
181
|
|
|
175
182
|
{#if isUsingBetaScript}
|
|
176
183
|
<small>You are using the beta version of TPI</small>
|
|
@@ -254,6 +261,11 @@
|
|
|
254
261
|
color: black;
|
|
255
262
|
background: theme(primary);
|
|
256
263
|
}
|
|
264
|
+
|
|
265
|
+
&:global([disabled]) {
|
|
266
|
+
opacity: 0.25;
|
|
267
|
+
cursor: not-allowed;
|
|
268
|
+
}
|
|
257
269
|
}
|
|
258
270
|
|
|
259
271
|
input[type="text"],
|