@atlaskit/renderer 138.1.8 → 139.0.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 +25 -0
- package/dist/cjs/react/index.js +1 -12
- package/dist/cjs/react/nodes/layoutSection.js +2 -2
- package/dist/cjs/react/nodes/multiBodiedExtension.js +2 -3
- package/dist/cjs/react/nodes/orderedList.js +2 -2
- package/dist/cjs/ui/ExtensionRenderer.js +2 -3
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/index.js +1 -12
- package/dist/es2019/react/nodes/layoutSection.js +2 -2
- package/dist/es2019/react/nodes/multiBodiedExtension.js +2 -3
- package/dist/es2019/react/nodes/orderedList.js +2 -2
- package/dist/es2019/ui/ExtensionRenderer.js +2 -3
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/index.js +1 -12
- package/dist/esm/react/nodes/layoutSection.js +2 -2
- package/dist/esm/react/nodes/multiBodiedExtension.js +2 -3
- package/dist/esm/react/nodes/orderedList.js +2 -2
- package/dist/esm/ui/ExtensionRenderer.js +2 -3
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/bodiedExtension.d.ts +0 -1
- package/dist/types/react/nodes/extensionFrame.d.ts +0 -1
- package/dist/types/react/nodes/layoutSection.d.ts +0 -1
- package/dist/types/react/nodes/multiBodiedExtension.d.ts +0 -1
- package/dist/types/react/nodes/orderedList.d.ts +0 -1
- package/dist/types/react/nodes/taskItem.d.ts +1 -1
- package/dist/types/react/types.d.ts +4 -17
- package/dist/types/ui/ExtensionRenderer.d.ts +0 -5
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 139.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`8774ea3d3d0fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8774ea3d3d0fb) -
|
|
8
|
+
Cleanup experiment `platform_editor_renderer_defer_content`. This is a breaking change: the
|
|
9
|
+
`content` prop is removed from `NodeMeta` and the `bodiedExtension`, `extensionFrame`,
|
|
10
|
+
`layoutSection`, `multiBodiedExtension`, and `orderedList` props.
|
|
11
|
+
|
|
12
|
+
To migrate, replace reads of `content` with `getContent?.()`. Consumers that construct node props
|
|
13
|
+
and need to provide content should supply a `getContent` callback instead, for example
|
|
14
|
+
`getContent: () => content`. The callback remains optional in the prop types. The
|
|
15
|
+
serializer-provided getter serializes the node's subtree on first call and memoizes the result.
|
|
16
|
+
`ExtensionParams.content` handed to extension handlers is unaffected.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 138.1.9
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 138.1.8
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -671,18 +671,8 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
671
671
|
}, {
|
|
672
672
|
key: "getProps",
|
|
673
673
|
value: function getProps(node) {
|
|
674
|
-
var _node$content;
|
|
675
674
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
676
675
|
var startPos = this.startPos + path.length;
|
|
677
|
-
|
|
678
|
-
// `content` is a recursive Fragment.toJSON() attached to every node, so the document is
|
|
679
|
-
// re-serialized once per ancestor — O(depth x size) overall, and a table paid it again for
|
|
680
|
-
// every row and cell. Consumers read `getContent()` instead, which serializes at most once.
|
|
681
|
-
// Experiment call last, so exposure only fires for nodes that have content to serialize.
|
|
682
|
-
var skipEagerContent = !!((_node$content = node.content) !== null && _node$content !== void 0 && _node$content.childCount) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_renderer_defer_content');
|
|
683
|
-
|
|
684
|
-
// Shared so the `content` prop and `getContent()` never serialize the subtree twice.
|
|
685
|
-
var getContent = (0, _contentGetter.createContentGetter)(node.content);
|
|
686
676
|
return _objectSpread({
|
|
687
677
|
asInline: this.inlinePositions.has(startPos) ? 'on' : undefined,
|
|
688
678
|
text: node.text,
|
|
@@ -692,8 +682,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
692
682
|
portal: this.portal,
|
|
693
683
|
rendererContext: this.rendererContext,
|
|
694
684
|
serializer: this,
|
|
695
|
-
|
|
696
|
-
getContent: getContent,
|
|
685
|
+
getContent: (0, _contentGetter.createContentGetter)(node.content),
|
|
697
686
|
allowHeadingAnchorLinks: this.allowHeadingAnchorLinks,
|
|
698
687
|
allowCopyToClipboard: this.allowCopyToClipboard,
|
|
699
688
|
allowDownloadCodeBlock: this.allowDownloadCodeBlock,
|
|
@@ -8,8 +8,8 @@ exports.default = LayoutSection;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
10
10
|
function LayoutSection(props) {
|
|
11
|
-
var
|
|
12
|
-
var columnCount = (
|
|
11
|
+
var _props$getContent;
|
|
12
|
+
var columnCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 || (_props$getContent = _props$getContent.call(props)) === null || _props$getContent === void 0 ? void 0 : _props$getContent.length;
|
|
13
13
|
return (0, _editorExperiment.editorExperiment)('advanced_layouts', true) ?
|
|
14
14
|
/*#__PURE__*/
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -139,7 +139,6 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
139
139
|
extensionType = props.extensionType,
|
|
140
140
|
extensionKey = props.extensionKey,
|
|
141
141
|
extensionHandlers = props.extensionHandlers,
|
|
142
|
-
content = props.content,
|
|
143
142
|
getContent = props.getContent,
|
|
144
143
|
marks = props.marks,
|
|
145
144
|
localId = props.localId,
|
|
@@ -183,7 +182,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
183
182
|
extensionKey: extensionKey,
|
|
184
183
|
extensionType: extensionType,
|
|
185
184
|
parameters: parameters,
|
|
186
|
-
content:
|
|
185
|
+
content: getContent === null || getContent === void 0 ? void 0 : getContent(),
|
|
187
186
|
localId: localId,
|
|
188
187
|
fragmentLocalId: fragmentLocalId
|
|
189
188
|
};
|
|
@@ -200,7 +199,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
200
199
|
activeChildIndex: activeChildIndex
|
|
201
200
|
}, children));
|
|
202
201
|
}
|
|
203
|
-
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters,
|
|
202
|
+
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters, getContent, localId, actions, children]);
|
|
204
203
|
|
|
205
204
|
// make the frame visible
|
|
206
205
|
var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex);
|
|
@@ -12,11 +12,11 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _lists = require("../utils/lists");
|
|
14
14
|
function OrderedList(props) {
|
|
15
|
-
var
|
|
15
|
+
var _props$getContent;
|
|
16
16
|
var extraProps = {};
|
|
17
17
|
|
|
18
18
|
// Item count drives the marker column width, so losing it narrows the gutter by a digit.
|
|
19
|
-
var itemsCount = (
|
|
19
|
+
var itemsCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 || (_props$getContent = _props$getContent.call(props)) === null || _props$getContent === void 0 ? void 0 : _props$getContent.length;
|
|
20
20
|
var itemCounterDigitsSize = (0, _utils.getItemCounterDigitsSize)({
|
|
21
21
|
order: props.order,
|
|
22
22
|
itemsCount: itemsCount
|
|
@@ -53,7 +53,6 @@ function ExtensionRenderer(props) {
|
|
|
53
53
|
extensionType = props.extensionType,
|
|
54
54
|
extensionKey = props.extensionKey,
|
|
55
55
|
parameters = props.parameters,
|
|
56
|
-
content = props.content,
|
|
57
56
|
getContent = props.getContent,
|
|
58
57
|
text = props.text,
|
|
59
58
|
type = props.type,
|
|
@@ -100,7 +99,7 @@ function ExtensionRenderer(props) {
|
|
|
100
99
|
extensionKey: extensionKey,
|
|
101
100
|
extensionType: extensionType,
|
|
102
101
|
parameters: parameters,
|
|
103
|
-
content: (
|
|
102
|
+
content: (getContent === null || getContent === void 0 ? void 0 : getContent()) || text,
|
|
104
103
|
localId: localId,
|
|
105
104
|
fragmentLocalId: fragmentLocalId
|
|
106
105
|
};
|
|
@@ -139,7 +138,7 @@ function ExtensionRenderer(props) {
|
|
|
139
138
|
node: node,
|
|
140
139
|
result: result
|
|
141
140
|
});
|
|
142
|
-
}, [actions, children,
|
|
141
|
+
}, [actions, children, getContent, extensionHandlers, extensionKey, extensionType, localGetNodeRenderer, localId, marks, parameters, rendererContext === null || rendererContext === void 0 ? void 0 : rendererContext.adDoc, text, type]);
|
|
143
142
|
var setupAndRenderExtensionNode = _react2.default.useCallback(function (providers) {
|
|
144
143
|
if (extensionProvider === null && providers.extensionProvider) {
|
|
145
144
|
handleProvider('extensionProvider', providers.extensionProvider);
|
|
@@ -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 = "
|
|
76
|
+
var packageVersion = "139.0.0";
|
|
77
77
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
78
78
|
containerName: 'ak-renderer-wrapper',
|
|
79
79
|
containerType: 'inline-size'
|
|
@@ -599,17 +599,7 @@ export default class ReactSerializer {
|
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
601
|
getProps(node, path = []) {
|
|
602
|
-
var _node$content;
|
|
603
602
|
const startPos = this.startPos + path.length;
|
|
604
|
-
|
|
605
|
-
// `content` is a recursive Fragment.toJSON() attached to every node, so the document is
|
|
606
|
-
// re-serialized once per ancestor — O(depth x size) overall, and a table paid it again for
|
|
607
|
-
// every row and cell. Consumers read `getContent()` instead, which serializes at most once.
|
|
608
|
-
// Experiment call last, so exposure only fires for nodes that have content to serialize.
|
|
609
|
-
const skipEagerContent = !!((_node$content = node.content) !== null && _node$content !== void 0 && _node$content.childCount) && isExperimentEnabled('platform_editor_renderer_defer_content');
|
|
610
|
-
|
|
611
|
-
// Shared so the `content` prop and `getContent()` never serialize the subtree twice.
|
|
612
|
-
const getContent = createContentGetter(node.content);
|
|
613
603
|
return {
|
|
614
604
|
asInline: this.inlinePositions.has(startPos) ? 'on' : undefined,
|
|
615
605
|
text: node.text,
|
|
@@ -619,8 +609,7 @@ export default class ReactSerializer {
|
|
|
619
609
|
portal: this.portal,
|
|
620
610
|
rendererContext: this.rendererContext,
|
|
621
611
|
serializer: this,
|
|
622
|
-
|
|
623
|
-
getContent,
|
|
612
|
+
getContent: createContentGetter(node.content),
|
|
624
613
|
allowHeadingAnchorLinks: this.allowHeadingAnchorLinks,
|
|
625
614
|
allowCopyToClipboard: this.allowCopyToClipboard,
|
|
626
615
|
allowDownloadCodeBlock: this.allowDownloadCodeBlock,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
3
3
|
export default function LayoutSection(props) {
|
|
4
|
-
var
|
|
5
|
-
const columnCount = (
|
|
4
|
+
var _props$getContent, _props$getContent$cal;
|
|
5
|
+
const columnCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 ? void 0 : (_props$getContent$cal = _props$getContent.call(props)) === null || _props$getContent$cal === void 0 ? void 0 : _props$getContent$cal.length;
|
|
6
6
|
return editorExperiment('advanced_layouts', true) ?
|
|
7
7
|
/*#__PURE__*/
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -139,7 +139,6 @@ const MultiBodiedExtension = props => {
|
|
|
139
139
|
extensionType,
|
|
140
140
|
extensionKey,
|
|
141
141
|
extensionHandlers,
|
|
142
|
-
content,
|
|
143
142
|
getContent,
|
|
144
143
|
marks,
|
|
145
144
|
localId,
|
|
@@ -183,7 +182,7 @@ const MultiBodiedExtension = props => {
|
|
|
183
182
|
extensionKey,
|
|
184
183
|
extensionType,
|
|
185
184
|
parameters,
|
|
186
|
-
content:
|
|
185
|
+
content: getContent === null || getContent === void 0 ? void 0 : getContent(),
|
|
187
186
|
localId,
|
|
188
187
|
fragmentLocalId
|
|
189
188
|
};
|
|
@@ -200,7 +199,7 @@ const MultiBodiedExtension = props => {
|
|
|
200
199
|
activeChildIndex: activeChildIndex
|
|
201
200
|
}, children));
|
|
202
201
|
}
|
|
203
|
-
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters,
|
|
202
|
+
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters, getContent, localId, actions, children]);
|
|
204
203
|
|
|
205
204
|
// make the frame visible
|
|
206
205
|
const containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex);
|
|
@@ -5,11 +5,11 @@ import { getOrderedListInlineStyles } from '@atlaskit/editor-common/styles';
|
|
|
5
5
|
import { getItemCounterDigitsSize, resolveOrder } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { getListIndentLevel } from '../utils/lists';
|
|
7
7
|
export default function OrderedList(props) {
|
|
8
|
-
var
|
|
8
|
+
var _props$getContent, _props$getContent$cal;
|
|
9
9
|
const extraProps = {};
|
|
10
10
|
|
|
11
11
|
// Item count drives the marker column width, so losing it narrows the gutter by a digit.
|
|
12
|
-
const itemsCount = (
|
|
12
|
+
const itemsCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 ? void 0 : (_props$getContent$cal = _props$getContent.call(props)) === null || _props$getContent$cal === void 0 ? void 0 : _props$getContent$cal.length;
|
|
13
13
|
const itemCounterDigitsSize = getItemCounterDigitsSize({
|
|
14
14
|
order: props.order,
|
|
15
15
|
itemsCount
|
|
@@ -43,7 +43,6 @@ export default function ExtensionRenderer(props) {
|
|
|
43
43
|
extensionType,
|
|
44
44
|
extensionKey,
|
|
45
45
|
parameters,
|
|
46
|
-
content,
|
|
47
46
|
getContent,
|
|
48
47
|
text,
|
|
49
48
|
type,
|
|
@@ -84,7 +83,7 @@ export default function ExtensionRenderer(props) {
|
|
|
84
83
|
extensionKey,
|
|
85
84
|
extensionType,
|
|
86
85
|
parameters,
|
|
87
|
-
content: (
|
|
86
|
+
content: (getContent === null || getContent === void 0 ? void 0 : getContent()) || text,
|
|
88
87
|
localId,
|
|
89
88
|
fragmentLocalId
|
|
90
89
|
};
|
|
@@ -123,7 +122,7 @@ export default function ExtensionRenderer(props) {
|
|
|
123
122
|
node,
|
|
124
123
|
result
|
|
125
124
|
});
|
|
126
|
-
}, [actions, children,
|
|
125
|
+
}, [actions, children, getContent, extensionHandlers, extensionKey, extensionType, localGetNodeRenderer, localId, marks, parameters, rendererContext === null || rendererContext === void 0 ? void 0 : rendererContext.adDoc, text, type]);
|
|
127
126
|
const setupAndRenderExtensionNode = React.useCallback(providers => {
|
|
128
127
|
if (extensionProvider === null && providers.extensionProvider) {
|
|
129
128
|
handleProvider('extensionProvider', providers.extensionProvider);
|
|
@@ -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 = "
|
|
62
|
+
const packageVersion = "139.0.0";
|
|
63
63
|
const setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
package/dist/esm/react/index.js
CHANGED
|
@@ -664,18 +664,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
664
664
|
}, {
|
|
665
665
|
key: "getProps",
|
|
666
666
|
value: function getProps(node) {
|
|
667
|
-
var _node$content;
|
|
668
667
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
669
668
|
var startPos = this.startPos + path.length;
|
|
670
|
-
|
|
671
|
-
// `content` is a recursive Fragment.toJSON() attached to every node, so the document is
|
|
672
|
-
// re-serialized once per ancestor — O(depth x size) overall, and a table paid it again for
|
|
673
|
-
// every row and cell. Consumers read `getContent()` instead, which serializes at most once.
|
|
674
|
-
// Experiment call last, so exposure only fires for nodes that have content to serialize.
|
|
675
|
-
var skipEagerContent = !!((_node$content = node.content) !== null && _node$content !== void 0 && _node$content.childCount) && isExperimentEnabled('platform_editor_renderer_defer_content');
|
|
676
|
-
|
|
677
|
-
// Shared so the `content` prop and `getContent()` never serialize the subtree twice.
|
|
678
|
-
var getContent = createContentGetter(node.content);
|
|
679
669
|
return _objectSpread({
|
|
680
670
|
asInline: this.inlinePositions.has(startPos) ? 'on' : undefined,
|
|
681
671
|
text: node.text,
|
|
@@ -685,8 +675,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
685
675
|
portal: this.portal,
|
|
686
676
|
rendererContext: this.rendererContext,
|
|
687
677
|
serializer: this,
|
|
688
|
-
|
|
689
|
-
getContent: getContent,
|
|
678
|
+
getContent: createContentGetter(node.content),
|
|
690
679
|
allowHeadingAnchorLinks: this.allowHeadingAnchorLinks,
|
|
691
680
|
allowCopyToClipboard: this.allowCopyToClipboard,
|
|
692
681
|
allowDownloadCodeBlock: this.allowDownloadCodeBlock,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
3
3
|
export default function LayoutSection(props) {
|
|
4
|
-
var
|
|
5
|
-
var columnCount = (
|
|
4
|
+
var _props$getContent;
|
|
5
|
+
var columnCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 || (_props$getContent = _props$getContent.call(props)) === null || _props$getContent === void 0 ? void 0 : _props$getContent.length;
|
|
6
6
|
return editorExperiment('advanced_layouts', true) ?
|
|
7
7
|
/*#__PURE__*/
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -131,7 +131,6 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
131
131
|
extensionType = props.extensionType,
|
|
132
132
|
extensionKey = props.extensionKey,
|
|
133
133
|
extensionHandlers = props.extensionHandlers,
|
|
134
|
-
content = props.content,
|
|
135
134
|
getContent = props.getContent,
|
|
136
135
|
marks = props.marks,
|
|
137
136
|
localId = props.localId,
|
|
@@ -175,7 +174,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
175
174
|
extensionKey: extensionKey,
|
|
176
175
|
extensionType: extensionType,
|
|
177
176
|
parameters: parameters,
|
|
178
|
-
content:
|
|
177
|
+
content: getContent === null || getContent === void 0 ? void 0 : getContent(),
|
|
179
178
|
localId: localId,
|
|
180
179
|
fragmentLocalId: fragmentLocalId
|
|
181
180
|
};
|
|
@@ -192,7 +191,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
192
191
|
activeChildIndex: activeChildIndex
|
|
193
192
|
}, children));
|
|
194
193
|
}
|
|
195
|
-
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters,
|
|
194
|
+
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters, getContent, localId, actions, children]);
|
|
196
195
|
|
|
197
196
|
// make the frame visible
|
|
198
197
|
var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex);
|
|
@@ -5,11 +5,11 @@ import { getOrderedListInlineStyles } from '@atlaskit/editor-common/styles';
|
|
|
5
5
|
import { getItemCounterDigitsSize, resolveOrder } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { getListIndentLevel } from '../utils/lists';
|
|
7
7
|
export default function OrderedList(props) {
|
|
8
|
-
var
|
|
8
|
+
var _props$getContent;
|
|
9
9
|
var extraProps = {};
|
|
10
10
|
|
|
11
11
|
// Item count drives the marker column width, so losing it narrows the gutter by a digit.
|
|
12
|
-
var itemsCount = (
|
|
12
|
+
var itemsCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 || (_props$getContent = _props$getContent.call(props)) === null || _props$getContent === void 0 ? void 0 : _props$getContent.length;
|
|
13
13
|
var itemCounterDigitsSize = getItemCounterDigitsSize({
|
|
14
14
|
order: props.order,
|
|
15
15
|
itemsCount: itemsCount
|
|
@@ -43,7 +43,6 @@ export default function ExtensionRenderer(props) {
|
|
|
43
43
|
extensionType = props.extensionType,
|
|
44
44
|
extensionKey = props.extensionKey,
|
|
45
45
|
parameters = props.parameters,
|
|
46
|
-
content = props.content,
|
|
47
46
|
getContent = props.getContent,
|
|
48
47
|
text = props.text,
|
|
49
48
|
type = props.type,
|
|
@@ -90,7 +89,7 @@ export default function ExtensionRenderer(props) {
|
|
|
90
89
|
extensionKey: extensionKey,
|
|
91
90
|
extensionType: extensionType,
|
|
92
91
|
parameters: parameters,
|
|
93
|
-
content: (
|
|
92
|
+
content: (getContent === null || getContent === void 0 ? void 0 : getContent()) || text,
|
|
94
93
|
localId: localId,
|
|
95
94
|
fragmentLocalId: fragmentLocalId
|
|
96
95
|
};
|
|
@@ -129,7 +128,7 @@ export default function ExtensionRenderer(props) {
|
|
|
129
128
|
node: node,
|
|
130
129
|
result: result
|
|
131
130
|
});
|
|
132
|
-
}, [actions, children,
|
|
131
|
+
}, [actions, children, getContent, extensionHandlers, extensionKey, extensionType, localGetNodeRenderer, localId, marks, parameters, rendererContext === null || rendererContext === void 0 ? void 0 : rendererContext.adDoc, text, type]);
|
|
133
132
|
var setupAndRenderExtensionNode = React.useCallback(function (providers) {
|
|
134
133
|
if (extensionProvider === null && providers.extensionProvider) {
|
|
135
134
|
handleProvider('extensionProvider', providers.extensionProvider);
|
|
@@ -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 = "
|
|
67
|
+
var packageVersion = "139.0.0";
|
|
68
68
|
var setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -8,7 +8,6 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
8
8
|
import type { RendererAppearance } from '../../ui/Renderer/types';
|
|
9
9
|
import type { AnalyticsEventPayload } from '../../analytics/events';
|
|
10
10
|
interface Props {
|
|
11
|
-
content?: any;
|
|
12
11
|
extensionHandlers?: ExtensionHandlers;
|
|
13
12
|
extensionKey: string;
|
|
14
13
|
extensionType: string;
|
|
@@ -10,7 +10,6 @@ import type { Layout as ExtensionLayout } from '@atlaskit/adf-schema/extensions'
|
|
|
10
10
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
11
11
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
12
12
|
type Props = React.PropsWithChildren<{
|
|
13
|
-
content?: any;
|
|
14
13
|
extensionHandlers?: ExtensionHandlers;
|
|
15
14
|
extensionKey: string;
|
|
16
15
|
extensionType: string;
|
|
@@ -12,7 +12,6 @@ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
|
12
12
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
13
13
|
import type { RendererAppearance } from '../../ui/Renderer/types';
|
|
14
14
|
type Props = React.PropsWithChildren<{
|
|
15
|
-
content?: any;
|
|
16
15
|
extensionHandlers?: ExtensionHandlers;
|
|
17
16
|
extensionKey: string;
|
|
18
17
|
extensionType: string;
|
|
@@ -3,7 +3,6 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { NodeContent } from '../types';
|
|
4
4
|
export default function OrderedList(props: {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
-
content?: NodeContent;
|
|
7
6
|
getContent?: () => NodeContent | undefined;
|
|
8
7
|
localId?: string;
|
|
9
8
|
order?: number;
|
|
@@ -11,7 +11,7 @@ export interface Props {
|
|
|
11
11
|
rendererContext?: RendererContext;
|
|
12
12
|
state?: string;
|
|
13
13
|
}
|
|
14
|
-
export default class TaskItem extends PureComponent<NodeProps<Props>,
|
|
14
|
+
export default class TaskItem extends PureComponent<NodeProps<Props>, object> {
|
|
15
15
|
private providerFactory;
|
|
16
16
|
constructor(props: NodeProps<Props>);
|
|
17
17
|
componentWillUnmount(): void;
|
|
@@ -31,14 +31,6 @@ export interface NodeMeta {
|
|
|
31
31
|
allowPlaceholderText?: boolean;
|
|
32
32
|
allowWrapCodeBlock?: boolean;
|
|
33
33
|
asInline?: 'on' | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Superseded by `getContent()`, and removed once `platform_editor_renderer_defer_content` ships.
|
|
36
|
-
* A recursive `Fragment.toJSON()` of the node's subtree, serialized on every render whether or
|
|
37
|
-
* not anything reads it — so the document was re-serialized once per ancestor node. While that
|
|
38
|
-
* experiment is enabled it is not provided on any node that has children; a childless node keeps
|
|
39
|
-
* the `null` both arms produce. Read `content ?? getContent?.()` so both arms are covered.
|
|
40
|
-
*/
|
|
41
|
-
content?: NodeContent;
|
|
42
34
|
dataAttributes: {
|
|
43
35
|
'data-renderer-start-pos': number;
|
|
44
36
|
};
|
|
@@ -46,13 +38,8 @@ export interface NodeMeta {
|
|
|
46
38
|
extensionHandlers?: ExtensionHandlers | undefined;
|
|
47
39
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
48
40
|
/**
|
|
49
|
-
* Serialized JSON of the node's
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `ReactSerializer` attaches this to every node it builds props for, in both arms of
|
|
53
|
-
* `platform_editor_renderer_defer_content`. Read `content ?? getContent?.()`: with the experiment
|
|
54
|
-
* off `content` is already serialized and calling this adds nothing, and with it on `content` is
|
|
55
|
-
* the operand that is absent — so both sides of that expression stay live until `content` goes.
|
|
41
|
+
* Serialized JSON (`Fragment.toJSON()`) of the node's subtree, computed on first call and
|
|
42
|
+
* memoized, so a node whose content nothing reads costs nothing.
|
|
56
43
|
*/
|
|
57
44
|
getContent?: () => NodeContent | undefined;
|
|
58
45
|
hideExtensionKeysWhilePending?: string[];
|
|
@@ -85,8 +72,8 @@ export interface AnnotationMarkMeta extends MarkMeta {
|
|
|
85
72
|
isMediaInline?: boolean;
|
|
86
73
|
useBlockLevel?: boolean;
|
|
87
74
|
}
|
|
88
|
-
export type NodeProps<NodeAttrs =
|
|
89
|
-
export type MarkProps<MarkAttrs =
|
|
75
|
+
export type NodeProps<NodeAttrs = object> = NodeAttrs & PropsWithChildren<NodeMeta>;
|
|
76
|
+
export type MarkProps<MarkAttrs = object> = MarkAttrs & PropsWithChildren<MarkMeta>;
|
|
90
77
|
export type TextHighlighter = {
|
|
91
78
|
component: React.ComponentType<{
|
|
92
79
|
children: React.ReactNode;
|
|
@@ -16,11 +16,6 @@ interface Props {
|
|
|
16
16
|
node: ExtensionParams<Parameters>;
|
|
17
17
|
result?: JSX.Element | null;
|
|
18
18
|
}) => JSX.Element;
|
|
19
|
-
/**
|
|
20
|
-
* Read as `content ?? getContent?.()` — absent on nodes with children once the serializer defers
|
|
21
|
-
* serialization, and the already-serialized value otherwise.
|
|
22
|
-
*/
|
|
23
|
-
content?: any;
|
|
24
19
|
extensionHandlers?: ExtensionHandlers;
|
|
25
20
|
extensionKey: string;
|
|
26
21
|
extensionType: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "139.0.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@atlaskit/editor-json-transformer": "^9.8.0",
|
|
45
45
|
"@atlaskit/editor-palette": "^3.5.0",
|
|
46
46
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
47
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
47
|
+
"@atlaskit/editor-shared-styles": "^4.2.0",
|
|
48
48
|
"@atlaskit/editor-smart-link-draggable": "^1.2.0",
|
|
49
49
|
"@atlaskit/emoji": "^72.3.0",
|
|
50
50
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
51
51
|
"@atlaskit/icon": "^37.6.0",
|
|
52
52
|
"@atlaskit/link": "^5.1.0",
|
|
53
|
-
"@atlaskit/link-datasource": "^6.
|
|
53
|
+
"@atlaskit/link-datasource": "^6.13.0",
|
|
54
54
|
"@atlaskit/link-extractors": "^4.2.0",
|
|
55
55
|
"@atlaskit/linking-common": "^12.1.0",
|
|
56
56
|
"@atlaskit/media-card": "^81.10.0",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
66
66
|
"@atlaskit/pragmatic-drag-and-drop": "^3.1.0",
|
|
67
67
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
68
|
-
"@atlaskit/react-ufo": "^7.
|
|
68
|
+
"@atlaskit/react-ufo": "^7.9.0",
|
|
69
69
|
"@atlaskit/smart-card": "^45.21.0",
|
|
70
70
|
"@atlaskit/status": "^5.9.0",
|
|
71
71
|
"@atlaskit/task-decision": "^21.9.0",
|
|
72
72
|
"@atlaskit/theme": "^28.2.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
74
|
-
"@atlaskit/tokens": "^16.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^187.0.0",
|
|
74
|
+
"@atlaskit/tokens": "^16.12.0",
|
|
75
75
|
"@atlaskit/tooltip": "^24.3.0",
|
|
76
76
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
77
77
|
"@babel/runtime": "^7.0.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"uuid": "^11.1.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/editor-common": "^121.
|
|
88
|
+
"@atlaskit/editor-common": "^121.4.0",
|
|
89
89
|
"@atlaskit/link-provider": "^5.6.0",
|
|
90
90
|
"@atlaskit/media-core": "^38.2.0",
|
|
91
91
|
"react": "^18.2.0 || ^19.2.0",
|