@apolitical/component-library 4.7.5-ac.4 → 4.7.5-beta.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 (36) hide show
  1. package/discussion/components/index.d.ts +1 -0
  2. package/discussion/components/post/post.d.ts +1 -9
  3. package/discussion/components/profile-modal-launcher/index.d.ts +1 -0
  4. package/discussion/components/profile-modal-launcher/profile-modal-launcher.d.ts +7 -0
  5. package/discussion/components/profile-modal-launcher/profile-modal-launcher.mock.d.ts +24 -0
  6. package/discussion/feeds/activities-feed/activities-feed.d.ts +3 -2
  7. package/discussion/feeds/activities-feed/cache/hooks/index.d.ts +0 -2
  8. package/discussion/feeds/activities-feed/mocks/activities-feed.mock.d.ts +3 -36
  9. package/discussion/feeds/replies-feed/replies-feed.d.ts +4 -1
  10. package/discussion/sections/activity-section/activity-section.d.ts +4 -3
  11. package/discussion/sections/activity-section/cache/hooks/index.d.ts +0 -2
  12. package/discussion/shared/helpers/activity.helper.d.ts +0 -2
  13. package/discussion/shared/mocks/reaction.mock.d.ts +0 -20
  14. package/enums/custom-events.d.ts +1 -0
  15. package/form/components/form/form.types.d.ts +1 -1
  16. package/form/types/profile-form/profile-form.mock.d.ts +19 -0
  17. package/helpers/index.d.ts +1 -0
  18. package/helpers/intl.d.ts +3 -2
  19. package/helpers/profile-is-complete/index.d.ts +1 -0
  20. package/helpers/profile-is-complete/profile-is-complete.d.ts +3 -0
  21. package/index.js +61 -61
  22. package/index.mjs +8497 -8575
  23. package/modals/types/profile-modal/index.d.ts +1 -0
  24. package/modals/types/profile-modal/profile-modal.d.ts +2 -2
  25. package/package.json +1 -1
  26. package/style.css +1 -1
  27. package/styles/base/buttons/_icons.scss +1 -3
  28. package/styles/variables/colors/theme/_discussion.scss +0 -2
  29. package/discussion/feeds/activities-feed/cache/hooks/pin/index.d.ts +0 -1
  30. package/discussion/feeds/activities-feed/cache/hooks/pin/pin.hook.d.ts +0 -7
  31. package/discussion/feeds/activities-feed/cache/hooks/unpin/index.d.ts +0 -1
  32. package/discussion/feeds/activities-feed/cache/hooks/unpin/unpin.hook.d.ts +0 -8
  33. package/discussion/sections/activity-section/cache/hooks/pin/index.d.ts +0 -1
  34. package/discussion/sections/activity-section/cache/hooks/pin/pin.hook.d.ts +0 -8
  35. package/discussion/sections/activity-section/cache/hooks/unpin/index.d.ts +0 -1
  36. package/discussion/sections/activity-section/cache/hooks/unpin/unpin.hook.d.ts +0 -8
@@ -4,5 +4,6 @@ export * from './discussion-form-card';
4
4
  export * from './form';
5
5
  export * from './likes';
6
6
  export * from './post';
7
+ export * from './profile-modal-launcher';
7
8
  export * from './responses-heading';
8
9
  export * from './thread';
@@ -12,8 +12,6 @@ interface Props {
12
12
  content: PostContent;
13
13
  /** If the user has permission to interact with the post box and content, e.g. if they're a member of the community */
14
14
  userHasPermissions?: boolean;
15
- /** If the user has owner permissions, e.g. if they're a community owner */
16
- userHasOwnerPermissions?: boolean;
17
15
  /** If the post is still loading */
18
16
  isLoading?: boolean;
19
17
  /** The ID of the original post author, for threads */
@@ -46,12 +44,6 @@ interface Props {
46
44
  /** Function to call when clicking mention fallback */
47
45
  clickMentionFallback: ClickMentionFallback;
48
46
  };
49
- pins?: {
50
- /** Pin the post */
51
- createPin?: () => void;
52
- /** Unpin the post */
53
- deletePin?: () => void;
54
- };
55
47
  };
56
48
  /** Optional `href`s for the card to link to */
57
49
  links?: {
@@ -78,5 +70,5 @@ interface Props {
78
70
  /** If the post is used within a community */
79
71
  isCommunity?: boolean;
80
72
  }
81
- declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton }, setFocus, isCommunity, }: Props) => import("react/jsx-runtime").JSX.Element;
73
+ declare const Post: ({ element, content, userHasPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton }, setFocus, isCommunity, }: Props) => import("react/jsx-runtime").JSX.Element;
82
74
  export default Post;
@@ -0,0 +1 @@
1
+ export { default as ProfileModalLauncher } from './profile-modal-launcher';
@@ -0,0 +1,7 @@
1
+ import type { IProfileFormProps } from '../../../form';
2
+ interface Props {
3
+ /** The `form` props for ProfileModal */
4
+ form: IProfileFormProps;
5
+ }
6
+ declare const ProfileModalLauncher: ({ form }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default ProfileModalLauncher;
@@ -0,0 +1,24 @@
1
+ declare const _default: {
2
+ functions: {
3
+ onClose: () => void;
4
+ };
5
+ form: {
6
+ hooks: {
7
+ useMaps: () => {
8
+ buildLocation: (input: string) => Promise<{
9
+ id: string;
10
+ en: string;
11
+ code: string;
12
+ }>;
13
+ isValidPlace: (input: string) => boolean;
14
+ predictPlaces: (input: string) => Promise<never[]>;
15
+ };
16
+ };
17
+ functions: {
18
+ uploadImage: () => Promise<void>;
19
+ onSuccess: () => Promise<void>;
20
+ onFailure: () => void;
21
+ };
22
+ };
23
+ };
24
+ export default _default;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { type IProfileFormProps } from '../../../form';
2
3
  import type { IMentionsFns } from '../../../discussion/discussion.d';
3
4
  import type { IQueryFns } from './cache';
4
5
  interface Props {
@@ -8,8 +9,6 @@ interface Props {
8
9
  parentId: string;
9
10
  /** Whether the user is a member of the community */
10
11
  isMember: boolean;
11
- /** Whether the user is an owner of the community */
12
- isOwner: boolean;
13
12
  /** Functions for the activities query */
14
13
  functions: {
15
14
  /** Query functions for the activities */
@@ -21,6 +20,8 @@ interface Props {
21
20
  /** Function to leave the community */
22
21
  leave: () => Promise<void>;
23
22
  };
23
+ /** Props to pass into the profile form */
24
+ profile: IProfileFormProps;
24
25
  }
25
26
  declare const ActivitiesFeed: React.FC<Props>;
26
27
  export default ActivitiesFeed;
@@ -3,7 +3,5 @@ export * from './edit';
3
3
  export * from './feed';
4
4
  export * from './like';
5
5
  export * from './list';
6
- export * from './pin';
7
6
  export * from './remove';
8
7
  export * from './unlike';
9
- export * from './unpin';
@@ -15,40 +15,13 @@ export declare const activitiesFeedMock: {
15
15
  feed_id: string;
16
16
  foreign_id: string;
17
17
  id: string;
18
- latest_reactions: {
19
- pin: {
20
- created_at: string;
21
- updated_at: string;
22
- id: string;
23
- user_id: string;
24
- user: {
25
- created_at: string;
26
- updated_at: string;
27
- id: string;
28
- data: {
29
- jobTitle: string;
30
- name: string;
31
- organization: string;
32
- thumbnail: string;
33
- };
34
- };
35
- kind: string;
36
- activity_id: string;
37
- data: {
38
- mentioned_users: null;
39
- };
40
- parent: string;
41
- latest_children: {};
42
- children_counts: {};
43
- }[];
44
- };
18
+ latest_reactions: {};
45
19
  latest_reactions_extra: {};
46
20
  object: string;
47
21
  origin: null;
48
22
  own_reactions: {};
49
23
  reaction_counts: {
50
24
  like: number;
51
- pin: number;
52
25
  };
53
26
  target: string;
54
27
  time: string;
@@ -69,16 +42,13 @@ export declare const activitiesFeedMock: {
69
42
  feed_id: string;
70
43
  foreign_id: string;
71
44
  id: string;
72
- latest_reactions: {
73
- pin?: undefined;
74
- };
45
+ latest_reactions: {};
75
46
  latest_reactions_extra: {};
76
47
  object: string;
77
48
  origin: null;
78
49
  own_reactions: {};
79
50
  reaction_counts: {
80
51
  like?: undefined;
81
- pin?: undefined;
82
52
  };
83
53
  target: string;
84
54
  time: string;
@@ -98,16 +68,13 @@ export declare const activitiesFeedMock: {
98
68
  feed_id: string;
99
69
  foreign_id: string;
100
70
  id: string;
101
- latest_reactions: {
102
- pin?: undefined;
103
- };
71
+ latest_reactions: {};
104
72
  latest_reactions_extra: {};
105
73
  object: string;
106
74
  origin: null;
107
75
  own_reactions: {};
108
76
  reaction_counts: {
109
77
  like?: undefined;
110
- pin?: undefined;
111
78
  };
112
79
  target: string;
113
80
  time: string;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import { type IProfileFormProps } from '../../../form';
2
3
  import type { IMentionsFns } from './../../discussion';
3
- import type { IQueryFns } from './cache';
4
+ import { type IQueryFns } from './cache';
4
5
  interface Props {
5
6
  /** The base path, used for slugs */
6
7
  basePath: string;
@@ -21,6 +22,8 @@ interface Props {
21
22
  /** Function to leave the community */
22
23
  leave: () => Promise<void>;
23
24
  };
25
+ /** Props to pass into the profile form */
26
+ profile: IProfileFormProps;
24
27
  }
25
28
  declare const RepliesFeed: React.FC<Props>;
26
29
  export default RepliesFeed;
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
- import type { IRepliesFeedQueryFns } from '../../../discussion/feeds';
2
+ import { type IProfileFormProps } from '../../../form';
3
+ import { type IRepliesFeedQueryFns } from '../../../discussion/feeds';
3
4
  import type { IMentionsFns } from './../../discussion.d';
4
- import type { IQueryFns } from './cache';
5
+ import { type IQueryFns } from './cache';
5
6
  interface IActivitySectionQueryFns extends IQueryFns {
6
7
  remove: () => Promise<void>;
7
8
  }
@@ -10,7 +11,6 @@ interface Props {
10
11
  parentId: string;
11
12
  activityId: string;
12
13
  isMember: boolean;
13
- isOwner: boolean;
14
14
  functions: {
15
15
  activities: IActivitySectionQueryFns;
16
16
  reactions: IRepliesFeedQueryFns;
@@ -18,6 +18,7 @@ interface Props {
18
18
  join: () => Promise<void>;
19
19
  leave: () => Promise<void>;
20
20
  };
21
+ profile: IProfileFormProps;
21
22
  }
22
23
  declare const ActivitySection: React.FC<Props>;
23
24
  export default ActivitySection;
@@ -3,5 +3,3 @@ export * from './read';
3
3
  export * from './section';
4
4
  export * from './like';
5
5
  export * from './unlike';
6
- export * from './pin';
7
- export * from './unpin';
@@ -27,6 +27,4 @@ export declare function prepareActivity({ title, content }: IPrepareActivityArgs
27
27
  export declare function enrichActivity({ activity, user }: IEnrichActivityArgs): IActivity;
28
28
  export declare function incrementActivityLikes({ activity, reaction, }: IIncrementActivityLikesArgs): void;
29
29
  export declare function decrementActivityLikes({ activity, user }: IDecrementActivityLikesArgs): void;
30
- export declare function incrementActivityPins({ activity, reaction, }: IIncrementActivityLikesArgs): void;
31
- export declare function decrementActivityPins({ activity }: IDecrementActivityLikesArgs): void;
32
30
  export {};
@@ -18,23 +18,3 @@ export declare const reactionMock1: Readonly<{
18
18
  updated_at: string;
19
19
  };
20
20
  }>;
21
- export declare const reactionMock2: Readonly<{
22
- id: "some-reaction-id-1";
23
- activity_id: "some-activity-id-1";
24
- kind: "pin";
25
- created_at: "2023-11-24T17:58:36.162000";
26
- data: {};
27
- parent: "";
28
- updated_at: "2023-11-24T17:58:36.162000";
29
- user_id: "some-user-id-2";
30
- children_counts: {};
31
- latest_children: {};
32
- latest_children_extra: {};
33
- own_children: {};
34
- user: {
35
- id: "some-user-id-2";
36
- data: {};
37
- created_at: string;
38
- updated_at: string;
39
- };
40
- }>;
@@ -1,4 +1,5 @@
1
1
  export declare enum CustomEvents {
2
+ DISCUSSION_FORM_SUBMITTED = "discussionFormSubmitted",
2
3
  DISCUSSION_POST_CLICKED = "discussionPostClicked",
3
4
  MEMBER_CLICKED = "memberClicked"
4
5
  }
@@ -12,7 +12,7 @@ export interface ILabel {
12
12
  /** The ID of the input to be labelled */
13
13
  htmlFor?: string;
14
14
  }
15
- export type FormActionTypes = 'addError' | 'formSubmitted' | 'formSubmittedAndReset' | 'removeError' | 'submitForm' | 'toggleSubmitting' | 'updateValue';
15
+ export type FormActionTypes = 'addError' | 'formSubmitted' | 'formSubmittedAndReset' | 'removeError' | 'submitForm' | 'updateValue';
16
16
  export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean);
17
17
  export interface IFieldOption {
18
18
  /** The ID of the option */
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ hooks: {
3
+ useMaps: () => {
4
+ buildLocation: (input: string) => Promise<{
5
+ id: string;
6
+ en: string;
7
+ code: string;
8
+ }>;
9
+ isValidPlace: (input: string) => boolean;
10
+ predictPlaces: (input: string) => Promise<never[]>;
11
+ };
12
+ };
13
+ functions: {
14
+ uploadImage: () => Promise<void>;
15
+ onSuccess: () => Promise<void>;
16
+ onFailure: () => void;
17
+ };
18
+ };
19
+ export default _default;
@@ -9,6 +9,7 @@ export * from './intl';
9
9
  export * from './numbers';
10
10
  export { default as passPropsToChildren } from './pass-props-to-children';
11
11
  export * from './prerender';
12
+ export * from './profile-is-complete';
12
13
  export { default as replaceMentionData } from './replace-mention-data';
13
14
  export * from './urls';
14
15
  export * from './validation';
package/helpers/intl.d.ts CHANGED
@@ -152,8 +152,6 @@ export declare const checkIntlPathExists: (path: string, language?: {
152
152
  discussion_likes_show: string;
153
153
  discussion_moreMenu_edit: string;
154
154
  discussion_moreMenu_delete: string;
155
- discussion_moreMenu_pin: string;
156
- discussion_moreMenu_unpin: string;
157
155
  discussion_moreMenu_report: string;
158
156
  discussion_comments_screenReader: string;
159
157
  discussion_comments: string;
@@ -168,6 +166,9 @@ export declare const checkIntlPathExists: (path: string, language?: {
168
166
  discussion_thread_show: string;
169
167
  discussion_thread_hide: string;
170
168
  discussion_thread_loadMore: string;
169
+ profileModalLauncher_successMessage: string;
170
+ profileModalLauncher_title: string;
171
+ profileModalLauncher_text: string;
171
172
  contactFooter_title: string;
172
173
  contactFooter_text: string;
173
174
  contactFooter_phone: string;
@@ -0,0 +1 @@
1
+ export { default as profileIsComplete } from './profile-is-complete';
@@ -0,0 +1,3 @@
1
+ import { IUserDetails } from '../../context';
2
+ declare const profileIsComplete: (details: IUserDetails) => boolean;
3
+ export default profileIsComplete;