@apolitical/component-library 6.1.2 → 6.2.0-jc.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.
Files changed (38) hide show
  1. package/discussion/components/form/form.type.d.ts +21 -2
  2. package/discussion/components/form/index.d.ts +1 -1
  3. package/discussion/feeds/replies-feed/cache/hooks/feed/index.d.ts +0 -1
  4. package/discussion/feeds/replies-feed/mocks/index.d.ts +0 -1
  5. package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/nested-replies-feed.d.ts +3 -3
  6. package/discussion/feeds/replies-feed/replies-feed.d.ts +2 -4
  7. package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +39 -45
  8. package/discussion/sections/activity-section/mocks/index.d.ts +0 -1
  9. package/discussion/shared/interfaces/discussion.interface.d.ts +0 -19
  10. package/form/components/form/form.types.d.ts +1 -1
  11. package/form/types/password-form/password-form.d.ts +3 -11
  12. package/helpers/intl.d.ts +0 -1
  13. package/index.js +36 -36
  14. package/index.mjs +7604 -7717
  15. package/package.json +1 -1
  16. package/text/pill/index.d.ts +1 -0
  17. package/text/pill/pill.d.ts +2 -2
  18. package/text/status-banner/index.d.ts +1 -0
  19. package/text/status-banner/status-banner.d.ts +2 -2
  20. package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/index.d.ts +0 -1
  21. package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/index.d.ts +0 -2
  22. package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/replies.mock.d.ts +0 -2
  23. package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/user.mock.d.ts +0 -4
  24. package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/parse-replies.d.ts +0 -28
  25. package/discussion/feeds/replies-feed/components/add-reply-form/add-reply-form.d.ts +0 -16
  26. package/discussion/feeds/replies-feed/components/add-reply-form/index.d.ts +0 -1
  27. package/discussion/feeds/replies-feed/components/index.d.ts +0 -3
  28. package/discussion/feeds/replies-feed/components/load-more-replies-button/index.d.ts +0 -1
  29. package/discussion/feeds/replies-feed/components/load-more-replies-button/load-more-replies-button.d.ts +0 -13
  30. package/discussion/feeds/replies-feed/components/reply-item/index.d.ts +0 -1
  31. package/discussion/feeds/replies-feed/components/reply-item/reply-item.d.ts +0 -26
  32. package/discussion/feeds/replies-feed/mocks/parsed-replies-feed.mock.d.ts +0 -13
  33. package/discussion/sections/activity-section/activity-section.helpers.d.ts +0 -2
  34. package/discussion/sections/activity-section/activity-section.mock.d.ts +0 -103
  35. package/discussion/sections/activity-section/mocks/activity-functions.mock.d.ts +0 -46
  36. /package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/index.d.ts +0 -0
  37. /package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/mocks/index.d.ts +0 -0
  38. /package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/mocks/nested-replies-feed.mock.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { IEnrichedUrlData } from '../../../navigation';
2
- import { IDiscussionContent, IMentions } from './../../discussion';
3
- import { ICategory, IDiscussionFormFunctions } from '../../shared';
2
+ import { DiscussionCreateContentFunction, IDiscussionContent, IListMemberData, IMentions, IDiscussionFormFns } from './../../discussion';
3
+ import { ICategory } from '../../shared';
4
4
  export interface IDiscussionFormMeta {
5
5
  /** Whether the form data is still loading */
6
6
  isLoading?: boolean;
@@ -36,6 +36,24 @@ export interface IDiscussionFormMeta {
36
36
  /** Whether the success message should show on a successful submit */
37
37
  showSuccessMessage?: boolean;
38
38
  }
39
+ interface IDiscussionFormFunctions extends IDiscussionFormFns {
40
+ onChange?: (args: {
41
+ [key: string]: string | boolean;
42
+ }) => void;
43
+ create: DiscussionCreateContentFunction;
44
+ handleSaveEdit?: (({ title, body }: {
45
+ title: string;
46
+ body: string;
47
+ }) => Promise<void>) | (() => void);
48
+ handleCancel?: () => void;
49
+ callback?: (args: void) => void;
50
+ onMention?: (value?: IListMemberData) => void;
51
+ props?: {
52
+ create: {
53
+ projectNames: ['questions-answers'];
54
+ };
55
+ };
56
+ }
39
57
  export interface IDiscussionForm {
40
58
  /** A unique ID for the form */
41
59
  id?: string;
@@ -89,3 +107,4 @@ export interface IDiscussionFormState {
89
107
  link?: false | IEnrichedUrlData;
90
108
  };
91
109
  }
110
+ export {};
@@ -1,2 +1,2 @@
1
- export type { IDiscussionForm, IDiscussionFormMeta, } from './form.type';
1
+ export type { IDiscussionForm, IDiscussionFormMeta } from './form.type';
2
2
  export { default as DiscussionForm } from './form';
@@ -1,2 +1 @@
1
1
  export * from './feed.hook';
2
- export type { IParsedReplies } from './parse-replies';
@@ -1,2 +1 @@
1
- export * from './parsed-replies-feed.mock';
2
1
  export * from './replies-feed.mock';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import type { IDiscussionFormFns } from '../../../../../discussion/discussion.d';
3
- import { ILikesFeedQueryFns } from '../../../../../discussion/feeds/likes-feed';
4
- import { type IQueryFns } from '../../cache';
2
+ import type { IDiscussionFormFns } from '../../../../discussion/discussion.d';
3
+ import { ILikesFeedQueryFns } from '../../../../discussion/feeds/likes-feed';
4
+ import { type IQueryFns } from './../cache';
5
5
  interface NestedRepliesFunctions {
6
6
  /** Functions for the replies query */
7
7
  reactions: IQueryFns;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { type IProfileFormProps } from '../../../form';
3
3
  import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
4
- import type { IDiscussionFormFns } from '../../discussion';
4
+ import type { IDiscussionFormFns } from './../../discussion';
5
5
  import { type IQueryFns } from './cache';
6
6
  interface RepliesFunctions {
7
7
  /** Functions for the replies query */
8
8
  reactions: IQueryFns;
9
- /** Functions for likes query */
9
+ /** Functions for the likes query */
10
10
  likes: ILikesFeedQueryFns;
11
11
  /** Query functions for the mentions */
12
12
  form: IDiscussionFormFns;
@@ -30,8 +30,6 @@ interface Props {
30
30
  functions: RepliesFunctions;
31
31
  /** Props to pass into the profile form */
32
32
  profile: IProfileFormProps;
33
- /** Whether to show the replies */
34
- showReplies: boolean;
35
33
  }
36
34
  declare const RepliesFeed: React.FC<Props>;
37
35
  export default RepliesFeed;
@@ -1,52 +1,46 @@
1
1
  export declare const activitySectionMock: {
2
- POST: {
3
- actor: {
4
- created_at: string;
5
- updated_at: string;
6
- id: string;
7
- data: {
8
- jobTitle: string;
9
- name: string;
10
- organization: string;
11
- location: {
12
- en: string;
13
- };
14
- badges: {
15
- communities: {
16
- 'community-slug': string[];
17
- };
2
+ actor: {
3
+ created_at: string;
4
+ updated_at: string;
5
+ id: string;
6
+ data: {
7
+ jobTitle: string;
8
+ name: string;
9
+ organization: string;
10
+ location: {
11
+ en: string;
12
+ };
13
+ badges: {
14
+ communities: {
15
+ 'community-slug': string[];
18
16
  };
19
17
  };
20
18
  };
21
- categories: never[];
22
- content: string;
23
- feed_id: string;
24
- foreign_id: string;
25
- id: string;
26
- latest_reactions: {
27
- like: never[];
28
- reply: never[];
29
- };
30
- latest_reactions_extra: {
31
- like: never[];
32
- reply: never[];
33
- };
34
- object: string;
35
- origin: null;
36
- own_reactions: {
37
- like: never[];
38
- reply: never[];
39
- };
40
- reaction_counts: {
41
- like: number;
42
- reply: number;
43
- };
44
- target: string;
45
- time: string;
46
- verb: string;
47
19
  };
48
- POLL: {
49
- total_replies: number;
50
- verb: string;
20
+ categories: string[];
21
+ content: string;
22
+ feed_id: string;
23
+ foreign_id: string;
24
+ id: string;
25
+ latest_reactions: {
26
+ like: never[];
27
+ reply: never[];
28
+ };
29
+ latest_reactions_extra: {
30
+ like: never[];
31
+ reply: never[];
32
+ };
33
+ object: string;
34
+ origin: null;
35
+ own_reactions: {
36
+ like: never[];
37
+ reply: never[];
38
+ };
39
+ reaction_counts: {
40
+ like: number;
41
+ reply: number;
51
42
  };
43
+ target: string;
44
+ time: string;
45
+ verb: string;
52
46
  };
@@ -1,3 +1,2 @@
1
1
  export { repliesFeedMock } from '../../../feeds/replies-feed';
2
- export * from './activity-functions.mock';
3
2
  export * from './activity-section.mock';
@@ -1,7 +1,6 @@
1
1
  import { MemberProps, MemberDetailsProps } from '../../../user';
2
2
  import type { ListMembers, ClickMentionFallback } from '../../../form';
3
3
  import type { IEnrichedUrlData } from '../../../navigation';
4
- import { IDiscussionFormFns } from '../../discussion';
5
4
  export type IDiscussionContentType = 'answer' | 'post' | 'response' | 'reply' | 'question';
6
5
  export interface IDiscussionContent {
7
6
  /** The type of content */
@@ -91,21 +90,3 @@ export interface IConversation {
91
90
  prepopulateForm?: string;
92
91
  mentionData?: IListMemberData;
93
92
  }
94
- export interface IDiscussionFormFunctions extends IDiscussionFormFns {
95
- onChange?: (args: {
96
- [key: string]: string | boolean;
97
- }) => void;
98
- create: DiscussionCreateContentFunction;
99
- handleSaveEdit?: (({ title, body }: {
100
- title: string;
101
- body: string;
102
- }) => Promise<void>) | (() => void);
103
- handleCancel?: () => void;
104
- callback?: (args: void) => void;
105
- onMention?: (value?: IListMemberData) => void;
106
- props?: {
107
- create: {
108
- projectNames: ['questions-answers'];
109
- };
110
- };
111
- }
@@ -13,7 +13,7 @@ export interface ILabel {
13
13
  htmlFor?: string;
14
14
  }
15
15
  export type FormActionTypes = 'addError' | 'formSubmitted' | 'formSubmittedAndReset' | 'removeError' | 'submitForm' | 'updateValue';
16
- export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean);
16
+ export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean | null | string);
17
17
  export interface IFieldOption {
18
18
  /** The ID of the option */
19
19
  id: string;
@@ -1,20 +1,12 @@
1
1
  import React from 'react';
2
- import { FormValues, IFormValues } from '../../components/form/form.types';
3
- export interface IPasswordFormProps {
2
+ import type { IFormProps, IFormValues } from '../../components/form/form.types';
3
+ export interface IPasswordFormProps extends Omit<IFormProps, 'id' | 'fields'> {
4
4
  /** Indicated for whether to show the current password field */
5
5
  isPasswordChange?: boolean;
6
6
  /** The functions being passed to the form */
7
- functions: {
7
+ functions: IFormProps['functions'] & {
8
8
  /** The function to call to create the password */
9
9
  createPassword: (arg: IFormValues) => Promise<void>;
10
- /** The function to call when onSuccess fails */
11
- onCatch?: (error?: unknown) => void;
12
- /** The function to call when the form submission fails */
13
- onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
14
- /** The function to call when the form is successfully submitted */
15
- onSuccess?: (arg: IFormValues) => Promise<void>;
16
- /** The function to call when the cancel button is clicked */
17
- onCancel?: () => void;
18
10
  };
19
11
  /** Specify custom text for the submit button */
20
12
  button?: {
package/helpers/intl.d.ts CHANGED
@@ -350,7 +350,6 @@ export declare const checkIntlPathExists: (path: string, language?: {
350
350
  poll_num_votes: string;
351
351
  poll_remove_vote_button: string;
352
352
  poll_aria_votes: string;
353
- replies_feed_missing_polls_vote_message: string;
354
353
  tableOfContents: string;
355
354
  timeToComplete_hours: string;
356
355
  timeToComplete_hours_short: string;