@atlaskit/editor-core 179.0.3 → 179.1.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 (107) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +1 -1
  3. package/dist/cjs/create-editor/create-plugins-list.js +6 -287
  4. package/dist/cjs/{plugins/feature-flags-context → create-editor}/feature-flags-from-props.js +0 -0
  5. package/dist/cjs/editor.js +41 -8
  6. package/dist/cjs/labs/next/presets/universal.js +313 -0
  7. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +24 -5
  8. package/dist/cjs/plugins/floating-toolbar/index.js +6 -0
  9. package/dist/cjs/plugins/floating-toolbar/pm-plugins/force-focus/index.js +72 -0
  10. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +12 -9
  11. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +3 -1
  12. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -2
  13. package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +40 -1
  14. package/dist/cjs/plugins/list/commands/outdent-list.js +22 -9
  15. package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +30 -12
  16. package/dist/cjs/plugins/list/utils/analytics.js +18 -2
  17. package/dist/cjs/plugins/media/commands/linking.js +2 -2
  18. package/dist/cjs/plugins/media/pm-plugins/alt-text/index.js +1 -12
  19. package/dist/cjs/plugins/media/toolbar/alt-text.js +14 -3
  20. package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +6 -6
  21. package/dist/cjs/plugins/media/toolbar/linking.js +7 -1
  22. package/dist/cjs/plugins/paste/handlers.js +7 -5
  23. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +17 -0
  24. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +13 -13
  25. package/dist/cjs/test-utils.js +13 -1
  26. package/dist/cjs/utils/document.js +3 -2
  27. package/dist/cjs/utils/input-rules.js +3 -2
  28. package/dist/cjs/utils/lists.js +31 -0
  29. package/dist/cjs/utils/prepare-quick-insert-provider.js +22 -0
  30. package/dist/cjs/version-wrapper.js +1 -1
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/create-editor/ReactEditorView.js +1 -1
  33. package/dist/es2019/create-editor/create-plugins-list.js +5 -293
  34. package/dist/es2019/{plugins/feature-flags-context → create-editor}/feature-flags-from-props.js +0 -0
  35. package/dist/es2019/editor.js +41 -7
  36. package/dist/es2019/labs/next/presets/universal.js +311 -0
  37. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +19 -2
  38. package/dist/es2019/plugins/floating-toolbar/index.js +4 -0
  39. package/dist/es2019/plugins/floating-toolbar/pm-plugins/force-focus/index.js +59 -0
  40. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +6 -3
  41. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +3 -1
  42. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -2
  43. package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +41 -1
  44. package/dist/es2019/plugins/list/commands/outdent-list.js +16 -1
  45. package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +29 -11
  46. package/dist/es2019/plugins/list/utils/analytics.js +12 -0
  47. package/dist/es2019/plugins/media/commands/linking.js +2 -2
  48. package/dist/es2019/plugins/media/pm-plugins/alt-text/index.js +1 -12
  49. package/dist/es2019/plugins/media/toolbar/alt-text.js +14 -3
  50. package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +6 -6
  51. package/dist/es2019/plugins/media/toolbar/linking.js +9 -1
  52. package/dist/es2019/plugins/paste/handlers.js +8 -6
  53. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +17 -0
  54. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +13 -13
  55. package/dist/es2019/test-utils.js +11 -1
  56. package/dist/es2019/utils/document.js +3 -2
  57. package/dist/es2019/utils/input-rules.js +3 -2
  58. package/dist/es2019/utils/lists.js +26 -0
  59. package/dist/es2019/utils/prepare-quick-insert-provider.js +17 -0
  60. package/dist/es2019/version-wrapper.js +1 -1
  61. package/dist/es2019/version.json +1 -1
  62. package/dist/esm/create-editor/ReactEditorView.js +1 -1
  63. package/dist/esm/create-editor/create-plugins-list.js +6 -287
  64. package/dist/esm/{plugins/feature-flags-context → create-editor}/feature-flags-from-props.js +0 -0
  65. package/dist/esm/editor.js +41 -8
  66. package/dist/esm/labs/next/presets/universal.js +306 -0
  67. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +24 -5
  68. package/dist/esm/plugins/floating-toolbar/index.js +6 -0
  69. package/dist/esm/plugins/floating-toolbar/pm-plugins/force-focus/index.js +62 -0
  70. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +12 -9
  71. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +3 -1
  72. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -2
  73. package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +40 -1
  74. package/dist/esm/plugins/list/commands/outdent-list.js +15 -2
  75. package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +30 -12
  76. package/dist/esm/plugins/list/utils/analytics.js +12 -0
  77. package/dist/esm/plugins/media/commands/linking.js +2 -2
  78. package/dist/esm/plugins/media/pm-plugins/alt-text/index.js +1 -12
  79. package/dist/esm/plugins/media/toolbar/alt-text.js +14 -3
  80. package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +6 -6
  81. package/dist/esm/plugins/media/toolbar/linking.js +7 -1
  82. package/dist/esm/plugins/paste/handlers.js +8 -6
  83. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +17 -0
  84. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +13 -13
  85. package/dist/esm/test-utils.js +11 -1
  86. package/dist/esm/utils/document.js +3 -2
  87. package/dist/esm/utils/input-rules.js +3 -2
  88. package/dist/esm/utils/lists.js +24 -0
  89. package/dist/esm/utils/prepare-quick-insert-provider.js +17 -0
  90. package/dist/esm/version-wrapper.js +1 -1
  91. package/dist/esm/version.json +1 -1
  92. package/dist/types/create-editor/create-plugins-list.d.ts +5 -4
  93. package/dist/types/{plugins/feature-flags-context → create-editor}/feature-flags-from-props.d.ts +2 -2
  94. package/dist/types/editor.d.ts +42 -0
  95. package/dist/types/labs/next/presets/universal.d.ts +30 -0
  96. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +4 -0
  97. package/dist/types/plugins/expand/index.d.ts +4 -1
  98. package/dist/types/plugins/floating-toolbar/pm-plugins/force-focus/index.d.ts +18 -0
  99. package/dist/types/plugins/list/utils/analytics.d.ts +5 -2
  100. package/dist/types/plugins/media/commands/linking.d.ts +1 -1
  101. package/dist/types/test-utils.d.ts +7 -0
  102. package/dist/types/types/editor-props.d.ts +96 -92
  103. package/dist/types/utils/input-rules.d.ts +2 -1
  104. package/dist/types/utils/lists.d.ts +2 -0
  105. package/dist/types/utils/prepare-quick-insert-provider.d.ts +16 -0
  106. package/package.json +8 -8
  107. package/report.api.md +89 -79
@@ -0,0 +1,30 @@
1
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import { EditorPlugin } from '../../../types';
3
+ import type { EditorAppearance, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
4
+ import { DefaultPresetPluginOptions } from './default';
5
+ import { EditorPresetProps } from './types';
6
+ import type { InsertNodeAPI } from '../../../insert-api/types';
7
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
8
+ import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
9
+ import { Preset } from './preset';
10
+ import { FeatureFlags } from '../../../types/feature-flags';
11
+ import { EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
12
+ declare type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & EditorPluginFeatureProps & EditorProviderProps;
13
+ /**
14
+ * Creates a preset with all of the available plugins.
15
+ * Basis for create-plugins-list and can be used to migrate from Editor -> EditorNext (Presets project)
16
+ * with minimal friction.
17
+ *
18
+ * @param appearance
19
+ * @param props A subset of full EditorProps for the full feature preset
20
+ * @param featureFlags
21
+ * @param prevAppearance The appearance of the editor in the previous render
22
+ * @param createAnalyticsEvent
23
+ * @param insertNodeAPI
24
+ * @param editorAnalyticsAPI
25
+ * @param editorSelectionAPI
26
+ * @param getEditorContainerWidth
27
+ * @returns a full featured preset configured according to the provided props - basis for create-plugins-list
28
+ */
29
+ export default function createUniversalPreset(appearance: EditorAppearance | undefined, props: UniversalPresetProps, featureFlags: FeatureFlags, prevAppearance?: EditorAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent, insertNodeAPI?: InsertNodeAPI, editorAnalyticsAPI?: EditorAnalyticsAPI, editorSelectionAPI?: EditorSelectionAPI, getEditorContainerWidth?: GetEditorContainerWidth): Preset<EditorPlugin, []>;
30
+ export {};
@@ -17,6 +17,10 @@ export declare type EditLinkToolbarProps = {
17
17
  export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProps> {
18
18
  componentDidUpdate(prevProps: EditLinkToolbarProps): void;
19
19
  componentWillUnmount(): void;
20
+ /** Focus should move to the 'Edit link' button when the toolbar closes
21
+ * and not close the floating toolbar.
22
+ */
23
+ private handleEsc;
20
24
  private hideLinkToolbar;
21
25
  render(): JSX.Element;
22
26
  }
@@ -5,7 +5,10 @@ interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
5
5
  appearance?: EditorProps['appearance'];
6
6
  }
7
7
  declare const expandPlugin: NextEditorPlugin<'expand', never, ExpandPluginOptions>;
8
+ interface ExpandEditorProps {
9
+ allowExpand?: EditorProps['allowExpand'];
10
+ }
8
11
  export default expandPlugin;
9
12
  export type { ExpandPluginState } from './types';
10
- export declare function isExpandInsertionEnabled({ allowExpand }: EditorProps): boolean;
13
+ export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
11
14
  export { pluginKey } from './pm-plugins/plugin-factory';
@@ -0,0 +1,18 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { PluginKey } from 'prosemirror-state';
3
+ import { EditorView } from 'prosemirror-view';
4
+ export declare const forceFocusStateKey: PluginKey<any, any>;
5
+ declare const _default: () => SafePlugin<any, any>;
6
+ /**
7
+ * Used in cases where a floating toolbar button opens a submenu which destroys
8
+ * the button, but the user has pressed ESC to close the submenu and focus needs
9
+ * to move back to the button. */
10
+ export default _default;
11
+ /**
12
+ * The provided selector should be the floating toolbar button that needs focus.
13
+ */
14
+ export declare function forceFocusSelector(selector: string | null, view?: EditorView): void;
15
+ /**
16
+ * If a selector is set and the element exists, focus it.
17
+ */
18
+ export declare function checkShouldForceFocusAndApply(view?: EditorView): void;
@@ -1,4 +1,7 @@
1
- import { EditorState } from 'prosemirror-state';
2
- import { CommonListAnalyticsAttributes } from '../../analytics';
1
+ import { EditorState, Transaction } from 'prosemirror-state';
2
+ import { RestartListsAttributesForListOutdented, CommonListAnalyticsAttributes } from '@atlaskit/editor-common/analytics';
3
3
  export declare const getCommonListAnalyticsAttributes: (state: EditorState) => CommonListAnalyticsAttributes;
4
4
  export declare const countListItemsInSelection: (state: EditorState) => number;
5
+ export declare const RESTART_LISTS_ANALYTICS_KEY = "restartListsAnalytics";
6
+ export declare const getRestartListsAttributes: (tr: Transaction) => RestartListsAttributesForListOutdented;
7
+ export declare const storeRestartListsAttributes: (tr: Transaction, attributes: RestartListsAttributesForListOutdented) => void;
@@ -5,6 +5,6 @@ import { INPUT_METHOD } from '../../analytics';
5
5
  import { Command } from '../../../types';
6
6
  export declare const showLinkingToolbar: import("@atlaskit/editor-common/types").Command;
7
7
  export declare const showLinkingToolbarWithMediaTypeCheck: Command;
8
- export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch | undefined, view?: EditorView<any> | undefined) => void;
8
+ export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch | undefined, view?: EditorView<any> | undefined, focusFloatingToolbar?: boolean | undefined) => void;
9
9
  export declare const unlink: import("@atlaskit/editor-common/types").Command;
10
10
  export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL) => import("@atlaskit/editor-common/types").Command;
@@ -28,3 +28,10 @@ export { EventDispatcher } from './event-dispatcher';
28
28
  export type { Dispatch } from './event-dispatcher';
29
29
  export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor/selection';
30
30
  export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
31
+ /**
32
+ * Given a selector, checks if an element matching the selector exists in the
33
+ * document.
34
+ * @param selector
35
+ * @returns true if element matching selector exists in document, false otherwise
36
+ */
37
+ export declare const isElementBySelectorInDocument: (selector: string) => boolean;
@@ -50,107 +50,32 @@ export declare type BeforeAndAfterToolbarComponents = {
50
50
  after: ReactComponents;
51
51
  };
52
52
  export declare type PrimaryToolbarComponents = BeforeAndAfterToolbarComponents | ReactComponents;
53
- export interface EditorProps {
53
+ export interface EditorProps extends EditorPluginFeatureProps, EditorProviderProps {
54
54
  appearance?: EditorAppearance;
55
55
  contentComponents?: ReactComponents;
56
- primaryToolbarComponents?: PrimaryToolbarComponents;
57
56
  primaryToolbarIconBefore?: ReactElement;
58
57
  secondaryToolbarComponents?: ReactComponents;
59
- allowAnalyticsGASV3?: boolean;
60
- allowBlockType?: BlockTypePluginOptions['allowBlockType'];
61
- allowTasksAndDecisions?: boolean;
62
- allowBreakout?: boolean;
63
- allowRule?: boolean;
64
- allowTextColor?: boolean | TextColorPluginConfig;
65
- allowTables?: boolean | TablesPluginConfig;
66
- allowHelpDialog?: boolean;
67
- feedbackInfo?: FeedbackInfo;
68
- allowJiraIssue?: boolean;
69
- allowPanel?: boolean | PanelPluginConfig;
70
- allowExtension?: boolean | ExtensionConfig;
71
- allowConfluenceInlineComment?: boolean;
72
- allowTemplatePlaceholders?: boolean | PlaceholderTextOptions;
73
- allowDate?: boolean;
74
- allowLayouts?: boolean | LayoutPluginOptions;
75
- allowStatus?: boolean | {
76
- menuDisabled: boolean;
77
- };
78
- allowTextAlignment?: boolean;
79
- allowIndentation?: boolean;
80
- /**
81
- * This enables new insertion behaviour only for horizontal rule and media single in certain conditions.
82
- * The idea of this new behaviour is to have a consistent outcome regardless of the insertion method.
83
- **/
84
- allowNewInsertionBehaviour?: boolean;
85
- /**
86
- * Set this to false to opt out of the default behaviour of auto scrolling into view
87
- * whenever the document is changed
88
- */
89
- autoScrollIntoView?: boolean;
90
- allowFindReplace?: boolean | FindReplaceOptions;
91
58
  persistScrollGutter?: boolean;
92
59
  quickInsert?: QuickInsertOptions;
93
- /** @deprecated Use smartLinks instead. */
94
- UNSAFE_cards?: CardOptions;
95
- /** @deprecated Use linking instead. */
96
- smartLinks?: CardOptions;
97
- /**
98
- * Configure and extend editor linking behaviour
99
- */
100
- linking?: LinkingOptions;
101
- allowExpand?: boolean | {
102
- allowInsertion?: boolean;
103
- allowInteractiveExpand?: boolean;
104
- };
105
- saveOnEnter?: boolean;
106
60
  shouldFocus?: boolean;
107
61
  disabled?: boolean;
108
62
  contextPanel?: ReactComponents;
109
63
  errorReporterHandler?: ErrorReportingHandler;
110
- uploadErrorHandler?: (state: MediaState) => void;
111
- activityProvider?: Promise<ActivityProvider>;
112
- searchProvider?: Promise<SearchProvider>;
113
- annotationProviders?: AnnotationProviders;
114
- collabEditProvider?: Providers['collabEditProvider'];
115
- presenceProvider?: Promise<any>;
116
- emojiProvider?: Providers['emojiProvider'];
117
- taskDecisionProvider?: Promise<TaskDecisionProvider>;
118
- allowNestedTasks?: boolean;
119
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
120
- legacyImageUploadProvider?: Providers['imageUploadProvider'];
121
- mentionProvider?: Promise<MentionProvider>;
122
- mention?: MentionPluginConfig;
123
- autoformattingProvider?: Providers['autoformattingProvider'];
124
- macroProvider?: Providers['macroProvider'];
125
- waitForMediaUpload?: boolean;
126
64
  contentTransformerProvider?: (schema: Schema) => Transformer<string>;
127
- media?: MediaOptions;
128
- collabEdit?: CollabEditOptions;
129
65
  textFormatting?: TextFormattingOptions;
130
66
  maxHeight?: number;
131
67
  minHeight?: number;
132
- maxContentSize?: number;
133
68
  placeholder?: string;
134
69
  placeholderBracketHint?: string;
135
70
  defaultValue?: Node | string | Object;
136
71
  popupsMountPoint?: HTMLElement;
137
72
  popupsBoundariesElement?: HTMLElement;
138
73
  popupsScrollableElement?: HTMLElement;
139
- insertMenuItems?: MenuItem[];
140
74
  editorActions?: EditorActions;
141
75
  onEditorReady?: (editorActions: EditorActions) => void;
142
76
  onDestroy?: () => void;
143
77
  onChange?: EditorOnChangeHandler;
144
- onSave?: (editorView: EditorView) => void;
145
78
  onCancel?: (editorView: EditorView) => void;
146
- extensionHandlers?: ExtensionHandlers;
147
- sanitizePrivateContent?: boolean;
148
- /**
149
- * flag to indicate display name instead of nick name should be inserted for mentions
150
- * default: false, which inserts the nick name
151
- * @deprecated Use mention.mentionInsertDisplayName instead
152
- */
153
- mentionInsertDisplayName?: boolean;
154
79
  /**
155
80
  * @description The nth keystroke after which an input time taken event is sent, 0 to disable it
156
81
  * @default 100
@@ -159,18 +84,7 @@ export interface EditorProps {
159
84
  inputSamplingLimit?: number;
160
85
  extensionProviders?: ExtensionProvidersProp;
161
86
  UNSAFE_useAnalyticsContext?: boolean;
162
- /**
163
- * @description Control performance metric measurements and tracking
164
- */
165
- performanceTracking?: PerformanceTracking;
166
- elementBrowser?: {
167
- showModal?: boolean;
168
- replacePlusMenu?: boolean;
169
- helpUrl?: string;
170
- emptyStateHandler?: EmptyStateHandler;
171
- };
172
87
  codeBlock?: CodeBlockOptions;
173
- allowUndoRedoButtons?: boolean;
174
88
  /**
175
89
  * @default undefined
176
90
  * @description Enables valid transaction events to be tracked in analytics (at a sampled rate)
@@ -217,11 +131,6 @@ export interface EditorProps {
217
131
  featureFlags?: {
218
132
  [featureFlag: string]: string | boolean;
219
133
  };
220
- /**
221
- * Enable support for the "fragment" mark.
222
- * Refer to ADF Change proposal #60 for more details.
223
- */
224
- allowFragmentMark?: boolean;
225
134
  /**
226
135
  * @deprecated Do not use outside of Editor team.
227
136
  * This has subtle side effects - you __WILL__ break functionality without implementer knowledge of editor-core internals
@@ -233,4 +142,99 @@ export interface EditorProps {
233
142
  __plugins: EditorPlugin[];
234
143
  };
235
144
  }
145
+ export interface EditorProviderProps {
146
+ activityProvider?: Promise<ActivityProvider>;
147
+ searchProvider?: Promise<SearchProvider>;
148
+ annotationProviders?: AnnotationProviders;
149
+ collabEditProvider?: Providers['collabEditProvider'];
150
+ presenceProvider?: Promise<any>;
151
+ emojiProvider?: Providers['emojiProvider'];
152
+ taskDecisionProvider?: Promise<TaskDecisionProvider>;
153
+ contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
154
+ legacyImageUploadProvider?: Providers['imageUploadProvider'];
155
+ mentionProvider?: Promise<MentionProvider>;
156
+ autoformattingProvider?: Providers['autoformattingProvider'];
157
+ macroProvider?: Providers['macroProvider'];
158
+ }
159
+ export interface EditorPluginFeatureProps {
160
+ allowExpand?: boolean | {
161
+ allowInsertion?: boolean;
162
+ allowInteractiveExpand?: boolean;
163
+ };
164
+ allowNestedTasks?: boolean;
165
+ allowAnalyticsGASV3?: boolean;
166
+ allowBlockType?: BlockTypePluginOptions['allowBlockType'];
167
+ allowTasksAndDecisions?: boolean;
168
+ allowBreakout?: boolean;
169
+ allowRule?: boolean;
170
+ allowTextColor?: boolean | TextColorPluginConfig;
171
+ allowTables?: boolean | TablesPluginConfig;
172
+ allowHelpDialog?: boolean;
173
+ allowJiraIssue?: boolean;
174
+ allowPanel?: boolean | PanelPluginConfig;
175
+ allowExtension?: boolean | ExtensionConfig;
176
+ allowConfluenceInlineComment?: boolean;
177
+ allowTemplatePlaceholders?: boolean | PlaceholderTextOptions;
178
+ allowDate?: boolean;
179
+ allowLayouts?: boolean | LayoutPluginOptions;
180
+ allowStatus?: boolean | {
181
+ menuDisabled: boolean;
182
+ };
183
+ allowTextAlignment?: boolean;
184
+ allowIndentation?: boolean;
185
+ /**
186
+ * This enables new insertion behaviour only for horizontal rule and media single in certain conditions.
187
+ * The idea of this new behaviour is to have a consistent outcome regardless of the insertion method.
188
+ **/
189
+ allowNewInsertionBehaviour?: boolean;
190
+ allowUndoRedoButtons?: boolean;
191
+ allowFindReplace?: boolean | FindReplaceOptions;
192
+ /**
193
+ * Enable support for the "fragment" mark.
194
+ * Refer to ADF Change proposal #60 for more details.
195
+ */
196
+ allowFragmentMark?: boolean;
197
+ /**
198
+ * Set this to false to opt out of the default behaviour of auto scrolling into view
199
+ * whenever the document is changed
200
+ */
201
+ autoScrollIntoView?: boolean;
202
+ elementBrowser?: {
203
+ showModal?: boolean;
204
+ replacePlusMenu?: boolean;
205
+ helpUrl?: string;
206
+ emptyStateHandler?: EmptyStateHandler;
207
+ };
208
+ maxContentSize?: number;
209
+ saveOnEnter?: boolean;
210
+ feedbackInfo?: FeedbackInfo;
211
+ media?: MediaOptions;
212
+ collabEdit?: CollabEditOptions;
213
+ primaryToolbarComponents?: PrimaryToolbarComponents;
214
+ /** @deprecated Use smartLinks instead. */
215
+ UNSAFE_cards?: CardOptions;
216
+ /** @deprecated Use linking instead. */
217
+ smartLinks?: CardOptions;
218
+ /**
219
+ * Configure and extend editor linking behaviour
220
+ */
221
+ linking?: LinkingOptions;
222
+ sanitizePrivateContent?: boolean;
223
+ mention?: MentionPluginConfig;
224
+ /**
225
+ * flag to indicate display name instead of nick name should be inserted for mentions
226
+ * default: false, which inserts the nick name
227
+ * @deprecated Use mention.mentionInsertDisplayName instead
228
+ */
229
+ mentionInsertDisplayName?: boolean;
230
+ /**
231
+ * @description Control performance metric measurements and tracking
232
+ */
233
+ performanceTracking?: PerformanceTracking;
234
+ uploadErrorHandler?: (state: MediaState) => void;
235
+ onSave?: (editorView: EditorView) => void;
236
+ waitForMediaUpload?: boolean;
237
+ insertMenuItems?: MenuItem[];
238
+ extensionHandlers?: ExtensionHandlers;
239
+ }
236
240
  export {};
@@ -3,6 +3,7 @@ import type { Node as PMNode, NodeType } from 'prosemirror-model';
3
3
  import { EditorState, Transaction } from 'prosemirror-state';
4
4
  import { InputRuleHandler, InputRuleWrapper } from '@atlaskit/prosemirror-input-rules';
5
5
  import { AnalyticsEventPayload } from '../plugins/analytics/types';
6
+ import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
6
7
  declare type GetPayload = AnalyticsEventPayload | ((state: EditorState, matchResult: RegExpExecArray) => AnalyticsEventPayload);
7
8
  export declare const ruleWithAnalytics: (getPayload: GetPayload) => (originalRule: InputRuleWrapper) => InputRuleWrapper;
8
9
  export declare const ruleWithTransform: (transform: (state: EditorState, tr: Transaction) => void) => (originalRule: InputRuleWrapper) => InputRuleWrapper;
@@ -22,7 +23,7 @@ declare type WrappingRuleProps = {
22
23
  match: RegExp;
23
24
  nodeType: NodeType;
24
25
  getAttrs?: Record<string, any> | ((matchResult: RegExpExecArray) => Record<string, any>);
25
- joinPredicate?: (matchResult: RegExpExecArray, node: PMNode) => boolean;
26
+ joinPredicate?: (matchResult: RegExpExecArray, node: PMNode, joinScenario: JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST) => boolean;
26
27
  };
27
28
  export declare const createWrappingJoinRule: ({ match, nodeType, getAttrs, joinPredicate, }: WrappingRuleProps) => InputRuleWrapper;
28
29
  export declare const createJoinNodesRule: (match: RegExp, nodeType: NodeType) => InputRuleWrapper;
@@ -0,0 +1,2 @@
1
+ import { Selection } from 'prosemirror-state';
2
+ export declare const doesSelectionWhichStartsOrEndsInListContainEntireList: (selection: Selection) => boolean;
@@ -0,0 +1,16 @@
1
+ import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
2
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
3
+ import { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
4
+ import EditorActions from '../actions';
5
+ import { QuickInsertOptions } from '../plugins/quick-insert/types';
6
+ /**
7
+ *
8
+ * Used to combine the quickInsert provider and extension provider (if available)
9
+ * Or return a provider that is available (quickInsertProvider preferred)
10
+ * @param editorActions
11
+ * @param extensionProvider
12
+ * @param quickInsert
13
+ * @param createAnalyticsEvent
14
+ * @returns Quick insert provider if available
15
+ */
16
+ export default function prepareQuickInsertProvider(editorActions: EditorActions, extensionProvider?: ExtensionProvider, quickInsert?: QuickInsertOptions, createAnalyticsEvent?: CreateUIAnalyticsEvent): Promise<QuickInsertProvider> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "179.0.3",
3
+ "version": "179.1.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,12 +25,12 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@atlaskit/activity-provider": "^2.3.0",
28
- "@atlaskit/adf-schema": "^25.1.0",
28
+ "@atlaskit/adf-schema": "^25.2.0",
29
29
  "@atlaskit/adf-utils": "^18.0.0",
30
30
  "@atlaskit/analytics-gas-types": "^5.0.0",
31
31
  "@atlaskit/analytics-listeners": "^8.5.0",
32
32
  "@atlaskit/analytics-namespaced-context": "^6.6.0",
33
- "@atlaskit/analytics-next": "^8.2.0",
33
+ "@atlaskit/analytics-next": "^9.0.0",
34
34
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
35
35
  "@atlaskit/avatar": "^21.1.0",
36
36
  "@atlaskit/avatar-group": "^9.2.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/code": "^14.4.0",
41
41
  "@atlaskit/date": "^0.9.0",
42
42
  "@atlaskit/datetime-picker": "^12.3.0",
43
- "@atlaskit/editor-common": "^72.2.0",
43
+ "@atlaskit/editor-common": "^72.4.0",
44
44
  "@atlaskit/editor-json-transformer": "^8.8.0",
45
45
  "@atlaskit/editor-markdown-transformer": "^5.0.0",
46
46
  "@atlaskit/editor-plugin-table": "^1.1.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/link-picker": "^1.16.0",
55
55
  "@atlaskit/locale": "^2.3.0",
56
56
  "@atlaskit/logo": "^13.11.0",
57
- "@atlaskit/media-card": "^74.5.0",
57
+ "@atlaskit/media-card": "^74.6.0",
58
58
  "@atlaskit/media-client": "^20.0.0",
59
59
  "@atlaskit/media-common": "^2.19.0",
60
60
  "@atlaskit/media-filmstrip": "^46.1.0",
@@ -79,7 +79,7 @@
79
79
  "@atlaskit/textfield": "^5.3.0",
80
80
  "@atlaskit/theme": "^12.2.0",
81
81
  "@atlaskit/toggle": "^12.5.0",
82
- "@atlaskit/tokens": "^1.1.0",
82
+ "@atlaskit/tokens": "^1.2.0",
83
83
  "@atlaskit/tooltip": "^17.6.0",
84
84
  "@atlaskit/util-service-support": "^6.1.0",
85
85
  "@atlaskit/width-detector": "^4.0.0",
@@ -132,9 +132,9 @@
132
132
  },
133
133
  "devDependencies": {
134
134
  "@atlaskit/atlassian-navigation": "^2.3.0",
135
- "@atlaskit/breadcrumbs": "11.7.11",
135
+ "@atlaskit/breadcrumbs": "11.7.12",
136
136
  "@atlaskit/code": "^14.4.0",
137
- "@atlaskit/collab-provider": "8.1.0",
137
+ "@atlaskit/collab-provider": "8.2.0",
138
138
  "@atlaskit/docs": "*",
139
139
  "@atlaskit/drawer": "^7.4.0",
140
140
  "@atlaskit/dropdown-menu": "^11.5.0",