@atlaskit/renderer 82.0.0 → 82.1.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 +10 -0
- package/dist/cjs/react/marks/code.js +19 -4
- package/dist/cjs/react/nodes/codeBlock.js +14 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/marks/code.js +11 -3
- package/dist/es2019/react/nodes/codeBlock.js +10 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/marks/code.js +11 -3
- package/dist/esm/react/nodes/codeBlock.js +10 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/react/marks/code.d.ts +7 -1
- package/dist/types/renderer-context.d.ts +3 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 82.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`c80c71b537d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c80c71b537d) - [ux] ED-13860 add bidi warning decorations to code components
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 82.0.0
|
|
4
14
|
|
|
5
15
|
### Major Changes
|
|
@@ -5,16 +5,31 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.CodeWithIntl = CodeWithIntl;
|
|
9
|
+
exports.default = void 0;
|
|
9
10
|
|
|
10
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
12
|
|
|
12
13
|
var _react = _interopRequireDefault(require("react"));
|
|
13
14
|
|
|
15
|
+
var _reactIntl = require("react-intl");
|
|
16
|
+
|
|
14
17
|
var _inline = _interopRequireDefault(require("@atlaskit/code/inline"));
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
20
|
+
|
|
21
|
+
var _useFeatureFlags = require("../../use-feature-flags");
|
|
22
|
+
|
|
23
|
+
function CodeWithIntl(props) {
|
|
24
|
+
var featureFlags = (0, _useFeatureFlags.useFeatureFlags)();
|
|
25
|
+
var codeBidiWarningLabel = props.intl.formatMessage(_messages.codeBidiWarningMessages.label);
|
|
17
26
|
return /*#__PURE__*/_react.default.createElement(_inline.default, (0, _extends2.default)({
|
|
18
|
-
className: "code"
|
|
27
|
+
className: "code",
|
|
28
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
29
|
+
codeBidiWarningLabel: codeBidiWarningLabel
|
|
19
30
|
}, props.dataAttributes), props.children);
|
|
20
|
-
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var _default = (0, _reactIntl.injectIntl)(CodeWithIntl);
|
|
34
|
+
|
|
35
|
+
exports.default = _default;
|
|
@@ -11,6 +11,8 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
|
14
|
+
var _reactIntl = require("react-intl");
|
|
15
|
+
|
|
14
16
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
17
|
|
|
16
18
|
var _code = require("@atlaskit/code");
|
|
@@ -23,6 +25,10 @@ var _components = require("@atlaskit/theme/components");
|
|
|
23
25
|
|
|
24
26
|
var _constants = require("@atlaskit/theme/constants");
|
|
25
27
|
|
|
28
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
29
|
+
|
|
30
|
+
var _useFeatureFlags = require("../../use-feature-flags");
|
|
31
|
+
|
|
26
32
|
var _codeBlockCopyButton = _interopRequireDefault(require("./codeBlockCopyButton"));
|
|
27
33
|
|
|
28
34
|
var _templateObject;
|
|
@@ -32,6 +38,8 @@ function CodeBlock(props) {
|
|
|
32
38
|
language = props.language,
|
|
33
39
|
_props$allowCopyToCli = props.allowCopyToClipboard,
|
|
34
40
|
allowCopyToClipboard = _props$allowCopyToCli === void 0 ? false : _props$allowCopyToCli;
|
|
41
|
+
var featureFlags = (0, _useFeatureFlags.useFeatureFlags)();
|
|
42
|
+
var codeBidiWarningLabel = props.intl.formatMessage(_messages.codeBidiWarningMessages.label);
|
|
35
43
|
var className = ['code-block', props.className].join(' ');
|
|
36
44
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
45
|
className: className
|
|
@@ -39,11 +47,15 @@ function CodeBlock(props) {
|
|
|
39
47
|
content: text
|
|
40
48
|
}) : null, /*#__PURE__*/_react.default.createElement(_code.CodeBlock, {
|
|
41
49
|
language: language,
|
|
42
|
-
text: text
|
|
50
|
+
text: text,
|
|
51
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
52
|
+
codeBidiWarningLabel: codeBidiWarningLabel
|
|
43
53
|
}));
|
|
44
54
|
}
|
|
45
55
|
|
|
46
|
-
var
|
|
56
|
+
var IntlCodeBlock = (0, _reactIntl.injectIntl)(CodeBlock);
|
|
57
|
+
|
|
58
|
+
var _default = (0, _styledComponents.default)(IntlCodeBlock)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _editorSharedStyles.overflowShadow)({
|
|
47
59
|
background: (0, _components.themed)({
|
|
48
60
|
light: _colors.N20,
|
|
49
61
|
dark: _colors.DN50
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { injectIntl } from 'react-intl';
|
|
3
4
|
import AkCode from '@atlaskit/code/inline';
|
|
4
|
-
|
|
5
|
+
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { useFeatureFlags } from '../../use-feature-flags';
|
|
7
|
+
export function CodeWithIntl(props) {
|
|
8
|
+
const featureFlags = useFeatureFlags();
|
|
9
|
+
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
5
10
|
return /*#__PURE__*/React.createElement(AkCode, _extends({
|
|
6
|
-
className: "code"
|
|
11
|
+
className: "code",
|
|
12
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
13
|
+
codeBidiWarningLabel: codeBidiWarningLabel
|
|
7
14
|
}, props.dataAttributes), props.children);
|
|
8
|
-
}
|
|
15
|
+
}
|
|
16
|
+
export default injectIntl(CodeWithIntl);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { injectIntl } from 'react-intl';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
4
5
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
6
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
6
7
|
import { themed } from '@atlaskit/theme/components';
|
|
7
8
|
import { fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
9
|
+
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
10
|
+
import { useFeatureFlags } from '../../use-feature-flags';
|
|
8
11
|
import CopyButton from './codeBlockCopyButton';
|
|
9
12
|
|
|
10
13
|
function CodeBlock(props) {
|
|
@@ -13,6 +16,8 @@ function CodeBlock(props) {
|
|
|
13
16
|
language,
|
|
14
17
|
allowCopyToClipboard = false
|
|
15
18
|
} = props;
|
|
19
|
+
const featureFlags = useFeatureFlags();
|
|
20
|
+
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
16
21
|
const className = ['code-block', props.className].join(' ');
|
|
17
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
23
|
className: className
|
|
@@ -20,11 +25,14 @@ function CodeBlock(props) {
|
|
|
20
25
|
content: text
|
|
21
26
|
}) : null, /*#__PURE__*/React.createElement(AkCodeBlock, {
|
|
22
27
|
language: language,
|
|
23
|
-
text: text
|
|
28
|
+
text: text,
|
|
29
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
30
|
+
codeBidiWarningLabel: codeBidiWarningLabel
|
|
24
31
|
}));
|
|
25
32
|
}
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
const IntlCodeBlock = injectIntl(CodeBlock);
|
|
35
|
+
export default styled(IntlCodeBlock)`
|
|
28
36
|
tab-size: 4;
|
|
29
37
|
[data-ds--code--code-block] {
|
|
30
38
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { injectIntl } from 'react-intl';
|
|
3
4
|
import AkCode from '@atlaskit/code/inline';
|
|
4
|
-
|
|
5
|
+
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { useFeatureFlags } from '../../use-feature-flags';
|
|
7
|
+
export function CodeWithIntl(props) {
|
|
8
|
+
var featureFlags = useFeatureFlags();
|
|
9
|
+
var codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
5
10
|
return /*#__PURE__*/React.createElement(AkCode, _extends({
|
|
6
|
-
className: "code"
|
|
11
|
+
className: "code",
|
|
12
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
13
|
+
codeBidiWarningLabel: codeBidiWarningLabel
|
|
7
14
|
}, props.dataAttributes), props.children);
|
|
8
|
-
}
|
|
15
|
+
}
|
|
16
|
+
export default injectIntl(CodeWithIntl);
|
|
@@ -3,12 +3,15 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { injectIntl } from 'react-intl';
|
|
6
7
|
import styled from 'styled-components';
|
|
7
8
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
8
9
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
10
11
|
import { themed } from '@atlaskit/theme/components';
|
|
11
12
|
import { fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
13
|
+
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
14
|
+
import { useFeatureFlags } from '../../use-feature-flags';
|
|
12
15
|
import CopyButton from './codeBlockCopyButton';
|
|
13
16
|
|
|
14
17
|
function CodeBlock(props) {
|
|
@@ -16,6 +19,8 @@ function CodeBlock(props) {
|
|
|
16
19
|
language = props.language,
|
|
17
20
|
_props$allowCopyToCli = props.allowCopyToClipboard,
|
|
18
21
|
allowCopyToClipboard = _props$allowCopyToCli === void 0 ? false : _props$allowCopyToCli;
|
|
22
|
+
var featureFlags = useFeatureFlags();
|
|
23
|
+
var codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
19
24
|
var className = ['code-block', props.className].join(' ');
|
|
20
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
26
|
className: className
|
|
@@ -23,11 +28,14 @@ function CodeBlock(props) {
|
|
|
23
28
|
content: text
|
|
24
29
|
}) : null, /*#__PURE__*/React.createElement(AkCodeBlock, {
|
|
25
30
|
language: language,
|
|
26
|
-
text: text
|
|
31
|
+
text: text,
|
|
32
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
33
|
+
codeBidiWarningLabel: codeBidiWarningLabel
|
|
27
34
|
}));
|
|
28
35
|
}
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
var IntlCodeBlock = injectIntl(CodeBlock);
|
|
38
|
+
export default styled(IntlCodeBlock)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n }\n"])), relativeFontSizeToBase16(fontSize()), overflowShadow({
|
|
31
39
|
background: themed({
|
|
32
40
|
light: N20,
|
|
33
41
|
dark: DN50
|
package/dist/esm/version.json
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InjectedIntlProps } from 'react-intl';
|
|
1
3
|
import type { MarkProps } from '../types';
|
|
2
|
-
export
|
|
4
|
+
export declare function CodeWithIntl(props: MarkProps & InjectedIntlProps): JSX.Element;
|
|
5
|
+
declare const _default: React.ComponentClass<import("../types").MarkMeta, any> & {
|
|
6
|
+
WrappedComponent: ReactIntl.ComponentConstructor<import("../types").MarkMeta & InjectedIntlProps>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "82.
|
|
3
|
+
"version": "82.1.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^6.3.0",
|
|
31
31
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
32
32
|
"@atlaskit/button": "^16.1.0",
|
|
33
|
-
"@atlaskit/code": "^14.
|
|
34
|
-
"@atlaskit/editor-common": "^60.
|
|
33
|
+
"@atlaskit/code": "^14.2.0",
|
|
34
|
+
"@atlaskit/editor-common": "^60.3.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.6.0",
|
|
36
36
|
"@atlaskit/editor-shared-styles": "^1.6.0",
|
|
37
37
|
"@atlaskit/icon": "^21.9.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@atlaskit/build-utils": "^2.6.2",
|
|
70
70
|
"@atlaskit/css-reset": "^6.2.0",
|
|
71
71
|
"@atlaskit/docs": "*",
|
|
72
|
-
"@atlaskit/editor-core": "^151.
|
|
72
|
+
"@atlaskit/editor-core": "^151.1.0",
|
|
73
73
|
"@atlaskit/editor-test-helpers": "^15.5.0",
|
|
74
74
|
"@atlaskit/field-range": "^9.0.0",
|
|
75
75
|
"@atlaskit/logo": "^13.5.0",
|