@atlaskit/editor-core 185.6.3 → 185.7.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 (175) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/plugins/card/index.js +14 -0
  3. package/dist/cjs/plugins/card/nodeviews/datasource.js +2 -4
  4. package/dist/cjs/plugins/card/pm-plugins/main.js +2 -1
  5. package/dist/cjs/plugins/card/pm-plugins/mountHyperlink.js +46 -0
  6. package/dist/cjs/plugins/card/toolbar.js +4 -5
  7. package/dist/cjs/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.js +5 -3
  8. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +24 -20
  9. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +2 -2
  10. package/dist/cjs/plugins/card/ui/SmallerEditIcon.js +2 -2
  11. package/dist/cjs/plugins/card/utils.js +2 -30
  12. package/dist/cjs/plugins/hyperlink/Toolbar.js +18 -30
  13. package/dist/cjs/plugins/hyperlink/commands.js +7 -3
  14. package/dist/cjs/plugins/hyperlink/index.js +9 -2
  15. package/dist/cjs/plugins/hyperlink/pm-plugins/toolbar-buttons.js +41 -0
  16. package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
  17. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +8 -4
  18. package/dist/cjs/plugins/media/toolbar/index.js +3 -3
  19. package/dist/cjs/plugins/media/ui/ImageBorder/index.js +13 -2
  20. package/dist/cjs/plugins/media/utils/media-common.js +1 -1
  21. package/dist/cjs/plugins/paste/handlers.js +12 -12
  22. package/dist/cjs/plugins/paste/index.js +1 -1
  23. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +12 -8
  24. package/dist/cjs/plugins/paste/pm-plugins/main.js +18 -17
  25. package/dist/cjs/plugins/paste/util/index.js +29 -2
  26. package/dist/cjs/ui/ContentStyles/index.js +2 -4
  27. package/dist/cjs/version-wrapper.js +1 -1
  28. package/dist/cjs/version.json +1 -1
  29. package/dist/es2019/plugins/card/index.js +12 -0
  30. package/dist/es2019/plugins/card/nodeviews/datasource.js +1 -2
  31. package/dist/es2019/plugins/card/pm-plugins/main.js +2 -1
  32. package/dist/es2019/plugins/card/pm-plugins/mountHyperlink.js +36 -0
  33. package/dist/es2019/plugins/card/toolbar.js +4 -3
  34. package/dist/es2019/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.js +5 -3
  35. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +12 -13
  36. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +1 -1
  37. package/dist/es2019/plugins/card/ui/SmallerEditIcon.js +1 -1
  38. package/dist/es2019/plugins/card/utils.js +0 -28
  39. package/dist/es2019/plugins/hyperlink/Toolbar.js +21 -30
  40. package/dist/es2019/plugins/hyperlink/commands.js +6 -3
  41. package/dist/es2019/plugins/hyperlink/index.js +9 -2
  42. package/dist/es2019/plugins/hyperlink/pm-plugins/toolbar-buttons.js +37 -0
  43. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +11 -4
  44. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +13 -5
  45. package/dist/es2019/plugins/media/toolbar/index.js +1 -1
  46. package/dist/es2019/plugins/media/ui/ImageBorder/index.js +13 -2
  47. package/dist/es2019/plugins/media/utils/media-common.js +1 -1
  48. package/dist/es2019/plugins/paste/handlers.js +12 -13
  49. package/dist/es2019/plugins/paste/index.js +1 -1
  50. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +24 -12
  51. package/dist/es2019/plugins/paste/pm-plugins/main.js +11 -10
  52. package/dist/es2019/plugins/paste/util/index.js +28 -1
  53. package/dist/es2019/ui/ContentStyles/index.js +1 -3
  54. package/dist/es2019/version-wrapper.js +1 -1
  55. package/dist/es2019/version.json +1 -1
  56. package/dist/esm/plugins/card/index.js +14 -0
  57. package/dist/esm/plugins/card/nodeviews/datasource.js +1 -2
  58. package/dist/esm/plugins/card/pm-plugins/main.js +2 -1
  59. package/dist/esm/plugins/card/pm-plugins/mountHyperlink.js +38 -0
  60. package/dist/esm/plugins/card/toolbar.js +4 -3
  61. package/dist/esm/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.js +5 -3
  62. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +14 -13
  63. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +1 -1
  64. package/dist/esm/plugins/card/ui/SmallerEditIcon.js +1 -1
  65. package/dist/esm/plugins/card/utils.js +0 -27
  66. package/dist/esm/plugins/hyperlink/Toolbar.js +19 -30
  67. package/dist/esm/plugins/hyperlink/commands.js +6 -3
  68. package/dist/esm/plugins/hyperlink/index.js +9 -2
  69. package/dist/esm/plugins/hyperlink/pm-plugins/toolbar-buttons.js +32 -0
  70. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +7 -4
  71. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +9 -5
  72. package/dist/esm/plugins/media/toolbar/index.js +1 -1
  73. package/dist/esm/plugins/media/ui/ImageBorder/index.js +13 -2
  74. package/dist/esm/plugins/media/utils/media-common.js +1 -1
  75. package/dist/esm/plugins/paste/handlers.js +12 -13
  76. package/dist/esm/plugins/paste/index.js +1 -1
  77. package/dist/esm/plugins/paste/pm-plugins/analytics.js +12 -8
  78. package/dist/esm/plugins/paste/pm-plugins/main.js +11 -10
  79. package/dist/esm/plugins/paste/util/index.js +27 -1
  80. package/dist/esm/ui/ContentStyles/index.js +1 -3
  81. package/dist/esm/version-wrapper.js +1 -1
  82. package/dist/esm/version.json +1 -1
  83. package/dist/types/labs/next/presets/cxhtml.d.ts +6 -0
  84. package/dist/types/labs/next/presets/default.d.ts +12 -0
  85. package/dist/types/labs/next/presets/mobile.d.ts +6 -0
  86. package/dist/types/plugins/card/index.d.ts +5 -1
  87. package/dist/types/plugins/card/nodeviews/datasource.d.ts +0 -1
  88. package/dist/types/plugins/card/pm-plugins/doc.d.ts +2 -1
  89. package/dist/types/plugins/card/pm-plugins/mountHyperlink.d.ts +5 -0
  90. package/dist/types/plugins/card/pm-plugins/util/state.d.ts +1 -1
  91. package/dist/types/plugins/card/types.d.ts +2 -3
  92. package/dist/types/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.d.ts +2 -0
  93. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +7 -5
  94. package/dist/types/plugins/card/utils.d.ts +1 -3
  95. package/dist/types/plugins/hyperlink/Toolbar.d.ts +3 -2
  96. package/dist/types/plugins/hyperlink/commands.d.ts +2 -0
  97. package/dist/types/plugins/hyperlink/index.d.ts +11 -0
  98. package/dist/types/plugins/hyperlink/pm-plugins/toolbar-buttons.d.ts +19 -0
  99. package/dist/types/plugins/paste/handlers.d.ts +6 -5
  100. package/dist/types/plugins/paste/index.d.ts +6 -2
  101. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -5
  102. package/dist/types/plugins/paste/pm-plugins/main.d.ts +3 -2
  103. package/dist/types/plugins/paste/util/index.d.ts +2 -0
  104. package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +6 -0
  105. package/dist/types-ts4.5/labs/next/presets/default.d.ts +12 -0
  106. package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +6 -0
  107. package/dist/types-ts4.5/plugins/card/index.d.ts +5 -1
  108. package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +0 -1
  109. package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +2 -1
  110. package/dist/types-ts4.5/plugins/card/pm-plugins/mountHyperlink.d.ts +5 -0
  111. package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +1 -1
  112. package/dist/types-ts4.5/plugins/card/types.d.ts +2 -3
  113. package/dist/types-ts4.5/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.d.ts +2 -0
  114. package/dist/types-ts4.5/plugins/card/ui/LinkToolbarAppearance.d.ts +7 -5
  115. package/dist/types-ts4.5/plugins/card/utils.d.ts +1 -3
  116. package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +3 -2
  117. package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +2 -0
  118. package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +11 -0
  119. package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/toolbar-buttons.d.ts +19 -0
  120. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +6 -5
  121. package/dist/types-ts4.5/plugins/paste/index.d.ts +4 -2
  122. package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +6 -5
  123. package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +3 -2
  124. package/dist/types-ts4.5/plugins/paste/util/index.d.ts +2 -0
  125. package/package.json +10 -2
  126. package/dist/cjs/plugins/card/messages.js +0 -90
  127. package/dist/cjs/plugins/card/styles.js +0 -18
  128. package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +0 -63
  129. package/dist/cjs/plugins/card/ui/assets/card.js +0 -30
  130. package/dist/cjs/plugins/card/ui/assets/embed.js +0 -30
  131. package/dist/cjs/plugins/card/ui/assets/inline.js +0 -30
  132. package/dist/cjs/plugins/card/ui/assets/url.js +0 -32
  133. package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +0 -52
  134. package/dist/cjs/plugins/card/ui/styled.js +0 -16
  135. package/dist/cjs/plugins/card/ui/types.js +0 -5
  136. package/dist/es2019/plugins/card/messages.js +0 -83
  137. package/dist/es2019/plugins/card/styles.js +0 -132
  138. package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +0 -61
  139. package/dist/es2019/plugins/card/ui/assets/card.js +0 -22
  140. package/dist/es2019/plugins/card/ui/assets/embed.js +0 -22
  141. package/dist/es2019/plugins/card/ui/assets/inline.js +0 -22
  142. package/dist/es2019/plugins/card/ui/assets/url.js +0 -24
  143. package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +0 -45
  144. package/dist/es2019/plugins/card/ui/styled.js +0 -27
  145. package/dist/es2019/plugins/card/ui/types.js +0 -1
  146. package/dist/esm/plugins/card/messages.js +0 -83
  147. package/dist/esm/plugins/card/styles.js +0 -10
  148. package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +0 -56
  149. package/dist/esm/plugins/card/ui/assets/card.js +0 -22
  150. package/dist/esm/plugins/card/ui/assets/embed.js +0 -22
  151. package/dist/esm/plugins/card/ui/assets/inline.js +0 -22
  152. package/dist/esm/plugins/card/ui/assets/url.js +0 -24
  153. package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +0 -45
  154. package/dist/esm/plugins/card/ui/styled.js +0 -6
  155. package/dist/esm/plugins/card/ui/types.js +0 -1
  156. package/dist/types/plugins/card/messages.d.ts +0 -82
  157. package/dist/types/plugins/card/styles.d.ts +0 -2
  158. package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +0 -16
  159. package/dist/types/plugins/card/ui/assets/card.d.ts +0 -3
  160. package/dist/types/plugins/card/ui/assets/embed.d.ts +0 -3
  161. package/dist/types/plugins/card/ui/assets/inline.d.ts +0 -3
  162. package/dist/types/plugins/card/ui/assets/url.d.ts +0 -3
  163. package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +0 -5
  164. package/dist/types/plugins/card/ui/styled.d.ts +0 -3
  165. package/dist/types/plugins/card/ui/types.d.ts +0 -12
  166. package/dist/types-ts4.5/plugins/card/messages.d.ts +0 -82
  167. package/dist/types-ts4.5/plugins/card/styles.d.ts +0 -2
  168. package/dist/types-ts4.5/plugins/card/ui/LinkToolbarButtonGroup.d.ts +0 -16
  169. package/dist/types-ts4.5/plugins/card/ui/assets/card.d.ts +0 -3
  170. package/dist/types-ts4.5/plugins/card/ui/assets/embed.d.ts +0 -3
  171. package/dist/types-ts4.5/plugins/card/ui/assets/inline.d.ts +0 -3
  172. package/dist/types-ts4.5/plugins/card/ui/assets/url.d.ts +0 -3
  173. package/dist/types-ts4.5/plugins/card/ui/link-toolbar-button-group-options.d.ts +0 -5
  174. package/dist/types-ts4.5/plugins/card/ui/styled.d.ts +0 -3
  175. package/dist/types-ts4.5/plugins/card/ui/types.d.ts +0 -12
@@ -7,7 +7,7 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
7
7
  url: string;
8
8
  appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
9
9
  compareLinkText: boolean;
10
- source: import("../../types").CardReplacementInputMethod;
10
+ source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
11
11
  previousAppearance?: "url" | import("@atlaskit/editor-common/provider-factory").CardAppearance | undefined;
12
12
  analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION | undefined;
13
13
  shouldReplaceLink?: boolean | undefined;
@@ -1,8 +1,8 @@
1
- import { INPUT_METHOD, ACTION } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION } from '@atlaskit/editor-common/analytics';
2
2
  import { CardProvider, CardAppearance } from '@atlaskit/editor-common/provider-factory';
3
3
  import { SmartLinkEvents } from '@atlaskit/smart-card';
4
4
  import { CreateUIAnalyticsEvent, UIAnalyticsEvent } from '@atlaskit/analytics-next';
5
- import { CardOptions } from '@atlaskit/editor-common/card';
5
+ import type { CardOptions, CardReplacementInputMethod } from '@atlaskit/editor-common/card';
6
6
  import type { EditorAppearance } from '@atlaskit/editor-common/types';
7
7
  import { LinkPickerOptions } from '@atlaskit/editor-common/types';
8
8
  import { DatasourceTableLayout } from './ui/LayoutButton/types';
@@ -162,5 +162,4 @@ export type SetCardLayoutAndDatasourceTableRef = {
162
162
  datasourceTableRef?: HTMLElement;
163
163
  };
164
164
  export type CardPluginAction = SetProvider | Queue | Resolve | Register | ShowLinkToolbar | HideLinkToolbar | ShowDatasourceModal | HideDatasourceModal | RegisterSmartCardEvents | RegisterSmartCardEventsNext | SetDatasourceTableRef | SetCardLayout | SetCardLayoutAndDatasourceTableRef;
165
- export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
166
165
  export {};
@@ -6,6 +6,7 @@ import { EditorState } from 'prosemirror-state';
6
6
  import { EditorView } from 'prosemirror-view';
7
7
  import { CardPlatform } from '@atlaskit/smart-card';
8
8
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
9
+ import type { CardPluginActions } from '@atlaskit/editor-common/card';
9
10
  export interface HyperlinkToolbarAppearanceProps {
10
11
  intl: IntlShape;
11
12
  editorState: EditorState;
@@ -15,6 +16,7 @@ export interface HyperlinkToolbarAppearanceProps {
15
16
  platform?: CardPlatform;
16
17
  cardOptions?: CardOptions;
17
18
  editorAnalyticsApi: EditorAnalyticsAPI | undefined;
19
+ cardActions: CardPluginActions | undefined;
18
20
  }
19
21
  export interface HyperlinkToolbarAppearanceState {
20
22
  supportedUrlsMap: Map<string, boolean>;
@@ -1,12 +1,13 @@
1
- import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
2
- import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import { CardContext } from '@atlaskit/link-provider';
4
- import { CardPlatform } from '@atlaskit/smart-card';
1
+ import React from 'react';
5
2
  import PropTypes from 'prop-types';
6
3
  import { EditorState } from 'prosemirror-state';
7
4
  import { EditorView } from 'prosemirror-view';
8
- import React from 'react';
9
5
  import { IntlShape } from 'react-intl-next';
6
+ import { CardContext } from '@atlaskit/link-provider';
7
+ import { CardPlatform } from '@atlaskit/smart-card';
8
+ import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
9
+ import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
10
+ import { CardPluginActions } from '@atlaskit/editor-common/card';
10
11
  export interface LinkToolbarAppearanceProps {
11
12
  intl: IntlShape;
12
13
  editorAnalyticsApi: EditorAnalyticsAPI | undefined;
@@ -17,6 +18,7 @@ export interface LinkToolbarAppearanceProps {
17
18
  allowEmbeds?: boolean;
18
19
  allowBlockCards?: boolean;
19
20
  platform?: CardPlatform;
21
+ cardActions: CardPluginActions | undefined;
20
22
  }
21
23
  export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, {}> {
22
24
  static contextTypes: {
@@ -1,8 +1,7 @@
1
1
  import { EditorState } from 'prosemirror-state';
2
- import { NodeType, Node, Slice } from 'prosemirror-model';
2
+ import { NodeType, Node } from 'prosemirror-model';
3
3
  import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
4
4
  import { CardInfo } from './types';
5
- import { CardOptions } from '@atlaskit/editor-common/card';
6
5
  export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
7
6
  export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
8
7
  export type TitleUrlPair = {
@@ -18,4 +17,3 @@ export declare const titleUrlPairFromNode: (node: Node) => TitleUrlPair;
18
17
  export declare const mergeCardInfo: (titleUrlPair: TitleUrlPair, info?: CardInfo) => TitleUrlPair;
19
18
  export declare const displayInfoForCard: (node: Node, info?: CardInfo) => TitleUrlPair;
20
19
  export declare const findCardInfo: (state: EditorState) => CardInfo | undefined;
21
- export declare const transformUnsupportedBlockCardToInline: (slice: Slice, state: EditorState, cardOptions?: CardOptions) => Slice;
@@ -1,5 +1,6 @@
1
1
  import { FloatingToolbarHandler } from '../floating-toolbar/types';
2
+ import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
3
  import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
3
4
  import { FeatureFlags } from '@atlaskit/editor-common/types';
4
- import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- export declare const getToolbarConfig: (options: HyperlinkPluginOptions, featureFlags: FeatureFlags, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => FloatingToolbarHandler;
5
+ import type hyperlinkPlugin from './index';
6
+ export declare const getToolbarConfig: (options: HyperlinkPluginOptions, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<typeof hyperlinkPlugin> | undefined) => FloatingToolbarHandler;
@@ -1,4 +1,5 @@
1
1
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import { Transaction } from 'prosemirror-state';
2
3
  import { Predicate } from '../../utils/commands';
3
4
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
5
  import type { Command, LinkInputType } from '@atlaskit/editor-common/types';
@@ -13,3 +14,4 @@ export declare function removeLink(pos: number): Command;
13
14
  export declare function editInsertedLink(): Command;
14
15
  export declare function showLinkToolbar(inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT | INPUT_METHOD.INSERT_MENU): Command;
15
16
  export declare function hideLinkToolbar(): Command;
17
+ export declare function hideLinkToolbarSetMeta(tr: Transaction): Transaction<any>;
@@ -1,4 +1,5 @@
1
1
  import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import { PrependToolbarButtons } from './pm-plugins/toolbar-buttons';
2
3
  import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
3
4
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
4
5
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
@@ -8,6 +9,16 @@ declare const hyperlinkPlugin: NextEditorPlugin<'hyperlink', {
8
9
  typeof featureFlagsPlugin,
9
10
  OptionalPlugin<typeof analyticsPlugin>
10
11
  ];
12
+ actions: {
13
+ /**
14
+ * Add items to the left of the hyperlink floating toolbar
15
+ * @param props
16
+ * -
17
+ * - items: Retrieve floating toolbar items to add
18
+ * - onEscapeCallback (optional): To be called when the link picker is escaped.
19
+ */
20
+ prependToolbarButtons: PrependToolbarButtons;
21
+ };
11
22
  }>;
12
23
  export type { HyperlinkState } from './pm-plugins/main';
13
24
  export default hyperlinkPlugin;
@@ -0,0 +1,19 @@
1
+ import { PluginKey, EditorState, Transaction } from 'prosemirror-state';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { FloatingToolbarItem } from '@atlaskit/editor-common/types';
4
+ import { EditorView } from 'prosemirror-view';
5
+ import type { IntlShape } from 'react-intl-next';
6
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
+ type HyperlinkToolbarItemsState = {
8
+ items: GetToolbarItems;
9
+ onEscapeCallback: ((tr: Transaction) => Transaction) | undefined;
10
+ };
11
+ export declare const toolbarKey: PluginKey<HyperlinkToolbarItemsState | undefined, any>;
12
+ type GetToolbarItems = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory, link: string) => FloatingToolbarItem<any>[];
13
+ interface PrependToolbarButtonsProps extends HyperlinkToolbarItemsState {
14
+ view: EditorView;
15
+ }
16
+ export type PrependToolbarButtons = (props: PrependToolbarButtonsProps) => void;
17
+ export declare const prependToolbarButtons: ({ items, onEscapeCallback, view, }: PrependToolbarButtonsProps) => void;
18
+ export declare const toolbarButtonsPlugin: () => SafePlugin<any, any>;
19
+ export {};
@@ -4,18 +4,19 @@ import { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions'
4
4
  import { Command } from '../../types';
5
5
  import { InputMethodInsertMedia } from '../analytics';
6
6
  import { CardOptions } from '@atlaskit/editor-common/card';
7
+ import type { QueueCardsFromTransactionAction } from '@atlaskit/editor-common/card';
7
8
  export declare function handleMention(slice: Slice, schema: Schema): Slice;
8
- export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice): Command;
9
+ export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
9
10
  export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice): Command;
10
11
  export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice): Command;
11
12
  export declare function handlePasteLinkOnSelectedText(slice: Slice): Command;
12
13
  export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent): Command;
13
- export declare function handlePastePreservingMarks(slice: Slice): Command;
14
- export declare function handleMacroAutoConvert(text: string, slice: Slice, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
14
+ export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
15
+ export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
15
16
  export declare function handleCodeBlock(text: string): Command;
16
17
  export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia): (slice: Slice) => Command;
17
18
  export declare function handleExpandPasteInTable(slice: Slice): Command;
18
- export declare function handleMarkdown(markdownSlice: Slice, from?: number, to?: number): Command;
19
+ export declare function handleMarkdown(markdownSlice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, from?: number, to?: number): Command;
19
20
  export declare function handleParagraphBlockMarks(state: EditorState, slice: Slice): Slice<any>;
20
21
  /**
21
22
  * ED-6300: When a nested list is pasted in a table cell and the slice has openStart > openEnd,
@@ -45,6 +46,6 @@ export declare function handleParagraphBlockMarks(state: EditorState, slice: Sli
45
46
  * ┗━p -> "two"
46
47
  */
47
48
  export declare function flattenNestedListInSlice(slice: Slice): Slice<any>;
48
- export declare function handleRichText(slice: Slice): Command;
49
+ export declare function handleRichText(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
49
50
  export declare function handlePasteIntoCaption(slice: Slice): Command;
50
51
  export declare const handleSelectedTable: (slice: Slice) => Command;
@@ -1,6 +1,7 @@
1
- import { NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import { CardOptions } from '@atlaskit/editor-common/card';
3
3
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
4
+ import type cardPlugin from '../card';
4
5
  export type PastePluginOptions = {
5
6
  cardOptions?: CardOptions;
6
7
  sanitizePrivateContent?: boolean;
@@ -8,7 +9,8 @@ export type PastePluginOptions = {
8
9
  declare const pastePlugin: NextEditorPlugin<'paste', {
9
10
  pluginConfiguration: PastePluginOptions;
10
11
  dependencies: [
11
- typeof featureFlagsPlugin
12
+ typeof featureFlagsPlugin,
13
+ OptionalPlugin<typeof cardPlugin>
12
14
  ];
13
15
  }>;
14
16
  export default pastePlugin;
@@ -1,7 +1,8 @@
1
1
  import { AnalyticsEventPayload, PasteType, PasteContent } from '../../analytics';
2
2
  import { EditorView } from 'prosemirror-view';
3
3
  import { Slice, Fragment, Schema } from 'prosemirror-model';
4
- import { Command } from '../../../types';
4
+ import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
5
+ import type pastePlugin from '../';
5
6
  type PasteContext = {
6
7
  type: PasteType;
7
8
  asPlain?: boolean;
@@ -20,13 +21,13 @@ export declare function createPasteAnalyticsPayload(view: EditorView, event: Cli
20
21
  export declare function sendPasteAnalyticsEvent(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): void;
21
22
  export declare function pasteCommandWithAnalytics(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): import("../../analytics").HigherOrderCommand;
22
23
  export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
23
- export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
24
+ export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
24
25
  export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
25
26
  export declare const handleCodeBlockWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
26
27
  export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
27
- export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
28
- export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
29
- export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
28
+ export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
29
+ export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
+ export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
31
  export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
31
32
  export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
32
33
  export declare const handleExpandWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
@@ -5,5 +5,6 @@ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
5
  import { DispatchAnalyticsEvent } from '../../analytics';
6
6
  export { pluginKey as stateKey } from './plugin-factory';
7
7
  import type { Dispatch } from '../../../event-dispatcher';
8
- import { FeatureFlags } from '@atlaskit/editor-common/types';
9
- export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../types").PastePluginState, Schema<any, any>>;
8
+ import { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
+ import type pastePlugin from '../';
10
+ export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../types").PastePluginState, Schema<any, any>>;
@@ -1,6 +1,7 @@
1
1
  import { Slice, Mark, Node as PMNode, NodeType, Schema } from 'prosemirror-model';
2
2
  import { EditorState, Selection, Transaction } from 'prosemirror-state';
3
3
  import { PasteSource } from '../../analytics';
4
+ import { CardOptions } from '@atlaskit/editor-common/card';
4
5
  export declare function isPastedFromWord(html?: string): boolean;
5
6
  export declare function isPastedFromExcel(html?: string): boolean;
6
7
  export declare const isSingleLine: (text: string) => boolean;
@@ -16,3 +17,4 @@ export declare function isSelectionInsidePanel(selection: Selection): PMNode | n
16
17
  export declare const htmlHasInvalidLinkTags: (html?: string) => boolean;
17
18
  export declare const removeDuplicateInvalidLinks: (html: string) => string;
18
19
  export declare const addReplaceSelectedTableAnalytics: (state: EditorState, tr: Transaction) => Transaction;
20
+ export declare const transformUnsupportedBlockCardToInline: (slice: Slice, state: EditorState, cardOptions?: CardOptions) => Slice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.6.3",
3
+ "version": "185.7.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/code": "^14.6.0",
50
50
  "@atlaskit/date": "^0.10.0",
51
51
  "@atlaskit/datetime-picker": "^12.7.0",
52
- "@atlaskit/editor-common": "^74.12.0",
52
+ "@atlaskit/editor-common": "^74.14.0",
53
53
  "@atlaskit/editor-json-transformer": "^8.9.0",
54
54
  "@atlaskit/editor-markdown-transformer": "^5.2.0",
55
55
  "@atlaskit/editor-palette": "1.5.1",
@@ -258,5 +258,13 @@
258
258
  "type": "boolean",
259
259
  "referenceOnly": "true"
260
260
  }
261
+ },
262
+ "tests": {
263
+ "integration": {
264
+ "additionalBrowsers": [
265
+ "desktop-firefox",
266
+ "desktop-webkit"
267
+ ]
268
+ }
261
269
  }
262
270
  }
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.messages = void 0;
7
- var _reactIntlNext = require("react-intl-next");
8
- var messages = (0, _reactIntlNext.defineMessages)({
9
- url: {
10
- id: 'fabric.editor.url',
11
- defaultMessage: 'Display URL',
12
- description: 'Convert the card to become a regular text-based hyperlink.'
13
- },
14
- block: {
15
- id: 'fabric.editor.displayBlock',
16
- defaultMessage: 'Display card',
17
- description: 'Display link as a card with a rich preview similar to in a Facebook feed with page title, description, and potentially an image.'
18
- },
19
- inline: {
20
- id: 'fabric.editor.displayInline',
21
- defaultMessage: 'Display inline',
22
- description: 'Display link with the title only.'
23
- },
24
- embed: {
25
- id: 'fabric.editor.displayEmbed',
26
- defaultMessage: 'Display embed',
27
- description: 'Display link as an embedded object'
28
- },
29
- link: {
30
- id: 'fabric.editor.displayLink',
31
- defaultMessage: 'Display as text',
32
- description: 'Convert the card to become a regular text-based hyperlink.'
33
- },
34
- card: {
35
- id: 'fabric.editor.cardFloatingControls',
36
- defaultMessage: 'Card options',
37
- description: 'Options to change card type'
38
- },
39
- blockCardUnavailable: {
40
- id: 'fabric.editor.blockCardUnavailable',
41
- defaultMessage: 'The inline link is inside {node} and cannot have its view changed',
42
- description: 'Warning message to show the user that this node cannot change its view'
43
- },
44
- displayOptionUnavailableInParentNode: {
45
- id: 'fabric.editor.displayOptionUnavailableInParentNode',
46
- defaultMessage: "This display option isn't available inside {node}",
47
- description: 'Warning message to show the user that this node option is not available inside a parent node type'
48
- },
49
- urlTitle: {
50
- id: 'fabric.editor.urlTitle',
51
- defaultMessage: 'URL',
52
- description: 'Title for option to convert the card to become a regular text-based hyperlink.'
53
- },
54
- blockTitle: {
55
- id: 'fabric.editor.blockTitle',
56
- defaultMessage: 'Card',
57
- description: 'Title for option to display link in the card view.'
58
- },
59
- inlineTitle: {
60
- id: 'fabric.editor.inlineTitle',
61
- defaultMessage: 'Inline',
62
- description: 'Title for option to display link in the inline view.'
63
- },
64
- embedTitle: {
65
- id: 'fabric.editor.embedTitle',
66
- defaultMessage: 'Embed',
67
- description: 'Title for option to display link as an embedded object.'
68
- },
69
- urlDescription: {
70
- id: 'fabric.editor.urlDescription',
71
- defaultMessage: 'Display link as URL',
72
- description: 'Description for option to convert the card to become a regular text-based hyperlink.'
73
- },
74
- blockDescription: {
75
- id: 'fabric.editor.blockDescription',
76
- defaultMessage: 'Display more information about a link, including a summary and actions',
77
- description: 'Description for option to display link in the card view.'
78
- },
79
- inlineDescription: {
80
- id: 'fabric.editor.inlineDescription',
81
- defaultMessage: 'Display link as inline text',
82
- description: 'Description for option to display link in the inline view.'
83
- },
84
- embedDescription: {
85
- id: 'fabric.editor.ecombedDescription',
86
- defaultMessage: 'Display an interactive preview of a link',
87
- description: 'Description for option to display link as an embedded object.'
88
- }
89
- });
90
- exports.messages = messages;
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.smartCardStyles = exports.FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _react = require("@emotion/react");
10
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
- var _colors = require("@atlaskit/theme/colors");
12
- var _styles = require("@atlaskit/editor-common/styles");
13
- var _datasource = require("./nodeviews/datasource");
14
- var _templateObject;
15
- var FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
16
- exports.FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = FLOATING_TOOLBAR_LINKPICKER_CLASSNAME;
17
- var smartCardStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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 max-width: 100%;\n display: flex;\n justify-content: center;\n\n .", " {\n cursor: pointer;\n background-color: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n }\n\n &.", " {\n .", " {\n ", "\n }\n }\n\n &.danger {\n .", " {\n box-shadow: 0 0 0 1px\n ", ";\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"])), _styles.SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _styles.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _styles.SmartCardSharedCssClassName.DATASOURCE_CONTAINER, _styles.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _datasource.DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-background-neutral-subtle, ".concat(_colors.N0, ")"), "var(--ds-border-radius-100, ".concat(_editorSharedStyles.akEditorRuleBorderRadius, ")"), "var(--ds-border, ".concat(_colors.N40, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, _datasource.DATASOURCE_INNER_CONTAINER_CLASSNAME, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _datasource.DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _styles.SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), FLOATING_TOOLBAR_LINKPICKER_CLASSNAME);
18
- exports.smartCardStyles = smartCardStyles;
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.LinkToolbarButtonGroup = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _react2 = require("@emotion/react");
12
- var _button = require("@atlaskit/button");
13
- var _ui = require("@atlaskit/editor-common/ui");
14
- var _excluded = ["disabled"];
15
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
16
- /** @jsx jsx */
17
- /**
18
- * Applying `pointer-events: none;` when disabled allows the Tooltip to be displayed
19
- */
20
- var buttonStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n pointer-events: auto;\n"])));
21
- var buttonStyleNoneEvent = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n pointer-events: none;\n"])));
22
- var DisallowedWrapper = function DisallowedWrapper(_ref) {
23
- var disabled = _ref.disabled,
24
- props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
25
- return (0, _react2.jsx)("div", props);
26
- };
27
-
28
- /**
29
- * The button requires `pointer-events: none;` in order to fix the tooltip, hence
30
- * leaving us without a disabled cursor, the following fixes this:
31
- */
32
- var defaultWrapperStyle = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n"])));
33
- var disallowedWrapperStyle = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n cursor: not-allowed;\n"])));
34
- var LinkToolbarButtonGroup = function LinkToolbarButtonGroup(_ref2) {
35
- var options = _ref2.options;
36
- return (0, _react2.jsx)(_button.ButtonGroup, null, options.map(function (_ref3) {
37
- var onClick = _ref3.onClick,
38
- selected = _ref3.selected,
39
- disabled = _ref3.disabled,
40
- testId = _ref3.testId,
41
- tooltipContent = _ref3.tooltipContent,
42
- title = _ref3.title,
43
- Icon = _ref3.icon;
44
- return (0, _react2.jsx)(DisallowedWrapper, {
45
- css: disabled ? disallowedWrapperStyle : defaultWrapperStyle,
46
- key: testId,
47
- disabled: disabled
48
- }, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
49
- css: disabled ? buttonStyleNoneEvent : buttonStyle,
50
- title: title,
51
- icon: (0, _react2.jsx)(Icon, {
52
- size: "medium",
53
- label: title
54
- }),
55
- selected: selected,
56
- onClick: onClick,
57
- testId: testId,
58
- disabled: disabled,
59
- tooltipContent: tooltipContent
60
- }));
61
- }));
62
- };
63
- exports.LinkToolbarButtonGroup = LinkToolbarButtonGroup;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.IconCard = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _icon = _interopRequireDefault(require("@atlaskit/icon"));
11
- var IconCardGlyph = function IconCardGlyph(props) {
12
- return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
13
- width: "32",
14
- height: "32",
15
- viewBox: "0 0 32 32",
16
- fill: "none",
17
- xmlns: "http://www.w3.org/2000/svg"
18
- }, props), /*#__PURE__*/_react.default.createElement("path", {
19
- fillRule: "evenodd",
20
- clipRule: "evenodd",
21
- d: "M8 9c-1.10457 0-2 .89543-2 2v10c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2V11c0-1.10457-.8954-2-2-2H8Zm0 3c0-.5523.44772-1 1-1h2c.5523 0 1 .4477 1 1v2c0 .5523-.4477 1-1 1H9c-.55228 0-1-.4477-1-1v-2Zm5 1c0-.2761.2239-.5.5-.5h10c.2761 0 .5.2239.5.5s-.2239.5-.5.5h-10c-.2761 0-.5-.2239-.5-.5Zm-4 3c-.55228 0-1 .4477-1 1s.44772 1 1 1h14c.5523 0 1-.4477 1-1s-.4477-1-1-1H9Zm-1 4c0-.5523.44772-1 1-1h6c.5523 0 1 .4477 1 1s-.4477 1-1 1H9c-.55228 0-1-.4477-1-1Z",
22
- fill: "currentColor"
23
- }));
24
- };
25
- var IconCard = function IconCard(props) {
26
- return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
27
- glyph: IconCardGlyph
28
- }, props));
29
- };
30
- exports.IconCard = IconCard;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.IconEmbed = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _icon = _interopRequireDefault(require("@atlaskit/icon"));
11
- var IconEmbedGlyph = function IconEmbedGlyph(props) {
12
- return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
13
- width: "32",
14
- height: "32",
15
- viewBox: "0 0 32 32",
16
- fill: "none",
17
- xmlns: "http://www.w3.org/2000/svg"
18
- }, props), /*#__PURE__*/_react.default.createElement("path", {
19
- fillRule: "evenodd",
20
- clipRule: "evenodd",
21
- d: "M8 6c-1.10457 0-2 .89543-2 2v16c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2V8c0-1.10457-.8954-2-2-2H8Zm1 2c-.55228 0-1 .44772-1 1v2c0 .5523.44772 1 1 1h2c.5523 0 1-.4477 1-1V9c0-.55228-.4477-1-1-1H9Zm4.5 1.5c-.2761 0-.5.22386-.5.5 0 .2761.2239.5.5.5h10c.2761 0 .5-.2239.5-.5 0-.27614-.2239-.5-.5-.5h-10ZM9 14c-.55228 0-1 .4477-1 1v8c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-8c0-.5523-.4477-1-1-1H9Zm6 2.5c0 .8284-.6716 1.5-1.5 1.5s-1.5-.6716-1.5-1.5.6716-1.5 1.5-1.5 1.5.6716 1.5 1.5Zm0 5.5-1-1-2 2h8v-1.8L18 19l-3 3Z",
22
- fill: "currentColor"
23
- }));
24
- };
25
- var IconEmbed = function IconEmbed(props) {
26
- return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
27
- glyph: IconEmbedGlyph
28
- }, props));
29
- };
30
- exports.IconEmbed = IconEmbed;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.IconInline = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _icon = _interopRequireDefault(require("@atlaskit/icon"));
11
- var IconInlineGlyph = function IconInlineGlyph(props) {
12
- return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
13
- width: "32",
14
- height: "32",
15
- viewBox: "0 0 32 32",
16
- fill: "none",
17
- xmlns: "http://www.w3.org/2000/svg"
18
- }, props), /*#__PURE__*/_react.default.createElement("path", {
19
- fillRule: "evenodd",
20
- clipRule: "evenodd",
21
- d: "M8 12c-1.10457 0-2 .8954-2 2v4c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2v-4c0-1.1046-.8954-2-2-2H8Zm0 3c0-.5523.44772-1 1-1h2c.5523 0 1 .4477 1 1v2c0 .5523-.4477 1-1 1H9c-.55228 0-1-.4477-1-1v-2Zm5 1c0-.2761.2239-.5.5-.5h10c.2761 0 .5.2239.5.5s-.2239.5-.5.5h-10c-.2761 0-.5-.2239-.5-.5Z",
22
- fill: "currentColor"
23
- }));
24
- };
25
- var IconInline = function IconInline(props) {
26
- return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
27
- glyph: IconInlineGlyph
28
- }, props));
29
- };
30
- exports.IconInline = IconInline;
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.IconUrl = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _icon = _interopRequireDefault(require("@atlaskit/icon"));
11
- var IconUrlGlyph = function IconUrlGlyph(props) {
12
- return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
13
- width: "32",
14
- height: "32",
15
- viewBox: "0 0 32 32",
16
- fill: "none",
17
- xmlns: "http://www.w3.org/2000/svg"
18
- }, props), /*#__PURE__*/_react.default.createElement("rect", {
19
- x: "6",
20
- y: "15",
21
- width: "20",
22
- height: "2",
23
- rx: "1",
24
- fill: "currentColor"
25
- }));
26
- };
27
- var IconUrl = function IconUrl(props) {
28
- return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
29
- glyph: IconUrlGlyph
30
- }, props));
31
- };
32
- exports.IconUrl = IconUrl;