@atlaskit/editor-core 165.0.0 → 166.0.2

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 (244) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cjs/actions/index.js +9 -0
  3. package/dist/cjs/create-editor/ReactEditorView.js +14 -6
  4. package/dist/cjs/create-editor/create-plugins-list.js +1 -2
  5. package/dist/cjs/editor.js +13 -0
  6. package/dist/cjs/event-dispatcher/index.js +9 -0
  7. package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
  8. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  9. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  10. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
  11. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
  12. package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
  13. package/dist/cjs/plugins/card/styles.js +3 -1
  14. package/dist/cjs/plugins/code-block/styles.js +6 -4
  15. package/dist/cjs/plugins/collab-edit/index.js +2 -2
  16. package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
  17. package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
  18. package/dist/cjs/plugins/date/styles.js +3 -1
  19. package/dist/cjs/plugins/emoji/index.js +30 -34
  20. package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
  21. package/dist/cjs/plugins/emoji/styles.js +3 -17
  22. package/dist/cjs/plugins/expand/ui/styles.js +2 -2
  23. package/dist/cjs/plugins/extension/context-panel.js +2 -2
  24. package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -2
  25. package/dist/cjs/plugins/extension/ui/styles.js +3 -1
  26. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  27. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
  28. package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
  29. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
  30. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  31. package/dist/cjs/plugins/layout/styles.js +3 -1
  32. package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
  33. package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
  34. package/dist/cjs/plugins/list/transforms.js +11 -3
  35. package/dist/cjs/plugins/macro/actions.js +2 -2
  36. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +2 -2
  37. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  38. package/dist/cjs/plugins/media/styles.js +3 -1
  39. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  40. package/dist/cjs/plugins/mentions/index.js +10 -14
  41. package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
  42. package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
  43. package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
  44. package/dist/cjs/plugins/panel/styles.js +3 -1
  45. package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  46. package/dist/cjs/plugins/rule/styles.js +3 -1
  47. package/dist/cjs/plugins/selection/utils.js +39 -23
  48. package/dist/cjs/plugins/table/event-handlers.js +3 -3
  49. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
  50. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  51. package/dist/cjs/plugins/table/ui/consts.js +6 -4
  52. package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
  53. package/dist/cjs/plugins/text-formatting/utils.js +1 -1
  54. package/dist/cjs/plugins/type-ahead/index.js +6 -2
  55. package/dist/cjs/plugins/unsupported-content/index.js +22 -10
  56. package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
  57. package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
  58. package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
  59. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
  60. package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
  61. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +2 -2
  62. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
  63. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
  64. package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
  65. package/dist/cjs/ui/ContentStyles/index.js +2 -2
  66. package/dist/cjs/version-wrapper.js +1 -1
  67. package/dist/cjs/version.json +1 -1
  68. package/dist/es2019/actions/index.js +12 -1
  69. package/dist/es2019/create-editor/ReactEditorView.js +14 -6
  70. package/dist/es2019/create-editor/create-plugins-list.js +1 -2
  71. package/dist/es2019/editor.js +14 -0
  72. package/dist/es2019/event-dispatcher/index.js +8 -0
  73. package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
  74. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
  75. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  76. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
  77. package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
  78. package/dist/es2019/plugins/card/styles.js +9 -5
  79. package/dist/es2019/plugins/code-block/styles.js +11 -8
  80. package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
  81. package/dist/es2019/plugins/date/styles.js +3 -1
  82. package/dist/es2019/plugins/emoji/index.js +16 -21
  83. package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
  84. package/dist/es2019/plugins/emoji/styles.js +1 -82
  85. package/dist/es2019/plugins/expand/ui/styles.js +2 -2
  86. package/dist/es2019/plugins/extension/ui/styles.js +4 -2
  87. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  88. package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
  89. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
  90. package/dist/es2019/plugins/layout/styles.js +3 -2
  91. package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
  92. package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
  93. package/dist/es2019/plugins/list/transforms.js +9 -4
  94. package/dist/es2019/plugins/media/styles.js +9 -7
  95. package/dist/es2019/plugins/mentions/index.js +1 -6
  96. package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
  97. package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
  98. package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
  99. package/dist/es2019/plugins/panel/styles.js +5 -4
  100. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  101. package/dist/es2019/plugins/rule/styles.js +2 -1
  102. package/dist/es2019/plugins/selection/utils.js +35 -20
  103. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
  104. package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
  105. package/dist/es2019/plugins/table/ui/consts.js +5 -4
  106. package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
  107. package/dist/es2019/plugins/text-formatting/utils.js +1 -1
  108. package/dist/es2019/plugins/type-ahead/index.js +5 -1
  109. package/dist/es2019/plugins/unsupported-content/index.js +23 -12
  110. package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
  111. package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
  112. package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
  113. package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
  114. package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
  115. package/dist/es2019/ui/ContentStyles/index.js +3 -3
  116. package/dist/es2019/version-wrapper.js +1 -1
  117. package/dist/es2019/version.json +1 -1
  118. package/dist/esm/actions/index.js +9 -1
  119. package/dist/esm/create-editor/ErrorBoundary.js +1 -1
  120. package/dist/esm/create-editor/ReactEditorView.js +14 -6
  121. package/dist/esm/create-editor/create-plugins-list.js +1 -2
  122. package/dist/esm/editor.js +16 -1
  123. package/dist/esm/event-dispatcher/index.js +9 -0
  124. package/dist/esm/nodeviews/ReactNodeView.js +1 -10
  125. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  126. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  127. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  128. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
  129. package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
  130. package/dist/esm/plugins/card/styles.js +2 -1
  131. package/dist/esm/plugins/code-block/styles.js +5 -4
  132. package/dist/esm/plugins/collab-edit/index.js +1 -1
  133. package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
  134. package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
  135. package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
  136. package/dist/esm/plugins/custom-autoformat/index.js +1 -1
  137. package/dist/esm/plugins/date/styles.js +2 -1
  138. package/dist/esm/plugins/emoji/index.js +26 -29
  139. package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
  140. package/dist/esm/plugins/emoji/styles.js +3 -14
  141. package/dist/esm/plugins/expand/ui/styles.js +2 -2
  142. package/dist/esm/plugins/extension/actions.js +1 -1
  143. package/dist/esm/plugins/extension/context-panel.js +1 -1
  144. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -1
  145. package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
  146. package/dist/esm/plugins/extension/ui/styles.js +2 -1
  147. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  148. package/dist/esm/plugins/feedback-dialog/index.js +1 -1
  149. package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
  150. package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -1
  151. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
  152. package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
  153. package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
  154. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
  155. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -1
  156. package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
  157. package/dist/esm/plugins/layout/styles.js +2 -1
  158. package/dist/esm/plugins/list/commands/indent-list.js +4 -1
  159. package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
  160. package/dist/esm/plugins/list/transforms.js +9 -4
  161. package/dist/esm/plugins/macro/actions.js +1 -1
  162. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
  163. package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -1
  164. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
  165. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +1 -1
  166. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  167. package/dist/esm/plugins/media/picker-facade.js +1 -1
  168. package/dist/esm/plugins/media/pm-plugins/main.js +1 -1
  169. package/dist/esm/plugins/media/styles.js +2 -1
  170. package/dist/esm/plugins/media/toolbar/utils.js +1 -1
  171. package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
  172. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
  173. package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
  174. package/dist/esm/plugins/mentions/index.js +10 -14
  175. package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
  176. package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
  177. package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
  178. package/dist/esm/plugins/panel/styles.js +2 -1
  179. package/dist/esm/plugins/paste/handlers.js +1 -1
  180. package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
  181. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  182. package/dist/esm/plugins/quick-insert/index.js +1 -1
  183. package/dist/esm/plugins/rule/styles.js +2 -1
  184. package/dist/esm/plugins/selection/utils.js +35 -20
  185. package/dist/esm/plugins/table/event-handlers.js +3 -3
  186. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
  187. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  188. package/dist/esm/plugins/table/ui/consts.js +5 -4
  189. package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
  190. package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
  191. package/dist/esm/plugins/text-formatting/utils.js +1 -1
  192. package/dist/esm/plugins/type-ahead/index.js +6 -2
  193. package/dist/esm/plugins/unsupported-content/index.js +21 -11
  194. package/dist/esm/plugins/unsupported-content/styles.js +3 -2
  195. package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
  196. package/dist/esm/ui/Appearance/Chromeless.js +6 -3
  197. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
  198. package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
  199. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
  200. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
  201. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
  202. package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
  203. package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
  204. package/dist/esm/ui/ContentStyles/index.js +3 -3
  205. package/dist/esm/ui/LinkSearch/index.js +1 -1
  206. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  207. package/dist/esm/utils/action.js +1 -1
  208. package/dist/esm/utils/clipboard.js +1 -1
  209. package/dist/esm/utils/extensions.js +1 -1
  210. package/dist/esm/version-wrapper.js +1 -1
  211. package/dist/esm/version.json +1 -1
  212. package/dist/types/actions/index.d.ts +3 -1
  213. package/dist/types/editor.d.ts +3 -0
  214. package/dist/types/event-dispatcher/index.d.ts +1 -0
  215. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
  216. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  217. package/dist/types/plugins/analytics/types/events.d.ts +2 -2
  218. package/dist/types/plugins/analytics/types/general-events.d.ts +10 -1
  219. package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
  220. package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
  221. package/dist/types/plugins/emoji/index.d.ts +2 -6
  222. package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
  223. package/dist/types/plugins/emoji/styles.d.ts +0 -1
  224. package/dist/types/plugins/emoji/types.d.ts +0 -1
  225. package/dist/types/plugins/list/transforms.d.ts +10 -1
  226. package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
  227. package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
  228. package/dist/types/plugins/selection/utils.d.ts +7 -15
  229. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
  230. package/dist/types/plugins/table/ui/consts.d.ts +2 -2
  231. package/dist/types/plugins/type-ahead/types.d.ts +1 -0
  232. package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
  233. package/dist/types/types/editor-appearance-component.d.ts +1 -0
  234. package/dist/types/types/editor-props.d.ts +1 -0
  235. package/dist/types/types/feature-flags.d.ts +0 -14
  236. package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
  237. package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
  238. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +4 -4
  239. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  240. package/package.json +23 -23
  241. package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
  242. package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
  243. package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
  244. package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "165.0.0",
3
+ "version": "166.0.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,26 +42,26 @@
42
42
  "@atlaskit/date": "^0.9.0",
43
43
  "@atlaskit/datetime-picker": "^11.1.0",
44
44
  "@atlaskit/droplist": "^11.0.0",
45
- "@atlaskit/editor-common": "^66.0.0",
45
+ "@atlaskit/editor-common": "^67.0.0",
46
46
  "@atlaskit/editor-json-transformer": "^8.7.0",
47
47
  "@atlaskit/editor-markdown-transformer": "^4.1.0",
48
- "@atlaskit/editor-shared-styles": "^2.0.0",
48
+ "@atlaskit/editor-shared-styles": "^2.1.0",
49
49
  "@atlaskit/editor-tables": "^2.1.0",
50
- "@atlaskit/emoji": "^64.5.0",
50
+ "@atlaskit/emoji": "^64.6.0",
51
51
  "@atlaskit/empty-state": "^7.3.0",
52
52
  "@atlaskit/form": "^8.5.0",
53
53
  "@atlaskit/icon": "^21.10.0",
54
54
  "@atlaskit/icon-object": "^6.2.0",
55
55
  "@atlaskit/item": "^12.0.0",
56
56
  "@atlaskit/locale": "^2.3.0",
57
- "@atlaskit/logo": "^13.5.0",
58
- "@atlaskit/media-card": "^73.5.0",
59
- "@atlaskit/media-client": "^15.1.0",
60
- "@atlaskit/media-common": "^2.12.0",
61
- "@atlaskit/media-filmstrip": "^43.0.0",
62
- "@atlaskit/media-picker": "^61.0.0",
63
- "@atlaskit/media-ui": "^21.1.0",
64
- "@atlaskit/media-viewer": "^46.2.0",
57
+ "@atlaskit/logo": "^13.6.0",
58
+ "@atlaskit/media-card": "^73.6.0",
59
+ "@atlaskit/media-client": "^16.0.0",
60
+ "@atlaskit/media-common": "^2.13.0",
61
+ "@atlaskit/media-filmstrip": "^44.0.0",
62
+ "@atlaskit/media-picker": "^62.0.0",
63
+ "@atlaskit/media-ui": "^22.0.0",
64
+ "@atlaskit/media-viewer": "^46.3.0",
65
65
  "@atlaskit/mention": "^21.0.0",
66
66
  "@atlaskit/menu": "^1.3.0",
67
67
  "@atlaskit/modal-dialog": "^12.2.0",
@@ -78,7 +78,7 @@
78
78
  "@atlaskit/textfield": "^5.1.0",
79
79
  "@atlaskit/theme": "^12.1.0",
80
80
  "@atlaskit/toggle": "^12.4.0",
81
- "@atlaskit/tokens": "^0.9.0",
81
+ "@atlaskit/tokens": "^0.10.0",
82
82
  "@atlaskit/tooltip": "^17.5.0",
83
83
  "@atlaskit/util-service-support": "^6.1.0",
84
84
  "@atlaskit/width-detector": "^4.0.0",
@@ -127,18 +127,18 @@
127
127
  "w3c-keyname": "^2.1.0"
128
128
  },
129
129
  "peerDependencies": {
130
- "@atlaskit/media-core": "^32.3.1",
131
- "@atlaskit/smart-card": "^19.0.0",
130
+ "@atlaskit/media-core": "^33.0.0",
131
+ "@atlaskit/smart-card": "^19.1.1",
132
132
  "react": "^16.8.0",
133
133
  "react-dom": "^16.8.0",
134
134
  "react-intl-next": "npm:react-intl@^5.18.1",
135
135
  "styled-components": "^3.2.6"
136
136
  },
137
137
  "devDependencies": {
138
- "@atlaskit/atlassian-navigation": "^2.1.0",
139
- "@atlaskit/breadcrumbs": "11.5.7",
138
+ "@atlaskit/atlassian-navigation": "^2.2.0",
139
+ "@atlaskit/breadcrumbs": "11.6.1",
140
140
  "@atlaskit/code": "^14.3.0",
141
- "@atlaskit/collab-provider": "7.3.1",
141
+ "@atlaskit/collab-provider": "7.4.0",
142
142
  "@atlaskit/docs": "*",
143
143
  "@atlaskit/drawer": "^7.1.0",
144
144
  "@atlaskit/dropdown-menu": "^11.1.0",
@@ -148,17 +148,17 @@
148
148
  "@atlaskit/flag": "^14.5.0",
149
149
  "@atlaskit/inline-dialog": "^13.3.0",
150
150
  "@atlaskit/lozenge": "^11.1.0",
151
- "@atlaskit/media-core": "^32.3.0",
151
+ "@atlaskit/media-core": "^33.0.0",
152
152
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
153
- "@atlaskit/media-test-helpers": "^29.4.0",
153
+ "@atlaskit/media-test-helpers": "^30.0.0",
154
154
  "@atlaskit/menu": "^1.3.0",
155
155
  "@atlaskit/page-layout": "^1.2.0",
156
156
  "@atlaskit/profilecard": "^16.4.0",
157
157
  "@atlaskit/pubsub": "^6.0.0",
158
- "@atlaskit/renderer": "^94.0.0",
158
+ "@atlaskit/renderer": "^95.0.0",
159
159
  "@atlaskit/section-message": "^6.1.0",
160
160
  "@atlaskit/share": "*",
161
- "@atlaskit/smart-card": "^19.0.0",
161
+ "@atlaskit/smart-card": "^19.1.0",
162
162
  "@atlaskit/smart-user-picker": "^5.0.2",
163
163
  "@atlaskit/synchrony-test-helpers": "^2.3.0",
164
164
  "@atlaskit/textarea": "^4.3.0",
@@ -168,7 +168,7 @@
168
168
  "@atlaskit/visual-regression": "*",
169
169
  "@atlaskit/webdriver-runner": "*",
170
170
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
171
- "@atlassian/search-provider": "2.2.3",
171
+ "@atlassian/search-provider": "2.3.0",
172
172
  "@atlassian/ufo": "^0.1.0",
173
173
  "@emotion/jest": "^11.8.0",
174
174
  "@testing-library/dom": "^7.7.3",
@@ -1,250 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.EmojiNodeView = void 0;
9
- exports.default = emojiNodeView;
10
-
11
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
-
13
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
-
15
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
16
-
17
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
18
-
19
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
20
-
21
- var _prosemirrorModel = require("prosemirror-model");
22
-
23
- var _utils = require("@atlaskit/editor-common/utils");
24
-
25
- var EmojiNodeView = /*#__PURE__*/function () {
26
- function EmojiNodeView(node, _, context) {
27
- var _this = this,
28
- _this$options;
29
-
30
- (0, _classCallCheck2.default)(this, EmojiNodeView);
31
- (0, _defineProperty2.default)(this, "hasProvider", false);
32
- (0, _defineProperty2.default)(this, "subscribe", function (_, provider) {
33
- _this.hasProvider = false;
34
- _this.emojiProvider = provider;
35
- provider === null || provider === void 0 ? void 0 : provider.then(function () {
36
- return _this.hasProvider = true;
37
- }).then(function () {
38
- return _this.findEmoji();
39
- }).then(function (emoji) {
40
- return _this.update(_this.node, null, emoji);
41
- });
42
- });
43
- this.node = node;
44
- this.providers = context.providerFactory;
45
- this.options = context.options;
46
- this.dom = EmojiNodeView.toDom(node);
47
- this.el = this.dom;
48
- this.providers.subscribe('emojiProvider', this.subscribe);
49
-
50
- if ((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.allowZeroWidthSpaceAfter) {
51
- this.el.after(document.createTextNode(_utils.ZERO_WIDTH_SPACE));
52
- }
53
-
54
- this.update(this.node, null);
55
- }
56
-
57
- (0, _createClass2.default)(EmojiNodeView, [{
58
- key: "findEmoji",
59
- value: function () {
60
- var _findEmoji = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
61
- var node,
62
- emojiProvider,
63
- _args = arguments;
64
- return _regenerator.default.wrap(function _callee$(_context) {
65
- while (1) {
66
- switch (_context.prev = _context.next) {
67
- case 0:
68
- node = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.node;
69
- _context.next = 3;
70
- return this.emojiProvider;
71
-
72
- case 3:
73
- emojiProvider = _context.sent;
74
-
75
- if (!emojiProvider) {
76
- _context.next = 6;
77
- break;
78
- }
79
-
80
- return _context.abrupt("return", emojiProvider.findByEmojiId({
81
- id: node.attrs.id,
82
- shortName: node.attrs.shortName,
83
- fallback: node.attrs.text
84
- }));
85
-
86
- case 6:
87
- case "end":
88
- return _context.stop();
89
- }
90
- }
91
- }, _callee, this);
92
- }));
93
-
94
- function findEmoji() {
95
- return _findEmoji.apply(this, arguments);
96
- }
97
-
98
- return findEmoji;
99
- }()
100
- }, {
101
- key: "destroy",
102
- value: function destroy() {
103
- this.providers.unsubscribe('emojiProvider', this.subscribe);
104
- }
105
- }, {
106
- key: "update",
107
- value: function update(node, _) {
108
- var _this2 = this;
109
-
110
- var emoji = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.emoji;
111
-
112
- if (this.node.type !== node.type) {
113
- this.node = node;
114
- return false;
115
- }
116
-
117
- var prev = this.node.attrs;
118
- var next = node.attrs;
119
- var changed = false;
120
-
121
- if (prev.id !== next.id) {
122
- changed = true;
123
- this.el.dataset.emojiId = next.id;
124
- }
125
-
126
- if (prev.shortName !== next.shortName) {
127
- changed = true;
128
- this.el.dataset.emojiShortname = next.shortName;
129
- }
130
-
131
- if (changed) {
132
- this.emoji = undefined;
133
- this.node = node;
134
- this.findEmoji().then(function (emoji) {
135
- return _this2.update(_this2.node, _, emoji);
136
- });
137
- return true;
138
- }
139
-
140
- if (!this.hasProvider) {
141
- this.el.classList.add('editor-emoji-loading');
142
- this.el.style.backgroundSize = '';
143
- this.el.style.backgroundPosition = '';
144
- this.el.style.backgroundImage = '';
145
- this.node = node;
146
- this.emoji = emoji;
147
- return true;
148
- } else {
149
- this.el.classList.remove('editor-emoji-loading');
150
- }
151
-
152
- if (!emoji) {
153
- this.el.classList.add('editor-emoji-fallback');
154
- this.el.style.backgroundSize = '';
155
- this.el.style.backgroundPosition = '';
156
- this.el.style.backgroundImage = '';
157
- this.node = node;
158
- this.emoji = emoji;
159
- return true;
160
- } else {
161
- this.el.classList.remove('editor-emoji-fallback');
162
- }
163
-
164
- if (this.emoji === emoji) {
165
- return true;
166
- }
167
-
168
- var representation = emoji === null || emoji === void 0 ? void 0 : emoji.representation;
169
-
170
- if (EmojiNodeView.isSprite(representation)) {
171
- var sprite = representation.sprite,
172
- xIndex = representation.xIndex,
173
- yIndex = representation.yIndex;
174
- var row = sprite.row,
175
- column = sprite.column,
176
- url = sprite.url;
177
- var xPosition = 100 / (column - 1) * (xIndex - 0);
178
- var yPosition = 100 / (row - 1) * (yIndex - 0);
179
- this.el.style.backgroundSize = "".concat(column * 100, "% ").concat(row * 100, "%");
180
- this.el.style.backgroundPosition = "".concat(xPosition, "% ").concat(yPosition, "%");
181
- this.el.style.backgroundImage = "url(".concat(url, ")");
182
- }
183
-
184
- if (EmojiNodeView.isImage(representation) || EmojiNodeView.isMedia(representation)) {
185
- var path = EmojiNodeView.isImage(representation) ? representation.imagePath : representation.mediaPath;
186
- var rawWidth = representation.width,
187
- rawHeight = representation.height;
188
- var width = rawWidth / (rawHeight / 20);
189
- this.el.style.width = "".concat(width, "px");
190
- this.el.style.backgroundImage = "url(".concat(path, ")");
191
- }
192
-
193
- this.emoji = emoji;
194
- return true;
195
- }
196
- }, {
197
- key: "ignoreMutation",
198
- value: function ignoreMutation(_) {
199
- return true;
200
- }
201
- }], [{
202
- key: "toDomSpec",
203
- value: function toDomSpec(node) {
204
- return ['span', {
205
- 'aria-label': node.attrs.shortName,
206
- 'data-emoji-id': node.attrs.id,
207
- 'data-emoji-shortname': node.attrs.shortName,
208
- class: 'editor-emoji'
209
- }, node.attrs.shortName];
210
- }
211
- }, {
212
- key: "toDom",
213
- value: function toDom(node) {
214
- return _prosemirrorModel.DOMSerializer.renderSpec(document, EmojiNodeView.toDomSpec(node)).dom;
215
- }
216
- }, {
217
- key: "isSprite",
218
- value: function isSprite(representation) {
219
- var _representation$hasOw;
220
-
221
- return (_representation$hasOw = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('sprite')) !== null && _representation$hasOw !== void 0 ? _representation$hasOw : false;
222
- }
223
- }, {
224
- key: "isImage",
225
- value: function isImage(representation) {
226
- var _representation$hasOw2;
227
-
228
- return (_representation$hasOw2 = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('imagePath')) !== null && _representation$hasOw2 !== void 0 ? _representation$hasOw2 : false;
229
- }
230
- }, {
231
- key: "isMedia",
232
- value: function isMedia(representation) {
233
- var _representation$hasOw3;
234
-
235
- return (_representation$hasOw3 = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('mediaPath')) !== null && _representation$hasOw3 !== void 0 ? _representation$hasOw3 : false;
236
- }
237
- }]);
238
- return EmojiNodeView;
239
- }();
240
-
241
- exports.EmojiNodeView = EmojiNodeView;
242
-
243
- function emojiNodeView(providerFactory, options) {
244
- return function (node, view) {
245
- return new EmojiNodeView(node, view, {
246
- providerFactory: providerFactory,
247
- options: options
248
- });
249
- };
250
- }
@@ -1,177 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { DOMSerializer } from 'prosemirror-model';
3
- import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
4
- export class EmojiNodeView {
5
- constructor(node, _, context) {
6
- var _this$options;
7
-
8
- _defineProperty(this, "hasProvider", false);
9
-
10
- _defineProperty(this, "subscribe", (_, provider) => {
11
- this.hasProvider = false;
12
- this.emojiProvider = provider;
13
- provider === null || provider === void 0 ? void 0 : provider.then(() => this.hasProvider = true).then(() => this.findEmoji()).then(emoji => this.update(this.node, null, emoji));
14
- });
15
-
16
- this.node = node;
17
- this.providers = context.providerFactory;
18
- this.options = context.options;
19
- this.dom = EmojiNodeView.toDom(node);
20
- this.el = this.dom;
21
- this.providers.subscribe('emojiProvider', this.subscribe);
22
-
23
- if ((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.allowZeroWidthSpaceAfter) {
24
- this.el.after(document.createTextNode(ZERO_WIDTH_SPACE));
25
- }
26
-
27
- this.update(this.node, null);
28
- }
29
-
30
- static toDomSpec(node) {
31
- return ['span', {
32
- 'aria-label': node.attrs.shortName,
33
- 'data-emoji-id': node.attrs.id,
34
- 'data-emoji-shortname': node.attrs.shortName,
35
- class: 'editor-emoji'
36
- }, node.attrs.shortName];
37
- }
38
-
39
- static toDom(node) {
40
- return DOMSerializer.renderSpec(document, EmojiNodeView.toDomSpec(node)).dom;
41
- }
42
-
43
- static isSprite(representation) {
44
- var _representation$hasOw;
45
-
46
- return (_representation$hasOw = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('sprite')) !== null && _representation$hasOw !== void 0 ? _representation$hasOw : false;
47
- }
48
-
49
- static isImage(representation) {
50
- var _representation$hasOw2;
51
-
52
- return (_representation$hasOw2 = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('imagePath')) !== null && _representation$hasOw2 !== void 0 ? _representation$hasOw2 : false;
53
- }
54
-
55
- static isMedia(representation) {
56
- var _representation$hasOw3;
57
-
58
- return (_representation$hasOw3 = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('mediaPath')) !== null && _representation$hasOw3 !== void 0 ? _representation$hasOw3 : false;
59
- }
60
-
61
- async findEmoji(node = this.node) {
62
- const emojiProvider = await this.emojiProvider;
63
-
64
- if (emojiProvider) {
65
- return emojiProvider.findByEmojiId({
66
- id: node.attrs.id,
67
- shortName: node.attrs.shortName,
68
- fallback: node.attrs.text
69
- });
70
- }
71
- }
72
-
73
- destroy() {
74
- this.providers.unsubscribe('emojiProvider', this.subscribe);
75
- }
76
-
77
- update(node, _, emoji = this.emoji) {
78
- if (this.node.type !== node.type) {
79
- this.node = node;
80
- return false;
81
- }
82
-
83
- const prev = this.node.attrs;
84
- const next = node.attrs;
85
- let changed = false;
86
-
87
- if (prev.id !== next.id) {
88
- changed = true;
89
- this.el.dataset.emojiId = next.id;
90
- }
91
-
92
- if (prev.shortName !== next.shortName) {
93
- changed = true;
94
- this.el.dataset.emojiShortname = next.shortName;
95
- }
96
-
97
- if (changed) {
98
- this.emoji = undefined;
99
- this.node = node;
100
- this.findEmoji().then(emoji => this.update(this.node, _, emoji));
101
- return true;
102
- }
103
-
104
- if (!this.hasProvider) {
105
- this.el.classList.add('editor-emoji-loading');
106
- this.el.style.backgroundSize = '';
107
- this.el.style.backgroundPosition = '';
108
- this.el.style.backgroundImage = '';
109
- this.node = node;
110
- this.emoji = emoji;
111
- return true;
112
- } else {
113
- this.el.classList.remove('editor-emoji-loading');
114
- }
115
-
116
- if (!emoji) {
117
- this.el.classList.add('editor-emoji-fallback');
118
- this.el.style.backgroundSize = '';
119
- this.el.style.backgroundPosition = '';
120
- this.el.style.backgroundImage = '';
121
- this.node = node;
122
- this.emoji = emoji;
123
- return true;
124
- } else {
125
- this.el.classList.remove('editor-emoji-fallback');
126
- }
127
-
128
- if (this.emoji === emoji) {
129
- return true;
130
- }
131
-
132
- const representation = emoji === null || emoji === void 0 ? void 0 : emoji.representation;
133
-
134
- if (EmojiNodeView.isSprite(representation)) {
135
- const {
136
- sprite,
137
- xIndex,
138
- yIndex
139
- } = representation;
140
- const {
141
- row,
142
- column,
143
- url
144
- } = sprite;
145
- const xPosition = 100 / (column - 1) * (xIndex - 0);
146
- const yPosition = 100 / (row - 1) * (yIndex - 0);
147
- this.el.style.backgroundSize = `${column * 100}% ${row * 100}%`;
148
- this.el.style.backgroundPosition = `${xPosition}% ${yPosition}%`;
149
- this.el.style.backgroundImage = `url(${url})`;
150
- }
151
-
152
- if (EmojiNodeView.isImage(representation) || EmojiNodeView.isMedia(representation)) {
153
- const path = EmojiNodeView.isImage(representation) ? representation.imagePath : representation.mediaPath;
154
- const {
155
- width: rawWidth,
156
- height: rawHeight
157
- } = representation;
158
- const width = rawWidth / (rawHeight / 20);
159
- this.el.style.width = `${width}px`;
160
- this.el.style.backgroundImage = `url(${path})`;
161
- }
162
-
163
- this.emoji = emoji;
164
- return true;
165
- }
166
-
167
- ignoreMutation(_) {
168
- return true;
169
- }
170
-
171
- }
172
- export default function emojiNodeView(providerFactory, options) {
173
- return (node, view) => new EmojiNodeView(node, view, {
174
- providerFactory,
175
- options
176
- });
177
- }