makethisbetter 1.20.1 → 1.21.0

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
@@ -219,7 +219,7 @@ The SDK watches for signals that a user is struggling and proactively offers to
219
219
  | Rage click | 4+ clicks on the same interaction target within 1.5 seconds |
220
220
  | Interaction error | Uncaught error within 2 seconds after an interaction |
221
221
  | Dead click (DOM) | Command-style control with no response after 1 second |
222
- | Rapid navigation | 3+ user-initiated page navigations within 5 seconds |
222
+ | Rapid navigation | 3+ browser back/forward navigations within 5 seconds |
223
223
  | Form failure | The same form fails validation twice within 30 seconds |
224
224
  | Error page | Landing on a 404/500 error page |
225
225
 
@@ -264,7 +264,13 @@ MakeThisBetter.init({
264
264
  locale: 'en', // UI language. Unset: falls back to <html lang>, then 'en'
265
265
  position: 'right', // Tab position: 'left' | 'right'
266
266
  tabText: 'Feedback', // Label on the docked tab. Unset: the locale's own wording
267
- tabColor: '#2563eb', // Six-digit hex color for the docked tab
267
+ brandColors: { // Optional semantic colors for the complete Widget
268
+ primary: '#2563eb',
269
+ hover: '#1d4ed8',
270
+ active: '#1e40af',
271
+ onPrimary: '#ffffff',
272
+ },
273
+ tabColor: '#2563eb', // Legacy launcher-only color; ignored when brandColors is valid
268
274
  entryMode: 'button', // 'button' docks a tab | 'api' renders none
269
275
  theme: 'auto', // 'light' | 'dark' | 'auto'
270
276
  frustrationDetection: true, // Proactive frustration prompts
@@ -281,26 +287,39 @@ MakeThisBetter.init({
281
287
  })
282
288
  ```
283
289
 
284
- ### Launcher branding
290
+ ### Widget branding
285
291
 
286
- Use `tabText` and `tabColor` to match the docked Feedback button to your
287
- product. Keep the text short. Omit `tabText` to use the built-in translation for
288
- the active locale, and omit `tabColor` to keep the Make This Better green.
292
+ Use `brandColors` to apply your product's semantic colors across the launcher,
293
+ annotation tools, focus and selection states, calls to action, Reporter bubbles,
294
+ and AI decoration. Supply all four values as six-digit hex colors. The SDK uses
295
+ them exactly as provided and does not generate a color scale.
289
296
 
290
297
  ```js
291
298
  MakeThisBetter.init({
292
299
  projectKey: 'mtb_proj_xxx',
293
300
  tabText: 'Report a problem',
294
- tabColor: '#2563eb',
301
+ brandColors: {
302
+ primary: '#2563eb',
303
+ hover: '#1d4ed8',
304
+ active: '#1e40af',
305
+ onPrimary: '#ffffff',
306
+ },
295
307
  })
296
308
  ```
297
309
 
298
- `tabColor` accepts a six-digit hex color. The SDK derives darker hover and active
299
- states from it, then chooses light or dark button text for readable contrast.
300
- The setting affects only the docked launcher, not the annotation toolbar or
301
- feedback panels. Project Settings can generate this configuration for you; the
302
- `/makethisbetter setup` skill can also detect your website's primary color and
303
- ask whether to use it before editing your installation.
310
+ Success, error, warning, and recording colors keep their state meanings. An
311
+ incomplete group or any value that is not `#RRGGBB` rejects the complete group
312
+ and leaves the default Widget colors in place.
313
+
314
+ `tabColor` remains available for existing installations and for products that
315
+ only expose one brand color. It accepts one six-digit hex color, affects only
316
+ the docked launcher, and derives its launcher hover, active, and foreground
317
+ colors. When both options are present and `brandColors` is valid, `tabColor` is
318
+ ignored. Omit both options to keep the Make This Better green.
319
+
320
+ The `/makethisbetter setup` skill recommends `brandColors` only when it finds a
321
+ complete semantic group in your design system. When it finds only a primary
322
+ color, it offers `tabColor` instead; it never guesses the missing shades.
304
323
 
305
324
  `locale` is resolved once, in this order: the `locale` you pass, then the page's
306
325
  `<html lang>` attribute, then `en`. A tag with no exact match is retried without
@@ -19,7 +19,6 @@ export declare class FrustrationDetector {
19
19
  private boundPageLeaveHandler;
20
20
  private boundTurboNavigationHandler;
21
21
  private lastNavigationAt;
22
- private userNavigationIntentUntil;
23
22
  private boundSubmitHandler;
24
23
  private boundInvalidHandler;
25
24
  private recentSubmitForms;
@@ -1 +1 @@
1
- {"version":3,"file":"frustration.d.ts","sourceRoot":"","sources":["../../src/context/frustration.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GACzB,YAAY,GACZ,YAAY,GACZ,k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@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAgBnD,QAAA,MAAM,cAAc;iBACL,oBAAoB,GAAG,IAAI;eAkB7B,IAAI;sBAOG,MAAM,GAAG,IAAI;IAK/B;;;;OAIG;YACK,IAAI;aAIH,IAAI;IAIb,sFAAsF;oBACtE,IAAI;oBAIJ,IAAI;CAGrB,CAAA;AAED,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,YAAY,EAAE,oBAAoB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAsBnD,QAAA,MAAM,cAAc;iBACL,oBAAoB,GAAG,IAAI;eAc7B,IAAI;sBAKG,MAAM,GAAG,IAAI;IAK/B;;;;OAIG;YACK,IAAI;aAIH,IAAI;IAIb,sFAAsF;oBACtE,IAAI;oBAIJ,IAAI;CAGrB,CAAA;AAED,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,YAAY,EAAE,oBAAoB,EAAE,CAAA"}