@bigbinary/neeto-molecules 1.0.78 → 1.0.79-beta

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.
@@ -1,14 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { forwardRef, useRef, useState } from 'react';
3
- import { noop, snakeToCamelCase, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
3
+ import { isNotEmpty, noop, snakeToCamelCase } from '@bigbinary/neeto-commons-frontend/pure';
4
4
  import { useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
5
5
  import { Typography, Button, Alert, Dropdown as Dropdown$1, Input, Tag, Callout, Pane, Label, Table, NoData } from '@bigbinary/neetoui';
6
6
  import { useTranslation, Trans } from 'react-i18next';
7
- import { Column, Download, Filter, Right, MenuVertical, HamburgerMenu, Search, MenuHorizontal, Info, Copy, Check } from '@bigbinary/neeto-icons';
7
+ import { Column, Download, Filter, MenuVertical, Search, MenuHorizontal, Info, Copy, Check } from '@bigbinary/neeto-icons';
8
8
  import ManageColumns from '@bigbinary/neeto-molecules/Columns';
9
9
  import { Filters } from '@bigbinary/neeto-filters-frontend';
10
- import { withEventTargetValue, joinHyphenCase, copyToClipboard, timeFormat } from '@bigbinary/neeto-commons-frontend/utils';
11
- import { isEmpty } from 'ramda';
10
+ import { withEventTargetValue, joinHyphenCase, copyToClipboard } from '@bigbinary/neeto-commons-frontend/utils';
12
11
  import { Link } from 'react-router-dom';
13
12
  import { Formik, Form } from 'formik';
14
13
  import { Input as Input$1 } from '@bigbinary/neetoui/formik';
@@ -1317,7 +1316,7 @@ if (process.env.NODE_ENV !== 'production') {
1317
1316
 
1318
1317
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
1319
1318
 
1320
- var css$3 = ".neeto-molecules-container{align-items:flex-start;display:flex;flex-direction:column;flex-grow:1;height:100vh;justify-content:flex-start;overflow-y:auto;padding:0 24px}.neeto-molecules-container--header-fixed{padding:0}.neeto-molecules-container--header-fixed>.neeto-molecules-header,.neeto-molecules-container--header-fixed>.neeto-molecules-scrollable,.neeto-molecules-container--header-fixed>.neeto-molecules-subheader{padding-left:24px;padding-right:24px}";
1319
+ var css$3 = ".neeto-molecules-container{align-items:flex-start;display:flex;flex-direction:column;flex-grow:1;height:100vh;justify-content:flex-start;overflow-y:auto;padding:0 40px!important}.neeto-molecules-container--header-fixed{padding:0!important}.neeto-molecules-container--header-fixed>.neeto-molecules-header,.neeto-molecules-container--header-fixed>.neeto-molecules-scrollable,.neeto-molecules-container--header-fixed>.neeto-molecules-subheader{padding-left:40px!important;padding-right:40px!important}";
1321
1320
  n(css$3,{});
1322
1321
 
1323
1322
  var Container = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -1588,7 +1587,7 @@ var RightBlock = function RightBlock(_ref) {
1588
1587
  }, downloadButtonProps && /*#__PURE__*/React__default.createElement(DownloadButton, downloadButtonProps), columnsButtonProps && /*#__PURE__*/React__default.createElement(Columns, columnsButtonProps), filterProps && /*#__PURE__*/React__default.createElement(FilterButton, filterProps));
1589
1588
  };
1590
1589
 
1591
- var css$1 = ".neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:var(--neeto-ui-sub-header-bottom-margin);min-height:var(--neeto-ui-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
1590
+ var css$1 = ":root{--neeto-molecules-sub-header-height:37px;--neeto-molecules-sub-header-bottom-margin:20px}.neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:20px;margin-bottom:var(--neeto-molecules-sub-header-bottom-margin);min-height:37px;min-height:var(--neeto-molecules-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
1592
1591
  n(css$1,{});
1593
1592
 
1594
1593
  var SubHeader = function SubHeader(_ref) {
@@ -1634,7 +1633,7 @@ var DeleteAlert = function DeleteAlert(_ref) {
1634
1633
  });
1635
1634
  };
1636
1635
 
1637
- var css = ".neeto-molecules-header{align-items:center;background:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;min-height:var(--neeto-ui-main-header-height);padding:24px 0;width:100%}.neeto-molecules-header--has-breadcrumbs{min-height:var(--neeto-ui-main-header-with-breadcrumbs-height)}.neeto-molecules-header .neeto-molecules-header__toggle-menubar-btn{margin-right:8px}.neeto-molecules-header .neeto-molecules-header__left{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start}.neeto-molecules-header .neeto-molecules-header__left-data-wrap{display:flex;flex-wrap:wrap}.neeto-molecules-header .neeto-molecules-header__page-title{display:flex;flex-direction:row;width:100%}.neeto-molecules-header .neeto-molecules-header__breadcrumbs-wrap{display:flex}.neeto-molecules-header .neeto-molecules-header__breadcrumb{align-items:center;display:flex;flex-direction:row;justify-content:flex-start;line-height:1}.neeto-molecules-header .neeto-molecules-header__breadcrumb a{text-decoration:none;transition:all .3s ease-in-out}.neeto-molecules-header .neeto-molecules-header__breadcrumb a:focus-visible{border-radius:var(--neeto-ui-rounded-sm);outline:3px solid rgba(var(--neeto-ui-primary-500),50%)}.neeto-molecules-header .neeto-molecules-header__breadcrumb-separator{margin:0 4px}.neeto-molecules-header .neeto-molecules-header__right{align-items:center;display:flex;flex-direction:row;justify-content:flex-end}";
1636
+ var css = ":root{--neeto-molecules-main-header-height:96px;--neeto-molecules-main-header-with-breadcrumbs-height:168px}.neeto-molecules-header{align-items:flex-start!important;background:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;min-height:96px;min-height:var(--neeto-molecules-main-header-height);padding:40px 0 24px!important;width:100%}.neeto-molecules-header .neeto-molecules-header__toggle-menubar-btn{margin-right:8px}.neeto-molecules-header .neeto-molecules-header__left{align-items:flex-start!important;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start}.neeto-molecules-header .neeto-molecules-header__left-data-wrap{display:flex;flex-wrap:wrap}.neeto-molecules-header .neeto-molecules-header__page-title{align-items:center;display:flex;flex-direction:row;gap:12px;margin-top:-16px;width:100%}.neeto-molecules-header .neeto-molecules-header__page-title h2{font-size:40px;line-height:48px}.neeto-molecules-header .neeto-molecules-header__breadcrumbs-wrap{display:flex;margin:0 0 40px}.neeto-molecules-header .neeto-molecules-header__breadcrumb{align-items:center;display:flex;flex-direction:row;justify-content:flex-start;line-height:1}.neeto-molecules-header .neeto-molecules-header__breadcrumb a{text-decoration:none;transition:all .3s ease-in-out}.neeto-molecules-header .neeto-molecules-header__breadcrumb a:focus-visible{border-radius:var(--neeto-ui-rounded-sm);outline:3px solid rgba(var(--neeto-ui-primary-500),50%)}.neeto-molecules-header .neeto-molecules-header__breadcrumb-separator{font-size:12px;line-height:16px;margin:0 12px!important}.neeto-molecules-header .neeto-molecules-header__right{align-items:center;display:flex;flex-direction:row;justify-content:flex-end}.neeto-molecules-header--has-breadcrumbs{min-height:168px;min-height:var(--neeto-molecules-main-header-with-breadcrumbs-height)}.neeto-molecules-header--has-breadcrumbs .neeto-molecules-header__page-title{margin-top:0}";
1638
1637
  n(css,{});
1639
1638
 
1640
1639
  var Breadcrumbs = function Breadcrumbs(_ref) {
@@ -1643,34 +1642,30 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
1643
1642
  className: "neeto-molecules-header__breadcrumbs-wrap"
1644
1643
  }, breadcrumbs.map(function (_ref2, index) {
1645
1644
  var text = _ref2.text,
1646
- link = _ref2.link;
1645
+ _ref2$link = _ref2.link,
1646
+ link = _ref2$link === void 0 ? "#" : _ref2$link;
1647
1647
  return /*#__PURE__*/React__default.createElement("div", {
1648
1648
  className: "neeto-molecules-header__breadcrumb",
1649
1649
  key: index
1650
1650
  }, /*#__PURE__*/React__default.createElement(Link, {
1651
1651
  to: link
1652
1652
  }, /*#__PURE__*/React__default.createElement(Typography, {
1653
- className: "neeto-molecules-text-gray-700 hover:neeto-ui-text-gray-800 neeto-molecules-header__breadcrumb-link",
1653
+ className: "neeto-ui-text-gray-700 hover:neeto-ui-text-gray-800 neeto-molecules-header__breadcrumb-link",
1654
1654
  component: "span",
1655
1655
  "data-cy": text,
1656
1656
  "data-test-id": text,
1657
1657
  style: "body2",
1658
1658
  weight: "normal"
1659
- }, text)), /*#__PURE__*/React__default.createElement(Right, {
1660
- className: "neeto-molecules-header__breadcrumb-separator neeto-ui-text-gray-400",
1661
- size: 16
1662
- }));
1659
+ }, text)), index + 1 !== breadcrumbs.length && /*#__PURE__*/React__default.createElement("span", {
1660
+ className: "neeto-molecules-header__breadcrumb-separator neeto-ui-text-black"
1661
+ }, "/"));
1663
1662
  }));
1664
1663
  };
1665
1664
  var Breadcrumbs$1 = /*#__PURE__*/React__default.memo(Breadcrumbs);
1666
1665
 
1667
1666
  var Dropdown = function Dropdown(props) {
1668
1667
  return /*#__PURE__*/React__default.createElement(Dropdown$1, _extends$1({
1669
- buttonProps: {
1670
- className: "ml-1.5"
1671
- },
1672
1668
  buttonStyle: "text",
1673
- className: "ml-3",
1674
1669
  icon: MenuVertical,
1675
1670
  position: "bottom-end"
1676
1671
  }, props));
@@ -1678,7 +1673,6 @@ var Dropdown = function Dropdown(props) {
1678
1673
 
1679
1674
  var Header$2 = function Header(_ref) {
1680
1675
  var title = _ref.title,
1681
- menuBarToggle = _ref.menuBarToggle,
1682
1676
  searchProps = _ref.searchProps,
1683
1677
  _ref$className = _ref.className,
1684
1678
  className = _ref$className === void 0 ? "" : _ref$className,
@@ -1692,20 +1686,13 @@ var Header$2 = function Header(_ref) {
1692
1686
  t = _useTranslation.t;
1693
1687
  return /*#__PURE__*/React__default.createElement("div", {
1694
1688
  className: classnames(["neeto-molecules-header", {
1695
- "neeto-molecules-header--has-breadcrumbs": !isEmpty(breadcrumbs)
1689
+ "neeto-molecules-header--has-breadcrumbs": isNotEmpty(breadcrumbs)
1696
1690
  }, className])
1697
1691
  }, /*#__PURE__*/React__default.createElement("div", {
1698
1692
  className: "neeto-molecules-header__left"
1699
- }, menuBarToggle && /*#__PURE__*/React__default.createElement(Button, {
1700
- "aria-label": "Toggle Menubar",
1701
- className: "neeto-molecules-header__toggle-menubar-btn",
1702
- "data-cy": "menubar-toggle-button",
1703
- icon: HamburgerMenu,
1704
- style: "text",
1705
- onClick: menuBarToggle
1706
- }), /*#__PURE__*/React__default.createElement("div", {
1693
+ }, /*#__PURE__*/React__default.createElement("div", {
1707
1694
  className: "neeto-molecules-header__left-data-wrap"
1708
- }, breadcrumbs && /*#__PURE__*/React__default.createElement(Breadcrumbs$1, {
1695
+ }, isNotEmpty(breadcrumbs) && /*#__PURE__*/React__default.createElement(Breadcrumbs$1, {
1709
1696
  breadcrumbs: breadcrumbs
1710
1697
  }), /*#__PURE__*/React__default.createElement("div", {
1711
1698
  className: "neeto-molecules-header__page-title"
@@ -1768,10 +1755,8 @@ var INITIAL_VALUES = {
1768
1755
 
1769
1756
  var TagBlock = function TagBlock(_ref) {
1770
1757
  var status = _ref.status,
1771
- isCnameRecordsAdded = _ref.isCnameRecordsAdded,
1772
1758
  _ref$stacked = _ref.stacked,
1773
- stacked = _ref$stacked === void 0 ? false : _ref$stacked,
1774
- handleValidateCname = _ref.handleValidateCname;
1759
+ stacked = _ref$stacked === void 0 ? false : _ref$stacked;
1775
1760
  var _useTranslation = useTranslation(),
1776
1761
  t = _useTranslation.t;
1777
1762
  var isDomainValidated = status === "active" || status === "pending_cname_validation";
@@ -1796,11 +1781,6 @@ var TagBlock = function TagBlock(_ref) {
1796
1781
  indicatorStyle: status === "active" ? "success" : "warning",
1797
1782
  style: "secondary",
1798
1783
  label: t("neetoMolecules.customDomain.status.cname.".concat(camelCasedStatus))
1799
- }), isCnameRecordsAdded && status === "pending_cname_validation" && /*#__PURE__*/React__default.createElement(Button, {
1800
- className: "text-xs",
1801
- style: "link",
1802
- label: t("neetoMolecules.customDomain.validation.buttonLabel.cnameCheck"),
1803
- onClick: handleValidateCname
1804
1784
  }))));
1805
1785
  };
1806
1786
  var TagBlock$1 = /*#__PURE__*/React__default.memo(TagBlock);
@@ -1859,8 +1839,11 @@ var recordData = function recordData(customDomain) {
1859
1839
  var recordName = isDomainValidated ? hostname : cnameValidationParams === null || cnameValidationParams === void 0 ? void 0 : cnameValidationParams.name;
1860
1840
  var recordValue = isDomainValidated ? dnsTarget : cnameValidationParams === null || cnameValidationParams === void 0 ? void 0 : cnameValidationParams.value;
1861
1841
  var recordType = isDomainValidated ? t$1("neetoMolecules.customDomain.cname") : t$1("neetoMolecules.customDomain.domainValidationCname");
1862
- var recordDescription = t$1("neetoMolecules.customDomain.validation.desc", {
1842
+ var recordDescription = isDomainValidated ? t$1("neetoMolecules.customDomain.validation.desc", {
1863
1843
  record: recordType
1844
+ }) : t$1("neetoMolecules.customDomain.validation.desc", {
1845
+ record: recordType,
1846
+ proxyMessage: t$1("neetoMolecules.customDomain.validation.proxyMessage")
1864
1847
  });
1865
1848
  var recordNameLabel = t$1("neetoMolecules.customDomain.validation.record", {
1866
1849
  record: recordType,
@@ -1920,28 +1903,25 @@ var Record = function Record(_ref) {
1920
1903
  };
1921
1904
  var Record$1 = /*#__PURE__*/React__default.memo(Record);
1922
1905
 
1923
- var CustomDomainInfo = function CustomDomainInfo(_ref) {
1924
- var time = _ref.time;
1925
- var _useTranslation = useTranslation(),
1926
- t = _useTranslation.t;
1906
+ var StatusInfo = function StatusInfo() {
1907
+ var helpUrl = "https://help.".concat(globalProps.appName.toLowerCase(), ".com/articles/custom-domains");
1927
1908
  return /*#__PURE__*/React__default.createElement("div", {
1928
1909
  className: "space-y-6"
1929
1910
  }, /*#__PURE__*/React__default.createElement("div", {
1930
1911
  className: "neeto-ui-rounded neeto-ui-bg-gray-100 neeto-ui-text-gray-700 space-y-3 p-4"
1931
1912
  }, /*#__PURE__*/React__default.createElement(Trans, {
1932
- i18nKey: "neetoMolecules.customDomain.messageBlock.dnsStatus"
1933
- }), /*#__PURE__*/React__default.createElement(Button, {
1934
- href: "mailto:support@neeto.com",
1935
- label: "support@neeto.com",
1936
- style: "link"
1937
- })), /*#__PURE__*/React__default.createElement(Callout, {
1938
- icon: Info,
1939
- style: "info"
1940
- }, t("neetoMolecules.customDomain.messageBlock.cnameAddedTime", {
1941
- time: timeFormat.fromNow(time)
1913
+ i18nKey: "neetoMolecules.customDomain.messageBlock.dnsStatus",
1914
+ components: {
1915
+ a: /*#__PURE__*/React__default.createElement("a", {
1916
+ className: "neeto-ui-btn--style-link",
1917
+ href: helpUrl,
1918
+ rel: "noreferrer",
1919
+ target: "_blank"
1920
+ })
1921
+ }
1942
1922
  })));
1943
1923
  };
1944
- var StatusInfo = /*#__PURE__*/React__default.memo(CustomDomainInfo);
1924
+ var StatusInfo$1 = /*#__PURE__*/React__default.memo(StatusInfo);
1945
1925
 
1946
1926
  var getCustomDomainValidationSchema = function getCustomDomainValidationSchema() {
1947
1927
  return Yup.object().shape({
@@ -2150,14 +2130,12 @@ var Manage = function Manage(_ref) {
2150
2130
  loading: isValidating,
2151
2131
  label: t("neetoMolecules.customDomain.validation.buttonLabel.domain"),
2152
2132
  onClick: handleValidateDomain
2153
- }), customDomain.status === "pending_cname_validation" && !customDomain.addedCnameAt && /*#__PURE__*/React__default.createElement(Button, {
2133
+ }), customDomain.status === "pending_cname_validation" && /*#__PURE__*/React__default.createElement(Button, {
2154
2134
  "data-cy": "validate-cname-record-button",
2155
2135
  loading: isCnameValidating || isUpdating,
2156
2136
  label: t("neetoMolecules.customDomain.validation.buttonLabel.cnameAdded"),
2157
2137
  onClick: handleUpdateCname
2158
- }), customDomain.status === "pending_cname_validation" && customDomain.addedCnameAt && /*#__PURE__*/React__default.createElement(StatusInfo, {
2159
- time: customDomain.addedCnameAt
2160
- })))));
2138
+ }), /*#__PURE__*/React__default.createElement(StatusInfo$1, null)))));
2161
2139
  }));
2162
2140
  };
2163
2141