makethisbetter 1.3.0 → 1.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/widget/controller.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,oBAAoB,EAAc,MAAM,UAAU,CAAA;AAIhE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,GAAG,CAA2B;IACtC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,iBAAiB,CAAqC;IAC9D,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,mBAAmB,CAAmC;IAC9D,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,gBAAgB,CAAgC;gBAE5C,MAAM,EAAE,oBAAoB;IAcxC,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,uBAAuB;IA8B/B,OAAO,CAAC,SAAS;YAcH,YAAY;IAwC1B,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,OAAO;IAgBf,OAAO,IAAI,IAAI;CAWhB"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/widget/controller.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,oBAAoB,EAAc,MAAM,UAAU,CAAA;AAIhE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,GAAG,CAA2B;IACtC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,iBAAiB,CAAqC;IAC9D,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,mBAAmB,CAAmC;IAC9D,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,gBAAgB,CAAgC;gBAE5C,MAAM,EAAE,oBAAoB;IAcxC,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,uBAAuB;IA8B/B,OAAO,CAAC,SAAS;YAcH,YAAY;IA0C1B,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,OAAO;IAgBf,OAAO,IAAI,IAAI;CAWhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makethisbetter",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Make This Better JS Widget SDK — embed user feedback collection in any website",
5
5
  "type": "module",
6
6
  "main": "./dist/makethisbetter.cjs.js",
@@ -37,22 +37,14 @@
37
37
  "devDependencies": {
38
38
  "@vitest/coverage-v8": "^1.5.0",
39
39
  "jsdom": "^24.0.0",
40
- "rrweb": "^2.1.0",
41
40
  "typescript": "^5.4.0",
42
41
  "vite": "^5.2.0",
43
42
  "vitest": "^1.5.0"
44
43
  },
45
44
  "dependencies": {
45
+ "@rrweb/record": "^2.1.0",
46
46
  "html-to-image": "^1.11.11"
47
47
  },
48
- "peerDependencies": {
49
- "rrweb": "^2.1.0"
50
- },
51
- "peerDependenciesMeta": {
52
- "rrweb": {
53
- "optional": true
54
- }
55
- },
56
48
  "keywords": [
57
49
  "feedback",
58
50
  "widget",
@@ -10,7 +10,7 @@ const mockRecord = Object.assign(
10
10
 
11
11
  // Force the bundler import path to fail so start() exercises the CDN fallback,
12
12
  // mirroring the IIFE/CDN build where the bare specifier is unresolvable.
13
- vi.mock('rrweb', () => {
13
+ vi.mock('@rrweb/record', () => {
14
14
  throw new Error('rrweb not installed')
15
15
  })
16
16
 
@@ -12,7 +12,7 @@ const mockRecord = Object.assign(
12
12
  { addCustomEvent: mockAddCustomEvent },
13
13
  )
14
14
 
15
- vi.mock('rrweb', () => ({ record: mockRecord }))
15
+ vi.mock('@rrweb/record', () => ({ record: mockRecord }))
16
16
 
17
17
  function createMockShadow(): ShadowContainer {
18
18
  const elements: HTMLElement[] = []
@@ -34,7 +34,7 @@ function loadRrweb(): Promise<RRWebRecordFn> {
34
34
  }
35
35
 
36
36
  async function loadViaImport(): Promise<RRWebRecordFn> {
37
- const mod = await import('rrweb')
37
+ const mod = await import('@rrweb/record')
38
38
  return mod.record as unknown as RRWebRecordFn
39
39
  }
40
40
 
@@ -60,6 +60,8 @@ describe('MakeThisBetter widget flow', () => {
60
60
  await vi.waitFor(() => {
61
61
  expect(shadow.querySelector('.mtb-success-title')?.textContent).toBe('Thanks!')
62
62
  }, { timeout: 5000 })
63
+
64
+ expect(shadow.querySelector('.mtb-toolbar')).toBeNull()
63
65
  })
64
66
 
65
67
  it('skips the AI clarify chat when ai_clarify_available is false', async () => {
@@ -176,6 +176,8 @@ export class WidgetController {
176
176
  this.popup = null
177
177
  this.session?.destroy()
178
178
  this.session = null
179
+ this.toolbar?.destroy()
180
+ this.toolbar = null
179
181
  this.recordingManager?.destroy()
180
182
  this.recordingManager = null
181
183
  const skipFollowup = feedback.skip_followup === true || feedback.ai_clarify_available === false