@atlaskit/renderer 133.16.0 → 133.16.2
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 +21 -0
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/collapsible-headings.js +9 -3
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/collapsible-headings.js +9 -3
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/collapsible-headings.js +9 -3
- package/package.json +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 133.16.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8e4275326153d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e4275326153d) -
|
|
8
|
+
[ux] Fixes an issue where heading couldn't collapse when sync blocks is partially visible.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 133.16.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`d7a60d4dc93f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d7a60d4dc93f0) -
|
|
16
|
+
Fix embed cards collapsing to 0 height in host renderers (e.g. Jira issue view). When an embed
|
|
17
|
+
uses the aspect-ratio (padding-bottom) sizing and the resolved pixel width is 0/NaN - which
|
|
18
|
+
happens when `lineLength`/`editorWidth` is unavailable in the host render context - the ratio
|
|
19
|
+
becomes `NaN`, producing an invalid `calc(NaN% + 32px)` that the browser drops, collapsing the
|
|
20
|
+
embed. `MediaSingle` now falls back to the embed's absolute height in that case. Guarded by
|
|
21
|
+
`platform_editor_embed_height_only_fallback`.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 133.16.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -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 = "133.
|
|
76
|
+
var packageVersion = "133.16.1";
|
|
77
77
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
78
78
|
containerName: 'ak-renderer-wrapper',
|
|
79
79
|
containerType: 'inline-size'
|
|
@@ -16,6 +16,10 @@ var _collapsibleHeadingsSectionModel = require("./collapsible-headings-section-m
|
|
|
16
16
|
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); }
|
|
17
17
|
var CollapsibleHeadingsContext = /*#__PURE__*/_react.default.createContext(null);
|
|
18
18
|
var emptyCollapsedHeadings = new Set();
|
|
19
|
+
function isSameDocument(currentDocument, nextDocument) {
|
|
20
|
+
// Renderer reparses equivalent ADF on parent rerenders, so object identity is not stable.
|
|
21
|
+
return currentDocument === nextDocument || Boolean(currentDocument && nextDocument && currentDocument.eq(nextDocument));
|
|
22
|
+
}
|
|
19
23
|
function supportsHiddenUntilFound(rendererRef) {
|
|
20
24
|
var _rendererRef$current;
|
|
21
25
|
var body = (_rendererRef$current = rendererRef.current) === null || _rendererRef$current === void 0 ? void 0 : _rendererRef$current.ownerDocument.body;
|
|
@@ -50,16 +54,18 @@ function CollapsibleHeadingsProvider(_ref) {
|
|
|
50
54
|
return section.headingPos;
|
|
51
55
|
}));
|
|
52
56
|
}, [sections]);
|
|
53
|
-
var
|
|
57
|
+
var isCurrentDocument = isSameDocument(state.pmDocument, pmDocument);
|
|
58
|
+
var collapsedHeadings = isCurrentDocument ? state.positions : emptyCollapsedHeadings;
|
|
54
59
|
var isActive = isEnabled && isBrowserFindSupported && Boolean(pmDocument);
|
|
55
60
|
(0, _react.useEffect)(function () {
|
|
56
61
|
setIsBrowserFindSupported(isEnabled && supportsHiddenUntilFound(rendererRef));
|
|
57
62
|
}, [isEnabled, rendererRef]);
|
|
58
63
|
var updateCollapsedHeadings = (0, _react.useCallback)(function (update) {
|
|
59
64
|
setState(function (currentState) {
|
|
60
|
-
var
|
|
65
|
+
var isStillCurrentDocument = isSameDocument(currentState.pmDocument, pmDocument);
|
|
66
|
+
var positions = new Set(isStillCurrentDocument ? currentState.positions : emptyCollapsedHeadings);
|
|
61
67
|
if (!update(positions)) {
|
|
62
|
-
return
|
|
68
|
+
return isStillCurrentDocument ? currentState : {
|
|
63
69
|
pmDocument: pmDocument,
|
|
64
70
|
positions: positions
|
|
65
71
|
};
|
|
@@ -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 = "133.
|
|
62
|
+
const packageVersion = "133.16.1";
|
|
63
63
|
const setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
|
@@ -4,6 +4,10 @@ import { COLLAPSED_CONTENT_OWNERS_ATTRIBUTE, getCollapsedContentOwners, getOwned
|
|
|
4
4
|
import { buildTopLevelHeadingSections } from './collapsible-headings-section-model';
|
|
5
5
|
const CollapsibleHeadingsContext = /*#__PURE__*/React.createContext(null);
|
|
6
6
|
const emptyCollapsedHeadings = new Set();
|
|
7
|
+
function isSameDocument(currentDocument, nextDocument) {
|
|
8
|
+
// Renderer reparses equivalent ADF on parent rerenders, so object identity is not stable.
|
|
9
|
+
return currentDocument === nextDocument || Boolean(currentDocument && nextDocument && currentDocument.eq(nextDocument));
|
|
10
|
+
}
|
|
7
11
|
function supportsHiddenUntilFound(rendererRef) {
|
|
8
12
|
var _rendererRef$current;
|
|
9
13
|
const body = (_rendererRef$current = rendererRef.current) === null || _rendererRef$current === void 0 ? void 0 : _rendererRef$current.ownerDocument.body;
|
|
@@ -25,16 +29,18 @@ export function CollapsibleHeadingsProvider({
|
|
|
25
29
|
const originalHiddenAttributes = React.useRef(new WeakMap()).current;
|
|
26
30
|
const sections = useMemo(() => buildTopLevelHeadingSections(pmDocument), [pmDocument]);
|
|
27
31
|
const collapsibleSectionPositions = useMemo(() => new Set(sections.filter(section => section.contentFrom < section.to).map(section => section.headingPos)), [sections]);
|
|
28
|
-
const
|
|
32
|
+
const isCurrentDocument = isSameDocument(state.pmDocument, pmDocument);
|
|
33
|
+
const collapsedHeadings = isCurrentDocument ? state.positions : emptyCollapsedHeadings;
|
|
29
34
|
const isActive = isEnabled && isBrowserFindSupported && Boolean(pmDocument);
|
|
30
35
|
useEffect(() => {
|
|
31
36
|
setIsBrowserFindSupported(isEnabled && supportsHiddenUntilFound(rendererRef));
|
|
32
37
|
}, [isEnabled, rendererRef]);
|
|
33
38
|
const updateCollapsedHeadings = useCallback(update => {
|
|
34
39
|
setState(currentState => {
|
|
35
|
-
const
|
|
40
|
+
const isStillCurrentDocument = isSameDocument(currentState.pmDocument, pmDocument);
|
|
41
|
+
const positions = new Set(isStillCurrentDocument ? currentState.positions : emptyCollapsedHeadings);
|
|
36
42
|
if (!update(positions)) {
|
|
37
|
-
return
|
|
43
|
+
return isStillCurrentDocument ? currentState : {
|
|
38
44
|
pmDocument,
|
|
39
45
|
positions
|
|
40
46
|
};
|
|
@@ -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 = "133.
|
|
67
|
+
var packageVersion = "133.16.1";
|
|
68
68
|
var setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -5,6 +5,10 @@ import { COLLAPSED_CONTENT_OWNERS_ATTRIBUTE, getCollapsedContentOwners, getOwned
|
|
|
5
5
|
import { buildTopLevelHeadingSections } from './collapsible-headings-section-model';
|
|
6
6
|
var CollapsibleHeadingsContext = /*#__PURE__*/React.createContext(null);
|
|
7
7
|
var emptyCollapsedHeadings = new Set();
|
|
8
|
+
function isSameDocument(currentDocument, nextDocument) {
|
|
9
|
+
// Renderer reparses equivalent ADF on parent rerenders, so object identity is not stable.
|
|
10
|
+
return currentDocument === nextDocument || Boolean(currentDocument && nextDocument && currentDocument.eq(nextDocument));
|
|
11
|
+
}
|
|
8
12
|
function supportsHiddenUntilFound(rendererRef) {
|
|
9
13
|
var _rendererRef$current;
|
|
10
14
|
var body = (_rendererRef$current = rendererRef.current) === null || _rendererRef$current === void 0 ? void 0 : _rendererRef$current.ownerDocument.body;
|
|
@@ -39,16 +43,18 @@ export function CollapsibleHeadingsProvider(_ref) {
|
|
|
39
43
|
return section.headingPos;
|
|
40
44
|
}));
|
|
41
45
|
}, [sections]);
|
|
42
|
-
var
|
|
46
|
+
var isCurrentDocument = isSameDocument(state.pmDocument, pmDocument);
|
|
47
|
+
var collapsedHeadings = isCurrentDocument ? state.positions : emptyCollapsedHeadings;
|
|
43
48
|
var isActive = isEnabled && isBrowserFindSupported && Boolean(pmDocument);
|
|
44
49
|
useEffect(function () {
|
|
45
50
|
setIsBrowserFindSupported(isEnabled && supportsHiddenUntilFound(rendererRef));
|
|
46
51
|
}, [isEnabled, rendererRef]);
|
|
47
52
|
var updateCollapsedHeadings = useCallback(function (update) {
|
|
48
53
|
setState(function (currentState) {
|
|
49
|
-
var
|
|
54
|
+
var isStillCurrentDocument = isSameDocument(currentState.pmDocument, pmDocument);
|
|
55
|
+
var positions = new Set(isStillCurrentDocument ? currentState.positions : emptyCollapsedHeadings);
|
|
50
56
|
if (!update(positions)) {
|
|
51
|
-
return
|
|
57
|
+
return isStillCurrentDocument ? currentState : {
|
|
52
58
|
pmDocument: pmDocument,
|
|
53
59
|
positions: positions
|
|
54
60
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "133.16.
|
|
3
|
+
"version": "133.16.2",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
50
50
|
"@atlaskit/icon": "^37.1.0",
|
|
51
51
|
"@atlaskit/link": "^4.3.0",
|
|
52
|
-
"@atlaskit/link-datasource": "^6.
|
|
52
|
+
"@atlaskit/link-datasource": "^6.3.0",
|
|
53
53
|
"@atlaskit/link-extractors": "^3.2.0",
|
|
54
54
|
"@atlaskit/linking-common": "^11.0.0",
|
|
55
55
|
"@atlaskit/media-card": "^81.4.0",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
|
|
65
65
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
66
66
|
"@atlaskit/react-ufo": "^7.3.0",
|
|
67
|
-
"@atlaskit/smart-card": "^45.
|
|
67
|
+
"@atlaskit/smart-card": "^45.13.0",
|
|
68
68
|
"@atlaskit/status": "^5.7.0",
|
|
69
69
|
"@atlaskit/task-decision": "^21.7.0",
|
|
70
70
|
"@atlaskit/theme": "^26.1.0",
|
|
71
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
71
|
+
"@atlaskit/tmp-editor-statsig": "^133.1.0",
|
|
72
72
|
"@atlaskit/tokens": "^16.3.0",
|
|
73
73
|
"@atlaskit/tooltip": "^23.1.0",
|
|
74
74
|
"@atlaskit/visually-hidden": "^4.2.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"uuid": "^3.1.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@atlaskit/editor-common": "^116.
|
|
86
|
+
"@atlaskit/editor-common": "^116.39.0",
|
|
87
87
|
"@atlaskit/link-provider": "^5.2.0",
|
|
88
88
|
"@atlaskit/media-core": "^38.0.0",
|
|
89
89
|
"react": "^18.2.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@atlaskit/media-test-helpers": "^42.2.0",
|
|
104
104
|
"@atlaskit/mention": "^27.10.0",
|
|
105
105
|
"@atlaskit/modal-dialog": "^16.1.0",
|
|
106
|
-
"@atlaskit/navigation-system": "^10.
|
|
106
|
+
"@atlaskit/navigation-system": "^10.8.0",
|
|
107
107
|
"@atlaskit/profilecard": "^26.13.0",
|
|
108
108
|
"@atlaskit/side-nav-items": "^2.3.0",
|
|
109
109
|
"@atlaskit/util-data-test": "^19.1.0",
|
|
@@ -274,6 +274,10 @@
|
|
|
274
274
|
"cc-maui-add-mark-for-remix-generated-images": {
|
|
275
275
|
"type": "boolean",
|
|
276
276
|
"referenceOnly": true
|
|
277
|
+
},
|
|
278
|
+
"platform_editor_embed_height_only_fallback": {
|
|
279
|
+
"type": "boolean",
|
|
280
|
+
"referenceOnly": true
|
|
277
281
|
}
|
|
278
282
|
}
|
|
279
283
|
}
|