@select-org/select-post-builder 1.1.1 → 1.1.3

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.d.ts CHANGED
@@ -78,6 +78,19 @@ declare enum MentionType {
78
78
  Group = "hashtag"
79
79
  }
80
80
 
81
+ declare enum NewPostType {
82
+ NEW_POST_IMAGE = "new:post:image",// content store in the db - no parent
83
+ NEW_POST_MEDIA = "new:post:media",// content store in the db - no parent
84
+ NEW_POST_POLL = "new:post:poll",// content store in the db - no parent
85
+ NEW_POST_LINK = "new:post:link",// content store in the db - no parent
86
+ NEW_POST_MESSAGE = "new:post:text",// content store in the db - no parent
87
+ NEW_COMMENT = "new:comment",// content store in the db - has parent
88
+ NEW_COMMENT_GUGGY = "new:comment:gif",// content store in the db - has parent
89
+ NEW_COMMENT_VOICE = "new:comment:voice",// content store in the db - has parent
90
+ NEW_COMMENT_IMAGE = "new:comment:image",// content store in the db - has parent
91
+ NEW_COMMENT_MEDIA = "new:comment:media"
92
+ }
93
+
81
94
  declare type PollChoiceItem = PollPostTextOptionItem | PollPostMediaOptionItem;
82
95
 
83
96
  declare type PollPostMediaOptionItem = BasePollOptionItem & PostCreationMediaItem;
@@ -110,6 +123,12 @@ export declare const PostBuilderEditor: FC<PostBuilderEditorProps>;
110
123
 
111
124
  export declare type PostBuilderEditorProps = WithModalProps | WithoutModalProps;
112
125
 
126
+ export declare enum PostBuilderEvents {
127
+ POST_PUBLISH_ATTEMPTED = "select:post_publish_attempted",
128
+ POST_PUBLISH_SUCCESSFUL = "select:post_publish_success",
129
+ POST_PUBLISH_FAILED = "select:post_publish_failed"
130
+ }
131
+
113
132
  declare interface PostBuilderI18nKeys {
114
133
  addImageKey: string;
115
134
  boldMarkKey: string;
@@ -125,7 +144,7 @@ declare type PostCreationData = {
125
144
  mentionData: MentionData[];
126
145
  specialType: SpecialType;
127
146
  sendCrossMention?: boolean;
128
- type: string;
147
+ type: NewPostType;
129
148
  postId: string;
130
149
  timestamp: number;
131
150
  };
@@ -151,6 +170,13 @@ declare enum PostType {
151
170
  Comment = "comment"
152
171
  }
153
172
 
173
+ export declare type PublishEventDetails = {
174
+ postId: string;
175
+ postType: string;
176
+ groupId?: string;
177
+ failureReason?: string;
178
+ };
179
+
154
180
  declare enum SpecialType {
155
181
  POST = 0,
156
182
  FEATURED_POST = 1
@@ -186,6 +212,30 @@ declare type WithoutModalProps = BaseProps & {
186
212
  export { }
187
213
 
188
214
 
215
+ declare module '@tiptap/core' {
216
+ interface Commands<ReturnType> {
217
+ media: {
218
+ /**
219
+ * Insert a media node (image, video, or audio)
220
+ */
221
+ insertMedia: (options: MediaAttrs) => ReturnType;
222
+ /**
223
+ * Update media node attributes by uid
224
+ */
225
+ updateMediaByUid: (uid: string, attrs: Partial<MediaAttrs>) => ReturnType;
226
+ /**
227
+ * Delete media node by uid
228
+ */
229
+ deleteMediaByUid: (uid: string) => ReturnType;
230
+ /**
231
+ * Update media upload progress by uid
232
+ */
233
+ updateMediaProgress: (uid: string, progress: number) => ReturnType;
234
+ };
235
+ }
236
+ }
237
+
238
+
189
239
  declare module '@tiptap/core' {
190
240
  interface Commands<ReturnType> {
191
241
  poll: {
@@ -221,30 +271,6 @@ declare module '@tiptap/core' {
221
271
  }
222
272
 
223
273
 
224
- declare module '@tiptap/core' {
225
- interface Commands<ReturnType> {
226
- media: {
227
- /**
228
- * Insert a media node (image, video, or audio)
229
- */
230
- insertMedia: (options: MediaAttrs) => ReturnType;
231
- /**
232
- * Update media node attributes by uid
233
- */
234
- updateMediaByUid: (uid: string, attrs: Partial<MediaAttrs>) => ReturnType;
235
- /**
236
- * Delete media node by uid
237
- */
238
- deleteMediaByUid: (uid: string) => ReturnType;
239
- /**
240
- * Update media upload progress by uid
241
- */
242
- updateMediaProgress: (uid: string, progress: number) => ReturnType;
243
- };
244
- }
245
- }
246
-
247
-
248
274
  declare module '@tiptap/core' {
249
275
  interface Commands<ReturnType> {
250
276
  iframe: {