@bigbinary/neeto-slack-frontend 0.4.2 → 1.0.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,11 +3,11 @@ import React__default, { useContext, useState, useRef, useEffect } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { Button, Typography, Label } from '@bigbinary/neetoui';
5
5
  import { Form, Select } from '@bigbinary/neetoui/formik';
6
- import { not, is } from 'ramda';
6
+ import { not, is, isEmpty } from 'ramda';
7
7
  import { Refresh } from '@bigbinary/neeto-icons';
8
8
  import * as yup from 'yup';
9
9
  import { Slack } from '@bigbinary/neeto-icons/misc';
10
- import { isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
10
+ import { isNotEmpty, noop as noop$1 } from '@bigbinary/neeto-commons-frontend/pure';
11
11
 
12
12
  function _typeof$2(obj) {
13
13
  "@babel/helpers - typeof";
@@ -153,7 +153,7 @@ function _toArray(arr) {
153
153
  return _arrayWithHoles$2(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableRest$2();
154
154
  }
155
155
 
156
- function ownKeys$4(object, enumerableOnly) {
156
+ function ownKeys$5(object, enumerableOnly) {
157
157
  var keys = Object.keys(object);
158
158
  if (Object.getOwnPropertySymbols) {
159
159
  var symbols = Object.getOwnPropertySymbols(object);
@@ -166,17 +166,17 @@ function ownKeys$4(object, enumerableOnly) {
166
166
  }
167
167
  return keys;
168
168
  }
169
- function _objectSpread$4(target) {
169
+ function _objectSpread$5(target) {
170
170
  for (var i = 1; i < arguments.length; i++) {
171
171
  var source = arguments[i] != null ? arguments[i] : {};
172
172
  if (i % 2) {
173
- ownKeys$4(Object(source), true).forEach(function (key) {
173
+ ownKeys$5(Object(source), true).forEach(function (key) {
174
174
  _defineProperty$2(target, key, source[key]);
175
175
  });
176
176
  } else if (Object.getOwnPropertyDescriptors) {
177
177
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
178
178
  } else {
179
- ownKeys$4(Object(source)).forEach(function (key) {
179
+ ownKeys$5(Object(source)).forEach(function (key) {
180
180
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
181
181
  });
182
182
  }
@@ -260,7 +260,7 @@ var Logger = function () {
260
260
  }, {
261
261
  key: "create",
262
262
  value: function create(moduleName) {
263
- return new Logger(this.logger, _objectSpread$4(_objectSpread$4({}, {
263
+ return new Logger(this.logger, _objectSpread$5(_objectSpread$5({}, {
264
264
  prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
265
265
  }), this.options));
266
266
  }
@@ -1892,7 +1892,7 @@ var Formatter = function () {
1892
1892
  }]);
1893
1893
  return Formatter;
1894
1894
  }();
1895
- function ownKeys$5(object, enumerableOnly) {
1895
+ function ownKeys$5$1(object, enumerableOnly) {
1896
1896
  var keys = Object.keys(object);
1897
1897
  if (Object.getOwnPropertySymbols) {
1898
1898
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1905,17 +1905,17 @@ function ownKeys$5(object, enumerableOnly) {
1905
1905
  }
1906
1906
  return keys;
1907
1907
  }
1908
- function _objectSpread$5(target) {
1908
+ function _objectSpread$5$1(target) {
1909
1909
  for (var i = 1; i < arguments.length; i++) {
1910
1910
  var source = arguments[i] != null ? arguments[i] : {};
1911
1911
  if (i % 2) {
1912
- ownKeys$5(Object(source), true).forEach(function (key) {
1912
+ ownKeys$5$1(Object(source), true).forEach(function (key) {
1913
1913
  _defineProperty$2(target, key, source[key]);
1914
1914
  });
1915
1915
  } else if (Object.getOwnPropertyDescriptors) {
1916
1916
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1917
1917
  } else {
1918
- ownKeys$5(Object(source)).forEach(function (key) {
1918
+ ownKeys$5$1(Object(source)).forEach(function (key) {
1919
1919
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1920
1920
  });
1921
1921
  }
@@ -2132,7 +2132,7 @@ var Connector = function (_EventEmitter) {
2132
2132
  }
2133
2133
  if (key === undefined || key === null || key === '') return;
2134
2134
  if (this.backend && this.backend.create) {
2135
- this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread$5(_objectSpread$5({}, options), {}, {
2135
+ this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread$5$1(_objectSpread$5$1({}, options), {}, {
2136
2136
  isUpdate: isUpdate
2137
2137
  }));
2138
2138
  }
@@ -2775,13 +2775,42 @@ instance.reloadResources;
2775
2775
  instance.use;
2776
2776
  instance.changeLanguage;
2777
2777
  instance.getFixedT;
2778
- var t$1 = instance.t;
2778
+ var t$2 = instance.t;
2779
2779
  instance.exists;
2780
2780
  instance.setDefaultNamespace;
2781
2781
  instance.hasLoadedNamespace;
2782
2782
  instance.loadNamespaces;
2783
2783
  instance.loadLanguages;
2784
2784
 
2785
+ function _objectWithoutPropertiesLoose(source, excluded) {
2786
+ if (source == null) return {};
2787
+ var target = {};
2788
+ var sourceKeys = Object.keys(source);
2789
+ var key, i;
2790
+ for (i = 0; i < sourceKeys.length; i++) {
2791
+ key = sourceKeys[i];
2792
+ if (excluded.indexOf(key) >= 0) continue;
2793
+ target[key] = source[key];
2794
+ }
2795
+ return target;
2796
+ }
2797
+
2798
+ function _objectWithoutProperties(source, excluded) {
2799
+ if (source == null) return {};
2800
+ var target = _objectWithoutPropertiesLoose(source, excluded);
2801
+ var key, i;
2802
+ if (Object.getOwnPropertySymbols) {
2803
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
2804
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
2805
+ key = sourceSymbolKeys[i];
2806
+ if (excluded.indexOf(key) >= 0) continue;
2807
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
2808
+ target[key] = source[key];
2809
+ }
2810
+ }
2811
+ return target;
2812
+ }
2813
+
2785
2814
  function _typeof$1(obj) {
2786
2815
  "@babel/helpers - typeof";
2787
2816
 
@@ -2823,6 +2852,161 @@ function _defineProperty$1(obj, key, value) {
2823
2852
  return obj;
2824
2853
  }
2825
2854
 
2855
+ /**
2856
+ * This file automatically generated from `pre-publish.js`.
2857
+ * Do not manually edit.
2858
+ */
2859
+ var voidElements = {
2860
+ "area": true,
2861
+ "base": true,
2862
+ "br": true,
2863
+ "col": true,
2864
+ "embed": true,
2865
+ "hr": true,
2866
+ "img": true,
2867
+ "input": true,
2868
+ "link": true,
2869
+ "meta": true,
2870
+ "param": true,
2871
+ "source": true,
2872
+ "track": true,
2873
+ "wbr": true
2874
+ };
2875
+
2876
+ var t$1 = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
2877
+ function n$1(n) {
2878
+ var r = {
2879
+ type: "tag",
2880
+ name: "",
2881
+ voidElement: !1,
2882
+ attrs: {},
2883
+ children: []
2884
+ },
2885
+ i = n.match(/<\/?([^\s]+?)[/\s>]/);
2886
+ if (i && (r.name = i[1], (voidElements[i[1]] || "/" === n.charAt(n.length - 2)) && (r.voidElement = !0), r.name.startsWith("!--"))) {
2887
+ var s = n.indexOf("--\x3e");
2888
+ return {
2889
+ type: "comment",
2890
+ comment: -1 !== s ? n.slice(4, s) : ""
2891
+ };
2892
+ }
2893
+ for (var a = new RegExp(t$1), c = null; null !== (c = a.exec(n));) if (c[0].trim()) if (c[1]) {
2894
+ var o = c[1].trim(),
2895
+ l = [o, ""];
2896
+ o.indexOf("=") > -1 && (l = o.split("=")), r.attrs[l[0]] = l[1], a.lastIndex--;
2897
+ } else c[2] && (r.attrs[c[2]] = c[3].trim().substring(1, c[3].length - 1));
2898
+ return r;
2899
+ }
2900
+ var r = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,
2901
+ i = /^\s*$/,
2902
+ s = Object.create(null);
2903
+ function a(e, t) {
2904
+ switch (t.type) {
2905
+ case "text":
2906
+ return e + t.content;
2907
+ case "tag":
2908
+ return e += "<" + t.name + (t.attrs ? function (e) {
2909
+ var t = [];
2910
+ for (var n in e) t.push(n + '="' + e[n] + '"');
2911
+ return t.length ? " " + t.join(" ") : "";
2912
+ }(t.attrs) : "") + (t.voidElement ? "/>" : ">"), t.voidElement ? e : e + t.children.reduce(a, "") + "</" + t.name + ">";
2913
+ case "comment":
2914
+ return e + "\x3c!--" + t.comment + "--\x3e";
2915
+ }
2916
+ }
2917
+ var c = {
2918
+ parse: function parse(e, t) {
2919
+ t || (t = {}), t.components || (t.components = s);
2920
+ var a,
2921
+ c = [],
2922
+ o = [],
2923
+ l = -1,
2924
+ m = !1;
2925
+ if (0 !== e.indexOf("<")) {
2926
+ var u = e.indexOf("<");
2927
+ c.push({
2928
+ type: "text",
2929
+ content: -1 === u ? e : e.substring(0, u)
2930
+ });
2931
+ }
2932
+ return e.replace(r, function (r, s) {
2933
+ if (m) {
2934
+ if (r !== "</" + a.name + ">") return;
2935
+ m = !1;
2936
+ }
2937
+ var u,
2938
+ f = "/" !== r.charAt(1),
2939
+ h = r.startsWith("\x3c!--"),
2940
+ p = s + r.length,
2941
+ d = e.charAt(p);
2942
+ if (h) {
2943
+ var v = n$1(r);
2944
+ return l < 0 ? (c.push(v), c) : ((u = o[l]).children.push(v), c);
2945
+ }
2946
+ if (f && (l++, "tag" === (a = n$1(r)).type && t.components[a.name] && (a.type = "component", m = !0), a.voidElement || m || !d || "<" === d || a.children.push({
2947
+ type: "text",
2948
+ content: e.slice(p, e.indexOf("<", p))
2949
+ }), 0 === l && c.push(a), (u = o[l - 1]) && u.children.push(a), o[l] = a), (!f || a.voidElement) && (l > -1 && (a.voidElement || a.name === r.slice(2, -1)) && (l--, a = -1 === l ? c : o[l]), !m && "<" !== d && d)) {
2950
+ u = -1 === l ? c : o[l].children;
2951
+ var x = e.indexOf("<", p),
2952
+ g = e.slice(p, -1 === x ? void 0 : x);
2953
+ i.test(g) && (g = " "), (x > -1 && l + u.length >= 0 || " " !== g) && u.push({
2954
+ type: "text",
2955
+ content: g
2956
+ });
2957
+ }
2958
+ }), c;
2959
+ },
2960
+ stringify: function stringify(e) {
2961
+ return e.reduce(function (e, t) {
2962
+ return e + a("", t);
2963
+ }, "");
2964
+ }
2965
+ };
2966
+
2967
+ /**
2968
+ * Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection
2969
+ *
2970
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
2971
+ * of this software and associated documentation files (the "Software"), to deal
2972
+ * in the Software without restriction, including without limitation the rights
2973
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2974
+ * copies of the Software, and to permit persons to whom the Software is
2975
+ * furnished to do so, subject to the following conditions:
2976
+ *
2977
+ * The above copyright notice and this permission notice shall be included in
2978
+ * all copies or substantial portions of the Software.
2979
+ *
2980
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2981
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2982
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2983
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2984
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2985
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2986
+ * THE SOFTWARE.
2987
+ */
2988
+
2989
+ var replace = ''.replace;
2990
+ var es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
2991
+ var unes = {
2992
+ '&amp;': '&',
2993
+ '&#38;': '&',
2994
+ '&lt;': '<',
2995
+ '&#60;': '<',
2996
+ '&gt;': '>',
2997
+ '&#62;': '>',
2998
+ '&apos;': "'",
2999
+ '&#39;': "'",
3000
+ '&quot;': '"',
3001
+ '&#34;': '"'
3002
+ };
3003
+ function unescape(un) {
3004
+ return replace.call(un, es, cape);
3005
+ }
3006
+ function cape(m) {
3007
+ return unes[m];
3008
+ }
3009
+
2826
3010
  function _classCallCheck(instance, Constructor) {
2827
3011
  if (!(instance instanceof Constructor)) {
2828
3012
  throw new TypeError("Cannot call a class as a function");
@@ -2847,7 +3031,7 @@ function _createClass(Constructor, protoProps, staticProps) {
2847
3031
  return Constructor;
2848
3032
  }
2849
3033
 
2850
- function ownKeys$3(object, enumerableOnly) {
3034
+ function ownKeys$4(object, enumerableOnly) {
2851
3035
  var keys = Object.keys(object);
2852
3036
  if (Object.getOwnPropertySymbols) {
2853
3037
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2860,17 +3044,17 @@ function ownKeys$3(object, enumerableOnly) {
2860
3044
  }
2861
3045
  return keys;
2862
3046
  }
2863
- function _objectSpread$3(target) {
3047
+ function _objectSpread$4(target) {
2864
3048
  for (var i = 1; i < arguments.length; i++) {
2865
3049
  var source = arguments[i] != null ? arguments[i] : {};
2866
3050
  if (i % 2) {
2867
- ownKeys$3(Object(source), true).forEach(function (key) {
3051
+ ownKeys$4(Object(source), true).forEach(function (key) {
2868
3052
  _defineProperty$1(target, key, source[key]);
2869
3053
  });
2870
3054
  } else if (Object.getOwnPropertyDescriptors) {
2871
3055
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2872
3056
  } else {
2873
- ownKeys$3(Object(source)).forEach(function (key) {
3057
+ ownKeys$4(Object(source)).forEach(function (key) {
2874
3058
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2875
3059
  });
2876
3060
  }
@@ -2890,7 +3074,7 @@ var i18nInstance;
2890
3074
  var I18nContext = /*#__PURE__*/React__default.createContext();
2891
3075
  function setDefaults() {
2892
3076
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2893
- defaultOptions = _objectSpread$3(_objectSpread$3({}, defaultOptions), options);
3077
+ defaultOptions = _objectSpread$4(_objectSpread$4({}, defaultOptions), options);
2894
3078
  }
2895
3079
  function getDefaults() {
2896
3080
  return defaultOptions;
@@ -2997,6 +3181,263 @@ function hasLoadedNamespace(ns, i18n) {
2997
3181
  });
2998
3182
  }
2999
3183
 
3184
+ var _excluded = ["format"],
3185
+ _excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
3186
+ function ownKeys$3(object, enumerableOnly) {
3187
+ var keys = Object.keys(object);
3188
+ if (Object.getOwnPropertySymbols) {
3189
+ var symbols = Object.getOwnPropertySymbols(object);
3190
+ if (enumerableOnly) {
3191
+ symbols = symbols.filter(function (sym) {
3192
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
3193
+ });
3194
+ }
3195
+ keys.push.apply(keys, symbols);
3196
+ }
3197
+ return keys;
3198
+ }
3199
+ function _objectSpread$3(target) {
3200
+ for (var i = 1; i < arguments.length; i++) {
3201
+ var source = arguments[i] != null ? arguments[i] : {};
3202
+ if (i % 2) {
3203
+ ownKeys$3(Object(source), true).forEach(function (key) {
3204
+ _defineProperty$1(target, key, source[key]);
3205
+ });
3206
+ } else if (Object.getOwnPropertyDescriptors) {
3207
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3208
+ } else {
3209
+ ownKeys$3(Object(source)).forEach(function (key) {
3210
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3211
+ });
3212
+ }
3213
+ }
3214
+ return target;
3215
+ }
3216
+ function hasChildren(node, checkLength) {
3217
+ if (!node) return false;
3218
+ var base = node.props ? node.props.children : node.children;
3219
+ if (checkLength) return base.length > 0;
3220
+ return !!base;
3221
+ }
3222
+ function getChildren(node) {
3223
+ if (!node) return [];
3224
+ return node && node.children ? node.children : node.props && node.props.children;
3225
+ }
3226
+ function hasValidReactChildren(children) {
3227
+ if (Object.prototype.toString.call(children) !== '[object Array]') return false;
3228
+ return children.every(function (child) {
3229
+ return /*#__PURE__*/React__default.isValidElement(child);
3230
+ });
3231
+ }
3232
+ function getAsArray(data) {
3233
+ return Array.isArray(data) ? data : [data];
3234
+ }
3235
+ function mergeProps(source, target) {
3236
+ var newTarget = _objectSpread$3({}, target);
3237
+ newTarget.props = Object.assign(source.props, target.props);
3238
+ return newTarget;
3239
+ }
3240
+ function nodesToString(children, i18nOptions) {
3241
+ if (!children) return '';
3242
+ var stringNode = '';
3243
+ var childrenArray = getAsArray(children);
3244
+ var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
3245
+ childrenArray.forEach(function (child, childIndex) {
3246
+ if (typeof child === 'string') {
3247
+ stringNode += "".concat(child);
3248
+ } else if ( /*#__PURE__*/React__default.isValidElement(child)) {
3249
+ var childPropsCount = Object.keys(child.props).length;
3250
+ var shouldKeepChild = keepArray.indexOf(child.type) > -1;
3251
+ var childChildren = child.props.children;
3252
+ if (!childChildren && shouldKeepChild && childPropsCount === 0) {
3253
+ stringNode += "<".concat(child.type, "/>");
3254
+ } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
3255
+ stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
3256
+ } else if (child.props.i18nIsDynamicList) {
3257
+ stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
3258
+ } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
3259
+ stringNode += "<".concat(child.type, ">").concat(childChildren, "</").concat(child.type, ">");
3260
+ } else {
3261
+ var content = nodesToString(childChildren, i18nOptions);
3262
+ stringNode += "<".concat(childIndex, ">").concat(content, "</").concat(childIndex, ">");
3263
+ }
3264
+ } else if (child === null) {
3265
+ warn("Trans: the passed in value is invalid - seems you passed in a null child.");
3266
+ } else if (_typeof$1(child) === 'object') {
3267
+ var format = child.format,
3268
+ clone = _objectWithoutProperties(child, _excluded);
3269
+ var keys = Object.keys(clone);
3270
+ if (keys.length === 1) {
3271
+ var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
3272
+ stringNode += "{{".concat(value, "}}");
3273
+ } else {
3274
+ warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.", child);
3275
+ }
3276
+ } else {
3277
+ warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.", child);
3278
+ }
3279
+ });
3280
+ return stringNode;
3281
+ }
3282
+ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
3283
+ if (targetString === '') return [];
3284
+ var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
3285
+ var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
3286
+ if (!children && !emptyChildrenButNeedsHandling) return [targetString];
3287
+ var data = {};
3288
+ function getData(childs) {
3289
+ var childrenArray = getAsArray(childs);
3290
+ childrenArray.forEach(function (child) {
3291
+ if (typeof child === 'string') return;
3292
+ if (hasChildren(child)) getData(getChildren(child));else if (_typeof$1(child) === 'object' && ! /*#__PURE__*/React__default.isValidElement(child)) Object.assign(data, child);
3293
+ });
3294
+ }
3295
+ getData(children);
3296
+ var ast = c.parse("<0>".concat(targetString, "</0>"));
3297
+ var opts = _objectSpread$3(_objectSpread$3({}, data), combinedTOpts);
3298
+ function renderInner(child, node, rootReactNode) {
3299
+ var childs = getChildren(child);
3300
+ var mappedChildren = mapAST(childs, node.children, rootReactNode);
3301
+ return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
3302
+ }
3303
+ function pushTranslatedJSX(child, inner, mem, i, isVoid) {
3304
+ if (child.dummy) child.children = inner;
3305
+ mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3306
+ key: i
3307
+ }), isVoid ? undefined : inner));
3308
+ }
3309
+ function mapAST(reactNode, astNode, rootReactNode) {
3310
+ var reactNodes = getAsArray(reactNode);
3311
+ var astNodes = getAsArray(astNode);
3312
+ return astNodes.reduce(function (mem, node, i) {
3313
+ var translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
3314
+ if (node.type === 'tag') {
3315
+ var tmp = reactNodes[parseInt(node.name, 10)];
3316
+ if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
3317
+ if (!tmp) tmp = {};
3318
+ var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
3319
+ props: node.attrs
3320
+ }, tmp) : tmp;
3321
+ var isElement = /*#__PURE__*/React__default.isValidElement(child);
3322
+ var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
3323
+ var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof$1(child) === 'object' && child.dummy && !isElement;
3324
+ var isKnownComponent = _typeof$1(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
3325
+ if (typeof child === 'string') {
3326
+ var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
3327
+ mem.push(value);
3328
+ } else if (hasChildren(child) || isValidTranslationWithChildren) {
3329
+ var inner = renderInner(child, node, rootReactNode);
3330
+ pushTranslatedJSX(child, inner, mem, i);
3331
+ } else if (isEmptyTransWithHTML) {
3332
+ var _inner = mapAST(reactNodes, node.children, rootReactNode);
3333
+ mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3334
+ key: i
3335
+ }), _inner));
3336
+ } else if (Number.isNaN(parseFloat(node.name))) {
3337
+ if (isKnownComponent) {
3338
+ var _inner2 = renderInner(child, node, rootReactNode);
3339
+ pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
3340
+ } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
3341
+ if (node.voidElement) {
3342
+ mem.push( /*#__PURE__*/React__default.createElement(node.name, {
3343
+ key: "".concat(node.name, "-").concat(i)
3344
+ }));
3345
+ } else {
3346
+ var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
3347
+ mem.push( /*#__PURE__*/React__default.createElement(node.name, {
3348
+ key: "".concat(node.name, "-").concat(i)
3349
+ }, _inner3));
3350
+ }
3351
+ } else if (node.voidElement) {
3352
+ mem.push("<".concat(node.name, " />"));
3353
+ } else {
3354
+ var _inner4 = mapAST(reactNodes, node.children, rootReactNode);
3355
+ mem.push("<".concat(node.name, ">").concat(_inner4, "</").concat(node.name, ">"));
3356
+ }
3357
+ } else if (_typeof$1(child) === 'object' && !isElement) {
3358
+ var content = node.children[0] ? translationContent : null;
3359
+ if (content) mem.push(content);
3360
+ } else if (node.children.length === 1 && translationContent) {
3361
+ mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3362
+ key: i
3363
+ }), translationContent));
3364
+ } else {
3365
+ mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3366
+ key: i
3367
+ })));
3368
+ }
3369
+ } else if (node.type === 'text') {
3370
+ var wrapTextNodes = i18nOptions.transWrapTextNodes;
3371
+ var _content = shouldUnescape ? unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
3372
+ if (wrapTextNodes) {
3373
+ mem.push( /*#__PURE__*/React__default.createElement(wrapTextNodes, {
3374
+ key: "".concat(node.name, "-").concat(i)
3375
+ }, _content));
3376
+ } else {
3377
+ mem.push(_content);
3378
+ }
3379
+ }
3380
+ return mem;
3381
+ }, []);
3382
+ }
3383
+ var result = mapAST([{
3384
+ dummy: true,
3385
+ children: children || []
3386
+ }], ast, getAsArray(children || []));
3387
+ return getChildren(result[0]);
3388
+ }
3389
+ function Trans(_ref) {
3390
+ var children = _ref.children,
3391
+ count = _ref.count,
3392
+ parent = _ref.parent,
3393
+ i18nKey = _ref.i18nKey,
3394
+ context = _ref.context,
3395
+ _ref$tOptions = _ref.tOptions,
3396
+ tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
3397
+ values = _ref.values,
3398
+ defaults = _ref.defaults,
3399
+ components = _ref.components,
3400
+ ns = _ref.ns,
3401
+ i18nFromProps = _ref.i18n,
3402
+ tFromProps = _ref.t,
3403
+ shouldUnescape = _ref.shouldUnescape,
3404
+ additionalProps = _objectWithoutProperties(_ref, _excluded2);
3405
+ var _ref2 = useContext(I18nContext) || {},
3406
+ i18nFromContext = _ref2.i18n,
3407
+ defaultNSFromContext = _ref2.defaultNS;
3408
+ var i18n = i18nFromProps || i18nFromContext || getI18n();
3409
+ if (!i18n) {
3410
+ warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
3411
+ return children;
3412
+ }
3413
+ var t = tFromProps || i18n.t.bind(i18n) || function (k) {
3414
+ return k;
3415
+ };
3416
+ if (context) tOptions.context = context;
3417
+ var reactI18nextOptions = _objectSpread$3(_objectSpread$3({}, getDefaults()), i18n.options && i18n.options.react);
3418
+ var namespaces = ns || t.ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
3419
+ namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
3420
+ var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
3421
+ var hashTransKey = reactI18nextOptions.hashTransKey;
3422
+ var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
3423
+ var interpolationOverride = values ? tOptions.interpolation : {
3424
+ interpolation: _objectSpread$3(_objectSpread$3({}, tOptions.interpolation), {}, {
3425
+ prefix: '#$?',
3426
+ suffix: '?$#'
3427
+ })
3428
+ };
3429
+ var combinedTOpts = _objectSpread$3(_objectSpread$3(_objectSpread$3(_objectSpread$3({}, tOptions), {}, {
3430
+ count: count
3431
+ }, values), interpolationOverride), {}, {
3432
+ defaultValue: defaultValue,
3433
+ ns: namespaces
3434
+ });
3435
+ var translation = key ? t(key, combinedTOpts) : defaultValue;
3436
+ var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
3437
+ var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
3438
+ return useAsParent ? /*#__PURE__*/React__default.createElement(useAsParent, additionalProps, content) : content;
3439
+ }
3440
+
3000
3441
  function _arrayWithHoles$1(arr) {
3001
3442
  if (Array.isArray(arr)) return arr;
3002
3443
  }
@@ -3186,13 +3627,14 @@ var slack = {
3186
3627
  loginButton: "Login to Slack"
3187
3628
  },
3188
3629
  configure: {
3630
+ title: "You are connecting to <br/><strong>{{teamName}}</strong> workspace <br/>({{slackUrl}}).",
3189
3631
  sendTo: "Send to",
3190
- sendToDescription: "Choose a Slack channel or contact to send the notifications",
3632
+ sendToDescription: "Choose a Slack channel to send the notifications",
3191
3633
  updateType: "Update type",
3192
3634
  refreshSlackChannelList: "Refresh Slack channel list"
3193
3635
  },
3194
3636
  finish: {
3195
- title: "Slack successfully connected",
3637
+ title: "Slack successfully connected to <br/><strong>{{teamName}}</strong> workspace.",
3196
3638
  account: "Account",
3197
3639
  channel: "Channel"
3198
3640
  }
@@ -3336,8 +3778,8 @@ var SlackRefreshChannelListButton$1 = /*#__PURE__*/React__default.memo(SlackRefr
3336
3778
  var CHANNEL_NAME_VALIDAITON_SCHEMA = {
3337
3779
  selectedChannel: yup.object().shape({
3338
3780
  label: yup.string(),
3339
- value: yup.string().required(t$1("common.required", {
3340
- entity: t$1("slack.channelName")
3781
+ value: yup.string().required(t$2("common.required", {
3782
+ entity: t$2("slack.channelName")
3341
3783
  }))
3342
3784
  }).required().nullable()
3343
3785
  };
@@ -3441,22 +3883,25 @@ var Configure = function Configure(_ref) {
3441
3883
  isSubmitting = _ref.isSubmitting,
3442
3884
  className = _ref.className,
3443
3885
  validationSchema = _ref.validationSchema,
3444
- channelRefreshHandler = _ref.channelRefreshHandler;
3886
+ channelRefreshHandler = _ref.channelRefreshHandler,
3887
+ _ref$channelSelectLab = _ref.channelSelectLabel,
3888
+ channelSelectLabel = _ref$channelSelectLab === void 0 ? "" : _ref$channelSelectLab;
3445
3889
  var _useTranslation = useTranslation(),
3446
3890
  t = _useTranslation.t;
3447
3891
  return /*#__PURE__*/React__default.createElement("div", {
3448
- className: classNames("neeto-ui-w-full neeto-ui-space-y-6 mx-auto max-w-lg", className)
3892
+ className: classNames("neeto-ui-w-full neeto-ui-space-y-6 mx-auto max-w-md", className)
3449
3893
  }, /*#__PURE__*/React__default.createElement("div", {
3450
- className: "neeto-ui-w-full neeto-ui-mb-3"
3894
+ className: "neeto-ui-mb-6 neeto-ui-w-full"
3451
3895
  }, /*#__PURE__*/React__default.createElement(Typography, {
3452
- className: "neeto-ui-text-gray-800 neeto-ui-mb-0.5",
3453
- style: "h3",
3454
- weight: "semibold"
3455
- }, teamName), /*#__PURE__*/React__default.createElement(Typography, {
3456
- className: "neeto-ui-text-gray-600",
3457
- style: "body1",
3458
- weight: "normal"
3459
- }, toSlackUrl(teamName))), /*#__PURE__*/React__default.createElement(Form, {
3896
+ style: "h3"
3897
+ }, /*#__PURE__*/React__default.createElement(Trans, {
3898
+ i18nKey: "slack.configure.title",
3899
+ values: {
3900
+ teamName: teamName,
3901
+ slackUrl: toSlackUrl(teamName)
3902
+ }
3903
+ }))), /*#__PURE__*/React__default.createElement(Form, {
3904
+ className: "neeto-ui-w-full",
3460
3905
  formikProps: {
3461
3906
  enableReinitialize: true,
3462
3907
  initialValues: initialFormValues,
@@ -3466,13 +3911,11 @@ var Configure = function Configure(_ref) {
3466
3911
  }, function (formikProps) {
3467
3912
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
3468
3913
  className: "neeto-ui-mb-4 neeto-ui-w-full"
3469
- }, /*#__PURE__*/React__default.createElement(Label, {
3470
- className: "neeto-ui-text-gray-800 neeto-ui-mb-0.5 neeto-ui-text-base neeto-ui-font-semibold"
3471
- }, t("slack.configure.sendTo")), /*#__PURE__*/React__default.createElement(Typography, {
3914
+ }, /*#__PURE__*/React__default.createElement(Typography, {
3472
3915
  className: "neeto-ui-text-gray-700 neeto-ui-mb-3",
3473
3916
  style: "body2",
3474
3917
  weight: "normal"
3475
- }, t("slack.configure.sendToDescription")), /*#__PURE__*/React__default.createElement("div", {
3918
+ }, isEmpty(channelSelectLabel) ? t("slack.configure.sendToDescription") : channelSelectLabel), /*#__PURE__*/React__default.createElement("div", {
3476
3919
  className: "relative flex"
3477
3920
  }, /*#__PURE__*/React__default.createElement(Select, {
3478
3921
  isSearchable: true,
@@ -3575,10 +4018,14 @@ var Field = function Field(_ref) {
3575
4018
 
3576
4019
  var Finish = function Finish(_ref) {
3577
4020
  var children = _ref.children,
3578
- teamName = _ref.teamName,
3579
- selectedChannel = _ref.selectedChannel,
3580
- _ref$otherFields = _ref.otherFields,
3581
- otherFields = _ref$otherFields === void 0 ? [] : _ref$otherFields,
4021
+ _ref$teamName = _ref.teamName,
4022
+ teamName = _ref$teamName === void 0 ? "" : _ref$teamName,
4023
+ _ref$fields = _ref.fields,
4024
+ fields = _ref$fields === void 0 ? [] : _ref$fields,
4025
+ _ref$onSuccess = _ref.onSuccess,
4026
+ onSuccess = _ref$onSuccess === void 0 ? noop$1 : _ref$onSuccess,
4027
+ _ref$onBack = _ref.onBack,
4028
+ onBack = _ref$onBack === void 0 ? noop$1 : _ref$onBack,
3582
4029
  _ref$buttonProps = _ref.buttonProps,
3583
4030
  buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
3584
4031
  _ref$secondaryButtonP = _ref.secondaryButtonProps,
@@ -3591,29 +4038,31 @@ var Finish = function Finish(_ref) {
3591
4038
  className: "neeto-ui-text-gray-800 neeto-ui-mb-6 neeto-ui-mt-4",
3592
4039
  style: "h3",
3593
4040
  weight: "bold"
3594
- }, t("slack.finish.title")), /*#__PURE__*/React__default.createElement(Field, {
3595
- name: t("slack.finish.account"),
3596
- value: toSlackUrl(teamName)
3597
- }), /*#__PURE__*/React__default.createElement(Field, {
3598
- className: "neeto-ui-pt-3 neeto-ui-border-gray-300 border-t",
3599
- name: t("slack.finish.channel"),
3600
- value: selectedChannel
3601
- }), isNotEmpty(otherFields) && otherFields.map(function (field) {
4041
+ }, /*#__PURE__*/React__default.createElement(Trans, {
4042
+ i18nKey: "slack.finish.title",
4043
+ values: {
4044
+ teamName: teamName
4045
+ }
4046
+ })), isNotEmpty(fields) && fields.map(function (field, index) {
3602
4047
  return /*#__PURE__*/React__default.createElement(Field, {
3603
- className: "neeto-ui-pt-3 neeto-ui-border-gray-300 border-t",
3604
4048
  key: field.name,
3605
4049
  name: field.name,
3606
- value: field.value
4050
+ value: field.value,
4051
+ className: classNames("neeto-ui-pt-3 neeto-ui-border-gray-300", {
4052
+ "border-t": index !== 0
4053
+ })
3607
4054
  });
3608
4055
  }), children, /*#__PURE__*/React__default.createElement("div", {
3609
4056
  className: "neeto-ui-flex neeto-ui-w-full neeto-ui-flex-row neeto-ui-mt-6"
3610
4057
  }, /*#__PURE__*/React__default.createElement(Button, _extends$1({
3611
4058
  className: "neeto-ui-my-1",
3612
- label: t("slack.steps.finish")
4059
+ label: t("slack.steps.finish"),
4060
+ onClick: onSuccess
3613
4061
  }, buttonProps)), isNotEmpty(secondaryButtonProps) && /*#__PURE__*/React__default.createElement(Button, _extends$1({
3614
4062
  className: "neeto-ui-my-1 neeto-ui-ml-2",
3615
4063
  label: t("common.edit"),
3616
- style: "secondary"
4064
+ style: "secondary",
4065
+ onClick: onBack
3617
4066
  }, secondaryButtonProps))));
3618
4067
  };
3619
4068