@atlaskit/editor-core 167.0.3 → 169.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 (193) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cjs/create-editor/create-plugins-list.js +7 -0
  3. package/dist/cjs/plugins/analytics/types/toolbar-button.js +2 -0
  4. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
  5. package/dist/cjs/plugins/breakout/index.js +7 -0
  6. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +3 -1
  7. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +6 -1
  8. package/dist/cjs/plugins/card/styles.js +4 -2
  9. package/dist/cjs/plugins/card/toolbar.js +6 -1
  10. package/dist/cjs/plugins/code-block/styles.js +17 -41
  11. package/dist/cjs/plugins/code-block/ui/class-names.js +5 -2
  12. package/dist/cjs/plugins/collab-edit/index.js +2 -2
  13. package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
  14. package/dist/cjs/plugins/copy-button/commands.js +85 -0
  15. package/dist/cjs/plugins/copy-button/index.js +27 -0
  16. package/dist/cjs/plugins/copy-button/pm-plugins/main.js +38 -0
  17. package/dist/cjs/plugins/copy-button/pm-plugins/plugin-key.js +11 -0
  18. package/dist/cjs/plugins/copy-button/utils.js +51 -0
  19. package/dist/cjs/plugins/extension/context-panel.js +2 -2
  20. package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -2
  21. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  22. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
  23. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  24. package/dist/cjs/plugins/indentation/messages.js +23 -0
  25. package/dist/cjs/plugins/index.js +16 -0
  26. package/dist/cjs/plugins/list/index.js +0 -43
  27. package/dist/cjs/plugins/macro/actions.js +2 -2
  28. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +2 -2
  29. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  30. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  31. package/dist/cjs/plugins/panel/toolbar.js +10 -2
  32. package/dist/cjs/plugins/table/commands/hover.js +2 -2
  33. package/dist/cjs/plugins/table/toolbar.js +5 -1
  34. package/dist/cjs/plugins/table/utils/decoration.js +5 -1
  35. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +65 -0
  36. package/dist/cjs/plugins/toolbar-lists-indentation/types.js +5 -0
  37. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +122 -0
  38. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +173 -0
  39. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +58 -0
  40. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +48 -0
  41. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -5
  42. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +17 -51
  43. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +2 -2
  44. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
  45. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
  46. package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
  47. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +12 -39
  48. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +31 -87
  49. package/dist/cjs/utils/clipboard.js +67 -2
  50. package/dist/cjs/version-wrapper.js +1 -1
  51. package/dist/cjs/version.json +1 -1
  52. package/dist/es2019/create-editor/create-plugins-list.js +8 -1
  53. package/dist/es2019/plugins/analytics/types/toolbar-button.js +2 -0
  54. package/dist/es2019/plugins/breakout/index.js +7 -0
  55. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +3 -1
  56. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +6 -1
  57. package/dist/es2019/plugins/card/styles.js +5 -0
  58. package/dist/es2019/plugins/card/toolbar.js +5 -1
  59. package/dist/es2019/plugins/code-block/styles.js +18 -95
  60. package/dist/es2019/plugins/code-block/ui/class-names.js +3 -2
  61. package/dist/es2019/plugins/copy-button/commands.js +64 -0
  62. package/dist/es2019/plugins/copy-button/index.js +15 -0
  63. package/dist/es2019/plugins/copy-button/pm-plugins/main.js +28 -0
  64. package/dist/es2019/plugins/copy-button/pm-plugins/plugin-key.js +2 -0
  65. package/dist/es2019/plugins/copy-button/utils.js +29 -0
  66. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  67. package/dist/es2019/plugins/indentation/messages.js +14 -0
  68. package/dist/es2019/plugins/index.js +3 -1
  69. package/dist/es2019/plugins/list/index.js +1 -44
  70. package/dist/es2019/plugins/panel/toolbar.js +9 -2
  71. package/dist/es2019/plugins/table/commands/hover.js +2 -2
  72. package/dist/es2019/plugins/table/toolbar.js +5 -2
  73. package/dist/es2019/plugins/table/utils/decoration.js +5 -1
  74. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +53 -0
  75. package/dist/es2019/plugins/toolbar-lists-indentation/types.js +1 -0
  76. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +94 -0
  77. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +149 -0
  78. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +49 -0
  79. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +35 -0
  80. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +11 -10
  81. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +17 -48
  82. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +10 -30
  83. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +34 -93
  84. package/dist/es2019/utils/clipboard.js +26 -0
  85. package/dist/es2019/version-wrapper.js +1 -1
  86. package/dist/es2019/version.json +1 -1
  87. package/dist/esm/actions/index.js +1 -1
  88. package/dist/esm/create-editor/ErrorBoundary.js +1 -1
  89. package/dist/esm/create-editor/create-plugins-list.js +8 -1
  90. package/dist/esm/editor.js +2 -1
  91. package/dist/esm/plugins/analytics/types/toolbar-button.js +2 -0
  92. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  93. package/dist/esm/plugins/breakout/index.js +7 -0
  94. package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -1
  95. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +6 -1
  96. package/dist/esm/plugins/card/styles.js +2 -1
  97. package/dist/esm/plugins/card/toolbar.js +5 -1
  98. package/dist/esm/plugins/code-block/styles.js +16 -35
  99. package/dist/esm/plugins/code-block/ui/class-names.js +3 -2
  100. package/dist/esm/plugins/collab-edit/index.js +1 -1
  101. package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
  102. package/dist/esm/plugins/copy-button/commands.js +66 -0
  103. package/dist/esm/plugins/copy-button/index.js +17 -0
  104. package/dist/esm/plugins/copy-button/pm-plugins/main.js +26 -0
  105. package/dist/esm/plugins/copy-button/pm-plugins/plugin-key.js +2 -0
  106. package/dist/esm/plugins/copy-button/utils.js +31 -0
  107. package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
  108. package/dist/esm/plugins/custom-autoformat/index.js +1 -1
  109. package/dist/esm/plugins/extension/actions.js +1 -1
  110. package/dist/esm/plugins/extension/context-panel.js +1 -1
  111. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -1
  112. package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
  113. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  114. package/dist/esm/plugins/feedback-dialog/index.js +1 -1
  115. package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
  116. package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -1
  117. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
  118. package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
  119. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -1
  120. package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
  121. package/dist/esm/plugins/indentation/messages.js +14 -0
  122. package/dist/esm/plugins/index.js +3 -1
  123. package/dist/esm/plugins/list/index.js +1 -41
  124. package/dist/esm/plugins/macro/actions.js +1 -1
  125. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
  126. package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -1
  127. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
  128. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +1 -1
  129. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  130. package/dist/esm/plugins/media/picker-facade.js +1 -1
  131. package/dist/esm/plugins/media/pm-plugins/main.js +1 -1
  132. package/dist/esm/plugins/media/toolbar/utils.js +1 -1
  133. package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
  134. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
  135. package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
  136. package/dist/esm/plugins/panel/toolbar.js +9 -2
  137. package/dist/esm/plugins/paste/handlers.js +1 -1
  138. package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
  139. package/dist/esm/plugins/quick-insert/index.js +1 -1
  140. package/dist/esm/plugins/table/commands/hover.js +2 -2
  141. package/dist/esm/plugins/table/toolbar.js +5 -2
  142. package/dist/esm/plugins/table/utils/decoration.js +5 -1
  143. package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
  144. package/dist/esm/plugins/toolbar-lists-indentation/index.js +51 -0
  145. package/dist/esm/plugins/toolbar-lists-indentation/types.js +1 -0
  146. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +96 -0
  147. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +153 -0
  148. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +47 -0
  149. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +39 -0
  150. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +6 -8
  151. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +18 -51
  152. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
  153. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
  154. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
  155. package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
  156. package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
  157. package/dist/esm/ui/ElementBrowser/InsertMenu.js +12 -35
  158. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +31 -89
  159. package/dist/esm/ui/LinkSearch/index.js +1 -1
  160. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  161. package/dist/esm/utils/action.js +1 -1
  162. package/dist/esm/utils/clipboard.js +56 -1
  163. package/dist/esm/utils/extensions.js +1 -1
  164. package/dist/esm/version-wrapper.js +1 -1
  165. package/dist/esm/version.json +1 -1
  166. package/dist/types/plugins/analytics/types/toolbar-button.d.ts +3 -1
  167. package/dist/types/plugins/card/styles.d.ts +1 -0
  168. package/dist/types/plugins/copy-button/commands.d.ts +4 -0
  169. package/dist/types/plugins/copy-button/index.d.ts +3 -0
  170. package/dist/types/plugins/copy-button/pm-plugins/main.d.ts +3 -0
  171. package/dist/types/plugins/copy-button/pm-plugins/plugin-key.d.ts +2 -0
  172. package/dist/types/plugins/copy-button/utils.d.ts +7 -0
  173. package/dist/types/plugins/indentation/messages.d.ts +12 -0
  174. package/dist/types/plugins/index.d.ts +2 -0
  175. package/dist/types/plugins/panel/toolbar.d.ts +1 -1
  176. package/dist/types/plugins/table/commands/hover.d.ts +1 -1
  177. package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
  178. package/dist/types/plugins/text-formatting/utils.d.ts +1 -1
  179. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +5 -0
  180. package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +16 -0
  181. package/dist/types/plugins/toolbar-lists-indentation/ui/Toolbar.d.ts +4 -0
  182. package/dist/types/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.d.ts +9 -0
  183. package/dist/types/plugins/{list/ui/ToolbarLists → toolbar-lists-indentation/ui}/index.d.ts +4 -10
  184. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +6 -0
  185. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +0 -25
  186. package/dist/types/types/feature-flags.d.ts +18 -0
  187. package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +11 -0
  188. package/dist/types/utils/clipboard.d.ts +1 -0
  189. package/package.json +25 -25
  190. package/report.api.md +6747 -0
  191. package/dist/cjs/plugins/list/ui/ToolbarLists/index.js +0 -266
  192. package/dist/es2019/plugins/list/ui/ToolbarLists/index.js +0 -220
  193. package/dist/esm/plugins/list/ui/ToolbarLists/index.js +0 -241
@@ -147,7 +147,9 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
147
147
  boundariesElement: boundariesElement,
148
148
  scrollableElement: scrollableElement,
149
149
  stick: true,
150
- forcePlacement: true
150
+ forcePlacement: true,
151
+ scheduleExtraLayoutUpdates: true,
152
+ waitForExtraLayoutUpdates: true
151
153
  }, jsx("div", {
152
154
  css: toolbarButtonWrapper
153
155
  }, jsx(ToolbarButton, {
@@ -6,7 +6,12 @@ import { replaceQueuedUrlWithCard, handleFallbackWithAnalytics } from '../doc';
6
6
  // Used for all interactions with the EditorCardProvider.
7
7
  // ============================================================================ //
8
8
  export var resolveWithProvider = function resolveWithProvider(view, outstandingRequests, provider, request, options) {
9
- var handleResolve = provider.resolve(request.url, request.appearance).then(function (resolvedCard) {
9
+ // When user manually changes appearance from blue link to smart link, we should respect that,
10
+ var shouldForceAppearance = // This flag is set to true only in one place atm:
11
+ // packages/editor/editor-core/src/plugins/card/pm-plugins/doc.ts @ convertHyperlinkToSmartCard
12
+ // Which is used when user switching from URL to smart link appearance.
13
+ !!request.shouldReplaceLink;
14
+ var handleResolve = provider.resolve(request.url, request.appearance, shouldForceAppearance).then(function (resolvedCard) {
10
15
  delete outstandingRequests[request.url];
11
16
  return resolvedCard;
12
17
  }).then(handleResolved(view, request, options), handleRejected(view, request));
@@ -8,4 +8,5 @@ import { N20 } from '@atlaskit/theme/colors';
8
8
  import { SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
9
9
  import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
10
10
  import { token } from '@atlaskit/tokens';
11
- export var smartCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n margin-bottom: -0.5em;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n }\n\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.background.neutral.subtle.hovered', N20), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), token('color.border.danger', akEditorDeleteBorder), token('color.background.danger', akEditorDeleteBackground), token('color.border.danger', akEditorDeleteBorder));
11
+ export var FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
12
+ export var smartCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n margin-bottom: -0.5em;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n }\n\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n\n .", " {\n padding: 0;\n }\n"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.background.neutral.subtle.hovered', N20), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), token('color.border.danger', akEditorDeleteBorder), token('color.background.danger', akEditorDeleteBackground), token('color.border.danger', akEditorDeleteBorder), FLOATING_TOOLBAR_LINKPICKER_CLASSNAME);
@@ -25,6 +25,7 @@ import { LinkToolbarAppearance } from './ui/LinkToolbarAppearance';
25
25
  import { messages } from './messages';
26
26
  import buildLayoutButtons from '../../ui/MediaAndEmbedsToolbar';
27
27
  import { buildVisitedLinkPayload } from '../../utils/linking-utils';
28
+ import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME } from './styles';
28
29
  export var removeCard = function removeCard(state, dispatch) {
29
30
  if (!(state.selection instanceof NodeSelection)) {
30
31
  return false;
@@ -234,9 +235,12 @@ export var floatingToolbar = function floatingToolbar(cardOptions, platform) {
234
235
 
235
236
  var toolbarOffset = isEmbedCard ? {
236
237
  offset: [0, 24]
237
- } : {};
238
+ } : {}; // Applies padding override for when link picker is currently displayed
239
+
240
+ var className = pluginState.showLinkingToolbar ? FLOATING_TOOLBAR_LINKPICKER_CLASSNAME : undefined;
238
241
  return _objectSpread(_objectSpread({
239
242
  title: intl.formatMessage(messages.card),
243
+ className: className,
240
244
  nodeType: nodeType
241
245
  }, toolbarOffset), {}, {
242
246
  getDomRef: function getDomRef(view) {
@@ -5,56 +5,37 @@ var _templateObject, _templateObject2;
5
5
  import { css } from '@emotion/react';
6
6
  import { themed } from '@atlaskit/theme/components';
7
7
  import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
8
- import * as colors from '@atlaskit/theme/colors';
8
+ import { R75, N20, DN50, N30, DN20, N90, DN90, N400, DN400, N800, DN500 } from '@atlaskit/theme/colors';
9
9
  import { blockNodesVerticalMargin, akEditorTableCellMinWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, SelectionStyle, getSelectionStyles, akEditorCodeFontFamily, akEditorSelectedNodeClassName, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
10
10
  import { token } from '@atlaskit/tokens';
11
11
  import { codeBlockClassNames } from './ui/class-names';
12
+ import { codeBlockSharedStyles } from '@atlaskit/editor-common/styles';
12
13
  export var highlightingCodeBlockStyles = function highlightingCodeBlockStyles(props) {
13
14
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n background-repeat: no-repeat;\n background-color: ", ";\n\n --ds--code--bg-color: transparent;\n\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n color: ", ";\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n overflow: hidden;\n tab-size: 4;\n\n & [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n\n .", " {\n position: relative;\n z-index: 1;\n display: flex;\n flex: 1;\n\n > code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n\n &[data-debounce='true'] {\n .", " {\n display: none;\n }\n }\n\n &:not([data-debounce='true']) {\n > code:not([data-language='plaintext']):not([data-language='none']):not([data-language='']) {\n color: transparent;\n caret-color: ", ";\n }\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), overflowShadow({
14
15
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
15
16
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
16
17
  background: themed({
17
- light: colors.N20,
18
- dark: colors.DN50
18
+ light: N20,
19
+ dark: DN50
19
20
  })(props),
20
21
  width: '8px'
21
22
  }), themed({
22
- light: token('color.background.neutral', colors.N20),
23
- dark: token('color.background.neutral', colors.DN50)
23
+ light: token('color.background.neutral', N20),
24
+ dark: token('color.background.neutral', DN50)
24
25
  })(props), akEditorCodeFontFamily, borderRadius(), blockNodesVerticalMargin, akEditorTableCellMinWidth, codeBlockClassNames.gutter, themed({
25
- light: token('color.background.neutral', colors.N30),
26
- dark: token('color.background.neutral', colors.DN20)
26
+ light: token('color.background.neutral', N30),
27
+ dark: token('color.background.neutral', DN20)
27
28
  })(props), gridSize(), themed({
28
- light: token('color.text.subtlest', colors.N90),
29
- dark: token('color.text.subtlest', colors.DN90)
29
+ light: token('color.text.subtlest', N90),
30
+ dark: token('color.text.subtlest', DN90)
30
31
  })(props), relativeFontSizeToBase16(fontSize()), themed({
31
- light: token('color.text.subtle', colors.N400),
32
- dark: token('color.text.subtle', colors.DN400)
32
+ light: token('color.text.subtle', N400),
33
+ dark: token('color.text.subtle', DN400)
33
34
  })(props), codeBlockClassNames.highlighting, relativeFontSizeToBase16(fontSize()), codeBlockClassNames.content, relativeFontSizeToBase16(fontSize()), borderRadius(), gridSize(), codeBlockClassNames.highlighting, themed({
34
- light: token('color.text', colors.N800),
35
- dark: token('color.text', colors.DN500)
36
- })(props), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, token('color.border.danger', akEditorDeleteBorder), codeBlockClassNames.gutter, token('color.blanket.danger', colors.R75), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', akEditorDeleteBackground), codeBlockClassNames.gutter, token('color.blanket.danger', 'rgba(255, 143, 115, 0.5)'), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', 'rgba(255, 189, 173, 0.5)'));
35
+ light: token('color.text', N800),
36
+ dark: token('color.text', DN500)
37
+ })(props), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, token('color.border.danger', akEditorDeleteBorder), codeBlockClassNames.gutter, token('color.blanket.danger', R75), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', akEditorDeleteBackground), codeBlockClassNames.gutter, token('color.blanket.danger', 'rgba(255, 143, 115, 0.5)'), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', 'rgba(255, 189, 173, 0.5)'));
37
38
  };
38
39
  export var codeBlockStyles = function codeBlockStyles(props) {
39
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n\n --ds--code--bg-color: transparent;\n\n background-repeat: no-repeat;\n background-color: ", ";\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), overflowShadow({
40
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
41
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
42
- background: themed({
43
- light: colors.N20,
44
- dark: colors.DN50
45
- })(props),
46
- width: '8px'
47
- }), themed({
48
- light: token('color.background.neutral', colors.N20),
49
- dark: token('color.background.neutral', colors.DN50)
50
- })(props), akEditorCodeFontFamily, borderRadius(), blockNodesVerticalMargin, akEditorTableCellMinWidth, codeBlockClassNames.gutter, themed({
51
- light: token('color.background.neutral', colors.N30),
52
- dark: token('color.background.neutral', colors.DN20)
53
- })(props), gridSize(), relativeFontSizeToBase16(fontSize()), themed({
54
- light: token('color.text', colors.N400),
55
- dark: token('color.text', colors.DN400)
56
- })(props), codeBlockClassNames.content, relativeFontSizeToBase16(fontSize()), themed({
57
- light: token('color.text', colors.N800),
58
- dark: token('color.text', colors.DN800)
59
- })(props), borderRadius(), gridSize(), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, akEditorDeleteBorder, codeBlockClassNames.gutter, token('color.blanket.danger', colors.R75), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', akEditorDeleteBackground), codeBlockClassNames.gutter, token('color.blanket.danger', 'rgba(255, 143, 115, 0.5)'), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', 'rgba(255, 189, 173, 0.5)'));
40
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), codeBlockSharedStyles(props), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, akEditorDeleteBorder, codeBlockClassNames.gutter, token('color.blanket.danger', R75), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', akEditorDeleteBackground), codeBlockClassNames.gutter, token('color.blanket.danger', 'rgba(255, 143, 115, 0.5)'), token('color.text.danger', akEditorDeleteIconColor), codeBlockClassNames.content, token('color.background.danger', 'rgba(255, 189, 173, 0.5)'));
60
41
  };
@@ -1,5 +1,6 @@
1
+ import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
1
2
  export var codeBlockClassNames = {
2
- gutter: 'line-number-gutter',
3
- content: 'code-content',
3
+ gutter: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER,
4
+ content: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT,
4
5
  highlighting: 'code-highlighting'
5
6
  };
@@ -1,6 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { collab } from 'prosemirror-collab';
5
5
  import { createPlugin, pluginKey } from './plugin';
6
6
  import { sendTransaction } from './events/send-transaction';
@@ -1,9 +1,9 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
4
  import _createClass from "@babel/runtime/helpers/createClass";
6
5
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  import { utils } from '@atlaskit/util-service-support';
8
8
  import { EventEmitter2 } from 'eventemitter2';
9
9
  import { getVersion, sendableSteps } from 'prosemirror-collab';
@@ -0,0 +1,66 @@
1
+ import { findSelectedNodeOfType, findParentNodeOfType } from 'prosemirror-utils';
2
+ import { pluginKey } from './pm-plugins/plugin-key';
3
+ import { hoverDecoration } from '../base/pm-plugins/decoration';
4
+ import { DOMSerializer } from 'prosemirror-model';
5
+ import { copyHTMLToClipboard } from '../../utils/clipboard';
6
+ export var copy = function copy(nodeType) {
7
+ return function (state, dispatch) {
8
+ var tr = state.tr,
9
+ schema = state.schema; // This command should only be triggered by the Copy button in the floating toolbar
10
+ // which is only visible when selection is inside the target node
11
+
12
+ var node = findSelectedNodeOfType(nodeType)(tr.selection);
13
+
14
+ if (!node) {
15
+ node = findParentNodeOfType(nodeType)(tr.selection);
16
+ }
17
+
18
+ if (!node) {
19
+ return false;
20
+ }
21
+
22
+ var domNode = DOMSerializer.fromSchema(schema).serializeNode(node.node);
23
+ var div = document.createElement('div');
24
+ div.appendChild(domNode); // The "0 0" refers to the start and end depth of the slice
25
+ // since we're coping the block node only, it will always be 0 0
26
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
27
+
28
+ div.firstChild.setAttribute('data-pm-slice', '0 0 []');
29
+ copyHTMLToClipboard(div.innerHTML);
30
+ var copyToClipboardTr = tr;
31
+ copyToClipboardTr.setMeta(pluginKey, {
32
+ copied: true
33
+ });
34
+
35
+ if (dispatch) {
36
+ dispatch(copyToClipboardTr);
37
+ }
38
+
39
+ return true;
40
+ };
41
+ };
42
+ export var resetCopiedState = function resetCopiedState(nodeType, onMouseLeave) {
43
+ return function (state, dispatch) {
44
+ var customTr = state.tr; // Avoid multipe dispatch
45
+ // https://product-fabric.atlassian.net/wiki/spaces/E/pages/2241659456/All+about+dispatch+and+why+there+shouldn+t+be+multiple#How-do-I-avoid-them%3F
46
+
47
+ var customDispatch = function customDispatch(tr) {
48
+ customTr = tr;
49
+ };
50
+
51
+ onMouseLeave ? onMouseLeave(state, customDispatch) : hoverDecoration(nodeType, false)(state, customDispatch);
52
+ var copyButtonState = pluginKey.getState(state);
53
+
54
+ if (copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied) {
55
+ customTr.setMeta(pluginKey, {
56
+ copied: false
57
+ });
58
+ }
59
+
60
+ if (dispatch) {
61
+ dispatch(customTr);
62
+ }
63
+
64
+ return true;
65
+ };
66
+ };
@@ -0,0 +1,17 @@
1
+ import createPlugin from './pm-plugins/main';
2
+
3
+ var copyButtonPlugin = function copyButtonPlugin() {
4
+ return {
5
+ name: 'copyButton',
6
+ pmPlugins: function pmPlugins() {
7
+ return [{
8
+ name: 'copyButton',
9
+ plugin: function plugin() {
10
+ return createPlugin();
11
+ }
12
+ }];
13
+ }
14
+ };
15
+ };
16
+
17
+ export default copyButtonPlugin;
@@ -0,0 +1,26 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { pluginKey } from './plugin-key';
3
+ export function copyButtonPlugin() {
4
+ return new SafePlugin({
5
+ state: {
6
+ init: function init() {
7
+ return {
8
+ copied: false
9
+ };
10
+ },
11
+ apply: function apply(tr, pluginState) {
12
+ var meta = tr.getMeta(pluginKey);
13
+
14
+ if ((meta === null || meta === void 0 ? void 0 : meta.copied) !== undefined) {
15
+ return {
16
+ copied: meta.copied
17
+ };
18
+ }
19
+
20
+ return pluginState;
21
+ }
22
+ },
23
+ key: pluginKey
24
+ });
25
+ }
26
+ export default copyButtonPlugin;
@@ -0,0 +1,2 @@
1
+ import { PluginKey } from 'prosemirror-state';
2
+ export var pluginKey = new PluginKey('copyButtonPlugin');
@@ -0,0 +1,31 @@
1
+ import CopyIcon from '@atlaskit/icon/glyph/copy';
2
+ import commonMessages from '../../messages';
3
+ import { hoverDecoration } from '../base/pm-plugins/decoration';
4
+ import { copy, resetCopiedState } from './commands';
5
+ import { pluginKey } from './pm-plugins/plugin-key';
6
+ export var getCopyButtonConfig = function getCopyButtonConfig(state, formatMessage, nodeType, onMouseEnter, onMouseLeave) {
7
+ var copyButtonState = pluginKey.getState(state);
8
+ return {
9
+ id: 'editor.floatingToolbar.copy',
10
+ type: 'button',
11
+ appearance: 'subtle',
12
+ icon: CopyIcon,
13
+ onClick: copy(nodeType),
14
+ title: formatMessage(copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied ? commonMessages.copiedToClipboard : commonMessages.copyToClipboard),
15
+ onMouseEnter: onMouseEnter || hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
16
+ onMouseLeave: resetCopiedState(nodeType, onMouseLeave),
17
+ onFocus: hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
18
+ onBlur: hoverDecoration(nodeType, false),
19
+ hideTooltipOnClick: false,
20
+ tabIndex: null // TODO select and delete styling needs to be removed when keyboard cursor moves away
21
+ // problem already exist with delete as well
22
+
23
+ };
24
+ };
25
+ export var showCopyButton = function showCopyButton(state) {
26
+ return state && // Check if the Copy button plugin is enabled
27
+ // @ts-ignore pluginKey.key
28
+ state.plugins.find(function (p) {
29
+ return p.key === pluginKey.key;
30
+ });
31
+ };
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { closeHistory } from 'prosemirror-history';
4
4
  import { processRawValue } from '../../utils';
5
5
  import { autoformatAction } from './utils';
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
 
5
5
  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; }
6
6
 
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
 
5
5
  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; }
6
6
 
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
4
  import _typeof from "@babel/runtime/helpers/typeof";
@@ -8,6 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
8
7
 
9
8
  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) { _defineProperty(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; }
10
9
 
10
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
  import React from 'react';
12
12
  import { getExtensionKeyAndNodeKey } from '@atlaskit/editor-common/extensions';
13
13
  import { getPluginState } from './pm-plugins/main';
@@ -1,6 +1,6 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { getExtensionModuleNode } from '@atlaskit/editor-common/extensions';
6
6
  import { createSelectionClickHandler } from '../../selection/utils';
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
12
 
@@ -19,7 +19,7 @@ var safeNumberFeatureFlag = function safeNumberFeatureFlag(value) {
19
19
 
20
20
 
21
21
  export function createFeatureFlagsFromProps(props) {
22
- var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$collabEdit, _props$collabEdit2, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37;
22
+ var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$collabEdit, _props$collabEdit2, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41;
23
23
 
24
24
  var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
25
25
  return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
@@ -57,6 +57,8 @@ export function createFeatureFlagsFromProps(props) {
57
57
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
58
58
  chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
59
59
  viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
60
- showHoverPreview: Boolean(typeof ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.showHoverPreview) === 'boolean' ? !!((_props$featureFlags37 = props.featureFlags) !== null && _props$featureFlags37 !== void 0 && _props$featureFlags37.showHoverPreview) : false)
60
+ showHoverPreview: Boolean(typeof ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.showHoverPreview) === 'boolean' ? !!((_props$featureFlags37 = props.featureFlags) !== null && _props$featureFlags37 !== void 0 && _props$featureFlags37.showHoverPreview) : false),
61
+ indentationButtonsInTheToolbar: Boolean(typeof ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38['indentation-buttons-in-the-toolbar']) === 'boolean' ? !!((_props$featureFlags39 = props.featureFlags) !== null && _props$featureFlags39 !== void 0 && _props$featureFlags39['indentation-buttons-in-the-toolbar']) : false),
62
+ floatingToolbarCopyButton: Boolean(typeof ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags41 = props.featureFlags) !== null && _props$featureFlags41 !== void 0 && _props$featureFlags41.floatingToolbarCopyButton) : false)
61
63
  });
62
64
  }
@@ -1,7 +1,7 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
3
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
 
6
6
  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; }
7
7
 
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import getDeviceInfo from './getDeviceInfo';
4
4
  import getBrowserInfo from './getBrowserInfo';
5
5
  var JIRA_ISSUE_COLLECTOR_URL = 'https://product-fabric.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T/-w0bwo4/b/14/e73395c53c3b10fde2303f4bf74ffbf6/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-US&collectorId=98644b9c';
@@ -1,7 +1,7 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import { createDecorations, findDecorationFromMatch } from './index';
6
6
  import { getPluginState } from '../plugin'; // max number of decorations to apply at once
7
7
 
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import React, { useEffect, useState } from 'react';
5
5
  import Loadable from 'react-loadable';
6
6
  import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions';
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
12
 
@@ -1,5 +1,4 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -13,6 +12,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
13
12
 
14
13
  var _templateObject, _templateObject2, _templateObject3;
15
14
 
15
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
16
+
16
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
18
 
18
19
  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; } }
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
 
5
5
  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; }
6
6
 
@@ -0,0 +1,14 @@
1
+ // Common Translations will live here
2
+ import { defineMessages } from 'react-intl-next';
3
+ export var messages = defineMessages({
4
+ indent: {
5
+ id: 'fabric.editor.indent',
6
+ defaultMessage: 'Indent',
7
+ description: 'Indent a list item, paragraph or heading'
8
+ },
9
+ outdent: {
10
+ id: 'fabric.editor.outdent',
11
+ defaultMessage: 'Outdent',
12
+ description: 'Outdent a list item, paragraph or heading'
13
+ }
14
+ });
@@ -15,6 +15,7 @@ export { default as insertBlockPlugin } from './insert-block';
15
15
  export { default as jiraIssuePlugin } from './jira-issue';
16
16
  export { default as layoutPlugin } from './layout';
17
17
  export { default as listPlugin } from './list';
18
+ export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
18
19
  export { default as macroPlugin } from './macro';
19
20
  export { default as maxContentSizePlugin } from './max-content-size';
20
21
  export { default as mediaPlugin } from './media';
@@ -63,4 +64,5 @@ export { default as undoRedoPlugin } from './undo-redo';
63
64
  export { default as avatarGroupPlugin } from './avatar-group';
64
65
  export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
65
66
  export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
66
- export { default as codeBidiWarningPlugin } from './code-bidi-warning';
67
+ export { default as codeBidiWarningPlugin } from './code-bidi-warning';
68
+ export { default as copyButtonPlugin } from './copy-button';
@@ -1,15 +1,12 @@
1
1
  import React from 'react';
2
2
  import { orderedList, bulletList, listItem } from '@atlaskit/adf-schema';
3
- import ToolbarLists from './ui/ToolbarLists';
4
- import { createPlugin, pluginKey } from './pm-plugins/main';
3
+ import { createPlugin } from './pm-plugins/main';
5
4
  import inputRulePlugin from './pm-plugins/input-rules';
6
5
  import keymapPlugin from './pm-plugins/keymap';
7
- import WithPluginState from '../../ui/WithPluginState';
8
6
  import { messages } from './messages';
9
7
  import { addAnalytics, ACTION, EVENT_TYPE, INPUT_METHOD, ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
10
8
  import { tooltip, toggleBulletList, toggleOrderedList } from '../../keymaps';
11
9
  import { IconList, IconListNumber } from '../quick-insert/assets';
12
- import { ToolbarSize } from '../../ui/Toolbar/types';
13
10
 
14
11
  var listPlugin = function listPlugin() {
15
12
  return {
@@ -96,43 +93,6 @@ var listPlugin = function listPlugin() {
96
93
  }
97
94
  }];
98
95
  }
99
- },
100
- primaryToolbarComponent: function primaryToolbarComponent(_ref4) {
101
- var editorView = _ref4.editorView,
102
- popupsMountPoint = _ref4.popupsMountPoint,
103
- popupsBoundariesElement = _ref4.popupsBoundariesElement,
104
- popupsScrollableElement = _ref4.popupsScrollableElement,
105
- toolbarSize = _ref4.toolbarSize,
106
- disabled = _ref4.disabled,
107
- isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
108
- var isSmall = toolbarSize < ToolbarSize.L;
109
- return /*#__PURE__*/React.createElement(WithPluginState, {
110
- plugins: {
111
- listState: pluginKey
112
- },
113
- render: function render(_ref5) {
114
- var listState = _ref5.listState;
115
-
116
- if (!listState) {
117
- return null;
118
- }
119
-
120
- return /*#__PURE__*/React.createElement(ToolbarLists, {
121
- isSmall: isSmall,
122
- isSeparator: true,
123
- isReducedSpacing: isToolbarReducedSpacing,
124
- disabled: disabled,
125
- editorView: editorView,
126
- popupsMountPoint: popupsMountPoint,
127
- popupsBoundariesElement: popupsBoundariesElement,
128
- popupsScrollableElement: popupsScrollableElement,
129
- bulletListActive: listState.bulletListActive,
130
- bulletListDisabled: listState.bulletListDisabled,
131
- orderedListActive: listState.orderedListActive,
132
- orderedListDisabled: listState.orderedListDisabled
133
- });
134
- }
135
- });
136
96
  }
137
97
  };
138
98
  };