@subnoto/embed-qwik 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 +1 -0
- package/index.ts +1 -0
- package/package.json +36 -0
- package/src/SignEmbed.tsx +54 -0
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.tsx";
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@subnoto/embed-qwik",
|
|
3
|
+
"version": "0.555.1",
|
|
4
|
+
"description": "Subnoto embed – qwik 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/qwik"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"subnoto",
|
|
13
|
+
"embeds",
|
|
14
|
+
"qwik"
|
|
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
|
+
"@builder.io/qwik": ">=1.0.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Fragment, component$, h, useComputed$ } from "@builder.io/qwik";
|
|
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
|
+
export const DEFAULT_HOST = "https://app.subnoto.com";
|
|
30
|
+
export const SignEmbed = component$((props: SignEmbedProps) => {
|
|
31
|
+
const src = useComputed$(() => {
|
|
32
|
+
if (props.iframeUrl) return props.iframeUrl;
|
|
33
|
+
const base = (props.host || DEFAULT_HOST).replace(/\/$/, "");
|
|
34
|
+
const token = props.token ?? "";
|
|
35
|
+
return `${base}/embeds/sign#t=${encodeURIComponent(token)}`;
|
|
36
|
+
});
|
|
37
|
+
const state: any = {};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<iframe
|
|
41
|
+
allow="fullscreen"
|
|
42
|
+
src={src.value}
|
|
43
|
+
title={props.title ?? "Subnoto signing"}
|
|
44
|
+
style={{
|
|
45
|
+
width: "100%",
|
|
46
|
+
height: "100%",
|
|
47
|
+
border: 0,
|
|
48
|
+
}}
|
|
49
|
+
class={props.className}
|
|
50
|
+
></iframe>
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export default SignEmbed;
|