@select-org/select-post-builder 1.0.3 → 1.0.5

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
@@ -33,6 +33,21 @@ declare type BasePollOptionItem = {
33
33
  option_color: string;
34
34
  };
35
35
 
36
+ declare type BaseProps = {
37
+ groupId?: string;
38
+ postId?: string;
39
+ user?: AppUserPayload;
40
+ hideGroupSelector?: boolean;
41
+ isSubmitting?: boolean;
42
+ clearOnSuccess?: boolean;
43
+ onCreatePost: (params: {
44
+ payload: Partial<PostCreationData>;
45
+ html: string;
46
+ json: JSONContent;
47
+ text: string;
48
+ }) => void;
49
+ };
50
+
36
51
  declare interface ImageInfo {
37
52
  width: number;
38
53
  height: number;
@@ -91,21 +106,7 @@ export declare interface PostBuilderConfig {
91
106
 
92
107
  export declare const PostBuilderEditor: default_2.FC<PostBuilderEditorProps>;
93
108
 
94
- declare type PostBuilderEditorProps = {
95
- groupId?: string;
96
- postId?: string;
97
- user?: AppUserPayload;
98
- hideGroupSelector?: boolean;
99
- showModal?: boolean;
100
- isSubmitting?: boolean;
101
- onCreatePost: (params: {
102
- payload: Partial<PostCreationData>;
103
- html: string;
104
- json: JSONContent;
105
- text: string;
106
- }) => void;
107
- clearOnSuccess?: boolean;
108
- };
109
+ declare type PostBuilderEditorProps = WithModalProps | WithoutModalProps;
109
110
 
110
111
  declare interface PostBuilderI18nKeys {
111
112
  addImageKey: string;
@@ -170,6 +171,16 @@ declare type UserPayload = {
170
171
  interactionIds?: Array<string>;
171
172
  };
172
173
 
174
+ declare type WithModalProps = BaseProps & {
175
+ openModal: boolean;
176
+ onModalOpenChange: (open: boolean) => void;
177
+ };
178
+
179
+ declare type WithoutModalProps = BaseProps & {
180
+ openModal?: undefined;
181
+ onModalOpenChange?: undefined;
182
+ };
183
+
173
184
  export { }
174
185
 
175
186
 
@@ -234,14 +245,13 @@ declare module '@tiptap/core' {
234
245
 
235
246
  declare module '@tiptap/core' {
236
247
  interface Commands<ReturnType> {
237
- iframe: {
238
- /**
239
- * Insert an iframe node into the document
240
- */
241
- setIframe: (options: {
242
- src: string;
243
- width?: string;
244
- height?: string;
248
+ smartMediaUpload: {
249
+ insertMediaWithUpload: (params: {
250
+ source: File | Blob | string;
251
+ type: MediaNodeTypes;
252
+ mediaType?: MediaItemType;
253
+ caption?: string;
254
+ searchFrom?: ImageSearchFrom;
245
255
  }) => ReturnType;
246
256
  };
247
257
  }
@@ -250,13 +260,14 @@ declare module '@tiptap/core' {
250
260
 
251
261
  declare module '@tiptap/core' {
252
262
  interface Commands<ReturnType> {
253
- smartMediaUpload: {
254
- insertMediaWithUpload: (params: {
255
- source: File | Blob | string;
256
- type: MediaNodeTypes;
257
- mediaType?: MediaItemType;
258
- caption?: string;
259
- searchFrom?: ImageSearchFrom;
263
+ iframe: {
264
+ /**
265
+ * Insert an iframe node into the document
266
+ */
267
+ setIframe: (options: {
268
+ src: string;
269
+ width?: string;
270
+ height?: string;
260
271
  }) => ReturnType;
261
272
  };
262
273
  }