@captchafox/react 1.0.2 → 1.1.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,13 @@
1
+ import * as react from 'react';
2
+ import { WidgetApi, WidgetOptions } from '@captchafox/types';
3
+
4
+ type CaptchaFoxInstance = Omit<WidgetApi, 'render'>;
5
+ declare const CaptchaFox: react.ForwardRefExoticComponent<WidgetOptions & {
6
+ /** Called after the widget has been loaded */
7
+ onLoad?: (() => void) | undefined;
8
+ className?: string | undefined;
9
+ } & react.RefAttributes<CaptchaFoxInstance>>;
10
+
11
+ declare const CAPTCHA_RESPONSE_KEY = "cf-captcha-response";
12
+
13
+ export { CAPTCHA_RESPONSE_KEY, CaptchaFox, CaptchaFoxInstance };
package/dist/index.js CHANGED
@@ -63,7 +63,6 @@ function loadCaptchaScript() {
63
63
  script.src = SCRIPT_SRC;
64
64
  script.async = true;
65
65
  script.defer = true;
66
- script.type = "module";
67
66
  script.onerror = rejectFn;
68
67
  document.body.appendChild(script);
69
68
  return mountInstance;
package/dist/index.mjs CHANGED
@@ -37,7 +37,6 @@ function loadCaptchaScript() {
37
37
  script.src = SCRIPT_SRC;
38
38
  script.async = true;
39
39
  script.defer = true;
40
- script.type = "module";
41
40
  script.onerror = rejectFn;
42
41
  document.body.appendChild(script);
43
42
  return mountInstance;
package/package.json CHANGED
@@ -1,13 +1,25 @@
1
1
  {
2
2
  "name": "@captchafox/react",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
7
7
  "sideEffects": false,
8
8
  "license": "MIT",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.mts",
13
+ "default": "./dist/index.mjs"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
19
+ }
20
+ },
9
21
  "files": [
10
- "dist/**"
22
+ "dist"
11
23
  ],
12
24
  "scripts": {
13
25
  "build": "tsup src/index.tsx --format esm,cjs --dts --external react",
@@ -22,7 +34,7 @@
22
34
  "react-dom": ">=16.8.0"
23
35
  },
24
36
  "dependencies": {
25
- "@captchafox/types": "*"
37
+ "@captchafox/types": "^1.1.0"
26
38
  },
27
39
  "devDependencies": {
28
40
  "@captchafox/internal": "*",
@@ -37,7 +49,7 @@
37
49
  "jest": "^29.5.0",
38
50
  "jest-environment-jsdom": "^29.5.0",
39
51
  "react": "^18.1.0",
40
- "tsup": "^6.6.3",
52
+ "tsup": "^7.1.0",
41
53
  "ts-jest": "^29.0.5",
42
54
  "typescript": "^4.9.5"
43
55
  },