@happeouikit/content-renderer 3.4.1 → 3.4.2-alpha.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,320 @@
1
+ # Changelog
2
+
3
+ ## 3.4.0
4
+
5
+ - [Add] Support unique ids for anchor links
6
+
7
+ ## 3.3.2
8
+
9
+ - [Fix] Handle special characters in anchor
10
+
11
+ ## 3.2.27
12
+
13
+ - [Fix] Escape < with &lt; when not part of html
14
+
15
+ ## 3.2.26
16
+
17
+ - [Fixed] Table cells will now have a color-scheme added to their cells that have a background color
18
+
19
+ ## 3.2.25
20
+
21
+ - [Fixed] Tables (and possibly other things) will now scroll in narrow screens (e.g. mobile), rather than getting squeezed
22
+
23
+ ## 3.2.23
24
+
25
+ - [Updated] Changed user-mention color (again) to be yellow rather than orange, in light mode
26
+
27
+ ## 3.2.22
28
+
29
+ - [Fixed] Fixes issues with copy to clipboard button when content changes
30
+
31
+ ## 3.2.17
32
+
33
+ - [Added] replaceLinkDomains allows replacing link domains with another domain. Allowing, for example, to replace all app.happeo.com and custom domain urls with relative urls.
34
+
35
+ ## 3.2.16
36
+
37
+ - [Fixed] Table styles
38
+
39
+ ## 3.2.10
40
+
41
+ - [Updated] Updated custom table styles
42
+
43
+ ## 3.2.8
44
+
45
+ - [Fixed] Deployment
46
+
47
+ ## 3.2.7
48
+
49
+ - [Added] Add allowed data attribute for data-link-chip
50
+
51
+ ## 3.2.6
52
+
53
+ - [Fixed] "mailto:some@email.address" links will now always open in a new tab
54
+
55
+ ## 3.2.5
56
+
57
+ - [Fixed] XSS vulnerability
58
+
59
+ ## 3.2.4
60
+
61
+ - [Fixed] Emojis correctly rendered
62
+ - [Added] Automatic non-anchored url truncation
63
+
64
+ ## 3.2.3
65
+
66
+ - [Updated] Convert to TS and add storybook
67
+ - [Updated] Handle code blocks
68
+
69
+ ## 3.2.2
70
+
71
+ - [Fixed] alignment style for images
72
+
73
+ ## 3.2.0
74
+
75
+ - [Added] Added `addColorBlocks` property
76
+ - Modified nested lists to allow 2 space separatation
77
+ - Updated xss
78
+ - Updated showdown
79
+
80
+ ## 3.1.7
81
+
82
+ - [Removed] styles for custom emojis
83
+
84
+ ## 3.1.6
85
+
86
+ - [Fixed] emoji size for all renderers
87
+
88
+ ## 3.1.5
89
+
90
+ - [Fixed] margin for custom-emoji
91
+
92
+ ## 3.1.4
93
+
94
+ - [Fixed] styles for custom-emoji
95
+
96
+ ## 3.1.3
97
+
98
+ - [Add] styles for custom-emoji
99
+
100
+ ## 3.1.2
101
+
102
+ - [Add] img type data attribute
103
+
104
+ ## 3.1.1
105
+
106
+ - [Remove] @universe dependencies
107
+
108
+ ## 3.0.10
109
+
110
+ - [Fixed] paragraph styles
111
+
112
+ ## 3.0.9
113
+
114
+ - [Fixed] paragraph styles
115
+
116
+ ## 3.0.8
117
+
118
+ - Publish
119
+
120
+ ## 3.0.7
121
+
122
+ - Publish
123
+
124
+ ## 3.0.6
125
+
126
+ - [Added] Support for user defined font families and weights
127
+
128
+ ## 3.0.5
129
+
130
+ - Publish
131
+
132
+ ## 3.0.4
133
+
134
+ - [Fixed] ContentRenderer should now render content without applying links to domain-like text.
135
+ - [Updated] Updated ContentRenderer unit test with Testing Linkify hyper-link Features.
136
+
137
+ ## 3.0.3
138
+
139
+ - [Added] Added prop `forceDefaultLinkTarget` that will force external links with `target="_blank"` and removes `target` from internal links.
140
+
141
+ ## 3.0.2
142
+
143
+ - [Fixed] ContentRenderer now applies styling options from Pages
144
+
145
+ ## 3.0.1
146
+
147
+ - [Fixed] ContentRenderer should now deal with all kinds of xss
148
+
149
+ ## 3.0.0
150
+
151
+ - [Fixed] the xss converter now accepts a whiteList for CSS properties that includes vertical-align
152
+ - [Updated] new dependencies updates: React 17 and and Styled Components 5
153
+
154
+ ## 2.0.1
155
+
156
+ - [Added] Changed type to uppercase and to handle both upper and lowercase. Add warning if lowecase is used.
157
+ - [Added] Handle widgetType=`page` by removing forced styles from component.
158
+
159
+ ## 2.0.0
160
+
161
+ - [Breaking change] Links rendered from markdown content now always open in a new tab (not configurable).
162
+
163
+ ## 1.0.48
164
+
165
+ - [Fixed] Decode HTML entites causing crashes
166
+
167
+ ## 1.0.46
168
+
169
+ - [Fixed] Use correct font-family for all the tags inside paragraphs and list elements etc.
170
+
171
+ ## 1.0.45
172
+
173
+ - [Fixed] Removed some padding for tables without borders
174
+
175
+ ## 1.0.44
176
+
177
+ - [Fixed] Removed special characteds from content copying
178
+
179
+ ## 1.0.43
180
+
181
+ - [Fixed] Moved to ReactDOM for rendering extra buttons
182
+ - [Added] Ability to include anchor links & buttons
183
+ - [Added] Ability to auto-scroll to anchors
184
+
185
+ ## 1.0.42
186
+
187
+ - [Fixed] Remove bolding from links
188
+
189
+ ## 1.0.37
190
+
191
+ - [Fixed] Get correct parent for copy button
192
+
193
+ ## 1.0.36
194
+
195
+ - [Fixed] Improved code block styles
196
+
197
+ ## 1.0.35
198
+
199
+ - [Fixed] important fonts
200
+
201
+ ## 1.0.34
202
+
203
+ - [Fixed] use custom fonts for all tags inside h1, h2, h3
204
+
205
+ ## 1.0.33
206
+
207
+ - [Fixed] Code block
208
+
209
+ ## 1.0.30
210
+
211
+ - [Fixed] enforce font style to content
212
+
213
+ ## 1.0.29
214
+
215
+ - [Fixed] Modify blockquote styles to match froala's
216
+
217
+ ## 1.0.28
218
+
219
+ - [Fixed] Default image placement is now left aligned and not centered
220
+ - [Fixed] Update frontend-utils dependency
221
+
222
+ ## 1.0.27
223
+
224
+ - [Add] Rendering of code blocks + adding copy button to code blocks
225
+
226
+ ## 1.0.26
227
+
228
+ - [Fixed] Embeded videos styles
229
+
230
+ ## 1.0.25
231
+
232
+ - [Fixed] Removed a href urls
233
+
234
+ ## 1.0.24
235
+
236
+ - [Fixed] fixed article CSS styles.
237
+
238
+ ## 1.0.23
239
+
240
+ - [Fixed] update dependencies
241
+
242
+ ## 1.0.22
243
+
244
+ - [Add] add some props for article content
245
+
246
+ ## 1.0.21
247
+
248
+ - [Fixed] stop publishing the docs
249
+
250
+ ## 1.0.20
251
+
252
+ - [Add] Changed some css for @channel and @editor
253
+
254
+ ## 1.0.19
255
+
256
+ - [Fixed] Changed @team into @channel mentioning
257
+
258
+ ## 1.0.18
259
+
260
+ - [Add] Support for @team and @editors mentioning.
261
+
262
+ ## 1.0.17
263
+
264
+ - [Fixed] Styles for heading text.
265
+
266
+ ## 1.0.15
267
+
268
+ - [Fixed] Type error in the mentions Showdown plugin
269
+
270
+ ## 1.0.14
271
+
272
+ - [Fixed] Links converted from markdown will now open in a new tab.
273
+
274
+ ## 1.0.13
275
+
276
+ - [Fixed] Pre element styles are now also applied to Code elements.
277
+
278
+ ## 1.0.11
279
+
280
+ - [Fixed] Ordered and unordered lists are now aligned, and have correct line-height.
281
+
282
+ ## 1.0.10
283
+
284
+ - [Fixed] List font size is now 16px.
285
+
286
+ ## 1.0.8
287
+
288
+ - [Added] CSS styles to mention tags.
289
+
290
+ ## 1.0.7
291
+
292
+ - [Fixed] Adds class to safe tags for anchor elements.
293
+
294
+ ## 1.0.6
295
+
296
+ - [Fixed] font stylings of p tags.
297
+
298
+ ## 1.0.5
299
+
300
+ - [Fixed] Missing dist
301
+
302
+ ## 1.0.4
303
+
304
+ - [Fixed] Package not updated
305
+
306
+ ## 1.0.3
307
+
308
+ - [Added] Handle user-mentio html tag
309
+
310
+ ## 1.0.2
311
+
312
+ - Publish
313
+
314
+ ## 1.0.1
315
+
316
+ - [Fixed] All children elements will now use the sans-serif font family.
317
+
318
+ ## 1.0.0
319
+
320
+ - Initial copy from the private kit
package/dist/index.cjs.js CHANGED
@@ -395,171 +395,169 @@
395
395
  margin: 0 auto;
396
396
  }
397
397
  }
398
+
399
+ img {
400
+ max-width: 100%;
401
+ margin: 5px;
402
+ padding: 0;
403
+ }
398
404
 
399
405
  // everything-except-pages CSS
400
- ${({widgetType:e,inheritBrandingStyles:n})=>e==="page"?"":_e.css`
401
- * {
402
- font-family: ${dt.sansFamily};
403
- }
404
-
405
- h1 {
406
- font-family: ${n?"var(--channels-h1-font-family, revert)":"revert"};
407
- font-weight: ${n?"var(--channels-h1-font-weight, 500)":"500"};
408
- font-size: 24px;
409
- letter-spacing: -0.5px;
410
- line-height: 32px;
411
- + h1,
412
- + h2,
413
- + h3,
414
- + h4,
415
- + p {
416
- margin-top: var(--space-md);
417
- }
418
- & * {
419
- font-family: ${n?"var(--channels-h1-font-family, revert)":"revert"};
406
+ ${({widgetType:e,inheritBrandingStyles:n})=>e!=="page"&&_e.css`
407
+ * {
408
+ font-family: ${dt.sansFamily};
420
409
  }
421
- }
422
- h2 {
423
- font-family: ${n?"var(--channels-h2-font-family, revert)":"revert"};
424
- font-weight: ${n?"var(--channels-h2-font-weight, 500)":"500"};
425
- font-size: 20px;
426
- line-height: 28px;
427
- + h1,
428
- + h2,
429
- + h3,
430
- + h4,
431
- + p {
432
- margin-top: var(--space-md);
433
- }
434
- & * {
435
- font-family: ${n?"var(--channels-h2-font-family, revert)":"revert"};
436
- }
437
- }
438
- h3 {
439
- font-family: ${n?"var(--channels-h3-font-family, revert)":"revert"};
440
- font-weight: ${n?"var(--channels-h3-font-weight, 500)":"500"};
441
- font-size: 16px;
442
- line-height: 24px;
443
- + h1,
444
- + h2,
445
- + h3,
446
- + h4,
447
- + p {
448
- margin-top: var(--space-md-minus);
449
- }
450
- & * {
451
- font-family: ${n?"var(--channels-h3-font-family, revert);":"revert"}
410
+
411
+ h1 {
412
+ font-family: ${n?"var(--channels-h1-font-family, revert)":"revert"};
413
+ font-weight: ${n?"var(--channels-h1-font-weight, 500)":"500"};
414
+ font-size: 24px;
415
+ letter-spacing: -0.5px;
416
+ line-height: 32px;
417
+ + h1,
418
+ + h2,
419
+ + h3,
420
+ + h4,
421
+ + p {
422
+ margin-top: var(--space-md);
423
+ }
424
+ & * {
425
+ font-family: ${n?"var(--channels-h1-font-family, revert)":"revert"};
426
+ }
452
427
  }
453
- }
454
- h4 {
455
- font-size: 16px;
456
- line-height: 24px;
457
- + h1,
458
- + h2,
459
- + h3,
460
- + h4,
461
- + p {
462
- margin-top: var(--space-md-minus);
428
+ h2 {
429
+ font-family: ${n?"var(--channels-h2-font-family, revert)":"revert"};
430
+ font-weight: ${n?"var(--channels-h2-font-weight, 500)":"500"};
431
+ font-size: 20px;
432
+ line-height: 28px;
433
+ + h1,
434
+ + h2,
435
+ + h3,
436
+ + h4,
437
+ + p {
438
+ margin-top: var(--space-md);
439
+ }
440
+ & * {
441
+ font-family: ${n?"var(--channels-h2-font-family, revert)":"revert"};
442
+ }
463
443
  }
464
- }
465
- p {
466
- font-family: ${n?"var(--channels-body-font-family, revert)":"revert"};
467
- font-weight: ${n?"var(--channels-body-font-weight, revert)":"revert"};
468
- font-size: 16px;
469
- line-height: 24px;
470
- letter-spacing: 0px;
471
- + h1,
472
- + h2,
473
- + h3,
474
- + h4,
475
- + p {
476
- margin-top: var(--space-md-minus);
477
- }
478
-
479
- & * {
480
- font-family: ${n?"var(--channels-body-font-family, revert)":"revert"};
444
+ h3 {
445
+ font-family: ${n?"var(--channels-h3-font-family, revert)":"revert"};
446
+ font-weight: ${n?"var(--channels-h3-font-weight, 500)":"500"};
447
+ font-size: 16px;
448
+ line-height: 24px;
449
+ + h1,
450
+ + h2,
451
+ + h3,
452
+ + h4,
453
+ + p {
454
+ margin-top: var(--space-md-minus);
455
+ }
456
+ & * {
457
+ font-family: ${n?"var(--channels-h3-font-family, revert);":"revert"}
458
+ }
481
459
  }
482
- }
483
- }
484
- a {
485
- color: var(--color-active-primary);
486
- text-decoration: none;
487
- :hover {
488
- text-decoration: underline;
460
+ h4 {
461
+ font-size: 16px;
462
+ line-height: 24px;
463
+ + h1,
464
+ + h2,
465
+ + h3,
466
+ + h4,
467
+ + p {
468
+ margin-top: var(--space-md-minus);
469
+ }
489
470
  }
490
- }
491
- ul {
492
- list-style-type: disc;
493
- }
494
- ol {
495
- list-style-type: decimal;
496
- counter-reset: item;
497
- li {
498
- padding-left: var(--space-md-minus);
499
- text-indent: -33px;
500
- list-style-type: none;
501
- counter-increment: item;
502
- &:before {
503
- display: inline-block;
504
- width: 13px;
505
- padding-right: var(--space-md);
506
- padding-left: var(--space-xs-plus);
507
- font-weight: bold;
508
- text-align: right;
509
- content: counter(item) ".";
510
- }
511
- font-family: ${n?"var(--channels-body-font-family, revert)":"revert"};
471
+ p {
472
+ font-family: ${n?"var(--channels-body-font-family, revert)":"revert"};
512
473
  font-weight: ${n?"var(--channels-body-font-weight, revert)":"revert"};
474
+ font-size: 16px;
475
+ line-height: 24px;
476
+ letter-spacing: 0;
477
+ + h1,
478
+ + h2,
479
+ + h3,
480
+ + h4,
481
+ + p {
482
+ margin-top: var(--space-md-minus);
483
+ }
484
+
485
+ & * {
486
+ font-family: ${n?"var(--channels-body-font-family, revert)":"revert"};
487
+ }
513
488
  }
514
- }
515
- ol,
516
- ul {
517
- font-size: 16px;
518
- line-height: 24px;
519
- margin: var(--space-md);
520
- display: block;
521
- -webkit-margin-before: var(--space-sm);
522
- -webkit-margin-after: var(--space-sm);
523
- -webkit-padding-start: var(--space-sm);
524
- li,
525
- li {
526
- margin-bottom: var(--space-xs-plus);
527
- padding-left: var(--space-sm-plus);
528
- > ul,
529
- > ol {
530
- -webkit-margin-before: var(--space-sm) !important;
531
- -webkit-margin-after: var(--space-sm) !important;
489
+ a {
490
+ color: var(--color-active-primary);
491
+ text-decoration: none;
492
+ :hover {
493
+ text-decoration: underline;
532
494
  }
533
-
534
- font-family: ${n?"var(--channels-body-font-family, revert);":"revert"};
535
- font-weight: ${n?"var(--channels-body-font-weight, revert)":"revert"};
536
495
  }
537
-
538
- &:first-child,
539
- &:first-child {
540
- -webkit-margin-before: 0;
496
+ ul {
497
+ list-style-type: disc;
541
498
  }
542
- &:last-child,
543
- &:last-child {
544
- -webkit-margin-after: 0;
499
+ ol {
500
+ list-style-type: decimal;
501
+ counter-reset: item;
502
+ li {
503
+ padding-left: var(--space-md-minus);
504
+ text-indent: -33px;
505
+ list-style-type: none;
506
+ counter-increment: item;
507
+ &:before {
508
+ display: inline-block;
509
+ width: 13px;
510
+ padding-right: var(--space-md);
511
+ padding-left: var(--space-xs-plus);
512
+ font-weight: bold;
513
+ text-align: right;
514
+ content: counter(item) ".";
515
+ }
516
+ font-family: ${n?"var(--channels-body-font-family, revert)":"revert"};
517
+ font-weight: ${n?"var(--channels-body-font-weight, revert)":"revert"};
518
+ }
545
519
  }
546
- }
547
- hr {
548
- -webkit-margin-before: var(--space-md);
549
- -webkit-margin-after: var(--space-md-minus);
550
- border-color: var(--color-divider);
551
- border-style: solid;
552
- height: 0px;
553
- border-width: 1px 0 0 0;
554
- }
555
- img {
556
- max-width: 100%;
557
- margin: var(--space-md) 0;
558
- & + img {
559
- margin-top: 0;
520
+ ol,
521
+ ul {
522
+ font-size: 16px;
523
+ line-height: 24px;
524
+ margin: var(--space-md);
525
+ display: block;
526
+ -webkit-margin-before: var(--space-sm);
527
+ -webkit-margin-after: var(--space-sm);
528
+ -webkit-padding-start: var(--space-sm);
529
+ li,
530
+ li {
531
+ margin-bottom: var(--space-xs-plus);
532
+ padding-left: var(--space-sm-plus);
533
+ > ul,
534
+ > ol {
535
+ -webkit-margin-before: var(--space-sm) !important;
536
+ -webkit-margin-after: var(--space-sm) !important;
537
+ }
538
+
539
+ font-family: ${n?"var(--channels-body-font-family, revert);":"revert"};
540
+ font-weight: ${n?"var(--channels-body-font-weight, revert)":"revert"};
541
+ }
542
+
543
+ &:first-child,
544
+ &:first-child {
545
+ -webkit-margin-before: 0;
546
+ }
547
+ &:last-child,
548
+ &:last-child {
549
+ -webkit-margin-after: 0;
550
+ }
560
551
  }
561
- }
562
- .xl-emoji * {
552
+ hr {
553
+ -webkit-margin-before: var(--space-md);
554
+ -webkit-margin-after: var(--space-md-minus);
555
+ border-color: var(--color-divider);
556
+ border-style: solid;
557
+ height: 0;
558
+ border-width: 1px 0 0 0;
559
+ }
560
+ .xl-emoji * {
563
561
  font-size: 40px;
564
562
  line-height: 1.2;
565
563
  }
@@ -681,7 +679,7 @@
681
679
  ${we.media.min.md`
682
680
  margin: 30px -150px;
683
681
  width: calc(100% + 300px) !important;
684
- max-width: none;
682
+ max-width: none !important;
685
683
  `}
686
684
  img {
687
685
  width: 100%;