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