@atlaskit/editor-common 82.14.0 → 83.0.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 (180) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/hooks/useSharedPluginState.js +1 -4
  3. package/dist/cjs/i18n/cs.js +2 -1
  4. package/dist/cjs/i18n/da.js +2 -1
  5. package/dist/cjs/i18n/de.js +2 -1
  6. package/dist/cjs/i18n/en.js +1 -0
  7. package/dist/cjs/i18n/en_GB.js +1 -0
  8. package/dist/cjs/i18n/en_ZZ.js +1 -0
  9. package/dist/cjs/i18n/es.js +2 -1
  10. package/dist/cjs/i18n/fi.js +2 -1
  11. package/dist/cjs/i18n/fr.js +2 -1
  12. package/dist/cjs/i18n/hu.js +2 -1
  13. package/dist/cjs/i18n/it.js +2 -1
  14. package/dist/cjs/i18n/ja.js +2 -1
  15. package/dist/cjs/i18n/ko.js +2 -1
  16. package/dist/cjs/i18n/nb.js +2 -1
  17. package/dist/cjs/i18n/nl.js +2 -1
  18. package/dist/cjs/i18n/pl.js +2 -1
  19. package/dist/cjs/i18n/pt_BR.js +2 -1
  20. package/dist/cjs/i18n/ru.js +2 -1
  21. package/dist/cjs/i18n/sv.js +2 -1
  22. package/dist/cjs/i18n/th.js +7 -3
  23. package/dist/cjs/i18n/tr.js +4 -3
  24. package/dist/cjs/i18n/uk.js +2 -1
  25. package/dist/cjs/i18n/vi.js +2 -1
  26. package/dist/cjs/i18n/zh.js +3 -2
  27. package/dist/cjs/i18n/zh_TW.js +2 -1
  28. package/dist/cjs/monitoring/error.js +1 -1
  29. package/dist/cjs/preset/builder.js +491 -0
  30. package/dist/cjs/styles/shared/annotation.js +20 -18
  31. package/dist/cjs/types/index.js +6 -1
  32. package/dist/cjs/ui/DropList/index.js +1 -1
  33. package/dist/cjs/ui/Mention/mention-with-profilecard.js +3 -1
  34. package/dist/es2019/hooks/useSharedPluginState.js +1 -6
  35. package/dist/es2019/i18n/cs.js +2 -1
  36. package/dist/es2019/i18n/da.js +2 -1
  37. package/dist/es2019/i18n/de.js +2 -1
  38. package/dist/es2019/i18n/en.js +1 -0
  39. package/dist/es2019/i18n/en_GB.js +1 -0
  40. package/dist/es2019/i18n/en_ZZ.js +1 -0
  41. package/dist/es2019/i18n/es.js +2 -1
  42. package/dist/es2019/i18n/fi.js +2 -1
  43. package/dist/es2019/i18n/fr.js +2 -1
  44. package/dist/es2019/i18n/hu.js +2 -1
  45. package/dist/es2019/i18n/it.js +2 -1
  46. package/dist/es2019/i18n/ja.js +2 -1
  47. package/dist/es2019/i18n/ko.js +2 -1
  48. package/dist/es2019/i18n/nb.js +2 -1
  49. package/dist/es2019/i18n/nl.js +2 -1
  50. package/dist/es2019/i18n/pl.js +2 -1
  51. package/dist/es2019/i18n/pt_BR.js +2 -1
  52. package/dist/es2019/i18n/ru.js +2 -1
  53. package/dist/es2019/i18n/sv.js +2 -1
  54. package/dist/es2019/i18n/th.js +7 -3
  55. package/dist/es2019/i18n/tr.js +4 -3
  56. package/dist/es2019/i18n/uk.js +2 -1
  57. package/dist/es2019/i18n/vi.js +2 -1
  58. package/dist/es2019/i18n/zh.js +3 -2
  59. package/dist/es2019/i18n/zh_TW.js +2 -1
  60. package/dist/es2019/monitoring/error.js +1 -1
  61. package/dist/es2019/preset/builder.js +528 -0
  62. package/dist/es2019/preset/core-plugin/index.js +1 -0
  63. package/dist/es2019/styles/shared/annotation.js +54 -29
  64. package/dist/es2019/types/index.js +9 -1
  65. package/dist/es2019/ui/DropList/index.js +1 -1
  66. package/dist/es2019/ui/Mention/mention-with-profilecard.js +2 -0
  67. package/dist/esm/hooks/useSharedPluginState.js +1 -4
  68. package/dist/esm/i18n/cs.js +2 -1
  69. package/dist/esm/i18n/da.js +2 -1
  70. package/dist/esm/i18n/de.js +2 -1
  71. package/dist/esm/i18n/en.js +1 -0
  72. package/dist/esm/i18n/en_GB.js +1 -0
  73. package/dist/esm/i18n/en_ZZ.js +1 -0
  74. package/dist/esm/i18n/es.js +2 -1
  75. package/dist/esm/i18n/fi.js +2 -1
  76. package/dist/esm/i18n/fr.js +2 -1
  77. package/dist/esm/i18n/hu.js +2 -1
  78. package/dist/esm/i18n/it.js +2 -1
  79. package/dist/esm/i18n/ja.js +2 -1
  80. package/dist/esm/i18n/ko.js +2 -1
  81. package/dist/esm/i18n/nb.js +2 -1
  82. package/dist/esm/i18n/nl.js +2 -1
  83. package/dist/esm/i18n/pl.js +2 -1
  84. package/dist/esm/i18n/pt_BR.js +2 -1
  85. package/dist/esm/i18n/ru.js +2 -1
  86. package/dist/esm/i18n/sv.js +2 -1
  87. package/dist/esm/i18n/th.js +7 -3
  88. package/dist/esm/i18n/tr.js +4 -3
  89. package/dist/esm/i18n/uk.js +2 -1
  90. package/dist/esm/i18n/vi.js +2 -1
  91. package/dist/esm/i18n/zh.js +3 -2
  92. package/dist/esm/i18n/zh_TW.js +2 -1
  93. package/dist/esm/monitoring/error.js +1 -1
  94. package/dist/esm/preset/builder.js +528 -0
  95. package/dist/esm/preset/core-plugin/index.js +1 -0
  96. package/dist/esm/styles/shared/annotation.js +20 -18
  97. package/dist/esm/types/index.js +9 -1
  98. package/dist/esm/ui/DropList/index.js +1 -1
  99. package/dist/esm/ui/Mention/mention-with-profilecard.js +3 -1
  100. package/dist/types/hooks/useSharedPluginState.d.ts +5 -5
  101. package/dist/types/i18n/cs.d.ts +1 -0
  102. package/dist/types/i18n/da.d.ts +1 -0
  103. package/dist/types/i18n/de.d.ts +1 -0
  104. package/dist/types/i18n/en.d.ts +1 -0
  105. package/dist/types/i18n/en_GB.d.ts +1 -0
  106. package/dist/types/i18n/en_ZZ.d.ts +1 -0
  107. package/dist/types/i18n/es.d.ts +1 -0
  108. package/dist/types/i18n/fi.d.ts +1 -0
  109. package/dist/types/i18n/fr.d.ts +1 -0
  110. package/dist/types/i18n/hu.d.ts +1 -0
  111. package/dist/types/i18n/it.d.ts +1 -0
  112. package/dist/types/i18n/ja.d.ts +1 -0
  113. package/dist/types/i18n/ko.d.ts +1 -0
  114. package/dist/types/i18n/nb.d.ts +1 -0
  115. package/dist/types/i18n/nl.d.ts +1 -0
  116. package/dist/types/i18n/pl.d.ts +1 -0
  117. package/dist/types/i18n/pt_BR.d.ts +1 -0
  118. package/dist/types/i18n/ru.d.ts +1 -0
  119. package/dist/types/i18n/sv.d.ts +1 -0
  120. package/dist/types/i18n/th.d.ts +4 -0
  121. package/dist/types/i18n/tr.d.ts +1 -0
  122. package/dist/types/i18n/uk.d.ts +1 -0
  123. package/dist/types/i18n/vi.d.ts +1 -0
  124. package/dist/types/i18n/zh.d.ts +1 -0
  125. package/dist/types/i18n/zh_TW.d.ts +1 -0
  126. package/dist/types/preset/builder.d.ts +550 -11
  127. package/dist/types/preset/core-plugin/index.d.ts +1 -1
  128. package/dist/types/preset/core-plugin/requestDocument.d.ts +1 -2
  129. package/dist/types/preset/index.d.ts +1 -0
  130. package/dist/types/preset/plugin-injection-api.d.ts +9 -3
  131. package/dist/types/styles/shared/annotation.d.ts +17 -0
  132. package/dist/types/types/index.d.ts +8 -7
  133. package/dist/types/types/next-editor-plugin.d.ts +641 -98
  134. package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -1
  135. package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +5 -5
  136. package/dist/types-ts4.5/i18n/cs.d.ts +1 -0
  137. package/dist/types-ts4.5/i18n/da.d.ts +1 -0
  138. package/dist/types-ts4.5/i18n/de.d.ts +1 -0
  139. package/dist/types-ts4.5/i18n/en.d.ts +1 -0
  140. package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
  141. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
  142. package/dist/types-ts4.5/i18n/es.d.ts +1 -0
  143. package/dist/types-ts4.5/i18n/fi.d.ts +1 -0
  144. package/dist/types-ts4.5/i18n/fr.d.ts +1 -0
  145. package/dist/types-ts4.5/i18n/hu.d.ts +1 -0
  146. package/dist/types-ts4.5/i18n/it.d.ts +1 -0
  147. package/dist/types-ts4.5/i18n/ja.d.ts +1 -0
  148. package/dist/types-ts4.5/i18n/ko.d.ts +1 -0
  149. package/dist/types-ts4.5/i18n/nb.d.ts +1 -0
  150. package/dist/types-ts4.5/i18n/nl.d.ts +1 -0
  151. package/dist/types-ts4.5/i18n/pl.d.ts +1 -0
  152. package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -0
  153. package/dist/types-ts4.5/i18n/ru.d.ts +1 -0
  154. package/dist/types-ts4.5/i18n/sv.d.ts +1 -0
  155. package/dist/types-ts4.5/i18n/th.d.ts +4 -0
  156. package/dist/types-ts4.5/i18n/tr.d.ts +1 -0
  157. package/dist/types-ts4.5/i18n/uk.d.ts +1 -0
  158. package/dist/types-ts4.5/i18n/vi.d.ts +1 -0
  159. package/dist/types-ts4.5/i18n/zh.d.ts +1 -0
  160. package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -0
  161. package/dist/types-ts4.5/preset/builder.d.ts +577 -13
  162. package/dist/types-ts4.5/preset/core-plugin/index.d.ts +1 -1
  163. package/dist/types-ts4.5/preset/core-plugin/requestDocument.d.ts +1 -2
  164. package/dist/types-ts4.5/preset/index.d.ts +1 -0
  165. package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +9 -8
  166. package/dist/types-ts4.5/styles/shared/annotation.d.ts +17 -0
  167. package/dist/types-ts4.5/types/index.d.ts +8 -7
  168. package/dist/types-ts4.5/types/next-editor-plugin.d.ts +673 -127
  169. package/dist/types-ts4.5/ui/Mention/mention-with-profilecard.d.ts +2 -1
  170. package/package.json +2 -2
  171. package/dist/cjs/preset/core-plugin/types.js +0 -5
  172. package/dist/cjs/types/editor-public-api.js +0 -5
  173. package/dist/es2019/preset/core-plugin/types.js +0 -1
  174. package/dist/es2019/types/editor-public-api.js +0 -1
  175. package/dist/esm/preset/core-plugin/types.js +0 -1
  176. package/dist/esm/types/editor-public-api.js +0 -1
  177. package/dist/types/preset/core-plugin/types.d.ts +0 -59
  178. package/dist/types/types/editor-public-api.d.ts +0 -3
  179. package/dist/types-ts4.5/preset/core-plugin/types.d.ts +0 -59
  180. package/dist/types-ts4.5/types/editor-public-api.d.ts +0 -4
@@ -3,6 +3,7 @@ import type { MentionProvider } from '@atlaskit/mention';
3
3
  import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
4
  import type { MentionEventHandler } from '../EventHandlers';
5
5
  export interface Props {
6
+ autoFocus?: boolean;
6
7
  id: string;
7
8
  text: string;
8
9
  accessLevel?: string;
@@ -13,4 +14,4 @@ export interface Props {
13
14
  onMouseLeave?: MentionEventHandler;
14
15
  localId?: string;
15
16
  }
16
- export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, }: Props): JSX.Element;
17
+ export default function MentionWithProfileCard({ autoFocus, id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, }: Props): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "82.14.0",
3
+ "version": "83.0.0",
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/"
@@ -115,7 +115,7 @@
115
115
  "@atlaskit/icon": "^22.4.0",
116
116
  "@atlaskit/icon-object": "^6.4.0",
117
117
  "@atlaskit/link-datasource": "^2.4.0",
118
- "@atlaskit/link-picker": "^1.37.0",
118
+ "@atlaskit/link-picker": "^1.38.0",
119
119
  "@atlaskit/media-card": "^77.12.0",
120
120
  "@atlaskit/media-client": "^27.3.0",
121
121
  "@atlaskit/media-client-react": "^2.0.0",
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,59 +0,0 @@
1
- import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
2
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { EditorCommand, NextEditorPlugin, Transformer } from '../../types';
5
- export type CorePlugin = NextEditorPlugin<'core', {
6
- pluginConfiguration: {
7
- getEditorView: () => EditorView | undefined;
8
- };
9
- actions: {
10
- /**
11
- * Dispatches an EditorCommand to ProseMirror
12
- *
13
- * @param command A function (EditorCommand | undefined) that takes an object containing a `Transaction` and returns a `Transaction` if it
14
- * is successful or `null` if it shouldn't be dispatched.
15
- * @returns (boolean) if the command was successful in dispatching
16
- */
17
- execute: (command: EditorCommand | undefined) => boolean;
18
- /**
19
- * Focuses the editor.
20
- *
21
- * Calls the focus method of the `EditorView` and scrolls the
22
- * current selection into view.
23
- *
24
- * @returns (boolean) if the focus was successful
25
- */
26
- focus: () => boolean;
27
- /**
28
- * Blurs the editor.
29
- *
30
- * Calls blur on the editor DOM element.
31
- *
32
- * @returns (boolean) if the blur was successful
33
- */
34
- blur: () => boolean;
35
- /**
36
- * Request the editor document.
37
- * The document will return when available. If called multiple times it will throttle and return the
38
- * latest document when ready.
39
- *
40
- * A transformer can be created using `createTransformer`.
41
- *
42
- * @param onReceive Callback to handle the document. Document type based on the transformer.
43
- * @param options Pass a transformer for the document to be transformed into a different format.
44
- */
45
- requestDocument<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(onReceive: (document: TransformerResult<GenericTransformer> | undefined) => void, options?: {
46
- transformer?: GenericTransformer;
47
- }): void;
48
- /**
49
- * Create a transformer
50
- *
51
- * @param schema Schema of the document
52
- * @returns Transformer which can be used to request a document
53
- */
54
- createTransformer<Format>(cb: (schema: Schema) => Transformer<Format>): Transformer<Format> | undefined;
55
- };
56
- }>;
57
- export type TransformerResult<GenericTransformer = Transformer<JSONDocNode>> = GenericTransformer extends Transformer<infer Content> ? Content : JSONDocNode;
58
- export type InferTransformerResultCallback<T extends Transformer<any> | undefined> = (doc: T extends Transformer<infer U> ? TransformerResult<U> : TransformerResult<JSONDocNode>) => void;
59
- export type DefaultTransformerResultCallback = (doc: TransformerResult<JSONDocNode> | undefined) => void;
@@ -1,3 +0,0 @@
1
- import type { EditorPresetBuilder } from '../preset/builder';
2
- import type { ExtractNextEditorPlugins, PublicPluginAPI } from './next-editor-plugin';
3
- export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = T extends EditorPresetBuilder<any, infer Plugins> ? PublicPluginAPI<ExtractNextEditorPlugins<Plugins>> : PublicPluginAPI<[]>;
@@ -1,59 +0,0 @@
1
- import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
2
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { EditorCommand, NextEditorPlugin, Transformer } from '../../types';
5
- export type CorePlugin = NextEditorPlugin<'core', {
6
- pluginConfiguration: {
7
- getEditorView: () => EditorView | undefined;
8
- };
9
- actions: {
10
- /**
11
- * Dispatches an EditorCommand to ProseMirror
12
- *
13
- * @param command A function (EditorCommand | undefined) that takes an object containing a `Transaction` and returns a `Transaction` if it
14
- * is successful or `null` if it shouldn't be dispatched.
15
- * @returns (boolean) if the command was successful in dispatching
16
- */
17
- execute: (command: EditorCommand | undefined) => boolean;
18
- /**
19
- * Focuses the editor.
20
- *
21
- * Calls the focus method of the `EditorView` and scrolls the
22
- * current selection into view.
23
- *
24
- * @returns (boolean) if the focus was successful
25
- */
26
- focus: () => boolean;
27
- /**
28
- * Blurs the editor.
29
- *
30
- * Calls blur on the editor DOM element.
31
- *
32
- * @returns (boolean) if the blur was successful
33
- */
34
- blur: () => boolean;
35
- /**
36
- * Request the editor document.
37
- * The document will return when available. If called multiple times it will throttle and return the
38
- * latest document when ready.
39
- *
40
- * A transformer can be created using `createTransformer`.
41
- *
42
- * @param onReceive Callback to handle the document. Document type based on the transformer.
43
- * @param options Pass a transformer for the document to be transformed into a different format.
44
- */
45
- requestDocument<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(onReceive: (document: TransformerResult<GenericTransformer> | undefined) => void, options?: {
46
- transformer?: GenericTransformer;
47
- }): void;
48
- /**
49
- * Create a transformer
50
- *
51
- * @param schema Schema of the document
52
- * @returns Transformer which can be used to request a document
53
- */
54
- createTransformer<Format>(cb: (schema: Schema) => Transformer<Format>): Transformer<Format> | undefined;
55
- };
56
- }>;
57
- export type TransformerResult<GenericTransformer = Transformer<JSONDocNode>> = GenericTransformer extends Transformer<infer Content> ? Content : JSONDocNode;
58
- export type InferTransformerResultCallback<T extends Transformer<any> | undefined> = (doc: T extends Transformer<infer U> ? TransformerResult<U> : TransformerResult<JSONDocNode>) => void;
59
- export type DefaultTransformerResultCallback = (doc: TransformerResult<JSONDocNode> | undefined) => void;
@@ -1,4 +0,0 @@
1
- import type { EditorPresetBuilder } from '../preset/builder';
2
- import type { ExtractNextEditorPlugins, PublicPluginAPI } from './next-editor-plugin';
3
- export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = T extends EditorPresetBuilder<any, infer Plugins> ? PublicPluginAPI<ExtractNextEditorPlugins<Plugins>> : PublicPluginAPI<[
4
- ]>;