@atlaskit/editor-core 220.0.3 → 220.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/codemods/createRenameVariableTransform.ts +17 -0
  3. package/codemods/findImportFromPackage.ts +54 -0
  4. package/codemods/migrates/createJSXRenameVariableToNestedKeyTransform.ts +43 -0
  5. package/codemods/migrates/createUpdateEditorToMigrationComponent.ts +25 -0
  6. package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +1 -1
  7. package/codemods/migrates/remove-config-panel-width-prop.ts +1 -1
  8. package/codemods/migrates/rename-editor-to-editor-migration-component.ts +1 -22
  9. package/codemods/migrates/rename-smartlinks-prop.ts +1 -40
  10. package/codemods/migrates/rename-unsafe-allowUndoRedoButtons-prop.ts +1 -1
  11. package/codemods/migrates/rename-unsafe-cards-prop.ts +1 -1
  12. package/codemods/utils.ts +0 -67
  13. package/dist/cjs/actions/isEmptyParagraph.js +12 -0
  14. package/dist/cjs/actions/temp-is-empty-document.js +2 -9
  15. package/dist/cjs/create-editor/ReactEditorView/useDispatchTransaction.js +2 -1
  16. package/dist/cjs/create-editor/ReactEditorView.js +6 -4
  17. package/dist/cjs/create-editor/addMetadataAttributes.js +36 -0
  18. package/dist/cjs/create-editor/create-editor.js +0 -62
  19. package/dist/cjs/create-editor/create-plugins-list.js +2 -15
  20. package/dist/cjs/create-editor/create-schema.js +4 -35
  21. package/dist/cjs/create-editor/createErrorReporter.js +14 -0
  22. package/dist/cjs/create-editor/createPMPlugins.js +39 -0
  23. package/dist/cjs/create-editor/fixExcludes.js +22 -0
  24. package/dist/cjs/create-editor/getScrollGutterOptions.js +19 -0
  25. package/dist/cjs/create-editor/sortByRank.js +9 -0
  26. package/dist/cjs/entry-points/test-utils.js +4 -2
  27. package/dist/cjs/isElementBySelectorInDocument.js +15 -0
  28. package/dist/cjs/setTextSelection.js +12 -0
  29. package/dist/cjs/test-utils.js +1 -18
  30. package/dist/cjs/ui/Addon/checkForModal.js +25 -0
  31. package/dist/cjs/ui/Addon/click-area-helper.js +5 -52
  32. package/dist/cjs/ui/Addon/outsideProsemirrorEditorClickHandler.js +35 -0
  33. package/dist/cjs/ui/Appearance/Chromeless.js +4 -16
  34. package/dist/cjs/ui/Appearance/ChromelessEditorContainer.js +19 -0
  35. package/dist/cjs/ui/Appearance/FullPage/CustomToolbarWrapperMigration.js +13 -0
  36. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +5 -2
  37. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +2 -15
  38. package/dist/cjs/ui/Appearance/FullPage/MainToolbarIconBeforeMigration.js +13 -0
  39. package/dist/cjs/ui/Appearance/FullPage/NonCustomToolbarWrapperMigration.js +13 -0
  40. package/dist/cjs/ui/EditorContentContainer/styles/mentions.js +19 -0
  41. package/dist/cjs/utils/combineQuickInsertProviders.js +16 -0
  42. package/dist/cjs/utils/extensions.js +0 -11
  43. package/dist/cjs/utils/getNodesVisibleInViewport.js +3 -12
  44. package/dist/cjs/utils/isNodeVisible.js +15 -0
  45. package/dist/cjs/utils/prepare-quick-insert-provider.js +2 -1
  46. package/dist/cjs/utils/validNode.js +14 -0
  47. package/dist/cjs/utils/validateNodes.js +3 -11
  48. package/dist/cjs/version-wrapper.js +1 -1
  49. package/dist/es2019/actions/isEmptyParagraph.js +6 -0
  50. package/dist/es2019/actions/temp-is-empty-document.js +1 -6
  51. package/dist/es2019/create-editor/ReactEditorView/useDispatchTransaction.js +2 -1
  52. package/dist/es2019/create-editor/ReactEditorView.js +3 -1
  53. package/dist/es2019/create-editor/addMetadataAttributes.js +29 -0
  54. package/dist/es2019/create-editor/create-editor.js +0 -53
  55. package/dist/es2019/create-editor/create-plugins-list.js +1 -13
  56. package/dist/es2019/create-editor/create-schema.js +2 -31
  57. package/dist/es2019/create-editor/createErrorReporter.js +8 -0
  58. package/dist/es2019/create-editor/createPMPlugins.js +30 -0
  59. package/dist/es2019/create-editor/fixExcludes.js +12 -0
  60. package/dist/es2019/create-editor/getScrollGutterOptions.js +13 -0
  61. package/dist/es2019/create-editor/sortByRank.js +3 -0
  62. package/dist/es2019/entry-points/test-utils.js +3 -1
  63. package/dist/es2019/isElementBySelectorInDocument.js +9 -0
  64. package/dist/es2019/setTextSelection.js +8 -0
  65. package/dist/es2019/test-utils.js +0 -18
  66. package/dist/es2019/ui/Addon/checkForModal.js +19 -0
  67. package/dist/es2019/ui/Addon/click-area-helper.js +2 -53
  68. package/dist/es2019/ui/Addon/outsideProsemirrorEditorClickHandler.js +33 -0
  69. package/dist/es2019/ui/Appearance/Chromeless.js +2 -12
  70. package/dist/es2019/ui/Appearance/ChromelessEditorContainer.js +12 -0
  71. package/dist/es2019/ui/Appearance/FullPage/CustomToolbarWrapperMigration.js +5 -0
  72. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -1
  73. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +1 -8
  74. package/dist/es2019/ui/Appearance/FullPage/MainToolbarIconBeforeMigration.js +5 -0
  75. package/dist/es2019/ui/Appearance/FullPage/NonCustomToolbarWrapperMigration.js +5 -0
  76. package/dist/es2019/ui/EditorContentContainer/styles/mentions.js +19 -0
  77. package/dist/es2019/utils/combineQuickInsertProviders.js +11 -0
  78. package/dist/es2019/utils/extensions.js +0 -11
  79. package/dist/es2019/utils/getNodesVisibleInViewport.js +1 -9
  80. package/dist/es2019/utils/isNodeVisible.js +9 -0
  81. package/dist/es2019/utils/prepare-quick-insert-provider.js +2 -1
  82. package/dist/es2019/utils/validNode.js +8 -0
  83. package/dist/es2019/utils/validateNodes.js +1 -8
  84. package/dist/es2019/version-wrapper.js +1 -1
  85. package/dist/esm/actions/isEmptyParagraph.js +6 -0
  86. package/dist/esm/actions/temp-is-empty-document.js +1 -6
  87. package/dist/esm/create-editor/ReactEditorView/useDispatchTransaction.js +2 -1
  88. package/dist/esm/create-editor/ReactEditorView.js +3 -1
  89. package/dist/esm/create-editor/addMetadataAttributes.js +29 -0
  90. package/dist/esm/create-editor/create-editor.js +0 -58
  91. package/dist/esm/create-editor/create-plugins-list.js +1 -13
  92. package/dist/esm/create-editor/create-schema.js +2 -31
  93. package/dist/esm/create-editor/createErrorReporter.js +8 -0
  94. package/dist/esm/create-editor/createPMPlugins.js +32 -0
  95. package/dist/esm/create-editor/fixExcludes.js +16 -0
  96. package/dist/esm/create-editor/getScrollGutterOptions.js +13 -0
  97. package/dist/esm/create-editor/sortByRank.js +3 -0
  98. package/dist/esm/entry-points/test-utils.js +3 -1
  99. package/dist/esm/isElementBySelectorInDocument.js +9 -0
  100. package/dist/esm/setTextSelection.js +6 -0
  101. package/dist/esm/test-utils.js +0 -16
  102. package/dist/esm/ui/Addon/checkForModal.js +19 -0
  103. package/dist/esm/ui/Addon/click-area-helper.js +2 -49
  104. package/dist/esm/ui/Addon/outsideProsemirrorEditorClickHandler.js +29 -0
  105. package/dist/esm/ui/Appearance/Chromeless.js +2 -14
  106. package/dist/esm/ui/Appearance/ChromelessEditorContainer.js +14 -0
  107. package/dist/esm/ui/Appearance/FullPage/CustomToolbarWrapperMigration.js +7 -0
  108. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -1
  109. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +1 -14
  110. package/dist/esm/ui/Appearance/FullPage/MainToolbarIconBeforeMigration.js +7 -0
  111. package/dist/esm/ui/Appearance/FullPage/NonCustomToolbarWrapperMigration.js +7 -0
  112. package/dist/esm/ui/EditorContentContainer/styles/mentions.js +19 -0
  113. package/dist/esm/utils/combineQuickInsertProviders.js +10 -0
  114. package/dist/esm/utils/extensions.js +0 -10
  115. package/dist/esm/utils/getNodesVisibleInViewport.js +1 -9
  116. package/dist/esm/utils/isNodeVisible.js +9 -0
  117. package/dist/esm/utils/prepare-quick-insert-provider.js +2 -1
  118. package/dist/esm/utils/validNode.js +8 -0
  119. package/dist/esm/utils/validateNodes.js +1 -8
  120. package/dist/esm/version-wrapper.js +1 -1
  121. package/dist/types/actions/isEmptyParagraph.d.ts +5 -0
  122. package/dist/types/actions/temp-is-empty-document.d.ts +0 -4
  123. package/dist/types/composable-editor/editor-internal.d.ts +1 -1
  124. package/dist/types/create-editor/ReactEditorView.d.ts +2 -2
  125. package/dist/types/create-editor/addMetadataAttributes.d.ts +16 -0
  126. package/dist/types/create-editor/create-editor.d.ts +1 -17
  127. package/dist/types/create-editor/create-plugins-list.d.ts +1 -4
  128. package/dist/types/create-editor/create-schema.d.ts +0 -15
  129. package/dist/types/create-editor/create-universal-preset.d.ts +1 -1
  130. package/dist/types/create-editor/createErrorReporter.d.ts +3 -0
  131. package/dist/types/create-editor/createPMPlugins.d.ts +3 -0
  132. package/dist/types/create-editor/fixExcludes.d.ts +6 -0
  133. package/dist/types/create-editor/get-ui-component.d.ts +1 -1
  134. package/dist/types/create-editor/getScrollGutterOptions.d.ts +3 -0
  135. package/dist/types/create-editor/sortByRank.d.ts +5 -0
  136. package/dist/types/editor.d.ts +1 -1
  137. package/dist/types/entry-points/editor.d.ts +10 -1
  138. package/dist/types/entry-points/test-utils.d.ts +5 -2
  139. package/dist/types/index.d.ts +3 -1
  140. package/dist/types/isElementBySelectorInDocument.d.ts +7 -0
  141. package/dist/types/presets/universal.d.ts +1 -2
  142. package/dist/types/setTextSelection.d.ts +2 -0
  143. package/dist/types/test-utils.d.ts +1 -10
  144. package/dist/types/types/with-appearance-component.d.ts +1 -1
  145. package/dist/types/ui/Addon/ClickAreaBlock/contentComponentWrapper.d.ts +1 -1
  146. package/dist/types/ui/Addon/checkForModal.d.ts +10 -0
  147. package/dist/types/ui/Addon/click-area-helper.d.ts +0 -11
  148. package/dist/types/ui/Addon/outsideProsemirrorEditorClickHandler.d.ts +2 -0
  149. package/dist/types/ui/Appearance/Chromeless.d.ts +2 -10
  150. package/dist/types/ui/Appearance/ChromelessEditorContainer.d.ts +9 -0
  151. package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -1
  152. package/dist/types/ui/Appearance/FullPage/CustomToolbarWrapperMigration.d.ts +4 -0
  153. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  154. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
  155. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +1 -1
  156. package/dist/types/ui/Appearance/FullPage/FullPageToolbarNext.d.ts +1 -1
  157. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -10
  158. package/dist/types/ui/Appearance/FullPage/MainToolbarIconBeforeMigration.d.ts +4 -0
  159. package/dist/types/ui/Appearance/FullPage/NonCustomToolbarWrapperMigration.d.ts +4 -0
  160. package/dist/types/utils/combineQuickInsertProviders.d.ts +2 -0
  161. package/dist/types/utils/extensions.d.ts +0 -1
  162. package/dist/types/utils/getNodesVisibleInViewport.d.ts +0 -5
  163. package/dist/types/utils/isNodeVisible.d.ts +5 -0
  164. package/dist/types/utils/validNode.d.ts +2 -0
  165. package/dist/types/utils/validateNodes.d.ts +0 -1
  166. package/dist/types-ts4.5/actions/isEmptyParagraph.d.ts +5 -0
  167. package/dist/types-ts4.5/actions/temp-is-empty-document.d.ts +0 -4
  168. package/dist/types-ts4.5/composable-editor/editor-internal.d.ts +1 -1
  169. package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +2 -2
  170. package/dist/types-ts4.5/create-editor/addMetadataAttributes.d.ts +16 -0
  171. package/dist/types-ts4.5/create-editor/create-editor.d.ts +1 -17
  172. package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +1 -4
  173. package/dist/types-ts4.5/create-editor/create-schema.d.ts +0 -15
  174. package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +1 -1
  175. package/dist/types-ts4.5/create-editor/createErrorReporter.d.ts +3 -0
  176. package/dist/types-ts4.5/create-editor/createPMPlugins.d.ts +3 -0
  177. package/dist/types-ts4.5/create-editor/fixExcludes.d.ts +6 -0
  178. package/dist/types-ts4.5/create-editor/get-ui-component.d.ts +1 -1
  179. package/dist/types-ts4.5/create-editor/getScrollGutterOptions.d.ts +3 -0
  180. package/dist/types-ts4.5/create-editor/sortByRank.d.ts +5 -0
  181. package/dist/types-ts4.5/editor.d.ts +1 -1
  182. package/dist/types-ts4.5/entry-points/editor.d.ts +10 -1
  183. package/dist/types-ts4.5/entry-points/test-utils.d.ts +5 -2
  184. package/dist/types-ts4.5/index.d.ts +3 -1
  185. package/dist/types-ts4.5/isElementBySelectorInDocument.d.ts +7 -0
  186. package/dist/types-ts4.5/presets/universal.d.ts +1 -2
  187. package/dist/types-ts4.5/setTextSelection.d.ts +2 -0
  188. package/dist/types-ts4.5/test-utils.d.ts +1 -10
  189. package/dist/types-ts4.5/types/with-appearance-component.d.ts +1 -1
  190. package/dist/types-ts4.5/ui/Addon/ClickAreaBlock/contentComponentWrapper.d.ts +1 -1
  191. package/dist/types-ts4.5/ui/Addon/checkForModal.d.ts +10 -0
  192. package/dist/types-ts4.5/ui/Addon/click-area-helper.d.ts +0 -11
  193. package/dist/types-ts4.5/ui/Addon/outsideProsemirrorEditorClickHandler.d.ts +2 -0
  194. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +2 -10
  195. package/dist/types-ts4.5/ui/Appearance/ChromelessEditorContainer.d.ts +9 -0
  196. package/dist/types-ts4.5/ui/Appearance/Comment/Comment.d.ts +1 -1
  197. package/dist/types-ts4.5/ui/Appearance/FullPage/CustomToolbarWrapperMigration.d.ts +4 -0
  198. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  199. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
  200. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbar.d.ts +1 -1
  201. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbarNext.d.ts +1 -1
  202. package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbar.d.ts +0 -10
  203. package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbarIconBeforeMigration.d.ts +4 -0
  204. package/dist/types-ts4.5/ui/Appearance/FullPage/NonCustomToolbarWrapperMigration.d.ts +4 -0
  205. package/dist/types-ts4.5/utils/combineQuickInsertProviders.d.ts +2 -0
  206. package/dist/types-ts4.5/utils/extensions.d.ts +0 -1
  207. package/dist/types-ts4.5/utils/getNodesVisibleInViewport.d.ts +0 -5
  208. package/dist/types-ts4.5/utils/isNodeVisible.d.ts +5 -0
  209. package/dist/types-ts4.5/utils/validNode.d.ts +2 -0
  210. package/dist/types-ts4.5/utils/validateNodes.d.ts +0 -1
  211. package/package.json +11 -11
  212. package/dist/cjs/types/index.js +0 -1
  213. package/dist/es2019/types/index.js +0 -0
  214. package/dist/esm/types/index.js +0 -0
  215. package/dist/types/types/index.d.ts +0 -9
  216. package/dist/types-ts4.5/types/index.d.ts +0 -9
@@ -1,13 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React, { Fragment } from 'react';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
5
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
5
  import EditorContentContainer from '../EditorContentContainer/EditorContentContainer';
7
6
  import PluginSlot from '../PluginSlot';
8
7
  import WithFlash from '../WithFlash';
9
- import { ChromelessEditorContainerCompiled } from './Chromeless-compiled';
10
- import { ChromelessEditorContainerEmotion } from './Chromeless-emotion';
8
+ import { ChromelessEditorContainer } from './ChromelessEditorContainer';
11
9
  /**
12
10
  * Render the editor in a chromeless appearance.
13
11
  * Example use is the inline comment editor, which doesn't have editor toolbar
@@ -105,12 +103,4 @@ function RenderWithPluginState({
105
103
  return /*#__PURE__*/React.createElement(Fragment, null, renderChrome({
106
104
  maxContentSize
107
105
  }));
108
- }
109
-
110
- /**
111
- * Container for the chromeless editor appearance. This is used to set the max and min height
112
- * of the editor content area, and to provide a ref to the container element for the popups.
113
- * @param param0 props for the chromeless editor container
114
- * @returns JSX element representing the chromeless editor container
115
- */
116
- export const ChromelessEditorContainer = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), ChromelessEditorContainerCompiled, ChromelessEditorContainerEmotion);
106
+ }
@@ -0,0 +1,12 @@
1
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+ import { ChromelessEditorContainerCompiled } from './Chromeless-compiled';
4
+ import { ChromelessEditorContainerEmotion } from './Chromeless-emotion';
5
+
6
+ /**
7
+ * Container for the chromeless editor appearance. This is used to set the max and min height
8
+ * of the editor content area, and to provide a ref to the container element for the popups.
9
+ * @param param0 props for the chromeless editor container
10
+ * @returns JSX element representing the chromeless editor container
11
+ */
12
+ export const ChromelessEditorContainer = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), ChromelessEditorContainerCompiled, ChromelessEditorContainerEmotion);
@@ -0,0 +1,5 @@
1
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+ import { CustomToolbarWrapperCompiled } from './MainToolbar-compiled';
4
+ import { CustomToolbarWrapperEmotion } from './MainToolbar-emotion';
5
+ export const CustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), CustomToolbarWrapperCompiled, CustomToolbarWrapperEmotion);
@@ -8,8 +8,11 @@ import { ToolbarPortalMountPoint, useToolbarPortal } from '../../Toolbar/Toolbar
8
8
  import { ToolbarWithSizeDetector as Toolbar } from '../../Toolbar/ToolbarWithSizeDetector';
9
9
  import { BeforePrimaryToolbarWrapper } from './BeforeWrapper';
10
10
  import { MainToolbarForFirstChildWrapper, MainToolbarForSecondChildWrapper } from './CustomToolbarWrapper';
11
- import { CustomToolbarWrapperMigration, MainToolbarIconBeforeMigration, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, NonCustomToolbarWrapperMigration } from './MainToolbar';
11
+ import { CustomToolbarWrapperMigration } from './CustomToolbarWrapperMigration';
12
+ import { MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
13
+ import { MainToolbarIconBeforeMigration } from './MainToolbarIconBeforeMigration';
12
14
  import { MainToolbarWrapper } from './MainToolbarWrapper';
15
+ import { NonCustomToolbarWrapperMigration } from './NonCustomToolbarWrapperMigration';
13
16
  export const EditorToolbar = /*#__PURE__*/React.memo(props => {
14
17
  var _props$primaryToolbar, _useToolbarPortal, _props$customPrimaryT;
15
18
  const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
@@ -1,8 +1 @@
1
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
- import { CustomToolbarWrapperCompiled, MainToolbarIconBeforeCompiled, NonCustomToolbarWrapperCompiled } from './MainToolbar-compiled';
4
- import { CustomToolbarWrapperEmotion, MainToolbarIconBeforeEmotion, NonCustomToolbarWrapperEmotion } from './MainToolbar-emotion';
5
- export const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
6
- export const NonCustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), NonCustomToolbarWrapperCompiled, NonCustomToolbarWrapperEmotion);
7
- export const CustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), CustomToolbarWrapperCompiled, CustomToolbarWrapperEmotion);
8
- export const MainToolbarIconBeforeMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), MainToolbarIconBeforeCompiled, MainToolbarIconBeforeEmotion);
1
+ export const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
@@ -0,0 +1,5 @@
1
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+ import { MainToolbarIconBeforeCompiled } from './MainToolbar-compiled';
4
+ import { MainToolbarIconBeforeEmotion } from './MainToolbar-emotion';
5
+ export const MainToolbarIconBeforeMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), MainToolbarIconBeforeCompiled, MainToolbarIconBeforeEmotion);
@@ -0,0 +1,5 @@
1
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+ import { NonCustomToolbarWrapperCompiled } from './MainToolbar-compiled';
4
+ import { NonCustomToolbarWrapperEmotion } from './MainToolbar-emotion';
5
+ export const NonCustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), NonCustomToolbarWrapperCompiled, NonCustomToolbarWrapperEmotion);
@@ -88,6 +88,25 @@ export const mentionNodeStyles = css({
88
88
  '&:active': {
89
89
  background: "var(--ds-background-brand-bold-pressed, #144794)"
90
90
  }
91
+ },
92
+ // Disabled variant — mirrors `MentionType.DISABLED` in
93
+ // `packages/elements/mention/src/components/Mention/PrimitiveMention.tsx`.
94
+ // Hover / active states are intentionally flat: a disabled chip should
95
+ // not respond to mouse interaction. The chip is still keyboard-focusable
96
+ // (see `MentionNodeView.setClassList`) so the focus ring is still
97
+ // allowed to render via `:focus-visible`.
98
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
99
+ '.editor-mention-primitive.mention-disabled': {
100
+ background: "var(--ds-background-disabled, #0515240F)",
101
+ border: '1px solid transparent',
102
+ color: "var(--ds-text-disabled, #080F214A)",
103
+ cursor: 'default',
104
+ '&:hover': {
105
+ background: "var(--ds-background-disabled, #0515240F)"
106
+ },
107
+ '&:active': {
108
+ background: "var(--ds-background-disabled, #0515240F)"
109
+ }
91
110
  }
92
111
  });
93
112
 
@@ -0,0 +1,11 @@
1
+ import { combineProviders } from '@atlaskit/editor-common/provider-helpers';
2
+ export function combineQuickInsertProviders(quickInsertProviders) {
3
+ const {
4
+ invokeList
5
+ } = combineProviders(quickInsertProviders);
6
+ return {
7
+ getItems() {
8
+ return invokeList('getItems');
9
+ }
10
+ };
11
+ }
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import Loadable from 'react-loadable';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { getQuickInsertItemsFromModule, resolveImport } from '@atlaskit/editor-common/extensions';
5
- import { combineProviders } from '@atlaskit/editor-common/provider-helpers';
6
5
  import { findInsertLocation } from '@atlaskit/editor-common/utils/analytics';
7
6
  import { fg } from '@atlaskit/platform-feature-flags';
8
7
 
@@ -130,14 +129,4 @@ export async function extensionProviderToQuickInsertProvider(extensionProvider,
130
129
  return Promise.all(quickInsertItems);
131
130
  }
132
131
  };
133
- }
134
- export function combineQuickInsertProviders(quickInsertProviders) {
135
- const {
136
- invokeList
137
- } = combineProviders(quickInsertProviders);
138
- return {
139
- getItems() {
140
- return invokeList('getItems');
141
- }
142
- };
143
132
  }
@@ -1,12 +1,4 @@
1
- /**
2
- * Check if a DOM element is visible within the viewport. We deem a node visible if the top left corner coordinate is within the viewport.
3
- * This may not look visible, and may include a node that looks below the fold – but it's more than 0 pixels within the viewport.
4
- */
5
- export const isNodeVisible = node => {
6
- const rect = node.getBoundingClientRect();
7
- const isVisible = rect.x >= 0 && rect.x < window.innerWidth && rect.y >= 0 && rect.y < window.innerHeight;
8
- return isVisible;
9
- };
1
+ import { isNodeVisible } from './isNodeVisible';
10
2
 
11
3
  /**
12
4
  * Get visible nodes in viewport by looping through the first N nodes (MAX_NODES_TO_COUNT)
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Check if a DOM element is visible within the viewport. We deem a node visible if the top left corner coordinate is within the viewport.
3
+ * This may not look visible, and may include a node that looks below the fold – but it's more than 0 pixels within the viewport.
4
+ */
5
+ export const isNodeVisible = node => {
6
+ const rect = node.getBoundingClientRect();
7
+ const isVisible = rect.x >= 0 && rect.x < window.innerWidth && rect.y >= 0 && rect.y < window.innerHeight;
8
+ return isVisible;
9
+ };
@@ -1,4 +1,5 @@
1
- import { combineQuickInsertProviders, extensionProviderToQuickInsertProvider } from './extensions';
1
+ import { combineQuickInsertProviders } from './combineQuickInsertProviders';
2
+ import { extensionProviderToQuickInsertProvider } from './extensions';
2
3
 
3
4
  /**
4
5
  *
@@ -0,0 +1,8 @@
1
+ export const validNode = node => {
2
+ try {
3
+ node.check();
4
+ } catch (error) {
5
+ return false;
6
+ }
7
+ return true;
8
+ };
@@ -1,11 +1,4 @@
1
- export const validNode = node => {
2
- try {
3
- node.check();
4
- } catch (error) {
5
- return false;
6
- }
7
- return true;
8
- };
1
+ import { validNode } from './validNode';
9
2
 
10
3
  /** Validates prosemirror nodes, and returns true only if all nodes are valid */
11
4
  export const validateNodes = nodes => nodes.every(validNode);
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "220.0.2";
2
+ export const version = "220.0.3";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Checks if node is an empty paragraph.
3
+ */
4
+ export function isEmptyParagraph(node) {
5
+ return !!node && node.type.name === 'paragraph' && !node.childCount;
6
+ }
@@ -5,12 +5,7 @@
5
5
  * help decouple it from editor-common
6
6
  */
7
7
 
8
- /**
9
- * Checks if node is an empty paragraph.
10
- */
11
- export function isEmptyParagraph(node) {
12
- return !!node && node.type.name === 'paragraph' && !node.childCount;
13
- }
8
+ import { isEmptyParagraph } from './isEmptyParagraph';
14
9
 
15
10
  /**
16
11
  * Checks if a node looks like an empty document
@@ -6,7 +6,8 @@ import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-m
6
6
  import { findChangedNodesFromTransaction } from '../../utils/findChangedNodesFromTransaction';
7
7
  import { freezeUnsafeTransactionProperties } from '../../utils/performance/safer-transactions';
8
8
  import { EVENT_NAME_ON_CHANGE } from '../../utils/performance/track-transactions';
9
- import { validateNodes, validNode } from '../../utils/validateNodes';
9
+ import { validateNodes } from '../../utils/validateNodes';
10
+ import { validNode } from '../../utils/validNode';
10
11
  export var useDispatchTransaction = function useDispatchTransaction(_ref) {
11
12
  var onChange = _ref.onChange,
12
13
  dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
@@ -44,9 +44,11 @@ import { isFullPage } from '../utils/is-full-page';
44
44
  import { RenderTracking } from '../utils/performance/components/RenderTracking';
45
45
  import measurements from '../utils/performance/measure-enum';
46
46
  import { PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD } from './consts';
47
- import { createErrorReporter, createPMPlugins, processPluginsList } from './create-editor';
47
+ import { processPluginsList } from './create-editor';
48
48
  import createPluginsList from './create-plugins-list';
49
49
  import { createSchema } from './create-schema';
50
+ import { createErrorReporter } from './createErrorReporter';
51
+ import { createPMPlugins } from './createPMPlugins';
50
52
  import { filterPluginsForReconfigure } from './filter-plugins-for-reconfigure';
51
53
  import { editorMessages } from './messages';
52
54
  import { focusEditorElement } from './ReactEditorView/focusEditorElement';
@@ -0,0 +1,29 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ import { createProseMirrorMetadata } from '@atlaskit/editor-common/prosemirror-dom-metadata';
3
+ /**
4
+ * 🧱 Internal Helper Function: Editor FE Platform
5
+ *
6
+ * Adds generic metadata attributes to a DOMOutputSpec array based on the provided node or mark.
7
+ * This function ensures that the DOMOutputSpec is annotated with ProseMirror-specific metadata.
8
+ *
9
+ * @param {object} params - Parameters object.
10
+ * @param {PMNode | PMMark} params.nodeOrMark - The ProseMirror node or mark to extract metadata from.
11
+ * @param {DOMOutputSpec} params.domSpec - The DOMOutputSpec to which attributes will be added.
12
+ * @returns {DOMOutputSpec} The modified DOMOutputSpec with additional metadata.
13
+ */
14
+ export var addMetadataAttributes = function addMetadataAttributes(_ref) {
15
+ var nodeOrMark = _ref.nodeOrMark,
16
+ domSpec = _ref.domSpec;
17
+ if (!Array.isArray(domSpec)) {
18
+ return domSpec;
19
+ }
20
+ var maybeDefinedAttributes = domSpec[1];
21
+ var metadata = createProseMirrorMetadata(nodeOrMark);
22
+ var hasDefinedAttributes = _typeof(maybeDefinedAttributes) === 'object' && !Array.isArray(maybeDefinedAttributes);
23
+ if (hasDefinedAttributes) {
24
+ domSpec[1] = Object.assign(maybeDefinedAttributes, metadata);
25
+ } else {
26
+ domSpec.splice(1, 0, metadata);
27
+ }
28
+ return domSpec;
29
+ };
@@ -1,28 +1,4 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
3
- import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
4
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
- import { createEditorNativeAnchorSupportPlugin } from './editorNativeAnchorSupportPlugin';
6
- import { createEditorStateNotificationPlugin } from './editorStateNotificationPlugin';
7
- export function sortByRank(a, b) {
8
- return a.rank - b.rank;
9
- }
10
- export function fixExcludes(marks) {
11
- var markKeys = Object.keys(marks);
12
- var markGroups = new Set(markKeys.map(function (mark) {
13
- return marks[mark].group;
14
- }));
15
- markKeys.forEach(function (markKey) {
16
- var mark = marks[markKey];
17
- if (mark.excludes) {
18
- // eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
19
- mark.excludes = mark.excludes.split(' ').filter(function (group) {
20
- return markGroups.has(group);
21
- }).join(' ');
22
- }
23
- });
24
- return marks;
25
- }
26
2
  export function processPluginsList(plugins) {
27
3
  /**
28
4
  * First pass to collect pluginsOptions
@@ -91,38 +67,4 @@ export function processPluginsList(plugins) {
91
67
  secondaryToolbarComponents: [],
92
68
  onEditorViewStateUpdatedCallbacks: []
93
69
  });
94
- }
95
- export function createPMPlugins(config) {
96
- var editorConfig = config.editorConfig;
97
- var pmPlugins = editorConfig.pmPlugins.sort(sortByOrder('plugins')).map(function (_ref) {
98
- var plugin = _ref.plugin;
99
- return plugin({
100
- schema: config.schema,
101
- dispatch: config.dispatch,
102
- eventDispatcher: config.eventDispatcher,
103
- providerFactory: config.providerFactory,
104
- errorReporter: config.errorReporter,
105
- portalProviderAPI: config.portalProviderAPI,
106
- nodeViewPortalProviderAPI: config.nodeViewPortalProviderAPI,
107
- dispatchAnalyticsEvent: config.dispatchAnalyticsEvent,
108
- featureFlags: config.featureFlags || {},
109
- getIntl: config.getIntl
110
- });
111
- }).filter(function (plugin) {
112
- return typeof plugin !== 'undefined';
113
- });
114
- if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
115
- pmPlugins.push(createEditorNativeAnchorSupportPlugin(config.schema));
116
- }
117
- if (config.onEditorStateUpdated !== undefined) {
118
- return [createEditorStateNotificationPlugin(config.onEditorStateUpdated, config.editorConfig.onEditorViewStateUpdatedCallbacks)].concat(_toConsumableArray(pmPlugins));
119
- }
120
- return pmPlugins;
121
- }
122
- export function createErrorReporter(errorReporterHandler) {
123
- var errorReporter = new ErrorReporter();
124
- if (errorReporterHandler) {
125
- errorReporter.handler = errorReporterHandler;
126
- }
127
- return errorReporter;
128
70
  }
@@ -2,23 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
5
- import { isFullPage as fullPageCheck } from '../utils/is-full-page';
5
+ import { getScrollGutterOptions } from './getScrollGutterOptions';
6
6
  var isCodeBlockAllowed = function isCodeBlockAllowed(options) {
7
7
  var exclude = options && options.allowBlockType && options.allowBlockType.exclude ? options.allowBlockType.exclude : [];
8
8
  return exclude.indexOf('codeBlock') === -1;
9
9
  };
10
- export function getScrollGutterOptions(props) {
11
- var appearance = props.appearance;
12
- if (fullPageCheck(appearance)) {
13
- // Full Page appearance uses a scrollable div wrapper.
14
- return {
15
- getScrollElement: function getScrollElement() {
16
- return document.querySelector('.fabric-editor-popup-scroll-parent');
17
- }
18
- };
19
- }
20
- return undefined;
21
- }
22
10
  export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent
23
11
  // Omit placeholder since it's an existing prop in `DefaultPresetPluginOptions` and will get overridden there
24
12
  ) {
@@ -1,37 +1,8 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import { sanitizeNodes } from '@atlaskit/adf-schema/schema';
3
2
  import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
4
- import { createProseMirrorMetadata } from '@atlaskit/editor-common/prosemirror-dom-metadata';
5
3
  import { Schema } from '@atlaskit/editor-prosemirror/model';
6
- import { fixExcludes } from './create-editor';
7
- /**
8
- * 🧱 Internal Helper Function: Editor FE Platform
9
- *
10
- * Adds generic metadata attributes to a DOMOutputSpec array based on the provided node or mark.
11
- * This function ensures that the DOMOutputSpec is annotated with ProseMirror-specific metadata.
12
- *
13
- * @param {object} params - Parameters object.
14
- * @param {PMNode | PMMark} params.nodeOrMark - The ProseMirror node or mark to extract metadata from.
15
- * @param {DOMOutputSpec} params.domSpec - The DOMOutputSpec to which attributes will be added.
16
- * @returns {DOMOutputSpec} The modified DOMOutputSpec with additional metadata.
17
- */
18
- export var addMetadataAttributes = function addMetadataAttributes(_ref) {
19
- var nodeOrMark = _ref.nodeOrMark,
20
- domSpec = _ref.domSpec;
21
- if (!Array.isArray(domSpec)) {
22
- return domSpec;
23
- }
24
- var maybeDefinedAttributes = domSpec[1];
25
- var metadata = createProseMirrorMetadata(nodeOrMark);
26
- var hasDefinedAttributes = _typeof(maybeDefinedAttributes) === 'object' && !Array.isArray(maybeDefinedAttributes);
27
- if (hasDefinedAttributes) {
28
- domSpec[1] = Object.assign(maybeDefinedAttributes, metadata);
29
- } else {
30
- domSpec.splice(1, 0, metadata);
31
- }
32
- return domSpec;
33
- };
34
-
4
+ import { addMetadataAttributes } from './addMetadataAttributes';
5
+ import { fixExcludes } from './fixExcludes';
35
6
  /**
36
7
  * 🧱 Internal Helper Function: Editor FE Platform
37
8
  *
@@ -0,0 +1,8 @@
1
+ import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
2
+ export function createErrorReporter(errorReporterHandler) {
3
+ var errorReporter = new ErrorReporter();
4
+ if (errorReporterHandler) {
5
+ errorReporter.handler = errorReporterHandler;
6
+ }
7
+ return errorReporter;
8
+ }
@@ -0,0 +1,32 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
+ import { createEditorNativeAnchorSupportPlugin } from './editorNativeAnchorSupportPlugin';
5
+ import { createEditorStateNotificationPlugin } from './editorStateNotificationPlugin';
6
+ export function createPMPlugins(config) {
7
+ var editorConfig = config.editorConfig;
8
+ var pmPlugins = editorConfig.pmPlugins.sort(sortByOrder('plugins')).map(function (_ref) {
9
+ var plugin = _ref.plugin;
10
+ return plugin({
11
+ schema: config.schema,
12
+ dispatch: config.dispatch,
13
+ eventDispatcher: config.eventDispatcher,
14
+ providerFactory: config.providerFactory,
15
+ errorReporter: config.errorReporter,
16
+ portalProviderAPI: config.portalProviderAPI,
17
+ nodeViewPortalProviderAPI: config.nodeViewPortalProviderAPI,
18
+ dispatchAnalyticsEvent: config.dispatchAnalyticsEvent,
19
+ featureFlags: config.featureFlags || {},
20
+ getIntl: config.getIntl
21
+ });
22
+ }).filter(function (plugin) {
23
+ return typeof plugin !== 'undefined';
24
+ });
25
+ if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
26
+ pmPlugins.push(createEditorNativeAnchorSupportPlugin(config.schema));
27
+ }
28
+ if (config.onEditorStateUpdated !== undefined) {
29
+ return [createEditorStateNotificationPlugin(config.onEditorStateUpdated, config.editorConfig.onEditorViewStateUpdatedCallbacks)].concat(_toConsumableArray(pmPlugins));
30
+ }
31
+ return pmPlugins;
32
+ }
@@ -0,0 +1,16 @@
1
+ export function fixExcludes(marks) {
2
+ var markKeys = Object.keys(marks);
3
+ var markGroups = new Set(markKeys.map(function (mark) {
4
+ return marks[mark].group;
5
+ }));
6
+ markKeys.forEach(function (markKey) {
7
+ var mark = marks[markKey];
8
+ if (mark.excludes) {
9
+ // eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
10
+ mark.excludes = mark.excludes.split(' ').filter(function (group) {
11
+ return markGroups.has(group);
12
+ }).join(' ');
13
+ }
14
+ });
15
+ return marks;
16
+ }
@@ -0,0 +1,13 @@
1
+ import { isFullPage as fullPageCheck } from '../utils/is-full-page';
2
+ export function getScrollGutterOptions(props) {
3
+ var appearance = props.appearance;
4
+ if (fullPageCheck(appearance)) {
5
+ // Full Page appearance uses a scrollable div wrapper.
6
+ return {
7
+ getScrollElement: function getScrollElement() {
8
+ return document.querySelector('.fabric-editor-popup-scroll-parent');
9
+ }
10
+ };
11
+ }
12
+ return undefined;
13
+ }
@@ -0,0 +1,3 @@
1
+ export function sortByRank(a, b) {
2
+ return a.rank - b.rank;
3
+ }
@@ -1,2 +1,4 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
- export { createPMSchemaAndPlugins, isElementBySelectorInDocument, setTextSelection } from '../test-utils';
2
+ export { isElementBySelectorInDocument } from '../isElementBySelectorInDocument';
3
+ export { setTextSelection } from '../setTextSelection';
4
+ export { createPMSchemaAndPlugins } from '../test-utils';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Given a selector, checks if an element matching the selector exists in the
3
+ * document.
4
+ * @param selector
5
+ * @returns true if element matching selector exists in document, false otherwise
6
+ */
7
+ export var isElementBySelectorInDocument = function isElementBySelectorInDocument(selector) {
8
+ return Boolean(document.querySelector(selector));
9
+ };
@@ -0,0 +1,6 @@
1
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
2
+ export function setTextSelection(view, anchor, head) {
3
+ var state = view.state;
4
+ var tr = state.tr.setSelection(TextSelection.create(state.doc, anchor, head));
5
+ view.dispatch(tr);
6
+ }
@@ -8,7 +8,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
8
8
  import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
9
9
  import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
10
10
  import { basePlugin } from '@atlaskit/editor-plugins/base';
11
- import { TextSelection } from '@atlaskit/editor-prosemirror/state';
12
11
  import { createSchema } from './create-editor/create-schema';
13
12
  function lightProcessPluginsList(editorPlugins) {
14
13
  /**
@@ -96,19 +95,4 @@ export var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
96
95
  editorConfig: editorConfig
97
96
  };
98
97
  };
99
- };
100
- export function setTextSelection(view, anchor, head) {
101
- var state = view.state;
102
- var tr = state.tr.setSelection(TextSelection.create(state.doc, anchor, head));
103
- view.dispatch(tr);
104
- }
105
-
106
- /**
107
- * Given a selector, checks if an element matching the selector exists in the
108
- * document.
109
- * @param selector
110
- * @returns true if element matching selector exists in document, false otherwise
111
- */
112
- export var isElementBySelectorInDocument = function isElementBySelectorInDocument(selector) {
113
- return Boolean(document.querySelector(selector));
114
98
  };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @see ED-14699 - check if editor is inside a modal to continue to bring cursor to input when
3
+ * any part of the editor container is clicked
4
+ *
5
+ * Handles two cases when a click event is fired:
6
+ *
7
+ * 1. if editor (e.g. comment inside of Jira ticket view) is inside modal then ensure focus and cursor is brought to the input
8
+ * 2. if another modal is open (e.g. delete confirmation modal for confluence table) then ignore clicks as they shouldn't influence editor state
9
+ */
10
+ export var checkForModal = function checkForModal(target) {
11
+ var modalDialog = target === null || target === void 0 ? void 0 : target.closest('[role=dialog]');
12
+ if (modalDialog) {
13
+ // return false if not an editor inside modal, otherwise return true
14
+ return !!(modalDialog !== null && modalDialog !== void 0 && modalDialog.querySelector('.akEditor'));
15
+ }
16
+
17
+ // no modal present so we can return true
18
+ return true;
19
+ };