@atlaskit/editor-core 185.1.6 → 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 (269) hide show
  1. package/CHANGELOG.md +13 -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/Appearance/Chromeless.js +4 -2
  40. package/dist/cjs/ui/Appearance/Comment/Comment.js +4 -2
  41. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -1
  42. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  43. package/dist/cjs/ui/Appearance/Mobile.js +4 -2
  44. package/dist/cjs/ui/AppearanceComponents/Mobile.js +6 -3
  45. package/dist/cjs/ui/ContentStyles/index.js +5 -3
  46. package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +4 -11
  47. package/dist/cjs/utils/document.js +7 -249
  48. package/dist/cjs/utils/index.js +1 -23
  49. package/dist/cjs/version-wrapper.js +1 -1
  50. package/dist/cjs/version.json +1 -1
  51. package/dist/es2019/actions/index.js +2 -1
  52. package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
  53. package/dist/es2019/index.js +1 -1
  54. package/dist/es2019/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
  55. package/dist/es2019/messages.js +2 -54
  56. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  57. package/dist/es2019/plugins/base/pm-plugins/scroll-gutter.js +1 -1
  58. package/dist/es2019/plugins/card/nodeviews/blockCard.js +1 -1
  59. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -1
  60. package/dist/es2019/plugins/card/pm-plugins/doc.js +2 -3
  61. package/dist/es2019/plugins/card/pm-plugins/keymap.js +3 -3
  62. package/dist/es2019/plugins/card/pm-plugins/main.js +1 -1
  63. package/dist/es2019/plugins/card/toolbar.js +7 -9
  64. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +3 -4
  65. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +1 -4
  66. package/dist/es2019/plugins/card/utils.js +1 -2
  67. package/dist/es2019/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
  68. package/dist/es2019/plugins/custom-autoformat/doc.js +1 -1
  69. package/dist/es2019/plugins/date/pm-plugins/main.js +1 -1
  70. package/dist/es2019/plugins/emoji/index.js +1 -1
  71. package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
  72. package/dist/es2019/plugins/hyperlink/Toolbar.js +3 -3
  73. package/dist/es2019/plugins/hyperlink/commands.js +1 -2
  74. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
  75. package/dist/es2019/plugins/layout/actions.js +1 -1
  76. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
  77. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
  78. package/dist/es2019/plugins/media/toolbar/index.js +9 -8
  79. package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
  80. package/dist/es2019/plugins/media/toolbar/linking.js +1 -1
  81. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +1 -1
  82. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
  83. package/dist/es2019/plugins/media/utils/media-files.js +4 -3
  84. package/dist/es2019/plugins/mentions/pm-plugins/main.js +1 -1
  85. package/dist/es2019/plugins/placeholder/index.js +1 -1
  86. package/dist/es2019/plugins/status/plugin.js +1 -1
  87. package/dist/es2019/plugins/unsupported-content/index.js +1 -1
  88. package/dist/es2019/ui/Appearance/Chromeless.js +4 -2
  89. package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
  90. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -1
  91. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  92. package/dist/es2019/ui/Appearance/Mobile.js +4 -2
  93. package/dist/es2019/ui/AppearanceComponents/Mobile.js +6 -3
  94. package/dist/es2019/ui/ContentStyles/index.js +5 -3
  95. package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -4
  96. package/dist/es2019/utils/document.js +3 -244
  97. package/dist/es2019/utils/index.js +1 -4
  98. package/dist/es2019/version-wrapper.js +1 -1
  99. package/dist/es2019/version.json +1 -1
  100. package/dist/esm/actions/index.js +2 -1
  101. package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
  102. package/dist/esm/index.js +1 -1
  103. package/dist/esm/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
  104. package/dist/esm/messages.js +2 -54
  105. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  106. package/dist/esm/plugins/base/pm-plugins/scroll-gutter.js +1 -1
  107. package/dist/esm/plugins/card/nodeviews/blockCard.js +1 -1
  108. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -1
  109. package/dist/esm/plugins/card/pm-plugins/doc.js +2 -3
  110. package/dist/esm/plugins/card/pm-plugins/keymap.js +3 -3
  111. package/dist/esm/plugins/card/pm-plugins/main.js +1 -1
  112. package/dist/esm/plugins/card/toolbar.js +7 -9
  113. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +3 -4
  114. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +1 -4
  115. package/dist/esm/plugins/card/utils.js +1 -2
  116. package/dist/esm/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
  117. package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
  118. package/dist/esm/plugins/date/pm-plugins/main.js +1 -1
  119. package/dist/esm/plugins/emoji/index.js +1 -1
  120. package/dist/esm/plugins/floating-toolbar/index.js +1 -1
  121. package/dist/esm/plugins/hyperlink/Toolbar.js +3 -3
  122. package/dist/esm/plugins/hyperlink/commands.js +1 -2
  123. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
  124. package/dist/esm/plugins/layout/actions.js +1 -1
  125. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  126. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
  127. package/dist/esm/plugins/media/toolbar/index.js +9 -8
  128. package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
  129. package/dist/esm/plugins/media/toolbar/linking.js +1 -1
  130. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -1
  131. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
  132. package/dist/esm/plugins/media/utils/media-files.js +4 -3
  133. package/dist/esm/plugins/mentions/pm-plugins/main.js +1 -1
  134. package/dist/esm/plugins/placeholder/index.js +1 -1
  135. package/dist/esm/plugins/status/plugin.js +1 -1
  136. package/dist/esm/plugins/unsupported-content/index.js +1 -1
  137. package/dist/esm/ui/Appearance/Chromeless.js +4 -2
  138. package/dist/esm/ui/Appearance/Comment/Comment.js +4 -2
  139. package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -1
  140. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  141. package/dist/esm/ui/Appearance/Mobile.js +4 -2
  142. package/dist/esm/ui/AppearanceComponents/Mobile.js +6 -3
  143. package/dist/esm/ui/ContentStyles/index.js +5 -3
  144. package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -4
  145. package/dist/esm/utils/document.js +6 -240
  146. package/dist/esm/utils/index.js +1 -4
  147. package/dist/esm/version-wrapper.js +1 -1
  148. package/dist/esm/version.json +1 -1
  149. package/dist/types/index.d.ts +1 -2
  150. package/dist/types/labs/next/presets/cxhtml.d.ts +3 -3
  151. package/dist/types/labs/next/presets/default.d.ts +1 -1
  152. package/dist/types/labs/next/presets/mobile.d.ts +3 -3
  153. package/dist/types/messages.d.ts +2 -53
  154. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +1 -1
  155. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +3 -3
  156. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
  157. package/dist/types/plugins/card/toolbar.d.ts +1 -1
  158. package/dist/types/plugins/card/types.d.ts +1 -1
  159. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
  160. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
  161. package/dist/types/plugins/date/nodeviews/date.d.ts +1 -1
  162. package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +1 -1
  163. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  164. package/dist/types/plugins/hyperlink/Toolbar.d.ts +1 -1
  165. package/dist/types/plugins/hyperlink/commands.d.ts +2 -3
  166. package/dist/types/plugins/hyperlink/index.d.ts +1 -1
  167. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
  168. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
  169. package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
  170. package/dist/types/plugins/media/utils/media-files.d.ts +1 -1
  171. package/dist/types/plugins/mentions/nodeviews/mention.d.ts +1 -1
  172. package/dist/types/plugins/status/nodeviews/status.d.ts +1 -1
  173. package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
  174. package/dist/types/types/editor-props.d.ts +1 -1
  175. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
  176. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -364
  177. package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
  178. package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -0
  179. package/dist/types/ui/ContentStyles/index.d.ts +3 -3
  180. package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
  181. package/dist/types/utils/document.d.ts +0 -12
  182. package/dist/types/utils/index.d.ts +1 -2
  183. package/dist/types-ts4.5/index.d.ts +1 -2
  184. package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +3 -3
  185. package/dist/types-ts4.5/labs/next/presets/default.d.ts +1 -1
  186. package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +3 -3
  187. package/dist/types-ts4.5/messages.d.ts +2 -53
  188. package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +1 -1
  189. package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +3 -3
  190. package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +1 -1
  191. package/dist/types-ts4.5/plugins/card/toolbar.d.ts +1 -1
  192. package/dist/types-ts4.5/plugins/card/types.d.ts +1 -1
  193. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
  194. package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
  195. package/dist/types-ts4.5/plugins/date/nodeviews/date.d.ts +1 -1
  196. package/dist/types-ts4.5/plugins/emoji/nodeviews/emoji.d.ts +1 -1
  197. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  198. package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +1 -1
  199. package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +2 -3
  200. package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +1 -1
  201. package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
  202. package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
  203. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
  204. package/dist/types-ts4.5/plugins/media/utils/media-files.d.ts +1 -1
  205. package/dist/types-ts4.5/plugins/mentions/nodeviews/mention.d.ts +1 -1
  206. package/dist/types-ts4.5/plugins/status/nodeviews/status.d.ts +1 -1
  207. package/dist/types-ts4.5/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
  208. package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
  209. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
  210. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +5 -364
  211. package/dist/types-ts4.5/ui/Appearance/Mobile.d.ts +1 -1
  212. package/dist/types-ts4.5/ui/AppearanceComponents/Mobile.d.ts +2 -0
  213. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +3 -3
  214. package/dist/types-ts4.5/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
  215. package/dist/types-ts4.5/utils/document.d.ts +0 -12
  216. package/dist/types-ts4.5/utils/index.d.ts +1 -2
  217. package/package.json +9 -10
  218. package/report.api.md +9 -34
  219. package/tmp/api-report-tmp.d.ts +7 -33
  220. package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +0 -227
  221. package/dist/cjs/plugins/hyperlink/types.js +0 -5
  222. package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +0 -152
  223. package/dist/cjs/ui/Resizer/index.js +0 -210
  224. package/dist/cjs/ui/Resizer/styled.js +0 -15
  225. package/dist/cjs/ui/Resizer/types.js +0 -5
  226. package/dist/cjs/ui/Resizer/utils.js +0 -21
  227. package/dist/cjs/utils/filter/privacy-filter.js +0 -55
  228. package/dist/cjs/utils/linking-utils.js +0 -84
  229. package/dist/cjs/utils/rich-media-utils.js +0 -130
  230. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +0 -221
  231. package/dist/es2019/plugins/hyperlink/types.js +0 -1
  232. package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +0 -159
  233. package/dist/es2019/ui/Resizer/index.js +0 -191
  234. package/dist/es2019/ui/Resizer/styled.js +0 -15
  235. package/dist/es2019/ui/Resizer/types.js +0 -1
  236. package/dist/es2019/ui/Resizer/utils.js +0 -12
  237. package/dist/es2019/utils/filter/privacy-filter.js +0 -47
  238. package/dist/es2019/utils/linking-utils.js +0 -74
  239. package/dist/es2019/utils/rich-media-utils.js +0 -108
  240. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +0 -217
  241. package/dist/esm/plugins/hyperlink/types.js +0 -1
  242. package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +0 -144
  243. package/dist/esm/ui/Resizer/index.js +0 -203
  244. package/dist/esm/ui/Resizer/styled.js +0 -7
  245. package/dist/esm/ui/Resizer/types.js +0 -1
  246. package/dist/esm/ui/Resizer/utils.js +0 -12
  247. package/dist/esm/utils/filter/privacy-filter.js +0 -48
  248. package/dist/esm/utils/linking-utils.js +0 -74
  249. package/dist/esm/utils/rich-media-utils.js +0 -117
  250. package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
  251. package/dist/types/plugins/hyperlink/types.d.ts +0 -35
  252. package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
  253. package/dist/types/ui/Resizer/index.d.ts +0 -41
  254. package/dist/types/ui/Resizer/styled.d.ts +0 -2
  255. package/dist/types/ui/Resizer/types.d.ts +0 -26
  256. package/dist/types/ui/Resizer/utils.d.ts +0 -6
  257. package/dist/types/utils/filter/privacy-filter.d.ts +0 -9
  258. package/dist/types/utils/linking-utils.d.ts +0 -14
  259. package/dist/types/utils/rich-media-utils.d.ts +0 -8
  260. package/dist/types-ts4.5/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
  261. package/dist/types-ts4.5/plugins/hyperlink/types.d.ts +0 -35
  262. package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
  263. package/dist/types-ts4.5/ui/Resizer/index.d.ts +0 -41
  264. package/dist/types-ts4.5/ui/Resizer/styled.d.ts +0 -2
  265. package/dist/types-ts4.5/ui/Resizer/types.d.ts +0 -26
  266. package/dist/types-ts4.5/ui/Resizer/utils.d.ts +0 -6
  267. package/dist/types-ts4.5/utils/filter/privacy-filter.d.ts +0 -9
  268. package/dist/types-ts4.5/utils/linking-utils.d.ts +0 -14
  269. package/dist/types-ts4.5/utils/rich-media-utils.d.ts +0 -8
@@ -1,210 +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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _react = _interopRequireDefault(require("react"));
16
- var _classnames = _interopRequireDefault(require("classnames"));
17
- var _reResizable = require("re-resizable");
18
- var _utils = require("@atlaskit/editor-common/utils");
19
- var _utils2 = require("./utils");
20
- var _styles = require("@atlaskit/editor-common/styles");
21
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
- var _analytics = require("../../plugins/analytics");
23
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
24
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
- var getResizeAnalyticsEvent = function getResizeAnalyticsEvent(type, size, layout) {
26
- var actionSubject = type === 'embed' ? _analytics.ACTION_SUBJECT.EMBEDS : _analytics.ACTION_SUBJECT.MEDIA_SINGLE;
27
- return {
28
- action: _analytics.ACTION.EDITED,
29
- actionSubject: actionSubject,
30
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.RESIZED,
31
- attributes: {
32
- size: size,
33
- layout: layout
34
- },
35
- eventType: _analytics.EVENT_TYPE.UI
36
- };
37
- };
38
- var getWidthFromSnapPoints = function getWidthFromSnapPoints(width, snapPoints) {
39
- if (snapPoints.length) {
40
- return Math.min(Math.max(width, snapPoints[0]), snapPoints[snapPoints.length - 1]);
41
- }
42
- return width;
43
- };
44
- var Resizer = /*#__PURE__*/function (_React$Component) {
45
- (0, _inherits2.default)(Resizer, _React$Component);
46
- var _super = _createSuper(Resizer);
47
- function Resizer() {
48
- var _this;
49
- (0, _classCallCheck2.default)(this, Resizer);
50
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
51
- args[_key] = arguments[_key];
52
- }
53
- _this = _super.call.apply(_super, [this].concat(args));
54
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resizable", /*#__PURE__*/_react.default.createRef());
55
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
56
- isResizing: false
57
- });
58
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleResizeStart", function (event) {
59
- var _this$props = _this.props,
60
- _this$props$innerPadd = _this$props.innerPadding,
61
- innerPadding = _this$props$innerPadd === void 0 ? 0 : _this$props$innerPadd,
62
- highlights = _this$props.highlights,
63
- displayGrid = _this$props.displayGrid,
64
- layout = _this$props.layout,
65
- width = _this$props.width,
66
- snapPoints = _this$props.snapPoints;
67
-
68
- // prevent creating a drag event on Firefox
69
- event.preventDefault();
70
- _this.setState({
71
- isResizing: true
72
- }, function () {
73
- var newHighlights = highlights(width + innerPadding, snapPoints);
74
- displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0, _utils.gridTypeForLayout)(layout), newHighlights);
75
- });
76
- });
77
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleResize", function (_event, _direction, _elementRef, delta) {
78
- var _this$props2 = _this.props,
79
- highlights = _this$props2.highlights,
80
- calcNewSize = _this$props2.calcNewSize,
81
- scaleFactor = _this$props2.scaleFactor,
82
- snapPoints = _this$props2.snapPoints,
83
- displayGrid = _this$props2.displayGrid,
84
- layout = _this$props2.layout,
85
- updateSize = _this$props2.updateSize,
86
- _this$props2$innerPad = _this$props2.innerPadding,
87
- innerPadding = _this$props2$innerPad === void 0 ? 0 : _this$props2$innerPad;
88
- var resizable = _this.resizable.current;
89
- var isResizing = _this.state.isResizing;
90
- if (!resizable || !resizable.state.original || !isResizing) {
91
- return;
92
- }
93
- var newWidth = getWidthFromSnapPoints(resizable.state.original.width + delta.width * (scaleFactor || 1), snapPoints);
94
- var newSize = calcNewSize(newWidth + innerPadding, false);
95
- if (newSize.layout !== layout) {
96
- updateSize(newSize.width, newSize.layout);
97
- }
98
- var newHighlights = highlights(newWidth, snapPoints);
99
- displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0, _utils.gridTypeForLayout)(newSize.layout), newHighlights);
100
- resizable.updateSize({
101
- width: newWidth,
102
- height: 'auto'
103
- });
104
- resizable.setState({
105
- isResizing: true
106
- });
107
- });
108
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleResizeStop", function (_event, _direction, _elementRef, delta) {
109
- var _this$props3 = _this.props,
110
- highlights = _this$props3.highlights,
111
- calcNewSize = _this$props3.calcNewSize,
112
- snapPoints = _this$props3.snapPoints,
113
- displayGrid = _this$props3.displayGrid,
114
- layout = _this$props3.layout,
115
- updateSize = _this$props3.updateSize,
116
- dispatchAnalyticsEvent = _this$props3.dispatchAnalyticsEvent,
117
- nodeType = _this$props3.nodeType;
118
- var resizable = _this.resizable.current;
119
- var isResizing = _this.state.isResizing;
120
- if (!resizable || !resizable.state.original || !isResizing) {
121
- return;
122
- }
123
- var newWidth = getWidthFromSnapPoints(resizable.state.original.width + delta.width, snapPoints);
124
- var snapWidth = (0, _utils2.snapTo)(newWidth, snapPoints);
125
- var newSize = calcNewSize(snapWidth, true);
126
- var newHighlights = highlights(newWidth, snapPoints);
127
- if (dispatchAnalyticsEvent) {
128
- dispatchAnalyticsEvent(getResizeAnalyticsEvent(nodeType, newSize.width, newSize.layout));
129
- }
130
- // show committed grid size
131
- displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0, _utils.gridTypeForLayout)(newSize.layout), newHighlights);
132
- _this.setState({
133
- isResizing: false
134
- }, function () {
135
- updateSize(newSize.width, newSize.layout);
136
- displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(false, (0, _utils.gridTypeForLayout)(layout), []);
137
- });
138
- });
139
- return _this;
140
- }
141
- (0, _createClass2.default)(Resizer, [{
142
- key: "render",
143
- value: function render() {
144
- var handleStyles = {};
145
- var handles = {};
146
- var handleComponent = {};
147
- var _this$props4 = this.props,
148
- _this$props4$innerPad = _this$props4.innerPadding,
149
- innerPadding = _this$props4$innerPad === void 0 ? 0 : _this$props4$innerPad,
150
- width = _this$props4.width,
151
- pctWidth = _this$props4.pctWidth,
152
- selected = _this$props4.selected,
153
- layout = _this$props4.layout,
154
- enable = _this$props4.enable,
155
- children = _this$props4.children,
156
- ratio = _this$props4.ratio,
157
- handleComponentFunc = _this$props4.handleComponentFunc;
158
- var isResizing = this.state.isResizing;
159
- _utils2.handleSides.forEach(function (side) {
160
- var _handleStyles$side;
161
- handles[side] = "richMedia-resize-handle-".concat(side);
162
- handleStyles[side] = (_handleStyles$side = {
163
- width: '24px'
164
- }, (0, _defineProperty2.default)(_handleStyles$side, side, "".concat(-13 - innerPadding, "px")), (0, _defineProperty2.default)(_handleStyles$side, "zIndex", _editorSharedStyles.akRichMediaResizeZIndex), (0, _defineProperty2.default)(_handleStyles$side, "pointerEvents", 'auto'), _handleStyles$side);
165
- var sideHandleComponent = handleComponentFunc && handleComponentFunc(side);
166
- if (sideHandleComponent) {
167
- handleComponent[side] = sideHandleComponent;
168
- }
169
- });
170
- var className = (0, _classnames.default)(_styles.richMediaClassName, "image-".concat(layout), this.props.className, {
171
- 'is-resizing': isResizing,
172
- 'not-resized': !pctWidth,
173
- 'richMedia-selected': selected,
174
- 'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
175
- });
176
- var handleWrapperStyle;
177
- if (ratio) {
178
- handleWrapperStyle = {
179
- position: 'absolute',
180
- width: '100%',
181
- paddingBottom: "".concat(ratio, "%"),
182
- top: 0,
183
- pointerEvents: 'none'
184
- };
185
- }
186
-
187
- // Ideally, Resizable would let you pass in the component rather than
188
- // the div. For now, we just apply the same styles using CSS
189
- return /*#__PURE__*/_react.default.createElement(_reResizable.Resizable, {
190
- ref: this.resizable,
191
- size: {
192
- width: width,
193
- // just content itself (no paddings)
194
- height: 'auto'
195
- },
196
- className: className,
197
- handleClasses: handles,
198
- handleStyles: handleStyles,
199
- handleWrapperStyle: handleWrapperStyle,
200
- handleComponent: handleComponent,
201
- enable: enable,
202
- onResize: this.handleResize,
203
- onResizeStop: this.handleResizeStop,
204
- onResizeStart: this.handleResizeStart
205
- }, children);
206
- }
207
- }]);
208
- return Resizer;
209
- }(_react.default.Component);
210
- exports.default = Resizer;
@@ -1,15 +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.wrapperStyle = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _react = require("@emotion/react");
10
- var _ui = require("@atlaskit/editor-common/ui");
11
- var _templateObject;
12
- var wrapperStyle = function wrapperStyle(props) {
13
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & > div {\n ", ";\n position: relative;\n clear: both;\n\n > div {\n position: absolute;\n height: 100%;\n width: 100%;\n }\n }\n"])), (0, _ui.MediaSingleDimensionHelper)(props));
14
- };
15
- exports.wrapperStyle = wrapperStyle;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.snapTo = exports.imageAlignmentMap = exports.handleSides = void 0;
7
- var snapTo = function snapTo(target, points) {
8
- return points.length === 0 ?
9
- // extreme last case if there are no points somehow
10
- target : points.reduce(function (point, closest) {
11
- return Math.abs(closest - target) < Math.abs(point - target) ? closest : point;
12
- });
13
- };
14
- exports.snapTo = snapTo;
15
- var handleSides = ['left', 'right'];
16
- exports.handleSides = handleSides;
17
- var imageAlignmentMap = {
18
- left: 'start',
19
- right: 'end'
20
- };
21
- exports.imageAlignmentMap = imageAlignmentMap;
@@ -1,55 +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.sanitizeNodeForPrivacy = sanitizeNodeForPrivacy;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _traverse = require("@atlaskit/adf-utils/traverse");
10
- var _resource = require("@atlaskit/mention/resource");
11
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
- /**
14
- * Sanitises a document where some content should not be in the document (e.g. mention names).
15
- *
16
- * It is expected that these names we be resolved separately (e.g. when rendering
17
- * a node view).
18
- */
19
- function sanitizeNodeForPrivacy(json, providerFactory) {
20
- var mentionNames = new Map();
21
- var hasCacheableMentions = false;
22
- var sanitizedJSON = (0, _traverse.traverse)(json, {
23
- mention: function mention(node) {
24
- if (node.attrs && node.attrs.text) {
25
- hasCacheableMentions = true;
26
- // Remove @ prefix
27
- var text = node.attrs.text;
28
- var name = text.startsWith('@') ? text.slice(1) : text;
29
- mentionNames.set(node.attrs.id, name);
30
- }
31
- return _objectSpread(_objectSpread({}, node), {}, {
32
- attrs: _objectSpread(_objectSpread({}, node.attrs), {}, {
33
- text: ''
34
- })
35
- });
36
- }
37
- });
38
- if (hasCacheableMentions && providerFactory) {
39
- var handler = function handler(_name, providerPromise) {
40
- if (providerPromise) {
41
- providerPromise.then(function (provider) {
42
- if ((0, _resource.isResolvingMentionProvider)(provider)) {
43
- mentionNames.forEach(function (name, id) {
44
- provider.cacheMentionName(id, name);
45
- });
46
- mentionNames.clear();
47
- providerFactory.unsubscribe('mentionProvider', handler);
48
- }
49
- });
50
- }
51
- };
52
- providerFactory.subscribe('mentionProvider', handler);
53
- }
54
- return sanitizedJSON;
55
- }
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.unlinkPayload = exports.buildVisitedLinkPayload = exports.buildOpenedSettingsPayload = exports.buildEditLinkPayload = void 0;
7
- var _analytics = require("@atlaskit/editor-common/analytics");
8
- var buildEditLinkPayload = function buildEditLinkPayload(type) {
9
- return {
10
- action: _analytics.ACTION.CLICKED,
11
- actionSubject: type === _analytics.ACTION_SUBJECT_ID.HYPERLINK ? _analytics.ACTION_SUBJECT.HYPERLINK : _analytics.ACTION_SUBJECT.SMART_LINK,
12
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.EDIT_LINK,
13
- attributes: type !== _analytics.ACTION_SUBJECT_ID.HYPERLINK ? {
14
- display: type
15
- } : {},
16
- eventType: _analytics.EVENT_TYPE.UI
17
- };
18
- };
19
- exports.buildEditLinkPayload = buildEditLinkPayload;
20
- var mapLinkTypeToCardAppearance = function mapLinkTypeToCardAppearance(type) {
21
- switch (type) {
22
- case _analytics.ACTION_SUBJECT_ID.CARD_INLINE:
23
- {
24
- return 'inline';
25
- }
26
- case _analytics.ACTION_SUBJECT_ID.CARD_BLOCK:
27
- {
28
- return 'block';
29
- }
30
- case _analytics.ACTION_SUBJECT_ID.EMBEDS:
31
- {
32
- return 'embed';
33
- }
34
- default:
35
- {
36
- return 'url';
37
- }
38
- }
39
- };
40
- var buildVisitedLinkPayload = function buildVisitedLinkPayload(type) {
41
- return type === _analytics.ACTION_SUBJECT_ID.HYPERLINK ? {
42
- action: _analytics.ACTION.VISITED,
43
- actionSubject: _analytics.ACTION_SUBJECT.HYPERLINK,
44
- actionSubjectId: undefined,
45
- attributes: {
46
- inputMethod: _analytics.INPUT_METHOD.TOOLBAR
47
- },
48
- eventType: _analytics.EVENT_TYPE.TRACK
49
- } : {
50
- action: _analytics.ACTION.VISITED,
51
- actionSubject: _analytics.ACTION_SUBJECT.SMART_LINK,
52
- actionSubjectId: type,
53
- attributes: {
54
- inputMethod: _analytics.INPUT_METHOD.TOOLBAR
55
- },
56
- eventType: _analytics.EVENT_TYPE.TRACK
57
- };
58
- };
59
- exports.buildVisitedLinkPayload = buildVisitedLinkPayload;
60
- var buildOpenedSettingsPayload = function buildOpenedSettingsPayload(type) {
61
- return {
62
- action: _analytics.ACTION.CLICKED,
63
- actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
64
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.GOTO_SMART_LINK_SETTINGS,
65
- attributes: {
66
- inputMethod: _analytics.INPUT_METHOD.TOOLBAR,
67
- display: mapLinkTypeToCardAppearance(type)
68
- },
69
- eventType: _analytics.EVENT_TYPE.UI
70
- };
71
- };
72
- exports.buildOpenedSettingsPayload = buildOpenedSettingsPayload;
73
- var unlinkPayload = function unlinkPayload(type) {
74
- return {
75
- action: _analytics.ACTION.UNLINK,
76
- actionSubject: type === _analytics.ACTION_SUBJECT_ID.HYPERLINK ? _analytics.ACTION_SUBJECT.HYPERLINK : _analytics.ACTION_SUBJECT.SMART_LINK,
77
- actionSubjectId: type === _analytics.ACTION_SUBJECT_ID.HYPERLINK ? undefined : type,
78
- attributes: {
79
- inputMethod: _analytics.INPUT_METHOD.TOOLBAR
80
- },
81
- eventType: _analytics.EVENT_TYPE.TRACK
82
- };
83
- };
84
- exports.unlinkPayload = unlinkPayload;
@@ -1,130 +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.alignAttributes = void 0;
8
- exports.calculateSnapPoints = calculateSnapPoints;
9
- exports.nonWrappedLayouts = exports.isRichMediaInsideOfBlockNode = exports.floatingLayouts = void 0;
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var _ui = require("@atlaskit/editor-common/ui");
12
- var _prosemirrorUtils = require("prosemirror-utils");
13
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
- var nonWrappedLayouts = ['center', 'wide', 'full-width'];
17
- exports.nonWrappedLayouts = nonWrappedLayouts;
18
- var floatingLayouts = ['wrap-left', 'wrap-right'];
19
- exports.floatingLayouts = floatingLayouts;
20
- var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos) {
21
- if (typeof pos !== 'number' || isNaN(pos) || !view) {
22
- return false;
23
- }
24
- var $pos = view.state.doc.resolve(pos);
25
- var _view$state$schema$no = view.state.schema.nodes,
26
- expand = _view$state$schema$no.expand,
27
- nestedExpand = _view$state$schema$no.nestedExpand,
28
- layoutColumn = _view$state$schema$no.layoutColumn;
29
- return !!(0, _prosemirrorUtils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn]);
30
- };
31
- exports.isRichMediaInsideOfBlockNode = isRichMediaInsideOfBlockNode;
32
- var alignAttributes = function alignAttributes(layout, oldAttrs) {
33
- var gridSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 12;
34
- var originalWidth = arguments.length > 3 ? arguments[3] : undefined;
35
- var lineLength = arguments.length > 4 ? arguments[4] : undefined;
36
- var width = oldAttrs.width;
37
- var oldLayout = oldAttrs.layout;
38
- var oldLayoutIsNonWrapped = nonWrappedLayouts.indexOf(oldLayout) > -1;
39
- var newLayoutIsNonWrapped = nonWrappedLayouts.indexOf(layout) > -1;
40
- var newLayoutIsWrapped = _ui.wrappedLayouts.indexOf(layout) > -1;
41
- var oldLayoutIsWrapped = _ui.wrappedLayouts.indexOf(oldLayout) > -1;
42
- if (oldLayoutIsNonWrapped && (0, _ui.shouldAddDefaultWrappedWidth)(layout, originalWidth, lineLength)) {
43
- // 'full-width' or 'wide' or 'center' -> 'wrap-left' or 'wrap-right' or 'align-end' or 'align-start'
44
- if (!width || width >= 100 || oldLayout !== 'center' // == 'full-width' or 'wide'
45
- ) {
46
- width = 50;
47
- }
48
- } else if (layout !== oldLayout && ['full-width', 'wide'].indexOf(oldLayout) > -1) {
49
- // 'full-width' -> 'center' or 'wide'
50
- // 'wide' -> 'center' or 'full-width'
51
- // unset width
52
- width = undefined;
53
- } else if (width) {
54
- var cols = Math.round(width / 100 * gridSize);
55
- var targetCols = cols;
56
- if (oldLayoutIsWrapped && newLayoutIsNonWrapped) {
57
- // wrap -> center needs to align to even grid
58
- targetCols = Math.floor(targetCols / 2) * 2;
59
- width = undefined;
60
- } else if (oldLayoutIsNonWrapped && newLayoutIsWrapped) {
61
- // Can be here only if
62
- // 'full-width' or 'wide' or 'center' -> 'wrap-left' or 'wrap-right' or 'align-end' or 'align-start'
63
- // AND
64
- // !originalWidth || !lineLength || small image
65
- // AND
66
- // width defined!
67
-
68
- // cannot resize to full column width, and cannot resize to 1 column
69
- if (cols <= 1) {
70
- targetCols = 2;
71
- } else if (cols >= gridSize) {
72
- targetCols = 10;
73
- }
74
- }
75
- if (targetCols !== cols) {
76
- width = targetCols / gridSize * 100;
77
- }
78
- }
79
- return _objectSpread(_objectSpread({}, oldAttrs), {}, {
80
- layout: layout,
81
- width: width
82
- });
83
- };
84
- exports.alignAttributes = alignAttributes;
85
- function calculateSnapPoints(_ref) {
86
- var $pos = _ref.$pos,
87
- akEditorWideLayoutWidth = _ref.akEditorWideLayoutWidth,
88
- allowBreakoutSnapPoints = _ref.allowBreakoutSnapPoints,
89
- containerWidth = _ref.containerWidth,
90
- gridSize = _ref.gridSize,
91
- gridWidth = _ref.gridWidth,
92
- insideInlineLike = _ref.insideInlineLike,
93
- insideLayout = _ref.insideLayout,
94
- isVideoFile = _ref.isVideoFile,
95
- lineLength = _ref.lineLength,
96
- offsetLeft = _ref.offsetLeft,
97
- wrappedLayout = _ref.wrappedLayout;
98
- var snapTargets = [];
99
- for (var i = 0; i < gridWidth; i++) {
100
- var pxFromColumns = (0, _ui.calcPxFromColumns)(i, lineLength, gridWidth);
101
- snapTargets.push(insideLayout ? pxFromColumns : pxFromColumns - offsetLeft);
102
- }
103
- // full width
104
- snapTargets.push(lineLength - offsetLeft);
105
- var columns = wrappedLayout || insideInlineLike ? 1 : 2;
106
- var minimumWidth = (0, _ui.calcPxFromColumns)(columns, lineLength, gridSize);
107
- var snapPoints = snapTargets.filter(function (width) {
108
- return width >= minimumWidth;
109
- });
110
- if (!$pos) {
111
- return snapPoints;
112
- }
113
- snapPoints = isVideoFile ? snapPoints.filter(function (width) {
114
- return width > 320;
115
- }) : snapPoints;
116
- var isTopLevel = $pos.parent.type.name === 'doc';
117
- if (isTopLevel && allowBreakoutSnapPoints) {
118
- snapPoints.push(akEditorWideLayoutWidth);
119
- var fullWidthPoint = containerWidth - _editorSharedStyles.akEditorBreakoutPadding;
120
- if (fullWidthPoint > akEditorWideLayoutWidth) {
121
- snapPoints.push(fullWidthPoint);
122
- }
123
- }
124
-
125
- // EDM-1107: Ensure new snapPoints are sorted with existing points
126
- snapPoints = snapPoints.sort(function (a, b) {
127
- return a - b;
128
- });
129
- return snapPoints;
130
- }