@atlaskit/editor-plugin-media 7.2.1 → 7.2.3

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,23 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 7.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f789827e18f93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f789827e18f93) -
8
+ FD-92214 clean up fg platform_editor_multi_images_overridden_upload_fix
9
+ - [`6fb79942fc3a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fb79942fc3a5) -
10
+ Internal changes to how borders are applied.
11
+ - Updated dependencies
12
+
13
+ ## 7.2.2
14
+
15
+ ### Patch Changes
16
+
17
+ - [`1c474ad18f3ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c474ad18f3ac) -
18
+ [ED-28566] Clean up platform_editor_controls_patch_15
19
+ - Updated dependencies
20
+
3
21
  ## 7.2.1
4
22
 
5
23
  ### Patch Changes
@@ -40,7 +40,7 @@ var supportTextStyles = (0, _react2.css)({
40
40
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-500, 40px)"),
41
41
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
42
42
  lineHeight: '20px',
43
- borderTop: "1px solid ".concat("var(--ds-border, ".concat(_colors.N30, ")")),
43
+ borderTop: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(_colors.N30, ")")),
44
44
  margin: 0
45
45
  });
46
46
  var containerStyles = (0, _react2.css)({
@@ -65,7 +65,7 @@ var validationWrapperStyles = (0, _react2.css)({
65
65
  lineHeight: 0,
66
66
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-300, 24px)", " ", "var(--ds-space-150, 12px)", " 0"),
67
67
  margin: "0 ".concat("var(--ds-space-150, 12px)", " 0 ", "var(--ds-space-500, 40px)"),
68
- borderTop: "1px solid ".concat("var(--ds-border-danger, ".concat(_colors.R400, ")")),
68
+ borderTop: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-danger, ".concat(_colors.R400, ")")),
69
69
  alignItems: 'start',
70
70
  flexDirection: 'column'
71
71
  });
@@ -53,19 +53,15 @@ function insertNodesWithOptionalParagraph(_ref) {
53
53
  var openEnd = 0;
54
54
  if (state.selection.empty) {
55
55
  var insertFrom = (0, _selection.atTheBeginningOfBlock)(state) ? state.selection.$from.before() : state.selection.from;
56
- if ((0, _platformFeatureFlags.fg)('platform_editor_multi_images_overridden_upload_fix')) {
57
- // the use of pmSafeInsert causes the node selection to media single node.
58
- // It leads to discrepancy between the full-page and comment editor - not sure why :shrug:
59
- // When multiple images are uploaded, the node selection is set to the previous node
60
- // and got overridden by the next node inserted.
61
- // It also causes the images position shifted when the images are uploaded.
62
- // E.g the images are uploaded after a table, the images will be inserted inside the table.
63
- // so we revert to use tr.insert instead. No extra paragraph is added.
64
- updatedTr = updatedTr.insert(insertFrom, nodes);
65
- } else {
66
- var shouldInsertFrom = !(0, _mediaCommon.isInsidePotentialEmptyParagraph)(state);
67
- updatedTr = (0, _selection.atTheBeginningOfBlock)(state) ? (0, _utils2.safeInsert)(nodes[0], shouldInsertFrom ? insertFrom : undefined, false)(updatedTr) : updatedTr.insert(insertFrom, nodes);
68
- }
56
+
57
+ // the use of pmSafeInsert causes the node selection to media single node.
58
+ // It leads to discrepancy between the full-page and comment editor - not sure why :shrug:
59
+ // When multiple images are uploaded, the node selection is set to the previous node
60
+ // and got overridden by the next node inserted.
61
+ // It also causes the images position shifted when the images are uploaded.
62
+ // E.g the images are uploaded after a table, the images will be inserted inside the table.
63
+ // so we revert to use tr.insert instead. No extra paragraph is added.
64
+ updatedTr = updatedTr.insert(insertFrom, nodes);
69
65
  } else {
70
66
  updatedTr.replaceSelection(new _model.Slice(_model.Fragment.from(nodes), 0, openEnd));
71
67
  }
@@ -34,7 +34,7 @@ var validationWrapper = (0, _react2.css)({
34
34
  lineHeight: 0,
35
35
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-300, 24px)", " ", "var(--ds-space-150, 12px)", " 0"),
36
36
  margin: "0 ".concat("var(--ds-space-050, 4px)", " 0 ", "var(--ds-space-400, 32px)"),
37
- borderTop: "1px solid ".concat("var(--ds-border-danger, ".concat(_colors.R400, ")")),
37
+ borderTop: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-danger, ".concat(_colors.R400, ")")),
38
38
  alignItems: 'start',
39
39
  display: 'flex',
40
40
  flexDirection: 'column'
@@ -13,8 +13,6 @@ var _styles = require("@atlaskit/editor-common/styles");
13
13
  var _ui = require("@atlaskit/editor-common/ui");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _imageAltText = _interopRequireDefault(require("@atlaskit/icon-lab/core/image-alt-text"));
16
- var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
16
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
17
  var _commands = require("../../pm-plugins/alt-text/commands");
20
18
  var _AltTextEdit = _interopRequireDefault(require("../../pm-plugins/alt-text/ui/AltTextEdit"));
@@ -99,9 +97,7 @@ var getAltTextDropdownOption = exports.getAltTextDropdownOption = function getAl
99
97
  return [{
100
98
  title: formatMessage(_media.altTextMessages.addAltText),
101
99
  onClick: (0, _commands.openMediaAltTextMenu)(editorAnalyticsAPI),
102
- icon: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? /*#__PURE__*/_react.default.createElement(_imageAltText.default, {
103
- label: ""
104
- }) : /*#__PURE__*/_react.default.createElement(_text.default, {
100
+ icon: /*#__PURE__*/_react.default.createElement(_imageAltText.default, {
105
101
  label: ""
106
102
  }),
107
103
  testId: 'media-alt-text-dropdown-option'
@@ -30,7 +30,7 @@ const supportTextStyles = css({
30
30
  padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-500, 40px)"}`,
31
31
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
32
32
  lineHeight: '20px',
33
- borderTop: `1px solid ${`var(--ds-border, ${N30})`}`,
33
+ borderTop: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border, ${N30})`}`,
34
34
  margin: 0
35
35
  });
36
36
  const containerStyles = css({
@@ -55,7 +55,7 @@ const validationWrapperStyles = css({
55
55
  lineHeight: 0,
56
56
  padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-300, 24px)"} ${"var(--ds-space-150, 12px)"} 0`,
57
57
  margin: `0 ${"var(--ds-space-150, 12px)"} 0 ${"var(--ds-space-500, 40px)"}`,
58
- borderTop: `1px solid ${`var(--ds-border-danger, ${R400})`}`,
58
+ borderTop: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border-danger, ${R400})`}`,
59
59
  alignItems: 'start',
60
60
  flexDirection: 'column'
61
61
  });
@@ -7,7 +7,7 @@ import { checkNodeDown, isEmptyParagraph } from '@atlaskit/editor-common/utils';
7
7
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
8
8
  import { safeInsert as pmSafeInsert, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
- import { copyOptionalAttrsFromMediaState, isInsidePotentialEmptyParagraph } from '../utils/media-common';
10
+ import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
11
11
  import { findChangeFromLocation, getChangeMediaAnalytics } from './analytics';
12
12
  import { isImage } from './is-type';
13
13
  const getInsertMediaAnalytics = (inputMethod, fileExtension, insertMediaVia) => ({
@@ -45,19 +45,15 @@ function insertNodesWithOptionalParagraph({
45
45
  const openEnd = 0;
46
46
  if (state.selection.empty) {
47
47
  const insertFrom = atTheBeginningOfBlock(state) ? state.selection.$from.before() : state.selection.from;
48
- if (fg('platform_editor_multi_images_overridden_upload_fix')) {
49
- // the use of pmSafeInsert causes the node selection to media single node.
50
- // It leads to discrepancy between the full-page and comment editor - not sure why :shrug:
51
- // When multiple images are uploaded, the node selection is set to the previous node
52
- // and got overridden by the next node inserted.
53
- // It also causes the images position shifted when the images are uploaded.
54
- // E.g the images are uploaded after a table, the images will be inserted inside the table.
55
- // so we revert to use tr.insert instead. No extra paragraph is added.
56
- updatedTr = updatedTr.insert(insertFrom, nodes);
57
- } else {
58
- const shouldInsertFrom = !isInsidePotentialEmptyParagraph(state);
59
- updatedTr = atTheBeginningOfBlock(state) ? pmSafeInsert(nodes[0], shouldInsertFrom ? insertFrom : undefined, false)(updatedTr) : updatedTr.insert(insertFrom, nodes);
60
- }
48
+
49
+ // the use of pmSafeInsert causes the node selection to media single node.
50
+ // It leads to discrepancy between the full-page and comment editor - not sure why :shrug:
51
+ // When multiple images are uploaded, the node selection is set to the previous node
52
+ // and got overridden by the next node inserted.
53
+ // It also causes the images position shifted when the images are uploaded.
54
+ // E.g the images are uploaded after a table, the images will be inserted inside the table.
55
+ // so we revert to use tr.insert instead. No extra paragraph is added.
56
+ updatedTr = updatedTr.insert(insertFrom, nodes);
61
57
  } else {
62
58
  updatedTr.replaceSelection(new Slice(Fragment.from(nodes), 0, openEnd));
63
59
  }
@@ -23,7 +23,7 @@ const validationWrapper = css({
23
23
  lineHeight: 0,
24
24
  padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-300, 24px)"} ${"var(--ds-space-150, 12px)"} 0`,
25
25
  margin: `0 ${"var(--ds-space-050, 4px)"} 0 ${"var(--ds-space-400, 32px)"}`,
26
- borderTop: `1px solid ${`var(--ds-border-danger, ${R400})`}`,
26
+ borderTop: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border-danger, ${R400})`}`,
27
27
  alignItems: 'start',
28
28
  display: 'flex',
29
29
  flexDirection: 'column'
@@ -5,8 +5,6 @@ import { MediaSharedClassNames as ClassNames } from '@atlaskit/editor-common/sty
5
5
  import { RECENT_SEARCH_WIDTH_IN_PX as CONTAINER_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import ImageAltTextIcon from '@atlaskit/icon-lab/core/image-alt-text';
8
- import TextIcon from '@atlaskit/icon/core/text';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
8
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
9
  import { openMediaAltTextMenu } from '../../pm-plugins/alt-text/commands';
12
10
  import AltTextEdit from '../../pm-plugins/alt-text/ui/AltTextEdit';
@@ -95,9 +93,7 @@ export const getAltTextDropdownOption = (state, formatMessage, allowAltTextOnIma
95
93
  return [{
96
94
  title: formatMessage(messages.addAltText),
97
95
  onClick: openMediaAltTextMenu(editorAnalyticsAPI),
98
- icon: fg('platform_editor_controls_patch_15') ? /*#__PURE__*/React.createElement(ImageAltTextIcon, {
99
- label: ""
100
- }) : /*#__PURE__*/React.createElement(TextIcon, {
96
+ icon: /*#__PURE__*/React.createElement(ImageAltTextIcon, {
101
97
  label: ""
102
98
  }),
103
99
  testId: 'media-alt-text-dropdown-option'
@@ -37,7 +37,7 @@ var supportTextStyles = css({
37
37
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-500, 40px)"),
38
38
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
39
39
  lineHeight: '20px',
40
- borderTop: "1px solid ".concat("var(--ds-border, ".concat(N30, ")")),
40
+ borderTop: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(N30, ")")),
41
41
  margin: 0
42
42
  });
43
43
  var containerStyles = css({
@@ -62,7 +62,7 @@ var validationWrapperStyles = css({
62
62
  lineHeight: 0,
63
63
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-300, 24px)", " ", "var(--ds-space-150, 12px)", " 0"),
64
64
  margin: "0 ".concat("var(--ds-space-150, 12px)", " 0 ", "var(--ds-space-500, 40px)"),
65
- borderTop: "1px solid ".concat("var(--ds-border-danger, ".concat(R400, ")")),
65
+ borderTop: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-danger, ".concat(R400, ")")),
66
66
  alignItems: 'start',
67
67
  flexDirection: 'column'
68
68
  });
@@ -10,7 +10,7 @@ import { checkNodeDown, isEmptyParagraph } from '@atlaskit/editor-common/utils';
10
10
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
11
11
  import { safeInsert as pmSafeInsert, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
- import { copyOptionalAttrsFromMediaState, isInsidePotentialEmptyParagraph } from '../utils/media-common';
13
+ import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
14
14
  import { findChangeFromLocation, getChangeMediaAnalytics } from './analytics';
15
15
  import { isImage } from './is-type';
16
16
  var getInsertMediaAnalytics = function getInsertMediaAnalytics(inputMethod, fileExtension, insertMediaVia) {
@@ -46,19 +46,15 @@ function insertNodesWithOptionalParagraph(_ref) {
46
46
  var openEnd = 0;
47
47
  if (state.selection.empty) {
48
48
  var insertFrom = atTheBeginningOfBlock(state) ? state.selection.$from.before() : state.selection.from;
49
- if (fg('platform_editor_multi_images_overridden_upload_fix')) {
50
- // the use of pmSafeInsert causes the node selection to media single node.
51
- // It leads to discrepancy between the full-page and comment editor - not sure why :shrug:
52
- // When multiple images are uploaded, the node selection is set to the previous node
53
- // and got overridden by the next node inserted.
54
- // It also causes the images position shifted when the images are uploaded.
55
- // E.g the images are uploaded after a table, the images will be inserted inside the table.
56
- // so we revert to use tr.insert instead. No extra paragraph is added.
57
- updatedTr = updatedTr.insert(insertFrom, nodes);
58
- } else {
59
- var shouldInsertFrom = !isInsidePotentialEmptyParagraph(state);
60
- updatedTr = atTheBeginningOfBlock(state) ? pmSafeInsert(nodes[0], shouldInsertFrom ? insertFrom : undefined, false)(updatedTr) : updatedTr.insert(insertFrom, nodes);
61
- }
49
+
50
+ // the use of pmSafeInsert causes the node selection to media single node.
51
+ // It leads to discrepancy between the full-page and comment editor - not sure why :shrug:
52
+ // When multiple images are uploaded, the node selection is set to the previous node
53
+ // and got overridden by the next node inserted.
54
+ // It also causes the images position shifted when the images are uploaded.
55
+ // E.g the images are uploaded after a table, the images will be inserted inside the table.
56
+ // so we revert to use tr.insert instead. No extra paragraph is added.
57
+ updatedTr = updatedTr.insert(insertFrom, nodes);
62
58
  } else {
63
59
  updatedTr.replaceSelection(new Slice(Fragment.from(nodes), 0, openEnd));
64
60
  }
@@ -30,7 +30,7 @@ var validationWrapper = css({
30
30
  lineHeight: 0,
31
31
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-300, 24px)", " ", "var(--ds-space-150, 12px)", " 0"),
32
32
  margin: "0 ".concat("var(--ds-space-050, 4px)", " 0 ", "var(--ds-space-400, 32px)"),
33
- borderTop: "1px solid ".concat("var(--ds-border-danger, ".concat(R400, ")")),
33
+ borderTop: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-danger, ".concat(R400, ")")),
34
34
  alignItems: 'start',
35
35
  display: 'flex',
36
36
  flexDirection: 'column'
@@ -8,8 +8,6 @@ import { MediaSharedClassNames as ClassNames } from '@atlaskit/editor-common/sty
8
8
  import { RECENT_SEARCH_WIDTH_IN_PX as CONTAINER_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
9
9
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
10
10
  import ImageAltTextIcon from '@atlaskit/icon-lab/core/image-alt-text';
11
- import TextIcon from '@atlaskit/icon/core/text';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
12
  import { openMediaAltTextMenu } from '../../pm-plugins/alt-text/commands';
15
13
  import AltTextEdit from '../../pm-plugins/alt-text/ui/AltTextEdit';
@@ -92,9 +90,7 @@ export var getAltTextDropdownOption = function getAltTextDropdownOption(state, f
92
90
  return [{
93
91
  title: formatMessage(messages.addAltText),
94
92
  onClick: openMediaAltTextMenu(editorAnalyticsAPI),
95
- icon: fg('platform_editor_controls_patch_15') ? /*#__PURE__*/React.createElement(ImageAltTextIcon, {
96
- label: ""
97
- }) : /*#__PURE__*/React.createElement(TextIcon, {
93
+ icon: /*#__PURE__*/React.createElement(ImageAltTextIcon, {
98
94
  label: ""
99
95
  }),
100
96
  testId: 'media-alt-text-dropdown-option'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "7.2.1",
3
+ "version": "7.2.3",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/editor-shared-styles": "^3.6.0",
53
53
  "@atlaskit/editor-tables": "^2.9.0",
54
54
  "@atlaskit/form": "^12.6.0",
55
- "@atlaskit/icon": "^28.1.0",
55
+ "@atlaskit/icon": "^28.2.0",
56
56
  "@atlaskit/icon-lab": "^5.7.0",
57
57
  "@atlaskit/media-card": "^79.5.0",
58
58
  "@atlaskit/media-client": "^35.3.0",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/primitives": "^14.14.0",
67
67
  "@atlaskit/textfield": "^8.0.0",
68
68
  "@atlaskit/theme": "^21.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^12.21.0",
69
+ "@atlaskit/tmp-editor-statsig": "^12.24.0",
70
70
  "@atlaskit/tokens": "^6.3.0",
71
71
  "@atlaskit/tooltip": "^20.4.0",
72
72
  "@babel/runtime": "^7.0.0",
@@ -78,7 +78,7 @@
78
78
  "uuid": "^3.1.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@atlaskit/editor-common": "^109.6.0",
81
+ "@atlaskit/editor-common": "^109.8.0",
82
82
  "@atlaskit/media-core": "^37.0.0",
83
83
  "react": "^18.2.0",
84
84
  "react-dom": "^18.2.0",
@@ -148,9 +148,6 @@
148
148
  "platform_editor_add_media_from_url_rollout": {
149
149
  "type": "boolean"
150
150
  },
151
- "platform_editor_multi_images_overridden_upload_fix": {
152
- "type": "boolean"
153
- },
154
151
  "platform_editor_remove_media_inline_feature_flag": {
155
152
  "type": "boolean"
156
153
  },
@@ -168,9 +165,6 @@
168
165
  },
169
166
  "platform_media_video_captions": {
170
167
  "type": "boolean"
171
- },
172
- "platform_editor_controls_patch_15": {
173
- "type": "boolean"
174
168
  }
175
169
  },
176
170
  "stricter": {