@playpilot/tpi 8.5.9 → 8.5.10-beta.1
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/build.html +3 -1
- package/dist/editorial.mount.js +2 -2
- package/dist/link-injections.js +2 -2
- package/dist/mount.js +2 -2
- package/package.json +1 -1
- package/src/main.ts +6 -2
- package/src/mount.ts +1 -1
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -37,6 +37,10 @@ window.PlayPilotLinkInjections = {
|
|
|
37
37
|
app: null,
|
|
38
38
|
|
|
39
39
|
async initialize(options = { token: '', selector: '', after_article_selector: '', after_article_insert_position: '', language: null, region: null, organization_sid: null, domain_sid: null, editorial_token: '', require_consent: true, no_affiliate: false }): Promise<void> {
|
|
40
|
+
if (window.PlayPilotLinkInjections.app) return
|
|
41
|
+
|
|
42
|
+
console.log('set')
|
|
43
|
+
|
|
40
44
|
if (!options.token) {
|
|
41
45
|
console.error('An API token is required.')
|
|
42
46
|
return
|
|
@@ -87,8 +91,8 @@ window.PlayPilotLinkInjections = {
|
|
|
87
91
|
const script = document.createElement('script')
|
|
88
92
|
|
|
89
93
|
script.id = 'playpilot-mount'
|
|
90
|
-
script.src = `https://cdn.jsdelivr.net/npm/@playpilot/tpi@${__SCRIPT_VERSION__}/dist/${shouldLoadEditorial ? 'editorial.' : ''}mount.js`
|
|
91
|
-
|
|
94
|
+
// script.src = `https://cdn.jsdelivr.net/npm/@playpilot/tpi@${__SCRIPT_VERSION__}/dist/${shouldLoadEditorial ? 'editorial.' : ''}mount.js`
|
|
95
|
+
script.src = './dist/mount.js' // Use me during development of this script
|
|
92
96
|
|
|
93
97
|
script.onload = () => window.PlayPilotMount?.mount()
|
|
94
98
|
|
package/src/mount.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { clearLinkInjections } from '$lib/injection'
|
|
|
4
4
|
|
|
5
5
|
window.PlayPilotMount = {
|
|
6
6
|
mount(): void {
|
|
7
|
-
if (window.PlayPilotLinkInjections.app)
|
|
7
|
+
if (window.PlayPilotLinkInjections.app) return
|
|
8
8
|
|
|
9
9
|
const target = document.createElement('div')
|
|
10
10
|
target.id = 'playpilot-link-injection'
|