@atlaskit/link-picker 1.25.3 → 1.25.4
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/common/analytics/context.js +1 -1
- package/dist/cjs/common/analytics/input-field-tracking.js +3 -3
- package/dist/cjs/common/constants.js +4 -2
- package/dist/cjs/common/utils/handleNavKeyDown.js +29 -0
- package/dist/cjs/services/use-plugins/index.js +7 -8
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +3 -1
- package/dist/cjs/ui/error-boundary/index.js +3 -3
- package/dist/cjs/ui/index.js +2 -2
- package/dist/cjs/ui/link-picker/form-footer/index.js +10 -10
- package/dist/cjs/ui/link-picker/index.js +29 -40
- package/dist/cjs/ui/link-picker/link-search-list/index.js +11 -11
- package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/index.js +1 -1
- package/dist/cjs/ui/link-picker/{list-item → link-search-list/list-item}/index.js +3 -1
- package/dist/cjs/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +5 -3
- package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +3 -0
- package/dist/cjs/ui/link-picker/styled.js +5 -23
- package/dist/cjs/ui/link-picker/text-input/index.js +4 -4
- package/dist/cjs/ui/link-picker/text-input/utils.js +28 -0
- package/dist/cjs/ui/link-picker/track-mount/index.js +1 -1
- package/dist/cjs/ui/link-picker/track-tab-viewed/index.js +1 -1
- package/dist/cjs/ui/link-picker/transformTimeStamp.js +2 -2
- package/dist/cjs/ui/link-picker/utils.js +1 -48
- package/dist/cjs/ui/loader-fallback/index.js +1 -1
- package/dist/cjs/ui/loader-fallback/styled.js +21 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/analytics/context.js +1 -1
- package/dist/es2019/common/analytics/input-field-tracking.js +2 -2
- package/dist/es2019/common/constants.js +2 -1
- package/dist/es2019/common/utils/handleNavKeyDown.js +22 -0
- package/dist/es2019/services/use-plugins/index.js +5 -6
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +2 -1
- package/dist/es2019/ui/error-boundary/index.js +3 -3
- package/dist/es2019/ui/index.js +3 -3
- package/dist/es2019/ui/link-picker/announcer.js +1 -1
- package/dist/es2019/ui/link-picker/form-footer/index.js +4 -4
- package/dist/es2019/ui/link-picker/index.js +18 -28
- package/dist/es2019/ui/link-picker/link-search-error/index.js +1 -1
- package/dist/es2019/ui/link-picker/link-search-list/index.js +5 -5
- package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/index.js +1 -1
- package/dist/es2019/ui/link-picker/{list-item → link-search-list/list-item}/index.js +3 -2
- package/dist/es2019/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +2 -2
- package/dist/es2019/ui/link-picker/link-search-list/styled.js +1 -0
- package/dist/es2019/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +6 -3
- package/dist/es2019/ui/link-picker/styled.js +0 -30
- package/dist/es2019/ui/link-picker/text-input/index.js +5 -5
- package/dist/es2019/ui/link-picker/text-input/utils.js +22 -0
- package/dist/es2019/ui/link-picker/track-mount/index.js +1 -1
- package/dist/es2019/ui/link-picker/track-tab-viewed/index.js +1 -1
- package/dist/es2019/ui/link-picker/transformTimeStamp.js +2 -2
- package/dist/es2019/ui/link-picker/utils.js +1 -45
- package/dist/es2019/ui/loader-fallback/index.js +1 -1
- package/dist/es2019/ui/loader-fallback/styled.js +25 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/analytics/context.js +1 -1
- package/dist/esm/common/analytics/input-field-tracking.js +2 -2
- package/dist/esm/common/constants.js +2 -1
- package/dist/esm/common/utils/handleNavKeyDown.js +22 -0
- package/dist/esm/services/use-plugins/index.js +5 -6
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +2 -1
- package/dist/esm/ui/error-boundary/index.js +3 -3
- package/dist/esm/ui/index.js +3 -3
- package/dist/esm/ui/link-picker/announcer.js +1 -1
- package/dist/esm/ui/link-picker/form-footer/index.js +4 -4
- package/dist/esm/ui/link-picker/index.js +19 -29
- package/dist/esm/ui/link-picker/link-search-error/index.js +1 -1
- package/dist/esm/ui/link-picker/link-search-list/index.js +5 -5
- package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/index.js +1 -1
- package/dist/esm/ui/link-picker/{list-item → link-search-list/list-item}/index.js +3 -2
- package/dist/esm/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +2 -2
- package/dist/esm/ui/link-picker/link-search-list/styled.js +1 -0
- package/dist/esm/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +6 -3
- package/dist/esm/ui/link-picker/styled.js +4 -19
- package/dist/esm/ui/link-picker/text-input/index.js +5 -5
- package/dist/esm/ui/link-picker/text-input/utils.js +20 -0
- package/dist/esm/ui/link-picker/track-mount/index.js +1 -1
- package/dist/esm/ui/link-picker/track-tab-viewed/index.js +1 -1
- package/dist/esm/ui/link-picker/transformTimeStamp.js +2 -2
- package/dist/esm/ui/link-picker/utils.js +1 -43
- package/dist/esm/ui/loader-fallback/index.js +1 -1
- package/dist/esm/ui/loader-fallback/styled.js +16 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/common/analytics/context.d.ts +1 -1
- package/dist/types/common/constants.d.ts +1 -0
- package/dist/types/{ui → common}/types.d.ts +10 -0
- package/dist/types/common/utils/handleNavKeyDown.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/services/use-plugins/index.d.ts +1 -1
- package/dist/types/services/use-plugins/reducer.d.ts +1 -1
- package/dist/types/services/use-plugins/utils.d.ts +1 -1
- package/dist/types/services/use-search-query/index.d.ts +1 -2
- package/dist/types/ui/link-picker/form-footer/index.d.ts +1 -2
- package/dist/types/ui/link-picker/form-footer/utils.d.ts +1 -1
- package/dist/types/ui/link-picker/index.d.ts +1 -13
- package/dist/types/ui/link-picker/link-search-list/index.d.ts +1 -1
- package/dist/types/ui/link-picker/{list-item → link-search-list/list-item}/index.d.ts +1 -1
- package/dist/types/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
- package/dist/types/ui/link-picker/styled.d.ts +0 -5
- package/dist/types/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.d.ts +1 -2
- package/dist/types/ui/link-picker/text-input/index.d.ts +1 -1
- package/dist/types/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types/ui/link-picker/utils.d.ts +1 -5
- package/dist/types/ui/loader-fallback/styled.d.ts +3 -0
- package/dist/types-ts4.5/common/analytics/context.d.ts +1 -1
- package/dist/types-ts4.5/common/constants.d.ts +1 -0
- package/dist/types-ts4.5/{ui → common}/types.d.ts +10 -0
- package/dist/types-ts4.5/common/utils/handleNavKeyDown.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/index.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/reducer.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/utils.d.ts +1 -1
- package/dist/types-ts4.5/services/use-search-query/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/form-footer/utils.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/index.d.ts +1 -13
- package/dist/types-ts4.5/ui/link-picker/link-search-list/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/{list-item → link-search-list/list-item}/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/styled.d.ts +0 -5
- package/dist/types-ts4.5/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types-ts4.5/ui/link-picker/utils.d.ts +1 -5
- package/dist/types-ts4.5/ui/loader-fallback/styled.d.ts +3 -0
- package/package.json +25 -5
- /package/dist/cjs/{ui → common}/types.js +0 -0
- /package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.js +0 -0
- /package/dist/cjs/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
- /package/dist/es2019/{ui → common}/types.js +0 -0
- /package/dist/es2019/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/es2019/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.js +0 -0
- /package/dist/es2019/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
- /package/dist/esm/{ui → common}/types.js +0 -0
- /package/dist/esm/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/esm/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.js +0 -0
- /package/dist/esm/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
- /package/dist/types/ui/link-picker/{list-item → link-search-list/list-item}/styled.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{list-item → link-search-list/list-item}/styled.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
-
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
5
4
|
import { ANALYTICS_CHANNEL } from '../../../common/constants';
|
|
5
|
+
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
6
6
|
export function TrackTabViewed({
|
|
7
7
|
activePlugin
|
|
8
8
|
}) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isYesterday from 'date-fns/isYesterday';
|
|
2
2
|
import { isMoreThanOneWeekAgo } from '../../common/utils/date';
|
|
3
3
|
import { selectUnit } from '../../common/utils/dateUtils';
|
|
4
|
-
import
|
|
4
|
+
import { timeMessages } from './messages';
|
|
5
5
|
const formatTime = (timeStamp, intl) => {
|
|
6
6
|
const isAbsolute = isMoreThanOneWeekAgo(timeStamp);
|
|
7
7
|
if (isAbsolute) {
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
2
1
|
import { transformTimeStamp } from './transformTimeStamp';
|
|
3
|
-
const KeyZCode = 90;
|
|
4
|
-
const KeyYCode = 89;
|
|
5
|
-
export const isUndoEvent = e => {
|
|
6
|
-
const {
|
|
7
|
-
mac
|
|
8
|
-
} = browser();
|
|
9
|
-
return e.keyCode === KeyZCode && (
|
|
10
|
-
// cmd + z for mac
|
|
11
|
-
mac && e.metaKey && !e.shiftKey ||
|
|
12
|
-
// ctrl + z for non-mac
|
|
13
|
-
!mac && e.ctrlKey);
|
|
14
|
-
};
|
|
15
|
-
export const isRedoEvent = e => {
|
|
16
|
-
const {
|
|
17
|
-
mac
|
|
18
|
-
} = browser();
|
|
19
|
-
return (
|
|
20
|
-
// ctrl + y for non-mac
|
|
21
|
-
!mac && e.ctrlKey && e.keyCode === KeyYCode || mac && e.metaKey && e.shiftKey && e.keyCode === KeyZCode || e.ctrlKey && e.shiftKey && e.keyCode === KeyZCode
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
2
|
|
|
25
3
|
/**
|
|
26
4
|
* Retrieve the data source for a link given the item and the plugin that resolved it
|
|
@@ -40,26 +18,4 @@ export function getScreenReaderText(items, selectedIndex, intl) {
|
|
|
40
18
|
const date = transformTimeStamp(intl, lastViewedDate, lastUpdatedDate);
|
|
41
19
|
return [name, container, date].filter(Boolean).join(', ');
|
|
42
20
|
}
|
|
43
|
-
}
|
|
44
|
-
export const handleNavKeyDown = (event, itemsLength, activeIndex) => {
|
|
45
|
-
let updatedIndex = activeIndex;
|
|
46
|
-
switch (event.key) {
|
|
47
|
-
case 'ArrowDown':
|
|
48
|
-
event.preventDefault();
|
|
49
|
-
updatedIndex = (activeIndex + 1) % itemsLength;
|
|
50
|
-
break;
|
|
51
|
-
case 'ArrowUp':
|
|
52
|
-
event.preventDefault();
|
|
53
|
-
updatedIndex = activeIndex > 0 ? activeIndex - 1 : itemsLength - 1;
|
|
54
|
-
break;
|
|
55
|
-
case 'Home':
|
|
56
|
-
event.preventDefault();
|
|
57
|
-
updatedIndex = 0;
|
|
58
|
-
break;
|
|
59
|
-
case 'End':
|
|
60
|
-
event.preventDefault();
|
|
61
|
-
updatedIndex = itemsLength - 1;
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
return updatedIndex;
|
|
65
|
-
};
|
|
21
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
|
-
import { rootContainerStylesForLoaderWithDisplaytext, rootContainerStylesForLoaderWithoutDisplaytext } from '
|
|
4
|
+
import { rootContainerStylesForLoaderWithDisplaytext, rootContainerStylesForLoaderWithoutDisplaytext } from './styled';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Loader / skeleton for the Link Picker. Takes displayText prop - when no displayText is given the height of the skeleton
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
4
|
+
import { rootContainerStyles } from '../link-picker/styled';
|
|
5
|
+
|
|
6
|
+
/** Link Picker loader / skeleton will be taller in height when displayText field is shown */
|
|
7
|
+
// See lazy-load-height example to verify these
|
|
8
|
+
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT = 142;
|
|
9
|
+
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = 220;
|
|
10
|
+
const rootContainerStylesForLoader = css`
|
|
11
|
+
${rootContainerStyles}
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
`;
|
|
16
|
+
export const rootContainerStylesForLoaderWithDisplaytext = css`
|
|
17
|
+
${rootContainerStylesForLoader}
|
|
18
|
+
min-height: ${LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT}px;
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
/** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
|
|
22
|
+
export const rootContainerStylesForLoaderWithoutDisplaytext = css`
|
|
23
|
+
${rootContainerStylesForLoader}
|
|
24
|
+
min-height: ${LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT}px;
|
|
25
|
+
`;
|
package/dist/es2019/version.json
CHANGED
|
@@ -5,8 +5,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
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; }
|
|
6
6
|
import React, { useCallback, useContext, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { AnalyticsListener } from '@atlaskit/analytics-next';
|
|
8
|
-
import { ANALYTICS_CHANNEL } from '../constants';
|
|
9
8
|
import { normalizeUrl } from '@atlaskit/linking-common/url';
|
|
9
|
+
import { ANALYTICS_CHANNEL } from '../constants';
|
|
10
10
|
var DEFAULT_CONTEXT_ATTRIBUTES = {
|
|
11
11
|
linkState: 'newLink',
|
|
12
12
|
linkFieldContent: null,
|
|
@@ -3,9 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
4
|
import React, { useCallback, useRef } from 'react';
|
|
5
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
|
-
import { ANALYTICS_CHANNEL } from '../constants';
|
|
7
6
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
8
|
-
import {
|
|
7
|
+
import { ANALYTICS_CHANNEL } from '../constants';
|
|
8
|
+
import { useLinkPickerAnalytics } from './index';
|
|
9
9
|
var isEventWithInputType = function isEventWithInputType(e) {
|
|
10
10
|
return _typeof(e) === 'object' && e !== null && 'inputType' in e;
|
|
11
11
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var handleNavKeyDown = function handleNavKeyDown(event, itemsLength, activeIndex) {
|
|
2
|
+
var updatedIndex = activeIndex;
|
|
3
|
+
switch (event.key) {
|
|
4
|
+
case 'ArrowDown':
|
|
5
|
+
event.preventDefault();
|
|
6
|
+
updatedIndex = (activeIndex + 1) % itemsLength;
|
|
7
|
+
break;
|
|
8
|
+
case 'ArrowUp':
|
|
9
|
+
event.preventDefault();
|
|
10
|
+
updatedIndex = activeIndex > 0 ? activeIndex - 1 : itemsLength - 1;
|
|
11
|
+
break;
|
|
12
|
+
case 'Home':
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
updatedIndex = 0;
|
|
15
|
+
break;
|
|
16
|
+
case 'End':
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
updatedIndex = itemsLength - 1;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
return updatedIndex;
|
|
22
|
+
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
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
|
-
import { useEffect, useMemo, useState
|
|
5
|
-
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
-
import {
|
|
6
|
+
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
7
|
+
import { useLinkPickerAnalytics } from '../../common/analytics';
|
|
8
|
+
import { ANALYTICS_CHANNEL, RECENT_SEARCH_LIST_SIZE } from '../../common/constants';
|
|
8
9
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
9
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
10
|
-
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
11
10
|
import { usePluginReducer } from './reducer';
|
|
12
|
-
import {
|
|
11
|
+
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
13
12
|
export function usePlugins(state, activeTab, plugins) {
|
|
14
13
|
var _activePlugin$tabKey;
|
|
15
14
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import EmptyState from '@atlaskit/empty-state';
|
|
4
3
|
import { defineMessages, useIntl } from 'react-intl-next';
|
|
4
|
+
import EmptyState from '@atlaskit/empty-state';
|
|
5
5
|
import { GenericErrorSVG } from '../../../common/generic-error-svg';
|
|
6
|
+
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
6
7
|
import { rootContainerStyles } from '../../link-picker/styled';
|
|
7
8
|
var messages = defineMessages({
|
|
8
9
|
heading: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
|
-
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
4
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
5
3
|
import { failUfoExperience, ufoExperience } from '../../common/analytics/experiences';
|
|
4
|
+
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
5
|
+
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
6
6
|
import { useLinkPickerSessionId } from '../../controllers/session-provider';
|
|
7
|
-
import { ErrorBoundaryFallback } from './error-boundary-fallback';
|
|
8
7
|
import { BaseErrorBoundary } from './error-boundary-base';
|
|
8
|
+
import { ErrorBoundaryFallback } from './error-boundary-fallback';
|
|
9
9
|
export function ErrorBoundary(_ref) {
|
|
10
10
|
var children = _ref.children;
|
|
11
11
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
2
|
import React, { memo } from 'react';
|
|
4
|
-
import {
|
|
3
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
4
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
5
5
|
import { COMPONENT_NAME } from '../common/constants';
|
|
6
|
+
import { LinkPickerSessionProvider } from '../controllers/session-provider';
|
|
6
7
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
7
8
|
import { ErrorBoundary } from './error-boundary';
|
|
8
9
|
import { LoaderFallback } from './loader-fallback';
|
|
9
|
-
import { LinkPickerSessionProvider } from '../controllers/session-provider';
|
|
10
10
|
import { MessagesProvider } from './messages-provider';
|
|
11
11
|
export var testIds = {
|
|
12
12
|
linkPickerRoot: 'link-picker-root'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { forwardRef, memo,
|
|
2
|
+
import React, { forwardRef, memo, useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
// How to use:
|
|
5
5
|
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Preferring_specialized_live_region_roles
|
|
@@ -2,14 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["isLoading", "error", "url", "queryState", "items", "isEditing", "onCancel", "action"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
5
|
import { memo } from 'react';
|
|
7
|
-
import {
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
|
+
import { defineMessages, useIntl } from 'react-intl-next';
|
|
8
8
|
import Button, { ButtonGroup } from '@atlaskit/button';
|
|
9
9
|
import EditorAddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
10
|
-
import { formFooterStyles, formFooterActionStyles } from './styled';
|
|
11
|
-
import { checkSubmitDisabled } from './utils';
|
|
12
10
|
import { UnauthenticatedError } from '../../../common/utils/errors';
|
|
11
|
+
import { formFooterActionStyles, formFooterStyles } from './styled';
|
|
12
|
+
import { checkSubmitDisabled } from './utils';
|
|
13
13
|
var messages = defineMessages({
|
|
14
14
|
cancelButton: {
|
|
15
15
|
id: 'fabric.linkPicker.button.cancel',
|
|
@@ -4,41 +4,39 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
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; }
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { Fragment, useCallback, useLayoutEffect, useReducer
|
|
7
|
+
import { Fragment, memo, useCallback, useLayoutEffect, useReducer } from 'react';
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
|
-
import {
|
|
9
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
10
10
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
11
|
-
import
|
|
11
|
+
import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
|
|
12
|
+
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
13
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
12
14
|
import Tabs, { Tab, TabList } from '@atlaskit/tabs';
|
|
13
15
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
14
|
-
import Spinner from '@atlaskit/spinner/spinner';
|
|
15
|
-
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
16
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
17
16
|
import { useLinkPickerAnalytics, withInputFieldTracking, withLinkPickerAnalyticsContext } from '../../common/analytics';
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
17
|
+
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
18
|
+
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
19
|
+
import { handleNavKeyDown } from '../../common/utils/handleNavKeyDown';
|
|
20
|
+
import { useFixHeight } from '../../controllers/use-fix-height';
|
|
20
21
|
import { usePlugins } from '../../services/use-plugins';
|
|
21
22
|
import { useSearchQuery } from '../../services/use-search-query';
|
|
22
|
-
import { useFixHeight } from '../../controllers/use-fix-height';
|
|
23
|
-
import { searchMessages, linkMessages, formMessages, linkTextMessages } from './messages';
|
|
24
|
-
import { TextInput, testIds as textFieldTestIds } from './text-input';
|
|
25
|
-
import { rootContainerStyles, searchIconStyles, tabsWrapperStyles, flexColumnStyles, formFooterMargin } from './styled';
|
|
26
23
|
import { Announcer } from './announcer';
|
|
27
|
-
import { ScrollingTabList } from '../scrolling-tabs';
|
|
28
|
-
import { LinkSearchList, testIds as listTestIds } from './link-search-list';
|
|
29
|
-
import { LinkSearchError, testIds as searchErrorTestIds } from './link-search-error';
|
|
30
24
|
import { FormFooter, testIds as formFooterTestIds } from './form-footer';
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import { TrackMount } from './track-mount';
|
|
25
|
+
import { LinkSearchError, testIds as searchErrorTestIds } from './link-search-error';
|
|
26
|
+
import { LinkSearchList, testIds as listTestIds } from './link-search-list';
|
|
34
27
|
import { spinnerContainerStyles } from './link-search-list/styled';
|
|
35
|
-
|
|
28
|
+
import { formMessages, linkMessages, linkTextMessages, searchMessages } from './messages';
|
|
29
|
+
import { ScrollingTabList } from './scrolling-tabs';
|
|
30
|
+
import { flexColumnStyles, formFooterMargin, rootContainerStyles, tabsWrapperStyles } from './styled';
|
|
31
|
+
import { testIds as textFieldTestIds, TextInput } from './text-input';
|
|
32
|
+
import { TrackMount } from './track-mount';
|
|
33
|
+
import { TrackTabViewed } from './track-tab-viewed';
|
|
34
|
+
import { getDataSource, getScreenReaderText } from './utils';
|
|
36
35
|
export var testIds = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
37
36
|
linkPickerRoot: 'link-picker-root',
|
|
38
37
|
linkPicker: 'link-picker',
|
|
39
38
|
urlInputField: 'link-url',
|
|
40
|
-
textInputField: 'link-text'
|
|
41
|
-
searchIcon: 'link-picker-search-icon'
|
|
39
|
+
textInputField: 'link-text'
|
|
42
40
|
}, formFooterTestIds), searchErrorTestIds), listTestIds), textFieldTestIds), {}, {
|
|
43
41
|
tabList: 'link-picker-tabs',
|
|
44
42
|
tabItem: 'link-picker-tab'
|
|
@@ -282,13 +280,6 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
282
280
|
// as the Aria design pattern for combobox does not work in this case
|
|
283
281
|
// for details: https://a11y-internal.atlassian.net/browse/AK-740
|
|
284
282
|
var screenReaderText = browser().safari && getScreenReaderText(items !== null && items !== void 0 ? items : [], selectedIndex, intl);
|
|
285
|
-
var searchIcon = isActivePlugin && jsx("span", {
|
|
286
|
-
css: searchIconStyles,
|
|
287
|
-
"data-testid": testIds.searchIcon
|
|
288
|
-
}, jsx(EditorSearchIcon, {
|
|
289
|
-
size: "medium",
|
|
290
|
-
label: ''
|
|
291
|
-
}));
|
|
292
283
|
var tabList = jsx(TabList, null, tabs.map(function (tab) {
|
|
293
284
|
return jsx(Tab, {
|
|
294
285
|
key: tab.tabTitle,
|
|
@@ -315,7 +306,6 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
315
306
|
placeholder: intl.formatMessage(messages.linkPlaceholder),
|
|
316
307
|
value: url,
|
|
317
308
|
autoFocus: true,
|
|
318
|
-
elemBeforeInput: searchIcon,
|
|
319
309
|
clearLabel: intl.formatMessage(formMessages.clearLink),
|
|
320
310
|
"aria-expanded": true,
|
|
321
311
|
"aria-autocomplete": "list",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
4
|
+
import { defineMessages, FormattedMessage, useIntl } from 'react-intl-next';
|
|
5
5
|
import Button from '@atlaskit/button';
|
|
6
6
|
import EmptyState from '@atlaskit/empty-state';
|
|
7
7
|
import { GenericErrorSVG } from '../../../common/generic-error-svg';
|
|
@@ -7,16 +7,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
/** @jsx jsx */
|
|
8
8
|
import { forwardRef, Fragment, useCallback, useRef } from 'react';
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { defineMessages, FormattedMessage } from 'react-intl-next';
|
|
11
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import Spinner from '@atlaskit/spinner';
|
|
13
13
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
14
|
-
import {
|
|
15
|
-
import { listContainerStyles, spinnerContainerStyles, listStyles, listTitleStyles } from './styled';
|
|
14
|
+
import { handleNavKeyDown } from '../../../common/utils/handleNavKeyDown';
|
|
16
15
|
import { NoResults, testIds as noResultsTestIds } from './link-search-no-results';
|
|
17
|
-
import { useTrackResultsShown } from './use-track-results-shown';
|
|
18
|
-
import { handleNavKeyDown } from '../utils';
|
|
19
16
|
import { emptyStateNoResultsWrapper } from './link-search-no-results/styled';
|
|
17
|
+
import { LinkSearchListItem, testIds as searchResultItemTestIds } from './list-item';
|
|
18
|
+
import { listContainerStyles, listStyles, listTitleStyles, spinnerContainerStyles } from './styled';
|
|
19
|
+
import { useTrackResultsShown } from './use-track-results-shown';
|
|
20
20
|
export var messages = defineMessages({
|
|
21
21
|
titleRecentlyViewed: {
|
|
22
22
|
id: 'fabric.linkPicker.listTitle.recentlyViewed',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl-next';
|
|
3
4
|
import EmptyState from '@atlaskit/empty-state';
|
|
4
|
-
import { useIntl, defineMessages } from 'react-intl-next';
|
|
5
5
|
import { NoResultsSVG } from './no-results-svg';
|
|
6
6
|
import { emptyStateWrapperStyles } from './styled';
|
|
7
7
|
export var messages = defineMessages({
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { forwardRef, Fragment } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { useIntl } from 'react-intl-next';
|
|
5
|
-
|
|
6
|
-
import {
|
|
5
|
+
/* eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports */
|
|
6
|
+
import { transformTimeStamp } from '../../transformTimeStamp';
|
|
7
|
+
import { composeListItemStyles, imgStyles, itemIconStyles, itemNameStyles, listItemContainerInnerStyles, listItemContainerStyles, listItemContextStyles, listItemNameStyles } from './styled';
|
|
7
8
|
export var testIds = {
|
|
8
9
|
searchResultItem: 'link-search-list-item',
|
|
9
10
|
searchResultIcon: 'link-search-list-item-icon'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import {
|
|
4
|
+
import { B100, B400, B50, N20, N200, N300, N800 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { fontSize, fontSizeSmall } from '@atlaskit/theme/constants';
|
|
5
6
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
6
7
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
7
|
-
import { fontSizeSmall, fontSize } from '@atlaskit/theme';
|
|
8
8
|
export var relativeFontSizeToBase16 = function relativeFontSizeToBase16(px) {
|
|
9
9
|
if (typeof px === 'string') {
|
|
10
10
|
px = parseInt(px);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
|
|
4
5
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
5
6
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
6
7
|
import { typography } from '@atlaskit/theme';
|
|
@@ -4,13 +4,13 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
|
4
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import Button from '@atlaskit/button';
|
|
10
10
|
import ChevronLeftIcon from '@atlaskit/icon/glyph/chevron-left';
|
|
11
11
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { calculateConditionalButtons, createGhost, getTabList, scrollBack, scrollForward } from './scrolling-tabs';
|
|
13
|
+
import { backButtonStyles, containerStyles, nextButtonStyles, scrollingContainerStyles } from './styles';
|
|
14
14
|
function isTouchDevice() {
|
|
15
15
|
return 'ontouchstart' in window ||
|
|
16
16
|
// eslint-disable-next-line compat/compat
|
|
@@ -20,6 +20,8 @@ var initialConditionalButtonsState = {
|
|
|
20
20
|
back: false,
|
|
21
21
|
forward: false
|
|
22
22
|
};
|
|
23
|
+
|
|
24
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
23
25
|
export var ScrollingTabList = function ScrollingTabList(props) {
|
|
24
26
|
var ref = useRef(null);
|
|
25
27
|
var _useState = useState(initialConditionalButtonsState),
|
|
@@ -97,6 +99,7 @@ export var ScrollingTabList = function ScrollingTabList(props) {
|
|
|
97
99
|
}
|
|
98
100
|
return function () {
|
|
99
101
|
if (scrollingContainer) {
|
|
102
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
100
103
|
scrollingContainer.removeEventListener('scroll', handleConditionalButtonsChange);
|
|
101
104
|
}
|
|
102
105
|
if (tabs.length) {
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { N500 } from '@atlaskit/theme/colors';
|
|
5
4
|
var LINK_PICKER_WIDTH_IN_PX = 342;
|
|
6
5
|
|
|
7
|
-
// See lazy-load-height example to verify these
|
|
8
|
-
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT = 142;
|
|
9
|
-
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = 220;
|
|
10
|
-
|
|
11
6
|
/**
|
|
12
7
|
* Half padding on the top as the form field has a `gridSize()` margin top that cannot be overridden
|
|
13
8
|
*/
|
|
14
9
|
export var rootContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n padding: ", " ", "\n ", ";\n box-sizing: border-box;\n line-height: initial;\n"])), LINK_PICKER_WIDTH_IN_PX, "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-200, 16px)");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
/** Link Picker loader / skeleton will be taller in height when displayText field is shown */
|
|
20
|
-
export var rootContainerStylesForLoaderWithDisplaytext = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n min-height: ", "px;\n"])), rootContainerStylesForLoader, LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT);
|
|
21
|
-
|
|
22
|
-
/** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
|
|
23
|
-
export var rootContainerStylesForLoaderWithoutDisplaytext = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n min-height: ", "px;\n"])), rootContainerStylesForLoader, LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT);
|
|
24
|
-
export var searchIconStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: ", ";\n color: ", ";\n cursor: default;\n"])), "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N500, ")"));
|
|
25
|
-
export var tabsWrapperStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-top: ", ";\n margin-left: calc(-1 * ", ");\n margin-right: calc(-1 * ", ");\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
|
|
26
|
-
export var flexColumnStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
27
|
-
export var formFooterMargin = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-top: ", ";\n"])), "var(--ds-space-200, 16px)");
|
|
10
|
+
export var tabsWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-top: ", ";\n margin-left: calc(-1 * ", ");\n margin-right: calc(-1 * ", ");\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
|
|
11
|
+
export var flexColumnStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
12
|
+
export var formFooterMargin = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-top: ", ";\n"])), "var(--ds-space-200, 16px)");
|
|
@@ -2,15 +2,15 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
|
-
import { useCallback, useRef
|
|
5
|
+
import { Fragment, useCallback, useRef } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
8
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
9
|
-
import Textfield from '@atlaskit/textfield';
|
|
10
8
|
import Selectclear from '@atlaskit/icon/glyph/select-clear';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import Textfield from '@atlaskit/textfield';
|
|
10
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
11
|
+
import { ConditionalSpotlightTargetWrapper } from './conditional-spotlight-target-wrapper';
|
|
13
12
|
import { clearTextButtonStyles, fieldStyles } from './styled';
|
|
13
|
+
import { isRedoEvent, isUndoEvent } from './utils';
|
|
14
14
|
export var testIds = {
|
|
15
15
|
urlError: 'link-error',
|
|
16
16
|
clearUrlButton: 'clear-text'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
2
|
+
var KeyZCode = 90;
|
|
3
|
+
var KeyYCode = 89;
|
|
4
|
+
export var isUndoEvent = function isUndoEvent(e) {
|
|
5
|
+
var _browser = browser(),
|
|
6
|
+
mac = _browser.mac;
|
|
7
|
+
return e.keyCode === KeyZCode && (
|
|
8
|
+
// cmd + z for mac
|
|
9
|
+
mac && e.metaKey && !e.shiftKey ||
|
|
10
|
+
// ctrl + z for non-mac
|
|
11
|
+
!mac && e.ctrlKey);
|
|
12
|
+
};
|
|
13
|
+
export var isRedoEvent = function isRedoEvent(e) {
|
|
14
|
+
var _browser2 = browser(),
|
|
15
|
+
mac = _browser2.mac;
|
|
16
|
+
return (
|
|
17
|
+
// ctrl + y for non-mac
|
|
18
|
+
!mac && e.ctrlKey && e.keyCode === KeyYCode || mac && e.metaKey && e.shiftKey && e.keyCode === KeyZCode || e.ctrlKey && e.shiftKey && e.keyCode === KeyZCode
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import { succeedUfoExperience, ufoExperience } from '../../../common/analytics/experiences';
|
|
5
|
-
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
6
5
|
import { ANALYTICS_CHANNEL } from '../../../common/constants';
|
|
6
|
+
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
7
7
|
import { useLinkPickerSessionId } from '../../../controllers/session-provider';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
-
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
5
4
|
import { ANALYTICS_CHANNEL } from '../../../common/constants';
|
|
5
|
+
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
6
6
|
export function TrackTabViewed(_ref) {
|
|
7
7
|
var activePlugin = _ref.activePlugin;
|
|
8
8
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isYesterday from 'date-fns/isYesterday';
|
|
2
2
|
import { isMoreThanOneWeekAgo } from '../../common/utils/date';
|
|
3
3
|
import { selectUnit } from '../../common/utils/dateUtils';
|
|
4
|
-
import
|
|
4
|
+
import { timeMessages } from './messages';
|
|
5
5
|
var formatTime = function formatTime(timeStamp, intl) {
|
|
6
6
|
var isAbsolute = isMoreThanOneWeekAgo(timeStamp);
|
|
7
7
|
if (isAbsolute) {
|