@credithub/harlan-components 1.131.0 → 1.131.2
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/consultaSimples.js +15 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/domResilience.d.ts +17 -0
- package/dist/utils/domResilience.js +47 -0
- package/lib/cjs/index.js +314 -960
- package/lib/esm/index.js +314 -960
- package/package.json +1 -1
package/dist/consultaSimples.js
CHANGED
|
@@ -6,30 +6,29 @@ import Addresses from './components/adresses/addresses';
|
|
|
6
6
|
import BankAccounts from './components/bank-accounts/bank-accounts';
|
|
7
7
|
import CCF from './components/ccf/ccf';
|
|
8
8
|
import ChartSystem from './components/chart/chartSystem';
|
|
9
|
-
import Contacts from './components/contacts/contacts';
|
|
10
|
-
import DividasPublicas from './components/dividasPublicas/dividasPublicas';
|
|
11
|
-
import Dossie from './components/dossie/dossie';
|
|
12
|
-
import Falencia from './components/falencia/falencia';
|
|
13
|
-
import Partners from './components/partners/partners';
|
|
14
|
-
import ProcessosJuridicos from './components/processos-juridicos/processosJuridicos';
|
|
15
|
-
import Protestos from './components/protestos/protestos';
|
|
16
|
-
import RefinBoaVista from './components/refinBoaVista/refinBoaVista';
|
|
17
|
-
import RefinSerasa from './components/refinSerasa/refinSerasa';
|
|
18
|
-
import Veiculos from './components/veiculos/veiculos';
|
|
19
|
-
import { Queries, useQuery, WebServiceProvider } from './components/webservice';
|
|
20
9
|
import Modal from './components/common/modal';
|
|
21
10
|
import { ConsultaRfbProvider } from './components/consultaRfb';
|
|
22
11
|
import ConsultaSimplesSection from './components/consultaSimplesSection/consultaSimplesSection';
|
|
23
12
|
import { ConsultasComplementaresProvider } from './components/consultasComplementares';
|
|
13
|
+
import Contacts from './components/contacts/contacts';
|
|
14
|
+
import DividasPublicas from './components/dividasPublicas/dividasPublicas';
|
|
24
15
|
import Dominios from './components/dominios/dominios';
|
|
16
|
+
import Dossie from './components/dossie/dossie';
|
|
25
17
|
import Edital from './components/edital/edital';
|
|
18
|
+
import Falencia from './components/falencia/falencia';
|
|
26
19
|
import ConsultaImoveis from './components/imoveis/imoveisService';
|
|
27
|
-
import
|
|
20
|
+
import Partners from './components/partners/partners';
|
|
21
|
+
import ProcessosJuridicos from './components/processos-juridicos/processosJuridicos';
|
|
22
|
+
import Protestos from './components/protestos/protestos';
|
|
28
23
|
import ProtestosSP from './components/protestos/protestosSp';
|
|
29
24
|
import ProtestosPagosBaixados from './components/protestosPagosBaixados';
|
|
25
|
+
import RefinBoaVista from './components/refinBoaVista/refinBoaVista';
|
|
26
|
+
import RefinSerasa from './components/refinSerasa/refinSerasa';
|
|
30
27
|
import ConsultaScore from './components/score/scoreService';
|
|
31
28
|
import ConsultaScoreSerasa from './components/scoreSerasa/scoreSerasa';
|
|
32
29
|
import ConsultaSCR from './components/scr/scr';
|
|
30
|
+
import Veiculos from './components/veiculos/veiculos';
|
|
31
|
+
import { Queries, useQuery, WebServiceProvider } from './components/webservice';
|
|
33
32
|
import { PostHogProvider } from './contexts/PostHogContext';
|
|
34
33
|
import { ErrorModalProvider } from './contexts/errorModalContext';
|
|
35
34
|
import { GlobalDataProvider } from './contexts/globalDataContext';
|
|
@@ -40,7 +39,10 @@ import GlobalStyle from './styles/globalStyle';
|
|
|
40
39
|
import theme from './styles/theme';
|
|
41
40
|
import { hasOneOfTags } from './utils/tags';
|
|
42
41
|
Chart.register.apply(Chart, registerables);
|
|
43
|
-
|
|
42
|
+
// `data-credithub-skip` opta a subárvore inteira fora do `replaceElement` da
|
|
43
|
+
// extensão `credithub-components`, que de outra forma muta os Text nodes
|
|
44
|
+
// renderizados pelo React e provoca `NotFoundError` em removeChild/insertBefore.
|
|
45
|
+
var Wrapper = styled.div.attrs({ 'data-credithub-skip': '' })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n margin-bottom: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"], ["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n margin-bottom: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"])));
|
|
44
46
|
// Componente de dependência de Protestos estabilizado em escopo de módulo
|
|
45
47
|
var ProtestosWithCCFDependency = React.memo(function (_a) {
|
|
46
48
|
var children = _a.children, documento = _a.documento;
|
|
@@ -116,7 +118,6 @@ var ConsultaSimples = function (_a) {
|
|
|
116
118
|
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial, ctime: ctimeProp, printMode: printMode, tags: tags, extensionInstalled: extensionInstalled },
|
|
117
119
|
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
118
120
|
React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
|
|
119
|
-
React.createElement(Liminar, { isFinancial: isFinancial, hasCredits: hasCredits, tags: tags }),
|
|
120
121
|
React.createElement(Falencia, { documento: documento }),
|
|
121
122
|
React.createElement(Addresses, { apiKey: apiKey }),
|
|
122
123
|
React.createElement(Contacts, null),
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Torna o React resiliente a mutações de DOM feitas por código externo
|
|
3
|
+
* (extensões do navegador, Google Translate, content scripts como o
|
|
4
|
+
* `replaceElement` do `credithub-components` que envolve CPF/CNPJ em
|
|
5
|
+
* `<x-credithub-extension>` por baixo dos panos).
|
|
6
|
+
*
|
|
7
|
+
* Sem este patch, quando o reconciler do React 18 tenta remover ou inserir
|
|
8
|
+
* um nó que já foi movido por terceiros, o navegador lança
|
|
9
|
+
* `NotFoundError: Failed to execute 'removeChild' on 'Node'` e o React
|
|
10
|
+
* derruba a árvore inteira via error boundary.
|
|
11
|
+
*
|
|
12
|
+
* O patch é idempotente: se outra cópia da lib já o aplicou na mesma
|
|
13
|
+
* página, esta chamada vira no-op.
|
|
14
|
+
*
|
|
15
|
+
* Referência: https://github.com/facebook/react/issues/11538
|
|
16
|
+
*/
|
|
17
|
+
export declare function installDomResilience(): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Torna o React resiliente a mutações de DOM feitas por código externo
|
|
3
|
+
* (extensões do navegador, Google Translate, content scripts como o
|
|
4
|
+
* `replaceElement` do `credithub-components` que envolve CPF/CNPJ em
|
|
5
|
+
* `<x-credithub-extension>` por baixo dos panos).
|
|
6
|
+
*
|
|
7
|
+
* Sem este patch, quando o reconciler do React 18 tenta remover ou inserir
|
|
8
|
+
* um nó que já foi movido por terceiros, o navegador lança
|
|
9
|
+
* `NotFoundError: Failed to execute 'removeChild' on 'Node'` e o React
|
|
10
|
+
* derruba a árvore inteira via error boundary.
|
|
11
|
+
*
|
|
12
|
+
* O patch é idempotente: se outra cópia da lib já o aplicou na mesma
|
|
13
|
+
* página, esta chamada vira no-op.
|
|
14
|
+
*
|
|
15
|
+
* Referência: https://github.com/facebook/react/issues/11538
|
|
16
|
+
*/
|
|
17
|
+
var FLAG = '__credithubDomResilienceInstalled__';
|
|
18
|
+
export function installDomResilience() {
|
|
19
|
+
if (typeof window === 'undefined' || typeof Node === 'undefined') {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
var flagged = window;
|
|
23
|
+
if (flagged[FLAG])
|
|
24
|
+
return;
|
|
25
|
+
flagged[FLAG] = true;
|
|
26
|
+
var originalRemoveChild = Node.prototype.removeChild;
|
|
27
|
+
Node.prototype.removeChild = function patchedRemoveChild(child) {
|
|
28
|
+
if (child.parentNode !== this) {
|
|
29
|
+
if (typeof console !== 'undefined' && typeof console.warn === 'function') {
|
|
30
|
+
console.warn('[harlan-components] removeChild ignorado: nó não é mais filho do esperado. Provável interferência de extensão de navegador.', { child: child, expectedParent: this });
|
|
31
|
+
}
|
|
32
|
+
return child;
|
|
33
|
+
}
|
|
34
|
+
return originalRemoveChild.call(this, child);
|
|
35
|
+
};
|
|
36
|
+
var originalInsertBefore = Node.prototype.insertBefore;
|
|
37
|
+
Node.prototype.insertBefore = function patchedInsertBefore(newNode, referenceNode) {
|
|
38
|
+
if (referenceNode != null && referenceNode.parentNode !== this) {
|
|
39
|
+
if (typeof console !== 'undefined' && typeof console.warn === 'function') {
|
|
40
|
+
console.warn('[harlan-components] insertBefore ajustado: nó de referência não é mais filho do esperado. Anexando ao final.', { newNode: newNode, referenceNode: referenceNode, expectedParent: this });
|
|
41
|
+
}
|
|
42
|
+
return originalInsertBefore.call(this, newNode, null);
|
|
43
|
+
}
|
|
44
|
+
return originalInsertBefore.call(this, newNode, referenceNode);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
installDomResilience();
|