Skip to content

Commit e407f25

Browse files
authored
Merge pull request #40 from GleapSDK/tooltipsnew
Tooltips
2 parents 570813b + 65a29bc commit e407f25

File tree

15 files changed

+682
-16
lines changed

15 files changed

+682
-16
lines changed

build/cjs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/esm/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

demo/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ <h2 class="sub-headline">
326326
}
327327

328328
</script>
329-
329+
<script>
330+
window.intercomSettings = {
331+
api_base: "https://api-iam.intercom.io",
332+
app_id: "vm8dcoo6"
333+
};
334+
</script>
330335
</body>
331336

332337
</html>

demo/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Gleap.on("tool-execution", (tool) => {
3535
3636
Gleap.setTicketAttribute("notes", "This is a test value.");*/
3737

38-
Gleap.initialize("ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV");
38+
Gleap.initialize("Vx0SXWPHGU7Af54CabNL07k6HRELKTxu");

package-lock.json

Lines changed: 25 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "13.5.16",
3+
"version": "13.6.0",
44
"main": "build/cjs/index.js",
55
"module": "build/esm/index.mjs",
66
"exports": {
@@ -70,7 +70,8 @@
7070
}
7171
},
7272
"dependencies": {
73+
"@floating-ui/dom": "^1.6.3",
7374
"pick-dom-element": "^0.2.3",
7475
"unique-selector": "^0.5.0"
7576
}
76-
}
77+
}

published/13.5.16/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/13.6.0/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gleap.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,50 @@ if (typeof window !== "undefined") {
11831183
}
11841184
}
11851185

1186+
const handleGleapLink = (href) => {
1187+
try {
1188+
// gleap://article/123
1189+
const urlParts = href.split('/');
1190+
const type = urlParts[2];
1191+
if (type === 'article') {
1192+
const identifier = urlParts[3];
1193+
Gleap.openHelpCenterArticle(identifier);
1194+
}
1195+
1196+
if (type === 'collection') {
1197+
const identifier = urlParts[3];
1198+
Gleap.openHelpCenterCollection(identifier);
1199+
}
1200+
1201+
if (type === 'survey') {
1202+
const identifier = urlParts[3];
1203+
Gleap.showSurvey(identifier);
1204+
}
1205+
1206+
if (type === 'bot') {
1207+
const identifier = urlParts[3];
1208+
Gleap.startBot(identifier);
1209+
}
1210+
1211+
if (type === 'news') {
1212+
const identifier = urlParts[3];
1213+
Gleap.openNews(identifier);
1214+
}
1215+
1216+
if (type === 'checklist') {
1217+
const identifier = urlParts[3];
1218+
Gleap.startChecklist(identifier);
1219+
}
1220+
1221+
if (type === 'tour') {
1222+
const identifier = urlParts[3];
1223+
Gleap.startProductTour(identifier);
1224+
}
1225+
} catch (e) {
1226+
console.error("Failed to handle Gleap link: ", href);
1227+
}
1228+
}
1229+
11861230
export {
11871231
GleapNetworkIntercepter,
11881232
GleapAudioManager,
@@ -1206,5 +1250,6 @@ export {
12061250
GleapFrameManager,
12071251
GleapMetaDataManager,
12081252
GleapTagManager,
1253+
handleGleapLink,
12091254
};
12101255
export default Gleap;

0 commit comments

Comments
 (0)