@ably/ui 8.7.0-dev.0d89184 → 8.7.0-dev.0f339e0

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 (86) hide show
  1. package/README.md +8 -1
  2. package/core/Code/component.css +3 -3
  3. package/core/Code/component.js +1 -1
  4. package/core/Code.jsx +353 -7273
  5. package/core/CompanyAutocomplete/component.js +1 -1
  6. package/core/ConnectStateWrapper.jsx +13 -4
  7. package/core/ContactFooter.jsx +13 -119
  8. package/core/CookieMessage.jsx +21 -293
  9. package/core/CustomerLogos.jsx +9 -114
  10. package/core/DropdownMenu.jsx +10 -120
  11. package/core/FeaturedLink.jsx +10 -116
  12. package/core/Flash.jsx +149 -1531
  13. package/core/Footer.jsx +17 -123
  14. package/core/Icon.jsx +9 -114
  15. package/core/Loader.jsx +9 -114
  16. package/core/Logo.jsx +36 -226
  17. package/core/Meganav/component.js +1 -2
  18. package/core/Meganav/component.json +1 -1
  19. package/core/Meganav.jsx +2202 -9546
  20. package/core/MeganavBlogPostsList/component.js +1 -1
  21. package/core/MeganavBlogPostsList.jsx +11 -118
  22. package/core/MeganavContentCompany.jsx +31 -124
  23. package/core/MeganavContentDevelopers.jsx +31 -125
  24. package/core/MeganavContentPlatform.jsx +11 -118
  25. package/core/MeganavContentUseCases.jsx +11 -117
  26. package/core/MeganavControl.jsx +10 -116
  27. package/core/MeganavControlMobileDropdown/component.js +1 -1
  28. package/core/MeganavControlMobileDropdown.jsx +10 -116
  29. package/core/MeganavControlMobilePanelClose.jsx +10 -116
  30. package/core/MeganavControlMobilePanelOpen.jsx +10 -116
  31. package/core/MeganavItemsDesktop.jsx +13 -121
  32. package/core/MeganavItemsMobile.jsx +18 -132
  33. package/core/MeganavItemsSignedIn.jsx +16 -129
  34. package/core/MeganavSearch.jsx +13 -123
  35. package/core/MeganavSearchAutocomplete/component.js +1 -2
  36. package/core/MeganavSearchPanel.jsx +12 -121
  37. package/core/MeganavSearchSuggestions.jsx +11 -118
  38. package/core/Notice/component.js +1 -2
  39. package/core/Notice.jsx +183 -2185
  40. package/core/SignOutLink.jsx +9 -114
  41. package/core/Slider/component.js +1 -1
  42. package/core/Slider.jsx +25 -582
  43. package/core/Uptime.jsx +15 -118
  44. package/core/images/ably-logo.png +0 -0
  45. package/core/scripts.js +1 -1
  46. package/core/sprites.svg +42 -1
  47. package/core/styles.css +2 -0
  48. package/package.json +4 -4
  49. package/src/.DS_Store +0 -0
  50. package/src/core/.DS_Store +0 -0
  51. package/src/core/Code/component.css +1 -67
  52. package/src/core/Code/component.js +11 -46
  53. package/src/core/Code/component.jsx +7 -3
  54. package/src/core/DropdownMenu/component.jsx +0 -2
  55. package/src/core/FeatureFooter/component.html.erb +1 -1
  56. package/src/core/Flash/component.jsx +40 -14
  57. package/src/core/Logo/component.html.erb +2 -27
  58. package/src/core/Logo/component.jsx +7 -40
  59. package/src/core/Logo/component.rb +15 -6
  60. package/src/core/Meganav/component.html.erb +1 -1
  61. package/src/core/Meganav/component.json +1 -1
  62. package/src/core/Meganav/component.jsx +1 -1
  63. package/src/core/Meganav/component.rb +3 -2
  64. package/src/core/MeganavContentDevelopers/component.html.erb +17 -8
  65. package/src/core/MeganavContentDevelopers/component.jsx +17 -8
  66. package/src/core/MeganavContentUseCases/component.html.erb +1 -1
  67. package/src/core/MeganavContentUseCases/component.jsx +1 -1
  68. package/src/core/MeganavSearchSuggestions/component.html.erb +1 -1
  69. package/src/core/core.rb +4 -0
  70. package/src/core/icons/github.svg +1 -1
  71. package/src/core/icons/google.svg +3 -0
  72. package/src/core/icons/icon-display-chat-col.svg +4 -0
  73. package/src/core/icons/icon-display-integrations-col.svg +8 -0
  74. package/src/core/icons/icon-gui-check-circled-fill-black.svg +4 -0
  75. package/src/core/icons/icon-gui-filter-flow-step-1.svg +5 -0
  76. package/src/core/icons/icon-gui-filter-flow-step-2.svg +5 -0
  77. package/src/core/icons/icon-gui-filter-flow-step-3.svg +5 -0
  78. package/src/core/icons/icon-gui-resources.svg +3 -0
  79. package/src/core/icons/stackoverflow.svg +3 -0
  80. package/src/core/icons/youtube.svg +11 -0
  81. package/src/core/images/ably-logo.png +0 -0
  82. package/src/core/styles/properties.css +2 -0
  83. package/src/core/utils/syntax-highlighter-registry.js +61 -0
  84. package/src/core/utils/syntax-highlighter.css +69 -0
  85. package/src/core/utils/syntax-highlighter.js +98 -0
  86. package/tailwind.config.js +1 -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 };
@@ -131,6 +131,7 @@ module.exports = {
131
131
  80: "var(--spacing-80)",
132
132
  88: "var(--spacing-88)",
133
133
  96: "var(--spacing-96)",
134
+ 128: "var(--spacing-128)",
134
135
  160: "var(--spacing-160)",
135
136
  256: "var(--spacing-256)",
136
137
  },