@ably/ui 8.7.0-dev.6ce15a7 → 8.7.0-dev.8be09a5

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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/core/Code/component.css +3 -3
  3. package/core/Code/component.js +1 -1
  4. package/core/Code.jsx +328 -7145
  5. package/core/DropdownMenu/component.js +1 -0
  6. package/core/DropdownMenu.jsx +317 -0
  7. package/core/Meganav.jsx +14 -2
  8. package/core/MeganavContentDevelopers.jsx +13 -1
  9. package/core/MeganavContentUseCases.jsx +1 -1
  10. package/core/MeganavContentWhyAbly/component.js +21 -5
  11. package/core/MeganavContentWhyAbly.jsx +3276 -3
  12. package/core/Notice/component.js.LICENSE.txt +0 -15
  13. package/core/sprites.svg +21 -0
  14. package/core/styles.css +2 -0
  15. package/package.json +3 -1
  16. package/src/core/Code/component.css +1 -67
  17. package/src/core/Code/component.js +11 -46
  18. package/src/core/Code/component.jsx +7 -3
  19. package/{preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/log/.keep → src/core/DropdownMenu/component.js} +0 -0
  20. package/src/core/DropdownMenu/component.jsx +114 -0
  21. package/src/core/FeatureFooter/component.html.erb +1 -1
  22. package/src/core/MeganavContentDevelopers/component.html.erb +9 -0
  23. package/src/core/MeganavContentDevelopers/component.jsx +9 -0
  24. package/src/core/MeganavContentUseCases/component.html.erb +1 -1
  25. package/src/core/MeganavContentUseCases/component.jsx +1 -1
  26. package/src/core/MeganavSearchSuggestions/component.html.erb +1 -1
  27. package/src/core/icons/google.svg +3 -0
  28. package/src/core/icons/icon-display-integrations-col.svg +8 -0
  29. package/src/core/icons/stackoverflow.svg +3 -0
  30. package/src/core/icons/youtube.svg +11 -0
  31. package/src/core/styles/properties.css +2 -0
  32. package/src/core/utils/syntax-highlighter-registry.js +61 -0
  33. package/src/core/utils/syntax-highlighter.css +69 -0
  34. package/src/core/utils/syntax-highlighter.js +98 -0
  35. package/core/.DS_Store +0 -0
  36. package/core/fonts/.DS_Store +0 -0
  37. package/core/images/.DS_Store +0 -0
  38. package/core/scripts.js.LICENSE.txt +0 -32
  39. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/.keep +0 -0
  40. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/pids/.keep +0 -0
  41. package/src/.DS_Store +0 -0
  42. package/src/core/.DS_Store +0 -0
  43. package/src/core/fonts/.DS_Store +0 -0
  44. package/src/core/images/.DS_Store +0 -0
  45. package/src/reset/.DS_Store +0 -0
@@ -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 };
package/core/.DS_Store DELETED
Binary file
Binary file
Binary file
@@ -1,32 +0,0 @@
1
- /*
2
- object-assign
3
- (c) Sindre Sorhus
4
- @license MIT
5
- */
6
-
7
- /** @license React v0.20.2
8
- * scheduler.production.min.js
9
- *
10
- * Copyright (c) Facebook, Inc. and its affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
-
16
- /** @license React v17.0.2
17
- * react-dom.production.min.js
18
- *
19
- * Copyright (c) Facebook, Inc. and its affiliates.
20
- *
21
- * This source code is licensed under the MIT license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- */
24
-
25
- /** @license React v17.0.2
26
- * react.production.min.js
27
- *
28
- * Copyright (c) Facebook, Inc. and its affiliates.
29
- *
30
- * This source code is licensed under the MIT license found in the
31
- * LICENSE file in the root directory of this source tree.
32
- */
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file
Binary file
Binary file