@ably/ui 8.7.0-dev.4e08581 → 8.7.0-dev.52da22c

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 (177) hide show
  1. package/README.md +16 -5
  2. package/core/Code/component.css +3 -3
  3. package/core/Code/component.js +1 -1
  4. package/core/Code.jsx +351 -7148
  5. package/core/CompanyAutocomplete/component.js +2 -1
  6. package/core/CompanyAutocomplete/component.js.LICENSE.txt +1 -0
  7. package/core/ConnectStateWrapper/component.js +1 -1
  8. package/core/ConnectStateWrapper.jsx +7 -7
  9. package/core/ContactFooter/component.js +1 -1
  10. package/core/ContactFooter.jsx +12 -12
  11. package/core/CookieMessage/component.js +1 -1
  12. package/core/CookieMessage.jsx +10 -10
  13. package/core/CustomerLogos/component.js +1 -1
  14. package/core/CustomerLogos.jsx +7 -7
  15. package/core/DropdownMenu/component.js +1 -0
  16. package/core/DropdownMenu.jsx +313 -0
  17. package/core/FeatureFooter/component.js +1 -1
  18. package/core/FeaturedLink/component.js +1 -1
  19. package/core/FeaturedLink.jsx +10 -10
  20. package/core/Flash/component.js +1 -1
  21. package/core/Flash.jsx +142 -70
  22. package/core/Footer/component.css +21 -1
  23. package/core/Footer/component.js +1 -1
  24. package/core/Footer.jsx +162 -76
  25. package/core/Icon/component.js +1 -1
  26. package/core/Icon.jsx +7 -7
  27. package/core/Loader/component.js +1 -1
  28. package/core/Loader.jsx +7 -7
  29. package/core/Logo/component.js +1 -1
  30. package/core/Logo.jsx +33 -118
  31. package/core/Meganav/component.css +59 -20
  32. package/core/Meganav/component.js +1 -1
  33. package/core/Meganav/component.json +2 -2
  34. package/core/Meganav.jsx +1120 -1211
  35. package/core/MeganavBlogPostsList/component.js +2 -1
  36. package/core/MeganavBlogPostsList/component.js.LICENSE.txt +1 -0
  37. package/core/MeganavBlogPostsList.jsx +13 -13
  38. package/core/MeganavContentCompany/component.js +1 -1
  39. package/core/MeganavContentCompany.jsx +328 -731
  40. package/core/MeganavContentDevelopers/component.js +1 -1
  41. package/core/MeganavContentDevelopers.jsx +119 -78
  42. package/core/{MeganavContentPlatform → MeganavContentProducts}/component.js +1 -1
  43. package/core/{MeganavContentPlatform.jsx → MeganavContentProducts.jsx} +34 -58
  44. package/core/MeganavContentUseCases/component.js +1 -1
  45. package/core/MeganavContentUseCases.jsx +63 -55
  46. package/core/MeganavControl/component.js +1 -1
  47. package/core/MeganavControl.jsx +10 -10
  48. package/core/MeganavControlMobileDropdown/component.js +1 -1
  49. package/core/MeganavControlMobileDropdown.jsx +11 -11
  50. package/core/MeganavControlMobilePanelClose/component.js +1 -1
  51. package/core/MeganavControlMobilePanelClose.jsx +10 -10
  52. package/core/MeganavControlMobilePanelOpen/component.js +1 -1
  53. package/core/MeganavControlMobilePanelOpen.jsx +10 -10
  54. package/core/MeganavItemsDesktop/component.js +1 -1
  55. package/core/MeganavItemsDesktop.jsx +17 -17
  56. package/core/MeganavItemsMobile/component.js +1 -1
  57. package/core/MeganavItemsMobile.jsx +39 -39
  58. package/core/MeganavItemsSignedIn/component.js +1 -1
  59. package/core/MeganavItemsSignedIn.jsx +33 -33
  60. package/core/MeganavSearch/component.js +1 -1
  61. package/core/MeganavSearch.jsx +23 -23
  62. package/core/MeganavSearchAutocomplete/component.js +1 -1
  63. package/core/MeganavSearchAutocomplete.jsx +4 -4
  64. package/core/MeganavSearchPanel/component.js +1 -1
  65. package/core/MeganavSearchPanel.jsx +19 -19
  66. package/core/MeganavSearchSuggestions/component.js +1 -1
  67. package/core/MeganavSearchSuggestions.jsx +13 -13
  68. package/core/Notice/component.js +1 -1
  69. package/core/Notice.jsx +152 -80
  70. package/core/Showcase/component.js +1 -1
  71. package/core/Showcase.jsx +1 -1
  72. package/core/SignOutLink/component.js +1 -1
  73. package/core/SignOutLink.jsx +7 -7
  74. package/core/Slider/component.js +1 -1
  75. package/core/Slider.jsx +14 -14
  76. package/core/Uptime/component.js +1 -1
  77. package/core/Uptime.jsx +300 -715
  78. package/core/images/ably-logo.png +0 -0
  79. package/core/images/best-support-2023.svg +1 -0
  80. package/core/images/fastest-implementation-2023.svg +1 -0
  81. package/core/images/high-performer-2022.png +0 -0
  82. package/core/images/high-performer-2023.svg +1 -0
  83. package/core/images/highest-user-adoption-2022.png +0 -0
  84. package/core/images/highest-user-adoption-2023.svg +1 -0
  85. package/core/images/users-love-us-2022.png +0 -0
  86. package/core/scripts.js +2 -1
  87. package/core/scripts.js.LICENSE.txt +1 -0
  88. package/core/sprites.svg +135 -1
  89. package/core/styles.css +3 -7
  90. package/package.json +7 -6
  91. package/reset/scripts.js +1 -1
  92. package/reset/styles.css +1 -11
  93. package/src/core/Code/component.css +1 -67
  94. package/src/core/Code/component.js +11 -46
  95. package/src/core/Code/component.jsx +7 -3
  96. package/src/core/DropdownMenu/component.jsx +112 -0
  97. package/src/core/FeatureFooter/component.html.erb +1 -1
  98. package/src/core/Flash/component.jsx +40 -14
  99. package/src/core/Footer/component.css +21 -1
  100. package/src/core/Footer/component.html.erb +120 -63
  101. package/src/core/Footer/component.jsx +128 -61
  102. package/src/core/HeadwayWidget/HeadwayWidget.jsx +229 -0
  103. package/src/core/HeadwayWidget/index.js +5 -0
  104. package/src/core/Logo/component.html.erb +2 -27
  105. package/src/core/Logo/component.jsx +7 -40
  106. package/src/core/Logo/component.rb +15 -6
  107. package/src/core/Meganav/MeganavHeadwayPortal.jsx +20 -0
  108. package/src/core/Meganav/component.css +59 -18
  109. package/src/core/Meganav/component.html.erb +1 -1
  110. package/src/core/Meganav/component.json +2 -2
  111. package/src/core/Meganav/component.jsx +16 -12
  112. package/src/core/Meganav/component.rb +7 -6
  113. package/src/core/MeganavContentCompany/component.html.erb +9 -0
  114. package/src/core/MeganavContentCompany/component.jsx +9 -0
  115. package/src/core/MeganavContentDevelopers/component.html.erb +47 -21
  116. package/src/core/MeganavContentDevelopers/component.js +16 -0
  117. package/src/core/MeganavContentDevelopers/component.jsx +52 -23
  118. package/src/core/{MeganavContentPlatform → MeganavContentProducts}/component.html.erb +15 -33
  119. package/src/core/{MeganavContentPlatform → MeganavContentProducts}/component.jsx +18 -39
  120. package/src/core/{MeganavContentPlatform → MeganavContentProducts}/component.rb +1 -1
  121. package/src/core/MeganavContentUseCases/component.html.erb +43 -39
  122. package/src/core/MeganavContentUseCases/component.jsx +42 -39
  123. package/src/core/MeganavItemsDesktop/component.jsx +1 -1
  124. package/src/core/MeganavItemsDesktop/component.rb +1 -1
  125. package/src/core/MeganavSearchSuggestions/component.html.erb +1 -1
  126. package/src/core/core.rb +16 -4
  127. package/src/core/icons/github.svg +1 -1
  128. package/src/core/icons/google.svg +3 -0
  129. package/src/core/icons/icon-display-asset-tracking-col.svg +18 -0
  130. package/src/core/icons/icon-display-chat-col.svg +4 -0
  131. package/src/core/icons/icon-display-data-broadcast-col.svg +26 -0
  132. package/src/core/icons/icon-display-data-synchronization-col.svg +14 -0
  133. package/src/core/icons/icon-display-events-col.svg +13 -0
  134. package/src/core/icons/icon-display-examples-col.svg +11 -0
  135. package/src/core/icons/icon-display-integrations-col.svg +8 -0
  136. package/src/core/icons/icon-display-kafka-at-the-edge-col.svg +8 -0
  137. package/src/core/icons/icon-display-push-notifications-col.svg +6 -0
  138. package/src/core/icons/icon-gui-check-circled-fill-black.svg +4 -0
  139. package/src/core/icons/icon-gui-filter-flow-step-1.svg +5 -0
  140. package/src/core/icons/icon-gui-filter-flow-step-2.svg +5 -0
  141. package/src/core/icons/icon-gui-filter-flow-step-3.svg +5 -0
  142. package/src/core/icons/icon-gui-resources.svg +3 -0
  143. package/src/core/icons/icon-social-x.svg +3 -0
  144. package/src/core/icons/icon-tech-apachekafka.svg +3 -0
  145. package/src/core/icons/stackoverflow.svg +3 -0
  146. package/src/core/icons/youtube.svg +11 -0
  147. package/src/core/images/ably-logo.png +0 -0
  148. package/src/core/images/best-support-2023.svg +1 -0
  149. package/src/core/images/fastest-implementation-2023.svg +1 -0
  150. package/src/core/images/high-performer-2022.png +0 -0
  151. package/src/core/images/high-performer-2023.svg +1 -0
  152. package/src/core/images/highest-user-adoption-2022.png +0 -0
  153. package/src/core/images/highest-user-adoption-2023.svg +1 -0
  154. package/src/core/images/users-love-us-2022.png +0 -0
  155. package/src/core/styles/properties.css +2 -0
  156. package/src/core/styles/text.css +1 -1
  157. package/src/core/utils/syntax-highlighter-registry.js +63 -0
  158. package/src/core/utils/syntax-highlighter.css +69 -0
  159. package/src/core/utils/syntax-highlighter.js +103 -0
  160. package/tailwind.config.js +1 -0
  161. package/core/.DS_Store +0 -0
  162. package/core/Meganav/component.js.LICENSE.txt +0 -7
  163. package/core/MeganavContentWhyAbly/component.js +0 -6
  164. package/core/MeganavContentWhyAbly.jsx +0 -6
  165. package/core/MeganavSearchAutocomplete/component.js.LICENSE.txt +0 -7
  166. package/core/Notice/component.js.LICENSE.txt +0 -9
  167. package/core/fonts/.DS_Store +0 -0
  168. package/core/images/.DS_Store +0 -0
  169. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/.keep +0 -0
  170. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/pids/.keep +0 -0
  171. package/src/.DS_Store +0 -0
  172. package/src/core/.DS_Store +0 -0
  173. package/src/core/fonts/.DS_Store +0 -0
  174. package/src/core/images/.DS_Store +0 -0
  175. package/src/reset/.DS_Store +0 -0
  176. /package/src/core/{MeganavContentPlatform → DropdownMenu}/component.js +0 -0
  177. /package/{preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/log/.keep → src/core/MeganavContentProducts/component.js} +0 -0
@@ -0,0 +1,229 @@
1
+ import PropTypes from "prop-types";
2
+ import React, { useCallback, useEffect, useRef } from "react";
3
+
4
+ const HeadwayWidgetClassName = "HW_widget_component";
5
+ const HeadwayWidgetSelector = "." + HeadwayWidgetClassName;
6
+ const HeadwayWidgetTriggerClassName = "HW_trigger";
7
+ const HeadwayWidgetTriggerSelector = "." + HeadwayWidgetTriggerClassName;
8
+
9
+ const HeadwayWidgetTrigger = ({ widgetId, component, children }) => {
10
+ const Component = component || "div";
11
+ const className = HeadwayWidgetTriggerClassName + `_${widgetId}`;
12
+
13
+ return <Component className={className}>{children}</Component>;
14
+ };
15
+
16
+ HeadwayWidgetTrigger.defaultProps = {
17
+ widgetId: "widget-1",
18
+ };
19
+
20
+ const HeadwayWidget = ({
21
+ id,
22
+ account,
23
+ children,
24
+ widgetPosition,
25
+ badgePosition,
26
+ component,
27
+ trigger,
28
+ onWidgetReady,
29
+ onShowWidget,
30
+ onShowDetails,
31
+ onReadMore,
32
+ onHideWidget,
33
+ styles,
34
+ options,
35
+ translations,
36
+ ...rest
37
+ }) => {
38
+ const onWidgetReadyRef = useRef(onWidgetReady);
39
+ const onShowWidgetRef = useRef(onShowWidget);
40
+ const onShowDetailsRef = useRef(onShowDetails);
41
+ const onReadMoreRef = useRef(onReadMore);
42
+ const onHideWidgetRef = useRef(onHideWidget);
43
+ const optionsRef = useRef(options);
44
+ useEffect(() => {
45
+ onWidgetReadyRef.current = onWidgetReady || (options.callbacks && options.callbacks.onWidgetReady);
46
+ onShowWidgetRef.current = onShowWidget || (options.callbacks && options.callbacks.onShowWidget);
47
+ onShowDetailsRef.current = onShowDetails || (options.callbacks && options.callbacks.onShowDetails);
48
+ onReadMoreRef.current = onReadMore || (options.callbacks && options.callbacks.onReadMore);
49
+ onHideWidgetRef.current = onHideWidget || (options.callbacks && options.callbacks.onHideWidget);
50
+ optionsRef.current = options;
51
+ });
52
+
53
+ const handleWidgetReady = useCallback(() => onWidgetReadyRef.current && onWidgetReadyRef.current(), []);
54
+ const handleShowWidget = useCallback(() => onShowWidgetRef.current && onShowWidgetRef.current(), []);
55
+ const handleShowDetails = useCallback(() => onShowDetailsRef.current && onShowDetailsRef.current(), []);
56
+ const handleReadMore = useCallback(() => onReadMoreRef.current && onReadMoreRef.current(), []);
57
+ const handleHideWidget = useCallback(() => onHideWidgetRef.current && onHideWidgetRef.current(), []);
58
+
59
+ const initHeadway = useCallback(() => {
60
+ const hwConfig = {
61
+ selector: HeadwayWidgetSelector + `_${id}`,
62
+ account: account || options.account,
63
+ trigger: trigger ? HeadwayWidgetSelector + `_${id}` : options.trigger || HeadwayWidgetTriggerSelector + `_${id}`,
64
+ callbacks: {
65
+ onWidgetReady: handleWidgetReady,
66
+ onShowWidget: handleShowWidget,
67
+ onShowDetails: handleShowDetails,
68
+ onReadMore: handleReadMore,
69
+ onHideWidget: handleHideWidget,
70
+ },
71
+ translations,
72
+ widgetPosition,
73
+ badgePosition,
74
+ __component: true,
75
+ styles,
76
+ ...options,
77
+ };
78
+
79
+ const widget = window.Headway.getNewWidget();
80
+ widget.init(hwConfig);
81
+
82
+ return () => {
83
+ widget.destroy();
84
+ };
85
+ }, [account, trigger, handleWidgetReady, handleShowWidget, handleShowDetails, handleReadMore, handleHideWidget, badgePosition, widgetPosition, translations]);
86
+
87
+ useEffect(() => {
88
+ let destroy;
89
+ if (window.Headway) {
90
+ destroy = initHeadway();
91
+ } else {
92
+ const head = document.getElementsByTagName("head")[0];
93
+ const script = document.createElement("script");
94
+ script.type = "text/javascript";
95
+ const p = new Promise((resolve) => {
96
+ script.onload = () => {
97
+ const d = initHeadway();
98
+ resolve(d);
99
+ };
100
+ });
101
+
102
+ destroy = () => {
103
+ p.then((d) => d());
104
+ };
105
+ script.src = "https://cdn.headwayapp.co/widget.js";
106
+ head.appendChild(script);
107
+ }
108
+ return destroy;
109
+ }, [initHeadway]);
110
+
111
+ const Component = component || "div";
112
+
113
+ return (
114
+ <Component className={HeadwayWidgetClassName + `_${id}`} {...rest} style={{ position: "relative", display: "inline-block" }}>
115
+ {children}
116
+ </Component>
117
+ );
118
+ };
119
+
120
+ export default HeadwayWidget;
121
+
122
+ HeadwayWidget.propTypes = {
123
+ /**
124
+ * account of your Headway.
125
+ */
126
+ account: PropTypes.string.isRequired,
127
+ /**
128
+ * id of the Widget. It is required if you have more than one widget instance on the page.
129
+ */
130
+ id: PropTypes.string,
131
+ /**
132
+ * position of a badge
133
+ */
134
+ badgePosition: PropTypes.oneOf([
135
+ "top-left",
136
+ "top-center",
137
+ "top-right",
138
+ "center-left",
139
+ "center",
140
+ "center-right",
141
+ "bottom-left",
142
+ "bottom-center",
143
+ "bottom-right",
144
+ ]),
145
+ /**
146
+ * badge relative widget position
147
+ */
148
+ widgetPosition: PropTypes.oneOf(["top-left", "top-right", "center-left", "center-right", "bottom-left", "bottom-right"]),
149
+ /**
150
+ * callback fired when widget has loaded
151
+ */
152
+ onWidgetReady: PropTypes.func,
153
+ /**
154
+ * callback fired when widget is shown
155
+ */
156
+ onShowWidget: PropTypes.func,
157
+ /**
158
+ * callback fired when an item in the widget is clicked
159
+ */
160
+ onShowDetails: PropTypes.func,
161
+ /**
162
+ * callback fired when user clicks on readMore link
163
+ */
164
+ onReadMore: PropTypes.func,
165
+ /**
166
+ * callback fired when user closes the widget
167
+ */
168
+ onHideWidget: PropTypes.func,
169
+ /**
170
+ * Translating the text inside of the widget
171
+ * */
172
+ translations: PropTypes.shape({
173
+ title: PropTypes.string,
174
+ labels: PropTypes.shape({
175
+ new: PropTypes.string,
176
+ update: PropTypes.string,
177
+ improvement: PropTypes.string,
178
+ }),
179
+ readMore: PropTypes.string,
180
+ footer: PropTypes.string,
181
+ }),
182
+ /**
183
+ * options defined in classic object format. Read more at https://docs.headwayapp.co/widget
184
+ */
185
+ options: PropTypes.shape({
186
+ account: PropTypes.string,
187
+ callbacks: PropTypes.shape({
188
+ onWidgetReady: PropTypes.func,
189
+ onShowWidget: PropTypes.func,
190
+ onShowDetails: PropTypes.func,
191
+ onReadMore: PropTypes.func,
192
+ onHideWidget: PropTypes.func,
193
+ }),
194
+ translations: PropTypes.shape({
195
+ title: PropTypes.string,
196
+ labels: PropTypes.shape({
197
+ new: PropTypes.string,
198
+ update: PropTypes.string,
199
+ improvement: PropTypes.string,
200
+ }),
201
+ readMore: PropTypes.string,
202
+ footer: PropTypes.string,
203
+ }),
204
+ trigger: PropTypes.string,
205
+ }),
206
+
207
+ component: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
208
+ children: PropTypes.node,
209
+ trigger: PropTypes.string,
210
+ styles: PropTypes.object,
211
+ };
212
+
213
+ HeadwayWidget.defaultProps = {
214
+ account: "",
215
+ id: "widget-1",
216
+ badgePosition: "bottom-right",
217
+ widgetPosition: "bottom-right",
218
+ styles: {},
219
+ translations: {},
220
+ options: {},
221
+ };
222
+
223
+ HeadwayWidgetTrigger.propTypes = {
224
+ widgetId: PropTypes.string.isRequired,
225
+ component: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
226
+ children: PropTypes.node,
227
+ };
228
+
229
+ export { HeadwayWidgetTrigger };
@@ -0,0 +1,5 @@
1
+ import HeadwayWidget, { HeadwayWidgetTrigger } from "./HeadwayWidget";
2
+
3
+ export default HeadwayWidget;
4
+
5
+ export { HeadwayWidgetTrigger };
@@ -1,28 +1,3 @@
1
- <%= link_to logo_href, class: 'h-32' do %>
2
- <%= tag.svg class: ["transition-colors", "text-cool-black"], data: { id: data_id }, width: "108", height: "32", viewBox: "0 0 108 32", xmlns: "http://www.w3.org/2000/svg" do %>
3
- <path
4
- d="M62.922 24.9786V4.08813H66.6933V11.6512C67.9709 10.435 69.6164 9.76044 71.3538 9.76044C75.4318 9.76044 79.0498 12.8674 79.0498 17.5484C79.0498 22.2293 75.4318 25.3465 71.3538 25.3465C69.5244 25.3465 67.7971 24.6209 66.5094 23.3024V24.9786H62.922ZM75.2785 17.5484C75.2785 14.932 73.4183 13.1025 70.9859 13.1025C68.6148 13.1025 66.7853 14.84 66.6933 17.3644V17.5484C66.6933 20.1648 68.5534 21.9942 70.9859 21.9942C73.4183 21.9942 75.2785 20.1648 75.2785 17.5484ZM80.7975 24.9786V4.08813H84.5688V24.9786H80.7975ZM89.8425 30.3954L92.0399 25.1523L86.0712 10.1284H90.1491L93.9511 20.6247L97.8144 10.1284H101.954L93.8591 30.4056H89.8425V30.3954ZM56.9329 10.1284V12.0191C55.6247 10.5883 53.7952 9.77066 51.9147 9.77066C47.8367 9.77066 44.2187 12.8777 44.2187 17.5586C44.2187 22.2497 47.8367 25.3465 51.9147 25.3465C53.8668 25.3465 55.7166 24.4982 57.0555 22.9754V24.9888H60.3465V10.1284H56.9329ZM56.5649 17.5484C56.5649 20.1341 54.7048 21.9942 52.2724 21.9942C49.8399 21.9942 47.9798 20.1341 47.9798 17.5484C47.9798 14.9626 49.8399 13.1025 52.2724 13.1025C54.6435 13.1025 56.473 14.8706 56.5649 17.3644V17.5484Z"
5
- fill="currentColor"
6
- />
7
- <path d="M19.2858 0L3.14788 29.5369L0 27.3293L14.932 0H19.2858ZM19.5107 0L35.6487 29.5369L38.7965 27.3293L23.8646 0H19.5107Z" fill="url(#<%= gradient_id_0 %>)" />
8
- <path d="M35.4238 29.7107L19.3983 17.16L3.37271 29.7107L6.64323 32L19.3983 22.0147L32.1533 32L35.4238 29.7107Z" fill="url(#<%= gradient_id_1 %>)" />
9
- <defs>
10
- <linearGradient id="<%= gradient_id_0 %>" x1="5.47361" y1="37.4219" x2="32.4603" y2="7.45023" gradientUnits="userSpaceOnUse">
11
- <stop stop-color="#FF5416" />
12
- <stop offset="0.2535" stop-color="#FF5115" />
13
- <stop offset="0.461" stop-color="#FF4712" />
14
- <stop offset="0.6523" stop-color="#FF350E" />
15
- <stop offset="0.8327" stop-color="#FF1E08" />
16
- <stop offset="1" stop-color="#FF0000" />
17
- </linearGradient>
18
- <linearGradient id="<%= gradient_id_1 %>" x1="10.7084" y1="39.3593" x2="26.6583" y2="21.6452" gradientUnits="userSpaceOnUse">
19
- <stop stop-color="#FF5416" />
20
- <stop offset="0.2535" stop-color="#FF5115" />
21
- <stop offset="0.461" stop-color="#FF4712" />
22
- <stop offset="0.6523" stop-color="#FF350E" />
23
- <stop offset="0.8327" stop-color="#FF1E08" />
24
- <stop offset="1" stop-color="#FF0000" />
25
- </linearGradient>
26
- </defs>
27
- <% end %>
1
+ <%= link_to logo_href, class: 'block', style: "height: 2.125rem", data: { id: data_id }, **additional_link_attrs do %>
2
+ <%= tag.img src: logo_url, width: "108px", alt: "Ably logo", **additional_img_attrs %>
28
3
  <% end %>
@@ -1,46 +1,10 @@
1
- import React, { useMemo } from "react";
1
+ import React from "react";
2
2
  import T from "prop-types";
3
- import { nanoid } from "nanoid/non-secure";
4
-
5
- const Logo = ({ dataId, href = "/" }) => {
6
- // This fixes a bug where if the logo is rendered more than once on the page, and one of the instances
7
- // if it is hidden, the other instance will not show the ably shape from the logo.
8
-
9
- // This is because the defs in this SVG reference ids that need to be unique ids. The browser discards the "newer"
10
- // linearGradients defined in the other logo, and inherits the `hidden` style from the first.
11
- const gradientIds = useMemo(() => [nanoid(), nanoid()], []);
12
3
 
4
+ const Logo = ({ dataId, logoUrl, href = "/", additionalImgAttrs, additionalLinkAttrs }) => {
13
5
  return (
14
- <a href={href} className="h-32">
15
- <svg data-id={dataId} className="text-cool-black transition-colors" width="108" height="32" viewBox="0 0 108 32" xmlns="http://www.w3.org/2000/svg">
16
- <path
17
- d="M62.922 24.9786V4.08813H66.6933V11.6512C67.9709 10.435 69.6164 9.76044 71.3538 9.76044C75.4318 9.76044 79.0498 12.8674 79.0498 17.5484C79.0498 22.2293 75.4318 25.3465 71.3538 25.3465C69.5244 25.3465 67.7971 24.6209 66.5094 23.3024V24.9786H62.922ZM75.2785 17.5484C75.2785 14.932 73.4183 13.1025 70.9859 13.1025C68.6148 13.1025 66.7853 14.84 66.6933 17.3644V17.5484C66.6933 20.1648 68.5534 21.9942 70.9859 21.9942C73.4183 21.9942 75.2785 20.1648 75.2785 17.5484ZM80.7975 24.9786V4.08813H84.5688V24.9786H80.7975ZM89.8425 30.3954L92.0399 25.1523L86.0712 10.1284H90.1491L93.9511 20.6247L97.8144 10.1284H101.954L93.8591 30.4056H89.8425V30.3954ZM56.9329 10.1284V12.0191C55.6247 10.5883 53.7952 9.77066 51.9147 9.77066C47.8367 9.77066 44.2187 12.8777 44.2187 17.5586C44.2187 22.2497 47.8367 25.3465 51.9147 25.3465C53.8668 25.3465 55.7166 24.4982 57.0555 22.9754V24.9888H60.3465V10.1284H56.9329ZM56.5649 17.5484C56.5649 20.1341 54.7048 21.9942 52.2724 21.9942C49.8399 21.9942 47.9798 20.1341 47.9798 17.5484C47.9798 14.9626 49.8399 13.1025 52.2724 13.1025C54.6435 13.1025 56.473 14.8706 56.5649 17.3644V17.5484Z"
18
- fill="currentColor"
19
- />
20
- <path
21
- d="M19.2858 0L3.14788 29.5369L0 27.3293L14.932 0H19.2858ZM19.5107 0L35.6487 29.5369L38.7965 27.3293L23.8646 0H19.5107Z"
22
- fill={`url(#${gradientIds[0]})`}
23
- />
24
- <path d="M35.4238 29.7107L19.3983 17.16L3.37271 29.7107L6.64323 32L19.3983 22.0147L32.1533 32L35.4238 29.7107Z" fill={`url(#${gradientIds[1]})`} />
25
- <defs>
26
- <linearGradient id={gradientIds[0]} x1="5.47361" y1="37.4219" x2="32.4603" y2="7.45023" gradientUnits="userSpaceOnUse">
27
- <stop stopColor="#FF5416" />
28
- <stop offset="0.2535" stopColor="#FF5115" />
29
- <stop offset="0.461" stopColor="#FF4712" />
30
- <stop offset="0.6523" stopColor="#FF350E" />
31
- <stop offset="0.8327" stopColor="#FF1E08" />
32
- <stop offset="1" stopColor="#FF0000" />
33
- </linearGradient>
34
- <linearGradient id={gradientIds[1]} x1="10.7084" y1="39.3593" x2="26.6583" y2="21.6452" gradientUnits="userSpaceOnUse">
35
- <stop stopColor="#FF5416" />
36
- <stop offset="0.2535" stopColor="#FF5115" />
37
- <stop offset="0.461" stopColor="#FF4712" />
38
- <stop offset="0.6523" stopColor="#FF350E" />
39
- <stop offset="0.8327" stopColor="#FF1E08" />
40
- <stop offset="1" stopColor="#FF0000" />
41
- </linearGradient>
42
- </defs>
43
- </svg>
6
+ <a href={href} data-id={dataId} className="block" style={{ height: "2.125rem" }} {...additionalLinkAttrs}>
7
+ <img src={logoUrl} width="108px" alt="Ably logo" {...additionalImgAttrs} />
44
8
  </a>
45
9
  );
46
10
  };
@@ -48,6 +12,9 @@ const Logo = ({ dataId, href = "/" }) => {
48
12
  Logo.propTypes = {
49
13
  dataId: T.string,
50
14
  href: T.string,
15
+ logoUrl: T.string,
16
+ additionalImgAttrs: T.object,
17
+ additionalLinkAttrs: T.object,
51
18
  };
52
19
 
53
20
  export default React.memo(Logo);
@@ -1,17 +1,26 @@
1
- require 'securerandom'
2
-
3
1
  module AblyUi
4
2
  module Core
5
3
  class Logo < ViewComponent::Base
6
4
  include AblyUi::Core::MeganavConfig
7
5
 
8
- attr_reader :href, :data_id, :gradient_id_0, :gradient_id_1
6
+ attr_reader :href,
7
+ :logo_url,
8
+ :data_id,
9
+ :additional_img_attrs,
10
+ :additional_link_attrs
9
11
 
10
- def initialize(data_id: '', href:)
12
+ def initialize(
13
+ href:,
14
+ logo_url:,
15
+ data_id: '',
16
+ additional_img_attrs: {},
17
+ additional_link_attrs: {}
18
+ )
11
19
  @data_id = data_id
12
20
  @href = href
13
- @gradient_id_0 = "paint_linear_#{SecureRandom.uuid}"
14
- @gradient_id_1 = "paint_linear_#{SecureRandom.uuid}"
21
+ @logo_url = logo_url
22
+ @additional_img_attrs = additional_img_attrs
23
+ @additional_link_attrs = additional_link_attrs
15
24
  end
16
25
 
17
26
  def logo_href
@@ -0,0 +1,20 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { createPortal } from "react-dom";
3
+ import HeadwayWidget from "../HeadwayWidget/HeadwayWidget.jsx";
4
+
5
+ export default function MeganavHeadwayPortal() {
6
+ const [headwayPortalNodes, setHeadwayPortalNodes] = useState([]);
7
+
8
+ useEffect(() => {
9
+ // Query all the elements with the .headwayPortal class
10
+ setHeadwayPortalNodes(Array.from(document.querySelectorAll(".headwayPortal")));
11
+ }, []);
12
+
13
+ return (
14
+ <>
15
+ {headwayPortalNodes.map((node, index) => {
16
+ return createPortal(<HeadwayWidget account={"yZ1rmJ"} badgePosition={"center-right"} id={`widget-${index}`} />, node, `headway-${index}`);
17
+ })}
18
+ </>
19
+ );
20
+ }
@@ -7,13 +7,13 @@
7
7
  z-index: var(--stacking-context-page-meganav);
8
8
 
9
9
  @apply fixed top-0 w-full;
10
- @apply antialiased font-sans transition-colors;
10
+ @apply font-sans antialiased transition-colors;
11
11
  }
12
12
 
13
13
  .ui-meganav {
14
14
  height: var(--ui-meganav-height);
15
15
 
16
- @apply flex justify-between items-center max-w-screen-xl mx-auto;
16
+ @apply flex items-center justify-between max-w-screen-xl mx-auto;
17
17
  }
18
18
 
19
19
  .ui-meganav-panel,
@@ -22,7 +22,7 @@
22
22
  z-index: var(--stacking-context-meganav-dropdown);
23
23
 
24
24
  @apply absolute left-0 right-0;
25
- @apply border-mid-grey border-t shadow-container;
25
+ @apply border-t border-mid-grey shadow-container;
26
26
  }
27
27
 
28
28
  .ui-meganav-panel {
@@ -35,9 +35,9 @@
35
35
  /* Prevents momentum-based scrolling https://devdocs.io/css/-webkit-overflow-scrolling */
36
36
  -webkit-overflow-scrolling: auto;
37
37
 
38
- @apply bg-white pt-16 border-0;
39
- @apply border-mid-grey border-t shadow-container;
40
- @apply fixed top-64 left-0 right-0 overflow-y-auto;
38
+ @apply pt-16 bg-white border-0;
39
+ @apply border-t border-mid-grey shadow-container;
40
+ @apply fixed left-0 right-0 overflow-y-auto top-64;
41
41
  }
42
42
 
43
43
  .ui-meganav-panel-account {
@@ -51,8 +51,8 @@
51
51
  }
52
52
 
53
53
  .ui-meganav-link {
54
- @apply text-menu2 font-medium block;
55
- @apply mr-12 lg:mr-24 px-0 py-20;
54
+ @apply block font-medium text-menu2;
55
+ @apply px-0 py-20 mr-12 lg:mr-24;
56
56
  @apply hover:text-gui-hover focus:text-gui-focus focus:outline-none;
57
57
  @apply transition-colors;
58
58
  }
@@ -62,18 +62,18 @@
62
62
  }
63
63
 
64
64
  .ui-meganav-mobile-link {
65
- @apply p-menu-row relative -left-8 w-extend-8;
66
- @apply text-menu2 font-medium block text-cool-black text-left;
65
+ @apply relative p-menu-row -left-8 w-extend-8;
66
+ @apply block font-medium text-left text-menu2 text-cool-black;
67
67
  @apply flex items-center;
68
68
  @apply focus:text-gui-focus focus:outline-none;
69
69
  }
70
70
 
71
71
  .ui-meganav-account-link {
72
- @apply block px-8 py-8 hover:bg-light-grey hover:text-gui-hover rounded relative -left-8 text-menu3 w-extend-8 font-light;
72
+ @apply relative block px-8 py-8 font-light rounded hover:bg-light-grey hover:text-gui-hover -left-8 text-menu3 w-extend-8;
73
73
  }
74
74
 
75
75
  .ui-meganav-content {
76
- @apply max-w-screen-xl py-24 lg:py-32 mx-auto;
76
+ @apply max-w-screen-xl py-24 mx-auto lg:py-32;
77
77
  @apply grid grid-cols-1;
78
78
  @apply px-24 md:px-32 lg:px-32 xl:px-64;
79
79
  }
@@ -81,27 +81,27 @@
81
81
  /* This is implemented not as padding so we can change the color of just this space, while keeping the grid
82
82
  as close to the designs as possible */
83
83
  .ui-meganav-content-spacer {
84
- @apply hidden md:block md:w-32 lg:w-32 xl:w-64 self-stretch flex-shrink-0 flex-grow-0;
84
+ @apply self-stretch flex-grow-0 flex-shrink-0 hidden md:block md:w-32 lg:w-32 xl:w-64;
85
85
  }
86
86
 
87
87
  .ui-meganav-media {
88
- @apply block px-8 py-8 hover:bg-light-grey rounded relative -left-8 w-extend-8;
88
+ @apply relative block px-8 py-8 rounded hover:bg-light-grey -left-8 w-extend-8;
89
89
  }
90
90
 
91
91
  .ui-meganav-media-with-image {
92
92
  grid-template-columns: max-content 1fr;
93
93
  grid-template-rows: min-content 1fr;
94
94
 
95
- @apply block px-8 py-8 hover:bg-light-grey rounded relative -left-8 w-extend-8;
96
- @apply grid gap-x-8;
95
+ @apply relative block px-8 py-8 rounded hover:bg-light-grey -left-8 w-extend-8;
96
+ @apply grid gap-x-16;
97
97
  }
98
98
 
99
99
  .ui-meganav-media-heading {
100
- @apply text-menu3 text-cool-black font-medium group-hover:text-gui-hover group-focus:text-gui-focus;
100
+ @apply font-medium text-menu3 text-cool-black group-hover:text-gui-hover group-focus:text-gui-focus;
101
101
  }
102
102
 
103
103
  .ui-meganav-media-copy {
104
- @apply text-p3 text-dark-grey font-light;
104
+ @apply font-light text-p3 text-dark-grey;
105
105
  }
106
106
 
107
107
  .ui-meganav-overline {
@@ -112,3 +112,44 @@
112
112
  @apply my-0 text-mid-grey;
113
113
  }
114
114
  }
115
+
116
+ .HW_badge {
117
+ width: 1.25rem !important;
118
+ height: 1.25rem !important;
119
+ display: flex !important;
120
+ justify-content: center !important;
121
+ align-items: center !important;
122
+ font-size: 14px !important;
123
+ top: 2px !important;
124
+ left: 20px !important;
125
+ transition: none !important;
126
+ pointer-events: none !important;
127
+ }
128
+
129
+ .HW_animated {
130
+ animation: none !important;
131
+ }
132
+
133
+ .invisible .HW_badge {
134
+ visibility: hidden !important;
135
+ display: none !important;
136
+ }
137
+
138
+ .invisible .HW_frame {
139
+ visibility: hidden !important;
140
+ display: none !important;
141
+ }
142
+
143
+ .HW_badge_cont.HW_visible {
144
+ display: block !important;
145
+ }
146
+
147
+ .HW_badge_cont {
148
+ visibility: unset !important;
149
+ display: none !important;
150
+ pointer-events: none !important;
151
+ }
152
+
153
+ [class^="HW_widget_component_widget-"] {
154
+ pointer-events: none !important;
155
+ }
@@ -3,7 +3,7 @@
3
3
 
4
4
  <div class="ui-meganav ui-grid-px">
5
5
  <div className="mr-24">
6
- <%= render(AblyUi::Core::Logo.new(data_id: "meganav-logo", href: logo_link)) %>
6
+ <%= render(AblyUi::Core::Logo.new(data_id: "meganav-logo", href: logo_link, logo_url: ably_logo)) %>
7
7
  </div>
8
8
  <%= render(AblyUi::Core::MeganavItemsDesktop.new(theme_name: @theme_name, url_base: url_base)) %>
9
9
 
@@ -29,8 +29,8 @@
29
29
  }
30
30
  },
31
31
  "panels": [
32
- { "label": "Platform", "shortLabel": "Platform", "id": "platform-panel", "component": "MeganavContentPlatform" },
33
- { "label": "Use Cases & Solutions", "shortLabel": "Use Cases", "id": "use-cases-panel", "component": "MeganavContentUseCases" },
32
+ { "label": "Products", "shortLabel": "Products", "id": "products-panel", "component": "MeganavContentProducts" },
33
+ { "label": "Solutions", "shortLabel": "Solutions", "id": "use-cases-panel", "component": "MeganavContentUseCases" },
34
34
  { "label": "Company", "shortLabel": "Company", "id": "company-panel", "component": "MeganavContentCompany" },
35
35
  { "label": "Developers", "shortLabel": "Developers", "id": "developers-panel", "component": "MeganavContentDevelopers" }
36
36
  ]
@@ -1,30 +1,32 @@
1
- import React, { useEffect, useState } from "react";
2
1
  import T from "prop-types";
2
+ import React, { useEffect, useState } from "react";
3
3
 
4
4
  import { connectState } from "../remote-data-store";
5
5
  import { selectSessionData } from "../remote-session-data";
6
6
 
7
7
  import Logo from "../Logo/component.jsx";
8
8
 
9
- import MeganavScripts from "./component.js";
10
9
  import MeganavItemsDesktop from "../MeganavItemsDesktop/component.jsx";
11
- import MeganavItemsSignedIn from "../MeganavItemsSignedIn/component.jsx";
12
10
  import MeganavItemsMobile from "../MeganavItemsMobile/component.jsx";
11
+ import MeganavItemsSignedIn from "../MeganavItemsSignedIn/component.jsx";
13
12
  import Notice from "../Notice/component.jsx";
14
- import MeganavData from "./component.json";
15
13
  import _absUrl from "../url-base";
14
+ import MeganavScripts from "./component.js";
15
+ import MeganavData from "./component.json";
16
16
 
17
- import MeganavContentPlatform from "../MeganavContentPlatform/component.jsx";
18
- import MeganavContentUseCases from "../MeganavContentUseCases/component.jsx";
19
17
  import MeganavContentCompany from "../MeganavContentCompany/component.jsx";
20
18
  import MeganavContentDevelopers from "../MeganavContentDevelopers/component.jsx";
19
+ import MeganavContentProducts from "../MeganavContentProducts/component.jsx";
20
+ import MeganavContentUseCases from "../MeganavContentUseCases/component.jsx";
21
21
  import MeganavSearch from "../MeganavSearch/component.jsx";
22
22
 
23
+ import MeganavHeadwayPortal from "./MeganavHeadwayPortal.jsx";
24
+
23
25
  const SignIn = ({ sessionState, theme, loginLink, absUrl }) => {
24
26
  return sessionState.signedIn ? (
25
27
  <MeganavItemsSignedIn absUrl={absUrl} sessionState={sessionState} theme={theme} />
26
28
  ) : (
27
- <ul className="hidden md:flex items-center">
29
+ <ul className="items-center hidden md:flex">
28
30
  <li className="ui-meganav-item">
29
31
  <a href={absUrl("/contact")} className={`ui-meganav-link ${theme.textColor}`} data-id="meganav-link">
30
32
  Contact us
@@ -58,10 +60,10 @@ SignIn.propTypes = {
58
60
  const SignInPlaceholder = () => <div />;
59
61
 
60
62
  const panels = {
61
- MeganavContentPlatform: MeganavContentPlatform,
62
- MeganavContentUseCases: MeganavContentUseCases,
63
- MeganavContentCompany: MeganavContentCompany,
64
- MeganavContentDevelopers: MeganavContentDevelopers,
63
+ MeganavContentProducts,
64
+ MeganavContentUseCases,
65
+ MeganavContentCompany,
66
+ MeganavContentDevelopers,
65
67
  };
66
68
 
67
69
  export default function Meganav({ paths, themeName = "white", notice, loginLink = "/login", urlBase, addSearchApiKey }) {
@@ -86,7 +88,7 @@ export default function Meganav({ paths, themeName = "white", notice, loginLink
86
88
  {notice && <Notice {...notice.props} config={notice.config} />}
87
89
  <div className="ui-meganav ui-grid-px">
88
90
  <div className="mr-24">
89
- <Logo dataId="meganav-logo" href={urlBase} />
91
+ <Logo dataId="meganav-logo" href={urlBase} logoUrl={paths.logo} />
90
92
  </div>
91
93
 
92
94
  <MeganavItemsDesktop panels={panels} paths={paths} theme={theme} absUrl={absUrl} />
@@ -95,6 +97,8 @@ export default function Meganav({ paths, themeName = "white", notice, loginLink
95
97
  {sessionState ? <SignIn sessionState={sessionState} theme={theme} loginLink={loginLink} absUrl={absUrl} /> : <SignInPlaceholder />}
96
98
 
97
99
  <MeganavItemsMobile panels={panels} sessionState={sessionState || {}} paths={paths} theme={theme} loginLink={loginLink} absUrl={absUrl} />
100
+
101
+ <MeganavHeadwayPortal />
98
102
  </div>
99
103
  </nav>
100
104
  );
@@ -6,6 +6,7 @@ module AblyUi
6
6
  class Meganav < ViewComponent::Base
7
7
  include MeganavConfig
8
8
  include Util
9
+ include SharedAssets
9
10
  attr_reader :options, :login_link, :logo_link, :url_base
10
11
 
11
12
  renders_one :notice, AblyUi::Core::Notice
@@ -29,14 +30,14 @@ module AblyUi
29
30
  def panels
30
31
  [
31
32
  {
32
- label: 'Platform',
33
- short_label: 'Platform',
34
- id: 'platform-panel',
35
- class: 'AblyUi::Core::MeganavContentPlatform'
33
+ label: 'Products',
34
+ short_label: 'Products',
35
+ id: 'products-panel',
36
+ class: 'AblyUi::Core::MeganavContentProducts'
36
37
  },
37
38
  {
38
- label: 'Use Cases & Solutions',
39
- short_label: 'Use Cases',
39
+ label: 'Solutions',
40
+ short_label: 'Solutions',
40
41
  id: 'use-cases-panel',
41
42
  class: 'AblyUi::Core::MeganavContentUseCases'
42
43
  },
@@ -72,6 +72,15 @@
72
72
  </div>
73
73
  <% end %>
74
74
  </li>
75
+ <li>
76
+ <%= link_to abs_url("/events"), class: "ui-meganav-media-with-image group" do %>
77
+ <%= render(AblyUi::Core::Icon.new(name: "icon-display-events-col", size: "2.5rem")) %>
78
+ <div class="flex flex-col justify-center">
79
+ <p class="ui-meganav-media-heading">Events</p>
80
+ <p class="ui-meganav-media-copy">Join Ably at upcoming events.</p>
81
+ </div>
82
+ <% end %>
83
+ </li>
75
84
  </ul>
76
85
  </div>
77
86