@atlaskit/editor-common 76.19.0 → 76.20.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 +12 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +7 -0
- package/dist/cjs/utils/nodes-by-localIds.js +34 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +2 -1
- package/dist/es2019/utils/nodes-by-localIds.js +27 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +2 -1
- package/dist/esm/utils/nodes-by-localIds.js +28 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/nodes-by-localIds.d.ts +7 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -0
- package/dist/types-ts4.5/utils/nodes-by-localIds.d.ts +7 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 76.20.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 76.20.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#43094](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43094) [`c797611f8ad`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c797611f8ad) - Internally decouple extension plugin from editor-core.
|
|
14
|
+
|
|
3
15
|
## 76.19.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -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 = "76.
|
|
19
|
+
var packageVersion = "76.20.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
|
|
@@ -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 = "76.
|
|
27
|
+
var packageVersion = "76.20.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -354,6 +354,12 @@ Object.defineProperty(exports, "findFilepaths", {
|
|
|
354
354
|
return _hyperlink.findFilepaths;
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
|
+
Object.defineProperty(exports, "findNodePosByLocalIds", {
|
|
358
|
+
enumerable: true,
|
|
359
|
+
get: function get() {
|
|
360
|
+
return _nodesByLocalIds.findNodePosByLocalIds;
|
|
361
|
+
}
|
|
362
|
+
});
|
|
357
363
|
Object.defineProperty(exports, "flatmap", {
|
|
358
364
|
enumerable: true,
|
|
359
365
|
get: function get() {
|
|
@@ -1130,6 +1136,7 @@ var _dedupe = require("./dedupe");
|
|
|
1130
1136
|
var _createWrapSelectionTransaction = require("./create-wrap-selection-transaction");
|
|
1131
1137
|
var _wrapSelectionIn = require("./wrap-selection-in");
|
|
1132
1138
|
var _calculateToolbarPosition = require("./calculate-toolbar-position");
|
|
1139
|
+
var _nodesByLocalIds = require("./nodes-by-localIds");
|
|
1133
1140
|
// prosemirror-history does not export its plugin key
|
|
1134
1141
|
var pmHistoryPluginKey = exports.pmHistoryPluginKey = 'history$';
|
|
1135
1142
|
function shallowEqual() {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findNodePosByLocalIds = void 0;
|
|
7
|
+
var findNodePosByLocalIds = exports.findNodePosByLocalIds = function findNodePosByLocalIds(state, ids) {
|
|
8
|
+
var _state$doc$attrs;
|
|
9
|
+
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10
|
+
if (ids.length === 0) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
var nodes = [];
|
|
14
|
+
var localIdSet = new Set(ids);
|
|
15
|
+
if (option.includeDocNode && localIdSet.has((_state$doc$attrs = state.doc.attrs) === null || _state$doc$attrs === void 0 ? void 0 : _state$doc$attrs.localId)) {
|
|
16
|
+
nodes.push({
|
|
17
|
+
node: state.doc,
|
|
18
|
+
pos: 0
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
state.doc.descendants(function (node, pos) {
|
|
22
|
+
var _node$attrs;
|
|
23
|
+
if (localIdSet.has((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId)) {
|
|
24
|
+
nodes.push({
|
|
25
|
+
node: node,
|
|
26
|
+
pos: pos
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// stop traversing once we found all the nodes
|
|
31
|
+
return localIdSet.size !== nodes.length;
|
|
32
|
+
});
|
|
33
|
+
return nodes;
|
|
34
|
+
};
|
|
@@ -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 = "76.
|
|
3
|
+
const packageVersion = "76.20.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
|
|
@@ -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 = "76.
|
|
12
|
+
const packageVersion = "76.20.1";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -215,4 +215,5 @@ export { dedupe } from './dedupe';
|
|
|
215
215
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
216
216
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
217
217
|
export { toJSON, nodeToJSON } from './nodes';
|
|
218
|
-
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
218
|
+
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
219
|
+
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const findNodePosByLocalIds = (state, ids, option = {}) => {
|
|
2
|
+
var _state$doc$attrs;
|
|
3
|
+
if (ids.length === 0) {
|
|
4
|
+
return [];
|
|
5
|
+
}
|
|
6
|
+
const nodes = [];
|
|
7
|
+
const localIdSet = new Set(ids);
|
|
8
|
+
if (option.includeDocNode && localIdSet.has((_state$doc$attrs = state.doc.attrs) === null || _state$doc$attrs === void 0 ? void 0 : _state$doc$attrs.localId)) {
|
|
9
|
+
nodes.push({
|
|
10
|
+
node: state.doc,
|
|
11
|
+
pos: 0
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
state.doc.descendants((node, pos) => {
|
|
15
|
+
var _node$attrs;
|
|
16
|
+
if (localIdSet.has((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId)) {
|
|
17
|
+
nodes.push({
|
|
18
|
+
node,
|
|
19
|
+
pos
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// stop traversing once we found all the nodes
|
|
24
|
+
return localIdSet.size !== nodes.length;
|
|
25
|
+
});
|
|
26
|
+
return nodes;
|
|
27
|
+
};
|
|
@@ -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 = "76.
|
|
9
|
+
var packageVersion = "76.20.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
|
|
@@ -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 = "76.
|
|
22
|
+
var packageVersion = "76.20.1";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -218,4 +218,5 @@ export { dedupe } from './dedupe';
|
|
|
218
218
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
219
219
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
220
220
|
export { toJSON, nodeToJSON } from './nodes';
|
|
221
|
-
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
221
|
+
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
222
|
+
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export var findNodePosByLocalIds = function findNodePosByLocalIds(state, ids) {
|
|
2
|
+
var _state$doc$attrs;
|
|
3
|
+
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
4
|
+
if (ids.length === 0) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
var nodes = [];
|
|
8
|
+
var localIdSet = new Set(ids);
|
|
9
|
+
if (option.includeDocNode && localIdSet.has((_state$doc$attrs = state.doc.attrs) === null || _state$doc$attrs === void 0 ? void 0 : _state$doc$attrs.localId)) {
|
|
10
|
+
nodes.push({
|
|
11
|
+
node: state.doc,
|
|
12
|
+
pos: 0
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
state.doc.descendants(function (node, pos) {
|
|
16
|
+
var _node$attrs;
|
|
17
|
+
if (localIdSet.has((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId)) {
|
|
18
|
+
nodes.push({
|
|
19
|
+
node: node,
|
|
20
|
+
pos: pos
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// stop traversing once we found all the nodes
|
|
25
|
+
return localIdSet.size !== nodes.length;
|
|
26
|
+
});
|
|
27
|
+
return nodes;
|
|
28
|
+
};
|
|
@@ -85,3 +85,4 @@ export { createWrapSelectionTransaction } from './create-wrap-selection-transact
|
|
|
85
85
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
86
86
|
export { toJSON, nodeToJSON } from './nodes';
|
|
87
87
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
|
|
88
|
+
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
type FindNodesByIdsOption = {
|
|
4
|
+
includeDocNode?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const findNodePosByLocalIds: (state: EditorState, ids: string[], option?: FindNodesByIdsOption) => NodeWithPos[];
|
|
7
|
+
export {};
|
|
@@ -85,3 +85,4 @@ export { createWrapSelectionTransaction } from './create-wrap-selection-transact
|
|
|
85
85
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
86
86
|
export { toJSON, nodeToJSON } from './nodes';
|
|
87
87
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
|
|
88
|
+
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
type FindNodesByIdsOption = {
|
|
4
|
+
includeDocNode?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const findNodePosByLocalIds: (state: EditorState, ids: string[], option?: FindNodesByIdsOption) => NodeWithPos[];
|
|
7
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "76.
|
|
3
|
+
"version": "76.20.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/"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
93
93
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
94
94
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
95
|
-
"@atlaskit/button": "^16.
|
|
95
|
+
"@atlaskit/button": "^16.16.0",
|
|
96
96
|
"@atlaskit/code": "^14.6.0",
|
|
97
97
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
98
98
|
"@atlaskit/custom-steps": "^0.0.2",
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
102
102
|
"@atlaskit/editor-shared-styles": "^2.8.0",
|
|
103
103
|
"@atlaskit/editor-tables": "^2.3.0",
|
|
104
|
-
"@atlaskit/emoji": "^67.
|
|
104
|
+
"@atlaskit/emoji": "^67.6.0",
|
|
105
105
|
"@atlaskit/icon": "^21.12.0",
|
|
106
106
|
"@atlaskit/icon-object": "^6.3.0",
|
|
107
107
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
108
|
-
"@atlaskit/link-datasource": "^1.
|
|
108
|
+
"@atlaskit/link-datasource": "^1.17.0",
|
|
109
109
|
"@atlaskit/link-picker": "^1.30.0",
|
|
110
110
|
"@atlaskit/media-card": "^77.4.0",
|
|
111
111
|
"@atlaskit/media-client": "^25.0.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"@atlaskit/textfield": "^5.6.0",
|
|
122
122
|
"@atlaskit/theme": "^12.6.0",
|
|
123
123
|
"@atlaskit/tokens": "^1.28.0",
|
|
124
|
-
"@atlaskit/tooltip": "^
|
|
124
|
+
"@atlaskit/tooltip": "^18.0.0",
|
|
125
125
|
"@atlaskit/ufo": "^0.2.0",
|
|
126
126
|
"@atlaskit/width-detector": "^4.1.0",
|
|
127
127
|
"@babel/runtime": "^7.0.0",
|