@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.cjs.js CHANGED
@@ -181,7 +181,7 @@ function _toArray(arr) {
181
181
  return _arrayWithHoles$2(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableRest$2();
182
182
  }
183
183
 
184
- function ownKeys$4(object, enumerableOnly) {
184
+ function ownKeys$5(object, enumerableOnly) {
185
185
  var keys = Object.keys(object);
186
186
  if (Object.getOwnPropertySymbols) {
187
187
  var symbols = Object.getOwnPropertySymbols(object);
@@ -194,17 +194,17 @@ function ownKeys$4(object, enumerableOnly) {
194
194
  }
195
195
  return keys;
196
196
  }
197
- function _objectSpread$4(target) {
197
+ function _objectSpread$5(target) {
198
198
  for (var i = 1; i < arguments.length; i++) {
199
199
  var source = arguments[i] != null ? arguments[i] : {};
200
200
  if (i % 2) {
201
- ownKeys$4(Object(source), true).forEach(function (key) {
201
+ ownKeys$5(Object(source), true).forEach(function (key) {
202
202
  _defineProperty$2(target, key, source[key]);
203
203
  });
204
204
  } else if (Object.getOwnPropertyDescriptors) {
205
205
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
206
206
  } else {
207
- ownKeys$4(Object(source)).forEach(function (key) {
207
+ ownKeys$5(Object(source)).forEach(function (key) {
208
208
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
209
209
  });
210
210
  }
@@ -288,7 +288,7 @@ var Logger = function () {
288
288
  }, {
289
289
  key: "create",
290
290
  value: function create(moduleName) {
291
- return new Logger(this.logger, _objectSpread$4(_objectSpread$4({}, {
291
+ return new Logger(this.logger, _objectSpread$5(_objectSpread$5({}, {
292
292
  prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
293
293
  }), this.options));
294
294
  }
@@ -1920,7 +1920,7 @@ var Formatter = function () {
1920
1920
  }]);
1921
1921
  return Formatter;
1922
1922
  }();
1923
- function ownKeys$5(object, enumerableOnly) {
1923
+ function ownKeys$5$1(object, enumerableOnly) {
1924
1924
  var keys = Object.keys(object);
1925
1925
  if (Object.getOwnPropertySymbols) {
1926
1926
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1933,17 +1933,17 @@ function ownKeys$5(object, enumerableOnly) {
1933
1933
  }
1934
1934
  return keys;
1935
1935
  }
1936
- function _objectSpread$5(target) {
1936
+ function _objectSpread$5$1(target) {
1937
1937
  for (var i = 1; i < arguments.length; i++) {
1938
1938
  var source = arguments[i] != null ? arguments[i] : {};
1939
1939
  if (i % 2) {
1940
- ownKeys$5(Object(source), true).forEach(function (key) {
1940
+ ownKeys$5$1(Object(source), true).forEach(function (key) {
1941
1941
  _defineProperty$2(target, key, source[key]);
1942
1942
  });
1943
1943
  } else if (Object.getOwnPropertyDescriptors) {
1944
1944
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1945
1945
  } else {
1946
- ownKeys$5(Object(source)).forEach(function (key) {
1946
+ ownKeys$5$1(Object(source)).forEach(function (key) {
1947
1947
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1948
1948
  });
1949
1949
  }
@@ -2160,7 +2160,7 @@ var Connector = function (_EventEmitter) {
2160
2160
  }
2161
2161
  if (key === undefined || key === null || key === '') return;
2162
2162
  if (this.backend && this.backend.create) {
2163
- this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread$5(_objectSpread$5({}, options), {}, {
2163
+ this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread$5$1(_objectSpread$5$1({}, options), {}, {
2164
2164
  isUpdate: isUpdate
2165
2165
  }));
2166
2166
  }
@@ -2803,13 +2803,42 @@ instance.reloadResources;
2803
2803
  instance.use;
2804
2804
  instance.changeLanguage;
2805
2805
  instance.getFixedT;
2806
- var t$1 = instance.t;
2806
+ var t$2 = instance.t;
2807
2807
  instance.exists;
2808
2808
  instance.setDefaultNamespace;
2809
2809
  instance.hasLoadedNamespace;
2810
2810
  instance.loadNamespaces;
2811
2811
  instance.loadLanguages;
2812
2812
 
2813
+ function _objectWithoutPropertiesLoose(source, excluded) {
2814
+ if (source == null) return {};
2815
+ var target = {};
2816
+ var sourceKeys = Object.keys(source);
2817
+ var key, i;
2818
+ for (i = 0; i < sourceKeys.length; i++) {
2819
+ key = sourceKeys[i];
2820
+ if (excluded.indexOf(key) >= 0) continue;
2821
+ target[key] = source[key];
2822
+ }
2823
+ return target;
2824
+ }
2825
+
2826
+ function _objectWithoutProperties(source, excluded) {
2827
+ if (source == null) return {};
2828
+ var target = _objectWithoutPropertiesLoose(source, excluded);
2829
+ var key, i;
2830
+ if (Object.getOwnPropertySymbols) {
2831
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
2832
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
2833
+ key = sourceSymbolKeys[i];
2834
+ if (excluded.indexOf(key) >= 0) continue;
2835
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
2836
+ target[key] = source[key];
2837
+ }
2838
+ }
2839
+ return target;
2840
+ }
2841
+
2813
2842
  function _typeof$1(obj) {
2814
2843
  "@babel/helpers - typeof";
2815
2844
 
@@ -2851,6 +2880,161 @@ function _defineProperty$1(obj, key, value) {
2851
2880
  return obj;
2852
2881
  }
2853
2882
 
2883
+ /**
2884
+ * This file automatically generated from `pre-publish.js`.
2885
+ * Do not manually edit.
2886
+ */
2887
+ var voidElements = {
2888
+ "area": true,
2889
+ "base": true,
2890
+ "br": true,
2891
+ "col": true,
2892
+ "embed": true,
2893
+ "hr": true,
2894
+ "img": true,
2895
+ "input": true,
2896
+ "link": true,
2897
+ "meta": true,
2898
+ "param": true,
2899
+ "source": true,
2900
+ "track": true,
2901
+ "wbr": true
2902
+ };
2903
+
2904
+ var t$1 = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
2905
+ function n$1(n) {
2906
+ var r = {
2907
+ type: "tag",
2908
+ name: "",
2909
+ voidElement: !1,
2910
+ attrs: {},
2911
+ children: []
2912
+ },
2913
+ i = n.match(/<\/?([^\s]+?)[/\s>]/);
2914
+ if (i && (r.name = i[1], (voidElements[i[1]] || "/" === n.charAt(n.length - 2)) && (r.voidElement = !0), r.name.startsWith("!--"))) {
2915
+ var s = n.indexOf("--\x3e");
2916
+ return {
2917
+ type: "comment",
2918
+ comment: -1 !== s ? n.slice(4, s) : ""
2919
+ };
2920
+ }
2921
+ for (var a = new RegExp(t$1), c = null; null !== (c = a.exec(n));) if (c[0].trim()) if (c[1]) {
2922
+ var o = c[1].trim(),
2923
+ l = [o, ""];
2924
+ o.indexOf("=") > -1 && (l = o.split("=")), r.attrs[l[0]] = l[1], a.lastIndex--;
2925
+ } else c[2] && (r.attrs[c[2]] = c[3].trim().substring(1, c[3].length - 1));
2926
+ return r;
2927
+ }
2928
+ var r = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,
2929
+ i = /^\s*$/,
2930
+ s = Object.create(null);
2931
+ function a(e, t) {
2932
+ switch (t.type) {
2933
+ case "text":
2934
+ return e + t.content;
2935
+ case "tag":
2936
+ return e += "<" + t.name + (t.attrs ? function (e) {
2937
+ var t = [];
2938
+ for (var n in e) t.push(n + '="' + e[n] + '"');
2939
+ return t.length ? " " + t.join(" ") : "";
2940
+ }(t.attrs) : "") + (t.voidElement ? "/>" : ">"), t.voidElement ? e : e + t.children.reduce(a, "") + "</" + t.name + ">";
2941
+ case "comment":
2942
+ return e + "\x3c!--" + t.comment + "--\x3e";
2943
+ }
2944
+ }
2945
+ var c = {
2946
+ parse: function parse(e, t) {
2947
+ t || (t = {}), t.components || (t.components = s);
2948
+ var a,
2949
+ c = [],
2950
+ o = [],
2951
+ l = -1,
2952
+ m = !1;
2953
+ if (0 !== e.indexOf("<")) {
2954
+ var u = e.indexOf("<");
2955
+ c.push({
2956
+ type: "text",
2957
+ content: -1 === u ? e : e.substring(0, u)
2958
+ });
2959
+ }
2960
+ return e.replace(r, function (r, s) {
2961
+ if (m) {
2962
+ if (r !== "</" + a.name + ">") return;
2963
+ m = !1;
2964
+ }
2965
+ var u,
2966
+ f = "/" !== r.charAt(1),
2967
+ h = r.startsWith("\x3c!--"),
2968
+ p = s + r.length,
2969
+ d = e.charAt(p);
2970
+ if (h) {
2971
+ var v = n$1(r);
2972
+ return l < 0 ? (c.push(v), c) : ((u = o[l]).children.push(v), c);
2973
+ }
2974
+ 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({
2975
+ type: "text",
2976
+ content: e.slice(p, e.indexOf("<", p))
2977
+ }), 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)) {
2978
+ u = -1 === l ? c : o[l].children;
2979
+ var x = e.indexOf("<", p),
2980
+ g = e.slice(p, -1 === x ? void 0 : x);
2981
+ i.test(g) && (g = " "), (x > -1 && l + u.length >= 0 || " " !== g) && u.push({
2982
+ type: "text",
2983
+ content: g
2984
+ });
2985
+ }
2986
+ }), c;
2987
+ },
2988
+ stringify: function stringify(e) {
2989
+ return e.reduce(function (e, t) {
2990
+ return e + a("", t);
2991
+ }, "");
2992
+ }
2993
+ };
2994
+
2995
+ /**
2996
+ * Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection
2997
+ *
2998
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
2999
+ * of this software and associated documentation files (the "Software"), to deal
3000
+ * in the Software without restriction, including without limitation the rights
3001
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3002
+ * copies of the Software, and to permit persons to whom the Software is
3003
+ * furnished to do so, subject to the following conditions:
3004
+ *
3005
+ * The above copyright notice and this permission notice shall be included in
3006
+ * all copies or substantial portions of the Software.
3007
+ *
3008
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3009
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3010
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3011
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3012
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3013
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3014
+ * THE SOFTWARE.
3015
+ */
3016
+
3017
+ var replace = ''.replace;
3018
+ var es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
3019
+ var unes = {
3020
+ '&amp;': '&',
3021
+ '&#38;': '&',
3022
+ '&lt;': '<',
3023
+ '&#60;': '<',
3024
+ '&gt;': '>',
3025
+ '&#62;': '>',
3026
+ '&apos;': "'",
3027
+ '&#39;': "'",
3028
+ '&quot;': '"',
3029
+ '&#34;': '"'
3030
+ };
3031
+ function unescape(un) {
3032
+ return replace.call(un, es, cape);
3033
+ }
3034
+ function cape(m) {
3035
+ return unes[m];
3036
+ }
3037
+
2854
3038
  function _classCallCheck(instance, Constructor) {
2855
3039
  if (!(instance instanceof Constructor)) {
2856
3040
  throw new TypeError("Cannot call a class as a function");
@@ -2875,7 +3059,7 @@ function _createClass(Constructor, protoProps, staticProps) {
2875
3059
  return Constructor;
2876
3060
  }
2877
3061
 
2878
- function ownKeys$3(object, enumerableOnly) {
3062
+ function ownKeys$4(object, enumerableOnly) {
2879
3063
  var keys = Object.keys(object);
2880
3064
  if (Object.getOwnPropertySymbols) {
2881
3065
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2888,17 +3072,17 @@ function ownKeys$3(object, enumerableOnly) {
2888
3072
  }
2889
3073
  return keys;
2890
3074
  }
2891
- function _objectSpread$3(target) {
3075
+ function _objectSpread$4(target) {
2892
3076
  for (var i = 1; i < arguments.length; i++) {
2893
3077
  var source = arguments[i] != null ? arguments[i] : {};
2894
3078
  if (i % 2) {
2895
- ownKeys$3(Object(source), true).forEach(function (key) {
3079
+ ownKeys$4(Object(source), true).forEach(function (key) {
2896
3080
  _defineProperty$1(target, key, source[key]);
2897
3081
  });
2898
3082
  } else if (Object.getOwnPropertyDescriptors) {
2899
3083
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2900
3084
  } else {
2901
- ownKeys$3(Object(source)).forEach(function (key) {
3085
+ ownKeys$4(Object(source)).forEach(function (key) {
2902
3086
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2903
3087
  });
2904
3088
  }
@@ -2918,7 +3102,7 @@ var i18nInstance;
2918
3102
  var I18nContext = /*#__PURE__*/React__default["default"].createContext();
2919
3103
  function setDefaults() {
2920
3104
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2921
- defaultOptions = _objectSpread$3(_objectSpread$3({}, defaultOptions), options);
3105
+ defaultOptions = _objectSpread$4(_objectSpread$4({}, defaultOptions), options);
2922
3106
  }
2923
3107
  function getDefaults() {
2924
3108
  return defaultOptions;
@@ -3025,6 +3209,263 @@ function hasLoadedNamespace(ns, i18n) {
3025
3209
  });
3026
3210
  }
3027
3211
 
3212
+ var _excluded = ["format"],
3213
+ _excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
3214
+ function ownKeys$3(object, enumerableOnly) {
3215
+ var keys = Object.keys(object);
3216
+ if (Object.getOwnPropertySymbols) {
3217
+ var symbols = Object.getOwnPropertySymbols(object);
3218
+ if (enumerableOnly) {
3219
+ symbols = symbols.filter(function (sym) {
3220
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
3221
+ });
3222
+ }
3223
+ keys.push.apply(keys, symbols);
3224
+ }
3225
+ return keys;
3226
+ }
3227
+ function _objectSpread$3(target) {
3228
+ for (var i = 1; i < arguments.length; i++) {
3229
+ var source = arguments[i] != null ? arguments[i] : {};
3230
+ if (i % 2) {
3231
+ ownKeys$3(Object(source), true).forEach(function (key) {
3232
+ _defineProperty$1(target, key, source[key]);
3233
+ });
3234
+ } else if (Object.getOwnPropertyDescriptors) {
3235
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3236
+ } else {
3237
+ ownKeys$3(Object(source)).forEach(function (key) {
3238
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3239
+ });
3240
+ }
3241
+ }
3242
+ return target;
3243
+ }
3244
+ function hasChildren(node, checkLength) {
3245
+ if (!node) return false;
3246
+ var base = node.props ? node.props.children : node.children;
3247
+ if (checkLength) return base.length > 0;
3248
+ return !!base;
3249
+ }
3250
+ function getChildren(node) {
3251
+ if (!node) return [];
3252
+ return node && node.children ? node.children : node.props && node.props.children;
3253
+ }
3254
+ function hasValidReactChildren(children) {
3255
+ if (Object.prototype.toString.call(children) !== '[object Array]') return false;
3256
+ return children.every(function (child) {
3257
+ return /*#__PURE__*/React__default["default"].isValidElement(child);
3258
+ });
3259
+ }
3260
+ function getAsArray(data) {
3261
+ return Array.isArray(data) ? data : [data];
3262
+ }
3263
+ function mergeProps(source, target) {
3264
+ var newTarget = _objectSpread$3({}, target);
3265
+ newTarget.props = Object.assign(source.props, target.props);
3266
+ return newTarget;
3267
+ }
3268
+ function nodesToString(children, i18nOptions) {
3269
+ if (!children) return '';
3270
+ var stringNode = '';
3271
+ var childrenArray = getAsArray(children);
3272
+ var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
3273
+ childrenArray.forEach(function (child, childIndex) {
3274
+ if (typeof child === 'string') {
3275
+ stringNode += "".concat(child);
3276
+ } else if ( /*#__PURE__*/React__default["default"].isValidElement(child)) {
3277
+ var childPropsCount = Object.keys(child.props).length;
3278
+ var shouldKeepChild = keepArray.indexOf(child.type) > -1;
3279
+ var childChildren = child.props.children;
3280
+ if (!childChildren && shouldKeepChild && childPropsCount === 0) {
3281
+ stringNode += "<".concat(child.type, "/>");
3282
+ } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
3283
+ stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
3284
+ } else if (child.props.i18nIsDynamicList) {
3285
+ stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
3286
+ } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
3287
+ stringNode += "<".concat(child.type, ">").concat(childChildren, "</").concat(child.type, ">");
3288
+ } else {
3289
+ var content = nodesToString(childChildren, i18nOptions);
3290
+ stringNode += "<".concat(childIndex, ">").concat(content, "</").concat(childIndex, ">");
3291
+ }
3292
+ } else if (child === null) {
3293
+ warn("Trans: the passed in value is invalid - seems you passed in a null child.");
3294
+ } else if (_typeof$1(child) === 'object') {
3295
+ var format = child.format,
3296
+ clone = _objectWithoutProperties(child, _excluded);
3297
+ var keys = Object.keys(clone);
3298
+ if (keys.length === 1) {
3299
+ var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
3300
+ stringNode += "{{".concat(value, "}}");
3301
+ } else {
3302
+ warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.", child);
3303
+ }
3304
+ } else {
3305
+ 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);
3306
+ }
3307
+ });
3308
+ return stringNode;
3309
+ }
3310
+ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
3311
+ if (targetString === '') return [];
3312
+ var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
3313
+ var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
3314
+ if (!children && !emptyChildrenButNeedsHandling) return [targetString];
3315
+ var data = {};
3316
+ function getData(childs) {
3317
+ var childrenArray = getAsArray(childs);
3318
+ childrenArray.forEach(function (child) {
3319
+ if (typeof child === 'string') return;
3320
+ if (hasChildren(child)) getData(getChildren(child));else if (_typeof$1(child) === 'object' && ! /*#__PURE__*/React__default["default"].isValidElement(child)) Object.assign(data, child);
3321
+ });
3322
+ }
3323
+ getData(children);
3324
+ var ast = c.parse("<0>".concat(targetString, "</0>"));
3325
+ var opts = _objectSpread$3(_objectSpread$3({}, data), combinedTOpts);
3326
+ function renderInner(child, node, rootReactNode) {
3327
+ var childs = getChildren(child);
3328
+ var mappedChildren = mapAST(childs, node.children, rootReactNode);
3329
+ return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
3330
+ }
3331
+ function pushTranslatedJSX(child, inner, mem, i, isVoid) {
3332
+ if (child.dummy) child.children = inner;
3333
+ mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3334
+ key: i
3335
+ }), isVoid ? undefined : inner));
3336
+ }
3337
+ function mapAST(reactNode, astNode, rootReactNode) {
3338
+ var reactNodes = getAsArray(reactNode);
3339
+ var astNodes = getAsArray(astNode);
3340
+ return astNodes.reduce(function (mem, node, i) {
3341
+ var translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
3342
+ if (node.type === 'tag') {
3343
+ var tmp = reactNodes[parseInt(node.name, 10)];
3344
+ if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
3345
+ if (!tmp) tmp = {};
3346
+ var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
3347
+ props: node.attrs
3348
+ }, tmp) : tmp;
3349
+ var isElement = /*#__PURE__*/React__default["default"].isValidElement(child);
3350
+ var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
3351
+ var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof$1(child) === 'object' && child.dummy && !isElement;
3352
+ var isKnownComponent = _typeof$1(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
3353
+ if (typeof child === 'string') {
3354
+ var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
3355
+ mem.push(value);
3356
+ } else if (hasChildren(child) || isValidTranslationWithChildren) {
3357
+ var inner = renderInner(child, node, rootReactNode);
3358
+ pushTranslatedJSX(child, inner, mem, i);
3359
+ } else if (isEmptyTransWithHTML) {
3360
+ var _inner = mapAST(reactNodes, node.children, rootReactNode);
3361
+ mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3362
+ key: i
3363
+ }), _inner));
3364
+ } else if (Number.isNaN(parseFloat(node.name))) {
3365
+ if (isKnownComponent) {
3366
+ var _inner2 = renderInner(child, node, rootReactNode);
3367
+ pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
3368
+ } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
3369
+ if (node.voidElement) {
3370
+ mem.push( /*#__PURE__*/React__default["default"].createElement(node.name, {
3371
+ key: "".concat(node.name, "-").concat(i)
3372
+ }));
3373
+ } else {
3374
+ var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
3375
+ mem.push( /*#__PURE__*/React__default["default"].createElement(node.name, {
3376
+ key: "".concat(node.name, "-").concat(i)
3377
+ }, _inner3));
3378
+ }
3379
+ } else if (node.voidElement) {
3380
+ mem.push("<".concat(node.name, " />"));
3381
+ } else {
3382
+ var _inner4 = mapAST(reactNodes, node.children, rootReactNode);
3383
+ mem.push("<".concat(node.name, ">").concat(_inner4, "</").concat(node.name, ">"));
3384
+ }
3385
+ } else if (_typeof$1(child) === 'object' && !isElement) {
3386
+ var content = node.children[0] ? translationContent : null;
3387
+ if (content) mem.push(content);
3388
+ } else if (node.children.length === 1 && translationContent) {
3389
+ mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3390
+ key: i
3391
+ }), translationContent));
3392
+ } else {
3393
+ mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$3(_objectSpread$3({}, child.props), {}, {
3394
+ key: i
3395
+ })));
3396
+ }
3397
+ } else if (node.type === 'text') {
3398
+ var wrapTextNodes = i18nOptions.transWrapTextNodes;
3399
+ var _content = shouldUnescape ? unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
3400
+ if (wrapTextNodes) {
3401
+ mem.push( /*#__PURE__*/React__default["default"].createElement(wrapTextNodes, {
3402
+ key: "".concat(node.name, "-").concat(i)
3403
+ }, _content));
3404
+ } else {
3405
+ mem.push(_content);
3406
+ }
3407
+ }
3408
+ return mem;
3409
+ }, []);
3410
+ }
3411
+ var result = mapAST([{
3412
+ dummy: true,
3413
+ children: children || []
3414
+ }], ast, getAsArray(children || []));
3415
+ return getChildren(result[0]);
3416
+ }
3417
+ function Trans(_ref) {
3418
+ var children = _ref.children,
3419
+ count = _ref.count,
3420
+ parent = _ref.parent,
3421
+ i18nKey = _ref.i18nKey,
3422
+ context = _ref.context,
3423
+ _ref$tOptions = _ref.tOptions,
3424
+ tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
3425
+ values = _ref.values,
3426
+ defaults = _ref.defaults,
3427
+ components = _ref.components,
3428
+ ns = _ref.ns,
3429
+ i18nFromProps = _ref.i18n,
3430
+ tFromProps = _ref.t,
3431
+ shouldUnescape = _ref.shouldUnescape,
3432
+ additionalProps = _objectWithoutProperties(_ref, _excluded2);
3433
+ var _ref2 = React.useContext(I18nContext) || {},
3434
+ i18nFromContext = _ref2.i18n,
3435
+ defaultNSFromContext = _ref2.defaultNS;
3436
+ var i18n = i18nFromProps || i18nFromContext || getI18n();
3437
+ if (!i18n) {
3438
+ warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
3439
+ return children;
3440
+ }
3441
+ var t = tFromProps || i18n.t.bind(i18n) || function (k) {
3442
+ return k;
3443
+ };
3444
+ if (context) tOptions.context = context;
3445
+ var reactI18nextOptions = _objectSpread$3(_objectSpread$3({}, getDefaults()), i18n.options && i18n.options.react);
3446
+ var namespaces = ns || t.ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
3447
+ namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
3448
+ var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
3449
+ var hashTransKey = reactI18nextOptions.hashTransKey;
3450
+ var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
3451
+ var interpolationOverride = values ? tOptions.interpolation : {
3452
+ interpolation: _objectSpread$3(_objectSpread$3({}, tOptions.interpolation), {}, {
3453
+ prefix: '#$?',
3454
+ suffix: '?$#'
3455
+ })
3456
+ };
3457
+ var combinedTOpts = _objectSpread$3(_objectSpread$3(_objectSpread$3(_objectSpread$3({}, tOptions), {}, {
3458
+ count: count
3459
+ }, values), interpolationOverride), {}, {
3460
+ defaultValue: defaultValue,
3461
+ ns: namespaces
3462
+ });
3463
+ var translation = key ? t(key, combinedTOpts) : defaultValue;
3464
+ var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
3465
+ var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
3466
+ return useAsParent ? /*#__PURE__*/React__default["default"].createElement(useAsParent, additionalProps, content) : content;
3467
+ }
3468
+
3028
3469
  function _arrayWithHoles$1(arr) {
3029
3470
  if (Array.isArray(arr)) return arr;
3030
3471
  }
@@ -3214,13 +3655,14 @@ var slack = {
3214
3655
  loginButton: "Login to Slack"
3215
3656
  },
3216
3657
  configure: {
3658
+ title: "You are connecting to <br/><strong>{{teamName}}</strong> workspace <br/>({{slackUrl}}).",
3217
3659
  sendTo: "Send to",
3218
- sendToDescription: "Choose a Slack channel or contact to send the notifications",
3660
+ sendToDescription: "Choose a Slack channel to send the notifications",
3219
3661
  updateType: "Update type",
3220
3662
  refreshSlackChannelList: "Refresh Slack channel list"
3221
3663
  },
3222
3664
  finish: {
3223
- title: "Slack successfully connected",
3665
+ title: "Slack successfully connected to <br/><strong>{{teamName}}</strong> workspace.",
3224
3666
  account: "Account",
3225
3667
  channel: "Channel"
3226
3668
  }
@@ -3364,8 +3806,8 @@ var SlackRefreshChannelListButton$1 = /*#__PURE__*/React__default["default"].mem
3364
3806
  var CHANNEL_NAME_VALIDAITON_SCHEMA = {
3365
3807
  selectedChannel: yup__namespace.object().shape({
3366
3808
  label: yup__namespace.string(),
3367
- value: yup__namespace.string().required(t$1("common.required", {
3368
- entity: t$1("slack.channelName")
3809
+ value: yup__namespace.string().required(t$2("common.required", {
3810
+ entity: t$2("slack.channelName")
3369
3811
  }))
3370
3812
  }).required().nullable()
3371
3813
  };
@@ -3469,22 +3911,25 @@ var Configure = function Configure(_ref) {
3469
3911
  isSubmitting = _ref.isSubmitting,
3470
3912
  className = _ref.className,
3471
3913
  validationSchema = _ref.validationSchema,
3472
- channelRefreshHandler = _ref.channelRefreshHandler;
3914
+ channelRefreshHandler = _ref.channelRefreshHandler,
3915
+ _ref$channelSelectLab = _ref.channelSelectLabel,
3916
+ channelSelectLabel = _ref$channelSelectLab === void 0 ? "" : _ref$channelSelectLab;
3473
3917
  var _useTranslation = useTranslation(),
3474
3918
  t = _useTranslation.t;
3475
3919
  return /*#__PURE__*/React__default["default"].createElement("div", {
3476
- className: classNames__default["default"]("neeto-ui-w-full neeto-ui-space-y-6 mx-auto max-w-lg", className)
3920
+ className: classNames__default["default"]("neeto-ui-w-full neeto-ui-space-y-6 mx-auto max-w-md", className)
3477
3921
  }, /*#__PURE__*/React__default["default"].createElement("div", {
3478
- className: "neeto-ui-w-full neeto-ui-mb-3"
3922
+ className: "neeto-ui-mb-6 neeto-ui-w-full"
3479
3923
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
3480
- className: "neeto-ui-text-gray-800 neeto-ui-mb-0.5",
3481
- style: "h3",
3482
- weight: "semibold"
3483
- }, teamName), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
3484
- className: "neeto-ui-text-gray-600",
3485
- style: "body1",
3486
- weight: "normal"
3487
- }, toSlackUrl(teamName))), /*#__PURE__*/React__default["default"].createElement(formik.Form, {
3924
+ style: "h3"
3925
+ }, /*#__PURE__*/React__default["default"].createElement(Trans, {
3926
+ i18nKey: "slack.configure.title",
3927
+ values: {
3928
+ teamName: teamName,
3929
+ slackUrl: toSlackUrl(teamName)
3930
+ }
3931
+ }))), /*#__PURE__*/React__default["default"].createElement(formik.Form, {
3932
+ className: "neeto-ui-w-full",
3488
3933
  formikProps: {
3489
3934
  enableReinitialize: true,
3490
3935
  initialValues: initialFormValues,
@@ -3494,13 +3939,11 @@ var Configure = function Configure(_ref) {
3494
3939
  }, function (formikProps) {
3495
3940
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
3496
3941
  className: "neeto-ui-mb-4 neeto-ui-w-full"
3497
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Label, {
3498
- className: "neeto-ui-text-gray-800 neeto-ui-mb-0.5 neeto-ui-text-base neeto-ui-font-semibold"
3499
- }, t("slack.configure.sendTo")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
3942
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
3500
3943
  className: "neeto-ui-text-gray-700 neeto-ui-mb-3",
3501
3944
  style: "body2",
3502
3945
  weight: "normal"
3503
- }, t("slack.configure.sendToDescription")), /*#__PURE__*/React__default["default"].createElement("div", {
3946
+ }, ramda.isEmpty(channelSelectLabel) ? t("slack.configure.sendToDescription") : channelSelectLabel), /*#__PURE__*/React__default["default"].createElement("div", {
3504
3947
  className: "relative flex"
3505
3948
  }, /*#__PURE__*/React__default["default"].createElement(formik.Select, {
3506
3949
  isSearchable: true,
@@ -3603,10 +4046,14 @@ var Field = function Field(_ref) {
3603
4046
 
3604
4047
  var Finish = function Finish(_ref) {
3605
4048
  var children = _ref.children,
3606
- teamName = _ref.teamName,
3607
- selectedChannel = _ref.selectedChannel,
3608
- _ref$otherFields = _ref.otherFields,
3609
- otherFields = _ref$otherFields === void 0 ? [] : _ref$otherFields,
4049
+ _ref$teamName = _ref.teamName,
4050
+ teamName = _ref$teamName === void 0 ? "" : _ref$teamName,
4051
+ _ref$fields = _ref.fields,
4052
+ fields = _ref$fields === void 0 ? [] : _ref$fields,
4053
+ _ref$onSuccess = _ref.onSuccess,
4054
+ onSuccess = _ref$onSuccess === void 0 ? pure.noop : _ref$onSuccess,
4055
+ _ref$onBack = _ref.onBack,
4056
+ onBack = _ref$onBack === void 0 ? pure.noop : _ref$onBack,
3610
4057
  _ref$buttonProps = _ref.buttonProps,
3611
4058
  buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
3612
4059
  _ref$secondaryButtonP = _ref.secondaryButtonProps,
@@ -3619,29 +4066,31 @@ var Finish = function Finish(_ref) {
3619
4066
  className: "neeto-ui-text-gray-800 neeto-ui-mb-6 neeto-ui-mt-4",
3620
4067
  style: "h3",
3621
4068
  weight: "bold"
3622
- }, t("slack.finish.title")), /*#__PURE__*/React__default["default"].createElement(Field, {
3623
- name: t("slack.finish.account"),
3624
- value: toSlackUrl(teamName)
3625
- }), /*#__PURE__*/React__default["default"].createElement(Field, {
3626
- className: "neeto-ui-pt-3 neeto-ui-border-gray-300 border-t",
3627
- name: t("slack.finish.channel"),
3628
- value: selectedChannel
3629
- }), pure.isNotEmpty(otherFields) && otherFields.map(function (field) {
4069
+ }, /*#__PURE__*/React__default["default"].createElement(Trans, {
4070
+ i18nKey: "slack.finish.title",
4071
+ values: {
4072
+ teamName: teamName
4073
+ }
4074
+ })), pure.isNotEmpty(fields) && fields.map(function (field, index) {
3630
4075
  return /*#__PURE__*/React__default["default"].createElement(Field, {
3631
- className: "neeto-ui-pt-3 neeto-ui-border-gray-300 border-t",
3632
4076
  key: field.name,
3633
4077
  name: field.name,
3634
- value: field.value
4078
+ value: field.value,
4079
+ className: classNames__default["default"]("neeto-ui-pt-3 neeto-ui-border-gray-300", {
4080
+ "border-t": index !== 0
4081
+ })
3635
4082
  });
3636
4083
  }), children, /*#__PURE__*/React__default["default"].createElement("div", {
3637
4084
  className: "neeto-ui-flex neeto-ui-w-full neeto-ui-flex-row neeto-ui-mt-6"
3638
4085
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$1({
3639
4086
  className: "neeto-ui-my-1",
3640
- label: t("slack.steps.finish")
4087
+ label: t("slack.steps.finish"),
4088
+ onClick: onSuccess
3641
4089
  }, buttonProps)), pure.isNotEmpty(secondaryButtonProps) && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$1({
3642
4090
  className: "neeto-ui-my-1 neeto-ui-ml-2",
3643
4091
  label: t("common.edit"),
3644
- style: "secondary"
4092
+ style: "secondary",
4093
+ onClick: onBack
3645
4094
  }, secondaryButtonProps))));
3646
4095
  };
3647
4096