@atlaskit/renderer 130.3.6 → 130.3.7

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,12 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 130.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4969431d7e397`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4969431d7e397) -
8
+ [ux] EDITOR-6726 Initialise renderer code block wrapping from the ADF wrap attribute
9
+
3
10
  ## 130.3.6
4
11
 
5
12
  ### Patch Changes
@@ -29,10 +29,13 @@ function CodeBlock(props) {
29
29
  _props$allowWrapCodeB = props.allowWrapCodeBlock,
30
30
  allowWrapCodeBlock = _props$allowWrapCodeB === void 0 ? false : _props$allowWrapCodeB,
31
31
  codeBidiWarningTooltipEnabled = props.codeBidiWarningTooltipEnabled,
32
- localId = props.localId;
32
+ localId = props.localId,
33
+ wrap = props.wrap;
33
34
  var codeBidiWarningLabel = props.intl.formatMessage(_messages.codeBidiWarningMessages.label);
34
35
  var className = [_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, props.className].join(' ');
35
- var _useState = (0, _react.useState)(false),
36
+ var _useState = (0, _react.useState)(function () {
37
+ return (0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap);
38
+ }),
36
39
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
37
40
  wrapLongLines = _useState2[0],
38
41
  setWrapLongLines = _useState2[1];
@@ -53,7 +53,8 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
53
53
  _ref2$allowWrapCodeBl = _ref2.allowWrapCodeBlock,
54
54
  allowWrapCodeBlock = _ref2$allowWrapCodeBl === void 0 ? false : _ref2$allowWrapCodeBl,
55
55
  codeBidiWarningTooltipEnabled = _ref2.codeBidiWarningTooltipEnabled,
56
- rootClassName = _ref2.className;
56
+ rootClassName = _ref2.className,
57
+ wrap = _ref2.wrap;
57
58
  var _useBidiWarnings = (0, _useBidiWarnings2.useBidiWarnings)({
58
59
  enableWarningTooltip: codeBidiWarningTooltipEnabled
59
60
  }),
@@ -70,7 +71,9 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
70
71
  ,
71
72
  className: rootClassName
72
73
  });
73
- var _useState = (0, _react.useState)(false),
74
+ var _useState = (0, _react.useState)(function () {
75
+ return (0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap);
76
+ }),
74
77
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
75
78
  wrapLongLines = _useState2[0],
76
79
  setWrapLongLines = _useState2[1];
@@ -18,11 +18,12 @@ function CodeBlock(props) {
18
18
  allowCopyToClipboard = false,
19
19
  allowWrapCodeBlock = false,
20
20
  codeBidiWarningTooltipEnabled,
21
- localId
21
+ localId,
22
+ wrap
22
23
  } = props;
23
24
  const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
24
25
  const className = [CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, props.className].join(' ');
25
- const [wrapLongLines, setWrapLongLines] = useState(false);
26
+ const [wrapLongLines, setWrapLongLines] = useState(() => expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap));
26
27
  return jsx(CodeBlockContainer, {
27
28
  allowCopyToClipboard: allowCopyToClipboard,
28
29
  allowWrapCodeBlock: allowWrapCodeBlock
@@ -24,7 +24,8 @@ const WindowedCodeBlock = ({
24
24
  allowCopyToClipboard,
25
25
  allowWrapCodeBlock = false,
26
26
  codeBidiWarningTooltipEnabled,
27
- className: rootClassName
27
+ className: rootClassName,
28
+ wrap
28
29
  }) => {
29
30
  const {
30
31
  warningLabel
@@ -44,7 +45,7 @@ const WindowedCodeBlock = ({
44
45
  ,
45
46
  className: rootClassName
46
47
  });
47
- const [wrapLongLines, setWrapLongLines] = useState(false);
48
+ const [wrapLongLines, setWrapLongLines] = useState(() => expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap));
48
49
  return isInViewport ? jsx(Fragment, null, jsx(Suspense, {
49
50
  fallback: memoizedLightWeightCodeBlock
50
51
  }, jsx(CodeBlockContainer, {
@@ -20,10 +20,13 @@ function CodeBlock(props) {
20
20
  _props$allowWrapCodeB = props.allowWrapCodeBlock,
21
21
  allowWrapCodeBlock = _props$allowWrapCodeB === void 0 ? false : _props$allowWrapCodeB,
22
22
  codeBidiWarningTooltipEnabled = props.codeBidiWarningTooltipEnabled,
23
- localId = props.localId;
23
+ localId = props.localId,
24
+ wrap = props.wrap;
24
25
  var codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
25
26
  var className = [CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, props.className].join(' ');
26
- var _useState = useState(false),
27
+ var _useState = useState(function () {
28
+ return expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap);
29
+ }),
27
30
  _useState2 = _slicedToArray(_useState, 2),
28
31
  wrapLongLines = _useState2[0],
29
32
  setWrapLongLines = _useState2[1];
@@ -44,7 +44,8 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
44
44
  _ref2$allowWrapCodeBl = _ref2.allowWrapCodeBlock,
45
45
  allowWrapCodeBlock = _ref2$allowWrapCodeBl === void 0 ? false : _ref2$allowWrapCodeBl,
46
46
  codeBidiWarningTooltipEnabled = _ref2.codeBidiWarningTooltipEnabled,
47
- rootClassName = _ref2.className;
47
+ rootClassName = _ref2.className,
48
+ wrap = _ref2.wrap;
48
49
  var _useBidiWarnings = useBidiWarnings({
49
50
  enableWarningTooltip: codeBidiWarningTooltipEnabled
50
51
  }),
@@ -61,7 +62,9 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
61
62
  ,
62
63
  className: rootClassName
63
64
  });
64
- var _useState = useState(false),
65
+ var _useState = useState(function () {
66
+ return expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap);
67
+ }),
65
68
  _useState2 = _slicedToArray(_useState, 2),
66
69
  wrapLongLines = _useState2[0],
67
70
  setWrapLongLines = _useState2[1];
@@ -13,6 +13,7 @@ export interface Props {
13
13
  language: SupportedLanguages;
14
14
  localId?: string;
15
15
  text: string;
16
+ wrap?: boolean;
16
17
  }
17
18
  declare const _default_1: FC<WithIntlProps<Props & WrappedComponentProps>> & {
18
19
  WrappedComponent: ComponentType<Props & WrappedComponentProps>;
@@ -1,4 +1,4 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import type { Props as CodeBlockProps } from './codeBlock';
3
- declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, allowWrapCodeBlock, codeBidiWarningTooltipEnabled, className: rootClassName, }: CodeBlockProps) => jsx.JSX.Element;
3
+ declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, allowWrapCodeBlock, codeBidiWarningTooltipEnabled, className: rootClassName, wrap, }: CodeBlockProps) => jsx.JSX.Element;
4
4
  export default WindowedCodeBlock;
@@ -13,6 +13,7 @@ export interface Props {
13
13
  language: SupportedLanguages;
14
14
  localId?: string;
15
15
  text: string;
16
+ wrap?: boolean;
16
17
  }
17
18
  declare const _default_1: FC<WithIntlProps<Props & WrappedComponentProps>> & {
18
19
  WrappedComponent: ComponentType<Props & WrappedComponentProps>;
@@ -1,4 +1,4 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import type { Props as CodeBlockProps } from './codeBlock';
3
- declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, allowWrapCodeBlock, codeBidiWarningTooltipEnabled, className: rootClassName, }: CodeBlockProps) => jsx.JSX.Element;
3
+ declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, allowWrapCodeBlock, codeBidiWarningTooltipEnabled, className: rootClassName, wrap, }: CodeBlockProps) => jsx.JSX.Element;
4
4
  export default WindowedCodeBlock;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "130.3.6",
3
+ "version": "130.3.7",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/status": "^4.0.0",
67
67
  "@atlaskit/task-decision": "^20.0.0",
68
68
  "@atlaskit/theme": "^23.2.0",
69
- "@atlaskit/tmp-editor-statsig": "^77.2.0",
69
+ "@atlaskit/tmp-editor-statsig": "^77.3.0",
70
70
  "@atlaskit/tokens": "^13.0.0",
71
71
  "@atlaskit/tooltip": "^22.0.0",
72
72
  "@atlaskit/visually-hidden": "^3.1.0",
@@ -80,7 +80,7 @@
80
80
  "uuid": "^3.1.0"
81
81
  },
82
82
  "peerDependencies": {
83
- "@atlaskit/editor-common": "^114.25.0",
83
+ "@atlaskit/editor-common": "^114.26.0",
84
84
  "@atlaskit/link-provider": "^4.4.0",
85
85
  "@atlaskit/media-core": "^37.0.0",
86
86
  "react": "^18.2.0",