altcha 1.2.0 → 1.4.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 +11 -8
- package/dist/altcha.d.ts +5 -0
- package/dist/altcha.js +1393 -1341
- package/dist/altcha.umd.cjs +5 -3
- package/dist_external/altcha.d.ts +5 -0
- package/dist_external/altcha.js +1488 -1437
- package/dist_external/altcha.umd.cjs +4 -3
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# ALTCHA
|
|
2
2
|
|
|
3
|
-
ALTCHA
|
|
3
|
+
ALTCHA leverages a proof-of-work mechanism to safeguard your website, APIs, and online services from spam and abuse. Unlike traditional solutions, ALTCHA is self-hosted, does not rely on cookies or fingerprinting, and ensures complete user privacy. It is fully compliant with [GDPR](https://altcha.org/docs/gdpr/), [WCAG 2.2 AA-level](https://altcha.org/docs/wcag/), and the [European Accessibility Act](https://altcha.org/docs/european-accessibility-act-2025/).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
For more details, visit [ALTCHA](https://altcha.org).
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
- **Frictionless
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
9
|
+
- **Frictionless Experience**: Utilizes proof-of-work (PoW) instead of visual puzzles, ensuring a seamless user experience.
|
|
10
|
+
- **Cookie-Free Design**: Built to be GDPR-compliant by default, with no cookies or tracking.
|
|
11
|
+
- **Fully Accessible**: Meets WCAG 2.2 AA-level standards and complies with the European Accessibility Act (EAA).
|
|
12
|
+
- **Lightweight**: Minimal bundle size for fast page loads and optimal performance.
|
|
13
|
+
- **Self-Hosted**: Operates independently without depending on third-party services.
|
|
14
|
+
- **SaaS Option Available**: Get started quickly with the SaaS API at [altcha.org](https://altcha.org/).
|
|
14
15
|
|
|
15
16
|
## Examples
|
|
16
17
|
|
|
@@ -111,8 +112,10 @@ Additional options:
|
|
|
111
112
|
- **floating**: Enable floating UI (possible values: `auto`, `top`, `bottom`).
|
|
112
113
|
- **floatinganchor**: CSS selector of the "anchor" to which the floating UI will be attached (defaults to the `button[type="submit"]` in the related form).
|
|
113
114
|
- **floatingoffset**: Y offset from the anchor element for the floating UI in pixels (defaults to `12`).
|
|
115
|
+
- **floatingpersist**: Whether to "persist" (keep visible) the floating widget after verification (possible values: `true` | `false` | `focus`; defaults to `false`, meaning the widget will hide).
|
|
114
116
|
- **hidefooter**: Hide the footer (ALTCHA link).
|
|
115
117
|
- **hidelogo**: Hide the ALTCHA logo.
|
|
118
|
+
- **id**: The checkbox `id` attribute. Useful for multiple instances of the widget on the same page.
|
|
116
119
|
- **maxnumber**: Max number to iterate to (defaults to 1,000,000).
|
|
117
120
|
- **name**: Name of the hidden field containing the payload (defaults to "altcha").
|
|
118
121
|
- **strings**: JSON-encoded translation strings. Refer to [customization](https://altcha.org/docs/widget-customization).
|
|
@@ -193,7 +196,7 @@ export interface Configure {
|
|
|
193
196
|
floating?: 'auto' | 'top' | 'bottom';
|
|
194
197
|
floatinganchor?: string;
|
|
195
198
|
floatingoffset?: number;
|
|
196
|
-
|
|
199
|
+
floatingpersist?: boolean | 'focus';
|
|
197
200
|
hidefooter?: boolean;
|
|
198
201
|
hidelogo?: boolean;
|
|
199
202
|
maxnumber?: number;
|
package/dist/altcha.d.ts
CHANGED
|
@@ -31,8 +31,10 @@ declare global {
|
|
|
31
31
|
floating?: 'auto' | 'top' | 'bottom' | 'false' | '' | boolean;
|
|
32
32
|
floatinganchor?: string;
|
|
33
33
|
floatingoffset?: number;
|
|
34
|
+
floatingpersist?: 'focus' | boolean;
|
|
34
35
|
hidefooter?: boolean;
|
|
35
36
|
hidelogo?: boolean;
|
|
37
|
+
id?: string;
|
|
36
38
|
maxnumber?: number;
|
|
37
39
|
mockerror?: boolean;
|
|
38
40
|
name?: string;
|
|
@@ -61,9 +63,12 @@ declare global {
|
|
|
61
63
|
getFloatingAnchor: () => HTMLElement | null;
|
|
62
64
|
getPlugin: <T = unknown>(name: string) => T;
|
|
63
65
|
getState: () => AltchaState;
|
|
66
|
+
hide: () => void;
|
|
67
|
+
repositionFloating: (viewportOffset: numer = 20) => void;
|
|
64
68
|
reset: (newState: AltchaState = 'unverified', err: string | null = null) => void;
|
|
65
69
|
setFloatingAnchor: (el: HTMLElement) => void;
|
|
66
70
|
setState: (newState: AltchaState, err: string | null = null) => void;
|
|
71
|
+
show: () => void;
|
|
67
72
|
verify: () => Promise<void>;
|
|
68
73
|
}
|
|
69
74
|
|