@happeouikit/content-renderer 3.4.2-alpha.4 → 3.4.4
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/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +552 -548
- package/dist/index.es.js.map +1 -1
- package/dist/links.d.ts +12 -7
- package/package.json +3 -2
- package/CHANGELOG.md +0 -320
package/dist/links.d.ts
CHANGED
|
@@ -2,18 +2,23 @@
|
|
|
2
2
|
* Support unique ids for headers for new content
|
|
3
3
|
*
|
|
4
4
|
* ID's are of format xhhhhhhh (x followed by 7 hexadecimal numbers)
|
|
5
|
-
* New content should be automatically created with this type of id, but old content probably
|
|
5
|
+
* New content should be automatically created with this type of id, but old content probably does not have any ids at all.
|
|
6
6
|
*
|
|
7
|
-
* If the element has this type of id then we generate links with hash such as #
|
|
8
|
-
* The snippet
|
|
9
|
-
*
|
|
10
|
-
* If the element does not have an id at all (all/most legacy content), then we generate one based on the content of the header.
|
|
11
|
-
* This approach does not support duplicates or updates to the header content
|
|
7
|
+
* If the element has this type of id then we generate links with hash such as #x1234321:~:headerText=MyHeaderSnippet
|
|
8
|
+
* The extra snippet at the end is ignored by everything, it's just for readability.
|
|
12
9
|
*
|
|
10
|
+
* If there's no ID at all on the header, we'll use a real text fragment, such as #:~:text=My%20Header%20Snippet (which
|
|
11
|
+
* will scroll to the text but will not support duplicates of that text in the same document)
|
|
13
12
|
*/
|
|
14
13
|
export declare const linkRandomIdRegex: RegExp;
|
|
15
14
|
export declare const linkSnippetWithIdRegex: RegExp;
|
|
16
15
|
export declare const getRandomLinkId: () => string;
|
|
16
|
+
/**
|
|
17
|
+
* This is outdated, we only used this between 2025-08 and 2025-09, but still some anchor links were created
|
|
18
|
+
* during this time period, so they'll use this format: #x1234567+MyHeaderSnippet
|
|
19
|
+
* (they will respond well when navigated to in a new tab/page, but not when remaining in the same tab and page)
|
|
20
|
+
*/
|
|
17
21
|
export declare const getLinkIdFromFragment: (fragment: string) => string;
|
|
18
22
|
export declare const getLinkSnippet: (originalString: string | null) => string;
|
|
19
|
-
export declare const
|
|
23
|
+
export declare const generateTextFragment: (element: Element) => string | null;
|
|
24
|
+
export declare const getLinkFragment: (element: Element) => string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happeouikit/content-renderer",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.4",
|
|
4
4
|
"description": "Rendering html and markdown content",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"jsnext:main": "dist/index.es.js",
|
|
@@ -38,5 +38,6 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/loadjs": "^4.0.4"
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"gitHead": "8f67f9788aad47f4ea61757d6c74d310bbe9c1dd"
|
|
42
43
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
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 < 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
|