@atlaskit/editor-common 74.12.0 → 74.14.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 (104) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +1 -1
  3. package/dist/cjs/card/LinkToolbarButtonGroup.js +63 -0
  4. package/dist/cjs/card/index.js +18 -1
  5. package/dist/cjs/card/link-toolbar-button-group-options.js +52 -0
  6. package/dist/cjs/card/types.js +5 -0
  7. package/dist/cjs/card/ui/assets/card.js +30 -0
  8. package/dist/cjs/card/ui/assets/embed.js +30 -0
  9. package/dist/cjs/card/ui/assets/inline.js +30 -0
  10. package/dist/cjs/card/ui/assets/url.js +32 -0
  11. package/dist/cjs/messages/card.js +90 -0
  12. package/dist/cjs/messages/index.js +7 -0
  13. package/dist/cjs/monitoring/error.js +1 -1
  14. package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +0 -1
  15. package/dist/cjs/react-node-view/index.js +0 -1
  16. package/dist/cjs/styles/index.js +39 -1
  17. package/dist/cjs/styles/shared/embedCard.js +16 -0
  18. package/dist/cjs/styles/shared/smartCard.js +19 -0
  19. package/dist/cjs/ui/DropList/index.js +1 -1
  20. package/dist/cjs/utils/get-performance-options.js +1 -4
  21. package/dist/cjs/version.json +1 -1
  22. package/dist/cjs/with-plugin-state/index.js +1 -4
  23. package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +1 -0
  24. package/dist/es2019/card/LinkToolbarButtonGroup.js +61 -0
  25. package/dist/es2019/card/index.js +4 -1
  26. package/dist/es2019/card/link-toolbar-button-group-options.js +45 -0
  27. package/dist/es2019/card/types.js +1 -0
  28. package/dist/es2019/card/ui/assets/card.js +22 -0
  29. package/dist/es2019/card/ui/assets/embed.js +22 -0
  30. package/dist/es2019/card/ui/assets/inline.js +22 -0
  31. package/dist/es2019/card/ui/assets/url.js +24 -0
  32. package/dist/es2019/messages/card.js +83 -0
  33. package/dist/es2019/messages/index.js +1 -0
  34. package/dist/es2019/monitoring/error.js +1 -1
  35. package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +0 -1
  36. package/dist/es2019/react-node-view/index.js +0 -1
  37. package/dist/es2019/styles/index.js +3 -1
  38. package/dist/es2019/styles/shared/embedCard.js +27 -0
  39. package/dist/es2019/styles/shared/smartCard.js +131 -0
  40. package/dist/es2019/ui/DropList/index.js +1 -1
  41. package/dist/es2019/utils/get-performance-options.js +1 -4
  42. package/dist/es2019/version.json +1 -1
  43. package/dist/es2019/with-plugin-state/index.js +1 -4
  44. package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +1 -0
  45. package/dist/esm/card/LinkToolbarButtonGroup.js +56 -0
  46. package/dist/esm/card/index.js +4 -1
  47. package/dist/esm/card/link-toolbar-button-group-options.js +45 -0
  48. package/dist/esm/card/types.js +1 -0
  49. package/dist/esm/card/ui/assets/card.js +22 -0
  50. package/dist/esm/card/ui/assets/embed.js +22 -0
  51. package/dist/esm/card/ui/assets/inline.js +22 -0
  52. package/dist/esm/card/ui/assets/url.js +24 -0
  53. package/dist/esm/messages/card.js +83 -0
  54. package/dist/esm/messages/index.js +1 -0
  55. package/dist/esm/monitoring/error.js +1 -1
  56. package/dist/esm/react-node-view/getInlineNodeViewProducer.js +0 -1
  57. package/dist/esm/react-node-view/index.js +0 -1
  58. package/dist/esm/styles/index.js +3 -1
  59. package/dist/esm/styles/shared/embedCard.js +6 -0
  60. package/dist/esm/styles/shared/smartCard.js +9 -0
  61. package/dist/esm/ui/DropList/index.js +1 -1
  62. package/dist/esm/utils/get-performance-options.js +1 -4
  63. package/dist/esm/version.json +1 -1
  64. package/dist/esm/with-plugin-state/index.js +1 -4
  65. package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +1 -1
  66. package/dist/types/analytics/types/general-events.d.ts +0 -2
  67. package/dist/types/card/LinkToolbarButtonGroup.d.ts +16 -0
  68. package/dist/types/card/index.d.ts +4 -0
  69. package/dist/types/card/link-toolbar-button-group-options.d.ts +5 -0
  70. package/dist/types/card/types.d.ts +27 -0
  71. package/dist/types/card/ui/assets/card.d.ts +3 -0
  72. package/dist/types/card/ui/assets/embed.d.ts +3 -0
  73. package/dist/types/card/ui/assets/inline.d.ts +3 -0
  74. package/dist/types/card/ui/assets/url.d.ts +3 -0
  75. package/dist/types/messages/card.d.ts +82 -0
  76. package/dist/types/messages/index.d.ts +1 -0
  77. package/dist/types/provider-factory/card-provider.d.ts +1 -1
  78. package/dist/types/styles/index.d.ts +2 -0
  79. package/dist/types/styles/shared/embedCard.d.ts +3 -0
  80. package/dist/types/styles/shared/smartCard.d.ts +3 -0
  81. package/dist/types/utils/get-performance-options.d.ts +1 -3
  82. package/dist/types-ts4.5/__tests_external__/page-objects/EditorSmartLink.d.ts +1 -1
  83. package/dist/types-ts4.5/analytics/types/general-events.d.ts +0 -2
  84. package/dist/types-ts4.5/card/LinkToolbarButtonGroup.d.ts +16 -0
  85. package/dist/types-ts4.5/card/index.d.ts +4 -0
  86. package/dist/types-ts4.5/card/link-toolbar-button-group-options.d.ts +5 -0
  87. package/dist/types-ts4.5/card/types.d.ts +27 -0
  88. package/dist/types-ts4.5/card/ui/assets/card.d.ts +3 -0
  89. package/dist/types-ts4.5/card/ui/assets/embed.d.ts +3 -0
  90. package/dist/types-ts4.5/card/ui/assets/inline.d.ts +3 -0
  91. package/dist/types-ts4.5/card/ui/assets/url.d.ts +3 -0
  92. package/dist/types-ts4.5/messages/card.d.ts +82 -0
  93. package/dist/types-ts4.5/messages/index.d.ts +1 -0
  94. package/dist/types-ts4.5/provider-factory/card-provider.d.ts +1 -1
  95. package/dist/types-ts4.5/styles/index.d.ts +2 -0
  96. package/dist/types-ts4.5/styles/shared/embedCard.d.ts +3 -0
  97. package/dist/types-ts4.5/styles/shared/smartCard.d.ts +3 -0
  98. package/dist/types-ts4.5/utils/get-performance-options.d.ts +1 -3
  99. package/package.json +6 -6
  100. package/dist/cjs/utils/collab.js +0 -18
  101. package/dist/es2019/utils/collab.js +0 -11
  102. package/dist/esm/utils/collab.js +0 -11
  103. package/dist/types/utils/collab.d.ts +0 -2
  104. package/dist/types-ts4.5/utils/collab.d.ts +0 -2
@@ -0,0 +1,45 @@
1
+ import { cardMessages as messages } from '../messages';
2
+ import { IconCard } from './ui/assets/card';
3
+ import { IconEmbed } from './ui/assets/embed';
4
+ import { IconInline } from './ui/assets/inline';
5
+ import { IconUrl } from './ui/assets/url';
6
+ var 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 var getButtonGroupOption = function getButtonGroupOption(intl, dispatchCommand, _ref) {
25
+ var disabled = _ref.disabled,
26
+ _onClick = _ref.onClick,
27
+ selected = _ref.selected,
28
+ appearance = _ref.appearance,
29
+ testId = _ref.testId,
30
+ tooltip = _ref.tooltip;
31
+ var _appearancePropsMap = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'],
32
+ title = _appearancePropsMap.title,
33
+ icon = _appearancePropsMap.icon;
34
+ return {
35
+ title: intl.formatMessage(title),
36
+ icon: icon,
37
+ onClick: function onClick() {
38
+ return dispatchCommand(_onClick);
39
+ },
40
+ disabled: Boolean(disabled),
41
+ tooltipContent: tooltip || null,
42
+ testId: testId,
43
+ selected: selected
44
+ };
45
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@atlaskit/icon';
4
+ var IconCardGlyph = function 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 var IconCard = function IconCard(props) {
19
+ return /*#__PURE__*/React.createElement(Icon, _extends({
20
+ glyph: IconCardGlyph
21
+ }, props));
22
+ };
@@ -0,0 +1,22 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@atlaskit/icon';
4
+ var IconEmbedGlyph = function 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 var IconEmbed = function IconEmbed(props) {
19
+ return /*#__PURE__*/React.createElement(Icon, _extends({
20
+ glyph: IconEmbedGlyph
21
+ }, props));
22
+ };
@@ -0,0 +1,22 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@atlaskit/icon';
4
+ var IconInlineGlyph = function 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 var IconInline = function IconInline(props) {
19
+ return /*#__PURE__*/React.createElement(Icon, _extends({
20
+ glyph: IconInlineGlyph
21
+ }, props));
22
+ };
@@ -0,0 +1,24 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@atlaskit/icon';
4
+ var IconUrlGlyph = function 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 var IconUrl = function IconUrl(props) {
21
+ return /*#__PURE__*/React.createElement(Icon, _extends({
22
+ glyph: IconUrlGlyph
23
+ }, props));
24
+ };
@@ -0,0 +1,83 @@
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
+ });
@@ -6,6 +6,7 @@ export { unsupportedContentMessages } from './unsupportedContent';
6
6
  export { codeBlockButtonMessages } from './codeBlockButton';
7
7
  export { toolbarInsertBlockMessages } from './insert-block';
8
8
  export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
9
+ export { messages as cardMessages } from './card';
9
10
  export default defineMessages({
10
11
  layoutFixedWidth: {
11
12
  id: 'fabric.editor.layoutFixedWidth',
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  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; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "74.12.0";
9
+ var packageVersion = "74.14.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -68,7 +68,6 @@ function createNodeView(_ref) {
68
68
  trackingEnabled && stopMeasureReactNodeViewRendered({
69
69
  nodeTypeName: currentNode.type.name,
70
70
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
71
- editorState: nodeViewParams.view.state,
72
71
  samplingRate: samplingRate,
73
72
  slowThreshold: slowThreshold
74
73
  });
@@ -85,7 +85,6 @@ var ReactNodeView = /*#__PURE__*/function () {
85
85
  trackingEnabled && stopMeasureReactNodeViewRendered({
86
86
  nodeTypeName: this.node.type.name,
87
87
  dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
88
- editorState: this.view.state,
89
88
  samplingRate: samplingRate,
90
89
  slowThreshold: slowThreshold
91
90
  });
@@ -23,4 +23,6 @@ export { CodeBlockSharedCssClassName, codeBlockSharedStyles, codeBlockInListSafa
23
23
  export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
24
24
  export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
25
25
  export { resizerStyles } from './shared/resizer';
26
- export { gridStyles, GRID_GUTTER } from './shared/grid';
26
+ export { gridStyles, GRID_GUTTER } from './shared/grid';
27
+ export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNER_CONTAINER_CLASSNAME } from './shared/smartCard';
28
+ export { embedCardStyles, embedSpacingStyles, editIconStyles } from './shared/embedCard';
@@ -0,0 +1,6 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3;
3
+ import { css } from '@emotion/react';
4
+ export var embedCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])));
5
+ export var embedSpacingStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 0 10px;\n"])));
6
+ export var editIconStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 20px;\n"])));
@@ -0,0 +1,9 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ import { css } from '@emotion/react';
4
+ import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorRuleBorderRadius, akEditorSelectedNodeClassName, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
5
+ import { N0, N20, N40 } from '@atlaskit/theme/colors';
6
+ import { SmartCardSharedCssClassName } from './smart-card';
7
+ export var DATASOURCE_INNER_CONTAINER_CLASSNAME = 'datasourceView-content-inner-wrap';
8
+ export var FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
9
+ 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);
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.12.0";
21
+ var packageVersion = "74.14.0";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,4 @@
1
1
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
2
- import { getParticipantsCount } from './collab';
3
2
  import { startMeasure, stopMeasure } from './performance/measure';
4
3
 
5
4
  // This was existing logic when converting from ReactNodeView
@@ -35,7 +34,6 @@ export function startMeasureReactNodeViewRendered(_ref) {
35
34
  export function stopMeasureReactNodeViewRendered(_ref2) {
36
35
  var nodeTypeName = _ref2.nodeTypeName,
37
36
  dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
38
- editorState = _ref2.editorState,
39
37
  samplingRate = _ref2.samplingRate,
40
38
  slowThreshold = _ref2.slowThreshold;
41
39
  stopMeasure("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"), function (duration) {
@@ -46,8 +44,7 @@ export function stopMeasureReactNodeViewRendered(_ref2) {
46
44
  eventType: EVENT_TYPE.OPERATIONAL,
47
45
  attributes: {
48
46
  node: nodeTypeName,
49
- duration: duration,
50
- participants: getParticipantsCount(editorState)
47
+ duration: duration
51
48
  }
52
49
  });
53
50
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.12.0",
3
+ "version": "74.14.0",
4
4
  "sideEffects": false
5
5
  }
@@ -14,7 +14,6 @@ import PropTypes from 'prop-types';
14
14
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
15
15
  import { createDispatch } from '../event-dispatcher';
16
16
  import { analyticsEventKey, startMeasure, stopMeasure } from '../utils';
17
- import { getParticipantsCount } from '../utils/collab';
18
17
  var DEFAULT_SAMPLING_RATE = 100;
19
18
  var DEFAULT_SLOW_THRESHOLD = 4;
20
19
 
@@ -109,15 +108,13 @@ var WithPluginState = /*#__PURE__*/function (_React$Component) {
109
108
  performanceOptions.trackingEnabled && stopMeasure(measure, function (duration) {
110
109
  // Each WithPluginState component will fire analytics event no more than once every `samplingLimit` times
111
110
  if (++_this.callsCount % performanceOptions.samplingRate === 0 && duration > performanceOptions.slowThreshold) {
112
- var _editorView = _this.getEditorView();
113
111
  _this.dispatchAnalyticsEvent({
114
112
  action: ACTION.WITH_PLUGIN_STATE_CALLED,
115
113
  actionSubject: ACTION_SUBJECT.EDITOR,
116
114
  eventType: EVENT_TYPE.OPERATIONAL,
117
115
  attributes: {
118
116
  plugin: pluginName,
119
- duration: duration,
120
- participants: getParticipantsCount(_editorView && _editorView.state)
117
+ duration: duration
121
118
  }
122
119
  });
123
120
  }
@@ -2,7 +2,7 @@
2
2
  /// <reference types="cypress" />
3
3
  /// <reference types="cypress" />
4
4
  import { CypressType, InProductTestPageObject } from '@atlaskit/in-product-testing';
5
- import { CardAppearance } from '@atlaskit/smart-card';
5
+ import type { CardAppearance } from '@atlaskit/smart-card';
6
6
  import { EditorPageObject } from './Editor';
7
7
  export declare class EditorSmartLinkPageObject extends InProductTestPageObject {
8
8
  protected cy: CypressType;
@@ -104,12 +104,10 @@ type TransactionMutatedAEP = OperationalAEP<ACTION.TRANSACTION_MUTATED_AFTER_DIS
104
104
  type WithPluginStateCalledAEP = OperationalAEP<ACTION.WITH_PLUGIN_STATE_CALLED, ACTION_SUBJECT.EDITOR, undefined, {
105
105
  plugin: string;
106
106
  duration: number;
107
- participants: number;
108
107
  }, undefined>;
109
108
  type ReactNodeViewRenderedAEP = OperationalAEP<ACTION.REACT_NODEVIEW_RENDERED, ACTION_SUBJECT.EDITOR, undefined, {
110
109
  node: string;
111
110
  duration: number;
112
- participants: number;
113
111
  }, undefined>;
114
112
  type UploadExternalFailedAEP = OperationalAEP<ACTION.UPLOAD_EXTERNAL_FAIL, ACTION_SUBJECT.EDITOR, undefined, undefined, undefined>;
115
113
  type InvalidProsemirrorDocumentErrorAEP = OperationalAEP<ACTION.INVALID_PROSEMIRROR_DOCUMENT, ACTION_SUBJECT.EDITOR, undefined, {
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { jsx } from '@emotion/react';
3
+ import type { GlyphProps } from '@atlaskit/icon/types';
4
+ export interface ButtonOptionProps {
5
+ title: string;
6
+ selected: boolean;
7
+ testId: string;
8
+ disabled: boolean;
9
+ tooltipContent?: string | null;
10
+ onClick: () => void;
11
+ icon: (props: GlyphProps) => JSX.Element;
12
+ }
13
+ export interface LinkToolbarButtonGroupProps {
14
+ options: ButtonOptionProps[];
15
+ }
16
+ export declare const LinkToolbarButtonGroup: ({ options, }: LinkToolbarButtonGroupProps) => jsx.JSX.Element;
@@ -1,3 +1,7 @@
1
1
  export type { CardOptions } from './cardOptions';
2
2
  export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata, } from './utils';
3
3
  export { default as buildLayoutButtons } from './MediaAndEmbedsToolbar';
4
+ export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, } from './types';
5
+ export { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
6
+ export { getButtonGroupOption } from './link-toolbar-button-group-options';
7
+ export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
@@ -0,0 +1,5 @@
1
+ import { IntlShape } from 'react-intl-next';
2
+ import type { Command } from '../types';
3
+ import type { ButtonOptionProps } from './LinkToolbarButtonGroup';
4
+ import type { OptionConfig } from './types';
5
+ export declare const getButtonGroupOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => ButtonOptionProps;
@@ -0,0 +1,27 @@
1
+ import type { Node } from 'prosemirror-model';
2
+ import type { EditorState, Transaction } from 'prosemirror-state';
3
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
4
+ import { ACTION, EditorAnalyticsAPI, INPUT_METHOD } from '../analytics';
5
+ import type { CardAppearance } from '../provider-factory';
6
+ import type { Command } from '../types';
7
+ export interface OptionConfig {
8
+ appearance?: CardAppearance;
9
+ title: string;
10
+ onClick: Command;
11
+ selected: boolean;
12
+ testId: string;
13
+ disabled?: boolean;
14
+ hidden?: boolean;
15
+ tooltip?: string;
16
+ }
17
+ export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
18
+ export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Transaction;
19
+ export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
20
+ export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
21
+ export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
22
+ export type CardPluginActions = {
23
+ queueCardsFromChangedTr: QueueCardsFromTransactionAction;
24
+ hideLinkToolbar: HideLinkToolbarAction;
25
+ changeSelectedCardToLink: ChangeSelectedCardToLink;
26
+ setSelectedCardAppearance: SetSelectedCardAppearance;
27
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconCard: (props: GlyphProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconEmbed: (props: GlyphProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconInline: (props: GlyphProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconUrl: (props: GlyphProps) => JSX.Element;
@@ -0,0 +1,82 @@
1
+ export declare const messages: {
2
+ url: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ block: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ inline: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ embed: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ link: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ card: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ blockCardUnavailable: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ displayOptionUnavailableInParentNode: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ urlTitle: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ blockTitle: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ description: string;
51
+ };
52
+ inlineTitle: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
57
+ embedTitle: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ urlDescription: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ description: string;
66
+ };
67
+ blockDescription: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ description: string;
71
+ };
72
+ inlineDescription: {
73
+ id: string;
74
+ defaultMessage: string;
75
+ description: string;
76
+ };
77
+ embedDescription: {
78
+ id: string;
79
+ defaultMessage: string;
80
+ description: string;
81
+ };
82
+ };
@@ -5,6 +5,7 @@ export { unsupportedContentMessages } from './unsupportedContent';
5
5
  export { codeBlockButtonMessages } from './codeBlockButton';
6
6
  export { toolbarInsertBlockMessages } from './insert-block';
7
7
  export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
8
+ export { messages as cardMessages } from './card';
8
9
  declare const _default: {
9
10
  layoutFixedWidth: {
10
11
  id: string;
@@ -1,4 +1,4 @@
1
- import { CardAdf, DatasourceAdf } from '@atlaskit/smart-card';
1
+ import type { CardAdf, DatasourceAdf } from '@atlaskit/smart-card';
2
2
  export type CardAppearance = 'inline' | 'block' | 'embed';
3
3
  export type { CardAdf, DatasourceAdf };
4
4
  export interface CardProvider {
@@ -24,3 +24,5 @@ export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
24
24
  export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
25
25
  export { resizerStyles } from './shared/resizer';
26
26
  export { gridStyles, GRID_GUTTER } from './shared/grid';
27
+ export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNER_CONTAINER_CLASSNAME, } from './shared/smartCard';
28
+ export { embedCardStyles, embedSpacingStyles, editIconStyles, } from './shared/embedCard';
@@ -0,0 +1,3 @@
1
+ export declare const embedCardStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const embedSpacingStyles: import("@emotion/react").SerializedStyles;
3
+ export declare const editIconStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,3 @@
1
+ export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
2
+ export declare const FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = "card-floating-toolbar--link-picker";
3
+ export declare const smartCardStyles: import("@emotion/react").SerializedStyles;
@@ -1,4 +1,3 @@
1
- import type { EditorState } from 'prosemirror-state';
2
1
  import type { EditorView } from 'prosemirror-view';
3
2
  import { AnalyticsEventPayload } from '../analytics';
4
3
  export declare function getPerformanceOptions(view: EditorView): {
@@ -9,10 +8,9 @@ export declare function getPerformanceOptions(view: EditorView): {
9
8
  export declare function startMeasureReactNodeViewRendered({ nodeTypeName, }: {
10
9
  nodeTypeName: string;
11
10
  }): void;
12
- export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, editorState, samplingRate, slowThreshold, }: {
11
+ export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, samplingRate, slowThreshold, }: {
13
12
  nodeTypeName: string;
14
13
  dispatchAnalyticsEvent(payload: AnalyticsEventPayload): void;
15
- editorState: EditorState;
16
14
  samplingRate: number;
17
15
  slowThreshold: number;
18
16
  }): void;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="cypress" />
2
2
  import { CypressType, InProductTestPageObject } from '@atlaskit/in-product-testing';
3
- import { CardAppearance } from '@atlaskit/smart-card';
3
+ import type { CardAppearance } from '@atlaskit/smart-card';
4
4
  import { EditorPageObject } from './Editor';
5
5
  export declare class EditorSmartLinkPageObject extends InProductTestPageObject {
6
6
  protected cy: CypressType;
@@ -104,12 +104,10 @@ type TransactionMutatedAEP = OperationalAEP<ACTION.TRANSACTION_MUTATED_AFTER_DIS
104
104
  type WithPluginStateCalledAEP = OperationalAEP<ACTION.WITH_PLUGIN_STATE_CALLED, ACTION_SUBJECT.EDITOR, undefined, {
105
105
  plugin: string;
106
106
  duration: number;
107
- participants: number;
108
107
  }, undefined>;
109
108
  type ReactNodeViewRenderedAEP = OperationalAEP<ACTION.REACT_NODEVIEW_RENDERED, ACTION_SUBJECT.EDITOR, undefined, {
110
109
  node: string;
111
110
  duration: number;
112
- participants: number;
113
111
  }, undefined>;
114
112
  type UploadExternalFailedAEP = OperationalAEP<ACTION.UPLOAD_EXTERNAL_FAIL, ACTION_SUBJECT.EDITOR, undefined, undefined, undefined>;
115
113
  type InvalidProsemirrorDocumentErrorAEP = OperationalAEP<ACTION.INVALID_PROSEMIRROR_DOCUMENT, ACTION_SUBJECT.EDITOR, undefined, {