@konemono/nostr-share-component 0.2.7 → 0.4.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.
- package/README.md +22 -11
- package/dist/main.d.ts +1 -4
- package/dist/nostr-share-component.es.js +849 -935
- package/dist/nostr-share-component.js +9 -18
- package/dist/nostr-share-component.umd.js +9 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
<nostr-share></nostr-share>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
- data-
|
|
23
|
-
-
|
|
22
|
+
- data-text に共有したい文字列を指定することができます。
|
|
23
|
+
- 指定されていない場合、設置したサイトのURLとタイトルが共有されます。
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
例:
|
|
27
27
|
```html
|
|
28
|
-
<nostr-share data-
|
|
28
|
+
<nostr-share data-text="Example Text"></nostr-share>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
|
|
@@ -37,13 +37,24 @@ data-type に以下の値を指定できます:
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
### 4. カスタム共有ボタンを作成
|
|
40
|
-
コンポーネント内に任意のコンテンツを挿入することで、共有ボタンをカスタマイズできます。
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
`part(button)` と `part(text)` を使用することで、ボタンとテキストのスタイルを個別にカスタマイズできます。
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
nostr-share::part(button) {
|
|
45
|
+
background-color: rgb(0, 136, 255);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
nostr-share::part(button):hover {
|
|
49
|
+
background-color: rgb(255, 0, 0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
nostr-share::part(text) {
|
|
53
|
+
font-style: italic;
|
|
54
|
+
font-family: 'Courier New', Courier, monospace;
|
|
55
|
+
font-size: medium;
|
|
56
|
+
}
|
|
57
|
+
|
|
47
58
|
|
|
48
59
|
|
|
49
60
|
-----
|
|
@@ -61,14 +72,14 @@ data-type に以下の値を指定できます:
|
|
|
61
72
|
```javascript
|
|
62
73
|
{
|
|
63
74
|
name: "クライアント名",
|
|
64
|
-
url: "https://example.com/share?text={text}
|
|
75
|
+
url: "https://example.com/share?text={text}",
|
|
65
76
|
icon: "https://example.com/favicon.ico",
|
|
66
77
|
}
|
|
67
78
|
```
|
|
68
79
|
## フィールドの説明
|
|
69
80
|
- name: クライアントの名前(短くわかりやすいものを推奨)。
|
|
70
81
|
- url: クライアントのリンク共有URL。
|
|
71
|
-
- {text}
|
|
82
|
+
- {text} のパラメータを含めることで動的なリンク生成を可能にします。
|
|
72
83
|
- icon: クライアントのファビコンURL(任意ですが、できるだけ提供してください)。
|
|
73
84
|
|
|
74
85
|
|
package/dist/main.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export { default as Dialog } from "$lib/Dialog.svelte";
|
|
2
2
|
export { default as NostrShare } from "$lib/NostrShare.svelte";
|
|
3
3
|
export interface DialogProps {
|
|
4
|
-
|
|
5
|
-
content: string;
|
|
4
|
+
text: string;
|
|
6
5
|
onClose: () => void;
|
|
7
6
|
}
|
|
8
7
|
export interface NostrShareProps {
|
|
9
|
-
url: string;
|
|
10
8
|
text: string;
|
|
11
|
-
hashtags?: string[];
|
|
12
9
|
}
|