@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 CHANGED
@@ -19,13 +19,13 @@
19
19
  <nostr-share></nostr-share>
20
20
  ```
21
21
 
22
- - data-url、data-title、data-text にそれぞれ共有したい文字列を指定することができます。
23
- - url、title、text が指定されていない場合、設置したサイトのURLとタイトルが共有されます。
22
+ - data-text に共有したい文字列を指定することができます。
23
+ - 指定されていない場合、設置したサイトのURLとタイトルが共有されます。
24
24
 
25
25
 
26
26
  例:
27
27
  ```html
28
- <nostr-share data-url="https://example.com" data-title="Example Title" data-text="Example Text"></nostr-share>
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
- ```html
43
- <nostr-share data-style="" data-url="https://example.com" data-title="Example Title" data-text="Example Text">
44
- Share on Nostr
45
- </nostr-share>
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}&url={url}&title={title}",
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}, {url}, {title} のパラメータを含めることで動的なリンク生成を可能にします。
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
- title: string;
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
  }