@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 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 load the bundle with a
45
- **classic** `<script>` (not `type="module"`, not imported by a bundler), and keep
46
- both files side by side when self-hosting. The budgets are checked at build time
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.0/dist/chatbot.global.js"></script>
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.0/dist/chatbot.global.js`.
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.0`,
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.0` never changes, so a release cannot alter a
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.