@postalsys/email-text-tools 2.4.26 → 2.5.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +10 -0
  3. package/dist/cjs/index.d.ts +18 -0
  4. package/dist/cjs/index.js +28 -0
  5. package/dist/cjs/lib/commonjs.cjs +17 -0
  6. package/dist/cjs/lib/commonjs.d.cts +4 -0
  7. package/dist/cjs/lib/format-date.d.ts +15 -0
  8. package/dist/cjs/lib/format-date.js +60 -0
  9. package/dist/cjs/lib/html-guard.d.ts +3 -0
  10. package/dist/cjs/lib/html-guard.js +119 -0
  11. package/dist/cjs/lib/html-to-text.d.ts +1 -0
  12. package/dist/cjs/lib/html-to-text.js +49 -0
  13. package/dist/cjs/lib/inline-html.d.ts +19 -0
  14. package/dist/cjs/lib/inline-html.js +150 -0
  15. package/dist/cjs/lib/inline-text.d.ts +3 -0
  16. package/dist/cjs/lib/inline-text.js +111 -0
  17. package/dist/cjs/lib/juice-worker.d.ts +1 -0
  18. package/dist/cjs/lib/juice-worker.js +19 -0
  19. package/dist/cjs/lib/mime-html.d.ts +34 -0
  20. package/dist/cjs/lib/mime-html.js +529 -0
  21. package/dist/cjs/lib/text-to-html.d.ts +1 -0
  22. package/dist/cjs/lib/text-to-html.js +182 -0
  23. package/dist/cjs/lib/worker-pool.d.ts +61 -0
  24. package/dist/cjs/lib/worker-pool.js +229 -0
  25. package/dist/cjs/package.json +3 -0
  26. package/dist/esm/index.d.ts +18 -0
  27. package/dist/esm/index.js +12 -0
  28. package/dist/esm/lib/commonjs.cjs +17 -0
  29. package/dist/esm/lib/commonjs.d.cts +4 -0
  30. package/dist/esm/lib/format-date.d.ts +15 -0
  31. package/{lib → dist/esm/lib}/format-date.js +8 -16
  32. package/dist/esm/lib/html-guard.d.ts +3 -0
  33. package/{lib → dist/esm/lib}/html-guard.js +8 -24
  34. package/dist/esm/lib/html-to-text.d.ts +1 -0
  35. package/{lib → dist/esm/lib}/html-to-text.js +2 -14
  36. package/dist/esm/lib/inline-html.d.ts +19 -0
  37. package/{lib → dist/esm/lib}/inline-html.js +17 -55
  38. package/dist/esm/lib/inline-text.d.ts +3 -0
  39. package/{lib → dist/esm/lib}/inline-text.js +8 -31
  40. package/dist/esm/lib/juice-worker.d.ts +1 -0
  41. package/{lib → dist/esm/lib}/juice-worker.js +7 -8
  42. package/dist/esm/lib/mime-html.d.ts +34 -0
  43. package/{lib → dist/esm/lib}/mime-html.js +79 -127
  44. package/dist/esm/lib/text-to-html.d.ts +1 -0
  45. package/{lib → dist/esm/lib}/text-to-html.js +35 -63
  46. package/dist/esm/lib/worker-pool.d.ts +61 -0
  47. package/{lib → dist/esm/lib}/worker-pool.js +18 -64
  48. package/dist/esm/package.json +3 -0
  49. package/package.json +67 -10
  50. package/.github/VULNERABILITY_REPORT.yml +0 -75
  51. package/.github/workflows/release.yaml +0 -38
  52. package/.github/workflows/test.yaml +0 -35
  53. package/.ncurc.js +0 -28
  54. package/.prettierignore +0 -14
  55. package/.prettierrc.js +0 -10
  56. package/.release-please-manifest.json +0 -3
  57. package/CLAUDE.md +0 -105
  58. package/benchmark/benchmark.js +0 -348
  59. package/benchmark/concurrency-benchmark.js +0 -176
  60. package/benchmark/quick-benchmark.js +0 -200
  61. package/benchmark/quick-concurrency.js +0 -64
  62. package/benchmark/real-world-benchmark.js +0 -257
  63. package/docs/PERFORMANCE.md +0 -262
  64. package/eslint.config.js +0 -71
  65. package/examples/failing.html +0 -617
  66. package/examples/fixtures/message-1.json +0 -74
  67. package/examples/inline-html.js +0 -24
  68. package/examples/inline-text.js +0 -24
  69. package/examples/mime-html.js +0 -284
  70. package/index.js +0 -22
  71. package/release-please-config.json +0 -10
  72. package/test/comprehensive.test.js +0 -358
  73. package/test/containment.test.js +0 -128
  74. package/test/edge-cases.test.js +0 -62
  75. package/test/hardening.test.js +0 -504
  76. package/test/html-to-text.test.js +0 -253
  77. package/test/inline-html.test.js +0 -230
  78. package/test/inline-text.test.js +0 -204
  79. package/test/mime-html-extra.test.js +0 -39
  80. package/test/mime-html.test.js +0 -302
  81. package/test/text-to-html-extra.test.js +0 -42
  82. package/test/worker-pool-extra.test.js +0 -132
  83. package/test/worker-pool-regression.test.js +0 -128
  84. package/test/worker-pool.test.js +0 -282
@@ -1,617 +0,0 @@
1
- <!doctype html>
2
- <html
3
- lang="und"
4
- dir="auto"
5
- xmlns="http://www.w3.org/1999/xhtml"
6
- xmlns:v="urn:schemas-microsoft-com:vml"
7
- xmlns:o="urn:schemas-microsoft-com:office:office"
8
- style="background-color: #fff"
9
- >
10
- <head>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
- <title>Neue Nachricht!</title>
13
- <!--[if !mso]><!-->
14
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
15
- <!--<![endif]-->
16
-
17
- <meta name="viewport" content="width=device-width, initial-scale=1" />
18
- <style type="text/css">
19
- #outlook a {
20
- padding: 0;
21
- }
22
- body {
23
- margin: 0;
24
- padding: 0;
25
- -webkit-text-size-adjust: 100%;
26
- -ms-text-size-adjust: 100%;
27
- }
28
- table,
29
- td {
30
- border-collapse: collapse;
31
- mso-table-lspace: 0pt;
32
- mso-table-rspace: 0pt;
33
- }
34
- img {
35
- border: 0;
36
- height: auto;
37
- line-height: 100%;
38
- outline: none;
39
- text-decoration: none;
40
- -ms-interpolation-mode: bicubic;
41
- }
42
- p {
43
- display: block;
44
- margin: 13px 0;
45
- }
46
- </style>
47
- <!--[if mso]>
48
- <noscript>
49
- <xml>
50
- <o:OfficeDocumentSettings>
51
- <o:AllowPNG />
52
- <o:PixelsPerInch>96</o:PixelsPerInch>
53
- </o:OfficeDocumentSettings>
54
- </xml>
55
- </noscript>
56
- <![endif]-->
57
- <!--[if lte mso 11]>
58
- <style type="text/css">
59
- .mj-outlook-group-fix {
60
- width: 100% !important;
61
- }
62
- </style>
63
- <![endif]-->
64
-
65
- <!--[if !mso]><!-->
66
- <link href="https://fonts.googleapis.com/css?family=Inter:400,600" rel="stylesheet" type="text/css" />
67
- <style type="text/css">
68
- @import url(https://fonts.googleapis.com/css?family=Inter:400,600);
69
- </style>
70
- <!--<![endif]-->
71
-
72
- <style type="text/css">
73
- @media only screen and (min-width: 480px) {
74
- .mj-column-per-100 {
75
- width: 100% !important;
76
- max-width: 100%;
77
- }
78
- }
79
- </style>
80
- <style media="screen and (min-width:480px)">
81
- .moz-text-html .mj-column-per-100 {
82
- width: 100% !important;
83
- max-width: 100%;
84
- }
85
- </style>
86
-
87
- <style type="text/css">
88
- @media only screen and (max-width: 479px) {
89
- table.mj-full-width-mobile {
90
- width: 100% !important;
91
- }
92
- td.mj-full-width-mobile {
93
- width: auto !important;
94
- }
95
- }
96
- </style>
97
-
98
- <style type="text/css">
99
- .wfix {
100
- max-width: 600px !important;
101
- }
102
-
103
- @media (max-width: 480px) {
104
- .body-image-mobile-width-14 td {
105
- width: 14px !important;
106
- }
107
- .body-image td {
108
- max-width: 100% !important;
109
- }
110
- .body-image img {
111
- box-sizing: border-box;
112
- }
113
- .social-icon-mobile-spacer {
114
- display: inline-block !important;
115
- }
116
- }
117
-
118
- .mobile-only {
119
- display: none !important;
120
- }
121
- .desktop-only {
122
- display: block !important;
123
- }
124
- @media (max-width: 480px) {
125
- .column-stack {
126
- width: 100% !important;
127
- max-width: 100% !important;
128
- display: block !important;
129
- }
130
- .column-stack td,
131
- .column-stack th {
132
- padding-left: 0 !important;
133
- padding-right: 0 !important;
134
- }
135
- .mobile-only {
136
- display: block !important;
137
- }
138
- .desktop-only {
139
- display: none !important;
140
- }
141
- }
142
- </style>
143
- <style>
144
- .wrapper {
145
- padding: 0 12px;
146
- }
147
-
148
- /* Superhuman selector */
149
- .ShadowHTML .wrapper {
150
- padding: 0 !important;
151
- }
152
-
153
- .ShadowHTML
154
- :is(
155
- .styleUnquotedContent .unquoted-content,
156
- .styleUnquotedContent .sh-unquoted-content,
157
- .styleQuotedContent .sh-quoted-content,
158
- .sh-signature,
159
- .Signature-settings
160
- )
161
- :is(td.column-container, div[class^='mj-column-per-']) {
162
- font-size: 0 !important;
163
- }
164
- html.sh-color :is(td.column-container, div[class^='mj-column-per-'], div.mj-column-per-100.mj-outlook-group-fix) {
165
- font-size: 0 !important;
166
- }
167
- @media (max-width: 480px) {
168
- html.sh-color .column-stack {
169
- width: 100% !important;
170
- max-width: 100% !important;
171
- display: block !important;
172
- }
173
- html.sh-color :is(.column-stack td, .column-stack th) {
174
- padding-left: 0 !important;
175
- padding-right: 0 !important;
176
- width: 100% !important;
177
- max-width: 100% !important;
178
- display: block !important;
179
- }
180
- html.sh-color :is(.column-stack, .column-stack *) {
181
- word-break: break-word !important;
182
- overflow-wrap: anywhere !important;
183
- }
184
- html.sh-color :is(.column-persist, .column-persist *) {
185
- word-break: break-word !important;
186
- overflow-wrap: anywhere !important;
187
- }
188
- }
189
- html.sh-color a[href^='tel:'] {
190
- color: inherit !important;
191
- text-decoration: none !important;
192
- font-size: inherit !important;
193
- line-height: inherit !important;
194
- letter-spacing: inherit !important;
195
- vertical-align: baseline !important;
196
- }
197
-
198
- .isMarketing {
199
- background-color: #fff !important;
200
- }
201
- .isMarketing .styled-primary-column {
202
- background-color: #fff !important;
203
- border-radius: 0px;
204
- }
205
-
206
- [class~='x_social-icon-dark-mode'] {
207
- display: none !important;
208
- mso-hide: all;
209
- width: 0px !important;
210
- padding: 0px !important;
211
- }
212
-
213
- /* Gmail selectors */
214
- u + .body .wrapper {
215
- padding: 0 !important;
216
- }
217
- div > u + .body .wrapper {
218
- padding: 0 !important;
219
- }
220
-
221
- a {
222
- text-decoration: none;
223
- color: #333;
224
- }
225
-
226
- .link-unsubscribe {
227
- color: #9ca3af !important;
228
- }
229
- </style>
230
- <meta name="color-scheme" content="light" />
231
- <meta name="supported-color-schemes" content="light" />
232
- </head>
233
- <body class="body" style="word-spacing: normal; background-color: #ffffff">
234
- <div class="email-body" style="background-color: #ffffff" lang="und" dir="auto">
235
- <!--[if mso]><style type="text/css"> a { text-decoration: underline !important; } .button a { text-decoration: none !important; } .outlook-list-fix { margin-left:4px !important; } .outlook-break-full-link { word-break: break-all !important; } .outlook-hide-social-icon { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; } .outlook-hide-social-icon * { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; } .outlook-hide-social-icon table { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; } .outlook-hide-social-icon tbody { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; } .outlook-hide-social-icon tr { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; } .outlook-hide-social-icon td { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; } .outlook-hide-social-icon img { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; } .outlook-hide-social-icon a { display: none !important; mso-hide:all; width: 0px !important; padding: 0px !important; }
236
- </style><table align="center" border="0" cellpadding="0" cellspacing="0" class="wfix-outlook gmail-no-padding-outlook wrapper-outlook" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
237
-
238
- <div class="wfix gmail-no-padding wrapper" style="margin: 0px auto; max-width: 600px">
239
- <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width: 100%">
240
- <tbody>
241
- <tr>
242
- <td style="direction: ltr; font-size: 0px; padding: 20px 0; padding-top: 0; text-align: center">
243
- <!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="wfix-outlook" width="600px" ><table align="center" border="0" cellpadding="0" cellspacing="0" class="wfix-outlook" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
244
-
245
- <div class="wfix" style="margin: 0px auto; max-width: 600px">
246
- <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width: 100%">
247
- <tbody>
248
- <tr>
249
- <td
250
- style="
251
- direction: ltr;
252
- font-size: 0px;
253
- padding: 20px 0;
254
- padding-bottom: 30px;
255
- padding-left: 0px;
256
- padding-right: 0px;
257
- padding-top: 30px;
258
- text-align: center;
259
- "
260
- >
261
- <!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" class="wfix-outlook rounded-corners-outlook styled-primary-column-outlook" style="vertical-align:top;width:600px;" ><![endif]-->
262
-
263
- <div
264
- class="mj-column-per-100 mj-outlook-group-fix wfix rounded-corners styled-primary-column"
265
- style="
266
- font-size: 0px;
267
- text-align: left;
268
- direction: ltr;
269
- display: inline-block;
270
- vertical-align: top;
271
- width: 100%;
272
- "
273
- >
274
- <table
275
- border="0"
276
- cellpadding="0"
277
- cellspacing="0"
278
- role="presentation"
279
- width="100%"
280
- style="border-collapse: separate"
281
- >
282
- <tbody>
283
- <tr>
284
- <td
285
- style="
286
- background-color: #ffffff;
287
- border-radius: 0px;
288
- vertical-align: top;
289
- padding-top: 0px;
290
- padding-right: 15px;
291
- padding-bottom: 0px;
292
- padding-left: 15px;
293
- "
294
- >
295
- <table
296
- border="0"
297
- cellpadding="0"
298
- cellspacing="0"
299
- role="presentation"
300
- style=""
301
- width="100%"
302
- >
303
- <tbody>
304
- <tr>
305
- <td
306
- align="left"
307
- style="
308
- font-size: 0px;
309
- padding: 10px 25px;
310
- padding-top: 0px;
311
- padding-right: 0px;
312
- padding-bottom: 0px;
313
- padding-left: 0px;
314
- word-break: break-word;
315
- "
316
- >
317
- <div
318
- style="
319
- font-family: Inter, ui-sans-serif, sans-serif;
320
- font-size: 14px;
321
- letter-spacing: 0px;
322
- line-height: 21px !important;
323
- text-align: left;
324
- color: #666666;
325
- "
326
- >
327
- <span>&nbsp;</span>
328
- </div>
329
- </td>
330
- </tr>
331
-
332
- <tr>
333
- <td
334
- align="left"
335
- class="body-image body-image-mobile-width-14"
336
- style="
337
- font-size: 0px;
338
- padding: 10px 25px;
339
- padding-top: 0px;
340
- padding-right: 0px;
341
- padding-bottom: 0px;
342
- padding-left: 0px;
343
- word-break: break-word;
344
- "
345
- >
346
- <table
347
- border="0"
348
- cellpadding="0"
349
- cellspacing="0"
350
- role="presentation"
351
- style="border-collapse: collapse; border-spacing: 0px"
352
- >
353
- <tbody>
354
- <tr>
355
- <td style="width: 14px">
356
- <a
357
- href="https://framer.com"
358
- target="_blank"
359
- style="text-decoration: none; color: #333"
360
- >
361
- <img
362
- alt="Framer Logo"
363
- src="https://d3b9kr64nievew.cloudfront.net/cm915sac71jhgzjjtr8rmq42q/cmb54yn83cy1vzx0ib1pj5jrq.png"
364
- style="
365
- border: 0;
366
- border-radius: 0px;
367
- display: block;
368
- outline: none;
369
- text-decoration: none;
370
- height: auto;
371
- width: 100%;
372
- font-size: 13px;
373
- "
374
- width="14"
375
- height="auto"
376
- />
377
- </a>
378
- </td>
379
- </tr>
380
- </tbody>
381
- </table>
382
- </td>
383
- </tr>
384
-
385
- <tr>
386
- <td
387
- align="left"
388
- style="
389
- font-size: 0px;
390
- padding: 10px 25px;
391
- padding-top: 0px;
392
- padding-right: 0px;
393
- padding-bottom: 0px;
394
- padding-left: 0px;
395
- word-break: break-word;
396
- "
397
- >
398
- <div
399
- style="
400
- font-family: Inter, ui-sans-serif, sans-serif;
401
- font-size: 14px;
402
- letter-spacing: 0px;
403
- line-height: 21px !important;
404
- text-align: left;
405
- color: #666666;
406
- "
407
- >
408
- <span>&nbsp;</span>
409
- </div>
410
- </td>
411
- </tr>
412
-
413
- <tr>
414
- <td
415
- align="left"
416
- style="
417
- font-size: 0px;
418
- padding: 10px 25px;
419
- padding-top: 0px;
420
- padding-right: 0px;
421
- padding-bottom: 0px;
422
- padding-left: 0px;
423
- word-break: break-word;
424
- "
425
- >
426
- <div
427
- style="
428
- font-family: Inter, ui-sans-serif, sans-serif;
429
- font-size: 14px;
430
- letter-spacing: 0px;
431
- line-height: 21px !important;
432
- text-align: left;
433
- color: #666666;
434
- "
435
- >
436
- <span
437
- style="
438
- line-height: 21px !important;
439
- font-size: 14px;
440
- font-size: 14px !important;
441
- white-space: pre-wrap;
442
- "
443
- >Sie haben eine neue Nachricht über das Kontaktformular auf der
444
- Webseite erhalten!</span
445
- >
446
- </div>
447
- </td>
448
- </tr>
449
-
450
- <tr>
451
- <td
452
- align="left"
453
- style="
454
- font-size: 0px;
455
- padding: 10px 25px;
456
- padding-top: 0px;
457
- padding-right: 0px;
458
- padding-bottom: 0px;
459
- padding-left: 0px;
460
- word-break: break-word;
461
- "
462
- >
463
- <div
464
- style="
465
- font-family: Inter, ui-sans-serif, sans-serif;
466
- font-size: 14px;
467
- letter-spacing: 0px;
468
- line-height: 22px !important;
469
- text-align: left;
470
- color: #666666;
471
- "
472
- >
473
- <span>&nbsp;</span>
474
- </div>
475
- </td>
476
- </tr>
477
-
478
- <tr>
479
- <td
480
- align="left"
481
- style="
482
- font-size: 0px;
483
- padding: 10px 25px;
484
- padding-top: 0px;
485
- padding-right: 0px;
486
- padding-bottom: 0px;
487
- padding-left: 0px;
488
- word-break: break-word;
489
- "
490
- >
491
- <div
492
- style="
493
- font-family: Inter, ui-sans-serif, sans-serif;
494
- font-size: 14px;
495
- letter-spacing: 0px;
496
- line-height: 21px !important;
497
- text-align: left;
498
- color: #666666;
499
- "
500
- >
501
- <span
502
- style="
503
- line-height: 21px !important;
504
- font-size: 14px;
505
- font-size: 14px !important;
506
- white-space: pre-wrap;
507
- "
508
- ><style type="text/css">
509
- a:link {
510
- text-decoration: none !important;
511
- }
512
- </style>
513
- <div style="line-height: 19px; padding-bottom: 5px">
514
- <span style="color: #999999">Location: </span>Haus kaufen
515
- </div>
516
- <div style="line-height: 19px; padding-bottom: 5px">
517
- <span style="color: #999999">Name: </span>Hayati Kaya
518
- </div>
519
- <div style="line-height: 19px; padding-bottom: 5px">
520
- <span style="color: #999999">Phone Number: </span
521
- >+41796336385
522
- </div>
523
- <div style="line-height: 19px; padding-bottom: 5px">
524
- <span style="color: #999999">Email Address: </span
525
- >kayahayati@windowslive.com
526
- </div>
527
- <div style="line-height: 19px; padding-bottom: 5px">
528
- <span style="color: #999999">Message: </span>Ich bin an
529
- diesem Objekt in Remetchwil interessiert, für das Frau
530
- Rudhani zuständig ist, und würde es gerne besichtigen.
531
- </div></span
532
- >
533
- </div>
534
- </td>
535
- </tr>
536
-
537
- <tr>
538
- <td
539
- align="left"
540
- style="
541
- font-size: 0px;
542
- padding: 10px 25px;
543
- padding-top: 0px;
544
- padding-right: 0px;
545
- padding-bottom: 0px;
546
- padding-left: 0px;
547
- word-break: break-word;
548
- "
549
- >
550
- <div
551
- style="
552
- font-family: Inter, ui-sans-serif, sans-serif;
553
- font-size: 14px;
554
- letter-spacing: 0px;
555
- line-height: 21px !important;
556
- text-align: left;
557
- color: #666666;
558
- "
559
- >
560
- <span>&nbsp;</span>
561
- </div>
562
- </td>
563
- </tr>
564
-
565
- <tr>
566
- <td
567
- align="left"
568
- style="
569
- font-size: 0px;
570
- padding: 10px 25px;
571
- padding-top: 0px;
572
- padding-right: 0px;
573
- padding-bottom: 0px;
574
- padding-left: 0px;
575
- word-break: break-word;
576
- "
577
- >
578
- <div
579
- style="
580
- font-family: Inter, ui-sans-serif, sans-serif;
581
- font-size: 14px;
582
- letter-spacing: 0px;
583
- line-height: 21px !important;
584
- text-align: left;
585
- color: #666666;
586
- "
587
- >
588
- <span>&nbsp;</span>
589
- </div>
590
- </td>
591
- </tr>
592
- </tbody>
593
- </table>
594
- </td>
595
- </tr>
596
- </tbody>
597
- </table>
598
- </div>
599
-
600
- <!--[if mso | IE]></td></tr></table><![endif]-->
601
- </td>
602
- </tr>
603
- </tbody>
604
- </table>
605
- </div>
606
-
607
- <!--[if mso | IE]></td></tr></table></td></tr></table><![endif]-->
608
- </td>
609
- </tr>
610
- </tbody>
611
- </table>
612
- </div>
613
-
614
- <!--[if mso | IE]></td></tr></table><![endif]-->
615
- </div>
616
- </body>
617
- </html>