@atlaskit/editor-plugin-media 1.8.1 → 1.9.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 (49) hide show
  1. package/.eslintrc.js +10 -0
  2. package/CHANGELOG.md +17 -0
  3. package/dist/cjs/commands/linking.js +0 -6
  4. package/dist/cjs/nodeviews/mediaGroup.js +1 -1
  5. package/dist/cjs/nodeviews/mediaInline.js +3 -3
  6. package/dist/cjs/nodeviews/mediaNodeView/index.js +1 -1
  7. package/dist/cjs/nodeviews/mediaNodeView/media.js +3 -3
  8. package/dist/cjs/nodeviews/mediaSingle.js +3 -3
  9. package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +45 -17
  10. package/dist/cjs/pm-plugins/keymap-media-single.js +0 -1
  11. package/dist/cjs/pm-plugins/main.js +2 -2
  12. package/dist/cjs/toolbar/alt-text.js +2 -2
  13. package/dist/cjs/toolbar/filePreviewItem.js +2 -2
  14. package/dist/cjs/toolbar/index.js +2 -2
  15. package/dist/cjs/toolbar/linking-toolbar-appearance.js +2 -2
  16. package/dist/cjs/toolbar/mediaInline.js +2 -2
  17. package/dist/cjs/ui/ImageBorder/styles.js +8 -6
  18. package/dist/cjs/ui/Media/DropPlaceholder.js +21 -6
  19. package/dist/cjs/ui/MediaLinkingToolbar.js +3 -3
  20. package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +1 -1
  21. package/dist/cjs/ui/MediaPicker/index.js +1 -1
  22. package/dist/cjs/ui/PixelEntry/index.js +2 -2
  23. package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
  24. package/dist/cjs/ui/ResizableMediaSingle/index.js +1 -1
  25. package/dist/cjs/ui/ResizableMediaSingle/styled.js +1 -0
  26. package/dist/cjs/ui/ResizableMediaSingle/styles.js +2 -2
  27. package/dist/es2019/commands/linking.js +0 -6
  28. package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +44 -45
  29. package/dist/es2019/pm-plugins/keymap-media-single.js +0 -1
  30. package/dist/es2019/ui/ImageBorder/styles.js +6 -4
  31. package/dist/es2019/ui/Media/DropPlaceholder.js +20 -20
  32. package/dist/es2019/ui/ResizableMediaSingle/styled.js +1 -0
  33. package/dist/esm/commands/linking.js +0 -6
  34. package/dist/esm/nodeviews/mediaGroup.js +1 -1
  35. package/dist/esm/nodeviews/mediaInline.js +1 -1
  36. package/dist/esm/nodeviews/mediaNodeView/index.js +1 -1
  37. package/dist/esm/nodeviews/mediaNodeView/media.js +1 -1
  38. package/dist/esm/nodeviews/mediaSingle.js +1 -1
  39. package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +45 -16
  40. package/dist/esm/pm-plugins/keymap-media-single.js +0 -1
  41. package/dist/esm/ui/ImageBorder/styles.js +5 -3
  42. package/dist/esm/ui/Media/DropPlaceholder.js +20 -6
  43. package/dist/esm/ui/MediaLinkingToolbar.js +1 -1
  44. package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +1 -1
  45. package/dist/esm/ui/MediaPicker/index.js +1 -1
  46. package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
  47. package/dist/esm/ui/ResizableMediaSingle/index.js +1 -1
  48. package/dist/esm/ui/ResizableMediaSingle/styled.js +1 -0
  49. package/package.json +7 -7
@@ -1,5 +1,3 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
3
1
  /** @jsx jsx */
4
2
  import { css, jsx } from '@emotion/react';
5
3
  import { injectIntl } from 'react-intl-next';
@@ -9,13 +7,29 @@ import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
9
7
  import { B200, B300, B400 } from '@atlaskit/theme/colors';
10
8
  import { borderRadius } from '@atlaskit/theme/constants';
11
9
  import { FILE_WIDTH, MEDIA_HEIGHT } from '../../nodeviews/mediaNodeView/media';
12
- var iconWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n background: ", ";\n border-radius: ", "px;\n margin: 5px 3px 25px;\n width: ", "px;\n min-height: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), "var(--ds-icon-accent-blue, ".concat(hexToRgba(B400, 0.4) || B400, ")"), "var(--ds-background-accent-blue-subtle, ".concat(hexToRgba(B300, 0.6) || B300, ")"), borderRadius(), FILE_WIDTH, MEDIA_HEIGHT);
13
- var dropLine = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n margin: ", " 0;\n width: 100%;\n height: 2px;\n"])), "var(--ds-border-focused, ".concat(B200, ")"), borderRadius(), "var(--ds-space-025, 2px)");
10
+ var iconWrapperStyles = css({
11
+ color: "var(--ds-icon-accent-blue, ".concat(hexToRgba(B400, 0.4) || B400, ")"),
12
+ background: "var(--ds-background-accent-blue-subtle, ".concat(hexToRgba(B300, 0.6) || B300, ")"),
13
+ borderRadius: "".concat(borderRadius(), "px"),
14
+ margin: "var(--ds-space-075, 6px)".concat(" ", "var(--ds-space-050, 4px)", " ", "var(--ds-space-300, 24px)"),
15
+ width: "".concat(FILE_WIDTH, "px"),
16
+ minHeight: "".concat(MEDIA_HEIGHT, "px"),
17
+ display: 'flex',
18
+ alignItems: 'center',
19
+ justifyContent: 'center'
20
+ });
21
+ var dropLineStyles = css({
22
+ background: "var(--ds-border-focused, ".concat(B200, ")"),
23
+ borderRadius: "".concat(borderRadius(), "px"),
24
+ margin: "var(--ds-space-025, 2px)".concat(" 0"),
25
+ width: '100%',
26
+ height: '2px'
27
+ });
14
28
  var IconWrapperComponent = function IconWrapperComponent(props) {
15
29
  var intl = props.intl;
16
30
  var dropPlaceholderLabel = dropPlaceholderMessages.dropPlaceholderLabel;
17
31
  return jsx("div", {
18
- css: iconWrapper
32
+ css: iconWrapperStyles
19
33
  }, jsx(DocumentFilledIcon, {
20
34
  label: intl.formatMessage(dropPlaceholderLabel),
21
35
  size: "medium"
@@ -26,6 +40,6 @@ export default (function (_ref) {
26
40
  var _ref$type = _ref.type,
27
41
  type = _ref$type === void 0 ? 'group' : _ref$type;
28
42
  return type === 'single' ? jsx("div", {
29
- css: dropLine
43
+ css: dropLineStyles
30
44
  }) : jsx(IntlIconWrapper, null);
31
45
  });
@@ -8,7 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
9
9
  var _templateObject, _templateObject2;
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  /** @jsx jsx */
13
13
  import React, { Fragment } from 'react';
14
14
  import { css, jsx } from '@emotion/react';
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  import React from 'react';
13
13
  import { flushSync } from 'react-dom';
14
14
  import { ErrorReporter } from '@atlaskit/editor-common/utils';
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  import React from 'react';
11
11
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
12
12
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
@@ -9,7 +9,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
10
  import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
13
  /** @jsx jsx */
14
14
  import React from 'react';
15
15
  import { jsx } from '@emotion/react';
@@ -9,7 +9,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
10
  import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
13
  /** @jsx jsx */
14
14
  import React from 'react';
15
15
  import { jsx } from '@emotion/react';
@@ -2,6 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
  var _templateObject;
3
3
  import { css } from '@emotion/react';
4
4
  import { MediaSingleDimensionHelper } from '@atlaskit/editor-common/ui';
5
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
5
6
  export var wrapperStyle = function wrapperStyle(props) {
6
7
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & > div {\n ", ";\n position: relative;\n clear: both;\n }\n"])), MediaSingleDimensionHelper(props));
7
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,11 +36,11 @@
36
36
  "@atlaskit/adf-schema": "^35.5.2",
37
37
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
38
38
  "@atlaskit/analytics-next": "^9.2.0",
39
- "@atlaskit/button": "^17.6.0",
40
- "@atlaskit/editor-common": "^78.11.0",
39
+ "@atlaskit/button": "^17.7.0",
40
+ "@atlaskit/editor-common": "^78.12.0",
41
41
  "@atlaskit/editor-palette": "1.5.2",
42
42
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
43
- "@atlaskit/editor-plugin-annotation": "1.2.1",
43
+ "@atlaskit/editor-plugin-annotation": "1.2.2",
44
44
  "@atlaskit/editor-plugin-decorations": "^1.0.0",
45
45
  "@atlaskit/editor-plugin-editor-disabled": "^1.0.0",
46
46
  "@atlaskit/editor-plugin-floating-toolbar": "^1.2.0",
@@ -63,10 +63,10 @@
63
63
  "@atlaskit/media-ui": "^25.4.0",
64
64
  "@atlaskit/media-viewer": "^48.3.0",
65
65
  "@atlaskit/platform-feature-flags": "^0.2.0",
66
- "@atlaskit/primitives": "^4.0.0",
67
- "@atlaskit/textfield": "^6.0.0",
66
+ "@atlaskit/primitives": "^4.1.0",
67
+ "@atlaskit/textfield": "^6.1.0",
68
68
  "@atlaskit/theme": "^12.6.0",
69
- "@atlaskit/tokens": "^1.39.0",
69
+ "@atlaskit/tokens": "^1.41.0",
70
70
  "@atlaskit/tooltip": "^18.1.0",
71
71
  "@babel/runtime": "^7.0.0",
72
72
  "@emotion/react": "^11.7.1",