@atlaskit/renderer 136.0.7 → 136.1.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 +27 -0
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +1 -4
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -8
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +1 -8
- package/dist/cjs/react/nodes/index.js +3 -2
- package/dist/cjs/react/nodes/nodes.js +104 -0
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +1 -4
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -8
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +1 -9
- package/dist/es2019/react/nodes/index.js +3 -1
- package/dist/es2019/react/nodes/nodes.js +97 -0
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +1 -4
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -8
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +1 -8
- package/dist/esm/react/nodes/index.js +3 -1
- package/dist/esm/react/nodes/nodes.js +97 -0
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
- package/dist/types/react/nodes/nodes.d.ts +4 -0
- package/package.json +3 -3
- package/dist/cjs/react/hooks/use-bidi-warnings.js +0 -38
- package/dist/es2019/react/hooks/use-bidi-warnings.js +0 -30
- package/dist/esm/react/hooks/use-bidi-warnings.js +0 -31
- package/dist/types/react/hooks/use-bidi-warnings.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 136.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1eb42bae392d7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1eb42bae392d7) -
|
|
8
|
+
Clean up experiment `platform_editor_remove_bidi_char_warning`. Bidirectional character warnings
|
|
9
|
+
are no longer rendered in code blocks: `codeBidiWarningPlugin` is no longer registered by any
|
|
10
|
+
preset, and the renderer passes `hasBidiWarnings={false}` to `@atlaskit/code` code blocks. Bidi
|
|
11
|
+
warnings on inline `code` marks are unaffected.
|
|
12
|
+
|
|
13
|
+
`codeBidiWarning` has been removed from the plugin lists and plugin options of the Confluence
|
|
14
|
+
full-page, Confluence markdown, and Company Hub presets, so consumers no longer need to pass
|
|
15
|
+
`pluginOptions.codeBidiWarning` or `enabledOptionalPlugins.codeBidiWarning`.
|
|
16
|
+
|
|
17
|
+
`@atlaskit/editor-plugin-code-bidi-warning` is retained but now has no consumers; it is scheduled
|
|
18
|
+
for removal in a follow-up.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 136.1.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- [`94ab527fc5fbf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/94ab527fc5fbf) -
|
|
27
|
+
Remove lazy-loaded nodes from the renderer. All nodes are now imported synchronously and will not
|
|
28
|
+
be affected by preloading if your app uses it.
|
|
29
|
+
|
|
3
30
|
## 136.0.7
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ var _react2 = require("@emotion/react");
|
|
|
11
11
|
var _reactIntl = require("react-intl");
|
|
12
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
13
|
var _code = require("@atlaskit/code");
|
|
14
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _codeBlockContainer = _interopRequireDefault(require("./components/codeBlockContainer"));
|
|
17
16
|
/**
|
|
@@ -35,7 +34,6 @@ function CodeBlock(props) {
|
|
|
35
34
|
hideLineNumbers = _props$hideLineNumber === void 0 ? false : _props$hideLineNumber,
|
|
36
35
|
localId = props.localId,
|
|
37
36
|
wrap = props.wrap;
|
|
38
|
-
var codeBidiWarningLabel = props.intl.formatMessage(_messages.codeBidiWarningMessages.label);
|
|
39
37
|
var className = [_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, props.className].join(' ');
|
|
40
38
|
var _useState = (0, _react.useState)(function () {
|
|
41
39
|
return (0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap);
|
|
@@ -59,11 +57,10 @@ function CodeBlock(props) {
|
|
|
59
57
|
testId: "renderer-code-block",
|
|
60
58
|
language: language,
|
|
61
59
|
text: text,
|
|
62
|
-
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
63
60
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
64
61
|
shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
|
|
65
62
|
shouldShowLineNumbers: !((0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
|
|
66
|
-
hasBidiWarnings:
|
|
63
|
+
hasBidiWarnings: false
|
|
67
64
|
}));
|
|
68
65
|
}
|
|
69
66
|
var _default_1 = (0, _reactIntl.injectIntl)(CodeBlock);
|
|
@@ -12,7 +12,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
15
|
-
var _useBidiWarnings2 = require("../../../hooks/use-bidi-warnings");
|
|
16
15
|
var _consts = require("../../../../consts");
|
|
17
16
|
var _templateObject;
|
|
18
17
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
@@ -146,18 +145,12 @@ var getLightWeightCodeBlockStylesForRootRendererStyleSheet = exports.getLightWei
|
|
|
146
145
|
};
|
|
147
146
|
var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
148
147
|
var text = _ref.text,
|
|
149
|
-
_ref$codeBidiWarningT = _ref.codeBidiWarningTooltipEnabled,
|
|
150
|
-
codeBidiWarningTooltipEnabled = _ref$codeBidiWarningT === void 0 ? true : _ref$codeBidiWarningT,
|
|
151
148
|
_ref$hideLineNumbers = _ref.hideLineNumbers,
|
|
152
149
|
hideLineNumbers = _ref$hideLineNumbers === void 0 ? false : _ref$hideLineNumbers,
|
|
153
150
|
className = _ref.className;
|
|
154
151
|
var textRows = (0, _react.useMemo)(function () {
|
|
155
152
|
return (text !== null && text !== void 0 ? text : '').split('\n');
|
|
156
153
|
}, [text]);
|
|
157
|
-
var _useBidiWarnings = (0, _useBidiWarnings2.useBidiWarnings)({
|
|
158
|
-
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
159
|
-
}),
|
|
160
|
-
renderBidiWarnings = _useBidiWarnings.renderBidiWarnings;
|
|
161
154
|
var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
162
155
|
var codeBlockBackgroundImage = (0, _editorSharedStyles.overflowShadow)({
|
|
163
156
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
@@ -190,6 +183,6 @@ var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
190
183
|
);
|
|
191
184
|
})), (0, _react2.jsx)("div", {
|
|
192
185
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
193
|
-
}, (0, _react2.jsx)("code", null,
|
|
186
|
+
}, (0, _react2.jsx)("code", null, text)))));
|
|
194
187
|
});
|
|
195
188
|
var _default = exports.default = LightWeightCodeBlock;
|
|
@@ -14,7 +14,6 @@ var _react2 = require("@emotion/react");
|
|
|
14
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
15
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
16
|
var _useInViewport2 = require("../../hooks/use-in-viewport");
|
|
17
|
-
var _useBidiWarnings2 = require("../../hooks/use-bidi-warnings");
|
|
18
17
|
var _lightWeightCodeBlock = _interopRequireDefault(require("./components/lightWeightCodeBlock"));
|
|
19
18
|
var _codeBlockContainer = _interopRequireDefault(require("./components/codeBlockContainer"));
|
|
20
19
|
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); } /**
|
|
@@ -58,10 +57,6 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
58
57
|
hideLineNumbers = _ref2$hideLineNumbers === void 0 ? false : _ref2$hideLineNumbers,
|
|
59
58
|
rootClassName = _ref2.className,
|
|
60
59
|
wrap = _ref2.wrap;
|
|
61
|
-
var _useBidiWarnings = (0, _useBidiWarnings2.useBidiWarnings)({
|
|
62
|
-
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
63
|
-
}),
|
|
64
|
-
warningLabel = _useBidiWarnings.warningLabel;
|
|
65
60
|
var _useInViewport = (0, _useInViewport2.useInViewport)(),
|
|
66
61
|
isInViewport = _useInViewport.isInViewport,
|
|
67
62
|
trackingRef = _useInViewport.trackingRef;
|
|
@@ -69,7 +64,6 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
69
64
|
var memoizedLightWeightCodeBlock = (0, _react2.jsx)(MemoizedLightWeightCodeBlock, {
|
|
70
65
|
ref: trackingRef,
|
|
71
66
|
text: text,
|
|
72
|
-
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
73
67
|
hideLineNumbers: (0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers
|
|
74
68
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
75
69
|
,
|
|
@@ -97,11 +91,10 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
97
91
|
}, (0, _react2.jsx)(LazyAkCodeBlock, {
|
|
98
92
|
language: language,
|
|
99
93
|
text: text,
|
|
100
|
-
codeBidiWarningLabel: warningLabel,
|
|
101
94
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
102
95
|
shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
|
|
103
96
|
shouldShowLineNumbers: !((0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
|
|
104
|
-
hasBidiWarnings:
|
|
97
|
+
hasBidiWarnings: false
|
|
105
98
|
})))) : memoizedLightWeightCodeBlock;
|
|
106
99
|
};
|
|
107
100
|
var _default = exports.default = WindowedCodeBlock;
|
|
@@ -179,12 +179,13 @@ var _table = _interopRequireDefault(require("./table"));
|
|
|
179
179
|
var _tableCell = require("./tableCell");
|
|
180
180
|
var _tableRow = _interopRequireDefault(require("./tableRow"));
|
|
181
181
|
var _unknownBlock = _interopRequireDefault(require("./unknownBlock"));
|
|
182
|
+
var _nodes = require("./nodes");
|
|
183
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
182
184
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
183
185
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
184
186
|
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" != (0, _typeof2.default)(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); } /* eslint-disable @atlaskit/editor/no-re-export */ // Mapping file
|
|
185
187
|
// Ignored via go/ees005
|
|
186
188
|
// eslint-disable-next-line import/no-named-as-default
|
|
187
|
-
|
|
188
189
|
var WindowedCodeBlock = exports.WindowedCodeBlock = (0, _reactLoadable.default)({
|
|
189
190
|
loader: function loader() {
|
|
190
191
|
return Promise.resolve().then(function () {
|
|
@@ -515,7 +516,7 @@ var toReact = exports.toReact = function toReact(node, flags, nodeComponents
|
|
|
515
516
|
}
|
|
516
517
|
|
|
517
518
|
// Allowing custom components to override those provided in nodeToReact
|
|
518
|
-
var nodes = _objectSpread(_objectSpread({}, nodeToReact), nodeComponents);
|
|
519
|
+
var nodes = _objectSpread(_objectSpread({}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_remove_react-loadable_renderer') ? _nodes.nodeToReact : nodeToReact), nodeComponents);
|
|
519
520
|
if (node.type.name === 'codeBlock') {
|
|
520
521
|
var _nodes$codeBlock;
|
|
521
522
|
if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.nodeToReact = void 0;
|
|
8
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
9
|
+
var _Expand = _interopRequireDefault(require("../../ui/Expand"));
|
|
10
|
+
var _blockCard = _interopRequireDefault(require("./blockCard"));
|
|
11
|
+
var _blockquote = _interopRequireDefault(require("./blockquote"));
|
|
12
|
+
var _bodiedExtension = _interopRequireDefault(require("./bodiedExtension"));
|
|
13
|
+
var _bodiedSyncBlock = _interopRequireDefault(require("./bodiedSyncBlock"));
|
|
14
|
+
var _bulletList = _interopRequireDefault(require("./bulletList"));
|
|
15
|
+
var _caption = _interopRequireDefault(require("./caption"));
|
|
16
|
+
var _codeBlock = _interopRequireDefault(require("./codeBlock/codeBlock"));
|
|
17
|
+
var _windowedCodeBlock = _interopRequireDefault(require("./codeBlock/windowedCodeBlock"));
|
|
18
|
+
var _date = _interopRequireDefault(require("./date"));
|
|
19
|
+
var _decisionItem = _interopRequireDefault(require("./decisionItem"));
|
|
20
|
+
var _decisionList = _interopRequireDefault(require("./decisionList"));
|
|
21
|
+
var _doc = _interopRequireDefault(require("./doc"));
|
|
22
|
+
var _embedCard = _interopRequireDefault(require("./embedCard"));
|
|
23
|
+
var _emoji = _interopRequireDefault(require("./emoji"));
|
|
24
|
+
var _extension = _interopRequireDefault(require("./extension"));
|
|
25
|
+
var _extensionFrame = _interopRequireDefault(require("./extensionFrame"));
|
|
26
|
+
var _hardBreak = _interopRequireDefault(require("./hardBreak"));
|
|
27
|
+
var _heading = _interopRequireDefault(require("./heading"));
|
|
28
|
+
var _inlineCard = _interopRequireDefault(require("./inlineCard"));
|
|
29
|
+
var _inlineExtension = _interopRequireDefault(require("./inlineExtension"));
|
|
30
|
+
var _layoutColumn = _interopRequireDefault(require("./layoutColumn"));
|
|
31
|
+
var _layoutSection = _interopRequireDefault(require("./layoutSection"));
|
|
32
|
+
var _listItem = _interopRequireDefault(require("./listItem"));
|
|
33
|
+
var _media = _interopRequireDefault(require("./media"));
|
|
34
|
+
var _mediaGroup = _interopRequireDefault(require("./mediaGroup"));
|
|
35
|
+
var _mediaInline = _interopRequireDefault(require("./mediaInline"));
|
|
36
|
+
var _mediaSingle = _interopRequireDefault(require("./mediaSingle"));
|
|
37
|
+
var _mention = _interopRequireDefault(require("./mention"));
|
|
38
|
+
var _multiBodiedExtension = _interopRequireDefault(require("./multiBodiedExtension"));
|
|
39
|
+
var _orderedList = _interopRequireDefault(require("./orderedList"));
|
|
40
|
+
var _panel = _interopRequireDefault(require("./panel"));
|
|
41
|
+
var _paragraph = _interopRequireDefault(require("./paragraph"));
|
|
42
|
+
var _placeholder = _interopRequireDefault(require("./placeholder"));
|
|
43
|
+
var _rule = _interopRequireDefault(require("./rule"));
|
|
44
|
+
var _status = _interopRequireDefault(require("./status"));
|
|
45
|
+
var _syncBlock = _interopRequireDefault(require("./syncBlock"));
|
|
46
|
+
var _table = _interopRequireDefault(require("./table"));
|
|
47
|
+
var _tableCell = require("./tableCell");
|
|
48
|
+
var _tableRow = _interopRequireDefault(require("./tableRow"));
|
|
49
|
+
var _taskItem = _interopRequireDefault(require("./taskItem"));
|
|
50
|
+
var _taskList = _interopRequireDefault(require("./taskList"));
|
|
51
|
+
var _unknownBlock = _interopRequireDefault(require("./unknownBlock"));
|
|
52
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
53
|
+
|
|
54
|
+
var nodeToReact = exports.nodeToReact = {
|
|
55
|
+
blockCard: _blockCard.default,
|
|
56
|
+
blockquote: _blockquote.default,
|
|
57
|
+
blockTaskItem: _taskItem.default,
|
|
58
|
+
bodiedExtension: _bodiedExtension.default,
|
|
59
|
+
bodiedSyncBlock: _bodiedSyncBlock.default,
|
|
60
|
+
bulletList: _bulletList.default,
|
|
61
|
+
caption: _caption.default,
|
|
62
|
+
codeBlock: _codeBlock.default,
|
|
63
|
+
date: _date.default,
|
|
64
|
+
decisionItem: _decisionItem.default,
|
|
65
|
+
decisionList: _decisionList.default,
|
|
66
|
+
doc: _doc.default,
|
|
67
|
+
embedCard: _embedCard.default,
|
|
68
|
+
emoji: _emoji.default,
|
|
69
|
+
expand: _Expand.default,
|
|
70
|
+
extension: _extension.default,
|
|
71
|
+
extensionFrame: _extensionFrame.default,
|
|
72
|
+
hardBreak: _hardBreak.default,
|
|
73
|
+
heading: _heading.default,
|
|
74
|
+
inlineCard: _inlineCard.default,
|
|
75
|
+
inlineExtension: _inlineExtension.default,
|
|
76
|
+
layoutColumn: _layoutColumn.default,
|
|
77
|
+
layoutSection: _layoutSection.default,
|
|
78
|
+
listItem: _listItem.default,
|
|
79
|
+
media: _media.default,
|
|
80
|
+
mediaGroup: _mediaGroup.default,
|
|
81
|
+
mediaInline: _mediaInline.default,
|
|
82
|
+
mediaSingle: _mediaSingle.default,
|
|
83
|
+
mention: _mention.default,
|
|
84
|
+
multiBodiedExtension: _multiBodiedExtension.default,
|
|
85
|
+
nestedExpand: _Expand.default,
|
|
86
|
+
orderedList: _orderedList.default,
|
|
87
|
+
panel: _panel.default,
|
|
88
|
+
panel_c1: _panel.default,
|
|
89
|
+
paragraph: _paragraph.default,
|
|
90
|
+
placeholder: _placeholder.default,
|
|
91
|
+
rule: _rule.default,
|
|
92
|
+
status: _status.default,
|
|
93
|
+
syncBlock: _syncBlock.default,
|
|
94
|
+
table: _table.default,
|
|
95
|
+
tableCell: _tableCell.TableCell,
|
|
96
|
+
tableHeader: _tableCell.TableHeader,
|
|
97
|
+
tableRow: _tableRow.default,
|
|
98
|
+
taskItem: _taskItem.default,
|
|
99
|
+
taskList: _taskList.default,
|
|
100
|
+
unknownBlock: _unknownBlock.default,
|
|
101
|
+
unsupportedBlock: _ui.UnsupportedBlock,
|
|
102
|
+
unsupportedInline: _ui.UnsupportedInline,
|
|
103
|
+
windowedCodeBlock: _windowedCodeBlock.default
|
|
104
|
+
};
|
|
@@ -73,7 +73,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
73
73
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
74
74
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
75
75
|
var packageName = "@atlaskit/renderer";
|
|
76
|
-
var packageVersion = "136.0
|
|
76
|
+
var packageVersion = "136.1.0";
|
|
77
77
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
78
78
|
containerName: 'ak-renderer-wrapper',
|
|
79
79
|
containerType: 'inline-size'
|
|
@@ -8,7 +8,6 @@ import { jsx } from '@emotion/react';
|
|
|
8
8
|
import { injectIntl } from 'react-intl';
|
|
9
9
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
10
10
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
11
|
-
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
12
11
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
12
|
import CodeBlockContainer from './components/codeBlockContainer';
|
|
14
13
|
function CodeBlock(props) {
|
|
@@ -23,7 +22,6 @@ function CodeBlock(props) {
|
|
|
23
22
|
localId,
|
|
24
23
|
wrap
|
|
25
24
|
} = props;
|
|
26
|
-
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
27
25
|
const className = [CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, props.className].join(' ');
|
|
28
26
|
const [wrapLongLines, setWrapLongLines] = useState(() => expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap));
|
|
29
27
|
return jsx(CodeBlockContainer, {
|
|
@@ -42,11 +40,10 @@ function CodeBlock(props) {
|
|
|
42
40
|
testId: "renderer-code-block",
|
|
43
41
|
language: language,
|
|
44
42
|
text: text,
|
|
45
|
-
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
46
43
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
47
44
|
shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
|
|
48
45
|
shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
|
|
49
|
-
hasBidiWarnings:
|
|
46
|
+
hasBidiWarnings: false
|
|
50
47
|
}));
|
|
51
48
|
}
|
|
52
49
|
const _default_1 = injectIntl(CodeBlock);
|
|
@@ -10,7 +10,6 @@ import React, { forwardRef, useMemo } from 'react';
|
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
12
12
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
13
|
-
import { useBidiWarnings } from '../../../hooks/use-bidi-warnings';
|
|
14
13
|
import { RendererCssClassName } from '../../../../consts';
|
|
15
14
|
const codeBlockSharedStyles = css({
|
|
16
15
|
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED}
|
|
@@ -175,16 +174,10 @@ export const getLightWeightCodeBlockStylesForRootRendererStyleSheet = () => {
|
|
|
175
174
|
};
|
|
176
175
|
const LightWeightCodeBlock = /*#__PURE__*/forwardRef(({
|
|
177
176
|
text,
|
|
178
|
-
codeBidiWarningTooltipEnabled = true,
|
|
179
177
|
hideLineNumbers = false,
|
|
180
178
|
className
|
|
181
179
|
}, ref) => {
|
|
182
180
|
const textRows = useMemo(() => (text !== null && text !== void 0 ? text : '').split('\n'), [text]);
|
|
183
|
-
const {
|
|
184
|
-
renderBidiWarnings
|
|
185
|
-
} = useBidiWarnings({
|
|
186
|
-
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
187
|
-
});
|
|
188
181
|
const classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
189
182
|
const codeBlockBackgroundImage = overflowShadow({
|
|
190
183
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
@@ -214,6 +207,6 @@ const LightWeightCodeBlock = /*#__PURE__*/forwardRef(({
|
|
|
214
207
|
key: index
|
|
215
208
|
}))), jsx("div", {
|
|
216
209
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
217
|
-
}, jsx("code", null,
|
|
210
|
+
}, jsx("code", null, text)))));
|
|
218
211
|
});
|
|
219
212
|
export default LightWeightCodeBlock;
|
|
@@ -8,7 +8,6 @@ import { jsx } from '@emotion/react';
|
|
|
8
8
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
10
|
import { useInViewport } from '../../hooks/use-in-viewport';
|
|
11
|
-
import { useBidiWarnings } from '../../hooks/use-bidi-warnings';
|
|
12
11
|
import LightWeightCodeBlock from './components/lightWeightCodeBlock';
|
|
13
12
|
import CodeBlockContainer from './components/codeBlockContainer';
|
|
14
13
|
const LazyAkCodeBlock = /*#__PURE__*/lazy(
|
|
@@ -29,11 +28,6 @@ const WindowedCodeBlock = ({
|
|
|
29
28
|
className: rootClassName,
|
|
30
29
|
wrap
|
|
31
30
|
}) => {
|
|
32
|
-
const {
|
|
33
|
-
warningLabel
|
|
34
|
-
} = useBidiWarnings({
|
|
35
|
-
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
36
|
-
});
|
|
37
31
|
const {
|
|
38
32
|
isInViewport,
|
|
39
33
|
trackingRef
|
|
@@ -42,7 +36,6 @@ const WindowedCodeBlock = ({
|
|
|
42
36
|
const memoizedLightWeightCodeBlock = jsx(MemoizedLightWeightCodeBlock, {
|
|
43
37
|
ref: trackingRef,
|
|
44
38
|
text: text,
|
|
45
|
-
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
46
39
|
hideLineNumbers: expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers
|
|
47
40
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
48
41
|
,
|
|
@@ -65,11 +58,10 @@ const WindowedCodeBlock = ({
|
|
|
65
58
|
}, jsx(LazyAkCodeBlock, {
|
|
66
59
|
language: language,
|
|
67
60
|
text: text,
|
|
68
|
-
codeBidiWarningLabel: warningLabel,
|
|
69
61
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
70
62
|
shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
|
|
71
63
|
shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
|
|
72
|
-
hasBidiWarnings:
|
|
64
|
+
hasBidiWarnings: false
|
|
73
65
|
})))) : memoizedLightWeightCodeBlock;
|
|
74
66
|
};
|
|
75
67
|
export default WindowedCodeBlock;
|
|
@@ -29,6 +29,8 @@ import UnknownBlock from './unknownBlock';
|
|
|
29
29
|
// Ignored via go/ees005
|
|
30
30
|
// eslint-disable-next-line import/no-named-as-default
|
|
31
31
|
|
|
32
|
+
import { nodeToReact as nodeToReactNew } from './nodes';
|
|
33
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
32
34
|
const WindowedCodeBlock = Loadable({
|
|
33
35
|
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_WindowedCodeBlock" */
|
|
34
36
|
'./codeBlock/windowedCodeBlock').then(mod => mod.default),
|
|
@@ -192,7 +194,7 @@ export const toReact = (node, flags, nodeComponents
|
|
|
192
194
|
|
|
193
195
|
// Allowing custom components to override those provided in nodeToReact
|
|
194
196
|
const nodes = {
|
|
195
|
-
...nodeToReact,
|
|
197
|
+
...(isExperimentEnabled('platform_editor_remove_react-loadable_renderer') ? nodeToReactNew : nodeToReact),
|
|
196
198
|
...nodeComponents
|
|
197
199
|
};
|
|
198
200
|
if (node.type.name === 'codeBlock') {
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
|
+
|
|
3
|
+
import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
4
|
+
import Expand from '../../ui/Expand';
|
|
5
|
+
import BlockCard from './blockCard';
|
|
6
|
+
import Blockquote from './blockquote';
|
|
7
|
+
import BodiedExtension from './bodiedExtension';
|
|
8
|
+
import BodiedSyncBlock from './bodiedSyncBlock';
|
|
9
|
+
import BulletList from './bulletList';
|
|
10
|
+
import Caption from './caption';
|
|
11
|
+
import CodeBlock from './codeBlock/codeBlock';
|
|
12
|
+
import WindowedCodeBlock from './codeBlock/windowedCodeBlock';
|
|
13
|
+
import DateNode from './date';
|
|
14
|
+
import DecisionItem from './decisionItem';
|
|
15
|
+
import DecisionList from './decisionList';
|
|
16
|
+
import Doc from './doc';
|
|
17
|
+
import EmbedCard from './embedCard';
|
|
18
|
+
import Emoji from './emoji';
|
|
19
|
+
import Extension from './extension';
|
|
20
|
+
import ExtensionFrame from './extensionFrame';
|
|
21
|
+
import HardBreak from './hardBreak';
|
|
22
|
+
import Heading from './heading';
|
|
23
|
+
import InlineCard from './inlineCard';
|
|
24
|
+
import InlineExtension from './inlineExtension';
|
|
25
|
+
import LayoutColumn from './layoutColumn';
|
|
26
|
+
import LayoutSection from './layoutSection';
|
|
27
|
+
import ListItem from './listItem';
|
|
28
|
+
import Media from './media';
|
|
29
|
+
import MediaGroup from './mediaGroup';
|
|
30
|
+
import MediaInline from './mediaInline';
|
|
31
|
+
import MediaSingle from './mediaSingle';
|
|
32
|
+
import Mention from './mention';
|
|
33
|
+
import MultiBodiedExtension from './multiBodiedExtension';
|
|
34
|
+
import OrderedList from './orderedList';
|
|
35
|
+
import Panel from './panel';
|
|
36
|
+
import Paragraph from './paragraph';
|
|
37
|
+
import Placeholder from './placeholder';
|
|
38
|
+
import Rule from './rule';
|
|
39
|
+
import Status from './status';
|
|
40
|
+
import SyncBlock from './syncBlock';
|
|
41
|
+
import Table from './table';
|
|
42
|
+
import { TableCell, TableHeader } from './tableCell';
|
|
43
|
+
import TableRow from './tableRow';
|
|
44
|
+
import TaskItem from './taskItem';
|
|
45
|
+
import TaskList from './taskList';
|
|
46
|
+
import UnknownBlock from './unknownBlock';
|
|
47
|
+
export const nodeToReact = {
|
|
48
|
+
blockCard: BlockCard,
|
|
49
|
+
blockquote: Blockquote,
|
|
50
|
+
blockTaskItem: TaskItem,
|
|
51
|
+
bodiedExtension: BodiedExtension,
|
|
52
|
+
bodiedSyncBlock: BodiedSyncBlock,
|
|
53
|
+
bulletList: BulletList,
|
|
54
|
+
caption: Caption,
|
|
55
|
+
codeBlock: CodeBlock,
|
|
56
|
+
date: DateNode,
|
|
57
|
+
decisionItem: DecisionItem,
|
|
58
|
+
decisionList: DecisionList,
|
|
59
|
+
doc: Doc,
|
|
60
|
+
embedCard: EmbedCard,
|
|
61
|
+
emoji: Emoji,
|
|
62
|
+
expand: Expand,
|
|
63
|
+
extension: Extension,
|
|
64
|
+
extensionFrame: ExtensionFrame,
|
|
65
|
+
hardBreak: HardBreak,
|
|
66
|
+
heading: Heading,
|
|
67
|
+
inlineCard: InlineCard,
|
|
68
|
+
inlineExtension: InlineExtension,
|
|
69
|
+
layoutColumn: LayoutColumn,
|
|
70
|
+
layoutSection: LayoutSection,
|
|
71
|
+
listItem: ListItem,
|
|
72
|
+
media: Media,
|
|
73
|
+
mediaGroup: MediaGroup,
|
|
74
|
+
mediaInline: MediaInline,
|
|
75
|
+
mediaSingle: MediaSingle,
|
|
76
|
+
mention: Mention,
|
|
77
|
+
multiBodiedExtension: MultiBodiedExtension,
|
|
78
|
+
nestedExpand: Expand,
|
|
79
|
+
orderedList: OrderedList,
|
|
80
|
+
panel: Panel,
|
|
81
|
+
panel_c1: Panel,
|
|
82
|
+
paragraph: Paragraph,
|
|
83
|
+
placeholder: Placeholder,
|
|
84
|
+
rule: Rule,
|
|
85
|
+
status: Status,
|
|
86
|
+
syncBlock: SyncBlock,
|
|
87
|
+
table: Table,
|
|
88
|
+
tableCell: TableCell,
|
|
89
|
+
tableHeader: TableHeader,
|
|
90
|
+
tableRow: TableRow,
|
|
91
|
+
taskItem: TaskItem,
|
|
92
|
+
taskList: TaskList,
|
|
93
|
+
unknownBlock: UnknownBlock,
|
|
94
|
+
unsupportedBlock: UnsupportedBlock,
|
|
95
|
+
unsupportedInline: UnsupportedInline,
|
|
96
|
+
windowedCodeBlock: WindowedCodeBlock
|
|
97
|
+
};
|
|
@@ -59,7 +59,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
59
59
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
60
60
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
61
61
|
const packageName = "@atlaskit/renderer";
|
|
62
|
-
const packageVersion = "136.0
|
|
62
|
+
const packageVersion = "136.1.0";
|
|
63
63
|
const setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
|
@@ -9,7 +9,6 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { injectIntl } from 'react-intl';
|
|
10
10
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
11
11
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
12
|
-
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
13
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
import CodeBlockContainer from './components/codeBlockContainer';
|
|
15
14
|
function CodeBlock(props) {
|
|
@@ -26,7 +25,6 @@ function CodeBlock(props) {
|
|
|
26
25
|
hideLineNumbers = _props$hideLineNumber === void 0 ? false : _props$hideLineNumber,
|
|
27
26
|
localId = props.localId,
|
|
28
27
|
wrap = props.wrap;
|
|
29
|
-
var codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
30
28
|
var className = [CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, props.className].join(' ');
|
|
31
29
|
var _useState = useState(function () {
|
|
32
30
|
return expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && Boolean(wrap);
|
|
@@ -50,11 +48,10 @@ function CodeBlock(props) {
|
|
|
50
48
|
testId: "renderer-code-block",
|
|
51
49
|
language: language,
|
|
52
50
|
text: text,
|
|
53
|
-
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
54
51
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
55
52
|
shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
|
|
56
53
|
shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
|
|
57
|
-
hasBidiWarnings:
|
|
54
|
+
hasBidiWarnings: false
|
|
58
55
|
}));
|
|
59
56
|
}
|
|
60
57
|
var _default_1 = injectIntl(CodeBlock);
|
|
@@ -13,7 +13,6 @@ import React, { forwardRef, useMemo } from 'react';
|
|
|
13
13
|
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
16
|
-
import { useBidiWarnings } from '../../../hooks/use-bidi-warnings';
|
|
17
16
|
import { RendererCssClassName } from '../../../../consts';
|
|
18
17
|
var codeBlockSharedStyles = css(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, "\n\t\t> .").concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "\n\t\t> .").concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT), {
|
|
19
18
|
marginRight: "var(--ds-space-100, 8px)",
|
|
@@ -137,18 +136,12 @@ export var getLightWeightCodeBlockStylesForRootRendererStyleSheet = function get
|
|
|
137
136
|
};
|
|
138
137
|
var LightWeightCodeBlock = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
139
138
|
var text = _ref.text,
|
|
140
|
-
_ref$codeBidiWarningT = _ref.codeBidiWarningTooltipEnabled,
|
|
141
|
-
codeBidiWarningTooltipEnabled = _ref$codeBidiWarningT === void 0 ? true : _ref$codeBidiWarningT,
|
|
142
139
|
_ref$hideLineNumbers = _ref.hideLineNumbers,
|
|
143
140
|
hideLineNumbers = _ref$hideLineNumbers === void 0 ? false : _ref$hideLineNumbers,
|
|
144
141
|
className = _ref.className;
|
|
145
142
|
var textRows = useMemo(function () {
|
|
146
143
|
return (text !== null && text !== void 0 ? text : '').split('\n');
|
|
147
144
|
}, [text]);
|
|
148
|
-
var _useBidiWarnings = useBidiWarnings({
|
|
149
|
-
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
150
|
-
}),
|
|
151
|
-
renderBidiWarnings = _useBidiWarnings.renderBidiWarnings;
|
|
152
145
|
var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
153
146
|
var codeBlockBackgroundImage = overflowShadow({
|
|
154
147
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
@@ -181,6 +174,6 @@ var LightWeightCodeBlock = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
181
174
|
);
|
|
182
175
|
})), jsx("div", {
|
|
183
176
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
184
|
-
}, jsx("code", null,
|
|
177
|
+
}, jsx("code", null, text)))));
|
|
185
178
|
});
|
|
186
179
|
export default LightWeightCodeBlock;
|
|
@@ -11,7 +11,6 @@ import { jsx } from '@emotion/react';
|
|
|
11
11
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
12
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
13
|
import { useInViewport } from '../../hooks/use-in-viewport';
|
|
14
|
-
import { useBidiWarnings } from '../../hooks/use-bidi-warnings';
|
|
15
14
|
import LightWeightCodeBlock from './components/lightWeightCodeBlock';
|
|
16
15
|
import CodeBlockContainer from './components/codeBlockContainer';
|
|
17
16
|
var LazyAkCodeBlock = /*#__PURE__*/lazy(
|
|
@@ -49,10 +48,6 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
49
48
|
hideLineNumbers = _ref2$hideLineNumbers === void 0 ? false : _ref2$hideLineNumbers,
|
|
50
49
|
rootClassName = _ref2.className,
|
|
51
50
|
wrap = _ref2.wrap;
|
|
52
|
-
var _useBidiWarnings = useBidiWarnings({
|
|
53
|
-
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
54
|
-
}),
|
|
55
|
-
warningLabel = _useBidiWarnings.warningLabel;
|
|
56
51
|
var _useInViewport = useInViewport(),
|
|
57
52
|
isInViewport = _useInViewport.isInViewport,
|
|
58
53
|
trackingRef = _useInViewport.trackingRef;
|
|
@@ -60,7 +55,6 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
60
55
|
var memoizedLightWeightCodeBlock = jsx(MemoizedLightWeightCodeBlock, {
|
|
61
56
|
ref: trackingRef,
|
|
62
57
|
text: text,
|
|
63
|
-
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
64
58
|
hideLineNumbers: expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers
|
|
65
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
66
60
|
,
|
|
@@ -88,11 +82,10 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
88
82
|
}, jsx(LazyAkCodeBlock, {
|
|
89
83
|
language: language,
|
|
90
84
|
text: text,
|
|
91
|
-
codeBidiWarningLabel: warningLabel,
|
|
92
85
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
93
86
|
shouldWrapLongLines: allowWrapCodeBlock && wrapLongLines,
|
|
94
87
|
shouldShowLineNumbers: !(expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && hideLineNumbers),
|
|
95
|
-
hasBidiWarnings:
|
|
88
|
+
hasBidiWarnings: false
|
|
96
89
|
})))) : memoizedLightWeightCodeBlock;
|
|
97
90
|
};
|
|
98
91
|
export default WindowedCodeBlock;
|
|
@@ -32,6 +32,8 @@ import UnknownBlock from './unknownBlock';
|
|
|
32
32
|
// Ignored via go/ees005
|
|
33
33
|
// eslint-disable-next-line import/no-named-as-default
|
|
34
34
|
|
|
35
|
+
import { nodeToReact as nodeToReactNew } from './nodes';
|
|
36
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
35
37
|
var WindowedCodeBlock = Loadable({
|
|
36
38
|
loader: function loader() {
|
|
37
39
|
return import( /* webpackChunkName: "@atlaskit-internal_renderer-node_WindowedCodeBlock" */
|
|
@@ -320,7 +322,7 @@ export var toReact = function toReact(node, flags, nodeComponents
|
|
|
320
322
|
}
|
|
321
323
|
|
|
322
324
|
// Allowing custom components to override those provided in nodeToReact
|
|
323
|
-
var nodes = _objectSpread(_objectSpread({}, nodeToReact), nodeComponents);
|
|
325
|
+
var nodes = _objectSpread(_objectSpread({}, isExperimentEnabled('platform_editor_remove_react-loadable_renderer') ? nodeToReactNew : nodeToReact), nodeComponents);
|
|
324
326
|
if (node.type.name === 'codeBlock') {
|
|
325
327
|
var _nodes$codeBlock;
|
|
326
328
|
if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
|
+
|
|
3
|
+
import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
4
|
+
import Expand from '../../ui/Expand';
|
|
5
|
+
import BlockCard from './blockCard';
|
|
6
|
+
import Blockquote from './blockquote';
|
|
7
|
+
import BodiedExtension from './bodiedExtension';
|
|
8
|
+
import BodiedSyncBlock from './bodiedSyncBlock';
|
|
9
|
+
import BulletList from './bulletList';
|
|
10
|
+
import Caption from './caption';
|
|
11
|
+
import CodeBlock from './codeBlock/codeBlock';
|
|
12
|
+
import WindowedCodeBlock from './codeBlock/windowedCodeBlock';
|
|
13
|
+
import DateNode from './date';
|
|
14
|
+
import DecisionItem from './decisionItem';
|
|
15
|
+
import DecisionList from './decisionList';
|
|
16
|
+
import Doc from './doc';
|
|
17
|
+
import EmbedCard from './embedCard';
|
|
18
|
+
import Emoji from './emoji';
|
|
19
|
+
import Extension from './extension';
|
|
20
|
+
import ExtensionFrame from './extensionFrame';
|
|
21
|
+
import HardBreak from './hardBreak';
|
|
22
|
+
import Heading from './heading';
|
|
23
|
+
import InlineCard from './inlineCard';
|
|
24
|
+
import InlineExtension from './inlineExtension';
|
|
25
|
+
import LayoutColumn from './layoutColumn';
|
|
26
|
+
import LayoutSection from './layoutSection';
|
|
27
|
+
import ListItem from './listItem';
|
|
28
|
+
import Media from './media';
|
|
29
|
+
import MediaGroup from './mediaGroup';
|
|
30
|
+
import MediaInline from './mediaInline';
|
|
31
|
+
import MediaSingle from './mediaSingle';
|
|
32
|
+
import Mention from './mention';
|
|
33
|
+
import MultiBodiedExtension from './multiBodiedExtension';
|
|
34
|
+
import OrderedList from './orderedList';
|
|
35
|
+
import Panel from './panel';
|
|
36
|
+
import Paragraph from './paragraph';
|
|
37
|
+
import Placeholder from './placeholder';
|
|
38
|
+
import Rule from './rule';
|
|
39
|
+
import Status from './status';
|
|
40
|
+
import SyncBlock from './syncBlock';
|
|
41
|
+
import Table from './table';
|
|
42
|
+
import { TableCell, TableHeader } from './tableCell';
|
|
43
|
+
import TableRow from './tableRow';
|
|
44
|
+
import TaskItem from './taskItem';
|
|
45
|
+
import TaskList from './taskList';
|
|
46
|
+
import UnknownBlock from './unknownBlock';
|
|
47
|
+
export var nodeToReact = {
|
|
48
|
+
blockCard: BlockCard,
|
|
49
|
+
blockquote: Blockquote,
|
|
50
|
+
blockTaskItem: TaskItem,
|
|
51
|
+
bodiedExtension: BodiedExtension,
|
|
52
|
+
bodiedSyncBlock: BodiedSyncBlock,
|
|
53
|
+
bulletList: BulletList,
|
|
54
|
+
caption: Caption,
|
|
55
|
+
codeBlock: CodeBlock,
|
|
56
|
+
date: DateNode,
|
|
57
|
+
decisionItem: DecisionItem,
|
|
58
|
+
decisionList: DecisionList,
|
|
59
|
+
doc: Doc,
|
|
60
|
+
embedCard: EmbedCard,
|
|
61
|
+
emoji: Emoji,
|
|
62
|
+
expand: Expand,
|
|
63
|
+
extension: Extension,
|
|
64
|
+
extensionFrame: ExtensionFrame,
|
|
65
|
+
hardBreak: HardBreak,
|
|
66
|
+
heading: Heading,
|
|
67
|
+
inlineCard: InlineCard,
|
|
68
|
+
inlineExtension: InlineExtension,
|
|
69
|
+
layoutColumn: LayoutColumn,
|
|
70
|
+
layoutSection: LayoutSection,
|
|
71
|
+
listItem: ListItem,
|
|
72
|
+
media: Media,
|
|
73
|
+
mediaGroup: MediaGroup,
|
|
74
|
+
mediaInline: MediaInline,
|
|
75
|
+
mediaSingle: MediaSingle,
|
|
76
|
+
mention: Mention,
|
|
77
|
+
multiBodiedExtension: MultiBodiedExtension,
|
|
78
|
+
nestedExpand: Expand,
|
|
79
|
+
orderedList: OrderedList,
|
|
80
|
+
panel: Panel,
|
|
81
|
+
panel_c1: Panel,
|
|
82
|
+
paragraph: Paragraph,
|
|
83
|
+
placeholder: Placeholder,
|
|
84
|
+
rule: Rule,
|
|
85
|
+
status: Status,
|
|
86
|
+
syncBlock: SyncBlock,
|
|
87
|
+
table: Table,
|
|
88
|
+
tableCell: TableCell,
|
|
89
|
+
tableHeader: TableHeader,
|
|
90
|
+
tableRow: TableRow,
|
|
91
|
+
taskItem: TaskItem,
|
|
92
|
+
taskList: TaskList,
|
|
93
|
+
unknownBlock: UnknownBlock,
|
|
94
|
+
unsupportedBlock: UnsupportedBlock,
|
|
95
|
+
unsupportedInline: UnsupportedInline,
|
|
96
|
+
windowedCodeBlock: WindowedCodeBlock
|
|
97
|
+
};
|
|
@@ -64,7 +64,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
64
64
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
65
65
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
66
66
|
var packageName = "@atlaskit/renderer";
|
|
67
|
-
var packageVersion = "136.0
|
|
67
|
+
var packageVersion = "136.1.0";
|
|
68
68
|
var setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -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' | '
|
|
16
|
+
declare const LightWeightCodeBlock: React.ForwardRefExoticComponent<Pick<CodeBlockProps, 'text' | 'className' | 'hideLineNumbers'> & React.RefAttributes<HTMLDivElement>>;
|
|
17
17
|
export default LightWeightCodeBlock;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "136.
|
|
3
|
+
"version": "136.1.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/editor-smart-link-draggable": "^1.2.0",
|
|
48
48
|
"@atlaskit/emoji": "^72.0.0",
|
|
49
49
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
50
|
-
"@atlaskit/icon": "^37.
|
|
50
|
+
"@atlaskit/icon": "^37.4.0",
|
|
51
51
|
"@atlaskit/link": "^5.0.0",
|
|
52
52
|
"@atlaskit/link-datasource": "^6.4.0",
|
|
53
53
|
"@atlaskit/link-extractors": "^4.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@atlaskit/status": "^5.8.0",
|
|
70
70
|
"@atlaskit/task-decision": "^21.8.0",
|
|
71
71
|
"@atlaskit/theme": "^28.0.0",
|
|
72
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^151.0.0",
|
|
73
73
|
"@atlaskit/tokens": "^16.7.0",
|
|
74
74
|
"@atlaskit/tooltip": "^24.0.0",
|
|
75
75
|
"@atlaskit/visually-hidden": "^4.2.0",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.useBidiWarnings = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactIntl = require("react-intl");
|
|
10
|
-
var _bidiWarning = _interopRequireDefault(require("@atlaskit/code/bidi-warning"));
|
|
11
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
|
-
var _bidiWarningDecorator = _interopRequireDefault(require("@atlaskit/code/bidi-warning-decorator"));
|
|
13
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
-
var useBidiWarnings = exports.useBidiWarnings = function useBidiWarnings(_ref) {
|
|
15
|
-
var _ref$enableWarningToo = _ref.enableWarningTooltip,
|
|
16
|
-
enableWarningTooltip = _ref$enableWarningToo === void 0 ? true : _ref$enableWarningToo;
|
|
17
|
-
var intl = (0, _reactIntl.useIntl)();
|
|
18
|
-
var warningLabel = intl.formatMessage(_messages.codeBidiWarningMessages.label);
|
|
19
|
-
var renderBidiWarnings = function renderBidiWarnings(text) {
|
|
20
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
|
|
21
|
-
return text;
|
|
22
|
-
}
|
|
23
|
-
return (0, _bidiWarningDecorator.default)(text, function (_ref2) {
|
|
24
|
-
var bidiCharacter = _ref2.bidiCharacter,
|
|
25
|
-
index = _ref2.index;
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(_bidiWarning.default, {
|
|
27
|
-
bidiCharacter: bidiCharacter,
|
|
28
|
-
key: index,
|
|
29
|
-
label: warningLabel,
|
|
30
|
-
tooltipEnabled: enableWarningTooltip
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
return {
|
|
35
|
-
renderBidiWarnings: renderBidiWarnings,
|
|
36
|
-
warningLabel: warningLabel
|
|
37
|
-
};
|
|
38
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl';
|
|
3
|
-
import CodeBidiWarning from '@atlaskit/code/bidi-warning';
|
|
4
|
-
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import codeBidiWarningDecorator from '@atlaskit/code/bidi-warning-decorator';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
-
export const useBidiWarnings = ({
|
|
8
|
-
enableWarningTooltip = true
|
|
9
|
-
}) => {
|
|
10
|
-
const intl = useIntl();
|
|
11
|
-
const warningLabel = intl.formatMessage(codeBidiWarningMessages.label);
|
|
12
|
-
const renderBidiWarnings = text => {
|
|
13
|
-
if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
|
|
14
|
-
return text;
|
|
15
|
-
}
|
|
16
|
-
return codeBidiWarningDecorator(text, ({
|
|
17
|
-
bidiCharacter,
|
|
18
|
-
index
|
|
19
|
-
}) => /*#__PURE__*/React.createElement(CodeBidiWarning, {
|
|
20
|
-
bidiCharacter: bidiCharacter,
|
|
21
|
-
key: index,
|
|
22
|
-
label: warningLabel,
|
|
23
|
-
tooltipEnabled: enableWarningTooltip
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
renderBidiWarnings,
|
|
28
|
-
warningLabel
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl';
|
|
3
|
-
import CodeBidiWarning from '@atlaskit/code/bidi-warning';
|
|
4
|
-
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import codeBidiWarningDecorator from '@atlaskit/code/bidi-warning-decorator';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
-
export var useBidiWarnings = function useBidiWarnings(_ref) {
|
|
8
|
-
var _ref$enableWarningToo = _ref.enableWarningTooltip,
|
|
9
|
-
enableWarningTooltip = _ref$enableWarningToo === void 0 ? true : _ref$enableWarningToo;
|
|
10
|
-
var intl = useIntl();
|
|
11
|
-
var warningLabel = intl.formatMessage(codeBidiWarningMessages.label);
|
|
12
|
-
var renderBidiWarnings = function renderBidiWarnings(text) {
|
|
13
|
-
if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
|
|
14
|
-
return text;
|
|
15
|
-
}
|
|
16
|
-
return codeBidiWarningDecorator(text, function (_ref2) {
|
|
17
|
-
var bidiCharacter = _ref2.bidiCharacter,
|
|
18
|
-
index = _ref2.index;
|
|
19
|
-
return /*#__PURE__*/React.createElement(CodeBidiWarning, {
|
|
20
|
-
bidiCharacter: bidiCharacter,
|
|
21
|
-
key: index,
|
|
22
|
-
label: warningLabel,
|
|
23
|
-
tooltipEnabled: enableWarningTooltip
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
return {
|
|
28
|
-
renderBidiWarnings: renderBidiWarnings,
|
|
29
|
-
warningLabel: warningLabel
|
|
30
|
-
};
|
|
31
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
interface Config {
|
|
3
|
-
enableWarningTooltip: boolean;
|
|
4
|
-
}
|
|
5
|
-
interface Result {
|
|
6
|
-
renderBidiWarnings: (text: string) => ReactNode;
|
|
7
|
-
warningLabel: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const useBidiWarnings: ({ enableWarningTooltip }: Config) => Result;
|
|
10
|
-
export {};
|