@atlaskit/editor-core 187.31.6 → 187.31.7

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,14 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.31.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c3de9f17631`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c3de9f17631) - ED-19359:
8
+ editor-core: Migrated skipped test: packages/editor/editor-core/src/tests/integration/gap-cursor/gap-cursor.ts to Libra
9
+ Libra: added a new page-model(editor-confirmation-popup-base-model.ts) to libra package and updated editor extension model
10
+ - [`a9feb9fae6e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a9feb9fae6e) - [ED-19672] Workaround tofix detached Extension calling NodeView.getPos
11
+
3
12
  ## 187.31.6
4
13
 
5
14
  ### Patch Changes
@@ -38,8 +38,17 @@ function ExtensionWithPluginState(props) {
38
38
  var isMobile = editorAppearance === 'mobile';
39
39
  var hasChildren = !!children;
40
40
  var removeBorder = hideFrame && !isMobile && !hasBody || false;
41
- var pos = typeof props.getPos === 'function' ? props.getPos() : undefined;
42
- var isTopLevelNode = typeof pos !== 'undefined' && !isNaN(pos) && props.view.state.doc.resolve(pos).depth === 0;
41
+ var getPos = props.getPos,
42
+ view = props.view;
43
+ var isTopLevelNode = _react.default.useMemo(function () {
44
+ try {
45
+ var pos = typeof getPos === 'function' ? getPos() : undefined;
46
+ return typeof pos !== 'undefined' && !isNaN(pos) && view.state.doc.resolve(pos).depth === 0;
47
+ } catch (e) {
48
+ return false;
49
+ }
50
+ return false;
51
+ }, [view, getPos]);
43
52
  var shouldBreakout =
44
53
  // Extension should breakout when the layout is set to 'full-width' or 'wide'.
45
54
  ['full-width', 'wide'].includes(node.attrs.layout) &&
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.31.6";
9
+ var version = "187.31.7";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -27,8 +27,19 @@ function ExtensionWithPluginState(props) {
27
27
  const isMobile = editorAppearance === 'mobile';
28
28
  const hasChildren = !!children;
29
29
  const removeBorder = hideFrame && !isMobile && !hasBody || false;
30
- const pos = typeof props.getPos === 'function' ? props.getPos() : undefined;
31
- const isTopLevelNode = typeof pos !== 'undefined' && !isNaN(pos) && props.view.state.doc.resolve(pos).depth === 0;
30
+ const {
31
+ getPos,
32
+ view
33
+ } = props;
34
+ const isTopLevelNode = React.useMemo(() => {
35
+ try {
36
+ const pos = typeof getPos === 'function' ? getPos() : undefined;
37
+ return typeof pos !== 'undefined' && !isNaN(pos) && view.state.doc.resolve(pos).depth === 0;
38
+ } catch (e) {
39
+ return false;
40
+ }
41
+ return false;
42
+ }, [view, getPos]);
32
43
  const shouldBreakout =
33
44
  // Extension should breakout when the layout is set to 'full-width' or 'wide'.
34
45
  ['full-width', 'wide'].includes(node.attrs.layout) &&
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.31.6";
2
+ export const version = "187.31.7";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -31,8 +31,17 @@ function ExtensionWithPluginState(props) {
31
31
  var isMobile = editorAppearance === 'mobile';
32
32
  var hasChildren = !!children;
33
33
  var removeBorder = hideFrame && !isMobile && !hasBody || false;
34
- var pos = typeof props.getPos === 'function' ? props.getPos() : undefined;
35
- var isTopLevelNode = typeof pos !== 'undefined' && !isNaN(pos) && props.view.state.doc.resolve(pos).depth === 0;
34
+ var getPos = props.getPos,
35
+ view = props.view;
36
+ var isTopLevelNode = React.useMemo(function () {
37
+ try {
38
+ var pos = typeof getPos === 'function' ? getPos() : undefined;
39
+ return typeof pos !== 'undefined' && !isNaN(pos) && view.state.doc.resolve(pos).depth === 0;
40
+ } catch (e) {
41
+ return false;
42
+ }
43
+ return false;
44
+ }, [view, getPos]);
36
45
  var shouldBreakout =
37
46
  // Extension should breakout when the layout is set to 'full-width' or 'wide'.
38
47
  ['full-width', 'wide'].includes(node.attrs.layout) &&
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.31.6";
2
+ export var version = "187.31.7";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.31.6",
3
+ "version": "187.31.7",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -115,7 +115,7 @@
115
115
  "@atlaskit/textfield": "^5.6.0",
116
116
  "@atlaskit/theme": "^12.5.0",
117
117
  "@atlaskit/toggle": "^12.6.0",
118
- "@atlaskit/tokens": "^1.16.0",
118
+ "@atlaskit/tokens": "^1.17.0",
119
119
  "@atlaskit/tooltip": "^17.8.0",
120
120
  "@atlaskit/width-detector": "^4.1.0",
121
121
  "@babel/runtime": "^7.0.0",