@apolitical/component-library 4.1.10-beta.0 → 4.1.10

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 (31) hide show
  1. package/constants/index.d.ts +0 -1
  2. package/discussion/components/post/components/share-link/index.d.ts +1 -0
  3. package/discussion/components/post/components/share-link/share-link.d.ts +6 -0
  4. package/form/components/rich-text-editor/components/context/context.d.ts +1 -3
  5. package/form/components/rich-text-editor/components/editor/index.d.ts +0 -1
  6. package/form/components/rich-text-editor/helpers/ast-types/ast-types.d.ts +1 -4
  7. package/form/components/rich-text-editor/helpers/index.d.ts +0 -1
  8. package/form/components/rich-text-editor/plugins/index.d.ts +0 -1
  9. package/form/components/rich-text-editor/rich-text-editor.d.ts +2 -10
  10. package/form/components/rich-text-editor/rich-text-editor.types.d.ts +2 -25
  11. package/general/index.d.ts +0 -1
  12. package/helpers/intl.d.ts +2 -0
  13. package/index.js +49 -49
  14. package/index.mjs +5813 -5962
  15. package/package.json +1 -1
  16. package/style.css +1 -1
  17. package/styles/variables/colors/theme/_discussion.scss +0 -1
  18. package/styles/variables/colors/theme/_form.scss +0 -1
  19. package/styles/variables/colors/theme/_general.scss +0 -3
  20. package/user/member/member.d.ts +2 -9
  21. package/constants/regex.d.ts +0 -1
  22. package/form/components/rich-text-editor/components/editor/mention-popover/index.d.ts +0 -1
  23. package/form/components/rich-text-editor/components/editor/mention-popover/mention-popover.d.ts +0 -2
  24. package/form/components/rich-text-editor/helpers/mentions/index.d.ts +0 -2
  25. package/form/components/rich-text-editor/helpers/mentions/insert-mention.d.ts +0 -5
  26. package/form/components/rich-text-editor/helpers/mentions/should-show-mentions-popover.d.ts +0 -5
  27. package/form/components/rich-text-editor/plugins/with-mentions/index.d.ts +0 -1
  28. package/form/components/rich-text-editor/plugins/with-mentions/with-mentions.d.ts +0 -6
  29. package/form/components/rich-text-editor/rich-text-editor.const.d.ts +0 -1
  30. package/general/popover/index.d.ts +0 -1
  31. package/general/popover/popover.d.ts +0 -11
@@ -2,5 +2,4 @@ export * from './assets';
2
2
  export * from './contact-details';
3
3
  export * from './courses';
4
4
  export * from './error-messages';
5
- export * from './regex';
6
5
  export * from './stats';
@@ -0,0 +1 @@
1
+ export { default as ShareLink } from './share-link';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ url: string;
4
+ }
5
+ declare const ShareLink: React.FC<Props>;
6
+ export default ShareLink;
@@ -1,6 +1,6 @@
1
1
  import { Dispatch } from 'react';
2
2
  import { Point } from 'slate';
3
- import { ReportError, IMentionPopOver } from './../../rich-text-editor.types';
3
+ import { ReportError } from './../../rich-text-editor.types';
4
4
  declare const RichTextEditorContext: import("react").Context<{
5
5
  /** The id of the editor */
6
6
  id: string;
@@ -12,8 +12,6 @@ declare const RichTextEditorContext: import("react").Context<{
12
12
  openTooltip: string | null;
13
13
  /** Whether the link editor is open */
14
14
  showLinkEditor: boolean;
15
- /** The data for the mention popover, including if it's showing, the selected user for the popover, and the possible users */
16
- mentionPopover: IMentionPopOver;
17
15
  /** The last anchor point (used for Slate to know where the cursor is) */
18
16
  lastAnchor: Point | null;
19
17
  /** The function to update the state */
@@ -1,3 +1,2 @@
1
1
  export * from './element';
2
2
  export * from './leaf';
3
- export * from './mention-popover';
@@ -7,7 +7,6 @@ export interface NodeTypes {
7
7
  [Formatting.ul]: string;
8
8
  [Formatting.ol]: string;
9
9
  [Formatting.li]: string;
10
- [Formatting.mention]: string;
11
10
  [Formatting.heading]: {
12
11
  1: string;
13
12
  2: string;
@@ -29,7 +28,6 @@ export declare enum MdastNodes {
29
28
  list = "list",
30
29
  listItem = "listItem",
31
30
  link = "link",
32
- mention = "mention",
33
31
  image = "image",
34
32
  blockquote = "blockquote",
35
33
  code = "code",
@@ -41,7 +39,7 @@ export declare enum MdastNodes {
41
39
  thematicBreak = "thematicBreak",
42
40
  text = "text"
43
41
  }
44
- export type MdastNodeType = MdastNodes.paragraph | MdastNodes.heading | MdastNodes.list | MdastNodes.listItem | MdastNodes.link | MdastNodes.mention | MdastNodes.image | MdastNodes.blockquote | MdastNodes.code | MdastNodes.html | MdastNodes.emphasis | MdastNodes.strong | MdastNodes.delete | MdastNodes.inlineCode | MdastNodes.thematicBreak | MdastNodes.text;
42
+ export type MdastNodeType = MdastNodes.paragraph | MdastNodes.heading | MdastNodes.list | MdastNodes.listItem | MdastNodes.link | MdastNodes.image | MdastNodes.blockquote | MdastNodes.code | MdastNodes.html | MdastNodes.emphasis | MdastNodes.strong | MdastNodes.delete | MdastNodes.inlineCode | MdastNodes.thematicBreak | MdastNodes.text;
45
43
  export declare const defaultNodeTypes: NodeTypes;
46
44
  export interface LeafType {
47
45
  text: string;
@@ -55,7 +53,6 @@ export interface BlockType {
55
53
  type: string;
56
54
  parentType?: string;
57
55
  link?: string;
58
- mention?: string;
59
56
  caption?: string;
60
57
  language?: string;
61
58
  break?: boolean;
@@ -2,6 +2,5 @@ export * from './ast-types';
2
2
  export * from './deserialize';
3
3
  export * from './handle-text';
4
4
  export * from './hot-keys';
5
- export * from './mentions';
6
5
  export * from './serialize';
7
6
  export * from './transform';
@@ -1,3 +1,2 @@
1
1
  export * from './with-linlines';
2
- export * from './with-mentions';
3
2
  export * from './without-empty-links';
@@ -1,5 +1,4 @@
1
- import type { IMentions } from '../../../discussion/discussion';
2
- import { GetUsers, ReportError } from './rich-text-editor.types';
1
+ import { ReportError } from './rich-text-editor.types';
3
2
  interface Props {
4
3
  /** The id of the rich text editor */
5
4
  id?: string;
@@ -11,8 +10,6 @@ interface Props {
11
10
  maxLength?: number;
12
11
  /** Optional functions */
13
12
  functions?: {
14
- /** An optional function to get a filtered list of members when the user starts typing a mention */
15
- getUsers?: GetUsers;
16
13
  /** An optional event handler, called when the rich text editor is changed */
17
14
  onChange?: (value: string) => void;
18
15
  /** An optional event handler, called when the rich text editor reports an error */
@@ -24,11 +21,6 @@ interface Props {
24
21
  'aria-invalid'?: boolean;
25
22
  /** Optional aria error message */
26
23
  'aria-errormessage'?: string;
27
- /** Optional data for the editor */
28
- data?: {
29
- /** Optional mentions */
30
- mentions?: IMentions;
31
- };
32
24
  }
33
- declare const RichTextEditor: ({ id, value, placeholder, maxLength, functions, autoFocus, data, ...props }: Props) => import("react/jsx-runtime").JSX.Element | null;
25
+ declare const RichTextEditor: ({ id, value, placeholder, maxLength, functions, autoFocus, ...props }: Props) => import("react/jsx-runtime").JSX.Element | null;
34
26
  export default RichTextEditor;
@@ -1,5 +1,4 @@
1
- import { BaseElement, BaseText, Descendant, Range } from 'slate';
2
- import type { MemberDetailsProps } from '../../../user';
1
+ import { BaseElement, BaseText, Descendant } from 'slate';
3
2
  export declare enum Formatting {
4
3
  blockquote = "block_quote",
5
4
  bold = "bold",
@@ -11,7 +10,6 @@ export declare enum Formatting {
11
10
  italic = "italic",
12
11
  li = "list_item",
13
12
  link = "link",
14
- mention = "mention",
15
13
  ol = "ol_list",
16
14
  paragraph = "paragraph",
17
15
  ul = "ul_list",
@@ -28,15 +26,10 @@ export interface BaseProps {
28
26
  className?: string;
29
27
  [key: string]: unknown;
30
28
  }
31
- export type BlockOptionType = Formatting.blockquote | Formatting.link | Formatting.li | Formatting.mention | Formatting.ol | Formatting.ul | Formatting.paragraph | Formatting.span;
29
+ export type BlockOptionType = Formatting.blockquote | Formatting.link | Formatting.li | Formatting.ol | Formatting.ul | Formatting.paragraph | Formatting.span;
32
30
  export interface TypeElement extends BaseElement {
33
31
  type: BlockOptionType;
34
32
  }
35
- export interface MentionElement extends BaseElement {
36
- type: Formatting.mention;
37
- id: string;
38
- name?: string;
39
- }
40
33
  export type MarkOptionType = Formatting.bold | Formatting.italic | Formatting.strikethrough;
41
34
  export interface TypeText extends BaseText {
42
35
  [Formatting.bold]?: boolean;
@@ -53,19 +46,3 @@ export type LinkElement = {
53
46
  children: Descendant[];
54
47
  };
55
48
  export type ReportError = (error: string) => void;
56
- export interface IMention {
57
- id: string;
58
- creator?: boolean;
59
- role?: string;
60
- createdAt?: string;
61
- updatedAt?: string;
62
- userId?: string;
63
- user: MemberDetailsProps;
64
- }
65
- export type GetUsers = (search: string) => Promise<IMention[]>;
66
- export interface IMentionPopOver {
67
- show: boolean;
68
- selectedUser: number;
69
- possibleUsers: IMention[];
70
- position: Range | null;
71
- }
@@ -2,7 +2,6 @@ export * from './buttons';
2
2
  export * from './divider';
3
3
  export * from './image-container';
4
4
  export * from './link';
5
- export * from './popover';
6
5
  export * from './portal';
7
6
  export * from './progress-tracker';
8
7
  export * from './responsive-image';
package/helpers/intl.d.ts CHANGED
@@ -146,6 +146,8 @@ export declare const checkIntlPathExists: (path: string, language?: {
146
146
  discussion_responses_empty: string;
147
147
  discussion_responses_empty_answer: string;
148
148
  discussion_responses_placeholder: string;
149
+ discussion_share_copy_link: string;
150
+ discussion_share_copy_link_success: string;
149
151
  discussion_thread_show: string;
150
152
  discussion_thread_hide: string;
151
153
  discussion_thread_loadMore: string;