@atlaskit/editor-common 76.24.5 → 76.25.1

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 (94) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/analytics/types/enums.js +4 -0
  3. package/dist/cjs/analytics/types/loom-events.js +5 -0
  4. package/dist/cjs/analytics/types/toolbar-button.js +1 -0
  5. package/dist/cjs/media-inline/inline-image-wrapper.js +14 -4
  6. package/dist/cjs/media-inline/media-inline-image-card.js +54 -40
  7. package/dist/cjs/media-inline/views/constants.js +8 -0
  8. package/dist/cjs/media-inline/views/error-view.js +33 -0
  9. package/dist/cjs/media-inline/views/frame.js +15 -0
  10. package/dist/cjs/media-inline/views/icon-wrapper.js +20 -0
  11. package/dist/cjs/media-inline/views/loading-view.js +21 -0
  12. package/dist/cjs/media-inline/views/wrapper.js +24 -0
  13. package/dist/cjs/messages/insert-block.js +10 -0
  14. package/dist/cjs/messages/media-inline-card.js +19 -0
  15. package/dist/cjs/monitoring/error.js +1 -1
  16. package/dist/cjs/quick-insert/assets/index.js +13 -1
  17. package/dist/cjs/quick-insert/assets/loom.js +26 -0
  18. package/dist/cjs/quick-insert/index.js +6 -0
  19. package/dist/cjs/ui/DropList/index.js +1 -1
  20. package/dist/es2019/analytics/types/enums.js +4 -0
  21. package/dist/es2019/analytics/types/loom-events.js +1 -0
  22. package/dist/es2019/analytics/types/toolbar-button.js +1 -0
  23. package/dist/es2019/media-inline/inline-image-wrapper.js +14 -4
  24. package/dist/es2019/media-inline/media-inline-image-card.js +54 -39
  25. package/dist/es2019/media-inline/views/constants.js +2 -0
  26. package/dist/es2019/media-inline/views/error-view.js +25 -0
  27. package/dist/es2019/media-inline/views/frame.js +8 -0
  28. package/dist/es2019/media-inline/views/icon-wrapper.js +15 -0
  29. package/dist/es2019/media-inline/views/loading-view.js +13 -0
  30. package/dist/es2019/media-inline/views/wrapper.js +18 -0
  31. package/dist/es2019/messages/insert-block.js +10 -0
  32. package/dist/es2019/messages/media-inline-card.js +13 -0
  33. package/dist/es2019/monitoring/error.js +1 -1
  34. package/dist/es2019/quick-insert/assets/index.js +4 -0
  35. package/dist/es2019/quick-insert/assets/loom.js +20 -0
  36. package/dist/es2019/quick-insert/index.js +1 -1
  37. package/dist/es2019/ui/DropList/index.js +1 -1
  38. package/dist/esm/analytics/types/enums.js +4 -0
  39. package/dist/esm/analytics/types/loom-events.js +1 -0
  40. package/dist/esm/analytics/types/toolbar-button.js +1 -0
  41. package/dist/esm/media-inline/inline-image-wrapper.js +14 -4
  42. package/dist/esm/media-inline/media-inline-image-card.js +53 -39
  43. package/dist/esm/media-inline/views/constants.js +2 -0
  44. package/dist/esm/media-inline/views/error-view.js +26 -0
  45. package/dist/esm/media-inline/views/frame.js +9 -0
  46. package/dist/esm/media-inline/views/icon-wrapper.js +14 -0
  47. package/dist/esm/media-inline/views/loading-view.js +14 -0
  48. package/dist/esm/media-inline/views/wrapper.js +18 -0
  49. package/dist/esm/messages/insert-block.js +10 -0
  50. package/dist/esm/messages/media-inline-card.js +13 -0
  51. package/dist/esm/monitoring/error.js +1 -1
  52. package/dist/esm/quick-insert/assets/index.js +10 -0
  53. package/dist/esm/quick-insert/assets/loom.js +19 -0
  54. package/dist/esm/quick-insert/index.js +1 -1
  55. package/dist/esm/ui/DropList/index.js +1 -1
  56. package/dist/types/analytics/types/enums.d.ts +6 -2
  57. package/dist/types/analytics/types/events.d.ts +2 -1
  58. package/dist/types/analytics/types/loom-events.d.ts +19 -0
  59. package/dist/types/analytics/types/toolbar-button.d.ts +2 -1
  60. package/dist/types/card/types.d.ts +1 -1
  61. package/dist/types/media-inline/inline-image-wrapper.d.ts +1 -0
  62. package/dist/types/media-inline/media-inline-image-card.d.ts +2 -0
  63. package/dist/types/media-inline/views/constants.d.ts +2 -0
  64. package/dist/types/media-inline/views/error-view.d.ts +12 -0
  65. package/dist/types/media-inline/views/frame.d.ts +9 -0
  66. package/dist/types/media-inline/views/icon-wrapper.d.ts +7 -0
  67. package/dist/types/media-inline/views/loading-view.d.ts +10 -0
  68. package/dist/types/media-inline/views/wrapper.d.ts +1 -0
  69. package/dist/types/messages/insert-block.d.ts +10 -0
  70. package/dist/types/messages/media-inline-card.d.ts +12 -0
  71. package/dist/types/provider-factory/quick-insert-provider.d.ts +3 -3
  72. package/dist/types/quick-insert/assets/index.d.ts +2 -1
  73. package/dist/types/quick-insert/assets/loom.d.ts +2 -0
  74. package/dist/types/quick-insert/index.d.ts +1 -1
  75. package/dist/types-ts4.5/analytics/types/enums.d.ts +6 -2
  76. package/dist/types-ts4.5/analytics/types/events.d.ts +2 -1
  77. package/dist/types-ts4.5/analytics/types/loom-events.d.ts +19 -0
  78. package/dist/types-ts4.5/analytics/types/toolbar-button.d.ts +2 -1
  79. package/dist/types-ts4.5/card/types.d.ts +1 -1
  80. package/dist/types-ts4.5/media-inline/inline-image-wrapper.d.ts +1 -0
  81. package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +2 -0
  82. package/dist/types-ts4.5/media-inline/views/constants.d.ts +2 -0
  83. package/dist/types-ts4.5/media-inline/views/error-view.d.ts +12 -0
  84. package/dist/types-ts4.5/media-inline/views/frame.d.ts +9 -0
  85. package/dist/types-ts4.5/media-inline/views/icon-wrapper.d.ts +7 -0
  86. package/dist/types-ts4.5/media-inline/views/loading-view.d.ts +10 -0
  87. package/dist/types-ts4.5/media-inline/views/wrapper.d.ts +1 -0
  88. package/dist/types-ts4.5/messages/insert-block.d.ts +10 -0
  89. package/dist/types-ts4.5/messages/media-inline-card.d.ts +12 -0
  90. package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +3 -3
  91. package/dist/types-ts4.5/quick-insert/assets/index.d.ts +2 -1
  92. package/dist/types-ts4.5/quick-insert/assets/loom.d.ts +2 -0
  93. package/dist/types-ts4.5/quick-insert/index.d.ts +1 -1
  94. package/package.json +2 -1
@@ -0,0 +1,25 @@
1
+ import WarningIcon from '@atlaskit/icon/glyph/warning';
2
+ import { R300 } from '@atlaskit/theme/colors';
3
+ import Tooltip from '@atlaskit/tooltip';
4
+ import { ICON_SIZE_THRESOLD } from './constants';
5
+ import { Frame } from './frame';
6
+ import { IconWrapper } from './icon-wrapper';
7
+ export const InlineImageCardErrorView = ({
8
+ testId = 'media-inline-image-card-error-view',
9
+ message,
10
+ icon,
11
+ height = ICON_SIZE_THRESOLD
12
+ }) => {
13
+ return /*#__PURE__*/React.createElement(Frame, {
14
+ testId: testId
15
+ }, /*#__PURE__*/React.createElement(Tooltip, {
16
+ content: message,
17
+ position: "top",
18
+ tag: "span",
19
+ hideTooltipOnClick: true
20
+ }, /*#__PURE__*/React.createElement(IconWrapper, null, icon || /*#__PURE__*/React.createElement(WarningIcon, {
21
+ label: "error",
22
+ size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small',
23
+ primaryColor: `var(--ds-icon-danger, ${R300})`
24
+ }))));
25
+ };
@@ -0,0 +1,8 @@
1
+ import { wrapperStyle } from './wrapper';
2
+ export const Frame = ({
3
+ children,
4
+ testId
5
+ }) => /*#__PURE__*/React.createElement("span", {
6
+ css: wrapperStyle,
7
+ "data-testid": testId
8
+ }, children);
@@ -0,0 +1,15 @@
1
+ import { css } from '@emotion/react';
2
+ const wrapperStyle = css({
3
+ display: 'flex',
4
+ 'span > svg': {
5
+ verticalAlign: 'baseline'
6
+ }
7
+ });
8
+ export const IconWrapper = ({
9
+ children
10
+ }) => {
11
+ return /*#__PURE__*/React.createElement("span", {
12
+ css: wrapperStyle,
13
+ "data-testid": "media-inline-image-card-icon"
14
+ }, children);
15
+ };
@@ -0,0 +1,13 @@
1
+ import Spinner from '@atlaskit/spinner';
2
+ import { ICON_SIZE_THRESOLD } from './constants';
3
+ import { Frame } from './frame';
4
+ export const InlineImageCardLoadingView = ({
5
+ testId = 'media-inline-image-card-loading-view',
6
+ height = ICON_SIZE_THRESOLD
7
+ }) => {
8
+ return /*#__PURE__*/React.createElement(Frame, {
9
+ testId: testId
10
+ }, /*#__PURE__*/React.createElement(Spinner, {
11
+ size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small'
12
+ }));
13
+ };
@@ -0,0 +1,18 @@
1
+ import { css } from '@emotion/react';
2
+ import { N30A, N40A, N900 } from '@atlaskit/theme/colors';
3
+ export const wrapperStyle = css({
4
+ display: 'inline-flex',
5
+ width: '100%',
6
+ height: '100%',
7
+ alignItems: 'center',
8
+ justifyContent: 'center',
9
+ boxDecorationBreak: 'clone',
10
+ borderRadius: `${"var(--ds-border-radius, 3px)"}`,
11
+ color: `${`var(--ds-text, ${N900})`}`,
12
+ backgroundColor: `${`var(--ds-background-neutral, ${N30A})`}`,
13
+ transition: '0.1s all ease-in-out',
14
+ cursor: 'pointer',
15
+ '&:hover': {
16
+ backgroundColor: `${`var(--ds-background-neutral-hovered, ${N40A})`}`
17
+ }
18
+ });
@@ -169,5 +169,15 @@ export const toolbarInsertBlockMessages = defineMessages({
169
169
  id: 'fabric.editor.help.description',
170
170
  defaultMessage: 'Browse all the keyboard shortcuts and markdown options',
171
171
  description: 'Browse all the keyboard shortcuts and markdown options'
172
+ },
173
+ recordVideo: {
174
+ id: 'fabric.editor.recordVideo',
175
+ defaultMessage: 'Record video',
176
+ description: 'Record video using Loom'
177
+ },
178
+ recordVideoDescription: {
179
+ id: 'fabric.editor.recordVideo.description',
180
+ defaultMessage: 'Record video using Loom',
181
+ description: 'Record video using Loom'
172
182
  }
173
183
  });
@@ -0,0 +1,13 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ unableToLoadContent: {
4
+ id: 'fabric.editor.unableToLoadContent',
5
+ defaultMessage: "We couldn't load this content",
6
+ description: 'Display this message when there is an error loading file content'
7
+ },
8
+ failedToUpload: {
9
+ id: 'fabric.editor.failed_to_upload',
10
+ defaultMessage: 'Failed to upload',
11
+ description: 'Display this message when there is an error uploading a file'
12
+ }
13
+ });
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "76.24.5";
3
+ const packageVersion = "76.25.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -120,4 +120,8 @@ export const IconDatasourceJiraIssue = Loadable({
120
120
  export const IconDatasourceAssetsObjects = Loadable({
121
121
  loader: () => import( /* webpackChunkName: "@atlaskit-internal_editor-icon-datasource-assets-objects" */'./datasource-assets-objects').then(module => module.default),
122
122
  loading: () => null
123
+ });
124
+ export const IconLoom = Loadable({
125
+ loader: () => import( /* webpackChunkName: "@atlaskit-internal_editor-icon-loom" */'./loom').then(module => module.default),
126
+ loading: () => null
123
127
  });
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { useIconThemed } from '../use-icon-themed';
3
+ export default function IconLayout() {
4
+ const {
5
+ iconThemed
6
+ } = useIconThemed();
7
+ return /*#__PURE__*/React.createElement("svg", {
8
+ focusable: "false",
9
+ "aria-hidden": true,
10
+ viewBox: "0 0 31 30",
11
+ width: 40,
12
+ height: 40
13
+ }, /*#__PURE__*/React.createElement("path", {
14
+ fill: iconThemed({
15
+ light: '#6460F9',
16
+ dark: '#FFF'
17
+ }),
18
+ d: "M30.01 13.43h-9.142l7.917-4.57-1.57-2.72-7.918 4.57 4.57-7.915-2.72-1.57-4.571 7.913V0h-3.142v9.139L8.863 1.225l-2.721 1.57 4.57 7.913L2.796 6.14 1.225 8.86l7.917 4.57H0v3.141h9.141l-7.916 4.57 1.57 2.72 7.918-4.57-4.571 7.915 2.72 1.57 4.572-7.914V30h3.142v-9.334l4.655 8.06 2.551-1.472-4.656-8.062 8.087 4.668 1.571-2.72-7.916-4.57h9.141v-3.14h.001zm-15.005 5.84a4.271 4.271 0 11-.001-8.542 4.271 4.271 0 01.001 8.542z"
19
+ }));
20
+ }
@@ -1,2 +1,2 @@
1
- export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects } from './assets';
1
+ export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects, IconLoom } from './assets';
2
2
  export { memoProcessQuickInsertItems, find } from './utils';
@@ -7,7 +7,7 @@ import { themed } from '@atlaskit/theme/components';
7
7
  import { borderRadius } from '@atlaskit/theme/constants';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "76.24.5";
10
+ const packageVersion = "76.25.1";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -126,6 +126,9 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
126
126
  ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED"] = "unsupportedContentLevelsTrackingSucceeded";
127
127
  ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED"] = "unsupportedContentLevelsTrackingErrored";
128
128
  ACTION["UNSUPPORTED_TOOLTIP_VIEWED"] = "viewed";
129
+ ACTION["RECORD_VIDEO"] = "recordVideo";
130
+ ACTION["INSERT_VIDEO"] = "insertVideo";
131
+ ACTION["RECORD_VIDEO_FAILED"] = "recordVideoFailed";
129
132
  return ACTION;
130
133
  }({});
131
134
  export var INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
@@ -210,6 +213,7 @@ export var ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
210
213
  ACTION_SUBJECT["ANCHOR_LINK"] = "anchorLink";
211
214
  ACTION_SUBJECT["LINK"] = "link";
212
215
  ACTION_SUBJECT["TOOLTIP"] = "tooltip";
216
+ ACTION_SUBJECT["LOOM"] = "loom";
213
217
  return ACTION_SUBJECT;
214
218
  }({});
215
219
  export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
@@ -0,0 +1 @@
1
+ export {};
@@ -14,5 +14,6 @@ export var TOOLBAR_ACTION_SUBJECT_ID = /*#__PURE__*/function (TOOLBAR_ACTION_SUB
14
14
  TOOLBAR_ACTION_SUBJECT_ID["REDO"] = "redo";
15
15
  TOOLBAR_ACTION_SUBJECT_ID["INDENT"] = "indent";
16
16
  TOOLBAR_ACTION_SUBJECT_ID["OUTDENT"] = "outdent";
17
+ TOOLBAR_ACTION_SUBJECT_ID["RECORD_VIDEO"] = "recordVideo";
17
18
  return TOOLBAR_ACTION_SUBJECT_ID;
18
19
  }({});
@@ -1,10 +1,20 @@
1
1
  import { css } from '@emotion/react';
2
+ import { B300 } from '@atlaskit/theme/colors';
2
3
  var wrapperStyle = css({
3
- display: 'inline-block'
4
+ display: 'inline-block',
5
+ verticalAlign: 'text-bottom',
6
+ borderRadius: "var(--ds-border-radius, 3px)"
7
+ });
8
+ var selectedStyle = css({
9
+ cursor: 'pointer',
10
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(B300, ")")),
11
+ outline: 'none',
12
+ borderColor: 'transparent'
4
13
  });
5
14
  export var InlineImageWrapper = function InlineImageWrapper(_ref) {
6
- var children = _ref.children;
7
- return /*#__PURE__*/React.createElement("div", {
8
- css: wrapperStyle
15
+ var children = _ref.children,
16
+ isSelected = _ref.isSelected;
17
+ return /*#__PURE__*/React.createElement("span", {
18
+ css: [wrapperStyle, isSelected && selectedStyle]
9
19
  }, children);
10
20
  };
@@ -1,8 +1,15 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { useEffect, useState } from 'react';
3
- export var MediaInlineImageCard = function MediaInlineImageCard(_ref) {
3
+ import { createIntl, injectIntl } from 'react-intl-next';
4
+ import { messages } from '../messages/media-inline-card';
5
+ import { InlineImageWrapper } from './inline-image-wrapper';
6
+ import { InlineImageCardErrorView } from './views/error-view';
7
+ import { InlineImageCardLoadingView } from './views/loading-view';
8
+ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(_ref) {
4
9
  var mediaClient = _ref.mediaClient,
5
- identifier = _ref.identifier;
10
+ identifier = _ref.identifier,
11
+ isSelected = _ref.isSelected,
12
+ intl = _ref.intl;
6
13
  var _useState = useState(),
7
14
  _useState2 = _slicedToArray(_useState, 2),
8
15
  fileState = _useState2[0],
@@ -11,6 +18,10 @@ export var MediaInlineImageCard = function MediaInlineImageCard(_ref) {
11
18
  _useState4 = _slicedToArray(_useState3, 2),
12
19
  subscribeError = _useState4[0],
13
20
  setSubscribeError = _useState4[1];
21
+ var _ref2 = intl || createIntl({
22
+ locale: 'en'
23
+ }),
24
+ formatMessage = _ref2.formatMessage;
14
25
  useEffect(function () {
15
26
  var subscription = mediaClient.file.getFileState(identifier.id, {
16
27
  collectionName: identifier.collectionName
@@ -27,41 +38,44 @@ export var MediaInlineImageCard = function MediaInlineImageCard(_ref) {
27
38
  subscription.unsubscribe();
28
39
  };
29
40
  }, [identifier.collectionName, identifier.id, mediaClient.file]);
30
- if (subscribeError) {
31
- // TODO:
32
- // referring to packages/media/media-card/src/inline/mediaInlineCard.tsx
33
- // for error message and analytics
34
- throw new Error("not yet implemented: MediaInlineImageCard subscribe error view");
35
- }
36
- if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
37
- // TODO:
38
- // referring to packages/media/media-card/src/inline/mediaInlineCard.tsx
39
- // for error message and analytics
40
- throw new Error("not yet implemented: MediaInlineImageCard error view");
41
- }
42
- if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
43
- // TODO:
44
- // referring to packages/media/media-card/src/inline/mediaInlineCard.tsx
45
- // for error message and analytics
46
- throw new Error("not yet implemented: MediaInlineImageCard failed-processing view");
47
- }
48
- // Empty file handling
49
- if (fileState && !fileState.name) {
50
- // TODO:
51
- // referring to packages/media/media-card/src/inline/mediaInlineCard.tsx
52
- // for error message and analytics
53
- throw new Error("not yet implemented: MediaInlineImageCard empty file name error view");
54
- }
55
- if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
56
- throw new Error("not yet implemented: MediaInlineImageCard uploading view");
57
- }
58
- if (!fileState) {
59
- throw new Error("not yet implemented: MediaInlineImageCard loading view");
60
- }
41
+ var content = function content() {
42
+ if (subscribeError) {
43
+ var isUploading = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading';
44
+ var errorMessage = isUploading ? messages.failedToUpload : messages.unableToLoadContent;
45
+ return /*#__PURE__*/React.createElement(InlineImageCardErrorView, {
46
+ message: formatMessage(errorMessage)
47
+ });
48
+ }
49
+ if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
50
+ return /*#__PURE__*/React.createElement(InlineImageCardErrorView, {
51
+ message: formatMessage(messages.unableToLoadContent)
52
+ });
53
+ }
54
+ if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
55
+ return /*#__PURE__*/React.createElement(InlineImageCardErrorView, {
56
+ message: formatMessage(messages.unableToLoadContent)
57
+ });
58
+ }
59
+ // Empty file handling
60
+ if (fileState && !fileState.name) {
61
+ return /*#__PURE__*/React.createElement(InlineImageCardErrorView, {
62
+ message: formatMessage(messages.unableToLoadContent)
63
+ });
64
+ }
65
+ if (!fileState) {
66
+ return /*#__PURE__*/React.createElement(InlineImageCardLoadingView, null);
67
+ }
61
68
 
62
- // TODO
63
- // use Card from `@atlaskit/media-card` with an inline block wrapper
64
- // with:
65
- // selection state and `mediaOptions.allowLazyLoading`
66
- throw new Error("not yet implemented: MediaInlineImageCard loading view");
67
- };
69
+ // TODO
70
+ // use Card from `@atlaskit/media-card` with an inline block wrapper
71
+ // with:
72
+ // selection state and `mediaOptions.allowLazyLoading`
73
+ throw new Error("not yet implemented: MediaInlineImageCard loading view");
74
+ };
75
+ return /*#__PURE__*/React.createElement(InlineImageWrapper, {
76
+ isSelected: isSelected
77
+ }, content());
78
+ };
79
+ export var MediaInlineImageCard = injectIntl(MediaInlineImageCardInternal, {
80
+ enforceContext: false
81
+ });
@@ -0,0 +1,2 @@
1
+ /** Height threshold that determines icon size to be small or medium */
2
+ export var ICON_SIZE_THRESOLD = 24;
@@ -0,0 +1,26 @@
1
+ import WarningIcon from '@atlaskit/icon/glyph/warning';
2
+ import { R300 } from '@atlaskit/theme/colors';
3
+ import Tooltip from '@atlaskit/tooltip';
4
+ import { ICON_SIZE_THRESOLD } from './constants';
5
+ import { Frame } from './frame';
6
+ import { IconWrapper } from './icon-wrapper';
7
+ export var InlineImageCardErrorView = function InlineImageCardErrorView(_ref) {
8
+ var _ref$testId = _ref.testId,
9
+ testId = _ref$testId === void 0 ? 'media-inline-image-card-error-view' : _ref$testId,
10
+ message = _ref.message,
11
+ icon = _ref.icon,
12
+ _ref$height = _ref.height,
13
+ height = _ref$height === void 0 ? ICON_SIZE_THRESOLD : _ref$height;
14
+ return /*#__PURE__*/React.createElement(Frame, {
15
+ testId: testId
16
+ }, /*#__PURE__*/React.createElement(Tooltip, {
17
+ content: message,
18
+ position: "top",
19
+ tag: "span",
20
+ hideTooltipOnClick: true
21
+ }, /*#__PURE__*/React.createElement(IconWrapper, null, icon || /*#__PURE__*/React.createElement(WarningIcon, {
22
+ label: "error",
23
+ size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small',
24
+ primaryColor: "var(--ds-icon-danger, ".concat(R300, ")")
25
+ }))));
26
+ };
@@ -0,0 +1,9 @@
1
+ import { wrapperStyle } from './wrapper';
2
+ export var Frame = function Frame(_ref) {
3
+ var children = _ref.children,
4
+ testId = _ref.testId;
5
+ return /*#__PURE__*/React.createElement("span", {
6
+ css: wrapperStyle,
7
+ "data-testid": testId
8
+ }, children);
9
+ };
@@ -0,0 +1,14 @@
1
+ import { css } from '@emotion/react';
2
+ var wrapperStyle = css({
3
+ display: 'flex',
4
+ 'span > svg': {
5
+ verticalAlign: 'baseline'
6
+ }
7
+ });
8
+ export var IconWrapper = function IconWrapper(_ref) {
9
+ var children = _ref.children;
10
+ return /*#__PURE__*/React.createElement("span", {
11
+ css: wrapperStyle,
12
+ "data-testid": "media-inline-image-card-icon"
13
+ }, children);
14
+ };
@@ -0,0 +1,14 @@
1
+ import Spinner from '@atlaskit/spinner';
2
+ import { ICON_SIZE_THRESOLD } from './constants';
3
+ import { Frame } from './frame';
4
+ export var InlineImageCardLoadingView = function InlineImageCardLoadingView(_ref) {
5
+ var _ref$testId = _ref.testId,
6
+ testId = _ref$testId === void 0 ? 'media-inline-image-card-loading-view' : _ref$testId,
7
+ _ref$height = _ref.height,
8
+ height = _ref$height === void 0 ? ICON_SIZE_THRESOLD : _ref$height;
9
+ return /*#__PURE__*/React.createElement(Frame, {
10
+ testId: testId
11
+ }, /*#__PURE__*/React.createElement(Spinner, {
12
+ size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small'
13
+ }));
14
+ };
@@ -0,0 +1,18 @@
1
+ import { css } from '@emotion/react';
2
+ import { N30A, N40A, N900 } from '@atlaskit/theme/colors';
3
+ export var wrapperStyle = css({
4
+ display: 'inline-flex',
5
+ width: '100%',
6
+ height: '100%',
7
+ alignItems: 'center',
8
+ justifyContent: 'center',
9
+ boxDecorationBreak: 'clone',
10
+ borderRadius: "var(--ds-border-radius, 3px)",
11
+ color: "".concat("var(--ds-text, ".concat(N900, ")")),
12
+ backgroundColor: "".concat("var(--ds-background-neutral, ".concat(N30A, ")")),
13
+ transition: '0.1s all ease-in-out',
14
+ cursor: 'pointer',
15
+ '&:hover': {
16
+ backgroundColor: "".concat("var(--ds-background-neutral-hovered, ".concat(N40A, ")"))
17
+ }
18
+ });
@@ -169,5 +169,15 @@ export var toolbarInsertBlockMessages = defineMessages({
169
169
  id: 'fabric.editor.help.description',
170
170
  defaultMessage: 'Browse all the keyboard shortcuts and markdown options',
171
171
  description: 'Browse all the keyboard shortcuts and markdown options'
172
+ },
173
+ recordVideo: {
174
+ id: 'fabric.editor.recordVideo',
175
+ defaultMessage: 'Record video',
176
+ description: 'Record video using Loom'
177
+ },
178
+ recordVideoDescription: {
179
+ id: 'fabric.editor.recordVideo.description',
180
+ defaultMessage: 'Record video using Loom',
181
+ description: 'Record video using Loom'
172
182
  }
173
183
  });
@@ -0,0 +1,13 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export var messages = defineMessages({
3
+ unableToLoadContent: {
4
+ id: 'fabric.editor.unableToLoadContent',
5
+ defaultMessage: "We couldn't load this content",
6
+ description: 'Display this message when there is an error loading file content'
7
+ },
8
+ failedToUpload: {
9
+ id: 'fabric.editor.failed_to_upload',
10
+ defaultMessage: 'Failed to upload',
11
+ description: 'Display this message when there is an error uploading a file'
12
+ }
13
+ });
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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 = "76.24.5";
9
+ var packageVersion = "76.25.1";
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
@@ -265,4 +265,14 @@ export var IconDatasourceAssetsObjects = Loadable({
265
265
  loading: function loading() {
266
266
  return null;
267
267
  }
268
+ });
269
+ export var IconLoom = Loadable({
270
+ loader: function loader() {
271
+ return import( /* webpackChunkName: "@atlaskit-internal_editor-icon-loom" */'./loom').then(function (module) {
272
+ return module.default;
273
+ });
274
+ },
275
+ loading: function loading() {
276
+ return null;
277
+ }
268
278
  });
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { useIconThemed } from '../use-icon-themed';
3
+ export default function IconLayout() {
4
+ var _useIconThemed = useIconThemed(),
5
+ iconThemed = _useIconThemed.iconThemed;
6
+ return /*#__PURE__*/React.createElement("svg", {
7
+ focusable: "false",
8
+ "aria-hidden": true,
9
+ viewBox: "0 0 31 30",
10
+ width: 40,
11
+ height: 40
12
+ }, /*#__PURE__*/React.createElement("path", {
13
+ fill: iconThemed({
14
+ light: '#6460F9',
15
+ dark: '#FFF'
16
+ }),
17
+ d: "M30.01 13.43h-9.142l7.917-4.57-1.57-2.72-7.918 4.57 4.57-7.915-2.72-1.57-4.571 7.913V0h-3.142v9.139L8.863 1.225l-2.721 1.57 4.57 7.913L2.796 6.14 1.225 8.86l7.917 4.57H0v3.141h9.141l-7.916 4.57 1.57 2.72 7.918-4.57-4.571 7.915 2.72 1.57 4.572-7.914V30h3.142v-9.334l4.655 8.06 2.551-1.472-4.656-8.062 8.087 4.668 1.571-2.72-7.916-4.57h9.141v-3.14h.001zm-15.005 5.84a4.271 4.271 0 11-.001-8.542 4.271 4.271 0 01.001 8.542z"
18
+ }));
19
+ }
@@ -1,2 +1,2 @@
1
- export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects } from './assets';
1
+ export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects, IconLoom } from './assets';
2
2
  export { memoProcessQuickInsertItems, find } from './utils';
@@ -17,7 +17,7 @@ import { themed } from '@atlaskit/theme/components';
17
17
  import { borderRadius } from '@atlaskit/theme/constants';
18
18
  import Layer from '../Layer';
19
19
  var packageName = "@atlaskit/editor-common";
20
- var packageVersion = "76.24.5";
20
+ var packageVersion = "76.25.1";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -132,7 +132,10 @@ export declare enum ACTION {
132
132
  CREATE_NOT_ALLOWED = "createNotAllowed",
133
133
  UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED = "unsupportedContentLevelsTrackingSucceeded",
134
134
  UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED = "unsupportedContentLevelsTrackingErrored",
135
- UNSUPPORTED_TOOLTIP_VIEWED = "viewed"
135
+ UNSUPPORTED_TOOLTIP_VIEWED = "viewed",
136
+ RECORD_VIDEO = "recordVideo",
137
+ INSERT_VIDEO = "insertVideo",
138
+ RECORD_VIDEO_FAILED = "recordVideoFailed"
136
139
  }
137
140
  export declare enum INPUT_METHOD {
138
141
  ASCII = "ascii",
@@ -213,7 +216,8 @@ export declare enum ACTION_SUBJECT {
213
216
  RENDERER = "renderer",
214
217
  ANCHOR_LINK = "anchorLink",
215
218
  LINK = "link",
216
- TOOLTIP = "tooltip"
219
+ TOOLTIP = "tooltip",
220
+ LOOM = "loom"
217
221
  }
218
222
  export declare enum ACTION_SUBJECT_ID {
219
223
  ACTION = "action",
@@ -17,6 +17,7 @@ import type { GeneralEventPayload } from './general-events';
17
17
  import type { InsertEventPayload } from './insert-events';
18
18
  import type { CreateLinkInlineDialogEventPayload, EditLinkToolbarAEP, OpenSettingsToolbarAEP, UnlinkToolbarAEP } from './link-tool-bar-events';
19
19
  import type { ListEventPayload } from './list-events';
20
+ import type { LoomEventPayload } from './loom-events';
20
21
  import type { MediaEventPayload } from './media-events';
21
22
  import type { NodeEventPayload } from './node-events';
22
23
  import type { PasteEventPayload } from './paste-events';
@@ -34,7 +35,7 @@ export type SimplifiedNode = {
34
35
  marks?: string[];
35
36
  content?: SimplifiedNode[];
36
37
  };
37
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload;
38
+ export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload;
38
39
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
39
40
  previousColor: string;
40
41
  newColor: string;
@@ -0,0 +1,19 @@
1
+ import type { SDKUnsupportedReasons } from '@loomhq/record-sdk';
2
+ import type { ACTION, ACTION_SUBJECT, INPUT_METHOD } from './enums';
3
+ import type { OperationalAEP, TrackAEP } from './utils';
4
+ type LoomInitialisedAEP = OperationalAEP<ACTION.INITIALISED, ACTION_SUBJECT.LOOM, undefined, undefined, undefined>;
5
+ type LoomDisabledAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.LOOM, undefined, {
6
+ error?: SDKUnsupportedReasons;
7
+ }, undefined>;
8
+ type RecordVideoAEP = TrackAEP<ACTION.RECORD_VIDEO, ACTION_SUBJECT.LOOM, undefined, {
9
+ inputMethod: INPUT_METHOD;
10
+ }, undefined>;
11
+ type RecordVideoFailedAEP = TrackAEP<ACTION.RECORD_VIDEO_FAILED, ACTION_SUBJECT.LOOM, undefined, {
12
+ inputMethod: INPUT_METHOD;
13
+ error?: SDKUnsupportedReasons;
14
+ }, undefined>;
15
+ type InsertVideoAEP = TrackAEP<ACTION.INSERT_VIDEO, ACTION_SUBJECT.LOOM, undefined, {
16
+ duration?: number;
17
+ }, undefined>;
18
+ export type LoomEventPayload = LoomInitialisedAEP | LoomDisabledAEP | RecordVideoAEP | RecordVideoFailedAEP | InsertVideoAEP;
19
+ export {};
@@ -15,7 +15,8 @@ export declare enum TOOLBAR_ACTION_SUBJECT_ID {
15
15
  UNDO = "undo",
16
16
  REDO = "redo",
17
17
  INDENT = "indent",
18
- OUTDENT = "outdent"
18
+ OUTDENT = "outdent",
19
+ RECORD_VIDEO = "recordVideo"
19
20
  }
20
21
  type ToolbarButtonClickedAEP = UIAEP<ACTION.CLICKED, ACTION_SUBJECT.TOOLBAR_BUTTON, undefined, {}, undefined>;
21
22
  export type ToolbarEventPayload = ToolbarButtonClickedAEP;
@@ -15,7 +15,7 @@ export interface OptionConfig {
15
15
  tooltip?: string;
16
16
  }
17
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;
18
+ export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
19
19
  export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
20
20
  export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
21
21
  export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
@@ -2,6 +2,7 @@
2
2
  import type { FC, ReactElement } from 'react';
3
3
  type Prop = {
4
4
  children: ReactElement;
5
+ isSelected?: boolean;
5
6
  };
6
7
  export declare const InlineImageWrapper: FC<Prop>;
7
8
  export {};