jclib-ui 1.0.295 → 1.0.297

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.
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React__default, { useEffect, createContext, useContext, useState, useCallback, useRef, useMemo, useLayoutEffect, useImperativeHandle } from "react";
3
- import { isDarkMode, random, isMobile, formatData, formatDataHora, formatValor, isDesktop, getDateTimeStr, getHash, validarCNPJ, validarCPF } from "jcinfo-utils";
3
+ import { isMobile, isDarkMode, random, formatData, formatDataHora, formatValor, isDesktop, getDateTimeStr, getHash, validarCNPJ, validarCPF } from "jcinfo-utils";
4
4
  import { useDragControls, motion } from "framer-motion";
5
5
  import styled from "styled-components";
6
6
  import { Dropdown, DropdownMenu, DropdownItem, DropdownToggle, Spinner, Button, InputGroup, Input as Input$1 } from "reactstrap";
@@ -3895,6 +3895,18 @@ if (process.env.NODE_ENV === "production") {
3895
3895
  jsxRuntime.exports = requireReactJsxRuntime_development();
3896
3896
  }
3897
3897
  var jsxRuntimeExports = jsxRuntime.exports;
3898
+ const BorderTestServer = styled.div`
3899
+ position: fixed;
3900
+ top: 3px;
3901
+ left: 3px;
3902
+ width: 12px;
3903
+ aspect-ratio: 1/1;
3904
+ box-sizing: border-box;
3905
+ background-color: #2cbd64;
3906
+ border-radius: 99px;
3907
+ pointer-events: none;
3908
+ z-index: 9999999;
3909
+ `;
3898
3910
  const MARCADOR_LOCALHOST = " 🔴 ";
3899
3911
  const MARCADOR_TESTE = " 🟢 ";
3900
3912
  function useLocalhostBadge() {
@@ -3906,13 +3918,20 @@ function useLocalhostBadge() {
3906
3918
  }, []);
3907
3919
  }
3908
3920
  function useTestDomainBadge(testDomain) {
3909
- useEffect(() => {
3921
+ function inTestServer() {
3910
3922
  const domains = testDomain ? [].concat(testDomain) : ["test.", "test-"];
3911
- const inTestServer = domains.some((domain) => window.location.hostname.includes(domain));
3912
- if (inTestServer && !document.title.includes(MARCADOR_TESTE)) {
3923
+ return Boolean(
3924
+ domains.some((domain) => window.location.hostname.includes(domain))
3925
+ );
3926
+ }
3927
+ useEffect(() => {
3928
+ if (inTestServer() && !document.title.includes(MARCADOR_TESTE)) {
3913
3929
  document.title = `${MARCADOR_TESTE}${document.title}`;
3914
3930
  }
3915
3931
  }, [testDomain]);
3932
+ if (inTestServer() && isMobile()) {
3933
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(BorderTestServer, {});
3934
+ }
3916
3935
  }
3917
3936
  const LibContext = createContext({
3918
3937
  modalList: [],
@@ -3992,7 +4011,7 @@ const LibProvider = ({ apiConfig, children, versionApp, useTheme, testDomain })
3992
4011
  [modalList]
3993
4012
  );
3994
4013
  useLocalhostBadge();
3995
- useTestDomainBadge(testDomain);
4014
+ const borderTestServer = useTestDomainBadge(testDomain);
3996
4015
  useEffect(() => {
3997
4016
  if (canChangeTheme) {
3998
4017
  localStorage.setItem(cTheme, theme);
@@ -4003,7 +4022,7 @@ const LibProvider = ({ apiConfig, children, versionApp, useTheme, testDomain })
4003
4022
  window.addEventListener("keydown", handleKeyDown, false);
4004
4023
  return () => window.removeEventListener("keydown", handleKeyDown, false);
4005
4024
  }, [modalList]);
4006
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
4025
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
4007
4026
  LibContext.Provider,
4008
4027
  {
4009
4028
  value: {
@@ -4021,7 +4040,10 @@ const LibProvider = ({ apiConfig, children, versionApp, useTheme, testDomain })
4021
4040
  reportType,
4022
4041
  setReportType
4023
4042
  },
4024
- children
4043
+ children: [
4044
+ borderTestServer,
4045
+ children
4046
+ ]
4025
4047
  }
4026
4048
  );
4027
4049
  };