@atlaskit/editor-plugin-media 9.5.4 → 9.5.6

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,21 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 9.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5ad6e24098de0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5ad6e24098de0) -
8
+ tidy up fg platform_editor_media_video_check_fix_new
9
+ - Updated dependencies
10
+
11
+ ## 9.5.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [`231bc5802c7de`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/231bc5802c7de) -
16
+ fix stale node position issue in media single
17
+ - Updated dependencies
18
+
3
19
  ## 9.5.4
4
20
 
5
21
  ### Patch Changes
@@ -21,7 +21,6 @@ var _utils = require("@atlaskit/editor-common/utils");
21
21
  var _state = require("@atlaskit/editor-prosemirror/state");
22
22
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
23
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
24
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
26
25
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
27
26
  var _main = require("../../pm-plugins/main");
@@ -38,6 +37,16 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
38
37
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
39
38
 
40
39
  var resizerNextTestId = exports.resizerNextTestId = 'mediaSingle.resizerNext.testid';
40
+ var getNodePosition = function getNodePosition(getPos) {
41
+ if (typeof getPos !== 'function') {
42
+ return null;
43
+ }
44
+ var pos = getPos();
45
+ if (Number.isNaN(pos) || typeof pos !== 'number') {
46
+ return null;
47
+ }
48
+ return pos;
49
+ };
41
50
  var calcPxHeight = function calcPxHeight(props) {
42
51
  var newWidth = props.newWidth,
43
52
  previousWidth = props.previousWidth,
@@ -196,7 +205,7 @@ var ResizableMediaSingleNextFunctional = exports.ResizableMediaSingleNextFunctio
196
205
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
197
206
  isResizing = _useState6[0],
198
207
  setIsResizing = _useState6[1];
199
- var _useState7 = (0, _react.useState)(!(0, _platformFeatureFlags.fg)('platform_editor_media_video_check_fix_new')),
208
+ var _useState7 = (0, _react.useState)(false),
200
209
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
201
210
  isVideoFile = _useState8[0],
202
211
  setIsVideoFile = _useState8[1];
@@ -204,15 +213,10 @@ var ResizableMediaSingleNextFunctional = exports.ResizableMediaSingleNextFunctio
204
213
  _useState0 = (0, _slicedToArray2.default)(_useState9, 2),
205
214
  hasResized = _useState0[0],
206
215
  setHasResized = _useState0[1];
207
- var nodePosition = (0, _react.useMemo)(function () {
208
- if (typeof getPos !== 'function') {
209
- return null;
210
- }
211
- var pos = getPos();
212
- if (Number.isNaN(pos) || typeof pos !== 'number') {
213
- return null;
214
- }
215
- return pos;
216
+ var nodePosition = (0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true) ? getNodePosition(getPos) :
217
+ // eslint-disable-next-line react-hooks/rules-of-hooks
218
+ (0, _react.useMemo)(function () {
219
+ return getNodePosition(getPos);
216
220
  }, [getPos]);
217
221
  var isNestedNode = (0, _react.useMemo)(function () {
218
222
  if (nodePosition === null) {
@@ -21,7 +21,6 @@ var _ui = require("@atlaskit/editor-common/ui");
21
21
  var _utils = require("@atlaskit/editor-common/utils");
22
22
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
23
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
24
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
26
25
  var _checkMediaType = require("../../pm-plugins/utils/check-media-type");
27
26
  var _styled = require("./styled");
@@ -42,7 +41,7 @@ var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Compo
42
41
  (0, _defineProperty2.default)(_this, "hasResized", false);
43
42
  (0, _defineProperty2.default)(_this, "state", {
44
43
  offsetLeft: (0, _mediaSingle.calculateOffsetLeft)(_this.insideInlineLike, _this.insideLayout, _this.props.view.dom, undefined),
45
- isVideoFile: !(0, _platformFeatureFlags.fg)('platform_editor_media_video_check_fix_new')
44
+ isVideoFile: false
46
45
  });
47
46
  (0, _defineProperty2.default)(_this, "displayGrid", function (visible, gridType, highlight) {
48
47
  var _pluginInjectionApi$g;
@@ -17,7 +17,6 @@ import { nonWrappedLayouts } from '@atlaskit/editor-common/utils';
17
17
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
18
18
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
19
19
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
20
- import { fg } from '@atlaskit/platform-feature-flags';
21
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
22
21
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
23
22
  import { MEDIA_PLUGIN_IS_RESIZING_KEY, MEDIA_PLUGIN_RESIZING_WIDTH_KEY } from '../../pm-plugins/main';
@@ -26,6 +25,16 @@ import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
26
25
  import { ResizableMediaMigrationNotification } from './ResizableMediaMigrationNotification';
27
26
  import { wrapperStyle } from './styled';
28
27
  export const resizerNextTestId = 'mediaSingle.resizerNext.testid';
28
+ const getNodePosition = getPos => {
29
+ if (typeof getPos !== 'function') {
30
+ return null;
31
+ }
32
+ const pos = getPos();
33
+ if (Number.isNaN(pos) || typeof pos !== 'number') {
34
+ return null;
35
+ }
36
+ return pos;
37
+ };
29
38
  const calcPxHeight = props => {
30
39
  const {
31
40
  newWidth,
@@ -179,18 +188,11 @@ export const ResizableMediaSingleNextFunctional = props => {
179
188
  const lastSnappedGuidelineKeysRef = useRef([]);
180
189
  const [snaps, setSnaps] = useState({});
181
190
  const [isResizing, setIsResizing] = useState(false);
182
- const [isVideoFile, setIsVideoFile] = useState(!fg('platform_editor_media_video_check_fix_new'));
191
+ const [isVideoFile, setIsVideoFile] = useState(false);
183
192
  const [hasResized, setHasResized] = useState(false);
184
- const nodePosition = useMemo(() => {
185
- if (typeof getPos !== 'function') {
186
- return null;
187
- }
188
- const pos = getPos();
189
- if (Number.isNaN(pos) || typeof pos !== 'number') {
190
- return null;
191
- }
192
- return pos;
193
- }, [getPos]);
193
+ const nodePosition = expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? getNodePosition(getPos) :
194
+ // eslint-disable-next-line react-hooks/rules-of-hooks
195
+ useMemo(() => getNodePosition(getPos), [getPos]);
194
196
  const isNestedNode = useMemo(() => {
195
197
  if (nodePosition === null) {
196
198
  return false;
@@ -13,7 +13,6 @@ import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, handleSides, imageA
13
13
  import { calculateSnapPoints } from '@atlaskit/editor-common/utils';
14
14
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
15
15
  import { akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
17
  import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
19
18
  import { wrapperStyle } from './styled';
@@ -24,7 +23,7 @@ export default class ResizableMediaSingle extends React.Component {
24
23
  _defineProperty(this, "hasResized", false);
25
24
  _defineProperty(this, "state", {
26
25
  offsetLeft: calculateOffsetLeft(this.insideInlineLike, this.insideLayout, this.props.view.dom, undefined),
27
- isVideoFile: !fg('platform_editor_media_video_check_fix_new')
26
+ isVideoFile: false
28
27
  });
29
28
  _defineProperty(this, "displayGrid", (visible, gridType, highlight) => {
30
29
  var _pluginInjectionApi$g, _pluginInjectionApi$g2;
@@ -19,7 +19,6 @@ import { nonWrappedLayouts } from '@atlaskit/editor-common/utils';
19
19
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
20
20
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
21
21
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
22
- import { fg } from '@atlaskit/platform-feature-flags';
23
22
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
24
23
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
25
24
  import { MEDIA_PLUGIN_IS_RESIZING_KEY, MEDIA_PLUGIN_RESIZING_WIDTH_KEY } from '../../pm-plugins/main';
@@ -28,6 +27,16 @@ import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
28
27
  import { ResizableMediaMigrationNotification } from './ResizableMediaMigrationNotification';
29
28
  import { wrapperStyle } from './styled';
30
29
  export var resizerNextTestId = 'mediaSingle.resizerNext.testid';
30
+ var getNodePosition = function getNodePosition(getPos) {
31
+ if (typeof getPos !== 'function') {
32
+ return null;
33
+ }
34
+ var pos = getPos();
35
+ if (Number.isNaN(pos) || typeof pos !== 'number') {
36
+ return null;
37
+ }
38
+ return pos;
39
+ };
31
40
  var calcPxHeight = function calcPxHeight(props) {
32
41
  var newWidth = props.newWidth,
33
42
  previousWidth = props.previousWidth,
@@ -186,7 +195,7 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
186
195
  _useState6 = _slicedToArray(_useState5, 2),
187
196
  isResizing = _useState6[0],
188
197
  setIsResizing = _useState6[1];
189
- var _useState7 = useState(!fg('platform_editor_media_video_check_fix_new')),
198
+ var _useState7 = useState(false),
190
199
  _useState8 = _slicedToArray(_useState7, 2),
191
200
  isVideoFile = _useState8[0],
192
201
  setIsVideoFile = _useState8[1];
@@ -194,15 +203,10 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
194
203
  _useState0 = _slicedToArray(_useState9, 2),
195
204
  hasResized = _useState0[0],
196
205
  setHasResized = _useState0[1];
197
- var nodePosition = useMemo(function () {
198
- if (typeof getPos !== 'function') {
199
- return null;
200
- }
201
- var pos = getPos();
202
- if (Number.isNaN(pos) || typeof pos !== 'number') {
203
- return null;
204
- }
205
- return pos;
206
+ var nodePosition = expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? getNodePosition(getPos) :
207
+ // eslint-disable-next-line react-hooks/rules-of-hooks
208
+ useMemo(function () {
209
+ return getNodePosition(getPos);
206
210
  }, [getPos]);
207
211
  var isNestedNode = useMemo(function () {
208
212
  if (nodePosition === null) {
@@ -22,7 +22,6 @@ import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, handleSides, imageA
22
22
  import { calculateSnapPoints } from '@atlaskit/editor-common/utils';
23
23
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
24
24
  import { akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
25
- import { fg } from '@atlaskit/platform-feature-flags';
26
25
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
27
26
  import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
28
27
  import { wrapperStyle } from './styled';
@@ -38,7 +37,7 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
38
37
  _defineProperty(_this, "hasResized", false);
39
38
  _defineProperty(_this, "state", {
40
39
  offsetLeft: calculateOffsetLeft(_this.insideInlineLike, _this.insideLayout, _this.props.view.dom, undefined),
41
- isVideoFile: !fg('platform_editor_media_video_check_fix_new')
40
+ isVideoFile: false
42
41
  });
43
42
  _defineProperty(_this, "displayGrid", function (visible, gridType, highlight) {
44
43
  var _pluginInjectionApi$g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "9.5.4",
3
+ "version": "9.5.6",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/media-client": "^35.8.0",
59
59
  "@atlaskit/media-client-react": "^4.2.0",
60
60
  "@atlaskit/media-common": "^12.4.0",
61
- "@atlaskit/media-filmstrip": "^51.1.0",
61
+ "@atlaskit/media-filmstrip": "^51.2.0",
62
62
  "@atlaskit/media-picker": "^70.1.0",
63
63
  "@atlaskit/media-ui": "^28.7.0",
64
64
  "@atlaskit/media-viewer": "^52.8.0",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/primitives": "^18.0.0",
67
67
  "@atlaskit/textfield": "^8.2.0",
68
68
  "@atlaskit/theme": "^21.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^29.0.0",
69
+ "@atlaskit/tmp-editor-statsig": "^29.5.0",
70
70
  "@atlaskit/tokens": "^11.0.0",
71
71
  "@atlaskit/tooltip": "^20.14.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": "^111.16.0",
81
+ "@atlaskit/editor-common": "^111.19.0",
82
82
  "@atlaskit/media-core": "^37.0.0",
83
83
  "react": "^18.2.0",
84
84
  "react-dom": "^18.2.0",
@@ -130,9 +130,6 @@
130
130
  "platform_editor_typography_ugc": {
131
131
  "type": "boolean"
132
132
  },
133
- "platform-visual-refresh-icons": {
134
- "type": "boolean"
135
- },
136
133
  "platform_editor_introduce_insert_media_command": {
137
134
  "type": "boolean"
138
135
  },
@@ -162,9 +159,6 @@
162
159
  },
163
160
  "platform_editor_media_insert_check": {
164
161
  "type": "boolean"
165
- },
166
- "platform_editor_media_video_check_fix_new": {
167
- "type": "boolean"
168
162
  }
169
163
  },
170
164
  "stricter": {