@subnoto/embed-solid 0.555.1

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/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as SignEmbed } from "./src/SignEmbed";
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as SignEmbed } from "./src/SignEmbed.jsx";
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@subnoto/embed-solid",
3
+ "version": "0.555.1",
4
+ "description": "Subnoto embed – solid components",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/nickel-org/subnoto-monorepo-public.git",
9
+ "directory": "libs/embeds/output/solid"
10
+ },
11
+ "keywords": [
12
+ "subnoto",
13
+ "embeds",
14
+ "solid"
15
+ ],
16
+ "type": "module",
17
+ "sideEffects": false,
18
+ "files": [
19
+ "src/",
20
+ "index.ts",
21
+ "index.d.ts"
22
+ ],
23
+ "main": "index.ts",
24
+ "module": "index.ts",
25
+ "types": "index.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./index.ts",
29
+ "import": "./index.ts",
30
+ "default": "./index.ts"
31
+ }
32
+ },
33
+ "peerDependencies": {
34
+ "solid-js": ">=1.0.0"
35
+ }
36
+ }
@@ -0,0 +1,57 @@
1
+ import { createSignal, createMemo } from "solid-js";
2
+
3
+ // Copyright 2025 Subnoto
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+
17
+ export type SignEmbedProps = {
18
+ /** Pre-built iframe URL. If set, host and token are ignored. */
19
+ iframeUrl?: string;
20
+ /** Base URL of the Subnoto app (e.g. https://app.subnoto.com). Used when token is set. */
21
+ host?: string;
22
+ /** Iframe token (from e.g. authentication_create-iframe-token). Passed in URL hash as #t=... */
23
+ token?: string;
24
+ /** Optional CSS class for the iframe. */
25
+ className?: string;
26
+ /** Iframe title for accessibility. */
27
+ title?: string;
28
+ };
29
+
30
+ const DEFAULT_HOST = "https://app.subnoto.com";
31
+
32
+ function SignEmbed(props: SignEmbedProps) {
33
+ const src = createMemo(() => {
34
+ if (props.iframeUrl) return props.iframeUrl;
35
+ const base = (props.host || DEFAULT_HOST).replace(/\/$/, "");
36
+ const token = props.token ?? "";
37
+ return `${base}/embeds/sign#t=${encodeURIComponent(token)}`;
38
+ });
39
+
40
+ return (
41
+ <>
42
+ <iframe
43
+ class={props.className}
44
+ allow="fullscreen"
45
+ src={src()}
46
+ title={props.title ?? "Subnoto signing"}
47
+ style={{
48
+ width: "100%",
49
+ height: "100%",
50
+ border: 0,
51
+ }}
52
+ ></iframe>
53
+ </>
54
+ );
55
+ }
56
+
57
+ export default SignEmbed;