santoid-sdk 9.1.0 → 9.2.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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * O canvas do desafio de luz nasce com o atributo `hidden` e e' exibido com
3
+ * `style.display = 'block'`. CSS de reset que forca `[hidden] { display: none
4
+ * !important }` - o do Tailwind v4, por exemplo - vence o estilo inline, a tela
5
+ * nao pisca e a verificacao perde o desafio de luz. Aqui o atributo acompanha
6
+ * o display que a captura pediu, entao nenhum CSS da pagina consegue esconde-lo.
7
+ */
8
+ export declare function keepFreshnessCanvasVisible(element: HTMLElement): () => void;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.keepFreshnessCanvasVisible = void 0;
4
+ const FRESHNESS_CANVAS_CLASS = 'amplify-liveness-freshness-canvas';
5
+ function syncHidden(canvas) {
6
+ if (canvas.style.display === 'block') {
7
+ canvas.removeAttribute('hidden');
8
+ }
9
+ else if (canvas.style.display === 'none') {
10
+ canvas.setAttribute('hidden', '');
11
+ }
12
+ }
13
+ /**
14
+ * O canvas do desafio de luz nasce com o atributo `hidden` e e' exibido com
15
+ * `style.display = 'block'`. CSS de reset que forca `[hidden] { display: none
16
+ * !important }` - o do Tailwind v4, por exemplo - vence o estilo inline, a tela
17
+ * nao pisca e a verificacao perde o desafio de luz. Aqui o atributo acompanha
18
+ * o display que a captura pediu, entao nenhum CSS da pagina consegue esconde-lo.
19
+ */
20
+ function keepFreshnessCanvasVisible(element) {
21
+ const observer = new MutationObserver((mutations) => {
22
+ var _a;
23
+ for (const mutation of mutations) {
24
+ const target = mutation.target;
25
+ if (mutation.type === 'attributes' && ((_a = target.classList) === null || _a === void 0 ? void 0 : _a.contains(FRESHNESS_CANVAS_CLASS))) {
26
+ syncHidden(target);
27
+ }
28
+ }
29
+ });
30
+ observer.observe(element, { subtree: true, attributes: true, attributeFilter: ['style'] });
31
+ return () => { observer.disconnect(); };
32
+ }
33
+ exports.keepFreshnessCanvasVisible = keepFreshnessCanvasVisible;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "santoid-sdk",
3
- "version": "9.1.0",
3
+ "version": "9.2.0",
4
4
  "description": "",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",