@atlaskit/editor-common 111.18.1 → 111.19.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 (52) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/annotation/manager.js +9 -9
  3. package/dist/cjs/messages/syncBlock.js +0 -30
  4. package/dist/cjs/monitoring/error.js +1 -1
  5. package/dist/cjs/node-anchor/node-anchor-provider.js +0 -6
  6. package/dist/cjs/preset/core-plugin/index.js +17 -37
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/utils/compareNodes.js +3 -3
  9. package/dist/es2019/annotation/manager.js +9 -9
  10. package/dist/es2019/messages/syncBlock.js +0 -30
  11. package/dist/es2019/monitoring/error.js +1 -1
  12. package/dist/es2019/node-anchor/node-anchor-provider.js +0 -6
  13. package/dist/es2019/preset/core-plugin/index.js +17 -37
  14. package/dist/es2019/ui/DropList/index.js +1 -1
  15. package/dist/esm/annotation/manager.js +9 -9
  16. package/dist/esm/messages/syncBlock.js +0 -30
  17. package/dist/esm/monitoring/error.js +1 -1
  18. package/dist/esm/node-anchor/node-anchor-provider.js +0 -6
  19. package/dist/esm/preset/core-plugin/index.js +17 -37
  20. package/dist/esm/ui/DropList/index.js +1 -1
  21. package/dist/esm/utils/compareNodes.js +3 -3
  22. package/dist/types/annotation/index.d.ts +12 -10
  23. package/dist/types/collab/index.d.ts +11 -11
  24. package/dist/types/extensions/types/extension-handler.d.ts +2 -2
  25. package/dist/types/extensions/types/extension-provider.d.ts +6 -6
  26. package/dist/types/link/LinkSearch/types.d.ts +8 -8
  27. package/dist/types/messages/syncBlock.d.ts +0 -30
  28. package/dist/types/provider-factory/autoformatting-provider.d.ts +1 -1
  29. package/dist/types/provider-factory/card-provider.d.ts +2 -2
  30. package/dist/types/provider-factory/macro-provider.d.ts +2 -2
  31. package/dist/types/provider-factory/search-provider.d.ts +1 -1
  32. package/dist/types/types/editor-actions.d.ts +12 -12
  33. package/dist/types/types/next-editor-plugin.d.ts +5 -5
  34. package/dist/types/types/user-preferences.d.ts +3 -3
  35. package/dist/types/utils/compareNodes.d.ts +1 -1
  36. package/dist/types/utils/get-performance-options.d.ts +1 -1
  37. package/dist/types-ts4.5/annotation/index.d.ts +12 -10
  38. package/dist/types-ts4.5/collab/index.d.ts +11 -11
  39. package/dist/types-ts4.5/extensions/types/extension-handler.d.ts +2 -2
  40. package/dist/types-ts4.5/extensions/types/extension-provider.d.ts +6 -6
  41. package/dist/types-ts4.5/link/LinkSearch/types.d.ts +8 -8
  42. package/dist/types-ts4.5/messages/syncBlock.d.ts +0 -30
  43. package/dist/types-ts4.5/provider-factory/autoformatting-provider.d.ts +1 -1
  44. package/dist/types-ts4.5/provider-factory/card-provider.d.ts +2 -2
  45. package/dist/types-ts4.5/provider-factory/macro-provider.d.ts +2 -2
  46. package/dist/types-ts4.5/provider-factory/search-provider.d.ts +1 -1
  47. package/dist/types-ts4.5/types/editor-actions.d.ts +12 -12
  48. package/dist/types-ts4.5/types/next-editor-plugin.d.ts +5 -5
  49. package/dist/types-ts4.5/types/user-preferences.d.ts +3 -3
  50. package/dist/types-ts4.5/utils/compareNodes.d.ts +1 -1
  51. package/dist/types-ts4.5/utils/get-performance-options.d.ts +1 -1
  52. package/package.json +3 -6
@@ -95,11 +95,6 @@ export var syncBlockMessages = defineMessages({
95
95
  defaultMessage: 'This content is synced. Edit it at the source.',
96
96
  description: 'Tooltip that shows when you hover over a task in the destination synced block'
97
97
  },
98
- deleteConfirmationModalTitleSingle: {
99
- id: 'fabric.editor.deleteConfirmationModalTitleSingle',
100
- defaultMessage: 'Delete synced block?',
101
- description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has no reference'
102
- },
103
98
  deletionConfirmationModalTitleSingle: {
104
99
  id: 'fabric.editor.deletionConfirmationModalTitleSingle',
105
100
  defaultMessage: 'Delete synced content?',
@@ -125,26 +120,11 @@ export var syncBlockMessages = defineMessages({
125
120
  defaultMessage: 'Try again',
126
121
  description: 'Text on button which retries deleting the sync block when the previous deletion failed'
127
122
  },
128
- deleteConfirmationModalDescriptionMultiple: {
129
- id: 'fabric.editor.deleteConfirmationModalDescriptionMultiple',
130
- defaultMessage: 'Deleting this content will also remove it from synced locations, where it will appear as an “Unsynced block”.',
131
- description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
132
- },
133
- deleteConfirmationModalDescription: {
134
- id: 'fabric.editor.deleteConfirmationModalDescriptionSingle',
135
- defaultMessage: 'Deleting this content will also remove {syncBlockCount, plural, one {a synced block. References to this block} other {# synced blocks. References to these blocks}} in other locations will show an error. Continue with deletion?',
136
- description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
137
- },
138
123
  deletionConfirmationModalDescription: {
139
124
  id: 'fabric.editor.deletionConfirmationModalDescription',
140
125
  defaultMessage: 'If you delete this synced block, it will become an “Unsynced block” in other locations. This action is permanent and cannot be undone.',
141
126
  description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
142
127
  },
143
- deleteConfirmationModalDescriptionNoRef: {
144
- id: 'fabric.editor.deleteConfirmationModalDescriptionNoRef',
145
- defaultMessage: "You'll no longer be able to reuse this synced block to keep content updated across locations. ",
146
- description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
147
- },
148
128
  deletionConfirmationModalDescriptionNoRef: {
149
129
  id: 'fabric.editor.deletionConfirmationModalDescriptionNoRef',
150
130
  defaultMessage: 'Your content will no longer appear, and the synced block will be deleted. This action is permanent and cannot be undone.',
@@ -340,21 +320,11 @@ export var syncBlockMessages = defineMessages({
340
320
  defaultMessage: 'Unsync this content?',
341
321
  description: 'Title of unsync confirmation modal that appears when user tries to unsync source synced block'
342
322
  },
343
- unsyncConfirmationModalDescriptionSingle: {
344
- id: 'fabric.editor.unsyncConfirmationModalDescriptionSingle',
345
- defaultMessage: 'Your content will stay here. It will no longer be a synced block.',
346
- description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with no reference'
347
- },
348
323
  unsyncConfirmModalDescriptionSingle: {
349
324
  id: 'fabric.editor.unsyncConfirmModalDescriptionSingle',
350
325
  defaultMessage: 'Your content will stay here. It will no longer be a synced block. This action is permanent and cannot be undone.',
351
326
  description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with no reference'
352
327
  },
353
- unsyncConfirmationModalDescriptionMultiple: {
354
- id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
355
- defaultMessage: 'Your content will stay here. In {syncBlockCount, plural, one {1 other synced location} other {# other synced locations}} it will appear as an “Unsynced block”. ',
356
- description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
357
- },
358
328
  unsyncConfirmModalDescriptionMultiple: {
359
329
  id: 'fabric.editor.unsyncConfirmModalDescriptionMultiple',
360
330
  defaultMessage: 'Your content will stay here. In {syncBlockCount, plural, one {1 other synced location} other {# other synced locations}} it will appear as an “Unsynced block”. This action is permanent and cannot be undone.',
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "111.18.0";
13
+ var packageVersion = "111.19.0";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -86,12 +86,6 @@ export var NodeAnchorProvider = /*#__PURE__*/function () {
86
86
  }, {
87
87
  key: "setIdForNode",
88
88
  value: function setIdForNode(node, id) {
89
- // [FEATURE FLAG: platform_editor_fix_node_anchor_dom_cache]
90
- // This method is part of the fix to prevent drag handle misalignment.
91
- // To clean up: remove the feature flag check, keep the method body
92
- if (!fg('platform_editor_fix_node_anchor_dom_cache')) {
93
- return;
94
- }
95
89
  if (this.limitedMode) {
96
90
  return;
97
91
  }
@@ -1,5 +1,4 @@
1
1
  import { Node } from '@atlaskit/editor-prosemirror/model';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
4
3
  import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
5
4
  import { editorCommandToPMCommand } from '../editor-commands';
@@ -148,45 +147,26 @@ export var corePlugin = function corePlugin(_ref) {
148
147
  return undefined;
149
148
  }
150
149
 
151
- // [FEATURE FLAG: platform_editor_fix_node_anchor_dom_cache]
152
- // Fixes drag handle misalignment on first focus after clicking from title
153
- // by checking DOM for existing anchor before generating a new ID with collision suffix.
154
- // To clean up: remove if-else block, keep only flag-on behavior (lines 217-229), remove old behavior (lines 231-238)
155
- if (fg('platform_editor_fix_node_anchor_dom_cache')) {
156
- // Check DOM first to avoid generating a new ID with a collision suffix
157
- // when the DOM already has a valid anchor. This prevents misalignment
158
- // of drag handles on first focus after clicking from the title.
159
- var nodeDOM = view.nodeDOM(pos);
160
- if (nodeDOM instanceof HTMLElement) {
161
- var domAnchor = nodeDOM.getAttribute('data-node-anchor');
162
- if (domAnchor) {
163
- // Cache the DOM anchor for this node to maintain consistency
164
- // This ensures subsequent calls return the same anchor
165
- nodeIdProvider.setIdForNode(node, domAnchor);
166
- return domAnchor;
167
- }
150
+ // Check DOM first to avoid generating a new ID with a collision suffix
151
+ // when the DOM already has a valid anchor. This prevents misalignment
152
+ // of drag handles on first focus after clicking from the title.
153
+ var nodeDOM = view.nodeDOM(pos);
154
+ if (nodeDOM instanceof HTMLElement) {
155
+ var domAnchor = nodeDOM.getAttribute('data-node-anchor');
156
+ if (domAnchor) {
157
+ // Cache the DOM anchor for this node to maintain consistency
158
+ // This ensures subsequent calls return the same anchor
159
+ nodeIdProvider.setIdForNode(node, domAnchor);
160
+ return domAnchor;
168
161
  }
162
+ }
169
163
 
170
- // Only generate a new ID if DOM doesn't have one
171
- var generatedId = nodeIdProvider.getOrGenerateId(node, pos);
172
- if (generatedId) {
173
- return generatedId;
174
- }
175
- return undefined;
176
- } else {
177
- // OLD BEHAVIOR (to be removed when flag is cleaned up)
178
- // This approach can generate incorrect IDs with collision suffixes when
179
- // the DOM already has a valid anchor, causing drag handle misalignment
180
- var _generatedId = nodeIdProvider.getOrGenerateId(node, pos);
181
- if (_generatedId) {
182
- return _generatedId;
183
- }
184
- var _nodeDOM = view.nodeDOM(pos);
185
- if (_nodeDOM instanceof HTMLElement) {
186
- return _nodeDOM.getAttribute('data-node-anchor') || undefined;
187
- }
188
- return undefined;
164
+ // Only generate a new ID if DOM doesn't have one
165
+ var generatedId = nodeIdProvider.getOrGenerateId(node, pos);
166
+ if (generatedId) {
167
+ return generatedId;
189
168
  }
169
+ return undefined;
190
170
  }
191
171
  }
192
172
  };
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "111.18.0";
24
+ var packageVersion = "111.19.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -126,15 +126,15 @@ function getMetaFromNode(node, options, normalizeTextParser) {
126
126
  }
127
127
  case 'inlineCard':
128
128
  {
129
- var _attrs = firstChild.attrs;
130
- var maybeTitle = options.getInlineCardTextFromStore(_attrs);
129
+ var attrs = firstChild.attrs;
130
+ var maybeTitle = options.getInlineCardTextFromStore(attrs);
131
131
  if (maybeTitle) {
132
132
  return {
133
133
  type: ContentType.LINK,
134
134
  value: maybeTitle
135
135
  };
136
136
  }
137
- var url = _attrs.url;
137
+ var url = attrs.url;
138
138
  return {
139
139
  type: ContentType.LINK,
140
140
  value: url ? url : ''
@@ -50,6 +50,8 @@ export type AnnotationSelectedChangeData = {
50
50
  export type AnnotationManagerEvents = {
51
51
  data: AnnotationDraftStartedData;
52
52
  name: 'draftAnnotationStarted';
53
+ } | {
54
+ name: 'draftAnnotationCleared';
53
55
  } | {
54
56
  data: AnnotationSelectedChangeData;
55
57
  name: 'annotationSelectionChanged';
@@ -139,13 +141,13 @@ export type AnnotationManager = AnnotationManagerMethods & {
139
141
  * @private
140
142
  * @internal
141
143
  */
142
- checkPreemptiveGate(): Promise<boolean>;
144
+ checkPreemptiveGate: () => Promise<boolean>;
143
145
  /**
144
146
  * @private
145
147
  * @internal
146
148
  * This method is intended for internal Platform use only. It is not intended for use by Product code.
147
149
  */
148
- emit(event: {
150
+ emit: (event: {
149
151
  data: AnnotationDraftStartedData;
150
152
  name: 'draftAnnotationStarted';
151
153
  } | {
@@ -153,28 +155,28 @@ export type AnnotationManager = AnnotationManagerMethods & {
153
155
  } | {
154
156
  data: AnnotationSelectedChangeData;
155
157
  name: 'annotationSelectionChanged';
156
- }): AnnotationManager;
158
+ }) => AnnotationManager;
157
159
  /**
158
160
  * @private
159
161
  * @internal
160
162
  * This method is intended for internal Platform use only. It is not intended for use by Product code.
161
163
  */
162
- hook<H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]): AnnotationManager;
163
- offAnnotationSelectionChange(handler: (data: AnnotationSelectedChangeData) => void): AnnotationManager;
164
- offDraftAnnotationStarted(handler: (data: AnnotationDraftStartedData) => void): AnnotationManager;
165
- onAnnotationSelectionChange(handler: (data: AnnotationSelectedChangeData) => void): AnnotationManager;
166
- onDraftAnnotationStarted(handler: (data: AnnotationDraftStartedData) => void): AnnotationManager;
164
+ hook: <H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]) => AnnotationManager;
165
+ offAnnotationSelectionChange: (handler: (data: AnnotationSelectedChangeData) => void) => AnnotationManager;
166
+ offDraftAnnotationStarted: (handler: (data: AnnotationDraftStartedData) => void) => AnnotationManager;
167
+ onAnnotationSelectionChange: (handler: (data: AnnotationSelectedChangeData) => void) => AnnotationManager;
168
+ onDraftAnnotationStarted: (handler: (data: AnnotationDraftStartedData) => void) => AnnotationManager;
167
169
  /**
168
170
  * This method is used to set a preemptive gate. A preemptive gate is a function that will be called
169
171
  * before the manager performs an action. If the function returns false, the action will not be performed.
170
172
  */
171
- setPreemptiveGate(handler: () => Promise<boolean>): AnnotationManager;
173
+ setPreemptiveGate: (handler: () => Promise<boolean>) => AnnotationManager;
172
174
  /**
173
175
  *
174
176
  * @internal
175
177
  * This method is intended for internal Platform use only. It is not intended for use by Product code.
176
178
  */
177
- unhook<H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]): AnnotationManager;
179
+ unhook: <H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]) => AnnotationManager;
178
180
  };
179
181
  /**
180
182
  * This is a factory method which creates a new instance of the AnnotationManager.
@@ -447,21 +447,21 @@ export interface CollabEvents {
447
447
  }
448
448
  export type SyncUpErrorFunction = (attributes: NewCollabSyncUpErrorAttributes) => void;
449
449
  export interface CollabEditProvider<Events extends CollabEvents = CollabEvents> {
450
- getFinalAcknowledgedState(reason: GetResolvedEditorStateReason): Promise<ResolvedEditorState>;
451
- getIsNamespaceLocked(): boolean;
452
- initialize(getState: () => any, createStep: (json: object) => Step): this;
453
- off(evt: keyof Events, handler: (...args: any) => void): this;
454
- on(evt: keyof Events, handler: (...args: any) => void): this;
455
- send(tr: Transaction, oldState: EditorState, newState: EditorState): void;
456
- sendMessage<K extends keyof Events>(data: {
450
+ getFinalAcknowledgedState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState>;
451
+ getIsNamespaceLocked: () => boolean;
452
+ initialize: (getState: () => any, createStep: (json: object) => Step) => this;
453
+ off: (evt: keyof Events, handler: (...args: any) => void) => this;
454
+ on: (evt: keyof Events, handler: (...args: any) => void) => this;
455
+ send: (tr: Transaction, oldState: EditorState, newState: EditorState) => void;
456
+ sendMessage: <K extends keyof Events>(data: {
457
457
  type: K;
458
- } & Events[K]): void;
459
- setup(props: {
458
+ } & Events[K]) => void;
459
+ setup: (props: {
460
460
  editorApi?: any;
461
461
  getState?: () => EditorState;
462
462
  onSyncUpError?: SyncUpErrorFunction;
463
- }): this;
464
- unsubscribeAll(evt: keyof Events): this;
463
+ }) => this;
464
+ unsubscribeAll: (evt: keyof Events) => this;
465
465
  }
466
466
  export type CollabEditOptions = {
467
467
  provider?: Providers['collabEditProvider'];
@@ -46,8 +46,8 @@ export type ReferenceEntity = {
46
46
  export type MultiBodiedExtensionActions = {
47
47
  addChild: () => boolean;
48
48
  changeActive: (index: number) => boolean;
49
- getChildren(): Array<ADFEntity>;
50
- getChildrenContainer(): React.ReactNode;
49
+ getChildren: () => Array<ADFEntity>;
50
+ getChildrenContainer: () => React.ReactNode;
51
51
  getChildrenCount: () => number;
52
52
  removeChild: (index: number) => boolean;
53
53
  updateParameters: (parameters: Parameters) => boolean;
@@ -1,10 +1,10 @@
1
1
  import { type ExtensionAutoConvertHandler, type ExtensionKey, type ExtensionManifest, type ExtensionType } from './extension-manifest';
2
2
  import { type Parameters } from './extension-parameters';
3
3
  export interface ExtensionProvider<T extends Parameters = any> {
4
- getAutoConverter(): Promise<ExtensionAutoConvertHandler[]>;
5
- getExtension(type: ExtensionType, key: ExtensionKey): Promise<ExtensionManifest<T> | undefined>;
6
- getExtensions(): Promise<ExtensionManifest<T>[]>;
7
- getPreloadedExtension?(type: ExtensionType, key: ExtensionKey): ExtensionManifest<T> | undefined;
8
- preload?(): Promise<void>;
9
- search(keyword: string): Promise<ExtensionManifest<T>[]>;
4
+ getAutoConverter: () => Promise<ExtensionAutoConvertHandler[]>;
5
+ getExtension: (type: ExtensionType, key: ExtensionKey) => Promise<ExtensionManifest<T> | undefined>;
6
+ getExtensions: () => Promise<ExtensionManifest<T>[]>;
7
+ getPreloadedExtension?: (type: ExtensionType, key: ExtensionKey) => ExtensionManifest<T> | undefined;
8
+ preload?: () => Promise<void>;
9
+ search: (keyword: string) => Promise<ExtensionManifest<T>[]>;
10
10
  }
@@ -4,15 +4,15 @@ import { type INPUT_METHOD } from '../../analytics';
4
4
  export type RecentSearchInputTypes = INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL;
5
5
  export interface ChildProps {
6
6
  activityProvider: ActivityProvider | null;
7
- clearValue(): void;
7
+ clearValue: () => void;
8
8
  currentInputMethod?: RecentSearchInputTypes;
9
9
  inputProps: {
10
- onChange(input: string): void;
11
- onKeyDown(event: KeyboardEvent<any>): void;
12
- onSubmit(): void;
10
+ onChange: (input: string) => void;
11
+ onKeyDown: (event: KeyboardEvent<any>) => void;
12
+ onSubmit: () => void;
13
13
  value: string;
14
14
  };
15
- renderRecentList(): React.ReactNode;
15
+ renderRecentList: () => React.ReactNode;
16
16
  }
17
17
  export interface RecentSearchSubmitOptions {
18
18
  inputMethod: RecentSearchInputTypes;
@@ -22,9 +22,9 @@ export interface RecentSearchSubmitOptions {
22
22
  export interface RecentSearchProps {
23
23
  defaultUrl?: string;
24
24
  limit?: number;
25
- onBlur(options: RecentSearchSubmitOptions): void;
26
- onSubmit(options: RecentSearchSubmitOptions): void;
27
- render(state: ChildProps): React.ReactNode;
25
+ onBlur: (options: RecentSearchSubmitOptions) => void;
26
+ onSubmit: (options: RecentSearchSubmitOptions) => void;
27
+ render: (state: ChildProps) => React.ReactNode;
28
28
  }
29
29
  export interface RecentSearchState {
30
30
  isLoading: boolean;
@@ -94,11 +94,6 @@ export declare const syncBlockMessages: {
94
94
  defaultMessage: string;
95
95
  description: string;
96
96
  };
97
- deleteConfirmationModalTitleSingle: {
98
- id: string;
99
- defaultMessage: string;
100
- description: string;
101
- };
102
97
  deletionConfirmationModalTitleSingle: {
103
98
  id: string;
104
99
  defaultMessage: string;
@@ -124,26 +119,11 @@ export declare const syncBlockMessages: {
124
119
  defaultMessage: string;
125
120
  description: string;
126
121
  };
127
- deleteConfirmationModalDescriptionMultiple: {
128
- id: string;
129
- defaultMessage: string;
130
- description: string;
131
- };
132
- deleteConfirmationModalDescription: {
133
- id: string;
134
- defaultMessage: string;
135
- description: string;
136
- };
137
122
  deletionConfirmationModalDescription: {
138
123
  id: string;
139
124
  defaultMessage: string;
140
125
  description: string;
141
126
  };
142
- deleteConfirmationModalDescriptionNoRef: {
143
- id: string;
144
- defaultMessage: string;
145
- description: string;
146
- };
147
127
  deletionConfirmationModalDescriptionNoRef: {
148
128
  id: string;
149
129
  defaultMessage: string;
@@ -339,21 +319,11 @@ export declare const syncBlockMessages: {
339
319
  defaultMessage: string;
340
320
  description: string;
341
321
  };
342
- unsyncConfirmationModalDescriptionSingle: {
343
- id: string;
344
- defaultMessage: string;
345
- description: string;
346
- };
347
322
  unsyncConfirmModalDescriptionSingle: {
348
323
  id: string;
349
324
  defaultMessage: string;
350
325
  description: string;
351
326
  };
352
- unsyncConfirmationModalDescriptionMultiple: {
353
- id: string;
354
- defaultMessage: string;
355
- description: string;
356
- };
357
327
  unsyncConfirmModalDescriptionMultiple: {
358
328
  id: string;
359
329
  defaultMessage: string;
@@ -5,5 +5,5 @@ export type AutoformatRuleset = {
5
5
  [regex: string]: AutoformatHandler;
6
6
  };
7
7
  export interface AutoformattingProvider {
8
- getRules(): Promise<AutoformatRuleset>;
8
+ getRules: () => Promise<AutoformatRuleset>;
9
9
  }
@@ -1,6 +1,6 @@
1
1
  import type { CardAdf, DatasourceAdf } from '@atlaskit/linking-common';
2
2
  export type CardAppearance = 'inline' | 'block' | 'embed';
3
3
  export interface CardProvider {
4
- findPattern(url: string): Promise<boolean>;
5
- resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean, isEmbedFriendlyLocation?: boolean): Promise<CardAdf | DatasourceAdf>;
4
+ findPattern: (url: string) => Promise<boolean>;
5
+ resolve: (url: string, appearance: CardAppearance, shouldForceAppearance?: boolean, isEmbedFriendlyLocation?: boolean) => Promise<CardAdf | DatasourceAdf>;
6
6
  }
@@ -16,10 +16,10 @@ export interface MacroAttributes {
16
16
  type: ExtensionType;
17
17
  }
18
18
  export interface MacroProvider {
19
- autoConvert(link: string): MacroAttributes | null;
19
+ autoConvert: (link: string) => MacroAttributes | null;
20
20
  config: Object;
21
21
  /**
22
22
  * If "macro" param is passed in, it will open macro browser for editing the macro
23
23
  */
24
- openMacroBrowser(macroNode?: PmNode): Promise<MacroAttributes>;
24
+ openMacroBrowser: (macroNode?: PmNode) => Promise<MacroAttributes>;
25
25
  }
@@ -8,5 +8,5 @@ export interface QuickSearchResult {
8
8
  }
9
9
  export type LinkContentType = 'jira.issue' | 'jira.issue.bug' | 'jira.issue.story' | 'jira.issue.task' | 'confluence.page' | 'confluence.blogpost' | 'default';
10
10
  export interface SearchProvider {
11
- quickSearch(query: string, limit: number): Promise<QuickSearchResult[]>;
11
+ quickSearch: (query: string, limit: number) => Promise<QuickSearchResult[]>;
12
12
  }
@@ -7,16 +7,16 @@ export type ContextUpdateHandler = (editorView: EditorView, eventDispatcher: Eve
7
7
  export type ReplaceRawValue = Node | object | string;
8
8
  export type GetResolvedEditorStateReason = 'publish' | 'draft-sync' | 'get-content';
9
9
  export interface EditorActionsOptions<T = any> {
10
- appendText(text: string): boolean;
11
- blur(): boolean;
12
- clear(): boolean;
13
- focus(): boolean;
14
- getNodeByFragmentLocalId(id: string): Node | undefined;
15
- getNodeByLocalId(id: string): Node | undefined;
16
- getResolvedEditorState(reason: GetResolvedEditorStateReason): Promise<ResolvedEditorState | undefined>;
17
- getSelectedNode(): Node | undefined;
18
- getValue(): Promise<T | JSONDocNode | undefined>;
19
- isDocumentEmpty(): boolean;
20
- replaceDocument(rawValue: any): boolean;
21
- replaceSelection(rawValue: ReplaceRawValue | Array<ReplaceRawValue>): boolean;
10
+ appendText: (text: string) => boolean;
11
+ blur: () => boolean;
12
+ clear: () => boolean;
13
+ focus: () => boolean;
14
+ getNodeByFragmentLocalId: (id: string) => Node | undefined;
15
+ getNodeByLocalId: (id: string) => Node | undefined;
16
+ getResolvedEditorState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState | undefined>;
17
+ getSelectedNode: () => Node | undefined;
18
+ getValue: () => Promise<T | JSONDocNode | undefined>;
19
+ isDocumentEmpty: () => boolean;
20
+ replaceDocument: (rawValue: any) => boolean;
21
+ replaceSelection: (rawValue: ReplaceRawValue | Array<ReplaceRawValue>) => boolean;
22
22
  }
@@ -12,8 +12,8 @@ import type { FireAnalyticsCallback } from '../analytics';
12
12
  import type { EditorCommand, EditorCommandWithMetadata } from './editor-command';
13
13
  import type { EditorPlugin } from './editor-plugin';
14
14
  export interface Transformer<T> {
15
- encode(node: Node): T;
16
- parse(content: T): Node;
15
+ encode: (node: Node) => T;
16
+ parse: (content: T) => Node;
17
17
  }
18
18
  export type CorePlugin = NextEditorPlugin<'core', {
19
19
  actions: {
@@ -31,7 +31,7 @@ export type CorePlugin = NextEditorPlugin<'core', {
31
31
  * @param schema Schema of the document
32
32
  * @returns Transformer which can be used to request a document
33
33
  */
34
- createTransformer<Format>(cb: (schema: Schema) => Transformer<Format>): Transformer<Format> | undefined;
34
+ createTransformer: <Format>(cb: (schema: Schema) => Transformer<Format>) => Transformer<Format> | undefined;
35
35
  /**
36
36
  * Dispatches an EditorCommand to ProseMirror
37
37
  *
@@ -90,10 +90,10 @@ export type CorePlugin = NextEditorPlugin<'core', {
90
90
  * @param options.transformer Pass a transformer for the document to be transformed into a different format.
91
91
  * @param options.alwaysFire If true, always return a value in `onReceive` handler rather than skipping throttled calls
92
92
  */
93
- requestDocument<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(onReceive: (document: TransformerResult<GenericTransformer> | undefined) => void, options?: {
93
+ requestDocument: <GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(onReceive: (document: TransformerResult<GenericTransformer> | undefined) => void, options?: {
94
94
  alwaysFire?: boolean;
95
95
  transformer?: GenericTransformer;
96
- }): void;
96
+ }) => void;
97
97
  /**
98
98
  * Request the editor document asynchronously.
99
99
  *
@@ -7,17 +7,17 @@ export interface UserPreferencesProvider {
7
7
  * meaning that consumers should prefetch the user preference and make it available initially
8
8
  * @param key
9
9
  */
10
- getPreference<K extends keyof UserPreferences>(key: K): UserPreferences[K] | undefined | null;
10
+ getPreference: <K extends keyof UserPreferences>(key: K) => UserPreferences[K] | undefined | null;
11
11
  /**
12
12
  * This method fetches the latest user preferences
13
13
  * @returns a promise that resolves with the user preferences, or rejects if error occurs
14
14
  */
15
- loadPreferences(): Promise<UserPreferences>;
15
+ loadPreferences: () => Promise<UserPreferences>;
16
16
  /**
17
17
  * This method updates a user preference
18
18
  * @param key
19
19
  * @param value
20
20
  * @returns a promise that resolves when the preference is updated, or rejects if the update fails
21
21
  */
22
- updatePreference<K extends keyof UserPreferences>(key: K, value: UserPreferences[K]): Promise<void>;
22
+ updatePreference: <K extends keyof UserPreferences>(key: K, value: UserPreferences[K]) => Promise<void>;
23
23
  }
@@ -10,7 +10,7 @@ export declare enum ContentType {
10
10
  LINK = 25
11
11
  }
12
12
  interface CompareOptions {
13
- getInlineCardTextFromStore(attrs: CardAttributes): string | null;
13
+ getInlineCardTextFromStore: (attrs: CardAttributes) => string | null;
14
14
  }
15
15
  interface NodeMetaGenerator<Type, Value> {
16
16
  type: Type;
@@ -9,7 +9,7 @@ export declare function startMeasureReactNodeViewRendered({ nodeTypeName, }: {
9
9
  nodeTypeName: string;
10
10
  }): void;
11
11
  export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, samplingRate, slowThreshold, }: {
12
- dispatchAnalyticsEvent(payload: AnalyticsEventPayload): void;
12
+ dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void;
13
13
  nodeTypeName: string;
14
14
  samplingRate: number;
15
15
  slowThreshold: number;
@@ -50,6 +50,8 @@ export type AnnotationSelectedChangeData = {
50
50
  export type AnnotationManagerEvents = {
51
51
  data: AnnotationDraftStartedData;
52
52
  name: 'draftAnnotationStarted';
53
+ } | {
54
+ name: 'draftAnnotationCleared';
53
55
  } | {
54
56
  data: AnnotationSelectedChangeData;
55
57
  name: 'annotationSelectionChanged';
@@ -139,13 +141,13 @@ export type AnnotationManager = AnnotationManagerMethods & {
139
141
  * @private
140
142
  * @internal
141
143
  */
142
- checkPreemptiveGate(): Promise<boolean>;
144
+ checkPreemptiveGate: () => Promise<boolean>;
143
145
  /**
144
146
  * @private
145
147
  * @internal
146
148
  * This method is intended for internal Platform use only. It is not intended for use by Product code.
147
149
  */
148
- emit(event: {
150
+ emit: (event: {
149
151
  data: AnnotationDraftStartedData;
150
152
  name: 'draftAnnotationStarted';
151
153
  } | {
@@ -153,28 +155,28 @@ export type AnnotationManager = AnnotationManagerMethods & {
153
155
  } | {
154
156
  data: AnnotationSelectedChangeData;
155
157
  name: 'annotationSelectionChanged';
156
- }): AnnotationManager;
158
+ }) => AnnotationManager;
157
159
  /**
158
160
  * @private
159
161
  * @internal
160
162
  * This method is intended for internal Platform use only. It is not intended for use by Product code.
161
163
  */
162
- hook<H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]): AnnotationManager;
163
- offAnnotationSelectionChange(handler: (data: AnnotationSelectedChangeData) => void): AnnotationManager;
164
- offDraftAnnotationStarted(handler: (data: AnnotationDraftStartedData) => void): AnnotationManager;
165
- onAnnotationSelectionChange(handler: (data: AnnotationSelectedChangeData) => void): AnnotationManager;
166
- onDraftAnnotationStarted(handler: (data: AnnotationDraftStartedData) => void): AnnotationManager;
164
+ hook: <H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]) => AnnotationManager;
165
+ offAnnotationSelectionChange: (handler: (data: AnnotationSelectedChangeData) => void) => AnnotationManager;
166
+ offDraftAnnotationStarted: (handler: (data: AnnotationDraftStartedData) => void) => AnnotationManager;
167
+ onAnnotationSelectionChange: (handler: (data: AnnotationSelectedChangeData) => void) => AnnotationManager;
168
+ onDraftAnnotationStarted: (handler: (data: AnnotationDraftStartedData) => void) => AnnotationManager;
167
169
  /**
168
170
  * This method is used to set a preemptive gate. A preemptive gate is a function that will be called
169
171
  * before the manager performs an action. If the function returns false, the action will not be performed.
170
172
  */
171
- setPreemptiveGate(handler: () => Promise<boolean>): AnnotationManager;
173
+ setPreemptiveGate: (handler: () => Promise<boolean>) => AnnotationManager;
172
174
  /**
173
175
  *
174
176
  * @internal
175
177
  * This method is intended for internal Platform use only. It is not intended for use by Product code.
176
178
  */
177
- unhook<H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]): AnnotationManager;
179
+ unhook: <H extends keyof AnnotationManagerMethods>(method: H, handler: AnnotationManagerMethods[H]) => AnnotationManager;
178
180
  };
179
181
  /**
180
182
  * This is a factory method which creates a new instance of the AnnotationManager.