@prosopo/svelte-procaptcha-wrapper 1.0.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,4 @@
1
+ import type { ProcaptchaLanguages, ProcaptchaRenderOptions, ProcaptchaType } from "@prosopo/procaptcha-wrapper";
2
+ import ProcaptchaComponent from "./procaptchaComponent.svelte";
3
+ export { ProcaptchaComponent, type ProcaptchaRenderOptions, type ProcaptchaType, type ProcaptchaLanguages, };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACX,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EACN,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACxB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import ProcaptchaComponent from "./procaptchaComponent.svelte";
2
+ export { ProcaptchaComponent, };
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import {tick, onMount} from "svelte";
3
+ import type {HTMLAttributes} from "svelte/elements";
4
+ import {type ProcaptchaRenderOptions, renderProcaptcha} from "@prosopo/procaptcha-wrapper";
5
+
6
+ type ProcaptchaComponentProperties = ProcaptchaRenderOptions & {
7
+ htmlAttributes?: AllHtmlAttributes,
8
+ }
9
+
10
+ type AllHtmlAttributes = HTMLAttributes<HTMLElement> & {
11
+ // allow custom data attributes
12
+ [key: string]: any
13
+ };
14
+
15
+ const properties: ProcaptchaComponentProperties = $props();
16
+ const htmlWrapperElementAttributes = $derived(properties.htmlAttributes || {});
17
+ let wrapperElement: HTMLDivElement;
18
+
19
+ onMount(() => {
20
+ tick().then(() => {
21
+ renderProcaptcha(wrapperElement, properties);
22
+ });
23
+ });
24
+
25
+ </script>
26
+
27
+ <div bind:this={wrapperElement} {...htmlWrapperElementAttributes}></div>
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ import { type ProcaptchaRenderOptions } from "@prosopo/procaptcha-wrapper";
3
+ type AllHtmlAttributes = HTMLAttributes<HTMLElement> & {
4
+ [key: string]: any;
5
+ };
6
+ type ProcaptchaComponentProperties = ProcaptchaRenderOptions & {
7
+ htmlAttributes?: AllHtmlAttributes;
8
+ };
9
+ declare const ProcaptchaComponent: import("svelte").Component<ProcaptchaComponentProperties, {}, "">;
10
+ type ProcaptchaComponent = ReturnType<typeof ProcaptchaComponent>;
11
+ export default ProcaptchaComponent;
12
+ //# sourceMappingURL=procaptchaComponent.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procaptchaComponent.svelte.d.ts","sourceRoot":"","sources":["../src/procaptchaComponent.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,KAAK,uBAAuB,EAAmB,MAAM,6BAA6B,CAAC;AAGvF,KAAK,iBAAiB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAEnD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAC;AAEF,KAAK,6BAA6B,GAAG,uBAAuB,GAAG;IAC3D,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAwBN,QAAA,MAAM,mBAAmB,mEAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@prosopo/svelte-procaptcha-wrapper",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "engines": {
6
+ "node": "20",
7
+ "npm": "10.8.2"
8
+ },
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "svelte": "./dist/index.js"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "test": "echo \"No test specified\"",
19
+ "clean": "del-cli ./dist && del-cli ./.svelte-kit",
20
+ "package": "svelte-package -i ./src -o ./dist",
21
+ "build": "npm run package && del-cli ./.svelte-kit",
22
+ "dev": "npm run package -- -w"
23
+ },
24
+ "dependencies": {
25
+ "@prosopo/procaptcha-wrapper": ">=2.5.4"
26
+ },
27
+ "peerDependencies": {
28
+ "svelte": "^5.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@sveltejs/package": "2.3.10",
32
+ "del-cli": "6.0.0"
33
+ },
34
+ "author": "PROSOPO LIMITED <info@prosopo.io>",
35
+ "license": "Apache-2.0",
36
+ "bugs": {
37
+ "url": "https://github.com/prosopo/captcha/issues"
38
+ },
39
+ "homepage": "https://github.com/prosopo/captcha#readme",
40
+ "sideEffects": false
41
+ }
package/readme.md ADDED
@@ -0,0 +1,7 @@
1
+ # Svelte Procaptcha Wrapper
2
+
3
+ ## 1. About the package
4
+
5
+ A Svelte component that provides seamless integration of [Procaptcha](https://prosopo.io/) into any Svelte project.
6
+
7
+ Refer to the [Procaptcha Docs](https://docs.prosopo.io/en/) to see an example of usage.