@atlaskit/editor-core 191.0.0 → 191.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/plugins/extension/toolbar.js +5 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/extension/toolbar.js +5 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/extension/toolbar.js +5 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/docs/3-annotations.tsx +5 -5
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 191.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#65604](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65604) [`c39131fa9ab3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c39131fa9ab3) - [ux] ED-21422 Fix MBE floating toolbar position issue on new tab and scroll.
|
|
8
|
+
- [#65494](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65494) [`14c48a2fa93d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/14c48a2fa93d) - Moved the example helpers from the test utlity library to editor-core
|
|
9
|
+
|
|
3
10
|
## 191.0.0
|
|
4
11
|
|
|
5
12
|
### Major Changes
|
|
@@ -176,15 +176,18 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
176
176
|
var mbeFrameElement = editorView.nodeDOM(mbeFrame.pos);
|
|
177
177
|
var mbeNodeRect = mbeDomElement === null || mbeDomElement === void 0 ? void 0 : mbeDomElement.getBoundingClientRect();
|
|
178
178
|
var mbeFrameRect = mbeFrameElement.getBoundingClientRect();
|
|
179
|
+
var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
|
|
179
180
|
|
|
180
181
|
/**
|
|
181
182
|
* MbeNodeRect height will include mbeFrameRect height and the navigation toolbar of the MBE
|
|
182
183
|
* excluding nav toolbar height from the floaing extention toolbar position calculated.
|
|
183
|
-
*
|
|
184
|
+
* In case of new tabs, MBE does not update the frame to the new tab so height comes as 0,
|
|
185
|
+
* so we add the min height (100px) + borders (2px) as the default minimum frame height for toolbar to appear
|
|
184
186
|
*
|
|
185
187
|
*/
|
|
188
|
+
var frameheight = mbeFrameRect.height > 0 ? mbeFrameRect.height : 102;
|
|
186
189
|
return {
|
|
187
|
-
top: mbeNodeRect.top +
|
|
190
|
+
top: mbeNodeRect.top + frameheight + scrollWrapper.scrollTop,
|
|
188
191
|
left: nextPos.left
|
|
189
192
|
};
|
|
190
193
|
},
|
|
@@ -174,15 +174,18 @@ export const getToolbarConfig = ({
|
|
|
174
174
|
const mbeFrameElement = editorView.nodeDOM(mbeFrame.pos);
|
|
175
175
|
const mbeNodeRect = mbeDomElement === null || mbeDomElement === void 0 ? void 0 : mbeDomElement.getBoundingClientRect();
|
|
176
176
|
const mbeFrameRect = mbeFrameElement.getBoundingClientRect();
|
|
177
|
+
const scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
|
|
177
178
|
|
|
178
179
|
/**
|
|
179
180
|
* MbeNodeRect height will include mbeFrameRect height and the navigation toolbar of the MBE
|
|
180
181
|
* excluding nav toolbar height from the floaing extention toolbar position calculated.
|
|
181
|
-
*
|
|
182
|
+
* In case of new tabs, MBE does not update the frame to the new tab so height comes as 0,
|
|
183
|
+
* so we add the min height (100px) + borders (2px) as the default minimum frame height for toolbar to appear
|
|
182
184
|
*
|
|
183
185
|
*/
|
|
186
|
+
const frameheight = mbeFrameRect.height > 0 ? mbeFrameRect.height : 102;
|
|
184
187
|
return {
|
|
185
|
-
top: mbeNodeRect.top +
|
|
188
|
+
top: mbeNodeRect.top + frameheight + scrollWrapper.scrollTop,
|
|
186
189
|
left: nextPos.left
|
|
187
190
|
};
|
|
188
191
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "191.0.
|
|
2
|
+
export const version = "191.0.1";
|
|
@@ -170,15 +170,18 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
170
170
|
var mbeFrameElement = editorView.nodeDOM(mbeFrame.pos);
|
|
171
171
|
var mbeNodeRect = mbeDomElement === null || mbeDomElement === void 0 ? void 0 : mbeDomElement.getBoundingClientRect();
|
|
172
172
|
var mbeFrameRect = mbeFrameElement.getBoundingClientRect();
|
|
173
|
+
var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
|
|
173
174
|
|
|
174
175
|
/**
|
|
175
176
|
* MbeNodeRect height will include mbeFrameRect height and the navigation toolbar of the MBE
|
|
176
177
|
* excluding nav toolbar height from the floaing extention toolbar position calculated.
|
|
177
|
-
*
|
|
178
|
+
* In case of new tabs, MBE does not update the frame to the new tab so height comes as 0,
|
|
179
|
+
* so we add the min height (100px) + borders (2px) as the default minimum frame height for toolbar to appear
|
|
178
180
|
*
|
|
179
181
|
*/
|
|
182
|
+
var frameheight = mbeFrameRect.height > 0 ? mbeFrameRect.height : 102;
|
|
180
183
|
return {
|
|
181
|
-
top: mbeNodeRect.top +
|
|
184
|
+
top: mbeNodeRect.top + frameheight + scrollWrapper.scrollTop,
|
|
182
185
|
left: nextPos.left
|
|
183
186
|
};
|
|
184
187
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "191.0.
|
|
2
|
+
export var version = "191.0.1";
|
package/docs/3-annotations.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { token } from '@atlaskit/tokens';
|
|
2
2
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { code, md } from '@atlaskit/docs';
|
|
7
7
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
8
8
|
|
|
9
9
|
import { Editor } from '../src';
|
|
@@ -280,18 +280,18 @@ An annotation mark only describes an \`id\` and a \`type\`, so your component wi
|
|
|
280
280
|
|
|
281
281
|
### Example
|
|
282
282
|
|
|
283
|
-
The full page examples in the storybook use the \`
|
|
283
|
+
The full page examples in the storybook use the \`ExampleViewInlineCommentComponent\` within the \`@atlaskit/editor-core\` package, like so:
|
|
284
284
|
|
|
285
285
|
${code`
|
|
286
286
|
import { Editor } from '@atlaskit/editor-core';
|
|
287
|
-
import {
|
|
287
|
+
import { ExampleViewInlineCommentComponent } from '@atlaskit/editor-core/examples-helpers/example-inline-comment-component';
|
|
288
288
|
|
|
289
289
|
class MyEditor extends React.Component {
|
|
290
290
|
render() {
|
|
291
291
|
return <Editor
|
|
292
292
|
// ... other providers and props here
|
|
293
293
|
annotationProvider={{
|
|
294
|
-
component:
|
|
294
|
+
component: ExampleViewInlineCommentComponent,
|
|
295
295
|
}}
|
|
296
296
|
/>;
|
|
297
297
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "191.0.
|
|
3
|
+
"version": "191.0.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -194,7 +194,6 @@
|
|
|
194
194
|
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
195
195
|
"@atlaskit/util-data-test": "^17.8.0",
|
|
196
196
|
"@atlaskit/visual-regression": "*",
|
|
197
|
-
"@atlaskit/webdriver-runner": "*",
|
|
198
197
|
"@atlassian/adf-schema-json": "^1.0.7",
|
|
199
198
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
200
199
|
"@atlassian/editor-extension-link-create": "^1.1.0",
|