@atlaskit/editor-common 108.5.1 → 108.6.1

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 (51) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/ai-messages/ai-failed-state.js +5 -0
  3. package/dist/cjs/hooks/useSharedPluginState.js +1 -1
  4. package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
  5. package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
  6. package/dist/cjs/link/LinkSearch/LinkSearchList.js +66 -2
  7. package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +87 -1
  8. package/dist/cjs/messages/block-menu.js +1 -1
  9. package/dist/cjs/monitoring/error.js +1 -1
  10. package/dist/cjs/preset/core-plugin/index.js +13 -2
  11. package/dist/cjs/safe-plugin/index.js +1 -1
  12. package/dist/cjs/ui/DropList/index.js +1 -1
  13. package/dist/es2019/ai-messages/ai-failed-state.js +5 -0
  14. package/dist/es2019/hooks/useSharedPluginState.js +1 -1
  15. package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
  16. package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
  17. package/dist/es2019/link/LinkSearch/LinkSearchList.js +58 -1
  18. package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +89 -1
  19. package/dist/es2019/messages/block-menu.js +1 -1
  20. package/dist/es2019/monitoring/error.js +1 -1
  21. package/dist/es2019/preset/core-plugin/index.js +13 -2
  22. package/dist/es2019/safe-plugin/index.js +1 -1
  23. package/dist/es2019/ui/DropList/index.js +1 -1
  24. package/dist/esm/ai-messages/ai-failed-state.js +5 -0
  25. package/dist/esm/hooks/useSharedPluginState.js +1 -1
  26. package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
  27. package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
  28. package/dist/esm/link/LinkSearch/LinkSearchList.js +63 -1
  29. package/dist/esm/link/LinkSearch/LinkSearchListItem.js +87 -1
  30. package/dist/esm/messages/block-menu.js +1 -1
  31. package/dist/esm/monitoring/error.js +1 -1
  32. package/dist/esm/preset/core-plugin/index.js +13 -2
  33. package/dist/esm/safe-plugin/index.js +1 -1
  34. package/dist/esm/ui/DropList/index.js +1 -1
  35. package/dist/types/ai-messages/ai-failed-state.d.ts +5 -0
  36. package/dist/types/hooks/useSharedPluginState.d.ts +1 -1
  37. package/dist/types/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +3 -0
  38. package/dist/types/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +3 -0
  39. package/dist/types/link/LinkSearch/LinkSearchList.d.ts +22 -1
  40. package/dist/types/link/LinkSearch/LinkSearchListItem.d.ts +16 -1
  41. package/dist/types/safe-plugin/index.d.ts +1 -1
  42. package/dist/types/types/next-editor-plugin.d.ts +2 -1
  43. package/dist/types-ts4.5/ai-messages/ai-failed-state.d.ts +5 -0
  44. package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +1 -1
  45. package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +3 -0
  46. package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +3 -0
  47. package/dist/types-ts4.5/link/LinkSearch/LinkSearchList.d.ts +22 -1
  48. package/dist/types-ts4.5/link/LinkSearch/LinkSearchListItem.d.ts +16 -1
  49. package/dist/types-ts4.5/safe-plugin/index.d.ts +1 -1
  50. package/dist/types-ts4.5/types/next-editor-plugin.d.ts +2 -1
  51. package/package.json +6 -3
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import React from 'react';
5
+ import React, { type KeyboardEvent } from 'react';
6
6
  import { type SerializedStyles } from '@emotion/react';
7
7
  import type { WrappedComponentProps } from 'react-intl-next';
8
8
  import type { LinkSearchListItemData } from './types';
@@ -10,6 +10,21 @@ export declare const container: SerializedStyles;
10
10
  export declare const containerSelected: SerializedStyles;
11
11
  export declare const nameStyle: SerializedStyles;
12
12
  export declare const containerName: SerializedStyles;
13
+ export interface PropsNext {
14
+ id?: string;
15
+ item: LinkSearchListItemData;
16
+ onFocus?: () => void;
17
+ onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
18
+ onMouseEnter?: (objectId: string) => void;
19
+ onMouseLeave?: (objectId: string) => void;
20
+ onMouseMove?: (objectId: string) => void;
21
+ onSelect: (href: string, text: string) => void;
22
+ role?: string;
23
+ selected: boolean;
24
+ }
25
+ export declare const ForwardedLinkSearchListItemNextWithIntl: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>>, "ref"> & React.RefAttributes<any>> & {
26
+ WrappedComponent: React.ComponentType<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>;
27
+ };
13
28
  export interface Props {
14
29
  id?: string;
15
30
  item: LinkSearchListItemData;
@@ -9,7 +9,7 @@ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
9
9
  * This function is useful for annotating DOM elements with metadata that describes the type and characteristics of the ProseMirror node.
10
10
  *
11
11
  *
12
- * @param {Object} params - The parameters for the function.
12
+ * @param {object} params - The parameters for the function.
13
13
  * @param {PMNode} params.node - The ProseMirror node from which to derive metadata.
14
14
  * @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached.
15
15
  */
@@ -57,9 +57,10 @@ export type CorePlugin = NextEditorPlugin<'core', {
57
57
  * Get the anchor ID for a ProseMirror node.
58
58
  *
59
59
  * @param node - The ProseMirror node to get the anchor ID for.
60
+ * @param pos - The position of the node in the document.
60
61
  * @returns The anchor ID if found, otherwise undefined.
61
62
  */
62
- getAnchorIdForNode: (node: PMNode) => string | undefined;
63
+ getAnchorIdForNode: (node: PMNode, pos: number) => string | undefined;
63
64
  /**
64
65
  * Replaces the current content of the editor with the provided raw value.
65
66
  *
@@ -54,4 +54,9 @@ export declare const aiFailedStateMessages: {
54
54
  defaultMessage: string;
55
55
  description: string;
56
56
  };
57
+ adfStreamingError: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
57
62
  };
@@ -8,7 +8,7 @@ type Options = {
8
8
  };
9
9
  /**
10
10
  *
11
- * NOTE: Generally you may want to use `usePluginStateSelector` over this which behaves similarly
11
+ * NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
12
12
  * but selects a slice of the state which is more performant.
13
13
  *
14
14
  * ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
@@ -30,6 +30,9 @@ type Options = {
30
30
  disabled?: boolean;
31
31
  };
32
32
  /**
33
+ *
34
+ * NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
35
+ * but selects a slice of the state which is more performant.
33
36
  *
34
37
  * ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
35
38
  * If the plugins you are listening to generate multiple shared states while the user is typing,
@@ -84,6 +84,7 @@ export declare class HyperlinkLinkAddToolbar extends PureComponent<Props, State>
84
84
  private urlInputContainer;
85
85
  private displayTextInputContainer;
86
86
  private wrapperRef;
87
+ private listItemRefs;
87
88
  private handleClearText;
88
89
  private handleClearDisplayText;
89
90
  private debouncedQuickSearch;
@@ -101,6 +102,7 @@ export declare class HyperlinkLinkAddToolbar extends PureComponent<Props, State>
101
102
  private createClearHandler;
102
103
  private handleClickOutside;
103
104
  private getScreenReaderText;
105
+ private listItemRefCallback;
104
106
  render(): jsx.JSX.Element;
105
107
  private isUrlPopulatedWithSelectedItem;
106
108
  private handleSelected;
@@ -109,6 +111,7 @@ export declare class HyperlinkLinkAddToolbar extends PureComponent<Props, State>
109
111
  private handleMouseLeaveResultItem;
110
112
  private handleSubmit;
111
113
  private handleClearTextKeyDown;
114
+ private handleListItemFocus;
112
115
  private handleKeyDown;
113
116
  private updateTextInput;
114
117
  private handleCancel;
@@ -2,10 +2,26 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { PureComponent } from 'react';
5
+ import { PureComponent, type KeyboardEvent } from 'react';
6
6
  import { jsx, type SerializedStyles } from '@emotion/react';
7
7
  import type { LinkSearchListItemData } from './types';
8
8
  export declare const linkSearchList: SerializedStyles;
9
+ export interface PropsNext {
10
+ ariaControls?: string;
11
+ id?: string;
12
+ isLoading: boolean;
13
+ items?: LinkSearchListItemData[];
14
+ listItemRefCallback?: (el: HTMLElement | null, id: string) => void;
15
+ onFocus?: (index: number) => void;
16
+ onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
17
+ onMouseEnter?: (objectId: string) => void;
18
+ onMouseLeave?: (objectId: string) => void;
19
+ onMouseMove?: (objectId: string) => void;
20
+ onSelect: (href: string, text: string) => void;
21
+ role?: string;
22
+ selectedIndex: number;
23
+ }
24
+ export declare const LinkSearchListNext: ({ listItemRefCallback, onFocus, onKeyDown, onSelect, onMouseMove, onMouseEnter, onMouseLeave, items, selectedIndex, isLoading, ariaControls, role, id, }: PropsNext) => jsx.JSX.Element;
9
25
  export interface Props {
10
26
  ariaControls?: string;
11
27
  id?: string;
@@ -18,6 +34,11 @@ export interface Props {
18
34
  role?: string;
19
35
  selectedIndex: number;
20
36
  }
37
+ /**
38
+ * *Warning:* With `platform_editor_a11y_insert_link_item_focus` enabled this component is no longer used and is replaced with `<LinkSearchListNext />`.
39
+ *
40
+ * If making changes to this component please ensure to also update `<LinkSearchListNext />`.
41
+ */
21
42
  export default class LinkSearchList extends PureComponent<Props, Object> {
22
43
  render(): jsx.JSX.Element;
23
44
  }
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import React from 'react';
5
+ import React, { type KeyboardEvent } from 'react';
6
6
  import { type SerializedStyles } from '@emotion/react';
7
7
  import type { WrappedComponentProps } from 'react-intl-next';
8
8
  import type { LinkSearchListItemData } from './types';
@@ -10,6 +10,21 @@ export declare const container: SerializedStyles;
10
10
  export declare const containerSelected: SerializedStyles;
11
11
  export declare const nameStyle: SerializedStyles;
12
12
  export declare const containerName: SerializedStyles;
13
+ export interface PropsNext {
14
+ id?: string;
15
+ item: LinkSearchListItemData;
16
+ onFocus?: () => void;
17
+ onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
18
+ onMouseEnter?: (objectId: string) => void;
19
+ onMouseLeave?: (objectId: string) => void;
20
+ onMouseMove?: (objectId: string) => void;
21
+ onSelect: (href: string, text: string) => void;
22
+ role?: string;
23
+ selected: boolean;
24
+ }
25
+ export declare const ForwardedLinkSearchListItemNextWithIntl: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>>, "ref"> & React.RefAttributes<any>> & {
26
+ WrappedComponent: React.ComponentType<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>;
27
+ };
13
28
  export interface Props {
14
29
  id?: string;
15
30
  item: LinkSearchListItemData;
@@ -9,7 +9,7 @@ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
9
9
  * This function is useful for annotating DOM elements with metadata that describes the type and characteristics of the ProseMirror node.
10
10
  *
11
11
  *
12
- * @param {Object} params - The parameters for the function.
12
+ * @param {object} params - The parameters for the function.
13
13
  * @param {PMNode} params.node - The ProseMirror node from which to derive metadata.
14
14
  * @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached.
15
15
  */
@@ -57,9 +57,10 @@ export type CorePlugin = NextEditorPlugin<'core', {
57
57
  * Get the anchor ID for a ProseMirror node.
58
58
  *
59
59
  * @param node - The ProseMirror node to get the anchor ID for.
60
+ * @param pos - The position of the node in the document.
60
61
  * @returns The anchor ID if found, otherwise undefined.
61
62
  */
62
- getAnchorIdForNode: (node: PMNode) => string | undefined;
63
+ getAnchorIdForNode: (node: PMNode, pos: number) => string | undefined;
63
64
  /**
64
65
  * Replaces the current content of the editor with the provided raw value.
65
66
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "108.5.1",
3
+ "version": "108.6.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -170,14 +170,14 @@
170
170
  "@atlaskit/profilecard": "^24.11.0",
171
171
  "@atlaskit/react-ufo": "^4.5.0",
172
172
  "@atlaskit/section-message": "^8.7.0",
173
- "@atlaskit/smart-card": "^40.20.0",
173
+ "@atlaskit/smart-card": "^40.21.0",
174
174
  "@atlaskit/smart-user-picker": "^8.2.0",
175
175
  "@atlaskit/spinner": "^19.0.0",
176
176
  "@atlaskit/status": "^3.0.0",
177
177
  "@atlaskit/task-decision": "^19.2.0",
178
178
  "@atlaskit/textfield": "^8.0.0",
179
179
  "@atlaskit/theme": "^20.0.0",
180
- "@atlaskit/tmp-editor-statsig": "^12.6.0",
180
+ "@atlaskit/tmp-editor-statsig": "^12.7.0",
181
181
  "@atlaskit/tokens": "^6.3.0",
182
182
  "@atlaskit/tooltip": "^20.4.0",
183
183
  "@atlaskit/width-detector": "^5.0.0",
@@ -369,6 +369,9 @@
369
369
  },
370
370
  "platform_editor_resolve_hyperlinks_killswitch": {
371
371
  "type": "boolean"
372
+ },
373
+ "platform_editor_a11y_insert_link_item_focus": {
374
+ "type": "boolean"
372
375
  }
373
376
  }
374
377
  }