@atlaskit/link-picker 1.10.0 → 1.10.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/analytics.codegen.js +1 -1
- package/dist/cjs/services/use-plugins/index.js +15 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.codegen.js +1 -1
- package/dist/es2019/services/use-plugins/index.js +11 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.codegen.js +1 -1
- package/dist/esm/services/use-plugins/index.js +11 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics.codegen.d.ts +5 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,7 @@ exports.default = void 0;
|
|
|
10
10
|
*
|
|
11
11
|
* Generates analytics utilities from the package analytics spec yaml
|
|
12
12
|
*
|
|
13
|
-
* @codegen <<SignedSource::
|
|
13
|
+
* @codegen <<SignedSource::05d8b1c9e46066efd0d11fa9d19c32a9>>
|
|
14
14
|
* @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
|
|
15
15
|
*/
|
|
16
16
|
function createEventPayload(eventKey, attributes) {
|
|
@@ -15,13 +15,24 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
15
15
|
|
|
16
16
|
var _react = require("react");
|
|
17
17
|
|
|
18
|
+
var _convertToError = require("@atlaskit/frontend-utilities/convert-to-error");
|
|
19
|
+
|
|
20
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
21
|
+
|
|
18
22
|
var _linkPicker = require("../../ui/link-picker");
|
|
19
23
|
|
|
24
|
+
var _analytics = _interopRequireDefault(require("../../analytics.codegen"));
|
|
25
|
+
|
|
26
|
+
var _constants = require("../../common/constants");
|
|
27
|
+
|
|
20
28
|
var _utils = require("./utils");
|
|
21
29
|
|
|
22
30
|
var _reducer = require("./reducer");
|
|
23
31
|
|
|
24
32
|
function usePlugins(state, activeTab, plugins) {
|
|
33
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
34
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
35
|
+
|
|
25
36
|
var _useState = (0, _react.useState)(0),
|
|
26
37
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
27
38
|
retries = _useState2[0],
|
|
@@ -101,6 +112,9 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
101
112
|
type: 'ERROR',
|
|
102
113
|
payload: _context.t0
|
|
103
114
|
});
|
|
115
|
+
createAnalyticsEvent((0, _analytics.default)('operational.resultsResolve.failed', {
|
|
116
|
+
error: (0, _convertToError.convertToError)(_context.t0).toString()
|
|
117
|
+
})).fire(_constants.ANALYTICS_CHANNEL);
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
case 17:
|
|
@@ -118,7 +132,7 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
118
132
|
|
|
119
133
|
updateResults();
|
|
120
134
|
return cancel;
|
|
121
|
-
}, [activePlugin, state, retries, dispatch]);
|
|
135
|
+
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch]);
|
|
122
136
|
var tabs = (0, _react.useMemo)(function () {
|
|
123
137
|
if (!plugins || plugins.length <= 1) {
|
|
124
138
|
return [];
|
package/dist/cjs/version.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates analytics utilities from the package analytics spec yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::05d8b1c9e46066efd0d11fa9d19c32a9>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
|
|
8
8
|
*/
|
|
9
9
|
function createEventPayload(eventKey, attributes) {
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState, useCallback } from 'react';
|
|
2
|
+
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
3
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
2
4
|
import { RECENT_SEARCH_LIST_SIZE } from '../../ui/link-picker';
|
|
5
|
+
import createEventPayload from '../../analytics.codegen';
|
|
6
|
+
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
3
7
|
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
4
8
|
import { usePluginReducer } from './reducer';
|
|
5
9
|
export function usePlugins(state, activeTab, plugins) {
|
|
10
|
+
const {
|
|
11
|
+
createAnalyticsEvent
|
|
12
|
+
} = useAnalyticsEvents();
|
|
6
13
|
const [retries, setRetries] = useState(0);
|
|
7
14
|
const [pluginState, dispatch] = usePluginReducer();
|
|
8
15
|
const activePlugin = plugins === null || plugins === void 0 ? void 0 : plugins[activeTab];
|
|
@@ -50,13 +57,16 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
50
57
|
type: 'ERROR',
|
|
51
58
|
payload: error
|
|
52
59
|
});
|
|
60
|
+
createAnalyticsEvent(createEventPayload('operational.resultsResolve.failed', {
|
|
61
|
+
error: convertToError(error).toString()
|
|
62
|
+
})).fire(ANALYTICS_CHANNEL);
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
65
|
};
|
|
56
66
|
|
|
57
67
|
updateResults();
|
|
58
68
|
return cancel;
|
|
59
|
-
}, [activePlugin, state, retries, dispatch]);
|
|
69
|
+
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch]);
|
|
60
70
|
const tabs = useMemo(() => {
|
|
61
71
|
if (!plugins || plugins.length <= 1) {
|
|
62
72
|
return [];
|
package/dist/es2019/version.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates analytics utilities from the package analytics spec yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::05d8b1c9e46066efd0d11fa9d19c32a9>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
|
|
8
8
|
*/
|
|
9
9
|
function createEventPayload(eventKey, attributes) {
|
|
@@ -2,10 +2,17 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { useEffect, useMemo, useState, useCallback } from 'react';
|
|
5
|
+
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
6
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
7
|
import { RECENT_SEARCH_LIST_SIZE } from '../../ui/link-picker';
|
|
8
|
+
import createEventPayload from '../../analytics.codegen';
|
|
9
|
+
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
6
10
|
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
7
11
|
import { usePluginReducer } from './reducer';
|
|
8
12
|
export function usePlugins(state, activeTab, plugins) {
|
|
13
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
14
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
15
|
+
|
|
9
16
|
var _useState = useState(0),
|
|
10
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11
18
|
retries = _useState2[0],
|
|
@@ -85,6 +92,9 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
85
92
|
type: 'ERROR',
|
|
86
93
|
payload: _context.t0
|
|
87
94
|
});
|
|
95
|
+
createAnalyticsEvent(createEventPayload('operational.resultsResolve.failed', {
|
|
96
|
+
error: convertToError(_context.t0).toString()
|
|
97
|
+
})).fire(ANALYTICS_CHANNEL);
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
case 17:
|
|
@@ -102,7 +112,7 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
102
112
|
|
|
103
113
|
updateResults();
|
|
104
114
|
return cancel;
|
|
105
|
-
}, [activePlugin, state, retries, dispatch]);
|
|
115
|
+
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch]);
|
|
106
116
|
var tabs = useMemo(function () {
|
|
107
117
|
if (!plugins || plugins.length <= 1) {
|
|
108
118
|
return [];
|
package/dist/esm/version.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates analytics utilities from the package analytics spec yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::05d8b1c9e46066efd0d11fa9d19c32a9>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
|
|
8
8
|
*/
|
|
9
9
|
export declare type PackageMetaDataType = {
|
|
@@ -30,6 +30,9 @@ export declare type LinkPickerUnhandledErrorCaughtAttributesType = {
|
|
|
30
30
|
error: string;
|
|
31
31
|
componentStack: string | null;
|
|
32
32
|
};
|
|
33
|
+
export declare type ResultsResolveFailedAttributesType = {
|
|
34
|
+
error: string;
|
|
35
|
+
};
|
|
33
36
|
declare type AnalyticsEventAttributes = {
|
|
34
37
|
'ui.form.submitted.linkPicker': FormSubmittedLinkPickerAttributesType;
|
|
35
38
|
'ui.inlineDialog.viewed.linkPicker': InlineDialogViewedLinkPickerAttributesType;
|
|
@@ -37,6 +40,7 @@ declare type AnalyticsEventAttributes = {
|
|
|
37
40
|
'ui.textField.updated.linkField': TextFieldUpdatedLinkFieldAttributesType;
|
|
38
41
|
'ui.textField.updated.displayTextField': TextFieldUpdatedDisplayTextFieldAttributesType;
|
|
39
42
|
'ui.linkPicker.unhandledErrorCaught': LinkPickerUnhandledErrorCaughtAttributesType;
|
|
43
|
+
'operational.resultsResolve.failed': ResultsResolveFailedAttributesType;
|
|
40
44
|
};
|
|
41
45
|
declare function createEventPayload<K extends keyof AnalyticsEventAttributes>(eventKey: K, attributes: AnalyticsEventAttributes[K]): {
|
|
42
46
|
eventType: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@atlaskit/button": "^16.2.0",
|
|
35
35
|
"@atlaskit/empty-state": "^7.4.0",
|
|
36
36
|
"@atlaskit/form": "^8.5.1",
|
|
37
|
+
"@atlaskit/frontend-utilities": "^2.0.0",
|
|
37
38
|
"@atlaskit/icon": "^21.10.0",
|
|
38
39
|
"@atlaskit/spinner": "^15.1.0",
|
|
39
40
|
"@atlaskit/tabs": "^13.3.0",
|