@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
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getButtonGroupOption = void 0;
7
- var _messages = require("../messages");
8
- var _card = require("./assets/card");
9
- var _embed = require("./assets/embed");
10
- var _inline = require("./assets/inline");
11
- var _url = require("./assets/url");
12
- var appearancePropsMap = {
13
- url: {
14
- title: _messages.messages.urlTitle,
15
- icon: _url.IconUrl
16
- },
17
- inline: {
18
- title: _messages.messages.inlineTitle,
19
- icon: _inline.IconInline
20
- },
21
- block: {
22
- title: _messages.messages.blockTitle,
23
- icon: _card.IconCard
24
- },
25
- embed: {
26
- title: _messages.messages.embedTitle,
27
- icon: _embed.IconEmbed
28
- }
29
- };
30
- var getButtonGroupOption = function getButtonGroupOption(intl, dispatchCommand, _ref) {
31
- var disabled = _ref.disabled,
32
- _onClick = _ref.onClick,
33
- selected = _ref.selected,
34
- appearance = _ref.appearance,
35
- testId = _ref.testId,
36
- tooltip = _ref.tooltip;
37
- var _appearancePropsMap = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'],
38
- title = _appearancePropsMap.title,
39
- icon = _appearancePropsMap.icon;
40
- return {
41
- title: intl.formatMessage(title),
42
- icon: icon,
43
- onClick: function onClick() {
44
- return dispatchCommand(_onClick);
45
- },
46
- disabled: Boolean(disabled),
47
- tooltipContent: tooltip || null,
48
- testId: testId,
49
- selected: selected
50
- };
51
- };
52
- exports.getButtonGroupOption = getButtonGroupOption;
@@ -1,16 +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.embedSpacingStyles = exports.embedCardStyles = exports.editIconStyles = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _react = require("@emotion/react");
10
- var _templateObject, _templateObject2, _templateObject3;
11
- var embedCardStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n .embedCardView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n }\n\n .embedCardView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .embedCardView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .embedCardView-content-wrap[layout='wrap-right']\n + .embedCardView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n }\n"])));
12
- exports.embedCardStyles = embedCardStyles;
13
- var embedSpacingStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 10px;\n"])));
14
- exports.embedSpacingStyles = embedSpacingStyles;
15
- var editIconStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 20px;\n"])));
16
- exports.editIconStyles = editIconStyles;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,83 +0,0 @@
1
- import { defineMessages } from 'react-intl-next';
2
- export const messages = defineMessages({
3
- url: {
4
- id: 'fabric.editor.url',
5
- defaultMessage: 'Display URL',
6
- description: 'Convert the card to become a regular text-based hyperlink.'
7
- },
8
- block: {
9
- id: 'fabric.editor.displayBlock',
10
- defaultMessage: 'Display card',
11
- description: 'Display link as a card with a rich preview similar to in a Facebook feed with page title, description, and potentially an image.'
12
- },
13
- inline: {
14
- id: 'fabric.editor.displayInline',
15
- defaultMessage: 'Display inline',
16
- description: 'Display link with the title only.'
17
- },
18
- embed: {
19
- id: 'fabric.editor.displayEmbed',
20
- defaultMessage: 'Display embed',
21
- description: 'Display link as an embedded object'
22
- },
23
- link: {
24
- id: 'fabric.editor.displayLink',
25
- defaultMessage: 'Display as text',
26
- description: 'Convert the card to become a regular text-based hyperlink.'
27
- },
28
- card: {
29
- id: 'fabric.editor.cardFloatingControls',
30
- defaultMessage: 'Card options',
31
- description: 'Options to change card type'
32
- },
33
- blockCardUnavailable: {
34
- id: 'fabric.editor.blockCardUnavailable',
35
- defaultMessage: 'The inline link is inside {node} and cannot have its view changed',
36
- description: 'Warning message to show the user that this node cannot change its view'
37
- },
38
- displayOptionUnavailableInParentNode: {
39
- id: 'fabric.editor.displayOptionUnavailableInParentNode',
40
- defaultMessage: "This display option isn't available inside {node}",
41
- description: 'Warning message to show the user that this node option is not available inside a parent node type'
42
- },
43
- urlTitle: {
44
- id: 'fabric.editor.urlTitle',
45
- defaultMessage: 'URL',
46
- description: 'Title for option to convert the card to become a regular text-based hyperlink.'
47
- },
48
- blockTitle: {
49
- id: 'fabric.editor.blockTitle',
50
- defaultMessage: 'Card',
51
- description: 'Title for option to display link in the card view.'
52
- },
53
- inlineTitle: {
54
- id: 'fabric.editor.inlineTitle',
55
- defaultMessage: 'Inline',
56
- description: 'Title for option to display link in the inline view.'
57
- },
58
- embedTitle: {
59
- id: 'fabric.editor.embedTitle',
60
- defaultMessage: 'Embed',
61
- description: 'Title for option to display link as an embedded object.'
62
- },
63
- urlDescription: {
64
- id: 'fabric.editor.urlDescription',
65
- defaultMessage: 'Display link as URL',
66
- description: 'Description for option to convert the card to become a regular text-based hyperlink.'
67
- },
68
- blockDescription: {
69
- id: 'fabric.editor.blockDescription',
70
- defaultMessage: 'Display more information about a link, including a summary and actions',
71
- description: 'Description for option to display link in the card view.'
72
- },
73
- inlineDescription: {
74
- id: 'fabric.editor.inlineDescription',
75
- defaultMessage: 'Display link as inline text',
76
- description: 'Description for option to display link in the inline view.'
77
- },
78
- embedDescription: {
79
- id: 'fabric.editor.ecombedDescription',
80
- defaultMessage: 'Display an interactive preview of a link',
81
- description: 'Description for option to display link as an embedded object.'
82
- }
83
- });
@@ -1,132 +0,0 @@
1
- import { css } from '@emotion/react';
2
- import { SelectionStyle, getSelectionStyles, akEditorDeleteBorder, akEditorDeleteBackground, akEditorRuleBorderRadius } from '@atlaskit/editor-shared-styles';
3
- import { N0, N20, N40 } from '@atlaskit/theme/colors';
4
- import { SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
5
- import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
6
- import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from './nodeviews/datasource';
7
- export const FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
8
- export const smartCardStyles = css`
9
- .${SmartCardSharedCssClassName.INLINE_CARD_CONTAINER} {
10
- max-width: calc(100% - 20px);
11
- vertical-align: top;
12
- word-break: break-all;
13
-
14
- .card {
15
- padding-left: 2px;
16
- padding-right: 2px;
17
- padding-top: 0.5em;
18
- padding-bottom: 0.5em;
19
- margin-bottom: -0.5em;
20
-
21
- .${SmartCardSharedCssClassName.LOADER_WRAPPER} > a:focus {
22
- ${getSelectionStyles([SelectionStyle.BoxShadow])}
23
- }
24
- }
25
-
26
- &.${akEditorSelectedNodeClassName}
27
- .${SmartCardSharedCssClassName.LOADER_WRAPPER}
28
- > a {
29
- ${getSelectionStyles([SelectionStyle.BoxShadow])}
30
- }
31
- .${SmartCardSharedCssClassName.LOADER_WRAPPER} > a {
32
- /* EDM-1717: box-shadow Safari fix start */
33
- z-index: 1;
34
- position: relative;
35
- /* EDM-1717: box-shadow Safari fix end */
36
- }
37
-
38
- &.danger {
39
- .${SmartCardSharedCssClassName.LOADER_WRAPPER} > a {
40
- box-shadow: 0 0 0 1px
41
- ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
42
- /* EDM-1717: box-shadow Safari fix start */
43
- z-index: 2;
44
- /* EDM-1717: box-shadow Safari fix end */
45
- }
46
- }
47
- }
48
-
49
- .${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER} {
50
- .${SmartCardSharedCssClassName.LOADER_WRAPPER} > div {
51
- cursor: pointer;
52
- &:hover {
53
- background-color: ${`var(--ds-background-neutral-subtle-hovered, ${N20})`};
54
- }
55
- }
56
-
57
- &.${akEditorSelectedNodeClassName}
58
- .${SmartCardSharedCssClassName.LOADER_WRAPPER}
59
- > div {
60
- ${getSelectionStyles([SelectionStyle.BoxShadow])}
61
- }
62
-
63
- &.danger {
64
- .${SmartCardSharedCssClassName.LOADER_WRAPPER} > div {
65
- box-shadow: 0 0 0 1px
66
- ${`var(--ds-border-danger, ${akEditorDeleteBorder})`} !important;
67
- }
68
- }
69
- }
70
-
71
- .${SmartCardSharedCssClassName.DATASOURCE_CONTAINER}.${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER} {
72
- max-width: 100%;
73
- display: flex;
74
- justify-content: center;
75
-
76
- .${DATASOURCE_INNER_CONTAINER_CLASSNAME} {
77
- cursor: pointer;
78
- background-color: ${`var(--ds-background-neutral-subtle, ${N0})`};
79
- border-radius: ${`var(--ds-border-radius-100, ${akEditorRuleBorderRadius})`};
80
- border: 1px solid ${`var(--ds-border, ${N40})`};
81
- }
82
-
83
- &.${akEditorSelectedNodeClassName} {
84
- .${DATASOURCE_INNER_CONTAINER_CLASSNAME} {
85
- ${getSelectionStyles([SelectionStyle.BoxShadow])}
86
- }
87
- }
88
-
89
- &.danger {
90
- .${DATASOURCE_INNER_CONTAINER_CLASSNAME} {
91
- box-shadow: 0 0 0 1px
92
- ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
93
- }
94
- }
95
- }
96
-
97
- .${SmartCardSharedCssClassName.EMBED_CARD_CONTAINER} {
98
- .${SmartCardSharedCssClassName.LOADER_WRAPPER} > div {
99
- cursor: pointer;
100
- &::after {
101
- transition: box-shadow 0s;
102
- }
103
- }
104
- &.${akEditorSelectedNodeClassName}
105
- .${SmartCardSharedCssClassName.LOADER_WRAPPER}
106
- > div {
107
- ${getSelectionStyles([SelectionStyle.BoxShadow])}
108
- }
109
-
110
- &.${akEditorSelectedNodeClassName}
111
- .${SmartCardSharedCssClassName.LOADER_WRAPPER}
112
- > div::after {
113
- ${getSelectionStyles([SelectionStyle.BoxShadow])}
114
- }
115
-
116
- &.danger {
117
- .media-card-frame::after {
118
- box-shadow: 0 0 0 1px
119
- ${`var(--ds-border-danger, ${akEditorDeleteBorder})`} !important;
120
- background: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`} !important;
121
- }
122
- .richMedia-resize-handle-right::after,
123
- .richMedia-resize-handle-left::after {
124
- background: ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
125
- }
126
- }
127
- }
128
-
129
- .${FLOATING_TOOLBAR_LINKPICKER_CLASSNAME} {
130
- padding: 0;
131
- }
132
- `;
@@ -1,61 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { css, jsx } from '@emotion/react';
4
- import { ButtonGroup } from '@atlaskit/button';
5
- import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
6
-
7
- /**
8
- * Applying `pointer-events: none;` when disabled allows the Tooltip to be displayed
9
- */
10
- const buttonStyle = css`
11
- pointer-events: auto;
12
- `;
13
- const buttonStyleNoneEvent = css`
14
- pointer-events: none;
15
- `;
16
- const DisallowedWrapper = ({
17
- disabled,
18
- ...props
19
- }) => {
20
- return jsx("div", props);
21
- };
22
-
23
- /**
24
- * The button requires `pointer-events: none;` in order to fix the tooltip, hence
25
- * leaving us without a disabled cursor, the following fixes this:
26
- */
27
- const defaultWrapperStyle = css`
28
- cursor: pointer;
29
- `;
30
- const disallowedWrapperStyle = css`
31
- cursor: not-allowed;
32
- `;
33
- export const LinkToolbarButtonGroup = ({
34
- options
35
- }) => {
36
- return jsx(ButtonGroup, null, options.map(({
37
- onClick,
38
- selected,
39
- disabled,
40
- testId,
41
- tooltipContent,
42
- title,
43
- icon: Icon
44
- }) => jsx(DisallowedWrapper, {
45
- css: disabled ? disallowedWrapperStyle : defaultWrapperStyle,
46
- key: testId,
47
- disabled: disabled
48
- }, jsx(Button, {
49
- css: disabled ? buttonStyleNoneEvent : buttonStyle,
50
- title: title,
51
- icon: 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
- };
@@ -1,22 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import Icon from '@atlaskit/icon';
4
- const IconCardGlyph = props => {
5
- return /*#__PURE__*/React.createElement("svg", _extends({
6
- width: "32",
7
- height: "32",
8
- viewBox: "0 0 32 32",
9
- fill: "none",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }, props), /*#__PURE__*/React.createElement("path", {
12
- fillRule: "evenodd",
13
- clipRule: "evenodd",
14
- 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",
15
- fill: "currentColor"
16
- }));
17
- };
18
- export const IconCard = props => {
19
- return /*#__PURE__*/React.createElement(Icon, _extends({
20
- glyph: IconCardGlyph
21
- }, props));
22
- };
@@ -1,22 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import Icon from '@atlaskit/icon';
4
- const IconEmbedGlyph = props => {
5
- return /*#__PURE__*/React.createElement("svg", _extends({
6
- width: "32",
7
- height: "32",
8
- viewBox: "0 0 32 32",
9
- fill: "none",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }, props), /*#__PURE__*/React.createElement("path", {
12
- fillRule: "evenodd",
13
- clipRule: "evenodd",
14
- 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",
15
- fill: "currentColor"
16
- }));
17
- };
18
- export const IconEmbed = props => {
19
- return /*#__PURE__*/React.createElement(Icon, _extends({
20
- glyph: IconEmbedGlyph
21
- }, props));
22
- };
@@ -1,22 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import Icon from '@atlaskit/icon';
4
- const IconInlineGlyph = props => {
5
- return /*#__PURE__*/React.createElement("svg", _extends({
6
- width: "32",
7
- height: "32",
8
- viewBox: "0 0 32 32",
9
- fill: "none",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }, props), /*#__PURE__*/React.createElement("path", {
12
- fillRule: "evenodd",
13
- clipRule: "evenodd",
14
- 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",
15
- fill: "currentColor"
16
- }));
17
- };
18
- export const IconInline = props => {
19
- return /*#__PURE__*/React.createElement(Icon, _extends({
20
- glyph: IconInlineGlyph
21
- }, props));
22
- };
@@ -1,24 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import Icon from '@atlaskit/icon';
4
- const IconUrlGlyph = props => {
5
- return /*#__PURE__*/React.createElement("svg", _extends({
6
- width: "32",
7
- height: "32",
8
- viewBox: "0 0 32 32",
9
- fill: "none",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }, props), /*#__PURE__*/React.createElement("rect", {
12
- x: "6",
13
- y: "15",
14
- width: "20",
15
- height: "2",
16
- rx: "1",
17
- fill: "currentColor"
18
- }));
19
- };
20
- export const IconUrl = props => {
21
- return /*#__PURE__*/React.createElement(Icon, _extends({
22
- glyph: IconUrlGlyph
23
- }, props));
24
- };
@@ -1,45 +0,0 @@
1
- import { messages } from '../messages';
2
- import { IconCard } from './assets/card';
3
- import { IconEmbed } from './assets/embed';
4
- import { IconInline } from './assets/inline';
5
- import { IconUrl } from './assets/url';
6
- const appearancePropsMap = {
7
- url: {
8
- title: messages.urlTitle,
9
- icon: IconUrl
10
- },
11
- inline: {
12
- title: messages.inlineTitle,
13
- icon: IconInline
14
- },
15
- block: {
16
- title: messages.blockTitle,
17
- icon: IconCard
18
- },
19
- embed: {
20
- title: messages.embedTitle,
21
- icon: IconEmbed
22
- }
23
- };
24
- export const getButtonGroupOption = (intl, dispatchCommand, {
25
- disabled,
26
- onClick,
27
- selected,
28
- appearance,
29
- testId,
30
- tooltip
31
- }) => {
32
- const {
33
- title,
34
- icon
35
- } = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'];
36
- return {
37
- title: intl.formatMessage(title),
38
- icon,
39
- onClick: () => dispatchCommand(onClick),
40
- disabled: Boolean(disabled),
41
- tooltipContent: tooltip || null,
42
- testId,
43
- selected
44
- };
45
- };
@@ -1,27 +0,0 @@
1
- import { css } from '@emotion/react';
2
- export const embedCardStyles = css`
3
- .ProseMirror {
4
- .embedCardView-content-wrap[layout^='wrap-'] {
5
- max-width: 100%;
6
- }
7
-
8
- .embedCardView-content-wrap[layout='wrap-left'] {
9
- float: left;
10
- }
11
-
12
- .embedCardView-content-wrap[layout='wrap-right'] {
13
- float: right;
14
- }
15
-
16
- .embedCardView-content-wrap[layout='wrap-right']
17
- + .embedCardView-content-wrap[layout='wrap-left'] {
18
- clear: both;
19
- }
20
- }
21
- `;
22
- export const embedSpacingStyles = css`
23
- margin: 0 10px;
24
- `;
25
- export const editIconStyles = css`
26
- width: 20px;
27
- `;
@@ -1 +0,0 @@
1
- export {};
@@ -1,83 +0,0 @@
1
- import { defineMessages } from 'react-intl-next';
2
- export var messages = defineMessages({
3
- url: {
4
- id: 'fabric.editor.url',
5
- defaultMessage: 'Display URL',
6
- description: 'Convert the card to become a regular text-based hyperlink.'
7
- },
8
- block: {
9
- id: 'fabric.editor.displayBlock',
10
- defaultMessage: 'Display card',
11
- description: 'Display link as a card with a rich preview similar to in a Facebook feed with page title, description, and potentially an image.'
12
- },
13
- inline: {
14
- id: 'fabric.editor.displayInline',
15
- defaultMessage: 'Display inline',
16
- description: 'Display link with the title only.'
17
- },
18
- embed: {
19
- id: 'fabric.editor.displayEmbed',
20
- defaultMessage: 'Display embed',
21
- description: 'Display link as an embedded object'
22
- },
23
- link: {
24
- id: 'fabric.editor.displayLink',
25
- defaultMessage: 'Display as text',
26
- description: 'Convert the card to become a regular text-based hyperlink.'
27
- },
28
- card: {
29
- id: 'fabric.editor.cardFloatingControls',
30
- defaultMessage: 'Card options',
31
- description: 'Options to change card type'
32
- },
33
- blockCardUnavailable: {
34
- id: 'fabric.editor.blockCardUnavailable',
35
- defaultMessage: 'The inline link is inside {node} and cannot have its view changed',
36
- description: 'Warning message to show the user that this node cannot change its view'
37
- },
38
- displayOptionUnavailableInParentNode: {
39
- id: 'fabric.editor.displayOptionUnavailableInParentNode',
40
- defaultMessage: "This display option isn't available inside {node}",
41
- description: 'Warning message to show the user that this node option is not available inside a parent node type'
42
- },
43
- urlTitle: {
44
- id: 'fabric.editor.urlTitle',
45
- defaultMessage: 'URL',
46
- description: 'Title for option to convert the card to become a regular text-based hyperlink.'
47
- },
48
- blockTitle: {
49
- id: 'fabric.editor.blockTitle',
50
- defaultMessage: 'Card',
51
- description: 'Title for option to display link in the card view.'
52
- },
53
- inlineTitle: {
54
- id: 'fabric.editor.inlineTitle',
55
- defaultMessage: 'Inline',
56
- description: 'Title for option to display link in the inline view.'
57
- },
58
- embedTitle: {
59
- id: 'fabric.editor.embedTitle',
60
- defaultMessage: 'Embed',
61
- description: 'Title for option to display link as an embedded object.'
62
- },
63
- urlDescription: {
64
- id: 'fabric.editor.urlDescription',
65
- defaultMessage: 'Display link as URL',
66
- description: 'Description for option to convert the card to become a regular text-based hyperlink.'
67
- },
68
- blockDescription: {
69
- id: 'fabric.editor.blockDescription',
70
- defaultMessage: 'Display more information about a link, including a summary and actions',
71
- description: 'Description for option to display link in the card view.'
72
- },
73
- inlineDescription: {
74
- id: 'fabric.editor.inlineDescription',
75
- defaultMessage: 'Display link as inline text',
76
- description: 'Description for option to display link in the inline view.'
77
- },
78
- embedDescription: {
79
- id: 'fabric.editor.ecombedDescription',
80
- defaultMessage: 'Display an interactive preview of a link',
81
- description: 'Description for option to display link as an embedded object.'
82
- }
83
- });
@@ -1,10 +0,0 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject;
3
- import { css } from '@emotion/react';
4
- import { SelectionStyle, getSelectionStyles, akEditorDeleteBorder, akEditorDeleteBackground, akEditorRuleBorderRadius } from '@atlaskit/editor-shared-styles';
5
- import { N0, N20, N40 } from '@atlaskit/theme/colors';
6
- import { SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
7
- import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
8
- import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from './nodeviews/datasource';
9
- export var FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
10
- 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 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"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.DATASOURCE_CONTAINER, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-background-neutral-subtle, ".concat(N0, ")"), "var(--ds-border-radius-100, ".concat(akEditorRuleBorderRadius, ")"), "var(--ds-border, ".concat(N40, ")"), akEditorSelectedNodeClassName, DATASOURCE_INNER_CONTAINER_CLASSNAME, getSelectionStyles([SelectionStyle.BoxShadow]), DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), FLOATING_TOOLBAR_LINKPICKER_CLASSNAME);