@atlaskit/editor-plugin-media 5.1.4 → 5.1.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,23 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 5.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#187144](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/187144)
8
+ [`a16147d8fbdfe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a16147d8fbdfe) -
9
+ Bump @atlaskit/adf-schema to v49.0.5
10
+ - Updated dependencies
11
+
12
+ ## 5.1.5
13
+
14
+ ### Patch Changes
15
+
16
+ - [#184968](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/184968)
17
+ [`a52007f9eed36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a52007f9eed36) -
18
+ Introduce a performance experiment to avoid running media floating toolbar code unless selected.
19
+ - Updated dependencies
20
+
3
21
  ## 5.1.4
4
22
 
5
23
  ### Patch Changes
@@ -31,6 +31,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
31
31
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
32
32
 
33
33
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives
34
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
34
35
 
35
36
  var pixelSizingLabel = (0, _primitives.xcss)({
36
37
  gridArea: 'label',
@@ -20,6 +20,7 @@ var _templateObject;
20
20
  * @jsx jsx
21
21
  */
22
22
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
23
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
23
24
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
25
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
25
26
  var placeholder = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tcolor: ", ";\n\twidth: 100%;\n\ttext-align: center;\n\tmargin-top: ", " !important;\n\tdisplay: block;\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-space-100, 8px)");
@@ -29,6 +29,7 @@ var _smartLinkCard = _interopRequireDefault(require("@atlaskit/icon/core/smart-l
29
29
  var _mediaFilmstrip = require("@atlaskit/media-filmstrip");
30
30
  var _mediaUi = require("@atlaskit/media-ui");
31
31
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
32
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
32
33
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
33
34
  var _styles = require("../../nodeviews/styles");
34
35
  var _altText = require("../../pm-plugins/alt-text");
@@ -685,6 +686,12 @@ var getMediaTypeMessage = function getMediaTypeMessage(selectedNodeTypeSingle) {
685
686
  return mediaType ? mediaTypeMessages[mediaType] : _mediaUi.messages.file_unknown_is_selected;
686
687
  };
687
688
  var overflowDropdwonBtnTriggerTestId = exports.overflowDropdwonBtnTriggerTestId = 'media-overflow-dropdown-trigger';
689
+ var isMediaSelection = function isMediaSelection(selection, nodeType) {
690
+ if (selection instanceof _state2.NodeSelection) {
691
+ return nodeType.includes(selection.node.type);
692
+ }
693
+ return false;
694
+ };
688
695
  var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state, intl) {
689
696
  var _pluginInjectionApi$d3, _pluginInjectionApi$d4;
690
697
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -715,6 +722,11 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
715
722
  }
716
723
  var nodeType = allowMediaInline ? [mediaInline, mediaSingle, media] : [mediaSingle];
717
724
  var isSelectedNodeMediaSingle = state.selection instanceof _state2.NodeSelection && state.selection.node.type === mediaSingle;
725
+ if ((0, _expValEquals.expValEquals)('platform_editor_media_floating_toolbar_early_exit', 'isEnabled', true)) {
726
+ if (!isMediaSelection(state.selection, nodeType)) {
727
+ return;
728
+ }
729
+ }
718
730
  var baseToolbar = {
719
731
  title: 'Media floating controls',
720
732
  nodeType: nodeType,
@@ -14,6 +14,8 @@ var _primitives = require("@atlaskit/primitives");
14
14
  */
15
15
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
16
16
 
17
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
18
+
17
19
  var containerStyles = (0, _primitives.xcss)({
18
20
  marginLeft: 'space.100'
19
21
  });
@@ -13,6 +13,7 @@ import { pixelEntryMessages as messages } from '@atlaskit/editor-common/media';
13
13
  import Form, { Field } from '@atlaskit/form';
14
14
  import CrossIcon from '@atlaskit/icon/core/cross';
15
15
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives
16
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
16
17
  import { Inline, Box, Text, xcss } from '@atlaskit/primitives';
17
18
  import Textfield from '@atlaskit/textfield';
18
19
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -9,6 +9,7 @@ import { css, jsx } from '@emotion/react';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
10
  import { captionMessages as messages } from '@atlaskit/editor-common/media';
11
11
  import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
12
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
12
13
  import { Pressable, Text, xcss } from '@atlaskit/primitives';
13
14
  import { N200 } from '@atlaskit/theme/colors';
14
15
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
@@ -19,6 +19,7 @@ import SmartLinkCardIcon from '@atlaskit/icon/core/smart-link-card';
19
19
  import { mediaFilmstripItemDOMSelector } from '@atlaskit/media-filmstrip';
20
20
  import { messages } from '@atlaskit/media-ui';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
22
23
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
23
24
  import { MediaSingleNodeSelector } from '../../nodeviews/styles';
24
25
  import { getPluginState as getMediaAltTextPluginState } from '../../pm-plugins/alt-text';
@@ -681,6 +682,12 @@ const getMediaTypeMessage = selectedNodeTypeSingle => {
681
682
  return mediaType ? mediaTypeMessages[mediaType] : messages.file_unknown_is_selected;
682
683
  };
683
684
  export const overflowDropdwonBtnTriggerTestId = 'media-overflow-dropdown-trigger';
685
+ const isMediaSelection = (selection, nodeType) => {
686
+ if (selection instanceof NodeSelection) {
687
+ return nodeType.includes(selection.node.type);
688
+ }
689
+ return false;
690
+ };
684
691
  export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) => {
685
692
  var _pluginInjectionApi$d3, _pluginInjectionApi$d4;
686
693
  const {
@@ -715,6 +722,11 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
715
722
  }
716
723
  const nodeType = allowMediaInline ? [mediaInline, mediaSingle, media] : [mediaSingle];
717
724
  const isSelectedNodeMediaSingle = state.selection instanceof NodeSelection && state.selection.node.type === mediaSingle;
725
+ if (expValEquals('platform_editor_media_floating_toolbar_early_exit', 'isEnabled', true)) {
726
+ if (!isMediaSelection(state.selection, nodeType)) {
727
+ return;
728
+ }
729
+ }
718
730
  const baseToolbar = {
719
731
  title: 'Media floating controls',
720
732
  nodeType,
@@ -6,6 +6,7 @@
6
6
  import { jsx } from '@emotion/react';
7
7
  import { ButtonGroup } from '@atlaskit/button';
8
8
  import { FloatingToolbarButton as Button, FloatingToolbarSeparator } from '@atlaskit/editor-common/ui';
9
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
9
10
  import { Box, xcss } from '@atlaskit/primitives';
10
11
  const containerStyles = xcss({
11
12
  marginLeft: 'space.100'
@@ -14,6 +14,7 @@ import { pixelEntryMessages as messages } from '@atlaskit/editor-common/media';
14
14
  import Form, { Field } from '@atlaskit/form';
15
15
  import CrossIcon from '@atlaskit/icon/core/cross';
16
16
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives
17
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
17
18
  import { Inline, Box, Text, xcss } from '@atlaskit/primitives';
18
19
  import Textfield from '@atlaskit/textfield';
19
20
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -11,6 +11,7 @@ import { css, jsx } from '@emotion/react';
11
11
  import { FormattedMessage } from 'react-intl-next';
12
12
  import { captionMessages as messages } from '@atlaskit/editor-common/media';
13
13
  import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
14
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
14
15
  import { Pressable, Text, xcss } from '@atlaskit/primitives';
15
16
  import { N200 } from '@atlaskit/theme/colors';
16
17
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
@@ -23,6 +23,7 @@ import SmartLinkCardIcon from '@atlaskit/icon/core/smart-link-card';
23
23
  import { mediaFilmstripItemDOMSelector } from '@atlaskit/media-filmstrip';
24
24
  import { messages } from '@atlaskit/media-ui';
25
25
  import { fg } from '@atlaskit/platform-feature-flags';
26
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
26
27
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
27
28
  import { MediaSingleNodeSelector } from '../../nodeviews/styles';
28
29
  import { getPluginState as getMediaAltTextPluginState } from '../../pm-plugins/alt-text';
@@ -676,6 +677,12 @@ var getMediaTypeMessage = function getMediaTypeMessage(selectedNodeTypeSingle) {
676
677
  return mediaType ? mediaTypeMessages[mediaType] : messages.file_unknown_is_selected;
677
678
  };
678
679
  export var overflowDropdwonBtnTriggerTestId = 'media-overflow-dropdown-trigger';
680
+ var isMediaSelection = function isMediaSelection(selection, nodeType) {
681
+ if (selection instanceof NodeSelection) {
682
+ return nodeType.includes(selection.node.type);
683
+ }
684
+ return false;
685
+ };
679
686
  export var floatingToolbar = function floatingToolbar(state, intl) {
680
687
  var _pluginInjectionApi$d3, _pluginInjectionApi$d4;
681
688
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -706,6 +713,11 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
706
713
  }
707
714
  var nodeType = allowMediaInline ? [mediaInline, mediaSingle, media] : [mediaSingle];
708
715
  var isSelectedNodeMediaSingle = state.selection instanceof NodeSelection && state.selection.node.type === mediaSingle;
716
+ if (expValEquals('platform_editor_media_floating_toolbar_early_exit', 'isEnabled', true)) {
717
+ if (!isMediaSelection(state.selection, nodeType)) {
718
+ return;
719
+ }
720
+ }
709
721
  var baseToolbar = {
710
722
  title: 'Media floating controls',
711
723
  nodeType: nodeType,
@@ -6,6 +6,7 @@
6
6
  import { jsx } from '@emotion/react';
7
7
  import { ButtonGroup } from '@atlaskit/button';
8
8
  import { FloatingToolbarButton as Button, FloatingToolbarSeparator } from '@atlaskit/editor-common/ui';
9
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
9
10
  import { Box, xcss } from '@atlaskit/primitives';
10
11
  var containerStyles = xcss({
11
12
  marginLeft: 'space.100'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "./types": "./src/types/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/adf-schema": "^47.6.0",
36
+ "@atlaskit/adf-schema": "^49.0.6",
37
37
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
38
38
  "@atlaskit/analytics-next": "^11.1.0",
39
39
  "@atlaskit/button": "^23.2.0",
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/icon": "^27.3.0",
59
59
  "@atlaskit/icon-lab": "^5.1.0",
60
60
  "@atlaskit/media-card": "^79.4.0",
61
- "@atlaskit/media-client": "^35.0.0",
61
+ "@atlaskit/media-client": "^35.1.0",
62
62
  "@atlaskit/media-client-react": "^4.1.0",
63
63
  "@atlaskit/media-common": "^12.3.0",
64
64
  "@atlaskit/media-filmstrip": "^51.0.0",
@@ -69,8 +69,8 @@
69
69
  "@atlaskit/primitives": "^14.10.0",
70
70
  "@atlaskit/textfield": "^8.0.0",
71
71
  "@atlaskit/theme": "^19.0.0",
72
- "@atlaskit/tmp-editor-statsig": "^9.2.0",
73
- "@atlaskit/tokens": "^5.4.0",
72
+ "@atlaskit/tmp-editor-statsig": "^9.7.0",
73
+ "@atlaskit/tokens": "^5.5.0",
74
74
  "@atlaskit/tooltip": "^20.3.0",
75
75
  "@babel/runtime": "^7.0.0",
76
76
  "@emotion/react": "^11.7.1",
@@ -84,7 +84,7 @@
84
84
  "typescript": "~5.4.2"
85
85
  },
86
86
  "peerDependencies": {
87
- "@atlaskit/editor-common": "^107.7.0",
87
+ "@atlaskit/editor-common": "^107.8.0",
88
88
  "@atlaskit/media-core": "^37.0.0",
89
89
  "react": "^18.2.0",
90
90
  "react-dom": "^18.2.0",