@atlaskit/editor-plugin-media 10.2.12 → 11.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 11.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b10c935ca9497`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b10c935ca9497) -
8
+ Removed deprecated `browser` singleton from editor-common. This has been replaced with a
9
+ `getBrowserInfo` function that returns the same information. This change was made to avoid issues
10
+ with module loading order and to provide a more consistent API for accessing browser information.
11
+
12
+ Please update any imports of `browser` to use `getBrowserInfo` instead. For example, the following
13
+ imports have been removed:
14
+
15
+ ```javascript
16
+ import { browser } from '@atlaskit/editor-common/utils';
17
+ import { browser } from '@atlaskit/editor-common/browser';
18
+ ```
19
+
20
+ Instead, please use:
21
+
22
+ ```javascript
23
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
24
+ ```
25
+
26
+ If you were previously using `browser.ie_version`, you would now use
27
+ `getBrowserInfo().ie_version`.
28
+
29
+ - Updated dependencies
30
+
31
+ ## 10.2.13
32
+
33
+ ### Patch Changes
34
+
35
+ - [`73b2fc243f544`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73b2fc243f544) -
36
+ Cleaning up getBrowserInfo which was behind experiment platform_editor_hydratable_ui and is now
37
+ rolled out
38
+ - Updated dependencies
39
+
3
40
  ## 10.2.12
4
41
 
5
42
  ### Patch Changes
@@ -432,11 +432,11 @@ var MediaSingleNodeNext = exports.MediaSingleNodeNext = function MediaSingleNode
432
432
  var isCurrentNodeDrafting = Boolean(isDrafting && targetNodeId === (mediaNode === null || mediaNode === void 0 || (_mediaNode$firstChild = mediaNode.firstChild) === null || _mediaNode$firstChild === void 0 ? void 0 : _mediaNode$firstChild.attrs.id));
433
433
  var mediaSingleWrapperRef = /*#__PURE__*/_react.default.createRef();
434
434
  var captionPlaceHolderRef = /*#__PURE__*/_react.default.createRef();
435
- var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
435
+ var browser = (0, _browser.getBrowserInfo)();
436
436
  var notIos = !browser.ios;
437
437
  var onMediaSingleClicked = _react.default.useCallback(function (event) {
438
438
  var _captionPlaceHolderRe;
439
- var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
439
+ var browser = (0, _browser.getBrowserInfo)();
440
440
  // Workaround for iOS 16 Caption selection issue
441
441
  // @see https://product-fabric.atlassian.net/browse/MEX-2012
442
442
  if (!browser.ios) {
@@ -16,6 +16,7 @@ var _react = _interopRequireDefault(require("react"));
16
16
  var _reactIntlNext = require("react-intl-next");
17
17
  var _uuid = _interopRequireDefault(require("uuid"));
18
18
  var _analytics = require("@atlaskit/editor-common/analytics");
19
+ var _browser = require("@atlaskit/editor-common/browser");
19
20
  var _mediaInline = require("@atlaskit/editor-common/media-inline");
20
21
  var _mediaSingle = require("@atlaskit/editor-common/media-single");
21
22
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
@@ -1039,17 +1040,17 @@ var createPlugin = exports.createPlugin = function createPlugin(_schema, options
1039
1040
  // Ignored via go/ees005
1040
1041
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
1041
1042
  var clickedInsideCaptionPlaceholder = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest("[data-id=\"".concat(_mediaSingle.CAPTION_PLACEHOLDER_ID, "\"]"));
1042
-
1043
+ var browser = (0, _browser.getBrowserInfo)();
1043
1044
  // Workaround for Chrome given a regression introduced in prosemirror-view@1.18.6
1044
1045
  // Returning true prevents that updateSelection() is getting called in the commit below:
1045
1046
  // @see https://github.com/ProseMirror/prosemirror-view/compare/1.18.5...1.18.6
1046
- if ((_utils.browser.chrome || _utils.browser.safari) && clickedInsideCaptionPlaceholder) {
1047
+ if ((browser.chrome || browser.safari) && clickedInsideCaptionPlaceholder) {
1047
1048
  return true;
1048
1049
  }
1049
1050
 
1050
1051
  // Workaound for iOS 16 Caption selection issue
1051
1052
  // @see https://product-fabric.atlassian.net/browse/MEX-2012
1052
- if (_utils.browser.ios) {
1053
+ if (browser.ios) {
1053
1054
  var _event$target2;
1054
1055
  // Ignored via go/ees005
1055
1056
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -7,7 +7,7 @@ import React, { Fragment } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
9
9
  import { css, jsx } from '@emotion/react';
10
- import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
10
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
11
11
  import { usePreviousState } from '@atlaskit/editor-common/hooks';
12
12
  import { captionMessages } from '@atlaskit/editor-common/media';
13
13
  import { calcMediaSinglePixelWidth, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, ExternalImageBadge, getMaxWidthForNestedNode, MEDIA_SINGLE_GUTTER_SIZE, MediaBadges } from '@atlaskit/editor-common/media-single';
@@ -392,11 +392,11 @@ export const MediaSingleNodeNext = mediaSingleNodeNextProps => {
392
392
  const isCurrentNodeDrafting = Boolean(isDrafting && targetNodeId === (mediaNode === null || mediaNode === void 0 ? void 0 : (_mediaNode$firstChild = mediaNode.firstChild) === null || _mediaNode$firstChild === void 0 ? void 0 : _mediaNode$firstChild.attrs.id));
393
393
  const mediaSingleWrapperRef = /*#__PURE__*/React.createRef();
394
394
  const captionPlaceHolderRef = /*#__PURE__*/React.createRef();
395
- const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
395
+ const browser = getBrowserInfo();
396
396
  const notIos = !browser.ios;
397
397
  const onMediaSingleClicked = React.useCallback(event => {
398
398
  var _captionPlaceHolderRe;
399
- const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
399
+ const browser = getBrowserInfo();
400
400
  // Workaround for iOS 16 Caption selection issue
401
401
  // @see https://product-fabric.atlassian.net/browse/MEX-2012
402
402
  if (!browser.ios) {
@@ -5,10 +5,11 @@ import { RawIntlProvider } from 'react-intl-next';
5
5
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
6
6
  import uuid from 'uuid';
7
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
8
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
8
9
  import { mediaInlineImagesEnabled } from '@atlaskit/editor-common/media-inline';
9
10
  import { CAPTION_PLACEHOLDER_ID, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
10
11
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
11
- import { browser, ErrorReporter } from '@atlaskit/editor-common/utils';
12
+ import { ErrorReporter } from '@atlaskit/editor-common/utils';
12
13
  import { AllSelection, NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
13
14
  import { insertPoint } from '@atlaskit/editor-prosemirror/transform';
14
15
  import { findDomRefAtPos, findParentNodeOfType, findSelectedNodeOfType, isNodeSelection } from '@atlaskit/editor-prosemirror/utils';
@@ -926,7 +927,7 @@ export const createPlugin = (_schema, options, getIntl, pluginInjectionApi, node
926
927
  // Ignored via go/ees005
927
928
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
928
929
  const clickedInsideCaptionPlaceholder = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest(`[data-id="${CAPTION_PLACEHOLDER_ID}"]`);
929
-
930
+ const browser = getBrowserInfo();
930
931
  // Workaround for Chrome given a regression introduced in prosemirror-view@1.18.6
931
932
  // Returning true prevents that updateSelection() is getting called in the commit below:
932
933
  // @see https://github.com/ProseMirror/prosemirror-view/compare/1.18.5...1.18.6
@@ -13,7 +13,7 @@ import React, { Fragment } from 'react';
13
13
 
14
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
15
15
  import { css, jsx } from '@emotion/react';
16
- import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
16
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
17
17
  import { usePreviousState } from '@atlaskit/editor-common/hooks';
18
18
  import { captionMessages } from '@atlaskit/editor-common/media';
19
19
  import { calcMediaSinglePixelWidth, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, ExternalImageBadge, getMaxWidthForNestedNode, MEDIA_SINGLE_GUTTER_SIZE, MediaBadges } from '@atlaskit/editor-common/media-single';
@@ -426,11 +426,11 @@ export var MediaSingleNodeNext = function MediaSingleNodeNext(mediaSingleNodeNex
426
426
  var isCurrentNodeDrafting = Boolean(isDrafting && targetNodeId === (mediaNode === null || mediaNode === void 0 || (_mediaNode$firstChild = mediaNode.firstChild) === null || _mediaNode$firstChild === void 0 ? void 0 : _mediaNode$firstChild.attrs.id));
427
427
  var mediaSingleWrapperRef = /*#__PURE__*/React.createRef();
428
428
  var captionPlaceHolderRef = /*#__PURE__*/React.createRef();
429
- var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
429
+ var browser = getBrowserInfo();
430
430
  var notIos = !browser.ios;
431
431
  var onMediaSingleClicked = React.useCallback(function (event) {
432
432
  var _captionPlaceHolderRe;
433
- var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
433
+ var browser = getBrowserInfo();
434
434
  // Workaround for iOS 16 Caption selection issue
435
435
  // @see https://product-fabric.atlassian.net/browse/MEX-2012
436
436
  if (!browser.ios) {
@@ -14,10 +14,11 @@ import { RawIntlProvider } from 'react-intl-next';
14
14
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
15
15
  import uuid from 'uuid';
16
16
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
17
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
17
18
  import { mediaInlineImagesEnabled } from '@atlaskit/editor-common/media-inline';
18
19
  import { CAPTION_PLACEHOLDER_ID, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
19
20
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
20
- import { browser, ErrorReporter } from '@atlaskit/editor-common/utils';
21
+ import { ErrorReporter } from '@atlaskit/editor-common/utils';
21
22
  import { AllSelection, NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
22
23
  import { insertPoint } from '@atlaskit/editor-prosemirror/transform';
23
24
  import { findDomRefAtPos, findParentNodeOfType, findSelectedNodeOfType, isNodeSelection } from '@atlaskit/editor-prosemirror/utils';
@@ -1031,7 +1032,7 @@ export var createPlugin = function createPlugin(_schema, options, getIntl, plugi
1031
1032
  // Ignored via go/ees005
1032
1033
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
1033
1034
  var clickedInsideCaptionPlaceholder = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest("[data-id=\"".concat(CAPTION_PLACEHOLDER_ID, "\"]"));
1034
-
1035
+ var browser = getBrowserInfo();
1035
1036
  // Workaround for Chrome given a regression introduced in prosemirror-view@1.18.6
1036
1037
  // Returning true prevents that updateSelection() is getting called in the commit below:
1037
1038
  // @see https://github.com/ProseMirror/prosemirror-view/compare/1.18.5...1.18.6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "10.2.12",
3
+ "version": "11.0.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,43 +29,43 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^52.4.0",
32
+ "@atlaskit/adf-schema": "^52.5.0",
33
33
  "@atlaskit/analytics-namespaced-context": "^7.2.0",
34
34
  "@atlaskit/analytics-next": "^11.2.0",
35
35
  "@atlaskit/button": "^23.11.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
- "@atlaskit/editor-plugin-analytics": "^8.0.0",
38
- "@atlaskit/editor-plugin-annotation": "^8.0.0",
39
- "@atlaskit/editor-plugin-connectivity": "^8.0.0",
40
- "@atlaskit/editor-plugin-decorations": "^8.0.0",
41
- "@atlaskit/editor-plugin-editor-disabled": "^8.0.0",
42
- "@atlaskit/editor-plugin-editor-viewmode": "^10.0.0",
43
- "@atlaskit/editor-plugin-floating-toolbar": "^10.0.0",
44
- "@atlaskit/editor-plugin-focus": "^7.0.0",
45
- "@atlaskit/editor-plugin-grid": "^8.0.0",
46
- "@atlaskit/editor-plugin-guideline": "^8.0.0",
47
- "@atlaskit/editor-plugin-interaction": "^17.0.0",
48
- "@atlaskit/editor-plugin-selection": "^8.0.0",
49
- "@atlaskit/editor-plugin-toolbar": "^5.1.0",
50
- "@atlaskit/editor-plugin-width": "^9.0.0",
37
+ "@atlaskit/editor-plugin-analytics": "^9.0.0",
38
+ "@atlaskit/editor-plugin-annotation": "^9.0.0",
39
+ "@atlaskit/editor-plugin-connectivity": "^9.0.0",
40
+ "@atlaskit/editor-plugin-decorations": "^9.0.0",
41
+ "@atlaskit/editor-plugin-editor-disabled": "^9.0.0",
42
+ "@atlaskit/editor-plugin-editor-viewmode": "^11.0.0",
43
+ "@atlaskit/editor-plugin-floating-toolbar": "^11.0.0",
44
+ "@atlaskit/editor-plugin-focus": "^8.0.0",
45
+ "@atlaskit/editor-plugin-grid": "^9.0.0",
46
+ "@atlaskit/editor-plugin-guideline": "^9.0.0",
47
+ "@atlaskit/editor-plugin-interaction": "^18.0.0",
48
+ "@atlaskit/editor-plugin-selection": "^9.0.0",
49
+ "@atlaskit/editor-plugin-toolbar": "^6.0.0",
50
+ "@atlaskit/editor-plugin-width": "^10.0.0",
51
51
  "@atlaskit/editor-prosemirror": "^7.3.0",
52
52
  "@atlaskit/editor-shared-styles": "^3.10.0",
53
53
  "@atlaskit/editor-tables": "^2.9.0",
54
54
  "@atlaskit/form": "^15.5.0",
55
- "@atlaskit/icon": "^34.0.0",
56
- "@atlaskit/icon-lab": "^6.4.0",
57
- "@atlaskit/media-card": "^79.16.0",
55
+ "@atlaskit/icon": "^34.2.0",
56
+ "@atlaskit/icon-lab": "^6.5.0",
57
+ "@atlaskit/media-card": "^80.0.0",
58
58
  "@atlaskit/media-client": "^36.0.0",
59
59
  "@atlaskit/media-client-react": "^5.0.0",
60
60
  "@atlaskit/media-common": "^13.0.0",
61
61
  "@atlaskit/media-filmstrip": "^51.2.0",
62
- "@atlaskit/media-picker": "^70.1.0",
63
- "@atlaskit/media-ui": "^28.7.0",
64
- "@atlaskit/media-viewer": "^52.9.0",
62
+ "@atlaskit/media-picker": "^71.0.0",
63
+ "@atlaskit/media-ui": "^29.0.0",
64
+ "@atlaskit/media-viewer": "^53.0.0",
65
65
  "@atlaskit/platform-feature-flags": "^1.1.0",
66
66
  "@atlaskit/primitives": "^19.0.0",
67
67
  "@atlaskit/textfield": "^8.3.0",
68
- "@atlaskit/tmp-editor-statsig": "^61.0.0",
68
+ "@atlaskit/tmp-editor-statsig": "^62.4.0",
69
69
  "@atlaskit/tokens": "^13.0.0",
70
70
  "@atlaskit/tooltip": "^21.1.0",
71
71
  "@babel/runtime": "^7.0.0",
@@ -77,7 +77,7 @@
77
77
  "uuid": "^3.1.0"
78
78
  },
79
79
  "peerDependencies": {
80
- "@atlaskit/editor-common": "^112.20.0",
80
+ "@atlaskit/editor-common": "^113.0.0",
81
81
  "@atlaskit/media-core": "^37.0.0",
82
82
  "react": "^18.2.0",
83
83
  "react-dom": "^18.2.0",