@mxenabled/connect-widget 0.17.2 → 0.18.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/README.md CHANGED
@@ -69,10 +69,12 @@ You need to pass an object containing API endpoint callbacks as the `apiValue` p
69
69
  _To make commits that trigger a package release, use `npx cz`, it will launch easy to follow commitizen prompts._
70
70
 
71
71
  A new _MAJOR.MINOR.PATCH_ release will be generated if at least one of the following types are used, see [Conventional Commits Documentation](https://www.conventionalcommits.org/) for more specifics.
72
- * `fix:` -> PATCH bump
73
- * `feat:` -> MINOR bump
72
+
73
+ - `fix:` -> PATCH bump
74
+ - `feat:` -> MINOR bump
74
75
 
75
76
  Major bump (any type with a footer of `BREAKING CHANGE:`)
77
+
76
78
  ```
77
79
  <any_type>: <message>
78
80
 
@@ -94,6 +96,6 @@ Pull requests are welcome. Please open an issue first to discuss what you would
94
96
 
95
97
  Make sure to add/update tests, translations, and documentation as appropriate.
96
98
 
97
- ## Changelog
99
+ ## Changes
98
100
 
99
- View our changelog [here](./CHANGELOG.md)
101
+ View our notes for each release [here](https://github.com/mxenabled/connect-widget/releases)
package/dist/index.es.js CHANGED
@@ -5131,39 +5131,23 @@ function baseFindIndex$2(array, predicate, fromIndex, fromRight) {
5131
5131
  }
5132
5132
  var _baseFindIndex = baseFindIndex$2;
5133
5133
 
5134
- var _trimmedEndIndex;
5135
- var hasRequired_trimmedEndIndex;
5136
-
5137
- function require_trimmedEndIndex () {
5138
- if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
5139
- hasRequired_trimmedEndIndex = 1;
5140
- var reWhitespace = /\s/;
5141
- function trimmedEndIndex(string) {
5142
- var index = string.length;
5143
- while (index-- && reWhitespace.test(string.charAt(index))) {
5144
- }
5145
- return index;
5146
- }
5147
- _trimmedEndIndex = trimmedEndIndex;
5148
- return _trimmedEndIndex;
5134
+ var reWhitespace = /\s/;
5135
+ function trimmedEndIndex$1(string) {
5136
+ var index = string.length;
5137
+ while (index-- && reWhitespace.test(string.charAt(index))) {
5138
+ }
5139
+ return index;
5149
5140
  }
5141
+ var _trimmedEndIndex = trimmedEndIndex$1;
5150
5142
 
5151
- var _baseTrim;
5152
- var hasRequired_baseTrim;
5153
-
5154
- function require_baseTrim () {
5155
- if (hasRequired_baseTrim) return _baseTrim;
5156
- hasRequired_baseTrim = 1;
5157
- var trimmedEndIndex = require_trimmedEndIndex();
5158
- var reTrimStart = /^\s+/;
5159
- function baseTrim(string) {
5160
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5161
- }
5162
- _baseTrim = baseTrim;
5163
- return _baseTrim;
5143
+ var trimmedEndIndex = _trimmedEndIndex;
5144
+ var reTrimStart = /^\s+/;
5145
+ function baseTrim$1(string) {
5146
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5164
5147
  }
5148
+ var _baseTrim = baseTrim$1;
5165
5149
 
5166
- var baseTrim = require_baseTrim(), isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5150
+ var baseTrim = _baseTrim, isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5167
5151
  var NAN = 0 / 0;
5168
5152
  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
5169
5153
  var reIsBinary = /^0b[01]+$/i;
@@ -8629,7 +8613,7 @@ var hasRequiredTrim;
8629
8613
  function requireTrim () {
8630
8614
  if (hasRequiredTrim) return trim_1;
8631
8615
  hasRequiredTrim = 1;
8632
- var baseToString = _baseToString, baseTrim = require_baseTrim(), castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8616
+ var baseToString = _baseToString, baseTrim = _baseTrim, castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8633
8617
  function trim(string, chars, guard) {
8634
8618
  string = toString(string);
8635
8619
  if (string && (guard || chars === void 0)) {
@@ -9543,7 +9527,36 @@ const initialState$5 = {
9543
9527
  const configSlice = createSlice({
9544
9528
  name: "config",
9545
9529
  initialState: initialState$5,
9546
- reducers: {},
9530
+ reducers: {
9531
+ stepUpToVerification: (state) => {
9532
+ if (state.mode === AGG_MODE) {
9533
+ state.include_transactions = true;
9534
+ }
9535
+ state.mode = VERIFY_MODE;
9536
+ if (Array.isArray(state.use_cases)) {
9537
+ state.use_cases.push("MONEY_MOVEMENT");
9538
+ } else {
9539
+ state.use_cases = ["MONEY_MOVEMENT"];
9540
+ }
9541
+ },
9542
+ stepUpToAggregation: (state) => {
9543
+ state.include_transactions = true;
9544
+ if (Array.isArray(state.use_cases)) {
9545
+ state.use_cases.push("PFM");
9546
+ } else {
9547
+ state.use_cases = ["PFM"];
9548
+ }
9549
+ },
9550
+ stepUpReset: (state) => {
9551
+ const initialValuesObject = convertInitialValuesToObject(state._initialValues);
9552
+ return {
9553
+ ...state,
9554
+ include_transactions: initialValuesObject?.include_transactions ?? initialState$5.include_transactions,
9555
+ mode: initialValuesObject?.mode ?? initialState$5.mode,
9556
+ use_cases: initialValuesObject?.use_cases ?? initialState$5.use_cases
9557
+ };
9558
+ }
9559
+ },
9547
9560
  extraReducers(builder) {
9548
9561
  builder.addCase(
9549
9562
  ActionTypes$2.LOAD_CONNECT,
@@ -9607,6 +9620,13 @@ const getProductDeterminedMode = (config) => {
9607
9620
  return null;
9608
9621
  }
9609
9622
  };
9623
+ const convertInitialValuesToObject = (initialValues) => {
9624
+ try {
9625
+ return JSON.parse(initialValues);
9626
+ } catch (error) {
9627
+ return {};
9628
+ }
9629
+ };
9610
9630
  const configSlice$1 = configSlice.reducer;
9611
9631
 
9612
9632
  const initialState$4 = {
@@ -74763,6 +74783,7 @@ const VerifyDeposits = ({ microdeposit, onSuccess }) => {
74763
74783
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: containerRef, children: [
74764
74784
  /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: styles.header, children: [
74765
74785
  /* @__PURE__ */ jsxRuntimeExports.jsx(x, { "data-test": "title-header", style: styles.title, truncate: false, variant: "H2", children: __("Enter deposit amounts") }),
74786
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
74766
74787
  /* @__PURE__ */ jsxRuntimeExports.jsx(
74767
74788
  ProtectedText,
74768
74789
  {