strapi-plugin-firebase-authentication 1.1.8 → 1.1.10

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.
@@ -5,13 +5,13 @@ import { Provider } from "@radix-ui/react-tooltip";
5
5
  import React, { useState, useCallback, useMemo, useEffect, useRef, useLayoutEffect } from "react";
6
6
  import { Link, Flex, Box, Button, Tooltip, Tbody, Tr, Td, Checkbox, Typography, Modal, Table, Thead, Th, SingleSelect, SingleSelectOption, SearchForm, Searchbar, IconButton, Dialog, Tabs, TextInput, Alert, Field, Toggle, Divider } from "@strapi/design-system";
7
7
  import { useIntl } from "react-intl";
8
- import { i as isArguments_1, a as isBufferExports, b as isTypedArray_1, c as isLength_1, d as isFunction_1, _ as _getTag, e as _Stack, f as _equalArrays, g as _equalByTag, h as isObjectLike_1, j as getDefaultExportFromCjs, k as _baseGetTag, l as _MapCache, m as _Symbol, P as PLUGIN_ID, n as getAugmentedNamespace, o as commonjsGlobal } from "./index-Do9Y0scX.mjs";
8
+ import { i as isArguments_1, a as isBufferExports, b as isTypedArray_1, c as isLength_1, d as isFunction_1, _ as _getTag, e as _Stack, f as _equalArrays, g as _equalByTag, h as isObjectLike_1, j as getDefaultExportFromCjs, k as _baseGetTag, l as _MapCache, m as _Symbol, P as PLUGIN_ID, n as getAugmentedNamespace, o as commonjsGlobal } from "./index-Dxg4gNu5.mjs";
9
9
  import { ArrowLeft, Key, Trash, WarningCircle, CaretUp, CaretDown, Search, Plus, Pencil } from "@strapi/icons";
10
10
  import styled from "styled-components";
11
11
  import { RxCheck, RxCross2 } from "react-icons/rx";
12
12
  import { AiOutlineUserAdd, AiFillPhone, AiFillMail, AiFillYahoo, AiFillGithub, AiFillTwitterCircle, AiFillFacebook, AiFillApple, AiFillGoogleCircle } from "react-icons/ai";
13
13
  import { MdPassword } from "react-icons/md";
14
- import { g as getFirebaseConfig$1 } from "./api-T8QRCile.mjs";
14
+ import { g as getFirebaseConfig$1 } from "./api-BznQNKgc.mjs";
15
15
  import * as PhoneInputModule from "react-phone-input-2";
16
16
  import "react-phone-input-2/lib/style.css";
17
17
  import validator from "validator";
@@ -2966,7 +2966,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
2966
2966
  var ys = arrObjKeys(obj, inspect2);
2967
2967
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
2968
2968
  var protoTag = obj instanceof Object ? "" : "null prototype";
2969
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
2969
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
2970
2970
  var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
2971
2971
  var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
2972
2972
  if (ys.length === 0) {
@@ -2991,25 +2991,25 @@ function canTrustToString(obj) {
2991
2991
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
2992
2992
  }
2993
2993
  function isArray$3(obj) {
2994
- return toStr(obj) === "[object Array]" && canTrustToString(obj);
2994
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
2995
2995
  }
2996
2996
  function isDate(obj) {
2997
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
2997
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
2998
2998
  }
2999
2999
  function isRegExp$1(obj) {
3000
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
3000
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
3001
3001
  }
3002
3002
  function isError(obj) {
3003
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
3003
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
3004
3004
  }
3005
3005
  function isString(obj) {
3006
- return toStr(obj) === "[object String]" && canTrustToString(obj);
3006
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
3007
3007
  }
3008
3008
  function isNumber(obj) {
3009
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
3009
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
3010
3010
  }
3011
3011
  function isBoolean(obj) {
3012
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
3012
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
3013
3013
  }
3014
3014
  function isSymbol(obj) {
3015
3015
  if (hasShammedSymbols) {
@@ -3045,7 +3045,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
3045
3045
  function has$3(obj, key) {
3046
3046
  return hasOwn$1.call(obj, key);
3047
3047
  }
3048
- function toStr(obj) {
3048
+ function toStr$1(obj) {
3049
3049
  return objectToString.call(obj);
3050
3050
  }
3051
3051
  function nameOf(f) {
@@ -3354,7 +3354,7 @@ var syntax = SyntaxError;
3354
3354
  var uri = URIError;
3355
3355
  var abs$1 = Math.abs;
3356
3356
  var floor$1 = Math.floor;
3357
- var max$1 = Math.max;
3357
+ var max$2 = Math.max;
3358
3358
  var min$1 = Math.min;
3359
3359
  var pow$1 = Math.pow;
3360
3360
  var round$1 = Math.round;
@@ -3483,99 +3483,78 @@ function requireObject_getPrototypeOf() {
3483
3483
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
3484
3484
  return Object_getPrototypeOf;
3485
3485
  }
3486
- var implementation;
3487
- var hasRequiredImplementation;
3488
- function requireImplementation() {
3489
- if (hasRequiredImplementation) return implementation;
3490
- hasRequiredImplementation = 1;
3491
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3492
- var toStr2 = Object.prototype.toString;
3493
- var max2 = Math.max;
3494
- var funcType = "[object Function]";
3495
- var concatty = function concatty2(a3, b2) {
3496
- var arr = [];
3497
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
3498
- arr[i2] = a3[i2];
3499
- }
3500
- for (var j = 0; j < b2.length; j += 1) {
3501
- arr[j + a3.length] = b2[j];
3502
- }
3503
- return arr;
3504
- };
3505
- var slicy = function slicy2(arrLike, offset) {
3506
- var arr = [];
3507
- for (var i2 = offset, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
3508
- arr[j] = arrLike[i2];
3509
- }
3510
- return arr;
3511
- };
3512
- var joiny = function(arr, joiner) {
3513
- var str = "";
3514
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
3515
- str += arr[i2];
3516
- if (i2 + 1 < arr.length) {
3517
- str += joiner;
3518
- }
3486
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3487
+ var toStr = Object.prototype.toString;
3488
+ var max$1 = Math.max;
3489
+ var funcType = "[object Function]";
3490
+ var concatty = function concatty2(a3, b2) {
3491
+ var arr = [];
3492
+ for (var i2 = 0; i2 < a3.length; i2 += 1) {
3493
+ arr[i2] = a3[i2];
3494
+ }
3495
+ for (var j = 0; j < b2.length; j += 1) {
3496
+ arr[j + a3.length] = b2[j];
3497
+ }
3498
+ return arr;
3499
+ };
3500
+ var slicy = function slicy2(arrLike, offset) {
3501
+ var arr = [];
3502
+ for (var i2 = offset, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
3503
+ arr[j] = arrLike[i2];
3504
+ }
3505
+ return arr;
3506
+ };
3507
+ var joiny = function(arr, joiner) {
3508
+ var str = "";
3509
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
3510
+ str += arr[i2];
3511
+ if (i2 + 1 < arr.length) {
3512
+ str += joiner;
3519
3513
  }
3520
- return str;
3521
- };
3522
- implementation = function bind2(that) {
3523
- var target = this;
3524
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
3525
- throw new TypeError(ERROR_MESSAGE + target);
3526
- }
3527
- var args = slicy(arguments, 1);
3528
- var bound;
3529
- var binder = function() {
3530
- if (this instanceof bound) {
3531
- var result = target.apply(
3532
- this,
3533
- concatty(args, arguments)
3534
- );
3535
- if (Object(result) === result) {
3536
- return result;
3537
- }
3538
- return this;
3539
- }
3540
- return target.apply(
3541
- that,
3514
+ }
3515
+ return str;
3516
+ };
3517
+ var implementation$1 = function bind(that) {
3518
+ var target = this;
3519
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
3520
+ throw new TypeError(ERROR_MESSAGE + target);
3521
+ }
3522
+ var args = slicy(arguments, 1);
3523
+ var bound;
3524
+ var binder = function() {
3525
+ if (this instanceof bound) {
3526
+ var result = target.apply(
3527
+ this,
3542
3528
  concatty(args, arguments)
3543
3529
  );
3544
- };
3545
- var boundLength = max2(0, target.length - args.length);
3546
- var boundArgs = [];
3547
- for (var i2 = 0; i2 < boundLength; i2++) {
3548
- boundArgs[i2] = "$" + i2;
3549
- }
3550
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
3551
- if (target.prototype) {
3552
- var Empty = function Empty2() {
3553
- };
3554
- Empty.prototype = target.prototype;
3555
- bound.prototype = new Empty();
3556
- Empty.prototype = null;
3530
+ if (Object(result) === result) {
3531
+ return result;
3532
+ }
3533
+ return this;
3557
3534
  }
3558
- return bound;
3535
+ return target.apply(
3536
+ that,
3537
+ concatty(args, arguments)
3538
+ );
3559
3539
  };
3560
- return implementation;
3561
- }
3562
- var functionBind;
3563
- var hasRequiredFunctionBind;
3564
- function requireFunctionBind() {
3565
- if (hasRequiredFunctionBind) return functionBind;
3566
- hasRequiredFunctionBind = 1;
3567
- var implementation2 = requireImplementation();
3568
- functionBind = Function.prototype.bind || implementation2;
3569
- return functionBind;
3570
- }
3571
- var functionCall;
3572
- var hasRequiredFunctionCall;
3573
- function requireFunctionCall() {
3574
- if (hasRequiredFunctionCall) return functionCall;
3575
- hasRequiredFunctionCall = 1;
3576
- functionCall = Function.prototype.call;
3577
- return functionCall;
3578
- }
3540
+ var boundLength = max$1(0, target.length - args.length);
3541
+ var boundArgs = [];
3542
+ for (var i2 = 0; i2 < boundLength; i2++) {
3543
+ boundArgs[i2] = "$" + i2;
3544
+ }
3545
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
3546
+ if (target.prototype) {
3547
+ var Empty = function Empty2() {
3548
+ };
3549
+ Empty.prototype = target.prototype;
3550
+ bound.prototype = new Empty();
3551
+ Empty.prototype = null;
3552
+ }
3553
+ return bound;
3554
+ };
3555
+ var implementation = implementation$1;
3556
+ var functionBind = Function.prototype.bind || implementation;
3557
+ var functionCall = Function.prototype.call;
3579
3558
  var functionApply;
3580
3559
  var hasRequiredFunctionApply;
3581
3560
  function requireFunctionApply() {
@@ -3585,14 +3564,14 @@ function requireFunctionApply() {
3585
3564
  return functionApply;
3586
3565
  }
3587
3566
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
3588
- var bind$2 = requireFunctionBind();
3567
+ var bind$2 = functionBind;
3589
3568
  var $apply$1 = requireFunctionApply();
3590
- var $call$2 = requireFunctionCall();
3569
+ var $call$2 = functionCall;
3591
3570
  var $reflectApply = reflectApply;
3592
3571
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
3593
- var bind$1 = requireFunctionBind();
3572
+ var bind$1 = functionBind;
3594
3573
  var $TypeError$4 = type;
3595
- var $call$1 = requireFunctionCall();
3574
+ var $call$1 = functionCall;
3596
3575
  var $actualApply = actualApply;
3597
3576
  var callBindApplyHelpers = function callBindBasic(args) {
3598
3577
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -3658,8 +3637,8 @@ function requireHasown() {
3658
3637
  hasRequiredHasown = 1;
3659
3638
  var call = Function.prototype.call;
3660
3639
  var $hasOwn = Object.prototype.hasOwnProperty;
3661
- var bind2 = requireFunctionBind();
3662
- hasown = bind2.call(call, $hasOwn);
3640
+ var bind3 = functionBind;
3641
+ hasown = bind3.call(call, $hasOwn);
3663
3642
  return hasown;
3664
3643
  }
3665
3644
  var undefined$1;
@@ -3673,7 +3652,7 @@ var $TypeError$3 = type;
3673
3652
  var $URIError = uri;
3674
3653
  var abs = abs$1;
3675
3654
  var floor = floor$1;
3676
- var max = max$1;
3655
+ var max = max$2;
3677
3656
  var min = min$1;
3678
3657
  var pow = pow$1;
3679
3658
  var round = round$1;
@@ -3707,7 +3686,7 @@ var getProto = requireGetProto();
3707
3686
  var $ObjectGPO = requireObject_getPrototypeOf();
3708
3687
  var $ReflectGPO = requireReflect_getPrototypeOf();
3709
3688
  var $apply = requireFunctionApply();
3710
- var $call = requireFunctionCall();
3689
+ var $call = functionCall;
3711
3690
  var needsEval = {};
3712
3691
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
3713
3692
  var INTRINSICS = {
@@ -3878,13 +3857,13 @@ var LEGACY_ALIASES = {
3878
3857
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3879
3858
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3880
3859
  };
3881
- var bind = requireFunctionBind();
3860
+ var bind2 = functionBind;
3882
3861
  var hasOwn = requireHasown();
3883
- var $concat = bind.call($call, Array.prototype.concat);
3884
- var $spliceApply = bind.call($apply, Array.prototype.splice);
3885
- var $replace = bind.call($call, String.prototype.replace);
3886
- var $strSlice = bind.call($call, String.prototype.slice);
3887
- var $exec = bind.call($call, RegExp.prototype.exec);
3862
+ var $concat = bind2.call($call, Array.prototype.concat);
3863
+ var $spliceApply = bind2.call($apply, Array.prototype.splice);
3864
+ var $replace = bind2.call($call, String.prototype.replace);
3865
+ var $strSlice = bind2.call($call, String.prototype.slice);
3866
+ var $exec = bind2.call($call, RegExp.prototype.exec);
3888
3867
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
3889
3868
  var reEscapeChar = /\\(\\)?/g;
3890
3869
  var stringToPath = function stringToPath2(string) {
@@ -5442,16 +5421,17 @@ const StyledPhoneInputWrapper = styled.div`
5442
5421
 
5443
5422
  /* Flag dropdown button styles */
5444
5423
  .flag-dropdown {
5445
- background: transparent;
5424
+ background: transparent !important;
5446
5425
  border: none;
5447
5426
  border-right: none;
5448
5427
 
5449
5428
  &.open {
5429
+ background: transparent !important;
5450
5430
  z-index: 1001;
5451
5431
  }
5452
5432
 
5453
5433
  .selected-flag {
5454
- padding: 0 0 0 0.75rem;
5434
+ padding: 0 0.5rem 0 1rem;
5455
5435
  height: 40px;
5456
5436
  display: flex;
5457
5437
  align-items: center;
@@ -5465,8 +5445,26 @@ const StyledPhoneInputWrapper = styled.div`
5465
5445
  margin-left: 8px;
5466
5446
  }
5467
5447
 
5468
- &.open .arrow {
5469
- border-top-color: ${({ theme }) => theme.colors.neutral800};
5448
+ /* Fix flag background in all interactive states */
5449
+ &:hover,
5450
+ &:focus,
5451
+ &:active,
5452
+ &.open {
5453
+ background: transparent;
5454
+ background-color: transparent;
5455
+
5456
+ .arrow {
5457
+ border-top-color: ${({ theme }) => theme.colors.neutral800};
5458
+ }
5459
+
5460
+ .flag {
5461
+ background-color: transparent;
5462
+ }
5463
+ }
5464
+
5465
+ /* Fix flag background flash on initial load */
5466
+ .flag {
5467
+ background-color: transparent;
5470
5468
  }
5471
5469
  }
5472
5470
  }
@@ -5920,10 +5918,13 @@ const EditUserForm = ({ data }) => {
5920
5918
  setIsLoading(true);
5921
5919
  try {
5922
5920
  const updatedUser = await updateUser(userData.uid, userData);
5923
- if (updatedUser[0]?.status === "rejected") {
5924
- throw new Error("Error updating user");
5921
+ const result = updatedUser[0];
5922
+ if (result?.status === "rejected") {
5923
+ const errorReason = result.reason;
5924
+ const errorMessage = errorReason?.message || (errorReason?.code ? `Firebase error: ${errorReason.code}` : null) || "Error updating user";
5925
+ throw new Error(errorMessage);
5925
5926
  }
5926
- setUserData(updatedUser[0].value);
5927
+ setUserData(result.value);
5927
5928
  setIsLoading(false);
5928
5929
  toggleNotification({
5929
5930
  type: "success",
@@ -5931,9 +5932,10 @@ const EditUserForm = ({ data }) => {
5931
5932
  });
5932
5933
  } catch (error) {
5933
5934
  console.error("Error updating user:", error);
5935
+ const errorMessage = error instanceof Error ? error.message : "An error occurred while updating the user";
5934
5936
  toggleNotification({
5935
5937
  type: "danger",
5936
- message: "An error occurred while updating the user"
5938
+ message: errorMessage
5937
5939
  });
5938
5940
  setIsLoading(false);
5939
5941
  setUserData(data);