@mushi-mushi/web 1.39.0 → 1.39.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
@@ -121,10 +121,18 @@ const mushi = Mushi.init({ /* ... */ });
121
121
  mushi.setScreen({ name: 'Chat', route: '/chat', feature: 'roleplay' });
122
122
  ```
123
123
 
124
- **Match your brand.** The widget uses your page's font and light/dark colors. Set an accent, theme, corner, language and hidden pages from code, the script tag (`data-accent="#7c3aed"`) or the console; text on the accent is kept readable for you ([theming guide](https://kensaur.us/mushi-mushi/docs/sdks/theming), with all 13 CSS tokens):
124
+ **Match your brand.** The widget uses your page's font and light/dark colors. Set the accent, theme, corner, language and hidden pages in the console; text on the accent is kept readable for you ([theming guide](https://kensaur.us/mushi-mushi/docs/sdks/theming), with all 13 CSS tokens). Your code needs only the app's identity:
125
125
 
126
126
  ```ts
127
- Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx', widget: { accent: '#7c3aed', position: 'bottom-left', hideOnRoutes: ['/admin/*'] } });
127
+ Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
128
+ ```
129
+
130
+ Look and position come from the console; set them in code only to lock them (your code's value wins).
131
+
132
+ **Lock in code.** A value set here, or on the script tag (`data-accent="#7c3aed"`), wins over the console, which can then no longer change it ([runtime config](https://kensaur.us/mushi-mushi/docs/concepts/runtime-config)):
133
+
134
+ ```ts
135
+ Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx', widget: { accent: '#7c3aed', position: 'bottom-left' } });
128
136
  ```
129
137
 
130
138
  Screenshots cannot capture cross-origin iframes or tainted `<canvas>` elements, and strict CSP can block them. Playwright and jsdom helpers live in `@mushi-mushi/web/test-utils`, which production bundles never load.
package/dist/index.cjs CHANGED
@@ -4688,8 +4688,10 @@ var MushiWidget = class _MushiWidget {
4688
4688
  void outcomeP.then((outcome) => {
4689
4689
  settled = outcome;
4690
4690
  });
4691
+ const sentFrom = this.openCount;
4691
4692
  this.successTimer = setTimeout(() => {
4692
4693
  this.successTimer = null;
4694
+ if (sentFrom !== this.openCount || !this.isOpen) return;
4693
4695
  if (isNotSentOutcome(settled)) {
4694
4696
  this.showNotSent(settled.failureKind, keptDrafts);
4695
4697
  return;
@@ -7370,7 +7372,7 @@ function createProactiveManager(config = {}) {
7370
7372
 
7371
7373
  // src/version.ts
7372
7374
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
7373
- var MUSHI_SDK_VERSION = "1.39.0" ;
7375
+ var MUSHI_SDK_VERSION = "1.39.2" ;
7374
7376
  function resolveReportAppVersion(config, environment) {
7375
7377
  if (config.appVersion) return config.appVersion;
7376
7378
  const vercelId = config.integrations?.vercel?.analyticsId;