ably-ui 8.7.0.dev.7021bee → 8.7.0.dev.7072b07

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -6
  3. data/README.md +15 -4
  4. data/lib/ably_ui/core/code/component.css +2 -0
  5. data/lib/ably_ui/core/code/component.js +739 -1
  6. data/lib/ably_ui/core/company_autocomplete/component.css +2 -0
  7. data/lib/ably_ui/core/company_autocomplete/component.js +1161 -1
  8. data/lib/ably_ui/core/connect_state_wrapper/component.js +22 -1
  9. data/lib/ably_ui/core/contact_footer/component.css +2 -0
  10. data/lib/ably_ui/core/contact_footer/component.js +211 -1
  11. data/lib/ably_ui/core/cookie_message/component.css +2 -0
  12. data/lib/ably_ui/core/cookie_message/component.js +82 -1
  13. data/lib/ably_ui/core/core.rb +12 -4
  14. data/lib/ably_ui/core/customer_logos/component.js +22 -1
  15. data/lib/ably_ui/core/dropdown_menu/component.js +22 -1
  16. data/lib/ably_ui/core/feature_footer/component.css +2 -0
  17. data/lib/ably_ui/core/feature_footer/component.js +211 -1
  18. data/lib/ably_ui/core/featured_link/component.css +2 -0
  19. data/lib/ably_ui/core/featured_link/component.js +82 -1
  20. data/lib/ably_ui/core/flash/component.css +2 -0
  21. data/lib/ably_ui/core/flash/component.js +82 -1
  22. data/lib/ably_ui/core/footer/component.css +23 -1
  23. data/lib/ably_ui/core/footer/component.js +82 -1
  24. data/lib/ably_ui/core/footer/footer.html.erb +120 -63
  25. data/lib/ably_ui/core/icon/component.js +22 -1
  26. data/lib/ably_ui/core/images/best-support-2023.svg +1 -0
  27. data/lib/ably_ui/core/images/fastest-implementation-2023.svg +1 -0
  28. data/lib/ably_ui/core/images/high-performer-2022.png +0 -0
  29. data/lib/ably_ui/core/images/high-performer-2023.svg +1 -0
  30. data/lib/ably_ui/core/images/highest-user-adoption-2022.png +0 -0
  31. data/lib/ably_ui/core/images/highest-user-adoption-2023.svg +1 -0
  32. data/lib/ably_ui/core/images/users-love-us-2022.png +0 -0
  33. data/lib/ably_ui/core/loader/component.js +22 -1
  34. data/lib/ably_ui/core/logo/component.js +22 -1
  35. data/lib/ably_ui/core/meganav/component.css +3 -3
  36. data/lib/ably_ui/core/meganav/component.js +992 -1
  37. data/lib/ably_ui/core/meganav/component.json +2 -2
  38. data/lib/ably_ui/core/meganav/meganav.rb +6 -6
  39. data/lib/ably_ui/core/meganav_blog_posts_list/component.js +1159 -1
  40. data/lib/ably_ui/core/meganav_content_company/component.js +22 -1
  41. data/lib/ably_ui/core/meganav_content_company/meganav_content_company.html.erb +9 -0
  42. data/lib/ably_ui/core/meganav_content_developers/component.js +22 -1
  43. data/lib/ably_ui/core/meganav_content_developers/meganav_content_developers.html.erb +30 -14
  44. data/lib/ably_ui/core/meganav_content_products/component.js +22 -0
  45. data/lib/ably_ui/core/{meganav_content_platform/meganav_content_platform.html.erb → meganav_content_products/meganav_content_products.html.erb} +15 -33
  46. data/lib/ably_ui/core/{meganav_content_platform/meganav_content_platform.rb → meganav_content_products/meganav_content_products.rb} +1 -1
  47. data/lib/ably_ui/core/meganav_content_use_cases/component.js +22 -1
  48. data/lib/ably_ui/core/meganav_content_use_cases/meganav_content_use_cases.html.erb +42 -38
  49. data/lib/ably_ui/core/meganav_control/component.js +241 -1
  50. data/lib/ably_ui/core/meganav_control_mobile_dropdown/component.js +180 -1
  51. data/lib/ably_ui/core/meganav_control_mobile_panel_close/component.js +142 -1
  52. data/lib/ably_ui/core/meganav_control_mobile_panel_open/component.js +170 -1
  53. data/lib/ably_ui/core/meganav_items_desktop/component.js +22 -1
  54. data/lib/ably_ui/core/meganav_items_desktop/meganav_items_desktop.rb +1 -1
  55. data/lib/ably_ui/core/meganav_items_mobile/component.js +22 -1
  56. data/lib/ably_ui/core/meganav_items_signed_in/component.js +22 -1
  57. data/lib/ably_ui/core/meganav_search/component.js +22 -1
  58. data/lib/ably_ui/core/meganav_search_autocomplete/component.js +295 -1
  59. data/lib/ably_ui/core/meganav_search_panel/component.js +22 -1
  60. data/lib/ably_ui/core/meganav_search_suggestions/component.js +258 -1
  61. data/lib/ably_ui/core/notice/component.css +2 -0
  62. data/lib/ably_ui/core/notice/component.js +872 -1
  63. data/lib/ably_ui/core/scripts.js +1465 -1
  64. data/lib/ably_ui/core/showcase/component.css +2 -0
  65. data/lib/ably_ui/core/showcase/component.js +343 -1
  66. data/lib/ably_ui/core/sign_out_link/component.js +22 -1
  67. data/lib/ably_ui/core/slider/component.css +2 -0
  68. data/lib/ably_ui/core/slider/component.js +255 -1
  69. data/lib/ably_ui/core/sprites.svg +99 -0
  70. data/lib/ably_ui/core/styles.css +3 -7
  71. data/lib/ably_ui/core/uptime/component.css +2 -0
  72. data/lib/ably_ui/core/uptime/component.js +82 -1
  73. data/lib/ably_ui/reset/scripts.js +1 -1
  74. data/lib/ably_ui/reset/styles.css +1 -11
  75. data/lib/ably_ui/version.rb +1 -1
  76. metadata +12 -7
  77. data/lib/ably_ui/core/meganav_content_platform/component.js +0 -1
  78. data/lib/ably_ui/react/connect_state_wrapper/component.js +0 -1
  79. data/lib/ably_ui/react/scripts.js +0 -1
@@ -1 +1,255 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash.throttle")):"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AblyUi=t(require("lodash.throttle")):(e.AblyUi=e.AblyUi||{},e.AblyUi.Core=e.AblyUi.Core||{},e.AblyUi.Core.Slider=t(e[void 0]))}(this,(function(e){return(()=>{"use strict";var t={2040:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o={};return(()=>{r.d(o,{default:()=>a});var e=r(2040),t=r.n(e),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector("[data-id=".concat(e,"]"))},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelectorAll("[data-id=".concat(e,"]"))},c=function(e){var t=n("slider-strip",e),r=Array.from(i("slider-slide",e)),o=n("slider-previous",e),c=n("slider-next",e),a=Array.from(i("slider-marker",e)),d=n("slider-controls",e);d.classList.replace("hidden","flex");var l=r.length,s=e.getBoundingClientRect().width,u=r[0].getBoundingClientRect(),f=u.width,v=u.left,h=r[1].getBoundingClientRect().left-v-f,p=(s-f)/2,y=0,m=0,x=function(e){return t.style.transform="translateX(".concat(function(e){return e*-f+p+e*-h}(e),"px)")},b=function(e){a.forEach((function(e){return e.classList.remove("text-active-orange")})),a[e].classList.remove("text-cool-black"),a[e].classList.add("text-active-orange")},g=function(){x(y=y-1<=0?0:y-1),b(y)},L=function(){x(y=y+1>=l?y:y+1),b(y)};return x(0),b(0),o.addEventListener("click",g),t.addEventListener("touchstart",(function(e){var t;m=null===(t=e.touches[0])||void 0===t?void 0:t.clientX})),t.addEventListener("touchend",(function(e){var t,n=(null===(t=e.changedTouches[0])||void 0===t?void 0:t.clientX)-m;Math.abs(n)<20||(n>0?g:L)()})),c.addEventListener("click",L),function(){t.style.transform=null,d.classList.replace("flex","hidden")}};const a=function(e){var n=e.container,r=e.mqEnableThreshold;if(n){var o=r||function(){return!window.matchMedia("(min-width: 48rem)").matches},i=function(){};o()&&(i=c(n)),window.addEventListener("resize",t()((function(){o()?i=c(n):i()}),100))}}})(),o.default})()}));
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("lodash.throttle"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["AblyUi"] = factory(require("lodash.throttle"));
8
+ else
9
+ root["AblyUi"] = root["AblyUi"] || {}, root["AblyUi"]["Core"] = root["AblyUi"]["Core"] || {}, root["AblyUi"]["Core"]["Slider"] = factory(root[undefined]);
10
+ })(this, (__WEBPACK_EXTERNAL_MODULE_lodash_throttle__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ "./src/core/dom-query.js":
16
+ /*!*******************************!*\
17
+ !*** ./src/core/dom-query.js ***!
18
+ \*******************************/
19
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20
+
21
+ __webpack_require__.r(__webpack_exports__);
22
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
+ /* harmony export */ "queryId": () => (/* binding */ queryId),
24
+ /* harmony export */ "queryIdAll": () => (/* binding */ queryIdAll)
25
+ /* harmony export */ });
26
+ var queryId = function queryId(val) {
27
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
28
+ return root.querySelector("[data-id=".concat(val, "]"));
29
+ };
30
+ var queryIdAll = function queryIdAll(val) {
31
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
32
+ return root.querySelectorAll("[data-id=".concat(val, "]"));
33
+ };
34
+
35
+ /***/ }),
36
+
37
+ /***/ "./src/core/Slider/component.css":
38
+ /*!***************************************!*\
39
+ !*** ./src/core/Slider/component.css ***!
40
+ \***************************************/
41
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
42
+
43
+ __webpack_require__.r(__webpack_exports__);
44
+ // extracted by mini-css-extract-plugin
45
+
46
+
47
+ /***/ }),
48
+
49
+ /***/ "lodash.throttle":
50
+ /*!*****************************************************************************!*\
51
+ !*** external {"commonjs":"lodash.throttle","commonjs2":"lodash.throttle"} ***!
52
+ \*****************************************************************************/
53
+ /***/ ((module) => {
54
+
55
+ module.exports = __WEBPACK_EXTERNAL_MODULE_lodash_throttle__;
56
+
57
+ /***/ })
58
+
59
+ /******/ });
60
+ /************************************************************************/
61
+ /******/ // The module cache
62
+ /******/ var __webpack_module_cache__ = {};
63
+ /******/
64
+ /******/ // The require function
65
+ /******/ function __webpack_require__(moduleId) {
66
+ /******/ // Check if module is in cache
67
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
68
+ /******/ if (cachedModule !== undefined) {
69
+ /******/ return cachedModule.exports;
70
+ /******/ }
71
+ /******/ // Create a new module (and put it into the cache)
72
+ /******/ var module = __webpack_module_cache__[moduleId] = {
73
+ /******/ // no module.id needed
74
+ /******/ // no module.loaded needed
75
+ /******/ exports: {}
76
+ /******/ };
77
+ /******/
78
+ /******/ // Execute the module function
79
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
80
+ /******/
81
+ /******/ // Return the exports of the module
82
+ /******/ return module.exports;
83
+ /******/ }
84
+ /******/
85
+ /************************************************************************/
86
+ /******/ /* webpack/runtime/compat get default export */
87
+ /******/ (() => {
88
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
89
+ /******/ __webpack_require__.n = (module) => {
90
+ /******/ var getter = module && module.__esModule ?
91
+ /******/ () => (module['default']) :
92
+ /******/ () => (module);
93
+ /******/ __webpack_require__.d(getter, { a: getter });
94
+ /******/ return getter;
95
+ /******/ };
96
+ /******/ })();
97
+ /******/
98
+ /******/ /* webpack/runtime/define property getters */
99
+ /******/ (() => {
100
+ /******/ // define getter functions for harmony exports
101
+ /******/ __webpack_require__.d = (exports, definition) => {
102
+ /******/ for(var key in definition) {
103
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
104
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
105
+ /******/ }
106
+ /******/ }
107
+ /******/ };
108
+ /******/ })();
109
+ /******/
110
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
111
+ /******/ (() => {
112
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
113
+ /******/ })();
114
+ /******/
115
+ /******/ /* webpack/runtime/make namespace object */
116
+ /******/ (() => {
117
+ /******/ // define __esModule on exports
118
+ /******/ __webpack_require__.r = (exports) => {
119
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
120
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
121
+ /******/ }
122
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
123
+ /******/ };
124
+ /******/ })();
125
+ /******/
126
+ /************************************************************************/
127
+ var __webpack_exports__ = {};
128
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
129
+ (() => {
130
+ /*!**************************************!*\
131
+ !*** ./src/core/Slider/component.js ***!
132
+ \**************************************/
133
+ __webpack_require__.r(__webpack_exports__);
134
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
135
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
136
+ /* harmony export */ });
137
+ /* harmony import */ var _component_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component.css */ "./src/core/Slider/component.css");
138
+ /* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.throttle */ "lodash.throttle");
139
+ /* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_1__);
140
+ /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-query */ "./src/core/dom-query.js");
141
+
142
+
143
+
144
+
145
+ var mdBreakpoint = function mdBreakpoint() {
146
+ return window.matchMedia("(min-width: 48rem)").matches;
147
+ };
148
+
149
+ var DRAG_BUFFER = 20;
150
+
151
+ var init = function init(slidesContainer) {
152
+ var transformContainer = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("slider-strip", slidesContainer);
153
+ var slides = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryIdAll)("slider-slide", slidesContainer));
154
+ var slideLeftChevron = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("slider-previous", slidesContainer);
155
+ var slideRightChevron = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("slider-next", slidesContainer);
156
+ var slideMarkers = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryIdAll)("slider-marker", slidesContainer));
157
+ var sliderControls = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("slider-controls", slidesContainer);
158
+ sliderControls.classList.replace("hidden", "flex");
159
+ var slidesLength = slides.length;
160
+ var slidesWidth = slidesContainer.getBoundingClientRect().width;
161
+
162
+ var _slides$0$getBounding = slides[0].getBoundingClientRect(),
163
+ slideWidth = _slides$0$getBounding.width,
164
+ slideLeftDistance = _slides$0$getBounding.left;
165
+
166
+ var _slides$1$getBounding = slides[1].getBoundingClientRect(),
167
+ slideLeftDistanceSecond = _slides$1$getBounding.left;
168
+
169
+ var slideGap = slideLeftDistanceSecond - slideLeftDistance - slideWidth;
170
+ var adjustment = (slidesWidth - slideWidth) / 2;
171
+ var currentIndex = 0;
172
+ var touchStartX = 0;
173
+
174
+ var calculateTransform = function calculateTransform(index) {
175
+ return index * -slideWidth + adjustment + index * -slideGap;
176
+ };
177
+
178
+ var updateSlide = function updateSlide(index) {
179
+ return transformContainer.style.transform = "translateX(".concat(calculateTransform(index), "px)");
180
+ };
181
+
182
+ var updateMarkers = function updateMarkers(index) {
183
+ slideMarkers.forEach(function (marker) {
184
+ return marker.classList.remove("text-active-orange");
185
+ });
186
+ slideMarkers[index].classList.remove("text-cool-black");
187
+ slideMarkers[index].classList.add("text-active-orange");
188
+ };
189
+
190
+ var slideLeft = function slideLeft() {
191
+ currentIndex = currentIndex - 1 <= 0 ? 0 : currentIndex - 1;
192
+ updateSlide(currentIndex);
193
+ updateMarkers(currentIndex);
194
+ };
195
+
196
+ var slideRight = function slideRight() {
197
+ currentIndex = currentIndex + 1 >= slidesLength ? currentIndex : currentIndex + 1;
198
+ updateSlide(currentIndex);
199
+ updateMarkers(currentIndex);
200
+ };
201
+
202
+ updateSlide(0);
203
+ updateMarkers(0);
204
+ slideLeftChevron.addEventListener("click", slideLeft);
205
+ transformContainer.addEventListener("touchstart", function (e) {
206
+ var _e$touches$;
207
+
208
+ touchStartX = (_e$touches$ = e.touches[0]) === null || _e$touches$ === void 0 ? void 0 : _e$touches$.clientX;
209
+ });
210
+ transformContainer.addEventListener("touchend", function (e) {
211
+ var _e$changedTouches$;
212
+
213
+ var distance = ((_e$changedTouches$ = e.changedTouches[0]) === null || _e$changedTouches$ === void 0 ? void 0 : _e$changedTouches$.clientX) - touchStartX; // Prevent sliding on clicks
214
+
215
+ if (Math.abs(distance) < DRAG_BUFFER) return;
216
+ var direction = distance > 0 ? slideLeft : slideRight;
217
+ direction();
218
+ });
219
+ slideRightChevron.addEventListener("click", slideRight);
220
+ return function () {
221
+ transformContainer.style.transform = null;
222
+ sliderControls.classList.replace("flex", "hidden");
223
+ };
224
+ };
225
+
226
+ var Slider = function Slider(_ref) {
227
+ var container = _ref.container,
228
+ mqEnableThreshold = _ref.mqEnableThreshold;
229
+ if (!container) return;
230
+
231
+ var breakpointCheck = mqEnableThreshold || function () {
232
+ return !mdBreakpoint();
233
+ };
234
+
235
+ var unmount = function unmount() {};
236
+
237
+ if (breakpointCheck()) unmount = init(container);
238
+ window.addEventListener("resize", lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default()(function () {
239
+ if (breakpointCheck()) {
240
+ unmount = init(container);
241
+ } else {
242
+ unmount();
243
+ }
244
+ }, 100));
245
+ };
246
+
247
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Slider);
248
+ })();
249
+
250
+ __webpack_exports__ = __webpack_exports__["default"];
251
+ /******/ return __webpack_exports__;
252
+ /******/ })()
253
+ ;
254
+ });
255
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS9TbGlkZXIvY29tcG9uZW50Lmp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