diff --git a/bun.lock b/bun.lock index 6ec75adb4..d68dbedc5 100644 --- a/bun.lock +++ b/bun.lock @@ -136,7 +136,7 @@ }, "integrations/front": { "name": "@gitbook/integration-front", - "version": "1.0.0", + "version": "1.0.1", "dependencies": { "@gitbook/runtime": "*", }, @@ -592,7 +592,7 @@ }, "integrations/slack": { "name": "@gitbook/integration-slack", - "version": "2.5.3", + "version": "2.6.0", "dependencies": { "@ai-sdk/openai": "^2.0.62", "@gitbook/api": "*", @@ -729,7 +729,7 @@ }, "packages/api": { "name": "@gitbook/api", - "version": "0.147.0", + "version": "0.151.0", "dependencies": { "event-iterator": "^2.0.0", "eventsource-parser": "^3.0.0", @@ -746,7 +746,7 @@ "name": "@gitbook/cli", "version": "0.26.2", "bin": { - "gitbook": "./cli.js", + "gitbook": "./cli.js" }, "dependencies": { "@1password/op-js": "^0.1.13", @@ -802,9 +802,6 @@ }, }, }, - "overrides": { - "@gitbook/openapi-parser": "^2.1.0", - }, "packages": { "@1password/op-js": ["@1password/op-js@0.1.13", "", { "dependencies": { "lookpath": "^1.2.2", "semver": "^7.6.2" } }, "sha512-ZZBLxVqywFdvIbLv2xWw2N1ImSi183rRKf90vV19KRMReNyLwuD0dv6IrKrIdrJU33IuV3Gz85Z4K2a1PJTBDg=="], diff --git a/integrations/front/CHANGELOG.md b/integrations/front/CHANGELOG.md index b945544e5..1b9065b43 100644 --- a/integrations/front/CHANGELOG.md +++ b/integrations/front/CHANGELOG.md @@ -1,5 +1,12 @@ # @gitbook/integration-front +## 1.0.1 + +### Bug Fixes + +- Fixed script injection to append to `` element instead of ``, matching Front's recommended implementation +- Removed duplicate `appendChild` call + ## 1.0.0 ### Major Changes diff --git a/integrations/front/package.json b/integrations/front/package.json index 98722edcc..2f9add89d 100644 --- a/integrations/front/package.json +++ b/integrations/front/package.json @@ -1,6 +1,6 @@ { "name": "@gitbook/integration-front", - "version": "1.0.0", + "version": "1.0.1", "private": true, "scripts": { "typecheck": "tsc --noEmit", diff --git a/integrations/front/src/script.raw.js b/integrations/front/src/script.raw.js index 0f3214a07..06a49a2fc 100644 --- a/integrations/front/src/script.raw.js +++ b/integrations/front/src/script.raw.js @@ -1,17 +1,17 @@ -(function (d, s) { +((d, s) => { const chatId = ''; d = document; s = d.createElement('script'); s.src = 'https://chat-assets.frontapp.com/v1/chat.bundle.js'; s.async = 1; - d.getElementsByTagName('head')[0].appendChild(s); - s.onload = function () { + s.onload = () => { if (window.FrontChat) { window.FrontChat('init', { chatId: chatId, useDefaultLauncher: true }); } }; - d.getElementsByTagName('head')[0].appendChild(s); + // Append to body (just before closing tag) as per Front's documentation + d.getElementsByTagName('body')[0].appendChild(s); })(window, document);