@atlaskit/editor-plugin-show-diff 17.1.0 → 17.1.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
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 17.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fc26bfc51dd5c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fc26bfc51dd5c) -
|
|
8
|
+
Add sparse block-control surface anchors, intersection-driven candidates, and explicit visibility
|
|
9
|
+
invalidation for registry-backed block controls. Expose registration change subscriptions from the
|
|
10
|
+
UI control registry model, and refresh cached visibility from suggestion and collapse transaction
|
|
11
|
+
metadata. Under `platform_editor_block_control_migration`, use native node-anchor identity across
|
|
12
|
+
Editor and Block Controls, and route expand keyboard focus through the shared Block Controls
|
|
13
|
+
command. Preserve Show Diff visibility checks in both migration cohorts so block controls stay
|
|
14
|
+
hidden while a diff is displayed. Keep the block menu closed when a migrated layout-column handle
|
|
15
|
+
opens the layout menu, and close the layout menu when the selection moves away from its selected
|
|
16
|
+
columns.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 17.1.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [`296193f8a499b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/296193f8a499b) -
|
|
24
|
+
Keep table diff indicators aligned with the visible table edge when the viewport narrows and the
|
|
25
|
+
table scrolls horizontally, behind platform_editor_ai_show_diff_patch_2.
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 17.1.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -88,6 +88,17 @@ var edgeCases = function edgeCases(doc, from) {
|
|
|
88
88
|
if (!node.firstChild) {
|
|
89
89
|
return undefined;
|
|
90
90
|
}
|
|
91
|
+
if ((0, _fg.fg)('platform_editor_ai_show_diff_patch_2')) {
|
|
92
|
+
// The row retains its full width when the table scrolls. Centering that
|
|
93
|
+
// width against the editor would push the anchor off-screen. Measure the
|
|
94
|
+
// visible container's edge instead, including start-aligned tables.
|
|
95
|
+
return {
|
|
96
|
+
beforePos: beforePos,
|
|
97
|
+
measurePos: beforePos,
|
|
98
|
+
measureSelector: '.pm-table-container',
|
|
99
|
+
measureLeft: true
|
|
100
|
+
};
|
|
101
|
+
}
|
|
91
102
|
|
|
92
103
|
// Measure the first row (`nodeStart` is just inside the table, i.e. the
|
|
93
104
|
// position of the first row): its width matches the table's.
|
|
@@ -175,19 +186,28 @@ var createLeftAnchorWidget = exports.createLeftAnchorWidget = function createLef
|
|
|
175
186
|
var nodeDOM = view.nodeDOM(edgeCase.measurePos);
|
|
176
187
|
var dom = edgeCase.measureSelector && nodeDOM instanceof HTMLElement ? (_nodeDOM$querySelecto = nodeDOM.querySelector(edgeCase.measureSelector)) !== null && _nodeDOM$querySelecto !== void 0 ? _nodeDOM$querySelecto : nodeDOM : nodeDOM;
|
|
177
188
|
if (dom instanceof HTMLElement) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
189
|
+
var updateAnchor = function updateAnchor() {
|
|
190
|
+
if (getPos() === undefined) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (edgeCase.measureLeft) {
|
|
194
|
+
var left = dom.getBoundingClientRect().left - wrapper.getBoundingClientRect().left;
|
|
195
|
+
anchor.style.setProperty('left', "".concat(left, "px"));
|
|
196
|
+
anchor.style.setProperty('transform', 'none');
|
|
197
|
+
}
|
|
198
|
+
anchor.style.setProperty('width', "".concat(dom.offsetWidth, "px"));
|
|
199
|
+
};
|
|
200
|
+
// Align against the block's horizontal extent.
|
|
201
|
+
updateAnchor();
|
|
181
202
|
|
|
182
203
|
// Observe the measured element for size changes (e.g. page
|
|
183
204
|
// resize) so the indicator stays aligned. CCI-17981
|
|
184
205
|
if (!leftResizeObserver) {
|
|
185
|
-
leftResizeObserver = new ResizeObserver(
|
|
186
|
-
if (getPos() !== undefined) {
|
|
187
|
-
anchor.style.setProperty('width', "".concat(dom.offsetWidth, "px"));
|
|
188
|
-
}
|
|
189
|
-
});
|
|
206
|
+
leftResizeObserver = new ResizeObserver(updateAnchor);
|
|
190
207
|
leftResizeObserver.observe(dom);
|
|
208
|
+
if (edgeCase.measureLeft) {
|
|
209
|
+
leftResizeObserver.observe(wrapper);
|
|
210
|
+
}
|
|
191
211
|
}
|
|
192
212
|
}
|
|
193
213
|
};
|
|
@@ -79,6 +79,17 @@ const edgeCases = (doc, from) => {
|
|
|
79
79
|
if (!node.firstChild) {
|
|
80
80
|
return undefined;
|
|
81
81
|
}
|
|
82
|
+
if (fg('platform_editor_ai_show_diff_patch_2')) {
|
|
83
|
+
// The row retains its full width when the table scrolls. Centering that
|
|
84
|
+
// width against the editor would push the anchor off-screen. Measure the
|
|
85
|
+
// visible container's edge instead, including start-aligned tables.
|
|
86
|
+
return {
|
|
87
|
+
beforePos,
|
|
88
|
+
measurePos: beforePos,
|
|
89
|
+
measureSelector: '.pm-table-container',
|
|
90
|
+
measureLeft: true
|
|
91
|
+
};
|
|
92
|
+
}
|
|
82
93
|
|
|
83
94
|
// Measure the first row (`nodeStart` is just inside the table, i.e. the
|
|
84
95
|
// position of the first row): its width matches the table's.
|
|
@@ -169,19 +180,28 @@ export const createLeftAnchorWidget = ({
|
|
|
169
180
|
const nodeDOM = view.nodeDOM(edgeCase.measurePos);
|
|
170
181
|
const dom = edgeCase.measureSelector && nodeDOM instanceof HTMLElement ? (_nodeDOM$querySelecto = nodeDOM.querySelector(edgeCase.measureSelector)) !== null && _nodeDOM$querySelecto !== void 0 ? _nodeDOM$querySelecto : nodeDOM : nodeDOM;
|
|
171
182
|
if (dom instanceof HTMLElement) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
183
|
+
const updateAnchor = () => {
|
|
184
|
+
if (getPos() === undefined) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (edgeCase.measureLeft) {
|
|
188
|
+
const left = dom.getBoundingClientRect().left - wrapper.getBoundingClientRect().left;
|
|
189
|
+
anchor.style.setProperty('left', `${left}px`);
|
|
190
|
+
anchor.style.setProperty('transform', 'none');
|
|
191
|
+
}
|
|
192
|
+
anchor.style.setProperty('width', `${dom.offsetWidth}px`);
|
|
193
|
+
};
|
|
194
|
+
// Align against the block's horizontal extent.
|
|
195
|
+
updateAnchor();
|
|
175
196
|
|
|
176
197
|
// Observe the measured element for size changes (e.g. page
|
|
177
198
|
// resize) so the indicator stays aligned. CCI-17981
|
|
178
199
|
if (!leftResizeObserver) {
|
|
179
|
-
leftResizeObserver = new ResizeObserver(
|
|
180
|
-
if (getPos() !== undefined) {
|
|
181
|
-
anchor.style.setProperty('width', `${dom.offsetWidth}px`);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
200
|
+
leftResizeObserver = new ResizeObserver(updateAnchor);
|
|
184
201
|
leftResizeObserver.observe(dom);
|
|
202
|
+
if (edgeCase.measureLeft) {
|
|
203
|
+
leftResizeObserver.observe(wrapper);
|
|
204
|
+
}
|
|
185
205
|
}
|
|
186
206
|
}
|
|
187
207
|
};
|
|
@@ -82,6 +82,17 @@ var edgeCases = function edgeCases(doc, from) {
|
|
|
82
82
|
if (!node.firstChild) {
|
|
83
83
|
return undefined;
|
|
84
84
|
}
|
|
85
|
+
if (fg('platform_editor_ai_show_diff_patch_2')) {
|
|
86
|
+
// The row retains its full width when the table scrolls. Centering that
|
|
87
|
+
// width against the editor would push the anchor off-screen. Measure the
|
|
88
|
+
// visible container's edge instead, including start-aligned tables.
|
|
89
|
+
return {
|
|
90
|
+
beforePos: beforePos,
|
|
91
|
+
measurePos: beforePos,
|
|
92
|
+
measureSelector: '.pm-table-container',
|
|
93
|
+
measureLeft: true
|
|
94
|
+
};
|
|
95
|
+
}
|
|
85
96
|
|
|
86
97
|
// Measure the first row (`nodeStart` is just inside the table, i.e. the
|
|
87
98
|
// position of the first row): its width matches the table's.
|
|
@@ -169,19 +180,28 @@ export var createLeftAnchorWidget = function createLeftAnchorWidget(_ref) {
|
|
|
169
180
|
var nodeDOM = view.nodeDOM(edgeCase.measurePos);
|
|
170
181
|
var dom = edgeCase.measureSelector && nodeDOM instanceof HTMLElement ? (_nodeDOM$querySelecto = nodeDOM.querySelector(edgeCase.measureSelector)) !== null && _nodeDOM$querySelecto !== void 0 ? _nodeDOM$querySelecto : nodeDOM : nodeDOM;
|
|
171
182
|
if (dom instanceof HTMLElement) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
183
|
+
var updateAnchor = function updateAnchor() {
|
|
184
|
+
if (getPos() === undefined) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (edgeCase.measureLeft) {
|
|
188
|
+
var left = dom.getBoundingClientRect().left - wrapper.getBoundingClientRect().left;
|
|
189
|
+
anchor.style.setProperty('left', "".concat(left, "px"));
|
|
190
|
+
anchor.style.setProperty('transform', 'none');
|
|
191
|
+
}
|
|
192
|
+
anchor.style.setProperty('width', "".concat(dom.offsetWidth, "px"));
|
|
193
|
+
};
|
|
194
|
+
// Align against the block's horizontal extent.
|
|
195
|
+
updateAnchor();
|
|
175
196
|
|
|
176
197
|
// Observe the measured element for size changes (e.g. page
|
|
177
198
|
// resize) so the indicator stays aligned. CCI-17981
|
|
178
199
|
if (!leftResizeObserver) {
|
|
179
|
-
leftResizeObserver = new ResizeObserver(
|
|
180
|
-
if (getPos() !== undefined) {
|
|
181
|
-
anchor.style.setProperty('width', "".concat(dom.offsetWidth, "px"));
|
|
182
|
-
}
|
|
183
|
-
});
|
|
200
|
+
leftResizeObserver = new ResizeObserver(updateAnchor);
|
|
184
201
|
leftResizeObserver.observe(dom);
|
|
202
|
+
if (edgeCase.measureLeft) {
|
|
203
|
+
leftResizeObserver.observe(wrapper);
|
|
204
|
+
}
|
|
185
205
|
}
|
|
186
206
|
}
|
|
187
207
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "17.1.
|
|
3
|
+
"version": "17.1.2",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
41
41
|
"@atlaskit/primitives": "^22.5.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^201.0.0",
|
|
43
43
|
"@atlaskit/tokens": "^18.2.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@compiled/react": "^1.0.2",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@atlaskit/adf-utils": "^20.9.0",
|
|
53
|
-
"@atlaskit/button": "^25.
|
|
53
|
+
"@atlaskit/button": "^25.4.0",
|
|
54
54
|
"@atlaskit/css": "^1.1.0",
|
|
55
55
|
"@atlaskit/dropdown-menu": "^18.3.0",
|
|
56
56
|
"@atlaskit/editor-core": "^229.1.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"react-intl": "^7.0.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^123.
|
|
74
|
+
"@atlaskit/editor-common": "^123.3.0",
|
|
75
75
|
"react": "^18.2.0 || ^19.2.0",
|
|
76
76
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
77
77
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|