@atlaskit/renderer 125.4.0 → 126.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 +18 -0
- package/afm-products/tsconfig.json +1 -1
- package/dist/cjs/react/index.js +15 -5
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -1
- package/dist/cjs/react/nodes/tableNew.js +6 -2
- package/dist/cjs/react/utils/merge-inlined-extension.js +92 -0
- package/dist/cjs/ui/MediaCard.js +2 -3
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +12 -11
- package/dist/cjs/ui/Renderer/index.js +3 -2
- package/dist/es2019/react/index.js +15 -5
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -1
- package/dist/es2019/react/nodes/tableNew.js +6 -2
- package/dist/es2019/react/utils/merge-inlined-extension.js +75 -0
- package/dist/es2019/ui/MediaCard.js +2 -3
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +12 -11
- package/dist/es2019/ui/Renderer/index.js +3 -2
- package/dist/esm/react/index.js +15 -5
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -1
- package/dist/esm/react/nodes/tableNew.js +6 -2
- package/dist/esm/react/utils/merge-inlined-extension.js +86 -0
- package/dist/esm/ui/MediaCard.js +2 -3
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +12 -11
- package/dist/esm/ui/Renderer/index.js +3 -2
- package/dist/types/react/index.d.ts +4 -3
- package/dist/types/react/utils/merge-inlined-extension.d.ts +25 -0
- package/dist/types/ui/renderer-props.d.ts +7 -1
- package/dist/types-ts4.5/react/index.d.ts +4 -3
- package/dist/types-ts4.5/react/utils/merge-inlined-extension.d.ts +25 -0
- package/dist/types-ts4.5/ui/renderer-props.d.ts +7 -1
- package/docs/0-intro.tsx +30 -28
- package/package.json +3 -3
- package/build/tsconfig.json +0 -23
|
@@ -314,7 +314,7 @@ const telepointerStyles = css({
|
|
|
314
314
|
left: 0,
|
|
315
315
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
316
316
|
fontSize: '10px',
|
|
317
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
317
|
+
fontWeight: "var(--ds-font-weight-bold, 653)",
|
|
318
318
|
width: '12.5px',
|
|
319
319
|
height: '13px',
|
|
320
320
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
@@ -353,7 +353,7 @@ const rovoTelepointerStyles = css({
|
|
|
353
353
|
'&::before': {
|
|
354
354
|
content: '"Rovo"',
|
|
355
355
|
position: 'absolute',
|
|
356
|
-
fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
356
|
+
fontFamily: "var(--ds-font-family-body, \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
357
357
|
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
358
358
|
color: "var(--ds-text-inverse, white)",
|
|
359
359
|
background: "var(--ds-text, #292A2E)",
|
|
@@ -496,7 +496,7 @@ const headingsSharedStyles = css({
|
|
|
496
496
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
497
497
|
lineHeight: 16 / 11,
|
|
498
498
|
color: "var(--ds-text-subtlest, #6B6E76)",
|
|
499
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
499
|
+
fontWeight: "var(--ds-font-weight-bold, 653)",
|
|
500
500
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
501
501
|
marginTop: '1.455em',
|
|
502
502
|
textTransform: 'none'
|
|
@@ -511,7 +511,7 @@ const headingsSharedStylesWithEditorUGC = css({
|
|
|
511
511
|
marginTop: '1.45833em',
|
|
512
512
|
'& strong': {
|
|
513
513
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
514
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
514
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
515
515
|
},
|
|
516
516
|
'&::before': {}
|
|
517
517
|
},
|
|
@@ -523,7 +523,7 @@ const headingsSharedStylesWithEditorUGC = css({
|
|
|
523
523
|
marginBottom: 0,
|
|
524
524
|
'& strong': {
|
|
525
525
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
526
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
526
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
527
527
|
}
|
|
528
528
|
},
|
|
529
529
|
'& h3': {
|
|
@@ -534,7 +534,7 @@ const headingsSharedStylesWithEditorUGC = css({
|
|
|
534
534
|
marginBottom: 0,
|
|
535
535
|
'& strong': {
|
|
536
536
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
537
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
537
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
538
538
|
}
|
|
539
539
|
},
|
|
540
540
|
'& h4': {
|
|
@@ -543,7 +543,7 @@ const headingsSharedStylesWithEditorUGC = css({
|
|
|
543
543
|
marginTop: "var(--ds-space-250, 1.25em)",
|
|
544
544
|
'& strong': {
|
|
545
545
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
546
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
546
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
547
547
|
}
|
|
548
548
|
},
|
|
549
549
|
'& h5': {
|
|
@@ -554,7 +554,7 @@ const headingsSharedStylesWithEditorUGC = css({
|
|
|
554
554
|
textTransform: 'none',
|
|
555
555
|
'& strong': {
|
|
556
556
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
557
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
557
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
558
558
|
}
|
|
559
559
|
},
|
|
560
560
|
'& h6': {
|
|
@@ -565,7 +565,7 @@ const headingsSharedStylesWithEditorUGC = css({
|
|
|
565
565
|
textTransform: 'none',
|
|
566
566
|
'& strong': {
|
|
567
567
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
568
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
568
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
});
|
|
@@ -822,7 +822,7 @@ const codeMarkSharedStyles = css({
|
|
|
822
822
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
823
823
|
fontSize: '0.875em',
|
|
824
824
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
825
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
825
|
+
fontFamily: "var(--ds-font-family-code, \"Atlassian Mono\", ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
826
826
|
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
827
827
|
backgroundColor: `var(--ds--code--bg-color,${`var(--ds-background-neutral, ${N20})`})`,
|
|
828
828
|
color: `var(--ds-text, ${N800})`,
|
|
@@ -1035,7 +1035,7 @@ const headerSmartCardStyles = css({
|
|
|
1035
1035
|
});
|
|
1036
1036
|
const baseOtherStyles = css({
|
|
1037
1037
|
'& .UnknownBlock': {
|
|
1038
|
-
fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
1038
|
+
fontFamily: "var(--ds-font-family-body, \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
1039
1039
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
1040
1040
|
fontSize: `${14 / 16}rem`,
|
|
1041
1041
|
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
@@ -2050,6 +2050,7 @@ const denseStyles = css({
|
|
|
2050
2050
|
const syncBlockStyles = css({
|
|
2051
2051
|
[`.${SyncBlockSharedCssClassName.renderer}, .${BodiedSyncBlockSharedCssClassName.renderer}, .${SyncBlockSharedCssClassName.error}, .${SyncBlockSharedCssClassName.loading}`]: {
|
|
2052
2052
|
borderRadius: "var(--ds-radius-small, 3px)",
|
|
2053
|
+
marginTop: "var(--ds-space-075, 6px)",
|
|
2053
2054
|
paddingBlock: "var(--ds-space-150, 12px)"
|
|
2054
2055
|
},
|
|
2055
2056
|
[`.${SyncBlockSharedCssClassName.renderer}`]: {
|
|
@@ -56,7 +56,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
56
56
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
57
57
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
58
58
|
const packageName = "@atlaskit/renderer";
|
|
59
|
-
const packageVersion = "125.
|
|
59
|
+
const packageVersion = "125.4.1";
|
|
60
60
|
const setAsQueryContainerStyles = css({
|
|
61
61
|
containerName: 'ak-renderer-wrapper',
|
|
62
62
|
containerType: 'inline-size'
|
|
@@ -262,7 +262,8 @@ export const RendererFunctionalComponent = props => {
|
|
|
262
262
|
textHighlighter: props.textHighlighter || props.UNSTABLE_textHighlighter,
|
|
263
263
|
allowTableAlignment: props.UNSTABLE_allowTableAlignment,
|
|
264
264
|
allowTableResizing: props.UNSTABLE_allowTableResizing,
|
|
265
|
-
disableTableOverflowShadow: props.disableTableOverflowShadow
|
|
265
|
+
disableTableOverflowShadow: props.disableTableOverflowShadow,
|
|
266
|
+
shouldDisplayExtensionAsInline: props.shouldDisplayExtensionAsInline
|
|
266
267
|
};
|
|
267
268
|
}, [createRendererContext, providerFactory, fireAnalyticsEvent]);
|
|
268
269
|
const serializer = useMemoFromPropsDerivative(serializerProps => {
|
package/dist/esm/react/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import { insideBlockNode, insideBreakoutExpand, insideBreakoutLayout, insideMult
|
|
|
25
25
|
import { renderTextSegments } from './utils/render-text-segments';
|
|
26
26
|
import { segmentText } from './utils/segment-text';
|
|
27
27
|
import { getStandaloneBackgroundColorMarks } from './utils/getStandaloneBackgroundColorMarks';
|
|
28
|
+
import { mergeInlinedExtension } from './utils/merge-inlined-extension';
|
|
28
29
|
function mergeMarks(marksAndNodes) {
|
|
29
30
|
return marksAndNodes.reduce(function (acc, markOrNode) {
|
|
30
31
|
var prev = acc.length && acc[acc.length - 1] || null;
|
|
@@ -214,6 +215,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
214
215
|
this.isPresentational = init.isPresentational;
|
|
215
216
|
this.disableTableOverflowShadow = init.disableTableOverflowShadow;
|
|
216
217
|
this.onSetLinkTarget = init.onSetLinkTarget;
|
|
218
|
+
this.shouldDisplayExtensionAsInline = init.shouldDisplayExtensionAsInline;
|
|
217
219
|
}
|
|
218
220
|
return _createClass(ReactSerializer, [{
|
|
219
221
|
key: "resetState",
|
|
@@ -289,7 +291,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
289
291
|
if (key === 'root-0') {
|
|
290
292
|
this.resetState();
|
|
291
293
|
}
|
|
292
|
-
return this.renderNode(target, props, key,
|
|
294
|
+
return this.renderNode(target, props, key, this.getChildNodes(fragment).map(function (node, index) {
|
|
293
295
|
if (isTextWrapper(node)) {
|
|
294
296
|
return _this2.serializeTextWrapper(node.content, {
|
|
295
297
|
index: index,
|
|
@@ -524,7 +526,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
524
526
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
525
527
|
return _objectSpread(_objectSpread({}, this.getProps(node, path)), {}, {
|
|
526
528
|
extensionViewportSizes: this.extensionViewportSizes,
|
|
527
|
-
nodeHeight: (_this$getExtensionHei = this.getExtensionHeight) === null || _this$getExtensionHei === void 0 ? void 0 : _this$getExtensionHei.call(this, node)
|
|
529
|
+
nodeHeight: (_this$getExtensionHei = this.getExtensionHeight) === null || _this$getExtensionHei === void 0 ? void 0 : _this$getExtensionHei.call(this, node),
|
|
530
|
+
shouldDisplayExtensionAsInline: this.shouldDisplayExtensionAsInline
|
|
528
531
|
});
|
|
529
532
|
}
|
|
530
533
|
}, {
|
|
@@ -753,16 +756,23 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
753
756
|
}
|
|
754
757
|
return this.getUniqueHeadingId(baseId, headingIds, ++counter);
|
|
755
758
|
}
|
|
756
|
-
}
|
|
759
|
+
}, {
|
|
757
760
|
key: "getChildNodes",
|
|
758
761
|
value: function getChildNodes(fragment) {
|
|
759
762
|
var children = [];
|
|
760
763
|
fragment.forEach(function (node) {
|
|
761
764
|
children.push(node);
|
|
762
765
|
});
|
|
763
|
-
|
|
766
|
+
children = mergeTextNodes(children);
|
|
767
|
+
if (!!this.shouldDisplayExtensionAsInline && expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true)) {
|
|
768
|
+
children = mergeInlinedExtension({
|
|
769
|
+
nodes: children,
|
|
770
|
+
shouldDisplayExtensionAsInline: this.shouldDisplayExtensionAsInline
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
return children;
|
|
764
774
|
}
|
|
765
|
-
}, {
|
|
775
|
+
}], [{
|
|
766
776
|
key: "getMarks",
|
|
767
777
|
value: function getMarks(node) {
|
|
768
778
|
if (!node.marks || node.marks.length === 0) {
|
|
@@ -34,7 +34,7 @@ var codeBlockSharedStyles = css(_defineProperty(_defineProperty(_defineProperty(
|
|
|
34
34
|
backgroundColor: "var(--ds-surface-raised, #FFFFFF)",
|
|
35
35
|
borderRadius: "var(--ds-radius-small, 3px)",
|
|
36
36
|
margin: "".concat(blockNodesVerticalMargin, " 0 0 0"),
|
|
37
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
37
|
+
fontFamily: "var(--ds-font-family-code, \"Atlassian Mono\", ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
38
38
|
minWidth: "".concat(akEditorTableCellMinWidth, "px"),
|
|
39
39
|
cursor: 'pointer',
|
|
40
40
|
clear: 'both',
|
|
@@ -115,7 +115,9 @@ export var addSortableColumn = function addSortableColumn(rows, tableOrderStatus
|
|
|
115
115
|
return row;
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
-
export var isHeaderRowEnabled = function isHeaderRowEnabled(rows
|
|
118
|
+
export var isHeaderRowEnabled = function isHeaderRowEnabled(rows
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
120
|
+
) {
|
|
119
121
|
if (!rows.length) {
|
|
120
122
|
return false;
|
|
121
123
|
}
|
|
@@ -132,7 +134,9 @@ export var isHeaderRowEnabled = function isHeaderRowEnabled(rows) {
|
|
|
132
134
|
return node.type === TableHeader;
|
|
133
135
|
});
|
|
134
136
|
};
|
|
135
|
-
export var tableCanBeSticky = function tableCanBeSticky(node, children
|
|
137
|
+
export var tableCanBeSticky = function tableCanBeSticky(node, children
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
|
+
) {
|
|
136
140
|
return isHeaderRowEnabled(children) && node && node.firstChild && !hasRowspan(node.firstChild);
|
|
137
141
|
};
|
|
138
142
|
/**
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
|
+
/**
|
|
5
|
+
* Merges extensions (displayed as inline) with adjacent textblocks
|
|
6
|
+
*
|
|
7
|
+
* Input:
|
|
8
|
+
* [
|
|
9
|
+
* { type: 'paragraph', content: [ { type: 'text', text: 'Hello' } ] },
|
|
10
|
+
* { type: 'bodiedExtension', content: [ { type: 'text', text: 'World' } ] },
|
|
11
|
+
* { type: 'paragraph', content: [ { type: 'text', text: '!' } ] },
|
|
12
|
+
* ]
|
|
13
|
+
*
|
|
14
|
+
* Output:
|
|
15
|
+
* [
|
|
16
|
+
* { type: 'paragraph', content: [
|
|
17
|
+
* { type: 'text', text: 'Hello' },
|
|
18
|
+
* { type: 'bodiedExtension', content: [ { type: 'text', text: 'World' } ] },
|
|
19
|
+
* { type: 'text', text: '!' }
|
|
20
|
+
* ] },
|
|
21
|
+
* ]
|
|
22
|
+
*/
|
|
23
|
+
export function mergeInlinedExtension(_ref) {
|
|
24
|
+
var nodes = _ref.nodes,
|
|
25
|
+
shouldDisplayExtensionAsInline = _ref.shouldDisplayExtensionAsInline;
|
|
26
|
+
function isInlineBodiedExtension(node) {
|
|
27
|
+
var _node$attrs, _node$attrs2, _node$attrs3, _node$attrs4;
|
|
28
|
+
return Boolean((node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && shouldDisplayExtensionAsInline({
|
|
29
|
+
type: node.type.name,
|
|
30
|
+
extensionKey: (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey,
|
|
31
|
+
extensionType: (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionType,
|
|
32
|
+
parameters: (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.parameters,
|
|
33
|
+
content: node.content,
|
|
34
|
+
localId: (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.localId
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
// if it's [inlinedBodiedExtension], wrap it in a textblock
|
|
39
|
+
if (nodes.length === 1 && isInlineBodiedExtension(nodes[0])) {
|
|
40
|
+
return [nodes[0].type.schema.nodes.paragraph.create(null, nodes[0])];
|
|
41
|
+
}
|
|
42
|
+
var newNodes = [];
|
|
43
|
+
var _iterator = _createForOfIteratorHelper(nodes),
|
|
44
|
+
_step;
|
|
45
|
+
try {
|
|
46
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
47
|
+
var node = _step.value;
|
|
48
|
+
var previousNode = newNodes[newNodes.length - 1];
|
|
49
|
+
|
|
50
|
+
// first node
|
|
51
|
+
if (!previousNode) {
|
|
52
|
+
newNodes.push(node);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// textblock + inlinedBodiedExtension
|
|
57
|
+
if (isInlineBodiedExtension(node) && previousNode.isTextblock) {
|
|
58
|
+
newNodes[newNodes.length - 1] = previousNode.copy(previousNode.content.addToEnd(node));
|
|
59
|
+
}
|
|
60
|
+
// textblock(..., inlinedBodiedExtension) + textblock
|
|
61
|
+
else if (node.isTextblock && previousNode.isTextblock && isInlineBodiedExtension(previousNode.content.lastChild)) {
|
|
62
|
+
newNodes[newNodes.length - 1] = previousNode.copy(previousNode.content.append(node.content));
|
|
63
|
+
}
|
|
64
|
+
// inlinedBodiedExtension + textblock
|
|
65
|
+
else if (isInlineBodiedExtension(previousNode) && node.isTextblock) {
|
|
66
|
+
newNodes[newNodes.length - 1] = node.copy(node.content.addToStart(previousNode));
|
|
67
|
+
}
|
|
68
|
+
// inlinedBodiedExtension + non-textblock
|
|
69
|
+
else if (isInlineBodiedExtension(previousNode) && !node.isTextblock) {
|
|
70
|
+
newNodes[newNodes.length - 1] = node.type.schema.nodes.paragraph.create(null, previousNode);
|
|
71
|
+
newNodes.push(node);
|
|
72
|
+
}
|
|
73
|
+
// default case
|
|
74
|
+
else {
|
|
75
|
+
newNodes.push(node);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} catch (err) {
|
|
79
|
+
_iterator.e(err);
|
|
80
|
+
} finally {
|
|
81
|
+
_iterator.f();
|
|
82
|
+
}
|
|
83
|
+
return newNodes;
|
|
84
|
+
} catch (_unused) {}
|
|
85
|
+
return nodes;
|
|
86
|
+
}
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -13,7 +13,6 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
import React, { Component, useContext } from 'react';
|
|
15
15
|
import { filter } from '@atlaskit/adf-utils/traverse';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { Card as CardAsync, CardSync, CardLoading, CardError } from '@atlaskit/media-card';
|
|
18
17
|
import { MediaClientContext } from '@atlaskit/media-client-react';
|
|
19
18
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
@@ -238,7 +237,7 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
238
237
|
|
|
239
238
|
// we need this statement for the mandatory mediaClientConfig below
|
|
240
239
|
var mediaClientConfig = mediaClient === null || mediaClient === void 0 ? void 0 : mediaClient.mediaClientConfig;
|
|
241
|
-
var Card = enableSyncMediaCard
|
|
240
|
+
var Card = enableSyncMediaCard ? CardSync : CardAsync;
|
|
242
241
|
return (
|
|
243
242
|
/*#__PURE__*/
|
|
244
243
|
// Ignored via go/ees005
|
|
@@ -320,7 +319,7 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
320
319
|
collectionName: collection,
|
|
321
320
|
occurrenceKey: occurrenceKey
|
|
322
321
|
};
|
|
323
|
-
var Card = enableSyncMediaCard
|
|
322
|
+
var Card = enableSyncMediaCard ? CardSync : CardAsync;
|
|
324
323
|
|
|
325
324
|
// Quick solution to disable lazy loading of images on PDF export pages in Confluence to remedy an issue with images never loading
|
|
326
325
|
// More robust solution will be implemented as part of CCPDF-233 - Link: https://hello.jira.atlassian.cloud/browse/CCPDF-233
|
|
@@ -232,7 +232,7 @@ var telepointerStyles = css(_defineProperty({}, "#".concat(TELEPOINTER_ID), {
|
|
|
232
232
|
left: 0,
|
|
233
233
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
234
234
|
fontSize: '10px',
|
|
235
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
235
|
+
fontWeight: "var(--ds-font-weight-bold, 653)",
|
|
236
236
|
width: '12.5px',
|
|
237
237
|
height: '13px',
|
|
238
238
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
@@ -269,7 +269,7 @@ var rovoTelepointerStyles = css(_defineProperty({}, "#".concat(TELEPOINTER_ID),
|
|
|
269
269
|
'&::before': {
|
|
270
270
|
content: '"Rovo"',
|
|
271
271
|
position: 'absolute',
|
|
272
|
-
fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
272
|
+
fontFamily: "var(--ds-font-family-body, \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
273
273
|
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
274
274
|
color: "var(--ds-text-inverse, white)",
|
|
275
275
|
background: "var(--ds-text, #292A2E)",
|
|
@@ -411,7 +411,7 @@ var headingsSharedStyles = css({
|
|
|
411
411
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
412
412
|
lineHeight: 16 / 11,
|
|
413
413
|
color: "var(--ds-text-subtlest, #6B6E76)",
|
|
414
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
414
|
+
fontWeight: "var(--ds-font-weight-bold, 653)",
|
|
415
415
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
416
416
|
marginTop: '1.455em',
|
|
417
417
|
textTransform: 'none'
|
|
@@ -426,7 +426,7 @@ var headingsSharedStylesWithEditorUGC = css({
|
|
|
426
426
|
marginTop: '1.45833em',
|
|
427
427
|
'& strong': {
|
|
428
428
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
429
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
429
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
430
430
|
},
|
|
431
431
|
'&::before': {}
|
|
432
432
|
},
|
|
@@ -438,7 +438,7 @@ var headingsSharedStylesWithEditorUGC = css({
|
|
|
438
438
|
marginBottom: 0,
|
|
439
439
|
'& strong': {
|
|
440
440
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
441
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
441
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
442
442
|
}
|
|
443
443
|
},
|
|
444
444
|
'& h3': {
|
|
@@ -449,7 +449,7 @@ var headingsSharedStylesWithEditorUGC = css({
|
|
|
449
449
|
marginBottom: 0,
|
|
450
450
|
'& strong': {
|
|
451
451
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
452
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
452
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
453
453
|
}
|
|
454
454
|
},
|
|
455
455
|
'& h4': {
|
|
@@ -458,7 +458,7 @@ var headingsSharedStylesWithEditorUGC = css({
|
|
|
458
458
|
marginTop: "var(--ds-space-250, 1.25em)",
|
|
459
459
|
'& strong': {
|
|
460
460
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
461
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
461
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
462
462
|
}
|
|
463
463
|
},
|
|
464
464
|
'& h5': {
|
|
@@ -469,7 +469,7 @@ var headingsSharedStylesWithEditorUGC = css({
|
|
|
469
469
|
textTransform: 'none',
|
|
470
470
|
'& strong': {
|
|
471
471
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
472
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
472
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
473
473
|
}
|
|
474
474
|
},
|
|
475
475
|
'& h6': {
|
|
@@ -480,7 +480,7 @@ var headingsSharedStylesWithEditorUGC = css({
|
|
|
480
480
|
textTransform: 'none',
|
|
481
481
|
'& strong': {
|
|
482
482
|
// set all heading bold style to token font.weight.bold, as not matter what typography is used, the editorUGCToken will return the font weight 700
|
|
483
|
-
fontWeight: "var(--ds-font-weight-bold,
|
|
483
|
+
fontWeight: "var(--ds-font-weight-bold, 653)"
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
});
|
|
@@ -706,7 +706,7 @@ var codeMarkSharedStyles = css({
|
|
|
706
706
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
707
707
|
fontSize: '0.875em',
|
|
708
708
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
709
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
709
|
+
fontFamily: "var(--ds-font-family-code, \"Atlassian Mono\", ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
710
710
|
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
711
711
|
backgroundColor: "var(--ds--code--bg-color,".concat("var(--ds-background-neutral, ".concat(N20, ")"), ")"),
|
|
712
712
|
color: "var(--ds-text, ".concat(N800, ")"),
|
|
@@ -889,7 +889,7 @@ var headerSmartCardStyles = css({
|
|
|
889
889
|
});
|
|
890
890
|
var baseOtherStyles = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
891
891
|
'& .UnknownBlock': {
|
|
892
|
-
fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
892
|
+
fontFamily: "var(--ds-font-family-body, \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
893
893
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
894
894
|
fontSize: "".concat(14 / 16, "rem"),
|
|
895
895
|
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
@@ -1619,6 +1619,7 @@ var denseStyles = css(_defineProperty(_defineProperty(_defineProperty({}, ".".co
|
|
|
1619
1619
|
}));
|
|
1620
1620
|
var syncBlockStyles = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(SyncBlockSharedCssClassName.renderer, ", .").concat(BodiedSyncBlockSharedCssClassName.renderer, ", .").concat(SyncBlockSharedCssClassName.error, ", .").concat(SyncBlockSharedCssClassName.loading), {
|
|
1621
1621
|
borderRadius: "var(--ds-radius-small, 3px)",
|
|
1622
|
+
marginTop: "var(--ds-space-075, 6px)",
|
|
1622
1623
|
paddingBlock: "var(--ds-space-150, 12px)"
|
|
1623
1624
|
}), ".".concat(SyncBlockSharedCssClassName.renderer), {
|
|
1624
1625
|
// First child node in syncBlock in editor is overridden with marginTop: 0, hence apply the same style in renderer for consistency
|
|
@@ -61,7 +61,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
61
61
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
62
62
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
63
63
|
var packageName = "@atlaskit/renderer";
|
|
64
|
-
var packageVersion = "125.
|
|
64
|
+
var packageVersion = "125.4.1";
|
|
65
65
|
var setAsQueryContainerStyles = css({
|
|
66
66
|
containerName: 'ak-renderer-wrapper',
|
|
67
67
|
containerType: 'inline-size'
|
|
@@ -259,7 +259,8 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
259
259
|
textHighlighter: props.textHighlighter || props.UNSTABLE_textHighlighter,
|
|
260
260
|
allowTableAlignment: props.UNSTABLE_allowTableAlignment,
|
|
261
261
|
allowTableResizing: props.UNSTABLE_allowTableResizing,
|
|
262
|
-
disableTableOverflowShadow: props.disableTableOverflowShadow
|
|
262
|
+
disableTableOverflowShadow: props.disableTableOverflowShadow,
|
|
263
|
+
shouldDisplayExtensionAsInline: props.shouldDisplayExtensionAsInline
|
|
263
264
|
};
|
|
264
265
|
}, [createRendererContext, providerFactory, _fireAnalyticsEvent]);
|
|
265
266
|
var serializer = useMemoFromPropsDerivative(function (serializerProps) {
|
|
@@ -3,8 +3,7 @@ import type { Fragment, Mark, Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
4
4
|
import type { Serializer } from '../serializer';
|
|
5
5
|
import type { HeadingAnchorLinksProps, NodeComponentsProps, RendererAppearance, RendererContentMode, StickyHeaderConfig } from '../ui/Renderer/types';
|
|
6
|
-
import type {
|
|
7
|
-
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
6
|
+
import type { ExtensionHandlers, ExtensionParams, Parameters } from '@atlaskit/editor-common/extensions';
|
|
8
7
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
8
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
10
9
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
@@ -44,6 +43,7 @@ export interface ReactSerializerInit {
|
|
|
44
43
|
onSetLinkTarget?: (url: string) => '_blank' | undefined;
|
|
45
44
|
portal?: HTMLElement;
|
|
46
45
|
providers?: ProviderFactory;
|
|
46
|
+
shouldDisplayExtensionAsInline?: (extensionParams: ExtensionParams<Parameters>) => boolean;
|
|
47
47
|
shouldOpenMediaViewer?: boolean;
|
|
48
48
|
smartLinks?: SmartLinksOptions;
|
|
49
49
|
/**
|
|
@@ -112,6 +112,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
112
112
|
private disableTableOverflowShadow?;
|
|
113
113
|
private standaloneBackgroundColorMarks;
|
|
114
114
|
private onSetLinkTarget?;
|
|
115
|
+
private shouldDisplayExtensionAsInline?;
|
|
115
116
|
constructor(init: ReactSerializerInit);
|
|
116
117
|
private resetState;
|
|
117
118
|
private getNodeProps;
|
|
@@ -147,7 +148,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
147
148
|
private getUniqueHeadingId;
|
|
148
149
|
private getAnnotationMarkProps;
|
|
149
150
|
private getMarkProps;
|
|
150
|
-
|
|
151
|
+
private getChildNodes;
|
|
151
152
|
static getMarks(node: Node): Mark[];
|
|
152
153
|
static buildMarkStructure(content: Node[]): Mark[];
|
|
153
154
|
static fromSchema(_: unknown, init: ReactSerializerInit): ReactSerializer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ExtensionParams, Parameters } from '@atlaskit/editor-common/extensions';
|
|
3
|
+
/**
|
|
4
|
+
* Merges extensions (displayed as inline) with adjacent textblocks
|
|
5
|
+
*
|
|
6
|
+
* Input:
|
|
7
|
+
* [
|
|
8
|
+
* { type: 'paragraph', content: [ { type: 'text', text: 'Hello' } ] },
|
|
9
|
+
* { type: 'bodiedExtension', content: [ { type: 'text', text: 'World' } ] },
|
|
10
|
+
* { type: 'paragraph', content: [ { type: 'text', text: '!' } ] },
|
|
11
|
+
* ]
|
|
12
|
+
*
|
|
13
|
+
* Output:
|
|
14
|
+
* [
|
|
15
|
+
* { type: 'paragraph', content: [
|
|
16
|
+
* { type: 'text', text: 'Hello' },
|
|
17
|
+
* { type: 'bodiedExtension', content: [ { type: 'text', text: 'World' } ] },
|
|
18
|
+
* { type: 'text', text: '!' }
|
|
19
|
+
* ] },
|
|
20
|
+
* ]
|
|
21
|
+
*/
|
|
22
|
+
export declare function mergeInlinedExtension({ nodes, shouldDisplayExtensionAsInline, }: {
|
|
23
|
+
nodes: PMNode[];
|
|
24
|
+
shouldDisplayExtensionAsInline: (extensionParams: ExtensionParams<Parameters>) => boolean;
|
|
25
|
+
}): PMNode[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
3
|
+
import type { ExtensionHandlers, ExtensionParams, Parameters } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { AnnotationProviders } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
@@ -135,6 +135,12 @@ export interface RendererProps {
|
|
|
135
135
|
portal?: HTMLElement;
|
|
136
136
|
rendererContext?: RendererContext;
|
|
137
137
|
schema?: Schema;
|
|
138
|
+
/**
|
|
139
|
+
* Determines if the extension should be displayed as inline based on the extension parameters.
|
|
140
|
+
* @param extensionParams - The extension parameters.
|
|
141
|
+
* @returns True if the extension should be displayed as inline, false otherwise.
|
|
142
|
+
*/
|
|
143
|
+
shouldDisplayExtensionAsInline?: (extensionParams: ExtensionParams<Parameters>) => boolean;
|
|
138
144
|
shouldOpenMediaViewer?: boolean;
|
|
139
145
|
shouldRemoveEmptySpaceAroundContent?: boolean;
|
|
140
146
|
smartLinks?: SmartLinksOptions;
|
|
@@ -3,8 +3,7 @@ import type { Fragment, Mark, Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
4
4
|
import type { Serializer } from '../serializer';
|
|
5
5
|
import type { HeadingAnchorLinksProps, NodeComponentsProps, RendererAppearance, RendererContentMode, StickyHeaderConfig } from '../ui/Renderer/types';
|
|
6
|
-
import type {
|
|
7
|
-
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
6
|
+
import type { ExtensionHandlers, ExtensionParams, Parameters } from '@atlaskit/editor-common/extensions';
|
|
8
7
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
8
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
10
9
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
@@ -44,6 +43,7 @@ export interface ReactSerializerInit {
|
|
|
44
43
|
onSetLinkTarget?: (url: string) => '_blank' | undefined;
|
|
45
44
|
portal?: HTMLElement;
|
|
46
45
|
providers?: ProviderFactory;
|
|
46
|
+
shouldDisplayExtensionAsInline?: (extensionParams: ExtensionParams<Parameters>) => boolean;
|
|
47
47
|
shouldOpenMediaViewer?: boolean;
|
|
48
48
|
smartLinks?: SmartLinksOptions;
|
|
49
49
|
/**
|
|
@@ -112,6 +112,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
112
112
|
private disableTableOverflowShadow?;
|
|
113
113
|
private standaloneBackgroundColorMarks;
|
|
114
114
|
private onSetLinkTarget?;
|
|
115
|
+
private shouldDisplayExtensionAsInline?;
|
|
115
116
|
constructor(init: ReactSerializerInit);
|
|
116
117
|
private resetState;
|
|
117
118
|
private getNodeProps;
|
|
@@ -147,7 +148,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
147
148
|
private getUniqueHeadingId;
|
|
148
149
|
private getAnnotationMarkProps;
|
|
149
150
|
private getMarkProps;
|
|
150
|
-
|
|
151
|
+
private getChildNodes;
|
|
151
152
|
static getMarks(node: Node): Mark[];
|
|
152
153
|
static buildMarkStructure(content: Node[]): Mark[];
|
|
153
154
|
static fromSchema(_: unknown, init: ReactSerializerInit): ReactSerializer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ExtensionParams, Parameters } from '@atlaskit/editor-common/extensions';
|
|
3
|
+
/**
|
|
4
|
+
* Merges extensions (displayed as inline) with adjacent textblocks
|
|
5
|
+
*
|
|
6
|
+
* Input:
|
|
7
|
+
* [
|
|
8
|
+
* { type: 'paragraph', content: [ { type: 'text', text: 'Hello' } ] },
|
|
9
|
+
* { type: 'bodiedExtension', content: [ { type: 'text', text: 'World' } ] },
|
|
10
|
+
* { type: 'paragraph', content: [ { type: 'text', text: '!' } ] },
|
|
11
|
+
* ]
|
|
12
|
+
*
|
|
13
|
+
* Output:
|
|
14
|
+
* [
|
|
15
|
+
* { type: 'paragraph', content: [
|
|
16
|
+
* { type: 'text', text: 'Hello' },
|
|
17
|
+
* { type: 'bodiedExtension', content: [ { type: 'text', text: 'World' } ] },
|
|
18
|
+
* { type: 'text', text: '!' }
|
|
19
|
+
* ] },
|
|
20
|
+
* ]
|
|
21
|
+
*/
|
|
22
|
+
export declare function mergeInlinedExtension({ nodes, shouldDisplayExtensionAsInline, }: {
|
|
23
|
+
nodes: PMNode[];
|
|
24
|
+
shouldDisplayExtensionAsInline: (extensionParams: ExtensionParams<Parameters>) => boolean;
|
|
25
|
+
}): PMNode[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
3
|
+
import type { ExtensionHandlers, ExtensionParams, Parameters } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { AnnotationProviders } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
@@ -135,6 +135,12 @@ export interface RendererProps {
|
|
|
135
135
|
portal?: HTMLElement;
|
|
136
136
|
rendererContext?: RendererContext;
|
|
137
137
|
schema?: Schema;
|
|
138
|
+
/**
|
|
139
|
+
* Determines if the extension should be displayed as inline based on the extension parameters.
|
|
140
|
+
* @param extensionParams - The extension parameters.
|
|
141
|
+
* @returns True if the extension should be displayed as inline, false otherwise.
|
|
142
|
+
*/
|
|
143
|
+
shouldDisplayExtensionAsInline?: (extensionParams: ExtensionParams<Parameters>) => boolean;
|
|
138
144
|
shouldOpenMediaViewer?: boolean;
|
|
139
145
|
shouldRemoveEmptySpaceAroundContent?: boolean;
|
|
140
146
|
smartLinks?: SmartLinksOptions;
|