@ably/ui 8.7.0-dev.0ce5893 → 8.7.0-dev.0eee65d
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/README.md +7 -3
- package/core/Code/component.js +1 -1
- package/core/Code.jsx +108 -88
- package/core/CompanyAutocomplete/component.js +2 -1
- package/core/CompanyAutocomplete/component.js.LICENSE.txt +1 -0
- package/core/ConnectStateWrapper/component.js +1 -1
- package/core/ConnectStateWrapper.jsx +7 -7
- package/core/ContactFooter/component.js +1 -1
- package/core/ContactFooter.jsx +12 -12
- package/core/CookieMessage/component.js +1 -1
- package/core/CookieMessage.jsx +10 -10
- package/core/CustomerLogos/component.js +1 -1
- package/core/CustomerLogos.jsx +7 -7
- package/core/DropdownMenu/component.js +1 -1
- package/core/DropdownMenu.jsx +11 -11
- package/core/FeatureFooter/component.js +1 -1
- package/core/FeaturedLink/component.js +1 -1
- package/core/FeaturedLink.jsx +10 -10
- package/core/Flash/component.js +1 -1
- package/core/Flash.jsx +19 -19
- package/core/Footer/component.css +21 -1
- package/core/Footer/component.js +1 -1
- package/core/Footer.jsx +162 -76
- package/core/Icon/component.js +1 -1
- package/core/Icon.jsx +7 -7
- package/core/Loader/component.js +1 -1
- package/core/Loader.jsx +7 -7
- package/core/Logo/component.js +1 -1
- package/core/Logo.jsx +7 -7
- package/core/Meganav/component.css +59 -20
- package/core/Meganav/component.js +1 -1
- package/core/Meganav/component.json +2 -2
- package/core/Meganav.jsx +955 -1047
- package/core/MeganavBlogPostsList/component.js +2 -1
- package/core/MeganavBlogPostsList/component.js.LICENSE.txt +1 -0
- package/core/MeganavBlogPostsList.jsx +13 -13
- package/core/MeganavContentCompany/component.js +1 -1
- package/core/MeganavContentCompany.jsx +328 -731
- package/core/MeganavContentDevelopers/component.js +1 -1
- package/core/MeganavContentDevelopers.jsx +108 -79
- package/core/{MeganavContentPlatform → MeganavContentProducts}/component.js +1 -1
- package/core/{MeganavContentPlatform.jsx → MeganavContentProducts.jsx} +34 -58
- package/core/MeganavContentUseCases/component.js +1 -1
- package/core/MeganavContentUseCases.jsx +62 -54
- package/core/MeganavControl/component.js +1 -1
- package/core/MeganavControl.jsx +10 -10
- package/core/MeganavControlMobileDropdown/component.js +1 -1
- package/core/MeganavControlMobileDropdown.jsx +11 -11
- package/core/MeganavControlMobilePanelClose/component.js +1 -1
- package/core/MeganavControlMobilePanelClose.jsx +10 -10
- package/core/MeganavControlMobilePanelOpen/component.js +1 -1
- package/core/MeganavControlMobilePanelOpen.jsx +10 -10
- package/core/MeganavItemsDesktop/component.js +1 -1
- package/core/MeganavItemsDesktop.jsx +17 -17
- package/core/MeganavItemsMobile/component.js +1 -1
- package/core/MeganavItemsMobile.jsx +39 -39
- package/core/MeganavItemsSignedIn/component.js +1 -1
- package/core/MeganavItemsSignedIn.jsx +33 -33
- package/core/MeganavSearch/component.js +1 -1
- package/core/MeganavSearch.jsx +23 -23
- package/core/MeganavSearchAutocomplete/component.js +1 -1
- package/core/MeganavSearchAutocomplete.jsx +4 -4
- package/core/MeganavSearchPanel/component.js +1 -1
- package/core/MeganavSearchPanel.jsx +19 -19
- package/core/MeganavSearchSuggestions/component.js +1 -1
- package/core/MeganavSearchSuggestions.jsx +13 -13
- package/core/Notice/component.js +1 -1
- package/core/Notice.jsx +30 -30
- package/core/Showcase/component.js +1 -1
- package/core/Showcase.jsx +1 -1
- package/core/SignOutLink/component.js +1 -1
- package/core/SignOutLink.jsx +7 -7
- package/core/Slider/component.js +1 -1
- package/core/Slider.jsx +14 -14
- package/core/Uptime/component.js +1 -1
- package/core/Uptime.jsx +300 -715
- package/core/images/best-support-2023.svg +1 -0
- package/core/images/fastest-implementation-2023.svg +1 -0
- package/core/images/high-performer-2022.png +0 -0
- package/core/images/high-performer-2023.svg +1 -0
- package/core/images/highest-user-adoption-2022.png +0 -0
- package/core/images/highest-user-adoption-2023.svg +1 -0
- package/core/images/users-love-us-2022.png +0 -0
- package/core/scripts.js +2 -1
- package/core/scripts.js.LICENSE.txt +1 -0
- package/core/sprites.svg +93 -0
- package/core/styles.css +1 -7
- package/package.json +5 -5
- package/reset/scripts.js +1 -1
- package/reset/styles.css +1 -11
- package/src/core/Footer/component.css +21 -1
- package/src/core/Footer/component.html.erb +120 -63
- package/src/core/Footer/component.jsx +128 -61
- package/src/core/HeadwayWidget/HeadwayWidget.jsx +229 -0
- package/src/core/HeadwayWidget/index.js +5 -0
- package/src/core/Meganav/MeganavHeadwayPortal.jsx +20 -0
- package/src/core/Meganav/component.css +59 -18
- package/src/core/Meganav/component.json +2 -2
- package/src/core/Meganav/component.jsx +15 -11
- package/src/core/Meganav/component.rb +6 -6
- package/src/core/MeganavContentCompany/component.html.erb +9 -0
- package/src/core/MeganavContentCompany/component.jsx +9 -0
- package/src/core/MeganavContentDevelopers/component.html.erb +34 -14
- package/src/core/MeganavContentDevelopers/component.js +26 -0
- package/src/core/MeganavContentDevelopers/component.jsx +35 -15
- package/src/core/{MeganavContentPlatform → MeganavContentProducts}/component.html.erb +15 -33
- package/src/core/{MeganavContentPlatform → MeganavContentProducts}/component.jsx +18 -39
- package/src/core/{MeganavContentPlatform → MeganavContentProducts}/component.rb +1 -1
- package/src/core/MeganavContentUseCases/component.html.erb +42 -38
- package/src/core/MeganavContentUseCases/component.jsx +41 -38
- package/src/core/MeganavItemsDesktop/component.jsx +1 -1
- package/src/core/MeganavItemsDesktop/component.rb +1 -1
- package/src/core/core.rb +12 -4
- package/src/core/icons/icon-display-asset-tracking-col.svg +18 -0
- package/src/core/icons/icon-display-data-broadcast-col.svg +26 -0
- package/src/core/icons/icon-display-data-synchronization-col.svg +14 -0
- package/src/core/icons/icon-display-events-col.svg +13 -0
- package/src/core/icons/icon-display-examples-col.svg +11 -0
- package/src/core/icons/icon-display-kafka-at-the-edge-col.svg +8 -0
- package/src/core/icons/icon-display-push-notifications-col.svg +6 -0
- package/src/core/icons/icon-social-x.svg +3 -0
- package/src/core/icons/icon-tech-apachekafka.svg +3 -0
- package/src/core/images/best-support-2023.svg +1 -0
- package/src/core/images/fastest-implementation-2023.svg +1 -0
- package/src/core/images/high-performer-2022.png +0 -0
- package/src/core/images/high-performer-2023.svg +1 -0
- package/src/core/images/highest-user-adoption-2022.png +0 -0
- package/src/core/images/highest-user-adoption-2023.svg +1 -0
- package/src/core/images/users-love-us-2022.png +0 -0
- package/src/core/styles/text.css +1 -1
- package/src/core/utils/syntax-highlighter-registry.js +2 -0
- package/src/core/utils/syntax-highlighter.js +5 -0
- package/core/DropdownMenuPreview/component.js +0 -6
- package/core/DropdownMenuPreview.jsx +0 -6
- 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
- package/src/.DS_Store +0 -0
- package/src/core/.DS_Store +0 -0
- /package/src/core/{MeganavContentPlatform → 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,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
|
|
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
|
|
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
|
|
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
|
|
39
|
-
@apply border-mid-grey
|
|
40
|
-
@apply fixed
|
|
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
|
|
55
|
-
@apply mr-12 lg:mr-24
|
|
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
|
|
66
|
-
@apply
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
96
|
-
@apply grid gap-x-
|
|
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
|
|
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
|
|
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
|
+
}
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"panels": [
|
|
32
|
-
{ "label": "
|
|
33
|
-
{ "label": "
|
|
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
|
|
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
|
-
|
|
62
|
-
MeganavContentUseCases
|
|
63
|
-
MeganavContentCompany
|
|
64
|
-
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 }) {
|
|
@@ -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
|
);
|
|
@@ -30,14 +30,14 @@ module AblyUi
|
|
|
30
30
|
def panels
|
|
31
31
|
[
|
|
32
32
|
{
|
|
33
|
-
label: '
|
|
34
|
-
short_label: '
|
|
35
|
-
id: '
|
|
36
|
-
class: 'AblyUi::Core::
|
|
33
|
+
label: 'Products',
|
|
34
|
+
short_label: 'Products',
|
|
35
|
+
id: 'products-panel',
|
|
36
|
+
class: 'AblyUi::Core::MeganavContentProducts'
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
label: '
|
|
40
|
-
short_label: '
|
|
39
|
+
label: 'Solutions',
|
|
40
|
+
short_label: 'Solutions',
|
|
41
41
|
id: 'use-cases-panel',
|
|
42
42
|
class: 'AblyUi::Core::MeganavContentUseCases'
|
|
43
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
|
|
|
@@ -88,6 +88,15 @@ const MeganavContentCompany = ({ paths, absUrl }) => {
|
|
|
88
88
|
</div>
|
|
89
89
|
</a>
|
|
90
90
|
</li>
|
|
91
|
+
<li>
|
|
92
|
+
<a href={absUrl("/events")} className="ui-meganav-media-with-image group">
|
|
93
|
+
<Icon name="icon-display-events-col" size="2.5rem" />
|
|
94
|
+
<div className="flex flex-col justify-center">
|
|
95
|
+
<p className="ui-meganav-media-heading">Events</p>
|
|
96
|
+
<p className="ui-meganav-media-copy">Join Ably at upcoming events.</p>
|
|
97
|
+
</div>
|
|
98
|
+
</a>
|
|
99
|
+
</li>
|
|
91
100
|
</ul>
|
|
92
101
|
</div>
|
|
93
102
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div class="flex max-w-screen-xl mx-auto">
|
|
2
2
|
<div class="ui-meganav-content-spacer"></div>
|
|
3
|
-
<section class="grid grid-cols-12 ui-grid-gap-x
|
|
4
|
-
<div class="col-span-full md:col-span-4
|
|
5
|
-
<h3 class="ui-meganav-overline
|
|
3
|
+
<section class="grid w-full grid-cols-12 ui-grid-gap-x">
|
|
4
|
+
<div class="px-24 pt-24 col-span-full md:col-span-4 md:py-24 lg:py-32 sm:px-32 md:pl-0 md:pr-24">
|
|
5
|
+
<h3 class="uppercase ui-meganav-overline" id="meganav-developers-panel-explore">
|
|
6
6
|
Explore
|
|
7
7
|
</h3>
|
|
8
8
|
<ul aria-labelledby="meganav-developers-panel-explore">
|
|
@@ -33,10 +33,18 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
<% end %>
|
|
35
35
|
</li>
|
|
36
|
+
<li>
|
|
37
|
+
<%= link_to abs_url("/examples"), class: "ui-meganav-media-with-image group" do %>
|
|
38
|
+
<%= render(AblyUi::Core::Icon.new(name: "icon-display-examples-col", size: "2.5rem")) %>
|
|
39
|
+
<div class="flex flex-col justify-center">
|
|
40
|
+
<p class="ui-meganav-media-heading">Live examples</p>
|
|
41
|
+
<p class="ui-meganav-media-copy">Discover our features and their use cases.</p>
|
|
42
|
+
</div>
|
|
43
|
+
<% end %>
|
|
44
|
+
</li>
|
|
36
45
|
</ul>
|
|
37
46
|
</div>
|
|
38
|
-
|
|
39
|
-
<div class="col-span-full md:col-span-4 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
|
|
47
|
+
<div class="px-24 pb-8 col-span-full md:col-span-4 md:py-24 lg:py-32 sm:px-32 md:px-0">
|
|
40
48
|
<ul class="md:mt-40" aria-labelledby="meganav-developers-panel-explore">
|
|
41
49
|
<li>
|
|
42
50
|
<%= link_to abs_url("/download"), class: "ui-meganav-media-with-image group" do %>
|
|
@@ -65,16 +73,24 @@
|
|
|
65
73
|
</div>
|
|
66
74
|
<% end %>
|
|
67
75
|
</li>
|
|
76
|
+
<li>
|
|
77
|
+
<%= link_to abs_url("/reference-guide-multiplayer"), class: "ui-meganav-media-with-image group" do %>
|
|
78
|
+
<%= render(AblyUi::Core::Icon.new(name: "icon-multi-user-spaces-col", size: "2.5rem")) %>
|
|
79
|
+
<div class="flex flex-col justify-center">
|
|
80
|
+
<p class="ui-meganav-media-heading">Multiplayer reference guide</p>
|
|
81
|
+
<p class="ui-meganav-media-copy">Learn how to build collaborative features with Ably.</p>
|
|
82
|
+
</div>
|
|
83
|
+
<% end %>
|
|
84
|
+
</li>
|
|
68
85
|
</ul>
|
|
69
86
|
</div>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<h3 class="ui-meganav-overline uppercase" id="meganav-developers-panel-quick-links">
|
|
87
|
+
<div class="px-24 pt-8 pb-24 col-span-full md:col-span-4 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
|
|
88
|
+
<h3 class="uppercase ui-meganav-overline" id="meganav-developers-panel-quick-links">
|
|
73
89
|
Quick links
|
|
74
90
|
</h3>
|
|
75
91
|
<ul aria-labelledby="meganav-developers-panel-quick-links">
|
|
76
92
|
<li>
|
|
77
|
-
<%= link_to "https://discord.gg/jwBPhEZ9g5", class: "group ui-meganav-media
|
|
93
|
+
<%= link_to "https://discord.gg/jwBPhEZ9g5", class: "py-12 group ui-meganav-media" do %>
|
|
78
94
|
<p class="ui-meganav-media-heading">Discord</p>
|
|
79
95
|
<% end %>
|
|
80
96
|
</li>
|
|
@@ -84,25 +100,29 @@
|
|
|
84
100
|
<% end %>
|
|
85
101
|
</li>
|
|
86
102
|
<li>
|
|
87
|
-
<%= link_to "https://changelog.ably.com/", class: "group ui-meganav-media
|
|
88
|
-
<
|
|
103
|
+
<%= link_to "https://changelog.ably.com/", class: "py-12 group ui-meganav-media", target: "_blank", rel: "noopener noreferrer" do %>
|
|
104
|
+
<span class="ui-meganav-media-heading">Changelog</span>
|
|
105
|
+
<span class="headwayPortal">
|
|
106
|
+
<!-- This imitates how the React component is initialized -->
|
|
107
|
+
<div class="HW_widget_component_widget-0" style="position: relative; display: inline-block;"></div>
|
|
108
|
+
</span>
|
|
89
109
|
<% end %>
|
|
90
110
|
</li>
|
|
91
111
|
<li>
|
|
92
|
-
<a href="https://status.ably.com/" class="group ui-meganav-media
|
|
112
|
+
<a href="https://status.ably.com/" class="py-12 group ui-meganav-media">
|
|
93
113
|
<p class="ui-meganav-media-heading">
|
|
94
114
|
Status<iframe
|
|
95
115
|
src="https://status.ably.com/embed/icon"
|
|
96
116
|
allowtransparency="true"
|
|
97
117
|
frameborder="0"
|
|
98
118
|
scrolling="no"
|
|
99
|
-
class="w-24 h-24 ml-4 border-none pointer-events-none
|
|
119
|
+
class="w-24 h-24 ml-4 align-middle border-none pointer-events-none"
|
|
100
120
|
></iframe>
|
|
101
121
|
</p>
|
|
102
122
|
</a>
|
|
103
123
|
</li>
|
|
104
124
|
<li>
|
|
105
|
-
<%= link_to abs_url("/support"), class: "group ui-meganav-media
|
|
125
|
+
<%= link_to abs_url("/support"), class: "py-12 group ui-meganav-media" do %>
|
|
106
126
|
<p class="ui-meganav-media-heading">Support & FAQs</p>
|
|
107
127
|
<% end %>
|
|
108
128
|
</li>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// This imitates the way the React component is initialized if it looks a bit strange...
|
|
2
|
+
const initHeadway = () => {
|
|
3
|
+
// See https://docs.headwayapp.co/widget for more configuration options.
|
|
4
|
+
const hwConfig = {
|
|
5
|
+
selector: '.headwayPortal div',
|
|
6
|
+
account: 'yZ1rmJ',
|
|
7
|
+
__component: true,
|
|
8
|
+
badgePosition: 'center-right',
|
|
9
|
+
widgetPosition: 'bottom-right',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const widget = window.Headway.getNewWidget();
|
|
13
|
+
widget.init(hwConfig);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default () => {
|
|
17
|
+
const script = document.createElement('script');
|
|
18
|
+
script.async = true;
|
|
19
|
+
script.src = 'https://cdn.headwayapp.co/widget.js';
|
|
20
|
+
script.type = 'text/javascript';
|
|
21
|
+
script.onload = () => {
|
|
22
|
+
initHeadway();
|
|
23
|
+
};
|
|
24
|
+
const head = document.getElementsByTagName('head')[0];
|
|
25
|
+
head.appendChild(script);
|
|
26
|
+
};
|