@vellumlabs/cexplorer-sdk 1.1.8 → 1.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/dist/index.es.js +1 -1
- package/dist/stories/dataDisplay/BlockCell.stories.d.ts +43 -0
- package/dist/stories/dataDisplay/BlockCell.stories.d.ts.map +1 -0
- package/dist/stories/dataDisplay/EpochCell.stories.d.ts +51 -0
- package/dist/stories/dataDisplay/EpochCell.stories.d.ts.map +1 -0
- package/dist/stories/dataDisplay/MintedByCard.stories.d.ts +4 -0
- package/dist/stories/dataDisplay/MintedByCard.stories.d.ts.map +1 -1
- package/dist/stories/dataDisplay/ProBadge.stories.d.ts +10 -2
- package/dist/stories/dataDisplay/ProBadge.stories.d.ts.map +1 -1
- package/dist/stories/feedback/SensitiveContentWarning.stories.d.ts +35 -0
- package/dist/stories/feedback/SensitiveContentWarning.stories.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/ui/blockCell/index.d.ts +111 -0
- package/dist/ui/blockCell/index.d.ts.map +1 -0
- package/dist/ui/epochCell/index.d.ts +156 -0
- package/dist/ui/epochCell/index.d.ts.map +1 -0
- package/dist/ui/index.d.ts +4 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/poolCell/index.d.ts.map +1 -1
- package/dist/ui/proBadge/index.d.ts +26 -1
- package/dist/ui/proBadge/index.d.ts.map +1 -1
- package/dist/ui/sensitiveContentWarning/index.d.ts +131 -0
- package/dist/ui/sensitiveContentWarning/index.d.ts.map +1 -0
- package/dist/ui/truncatedText/index.d.ts.map +1 -1
- package/dist/utils/format.d.ts +25 -1
- package/dist/utils/format.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the SensitiveContentWarning component
|
|
3
|
+
*/
|
|
4
|
+
export interface SensitiveContentWarningProps {
|
|
5
|
+
/**
|
|
6
|
+
* Callback function called when user clicks the Display button.
|
|
7
|
+
* This should trigger showing the sensitive/user-generated content.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <SensitiveContentWarning onDisplay={() => setShowContent(true)} />
|
|
11
|
+
*/
|
|
12
|
+
onDisplay: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Optional localStorage key for remembering user preference.
|
|
15
|
+
* If not provided, defaults to "showSensitiveContent".
|
|
16
|
+
*
|
|
17
|
+
* @default "showSensitiveContent"
|
|
18
|
+
* @example
|
|
19
|
+
* <SensitiveContentWarning
|
|
20
|
+
* onDisplay={() => setShowContent(true)}
|
|
21
|
+
* localStorageKey="showUserGeneratedContent"
|
|
22
|
+
* />
|
|
23
|
+
*/
|
|
24
|
+
localStorageKey?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional custom title text.
|
|
27
|
+
*
|
|
28
|
+
* @default "User-generated content"
|
|
29
|
+
* @example
|
|
30
|
+
* <SensitiveContentWarning
|
|
31
|
+
* onDisplay={() => setShowContent(true)}
|
|
32
|
+
* title="Sensitive Content Warning"
|
|
33
|
+
* />
|
|
34
|
+
*/
|
|
35
|
+
title?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional custom description text.
|
|
38
|
+
*
|
|
39
|
+
* @default "Following content is user-generated and unmoderated by the Cexplorer team."
|
|
40
|
+
* @example
|
|
41
|
+
* <SensitiveContentWarning
|
|
42
|
+
* onDisplay={() => setShowContent(true)}
|
|
43
|
+
* description="This content may contain sensitive information."
|
|
44
|
+
* />
|
|
45
|
+
*/
|
|
46
|
+
description?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* SensitiveContentWarning displays a warning message before showing user-generated or sensitive content.
|
|
50
|
+
*
|
|
51
|
+
* This component acts as a content gate, warning users about potentially sensitive or unmoderated
|
|
52
|
+
* content. Users can choose to display the content immediately or check "Remember this setting"
|
|
53
|
+
* to automatically show similar content in the future via localStorage.
|
|
54
|
+
*
|
|
55
|
+
* **Key Features:**
|
|
56
|
+
* - Warning icon with clear messaging about content type
|
|
57
|
+
* - "Remember this setting" checkbox for localStorage persistence
|
|
58
|
+
* - "Display" button with eye icon to reveal content
|
|
59
|
+
* - Customizable title, description, and localStorage key
|
|
60
|
+
* - Follows GDPR-friendly approach by requiring explicit user consent
|
|
61
|
+
*
|
|
62
|
+
* **localStorage Behavior:**
|
|
63
|
+
* - When checkbox is checked and user clicks Display, preference is saved to localStorage
|
|
64
|
+
* - Parent component should check localStorage on mount to skip showing this warning
|
|
65
|
+
* - Uses localStorage key "showSensitiveContent" by default (customizable via props)
|
|
66
|
+
*
|
|
67
|
+
* **Common Use Cases:**
|
|
68
|
+
* - Warn before showing user-generated blockchain metadata
|
|
69
|
+
* - Gate access to unmoderated community content
|
|
70
|
+
* - Display warning for potentially sensitive transaction memos
|
|
71
|
+
* - Show notice before displaying external/untrusted data
|
|
72
|
+
* - Content moderation in NFT metadata display
|
|
73
|
+
*
|
|
74
|
+
* @component
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* // Basic usage with state management
|
|
78
|
+
* const [showContent, setShowContent] = useState(() => {
|
|
79
|
+
* return localStorage.getItem("showSensitiveContent") === "true";
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* if (!showContent) {
|
|
83
|
+
* return <SensitiveContentWarning onDisplay={() => setShowContent(true)} />;
|
|
84
|
+
* }
|
|
85
|
+
*
|
|
86
|
+
* return <div>{sensitiveContent}</div>;
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```tsx
|
|
91
|
+
* // With custom text and localStorage key
|
|
92
|
+
* <SensitiveContentWarning
|
|
93
|
+
* onDisplay={() => setShowContent(true)}
|
|
94
|
+
* localStorageKey="showNFTMetadata"
|
|
95
|
+
* title="NFT Metadata Warning"
|
|
96
|
+
* description="This NFT contains user-uploaded metadata that may not be verified."
|
|
97
|
+
* />
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* // In a transaction detail view
|
|
103
|
+
* const TransactionMemo = ({ memo }: { memo: string }) => {
|
|
104
|
+
* const [showMemo, setShowMemo] = useState(() => {
|
|
105
|
+
* return localStorage.getItem("showTransactionMemos") === "true";
|
|
106
|
+
* });
|
|
107
|
+
*
|
|
108
|
+
* if (!showMemo) {
|
|
109
|
+
* return (
|
|
110
|
+
* <SensitiveContentWarning
|
|
111
|
+
* onDisplay={() => setShowMemo(true)}
|
|
112
|
+
* localStorageKey="showTransactionMemos"
|
|
113
|
+
* title="Transaction Memo"
|
|
114
|
+
* description="This transaction contains a user-generated memo."
|
|
115
|
+
* />
|
|
116
|
+
* );
|
|
117
|
+
* }
|
|
118
|
+
*
|
|
119
|
+
* return <p className="text-text-sm">{memo}</p>;
|
|
120
|
+
* };
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @param {SensitiveContentWarningProps} props - Component props
|
|
124
|
+
* @param {() => void} props.onDisplay - Callback when Display button is clicked
|
|
125
|
+
* @param {string} [props.localStorageKey="showSensitiveContent"] - localStorage key for user preference
|
|
126
|
+
* @param {string} [props.title="User-generated content"] - Warning title text
|
|
127
|
+
* @param {string} [props.description] - Warning description text
|
|
128
|
+
* @returns {JSX.Element} A centered warning component with icon, text, checkbox, and display button
|
|
129
|
+
*/
|
|
130
|
+
export declare const SensitiveContentWarning: ({ onDisplay, localStorageKey, title, description, }: SensitiveContentWarningProps) => import("react/jsx-runtime").JSX.Element;
|
|
131
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/sensitiveContentWarning/index.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,eAAO,MAAM,uBAAuB,GAAI,qDAKrC,4BAA4B,4CA0C9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/truncatedText/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/truncatedText/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;GAIG;AACH,UAAU,kBAAkB;IAC1B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,aAAa,GAAI,4CAI3B,kBAAkB,4CAmFpB,CAAC"}
|
package/dist/utils/format.d.ts
CHANGED
|
@@ -103,6 +103,8 @@ export declare const toUtcDate: (input: string | Date | number) => Date;
|
|
|
103
103
|
* @param {string | Date | number} [input] - Date to format
|
|
104
104
|
* @param {boolean} [hideTime=false] - Hide time portion, show only date
|
|
105
105
|
* @param {boolean} [returnString=false] - Return ISO string instead of JSX
|
|
106
|
+
* @param {boolean} [showRelative=false] - Show relative time (e.g., "10 minutes ago") as main text
|
|
107
|
+
* @param {boolean} [showSecondary=false] - Show secondary date format below main text (small, muted)
|
|
106
108
|
* @returns {JSX.Element | string} Formatted date with tooltip or ISO string
|
|
107
109
|
*
|
|
108
110
|
* @example
|
|
@@ -116,8 +118,30 @@ export declare const toUtcDate: (input: string | Date | number) => Date;
|
|
|
116
118
|
* formatDate("2024-01-15T10:30:00Z", true)
|
|
117
119
|
* // Returns: <Tooltip>Jan 15 2024</Tooltip>
|
|
118
120
|
* ```
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```tsx
|
|
124
|
+
* // Withdrawals: relative time with absolute date below
|
|
125
|
+
* formatDate("2024-01-15T10:30:00Z", false, false, true, true)
|
|
126
|
+
* // Returns:
|
|
127
|
+
* // <div>
|
|
128
|
+
* // 10 minutes ago
|
|
129
|
+
* // <small class="text-muted">15.1.2024, 10:30:45</small>
|
|
130
|
+
* // </div>
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```tsx
|
|
135
|
+
* // Rewards: formatted date with alternative format below
|
|
136
|
+
* formatDate("2024-11-03T10:30:00Z", false, false, false, true)
|
|
137
|
+
* // Returns:
|
|
138
|
+
* // <div>
|
|
139
|
+
* // Nov 03 2024
|
|
140
|
+
* // <small class="text-muted">3.11.2024, 10:30:45</small>
|
|
141
|
+
* // </div>
|
|
142
|
+
* ```
|
|
119
143
|
*/
|
|
120
|
-
export declare const formatDate: (input?: string | Date | number, hideTime?: boolean, returnString?: boolean) => string | import("react/jsx-runtime").JSX.Element;
|
|
144
|
+
export declare const formatDate: (input?: string | Date | number, hideTime?: boolean, returnString?: boolean, showRelative?: boolean, showSecondary?: boolean) => string | import("react/jsx-runtime").JSX.Element;
|
|
121
145
|
/**
|
|
122
146
|
* Formats future timestamp as relative time ("in X time").
|
|
123
147
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAA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