@atlaskit/editor-common 74.51.7 → 74.52.0
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/insert/index.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/index.js +20 -1
- package/dist/cjs/quick-insert/utils.js +79 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/dedupe.js +37 -0
- package/dist/cjs/utils/index.js +7 -0
- package/dist/es2019/insert/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/index.js +2 -1
- package/dist/es2019/quick-insert/utils.js +58 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/dedupe.js +25 -0
- package/dist/es2019/utils/index.js +2 -1
- package/dist/esm/insert/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/index.js +2 -1
- package/dist/esm/quick-insert/utils.js +69 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/dedupe.js +31 -0
- package/dist/esm/utils/index.js +2 -1
- package/dist/types/insert/index.d.ts +4 -3
- package/dist/types/link/LinkSearch/index.d.ts +4 -4
- package/dist/types/link/LinkSearch/withActivityProvider.d.ts +4 -4
- package/dist/types/quick-insert/index.d.ts +1 -0
- package/dist/types/quick-insert/utils.d.ts +12 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/quick-insert.d.ts +13 -0
- package/dist/types/ui/OverflowShadow/index.d.ts +4 -4
- package/dist/types/utils/dedupe.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types-ts4.5/insert/index.d.ts +4 -3
- package/dist/types-ts4.5/link/LinkSearch/index.d.ts +4 -4
- package/dist/types-ts4.5/link/LinkSearch/withActivityProvider.d.ts +4 -4
- package/dist/types-ts4.5/quick-insert/index.d.ts +1 -0
- package/dist/types-ts4.5/quick-insert/utils.d.ts +12 -0
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/dist/types-ts4.5/types/quick-insert.d.ts +13 -0
- package/dist/types-ts4.5/ui/OverflowShadow/index.d.ts +4 -4
- package/dist/types-ts4.5/utils/dedupe.d.ts +1 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/cjs/insert/index.js
CHANGED
|
@@ -194,7 +194,7 @@ var finaliseInsert = function finaliseInsert(tr, nodeLength) {
|
|
|
194
194
|
};
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
|
-
* Method extracted from
|
|
197
|
+
* Method extracted from typeahead plugin to be shared with the element browser on handling element insertion.
|
|
198
198
|
*/
|
|
199
199
|
var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
200
200
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -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 = "74.
|
|
19
|
+
var packageVersion = "74.52.0";
|
|
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
|
|
@@ -159,4 +159,23 @@ Object.defineProperty(exports, "IconStatus", {
|
|
|
159
159
|
return _assets.IconStatus;
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
-
|
|
162
|
+
Object.defineProperty(exports, "find", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function get() {
|
|
165
|
+
return _utils.find;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "getQuickInsertSuggestions", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function get() {
|
|
171
|
+
return _utils.getQuickInsertSuggestions;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "memoProcessQuickInsertItems", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function get() {
|
|
177
|
+
return _utils.memoProcessQuickInsertItems;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
var _assets = require("./assets");
|
|
181
|
+
var _utils = require("./utils");
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.find = find;
|
|
8
|
+
exports.memoProcessQuickInsertItems = exports.getQuickInsertSuggestions = void 0;
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _fuse = _interopRequireDefault(require("fuse.js"));
|
|
11
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
var processQuickInsertItems = function processQuickInsertItems(items, intl) {
|
|
14
|
+
return items.reduce(function (acc, item) {
|
|
15
|
+
if (typeof item === 'function') {
|
|
16
|
+
var quickInsertItems = item(intl);
|
|
17
|
+
return acc.concat(quickInsertItems);
|
|
18
|
+
}
|
|
19
|
+
return acc.concat(item);
|
|
20
|
+
}, []);
|
|
21
|
+
};
|
|
22
|
+
var memoProcessQuickInsertItems = (0, _memoizeOne.default)(processQuickInsertItems);
|
|
23
|
+
exports.memoProcessQuickInsertItems = memoProcessQuickInsertItems;
|
|
24
|
+
var options = {
|
|
25
|
+
threshold: 0.3,
|
|
26
|
+
keys: [{
|
|
27
|
+
name: 'title',
|
|
28
|
+
weight: 0.57
|
|
29
|
+
}, {
|
|
30
|
+
name: 'priority',
|
|
31
|
+
weight: 0.3
|
|
32
|
+
}, {
|
|
33
|
+
name: 'keywords',
|
|
34
|
+
weight: 0.08
|
|
35
|
+
}, {
|
|
36
|
+
name: 'description',
|
|
37
|
+
weight: 0.04
|
|
38
|
+
}, {
|
|
39
|
+
name: 'keyshortcut',
|
|
40
|
+
weight: 0.01
|
|
41
|
+
}]
|
|
42
|
+
};
|
|
43
|
+
function find(query, items) {
|
|
44
|
+
var fuse = new _fuse.default(items, options);
|
|
45
|
+
if (query === '') {
|
|
46
|
+
// Copy and sort list by priority
|
|
47
|
+
return items.slice(0).sort(function (a, b) {
|
|
48
|
+
return (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return fuse.search(query).map(function (result) {
|
|
52
|
+
return result.item;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var getQuickInsertSuggestions = function getQuickInsertSuggestions(_ref) {
|
|
56
|
+
var searchOptions = _ref.searchOptions,
|
|
57
|
+
_ref$lazyDefaultItems = _ref.lazyDefaultItems,
|
|
58
|
+
lazyDefaultItems = _ref$lazyDefaultItems === void 0 ? function () {
|
|
59
|
+
return [];
|
|
60
|
+
} : _ref$lazyDefaultItems,
|
|
61
|
+
providedItems = _ref.providedItems;
|
|
62
|
+
var query = searchOptions.query,
|
|
63
|
+
category = searchOptions.category,
|
|
64
|
+
disableDefaultItems = searchOptions.disableDefaultItems,
|
|
65
|
+
featuredItems = searchOptions.featuredItems;
|
|
66
|
+
var defaultItems = disableDefaultItems ? [] : lazyDefaultItems();
|
|
67
|
+
var items = providedItems ? (0, _utils.dedupe)([].concat((0, _toConsumableArray2.default)(defaultItems), (0, _toConsumableArray2.default)(providedItems)), function (item) {
|
|
68
|
+
return item.title;
|
|
69
|
+
}) : defaultItems;
|
|
70
|
+
if (featuredItems) {
|
|
71
|
+
return items.filter(function (item) {
|
|
72
|
+
return item.featured;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return find(query || '', category === 'all' || !category ? items : items.filter(function (item) {
|
|
76
|
+
return item.categories && item.categories.includes(category);
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
exports.getQuickInsertSuggestions = getQuickInsertSuggestions;
|
|
@@ -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 = "74.
|
|
27
|
+
var packageVersion = "74.52.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dedupe = dedupe;
|
|
7
|
+
function dedupe() {
|
|
8
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9
|
+
var iteratee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (p) {
|
|
10
|
+
return p;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
.,
|
|
14
|
+
. _,'f----.._
|
|
15
|
+
|\ ,-'"/ | ,'
|
|
16
|
+
|,_ ,--. /
|
|
17
|
+
/,-. ,'`. (_
|
|
18
|
+
f o| o|__ "`-.
|
|
19
|
+
,-._.,--'_ `. _.,-`
|
|
20
|
+
`"' ___.,'` j,-'
|
|
21
|
+
`-.__.,--'
|
|
22
|
+
Gotta go fast!
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var seen = new Set();
|
|
26
|
+
list.forEach(function (l) {
|
|
27
|
+
return seen.add(iteratee(l));
|
|
28
|
+
});
|
|
29
|
+
return list.filter(function (l) {
|
|
30
|
+
var it = iteratee(l);
|
|
31
|
+
if (seen.has(it)) {
|
|
32
|
+
seen.delete(it);
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
});
|
|
37
|
+
}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -281,6 +281,12 @@ Object.defineProperty(exports, "createWrappingJoinRule", {
|
|
|
281
281
|
return _inputRules.createWrappingJoinRule;
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
|
+
Object.defineProperty(exports, "dedupe", {
|
|
285
|
+
enumerable: true,
|
|
286
|
+
get: function get() {
|
|
287
|
+
return _dedupe.dedupe;
|
|
288
|
+
}
|
|
289
|
+
});
|
|
284
290
|
Object.defineProperty(exports, "deleteEmptyParagraphAndMoveBlockUp", {
|
|
285
291
|
enumerable: true,
|
|
286
292
|
get: function get() {
|
|
@@ -1047,6 +1053,7 @@ var _scrollGutter = require("./scroll-gutter");
|
|
|
1047
1053
|
var _getPerformanceTiming = require("./performance/get-performance-timing");
|
|
1048
1054
|
var _countNodes = require("./count-nodes");
|
|
1049
1055
|
var _inputRules = require("./input-rules");
|
|
1056
|
+
var _dedupe = require("./dedupe");
|
|
1050
1057
|
// prosemirror-history does not export its plugin key
|
|
1051
1058
|
var pmHistoryPluginKey = 'history$';
|
|
1052
1059
|
exports.pmHistoryPluginKey = pmHistoryPluginKey;
|
|
@@ -188,7 +188,7 @@ const finaliseInsert = (tr, nodeLength) => {
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
|
-
* Method extracted from
|
|
191
|
+
* Method extracted from typeahead plugin to be shared with the element browser on handling element insertion.
|
|
192
192
|
*/
|
|
193
193
|
export const insertSelectedItem = (maybeNode, opts = {}) => (state, tr, start) => {
|
|
194
194
|
if (!maybeNode) {
|
|
@@ -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 = "74.
|
|
3
|
+
const packageVersion = "74.52.0";
|
|
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 +1,2 @@
|
|
|
1
|
-
export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects } from './assets';
|
|
1
|
+
export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects } from './assets';
|
|
2
|
+
export { memoProcessQuickInsertItems, getQuickInsertSuggestions, find } from './utils';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Fuse from 'fuse.js';
|
|
2
|
+
import memoizeOne from 'memoize-one';
|
|
3
|
+
import { dedupe } from '../utils';
|
|
4
|
+
const processQuickInsertItems = (items, intl) => {
|
|
5
|
+
return items.reduce((acc, item) => {
|
|
6
|
+
if (typeof item === 'function') {
|
|
7
|
+
const quickInsertItems = item(intl);
|
|
8
|
+
return acc.concat(quickInsertItems);
|
|
9
|
+
}
|
|
10
|
+
return acc.concat(item);
|
|
11
|
+
}, []);
|
|
12
|
+
};
|
|
13
|
+
export const memoProcessQuickInsertItems = memoizeOne(processQuickInsertItems);
|
|
14
|
+
const options = {
|
|
15
|
+
threshold: 0.3,
|
|
16
|
+
keys: [{
|
|
17
|
+
name: 'title',
|
|
18
|
+
weight: 0.57
|
|
19
|
+
}, {
|
|
20
|
+
name: 'priority',
|
|
21
|
+
weight: 0.3
|
|
22
|
+
}, {
|
|
23
|
+
name: 'keywords',
|
|
24
|
+
weight: 0.08
|
|
25
|
+
}, {
|
|
26
|
+
name: 'description',
|
|
27
|
+
weight: 0.04
|
|
28
|
+
}, {
|
|
29
|
+
name: 'keyshortcut',
|
|
30
|
+
weight: 0.01
|
|
31
|
+
}]
|
|
32
|
+
};
|
|
33
|
+
export function find(query, items) {
|
|
34
|
+
const fuse = new Fuse(items, options);
|
|
35
|
+
if (query === '') {
|
|
36
|
+
// Copy and sort list by priority
|
|
37
|
+
return items.slice(0).sort((a, b) => (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY));
|
|
38
|
+
}
|
|
39
|
+
return fuse.search(query).map(result => result.item);
|
|
40
|
+
}
|
|
41
|
+
export const getQuickInsertSuggestions = ({
|
|
42
|
+
searchOptions,
|
|
43
|
+
lazyDefaultItems = () => [],
|
|
44
|
+
providedItems
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
query,
|
|
48
|
+
category,
|
|
49
|
+
disableDefaultItems,
|
|
50
|
+
featuredItems
|
|
51
|
+
} = searchOptions;
|
|
52
|
+
const defaultItems = disableDefaultItems ? [] : lazyDefaultItems();
|
|
53
|
+
const items = providedItems ? dedupe([...defaultItems, ...providedItems], item => item.title) : defaultItems;
|
|
54
|
+
if (featuredItems) {
|
|
55
|
+
return items.filter(item => item.featured);
|
|
56
|
+
}
|
|
57
|
+
return find(query || '', category === 'all' || !category ? items : items.filter(item => item.categories && item.categories.includes(category)));
|
|
58
|
+
};
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "74.
|
|
11
|
+
const packageVersion = "74.52.0";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function dedupe(list = [], iteratee = p => p) {
|
|
2
|
+
/**
|
|
3
|
+
.,
|
|
4
|
+
. _,'f----.._
|
|
5
|
+
|\ ,-'"/ | ,'
|
|
6
|
+
|,_ ,--. /
|
|
7
|
+
/,-. ,'`. (_
|
|
8
|
+
f o| o|__ "`-.
|
|
9
|
+
,-._.,--'_ `. _.,-`
|
|
10
|
+
`"' ___.,'` j,-'
|
|
11
|
+
`-.__.,--'
|
|
12
|
+
Gotta go fast!
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const seen = new Set();
|
|
16
|
+
list.forEach(l => seen.add(iteratee(l)));
|
|
17
|
+
return list.filter(l => {
|
|
18
|
+
const it = iteratee(l);
|
|
19
|
+
if (seen.has(it)) {
|
|
20
|
+
seen.delete(it);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -192,4 +192,5 @@ export function isNodeEmpty(node) {
|
|
|
192
192
|
child.isInline ? nonBlock.push(child) : block.push(child);
|
|
193
193
|
});
|
|
194
194
|
return !nonBlock.length && !block.filter(childNode => !!childNode.childCount && !(childNode.childCount === 1 && isEmptyParagraph(childNode.firstChild)) || childNode.isAtom).length;
|
|
195
|
-
}
|
|
195
|
+
}
|
|
196
|
+
export { dedupe } from './dedupe';
|
package/dist/esm/insert/index.js
CHANGED
|
@@ -184,7 +184,7 @@ var finaliseInsert = function finaliseInsert(tr, nodeLength) {
|
|
|
184
184
|
};
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
|
-
* Method extracted from
|
|
187
|
+
* Method extracted from typeahead plugin to be shared with the element browser on handling element insertion.
|
|
188
188
|
*/
|
|
189
189
|
export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
190
190
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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 = "74.
|
|
9
|
+
var packageVersion = "74.52.0";
|
|
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
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects } from './assets';
|
|
1
|
+
export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects } from './assets';
|
|
2
|
+
export { memoProcessQuickInsertItems, getQuickInsertSuggestions, find } from './utils';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import Fuse from 'fuse.js';
|
|
3
|
+
import memoizeOne from 'memoize-one';
|
|
4
|
+
import { dedupe } from '../utils';
|
|
5
|
+
var processQuickInsertItems = function processQuickInsertItems(items, intl) {
|
|
6
|
+
return items.reduce(function (acc, item) {
|
|
7
|
+
if (typeof item === 'function') {
|
|
8
|
+
var quickInsertItems = item(intl);
|
|
9
|
+
return acc.concat(quickInsertItems);
|
|
10
|
+
}
|
|
11
|
+
return acc.concat(item);
|
|
12
|
+
}, []);
|
|
13
|
+
};
|
|
14
|
+
export var memoProcessQuickInsertItems = memoizeOne(processQuickInsertItems);
|
|
15
|
+
var options = {
|
|
16
|
+
threshold: 0.3,
|
|
17
|
+
keys: [{
|
|
18
|
+
name: 'title',
|
|
19
|
+
weight: 0.57
|
|
20
|
+
}, {
|
|
21
|
+
name: 'priority',
|
|
22
|
+
weight: 0.3
|
|
23
|
+
}, {
|
|
24
|
+
name: 'keywords',
|
|
25
|
+
weight: 0.08
|
|
26
|
+
}, {
|
|
27
|
+
name: 'description',
|
|
28
|
+
weight: 0.04
|
|
29
|
+
}, {
|
|
30
|
+
name: 'keyshortcut',
|
|
31
|
+
weight: 0.01
|
|
32
|
+
}]
|
|
33
|
+
};
|
|
34
|
+
export function find(query, items) {
|
|
35
|
+
var fuse = new Fuse(items, options);
|
|
36
|
+
if (query === '') {
|
|
37
|
+
// Copy and sort list by priority
|
|
38
|
+
return items.slice(0).sort(function (a, b) {
|
|
39
|
+
return (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return fuse.search(query).map(function (result) {
|
|
43
|
+
return result.item;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export var getQuickInsertSuggestions = function getQuickInsertSuggestions(_ref) {
|
|
47
|
+
var searchOptions = _ref.searchOptions,
|
|
48
|
+
_ref$lazyDefaultItems = _ref.lazyDefaultItems,
|
|
49
|
+
lazyDefaultItems = _ref$lazyDefaultItems === void 0 ? function () {
|
|
50
|
+
return [];
|
|
51
|
+
} : _ref$lazyDefaultItems,
|
|
52
|
+
providedItems = _ref.providedItems;
|
|
53
|
+
var query = searchOptions.query,
|
|
54
|
+
category = searchOptions.category,
|
|
55
|
+
disableDefaultItems = searchOptions.disableDefaultItems,
|
|
56
|
+
featuredItems = searchOptions.featuredItems;
|
|
57
|
+
var defaultItems = disableDefaultItems ? [] : lazyDefaultItems();
|
|
58
|
+
var items = providedItems ? dedupe([].concat(_toConsumableArray(defaultItems), _toConsumableArray(providedItems)), function (item) {
|
|
59
|
+
return item.title;
|
|
60
|
+
}) : defaultItems;
|
|
61
|
+
if (featuredItems) {
|
|
62
|
+
return items.filter(function (item) {
|
|
63
|
+
return item.featured;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return find(query || '', category === 'all' || !category ? items : items.filter(function (item) {
|
|
67
|
+
return item.categories && item.categories.includes(category);
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "74.
|
|
21
|
+
var packageVersion = "74.52.0";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function dedupe() {
|
|
2
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3
|
+
var iteratee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (p) {
|
|
4
|
+
return p;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
.,
|
|
8
|
+
. _,'f----.._
|
|
9
|
+
|\ ,-'"/ | ,'
|
|
10
|
+
|,_ ,--. /
|
|
11
|
+
/,-. ,'`. (_
|
|
12
|
+
f o| o|__ "`-.
|
|
13
|
+
,-._.,--'_ `. _.,-`
|
|
14
|
+
`"' ___.,'` j,-'
|
|
15
|
+
`-.__.,--'
|
|
16
|
+
Gotta go fast!
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var seen = new Set();
|
|
20
|
+
list.forEach(function (l) {
|
|
21
|
+
return seen.add(iteratee(l));
|
|
22
|
+
});
|
|
23
|
+
return list.filter(function (l) {
|
|
24
|
+
var it = iteratee(l);
|
|
25
|
+
if (seen.has(it)) {
|
|
26
|
+
seen.delete(it);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
});
|
|
31
|
+
}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -198,4 +198,5 @@ export function isNodeEmpty(node) {
|
|
|
198
198
|
return !nonBlock.length && !block.filter(function (childNode) {
|
|
199
199
|
return !!childNode.childCount && !(childNode.childCount === 1 && isEmptyParagraph(childNode.firstChild)) || childNode.isAtom;
|
|
200
200
|
}).length;
|
|
201
|
-
}
|
|
201
|
+
}
|
|
202
|
+
export { dedupe } from './dedupe';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Fragment, Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
export type InsertableContent = Node | Fragment;
|
|
4
5
|
export declare enum LookDirection {
|
|
5
6
|
Before = "before",
|
|
@@ -8,7 +9,7 @@ export declare enum LookDirection {
|
|
|
8
9
|
export declare const normaliseNestedLayout: ({ selection, doc }: EditorState | Transaction, node: Node) => Node;
|
|
9
10
|
export declare const safeInsert: (content: InsertableContent, position?: number) => (tr: Transaction) => Transaction | null;
|
|
10
11
|
/**
|
|
11
|
-
* Method extracted from
|
|
12
|
+
* Method extracted from typeahead plugin to be shared with the element browser on handling element insertion.
|
|
12
13
|
*/
|
|
13
14
|
export declare const insertSelectedItem: (maybeNode?: Node | Object | string | Fragment, opts?: {
|
|
14
15
|
selectInlineNode?: boolean;
|
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { RecentSearchProps } from './types';
|
|
3
3
|
import { WithActivityProviderProps } from './withActivityProvider';
|
|
4
4
|
declare const _default: {
|
|
5
|
-
new (props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>): {
|
|
5
|
+
new (props: (import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps) | Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>): {
|
|
6
6
|
renderNode: (providers: import("../../provider-factory").Providers) => JSX.Element;
|
|
7
7
|
render(): JSX.Element;
|
|
8
8
|
context: any;
|
|
9
9
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
10
|
-
forceUpdate(
|
|
10
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
11
11
|
readonly props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps> & Readonly<{
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
}>;
|
|
@@ -28,12 +28,12 @@ declare const _default: {
|
|
|
28
28
|
componentWillUpdate?(nextProps: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
29
29
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
30
30
|
};
|
|
31
|
-
new (props: import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps, context
|
|
31
|
+
new (props: import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps, context: any): {
|
|
32
32
|
renderNode: (providers: import("../../provider-factory").Providers) => JSX.Element;
|
|
33
33
|
render(): JSX.Element;
|
|
34
34
|
context: any;
|
|
35
35
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
36
|
-
forceUpdate(
|
|
36
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
37
37
|
readonly props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps> & Readonly<{
|
|
38
38
|
children?: React.ReactNode;
|
|
39
39
|
}>;
|
|
@@ -10,12 +10,12 @@ export interface WithActivityProviderProps {
|
|
|
10
10
|
activityProvider: ActivityProvider;
|
|
11
11
|
}
|
|
12
12
|
export default function withActivityProvider<Props>(WrappedComponent: React.ComponentType<Props & WithActivityProviderProps>): {
|
|
13
|
-
new (props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>): {
|
|
13
|
+
new (props: (Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps) | Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>): {
|
|
14
14
|
renderNode: (providers: Providers) => JSX.Element;
|
|
15
15
|
render(): JSX.Element;
|
|
16
16
|
context: any;
|
|
17
17
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
18
|
-
forceUpdate(
|
|
18
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
19
19
|
readonly props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps> & Readonly<{
|
|
20
20
|
children?: React.ReactNode;
|
|
21
21
|
}>;
|
|
@@ -36,12 +36,12 @@ export default function withActivityProvider<Props>(WrappedComponent: React.Comp
|
|
|
36
36
|
componentWillUpdate?(nextProps: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
37
37
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
38
38
|
};
|
|
39
|
-
new (props: Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps, context
|
|
39
|
+
new (props: Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps, context: any): {
|
|
40
40
|
renderNode: (providers: Providers) => JSX.Element;
|
|
41
41
|
render(): JSX.Element;
|
|
42
42
|
context: any;
|
|
43
43
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
44
|
-
forceUpdate(
|
|
44
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
45
45
|
readonly props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps> & Readonly<{
|
|
46
46
|
children?: React.ReactNode;
|
|
47
47
|
}>;
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects, } from './assets';
|
|
2
|
+
export { memoProcessQuickInsertItems, getQuickInsertSuggestions, find, } from './utils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { QuickInsertItem } from '../provider-factory';
|
|
3
|
+
import type { QuickInsertHandler, QuickInsertSearchOptions } from '../types';
|
|
4
|
+
declare const processQuickInsertItems: (items: Array<QuickInsertHandler | QuickInsertItem>, intl: IntlShape) => QuickInsertItem[];
|
|
5
|
+
export declare const memoProcessQuickInsertItems: typeof processQuickInsertItems;
|
|
6
|
+
export declare function find(query: string, items: QuickInsertItem[]): QuickInsertItem[];
|
|
7
|
+
export declare const getQuickInsertSuggestions: ({ searchOptions, lazyDefaultItems, providedItems, }: {
|
|
8
|
+
searchOptions: QuickInsertSearchOptions;
|
|
9
|
+
lazyDefaultItems?: (() => QuickInsertItem[]) | undefined;
|
|
10
|
+
providedItems?: QuickInsertItem[] | undefined;
|
|
11
|
+
}) => QuickInsertItem[];
|
|
12
|
+
export {};
|
|
@@ -47,4 +47,4 @@ export type { InputRuleHandler, OnHandlerApply, InputRuleWrapper, } from './inpu
|
|
|
47
47
|
export type { TextFormattingOptions, TextFormattingState, InputMethodToolbar, InputMethodBasic, } from './text-formatting';
|
|
48
48
|
export type { LayoutPluginOptions } from './layout';
|
|
49
49
|
export type { LongPressSelectionPluginOptions } from './selection';
|
|
50
|
-
export type { QuickInsertPluginState, QuickInsertPluginStateKeys, QuickInsertOptions, QuickInsertPluginOptions, } from './quick-insert';
|
|
50
|
+
export type { QuickInsertPluginState, QuickInsertPluginStateKeys, QuickInsertOptions, QuickInsertPluginOptions, QuickInsertSearchOptions, QuickInsertSharedState, QuickInsertHandler, } from './quick-insert';
|
|
@@ -8,12 +8,20 @@ export type QuickInsertHandler = Array<QuickInsertItem> | ((intl: IntlShape) =>
|
|
|
8
8
|
export type IconProps = {
|
|
9
9
|
label?: string;
|
|
10
10
|
};
|
|
11
|
+
export type QuickInsertSearchOptions = {
|
|
12
|
+
query?: string;
|
|
13
|
+
category?: string;
|
|
14
|
+
disableDefaultItems?: boolean;
|
|
15
|
+
featuredItems?: boolean;
|
|
16
|
+
};
|
|
11
17
|
export type QuickInsertPluginState = {
|
|
12
18
|
isElementBrowserModalOpen: boolean;
|
|
13
19
|
lazyDefaultItems: () => QuickInsertItem[];
|
|
14
20
|
providedItems?: QuickInsertItem[];
|
|
15
21
|
provider?: QuickInsertProvider;
|
|
16
22
|
emptyStateHandler?: EmptyStateHandler;
|
|
23
|
+
suggestions?: QuickInsertItem[];
|
|
24
|
+
searchOptions?: QuickInsertSearchOptions;
|
|
17
25
|
};
|
|
18
26
|
export type QuickInsertPluginStateKeys = keyof QuickInsertPluginState;
|
|
19
27
|
export interface QuickInsertPluginOptions {
|
|
@@ -23,3 +31,8 @@ export interface QuickInsertPluginOptions {
|
|
|
23
31
|
elementBrowserHelpUrl?: string;
|
|
24
32
|
emptyStateHandler?: EmptyStateHandler;
|
|
25
33
|
}
|
|
34
|
+
export type QuickInsertSharedState = {
|
|
35
|
+
suggestions: QuickInsertItem[];
|
|
36
|
+
lazyDefaultItems: () => QuickInsertItem[];
|
|
37
|
+
emptyStateHandler?: EmptyStateHandler;
|
|
38
|
+
};
|
|
@@ -17,7 +17,7 @@ export interface OverflowShadowOptions {
|
|
|
17
17
|
useShadowObserver?: boolean;
|
|
18
18
|
}
|
|
19
19
|
export default function overflowShadow<P>(Component: React.ComponentType<P & OverflowShadowProps> | React.StatelessComponent<P & OverflowShadowProps>, options: OverflowShadowOptions): {
|
|
20
|
-
new (props: Readonly<P>): {
|
|
20
|
+
new (props: P | Readonly<P>): {
|
|
21
21
|
overflowContainer?: HTMLElement | null | undefined;
|
|
22
22
|
container?: HTMLElement | undefined;
|
|
23
23
|
shadowObserver?: ShadowObserver | undefined;
|
|
@@ -40,7 +40,7 @@ export default function overflowShadow<P>(Component: React.ComponentType<P & Ove
|
|
|
40
40
|
render(): JSX.Element;
|
|
41
41
|
context: any;
|
|
42
42
|
setState<K extends keyof OverflowShadowState>(state: OverflowShadowState | ((prevState: Readonly<OverflowShadowState>, props: Readonly<P>) => OverflowShadowState | Pick<OverflowShadowState, K> | null) | Pick<OverflowShadowState, K> | null, callback?: (() => void) | undefined): void;
|
|
43
|
-
forceUpdate(
|
|
43
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
44
44
|
readonly props: Readonly<P> & Readonly<{
|
|
45
45
|
children?: React.ReactNode;
|
|
46
46
|
}>;
|
|
@@ -58,7 +58,7 @@ export default function overflowShadow<P>(Component: React.ComponentType<P & Ove
|
|
|
58
58
|
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<OverflowShadowState>, nextContext: any): void;
|
|
59
59
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<OverflowShadowState>, nextContext: any): void;
|
|
60
60
|
};
|
|
61
|
-
new (props: P, context
|
|
61
|
+
new (props: P, context: any): {
|
|
62
62
|
overflowContainer?: HTMLElement | null | undefined;
|
|
63
63
|
container?: HTMLElement | undefined;
|
|
64
64
|
shadowObserver?: ShadowObserver | undefined;
|
|
@@ -81,7 +81,7 @@ export default function overflowShadow<P>(Component: React.ComponentType<P & Ove
|
|
|
81
81
|
render(): JSX.Element;
|
|
82
82
|
context: any;
|
|
83
83
|
setState<K extends keyof OverflowShadowState>(state: OverflowShadowState | ((prevState: Readonly<OverflowShadowState>, props: Readonly<P>) => OverflowShadowState | Pick<OverflowShadowState, K> | null) | Pick<OverflowShadowState, K> | null, callback?: (() => void) | undefined): void;
|
|
84
|
-
forceUpdate(
|
|
84
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
85
85
|
readonly props: Readonly<P> & Readonly<{
|
|
86
86
|
children?: React.ReactNode;
|
|
87
87
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dedupe<T>(list?: T[], iteratee?: (p: T) => T[keyof T] | T): T[];
|
|
@@ -79,3 +79,4 @@ export declare const isEmptyNode: (schema: Schema) => (node: PMNode) => boolean;
|
|
|
79
79
|
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
|
80
80
|
*/
|
|
81
81
|
export declare function isNodeEmpty(node?: PMNode): boolean;
|
|
82
|
+
export { dedupe } from './dedupe';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Fragment, Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
export type InsertableContent = Node | Fragment;
|
|
4
5
|
export declare enum LookDirection {
|
|
5
6
|
Before = "before",
|
|
@@ -8,7 +9,7 @@ export declare enum LookDirection {
|
|
|
8
9
|
export declare const normaliseNestedLayout: ({ selection, doc }: EditorState | Transaction, node: Node) => Node;
|
|
9
10
|
export declare const safeInsert: (content: InsertableContent, position?: number) => (tr: Transaction) => Transaction | null;
|
|
10
11
|
/**
|
|
11
|
-
* Method extracted from
|
|
12
|
+
* Method extracted from typeahead plugin to be shared with the element browser on handling element insertion.
|
|
12
13
|
*/
|
|
13
14
|
export declare const insertSelectedItem: (maybeNode?: Node | Object | string | Fragment, opts?: {
|
|
14
15
|
selectInlineNode?: boolean;
|
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { RecentSearchProps } from './types';
|
|
3
3
|
import { WithActivityProviderProps } from './withActivityProvider';
|
|
4
4
|
declare const _default: {
|
|
5
|
-
new (props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>): {
|
|
5
|
+
new (props: (import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps) | Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>): {
|
|
6
6
|
renderNode: (providers: import("../../provider-factory").Providers) => JSX.Element;
|
|
7
7
|
render(): JSX.Element;
|
|
8
8
|
context: any;
|
|
9
9
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
10
|
-
forceUpdate(
|
|
10
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
11
11
|
readonly props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps> & Readonly<{
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
}>;
|
|
@@ -28,12 +28,12 @@ declare const _default: {
|
|
|
28
28
|
componentWillUpdate?(nextProps: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
29
29
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
30
30
|
};
|
|
31
|
-
new (props: import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps, context
|
|
31
|
+
new (props: import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps, context: any): {
|
|
32
32
|
renderNode: (providers: import("../../provider-factory").Providers) => JSX.Element;
|
|
33
33
|
render(): JSX.Element;
|
|
34
34
|
context: any;
|
|
35
35
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
36
|
-
forceUpdate(
|
|
36
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
37
37
|
readonly props: Readonly<import("../../utils").Diff<RecentSearchProps & WithActivityProviderProps, WithActivityProviderProps> & import("./withActivityProvider").ExpandedActivityProviderProps> & Readonly<{
|
|
38
38
|
children?: React.ReactNode;
|
|
39
39
|
}>;
|
|
@@ -10,12 +10,12 @@ export interface WithActivityProviderProps {
|
|
|
10
10
|
activityProvider: ActivityProvider;
|
|
11
11
|
}
|
|
12
12
|
export default function withActivityProvider<Props>(WrappedComponent: React.ComponentType<Props & WithActivityProviderProps>): {
|
|
13
|
-
new (props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>): {
|
|
13
|
+
new (props: (Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps) | Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>): {
|
|
14
14
|
renderNode: (providers: Providers) => JSX.Element;
|
|
15
15
|
render(): JSX.Element;
|
|
16
16
|
context: any;
|
|
17
17
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
18
|
-
forceUpdate(
|
|
18
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
19
19
|
readonly props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps> & Readonly<{
|
|
20
20
|
children?: React.ReactNode;
|
|
21
21
|
}>;
|
|
@@ -36,12 +36,12 @@ export default function withActivityProvider<Props>(WrappedComponent: React.Comp
|
|
|
36
36
|
componentWillUpdate?(nextProps: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
37
37
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
38
38
|
};
|
|
39
|
-
new (props: Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps, context
|
|
39
|
+
new (props: Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps, context: any): {
|
|
40
40
|
renderNode: (providers: Providers) => JSX.Element;
|
|
41
41
|
render(): JSX.Element;
|
|
42
42
|
context: any;
|
|
43
43
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
44
|
-
forceUpdate(
|
|
44
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
45
45
|
readonly props: Readonly<Diff<Props, WithActivityProviderProps> & ExpandedActivityProviderProps> & Readonly<{
|
|
46
46
|
children?: React.ReactNode;
|
|
47
47
|
}>;
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { IconAction, IconCode, IconDate, IconDecision, IconDivider, IconEmoji, IconImages, IconLayout, IconLink, IconListNumber, IconList, IconMention, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanel, IconQuote, IconStatus, IconHeading, IconFeedback, IconExpand, IconCustomPanel, IconFallback, IconDatasourceJiraIssue, IconDatasourceAssetsObjects, } from './assets';
|
|
2
|
+
export { memoProcessQuickInsertItems, getQuickInsertSuggestions, find, } from './utils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { QuickInsertItem } from '../provider-factory';
|
|
3
|
+
import type { QuickInsertHandler, QuickInsertSearchOptions } from '../types';
|
|
4
|
+
declare const processQuickInsertItems: (items: Array<QuickInsertHandler | QuickInsertItem>, intl: IntlShape) => QuickInsertItem[];
|
|
5
|
+
export declare const memoProcessQuickInsertItems: typeof processQuickInsertItems;
|
|
6
|
+
export declare function find(query: string, items: QuickInsertItem[]): QuickInsertItem[];
|
|
7
|
+
export declare const getQuickInsertSuggestions: ({ searchOptions, lazyDefaultItems, providedItems, }: {
|
|
8
|
+
searchOptions: QuickInsertSearchOptions;
|
|
9
|
+
lazyDefaultItems?: (() => QuickInsertItem[]) | undefined;
|
|
10
|
+
providedItems?: QuickInsertItem[] | undefined;
|
|
11
|
+
}) => QuickInsertItem[];
|
|
12
|
+
export {};
|
|
@@ -47,4 +47,4 @@ export type { InputRuleHandler, OnHandlerApply, InputRuleWrapper, } from './inpu
|
|
|
47
47
|
export type { TextFormattingOptions, TextFormattingState, InputMethodToolbar, InputMethodBasic, } from './text-formatting';
|
|
48
48
|
export type { LayoutPluginOptions } from './layout';
|
|
49
49
|
export type { LongPressSelectionPluginOptions } from './selection';
|
|
50
|
-
export type { QuickInsertPluginState, QuickInsertPluginStateKeys, QuickInsertOptions, QuickInsertPluginOptions, } from './quick-insert';
|
|
50
|
+
export type { QuickInsertPluginState, QuickInsertPluginStateKeys, QuickInsertOptions, QuickInsertPluginOptions, QuickInsertSearchOptions, QuickInsertSharedState, QuickInsertHandler, } from './quick-insert';
|
|
@@ -8,12 +8,20 @@ export type QuickInsertHandler = Array<QuickInsertItem> | ((intl: IntlShape) =>
|
|
|
8
8
|
export type IconProps = {
|
|
9
9
|
label?: string;
|
|
10
10
|
};
|
|
11
|
+
export type QuickInsertSearchOptions = {
|
|
12
|
+
query?: string;
|
|
13
|
+
category?: string;
|
|
14
|
+
disableDefaultItems?: boolean;
|
|
15
|
+
featuredItems?: boolean;
|
|
16
|
+
};
|
|
11
17
|
export type QuickInsertPluginState = {
|
|
12
18
|
isElementBrowserModalOpen: boolean;
|
|
13
19
|
lazyDefaultItems: () => QuickInsertItem[];
|
|
14
20
|
providedItems?: QuickInsertItem[];
|
|
15
21
|
provider?: QuickInsertProvider;
|
|
16
22
|
emptyStateHandler?: EmptyStateHandler;
|
|
23
|
+
suggestions?: QuickInsertItem[];
|
|
24
|
+
searchOptions?: QuickInsertSearchOptions;
|
|
17
25
|
};
|
|
18
26
|
export type QuickInsertPluginStateKeys = keyof QuickInsertPluginState;
|
|
19
27
|
export interface QuickInsertPluginOptions {
|
|
@@ -23,3 +31,8 @@ export interface QuickInsertPluginOptions {
|
|
|
23
31
|
elementBrowserHelpUrl?: string;
|
|
24
32
|
emptyStateHandler?: EmptyStateHandler;
|
|
25
33
|
}
|
|
34
|
+
export type QuickInsertSharedState = {
|
|
35
|
+
suggestions: QuickInsertItem[];
|
|
36
|
+
lazyDefaultItems: () => QuickInsertItem[];
|
|
37
|
+
emptyStateHandler?: EmptyStateHandler;
|
|
38
|
+
};
|
|
@@ -17,7 +17,7 @@ export interface OverflowShadowOptions {
|
|
|
17
17
|
useShadowObserver?: boolean;
|
|
18
18
|
}
|
|
19
19
|
export default function overflowShadow<P>(Component: React.ComponentType<P & OverflowShadowProps> | React.StatelessComponent<P & OverflowShadowProps>, options: OverflowShadowOptions): {
|
|
20
|
-
new (props: Readonly<P>): {
|
|
20
|
+
new (props: P | Readonly<P>): {
|
|
21
21
|
overflowContainer?: HTMLElement | null | undefined;
|
|
22
22
|
container?: HTMLElement | undefined;
|
|
23
23
|
shadowObserver?: ShadowObserver | undefined;
|
|
@@ -40,7 +40,7 @@ export default function overflowShadow<P>(Component: React.ComponentType<P & Ove
|
|
|
40
40
|
render(): JSX.Element;
|
|
41
41
|
context: any;
|
|
42
42
|
setState<K extends keyof OverflowShadowState>(state: OverflowShadowState | ((prevState: Readonly<OverflowShadowState>, props: Readonly<P>) => OverflowShadowState | Pick<OverflowShadowState, K> | null) | Pick<OverflowShadowState, K> | null, callback?: (() => void) | undefined): void;
|
|
43
|
-
forceUpdate(
|
|
43
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
44
44
|
readonly props: Readonly<P> & Readonly<{
|
|
45
45
|
children?: React.ReactNode;
|
|
46
46
|
}>;
|
|
@@ -58,7 +58,7 @@ export default function overflowShadow<P>(Component: React.ComponentType<P & Ove
|
|
|
58
58
|
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<OverflowShadowState>, nextContext: any): void;
|
|
59
59
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<OverflowShadowState>, nextContext: any): void;
|
|
60
60
|
};
|
|
61
|
-
new (props: P, context
|
|
61
|
+
new (props: P, context: any): {
|
|
62
62
|
overflowContainer?: HTMLElement | null | undefined;
|
|
63
63
|
container?: HTMLElement | undefined;
|
|
64
64
|
shadowObserver?: ShadowObserver | undefined;
|
|
@@ -81,7 +81,7 @@ export default function overflowShadow<P>(Component: React.ComponentType<P & Ove
|
|
|
81
81
|
render(): JSX.Element;
|
|
82
82
|
context: any;
|
|
83
83
|
setState<K extends keyof OverflowShadowState>(state: OverflowShadowState | ((prevState: Readonly<OverflowShadowState>, props: Readonly<P>) => OverflowShadowState | Pick<OverflowShadowState, K> | null) | Pick<OverflowShadowState, K> | null, callback?: (() => void) | undefined): void;
|
|
84
|
-
forceUpdate(
|
|
84
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
85
85
|
readonly props: Readonly<P> & Readonly<{
|
|
86
86
|
children?: React.ReactNode;
|
|
87
87
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dedupe<T>(list?: T[], iteratee?: (p: T) => T[keyof T] | T): T[];
|
|
@@ -79,3 +79,4 @@ export declare const isEmptyNode: (schema: Schema) => (node: PMNode) => boolean;
|
|
|
79
79
|
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
|
80
80
|
*/
|
|
81
81
|
export declare function isNodeEmpty(node?: PMNode): boolean;
|
|
82
|
+
export { dedupe } from './dedupe';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.52.0",
|
|
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/"
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
"classnames": "^2.2.5",
|
|
125
125
|
"date-fns": "^2.17.0",
|
|
126
126
|
"focus-trap": "^2.4.5",
|
|
127
|
+
"fuse.js": "^6.6.2",
|
|
127
128
|
"linkify-it": "^2.0.3",
|
|
128
129
|
"lodash": "^4.17.21",
|
|
129
130
|
"markdown-it": "^12.3.2",
|
|
@@ -143,7 +144,6 @@
|
|
|
143
144
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
144
145
|
},
|
|
145
146
|
"devDependencies": {
|
|
146
|
-
"@atlaskit/editor-test-helpers": "^18.11.0",
|
|
147
147
|
"@atlaskit/media-core": "^34.1.0",
|
|
148
148
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
149
149
|
"@atlaskit/smart-card": "^26.16.0",
|
|
@@ -200,4 +200,4 @@
|
|
|
200
200
|
"type": "boolean"
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
}
|
|
203
|
+
}
|