@atlaskit/editor-common 75.8.0 → 75.8.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 +6 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/safe-plugin/index.js +39 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/safe-plugin/index.js +33 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/safe-plugin/index.js +39 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/safe-plugin/index.d.ts +2 -1
- package/dist/types-ts4.5/safe-plugin/index.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "75.8.
|
|
19
|
+
var packageVersion = "75.8.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -10,9 +10,47 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
10
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
14
|
+
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
13
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
15
17
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
+
// Wraper to avoid any exception during the get pos operation
|
|
19
|
+
// See this https://hello.atlassian.net/wiki/spaces/EDITOR/pages/2849713193/ED-19672+Extensions+Regression
|
|
20
|
+
// And this https://discuss.prosemirror.net/t/possible-bug-on-viewdesc-posbeforechild/5783
|
|
21
|
+
var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
|
|
22
|
+
var _spec$props;
|
|
23
|
+
if (!(spec !== null && spec !== void 0 && (_spec$props = spec.props) !== null && _spec$props !== void 0 && _spec$props.nodeViews)) {
|
|
24
|
+
return spec;
|
|
25
|
+
}
|
|
26
|
+
var unsafeNodeViews = spec.props.nodeViews;
|
|
27
|
+
var safeNodeViews = new Proxy(unsafeNodeViews, {
|
|
28
|
+
get: function get(target, prop, receiver) {
|
|
29
|
+
var safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
|
|
30
|
+
apply: function apply(target, thisArg, argumentsList) {
|
|
31
|
+
var _argumentsList = (0, _toArray2.default)(argumentsList),
|
|
32
|
+
node = _argumentsList[0],
|
|
33
|
+
view = _argumentsList[1],
|
|
34
|
+
unsafeGetPos = _argumentsList[2],
|
|
35
|
+
more = _argumentsList.slice(3);
|
|
36
|
+
var safeGetPos = function () {
|
|
37
|
+
try {
|
|
38
|
+
return unsafeGetPos();
|
|
39
|
+
} catch (e) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
// eslint-disable-next-line no-extra-bind
|
|
44
|
+
}.bind(thisArg);
|
|
45
|
+
return Reflect.apply(target, thisArg, [node, view, safeGetPos].concat((0, _toConsumableArray2.default)(more)));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return safeNodeView;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
spec.props.nodeViews = safeNodeViews;
|
|
52
|
+
return spec;
|
|
53
|
+
};
|
|
16
54
|
var SafePlugin = /*#__PURE__*/function (_Plugin) {
|
|
17
55
|
(0, _inherits2.default)(SafePlugin, _Plugin);
|
|
18
56
|
var _super = _createSuper(SafePlugin);
|
|
@@ -22,7 +60,7 @@ var SafePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
22
60
|
|
|
23
61
|
function SafePlugin(spec) {
|
|
24
62
|
(0, _classCallCheck2.default)(this, SafePlugin);
|
|
25
|
-
return _super.call(this, spec);
|
|
63
|
+
return _super.call(this, wrapGetPosExceptions(spec));
|
|
26
64
|
}
|
|
27
65
|
return (0, _createClass2.default)(SafePlugin);
|
|
28
66
|
}(_state.Plugin);
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "75.8.
|
|
27
|
+
var packageVersion = "75.8.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "75.8.
|
|
3
|
+
const packageVersion = "75.8.1";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
// Wraper to avoid any exception during the get pos operation
|
|
3
|
+
// See this https://hello.atlassian.net/wiki/spaces/EDITOR/pages/2849713193/ED-19672+Extensions+Regression
|
|
4
|
+
// And this https://discuss.prosemirror.net/t/possible-bug-on-viewdesc-posbeforechild/5783
|
|
5
|
+
const wrapGetPosExceptions = spec => {
|
|
6
|
+
var _spec$props;
|
|
7
|
+
if (!(spec !== null && spec !== void 0 && (_spec$props = spec.props) !== null && _spec$props !== void 0 && _spec$props.nodeViews)) {
|
|
8
|
+
return spec;
|
|
9
|
+
}
|
|
10
|
+
const unsafeNodeViews = spec.props.nodeViews;
|
|
11
|
+
const safeNodeViews = new Proxy(unsafeNodeViews, {
|
|
12
|
+
get(target, prop, receiver) {
|
|
13
|
+
const safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
|
|
14
|
+
apply(target, thisArg, argumentsList) {
|
|
15
|
+
const [node, view, unsafeGetPos, ...more] = argumentsList;
|
|
16
|
+
const safeGetPos = (() => {
|
|
17
|
+
try {
|
|
18
|
+
return unsafeGetPos();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
return;
|
|
23
|
+
// eslint-disable-next-line no-extra-bind
|
|
24
|
+
}).bind(thisArg);
|
|
25
|
+
return Reflect.apply(target, thisArg, [node, view, safeGetPos, ...more]);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return safeNodeView;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
spec.props.nodeViews = safeNodeViews;
|
|
32
|
+
return spec;
|
|
33
|
+
};
|
|
2
34
|
export class SafePlugin extends Plugin {
|
|
3
35
|
// This variable isn't (and shouldn't) be used anywhere. Its purpose is
|
|
4
36
|
// to distinguish Plugin from SafePlugin, thus ensuring that an 'unsafe'
|
|
5
37
|
// Plugin cannot be assigned as an item in EditorPlugin → pmPlugins.
|
|
6
38
|
|
|
7
39
|
constructor(spec) {
|
|
8
|
-
super(spec);
|
|
40
|
+
super(wrapGetPosExceptions(spec));
|
|
9
41
|
}
|
|
10
42
|
}
|
|
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
9
9
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
10
|
import Layer from '../Layer';
|
|
11
11
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "75.8.
|
|
12
|
+
const packageVersion = "75.8.1";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "75.8.
|
|
9
|
+
var packageVersion = "75.8.1";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -3,9 +3,47 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
7
|
+
import _toArray from "@babel/runtime/helpers/toArray";
|
|
6
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
10
|
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
// Wraper to avoid any exception during the get pos operation
|
|
12
|
+
// See this https://hello.atlassian.net/wiki/spaces/EDITOR/pages/2849713193/ED-19672+Extensions+Regression
|
|
13
|
+
// And this https://discuss.prosemirror.net/t/possible-bug-on-viewdesc-posbeforechild/5783
|
|
14
|
+
var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
|
|
15
|
+
var _spec$props;
|
|
16
|
+
if (!(spec !== null && spec !== void 0 && (_spec$props = spec.props) !== null && _spec$props !== void 0 && _spec$props.nodeViews)) {
|
|
17
|
+
return spec;
|
|
18
|
+
}
|
|
19
|
+
var unsafeNodeViews = spec.props.nodeViews;
|
|
20
|
+
var safeNodeViews = new Proxy(unsafeNodeViews, {
|
|
21
|
+
get: function get(target, prop, receiver) {
|
|
22
|
+
var safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
|
|
23
|
+
apply: function apply(target, thisArg, argumentsList) {
|
|
24
|
+
var _argumentsList = _toArray(argumentsList),
|
|
25
|
+
node = _argumentsList[0],
|
|
26
|
+
view = _argumentsList[1],
|
|
27
|
+
unsafeGetPos = _argumentsList[2],
|
|
28
|
+
more = _argumentsList.slice(3);
|
|
29
|
+
var safeGetPos = function () {
|
|
30
|
+
try {
|
|
31
|
+
return unsafeGetPos();
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
// eslint-disable-next-line no-extra-bind
|
|
37
|
+
}.bind(thisArg);
|
|
38
|
+
return Reflect.apply(target, thisArg, [node, view, safeGetPos].concat(_toConsumableArray(more)));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return safeNodeView;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
spec.props.nodeViews = safeNodeViews;
|
|
45
|
+
return spec;
|
|
46
|
+
};
|
|
9
47
|
export var SafePlugin = /*#__PURE__*/function (_Plugin) {
|
|
10
48
|
_inherits(SafePlugin, _Plugin);
|
|
11
49
|
var _super = _createSuper(SafePlugin);
|
|
@@ -15,7 +53,7 @@ export var SafePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
15
53
|
|
|
16
54
|
function SafePlugin(spec) {
|
|
17
55
|
_classCallCheck(this, SafePlugin);
|
|
18
|
-
return _super.call(this, spec);
|
|
56
|
+
return _super.call(this, wrapGetPosExceptions(spec));
|
|
19
57
|
}
|
|
20
58
|
return _createClass(SafePlugin);
|
|
21
59
|
}(Plugin);
|
|
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
19
19
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
20
|
import Layer from '../Layer';
|
|
21
21
|
var packageName = "@atlaskit/editor-common";
|
|
22
|
-
var packageVersion = "75.8.
|
|
22
|
+
var packageVersion = "75.8.1";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Plugin
|
|
1
|
+
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
export declare class SafePlugin<T = any> extends Plugin<T> {
|
|
3
4
|
_isATypeSafePlugin: never;
|
|
4
5
|
constructor(spec: SafePluginSpec<T>);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Plugin
|
|
1
|
+
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
export declare class SafePlugin<T = any> extends Plugin<T> {
|
|
3
4
|
_isATypeSafePlugin: never;
|
|
4
5
|
constructor(spec: SafePluginSpec<T>);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "75.8.
|
|
3
|
+
"version": "75.8.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@atlaskit/icon": "^21.12.0",
|
|
102
102
|
"@atlaskit/icon-object": "^6.3.0",
|
|
103
103
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
104
|
-
"@atlaskit/link-datasource": "^1.
|
|
104
|
+
"@atlaskit/link-datasource": "^1.4.0",
|
|
105
105
|
"@atlaskit/link-picker": "^1.30.0",
|
|
106
106
|
"@atlaskit/media-card": "^77.0.0",
|
|
107
107
|
"@atlaskit/media-client": "^24.0.0",
|