@happeouikit/content-renderer 3.1.2 → 3.1.3
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 +227 -0
- package/dist/ContentRenderer.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 3.1.3
|
|
4
|
+
|
|
5
|
+
- [Add] styles for custom-emoji
|
|
6
|
+
|
|
7
|
+
## 3.1.2
|
|
8
|
+
|
|
9
|
+
- [Add] img type data attribute
|
|
10
|
+
|
|
11
|
+
## 3.1.1
|
|
12
|
+
|
|
13
|
+
- [Remove] @universe dependencies
|
|
14
|
+
|
|
15
|
+
## 3.0.10
|
|
16
|
+
|
|
17
|
+
- [Fixed] paragraph styles
|
|
18
|
+
|
|
19
|
+
## 3.0.9
|
|
20
|
+
|
|
21
|
+
- [Fixed] paragraph styles
|
|
22
|
+
|
|
23
|
+
## 3.0.8
|
|
24
|
+
|
|
25
|
+
- Publish
|
|
26
|
+
|
|
27
|
+
## 3.0.7
|
|
28
|
+
|
|
29
|
+
- Publish
|
|
30
|
+
|
|
31
|
+
## 3.0.6
|
|
32
|
+
|
|
33
|
+
- [Added] Support for user defined font families and weights
|
|
34
|
+
|
|
35
|
+
## 3.0.5
|
|
36
|
+
|
|
37
|
+
- Publish
|
|
38
|
+
|
|
39
|
+
## 3.0.4
|
|
40
|
+
|
|
41
|
+
- [Fixed] ContentRenderer should now render content without applying links to domain-like text.
|
|
42
|
+
- [Updated] Updated ContentRenderer unit test with Testing Linkify hyper-link Features.
|
|
43
|
+
|
|
44
|
+
## 3.0.3
|
|
45
|
+
|
|
46
|
+
- [Added] Added prop `forceDefaultLinkTarget` that will force external links with `target="_blank"` and removes `target` from internal links.
|
|
47
|
+
|
|
48
|
+
## 3.0.2
|
|
49
|
+
|
|
50
|
+
- [Fixed] ContentRenderer now applies styling options from Pages
|
|
51
|
+
|
|
52
|
+
## 3.0.1
|
|
53
|
+
|
|
54
|
+
- [Fixed] ContentRenderer should now deal with all kinds of xss
|
|
55
|
+
|
|
56
|
+
## 3.0.0
|
|
57
|
+
|
|
58
|
+
- [Fixed] the xss converter now accepts a whiteList for CSS properties that includes vertical-align
|
|
59
|
+
- [Updated] new dependencies updates: React 17 and and Styled Components 5
|
|
60
|
+
|
|
61
|
+
## 2.0.1
|
|
62
|
+
|
|
63
|
+
- [Added] Changed type to uppercase and to handle both upper and lowercase. Add warning if lowecase is used.
|
|
64
|
+
- [Added] Handle widgetType=`page` by removing forced styles from component.
|
|
65
|
+
|
|
66
|
+
## 2.0.0
|
|
67
|
+
|
|
68
|
+
- [Breaking change] Links rendered from markdown content now always open in a new tab (not configurable).
|
|
69
|
+
|
|
70
|
+
## 1.0.48
|
|
71
|
+
|
|
72
|
+
- [Fixed] Decode HTML entites causing crashes
|
|
73
|
+
|
|
74
|
+
## 1.0.46
|
|
75
|
+
|
|
76
|
+
- [Fixed] Use correct font-family for all the tags inside paragraphs and list elements etc.
|
|
77
|
+
|
|
78
|
+
## 1.0.45
|
|
79
|
+
|
|
80
|
+
- [Fixed] Removed some padding for tables without borders
|
|
81
|
+
|
|
82
|
+
## 1.0.44
|
|
83
|
+
|
|
84
|
+
- [Fixed] Removed special characteds from content copying
|
|
85
|
+
|
|
86
|
+
## 1.0.43
|
|
87
|
+
|
|
88
|
+
- [Fixed] Moved to ReactDOM for rendering extra buttons
|
|
89
|
+
- [Added] Ability to include anchor links & buttons
|
|
90
|
+
- [Added] Ability to auto-scroll to anchors
|
|
91
|
+
|
|
92
|
+
## 1.0.42
|
|
93
|
+
|
|
94
|
+
- [Fixed] Remove bolding from links
|
|
95
|
+
|
|
96
|
+
## 1.0.37
|
|
97
|
+
|
|
98
|
+
- [Fixed] Get correct parent for copy button
|
|
99
|
+
|
|
100
|
+
## 1.0.36
|
|
101
|
+
|
|
102
|
+
- [Fixed] Improved code block styles
|
|
103
|
+
|
|
104
|
+
## 1.0.35
|
|
105
|
+
|
|
106
|
+
- [Fixed] important fonts
|
|
107
|
+
|
|
108
|
+
## 1.0.34
|
|
109
|
+
|
|
110
|
+
- [Fixed] use custom fonts for all tags inside h1, h2, h3
|
|
111
|
+
|
|
112
|
+
## 1.0.33
|
|
113
|
+
|
|
114
|
+
- [Fixed] Code block
|
|
115
|
+
|
|
116
|
+
## 1.0.30
|
|
117
|
+
|
|
118
|
+
- [Fixed] enforce font style to content
|
|
119
|
+
|
|
120
|
+
## 1.0.29
|
|
121
|
+
|
|
122
|
+
- [Fixed] Modify blockquote styles to match froala's
|
|
123
|
+
|
|
124
|
+
## 1.0.28
|
|
125
|
+
|
|
126
|
+
- [Fixed] Default image placement is now left aligned and not centered
|
|
127
|
+
- [Fixed] Update frontend-utils dependency
|
|
128
|
+
|
|
129
|
+
## 1.0.27
|
|
130
|
+
|
|
131
|
+
- [Add] Rendering of code blocks + adding copy button to code blocks
|
|
132
|
+
|
|
133
|
+
## 1.0.26
|
|
134
|
+
|
|
135
|
+
- [Fixed] Embeded videos styles
|
|
136
|
+
|
|
137
|
+
## 1.0.25
|
|
138
|
+
|
|
139
|
+
- [Fixed] Removed a href urls
|
|
140
|
+
|
|
141
|
+
## 1.0.24
|
|
142
|
+
|
|
143
|
+
- [Fixed] fixed article CSS styles.
|
|
144
|
+
|
|
145
|
+
## 1.0.23
|
|
146
|
+
|
|
147
|
+
- [Fixed] update dependencies
|
|
148
|
+
|
|
149
|
+
## 1.0.22
|
|
150
|
+
|
|
151
|
+
- [Add] add some props for article content
|
|
152
|
+
|
|
153
|
+
## 1.0.21
|
|
154
|
+
|
|
155
|
+
- [Fixed] stop publishing the docs
|
|
156
|
+
|
|
157
|
+
## 1.0.20
|
|
158
|
+
|
|
159
|
+
- [Add] Changed some css for @channel and @editor
|
|
160
|
+
|
|
161
|
+
## 1.0.19
|
|
162
|
+
|
|
163
|
+
- [Fixed] Changed @team into @channel mentioning
|
|
164
|
+
|
|
165
|
+
## 1.0.18
|
|
166
|
+
|
|
167
|
+
- [Add] Support for @team and @editors mentioning.
|
|
168
|
+
|
|
169
|
+
## 1.0.17
|
|
170
|
+
|
|
171
|
+
- [Fixed] Styles for heading text.
|
|
172
|
+
|
|
173
|
+
## 1.0.15
|
|
174
|
+
|
|
175
|
+
- [Fixed] Type error in the mentions Showdown plugin
|
|
176
|
+
|
|
177
|
+
## 1.0.14
|
|
178
|
+
|
|
179
|
+
- [Fixed] Links converted from markdown will now open in a new tab.
|
|
180
|
+
|
|
181
|
+
## 1.0.13
|
|
182
|
+
|
|
183
|
+
- [Fixed] Pre element styles are now also applied to Code elements.
|
|
184
|
+
|
|
185
|
+
## 1.0.11
|
|
186
|
+
|
|
187
|
+
- [Fixed] Ordered and unordered lists are now aligned, and have correct line-height.
|
|
188
|
+
|
|
189
|
+
## 1.0.10
|
|
190
|
+
|
|
191
|
+
- [Fixed] List font size is now 16px.
|
|
192
|
+
|
|
193
|
+
## 1.0.8
|
|
194
|
+
|
|
195
|
+
- [Added] CSS styles to mention tags.
|
|
196
|
+
|
|
197
|
+
## 1.0.7
|
|
198
|
+
|
|
199
|
+
- [Fixed] Adds class to safe tags for anchor elements.
|
|
200
|
+
|
|
201
|
+
## 1.0.6
|
|
202
|
+
|
|
203
|
+
- [Fixed] font stylings of p tags.
|
|
204
|
+
|
|
205
|
+
## 1.0.5
|
|
206
|
+
|
|
207
|
+
- [Fixed] Missing dist
|
|
208
|
+
|
|
209
|
+
## 1.0.4
|
|
210
|
+
|
|
211
|
+
- [Fixed] Package not updated
|
|
212
|
+
|
|
213
|
+
## 1.0.3
|
|
214
|
+
|
|
215
|
+
- [Added] Handle user-mentio html tag
|
|
216
|
+
|
|
217
|
+
## 1.0.2
|
|
218
|
+
|
|
219
|
+
- Publish
|
|
220
|
+
|
|
221
|
+
## 1.0.1
|
|
222
|
+
|
|
223
|
+
- [Fixed] All children elements will now use the sans-serif font family.
|
|
224
|
+
|
|
225
|
+
## 1.0.0
|
|
226
|
+
|
|
227
|
+
- Initial copy from the private kit
|
package/dist/ContentRenderer.js
CHANGED
|
@@ -179,7 +179,7 @@ var Wrapper = styled(BodyUI).attrs({
|
|
|
179
179
|
}, lighten(warn, 0.8), gray09, padding200, function (_ref3) {
|
|
180
180
|
var widgetType = _ref3.widgetType,
|
|
181
181
|
inheritBrandingStyles = _ref3.inheritBrandingStyles;
|
|
182
|
-
return widgetType === "page" ? "" : "\n * {\n font-family: ".concat(sansFamily, ";\n }\n\n h1 {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h1-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-h1-font-weight, 500)" : "500", ";\n font-size: 24px;\n letter-spacing: -0.5px;\n line-height: 32px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 16px;\n }\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h1-font-family, revert)" : "revert", "; \n }\n }\n h2 {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h2-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-h2-font-weight, 500)" : "500", ";\n font-size: 20px;\n line-height: 28px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 14px;\n }\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h2-font-family, revert)" : "revert", "; \n }\n }\n h3 {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h3-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-h3-font-weight, 500)" : "500", ";\n font-size: 16px;\n line-height: 24px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 12px;\n }\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h3-font-family, revert);" : "revert", " \n }\n }\n h4 {\n font-size: 16px;\n line-height: 24px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 12px;\n }\n }\n p {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-body-font-weight, revert)" : "revert", ";\n font-size: 16px;\n line-height: 24px;\n letter-spacing: 0px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 12px;\n }\n\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert)" : "revert", "; \n }\n }\n }\n a {\n color: ").concat(active, ";\n text-decoration: none;\n :hover {\n text-decoration: underline;\n }\n }\n ul {\n list-style-type: disc;\n }\n ol {\n list-style-type: decimal;\n counter-reset: item;\n li {\n padding-left: 12px;\n text-indent: -33px;\n list-style-type: none;\n counter-increment: item;\n &:before {\n display: inline-block;\n width: 13px;\n padding-right: 15px;\n padding-left: 5px;\n font-weight: bold;\n text-align: right;\n content: counter(item) \".\";\n }\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-body-font-weight, revert)" : "revert", ";\n }\n }\n ol,\n ul {\n font-size: 16px;\n line-height: 24px;\n margin: 18px 16px;\n display: block;\n -webkit-margin-before: 0.5em;\n -webkit-margin-after: 0.5em;\n -webkit-padding-start: 0.5em;\n li,\n li {\n margin-bottom: 5px;\n padding-left: 10px;\n > ul,\n > ol {\n -webkit-margin-before: 8px !important;\n -webkit-margin-after: 8px !important;\n }\n\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert);" : "revert", ";\n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-body-font-weight, revert)" : "revert", ";\n }\n\n &:first-child,\n &:first-child {\n -webkit-margin-before: 0;\n }\n &:last-child,\n &:last-child {\n -webkit-margin-after: 0;\n }\n }\n hr {\n -webkit-margin-before: 16px;\n -webkit-margin-after: 13px;\n border-color: @border-color;\n border-style: solid;\n height: 0px;\n border-width: 1px 0 0 0;\n }\n table {\n width: 100%;\n margin: 15px 0;\n text-align: left;\n thead th {\n background: @white;\n }\n th,\n td {\n border-width: 1px;\n border-style: solid;\n border-color: @border-color;\n padding: 0.5em;\n }\n tr:nth-child(even) {\n background: @almost-white;\n }\n tr:nth-child(odd) {\n background: @white;\n }\n }\n table.no-borders {\n th,\n td {\n border: none;\n }\n }\n table.padded-2 {\n th,\n td {\n padding: 2em;\n }\n }\n table.padded-1 {\n th,\n td {\n padding: 1em;\n }\n }\n img {\n max-width: 100%;\n margin: 15px 0;\n & + img {\n margin-top: 0;\n }\n }\n .xl-emoji * {\n font-size: 40px;\n line-height: 1.2;\n }\n \n blockquote {\n border-top: 2px solid ").concat(gray07, ";\n border-bottom: 2px solid ").concat(gray07, ";\n font-size: 18px;\n padding: 24px 48px;\n position: relative;\n text-align: center;\n margin: 48px 0;\n }\n ");
|
|
182
|
+
return widgetType === "page" ? "" : "\n * {\n font-family: ".concat(sansFamily, ";\n }\n\n h1 {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h1-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-h1-font-weight, 500)" : "500", ";\n font-size: 24px;\n letter-spacing: -0.5px;\n line-height: 32px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 16px;\n }\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h1-font-family, revert)" : "revert", "; \n }\n }\n h2 {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h2-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-h2-font-weight, 500)" : "500", ";\n font-size: 20px;\n line-height: 28px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 14px;\n }\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h2-font-family, revert)" : "revert", "; \n }\n }\n h3 {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h3-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-h3-font-weight, 500)" : "500", ";\n font-size: 16px;\n line-height: 24px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 12px;\n }\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-h3-font-family, revert);" : "revert", " \n }\n }\n h4 {\n font-size: 16px;\n line-height: 24px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 12px;\n }\n }\n p {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-body-font-weight, revert)" : "revert", ";\n font-size: 16px;\n line-height: 24px;\n letter-spacing: 0px;\n + h1,\n + h2,\n + h3,\n + h4,\n + p {\n margin-top: 12px;\n }\n\n & * {\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert)" : "revert", "; \n }\n }\n }\n a {\n color: ").concat(active, ";\n text-decoration: none;\n :hover {\n text-decoration: underline;\n }\n }\n ul {\n list-style-type: disc;\n }\n ol {\n list-style-type: decimal;\n counter-reset: item;\n li {\n padding-left: 12px;\n text-indent: -33px;\n list-style-type: none;\n counter-increment: item;\n &:before {\n display: inline-block;\n width: 13px;\n padding-right: 15px;\n padding-left: 5px;\n font-weight: bold;\n text-align: right;\n content: counter(item) \".\";\n }\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert)" : "revert", "; \n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-body-font-weight, revert)" : "revert", ";\n }\n }\n ol,\n ul {\n font-size: 16px;\n line-height: 24px;\n margin: 18px 16px;\n display: block;\n -webkit-margin-before: 0.5em;\n -webkit-margin-after: 0.5em;\n -webkit-padding-start: 0.5em;\n li,\n li {\n margin-bottom: 5px;\n padding-left: 10px;\n > ul,\n > ol {\n -webkit-margin-before: 8px !important;\n -webkit-margin-after: 8px !important;\n }\n\n font-family: ").concat(inheritBrandingStyles ? "var(--channels-body-font-family, revert);" : "revert", ";\n font-weight: ").concat(inheritBrandingStyles ? "var(--channels-body-font-weight, revert)" : "revert", ";\n }\n\n &:first-child,\n &:first-child {\n -webkit-margin-before: 0;\n }\n &:last-child,\n &:last-child {\n -webkit-margin-after: 0;\n }\n }\n hr {\n -webkit-margin-before: 16px;\n -webkit-margin-after: 13px;\n border-color: @border-color;\n border-style: solid;\n height: 0px;\n border-width: 1px 0 0 0;\n }\n table {\n width: 100%;\n margin: 15px 0;\n text-align: left;\n thead th {\n background: @white;\n }\n th,\n td {\n border-width: 1px;\n border-style: solid;\n border-color: @border-color;\n padding: 0.5em;\n }\n tr:nth-child(even) {\n background: @almost-white;\n }\n tr:nth-child(odd) {\n background: @white;\n }\n }\n table.no-borders {\n th,\n td {\n border: none;\n }\n }\n table.padded-2 {\n th,\n td {\n padding: 2em;\n }\n }\n table.padded-1 {\n th,\n td {\n padding: 1em;\n }\n }\n img {\n max-width: 100%;\n margin: 15px 0;\n & + img {\n margin-top: 0;\n }\n\n &[type=\"custom-emoji\"] {\n height: 1em;\n display: inline;\n margin: 0;\n }\n }\n .xl-emoji * {\n font-size: 40px;\n line-height: 1.2;\n }\n \n blockquote {\n border-top: 2px solid ").concat(gray07, ";\n border-bottom: 2px solid ").concat(gray07, ";\n font-size: 18px;\n padding: 24px 48px;\n position: relative;\n text-align: center;\n margin: 48px 0;\n }\n ");
|
|
183
183
|
}, function (_ref4) {
|
|
184
184
|
var widgetType = _ref4.widgetType,
|
|
185
185
|
inheritBrandingStyles = _ref4.inheritBrandingStyles;
|