@atlaskit/renderer 130.6.0 → 130.6.1

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/renderer
2
2
 
3
+ ## 130.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7e8145e6a7ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e8145e6a7ce6) -
8
+ Add ADF-backed code block line number visibility
9
+ - Updated dependencies
10
+
3
11
  ## 130.6.0
4
12
 
5
13
  ### Minor Changes
@@ -29,6 +29,8 @@ 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
+ _props$hideLineNumber = props.hideLineNumbers,
33
+ hideLineNumbers = _props$hideLineNumber === void 0 ? false : _props$hideLineNumber,
32
34
  localId = props.localId,
33
35
  wrap = props.wrap;
34
36
  var codeBidiWarningLabel = props.intl.formatMessage(_messages.codeBidiWarningMessages.label);
@@ -56,6 +58,7 @@ function CodeBlock(props) {
56
58
  codeBidiWarningLabel: codeBidiWarningLabel,
57
59
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
58
60
  shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
61
+ shouldShowLineNumbers: !((0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
59
62
  hasBidiWarnings: (0, _expValEquals.expValEquals)('platform_editor_remove_bidi_char_warning', 'isEnabled', true) ? false : undefined
60
63
  }));
61
64
  }
@@ -148,6 +148,8 @@ var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
148
148
  var text = _ref.text,
149
149
  _ref$codeBidiWarningT = _ref.codeBidiWarningTooltipEnabled,
150
150
  codeBidiWarningTooltipEnabled = _ref$codeBidiWarningT === void 0 ? true : _ref$codeBidiWarningT,
151
+ _ref$hideLineNumbers = _ref.hideLineNumbers,
152
+ hideLineNumbers = _ref$hideLineNumbers === void 0 ? false : _ref$hideLineNumbers,
151
153
  className = _ref.className;
152
154
  var textRows = (0, _react.useMemo)(function () {
153
155
  return (text !== null && text !== void 0 ? text : '').split('\n');
@@ -175,7 +177,7 @@ var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
175
177
  }, (0, _react2.jsx)("div", {
176
178
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
177
179
  className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
178
- }, (0, _react2.jsx)("div", {
180
+ }, !hideLineNumbers && (0, _react2.jsx)("div", {
179
181
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
180
182
  className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
181
183
  }, textRows.map(function (_, index) {
@@ -53,6 +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
+ _ref2$hideLineNumbers = _ref2.hideLineNumbers,
57
+ hideLineNumbers = _ref2$hideLineNumbers === void 0 ? false : _ref2$hideLineNumbers,
56
58
  rootClassName = _ref2.className,
57
59
  wrap = _ref2.wrap;
58
60
  var _useBidiWarnings = (0, _useBidiWarnings2.useBidiWarnings)({
@@ -66,7 +68,8 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
66
68
  var memoizedLightWeightCodeBlock = (0, _react2.jsx)(MemoizedLightWeightCodeBlock, {
67
69
  ref: trackingRef,
68
70
  text: text,
69
- codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
71
+ codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
72
+ hideLineNumbers: (0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers
70
73
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
71
74
  ,
72
75
  className: rootClassName
@@ -94,6 +97,7 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
94
97
  codeBidiWarningLabel: warningLabel,
95
98
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
96
99
  shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
100
+ shouldShowLineNumbers: !((0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
97
101
  hasBidiWarnings: (0, _expValEquals.expValEquals)('platform_editor_remove_bidi_char_warning', 'isEnabled', true) ? false : undefined
98
102
  })))) : memoizedLightWeightCodeBlock;
99
103
  };
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
71
71
  var TABLE_INFO_TIMEOUT = 10000;
72
72
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
73
73
  var packageName = "@atlaskit/renderer";
74
- var packageVersion = "130.5.1";
74
+ var packageVersion = "130.6.0";
75
75
  var setAsQueryContainerStyles = (0, _react2.css)({
76
76
  containerName: 'ak-renderer-wrapper',
77
77
  containerType: 'inline-size'
@@ -18,6 +18,7 @@ function CodeBlock(props) {
18
18
  allowCopyToClipboard = false,
19
19
  allowWrapCodeBlock = false,
20
20
  codeBidiWarningTooltipEnabled,
21
+ hideLineNumbers = false,
21
22
  localId,
22
23
  wrap
23
24
  } = props;
@@ -41,6 +42,7 @@ function CodeBlock(props) {
41
42
  codeBidiWarningLabel: codeBidiWarningLabel,
42
43
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
43
44
  shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
45
+ shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
44
46
  hasBidiWarnings: expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true) ? false : undefined
45
47
  }));
46
48
  }
@@ -176,6 +176,7 @@ export const getLightWeightCodeBlockStylesForRootRendererStyleSheet = () => {
176
176
  const LightWeightCodeBlock = /*#__PURE__*/forwardRef(({
177
177
  text,
178
178
  codeBidiWarningTooltipEnabled = true,
179
+ hideLineNumbers = false,
179
180
  className
180
181
  }, ref) => {
181
182
  const textRows = useMemo(() => (text !== null && text !== void 0 ? text : '').split('\n'), [text]);
@@ -203,7 +204,7 @@ const LightWeightCodeBlock = /*#__PURE__*/forwardRef(({
203
204
  }, jsx("div", {
204
205
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
205
206
  className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
206
- }, jsx("div", {
207
+ }, !hideLineNumbers && jsx("div", {
207
208
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
208
209
  className: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
209
210
  }, textRows.map((_, index) =>
@@ -24,6 +24,7 @@ const WindowedCodeBlock = ({
24
24
  allowCopyToClipboard,
25
25
  allowWrapCodeBlock = false,
26
26
  codeBidiWarningTooltipEnabled,
27
+ hideLineNumbers = false,
27
28
  className: rootClassName,
28
29
  wrap
29
30
  }) => {
@@ -40,7 +41,8 @@ const WindowedCodeBlock = ({
40
41
  const memoizedLightWeightCodeBlock = jsx(MemoizedLightWeightCodeBlock, {
41
42
  ref: trackingRef,
42
43
  text: text,
43
- codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
44
+ codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
45
+ hideLineNumbers: expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers
44
46
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
45
47
  ,
46
48
  className: rootClassName
@@ -63,6 +65,7 @@ const WindowedCodeBlock = ({
63
65
  codeBidiWarningLabel: warningLabel,
64
66
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
65
67
  shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
68
+ shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
66
69
  hasBidiWarnings: expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true) ? false : undefined
67
70
  })))) : memoizedLightWeightCodeBlock;
68
71
  };
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
57
57
  const TABLE_INFO_TIMEOUT = 10000;
58
58
  const RENDER_EVENT_SAMPLE_RATE = 0.2;
59
59
  const packageName = "@atlaskit/renderer";
60
- const packageVersion = "130.5.1";
60
+ const packageVersion = "130.6.0";
61
61
  const setAsQueryContainerStyles = css({
62
62
  containerName: 'ak-renderer-wrapper',
63
63
  containerType: 'inline-size'
@@ -20,6 +20,8 @@ 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
+ _props$hideLineNumber = props.hideLineNumbers,
24
+ hideLineNumbers = _props$hideLineNumber === void 0 ? false : _props$hideLineNumber,
23
25
  localId = props.localId,
24
26
  wrap = props.wrap;
25
27
  var codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
@@ -47,6 +49,7 @@ function CodeBlock(props) {
47
49
  codeBidiWarningLabel: codeBidiWarningLabel,
48
50
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
49
51
  shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
52
+ shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
50
53
  hasBidiWarnings: expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true) ? false : undefined
51
54
  }));
52
55
  }
@@ -139,6 +139,8 @@ var LightWeightCodeBlock = /*#__PURE__*/forwardRef(function (_ref, ref) {
139
139
  var text = _ref.text,
140
140
  _ref$codeBidiWarningT = _ref.codeBidiWarningTooltipEnabled,
141
141
  codeBidiWarningTooltipEnabled = _ref$codeBidiWarningT === void 0 ? true : _ref$codeBidiWarningT,
142
+ _ref$hideLineNumbers = _ref.hideLineNumbers,
143
+ hideLineNumbers = _ref$hideLineNumbers === void 0 ? false : _ref$hideLineNumbers,
142
144
  className = _ref.className;
143
145
  var textRows = useMemo(function () {
144
146
  return (text !== null && text !== void 0 ? text : '').split('\n');
@@ -166,7 +168,7 @@ var LightWeightCodeBlock = /*#__PURE__*/forwardRef(function (_ref, ref) {
166
168
  }, jsx("div", {
167
169
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
168
170
  className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
169
- }, jsx("div", {
171
+ }, !hideLineNumbers && jsx("div", {
170
172
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
171
173
  className: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
172
174
  }, textRows.map(function (_, index) {
@@ -44,6 +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
+ _ref2$hideLineNumbers = _ref2.hideLineNumbers,
48
+ hideLineNumbers = _ref2$hideLineNumbers === void 0 ? false : _ref2$hideLineNumbers,
47
49
  rootClassName = _ref2.className,
48
50
  wrap = _ref2.wrap;
49
51
  var _useBidiWarnings = useBidiWarnings({
@@ -57,7 +59,8 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
57
59
  var memoizedLightWeightCodeBlock = jsx(MemoizedLightWeightCodeBlock, {
58
60
  ref: trackingRef,
59
61
  text: text,
60
- codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
62
+ codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
63
+ hideLineNumbers: expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers
61
64
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
62
65
  ,
63
66
  className: rootClassName
@@ -85,6 +88,7 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
85
88
  codeBidiWarningLabel: warningLabel,
86
89
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
87
90
  shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
91
+ shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
88
92
  hasBidiWarnings: expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true) ? false : undefined
89
93
  })))) : memoizedLightWeightCodeBlock;
90
94
  };
@@ -62,7 +62,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
62
62
  var TABLE_INFO_TIMEOUT = 10000;
63
63
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
64
64
  var packageName = "@atlaskit/renderer";
65
- var packageVersion = "130.5.1";
65
+ var packageVersion = "130.6.0";
66
66
  var setAsQueryContainerStyles = css({
67
67
  containerName: 'ak-renderer-wrapper',
68
68
  containerType: 'inline-size'
@@ -10,6 +10,7 @@ export interface Props {
10
10
  allowWrapCodeBlock?: boolean;
11
11
  className?: string;
12
12
  codeBidiWarningTooltipEnabled: boolean;
13
+ hideLineNumbers?: boolean;
13
14
  language: SupportedLanguages;
14
15
  localId?: string;
15
16
  text: string;
@@ -13,5 +13,5 @@ export declare const LightWeightCodeBlockCssClassName: {
13
13
  * @deprecated styles are moved to RendererStyleContainer
14
14
  */
15
15
  export declare const getLightWeightCodeBlockStylesForRootRendererStyleSheet: () => SerializedStyles;
16
- declare const LightWeightCodeBlock: React.ForwardRefExoticComponent<Pick<CodeBlockProps, 'text' | 'className' | 'codeBidiWarningTooltipEnabled'> & React.RefAttributes<HTMLDivElement>>;
16
+ declare const LightWeightCodeBlock: React.ForwardRefExoticComponent<Pick<CodeBlockProps, 'text' | 'className' | 'codeBidiWarningTooltipEnabled' | 'hideLineNumbers'> & React.RefAttributes<HTMLDivElement>>;
17
17
  export default LightWeightCodeBlock;
@@ -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, wrap, }: CodeBlockProps) => jsx.JSX.Element;
3
+ declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, allowWrapCodeBlock, codeBidiWarningTooltipEnabled, hideLineNumbers, className: rootClassName, wrap, }: CodeBlockProps) => jsx.JSX.Element;
4
4
  export default WindowedCodeBlock;
@@ -10,6 +10,7 @@ export interface Props {
10
10
  allowWrapCodeBlock?: boolean;
11
11
  className?: string;
12
12
  codeBidiWarningTooltipEnabled: boolean;
13
+ hideLineNumbers?: boolean;
13
14
  language: SupportedLanguages;
14
15
  localId?: string;
15
16
  text: string;
@@ -13,5 +13,5 @@ export declare const LightWeightCodeBlockCssClassName: {
13
13
  * @deprecated styles are moved to RendererStyleContainer
14
14
  */
15
15
  export declare const getLightWeightCodeBlockStylesForRootRendererStyleSheet: () => SerializedStyles;
16
- declare const LightWeightCodeBlock: React.ForwardRefExoticComponent<Pick<CodeBlockProps, 'text' | 'className' | 'codeBidiWarningTooltipEnabled'> & React.RefAttributes<HTMLDivElement>>;
16
+ declare const LightWeightCodeBlock: React.ForwardRefExoticComponent<Pick<CodeBlockProps, 'text' | 'className' | 'codeBidiWarningTooltipEnabled' | 'hideLineNumbers'> & React.RefAttributes<HTMLDivElement>>;
17
17
  export default LightWeightCodeBlock;
@@ -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, wrap, }: CodeBlockProps) => jsx.JSX.Element;
3
+ declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, allowWrapCodeBlock, codeBidiWarningTooltipEnabled, hideLineNumbers, 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.6.0",
3
+ "version": "130.6.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/status": "^4.1.0",
67
67
  "@atlaskit/task-decision": "^20.1.0",
68
68
  "@atlaskit/theme": "^23.2.0",
69
- "@atlaskit/tmp-editor-statsig": "^80.2.0",
69
+ "@atlaskit/tmp-editor-statsig": "^80.3.0",
70
70
  "@atlaskit/tokens": "^13.0.0",
71
71
  "@atlaskit/tooltip": "^22.2.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.30.0",
83
+ "@atlaskit/editor-common": "^114.32.0",
84
84
  "@atlaskit/link-provider": "^4.4.0",
85
85
  "@atlaskit/media-core": "^37.0.0",
86
86
  "react": "^18.2.0",