@atlaskit/editor-common 94.14.2 → 94.15.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 +8 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/utils.js +10 -5
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/utils.js +10 -5
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/utils.js +10 -5
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/quick-insert/utils.d.ts +1 -1
- package/dist/types/types/quick-insert.d.ts +3 -3
- package/dist/types-ts4.5/quick-insert/utils.d.ts +1 -1
- package/dist/types-ts4.5/types/quick-insert.d.ts +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 94.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`52d232456ff0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52d232456ff0c) -
|
|
8
|
+
Updated quick insert find function to conditionally set sort function to account for new logic
|
|
9
|
+
around triggering experiment exposure
|
|
10
|
+
|
|
3
11
|
## 94.14.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "94.
|
|
20
|
+
var packageVersion = "94.15.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -66,17 +66,22 @@ var options = {
|
|
|
66
66
|
* @returns {QuickInsertItem[]} - Returns a sorted array of QuickInsertItems based on the priority. If the query string is empty, it will return the array sorted by priority. If a query string is provided, it will return an array of QuickInsertItems that match the query string, sorted by relevance to the query.
|
|
67
67
|
*/
|
|
68
68
|
function find(query, items, prioritySortingFn) {
|
|
69
|
-
var fuseOptions = _objectSpread({}, options);
|
|
70
|
-
if (prioritySortingFn) {
|
|
71
|
-
fuseOptions.sortFn = prioritySortingFn(items);
|
|
72
|
-
}
|
|
73
|
-
var fuse = new _fuse.default(items, fuseOptions);
|
|
74
69
|
if (query === '') {
|
|
75
70
|
// Copy and sort list by priority
|
|
76
71
|
return items.slice(0).sort(function (a, b) {
|
|
77
72
|
return (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY);
|
|
78
73
|
});
|
|
79
74
|
}
|
|
75
|
+
var fuseOptions = _objectSpread({}, options);
|
|
76
|
+
if (prioritySortingFn) {
|
|
77
|
+
var sortFn = prioritySortingFn(items);
|
|
78
|
+
// prioritySortingFn will trigger the experiment exposure, but sortFn
|
|
79
|
+
// will be undefined for the control group.
|
|
80
|
+
if (sortFn) {
|
|
81
|
+
fuseOptions.sortFn = sortFn;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
var fuse = new _fuse.default(items, fuseOptions);
|
|
80
85
|
return fuse.search(query).map(function (result) {
|
|
81
86
|
return result.item;
|
|
82
87
|
});
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "94.
|
|
27
|
+
var packageVersion = "94.15.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "94.
|
|
4
|
+
const packageVersion = "94.15.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -51,16 +51,21 @@ const options = {
|
|
|
51
51
|
* @returns {QuickInsertItem[]} - Returns a sorted array of QuickInsertItems based on the priority. If the query string is empty, it will return the array sorted by priority. If a query string is provided, it will return an array of QuickInsertItems that match the query string, sorted by relevance to the query.
|
|
52
52
|
*/
|
|
53
53
|
export function find(query, items, prioritySortingFn) {
|
|
54
|
+
if (query === '') {
|
|
55
|
+
// Copy and sort list by priority
|
|
56
|
+
return items.slice(0).sort((a, b) => (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY));
|
|
57
|
+
}
|
|
54
58
|
const fuseOptions = {
|
|
55
59
|
...options
|
|
56
60
|
};
|
|
57
61
|
if (prioritySortingFn) {
|
|
58
|
-
|
|
62
|
+
const sortFn = prioritySortingFn(items);
|
|
63
|
+
// prioritySortingFn will trigger the experiment exposure, but sortFn
|
|
64
|
+
// will be undefined for the control group.
|
|
65
|
+
if (sortFn) {
|
|
66
|
+
fuseOptions.sortFn = sortFn;
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
const fuse = new Fuse(items, fuseOptions);
|
|
61
|
-
if (query === '') {
|
|
62
|
-
// Copy and sort list by priority
|
|
63
|
-
return items.slice(0).sort((a, b) => (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY));
|
|
64
|
-
}
|
|
65
70
|
return fuse.search(query).map(result => result.item);
|
|
66
71
|
}
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "94.
|
|
16
|
+
const packageVersion = "94.15.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
class DropList extends Component {
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "94.
|
|
10
|
+
var packageVersion = "94.15.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -58,17 +58,22 @@ var options = {
|
|
|
58
58
|
* @returns {QuickInsertItem[]} - Returns a sorted array of QuickInsertItems based on the priority. If the query string is empty, it will return the array sorted by priority. If a query string is provided, it will return an array of QuickInsertItems that match the query string, sorted by relevance to the query.
|
|
59
59
|
*/
|
|
60
60
|
export function find(query, items, prioritySortingFn) {
|
|
61
|
-
var fuseOptions = _objectSpread({}, options);
|
|
62
|
-
if (prioritySortingFn) {
|
|
63
|
-
fuseOptions.sortFn = prioritySortingFn(items);
|
|
64
|
-
}
|
|
65
|
-
var fuse = new Fuse(items, fuseOptions);
|
|
66
61
|
if (query === '') {
|
|
67
62
|
// Copy and sort list by priority
|
|
68
63
|
return items.slice(0).sort(function (a, b) {
|
|
69
64
|
return (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY);
|
|
70
65
|
});
|
|
71
66
|
}
|
|
67
|
+
var fuseOptions = _objectSpread({}, options);
|
|
68
|
+
if (prioritySortingFn) {
|
|
69
|
+
var sortFn = prioritySortingFn(items);
|
|
70
|
+
// prioritySortingFn will trigger the experiment exposure, but sortFn
|
|
71
|
+
// will be undefined for the control group.
|
|
72
|
+
if (sortFn) {
|
|
73
|
+
fuseOptions.sortFn = sortFn;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
var fuse = new Fuse(items, fuseOptions);
|
|
72
77
|
return fuse.search(query).map(function (result) {
|
|
73
78
|
return result.item;
|
|
74
79
|
});
|
|
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
21
21
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "94.
|
|
24
|
+
var packageVersion = "94.15.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -11,4 +11,4 @@ export declare const memoProcessQuickInsertItems: (items: Array<QuickInsertHandl
|
|
|
11
11
|
* @param {QuickInsertItem[]} items - An array of QuickInsertItems to be searched.
|
|
12
12
|
* @returns {QuickInsertItem[]} - Returns a sorted array of QuickInsertItems based on the priority. If the query string is empty, it will return the array sorted by priority. If a query string is provided, it will return an array of QuickInsertItems that match the query string, sorted by relevance to the query.
|
|
13
13
|
*/
|
|
14
|
-
export declare function find(query: string, items: QuickInsertItem[], prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction): QuickInsertItem[];
|
|
14
|
+
export declare function find(query: string, items: QuickInsertItem[], prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined): QuickInsertItem[];
|
|
@@ -4,7 +4,7 @@ import type { QuickInsertItem, QuickInsertProvider } from '../provider-factory';
|
|
|
4
4
|
import type { EmptyStateHandler } from './empty-state-handler';
|
|
5
5
|
export type QuickInsertOptions = boolean | {
|
|
6
6
|
provider?: Promise<QuickInsertProvider>;
|
|
7
|
-
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction;
|
|
7
|
+
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined;
|
|
8
8
|
onInsert?: (item: QuickInsertItem) => void;
|
|
9
9
|
};
|
|
10
10
|
export type QuickInsertHandlerFn = ((intl: IntlShape) => Array<QuickInsertItem>) & {
|
|
@@ -19,7 +19,7 @@ export type QuickInsertSearchOptions = {
|
|
|
19
19
|
category?: string;
|
|
20
20
|
disableDefaultItems?: boolean;
|
|
21
21
|
featuredItems?: boolean;
|
|
22
|
-
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction;
|
|
22
|
+
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined;
|
|
23
23
|
};
|
|
24
24
|
export type QuickInsertPluginState = {
|
|
25
25
|
isElementBrowserModalOpen: boolean;
|
|
@@ -36,7 +36,7 @@ export interface QuickInsertPluginOptions {
|
|
|
36
36
|
enableElementBrowser?: boolean;
|
|
37
37
|
elementBrowserHelpUrl?: string;
|
|
38
38
|
emptyStateHandler?: EmptyStateHandler;
|
|
39
|
-
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction;
|
|
39
|
+
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined;
|
|
40
40
|
onInsert?: (item: QuickInsertItem) => void;
|
|
41
41
|
}
|
|
42
42
|
export type QuickInsertSharedState = {
|
|
@@ -11,4 +11,4 @@ export declare const memoProcessQuickInsertItems: (items: Array<QuickInsertHandl
|
|
|
11
11
|
* @param {QuickInsertItem[]} items - An array of QuickInsertItems to be searched.
|
|
12
12
|
* @returns {QuickInsertItem[]} - Returns a sorted array of QuickInsertItems based on the priority. If the query string is empty, it will return the array sorted by priority. If a query string is provided, it will return an array of QuickInsertItems that match the query string, sorted by relevance to the query.
|
|
13
13
|
*/
|
|
14
|
-
export declare function find(query: string, items: QuickInsertItem[], prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction): QuickInsertItem[];
|
|
14
|
+
export declare function find(query: string, items: QuickInsertItem[], prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined): QuickInsertItem[];
|
|
@@ -4,7 +4,7 @@ import type { QuickInsertItem, QuickInsertProvider } from '../provider-factory';
|
|
|
4
4
|
import type { EmptyStateHandler } from './empty-state-handler';
|
|
5
5
|
export type QuickInsertOptions = boolean | {
|
|
6
6
|
provider?: Promise<QuickInsertProvider>;
|
|
7
|
-
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction;
|
|
7
|
+
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined;
|
|
8
8
|
onInsert?: (item: QuickInsertItem) => void;
|
|
9
9
|
};
|
|
10
10
|
export type QuickInsertHandlerFn = ((intl: IntlShape) => Array<QuickInsertItem>) & {
|
|
@@ -19,7 +19,7 @@ export type QuickInsertSearchOptions = {
|
|
|
19
19
|
category?: string;
|
|
20
20
|
disableDefaultItems?: boolean;
|
|
21
21
|
featuredItems?: boolean;
|
|
22
|
-
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction;
|
|
22
|
+
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined;
|
|
23
23
|
};
|
|
24
24
|
export type QuickInsertPluginState = {
|
|
25
25
|
isElementBrowserModalOpen: boolean;
|
|
@@ -36,7 +36,7 @@ export interface QuickInsertPluginOptions {
|
|
|
36
36
|
enableElementBrowser?: boolean;
|
|
37
37
|
elementBrowserHelpUrl?: string;
|
|
38
38
|
emptyStateHandler?: EmptyStateHandler;
|
|
39
|
-
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction;
|
|
39
|
+
prioritySortingFn?: (items: QuickInsertItem[]) => Fuse.FuseSortFunction | undefined;
|
|
40
40
|
onInsert?: (item: QuickInsertItem) => void;
|
|
41
41
|
}
|
|
42
42
|
export type QuickInsertSharedState = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "94.
|
|
3
|
+
"version": "94.15.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/"
|
|
@@ -136,14 +136,14 @@
|
|
|
136
136
|
"@atlaskit/media-common": "^11.7.0",
|
|
137
137
|
"@atlaskit/media-file-preview": "^0.9.0",
|
|
138
138
|
"@atlaskit/media-picker": "^67.0.0",
|
|
139
|
-
"@atlaskit/media-ui": "^26.
|
|
139
|
+
"@atlaskit/media-ui": "^26.1.0",
|
|
140
140
|
"@atlaskit/media-viewer": "49.2.7",
|
|
141
141
|
"@atlaskit/mention": "^23.3.0",
|
|
142
142
|
"@atlaskit/menu": "^2.13.0",
|
|
143
143
|
"@atlaskit/onboarding": "^12.1.0",
|
|
144
144
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
145
145
|
"@atlaskit/popper": "^6.3.0",
|
|
146
|
-
"@atlaskit/primitives": "^13.
|
|
146
|
+
"@atlaskit/primitives": "^13.1.0",
|
|
147
147
|
"@atlaskit/profilecard": "^20.9.0",
|
|
148
148
|
"@atlaskit/section-message": "^6.6.0",
|
|
149
149
|
"@atlaskit/smart-card": "^30.2.0",
|