@atlaskit/editor-common 81.1.5 → 81.2.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 (299) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/codemods/migrates/entry-points.ts +14 -30
  3. package/dist/cjs/clipboard/index.js +4 -4
  4. package/dist/cjs/collab/index.js +1 -1
  5. package/dist/cjs/doc-utils/editor-use-only.js +2 -2
  6. package/dist/cjs/i18n/cs.js +1 -0
  7. package/dist/cjs/i18n/da.js +3 -2
  8. package/dist/cjs/i18n/de.js +3 -2
  9. package/dist/cjs/i18n/en.js +1 -0
  10. package/dist/cjs/i18n/en_GB.js +1 -0
  11. package/dist/cjs/i18n/en_ZZ.js +1 -0
  12. package/dist/cjs/i18n/es.js +2 -1
  13. package/dist/cjs/i18n/fi.js +2 -1
  14. package/dist/cjs/i18n/fr.js +1 -0
  15. package/dist/cjs/i18n/hu.js +1 -0
  16. package/dist/cjs/i18n/it.js +1 -0
  17. package/dist/cjs/i18n/ja.js +2 -1
  18. package/dist/cjs/i18n/ko.js +2 -1
  19. package/dist/cjs/i18n/nb.js +1 -0
  20. package/dist/cjs/i18n/nl.js +1 -0
  21. package/dist/cjs/i18n/pl.js +1 -0
  22. package/dist/cjs/i18n/pt_BR.js +1 -0
  23. package/dist/cjs/i18n/ru.js +1 -0
  24. package/dist/cjs/i18n/sv.js +1 -0
  25. package/dist/cjs/i18n/th.js +1 -0
  26. package/dist/cjs/i18n/tr.js +1 -0
  27. package/dist/cjs/i18n/uk.js +7 -6
  28. package/dist/cjs/i18n/vi.js +1 -0
  29. package/dist/cjs/i18n/zh.js +3 -2
  30. package/dist/cjs/i18n/zh_TW.js +1 -0
  31. package/dist/cjs/lists/node.js +8 -8
  32. package/dist/cjs/lists/replace-content.js +8 -8
  33. package/dist/cjs/mark/commands.js +64 -15
  34. package/dist/cjs/mark/index.js +6 -0
  35. package/dist/cjs/media-inline/styles.js +2 -2
  36. package/dist/cjs/messages/card.js +20 -0
  37. package/dist/cjs/monitoring/error.js +1 -1
  38. package/dist/cjs/selection/gap-cursor/styles.js +1 -1
  39. package/dist/cjs/styles/shared/annotation.js +1 -1
  40. package/dist/cjs/styles/shared/block-marks.js +1 -1
  41. package/dist/cjs/styles/shared/code-block.js +2 -2
  42. package/dist/cjs/styles/shared/lists.js +1 -1
  43. package/dist/cjs/styles/shared/panel.js +1 -1
  44. package/dist/cjs/styles/shared/resizer.js +1 -1
  45. package/dist/cjs/styles/shared/smartCard.js +1 -1
  46. package/dist/cjs/styles/shared/table.js +1 -1
  47. package/dist/cjs/styles/shared/task-decision.js +1 -1
  48. package/dist/cjs/styles/shared/unsupported-content.js +1 -1
  49. package/dist/cjs/table/SortingIcon.js +2 -2
  50. package/dist/cjs/ui/DropList/index.js +1 -1
  51. package/dist/cjs/ui/Expand/index.js +1 -1
  52. package/dist/cjs/ui/FloatingToolbar/styles.js +4 -4
  53. package/dist/cjs/ui/MediaSingle/styled.js +5 -5
  54. package/dist/cjs/ui/ResizerLegacy/styled.js +1 -1
  55. package/dist/cjs/ui-menu/DropdownMenu/index.js +2 -2
  56. package/dist/cjs/utils/calculate-toolbar-position.js +8 -8
  57. package/dist/cjs/utils/compareNodes.js +7 -7
  58. package/dist/cjs/utils/dedupe.js +10 -10
  59. package/dist/es2019/clipboard/index.js +4 -4
  60. package/dist/es2019/collab/index.js +29 -29
  61. package/dist/es2019/doc-utils/editor-use-only.js +2 -2
  62. package/dist/es2019/i18n/cs.js +1 -0
  63. package/dist/es2019/i18n/da.js +3 -2
  64. package/dist/es2019/i18n/de.js +3 -2
  65. package/dist/es2019/i18n/en.js +1 -0
  66. package/dist/es2019/i18n/en_GB.js +1 -0
  67. package/dist/es2019/i18n/en_ZZ.js +1 -0
  68. package/dist/es2019/i18n/es.js +2 -1
  69. package/dist/es2019/i18n/fi.js +2 -1
  70. package/dist/es2019/i18n/fr.js +1 -0
  71. package/dist/es2019/i18n/hu.js +1 -0
  72. package/dist/es2019/i18n/it.js +1 -0
  73. package/dist/es2019/i18n/ja.js +2 -1
  74. package/dist/es2019/i18n/ko.js +2 -1
  75. package/dist/es2019/i18n/nb.js +1 -0
  76. package/dist/es2019/i18n/nl.js +1 -0
  77. package/dist/es2019/i18n/pl.js +1 -0
  78. package/dist/es2019/i18n/pt_BR.js +1 -0
  79. package/dist/es2019/i18n/ru.js +1 -0
  80. package/dist/es2019/i18n/sv.js +1 -0
  81. package/dist/es2019/i18n/th.js +1 -0
  82. package/dist/es2019/i18n/tr.js +1 -0
  83. package/dist/es2019/i18n/uk.js +7 -6
  84. package/dist/es2019/i18n/vi.js +1 -0
  85. package/dist/es2019/i18n/zh.js +3 -2
  86. package/dist/es2019/i18n/zh_TW.js +1 -0
  87. package/dist/es2019/lists/node.js +8 -8
  88. package/dist/es2019/lists/replace-content.js +8 -8
  89. package/dist/es2019/mark/commands.js +54 -1
  90. package/dist/es2019/mark/index.js +1 -1
  91. package/dist/es2019/media-inline/styles.js +28 -28
  92. package/dist/es2019/messages/card.js +20 -0
  93. package/dist/es2019/monitoring/error.js +1 -1
  94. package/dist/es2019/selection/gap-cursor/styles.js +80 -80
  95. package/dist/es2019/styles/shared/annotation.js +12 -12
  96. package/dist/es2019/styles/shared/block-marks.js +16 -16
  97. package/dist/es2019/styles/shared/code-block.js +101 -89
  98. package/dist/es2019/styles/shared/lists.js +83 -86
  99. package/dist/es2019/styles/shared/panel.js +78 -78
  100. package/dist/es2019/styles/shared/resizer.js +180 -178
  101. package/dist/es2019/styles/shared/smartCard.js +92 -102
  102. package/dist/es2019/styles/shared/table.js +125 -127
  103. package/dist/es2019/styles/shared/task-decision.js +46 -46
  104. package/dist/es2019/styles/shared/unsupported-content.js +15 -15
  105. package/dist/es2019/table/SortingIcon.js +34 -34
  106. package/dist/es2019/ui/DropList/index.js +1 -1
  107. package/dist/es2019/ui/Expand/index.js +14 -14
  108. package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
  109. package/dist/es2019/ui/MediaSingle/styled.js +55 -55
  110. package/dist/es2019/ui/ResizerLegacy/styled.js +10 -10
  111. package/dist/es2019/ui-menu/DropdownMenu/index.js +30 -30
  112. package/dist/es2019/utils/calculate-toolbar-position.js +8 -8
  113. package/dist/es2019/utils/compareNodes.js +7 -7
  114. package/dist/es2019/utils/dedupe.js +10 -10
  115. package/dist/esm/clipboard/index.js +4 -4
  116. package/dist/esm/collab/index.js +1 -1
  117. package/dist/esm/doc-utils/editor-use-only.js +2 -2
  118. package/dist/esm/i18n/cs.js +1 -0
  119. package/dist/esm/i18n/da.js +3 -2
  120. package/dist/esm/i18n/de.js +3 -2
  121. package/dist/esm/i18n/en.js +1 -0
  122. package/dist/esm/i18n/en_GB.js +1 -0
  123. package/dist/esm/i18n/en_ZZ.js +1 -0
  124. package/dist/esm/i18n/es.js +2 -1
  125. package/dist/esm/i18n/fi.js +2 -1
  126. package/dist/esm/i18n/fr.js +1 -0
  127. package/dist/esm/i18n/hu.js +1 -0
  128. package/dist/esm/i18n/it.js +1 -0
  129. package/dist/esm/i18n/ja.js +2 -1
  130. package/dist/esm/i18n/ko.js +2 -1
  131. package/dist/esm/i18n/nb.js +1 -0
  132. package/dist/esm/i18n/nl.js +1 -0
  133. package/dist/esm/i18n/pl.js +1 -0
  134. package/dist/esm/i18n/pt_BR.js +1 -0
  135. package/dist/esm/i18n/ru.js +1 -0
  136. package/dist/esm/i18n/sv.js +1 -0
  137. package/dist/esm/i18n/th.js +1 -0
  138. package/dist/esm/i18n/tr.js +1 -0
  139. package/dist/esm/i18n/uk.js +7 -6
  140. package/dist/esm/i18n/vi.js +1 -0
  141. package/dist/esm/i18n/zh.js +3 -2
  142. package/dist/esm/i18n/zh_TW.js +1 -0
  143. package/dist/esm/lists/node.js +8 -8
  144. package/dist/esm/lists/replace-content.js +8 -8
  145. package/dist/esm/mark/commands.js +61 -14
  146. package/dist/esm/mark/index.js +1 -1
  147. package/dist/esm/media-inline/styles.js +2 -2
  148. package/dist/esm/messages/card.js +20 -0
  149. package/dist/esm/monitoring/error.js +1 -1
  150. package/dist/esm/selection/gap-cursor/styles.js +1 -1
  151. package/dist/esm/styles/shared/annotation.js +1 -1
  152. package/dist/esm/styles/shared/block-marks.js +1 -1
  153. package/dist/esm/styles/shared/code-block.js +2 -2
  154. package/dist/esm/styles/shared/lists.js +1 -1
  155. package/dist/esm/styles/shared/panel.js +1 -1
  156. package/dist/esm/styles/shared/resizer.js +1 -1
  157. package/dist/esm/styles/shared/smartCard.js +1 -1
  158. package/dist/esm/styles/shared/table.js +1 -1
  159. package/dist/esm/styles/shared/task-decision.js +1 -1
  160. package/dist/esm/styles/shared/unsupported-content.js +1 -1
  161. package/dist/esm/table/SortingIcon.js +2 -2
  162. package/dist/esm/ui/DropList/index.js +1 -1
  163. package/dist/esm/ui/Expand/index.js +1 -1
  164. package/dist/esm/ui/FloatingToolbar/styles.js +4 -4
  165. package/dist/esm/ui/MediaSingle/styled.js +5 -5
  166. package/dist/esm/ui/ResizerLegacy/styled.js +1 -1
  167. package/dist/esm/ui-menu/DropdownMenu/index.js +2 -2
  168. package/dist/esm/utils/calculate-toolbar-position.js +8 -8
  169. package/dist/esm/utils/compareNodes.js +7 -7
  170. package/dist/esm/utils/dedupe.js +10 -10
  171. package/dist/types/analytics/index.d.ts +1 -1
  172. package/dist/types/analytics/types/index.d.ts +3 -3
  173. package/dist/types/card/LinkToolbarButtonGroup.d.ts +1 -1
  174. package/dist/types/card/index.d.ts +1 -1
  175. package/dist/types/element-browser/ViewMore.d.ts +1 -1
  176. package/dist/types/element-browser/components/ElementList/EmptyState.d.ts +1 -1
  177. package/dist/types/extensibility/index.d.ts +1 -1
  178. package/dist/types/extensions/index.d.ts +1 -1
  179. package/dist/types/extensions/types/index.d.ts +2 -2
  180. package/dist/types/guideline/index.d.ts +3 -3
  181. package/dist/types/i18n/cs.d.ts +1 -0
  182. package/dist/types/i18n/da.d.ts +1 -0
  183. package/dist/types/i18n/de.d.ts +1 -0
  184. package/dist/types/i18n/en.d.ts +1 -0
  185. package/dist/types/i18n/en_GB.d.ts +1 -0
  186. package/dist/types/i18n/en_ZZ.d.ts +1 -0
  187. package/dist/types/i18n/es.d.ts +1 -0
  188. package/dist/types/i18n/fi.d.ts +1 -0
  189. package/dist/types/i18n/fr.d.ts +1 -0
  190. package/dist/types/i18n/hu.d.ts +1 -0
  191. package/dist/types/i18n/it.d.ts +1 -0
  192. package/dist/types/i18n/ja.d.ts +1 -0
  193. package/dist/types/i18n/ko.d.ts +1 -0
  194. package/dist/types/i18n/nb.d.ts +1 -0
  195. package/dist/types/i18n/nl.d.ts +1 -0
  196. package/dist/types/i18n/pl.d.ts +1 -0
  197. package/dist/types/i18n/pt_BR.d.ts +1 -0
  198. package/dist/types/i18n/ru.d.ts +1 -0
  199. package/dist/types/i18n/sv.d.ts +1 -0
  200. package/dist/types/i18n/th.d.ts +1 -0
  201. package/dist/types/i18n/tr.d.ts +1 -0
  202. package/dist/types/i18n/uk.d.ts +1 -0
  203. package/dist/types/i18n/vi.d.ts +1 -0
  204. package/dist/types/i18n/zh.d.ts +1 -0
  205. package/dist/types/i18n/zh_TW.d.ts +1 -0
  206. package/dist/types/link/index.d.ts +3 -3
  207. package/dist/types/lists/index.d.ts +3 -3
  208. package/dist/types/lists/replace-content.d.ts +1 -1
  209. package/dist/types/mark/commands.d.ts +5 -0
  210. package/dist/types/mark/index.d.ts +2 -2
  211. package/dist/types/media-inline/index.d.ts +1 -1
  212. package/dist/types/media-inline/views/frame.d.ts +1 -1
  213. package/dist/types/messages/card.d.ts +20 -0
  214. package/dist/types/portal/index.d.ts +1 -1
  215. package/dist/types/preset/index.d.ts +1 -1
  216. package/dist/types/preset/plugin-injection-api.d.ts +1 -1
  217. package/dist/types/provider-factory/quick-insert-provider.d.ts +1 -1
  218. package/dist/types/provider-factory.d.ts +2 -2
  219. package/dist/types/react-node-view/index.d.ts +1 -1
  220. package/dist/types/selection/index.d.ts +2 -2
  221. package/dist/types/styles/index.d.ts +4 -4
  222. package/dist/types/types/feature-flags.d.ts +6 -6
  223. package/dist/types/types/index.d.ts +12 -12
  224. package/dist/types/types/next-editor-plugin.d.ts +2 -8
  225. package/dist/types/types/performance-tracking.d.ts +4 -4
  226. package/dist/types/ufo/index.d.ts +1 -1
  227. package/dist/types/ui/BaseTheme/index.d.ts +1 -1
  228. package/dist/types/ui/FloatingToolbar/styles.d.ts +4 -4
  229. package/dist/types/ui/MediaSingle/styled.d.ts +1 -1
  230. package/dist/types/ui/index.d.ts +4 -4
  231. package/dist/types/ui-color/index.d.ts +1 -1
  232. package/dist/types/utils/get-performance-options.d.ts +1 -1
  233. package/dist/types/utils/index.d.ts +6 -6
  234. package/dist/types/validator.d.ts +1 -1
  235. package/dist/types-ts4.5/analytics/index.d.ts +1 -1
  236. package/dist/types-ts4.5/analytics/types/index.d.ts +3 -3
  237. package/dist/types-ts4.5/card/LinkToolbarButtonGroup.d.ts +1 -1
  238. package/dist/types-ts4.5/card/index.d.ts +1 -1
  239. package/dist/types-ts4.5/element-browser/ViewMore.d.ts +1 -1
  240. package/dist/types-ts4.5/element-browser/components/ElementList/EmptyState.d.ts +1 -1
  241. package/dist/types-ts4.5/extensibility/index.d.ts +1 -1
  242. package/dist/types-ts4.5/extensions/index.d.ts +1 -1
  243. package/dist/types-ts4.5/extensions/types/index.d.ts +2 -2
  244. package/dist/types-ts4.5/guideline/index.d.ts +3 -3
  245. package/dist/types-ts4.5/i18n/cs.d.ts +1 -0
  246. package/dist/types-ts4.5/i18n/da.d.ts +1 -0
  247. package/dist/types-ts4.5/i18n/de.d.ts +1 -0
  248. package/dist/types-ts4.5/i18n/en.d.ts +1 -0
  249. package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
  250. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
  251. package/dist/types-ts4.5/i18n/es.d.ts +1 -0
  252. package/dist/types-ts4.5/i18n/fi.d.ts +1 -0
  253. package/dist/types-ts4.5/i18n/fr.d.ts +1 -0
  254. package/dist/types-ts4.5/i18n/hu.d.ts +1 -0
  255. package/dist/types-ts4.5/i18n/it.d.ts +1 -0
  256. package/dist/types-ts4.5/i18n/ja.d.ts +1 -0
  257. package/dist/types-ts4.5/i18n/ko.d.ts +1 -0
  258. package/dist/types-ts4.5/i18n/nb.d.ts +1 -0
  259. package/dist/types-ts4.5/i18n/nl.d.ts +1 -0
  260. package/dist/types-ts4.5/i18n/pl.d.ts +1 -0
  261. package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -0
  262. package/dist/types-ts4.5/i18n/ru.d.ts +1 -0
  263. package/dist/types-ts4.5/i18n/sv.d.ts +1 -0
  264. package/dist/types-ts4.5/i18n/th.d.ts +1 -0
  265. package/dist/types-ts4.5/i18n/tr.d.ts +1 -0
  266. package/dist/types-ts4.5/i18n/uk.d.ts +1 -0
  267. package/dist/types-ts4.5/i18n/vi.d.ts +1 -0
  268. package/dist/types-ts4.5/i18n/zh.d.ts +1 -0
  269. package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -0
  270. package/dist/types-ts4.5/link/index.d.ts +3 -3
  271. package/dist/types-ts4.5/lists/index.d.ts +3 -3
  272. package/dist/types-ts4.5/lists/replace-content.d.ts +1 -1
  273. package/dist/types-ts4.5/mark/commands.d.ts +5 -0
  274. package/dist/types-ts4.5/mark/index.d.ts +2 -2
  275. package/dist/types-ts4.5/media-inline/index.d.ts +1 -1
  276. package/dist/types-ts4.5/media-inline/views/frame.d.ts +1 -1
  277. package/dist/types-ts4.5/messages/card.d.ts +20 -0
  278. package/dist/types-ts4.5/portal/index.d.ts +1 -1
  279. package/dist/types-ts4.5/preset/index.d.ts +1 -1
  280. package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +1 -1
  281. package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +1 -1
  282. package/dist/types-ts4.5/provider-factory.d.ts +2 -2
  283. package/dist/types-ts4.5/react-node-view/index.d.ts +1 -1
  284. package/dist/types-ts4.5/selection/index.d.ts +2 -2
  285. package/dist/types-ts4.5/styles/index.d.ts +4 -4
  286. package/dist/types-ts4.5/types/feature-flags.d.ts +6 -6
  287. package/dist/types-ts4.5/types/index.d.ts +12 -12
  288. package/dist/types-ts4.5/types/performance-tracking.d.ts +4 -4
  289. package/dist/types-ts4.5/ufo/index.d.ts +1 -1
  290. package/dist/types-ts4.5/ui/BaseTheme/index.d.ts +1 -1
  291. package/dist/types-ts4.5/ui/FloatingToolbar/styles.d.ts +4 -4
  292. package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +1 -1
  293. package/dist/types-ts4.5/ui/index.d.ts +4 -4
  294. package/dist/types-ts4.5/ui-color/index.d.ts +1 -1
  295. package/dist/types-ts4.5/utils/get-performance-options.d.ts +1 -1
  296. package/dist/types-ts4.5/utils/index.d.ts +6 -6
  297. package/dist/types-ts4.5/validator.d.ts +1 -1
  298. package/package.json +7 -6
  299. package/report.api.md +6 -5
@@ -321,6 +321,7 @@ export default {
321
321
  'fabric.editor.pageActionsLabel': '頁面動作',
322
322
  'fabric.editor.panel.backgroundColor': '背景顏色',
323
323
  'fabric.editor.panel.emoji': '新增表情符號',
324
+ 'fabric.editor.panel.panelsGroup': '面板類型',
324
325
  'fabric.editor.pasteOptions': '貼上選項',
325
326
  'fabric.editor.pastePlainText': '貼上純文字',
326
327
  'fabric.editor.placeholderAltText': '使用替代文字描述這張圖片',
@@ -139,10 +139,10 @@ const findGrandParentResolvedPos = (tr, $from) => {
139
139
  };
140
140
  const findNestedTaskListsIndexAtSameLevel = (tr, $from) => {
141
141
  /*
142
- Currently our cursor would be inside a pargraph of a list of type numbered/bullet list,
143
- we need to find the grandparent of the cursor which is the list at same level of taskList.
144
- We can get the root list item(inside which various lists are being resolved before outdenting) by going one depth above that list.
145
- */
142
+ Currently our cursor would be inside a pargraph of a list of type numbered/bullet list,
143
+ we need to find the grandparent of the cursor which is the list at same level of taskList.
144
+ We can get the root list item(inside which various lists are being resolved before outdenting) by going one depth above that list.
145
+ */
146
146
  const nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
147
147
  const rootListItem = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.node(nestedListResolvedPos.depth - 1);
148
148
  const nestedTaskListsIndexes = [];
@@ -170,10 +170,10 @@ export const processNestedTaskListsInSameLevel = tr => {
170
170
  const nestedTaskListIndexesToWrap = nestedTaskListIndexes.filter(index => index > 1);
171
171
 
172
172
  /*
173
- Wraps the taskLists present at each index mentioned in the nestedTaskListIndexesToWrap to the list above it.
174
- After each wrap the indexes changes since two lists are being merged into one,
175
- so we keep track of it and use it to access actual calculated taskList indexes.
176
- */
173
+ Wraps the taskLists present at each index mentioned in the nestedTaskListIndexesToWrap to the list above it.
174
+ After each wrap the indexes changes since two lists are being merged into one,
175
+ so we keep track of it and use it to access actual calculated taskList indexes.
176
+ */
177
177
  if (rootListItemStart) {
178
178
  let taskListsFixedNested = 0;
179
179
  nestedTaskListIndexesToWrap.forEach(index => {
@@ -29,14 +29,14 @@ export const wrapTaskListIntoListAbove = (tr, taskListStart, previousListStart)
29
29
  const frag = Fragment.from(taskList.content);
30
30
 
31
31
  /*
32
- Delete the existing taskList at the same level and insert inside above list provided
33
- 1. To delete the tasklist, we need wrapping positions before and after it to completely delete it.
34
- $taskListStart.after() would give us closing position enclosed by node itself using it would remove only the contents of taskList
35
- so we add 1 to it to get the position after the taskList node and completly remove it.
36
- 2. Inserting the taskList at the end() position safe inserts the taskList to next available position which would lead to deleting and inserting taskList at same place.
37
- Reason: $previousListStart.end() gives us end position of listItem but we can add content only inside listItem not at same level
38
- so we subtract 1 to get the position inside the list item and insert the TaskList same level as paragraph/content inside listItem.
39
- */
32
+ Delete the existing taskList at the same level and insert inside above list provided
33
+ 1. To delete the tasklist, we need wrapping positions before and after it to completely delete it.
34
+ $taskListStart.after() would give us closing position enclosed by node itself using it would remove only the contents of taskList
35
+ so we add 1 to it to get the position after the taskList node and completly remove it.
36
+ 2. Inserting the taskList at the end() position safe inserts the taskList to next available position which would lead to deleting and inserting taskList at same place.
37
+ Reason: $previousListStart.end() gives us end position of listItem but we can add content only inside listItem not at same level
38
+ so we subtract 1 to get the position inside the list item and insert the TaskList same level as paragraph/content inside listItem.
39
+ */
40
40
  tr.delete($taskListStart.before(), $taskListStart.after() + 1);
41
41
  tr.insert($previousListStart.end() - 1, frag);
42
42
  };
@@ -61,6 +61,59 @@ export function filterChildrenBetween(doc, from, to, predicate) {
61
61
  });
62
62
  return results;
63
63
  }
64
+ export function transformNonTextNodesToText(from, to, tr) {
65
+ const {
66
+ doc
67
+ } = tr;
68
+ const {
69
+ schema
70
+ } = doc.type;
71
+ const {
72
+ mention: mentionNodeType,
73
+ text: textNodeType,
74
+ emoji: emojiNodeType,
75
+ inlineCard: inlineCardNodeType
76
+ } = schema.nodes;
77
+ const nodesToChange = [];
78
+ doc.nodesBetween(from, to, (node, pos, parent) => {
79
+ if ([mentionNodeType, textNodeType, emojiNodeType, inlineCardNodeType].includes(node.type)) {
80
+ nodesToChange.push({
81
+ node,
82
+ pos
83
+ });
84
+ }
85
+ });
86
+ nodesToChange.forEach(({
87
+ node,
88
+ pos
89
+ }) => {
90
+ if (node.type !== textNodeType) {
91
+ const newText = node.attrs.url ||
92
+ // url for inlineCard
93
+ node.attrs.text || `${node.type.name} text missing`; // fallback for missing text
94
+
95
+ const currentPos = tr.mapping.map(pos);
96
+ tr.replaceWith(currentPos, currentPos + node.nodeSize, schema.text(newText, node.marks));
97
+ } else if (node.text) {
98
+ // Find a valid start and end position because the text may be partially selected.
99
+ const startPositionInSelection = Math.max(pos, from);
100
+ const endPositionInSelection = Math.min(pos + node.nodeSize, to);
101
+ const textForReplacing = doc.textBetween(startPositionInSelection, endPositionInSelection);
102
+ const newText = textForReplacing.replace(FIND_SMART_CHAR, match => {
103
+ var _SMART_TO_ASCII$match;
104
+ return (_SMART_TO_ASCII$match = SMART_TO_ASCII[match]) !== null && _SMART_TO_ASCII$match !== void 0 ? _SMART_TO_ASCII$match : match;
105
+ });
106
+ const currentStartPos = tr.mapping.map(startPositionInSelection);
107
+ const currentEndPos = tr.mapping.map(endPositionInSelection);
108
+ tr.replaceWith(currentStartPos, currentEndPos, schema.text(newText, node.marks));
109
+ }
110
+ });
111
+ }
112
+
113
+ /**
114
+ * @private
115
+ * @deprecated Use {@link transformNonTextNodesToText} instead.
116
+ */
64
117
  export const transformSmartCharsMentionsAndEmojis = (from, to, tr) => {
65
118
  const {
66
119
  schema
@@ -101,7 +154,7 @@ export const applyMarkOnRange = (from, to, removeMark, mark, tr) => {
101
154
  inlineCard
102
155
  } = schema.nodes;
103
156
  if (mark.type === code) {
104
- transformSmartCharsMentionsAndEmojis(from, to, tr);
157
+ getBooleanFF('platform.editor.simplify-inline-cards-in-code-blocks_jw6t1') ? transformNonTextNodesToText(from, to, tr) : transformSmartCharsMentionsAndEmojis(from, to, tr);
105
158
  }
106
159
  tr.doc.nodesBetween(tr.mapping.map(from), tr.mapping.map(to), (node, pos) => {
107
160
  if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, transformNonTextNodesToText, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
@@ -9,15 +9,15 @@ export const INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = '--editor-media-inline-imag
9
9
  // We implemented such selectors to ensure specificity:
10
10
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Nested and dynamic css calls are violations, needs manual remediation
11
11
  const inlineImageHeight = (height, margin = 0) => css`
12
- /* Editor style */
13
- > .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
12
+ /* Editor style */
13
+ > .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
14
14
  > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
15
15
  /* Renderer style */
16
16
  > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
17
17
  > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
18
- height: ${height}px;
19
- transform: translateY(${margin}px);
20
- }
18
+ height: ${height}px;
19
+ transform: translateY(${margin}px);
20
+ }
21
21
  `;
22
22
 
23
23
  /**
@@ -28,35 +28,35 @@ const inlineImageHeight = (height, margin = 0) => css`
28
28
  */
29
29
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Nested and dynamic css calls are violations, needs manual remediation
30
30
  export const mediaInlineImageStyles = css`
31
- // p, h3, and action items
32
- .${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
33
- height: ${referenceHeights['p']}px;
34
- transform: translateY(-2px);
35
- }
31
+ // p, h3, and action items
32
+ .${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
33
+ height: ${referenceHeights['p']}px;
34
+ transform: translateY(-2px);
35
+ }
36
36
 
37
- h1 {
38
- ${inlineImageHeight(referenceHeights['h1'], -3)}
39
- }
37
+ h1 {
38
+ ${inlineImageHeight(referenceHeights['h1'], -3)}
39
+ }
40
40
 
41
- h2 {
42
- ${inlineImageHeight(referenceHeights['h2'], -3)}
43
- }
41
+ h2 {
42
+ ${inlineImageHeight(referenceHeights['h2'], -3)}
43
+ }
44
44
 
45
- h3 {
46
- ${inlineImageHeight(referenceHeights['h3'], -2)}
47
- }
45
+ h3 {
46
+ ${inlineImageHeight(referenceHeights['h3'], -2)}
47
+ }
48
48
 
49
- h4 {
50
- ${inlineImageHeight(referenceHeights['h4'], -2)}
51
- }
49
+ h4 {
50
+ ${inlineImageHeight(referenceHeights['h4'], -2)}
51
+ }
52
52
 
53
- h5 {
54
- ${inlineImageHeight(referenceHeights['h5'], -2)}
55
- }
53
+ h5 {
54
+ ${inlineImageHeight(referenceHeights['h5'], -2)}
55
+ }
56
56
 
57
- h6 {
58
- ${inlineImageHeight(referenceHeights['h6'], -2)}
59
- }
57
+ h6 {
58
+ ${inlineImageHeight(referenceHeights['h6'], -2)}
59
+ }
60
60
  `;
61
61
  export const wrapperStyle = css({
62
62
  display: 'inline-flex',
@@ -80,6 +80,26 @@ export const messages = defineMessages({
80
80
  defaultMessage: 'Display an interactive preview of a link',
81
81
  description: 'Description for option to display link as an embedded object.'
82
82
  },
83
+ editDropdownExpandIconLabel: {
84
+ id: 'fabric.editor.editDropdownExpandIconLabel',
85
+ defaultMessage: 'Expand dropdown menu',
86
+ description: 'Text of an icon to expand the dropdown'
87
+ },
88
+ editDropdownTriggerTitle: {
89
+ id: 'fabric.editor.editDropdownTriggerTitle',
90
+ defaultMessage: 'Edit',
91
+ description: 'Text of a button to trigger opening an edit dropdown'
92
+ },
93
+ editDropdownEditLinkTitle: {
94
+ id: 'fabric.editor.editDropdownEditLinkTitle',
95
+ defaultMessage: 'Edit link',
96
+ description: 'Edit dropdown edit link button text'
97
+ },
98
+ editDropdownEditDatasourceTitle: {
99
+ id: 'fabric.editor.editDropdownEditDatasourceTitle',
100
+ defaultMessage: 'Edit search query',
101
+ description: 'Edit dropdown edit datasource button text'
102
+ },
83
103
  datasourceTitle: {
84
104
  id: 'fabric.editor.datasourceTitle',
85
105
  defaultMessage: 'Edit search query',
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "81.1.5";
3
+ const packageVersion = "81.2.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -15,70 +15,70 @@ const wrapRight = '[layout="wrap-right"]';
15
15
 
16
16
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- This needs manual remediation, it autofixes seemingly safely, but the code style and readability is destroyed.
17
17
  export const gapCursorStyles = css`
18
- /* =============== GAP CURSOR ================== */
19
- .ProseMirror {
20
- &.${hideCaretModifier} {
21
- caret-color: transparent;
22
- }
18
+ /* =============== GAP CURSOR ================== */
19
+ .ProseMirror {
20
+ &.${hideCaretModifier} {
21
+ caret-color: transparent;
22
+ }
23
23
 
24
- ${gapCursor} {
25
- display: none;
26
- pointer-events: none;
27
- position: relative;
24
+ ${gapCursor} {
25
+ display: none;
26
+ pointer-events: none;
27
+ position: relative;
28
28
 
29
- & span {
30
- caret-color: transparent;
31
- position: absolute;
32
- height: 100%;
33
- width: 100%;
34
- display: block;
35
- }
29
+ & span {
30
+ caret-color: transparent;
31
+ position: absolute;
32
+ height: 100%;
33
+ width: 100%;
34
+ display: block;
35
+ }
36
36
 
37
- & span::after {
38
- animation: 1s ${gapCursorBlink} step-end infinite;
39
- border-left: 1px solid;
40
- content: '';
41
- display: block;
42
- position: absolute;
43
- top: 0;
44
- height: 100%;
45
- }
46
- &.-left span::after {
47
- left: ${"var(--ds-space-negative-050, -4px)"};
48
- }
49
- &.-right span::after {
50
- right: ${"var(--ds-space-negative-050, -4px)"};
51
- }
52
- & span[layout='full-width'],
53
- & span[layout='wide'],
54
- & span[layout='fixed-width'] {
55
- margin-left: 50%;
56
- transform: translateX(-50%);
57
- }
58
- &${wrapRight} {
59
- float: right;
60
- }
37
+ & span::after {
38
+ animation: 1s ${gapCursorBlink} step-end infinite;
39
+ border-left: 1px solid;
40
+ content: '';
41
+ display: block;
42
+ position: absolute;
43
+ top: 0;
44
+ height: 100%;
45
+ }
46
+ &.-left span::after {
47
+ left: ${"var(--ds-space-negative-050, -4px)"};
48
+ }
49
+ &.-right span::after {
50
+ right: ${"var(--ds-space-negative-050, -4px)"};
51
+ }
52
+ & span[layout='full-width'],
53
+ & span[layout='wide'],
54
+ & span[layout='fixed-width'] {
55
+ margin-left: 50%;
56
+ transform: translateX(-50%);
57
+ }
58
+ &${wrapRight} {
59
+ float: right;
60
+ }
61
61
 
62
- /* fix vertical alignment of gap cursor */
63
- &:first-of-type + ul,
64
- &:first-of-type + span + ul,
65
- &:first-of-type + ol,
66
- &:first-of-type + span + ol,
67
- &:first-of-type + pre,
68
- &:first-of-type + span + pre,
69
- &:first-of-type + blockquote,
70
- &:first-of-type + span + blockquote {
71
- margin-top: 0;
72
- }
73
- }
74
- &.ProseMirror-focused ${gapCursor} {
75
- display: block;
76
- border-color: transparent;
77
- }
78
- }
62
+ /* fix vertical alignment of gap cursor */
63
+ &:first-of-type + ul,
64
+ &:first-of-type + span + ul,
65
+ &:first-of-type + ol,
66
+ &:first-of-type + span + ol,
67
+ &:first-of-type + pre,
68
+ &:first-of-type + span + pre,
69
+ &:first-of-type + blockquote,
70
+ &:first-of-type + span + blockquote {
71
+ margin-top: 0;
72
+ }
73
+ }
74
+ &.ProseMirror-focused ${gapCursor} {
75
+ display: block;
76
+ border-color: transparent;
77
+ }
78
+ }
79
79
 
80
- /* This hack below is for two images aligned side by side */
81
- ${gapCursor}${wrapLeft} + span + ${wrapLeft},
80
+ /* This hack below is for two images aligned side by side */
81
+ ${gapCursor}${wrapLeft} + span + ${wrapLeft},
82
82
  ${gapCursor}${wrapRight} + span + ${wrapRight},
83
83
  ${gapCursor} + ${wrapLeft} + ${wrapRight},
84
84
  ${gapCursor} + ${wrapLeft} + span + ${wrapRight},
@@ -89,10 +89,10 @@ export const gapCursorStyles = css`
89
89
  ${wrapRight} + ${gapCursor} + ${wrapLeft},
90
90
  ${wrapRight} + ${gapCursor} + span + ${wrapLeft},
91
91
  ${wrapLeft} + ${gapCursor} {
92
- clear: none;
93
- }
92
+ clear: none;
93
+ }
94
94
 
95
- ${wrapLeft} + ${gapCursor} + ${wrapRight} > div,
95
+ ${wrapLeft} + ${gapCursor} + ${wrapRight} > div,
96
96
  ${wrapLeft} + ${gapCursor} + span + ${wrapRight} > div,
97
97
  ${wrapRight} + ${gapCursor} + ${wrapLeft} > div,
98
98
  ${wrapRight} + ${gapCursor} + span + ${wrapLeft} > div,
@@ -100,31 +100,31 @@ export const gapCursorStyles = css`
100
100
  ${gapCursor} + ${wrapRight} + span + ${wrapLeft} > div,
101
101
  ${gapCursor} + ${wrapLeft} + ${wrapRight} > div,
102
102
  ${gapCursor} + ${wrapLeft} + span + ${wrapRight} > div {
103
- margin-right: 0;
104
- margin-left: 0;
105
- margin-bottom: 0;
106
- }
103
+ margin-right: 0;
104
+ margin-left: 0;
105
+ margin-bottom: 0;
106
+ }
107
107
 
108
- ${wrapLeft} + ${gapCursor},
108
+ ${wrapLeft} + ${gapCursor},
109
109
  ${wrapRight} + ${gapCursor} {
110
- float: left;
111
- }
110
+ float: left;
111
+ }
112
112
 
113
- ${gapCursor} + ${wrapLeft} + span + ${wrapRight}::after,
113
+ ${gapCursor} + ${wrapLeft} + span + ${wrapRight}::after,
114
114
  ${gapCursor} + ${wrapRight} + span + ${wrapLeft}::after,
115
115
  ${wrapLeft} + ${gapCursor} + ${wrapRight}::after,
116
116
  ${wrapLeft} + ${gapCursor} + span + ${wrapRight}::after,
117
117
  ${wrapRight} + ${gapCursor} + ${wrapLeft}::after,
118
118
  ${wrapRight} + ${gapCursor} + span + ${wrapLeft}::after {
119
- visibility: hidden;
120
- display: block;
121
- font-size: 0;
122
- content: ' ';
123
- clear: both;
124
- height: 0;
125
- }
119
+ visibility: hidden;
120
+ display: block;
121
+ font-size: 0;
122
+ content: ' ';
123
+ clear: both;
124
+ height: 0;
125
+ }
126
126
 
127
- ${wrapLeft} + ${gapCursor} + ${wrapRight} + *,
127
+ ${wrapLeft} + ${gapCursor} + ${wrapRight} + *,
128
128
  ${wrapLeft} + ${gapCursor} + ${wrapRight} + span + *,
129
129
  ${wrapRight} + ${gapCursor} + ${wrapLeft} + *,
130
130
  ${wrapRight} + ${gapCursor} + ${wrapLeft} + span + *,
@@ -142,6 +142,6 @@ export const gapCursorStyles = css`
142
142
  ${gapCursor} + ${wrapRight} + span + ${wrapLeft} + * > *,
143
143
  ${prosemirrorwidget} + ${gapCursor} + *,
144
144
  ${prosemirrorwidget} + ${gapCursor} + span + * {
145
- margin-top: 0;
146
- }
145
+ margin-top: 0;
146
+ }
147
147
  `;
@@ -60,18 +60,18 @@ export const AnnotationSharedCSSByState = () => getBooleanFF('platform.editor.al
60
60
 
61
61
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState()` is not safe in object syntax
62
62
  export const annotationSharedStyles = () => css`
63
- .ProseMirror {
64
- .${AnnotationSharedClassNames.focus} {
65
- ${AnnotationSharedCSSByState().focus};
66
- }
63
+ .ProseMirror {
64
+ .${AnnotationSharedClassNames.focus} {
65
+ ${AnnotationSharedCSSByState().focus};
66
+ }
67
67
 
68
- .${AnnotationSharedClassNames.draft} {
69
- ${AnnotationSharedCSSByState().focus};
70
- cursor: initial;
71
- }
68
+ .${AnnotationSharedClassNames.draft} {
69
+ ${AnnotationSharedCSSByState().focus};
70
+ cursor: initial;
71
+ }
72
72
 
73
- .${AnnotationSharedClassNames.blur} {
74
- ${AnnotationSharedCSSByState().blur};
75
- }
76
- }
73
+ .${AnnotationSharedClassNames.blur} {
74
+ ${AnnotationSharedCSSByState().blur};
75
+ }
76
+ }
77
77
  `;
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Perfectly safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing */
2
2
  import { css } from '@emotion/react';
3
3
  export const blockMarksSharedStyles = css`
4
- /**
4
+ /**
5
5
  * We need to remove margin-top from first item
6
6
  * inside doc, tableCell, tableHeader, blockquote, etc.
7
7
  */
8
- *:not(.fabric-editor-block-mark) >,
8
+ *:not(.fabric-editor-block-mark) >,
9
9
  /* For nested block marks apart from those with indentation mark */
10
10
  *:not(.fabric-editor-block-mark) >
11
11
  div.fabric-editor-block-mark:first-of-type
@@ -17,18 +17,18 @@ export const blockMarksSharedStyles = css`
17
17
  .fabric-editor-alignment:first-of-type:first-child,
18
18
  // If first document element has indentation mark remove margin-top
19
19
  .ProseMirror .fabric-editor-indentation-mark:first-of-type:first-child {
20
- p,
21
- h1,
22
- h2,
23
- h3,
24
- h4,
25
- h5,
26
- h6,
27
- .heading-wrapper {
28
- :first-child:not(style),
29
- style:first-child + * {
30
- margin-top: 0;
31
- }
32
- }
33
- }
20
+ p,
21
+ h1,
22
+ h2,
23
+ h3,
24
+ h4,
25
+ h5,
26
+ h6,
27
+ .heading-wrapper {
28
+ :first-child:not(style),
29
+ style:first-child + * {
30
+ margin-top: 0;
31
+ }
32
+ }
33
+ }
34
34
  `;