@atlaskit/link-datasource 2.9.2 → 2.9.3

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 2.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#121590](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121590)
8
+ [`4dbf48b5397de`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4dbf48b5397de) -
9
+ Track datasource table word-wrap action
10
+ - Updated dependencies
11
+
3
12
  ## 2.9.2
4
13
 
5
14
  ### Patch Changes
@@ -14,7 +14,7 @@ var _createEventPayload = _interopRequireDefault(require("./create-event-payload
14
14
  *
15
15
  * Generates Typescript types for analytics events from analytics.spec.yaml
16
16
  *
17
- * @codegen <<SignedSource::415836762b378b7d79f3aff4ba051c14>>
17
+ * @codegen <<SignedSource::21ae373abad7c370a8682ddcd3a7ed21>>
18
18
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
19
19
  */
20
20
 
@@ -28,6 +28,7 @@ var _disableNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/eleme
28
28
  var _pointerOutsideOfPreview = require("@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview");
29
29
  var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview");
30
30
  var _preventUnhandled = require("@atlaskit/pragmatic-drag-and-drop/prevent-unhandled");
31
+ var _analytics = require("../../analytics");
31
32
  var _customIcons = require("./custom-icons");
32
33
  var _messages = require("./messages");
33
34
  var _styled2 = require("./styled");
@@ -119,6 +120,8 @@ var DraggableTableHeading = exports.DraggableTableHeading = function DraggableTa
119
120
  onWidthChange = _ref.onWidthChange,
120
121
  isWrapped = _ref.isWrapped,
121
122
  onIsWrappedChange = _ref.onIsWrappedChange;
123
+ var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
124
+ fireEvent = _useDatasourceAnalyti.fireEvent;
122
125
  var mainHeaderCellRef = (0, _react.useRef)(null);
123
126
  var columnResizeHandleRef = (0, _react.useRef)(null);
124
127
  var _useState = (0, _react.useState)(idleState),
@@ -341,8 +344,17 @@ var DraggableTableHeading = exports.DraggableTableHeading = function DraggableTa
341
344
  return setIsDropdownOpen(isOpen);
342
345
  }, []);
343
346
  var toggleWrap = (0, _react.useCallback)(function () {
344
- return onIsWrappedChange && onIsWrappedChange(!(isWrapped || false));
345
- }, [isWrapped, onIsWrappedChange]);
347
+ if (!onIsWrappedChange) {
348
+ return;
349
+ }
350
+ var nextIsWrap = !(isWrapped || false);
351
+ if (nextIsWrap) {
352
+ fireEvent('ui.button.clicked.wrap', {});
353
+ } else {
354
+ fireEvent('ui.button.clicked.unwrap', {});
355
+ }
356
+ onIsWrappedChange(nextIsWrap);
357
+ }, [fireEvent, isWrapped, onIsWrappedChange]);
346
358
  return (0, _react2.jsx)(_styled2.TableHeading, {
347
359
  ref: mainHeaderCellRef,
348
360
  "data-testid": "".concat(id, "-column-heading"),
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::415836762b378b7d79f3aff4ba051c14>>
6
+ * @codegen <<SignedSource::21ae373abad7c370a8682ddcd3a7ed21>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  import { useCallback } from 'react';
@@ -24,6 +24,7 @@ import { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/elem
24
24
  import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
25
25
  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
26
26
  import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';
27
+ import { useDatasourceAnalyticsEvents } from '../../analytics';
27
28
  import { GlyphPlaceholder, UnwrapTextIcon, WrapTextIcon } from './custom-icons';
28
29
  import { issueLikeTableMessages } from './messages';
29
30
  import { TableHeading } from './styled';
@@ -105,6 +106,9 @@ export const DraggableTableHeading = ({
105
106
  isWrapped,
106
107
  onIsWrappedChange
107
108
  }) => {
109
+ const {
110
+ fireEvent
111
+ } = useDatasourceAnalyticsEvents();
108
112
  const mainHeaderCellRef = useRef(null);
109
113
  const columnResizeHandleRef = useRef(null);
110
114
  const [state, setState] = useState(idleState);
@@ -311,7 +315,18 @@ export const DraggableTableHeading = ({
311
315
  const onDropdownOpenChange = useCallback(({
312
316
  isOpen
313
317
  }) => setIsDropdownOpen(isOpen), []);
314
- const toggleWrap = useCallback(() => onIsWrappedChange && onIsWrappedChange(!(isWrapped || false)), [isWrapped, onIsWrappedChange]);
318
+ const toggleWrap = useCallback(() => {
319
+ if (!onIsWrappedChange) {
320
+ return;
321
+ }
322
+ const nextIsWrap = !(isWrapped || false);
323
+ if (nextIsWrap) {
324
+ fireEvent('ui.button.clicked.wrap', {});
325
+ } else {
326
+ fireEvent('ui.button.clicked.unwrap', {});
327
+ }
328
+ onIsWrappedChange(nextIsWrap);
329
+ }, [fireEvent, isWrapped, onIsWrappedChange]);
315
330
  return jsx(TableHeading, {
316
331
  ref: mainHeaderCellRef,
317
332
  "data-testid": `${id}-column-heading`,
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::415836762b378b7d79f3aff4ba051c14>>
6
+ * @codegen <<SignedSource::21ae373abad7c370a8682ddcd3a7ed21>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  import { useCallback } from 'react';
@@ -30,6 +30,7 @@ import { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/elem
30
30
  import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
31
31
  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
32
32
  import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';
33
+ import { useDatasourceAnalyticsEvents } from '../../analytics';
33
34
  import { GlyphPlaceholder, UnwrapTextIcon, WrapTextIcon } from './custom-icons';
34
35
  import { issueLikeTableMessages } from './messages';
35
36
  import { TableHeading } from './styled';
@@ -110,6 +111,8 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref) {
110
111
  onWidthChange = _ref.onWidthChange,
111
112
  isWrapped = _ref.isWrapped,
112
113
  onIsWrappedChange = _ref.onIsWrappedChange;
114
+ var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
115
+ fireEvent = _useDatasourceAnalyti.fireEvent;
113
116
  var mainHeaderCellRef = useRef(null);
114
117
  var columnResizeHandleRef = useRef(null);
115
118
  var _useState = useState(idleState),
@@ -332,8 +335,17 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref) {
332
335
  return setIsDropdownOpen(isOpen);
333
336
  }, []);
334
337
  var toggleWrap = useCallback(function () {
335
- return onIsWrappedChange && onIsWrappedChange(!(isWrapped || false));
336
- }, [isWrapped, onIsWrappedChange]);
338
+ if (!onIsWrappedChange) {
339
+ return;
340
+ }
341
+ var nextIsWrap = !(isWrapped || false);
342
+ if (nextIsWrap) {
343
+ fireEvent('ui.button.clicked.wrap', {});
344
+ } else {
345
+ fireEvent('ui.button.clicked.unwrap', {});
346
+ }
347
+ onIsWrappedChange(nextIsWrap);
348
+ }, [fireEvent, isWrapped, onIsWrappedChange]);
337
349
  return jsx(TableHeading, {
338
350
  ref: mainHeaderCellRef,
339
351
  "data-testid": "".concat(id, "-column-heading"),
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6518dea178189cd102e0ca6ce7eae059>>
6
+ * @codegen <<SignedSource::a526398bbb8839b31c26c69ef2845c19>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -16,10 +16,6 @@ export type AnalyticsContextAttributesType = {
16
16
  dataProvider: 'jira-issues' | 'jsm-assets' | 'confluence-search';
17
17
  };
18
18
  export type DatasourceModalDialogViewedAttributesType = {};
19
- export type LinkClickedPoweredByAttributesType = {
20
- extensionKey: string;
21
- componentHierarchy: string;
22
- };
23
19
  export type ModalReadyDatasourceAttributesType = {
24
20
  instancesCount: number | null;
25
21
  schemasCount: number | null;
@@ -57,6 +53,8 @@ export type ButtonClickedCancelAttributesType = {
57
53
  extensionKey: string | null;
58
54
  actions: unknown[];
59
55
  };
56
+ export type ButtonClickedWrapAttributesType = {};
57
+ export type ButtonClickedUnwrapAttributesType = {};
60
58
  export type LinkClickedSingleItemAttributesType = {
61
59
  extensionKey: string | null;
62
60
  destinationObjectTypes: unknown[];
@@ -126,6 +124,7 @@ export type ButtonClickedBasicSearchDropdownAttributesType = {
126
124
  type: 'showMore';
127
125
  };
128
126
  export type AqlEditorSearchedAttributesType = {};
127
+ export type LinkClickedPoweredByAttributesType = {};
129
128
  export type GetWorkspaceIdSuccessAttributesType = {};
130
129
  export type GetWorkspaceIdFailedAttributesType = {
131
130
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
@@ -170,6 +169,12 @@ export type AnalyticsEventAttributes = {
170
169
  /**
171
170
  * Fired on cancel button click */
172
171
  'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
172
+ /**
173
+ * Fired on wrap button click */
174
+ 'ui.button.clicked.wrap': ButtonClickedWrapAttributesType;
175
+ /**
176
+ * Fired on unwrap button click */
177
+ 'ui.button.clicked.unwrap': ButtonClickedUnwrapAttributesType;
173
178
  /**
174
179
  * Fired when user clicks on datasource items */
175
180
  'ui.link.clicked.singleItem': LinkClickedSingleItemAttributesType;
@@ -215,12 +220,12 @@ export type AnalyticsEventAttributes = {
215
220
  /**
216
221
  * Fired when the “show more” button inside the dropdown menu is clicked */
217
222
  'ui.button.clicked.basicSearchDropdown': ButtonClickedBasicSearchDropdownAttributesType;
218
- /**
219
- * Fired when the “show more” button inside the dropdown menu is clicked */
220
- 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
221
223
  /**
222
224
  * Fired when search is initiated via the search icon or enter key press for aql editor input field. */
223
225
  'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
226
+ /**
227
+ * Fired when the power by link on the issue like table footer is clicked. */
228
+ 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
224
229
  /**
225
230
  * Fired when fetching a workspace Id is successful. */
226
231
  'operational.getWorkspaceId.success': GetWorkspaceIdSuccessAttributesType;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6518dea178189cd102e0ca6ce7eae059>>
6
+ * @codegen <<SignedSource::a526398bbb8839b31c26c69ef2845c19>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -16,10 +16,6 @@ export type AnalyticsContextAttributesType = {
16
16
  dataProvider: 'jira-issues' | 'jsm-assets' | 'confluence-search';
17
17
  };
18
18
  export type DatasourceModalDialogViewedAttributesType = {};
19
- export type LinkClickedPoweredByAttributesType = {
20
- extensionKey: string;
21
- componentHierarchy: string;
22
- };
23
19
  export type ModalReadyDatasourceAttributesType = {
24
20
  instancesCount: number | null;
25
21
  schemasCount: number | null;
@@ -57,6 +53,8 @@ export type ButtonClickedCancelAttributesType = {
57
53
  extensionKey: string | null;
58
54
  actions: unknown[];
59
55
  };
56
+ export type ButtonClickedWrapAttributesType = {};
57
+ export type ButtonClickedUnwrapAttributesType = {};
60
58
  export type LinkClickedSingleItemAttributesType = {
61
59
  extensionKey: string | null;
62
60
  destinationObjectTypes: unknown[];
@@ -126,6 +124,7 @@ export type ButtonClickedBasicSearchDropdownAttributesType = {
126
124
  type: 'showMore';
127
125
  };
128
126
  export type AqlEditorSearchedAttributesType = {};
127
+ export type LinkClickedPoweredByAttributesType = {};
129
128
  export type GetWorkspaceIdSuccessAttributesType = {};
130
129
  export type GetWorkspaceIdFailedAttributesType = {
131
130
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
@@ -170,6 +169,12 @@ export type AnalyticsEventAttributes = {
170
169
  /**
171
170
  * Fired on cancel button click */
172
171
  'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
172
+ /**
173
+ * Fired on wrap button click */
174
+ 'ui.button.clicked.wrap': ButtonClickedWrapAttributesType;
175
+ /**
176
+ * Fired on unwrap button click */
177
+ 'ui.button.clicked.unwrap': ButtonClickedUnwrapAttributesType;
173
178
  /**
174
179
  * Fired when user clicks on datasource items */
175
180
  'ui.link.clicked.singleItem': LinkClickedSingleItemAttributesType;
@@ -215,12 +220,12 @@ export type AnalyticsEventAttributes = {
215
220
  /**
216
221
  * Fired when the “show more” button inside the dropdown menu is clicked */
217
222
  'ui.button.clicked.basicSearchDropdown': ButtonClickedBasicSearchDropdownAttributesType;
218
- /**
219
- * Fired when the “show more” button inside the dropdown menu is clicked */
220
- 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
221
223
  /**
222
224
  * Fired when search is initiated via the search icon or enter key press for aql editor input field. */
223
225
  'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
226
+ /**
227
+ * Fired when the power by link on the issue like table footer is clicked. */
228
+ 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
224
229
  /**
225
230
  * Fired when fetching a workspace Id is successful. */
226
231
  'operational.getWorkspaceId.success': GetWorkspaceIdSuccessAttributesType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/empty-state": "^7.9.0",
48
48
  "@atlaskit/form": "^10.4.0",
49
49
  "@atlaskit/heading": "^2.4.0",
50
- "@atlaskit/icon": "^22.9.0",
50
+ "@atlaskit/icon": "^22.10.0",
51
51
  "@atlaskit/icon-object": "^6.4.0",
52
52
  "@atlaskit/image": "^1.3.0",
53
53
  "@atlaskit/intl-messages-provider": "^1.0.0",
@@ -75,7 +75,7 @@
75
75
  "@atlaskit/tag": "^12.4.0",
76
76
  "@atlaskit/textfield": "6.4.2",
77
77
  "@atlaskit/theme": "^12.11.0",
78
- "@atlaskit/tokens": "^1.56.0",
78
+ "@atlaskit/tokens": "^1.57.0",
79
79
  "@atlaskit/tooltip": "^18.5.0",
80
80
  "@atlaskit/ufo": "^0.2.4",
81
81
  "@atlaskit/width-detector": "^4.2.0",