@atlaskit/editor-plugin-media 8.1.3 → 8.1.4

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,13 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 8.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5c07f0d4e428f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c07f0d4e428f) -
8
+ [EDITOR-1998] Make media captions follow dense/ compact content mode
9
+ - Updated dependencies
10
+
3
11
  ## 8.1.3
4
12
 
5
13
  ### Patch Changes
@@ -141,7 +149,6 @@
141
149
 
142
150
  - [`0d0fe7a300841`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d0fe7a300841) -
143
151
  Cleanup platform_editor_usesharedpluginstatewithselector experiment
144
-
145
152
  - BREAKING CHANGE: sharedPluginStateHookMigratorFactory is deleted from @atlaskit/editor-common
146
153
 
147
154
  - Updated dependencies
@@ -509,7 +516,6 @@
509
516
  shared context or singletons.
510
517
 
511
518
  **HOW TO ADJUST:**
512
-
513
519
  - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
514
520
  any of these editor plugins.
515
521
  - Ensure the version you install matches the version required by the plugins.
@@ -1914,12 +1920,10 @@
1914
1920
  [ux] [ED-25085] Migrate typography \
1915
1921
 
1916
1922
  editor-plugin-media:
1917
-
1918
1923
  - replace caption placeholder span with button
1919
1924
  - replace x between width and height pixel entry with symbol × \
1920
1925
 
1921
1926
  tmp-editor-statsig:
1922
-
1923
1927
  - Add experiment `platform_editor_typography_migration_ugc`
1924
1928
 
1925
1929
  - Updated dependencies
@@ -1983,7 +1987,6 @@
1983
1987
  - [#146446](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146446)
1984
1988
  [`c98c34dd5f307`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c98c34dd5f307) -
1985
1989
  [ED-24941] Added analytics for media-insert
1986
-
1987
1990
  - **@atlaskit/editor-common**: Add enums and types for new anaylics params
1988
1991
  - **@atlaskit/editor-plugin-media**: Include 'insertMediaVia' on analytics events for inserting
1989
1992
  media into the document
@@ -3330,7 +3333,6 @@
3330
3333
  ## WHAT?:
3331
3334
 
3332
3335
  Removing feature flags:
3333
-
3334
3336
  - singleLayout
3335
3337
  - newInsertionBehaviour
3336
3338
  - interactiveExpand
@@ -3344,7 +3346,6 @@
3344
3346
  maintenance burden
3345
3347
 
3346
3348
  ## HOW to update your code:
3347
-
3348
3349
  - If you were using the feature flag - the behaviour is now default and you can remove the flags
3349
3350
  - If you were not using the feature flag - the behaviour is now default.
3350
3351
  - If you have opted out of using the feature flag - we have been careful to ensure no-one has
@@ -3837,7 +3838,6 @@
3837
3838
  - [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646)
3838
3839
  [`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make
3839
3840
  feature flags plugin optional in all plugins including:
3840
-
3841
3841
  - analytics
3842
3842
  - base
3843
3843
  - card
@@ -12,8 +12,10 @@ var _react2 = require("@emotion/react");
12
12
  var _reactIntlNext = require("react-intl-next");
13
13
  var _media = require("@atlaskit/editor-common/media");
14
14
  var _mediaSingle = require("@atlaskit/editor-common/media-single");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _primitives = require("@atlaskit/primitives");
16
17
  var _colors = require("@atlaskit/theme/colors");
18
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
19
  var _templateObject;
18
20
  /**
19
21
  * @jsxRuntime classic
@@ -24,6 +26,9 @@ var _templateObject;
24
26
  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); }
25
27
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
26
28
  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
+ var placeholderText = (0, _react2.css)({
30
+ color: "var(--ds-text-subtlest, #626F86)"
31
+ });
27
32
  var placeholderButton = (0, _primitives.xcss)({
28
33
  width: '100%',
29
34
  marginTop: 'space.100'
@@ -42,11 +47,15 @@ var CaptionPlaceholder = exports.CaptionPlaceholder = /*#__PURE__*/_react.defaul
42
47
  // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
43
48
  // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
44
49
  return (
45
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/no-static-element-interactions
50
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
46
51
  (0, _react2.jsx)("span", {
47
52
  ref: ref,
48
53
  css: placeholder,
49
- onPointerDown: handlePointerDown,
54
+ onPointerDown: handlePointerDown
55
+ // This id is just used for setting styles at the moment, if it's needed for anything more specific
56
+ // It may need to be generated to avoid overlap
57
+ ,
58
+ id: (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ? _mediaSingle.CAPTION_PLACEHOLDER_ID : undefined,
50
59
  "data-id": _mediaSingle.CAPTION_PLACEHOLDER_ID,
51
60
  "data-testid": "caption-placeholder"
52
61
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
@@ -58,6 +67,7 @@ var CaptionPlaceholder = exports.CaptionPlaceholder = /*#__PURE__*/_react.defaul
58
67
  var CaptionPlaceholderButton = exports.CaptionPlaceholderButton = /*#__PURE__*/_react.default.forwardRef(function (_ref2, ref) {
59
68
  var onClick = _ref2.onClick,
60
69
  placeholderMessage = _ref2.placeholderMessage;
70
+ var intl = (0, _reactIntlNext.useIntl)();
61
71
  var handleMouseDown = (0, _react.useCallback)(function (e) {
62
72
  // In firefox, button is focused when mouse down, which make editor lose focus
63
73
  // Hence we want to disabled it so that user can type in caption directly after click
@@ -73,11 +83,18 @@ var CaptionPlaceholderButton = exports.CaptionPlaceholderButton = /*#__PURE__*/_
73
83
  testId: "caption-placeholder",
74
84
  padding: "space.0",
75
85
  xcss: placeholderButton
76
- }, (0, _react2.jsx)(_primitives.Text, {
77
- color: "color.text.subtlest",
78
- size: "large"
86
+ }, (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ?
87
+ // This id is just used for setting styles at the moment, if it's needed for anything more specific
88
+ // It may need to be generated to avoid overlap
89
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
90
+ (0, _react2.jsx)("span", {
91
+ css: placeholderText,
92
+ id: _mediaSingle.CAPTION_PLACEHOLDER_ID
79
93
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
80
94
  // Ignored via go/ees005
81
95
  // eslint-disable-next-line react/jsx-props-no-spreading
82
- , computedPlaceholderMessage)));
96
+ , computedPlaceholderMessage)) : (0, _react2.jsx)(_primitives.Text, {
97
+ color: "color.text.subtlest",
98
+ size: "large"
99
+ }, intl.formatMessage(computedPlaceholderMessage)));
83
100
  });
@@ -6,12 +6,14 @@ import React, { useCallback } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
- import { FormattedMessage } from 'react-intl-next';
9
+ import { FormattedMessage, useIntl } 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
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
13
14
  import { Pressable, Text, xcss } from '@atlaskit/primitives';
14
15
  import { N200 } from '@atlaskit/theme/colors';
16
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
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
16
18
  const placeholder = css`
17
19
  color: ${`var(--ds-text-subtlest, ${N200})`};
@@ -20,6 +22,9 @@ const placeholder = css`
20
22
  margin-top: ${"var(--ds-space-100, 8px)"} !important;
21
23
  display: block;
22
24
  `;
25
+ const placeholderText = css({
26
+ color: "var(--ds-text-subtlest, #626F86)"
27
+ });
23
28
  const placeholderButton = xcss({
24
29
  width: '100%',
25
30
  marginTop: 'space.100'
@@ -39,11 +44,15 @@ export const CaptionPlaceholder = /*#__PURE__*/React.forwardRef(({
39
44
  // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
40
45
  // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
41
46
  return (
42
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/no-static-element-interactions
47
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
43
48
  jsx("span", {
44
49
  ref: ref,
45
50
  css: placeholder,
46
- onPointerDown: handlePointerDown,
51
+ onPointerDown: handlePointerDown
52
+ // This id is just used for setting styles at the moment, if it's needed for anything more specific
53
+ // It may need to be generated to avoid overlap
54
+ ,
55
+ id: expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? CAPTION_PLACEHOLDER_ID : undefined,
47
56
  "data-id": CAPTION_PLACEHOLDER_ID,
48
57
  "data-testid": "caption-placeholder"
49
58
  }, jsx(FormattedMessage
@@ -56,6 +65,7 @@ export const CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(({
56
65
  onClick,
57
66
  placeholderMessage
58
67
  }, ref) => {
68
+ const intl = useIntl();
59
69
  const handleMouseDown = useCallback(e => {
60
70
  // In firefox, button is focused when mouse down, which make editor lose focus
61
71
  // Hence we want to disabled it so that user can type in caption directly after click
@@ -71,11 +81,18 @@ export const CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(({
71
81
  testId: "caption-placeholder",
72
82
  padding: "space.0",
73
83
  xcss: placeholderButton
74
- }, jsx(Text, {
75
- color: "color.text.subtlest",
76
- size: "large"
84
+ }, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ?
85
+ // This id is just used for setting styles at the moment, if it's needed for anything more specific
86
+ // It may need to be generated to avoid overlap
87
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
88
+ jsx("span", {
89
+ css: placeholderText,
90
+ id: CAPTION_PLACEHOLDER_ID
77
91
  }, jsx(FormattedMessage
78
92
  // Ignored via go/ees005
79
93
  // eslint-disable-next-line react/jsx-props-no-spreading
80
- , computedPlaceholderMessage)));
94
+ , computedPlaceholderMessage)) : jsx(Text, {
95
+ color: "color.text.subtlest",
96
+ size: "large"
97
+ }, intl.formatMessage(computedPlaceholderMessage)));
81
98
  });
@@ -8,14 +8,19 @@ import React, { useCallback } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
- import { FormattedMessage } from 'react-intl-next';
11
+ import { FormattedMessage, useIntl } 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
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
15
16
  import { Pressable, Text, xcss } from '@atlaskit/primitives';
16
17
  import { N200 } from '@atlaskit/theme/colors';
18
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
19
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
18
20
  var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tcolor: ", ";\n\twidth: 100%;\n\ttext-align: center;\n\tmargin-top: ", " !important;\n\tdisplay: block;\n"])), "var(--ds-text-subtlest, ".concat(N200, ")"), "var(--ds-space-100, 8px)");
21
+ var placeholderText = css({
22
+ color: "var(--ds-text-subtlest, #626F86)"
23
+ });
19
24
  var placeholderButton = xcss({
20
25
  width: '100%',
21
26
  marginTop: 'space.100'
@@ -34,11 +39,15 @@ export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, re
34
39
  // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
35
40
  // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
36
41
  return (
37
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/no-static-element-interactions
42
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
38
43
  jsx("span", {
39
44
  ref: ref,
40
45
  css: placeholder,
41
- onPointerDown: handlePointerDown,
46
+ onPointerDown: handlePointerDown
47
+ // This id is just used for setting styles at the moment, if it's needed for anything more specific
48
+ // It may need to be generated to avoid overlap
49
+ ,
50
+ id: expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? CAPTION_PLACEHOLDER_ID : undefined,
42
51
  "data-id": CAPTION_PLACEHOLDER_ID,
43
52
  "data-testid": "caption-placeholder"
44
53
  }, jsx(FormattedMessage
@@ -50,6 +59,7 @@ export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, re
50
59
  export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
51
60
  var onClick = _ref2.onClick,
52
61
  placeholderMessage = _ref2.placeholderMessage;
62
+ var intl = useIntl();
53
63
  var handleMouseDown = useCallback(function (e) {
54
64
  // In firefox, button is focused when mouse down, which make editor lose focus
55
65
  // Hence we want to disabled it so that user can type in caption directly after click
@@ -65,11 +75,18 @@ export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_r
65
75
  testId: "caption-placeholder",
66
76
  padding: "space.0",
67
77
  xcss: placeholderButton
68
- }, jsx(Text, {
69
- color: "color.text.subtlest",
70
- size: "large"
78
+ }, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ?
79
+ // This id is just used for setting styles at the moment, if it's needed for anything more specific
80
+ // It may need to be generated to avoid overlap
81
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
82
+ jsx("span", {
83
+ css: placeholderText,
84
+ id: CAPTION_PLACEHOLDER_ID
71
85
  }, jsx(FormattedMessage
72
86
  // Ignored via go/ees005
73
87
  // eslint-disable-next-line react/jsx-props-no-spreading
74
- , computedPlaceholderMessage)));
88
+ , computedPlaceholderMessage)) : jsx(Text, {
89
+ color: "color.text.subtlest",
90
+ size: "large"
91
+ }, intl.formatMessage(computedPlaceholderMessage)));
75
92
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "8.1.3",
3
+ "version": "8.1.4",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/primitives": "^15.0.0",
67
67
  "@atlaskit/textfield": "^8.0.0",
68
68
  "@atlaskit/theme": "^21.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^13.10.0",
69
+ "@atlaskit/tmp-editor-statsig": "^13.12.0",
70
70
  "@atlaskit/tokens": "^6.5.0",
71
71
  "@atlaskit/tooltip": "^20.5.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": "^110.12.0",
81
+ "@atlaskit/editor-common": "^110.13.0",
82
82
  "@atlaskit/media-core": "^37.0.0",
83
83
  "react": "^18.2.0",
84
84
  "react-dom": "^18.2.0",
@@ -148,6 +148,9 @@
148
148
  "platform_editor_remove_media_inline_feature_flag": {
149
149
  "type": "boolean"
150
150
  },
151
+ "platform_editor_content_mode_button_mvp": {
152
+ "type": "boolean"
153
+ },
151
154
  "platform_editor_ssr_media": {
152
155
  "type": "boolean"
153
156
  },