@meetelise/chat
Advanced tools
Comparing version 1.0.0-rc.4 to 1.0.0-rc.5
{ | ||
"name": "@meetelise/chat", | ||
"version": "1.0.0-rc.4", | ||
"version": "1.0.0-rc.5", | ||
"description": "", | ||
@@ -25,2 +25,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/uuid": "^8.3.1", | ||
"concurrently": "^6.2.0", | ||
@@ -31,4 +32,5 @@ "esbuild": "^0.12.15", | ||
"dependencies": { | ||
"talkjs": "^0.14.5" | ||
"talkjs": "^0.14.5", | ||
"uuid": "^8.3.2" | ||
} | ||
} |
@@ -10,1 +10,18 @@ # chat-ui | ||
``` | ||
### Bookmarklet | ||
To preview the production chat widget on an ad-hoc website, you can use a bookmarklet. Create a bookmark in your browser, but instead of pasting in an http(s) URL, paste in the following code: | ||
```js | ||
javascript:((d) => { | ||
const s = d.createElement('script'); | ||
s.type = 'module'; | ||
let p = prompt('Enter an org/building URL pair', 'bainbridge/930-central-flats'); | ||
if (!p) return; | ||
s.src=`https://unpkg.com/@meetelise/chat#${p}`; | ||
d.body.appendChild(s); | ||
})(document); | ||
``` | ||
This bookmarklet will not work on some pages due to Content Security Policy (CSP) settings, but it will work on <https://get.meetelise.com/demo>. |
import Talk from 'talkjs'; | ||
import { Building } from './fetchBuildingInfo'; | ||
import { getChatID } from './getChatID'; | ||
@@ -7,3 +8,3 @@ export async function startTalkJS(building: Building): Promise<void> { | ||
const me = new Talk.User({ | ||
id: `lead_${(Math.random() * 1e8).toFixed(0)}`, | ||
id: 'anonymous', | ||
name: 'Me', | ||
@@ -25,9 +26,10 @@ email: null, | ||
}); | ||
const conversation = session.getOrCreateConversation( | ||
Talk.oneOnOneId(me, agent) | ||
); | ||
const conversation = session.getOrCreateConversation(getChatID()); | ||
conversation.setParticipant(me); | ||
conversation.setParticipant(agent); | ||
conversation.custom = { | ||
buildingId: building.id.toString(), | ||
}; | ||
const popup = session.createPopup(conversation); | ||
return popup.mount({ show: false }); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
17253
11
199
27
1
2
4
+ Addeduuid@^8.3.2
+ Addeduuid@8.3.2(transitive)