@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
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.18.1",
3
+ "version": "111.19.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/"
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/editor-shared-styles": "^3.10.0",
49
49
  "@atlaskit/editor-tables": "^2.9.0",
50
50
  "@atlaskit/editor-toolbar": "^0.19.0",
51
- "@atlaskit/editor-toolbar-model": "^0.3.0",
51
+ "@atlaskit/editor-toolbar-model": "^0.4.0",
52
52
  "@atlaskit/emoji": "^69.10.0",
53
53
  "@atlaskit/icon": "^31.0.0",
54
54
  "@atlaskit/icon-object": "^7.4.0",
@@ -81,7 +81,7 @@
81
81
  "@atlaskit/task-decision": "^19.2.0",
82
82
  "@atlaskit/textfield": "^8.2.0",
83
83
  "@atlaskit/theme": "^21.0.0",
84
- "@atlaskit/tmp-editor-statsig": "^29.3.0",
84
+ "@atlaskit/tmp-editor-statsig": "^29.5.0",
85
85
  "@atlaskit/tokens": "^11.0.0",
86
86
  "@atlaskit/tooltip": "^20.14.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",
@@ -266,9 +266,6 @@
266
266
  },
267
267
  "platform_editor_toolbar_aifc_placement_overridden": {
268
268
  "type": "boolean"
269
- },
270
- "platform_editor_fix_node_anchor_dom_cache": {
271
- "type": "boolean"
272
269
  }
273
270
  }
274
271
  }