funda-ui 4.6.101 → 4.6.151
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/Chatbox/index.css +25 -1
- package/Chatbox/index.d.ts +7 -0
- package/Chatbox/index.js +279 -133
- package/Date/index.js +53 -47
- package/Select/index.d.ts +4 -4
- package/TagInput/index.d.ts +6 -0
- package/TagInput/index.js +6 -3
- package/Textarea/index.js +46 -46
- package/Utils/sanitize.d.ts +14 -0
- package/Utils/sanitize.js +87 -0
- package/Utils/useAutosizeTextArea.js +46 -46
- package/lib/cjs/Chatbox/index.d.ts +7 -0
- package/lib/cjs/Chatbox/index.js +279 -133
- package/lib/cjs/Date/index.js +53 -47
- package/lib/cjs/Select/index.d.ts +4 -4
- package/lib/cjs/TagInput/index.d.ts +6 -0
- package/lib/cjs/TagInput/index.js +6 -3
- package/lib/cjs/Textarea/index.js +46 -46
- package/lib/cjs/Utils/sanitize.d.ts +14 -0
- package/lib/cjs/Utils/sanitize.js +87 -0
- package/lib/cjs/Utils/useAutosizeTextArea.js +46 -46
- package/lib/css/Chatbox/index.css +25 -1
- package/lib/esm/Chatbox/index.scss +33 -2
- package/lib/esm/Chatbox/index.tsx +70 -8
- package/lib/esm/Chatbox/utils/func.ts +0 -54
- package/lib/esm/Date/index.tsx +60 -43
- package/lib/esm/Input/index.tsx +1 -0
- package/lib/esm/Select/index.tsx +4 -5
- package/lib/esm/TagInput/index.tsx +30 -10
- package/lib/esm/Textarea/index.tsx +1 -0
- package/lib/esm/Utils/hooks/useAutosizeTextArea.tsx +47 -49
- package/lib/esm/Utils/libs/sanitize.ts +55 -0
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* HTML entities encode
|
|
4
|
+
*
|
|
5
|
+
* @param {String} str Input text
|
|
6
|
+
* @return {String} Filtered text
|
|
7
|
+
*/function htmlEncode(str: string): string {
|
|
8
|
+
|
|
9
|
+
return str.replace(/[&<>'"]/g, tag => ({
|
|
10
|
+
'&': '&',
|
|
11
|
+
'<': '<',
|
|
12
|
+
'>': '>',
|
|
13
|
+
"'": ''',
|
|
14
|
+
'"': '"'
|
|
15
|
+
}[tag]!));
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* HTML entities decode
|
|
22
|
+
*
|
|
23
|
+
* @param {String} str Input text
|
|
24
|
+
* @return {String} Filtered text
|
|
25
|
+
*/
|
|
26
|
+
function htmlDecode(str: string = ''): string {
|
|
27
|
+
const entities: [string, string][] = [
|
|
28
|
+
['amp', '&'],
|
|
29
|
+
['apos', '\''],
|
|
30
|
+
['#x27', '\''],
|
|
31
|
+
['#x2F', '/'],
|
|
32
|
+
['#39', '\''],
|
|
33
|
+
['#47', '/'],
|
|
34
|
+
['lt', '<'],
|
|
35
|
+
['gt', '>'],
|
|
36
|
+
['nbsp', ' '],
|
|
37
|
+
['quot', '"'],
|
|
38
|
+
['#60', '<'],
|
|
39
|
+
['#62', '>']
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
for (let i = 0, max = entities.length; i < max; i++) {
|
|
43
|
+
str = str.replace(new RegExp('&' + entities[i][0] + ';', 'g'), entities[i][1]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return str;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
htmlEncode,
|
|
54
|
+
htmlDecode
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "UIUX Lab",
|
|
3
3
|
"email": "uiuxlab@gmail.com",
|
|
4
4
|
"name": "funda-ui",
|
|
5
|
-
"version": "4.6.
|
|
5
|
+
"version": "4.6.151",
|
|
6
6
|
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|