@konemono/nostr-share-component 0.0.16 → 0.0.18
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/README.md +17 -36
- package/dist/icons.d.ts +4 -0
- package/dist/nostr-share-component.es.js +824 -881
- package/dist/nostr-share-component.js +37 -78
- package/dist/nostr-share-component.umd.js +37 -78
- package/package.json +6 -6
- package/dist/lib/icons.d.ts +0 -4
- package/dist/main.d.ts +0 -2
- /package/dist/{lib/list.d.ts → list.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,47 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# nostr-share-component
|
|
2
2
|
|
|
3
|
-
This template should help get you started developing with Svelte and TypeScript in Vite.
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
``<head>``に以下のコードを各。{version}の部分は適切なバージョンに変更してください(e.g. 0.0.10)
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Technical considerations
|
|
14
|
-
|
|
15
|
-
**Why use this over SvelteKit?**
|
|
16
|
-
|
|
17
|
-
- It brings its own routing solution which might not be preferable for some users.
|
|
18
|
-
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
|
|
19
|
-
|
|
20
|
-
This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
|
|
21
|
-
|
|
22
|
-
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
|
|
23
|
-
|
|
24
|
-
**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
|
|
25
|
-
|
|
26
|
-
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.
|
|
27
|
-
|
|
28
|
-
**Why include `.vscode/extensions.json`?**
|
|
6
|
+
```
|
|
7
|
+
<script src="
|
|
8
|
+
https://cdn.jsdelivr.net/npm/@konemono/nostr-share-component@{version}/dist/nostr-share-component.min.js
|
|
9
|
+
"></script>
|
|
10
|
+
```
|
|
29
11
|
|
|
30
|
-
|
|
12
|
+
任意の位置に以下のコードを配置
|
|
31
13
|
|
|
32
|
-
|
|
14
|
+
{url}{title}{text}はそれぞれ共有したい文字列に変換
|
|
15
|
+
(なくても良い)
|
|
33
16
|
|
|
34
|
-
|
|
17
|
+
icon={true}にすると◯サイズのボタン(なくても良い。defaultはfalse)
|
|
35
18
|
|
|
36
|
-
**Why is HMR not preserving my local component state?**
|
|
37
19
|
|
|
38
|
-
|
|
20
|
+
```
|
|
21
|
+
<nostr-share url={url} shareTitle={title} text={text} icon={true} ></nostr-share>
|
|
22
|
+
```
|
|
39
23
|
|
|
40
|
-
|
|
24
|
+
中に任意のコンテントをいれると共有ボタンがカスタムできる
|
|
41
25
|
|
|
42
|
-
```ts
|
|
43
|
-
// store.ts
|
|
44
|
-
// An extremely simple external store
|
|
45
|
-
import { writable } from 'svelte/store'
|
|
46
|
-
export default writable(0)
|
|
47
26
|
```
|
|
27
|
+
<nostr-share style="" url={url} shareTitle={title} text={text} icon={true}>Share on Nostr</nostr-share>
|
|
28
|
+
```
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const nostrIcon = "<svg class=\"nostr-icon\" \nversion=\"1.1\"\nid=\"_8\"\nxmlns=\"http://www.w3.org/2000/svg\"\nxmlns:xlink=\"http://www.w3.org/1999/xlink\"\nx=\"0px\"\ny=\"0px\"\nviewBox=\"0 0 256 256\"\nstyle=\"enable-background:new 0 0 256 256;\"\nxml:space=\"preserve\"\n>\n<style type=\"text/css\">\n .st0 {\n fill: none;\n }\n .st1 {\n fill: #ffffff;\n }\n .st2 {\n fill: #662482;\n }\n</style>\n<g>\n <path\n class=\"st0\"\n d=\"M0,0v256h256V0H0z M231.2,159.2c0,20.7,0,31.1-3.5,42.2c-4.4,12.2-14,21.8-26.2,26.2\nc-11.1,3.5-21.5,3.5-42.2,3.5H96.8c-20.7,0-31.1,0-42.2-3.5c-12.2-4.4-21.8-14-26.2-26.2c-3.5-11.1-3.5-21.5-3.5-42.2V96.8\nc0-20.7,0-31.1,3.5-42.2c4.4-12.2,14-21.8,26.2-26.2c11.2-3.5,21.5-3.5,42.2-3.5h62.5c20.7,0,31.1,0,42.2,3.5\nc12.2,4.4,21.8,14,26.2,26.2c3.5,11.1,3.5,21.5,3.5,42.2V159.2z\"\n />\n <circle class=\"st1\" cx=\"137.9\" cy=\"99\" r=\"12.1\" />\n <path\n class=\"st1\"\n d=\"M210.8,115.9c0-47.3-27.7-68.7-64.4-68.7c-16.4,0-31,4.4-42.4,12.5c-3.8,2.7-9,0.1-9-4.5\nc0-3.1-2.5-5.7-5.7-5.7H57.7c-3.1,0-5.7,2.5-5.7,5.7v144c0,3.1,2.5,5.7,5.7,5.7h33.7c3.1,0,5.6-2.5,5.6-5.6v-8.4\nc0-62.8-33.2-109.8-0.4-116c30-5.7,64.1-3,64.5,20.1c0,2,0.3,8,8.6,11.2c5,2,12.6,2.6,22.6,2.4c0,0,9.1-0.7,9.1,8.5\nc0,11.5-20.4,10.7-20.4,10.7c-6.7,0.3-22.6-1.5-31.7,1.2c-4.8,1.5-9,4.2-11.5,9.1c-4.2,8.3-6.2,26.5-6.5,45.5v15.5\nc0,3.1,2.5,5.7,5.7,5.7h68c3.1,0,5.7-2.5,5.7-5.7l0,0V115.9z\"\n />\n <path\n class=\"st2\"\n d=\"M227.6,54.6c-4.4-12.2-14-21.8-26.2-26.2c-11.1-3.5-21.5-3.5-42.2-3.5H96.8c-20.7,0-31.1,0-42.2,3.5\nc-12.2,4.4-21.8,14-26.2,26.2c-3.5,11.2-3.5,21.5-3.5,42.2v62.5c0,20.7,0,31.1,3.5,42.2c4.4,12.2,14,21.8,26.2,26.2\nc11.2,3.5,21.5,3.5,42.2,3.5h62.5c20.7,0,31.1,0,42.2-3.5c12.2-4.4,21.8-14,26.2-26.2c3.5-11.1,3.5-21.5,3.5-42.2V96.8\nC231.2,76.1,231.2,65.7,227.6,54.6z M205.1,204.8h-68c-3.1,0-5.7-2.5-5.7-5.7v-15.5c0.3-19,2.3-37.2,6.5-45.5\nc2.5-5,6.7-7.7,11.5-9.1c9-2.7,24.9-0.9,31.7-1.2c0,0,20.4,0.8,20.4-10.7c0-9.3-9.1-8.5-9.1-8.5c-10,0.3-17.7-0.4-22.6-2.4\nc-8.3-3.3-8.6-9.2-8.6-11.2c-0.4-23.1-34.5-25.9-64.5-20.1c-32.8,6.2,0.4,53.3,0.4,116v8.4c-0.1,3.1-2.5,5.6-5.6,5.6H57.7\nc-3.1,0-5.7-2.5-5.7-5.7v-144c0-3.1,2.5-5.7,5.7-5.7h31.7c3.1,0,5.7,2.5,5.7,5.7c0,4.7,5.2,7.2,9,4.5c11.4-8.2,26-12.5,42.4-12.5\nc36.7,0,64.4,21.4,64.4,68.7v83.2l0,0C210.8,202.3,208.3,204.8,205.1,204.8z M125.7,99c0-6.7,5.4-12.1,12.1-12.1S150,92.3,150,99\ns-5.4,12.1-12.1,12.1S125.7,105.8,125.7,99z\"\n />\n</g>\n</svg>";
|
|
2
|
+
export declare const githubIcon = "\n <svg viewBox=\"0 0 98 96\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z\"/></svg>";
|
|
3
|
+
export declare const lightningIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" enable-background=\"new 0 0 24 24\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" ><g><rect fill=\"none\" height=\"24\" width=\"24\"/></g><g><path d=\"M11,21h-1l1-7H7.5c-0.88,0-0.33-0.75-0.31-0.78C8.48,10.94,10.42,7.54,13.01,3h1l-1,7h3.51c0.4,0,0.62,0.19,0.4,0.66 C12.97,17.55,11,21,11,21z\"/></g></svg>";
|
|
4
|
+
export declare const lightningIcon2 = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 256 256\"><path d=\"m213.85 125.46l-112 120a8 8 0 0 1-13.69-7l14.66-73.33l-57.63-21.64a8 8 0 0 1-3-13l112-120a8 8 0 0 1 13.69 7l-14.7 73.41l57.63 21.61a8 8 0 0 1 3 12.95Z\"/></svg>";
|