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

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,9 +171,30 @@ 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
 
187
+ declare module '@tiptap/core' {
188
+ interface Commands<ReturnType> {
189
+ poll: {
190
+ insertPoll: (attrs: {
191
+ choices: PollChoiceItem[];
192
+ }) => ReturnType;
193
+ };
194
+ }
195
+ }
196
+
197
+
176
198
  declare module '@tiptap/core' {
177
199
  interface Commands<ReturnType> {
178
200
  media: {
@@ -197,17 +219,6 @@ declare module '@tiptap/core' {
197
219
  }
198
220
 
199
221
 
200
- declare module '@tiptap/core' {
201
- interface Commands<ReturnType> {
202
- poll: {
203
- insertPoll: (attrs: {
204
- choices: PollChoiceItem[];
205
- }) => ReturnType;
206
- };
207
- }
208
- }
209
-
210
-
211
222
  declare module '@tiptap/core' {
212
223
  interface Commands<ReturnType> {
213
224
  customLink: {