@squadico/chatbot 1.5.0 → 1.5.2
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/README.md +9 -7
- package/dist/{answer-CDGrP8YE.js → answer-BDuY6oLY.js} +242 -231
- package/dist/answer-BDuY6oLY.js.map +1 -0
- package/dist/answer-Bi8GWLyA.cjs +8 -0
- package/dist/answer-Bi8GWLyA.cjs.map +1 -0
- package/dist/chatbot.global.js +11 -11
- package/dist/chatbot.global.js.map +1 -1
- package/dist/{extras-lsCe4xgN.cjs → extras-BAqWS9pU.cjs} +2 -2
- package/dist/{extras-lsCe4xgN.cjs.map → extras-BAqWS9pU.cjs.map} +1 -1
- package/dist/{extras-ClIRRLqo.js → extras-BSCTuiit.js} +2 -2
- package/dist/{extras-ClIRRLqo.js.map → extras-BSCTuiit.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/useChat.d.ts.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/{src-BWDC0W4O.js → src-B7GLD1Xs.js} +62 -46
- package/dist/src-B7GLD1Xs.js.map +1 -0
- package/dist/src-DuYhMbNf.cjs +7 -0
- package/dist/src-DuYhMbNf.cjs.map +1 -0
- package/dist/widgets/extras-loader.d.ts +3 -2
- package/dist/widgets/extras-loader.d.ts.map +1 -1
- package/dist/widgets/inline.d.ts.map +1 -1
- package/dist/widgets.cjs +1 -1
- package/dist/widgets.js +2 -2
- package/package.json +1 -1
- package/dist/answer-CDGrP8YE.js.map +0 -1
- package/dist/answer-DRaV2dVt.cjs +0 -8
- package/dist/answer-DRaV2dVt.cjs.map +0 -1
- package/dist/src-BWDC0W4O.js.map +0 -1
- package/dist/src-DvrmRR89.cjs +0 -7
- package/dist/src-DvrmRR89.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -41,9 +41,11 @@ The standalone build is two files in `dist/`: `chatbot.global.js` (the chat,
|
|
|
41
41
|
Preact runtime and CSS included — under **30 kB gzip**) and
|
|
42
42
|
`chatbot-widgets.global.js` (the form, chart and tool-approval widgets, under 20 kB gzip),
|
|
43
43
|
which the chat fetches from beside its own script the first time an answer
|
|
44
|
-
needs it. That lookup reads `document.currentScript`, so
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
needs it. That lookup reads `document.currentScript`, so prefer a **classic**
|
|
45
|
+
`<script>`; loaded as `type="module"`, the bundle finds itself in the page by its
|
|
46
|
+
file name (`chatbot.global.js`, or the bare package URL on a CDN), so keep that
|
|
47
|
+
name. Do not import it through a bundler, and keep both files side by side when
|
|
48
|
+
self-hosting. The budgets are checked at build time
|
|
47
49
|
by `npm run size`.
|
|
48
50
|
|
|
49
51
|
## Implementation choices
|
|
@@ -312,7 +314,7 @@ and [unpkg](https://unpkg.com) as soon as a version is published — there is
|
|
|
312
314
|
nothing else to deploy. Add the script, then the tag, anywhere in the page:
|
|
313
315
|
|
|
314
316
|
```html
|
|
315
|
-
<script src="https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.5.
|
|
317
|
+
<script src="https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.5.2/dist/chatbot.global.js"></script>
|
|
316
318
|
<squadico-chatbot
|
|
317
319
|
embed-key="sq_pub_paste_yours_here"
|
|
318
320
|
context='{"workspaceId":"WS-1"}'
|
|
@@ -320,7 +322,7 @@ nothing else to deploy. Add the script, then the tag, anywhere in the page:
|
|
|
320
322
|
```
|
|
321
323
|
|
|
322
324
|
unpkg works the same way:
|
|
323
|
-
`https://unpkg.com/@squadico/chatbot@1.5.
|
|
325
|
+
`https://unpkg.com/@squadico/chatbot@1.5.2/dist/chatbot.global.js`.
|
|
324
326
|
|
|
325
327
|
The form an agent may ask the visitor to fill in, the charts it draws and the
|
|
326
328
|
Yes / No card of a tool call waiting on the visitor's approval live
|
|
@@ -328,14 +330,14 @@ in a second file, `chatbot-widgets.global.js`, published next to
|
|
|
328
330
|
`chatbot.global.js` in `dist/`. The chat loads it on its own, from the same
|
|
329
331
|
folder as its own script, the first time an answer holds a form, a chart or an approval — so it is never fetched by a conversation that does
|
|
330
332
|
not need it. A self-hosted copy must therefore keep both files side by side.
|
|
331
|
-
The short CDN URL (`https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.5.
|
|
333
|
+
The short CDN URL (`https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.5.2`,
|
|
332
334
|
served through the package's `jsdelivr` / `unpkg` fields) works too: a script URL
|
|
333
335
|
that does not end in `.js` is taken as the package root, and the extras file is
|
|
334
336
|
fetched from its `dist/` folder. The injected script carries the main script's
|
|
335
337
|
`nonce`, so a CSP built on nonces covers it. Until the file arrives — or if it
|
|
336
338
|
cannot — a form shows its field labels and a chart its filename, as plain text.
|
|
337
339
|
|
|
338
|
-
**Pin the version.** `@1.5.
|
|
340
|
+
**Pin the version.** `@1.5.2` never changes, so a release cannot alter a
|
|
339
341
|
customer page. Leaving it out (`@squadico/chatbot/dist/…`) serves the latest
|
|
340
342
|
version, cached by jsDelivr for up to 12 hours; a range such as `@1` follows the
|
|
341
343
|
newest `1.x.y`. Prefer a pinned version in production.
|