@select-org/post-components 1.0.0 → 1.0.1

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.
@@ -0,0 +1,269 @@
1
+ type TipTapTextAlign = 'left' | 'center' | 'right';
2
+ type TipTapBoldMark = {
3
+ type: 'bold';
4
+ };
5
+ type TipTapItalicMark = {
6
+ type: 'italic';
7
+ };
8
+ type TipTapUnderlineMark = {
9
+ type: 'underline';
10
+ };
11
+ type TipTapStrikeMark = {
12
+ type: 'strike';
13
+ };
14
+ type TipTapCodeMark = {
15
+ type: 'code';
16
+ };
17
+ type TipTapSuperscriptMark = {
18
+ type: 'superscript';
19
+ };
20
+ type TipTapSubscriptMark = {
21
+ type: 'subscript';
22
+ };
23
+ type TipTapCustomLinkMark = {
24
+ type: 'customLink';
25
+ attrs: {
26
+ href: string;
27
+ text?: string | null;
28
+ uid?: string | null;
29
+ isLinkMode?: boolean;
30
+ previewPayload?: unknown;
31
+ target?: string | null;
32
+ rel?: string | null;
33
+ class?: string | null;
34
+ };
35
+ };
36
+ type TipTapLinkMark = {
37
+ type: 'link';
38
+ attrs: {
39
+ href: string;
40
+ target?: string | null;
41
+ rel?: string | null;
42
+ class?: string | null;
43
+ };
44
+ };
45
+ type TipTapMark = TipTapBoldMark | TipTapItalicMark | TipTapUnderlineMark | TipTapStrikeMark | TipTapCodeMark | TipTapSuperscriptMark | TipTapSubscriptMark | TipTapCustomLinkMark | TipTapLinkMark;
46
+ interface TipTapTextNode {
47
+ type: 'text';
48
+ text: string;
49
+ marks?: TipTapMark[];
50
+ }
51
+ interface TipTapHardBreakNode {
52
+ type: 'hardBreak';
53
+ }
54
+ interface TipTapMentionNode {
55
+ type: 'mention';
56
+ attrs: {
57
+ id: string;
58
+ label: string;
59
+ type: 'mention' | 'hashtag';
60
+ };
61
+ }
62
+ type TipTapInlineNode = TipTapTextNode | TipTapHardBreakNode | TipTapMentionNode;
63
+ interface TipTapParagraphNode {
64
+ type: 'paragraph';
65
+ attrs?: {
66
+ textAlign?: TipTapTextAlign;
67
+ };
68
+ content?: TipTapInlineNode[];
69
+ }
70
+ interface TipTapHeadingNode {
71
+ type: 'heading';
72
+ attrs: {
73
+ level: 1 | 2 | 3 | 4 | 5 | 6;
74
+ textAlign?: TipTapTextAlign;
75
+ };
76
+ content?: TipTapInlineNode[];
77
+ }
78
+ interface TipTapListItemNode {
79
+ type: 'listItem';
80
+ content?: TipTapParagraphNode[];
81
+ }
82
+ interface TipTapBulletListNode {
83
+ type: 'bulletList';
84
+ content?: TipTapListItemNode[];
85
+ }
86
+ interface TipTapOrderedListNode {
87
+ type: 'orderedList';
88
+ attrs?: {
89
+ start?: number;
90
+ };
91
+ content?: TipTapListItemNode[];
92
+ }
93
+ interface TipTapBlockquoteNode {
94
+ type: 'blockquote';
95
+ content?: TipTapParagraphNode[];
96
+ }
97
+ interface TipTapCodeBlockNode {
98
+ type: 'codeBlock';
99
+ attrs?: {
100
+ language?: string;
101
+ };
102
+ content?: TipTapTextNode[];
103
+ }
104
+ interface TipTapHorizontalRuleNode {
105
+ type: 'horizontalRule';
106
+ }
107
+ interface TipTapMediaNode {
108
+ type: 'media';
109
+ attrs: {
110
+ uid: string;
111
+ src: string;
112
+ type: 'image' | 'video' | 'audio';
113
+ style?: string | null;
114
+ maxWidth?: number | null;
115
+ align?: TipTapTextAlign | null;
116
+ caption?: string | null;
117
+ uploading?: boolean | null;
118
+ progress?: number | null;
119
+ payload?: unknown;
120
+ textAlign?: TipTapTextAlign;
121
+ };
122
+ }
123
+ interface TipTapMediaGroupNode {
124
+ type: 'mediaGroup';
125
+ attrs: {
126
+ uid: string;
127
+ };
128
+ content?: TipTapMediaNode[];
129
+ }
130
+ interface TipTapPollNode {
131
+ type: 'poll';
132
+ attrs: {
133
+ uid: string;
134
+ };
135
+ }
136
+ interface TipTapIframeNode {
137
+ type: 'iframe';
138
+ attrs: {
139
+ src: string;
140
+ width?: number | null;
141
+ height?: number | null;
142
+ };
143
+ }
144
+ interface TipTapLinkPreviewNode {
145
+ type: 'linkPreview';
146
+ attrs: {
147
+ uid: string;
148
+ href: string;
149
+ previewType: 'compact' | 'extended';
150
+ };
151
+ }
152
+ type TipTapBlockNode = TipTapParagraphNode | TipTapHeadingNode | TipTapBulletListNode | TipTapOrderedListNode | TipTapBlockquoteNode | TipTapCodeBlockNode | TipTapHorizontalRuleNode | TipTapMediaNode | TipTapMediaGroupNode | TipTapPollNode | TipTapIframeNode | TipTapLinkPreviewNode;
153
+ interface TipTapDocument {
154
+ type: 'doc';
155
+ content?: TipTapBlockNode[];
156
+ }
157
+
158
+ interface PostAuthor {
159
+ id: string;
160
+ name: string;
161
+ avatar: string;
162
+ avatarPlaceholder?: string;
163
+ username?: string;
164
+ }
165
+ interface ImageInfo {
166
+ width: number;
167
+ height: number;
168
+ url: string;
169
+ isBase64: boolean;
170
+ }
171
+ interface ItemData {
172
+ type: string;
173
+ text?: string;
174
+ imageType: string;
175
+ playableDuration: number;
176
+ key: string;
177
+ sources: {
178
+ original: ImageInfo;
179
+ placeholder: ImageInfo;
180
+ thumbnail: ImageInfo;
181
+ };
182
+ file?: unknown;
183
+ }
184
+ interface PollItemData extends ItemData {
185
+ option_color: string;
186
+ option_id: string;
187
+ text?: string;
188
+ }
189
+ type LinkItemMetaData = {
190
+ type: string;
191
+ linkTitle: string;
192
+ linkDesc: string;
193
+ linkIcon: string;
194
+ linkImage?: {
195
+ width: number;
196
+ height: number;
197
+ url: string;
198
+ };
199
+ linkUrl?: string;
200
+ text?: string;
201
+ };
202
+ interface PollResult {
203
+ user_vote_option_id: string;
204
+ context_id: string;
205
+ options: {
206
+ option_id: string;
207
+ context_id: string;
208
+ count: number;
209
+ }[];
210
+ }
211
+ type MentionData = {
212
+ id: string;
213
+ selectId: string;
214
+ matchStartPosition: number;
215
+ name: string;
216
+ avatar: string;
217
+ type: 'mention' | 'hashtag';
218
+ inThisThread: number;
219
+ from?: 'post' | 'comment';
220
+ isCrossExposureEnable?: boolean;
221
+ };
222
+ type FormatMentionData = {
223
+ name: string;
224
+ type: string;
225
+ index: number;
226
+ endIndex: number;
227
+ data: MentionData;
228
+ };
229
+ type SectionItem = {
230
+ type: string;
231
+ data: {
232
+ body?: string;
233
+ items?: ItemData[];
234
+ mentionData?: MentionData[];
235
+ sourceInfo?: {
236
+ avatar: string;
237
+ username: string;
238
+ url: string;
239
+ };
240
+ [key: string]: unknown;
241
+ };
242
+ };
243
+ interface PostDataMetaData {
244
+ body: string;
245
+ htmlBody?: string;
246
+ textBody?: string;
247
+ jsonBody?: TipTapDocument | null;
248
+ items?: ItemData[] | LinkItemMetaData[] | PollItemData[];
249
+ sections?: any[];
250
+ mentionData?: MentionData[];
251
+ crossMentionData?: MentionData;
252
+ expiration?: number;
253
+ group_name?: string;
254
+ group_users?: string[];
255
+ add_users?: string[];
256
+ inviter_id?: string;
257
+ inviter_name?: string;
258
+ eventType?: string;
259
+ votes_data?: any;
260
+ featured_group_context_id?: string;
261
+ featured_group_name?: string;
262
+ other_group_allow_cross_exposure?: boolean;
263
+ other_group_context_id?: string;
264
+ other_group_name?: string;
265
+ }
266
+
267
+ type MediaUploadStatus = 'uploading' | 'processing' | 'uploaded' | 'error';
268
+
269
+ export type { FormatMentionData, ImageInfo, ItemData, LinkItemMetaData, MediaUploadStatus, MentionData, PollItemData, PollResult, PostAuthor, PostDataMetaData, SectionItem, TipTapDocument };
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@select-org/post-components",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Select design system post family components.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,8 +40,8 @@
40
40
  "peerDependencies": {
41
41
  "react": "^18 || ^19",
42
42
  "react-dom": "^18 || ^19",
43
- "@select-org/tailwind-preset": "0.1.0",
44
- "@select-org/ui": "0.2.0"
43
+ "@select-org/tailwind-preset": "0.1.1",
44
+ "@select-org/ui": "0.2.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/react": "^19.0.0",