nostr-components 0.2.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/LICENSE +21 -0
- package/README.md +334 -0
- package/dist/assets/base-styles-CBypR3FR.js +145 -0
- package/dist/assets/base-styles-CBypR3FR.js.map +1 -0
- package/dist/assets/copy-delegation-C4uvRTVM.js +15 -0
- package/dist/assets/copy-delegation-C4uvRTVM.js.map +1 -0
- package/dist/assets/dialog-component-Dqg0QU9I.js +66 -0
- package/dist/assets/dialog-component-Dqg0QU9I.js.map +1 -0
- package/dist/assets/dialog-likers-BzTesCZa.js +238 -0
- package/dist/assets/dialog-likers-BzTesCZa.js.map +1 -0
- package/dist/assets/icons-Dr_d9MII.js +105 -0
- package/dist/assets/icons-Dr_d9MII.js.map +1 -0
- package/dist/assets/nip05-utils-BNBHUmkr.js +2 -0
- package/dist/assets/nip05-utils-BNBHUmkr.js.map +1 -0
- package/dist/assets/nostr-service-pr_crY62.js +78 -0
- package/dist/assets/nostr-service-pr_crY62.js.map +1 -0
- package/dist/assets/nostr-user-component-Q7GeeFyu.js +2 -0
- package/dist/assets/nostr-user-component-Q7GeeFyu.js.map +1 -0
- package/dist/assets/preload-helper-D7HrI6pR.js +2 -0
- package/dist/assets/preload-helper-D7HrI6pR.js.map +1 -0
- package/dist/assets/pure-jrVhRVpB.js +2 -0
- package/dist/assets/pure-jrVhRVpB.js.map +1 -0
- package/dist/assets/theme-C1r1Zw8r.js +2 -0
- package/dist/assets/theme-C1r1Zw8r.js.map +1 -0
- package/dist/assets/user-resolver-C-E6KdwY.js +2 -0
- package/dist/assets/user-resolver-C-E6KdwY.js.map +1 -0
- package/dist/assets/utils--bxLbhGF.js +2 -0
- package/dist/assets/utils--bxLbhGF.js.map +1 -0
- package/dist/assets/zap-utils-B1sz0Abx.js +2 -0
- package/dist/assets/zap-utils-B1sz0Abx.js.map +1 -0
- package/dist/components/nostr-comment.es.js +924 -0
- package/dist/components/nostr-comment.es.js.map +1 -0
- package/dist/components/nostr-dm.es.js +217 -0
- package/dist/components/nostr-dm.es.js.map +1 -0
- package/dist/components/nostr-follow-button.es.js +103 -0
- package/dist/components/nostr-follow-button.es.js.map +1 -0
- package/dist/components/nostr-like.es.js +296 -0
- package/dist/components/nostr-like.es.js.map +1 -0
- package/dist/components/nostr-live-chat.es.js +523 -0
- package/dist/components/nostr-live-chat.es.js.map +1 -0
- package/dist/components/nostr-post.es.js +441 -0
- package/dist/components/nostr-post.es.js.map +1 -0
- package/dist/components/nostr-profile-badge.es.js +100 -0
- package/dist/components/nostr-profile-badge.es.js.map +1 -0
- package/dist/components/nostr-profile.es.js +287 -0
- package/dist/components/nostr-profile.es.js.map +1 -0
- package/dist/components/nostr-zap.es.js +694 -0
- package/dist/components/nostr-zap.es.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/nostr-comment.d.ts +4 -0
- package/dist/nostr-components.es.js +2 -0
- package/dist/nostr-components.es.js.map +1 -0
- package/dist/nostr-components.umd.js +4200 -0
- package/dist/nostr-components.umd.js.map +1 -0
- package/dist/nostr-dm.d.ts +4 -0
- package/dist/nostr-follow-button.d.ts +4 -0
- package/dist/nostr-like.d.ts +4 -0
- package/dist/nostr-live-chat.d.ts +4 -0
- package/dist/nostr-post.d.ts +4 -0
- package/dist/nostr-profile-badge.d.ts +4 -0
- package/dist/nostr-profile.d.ts +4 -0
- package/dist/nostr-zap.d.ts +4 -0
- package/dist/src/base/base-component/nostr-base-component.d.ts +116 -0
- package/dist/src/base/copy-delegation.d.ts +5 -0
- package/dist/src/base/dialog-component/dialog-component.d.ts +67 -0
- package/dist/src/base/dialog-component/style.d.ts +5 -0
- package/dist/src/base/event-component/nostr-event-component.d.ts +53 -0
- package/dist/src/base/render-options.d.ts +5 -0
- package/dist/src/base/resolvers/event-resolver.d.ts +20 -0
- package/dist/src/base/resolvers/user-resolver.d.ts +19 -0
- package/dist/src/base/text-row/render-name.d.ts +7 -0
- package/dist/src/base/text-row/render-nip05.d.ts +1 -0
- package/dist/src/base/text-row/render-npub.d.ts +1 -0
- package/dist/src/base/text-row/render-text-row.d.ts +9 -0
- package/dist/src/base/user-component/nostr-user-component.d.ts +43 -0
- package/dist/src/common/base-styles.d.ts +44 -0
- package/dist/src/common/constants.d.ts +4 -0
- package/dist/src/common/date-utils.d.ts +9 -0
- package/dist/src/common/icons.d.ts +7 -0
- package/dist/src/common/nip05-utils.d.ts +13 -0
- package/dist/src/common/nostr-service.d.ts +40 -0
- package/dist/src/common/theme.d.ts +4 -0
- package/dist/src/common/types.d.ts +1 -0
- package/dist/src/common/utils.d.ts +34 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/nostr-comment/nostr-comment.d.ts +60 -0
- package/dist/src/nostr-comment/render.d.ts +15 -0
- package/dist/src/nostr-comment/utils.d.ts +81 -0
- package/dist/src/nostr-dm/nostr-dm.d.ts +34 -0
- package/dist/src/nostr-dm/render.d.ts +15 -0
- package/dist/src/nostr-follow-button/nostr-follow-button.d.ts +24 -0
- package/dist/src/nostr-follow-button/render.d.ts +11 -0
- package/dist/src/nostr-follow-button/style.d.ts +1 -0
- package/dist/src/nostr-like/dialog-help-style.d.ts +1 -0
- package/dist/src/nostr-like/dialog-help.d.ts +2 -0
- package/dist/src/nostr-like/dialog-likers-style.d.ts +1 -0
- package/dist/src/nostr-like/dialog-likers.d.ts +24 -0
- package/dist/src/nostr-like/like-utils.d.ts +52 -0
- package/dist/src/nostr-like/nostr-like.d.ts +49 -0
- package/dist/src/nostr-like/render.d.ts +10 -0
- package/dist/src/nostr-like/style.d.ts +1 -0
- package/dist/src/nostr-live-chat/nostr-live-chat.d.ts +65 -0
- package/dist/src/nostr-live-chat/render.d.ts +31 -0
- package/dist/src/nostr-post/nostr-post.d.ts +25 -0
- package/dist/src/nostr-post/parse-text.d.ts +8 -0
- package/dist/src/nostr-post/render-content.d.ts +5 -0
- package/dist/src/nostr-post/render.d.ts +19 -0
- package/dist/src/nostr-post/style.d.ts +1 -0
- package/dist/src/nostr-profile/nostr-profile.d.ts +24 -0
- package/dist/src/nostr-profile/render-stats.d.ts +1 -0
- package/dist/src/nostr-profile/render.d.ts +22 -0
- package/dist/src/nostr-profile/style.d.ts +1 -0
- package/dist/src/nostr-profile-badge/nostr-profile-badge.d.ts +34 -0
- package/dist/src/nostr-profile-badge/render.d.ts +11 -0
- package/dist/src/nostr-profile-badge/style.d.ts +1 -0
- package/dist/src/nostr-zap/dialog-help-style.d.ts +5 -0
- package/dist/src/nostr-zap/dialog-help.d.ts +2 -0
- package/dist/src/nostr-zap/dialog-zap-style.d.ts +6 -0
- package/dist/src/nostr-zap/dialog-zap.d.ts +31 -0
- package/dist/src/nostr-zap/dialog-zappers-style.d.ts +1 -0
- package/dist/src/nostr-zap/dialog-zappers.d.ts +25 -0
- package/dist/src/nostr-zap/nostr-zap.d.ts +45 -0
- package/dist/src/nostr-zap/render.d.ts +9 -0
- package/dist/src/nostr-zap/style.d.ts +1 -0
- package/dist/src/nostr-zap/zap-utils.d.ts +53 -0
- package/dist/themes/dark.css +10 -0
- package/dist/themes/light.css +10 -0
- package/dist/themes.css +52 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.config.esm.d.ts +2 -0
- package/dist/vite.config.umd.d.ts +2 -0
- package/package.json +95 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NDKUser, NDKUserProfile } from '@nostr-dev-kit/ndk';
|
|
2
|
+
export interface RenderProfileBadgeOptions {
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
isError: boolean;
|
|
5
|
+
errorMessage?: string;
|
|
6
|
+
userProfile: NDKUserProfile | null;
|
|
7
|
+
ndkUser: NDKUser | null;
|
|
8
|
+
showNpub: boolean;
|
|
9
|
+
showFollow: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function renderProfileBadge({ isLoading, isError, errorMessage, userProfile, ndkUser, showNpub, showFollow }: RenderProfileBadgeOptions): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getProfileBadgeStyles(): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DialogComponent } from '../base/dialog-component/dialog-component';
|
|
2
|
+
interface WebLN {
|
|
3
|
+
enable: () => Promise<void>;
|
|
4
|
+
sendPayment: (invoice: string) => Promise<{
|
|
5
|
+
preimage: string;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
webln?: WebLN;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export interface OpenZapModalParams {
|
|
14
|
+
npub: string;
|
|
15
|
+
relays: string;
|
|
16
|
+
cachedDialogComponent?: DialogComponent | null;
|
|
17
|
+
buttonColor?: string;
|
|
18
|
+
theme?: 'light' | 'dark';
|
|
19
|
+
fixedAmount?: number;
|
|
20
|
+
defaultAmount?: number;
|
|
21
|
+
initialAmount?: number;
|
|
22
|
+
anon?: boolean;
|
|
23
|
+
url?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const injectCSS: (theme?: "light" | "dark") => void;
|
|
26
|
+
/**
|
|
27
|
+
* Opens (or re-opens) the zap modal. Returns the DialogComponent so the caller
|
|
28
|
+
* can cache it between clicks.
|
|
29
|
+
*/
|
|
30
|
+
export declare function init(params: OpenZapModalParams): Promise<DialogComponent>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getZappersDialogStyles(theme?: 'light' | 'dark'): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DialogComponent } from '../base/dialog-component/dialog-component';
|
|
2
|
+
import { ZapDetails } from './zap-utils';
|
|
3
|
+
/**
|
|
4
|
+
* Modal dialog for displaying individual zap details (zappers).
|
|
5
|
+
*
|
|
6
|
+
* Shows a list of all zaps received by a user with:
|
|
7
|
+
* - Zap amount
|
|
8
|
+
* - Zap date (relative time)
|
|
9
|
+
* - Zap author's name
|
|
10
|
+
* - Zap author's profile picture
|
|
11
|
+
* - Clickable links to author profiles via njump.me
|
|
12
|
+
*/
|
|
13
|
+
export interface OpenZappersModalParams {
|
|
14
|
+
zapDetails: ZapDetails[];
|
|
15
|
+
theme?: 'light' | 'dark';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Inject zappers dialog content styles into document head
|
|
19
|
+
* Prevents duplicate injection by checking for existing styles
|
|
20
|
+
*/
|
|
21
|
+
export declare const injectZappersDialogStyles: (theme?: "light" | "dark") => void;
|
|
22
|
+
/**
|
|
23
|
+
* Opens the zappers dialog showing individual zap details
|
|
24
|
+
*/
|
|
25
|
+
export declare function openZappersDialog(params: OpenZappersModalParams): Promise<DialogComponent>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { NostrUserComponent } from '../base/user-component/nostr-user-component';
|
|
2
|
+
import { NCStatus } from '../base/base-component/nostr-base-component';
|
|
3
|
+
/**
|
|
4
|
+
* <nostr-zap>
|
|
5
|
+
* Attributes:
|
|
6
|
+
* - npub | pubkey | nip05 (required) : Nostr user to zap
|
|
7
|
+
* - relays (optional) : comma-separated relay URLs
|
|
8
|
+
* - theme (optional) : "light" | "dark" (default light)
|
|
9
|
+
* - text (optional) : custom text (default "Zap")
|
|
10
|
+
* - amount (optional) : pre-defined zap amount in sats
|
|
11
|
+
* - default-amount (optional) : default zap amount in sats (default 21)
|
|
12
|
+
* - url (optional) : URL to send zap to (enables URL-based zaps)
|
|
13
|
+
*
|
|
14
|
+
* TODO: Doesn't yet support dynamic updates of attributes.
|
|
15
|
+
*/
|
|
16
|
+
export default class NostrZap extends NostrUserComponent {
|
|
17
|
+
protected zapActionStatus: {
|
|
18
|
+
set: (s: NCStatus, e?: string) => void;
|
|
19
|
+
get: () => NCStatus;
|
|
20
|
+
};
|
|
21
|
+
protected zapListStatus: {
|
|
22
|
+
set: (s: NCStatus, e?: string) => void;
|
|
23
|
+
get: () => NCStatus;
|
|
24
|
+
};
|
|
25
|
+
private totalZapAmount;
|
|
26
|
+
private cachedZapDetails;
|
|
27
|
+
private cachedAmountDialog;
|
|
28
|
+
constructor();
|
|
29
|
+
connectedCallback(): void;
|
|
30
|
+
static get observedAttributes(): string[];
|
|
31
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
/** Base class functions */
|
|
34
|
+
protected onStatusChange(_status: NCStatus): void;
|
|
35
|
+
protected onUserReady(_user: any, _profile: any): void;
|
|
36
|
+
/** Protected methods */
|
|
37
|
+
protected validateInputs(): boolean;
|
|
38
|
+
/** Private functions */
|
|
39
|
+
private handleZapClick;
|
|
40
|
+
private handleHelpClick;
|
|
41
|
+
private handleZappersClick;
|
|
42
|
+
private attachDelegatedListeners;
|
|
43
|
+
private updateZapCount;
|
|
44
|
+
protected renderContent(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IRenderOptions } from '../base/render-options';
|
|
2
|
+
export interface RenderZapButtonOptions extends IRenderOptions {
|
|
3
|
+
isAmountLoading: boolean;
|
|
4
|
+
isSuccess: boolean;
|
|
5
|
+
buttonText: string;
|
|
6
|
+
totalZapAmount: number | null;
|
|
7
|
+
hasZaps?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function renderZapButton({ isLoading, isError, isSuccess, errorMessage, buttonText, totalZapAmount, isAmountLoading, hasZaps, }: RenderZapButtonOptions): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getZapButtonStyles(): string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Filter, Event } from 'nostr-tools';
|
|
2
|
+
export declare const getProfileMetadata: (authorId: string) => Promise<any>;
|
|
3
|
+
export declare const getBatchedProfileMetadata: (authorIds: string[]) => Promise<{
|
|
4
|
+
id: string;
|
|
5
|
+
profile: any;
|
|
6
|
+
}[]>;
|
|
7
|
+
export declare const extractProfileMetadataContent: (profileMetadata: any) => any;
|
|
8
|
+
export declare const getZapEndpoint: (profileMetadata: any) => Promise<string>;
|
|
9
|
+
export declare const fetchInvoice: ({ zapEndpoint, amount, comment, authorId, nip19Target, normalizedRelays, anon, url, }: {
|
|
10
|
+
zapEndpoint: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
comment?: string;
|
|
13
|
+
authorId: string;
|
|
14
|
+
nip19Target?: string;
|
|
15
|
+
normalizedRelays: string[];
|
|
16
|
+
anon?: boolean;
|
|
17
|
+
url?: string;
|
|
18
|
+
}) => Promise<string>;
|
|
19
|
+
export declare const isNip07ExtAvailable: () => boolean;
|
|
20
|
+
export declare function resolveNip05(nip05Identifier: string): Promise<string | null>;
|
|
21
|
+
declare module 'nostr-tools' {
|
|
22
|
+
interface SimplePool {
|
|
23
|
+
subscribe(relays: string[], filter: Filter, params: {
|
|
24
|
+
onevent: (event: Event) => void;
|
|
25
|
+
onclose?: () => void;
|
|
26
|
+
id?: string;
|
|
27
|
+
maxWait?: number;
|
|
28
|
+
}): {
|
|
29
|
+
close: () => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export interface ZapDetails {
|
|
34
|
+
amount: number;
|
|
35
|
+
date: Date;
|
|
36
|
+
authorPubkey: string;
|
|
37
|
+
comment?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ZapAmountResult {
|
|
40
|
+
totalAmount: number;
|
|
41
|
+
zapDetails: ZapDetails[];
|
|
42
|
+
}
|
|
43
|
+
export declare const fetchTotalZapAmount: ({ pubkey, relays, url, }: {
|
|
44
|
+
pubkey: string;
|
|
45
|
+
relays: string[];
|
|
46
|
+
url?: string;
|
|
47
|
+
}) => Promise<ZapAmountResult>;
|
|
48
|
+
export declare const listenForZapReceipt: ({ relays, receiversPubKey, invoice, onSuccess, }: {
|
|
49
|
+
relays: string[];
|
|
50
|
+
receiversPubKey: string;
|
|
51
|
+
invoice: string;
|
|
52
|
+
onSuccess: () => void;
|
|
53
|
+
}) => () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MIT */
|
|
2
|
+
|
|
3
|
+
/* Dark Theme for Nostr Components */
|
|
4
|
+
:root {
|
|
5
|
+
--nostrc-theme-bg: #1a1a1a;
|
|
6
|
+
--nostrc-theme-text-primary: #cccccc;
|
|
7
|
+
--nostrc-theme-text-secondary: #999999;
|
|
8
|
+
--nostrc-theme-border: #333333;
|
|
9
|
+
--nostrc-theme-hover-bg: #333333;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MIT */
|
|
2
|
+
|
|
3
|
+
/* Light Theme for Nostr Components */
|
|
4
|
+
:root {
|
|
5
|
+
--nostrc-theme-bg: #ffffff;
|
|
6
|
+
--nostrc-theme-text-primary: #333333;
|
|
7
|
+
--nostrc-theme-text-secondary: #666666;
|
|
8
|
+
--nostrc-theme-border: #e0e0e0;
|
|
9
|
+
--nostrc-theme-hover-bg: rgba(0, 0, 0, 0.05);
|
|
10
|
+
}
|
package/dist/themes.css
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MIT */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Nostr Components Theme Classes
|
|
5
|
+
* ==============================
|
|
6
|
+
*
|
|
7
|
+
* Apply themes to individual components using data-theme attributes:
|
|
8
|
+
*
|
|
9
|
+
* <div data-theme="dark">
|
|
10
|
+
* <nostr-profile-badge npub="npub123..."></nostr-profile-badge>
|
|
11
|
+
* </div>
|
|
12
|
+
*
|
|
13
|
+
* <div data-theme="ocean-glass">
|
|
14
|
+
* <nostr-follow-button pubkey="pk456..."></nostr-follow-button>
|
|
15
|
+
* </div>
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/* Light Theme */
|
|
19
|
+
[data-theme="light"],
|
|
20
|
+
:host([data-theme="light"]) {
|
|
21
|
+
--nostrc-theme-bg: #ffffff;
|
|
22
|
+
--nostrc-theme-text-primary: #333333;
|
|
23
|
+
--nostrc-theme-text-secondary: #666666;
|
|
24
|
+
--nostrc-theme-border: #e0e0e0;
|
|
25
|
+
--nostrc-theme-hover-bg: rgba(0, 0, 0, 0.05);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.theme-light {
|
|
29
|
+
--nostrc-theme-bg: #ffffff;
|
|
30
|
+
--nostrc-theme-text-primary: #333333;
|
|
31
|
+
--nostrc-theme-text-secondary: #666666;
|
|
32
|
+
--nostrc-theme-border: #e0e0e0;
|
|
33
|
+
--nostrc-theme-hover-bg: rgba(0, 0, 0, 0.05);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Dark Theme */
|
|
37
|
+
[data-theme="dark"],
|
|
38
|
+
:host([data-theme="dark"]) {
|
|
39
|
+
--nostrc-theme-bg: #1a1a1a;
|
|
40
|
+
--nostrc-theme-text-primary: #cccccc;
|
|
41
|
+
--nostrc-theme-text-secondary: #999999;
|
|
42
|
+
--nostrc-theme-border: #333333;
|
|
43
|
+
--nostrc-theme-hover-bg: #333333;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.theme-dark {
|
|
47
|
+
--nostrc-theme-bg: #1a1a1a;
|
|
48
|
+
--nostrc-theme-text-primary: #cccccc;
|
|
49
|
+
--nostrc-theme-text-secondary: #999999;
|
|
50
|
+
--nostrc-theme-border: #333333;
|
|
51
|
+
--nostrc-theme-hover-bg: #333333;
|
|
52
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nostr-components",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Embed Nostr anywhere on the internet, a Zap Button for every webpage",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"nostr",
|
|
8
|
+
"web-components",
|
|
9
|
+
"lightning",
|
|
10
|
+
"zap",
|
|
11
|
+
"decentralized",
|
|
12
|
+
"social-network",
|
|
13
|
+
"nostr-profile",
|
|
14
|
+
"nostr-post",
|
|
15
|
+
"nostr-zap"
|
|
16
|
+
],
|
|
17
|
+
"author": "saiy2k",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/saiy2k/nostr-components.git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://nostr-components.web.app",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/saiy2k/nostr-components/issues"
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/nostr-components.umd.js",
|
|
28
|
+
"module": "./dist/nostr-components.es.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": "./dist/nostr-components.es.js",
|
|
33
|
+
"require": "./dist/nostr-components.umd.js",
|
|
34
|
+
"types": "./dist/index.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./themes": {
|
|
37
|
+
"import": "./dist/themes.css",
|
|
38
|
+
"default": "./dist/themes.css"
|
|
39
|
+
},
|
|
40
|
+
"./themes/dark": {
|
|
41
|
+
"import": "./dist/themes/dark.css",
|
|
42
|
+
"default": "./dist/themes/dark.css"
|
|
43
|
+
},
|
|
44
|
+
"./themes/light": {
|
|
45
|
+
"import": "./dist/themes/light.css",
|
|
46
|
+
"default": "./dist/themes/light.css"
|
|
47
|
+
},
|
|
48
|
+
"./components/*": "./dist/components/*.es.js"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"LICENSE",
|
|
52
|
+
"README.md",
|
|
53
|
+
"dist"
|
|
54
|
+
],
|
|
55
|
+
"scripts": {
|
|
56
|
+
"dev": "vite",
|
|
57
|
+
"build:esm": "vite build --config vite.config.esm.ts",
|
|
58
|
+
"build:umd": "vite build --config vite.config.umd.ts",
|
|
59
|
+
"build:themes": "node scripts/build-themes.js",
|
|
60
|
+
"build": "npm run build:esm && npm run build:umd && npm run build:themes",
|
|
61
|
+
"preview": "vite preview",
|
|
62
|
+
"storybook": "storybook dev -p 6006",
|
|
63
|
+
"build-storybook": "cross-env STORYBOOK_ENV=production storybook build && npm run build:themes",
|
|
64
|
+
"wp-build": "npm run build:esm && npm run build:themes && npm run wp-copy",
|
|
65
|
+
"wp-copy": "node scripts/wp-copy.js"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
69
|
+
"@storybook/addon-docs": "^9.1.8",
|
|
70
|
+
"@storybook/addons": "^7.6.17",
|
|
71
|
+
"@storybook/web-components-vite": "^9.1.8",
|
|
72
|
+
"@types/glidejs__glide": "^3.6.6",
|
|
73
|
+
"@types/htmlparser2": "^3.10.7",
|
|
74
|
+
"@types/node": "^22.15.21",
|
|
75
|
+
"cross-env": "^7.0.3",
|
|
76
|
+
"esbuild": "0.23.1",
|
|
77
|
+
"htmlparser2": "^10.0.0",
|
|
78
|
+
"lit": "^3.3.1",
|
|
79
|
+
"prettier": "^3.5.3",
|
|
80
|
+
"storybook": "^9.1.8",
|
|
81
|
+
"typescript": "^5.8.3",
|
|
82
|
+
"vite": "^5.4.1",
|
|
83
|
+
"vite-plugin-dts": "^4.5.4"
|
|
84
|
+
},
|
|
85
|
+
"dependencies": {
|
|
86
|
+
"@glidejs/glide": "^3.7.1",
|
|
87
|
+
"@nostr-dev-kit/ndk": "^2.10.0",
|
|
88
|
+
"@types/dompurify": "^3.0.5",
|
|
89
|
+
"@types/qrcode": "^1.5.5",
|
|
90
|
+
"dompurify": "^3.2.6",
|
|
91
|
+
"light-bolt11-decoder": "^3.2.0",
|
|
92
|
+
"nostr-tools": "^2.7.2",
|
|
93
|
+
"qrcode": "^1.5.4"
|
|
94
|
+
}
|
|
95
|
+
}
|