@cowprotocol/widget-lib 2.0.1 → 2.0.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.
Files changed (34) hide show
  1. package/{src/flexibleConfig.d.ts → flexibleConfig.d.ts} +1 -1
  2. package/index.cjs +1 -0
  3. package/index.js +217 -0
  4. package/package.json +13 -24
  5. package/{src/types.d.ts → types.d.ts} +1 -1
  6. package/CHANGELOG.md +0 -462
  7. package/src/IframeCowEventEmitter.js +0 -35
  8. package/src/IframeCowEventEmitter.js.map +0 -1
  9. package/src/IframeSafeSdkBridge.js +0 -53
  10. package/src/IframeSafeSdkBridge.js.map +0 -1
  11. package/src/cowSwapWidget.js +0 -189
  12. package/src/cowSwapWidget.js.map +0 -1
  13. package/src/flexibleConfig.js +0 -30
  14. package/src/flexibleConfig.js.map +0 -1
  15. package/src/index.js +0 -14
  16. package/src/index.js.map +0 -1
  17. package/src/resolveFlexibleConfigValues.js +0 -14
  18. package/src/resolveFlexibleConfigValues.js.map +0 -1
  19. package/src/themeUtils.js +0 -7
  20. package/src/themeUtils.js.map +0 -1
  21. package/src/types.js +0 -42
  22. package/src/types.js.map +0 -1
  23. package/src/urlUtils.js +0 -55
  24. package/src/urlUtils.js.map +0 -1
  25. package/src/widgetIframeTransport.js +0 -6
  26. package/src/widgetIframeTransport.js.map +0 -1
  27. /package/{src/IframeCowEventEmitter.d.ts → IframeCowEventEmitter.d.ts} +0 -0
  28. /package/{src/IframeSafeSdkBridge.d.ts → IframeSafeSdkBridge.d.ts} +0 -0
  29. /package/{src/cowSwapWidget.d.ts → cowSwapWidget.d.ts} +0 -0
  30. /package/{src/index.d.ts → index.d.ts} +0 -0
  31. /package/{src/resolveFlexibleConfigValues.d.ts → resolveFlexibleConfigValues.d.ts} +0 -0
  32. /package/{src/themeUtils.d.ts → themeUtils.d.ts} +0 -0
  33. /package/{src/urlUtils.d.ts → urlUtils.d.ts} +0 -0
  34. /package/{src/widgetIframeTransport.d.ts → widgetIframeTransport.d.ts} +0 -0
package/CHANGELOG.md DELETED
@@ -1,462 +0,0 @@
1
- # Changelog
2
-
3
- ## [2.0.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v2.0.0...widget-lib-v2.0.1) (2026-03-18)
4
-
5
-
6
- ### 🐛 Bug Fixes
7
-
8
- * update libs publising and bundling ([#7173](https://github.com/cowprotocol/cowswap/issues/7173)) ([e3bc5f1](https://github.com/cowprotocol/cowswap/commit/e3bc5f179124c11590a992789db43d912f8ee4a6))
9
-
10
-
11
- ### Dependencies
12
-
13
- * The following workspace dependencies were updated
14
- * dependencies
15
- * @cowprotocol/events bumped to 4.0.1
16
- * @cowprotocol/iframe-transport bumped to 2.0.9
17
-
18
- ## [2.0.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.3.0...widget-lib-v2.0.0) (2026-03-11)
19
-
20
-
21
- ### ⚠ BREAKING CHANGES
22
-
23
- * Remove support for Lens network ([#7128](https://github.com/cowprotocol/cowswap/issues/7128))
24
-
25
- ### ✨ Features
26
-
27
- * remove support for Lens network ([#7128](https://github.com/cowprotocol/cowswap/issues/7128)) ([ffdd36d](https://github.com/cowprotocol/cowswap/commit/ffdd36db765eb1feb7fc675347de40b1e6df2bdd))
28
-
29
-
30
- ### 🔧 Miscellaneous
31
-
32
- * **hotfix:** 2026-03-10 ([8c831f7](https://github.com/cowprotocol/cowswap/commit/8c831f70685c058f460d7a0fabbf2941163b9fba))
33
-
34
-
35
- ### Dependencies
36
-
37
- * The following workspace dependencies were updated
38
- * dependencies
39
- * @cowprotocol/events bumped to 4.0.0
40
- * @cowprotocol/iframe-transport bumped to 2.0.8
41
-
42
- ## [1.3.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.2.2...widget-lib-v1.3.0) (2026-03-10)
43
-
44
-
45
- ### ✨ Features
46
-
47
- * integrate non-evm sdk changes ([#7085](https://github.com/cowprotocol/cowswap/issues/7085)) ([674602e](https://github.com/cowprotocol/cowswap/commit/674602e19bd97197a98733da51cda186d256384e))
48
-
49
-
50
- ### 🐛 Bug Fixes
51
-
52
- * use correct amounts to sign instead of afterSlippage ([#7022](https://github.com/cowprotocol/cowswap/issues/7022)) ([b1020c4](https://github.com/cowprotocol/cowswap/commit/b1020c44615b49c5f05f0a6dcf0d21b96b628846))
53
-
54
-
55
- ### 🔧 Miscellaneous
56
-
57
- * **release:** 2026-03-04 ([5612b59](https://github.com/cowprotocol/cowswap/commit/5612b59d690f9081e62d9efc5ea80774428f0366))
58
-
59
-
60
- ### Dependencies
61
-
62
- * The following workspace dependencies were updated
63
- * dependencies
64
- * @cowprotocol/events bumped to 3.4.0
65
- * @cowprotocol/iframe-transport bumped to 2.0.7
66
-
67
- ## [1.2.2](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.2.1...widget-lib-v1.2.2) (2026-02-25)
68
-
69
-
70
- ### 🔧 Miscellaneous
71
-
72
- * main -> dev ([9c6611e](https://github.com/cowprotocol/cowswap/commit/9c6611e90a4b23e23f6aaadc513de3c6d7f3b562))
73
-
74
-
75
- ### Dependencies
76
-
77
- * The following workspace dependencies were updated
78
- * dependencies
79
- * @cowprotocol/events bumped to 3.3.2
80
- * @cowprotocol/iframe-transport bumped to 2.0.6
81
-
82
- ## [1.2.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.2.0...widget-lib-v1.2.1) (2026-02-24)
83
-
84
-
85
- ### 🔧 Miscellaneous
86
-
87
- * merge main into dev 23 02 ([#7062](https://github.com/cowprotocol/cowswap/issues/7062)) ([ac48c9c](https://github.com/cowprotocol/cowswap/commit/ac48c9c83284c6228ba71392edc1c1e0483b53ff))
88
-
89
-
90
- ### Dependencies
91
-
92
- * The following workspace dependencies were updated
93
- * dependencies
94
- * @cowprotocol/events bumped to 3.3.1
95
- * @cowprotocol/iframe-transport bumped to 2.0.5
96
-
97
- ## [1.2.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.1.2...widget-lib-v1.2.0) (2026-02-20)
98
-
99
-
100
- ### ✨ Features
101
-
102
- * **chains:** disable Lens and support deprecating networks ([#7028](https://github.com/cowprotocol/cowswap/issues/7028)) ([c12d6c2](https://github.com/cowprotocol/cowswap/commit/c12d6c21ad69258c587378add9da86d72ff755b2))
103
-
104
-
105
- ### Dependencies
106
-
107
- * The following workspace dependencies were updated
108
- * dependencies
109
- * @cowprotocol/events bumped to 3.3.0
110
- * @cowprotocol/iframe-transport bumped to 2.0.4
111
-
112
- ## [1.1.2](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.1.1...widget-lib-v1.1.2) (2026-02-13)
113
-
114
-
115
- ### Dependencies
116
-
117
- * The following workspace dependencies were updated
118
- * dependencies
119
- * @cowprotocol/events bumped to 3.2.0
120
- * @cowprotocol/iframe-transport bumped to 2.0.3
121
-
122
- ## [1.1.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.1.0...widget-lib-v1.1.1) (2026-02-10)
123
-
124
-
125
- ### 🐛 Bug Fixes
126
-
127
- * **widget-lib:** clean up code ([#6992](https://github.com/cowprotocol/cowswap/issues/6992)) ([39d9f97](https://github.com/cowprotocol/cowswap/commit/39d9f97966e0a80dbc6b1232676fd18333070e1a))
128
-
129
- ## [1.1.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.0.1...widget-lib-v1.1.0) (2026-02-05)
130
-
131
-
132
- ### ✨ Features
133
-
134
- * **trade:** upload appData to IPFS before signing ([#6922](https://github.com/cowprotocol/cowswap/issues/6922)) ([cb94104](https://github.com/cowprotocol/cowswap/commit/cb9410470c549bd5453a7933a0a224ba706ec2c2))
135
-
136
-
137
- ### 🔧 Miscellaneous
138
-
139
- * update sdk ([a20814b](https://github.com/cowprotocol/cowswap/commit/a20814b7caf16f495cd0292d5f3469bc552e4d97))
140
-
141
-
142
- ### Dependencies
143
-
144
- * The following workspace dependencies were updated
145
- * dependencies
146
- * @cowprotocol/events bumped to 3.1.0
147
- * @cowprotocol/iframe-transport bumped to 2.0.2
148
-
149
- ## [1.0.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v1.0.0...widget-lib-v1.0.1) (2026-02-02)
150
-
151
-
152
- ### Bug Fixes
153
-
154
- * **protocol-fee:** support decimals in protocol fee ([#6948](https://github.com/cowprotocol/cowswap/issues/6948)) ([a572bbe](https://github.com/cowprotocol/cowswap/commit/a572bbe2899b0a48b2c0891922442a4420f6c3ef))
155
-
156
-
157
- ### Dependencies
158
-
159
- * The following workspace dependencies were updated
160
- * dependencies
161
- * @cowprotocol/events bumped to 3.0.1
162
- * @cowprotocol/iframe-transport bumped to 2.0.1
163
-
164
- ## [1.0.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.22.3...widget-lib-v1.0.0) (2026-01-28)
165
-
166
-
167
- ### ⚠ BREAKING CHANGES
168
-
169
- * migrate from yarn to pnpm ([#6847](https://github.com/cowprotocol/cowswap/issues/6847))
170
-
171
- ### Features
172
-
173
- * migrate from yarn to pnpm ([#6847](https://github.com/cowprotocol/cowswap/issues/6847)) ([1c5d115](https://github.com/cowprotocol/cowswap/commit/1c5d11516d0ddb997b0ebbb4eee4adcb491204a4))
174
-
175
-
176
- ### Dependencies
177
-
178
- * The following workspace dependencies were updated
179
- * dependencies
180
- * @cowprotocol/events bumped to 3.0.0
181
- * @cowprotocol/iframe-transport bumped to 2.0.0
182
-
183
- ## [0.22.3](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.22.2...widget-lib-v0.22.3) (2026-01-26)
184
-
185
-
186
- ### Dependencies
187
-
188
- * The following workspace dependencies were updated
189
- * dependencies
190
- * @cowprotocol/iframe-transport bumped from ^1.1.1 to ^1.2.0
191
-
192
- ## [0.22.2](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.22.1...widget-lib-v0.22.2) (2026-01-26)
193
-
194
-
195
- ### Bug Fixes
196
-
197
- * **widget-lib:** add compatibility with server rendering ([#6813](https://github.com/cowprotocol/cowswap/issues/6813)) ([76bd736](https://github.com/cowprotocol/cowswap/commit/76bd736f17d722f0a639542d4fcbd5e3f0be57b2))
198
-
199
- ## [0.22.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.22.0...widget-lib-v0.22.1) (2025-12-24)
200
-
201
-
202
- ### Dependencies
203
-
204
- * The following workspace dependencies were updated
205
- * dependencies
206
- * @cowprotocol/events bumped from ^2.0.2 to ^2.1.0
207
-
208
- ## [0.22.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.21.1...widget-lib-v0.22.0) (2025-12-22)
209
-
210
-
211
- ### Features
212
-
213
- * **widget:** option to disable bridging ([#6730](https://github.com/cowprotocol/cowswap/issues/6730)) ([7fc3949](https://github.com/cowprotocol/cowswap/commit/7fc3949f5d656709e3f812499870313cc3b41b9f))
214
-
215
- ## [0.21.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.21.0...widget-lib-v0.21.1) (2025-12-16)
216
-
217
-
218
- ### Dependencies
219
-
220
- * The following workspace dependencies were updated
221
- * dependencies
222
- * @cowprotocol/events bumped from ^2.0.1 to ^2.0.2
223
-
224
- ## [0.21.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.20.0...widget-lib-v0.21.0) (2025-11-24)
225
-
226
-
227
- ### Features
228
-
229
- * **internationalization:** add internationalization to CoW Swap ([#6198](https://github.com/cowprotocol/cowswap/issues/6198)) ([bec1e54](https://github.com/cowprotocol/cowswap/commit/bec1e54643d9b20a8b6517eae188993e364fed90))
230
-
231
-
232
- ### Dependencies
233
-
234
- * The following workspace dependencies were updated
235
- * dependencies
236
- * @cowprotocol/events bumped from ^1.6.1 to ^2.0.1
237
-
238
- ## [0.20.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.19.2...widget-lib-v0.20.0) (2025-07-10)
239
-
240
-
241
- ### Features
242
-
243
- * **trade:** slippage config for integrators ([#5906](https://github.com/cowprotocol/cowswap/issues/5906)) ([cbfa3b1](https://github.com/cowprotocol/cowswap/commit/cbfa3b142571df7bdf55919b8ae6df986017aeab))
244
-
245
- ## [0.19.2](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.19.1...widget-lib-v0.19.2) (2025-06-18)
246
-
247
-
248
- ### Bug Fixes
249
-
250
- * make order progress bar UI more stable ([#5834](https://github.com/cowprotocol/cowswap/issues/5834)) ([80cebd1](https://github.com/cowprotocol/cowswap/commit/80cebd1104a0a2e30e12ce8a4b3d62c212559cec))
251
-
252
- ## [0.19.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.19.0...widget-lib-v0.19.1) (2025-05-19)
253
-
254
-
255
- ### Bug Fixes
256
-
257
- * **dev-deps-update:** bump the dev-deps group with 76 updates ([#5663](https://github.com/cowprotocol/cowswap/issues/5663)) ([552b349](https://github.com/cowprotocol/cowswap/commit/552b349f53762a01ccf008e9a2083248424cbafa))
258
-
259
- ## [0.19.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.18.1...widget-lib-v0.19.0) (2025-03-27)
260
-
261
-
262
- ### Features
263
-
264
- * **widget:** allow passing targetChainId for bridge ([#5523](https://github.com/cowprotocol/cowswap/issues/5523)) ([8572095](https://github.com/cowprotocol/cowswap/commit/85720957f2aaf1e8f67d745642f09bf3403ed8a5))
265
-
266
- ## [0.18.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.18.0...widget-lib-v0.18.1) (2025-02-05)
267
-
268
-
269
- ### Bug Fixes
270
-
271
- * **safe-app:** remove approval+order placement bundling banner ([#5393](https://github.com/cowprotocol/cowswap/issues/5393)) ([571029d](https://github.com/cowprotocol/cowswap/commit/571029d11f7c2d1afe608f8dd3481c404e0efea0))
272
-
273
- ## [0.18.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.17.0...widget-lib-v0.18.0) (2024-12-03)
274
-
275
-
276
- ### Features
277
-
278
- * **widget:** add maxHeight parameter for the widget ([#5127](https://github.com/cowprotocol/cowswap/issues/5127)) ([db8b509](https://github.com/cowprotocol/cowswap/commit/db8b509d2d46d1ef5e52a18347d20bbebe96dbbd))
279
-
280
- ## [0.17.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.16.0...widget-lib-v0.17.0) (2024-10-29)
281
-
282
-
283
- ### Features
284
-
285
- * setup vampire attack widget ([#4950](https://github.com/cowprotocol/cowswap/issues/4950)) ([99c4c42](https://github.com/cowprotocol/cowswap/commit/99c4c42aec60a734a37926935be5dca6cd4cf11c))
286
-
287
- ## [0.16.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.15.0...widget-lib-v0.16.0) (2024-10-18)
288
-
289
-
290
- ### Features
291
-
292
- * **widget:** deadline widget param ([#4991](https://github.com/cowprotocol/cowswap/issues/4991)) ([ce3b5b8](https://github.com/cowprotocol/cowswap/commit/ce3b5b8adb5cc95a5ca3097d5cf2d45b249748c2))
293
- * **widget:** hide bridge info ([#4992](https://github.com/cowprotocol/cowswap/issues/4992)) ([9842afd](https://github.com/cowprotocol/cowswap/commit/9842afdb887497d235a01538663488b0b8852bb5))
294
- * **widget:** hide orders table ([#4993](https://github.com/cowprotocol/cowswap/issues/4993)) ([681fb20](https://github.com/cowprotocol/cowswap/commit/681fb20dab0b4155d50ad7f32c7a48cb95e084a3))
295
-
296
- ## [0.15.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.14.1...widget-lib-v0.15.0) (2024-09-30)
297
-
298
-
299
- ### Features
300
-
301
- * **hooks-store:** support iframe hook-dapps ([#4885](https://github.com/cowprotocol/cowswap/issues/4885)) ([5116f29](https://github.com/cowprotocol/cowswap/commit/5116f296a0e4866d0a51a806b7abe55e809d26e9))
302
-
303
- ## [0.14.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.14.0...widget-lib-v0.14.1) (2024-09-17)
304
-
305
-
306
- ### Bug Fixes
307
-
308
- * **libs:** fix import error on multiple libs ([#4869](https://github.com/cowprotocol/cowswap/issues/4869)) ([8cfd70b](https://github.com/cowprotocol/cowswap/commit/8cfd70b6000a1a021b76ad1f924829cb42cb2bcd))
309
-
310
- ## [0.14.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.13.2...widget-lib-v0.14.0) (2024-08-27)
311
-
312
-
313
- ### Features
314
-
315
- * **progress-bar-v2:** replace progress bar with v2 ([#4033](https://github.com/cowprotocol/cowswap/issues/4033)) ([e199bff](https://github.com/cowprotocol/cowswap/commit/e199bff492ad3f91df23be34a829ebe1f246444a))
316
-
317
- ## [0.13.2](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.13.1...widget-lib-v0.13.2) (2024-07-05)
318
-
319
-
320
- ### Bug Fixes
321
-
322
- * **widget-lib:** exclude cow-sdk from the bundle ([#4681](https://github.com/cowprotocol/cowswap/issues/4681)) ([a2eaa3d](https://github.com/cowprotocol/cowswap/commit/a2eaa3d9198a4e5245a70b3a6c71a23337fd0ce8))
323
-
324
- ## [0.13.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.13.0...widget-lib-v0.13.1) (2024-07-04)
325
-
326
-
327
- ### Bug Fixes
328
-
329
- * **widget:** always listen activation event ([#4670](https://github.com/cowprotocol/cowswap/issues/4670)) ([#4673](https://github.com/cowprotocol/cowswap/issues/4673)) ([a74244d](https://github.com/cowprotocol/cowswap/commit/a74244d3ec35f4b96b52b87f0be2e4f082a240e5))
330
-
331
- ## [0.13.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.12.0...widget-lib-v0.13.0) (2024-06-18)
332
-
333
-
334
- ### Features
335
-
336
- * **widget:** use flexible config for partner fee ([#4546](https://github.com/cowprotocol/cowswap/issues/4546)) ([e23194a](https://github.com/cowprotocol/cowswap/commit/e23194acde8d97b8b4f852e73f4f59b33e65a8b8))
337
-
338
-
339
- ### Bug Fixes
340
-
341
- * **widget:** allow using walletconnect in widget mobile ([#4522](https://github.com/cowprotocol/cowswap/issues/4522)) ([ff58638](https://github.com/cowprotocol/cowswap/commit/ff586381f673314cf5d847f4f52da2e9e4015bea))
342
-
343
- ## [0.12.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.11.0...widget-lib-v0.12.0) (2024-05-29)
344
-
345
-
346
- ### Features
347
-
348
- * **arbitrum:** add arbitrum_one ([#4407](https://github.com/cowprotocol/cowswap/issues/4407)) ([166e33f](https://github.com/cowprotocol/cowswap/commit/166e33f3c494972738b154cf844584dd78e12c7d))
349
-
350
- ## [0.11.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.10.1...widget-lib-v0.11.0) (2024-05-01)
351
-
352
-
353
- ### Features
354
-
355
- * allow to modify the label of the fee and its tooltip ([a5dd0ba](https://github.com/cowprotocol/cowswap/commit/a5dd0baf19e6831fc135dd6c089e66ea0edd14f4))
356
-
357
- ## [0.10.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.10.0...widget-lib-v0.10.1) (2024-04-23)
358
-
359
-
360
- ### Bug Fixes
361
-
362
- * **widget:** ignore self-fired events in Safe sdk bridge ([#4271](https://github.com/cowprotocol/cowswap/issues/4271)) ([b11eab7](https://github.com/cowprotocol/cowswap/commit/b11eab7ad5dff65bee8ffa2be8aef2fa913af5f2))
363
-
364
- ## [0.10.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.9.0...widget-lib-v0.10.0) (2024-04-15)
365
-
366
-
367
- ### Features
368
-
369
- * add option to define the base URL for the widget ([#3991](https://github.com/cowprotocol/cowswap/issues/3991)) ([6b70572](https://github.com/cowprotocol/cowswap/commit/6b7057239c137b6b80f8277fdda7d8b06a5b2ed0))
370
- * Introduce partner fee ([#3913](https://github.com/cowprotocol/cowswap/issues/3913)) ([dbae7ed](https://github.com/cowprotocol/cowswap/commit/dbae7ed38b690b538d9fbd50e13d04bb199e3437))
371
- * remove goerli ([#3735](https://github.com/cowprotocol/cowswap/issues/3735)) ([2eaae50](https://github.com/cowprotocol/cowswap/commit/2eaae5063f1623d03328e4c2a0fb49c7799ff0a3))
372
- * up events lib version ([#4083](https://github.com/cowprotocol/cowswap/issues/4083)) ([02dbb0b](https://github.com/cowprotocol/cowswap/commit/02dbb0ba6f9f68a333a2fa2b78a961df4f301e36))
373
- * update docs/learn.cow.fi URLs ([#3611](https://github.com/cowprotocol/cowswap/issues/3611)) ([af0ff6b](https://github.com/cowprotocol/cowswap/commit/af0ff6b71de422e43aab987287f780d26a17ac73))
374
- * **widget:** add parametrization for sounds, images, and disabling/hiding features ([#3815](https://github.com/cowprotocol/cowswap/issues/3815)) ([4a6c461](https://github.com/cowprotocol/cowswap/commit/4a6c46133c98bdcffa5ebcfc66cde3bd85b23d9f))
375
- * **widget:** create an iframe event emitter ([#3821](https://github.com/cowprotocol/cowswap/issues/3821)) ([d9d1f23](https://github.com/cowprotocol/cowswap/commit/d9d1f23c1bf90a277a0d559c019b9794e43d8162))
376
- * **widget:** custom token lists in widget ([#3390](https://github.com/cowprotocol/cowswap/issues/3390)) ([7eabe06](https://github.com/cowprotocol/cowswap/commit/7eabe06d043703718d742809791eda555dff5058))
377
- * **widget:** customize images ([#4159](https://github.com/cowprotocol/cowswap/issues/4159)) ([0b14b2b](https://github.com/cowprotocol/cowswap/commit/0b14b2b19279a1688f75dc4f2954b8c267e57c40))
378
- * **widget:** emit post order events ([#3819](https://github.com/cowprotocol/cowswap/issues/3819)) ([0df62ec](https://github.com/cowprotocol/cowswap/commit/0df62ec3679da1841e07f85292a5de5faab74cab))
379
- * **widget:** emit toast for posting orders ([#3837](https://github.com/cowprotocol/cowswap/issues/3837)) ([44749fc](https://github.com/cowprotocol/cowswap/commit/44749fc19a392bba0055c856b6990e354729f31a))
380
- * **widget:** follow ups on issues raised ([#3840](https://github.com/cowprotocol/cowswap/issues/3840)) ([b1d621f](https://github.com/cowprotocol/cowswap/commit/b1d621f98fb1ec807b1ce5360e1f4d3d9cc50f4e))
381
- * **widget:** implement all listeners and fix types ([#3817](https://github.com/cowprotocol/cowswap/issues/3817)) ([11a7226](https://github.com/cowprotocol/cowswap/commit/11a7226a5d3811139e784fe668ee2eebf2167a38))
382
- * **widget:** improve JSON-RPC bridging between iFrame and provider ([#3824](https://github.com/cowprotocol/cowswap/issues/3824)) ([e9652e5](https://github.com/cowprotocol/cowswap/commit/e9652e5835d2c3ca0203349d4eae5b5874891cfc))
383
- * **widget:** let the host app be the one connecting ([#3846](https://github.com/cowprotocol/cowswap/issues/3846)) ([05a3321](https://github.com/cowprotocol/cowswap/commit/05a3321ede220e7c07dc41df2f2f706028fc4afb))
384
- * **widget:** misc to address issues and comments ([#3827](https://github.com/cowprotocol/cowswap/issues/3827)) ([ef83a5a](https://github.com/cowprotocol/cowswap/commit/ef83a5ad520d072ebf4f2cccde5fcfd0c1d88cd2))
385
- * **widget:** optimise widget updates ([#3822](https://github.com/cowprotocol/cowswap/issues/3822)) ([d1a1e7d](https://github.com/cowprotocol/cowswap/commit/d1a1e7d05a1fed94dece9afbbc65f43af1a4f748))
386
- * **widget:** option to hide safe banner ([#4175](https://github.com/cowprotocol/cowswap/issues/4175)) ([84108f4](https://github.com/cowprotocol/cowswap/commit/84108f4362333f8638d8da7c4ad4849d9f5a796c))
387
- * **widget:** subscribe to cow events (from iframe) ([#3816](https://github.com/cowprotocol/cowswap/issues/3816)) ([c3b8104](https://github.com/cowprotocol/cowswap/commit/c3b810435a6e64b12d28aac12cf785eef52f6531))
388
- * **widget:** use custom tokens as virtual list ([#4164](https://github.com/cowprotocol/cowswap/issues/4164)) ([8424a33](https://github.com/cowprotocol/cowswap/commit/8424a337f2ea2fd21cc3cb664d2f91facace00fb))
389
- * **widget:** use theme colors from URL ([#4188](https://github.com/cowprotocol/cowswap/issues/4188)) ([1623b37](https://github.com/cowprotocol/cowswap/commit/1623b37a1b50499473cf82a7aa0dd8f73f63a415))
390
-
391
-
392
- ### Bug Fixes
393
-
394
- * update widget-lib readme ([#4090](https://github.com/cowprotocol/cowswap/issues/4090)) ([014e321](https://github.com/cowprotocol/cowswap/commit/014e3210e4195c75a02f8a5e330b98d41a74149c))
395
- * **widget:** call disconnect when destroying the widget ([#4181](https://github.com/cowprotocol/cowswap/issues/4181)) ([93a460a](https://github.com/cowprotocol/cowswap/commit/93a460a0082bc7039dea3cc5c376cc2038917966))
396
- * **widget:** don't reset palette state while navigating ([#4239](https://github.com/cowprotocol/cowswap/issues/4239)) ([b963bc3](https://github.com/cowprotocol/cowswap/commit/b963bc32739084e729320c49c50f51e8aed86616))
397
- * **widget:** simplify token lists config ([#3652](https://github.com/cowprotocol/cowswap/issues/3652)) ([08aacdb](https://github.com/cowprotocol/cowswap/commit/08aacdb09602f48408cfe132bb9e5440fd774063))
398
-
399
- ## [0.9.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.7.1...widget-lib-v0.9.0) (2024-04-11)
400
-
401
- ### Features
402
-
403
- - **widget:** customize images ([#4159](https://github.com/cowprotocol/cowswap/issues/4159)) ([0b14b2b](https://github.com/cowprotocol/cowswap/commit/0b14b2b19279a1688f75dc4f2954b8c267e57c40))
404
- - **widget:** option to hide safe banner ([#4175](https://github.com/cowprotocol/cowswap/issues/4175)) ([84108f4](https://github.com/cowprotocol/cowswap/commit/84108f4362333f8638d8da7c4ad4849d9f5a796c))
405
- - **widget:** use custom tokens as virtual list ([#4164](https://github.com/cowprotocol/cowswap/issues/4164)) ([8424a33](https://github.com/cowprotocol/cowswap/commit/8424a337f2ea2fd21cc3cb664d2f91facace00fb))
406
- - **widget:** use theme colors from URL ([#4188](https://github.com/cowprotocol/cowswap/issues/4188)) ([1623b37](https://github.com/cowprotocol/cowswap/commit/1623b37a1b50499473cf82a7aa0dd8f73f63a415))
407
-
408
- ### Bug Fixes
409
-
410
- - **widget:** call disconnect when destroying the widget ([#4181](https://github.com/cowprotocol/cowswap/issues/4181)) ([93a460a](https://github.com/cowprotocol/cowswap/commit/93a460a0082bc7039dea3cc5c376cc2038917966))
411
-
412
- ## [0.7.1](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.7.0...widget-lib-v0.7.1) (2024-03-22)
413
-
414
- ### Bug Fixes
415
-
416
- - update widget-lib readme ([#4090](https://github.com/cowprotocol/cowswap/issues/4090)) ([014e321](https://github.com/cowprotocol/cowswap/commit/014e3210e4195c75a02f8a5e330b98d41a74149c))
417
-
418
- ## [0.7.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.6.0...widget-lib-v0.7.0) (2024-03-22)
419
-
420
- ### Features
421
-
422
- - up events lib version ([#4083](https://github.com/cowprotocol/cowswap/issues/4083)) ([02dbb0b](https://github.com/cowprotocol/cowswap/commit/02dbb0ba6f9f68a333a2fa2b78a961df4f301e36))
423
-
424
- ## [0.6.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.5.0...widget-lib-v0.6.0) (2024-03-12)
425
-
426
- ### Features
427
-
428
- - add option to define the base URL for the widget ([#3991](https://github.com/cowprotocol/cowswap/issues/3991)) ([6b70572](https://github.com/cowprotocol/cowswap/commit/6b7057239c137b6b80f8277fdda7d8b06a5b2ed0))
429
- - Introduce partner fee ([#3913](https://github.com/cowprotocol/cowswap/issues/3913)) ([dbae7ed](https://github.com/cowprotocol/cowswap/commit/dbae7ed38b690b538d9fbd50e13d04bb199e3437))
430
-
431
- ## [0.5.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.4.0...widget-lib-v0.5.0) (2024-02-22)
432
-
433
- ### Features
434
-
435
- - **widget:** add parametrization for sounds, images, and disabling/hiding features ([#3815](https://github.com/cowprotocol/cowswap/issues/3815)) ([4a6c461](https://github.com/cowprotocol/cowswap/commit/4a6c46133c98bdcffa5ebcfc66cde3bd85b23d9f))
436
- - **widget:** create an iframe event emitter ([#3821](https://github.com/cowprotocol/cowswap/issues/3821)) ([d9d1f23](https://github.com/cowprotocol/cowswap/commit/d9d1f23c1bf90a277a0d559c019b9794e43d8162))
437
- - **widget:** emit post order events ([#3819](https://github.com/cowprotocol/cowswap/issues/3819)) ([0df62ec](https://github.com/cowprotocol/cowswap/commit/0df62ec3679da1841e07f85292a5de5faab74cab))
438
- - **widget:** emit toast for posting orders ([#3837](https://github.com/cowprotocol/cowswap/issues/3837)) ([44749fc](https://github.com/cowprotocol/cowswap/commit/44749fc19a392bba0055c856b6990e354729f31a))
439
- - **widget:** follow ups on issues raised ([#3840](https://github.com/cowprotocol/cowswap/issues/3840)) ([b1d621f](https://github.com/cowprotocol/cowswap/commit/b1d621f98fb1ec807b1ce5360e1f4d3d9cc50f4e))
440
- - **widget:** implement all listeners and fix types ([#3817](https://github.com/cowprotocol/cowswap/issues/3817)) ([11a7226](https://github.com/cowprotocol/cowswap/commit/11a7226a5d3811139e784fe668ee2eebf2167a38))
441
- - **widget:** improve JSON-RPC bridging between iFrame and provider ([#3824](https://github.com/cowprotocol/cowswap/issues/3824)) ([e9652e5](https://github.com/cowprotocol/cowswap/commit/e9652e5835d2c3ca0203349d4eae5b5874891cfc))
442
- - **widget:** let the host app be the one connecting ([#3846](https://github.com/cowprotocol/cowswap/issues/3846)) ([05a3321](https://github.com/cowprotocol/cowswap/commit/05a3321ede220e7c07dc41df2f2f706028fc4afb))
443
- - **widget:** misc to address issues and comments ([#3827](https://github.com/cowprotocol/cowswap/issues/3827)) ([ef83a5a](https://github.com/cowprotocol/cowswap/commit/ef83a5ad520d072ebf4f2cccde5fcfd0c1d88cd2))
444
- - **widget:** optimise widget updates ([#3822](https://github.com/cowprotocol/cowswap/issues/3822)) ([d1a1e7d](https://github.com/cowprotocol/cowswap/commit/d1a1e7d05a1fed94dece9afbbc65f43af1a4f748))
445
- - **widget:** subscribe to cow events (from iframe) ([#3816](https://github.com/cowprotocol/cowswap/issues/3816)) ([c3b8104](https://github.com/cowprotocol/cowswap/commit/c3b810435a6e64b12d28aac12cf785eef52f6531))
446
-
447
- ## [0.4.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.3.0...widget-lib-v0.4.0) (2024-02-01)
448
-
449
- ### Features
450
-
451
- - remove goerli ([#3735](https://github.com/cowprotocol/cowswap/issues/3735)) ([2eaae50](https://github.com/cowprotocol/cowswap/commit/2eaae5063f1623d03328e4c2a0fb49c7799ff0a3))
452
-
453
- ## [0.3.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.2.1...widget-lib-v0.3.0) (2024-01-17)
454
-
455
- ### Features
456
-
457
- - update docs/learn.cow.fi URLs ([#3611](https://github.com/cowprotocol/cowswap/issues/3611)) ([af0ff6b](https://github.com/cowprotocol/cowswap/commit/af0ff6b71de422e43aab987287f780d26a17ac73))
458
- - **widget:** custom token lists in widget ([#3390](https://github.com/cowprotocol/cowswap/issues/3390)) ([7eabe06](https://github.com/cowprotocol/cowswap/commit/7eabe06d043703718d742809791eda555dff5058))
459
-
460
- ### Bug Fixes
461
-
462
- - **widget:** simplify token lists config ([#3652](https://github.com/cowprotocol/cowswap/issues/3652)) ([08aacdb](https://github.com/cowprotocol/cowswap/commit/08aacdb09602f48408cfe132bb9e5440fd774063))
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IframeCowEventEmitter = void 0;
4
- const events_1 = require("@cowprotocol/events");
5
- const types_1 = require("./types");
6
- const widgetIframeTransport_1 = require("./widgetIframeTransport");
7
- class IframeCowEventEmitter {
8
- contentWindow;
9
- eventEmitter = new events_1.SimpleCowEventEmitter();
10
- listeners = [];
11
- widgetListener;
12
- constructor(contentWindow, listeners = []) {
13
- this.contentWindow = contentWindow;
14
- // Subscribe listeners to local event emitter
15
- this.updateListeners(listeners);
16
- // Listen to iFrame, and forward to local event emitter
17
- this.widgetListener = widgetIframeTransport_1.widgetIframeTransport.listenToMessageFromWindow(this.contentWindow, types_1.WidgetMethodsEmit.EMIT_COW_EVENT, (cowEvent) => this.eventEmitter.emit(cowEvent.event, cowEvent.payload));
18
- }
19
- stopListeningIframe() {
20
- widgetIframeTransport_1.widgetIframeTransport.stopListeningWindowListener(this.contentWindow, this.widgetListener);
21
- }
22
- updateListeners(listeners) {
23
- // Unsubscribe from previous listeners
24
- for (const listener of this.listeners) {
25
- this.eventEmitter.off(listener);
26
- }
27
- // Subscribe to events
28
- this.listeners = listeners || [];
29
- for (const listener of this.listeners) {
30
- this.eventEmitter.on(listener);
31
- }
32
- }
33
- }
34
- exports.IframeCowEventEmitter = IframeCowEventEmitter;
35
- //# sourceMappingURL=IframeCowEventEmitter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IframeCowEventEmitter.js","sourceRoot":"","sources":["../../../../libs/widget-lib/src/IframeCowEventEmitter.ts"],"names":[],"mappings":";;;AAAA,gDAK4B;AAE5B,mCAA2D;AAC3D,mEAA+D;AAE/D,MAAa,qBAAqB;IAMtB;IALF,YAAY,GAAG,IAAI,8BAAqB,EAA6C,CAAA;IACrF,SAAS,GAA4B,EAAE,CAAA;IACvC,cAAc,CAAgB;IAEtC,YACU,aAAqB,EAC7B,YAAqC,EAAE;QAD/B,kBAAa,GAAb,aAAa,CAAQ;QAG7B,6CAA6C;QAC7C,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;QAE/B,uDAAuD;QACvD,IAAI,CAAC,cAAc,GAAG,6CAAqB,CAAC,yBAAyB,CACnE,IAAI,CAAC,aAAa,EAClB,yBAAiB,CAAC,cAAc,EAChC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CACvE,CAAA;IACH,CAAC;IAEM,mBAAmB;QACxB,6CAAqB,CAAC,2BAA2B,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAC5F,CAAC;IAEM,eAAe,CAAC,SAAmC;QACxD,sCAAsC;QACtC,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACjC,CAAC;QAED,sBAAsB;QACtB,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAA;QAChC,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;CACF;AApCD,sDAoCC"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IframeSafeSdkBridge = void 0;
4
- class IframeSafeSdkBridge {
5
- appWindow;
6
- iframeWidow;
7
- forwardSdkMessage;
8
- constructor(appWindow, iframeWidow) {
9
- this.appWindow = appWindow;
10
- this.iframeWidow = iframeWidow;
11
- this.forwardSdkMessage = (event) => {
12
- if (!isSafeMessage(event.data)) {
13
- return;
14
- }
15
- if (typeof window !== 'undefined' && event.origin === window.location.origin) {
16
- return;
17
- }
18
- if (isSafeMessageRequest(event.data)) {
19
- this.appWindow.parent.postMessage(event.data, '*');
20
- }
21
- else if (isSafeMessageResponse(event.data)) {
22
- this.iframeWidow.postMessage(event.data, '*');
23
- }
24
- };
25
- this.startListening();
26
- }
27
- startListening() {
28
- this.appWindow.addEventListener('message', this.forwardSdkMessage);
29
- }
30
- stopListening() {
31
- this.appWindow.removeEventListener('message', this.forwardSdkMessage);
32
- }
33
- }
34
- exports.IframeSafeSdkBridge = IframeSafeSdkBridge;
35
- function isSafeMessage(obj) {
36
- return typeof obj === 'object' && obj !== null && 'id' in obj && typeof obj.id === 'string';
37
- }
38
- function isSafeMessageRequest(message) {
39
- return ('method' in message &&
40
- typeof message.method === 'string' &&
41
- 'params' in message &&
42
- 'env' in message &&
43
- typeof message.env === 'object' &&
44
- message.env !== null &&
45
- 'sdkVersion' in message.env);
46
- }
47
- function isSafeMessageResponse(message) {
48
- return ('success' in message &&
49
- typeof message.success === 'boolean' &&
50
- 'version' in message &&
51
- typeof message.version === 'string');
52
- }
53
- //# sourceMappingURL=IframeSafeSdkBridge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IframeSafeSdkBridge.js","sourceRoot":"","sources":["../../../../libs/widget-lib/src/IframeSafeSdkBridge.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;IAIpB;IACA;IAJV,iBAAiB,CAAwC;IAEzD,YACU,SAAiB,EACjB,WAAmB;QADnB,cAAS,GAAT,SAAS,CAAQ;QACjB,gBAAW,GAAX,WAAW,CAAQ;QAE3B,IAAI,CAAC,iBAAiB,GAAG,CAAC,KAA4B,EAAE,EAAE;YACxD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/B,OAAM;YACR,CAAC;YAED,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC7E,OAAM;YACR,CAAC;YAED,IAAI,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;YACpD,CAAC;iBAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC,CAAA;QAED,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAA;IACpE,CAAC;IAEM,aAAa;QAClB,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAA;IACvE,CAAC;CACF;AAjCD,kDAiCC;AAED,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,IAAI,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,CAAA;AAC7F,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAoB;IAChD,OAAO,CACL,QAAQ,IAAI,OAAO;QACnB,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ;QAClC,QAAQ,IAAI,OAAO;QACnB,KAAK,IAAI,OAAO;QAChB,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC/B,OAAO,CAAC,GAAG,KAAK,IAAI;QACpB,YAAY,IAAI,OAAO,CAAC,GAAG,CAC5B,CAAA;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAoB;IACjD,OAAO,CACL,SAAS,IAAI,OAAO;QACpB,OAAO,OAAO,CAAC,OAAO,KAAK,SAAS;QACpC,SAAS,IAAI,OAAO;QACpB,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,CACpC,CAAA;AACH,CAAC"}