@atlaskit/renderer 108.11.18 → 108.12.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,11 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 108.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ec4867e1376`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ec4867e1376) - Removed captions flag and replaced with a new media prop `allowCaptions`. `allowCaptions` is set to `false` by default and products will need to opt in to be able to use captions from now on.
8
+
3
9
  ## 108.11.18
4
10
 
5
11
  ### Patch Changes
@@ -56,8 +56,11 @@ var MediaSingle = function MediaSingle(props) {
56
56
  layout = props.layout,
57
57
  children = props.children,
58
58
  widthAttr = props.width,
59
- widthType = props.widthType;
59
+ widthType = props.widthType,
60
+ _props$allowCaptions = props.allowCaptions,
61
+ allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions;
60
62
  var isCaptionsFlaggedOn = (0, _mediaCommon.getMediaFeatureFlag)('captions', featureFlags);
63
+ var showCaptions = allowCaptions ? allowCaptions : isCaptionsFlaggedOn;
61
64
  var _React$useState = _react.default.useState({
62
65
  width: 0,
63
66
  height: 0
@@ -169,7 +172,7 @@ var MediaSingle = function MediaSingle(props) {
169
172
  widthType: widthType
170
173
  },
171
174
  fullWidthMode: isFullWidth
172
- }, (0, _react2.jsx)(_react.Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
175
+ }, (0, _react2.jsx)(_react.Fragment, null, mediaComponent), showCaptions && caption);
173
176
  };
174
177
  return (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref3) {
175
178
  var width = _ref3.width,
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
55
55
  var DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "108.11.18";
58
+ var packageVersion = "108.12.0";
59
59
  var Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+
2
3
  import { default as React, Fragment } from 'react';
3
4
  import { jsx } from '@emotion/react';
4
5
  import { injectIntl } from 'react-intl-next';
@@ -43,9 +44,11 @@ const MediaSingle = props => {
43
44
  layout,
44
45
  children,
45
46
  width: widthAttr,
46
- widthType
47
+ widthType,
48
+ allowCaptions = false
47
49
  } = props;
48
50
  const isCaptionsFlaggedOn = getMediaFeatureFlag('captions', featureFlags);
51
+ const showCaptions = allowCaptions ? allowCaptions : isCaptionsFlaggedOn;
49
52
  const [externalImageDimensions, setExternalImageDimensions] = React.useState({
50
53
  width: 0,
51
54
  height: 0
@@ -154,7 +157,7 @@ const MediaSingle = props => {
154
157
  widthType
155
158
  },
156
159
  fullWidthMode: isFullWidth
157
- }, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
160
+ }, jsx(Fragment, null, mediaComponent), showCaptions && caption);
158
161
  };
159
162
  return jsx(WidthConsumer, null, ({
160
163
  width,
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
35
35
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
36
36
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
37
37
  const packageName = "@atlaskit/renderer";
38
- const packageVersion = "108.11.18";
38
+ const packageVersion = "108.12.0";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -1,5 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  /** @jsx jsx */
3
+
3
4
  import { default as React, Fragment } from 'react';
4
5
  import { jsx } from '@emotion/react';
5
6
  import { injectIntl } from 'react-intl-next';
@@ -44,8 +45,11 @@ var MediaSingle = function MediaSingle(props) {
44
45
  layout = props.layout,
45
46
  children = props.children,
46
47
  widthAttr = props.width,
47
- widthType = props.widthType;
48
+ widthType = props.widthType,
49
+ _props$allowCaptions = props.allowCaptions,
50
+ allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions;
48
51
  var isCaptionsFlaggedOn = getMediaFeatureFlag('captions', featureFlags);
52
+ var showCaptions = allowCaptions ? allowCaptions : isCaptionsFlaggedOn;
49
53
  var _React$useState = React.useState({
50
54
  width: 0,
51
55
  height: 0
@@ -157,7 +161,7 @@ var MediaSingle = function MediaSingle(props) {
157
161
  widthType: widthType
158
162
  },
159
163
  fullWidthMode: isFullWidth
160
- }, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
164
+ }, jsx(Fragment, null, mediaComponent), showCaptions && caption);
161
165
  };
162
166
  return jsx(WidthConsumer, null, function (_ref3) {
163
167
  var width = _ref3.width,
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
45
45
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  var packageName = "@atlaskit/renderer";
48
- var packageVersion = "108.11.18";
48
+ var packageVersion = "108.12.0";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -1,11 +1,10 @@
1
- /** @jsx jsx */
2
1
  import { default as React } from 'react';
3
- import { WrappedComponentProps } from 'react-intl-next';
4
- import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
- import { MediaFeatureFlags } from '@atlaskit/media-common';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
4
+ import type { MediaFeatureFlags } from '@atlaskit/media-common';
6
5
  import type { EventHandlers, MediaSingleWidthType } from '@atlaskit/editor-common/ui';
7
- import { AnalyticsEventPayload } from '../../../analytics/events';
8
- import { RendererAppearance } from '../../../ui/Renderer/types';
6
+ import type { AnalyticsEventPayload } from '../../../analytics/events';
7
+ import type { RendererAppearance } from '../../../ui/Renderer/types';
9
8
  export interface Props {
10
9
  children: React.ReactNode;
11
10
  layout: MediaSingleLayout;
@@ -16,6 +15,7 @@ export interface Props {
16
15
  rendererAppearance: RendererAppearance;
17
16
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
18
17
  featureFlags?: MediaFeatureFlags;
18
+ allowCaptions?: boolean;
19
19
  }
20
20
  export declare const getMediaContainerWidth: (currentContainerWidth: number, layout: MediaSingleLayout) => number;
21
21
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
@@ -1,5 +1,5 @@
1
- import { MediaClientConfig } from '@atlaskit/media-core';
2
- import { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
1
+ import type { MediaClientConfig } from '@atlaskit/media-core';
2
+ import type { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
3
3
  export type MediaSSR = {
4
4
  mode: SSR;
5
5
  config: MediaClientConfig;
@@ -9,4 +9,5 @@ export interface MediaOptions {
9
9
  enableDownloadButton?: boolean;
10
10
  featureFlags?: MediaFeatureFlags;
11
11
  ssr?: MediaSSR;
12
+ allowCaptions?: boolean;
12
13
  }
@@ -1,11 +1,10 @@
1
- /** @jsx jsx */
2
1
  import { default as React } from 'react';
3
- import { WrappedComponentProps } from 'react-intl-next';
4
- import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
- import { MediaFeatureFlags } from '@atlaskit/media-common';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
4
+ import type { MediaFeatureFlags } from '@atlaskit/media-common';
6
5
  import type { EventHandlers, MediaSingleWidthType } from '@atlaskit/editor-common/ui';
7
- import { AnalyticsEventPayload } from '../../../analytics/events';
8
- import { RendererAppearance } from '../../../ui/Renderer/types';
6
+ import type { AnalyticsEventPayload } from '../../../analytics/events';
7
+ import type { RendererAppearance } from '../../../ui/Renderer/types';
9
8
  export interface Props {
10
9
  children: React.ReactNode;
11
10
  layout: MediaSingleLayout;
@@ -16,6 +15,7 @@ export interface Props {
16
15
  rendererAppearance: RendererAppearance;
17
16
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
18
17
  featureFlags?: MediaFeatureFlags;
18
+ allowCaptions?: boolean;
19
19
  }
20
20
  export declare const getMediaContainerWidth: (currentContainerWidth: number, layout: MediaSingleLayout) => number;
21
21
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
@@ -1,5 +1,5 @@
1
- import { MediaClientConfig } from '@atlaskit/media-core';
2
- import { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
1
+ import type { MediaClientConfig } from '@atlaskit/media-core';
2
+ import type { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
3
3
  export type MediaSSR = {
4
4
  mode: SSR;
5
5
  config: MediaClientConfig;
@@ -9,4 +9,5 @@ export interface MediaOptions {
9
9
  enableDownloadButton?: boolean;
10
10
  featureFlags?: MediaFeatureFlags;
11
11
  ssr?: MediaSSR;
12
+ allowCaptions?: boolean;
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.11.18",
3
+ "version": "108.12.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -31,8 +31,8 @@ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
31
31
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
32
32
  import { jsx } from '@emotion/react';
33
33
  import type { Mark } from '@atlaskit/editor-prosemirror/model';
34
- import { MediaClientConfig } from '@atlaskit/media-core';
35
- import { MediaFeatureFlags } from '@atlaskit/media-common';
34
+ import type { MediaClientConfig } from '@atlaskit/media-core';
35
+ import type { MediaFeatureFlags } from '@atlaskit/media-common';
36
36
  import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
37
37
  import { OperationalAEP } from '@atlaskit/editor-common/analytics';
38
38
  import { PropsDifference } from '@atlaskit/editor-common/utils';
@@ -41,7 +41,7 @@ import { Schema } from '@atlaskit/editor-prosemirror/model';
41
41
  import { SEVERITY } from '@atlaskit/editor-common/utils';
42
42
  import { ShallowPropsDifference } from '@atlaskit/editor-common/utils';
43
43
  import { SortOrder } from '@atlaskit/editor-common/types';
44
- import { SSR } from '@atlaskit/media-common';
44
+ import type { SSR } from '@atlaskit/media-common';
45
45
  import type { Transformer as Transformer_2 } from '@atlaskit/editor-common/types';
46
46
  import { UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from '@atlaskit/editor-common/utils';
47
47
  import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
@@ -236,6 +236,8 @@ type MediaLnkTransformedAEP = AEP<
236
236
 
237
237
  // @public (undocumented)
238
238
  interface MediaOptions {
239
+ // (undocumented)
240
+ allowCaptions?: boolean;
239
241
  // (undocumented)
240
242
  allowLinking?: boolean;
241
243
  // (undocumented)
@@ -20,8 +20,8 @@ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
20
20
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
21
21
  import { jsx } from '@emotion/react';
22
22
  import type { Mark } from '@atlaskit/editor-prosemirror/model';
23
- import { MediaClientConfig } from '@atlaskit/media-core';
24
- import { MediaFeatureFlags } from '@atlaskit/media-common';
23
+ import type { MediaClientConfig } from '@atlaskit/media-core';
24
+ import type { MediaFeatureFlags } from '@atlaskit/media-common';
25
25
  import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
26
26
  import { OperationalAEP } from '@atlaskit/editor-common/analytics';
27
27
  import { PropsDifference } from '@atlaskit/editor-common/utils';
@@ -30,7 +30,7 @@ import { Schema } from '@atlaskit/editor-prosemirror/model';
30
30
  import { SEVERITY } from '@atlaskit/editor-common/utils';
31
31
  import { ShallowPropsDifference } from '@atlaskit/editor-common/utils';
32
32
  import { SortOrder } from '@atlaskit/editor-common/types';
33
- import { SSR } from '@atlaskit/media-common';
33
+ import type { SSR } from '@atlaskit/media-common';
34
34
  import type { Transformer as Transformer_2 } from '@atlaskit/editor-common/types';
35
35
  import { UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from '@atlaskit/editor-common/utils';
36
36
  import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
@@ -139,6 +139,8 @@ type MediaLnkTransformedAEP = AEP<ACTION.MEDIA_LINK_TRANSFORMED, ACTION_SUBJECT.
139
139
 
140
140
  // @public (undocumented)
141
141
  interface MediaOptions {
142
+ // (undocumented)
143
+ allowCaptions?: boolean;
142
144
  // (undocumented)
143
145
  allowLinking?: boolean;
144
146
  // (undocumented)