@atlaskit/editor-core 185.2.0 → 185.2.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 (238) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/actions/index.js +2 -2
  3. package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -2
  4. package/dist/cjs/index.js +0 -6
  5. package/dist/cjs/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
  6. package/dist/cjs/messages.js +6 -56
  7. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +2 -2
  8. package/dist/cjs/plugins/base/pm-plugins/scroll-gutter.js +1 -1
  9. package/dist/cjs/plugins/card/nodeviews/blockCard.js +2 -2
  10. package/dist/cjs/plugins/card/nodeviews/embedCard.js +4 -4
  11. package/dist/cjs/plugins/card/pm-plugins/doc.js +9 -11
  12. package/dist/cjs/plugins/card/pm-plugins/keymap.js +3 -6
  13. package/dist/cjs/plugins/card/pm-plugins/main.js +2 -2
  14. package/dist/cjs/plugins/card/toolbar.js +12 -15
  15. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +4 -6
  16. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +7 -10
  17. package/dist/cjs/plugins/card/utils.js +3 -4
  18. package/dist/cjs/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
  19. package/dist/cjs/plugins/custom-autoformat/doc.js +1 -1
  20. package/dist/cjs/plugins/date/pm-plugins/main.js +2 -2
  21. package/dist/cjs/plugins/emoji/index.js +2 -2
  22. package/dist/cjs/plugins/floating-toolbar/index.js +1 -1
  23. package/dist/cjs/plugins/hyperlink/Toolbar.js +8 -8
  24. package/dist/cjs/plugins/hyperlink/commands.js +2 -3
  25. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
  26. package/dist/cjs/plugins/layout/actions.js +1 -1
  27. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -3
  28. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -2
  29. package/dist/cjs/plugins/media/toolbar/index.js +9 -8
  30. package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +4 -3
  31. package/dist/cjs/plugins/media/toolbar/linking.js +3 -3
  32. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +1 -1
  33. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +6 -8
  34. package/dist/cjs/plugins/media/utils/media-files.js +8 -7
  35. package/dist/cjs/plugins/mentions/pm-plugins/main.js +2 -2
  36. package/dist/cjs/plugins/placeholder/index.js +2 -3
  37. package/dist/cjs/plugins/status/plugin.js +2 -2
  38. package/dist/cjs/plugins/unsupported-content/index.js +3 -3
  39. package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +4 -11
  40. package/dist/cjs/utils/document.js +7 -249
  41. package/dist/cjs/utils/index.js +1 -23
  42. package/dist/cjs/version-wrapper.js +1 -1
  43. package/dist/cjs/version.json +1 -1
  44. package/dist/es2019/actions/index.js +2 -1
  45. package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
  46. package/dist/es2019/index.js +1 -1
  47. package/dist/es2019/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
  48. package/dist/es2019/messages.js +2 -54
  49. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  50. package/dist/es2019/plugins/base/pm-plugins/scroll-gutter.js +1 -1
  51. package/dist/es2019/plugins/card/nodeviews/blockCard.js +1 -1
  52. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -1
  53. package/dist/es2019/plugins/card/pm-plugins/doc.js +2 -3
  54. package/dist/es2019/plugins/card/pm-plugins/keymap.js +3 -3
  55. package/dist/es2019/plugins/card/pm-plugins/main.js +1 -1
  56. package/dist/es2019/plugins/card/toolbar.js +7 -9
  57. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +3 -4
  58. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +1 -4
  59. package/dist/es2019/plugins/card/utils.js +1 -2
  60. package/dist/es2019/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
  61. package/dist/es2019/plugins/custom-autoformat/doc.js +1 -1
  62. package/dist/es2019/plugins/date/pm-plugins/main.js +1 -1
  63. package/dist/es2019/plugins/emoji/index.js +1 -1
  64. package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
  65. package/dist/es2019/plugins/hyperlink/Toolbar.js +3 -3
  66. package/dist/es2019/plugins/hyperlink/commands.js +1 -2
  67. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
  68. package/dist/es2019/plugins/layout/actions.js +1 -1
  69. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
  70. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
  71. package/dist/es2019/plugins/media/toolbar/index.js +9 -8
  72. package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
  73. package/dist/es2019/plugins/media/toolbar/linking.js +1 -1
  74. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +1 -1
  75. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
  76. package/dist/es2019/plugins/media/utils/media-files.js +4 -3
  77. package/dist/es2019/plugins/mentions/pm-plugins/main.js +1 -1
  78. package/dist/es2019/plugins/placeholder/index.js +1 -1
  79. package/dist/es2019/plugins/status/plugin.js +1 -1
  80. package/dist/es2019/plugins/unsupported-content/index.js +1 -1
  81. package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -4
  82. package/dist/es2019/utils/document.js +3 -244
  83. package/dist/es2019/utils/index.js +1 -4
  84. package/dist/es2019/version-wrapper.js +1 -1
  85. package/dist/es2019/version.json +1 -1
  86. package/dist/esm/actions/index.js +2 -1
  87. package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
  88. package/dist/esm/index.js +1 -1
  89. package/dist/esm/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
  90. package/dist/esm/messages.js +2 -54
  91. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  92. package/dist/esm/plugins/base/pm-plugins/scroll-gutter.js +1 -1
  93. package/dist/esm/plugins/card/nodeviews/blockCard.js +1 -1
  94. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -1
  95. package/dist/esm/plugins/card/pm-plugins/doc.js +2 -3
  96. package/dist/esm/plugins/card/pm-plugins/keymap.js +3 -3
  97. package/dist/esm/plugins/card/pm-plugins/main.js +1 -1
  98. package/dist/esm/plugins/card/toolbar.js +7 -9
  99. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +3 -4
  100. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +1 -4
  101. package/dist/esm/plugins/card/utils.js +1 -2
  102. package/dist/esm/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
  103. package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
  104. package/dist/esm/plugins/date/pm-plugins/main.js +1 -1
  105. package/dist/esm/plugins/emoji/index.js +1 -1
  106. package/dist/esm/plugins/floating-toolbar/index.js +1 -1
  107. package/dist/esm/plugins/hyperlink/Toolbar.js +3 -3
  108. package/dist/esm/plugins/hyperlink/commands.js +1 -2
  109. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
  110. package/dist/esm/plugins/layout/actions.js +1 -1
  111. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  112. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
  113. package/dist/esm/plugins/media/toolbar/index.js +9 -8
  114. package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
  115. package/dist/esm/plugins/media/toolbar/linking.js +1 -1
  116. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -1
  117. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
  118. package/dist/esm/plugins/media/utils/media-files.js +4 -3
  119. package/dist/esm/plugins/mentions/pm-plugins/main.js +1 -1
  120. package/dist/esm/plugins/placeholder/index.js +1 -1
  121. package/dist/esm/plugins/status/plugin.js +1 -1
  122. package/dist/esm/plugins/unsupported-content/index.js +1 -1
  123. package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -4
  124. package/dist/esm/utils/document.js +6 -240
  125. package/dist/esm/utils/index.js +1 -4
  126. package/dist/esm/version-wrapper.js +1 -1
  127. package/dist/esm/version.json +1 -1
  128. package/dist/types/index.d.ts +1 -2
  129. package/dist/types/labs/next/presets/cxhtml.d.ts +3 -3
  130. package/dist/types/labs/next/presets/default.d.ts +1 -1
  131. package/dist/types/labs/next/presets/mobile.d.ts +3 -3
  132. package/dist/types/messages.d.ts +2 -53
  133. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +1 -1
  134. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +3 -3
  135. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
  136. package/dist/types/plugins/card/toolbar.d.ts +1 -1
  137. package/dist/types/plugins/card/types.d.ts +1 -1
  138. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
  139. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
  140. package/dist/types/plugins/date/nodeviews/date.d.ts +1 -1
  141. package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +1 -1
  142. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  143. package/dist/types/plugins/hyperlink/Toolbar.d.ts +1 -1
  144. package/dist/types/plugins/hyperlink/commands.d.ts +2 -3
  145. package/dist/types/plugins/hyperlink/index.d.ts +1 -1
  146. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
  147. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
  148. package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
  149. package/dist/types/plugins/media/utils/media-files.d.ts +1 -1
  150. package/dist/types/plugins/mentions/nodeviews/mention.d.ts +1 -1
  151. package/dist/types/plugins/status/nodeviews/status.d.ts +1 -1
  152. package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
  153. package/dist/types/types/editor-props.d.ts +1 -1
  154. package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
  155. package/dist/types/utils/document.d.ts +0 -12
  156. package/dist/types/utils/index.d.ts +1 -2
  157. package/dist/types-ts4.5/index.d.ts +1 -2
  158. package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +3 -3
  159. package/dist/types-ts4.5/labs/next/presets/default.d.ts +1 -1
  160. package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +3 -3
  161. package/dist/types-ts4.5/messages.d.ts +2 -53
  162. package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +1 -1
  163. package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +3 -3
  164. package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +1 -1
  165. package/dist/types-ts4.5/plugins/card/toolbar.d.ts +1 -1
  166. package/dist/types-ts4.5/plugins/card/types.d.ts +1 -1
  167. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
  168. package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
  169. package/dist/types-ts4.5/plugins/date/nodeviews/date.d.ts +1 -1
  170. package/dist/types-ts4.5/plugins/emoji/nodeviews/emoji.d.ts +1 -1
  171. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  172. package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +1 -1
  173. package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +2 -3
  174. package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +1 -1
  175. package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
  176. package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
  177. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
  178. package/dist/types-ts4.5/plugins/media/utils/media-files.d.ts +1 -1
  179. package/dist/types-ts4.5/plugins/mentions/nodeviews/mention.d.ts +1 -1
  180. package/dist/types-ts4.5/plugins/status/nodeviews/status.d.ts +1 -1
  181. package/dist/types-ts4.5/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
  182. package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
  183. package/dist/types-ts4.5/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
  184. package/dist/types-ts4.5/utils/document.d.ts +0 -12
  185. package/dist/types-ts4.5/utils/index.d.ts +1 -2
  186. package/package.json +4 -5
  187. package/report.api.md +9 -34
  188. package/tmp/api-report-tmp.d.ts +7 -33
  189. package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +0 -227
  190. package/dist/cjs/plugins/hyperlink/types.js +0 -5
  191. package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +0 -152
  192. package/dist/cjs/ui/Resizer/index.js +0 -210
  193. package/dist/cjs/ui/Resizer/styled.js +0 -15
  194. package/dist/cjs/ui/Resizer/types.js +0 -5
  195. package/dist/cjs/ui/Resizer/utils.js +0 -21
  196. package/dist/cjs/utils/filter/privacy-filter.js +0 -55
  197. package/dist/cjs/utils/linking-utils.js +0 -84
  198. package/dist/cjs/utils/rich-media-utils.js +0 -130
  199. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +0 -221
  200. package/dist/es2019/plugins/hyperlink/types.js +0 -1
  201. package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +0 -159
  202. package/dist/es2019/ui/Resizer/index.js +0 -191
  203. package/dist/es2019/ui/Resizer/styled.js +0 -15
  204. package/dist/es2019/ui/Resizer/types.js +0 -1
  205. package/dist/es2019/ui/Resizer/utils.js +0 -12
  206. package/dist/es2019/utils/filter/privacy-filter.js +0 -47
  207. package/dist/es2019/utils/linking-utils.js +0 -74
  208. package/dist/es2019/utils/rich-media-utils.js +0 -108
  209. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +0 -217
  210. package/dist/esm/plugins/hyperlink/types.js +0 -1
  211. package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +0 -144
  212. package/dist/esm/ui/Resizer/index.js +0 -203
  213. package/dist/esm/ui/Resizer/styled.js +0 -7
  214. package/dist/esm/ui/Resizer/types.js +0 -1
  215. package/dist/esm/ui/Resizer/utils.js +0 -12
  216. package/dist/esm/utils/filter/privacy-filter.js +0 -48
  217. package/dist/esm/utils/linking-utils.js +0 -74
  218. package/dist/esm/utils/rich-media-utils.js +0 -117
  219. package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
  220. package/dist/types/plugins/hyperlink/types.d.ts +0 -35
  221. package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
  222. package/dist/types/ui/Resizer/index.d.ts +0 -41
  223. package/dist/types/ui/Resizer/styled.d.ts +0 -2
  224. package/dist/types/ui/Resizer/types.d.ts +0 -26
  225. package/dist/types/ui/Resizer/utils.d.ts +0 -6
  226. package/dist/types/utils/filter/privacy-filter.d.ts +0 -9
  227. package/dist/types/utils/linking-utils.d.ts +0 -14
  228. package/dist/types/utils/rich-media-utils.d.ts +0 -8
  229. package/dist/types-ts4.5/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
  230. package/dist/types-ts4.5/plugins/hyperlink/types.d.ts +0 -35
  231. package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
  232. package/dist/types-ts4.5/ui/Resizer/index.d.ts +0 -41
  233. package/dist/types-ts4.5/ui/Resizer/styled.d.ts +0 -2
  234. package/dist/types-ts4.5/ui/Resizer/types.d.ts +0 -26
  235. package/dist/types-ts4.5/ui/Resizer/utils.d.ts +0 -6
  236. package/dist/types-ts4.5/utils/filter/privacy-filter.d.ts +0 -9
  237. package/dist/types-ts4.5/utils/linking-utils.d.ts +0 -14
  238. package/dist/types-ts4.5/utils/rich-media-utils.d.ts +0 -8
package/report.api.md CHANGED
@@ -85,6 +85,7 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
85
85
  import { Side as GapCursorSide } from '@atlaskit/editor-common/selection';
86
86
  import { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
87
87
  import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
88
+ import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
88
89
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
89
90
  import { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
90
91
  import { InputTracking } from '@atlaskit/editor-common/types';
@@ -92,7 +93,8 @@ import { IntlShape } from 'react-intl-next';
92
93
  import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
93
94
  import { jsx } from '@emotion/react';
94
95
  import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
95
- import { LinkPickerProps } from '@atlaskit/link-picker';
96
+ import type { LinkingOptions } from '@atlaskit/editor-common/types';
97
+ import type { LinkInputType } from '@atlaskit/editor-common/types';
96
98
  import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
97
99
  import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
98
100
  import { MarkConfig } from '@atlaskit/editor-common/types';
@@ -1226,18 +1228,6 @@ export enum HyperlinkInsertStatus {
1226
1228
  INSERT_LINK_TOOLBAR = 'INSERT',
1227
1229
  }
1228
1230
 
1229
- // @public
1230
- interface HyperlinkPluginOptions {
1231
- // (undocumented)
1232
- cardOptions?: CardOptions;
1233
- // (undocumented)
1234
- editorAppearance?: EditorAppearance;
1235
- // (undocumented)
1236
- linkPicker?: LinkPickerOptions;
1237
- // (undocumented)
1238
- platform?: 'mobile' | 'web';
1239
- }
1240
-
1241
1231
  // @public (undocumented)
1242
1232
  export interface HyperlinkState {
1243
1233
  // (undocumented)
@@ -1347,13 +1337,13 @@ export function insertLink(
1347
1337
  incomingHref: string,
1348
1338
  incomingTitle?: string,
1349
1339
  displayText?: string,
1350
- source?: LinkInputMethod,
1340
+ source?: LinkInputType,
1351
1341
  sourceEvent?: UIAnalyticsEvent | null | undefined,
1352
- ): Command;
1342
+ ): Command_2;
1353
1343
 
1354
1344
  // @public (undocumented)
1355
1345
  export const insertLinkWithAnalytics: (
1356
- inputMethod: LinkInputMethod,
1346
+ inputMethod: LinkInputType,
1357
1347
  from: number,
1358
1348
  to: number,
1359
1349
  href: string,
@@ -1361,11 +1351,11 @@ export const insertLinkWithAnalytics: (
1361
1351
  displayText?: string,
1362
1352
  cardsAvailable?: boolean,
1363
1353
  sourceEvent?: UIAnalyticsEvent | null | undefined,
1364
- ) => Command;
1354
+ ) => Command_2;
1365
1355
 
1366
1356
  // @public (undocumented)
1367
1357
  export const insertLinkWithAnalyticsMobileNative: (
1368
- inputMethod: LinkInputMethod,
1358
+ inputMethod: LinkInputType,
1369
1359
  from: number,
1370
1360
  to: number,
1371
1361
  href: string,
@@ -1413,9 +1403,6 @@ type InviteToEditComponentProps = {
1413
1403
  children: ReactElement<InviteToEditButtonProps>;
1414
1404
  };
1415
1405
 
1416
- // @public
1417
- export function isEmptyDocument(node: Node_2): boolean;
1418
-
1419
1406
  // @public (undocumented)
1420
1407
  export function isLinkAtPos(pos: number): Predicate;
1421
1408
 
@@ -1434,18 +1421,6 @@ interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
1434
1421
 
1435
1422
  export { lightModeStatusColorPalette };
1436
1423
 
1437
- // @public
1438
- interface LinkingOptions {
1439
- linkPicker?: LinkPickerOptions;
1440
- smartLinks?: CardOptions;
1441
- }
1442
-
1443
- // @public (undocumented)
1444
- export type LinkInputMethod = INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD;
1445
-
1446
- // @public
1447
- interface LinkPickerOptions extends Partial<LinkPickerProps> {}
1448
-
1449
1424
  // @public (undocumented)
1450
1425
  type LinkToolbarState = EditInsertedState | EditState | InsertState | undefined;
1451
1426
 
@@ -2674,7 +2649,7 @@ export function updateLink(
2674
2649
  text: string,
2675
2650
  pos: number,
2676
2651
  to?: number,
2677
- ): Command;
2652
+ ): Command_2;
2678
2653
 
2679
2654
  // @public (undocumented)
2680
2655
  export const updateStatus: (status?: StatusType) => Command;
@@ -74,6 +74,7 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
74
74
  import { Side as GapCursorSide } from '@atlaskit/editor-common/selection';
75
75
  import { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
76
76
  import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
77
+ import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
77
78
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
78
79
  import { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
79
80
  import { InputTracking } from '@atlaskit/editor-common/types';
@@ -81,7 +82,8 @@ import { IntlShape } from 'react-intl-next';
81
82
  import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
82
83
  import { jsx } from '@emotion/react';
83
84
  import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
84
- import { LinkPickerProps } from '@atlaskit/link-picker';
85
+ import type { LinkingOptions } from '@atlaskit/editor-common/types';
86
+ import type { LinkInputType } from '@atlaskit/editor-common/types';
85
87
  import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
86
88
  import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
87
89
  import { MarkConfig } from '@atlaskit/editor-common/types';
@@ -1126,18 +1128,6 @@ export enum HyperlinkInsertStatus {
1126
1128
  INSERT_LINK_TOOLBAR = "INSERT"
1127
1129
  }
1128
1130
 
1129
- // @public
1130
- interface HyperlinkPluginOptions {
1131
- // (undocumented)
1132
- cardOptions?: CardOptions;
1133
- // (undocumented)
1134
- editorAppearance?: EditorAppearance;
1135
- // (undocumented)
1136
- linkPicker?: LinkPickerOptions;
1137
- // (undocumented)
1138
- platform?: 'mobile' | 'web';
1139
- }
1140
-
1141
1131
  // @public (undocumented)
1142
1132
  export interface HyperlinkState {
1143
1133
  // (undocumented)
@@ -1220,13 +1210,13 @@ type InsertItemProps = {
1220
1210
  };
1221
1211
 
1222
1212
  // @public (undocumented)
1223
- export function insertLink(from: number, to: number, incomingHref: string, incomingTitle?: string, displayText?: string, source?: LinkInputMethod, sourceEvent?: UIAnalyticsEvent | null | undefined): Command;
1213
+ export function insertLink(from: number, to: number, incomingHref: string, incomingTitle?: string, displayText?: string, source?: LinkInputType, sourceEvent?: UIAnalyticsEvent | null | undefined): Command_2;
1224
1214
 
1225
1215
  // @public (undocumented)
1226
- export const insertLinkWithAnalytics: (inputMethod: LinkInputMethod, from: number, to: number, href: string, title?: string, displayText?: string, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command;
1216
+ export const insertLinkWithAnalytics: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command_2;
1227
1217
 
1228
1218
  // @public (undocumented)
1229
- export const insertLinkWithAnalyticsMobileNative: (inputMethod: LinkInputMethod, from: number, to: number, href: string, title?: string, displayText?: string) => Command;
1219
+ export const insertLinkWithAnalyticsMobileNative: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string) => Command;
1230
1220
 
1231
1221
  // @public (undocumented)
1232
1222
  export const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean) => boolean;
@@ -1252,9 +1242,6 @@ type InviteToEditComponentProps = {
1252
1242
  children: ReactElement<InviteToEditButtonProps>;
1253
1243
  };
1254
1244
 
1255
- // @public
1256
- export function isEmptyDocument(node: Node_2): boolean;
1257
-
1258
1245
  // @public (undocumented)
1259
1246
  export function isLinkAtPos(pos: number): Predicate;
1260
1247
 
@@ -1273,19 +1260,6 @@ interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
1273
1260
 
1274
1261
  export { lightModeStatusColorPalette }
1275
1262
 
1276
- // @public
1277
- interface LinkingOptions {
1278
- linkPicker?: LinkPickerOptions;
1279
- smartLinks?: CardOptions;
1280
- }
1281
-
1282
- // @public (undocumented)
1283
- export type LinkInputMethod = INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD;
1284
-
1285
- // @public
1286
- interface LinkPickerOptions extends Partial<LinkPickerProps> {
1287
- }
1288
-
1289
1263
  // @public (undocumented)
1290
1264
  type LinkToolbarState = EditInsertedState | EditState | InsertState | undefined;
1291
1265
 
@@ -2362,7 +2336,7 @@ interface TypeAheadStatsSerializable extends TypeAheadStats {
2362
2336
  export type UpdateEvent = 'create' | 'delete' | 'resolve' | 'unresolve';
2363
2337
 
2364
2338
  // @public (undocumented)
2365
- export function updateLink(href: string, text: string, pos: number, to?: number): Command;
2339
+ export function updateLink(href: string, text: string, pos: number, to?: number): Command_2;
2366
2340
 
2367
2341
  // @public (undocumented)
2368
2342
  export const updateStatus: (status?: StatusType) => Command;
@@ -1,227 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getInlineNodeViewProducer = getInlineNodeViewProducer;
8
- exports.inlineNodeViewClassname = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _react = require("@emotion/react");
11
- var _react2 = _interopRequireDefault(require("react"));
12
- var _utils = require("@atlaskit/editor-common/utils");
13
- var _analytics = require("../plugins/analytics");
14
- var _consts = require("../plugins/analytics/consts");
15
- var _ErrorBoundary = require("../ui/ErrorBoundary");
16
- var _getPerformanceOptions = require("./getPerformanceOptions");
17
- /** @jsx jsx */
18
-
19
- var inlineNodeViewClassname = 'inlineNodeView';
20
- exports.inlineNodeViewClassname = inlineNodeViewClassname;
21
- function createNodeView(_ref) {
22
- var nodeViewParams = _ref.nodeViewParams,
23
- pmPluginFactoryParams = _ref.pmPluginFactoryParams,
24
- Component = _ref.Component,
25
- extraComponentProps = _ref.extraComponentProps;
26
- // We set a variable for the current node which is
27
- // used for comparisions when doing updates, before being
28
- // overwritten to the updated node.
29
- var currentNode = nodeViewParams.node;
30
-
31
- // First we setup the dom element which will be rendered and "tracked" by prosemirror
32
- // and also used as a "editor portal" (not react portal) target by the editor
33
- // portal provider api, for rendering the Component passed.
34
-
35
- var domRef = document.createElement('span');
36
- domRef.contentEditable = 'false';
37
- setDomAttrs(nodeViewParams.node, domRef);
38
-
39
- // @see ED-3790
40
- // something gets messed up during mutation processing inside of a
41
- // nodeView if DOM structure has nested plain "div"s, it doesn't see the
42
- // difference between them and it kills the nodeView
43
- domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "".concat(inlineNodeViewClassname));
44
-
45
- // This util is shared for tracking rendering, and the ErrorBoundary that
46
- // is setup to wrap the Component when rendering
47
- // NOTE: This is not a prosemirror dispatch
48
- function dispatchAnalyticsEvent(payload) {
49
- pmPluginFactoryParams.eventDispatcher.emit(_consts.analyticsEventKey, {
50
- payload: payload
51
- });
52
- }
53
-
54
- // This is called to render the Component into domRef which is inside the
55
- // prosemirror View.
56
- // Internally it uses the unstable_renderSubtreeIntoContainer api to render,
57
- // to the passed dom element (domRef) which means it is automatically
58
- // "cleaned up" when you do a "re render".
59
- function renderComponent() {
60
- pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
61
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
62
- currentNode: currentNode,
63
- nodeViewParams: nodeViewParams,
64
- Component: Component,
65
- extraComponentProps: extraComponentProps
66
- }), domRef, false,
67
- // node views should be rendered with intl context
68
- true);
69
- }
70
- var _getPerformanceOption = (0, _getPerformanceOptions.getPerformanceOptions)(nodeViewParams.view),
71
- samplingRate = _getPerformanceOption.samplingRate,
72
- slowThreshold = _getPerformanceOption.slowThreshold,
73
- trackingEnabled = _getPerformanceOption.trackingEnabled;
74
- trackingEnabled && (0, _getPerformanceOptions.startMeasureReactNodeViewRendered)({
75
- nodeTypeName: currentNode.type.name
76
- });
77
-
78
- // We render the component while creating the node view
79
- renderComponent();
80
- trackingEnabled && (0, _getPerformanceOptions.stopMeasureReactNodeViewRendered)({
81
- nodeTypeName: currentNode.type.name,
82
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
83
- editorState: nodeViewParams.view.state,
84
- samplingRate: samplingRate,
85
- slowThreshold: slowThreshold
86
- });
87
-
88
- // https://prosemirror.net/docs/ref/#view.NodeView
89
- var nodeView = {
90
- get dom() {
91
- return domRef;
92
- },
93
- update: function update(nextNode, _decorations) {
94
- // Let ProseMirror handle the update if node types are different.
95
- // This prevents an issue where it was not possible to select the
96
- // inline node view then replace it by entering text - the node
97
- // view contents would be deleted but the node view itself would
98
- // stay in the view and become uneditable.
99
- if (currentNode.type !== nextNode.type) {
100
- return false;
101
- }
102
- // On updates, we only set the new attributes if the type, attributes, and marks
103
- // have changed on the node.
104
-
105
- // NOTE: this could mean attrs changes aren't reflected in the dom,
106
- // when an attribute key which was previously present is no longer
107
- // present.
108
- // ie.
109
- // -> Original attributes { text: "hello world", color: "red" }
110
- // -> Updated attributes { color: "blue" }
111
- // in this case, the dom text attribute will not be cleared.
112
- //
113
- // This may not be an issue with any of our current node schemas.
114
- if (!currentNode.sameMarkup(nextNode)) {
115
- setDomAttrs(nextNode, domRef);
116
- }
117
- currentNode = nextNode;
118
- renderComponent();
119
- return true;
120
- },
121
- destroy: function destroy() {
122
- // When prosemirror destroys the node view, we need to clean up
123
- // what we have previously rendered using the editor portal
124
- // provider api.
125
- pmPluginFactoryParams.portalProviderAPI.remove(domRef);
126
- // @ts-expect-error Expect an error as domRef is expected to be
127
- // of HTMLSpanElement type however once the node view has
128
- // been destroyed no other consumers should still be using it.
129
- domRef = undefined;
130
- }
131
- };
132
- return nodeView;
133
- }
134
-
135
- /**
136
- * Copies the attributes from a ProseMirror Node to a DOM node.
137
- * @param node The Prosemirror Node from which to source the attributes
138
- */
139
- function setDomAttrs(node, element) {
140
- Object.keys(node.attrs || {}).forEach(function (attr) {
141
- element.setAttribute(attr, node.attrs[attr]);
142
- });
143
- }
144
- function getPortalChildren(_ref2) {
145
- var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
146
- currentNode = _ref2.currentNode,
147
- nodeViewParams = _ref2.nodeViewParams,
148
- Component = _ref2.Component,
149
- extraComponentProps = _ref2.extraComponentProps;
150
- return function portalChildren() {
151
- var _currentNode$type$nam, _currentNode$type;
152
- // All inline nodes use `display: inline` to allow for multi-line
153
- // wrapping. This does produce an issue in Chrome where it is not
154
- // possible to click select the position after the node,
155
- // see: https://product-fabric.atlassian.net/browse/ED-12003
156
- // however this is only a problem for node views that use
157
- // `display: inline-block` somewhere within the Component.
158
- // Looking at the below structure, spans with className
159
- // `inlineNodeViewAddZeroWidthSpace` have pseudo elements that
160
- // add a zero width space which fixes the problem.
161
- // Without the additional zero width space before the Component,
162
- // it is not possible to use the keyboard to range select in Safari.
163
- //
164
- // Zero width spaces on either side of the Component also prevent
165
- // the cursor from appearing inside the node view on all browsers.
166
- //
167
- // Note:
168
- // In future it is worth considering prohibiting the use of `display: inline-block`
169
- // within inline node view Components however would require a sizable
170
- // refactor. A test suite to catch any instances of this is ideal however
171
- // the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
172
-
173
- return (0, _react.jsx)(_ErrorBoundary.ErrorBoundary, {
174
- component: _analytics.ACTION_SUBJECT.REACT_NODE_VIEW,
175
- componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : _analytics.ACTION_SUBJECT_ID.UNKNOWN_NODE,
176
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
177
- }, (0, _react.jsx)("span", {
178
- "aria-hidden": "true",
179
- className: "zeroWidthSpaceContainer"
180
- }, (0, _react.jsx)("span", {
181
- className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
182
- }), _utils.ZERO_WIDTH_SPACE), (0, _react.jsx)(Component, (0, _extends2.default)({
183
- view: nodeViewParams.view,
184
- getPos: nodeViewParams.getPos,
185
- node: currentNode
186
- }, extraComponentProps)), (0, _react.jsx)("span", {
187
- "aria-hidden": "true",
188
- className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
189
- }));
190
- };
191
- }
192
-
193
- // https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
194
- // The prosemirror EditorProps has a nodeViews key which has the rough shape:
195
- // type nodeViews: {
196
- // [nodeViewName: string]: (node, editorView, getPos, decorations, innerDecorations) => NodeView
197
- // }
198
- // So the value of the keys on the nodeViews object, are a function which should return a NodeView.
199
- // The following type NodeViewProducer, refers to these functions which return a NodeView.
200
- //
201
- // So the above type could also be described as
202
- // type NodeViewProducer = (node, editorView, getPos, decorations, innerDecorations) => NodeView
203
- // nodeViews: {
204
- // [nodeViewName: string]: NodeViewProducer
205
- // }
206
- // This return of this function is intended to be the value of a key
207
- // in a ProseMirror nodeViews object.
208
- function getInlineNodeViewProducer(_ref3) {
209
- var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
210
- Component = _ref3.Component,
211
- extraComponentProps = _ref3.extraComponentProps;
212
- function nodeViewProducer() {
213
- var nodeView = createNodeView({
214
- nodeViewParams: {
215
- node: arguments.length <= 0 ? undefined : arguments[0],
216
- view: arguments.length <= 1 ? undefined : arguments[1],
217
- getPos: arguments.length <= 2 ? undefined : arguments[2],
218
- decorations: arguments.length <= 3 ? undefined : arguments[3]
219
- },
220
- pmPluginFactoryParams: pmPluginFactoryParams,
221
- Component: Component,
222
- extraComponentProps: extraComponentProps
223
- });
224
- return nodeView;
225
- }
226
- return nodeViewProducer;
227
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,152 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- var _prosemirrorState = require("prosemirror-state");
10
- var _prosemirrorUtils = require("prosemirror-utils");
11
- var _messages = _interopRequireDefault(require("../../messages"));
12
- var _mediaWrapLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wrap-left"));
13
- var _mediaWrapRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wrap-right"));
14
- var _mediaWide = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wide"));
15
- var _mediaFullWidth = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-full-width"));
16
- var _alignImageLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-left"));
17
- var _alignImageRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-right"));
18
- var _alignImageCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-center"));
19
- var _richMediaUtils = require("../../utils/rich-media-utils");
20
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
- var _utils = require("../../plugins/analytics/utils");
22
- var _analytics = require("../../plugins/analytics");
23
- var _toolbarMessages = require("./toolbar-messages");
24
- var _utils2 = require("../../utils");
25
- var alignmentIcons = [{
26
- id: 'editor.media.alignLeft',
27
- value: 'align-start',
28
- icon: _alignImageLeft.default
29
- }, {
30
- id: 'editor.media.alignCenter',
31
- value: 'center',
32
- icon: _alignImageCenter.default
33
- }, {
34
- id: 'editor.media.alignRight',
35
- value: 'align-end',
36
- icon: _alignImageRight.default
37
- }];
38
- var wrappingIcons = [{
39
- id: 'editor.media.wrapLeft',
40
- value: 'wrap-left',
41
- icon: _mediaWrapLeft.default
42
- }, {
43
- id: 'editor.media.wrapRight',
44
- value: 'wrap-right',
45
- icon: _mediaWrapRight.default
46
- }];
47
- var breakoutIcons = [{
48
- value: 'wide',
49
- icon: _mediaWide.default
50
- }, {
51
- value: 'full-width',
52
- icon: _mediaFullWidth.default
53
- }];
54
- var layoutToMessages = {
55
- 'wrap-left': _toolbarMessages.toolbarMessages.wrapLeft,
56
- center: _messages.default.alignImageCenter,
57
- 'wrap-right': _toolbarMessages.toolbarMessages.wrapRight,
58
- wide: _messages.default.layoutWide,
59
- 'full-width': _messages.default.layoutFullWidth,
60
- 'align-end': _messages.default.alignImageRight,
61
- 'align-start': _messages.default.alignImageLeft
62
- };
63
- var getNodeWidth = function getNodeWidth(node, schema) {
64
- var embedCard = schema.nodes.embedCard;
65
- if (node.type === embedCard) {
66
- return node.attrs.originalWidth || _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH;
67
- }
68
- return node.firstChild && node.firstChild.attrs.width || node.attrs.width;
69
- };
70
- var makeAlign = function makeAlign(layout, nodeType, widthPluginDependencyApi) {
71
- return function (state, dispatch) {
72
- var _ref = state.selection,
73
- node = _ref.node;
74
- var previousLayoutType = node.attrs.layout;
75
- var mediaSingle = state.schema.nodes.mediaSingle;
76
- if (!dispatch) {
77
- return false;
78
- }
79
- var widthPluginState = widthPluginDependencyApi === null || widthPluginDependencyApi === void 0 ? void 0 : widthPluginDependencyApi.sharedState.currentState();
80
- if (!node || node.type !== nodeType || !widthPluginState) {
81
- return false;
82
- }
83
- var nodeWidth = getNodeWidth(node, state.schema);
84
- var newAttrs = (0, _richMediaUtils.alignAttributes)(layout, node.attrs, undefined, nodeWidth, widthPluginState.lineLength);
85
- var tr = state.tr.setNodeMarkup(state.selection.from, undefined, newAttrs);
86
- tr.setMeta('scrollIntoView', false);
87
- // when image captions are enabled, the wrong node gets selected after
88
- // setNodeMarkup is called
89
- tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, state.selection.from));
90
- var paragraph = tr.doc.type.schema.nodes.paragraph;
91
-
92
- // see https://product-fabric.atlassian.net/browse/ED-15518 insert a new paragraph when an embedded card is wrapped left or right
93
- if (layout.startsWith('wrap') && paragraph && !tr.doc.nodeAt(state.selection.to) && ((0, _utils2.insideTable)(state) || (0, _utils2.isInLayoutColumn)(state))) {
94
- tr.insert(state.selection.to, paragraph.createAndFill());
95
- }
96
- dispatch((0, _utils.addAnalytics)(state, tr, {
97
- eventType: _analytics.EVENT_TYPE.TRACK,
98
- action: _analytics.ACTION.SELECTED,
99
- actionSubject: _analytics.ACTION_SUBJECT[node.type === mediaSingle ? 'MEDIA_SINGLE' : 'EMBEDS'],
100
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.RICH_MEDIA_LAYOUT,
101
- attributes: {
102
- previousLayoutType: previousLayoutType,
103
- currentLayoutType: layout
104
- }
105
- }));
106
- return true;
107
- };
108
- };
109
- var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl, nodeType, widthPluginDependencyApi) {
110
- return icons.map(function (toolbarItem) {
111
- var id = toolbarItem.id,
112
- value = toolbarItem.value;
113
- return {
114
- id: id,
115
- type: 'button',
116
- icon: toolbarItem.icon,
117
- title: intl.formatMessage(layoutToMessages[value]),
118
- selected: layout === value,
119
- onClick: makeAlign(value, nodeType, widthPluginDependencyApi)
120
- };
121
- });
122
- };
123
- var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2, allowResizingInTables) {
124
- var nodes = _ref2.nodes;
125
- return (0, _prosemirrorUtils.hasParentNodeOfType)([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat((0, _toConsumableArray2.default)(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
126
- };
127
- var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, widthPluginDependencyApi, allowResizing, allowResizingInTables) {
128
- var allowWrapping = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
129
- var allowAlignment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
130
- var selection = state.selection;
131
- if (!(selection instanceof _prosemirrorState.NodeSelection) || !selection.node || !nodeType || shouldHideLayoutToolbar(selection, state.schema, allowResizingInTables)) {
132
- return [];
133
- }
134
- var layout = selection.node.attrs.layout;
135
- var alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
136
- var wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
137
- var breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
138
- var items = [].concat((0, _toConsumableArray2.default)(alignmentToolbarItems), (0, _toConsumableArray2.default)(getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping)), (0, _toConsumableArray2.default)(wrappingToolbarItems), (0, _toConsumableArray2.default)(getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing)), (0, _toConsumableArray2.default)(breakOutToolbarItems));
139
- return items;
140
- };
141
- var getSeparatorBetweenAlignmentAndWrapping = function getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping) {
142
- return allowAlignment && allowWrapping ? [{
143
- type: 'separator'
144
- }] : [];
145
- };
146
- var getSeparatorBeforeBreakoutItems = function getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing) {
147
- return !allowResizing && (allowAlignment || allowWrapping) ? [{
148
- type: 'separator'
149
- }] : [];
150
- };
151
- var _default = buildLayoutButtons;
152
- exports.default = _default;