@atlaskit/editor-plugin-media 1.44.7 → 1.44.8

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 1.44.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#105278](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105278)
8
+ [`3fb1e0a806ca3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3fb1e0a806ca3) -
9
+ [ux] ED-25716 fixes issue with copying media nodes on safari when
10
+ platform_editor_exp_lazy_node_views is enabled
11
+ - Updated dependencies
12
+
3
13
  ## 1.44.7
4
14
 
5
15
  ### Patch Changes
@@ -8,6 +8,7 @@ exports.mediaSpecWithFixedToDOM = exports.defaultImageCardDimensions = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
10
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
13
  var _toDOMAttrs = require("./toDOMAttrs");
13
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -51,13 +52,12 @@ var mediaSpecWithFixedToDOM = exports.mediaSpecWithFixedToDOM = function mediaSp
51
52
  var dataUrl = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
52
53
  var width = defaultImageCardDimensions.width;
53
54
  var height = defaultImageCardDimensions.height;
54
- return ['div', _objectSpread(_objectSpread({
55
+ var sharedAttrs = _objectSpread(_objectSpread({
55
56
  width: width,
56
57
  height: height
57
58
  }, attrs), {}, {
58
59
  // Manually kept in sync with the style of media cards. The goal is to render a plain gray
59
60
  // rectangle that provides an affordance for media.
60
-
61
61
  style: (0, _lazyNodeView.convertToInlineCss)({
62
62
  display: 'var(--ak-editor-media-card-display, inline-block)',
63
63
  backgroundImage: "url(\"".concat(dataUrl, "\")"),
@@ -71,7 +71,12 @@ var mediaSpecWithFixedToDOM = exports.mediaSpecWithFixedToDOM = function mediaSp
71
71
  height: "var(--ak-editor-media-card-height, 0)",
72
72
  paddingBottom: "var(--ak-editor-media-padding-bottom, 0)"
73
73
  })
74
- })];
74
+ });
75
+
76
+ // Safari is stripping the dom if a child does not exist for the media nodes on safari.
77
+ // Creating an empty child allows safari to pick up the media node within the clipboard.
78
+ // https://product-fabric.atlassian.net/browse/ED-25841
79
+ return (0, _platformFeatureFlags.fg)('platform_editor_safari_media_clipboard_fix') ? ['div', sharedAttrs, ['div', {}]] : ['div', sharedAttrs];
75
80
  }
76
81
  return ['div', _objectSpread(_objectSpread({}, attrs), {}, {
77
82
  styles: (0, _lazyNodeView.convertToInlineCss)({
@@ -1,5 +1,6 @@
1
1
  import { media } from '@atlaskit/adf-schema';
2
2
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
5
  import { getMediaAttrs } from './toDOMAttrs';
5
6
 
@@ -44,13 +45,12 @@ export const mediaSpecWithFixedToDOM = () => {
44
45
  const dataUrl = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
45
46
  const width = defaultImageCardDimensions.width;
46
47
  const height = defaultImageCardDimensions.height;
47
- return ['div', {
48
+ const sharedAttrs = {
48
49
  width,
49
50
  height,
50
51
  ...attrs,
51
52
  // Manually kept in sync with the style of media cards. The goal is to render a plain gray
52
53
  // rectangle that provides an affordance for media.
53
-
54
54
  style: convertToInlineCss({
55
55
  display: 'var(--ak-editor-media-card-display, inline-block)',
56
56
  backgroundImage: `url("${dataUrl}")`,
@@ -64,7 +64,12 @@ export const mediaSpecWithFixedToDOM = () => {
64
64
  height: `var(--ak-editor-media-card-height, 0)`,
65
65
  paddingBottom: `var(--ak-editor-media-padding-bottom, 0)`
66
66
  })
67
- }];
67
+ };
68
+
69
+ // Safari is stripping the dom if a child does not exist for the media nodes on safari.
70
+ // Creating an empty child allows safari to pick up the media node within the clipboard.
71
+ // https://product-fabric.atlassian.net/browse/ED-25841
72
+ return fg('platform_editor_safari_media_clipboard_fix') ? ['div', sharedAttrs, ['div', {}]] : ['div', sharedAttrs];
68
73
  }
69
74
  return ['div', {
70
75
  ...attrs,
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import { media } from '@atlaskit/adf-schema';
5
5
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  import { getMediaAttrs } from './toDOMAttrs';
8
9
 
@@ -45,13 +46,12 @@ export var mediaSpecWithFixedToDOM = function mediaSpecWithFixedToDOM() {
45
46
  var dataUrl = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
46
47
  var width = defaultImageCardDimensions.width;
47
48
  var height = defaultImageCardDimensions.height;
48
- return ['div', _objectSpread(_objectSpread({
49
+ var sharedAttrs = _objectSpread(_objectSpread({
49
50
  width: width,
50
51
  height: height
51
52
  }, attrs), {}, {
52
53
  // Manually kept in sync with the style of media cards. The goal is to render a plain gray
53
54
  // rectangle that provides an affordance for media.
54
-
55
55
  style: convertToInlineCss({
56
56
  display: 'var(--ak-editor-media-card-display, inline-block)',
57
57
  backgroundImage: "url(\"".concat(dataUrl, "\")"),
@@ -65,7 +65,12 @@ export var mediaSpecWithFixedToDOM = function mediaSpecWithFixedToDOM() {
65
65
  height: "var(--ak-editor-media-card-height, 0)",
66
66
  paddingBottom: "var(--ak-editor-media-padding-bottom, 0)"
67
67
  })
68
- })];
68
+ });
69
+
70
+ // Safari is stripping the dom if a child does not exist for the media nodes on safari.
71
+ // Creating an empty child allows safari to pick up the media node within the clipboard.
72
+ // https://product-fabric.atlassian.net/browse/ED-25841
73
+ return fg('platform_editor_safari_media_clipboard_fix') ? ['div', sharedAttrs, ['div', {}]] : ['div', sharedAttrs];
69
74
  }
70
75
  return ['div', _objectSpread(_objectSpread({}, attrs), {}, {
71
76
  styles: convertToInlineCss({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "1.44.7",
3
+ "version": "1.44.8",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,10 +36,10 @@
36
36
  "@atlaskit/analytics-namespaced-context": "^6.12.0",
37
37
  "@atlaskit/analytics-next": "^10.2.0",
38
38
  "@atlaskit/button": "^20.3.0",
39
- "@atlaskit/editor-common": "^99.4.0",
39
+ "@atlaskit/editor-common": "^99.5.0",
40
40
  "@atlaskit/editor-palette": "1.6.4",
41
- "@atlaskit/editor-plugin-analytics": "^1.10.0",
42
- "@atlaskit/editor-plugin-annotation": "1.26.13",
41
+ "@atlaskit/editor-plugin-analytics": "^1.11.0",
42
+ "@atlaskit/editor-plugin-annotation": "1.26.14",
43
43
  "@atlaskit/editor-plugin-connectivity": "^1.1.0",
44
44
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
45
45
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/form": "^11.0.0",
57
57
  "@atlaskit/icon": "^23.4.0",
58
58
  "@atlaskit/media-card": "^78.18.0",
59
- "@atlaskit/media-client": "^30.0.0",
59
+ "@atlaskit/media-client": "^31.0.0",
60
60
  "@atlaskit/media-client-react": "^2.6.0",
61
61
  "@atlaskit/media-common": "^11.7.0",
62
62
  "@atlaskit/media-filmstrip": "^48.1.0",
@@ -67,8 +67,8 @@
67
67
  "@atlaskit/primitives": "^13.3.0",
68
68
  "@atlaskit/textfield": "^6.7.0",
69
69
  "@atlaskit/theme": "^14.0.0",
70
- "@atlaskit/tmp-editor-statsig": "^2.38.0",
71
- "@atlaskit/tokens": "^3.1.0",
70
+ "@atlaskit/tmp-editor-statsig": "^2.39.0",
71
+ "@atlaskit/tokens": "^3.2.0",
72
72
  "@atlaskit/tooltip": "^19.0.0",
73
73
  "@babel/runtime": "^7.0.0",
74
74
  "@emotion/react": "^11.7.1",
@@ -168,6 +168,9 @@
168
168
  },
169
169
  "platform_editor_axe_leading_paragraph_from_media": {
170
170
  "type": "boolean"
171
+ },
172
+ "platform_editor_safari_media_clipboard_fix": {
173
+ "type": "boolean"
171
174
  }
172
175
  },
173
176
  "stricter": {