@bigbinary/neeto-integrations-frontend 2.4.0 → 2.5.1
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/Twilio.cjs.js +254 -94
- package/dist/Twilio.cjs.js.map +1 -1
- package/dist/Twilio.js +244 -84
- package/dist/Twilio.js.map +1 -1
- package/dist/ZapierForm.cjs.js +10 -10
- package/dist/ZapierForm.cjs.js.map +1 -1
- package/dist/ZapierForm.js +1 -1
- package/dist/ZapierForm.js.map +1 -1
- package/dist/index.cjs.js +468 -742
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +462 -748
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/Twilio.cjs.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var
|
|
5
|
-
|
|
4
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
|
+
require('@bigbinary/neeto-molecules/IntegrationCard');
|
|
6
|
+
require('@bigbinary/neeto-molecules/IntegrationDisconnectAlert');
|
|
7
|
+
require('@bigbinary/neeto-molecules/IntegrationWalkthroughModal');
|
|
6
8
|
var neetoui = require('@bigbinary/neetoui');
|
|
7
|
-
var
|
|
8
|
-
var ramda = require('ramda');
|
|
9
|
+
var classnames = require('classnames');
|
|
9
10
|
var reactI18next = require('react-i18next');
|
|
11
|
+
var ramda = require('ramda');
|
|
12
|
+
var i18next = require('i18next');
|
|
13
|
+
var formik = require('@bigbinary/neetoui/formik');
|
|
10
14
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
11
|
-
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
12
15
|
var reactQuery = require('react-query');
|
|
13
16
|
var axios = require('axios');
|
|
14
17
|
var yup = require('yup');
|
|
15
|
-
var classnames = require('classnames');
|
|
16
18
|
|
|
17
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
20
|
|
|
@@ -35,10 +37,10 @@ function _interopNamespace(e) {
|
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
40
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
38
41
|
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
39
42
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
40
43
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
41
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
42
44
|
|
|
43
45
|
function _arrayWithHoles(arr) {
|
|
44
46
|
if (Array.isArray(arr)) return arr;
|
|
@@ -95,6 +97,238 @@ function _slicedToArray(arr, i) {
|
|
|
95
97
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
var Stepper = function Stepper(_ref) {
|
|
101
|
+
var _ref$steps = _ref.steps,
|
|
102
|
+
steps = _ref$steps === void 0 ? {} : _ref$steps;
|
|
103
|
+
var isActiveOrCompleted = function isActiveOrCompleted(activeStatus, completedStatus) {
|
|
104
|
+
return activeStatus || completedStatus;
|
|
105
|
+
};
|
|
106
|
+
return /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
107
|
+
className: "flex gap-4"
|
|
108
|
+
}, steps === null || steps === void 0 ? void 0 : steps.map(function (_ref2) {
|
|
109
|
+
var step = _ref2.step,
|
|
110
|
+
label = _ref2.label,
|
|
111
|
+
isActive = _ref2.isActive,
|
|
112
|
+
isCompleted = _ref2.isCompleted;
|
|
113
|
+
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
114
|
+
className: "flex items-center gap-4",
|
|
115
|
+
key: step
|
|
116
|
+
}, step !== "1" && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
117
|
+
className: classnames__default["default"]("w-10 border-b", {
|
|
118
|
+
"neeto-ui-border-gray-800": isActiveOrCompleted(isActive, isCompleted),
|
|
119
|
+
"neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
|
|
120
|
+
})
|
|
121
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
122
|
+
className: "flex items-center gap-2"
|
|
123
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
124
|
+
className: classnames__default["default"]("neeto-ui-rounded-full neeto-ui-gray-600 flex h-6 w-6 items-center justify-center border", {
|
|
125
|
+
"neeto-ui-bg-success-600 neeto-ui-border-success-600 neeto-ui-text-white": isActive,
|
|
126
|
+
"neeto-ui-bg-primary-600 neeto-ui-border-primary-600 neeto-ui-text-white": isCompleted,
|
|
127
|
+
"neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
|
|
128
|
+
})
|
|
129
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
130
|
+
component: "span",
|
|
131
|
+
style: "body2",
|
|
132
|
+
weight: "normal"
|
|
133
|
+
}, step)), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
134
|
+
style: "body2",
|
|
135
|
+
weight: "normal",
|
|
136
|
+
className: classnames__default["default"]({
|
|
137
|
+
"neeto-ui-text-gray-800": isActiveOrCompleted(isActive, isCompleted),
|
|
138
|
+
"neeto-ui-text-gray-600": !isActiveOrCompleted(isActive, isCompleted)
|
|
139
|
+
})
|
|
140
|
+
}, label)));
|
|
141
|
+
}));
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
var Modal = function Modal(_ref) {
|
|
145
|
+
var _ref$isOpen = _ref.isOpen,
|
|
146
|
+
isOpen = _ref$isOpen === void 0 ? neetoCist.noop : _ref$isOpen,
|
|
147
|
+
_ref$onClose = _ref.onClose,
|
|
148
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
149
|
+
_ref$steps = _ref.steps,
|
|
150
|
+
steps = _ref$steps === void 0 ? {} : _ref$steps,
|
|
151
|
+
children = _ref.children;
|
|
152
|
+
return /*#__PURE__*/React__default["default"].createElement(neetoui.Modal, {
|
|
153
|
+
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-transform-none w-screen overflow-y-auto",
|
|
154
|
+
isOpen: isOpen,
|
|
155
|
+
size: "fullScreen",
|
|
156
|
+
onClose: onClose
|
|
157
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Header, null, /*#__PURE__*/React__default["default"].createElement(Stepper, {
|
|
158
|
+
steps: steps
|
|
159
|
+
})), /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Body, {
|
|
160
|
+
className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-items-center neeto-ui-flex-grow"
|
|
161
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
162
|
+
className: "neeto-ui-w-full py-10"
|
|
163
|
+
}, children)));
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
var propTypes = {exports: {}};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the MIT license found in the
|
|
172
|
+
* LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/
|
|
174
|
+
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
175
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the MIT license found in the
|
|
181
|
+
* LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/
|
|
183
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
184
|
+
function emptyFunction() {}
|
|
185
|
+
function emptyFunctionWithReset() {}
|
|
186
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
187
|
+
var factoryWithThrowingShims = function factoryWithThrowingShims() {
|
|
188
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
189
|
+
if (secret === ReactPropTypesSecret) {
|
|
190
|
+
// It is still safe when called from React.
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
194
|
+
err.name = 'Invariant Violation';
|
|
195
|
+
throw err;
|
|
196
|
+
}
|
|
197
|
+
shim.isRequired = shim;
|
|
198
|
+
function getShim() {
|
|
199
|
+
return shim;
|
|
200
|
+
}
|
|
201
|
+
// Important!
|
|
202
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
203
|
+
var ReactPropTypes = {
|
|
204
|
+
array: shim,
|
|
205
|
+
bigint: shim,
|
|
206
|
+
bool: shim,
|
|
207
|
+
func: shim,
|
|
208
|
+
number: shim,
|
|
209
|
+
object: shim,
|
|
210
|
+
string: shim,
|
|
211
|
+
symbol: shim,
|
|
212
|
+
any: shim,
|
|
213
|
+
arrayOf: getShim,
|
|
214
|
+
element: shim,
|
|
215
|
+
elementType: shim,
|
|
216
|
+
instanceOf: getShim,
|
|
217
|
+
node: shim,
|
|
218
|
+
objectOf: getShim,
|
|
219
|
+
oneOf: getShim,
|
|
220
|
+
oneOfType: getShim,
|
|
221
|
+
shape: getShim,
|
|
222
|
+
exact: getShim,
|
|
223
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
224
|
+
resetWarningCache: emptyFunction
|
|
225
|
+
};
|
|
226
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
227
|
+
return ReactPropTypes;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the MIT license found in the
|
|
234
|
+
* LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/
|
|
236
|
+
{
|
|
237
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
238
|
+
// http://fb.me/prop-types-in-prod
|
|
239
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
({
|
|
243
|
+
/**
|
|
244
|
+
* To specify the Icon to be shown
|
|
245
|
+
*/
|
|
246
|
+
Icon: propTypes.exports.PropTypes.node,
|
|
247
|
+
/**
|
|
248
|
+
* To specify the title of the connect component
|
|
249
|
+
*/
|
|
250
|
+
title: propTypes.exports.PropTypes.string,
|
|
251
|
+
/**
|
|
252
|
+
* To specify the description for connect component
|
|
253
|
+
*/
|
|
254
|
+
description: propTypes.exports.PropTypes.string,
|
|
255
|
+
/**
|
|
256
|
+
* To specify the props for the connect button
|
|
257
|
+
*/
|
|
258
|
+
buttonProps: propTypes.exports.PropTypes.object,
|
|
259
|
+
/**
|
|
260
|
+
* Handler function that is triggered when the connect button is clicked.
|
|
261
|
+
*/
|
|
262
|
+
onConnect: propTypes.exports.PropTypes.func
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
({
|
|
266
|
+
/**
|
|
267
|
+
* To specify whether the integration modal should be opened or closed.
|
|
268
|
+
*/
|
|
269
|
+
onClose: propTypes.exports.func,
|
|
270
|
+
/**
|
|
271
|
+
* To specify the walkthrough video link
|
|
272
|
+
*/
|
|
273
|
+
videoUrl: propTypes.exports.string,
|
|
274
|
+
/**
|
|
275
|
+
* To specify the title of the demo component
|
|
276
|
+
*/
|
|
277
|
+
title: propTypes.exports.string,
|
|
278
|
+
/**
|
|
279
|
+
* To specify the subtitle of the demo component
|
|
280
|
+
*/
|
|
281
|
+
subtitle: propTypes.exports.string,
|
|
282
|
+
/**
|
|
283
|
+
* To specify the title of the video in the iframe
|
|
284
|
+
*/
|
|
285
|
+
iframeTitle: propTypes.exports.string
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
({
|
|
289
|
+
/**
|
|
290
|
+
* To specify whether the integration modal should be opened or closed.
|
|
291
|
+
*/
|
|
292
|
+
onClick: propTypes.exports.func,
|
|
293
|
+
/**
|
|
294
|
+
* To show the title of the Finish component
|
|
295
|
+
*/
|
|
296
|
+
title: propTypes.exports.string,
|
|
297
|
+
/**
|
|
298
|
+
* To specify props for primary button
|
|
299
|
+
*/
|
|
300
|
+
buttonProps: propTypes.exports.object,
|
|
301
|
+
/**
|
|
302
|
+
* To specify props for secondary button
|
|
303
|
+
*/
|
|
304
|
+
secondaryButtonProps: propTypes.exports.object
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
var e = [],
|
|
308
|
+
t = [];
|
|
309
|
+
function n(n, r) {
|
|
310
|
+
if (n && "undefined" != typeof document) {
|
|
311
|
+
var a,
|
|
312
|
+
s = !0 === r.prepend ? "prepend" : "append",
|
|
313
|
+
d = !0 === r.singleTag,
|
|
314
|
+
i = "string" == typeof r.container ? document.querySelector(r.container) : document.getElementsByTagName("head")[0];
|
|
315
|
+
if (d) {
|
|
316
|
+
var u = e.indexOf(i);
|
|
317
|
+
-1 === u && (u = e.push(i) - 1, t[u] = {}), a = t[u] && t[u][s] ? t[u][s] : t[u][s] = c();
|
|
318
|
+
} else a = c();
|
|
319
|
+
65279 === n.charCodeAt(0) && (n = n.substring(1)), a.styleSheet ? a.styleSheet.cssText += n : a.appendChild(document.createTextNode(n));
|
|
320
|
+
}
|
|
321
|
+
function c() {
|
|
322
|
+
var e = document.createElement("style");
|
|
323
|
+
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]]);
|
|
324
|
+
var a = "prepend" === s ? "afterbegin" : "beforeend";
|
|
325
|
+
return i.insertAdjacentElement(a, e), e;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
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%}";
|
|
330
|
+
n(css,{});
|
|
331
|
+
|
|
98
332
|
var TWILIO_INTEGRATION_STEPS = [{
|
|
99
333
|
step: "1",
|
|
100
334
|
label: i18next__default["default"].t("neetoIntegrations.steps.configure"),
|
|
@@ -216,10 +450,6 @@ function _toConsumableArray(arr) {
|
|
|
216
450
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
217
451
|
}
|
|
218
452
|
|
|
219
|
-
var queryClient = new reactQuery.QueryClient({
|
|
220
|
-
queryCache: new reactQuery.QueryCache()
|
|
221
|
-
});
|
|
222
|
-
|
|
223
453
|
var TWILIO_CONFIGURATION_BASE_URL = "/neeto_integrations/twilio/sms_configurations";
|
|
224
454
|
|
|
225
455
|
var twilioApi = {
|
|
@@ -246,7 +476,6 @@ var QUERY_KEYS = {
|
|
|
246
476
|
|
|
247
477
|
var useFetchTwilioSmsConfiguration = function useFetchTwilioSmsConfiguration() {
|
|
248
478
|
return reactQuery.useQuery(QUERY_KEYS.TWILIO_SMS_CONFIGURATION, twilioApi.fetchTwilioSmsConfiguration, {
|
|
249
|
-
staleTime: constants.DEFAULT_STALE_TIME,
|
|
250
479
|
select: function select(response) {
|
|
251
480
|
var _smsConfiguration$twi, _smsConfiguration$twi2, _smsConfiguration$twi3;
|
|
252
481
|
var smsConfiguration = response.smsConfiguration;
|
|
@@ -263,19 +492,16 @@ var useFetchTwilioPhoneNumbers = function useFetchTwilioPhoneNumbers(_ref) {
|
|
|
263
492
|
return reactQuery.useQuery([QUERY_KEYS.TWILIO_PHONE_NUMBERS, {
|
|
264
493
|
credentials: credentials
|
|
265
494
|
}], function () {
|
|
266
|
-
return twilioApi.getTwilioPhoneNumbers(
|
|
495
|
+
return twilioApi.getTwilioPhoneNumbers(neetoCist.keysToSnakeCase(credentials));
|
|
267
496
|
}, {
|
|
268
|
-
staleTime: constants.DEFAULT_STALE_TIME,
|
|
269
497
|
enabled: !!(credentials !== null && credentials !== void 0 && credentials.twilio_sid) || !!(credentials !== null && credentials !== void 0 && credentials.twilioSid),
|
|
270
498
|
select: ramda.prop("phoneNumbers"),
|
|
271
499
|
retry: false
|
|
272
500
|
});
|
|
273
501
|
};
|
|
274
502
|
var useCreateTwilioConfiguration = function useCreateTwilioConfiguration() {
|
|
275
|
-
return
|
|
276
|
-
|
|
277
|
-
return queryClient.invalidateQueries(QUERY_KEYS.TWILIO_SMS_CONFIGURATION);
|
|
278
|
-
}
|
|
503
|
+
return reactUtils.useMutationWithInvalidation(twilioApi.createTwilioConfiguration, {
|
|
504
|
+
keysToInvalidate: [QUERY_KEYS.TWILIO_SMS_CONFIGURATION]
|
|
279
505
|
});
|
|
280
506
|
};
|
|
281
507
|
|
|
@@ -283,11 +509,11 @@ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if
|
|
|
283
509
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
284
510
|
var useTwilio = function useTwilio(_ref) {
|
|
285
511
|
var _ref$onSave = _ref.onSave,
|
|
286
|
-
onSave = _ref$onSave === void 0 ?
|
|
512
|
+
onSave = _ref$onSave === void 0 ? neetoCist.noop : _ref$onSave,
|
|
287
513
|
_ref$setSteps = _ref.setSteps,
|
|
288
|
-
setSteps = _ref$setSteps === void 0 ?
|
|
514
|
+
setSteps = _ref$setSteps === void 0 ? neetoCist.noop : _ref$setSteps,
|
|
289
515
|
_ref$useConnect = _ref.useConnect,
|
|
290
|
-
useConnect = _ref$useConnect === void 0 ?
|
|
516
|
+
useConnect = _ref$useConnect === void 0 ? neetoCist.noop : _ref$useConnect;
|
|
291
517
|
var _useFetchTwilioSmsCon = useFetchTwilioSmsConfiguration(),
|
|
292
518
|
configuration = _useFetchTwilioSmsCon.data,
|
|
293
519
|
isConfigurationLoading = _useFetchTwilioSmsCon.isLoading,
|
|
@@ -365,13 +591,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
365
591
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
366
592
|
var TwilioConfiguration = function TwilioConfiguration(_ref) {
|
|
367
593
|
var _ref$onCancel = _ref.onCancel,
|
|
368
|
-
onCancel = _ref$onCancel === void 0 ?
|
|
594
|
+
onCancel = _ref$onCancel === void 0 ? neetoCist.noop : _ref$onCancel,
|
|
369
595
|
_ref$onSave = _ref.onSave,
|
|
370
|
-
onSave = _ref$onSave === void 0 ?
|
|
596
|
+
onSave = _ref$onSave === void 0 ? neetoCist.noop : _ref$onSave,
|
|
371
597
|
_ref$setSteps = _ref.setSteps,
|
|
372
|
-
setSteps = _ref$setSteps === void 0 ?
|
|
598
|
+
setSteps = _ref$setSteps === void 0 ? neetoCist.noop : _ref$setSteps,
|
|
373
599
|
_ref$useConnect = _ref.useConnect,
|
|
374
|
-
useConnect = _ref$useConnect === void 0 ?
|
|
600
|
+
useConnect = _ref$useConnect === void 0 ? neetoCist.noop : _ref$useConnect,
|
|
375
601
|
_ref$isModal = _ref.isModal,
|
|
376
602
|
isModal = _ref$isModal === void 0 ? false : _ref$isModal;
|
|
377
603
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -396,7 +622,7 @@ var TwilioConfiguration = function TwilioConfiguration(_ref) {
|
|
|
396
622
|
value: sid
|
|
397
623
|
};
|
|
398
624
|
});
|
|
399
|
-
var selectedPhoneNumber =
|
|
625
|
+
var selectedPhoneNumber = neetoCist._findBy({
|
|
400
626
|
label: configuration === null || configuration === void 0 ? void 0 : configuration.twilioPhoneNumber
|
|
401
627
|
}, phoneNumberOptions);
|
|
402
628
|
var wrapInModalBody = function wrapInModalBody(children) {
|
|
@@ -449,77 +675,11 @@ var TwilioConfiguration = function TwilioConfiguration(_ref) {
|
|
|
449
675
|
});
|
|
450
676
|
};
|
|
451
677
|
|
|
452
|
-
var Stepper = function Stepper(_ref) {
|
|
453
|
-
var _ref$steps = _ref.steps,
|
|
454
|
-
steps = _ref$steps === void 0 ? {} : _ref$steps;
|
|
455
|
-
var isActiveOrCompleted = function isActiveOrCompleted(activeStatus, completedStatus) {
|
|
456
|
-
return activeStatus || completedStatus;
|
|
457
|
-
};
|
|
458
|
-
return /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
459
|
-
className: "flex gap-4"
|
|
460
|
-
}, steps === null || steps === void 0 ? void 0 : steps.map(function (_ref2) {
|
|
461
|
-
var step = _ref2.step,
|
|
462
|
-
label = _ref2.label,
|
|
463
|
-
isActive = _ref2.isActive,
|
|
464
|
-
isCompleted = _ref2.isCompleted;
|
|
465
|
-
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
466
|
-
className: "flex items-center gap-4",
|
|
467
|
-
key: step
|
|
468
|
-
}, step !== "1" && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
469
|
-
className: classnames__default["default"]("w-10 border-b", {
|
|
470
|
-
"neeto-ui-border-gray-800": isActiveOrCompleted(isActive, isCompleted),
|
|
471
|
-
"neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
|
|
472
|
-
})
|
|
473
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
474
|
-
className: "flex items-center gap-2"
|
|
475
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
476
|
-
className: classnames__default["default"]("neeto-ui-rounded-full neeto-ui-gray-600 flex h-6 w-6 items-center justify-center border", {
|
|
477
|
-
"neeto-ui-bg-success-600 neeto-ui-border-success-600 neeto-ui-text-white": isActive,
|
|
478
|
-
"neeto-ui-bg-primary-600 neeto-ui-border-primary-600 neeto-ui-text-white": isCompleted,
|
|
479
|
-
"neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
|
|
480
|
-
})
|
|
481
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
482
|
-
component: "span",
|
|
483
|
-
style: "body2",
|
|
484
|
-
weight: "normal"
|
|
485
|
-
}, step)), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
486
|
-
style: "body2",
|
|
487
|
-
weight: "normal",
|
|
488
|
-
className: classnames__default["default"]({
|
|
489
|
-
"neeto-ui-text-gray-800": isActiveOrCompleted(isActive, isCompleted),
|
|
490
|
-
"neeto-ui-text-gray-600": !isActiveOrCompleted(isActive, isCompleted)
|
|
491
|
-
})
|
|
492
|
-
}, label)));
|
|
493
|
-
}));
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
var Modal = function Modal(_ref) {
|
|
497
|
-
var _ref$isOpen = _ref.isOpen,
|
|
498
|
-
isOpen = _ref$isOpen === void 0 ? pure.noop : _ref$isOpen,
|
|
499
|
-
_ref$onClose = _ref.onClose,
|
|
500
|
-
onClose = _ref$onClose === void 0 ? pure.noop : _ref$onClose,
|
|
501
|
-
_ref$steps = _ref.steps,
|
|
502
|
-
steps = _ref$steps === void 0 ? {} : _ref$steps,
|
|
503
|
-
children = _ref.children;
|
|
504
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Modal, {
|
|
505
|
-
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-transform-none w-screen overflow-y-auto",
|
|
506
|
-
isOpen: isOpen,
|
|
507
|
-
size: "fullScreen",
|
|
508
|
-
onClose: onClose
|
|
509
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Header, null, /*#__PURE__*/React__default["default"].createElement(Stepper, {
|
|
510
|
-
steps: steps
|
|
511
|
-
})), /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Body, {
|
|
512
|
-
className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-items-center neeto-ui-flex-grow"
|
|
513
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
514
|
-
className: "neeto-ui-w-full py-10"
|
|
515
|
-
}, children)));
|
|
516
|
-
};
|
|
517
|
-
|
|
518
678
|
var Twilio = function Twilio(_ref) {
|
|
519
679
|
var _ref$onClose = _ref.onClose,
|
|
520
|
-
onClose = _ref$onClose === void 0 ?
|
|
680
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
521
681
|
_ref$useConnect = _ref.useConnect,
|
|
522
|
-
useConnect = _ref$useConnect === void 0 ?
|
|
682
|
+
useConnect = _ref$useConnect === void 0 ? neetoCist.noop : _ref$useConnect;
|
|
523
683
|
var _useState = React.useState(TWILIO_INTEGRATION_STEPS),
|
|
524
684
|
_useState2 = _slicedToArray(_useState, 2),
|
|
525
685
|
steps = _useState2[0],
|