@bigbinary/neeto-integrations-frontend 1.3.0 → 1.5.0

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/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import React__default, { useContext, useState, useRef, useEffect } from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { noop as noop$1, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
5
5
  import { joinHyphenCase, timeFormat, copyToClipboard } from '@bigbinary/neeto-commons-frontend/utils';
6
- import { Dropdown as Dropdown$1, Tag, Tooltip, Typography, Spinner, Button, Modal as Modal$1, Table, Alert, Callout } from '@bigbinary/neetoui';
6
+ import { Dropdown as Dropdown$1, Tag, Tooltip, Typography, Spinner, Button, Alert, Modal as Modal$1, Table, Callout } from '@bigbinary/neetoui';
7
7
  import { isNotNil, isEmpty } from 'ramda';
8
8
  import { MenuVertical, Warning, Check, MenuHorizontal, Copy } from '@bigbinary/neeto-icons';
9
9
  import { Form, Input } from '@bigbinary/neetoui/formik';
@@ -3181,7 +3181,7 @@ function hasLoadedNamespace(ns, i18n) {
3181
3181
  });
3182
3182
  }
3183
3183
 
3184
- var _excluded$1 = ["format"],
3184
+ var _excluded$2 = ["format"],
3185
3185
  _excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
3186
3186
  function ownKeys$3(object, enumerableOnly) {
3187
3187
  var keys = Object.keys(object);
@@ -3265,7 +3265,7 @@ function nodesToString(children, i18nOptions) {
3265
3265
  warn("Trans: the passed in value is invalid - seems you passed in a null child.");
3266
3266
  } else if (_typeof$1(child) === 'object') {
3267
3267
  var format = child.format,
3268
- clone = _objectWithoutProperties$1(child, _excluded$1);
3268
+ clone = _objectWithoutProperties$1(child, _excluded$2);
3269
3269
  var keys = Object.keys(clone);
3270
3270
  if (keys.length === 1) {
3271
3271
  var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
@@ -3782,11 +3782,11 @@ function _objectWithoutProperties(source, excluded) {
3782
3782
  return target;
3783
3783
  }
3784
3784
 
3785
- var _excluded = ["disabled", "children"];
3785
+ var _excluded$1 = ["disabled", "children"];
3786
3786
  var TooltipWrapper = function TooltipWrapper(_ref) {
3787
3787
  var disabled = _ref.disabled,
3788
3788
  children = _ref.children,
3789
- tooltipProps = _objectWithoutProperties(_ref, _excluded);
3789
+ tooltipProps = _objectWithoutProperties(_ref, _excluded$1);
3790
3790
  return disabled ? /*#__PURE__*/React__default.createElement(Tooltip, tooltipProps, children) : children;
3791
3791
  };
3792
3792
 
@@ -3902,6 +3902,36 @@ var Card = function Card(_ref) {
3902
3902
  })))));
3903
3903
  };
3904
3904
 
3905
+ var _excluded = ["isOpen", "isDisconnecting", "title", "message", "onClose", "onDisconnect"];
3906
+ var DisconnectAlert = function DisconnectAlert(_ref) {
3907
+ var _ref$isOpen = _ref.isOpen,
3908
+ isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
3909
+ _ref$isDisconnecting = _ref.isDisconnecting,
3910
+ isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
3911
+ _ref$title = _ref.title,
3912
+ title = _ref$title === void 0 ? "" : _ref$title,
3913
+ _ref$message = _ref.message,
3914
+ message = _ref$message === void 0 ? "" : _ref$message,
3915
+ _ref$onClose = _ref.onClose,
3916
+ onClose = _ref$onClose === void 0 ? noop$1 : _ref$onClose,
3917
+ _ref$onDisconnect = _ref.onDisconnect,
3918
+ onDisconnect = _ref$onDisconnect === void 0 ? noop$1 : _ref$onDisconnect,
3919
+ otherProps = _objectWithoutProperties(_ref, _excluded);
3920
+ var _useTranslation = useTranslation(),
3921
+ t = _useTranslation.t;
3922
+ return /*#__PURE__*/React__default.createElement(Alert, _extends$1({
3923
+ closeOnEsc: true,
3924
+ closeOnOutsideClick: true,
3925
+ isOpen: isOpen,
3926
+ isSubmitting: isDisconnecting,
3927
+ message: message,
3928
+ submitButtonLabel: t("common.disconnect"),
3929
+ title: title,
3930
+ onClose: onClose,
3931
+ onSubmit: onDisconnect
3932
+ }, otherProps));
3933
+ };
3934
+
3905
3935
  var Stepper = function Stepper(_ref) {
3906
3936
  var _ref$steps = _ref.steps,
3907
3937
  steps = _ref$steps === void 0 ? {} : _ref$steps;
@@ -4424,8 +4454,8 @@ var ApiKeysList = function ApiKeysList(_ref) {
4424
4454
  deleteApiKey = _ref$deleteApiKey === void 0 ? noop$1 : _ref$deleteApiKey,
4425
4455
  _ref$isDeleting = _ref.isDeleting,
4426
4456
  isDeleting = _ref$isDeleting === void 0 ? false : _ref$isDeleting,
4427
- _ref$setNewZapierApiK = _ref.setNewZapierApiKey,
4428
- setNewZapierApiKey = _ref$setNewZapierApiK === void 0 ? noop$1 : _ref$setNewZapierApiK;
4457
+ _ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
4458
+ setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? noop$1 : _ref$setNewlyCreatedA;
4429
4459
  var _useState = useState(null),
4430
4460
  _useState2 = _slicedToArray(_useState, 2),
4431
4461
  apiKeyToDelete = _useState2[0],
@@ -4439,7 +4469,7 @@ var ApiKeysList = function ApiKeysList(_ref) {
4439
4469
  deleteApiKey(apiKeyToDelete === null || apiKeyToDelete === void 0 ? void 0 : apiKeyToDelete.id, {
4440
4470
  onSuccess: function onSuccess() {
4441
4471
  closeAlert();
4442
- setNewZapierApiKey("");
4472
+ setNewlyCreatedApiKey("");
4443
4473
  }
4444
4474
  });
4445
4475
  };
@@ -4513,7 +4543,7 @@ var GenerateKey = function GenerateKey(_ref) {
4513
4543
  })));
4514
4544
  };
4515
4545
 
4516
- var NewZapierApiKey = function NewZapierApiKey(_ref) {
4546
+ var NewApiKeyCallout = function NewApiKeyCallout(_ref) {
4517
4547
  var apiKey = _ref.apiKey;
4518
4548
  var _useTranslation = useTranslation(),
4519
4549
  t = _useTranslation.t;
@@ -4535,12 +4565,12 @@ var NewZapierApiKey = function NewZapierApiKey(_ref) {
4535
4565
  };
4536
4566
 
4537
4567
  var ZapierForm = function ZapierForm(_ref) {
4538
- var _ref$newZapierApiKey = _ref.newZapierApiKey,
4539
- newZapierApiKey = _ref$newZapierApiKey === void 0 ? "" : _ref$newZapierApiKey,
4568
+ var _ref$newlyCreatedApiK = _ref.newlyCreatedApiKey,
4569
+ newlyCreatedApiKey = _ref$newlyCreatedApiK === void 0 ? "" : _ref$newlyCreatedApiK,
4540
4570
  _ref$videoUrl = _ref.videoUrl,
4541
4571
  videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
4542
- _ref$zapierApiKeys = _ref.zapierApiKeys,
4543
- zapierApiKeys = _ref$zapierApiKeys === void 0 ? [] : _ref$zapierApiKeys,
4572
+ _ref$apiKeys = _ref.apiKeys,
4573
+ apiKeys = _ref$apiKeys === void 0 ? [] : _ref$apiKeys,
4544
4574
  _ref$isGenerating = _ref.isGenerating,
4545
4575
  isGenerating = _ref$isGenerating === void 0 ? false : _ref$isGenerating,
4546
4576
  _ref$isLoading = _ref.isLoading,
@@ -4551,8 +4581,8 @@ var ZapierForm = function ZapierForm(_ref) {
4551
4581
  deleteApiKey = _ref$deleteApiKey === void 0 ? noop$1 : _ref$deleteApiKey,
4552
4582
  _ref$handleGenerateAp = _ref.handleGenerateApiKey,
4553
4583
  handleGenerateApiKey = _ref$handleGenerateAp === void 0 ? noop$1 : _ref$handleGenerateAp,
4554
- _ref$setNewZapierApiK = _ref.setNewZapierApiKey,
4555
- setNewZapierApiKey = _ref$setNewZapierApiK === void 0 ? noop$1 : _ref$setNewZapierApiK,
4584
+ _ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
4585
+ setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? noop$1 : _ref$setNewlyCreatedA,
4556
4586
  _ref$setIsDemoModalOp = _ref.setIsDemoModalOpen,
4557
4587
  setIsDemoModalOpen = _ref$setIsDemoModalOp === void 0 ? noop$1 : _ref$setIsDemoModalOp;
4558
4588
  var _useTranslation = useTranslation(),
@@ -4560,20 +4590,20 @@ var ZapierForm = function ZapierForm(_ref) {
4560
4590
  if (isLoading) return /*#__PURE__*/React__default.createElement(Spinner, null);
4561
4591
  return /*#__PURE__*/React__default.createElement("div", {
4562
4592
  className: "w-full max-w-xl space-y-10 p-10"
4563
- }, isNotEmpty(newZapierApiKey) && /*#__PURE__*/React__default.createElement(NewZapierApiKey, {
4564
- apiKey: newZapierApiKey
4593
+ }, isNotEmpty(newlyCreatedApiKey) && /*#__PURE__*/React__default.createElement(NewApiKeyCallout, {
4594
+ apiKey: newlyCreatedApiKey
4565
4595
  }), /*#__PURE__*/React__default.createElement(Typography, {
4566
4596
  style: "h2"
4567
- }, t("zapier.apiKeys")), isEmpty(zapierApiKeys) && /*#__PURE__*/React__default.createElement(Typography, {
4597
+ }, t("zapier.apiKeys")), isEmpty(apiKeys) && /*#__PURE__*/React__default.createElement(Typography, {
4568
4598
  style: "h4"
4569
4599
  }, t("zapier.emptyText")), /*#__PURE__*/React__default.createElement(GenerateKey, {
4570
4600
  handleSubmit: handleGenerateApiKey,
4571
4601
  isLoading: isGenerating
4572
4602
  }), /*#__PURE__*/React__default.createElement(ApiKeysList, {
4573
- apiKeys: zapierApiKeys,
4603
+ apiKeys: apiKeys,
4574
4604
  deleteApiKey: deleteApiKey,
4575
4605
  isDeleting: isDeleting,
4576
- setNewZapierApiKey: setNewZapierApiKey
4606
+ setNewlyCreatedApiKey: setNewlyCreatedApiKey
4577
4607
  }), isNotEmpty(videoUrl) && /*#__PURE__*/React__default.createElement(Button, {
4578
4608
  className: "mb-6",
4579
4609
  label: t("zapier.walkthroughText"),
@@ -4609,5 +4639,5 @@ function n(n, r) {
4609
4639
  var css = ".intrinsic-container{height:0;overflow:hidden;position:relative}.intrinsic-container-16x9{padding-bottom:56.25%}.intrinsic-container-4x3{padding-bottom:75%}.intrinsic-container iframe{height:100%;left:0;position:absolute;top:0;width:100%}";
4610
4640
  n(css,{});
4611
4641
 
4612
- export { Card, Connect, Demo, Finish, Modal, WalkthroughModal, ZapierForm };
4642
+ export { Card, Connect, Demo, DisconnectAlert, Finish, Modal, WalkthroughModal, ZapierForm };
4613
4643
  //# sourceMappingURL=index.js.map