@ably/ui 8.10.0 → 9.0.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.
- package/core/Code/component.css +3 -3
- package/core/Code/component.js +1 -1
- package/core/Code.jsx +353 -7273
- package/core/CompanyAutocomplete/component.js +1 -1
- package/core/ConnectStateWrapper.jsx +13 -4
- package/core/ContactFooter.jsx +13 -119
- package/core/CookieMessage.jsx +21 -293
- package/core/CustomerLogos.jsx +9 -114
- package/core/DropdownMenu.jsx +10 -116
- package/core/FeaturedLink.jsx +10 -116
- package/core/Flash.jsx +29 -1483
- package/core/Footer.jsx +17 -123
- package/core/Icon.jsx +9 -114
- package/core/Loader.jsx +9 -114
- package/core/Logo.jsx +13 -118
- package/core/Meganav/component.js +1 -2
- package/core/Meganav.jsx +2844 -10189
- package/core/MeganavBlogPostsList/component.js +1 -1
- package/core/MeganavBlogPostsList.jsx +11 -118
- package/core/MeganavContentCompany.jsx +31 -124
- package/core/MeganavContentDevelopers.jsx +10 -116
- package/core/MeganavContentPlatform.jsx +11 -118
- package/core/MeganavContentUseCases.jsx +10 -116
- package/core/MeganavControl.jsx +10 -116
- package/core/MeganavControlMobileDropdown/component.js +1 -1
- package/core/MeganavControlMobileDropdown.jsx +10 -116
- package/core/MeganavControlMobilePanelClose.jsx +10 -116
- package/core/MeganavControlMobilePanelOpen.jsx +10 -116
- package/core/MeganavItemsDesktop.jsx +13 -121
- package/core/MeganavItemsMobile.jsx +18 -132
- package/core/MeganavItemsSignedIn.jsx +16 -129
- package/core/MeganavSearch.jsx +13 -123
- package/core/MeganavSearchAutocomplete/component.js +1 -2
- package/core/MeganavSearchPanel.jsx +12 -121
- package/core/MeganavSearchSuggestions.jsx +11 -118
- package/core/Notice/component.js +1 -2
- package/core/Notice.jsx +62 -2136
- package/core/SignOutLink.jsx +9 -114
- package/core/Slider/component.js +1 -1
- package/core/Slider.jsx +25 -582
- package/core/Uptime.jsx +15 -118
- package/core/scripts.js +1 -1
- package/package.json +4 -4
- package/src/core/Code/component.css +1 -67
- package/src/core/Code/component.js +11 -46
- package/src/core/Code/component.jsx +7 -3
- package/src/core/FeatureFooter/component.html.erb +1 -1
- package/src/core/utils/syntax-highlighter-registry.js +61 -0
- package/src/core/utils/syntax-highlighter.css +69 -0
- package/src/core/utils/syntax-highlighter.js +98 -0
- package/core/Meganav/component.js.LICENSE.txt +0 -7
- package/core/MeganavSearchAutocomplete/component.js.LICENSE.txt +0 -7
- package/core/Notice/component.js.LICENSE.txt +0 -9
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import hljs from "highlight.js/lib/core";
|
|
2
|
+
|
|
3
|
+
// Map certain frameworks, protocols etc to available langauage packs
|
|
4
|
+
const languageToHighlightKey = (lang) => {
|
|
5
|
+
let id;
|
|
6
|
+
|
|
7
|
+
if (!lang) {
|
|
8
|
+
lang = "text";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
switch (lang.toLowerCase()) {
|
|
12
|
+
case "android":
|
|
13
|
+
id = "java";
|
|
14
|
+
break;
|
|
15
|
+
|
|
16
|
+
case ".net":
|
|
17
|
+
case "net":
|
|
18
|
+
case "dotnet":
|
|
19
|
+
case "csharp":
|
|
20
|
+
case "c#":
|
|
21
|
+
id = "cs";
|
|
22
|
+
break;
|
|
23
|
+
|
|
24
|
+
case "objc":
|
|
25
|
+
case "objective c":
|
|
26
|
+
id = "objectivec";
|
|
27
|
+
break;
|
|
28
|
+
|
|
29
|
+
case "laravel":
|
|
30
|
+
id = "php";
|
|
31
|
+
break;
|
|
32
|
+
|
|
33
|
+
case "flutter":
|
|
34
|
+
id = "dart";
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case "node.js":
|
|
38
|
+
case "js":
|
|
39
|
+
id = "javascript";
|
|
40
|
+
break;
|
|
41
|
+
|
|
42
|
+
case "ts":
|
|
43
|
+
id = "typescript";
|
|
44
|
+
break;
|
|
45
|
+
|
|
46
|
+
case "shell":
|
|
47
|
+
case "fh":
|
|
48
|
+
case "sh":
|
|
49
|
+
id = "bash";
|
|
50
|
+
break;
|
|
51
|
+
|
|
52
|
+
case "https":
|
|
53
|
+
case "http":
|
|
54
|
+
case "txt":
|
|
55
|
+
case "plaintext":
|
|
56
|
+
id = "text";
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case "cmd":
|
|
60
|
+
case "bat":
|
|
61
|
+
id = "dos";
|
|
62
|
+
break;
|
|
63
|
+
|
|
64
|
+
case "yml":
|
|
65
|
+
id = "yaml";
|
|
66
|
+
break;
|
|
67
|
+
|
|
68
|
+
case "erl":
|
|
69
|
+
id = "erlang";
|
|
70
|
+
break;
|
|
71
|
+
|
|
72
|
+
case "patch":
|
|
73
|
+
id = "diff";
|
|
74
|
+
break;
|
|
75
|
+
|
|
76
|
+
case "svg":
|
|
77
|
+
id = "xml";
|
|
78
|
+
break;
|
|
79
|
+
|
|
80
|
+
default:
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return id || lang;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const registerDefaultLanguages = (register) => {
|
|
88
|
+
register.forEach(({ key, module }) => hljs.registerLanguage(key, module));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const highlightSnippet = (languageKeyword, snippet) => {
|
|
92
|
+
const language = languageToHighlightKey(languageKeyword);
|
|
93
|
+
if (typeof snippet !== "string" || !snippet || !language) return;
|
|
94
|
+
|
|
95
|
+
return hljs.highlight(snippet, { language }).value;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export { highlightSnippet, languageToHighlightKey, registerDefaultLanguages };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
3
|
-
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
4
|
-
* @license Licensed under MIT license
|
|
5
|
-
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
6
|
-
* @version v4.2.8+1e68dce6
|
|
7
|
-
*/
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
3
|
-
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
4
|
-
* @license Licensed under MIT license
|
|
5
|
-
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
6
|
-
* @version v4.2.8+1e68dce6
|
|
7
|
-
*/
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* JavaScript Cookie v2.2.1
|
|
3
|
-
* https://github.com/js-cookie/js-cookie
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
6
|
-
* Released under the MIT license
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
|