@atlaskit/link-picker 1.25.2 → 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/.eslintrc.js +18 -0
- package/CHANGELOG.md +12 -0
- package/compass.yml +43 -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/generic-error-svg/index.js +2 -3
- package/dist/cjs/common/utils/handleNavKeyDown.js +29 -0
- package/dist/cjs/controllers/use-fix-height/index.js +2 -3
- package/dist/cjs/services/use-plugins/index.js +7 -8
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +5 -3
- package/dist/cjs/ui/error-boundary/index.js +8 -9
- package/dist/cjs/ui/index.js +13 -10
- package/dist/cjs/ui/link-picker/announcer.js +4 -5
- package/dist/cjs/ui/link-picker/form-footer/index.js +13 -14
- package/dist/cjs/ui/link-picker/index.js +37 -49
- package/dist/cjs/ui/link-picker/link-search-error/index.js +4 -5
- package/dist/cjs/ui/link-picker/link-search-list/index.js +18 -23
- package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/index.js +5 -6
- package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/cjs/ui/link-picker/{list-item → link-search-list/list-item}/index.js +47 -43
- 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 +5 -4
- package/dist/cjs/ui/link-picker/styled.js +5 -23
- package/dist/cjs/ui/link-picker/text-input/index.js +6 -7
- package/dist/cjs/ui/link-picker/text-input/utils.js +28 -0
- package/dist/cjs/ui/link-picker/track-mount/index.js +3 -5
- package/dist/cjs/ui/link-picker/track-tab-viewed/index.js +3 -5
- 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/generic-error-svg/index.js +2 -3
- package/dist/es2019/common/utils/handleNavKeyDown.js +22 -0
- package/dist/es2019/controllers/use-fix-height/index.js +2 -3
- package/dist/es2019/services/use-plugins/index.js +5 -6
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +3 -2
- package/dist/es2019/ui/error-boundary/index.js +10 -9
- package/dist/es2019/ui/index.js +10 -7
- package/dist/es2019/ui/link-picker/announcer.js +3 -4
- package/dist/es2019/ui/link-picker/form-footer/index.js +6 -7
- package/dist/es2019/ui/link-picker/index.js +23 -34
- package/dist/es2019/ui/link-picker/link-search-error/index.js +4 -5
- package/dist/es2019/ui/link-picker/link-search-list/index.js +11 -12
- package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/index.js +4 -5
- package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/es2019/ui/link-picker/{list-item → link-search-list/list-item}/index.js +42 -40
- 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 +7 -5
- package/dist/es2019/ui/link-picker/styled.js +0 -30
- package/dist/es2019/ui/link-picker/text-input/index.js +7 -8
- package/dist/es2019/ui/link-picker/text-input/utils.js +22 -0
- package/dist/es2019/ui/link-picker/track-mount/index.js +3 -4
- package/dist/es2019/ui/link-picker/track-tab-viewed/index.js +3 -4
- 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/generic-error-svg/index.js +2 -3
- package/dist/esm/common/utils/handleNavKeyDown.js +22 -0
- package/dist/esm/controllers/use-fix-height/index.js +2 -3
- package/dist/esm/services/use-plugins/index.js +5 -6
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +3 -2
- package/dist/esm/ui/error-boundary/index.js +9 -9
- package/dist/esm/ui/index.js +13 -9
- package/dist/esm/ui/link-picker/announcer.js +3 -4
- package/dist/esm/ui/link-picker/form-footer/index.js +6 -7
- package/dist/esm/ui/link-picker/index.js +23 -34
- package/dist/esm/ui/link-picker/link-search-error/index.js +4 -5
- package/dist/esm/ui/link-picker/link-search-list/index.js +11 -13
- package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/index.js +4 -5
- package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/esm/ui/link-picker/{list-item → link-search-list/list-item}/index.js +42 -40
- 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 +7 -5
- package/dist/esm/ui/link-picker/styled.js +4 -19
- package/dist/esm/ui/link-picker/text-input/index.js +7 -8
- package/dist/esm/ui/link-picker/text-input/utils.js +20 -0
- package/dist/esm/ui/link-picker/track-mount/index.js +3 -4
- package/dist/esm/ui/link-picker/track-tab-viewed/index.js +3 -4
- 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/common/generic-error-svg/index.d.ts +1 -2
- package/dist/types/{ui → common}/types.d.ts +10 -0
- package/dist/types/common/utils/handleNavKeyDown.d.ts +2 -0
- package/dist/types/controllers/use-fix-height/index.d.ts +1 -2
- 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/error-boundary/index.d.ts +4 -5
- package/dist/types/ui/index.d.ts +0 -1
- package/dist/types/ui/link-picker/announcer.d.ts +2 -2
- package/dist/types/ui/link-picker/form-footer/index.d.ts +3 -4
- package/dist/types/ui/link-picker/form-footer/utils.d.ts +1 -1
- package/dist/types/ui/link-picker/index.d.ts +5 -16
- package/dist/types/ui/link-picker/link-search-error/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/index.d.ts +5 -4
- package/dist/types/ui/link-picker/link-search-list/link-search-no-results/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/list-item/index.d.ts +19 -0
- package/dist/types/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
- package/dist/{types-ts4.5/ui → types/ui/link-picker}/scrolling-tabs/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 +2 -3
- package/dist/types/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types/ui/link-picker/track-mount/index.d.ts +1 -2
- package/dist/types/ui/link-picker/track-tab-viewed/index.d.ts +1 -2
- 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/common/generic-error-svg/index.d.ts +1 -2
- 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/controllers/use-fix-height/index.d.ts +1 -2
- 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/error-boundary/index.d.ts +4 -5
- package/dist/types-ts4.5/ui/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/announcer.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +3 -4
- 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 +5 -16
- package/dist/types-ts4.5/ui/link-picker/link-search-error/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/index.d.ts +5 -4
- package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/list-item/index.d.ts +19 -0
- package/dist/types-ts4.5/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
- package/dist/{types/ui → types-ts4.5/ui/link-picker}/scrolling-tabs/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 +2 -3
- package/dist/types-ts4.5/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types-ts4.5/ui/link-picker/track-mount/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/track-tab-viewed/index.d.ts +1 -2
- 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 +26 -6
- package/dist/types/ui/link-picker/list-item/index.d.ts +0 -16
- package/dist/types-ts4.5/ui/link-picker/list-item/index.d.ts +0 -16
- /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}/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}/scrolling-tabs.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.d.ts +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
4
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
2
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
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';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { ErrorBoundaryFallback } from './error-boundary-fallback';
|
|
9
|
+
export function ErrorBoundary(_ref) {
|
|
10
|
+
var children = _ref.children;
|
|
11
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
12
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
12
13
|
var linkPickerSessionId = useLinkPickerSessionId();
|
|
13
14
|
var handleError = useCallback(function (error, info) {
|
|
14
15
|
var _window, _window$navigator, _info$componentStack;
|
|
@@ -26,5 +27,4 @@ function ErrorBoundary(_ref) {
|
|
|
26
27
|
onError: handleError,
|
|
27
28
|
ErrorComponent: ErrorBoundaryFallback
|
|
28
29
|
}, children);
|
|
29
|
-
}
|
|
30
|
-
export default withAnalyticsEvents()(ErrorBoundary);
|
|
30
|
+
}
|
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
|
-
import ErrorBoundary from './error-boundary';
|
|
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'
|
|
@@ -19,10 +19,15 @@ export var PACKAGE_DATA = {
|
|
|
19
19
|
};
|
|
20
20
|
var LazyLinkPicker = lazyForPaint(function () {
|
|
21
21
|
return import( /* webpackChunkName: "@atlaskit-internal_link-picker" */
|
|
22
|
-
'./link-picker')
|
|
22
|
+
'./link-picker').then(function (_ref) {
|
|
23
|
+
var LinkPicker = _ref.LinkPicker;
|
|
24
|
+
return {
|
|
25
|
+
default: LinkPicker
|
|
26
|
+
};
|
|
27
|
+
});
|
|
23
28
|
});
|
|
24
|
-
var DefaultRootComponent = function DefaultRootComponent(
|
|
25
|
-
var children =
|
|
29
|
+
var DefaultRootComponent = function DefaultRootComponent(_ref2) {
|
|
30
|
+
var children = _ref2.children;
|
|
26
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
32
|
"data-testid": testIds.linkPickerRoot
|
|
28
33
|
}, children);
|
|
@@ -39,5 +44,4 @@ export var ComposedLinkPicker = /*#__PURE__*/memo(function (props) {
|
|
|
39
44
|
}, /*#__PURE__*/React.createElement(RootComponent, _extends({}, props, {
|
|
40
45
|
"data-testid": testIds.linkPickerRoot
|
|
41
46
|
}), /*#__PURE__*/React.createElement(LazyLinkPicker, props)))))));
|
|
42
|
-
});
|
|
43
|
-
export default ComposedLinkPicker;
|
|
47
|
+
});
|
|
@@ -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
|
|
@@ -13,7 +13,7 @@ import React, { forwardRef, memo, useState, useEffect } from 'react';
|
|
|
13
13
|
// Note: Flag 'contentRendered' resolves bug with duplicates messages (NVDA + Firefox)
|
|
14
14
|
// https://github.com/nvaccess/nvda/labels/bug%2Fdouble-speaking
|
|
15
15
|
var timer;
|
|
16
|
-
var Announcer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
16
|
+
export var Announcer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
17
17
|
var _ref$ariaAtomic = _ref.ariaAtomic,
|
|
18
18
|
ariaAtomic = _ref$ariaAtomic === void 0 ? 'true' : _ref$ariaAtomic,
|
|
19
19
|
_ref$ariaLive = _ref.ariaLive,
|
|
@@ -48,5 +48,4 @@ var Announcer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
48
48
|
"aria-relevant": ariaRelevant,
|
|
49
49
|
"aria-live": ariaLive
|
|
50
50
|
}, contentRendered && /*#__PURE__*/React.createElement("span", null, text));
|
|
51
|
-
});
|
|
52
|
-
export default /*#__PURE__*/memo(Announcer);
|
|
51
|
+
}));
|
|
@@ -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',
|
|
@@ -32,7 +32,7 @@ export var testIds = {
|
|
|
32
32
|
cancelButton: 'link-picker-cancel-button',
|
|
33
33
|
actionButton: 'link-picker-action-button'
|
|
34
34
|
};
|
|
35
|
-
var FormFooter = function
|
|
35
|
+
export var FormFooter = /*#__PURE__*/memo(function (_ref) {
|
|
36
36
|
var isLoading = _ref.isLoading,
|
|
37
37
|
error = _ref.error,
|
|
38
38
|
url = _ref.url,
|
|
@@ -70,5 +70,4 @@ var FormFooter = function FormFooter(_ref) {
|
|
|
70
70
|
testId: testIds.insertButton,
|
|
71
71
|
isDisabled: isSubmitDisabled
|
|
72
72
|
}, intl.formatMessage(insertButtonMsg))));
|
|
73
|
-
};
|
|
74
|
-
export default /*#__PURE__*/memo(FormFooter);
|
|
73
|
+
});
|
|
@@ -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 createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
15
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
16
16
|
import { useLinkPickerAnalytics, withInputFieldTracking, withLinkPickerAnalyticsContext } from '../../common/analytics';
|
|
17
|
-
import {
|
|
18
|
-
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';
|
|
19
21
|
import { usePlugins } from '../../services/use-plugins';
|
|
20
22
|
import { useSearchQuery } from '../../services/use-search-query';
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import Announcer from './announcer';
|
|
26
|
-
import ScrollingTabList from '../scrolling-tabs';
|
|
27
|
-
import LinkSearchList, { testIds as listTestIds } from './link-search-list';
|
|
28
|
-
import LinkSearchError, { testIds as searchErrorTestIds } from './link-search-error';
|
|
29
|
-
import FormFooter, { testIds as formFooterTestIds } from './form-footer';
|
|
30
|
-
import { getDataSource, getScreenReaderText, handleNavKeyDown } from './utils';
|
|
31
|
-
import TrackTabViewed from './track-tab-viewed';
|
|
32
|
-
import TrackMount from './track-mount';
|
|
23
|
+
import { Announcer } from './announcer';
|
|
24
|
+
import { FormFooter, testIds as formFooterTestIds } from './form-footer';
|
|
25
|
+
import { LinkSearchError, testIds as searchErrorTestIds } from './link-search-error';
|
|
26
|
+
import { LinkSearchList, testIds as listTestIds } from './link-search-list';
|
|
33
27
|
import { spinnerContainerStyles } from './link-search-list/styled';
|
|
34
|
-
import
|
|
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'
|
|
@@ -78,7 +76,7 @@ var LinkInputField = withInputFieldTracking(TextInput, 'link', function (event,
|
|
|
78
76
|
});
|
|
79
77
|
});
|
|
80
78
|
var DisplayTextInputField = withInputFieldTracking(TextInput, 'displayText');
|
|
81
|
-
|
|
79
|
+
export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(function (_ref) {
|
|
82
80
|
var _activePlugin$errorFa, _activePlugin$errorFa2;
|
|
83
81
|
var onSubmit = _ref.onSubmit,
|
|
84
82
|
onCancel = _ref.onCancel,
|
|
@@ -282,13 +280,6 @@ function LinkPicker(_ref) {
|
|
|
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 @@ function LinkPicker(_ref) {
|
|
|
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",
|
|
@@ -378,5 +368,4 @@ function LinkPicker(_ref) {
|
|
|
378
368
|
action: pluginAction,
|
|
379
369
|
css: !queryState || !(plugins !== null && plugins !== void 0 && plugins.length) ? formFooterMargin : undefined
|
|
380
370
|
}));
|
|
381
|
-
}
|
|
382
|
-
export default withLinkPickerAnalyticsContext( /*#__PURE__*/memo(LinkPicker));
|
|
371
|
+
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
import GenericErrorSVG from '../../../common/generic-error-svg';
|
|
7
|
+
import { GenericErrorSVG } from '../../../common/generic-error-svg';
|
|
8
8
|
export var CONTACT_SUPPORT_LINK = 'https://support.atlassian.com/contact/';
|
|
9
9
|
export var messages = defineMessages({
|
|
10
10
|
searchErrorHeader: {
|
|
@@ -21,7 +21,7 @@ export var messages = defineMessages({
|
|
|
21
21
|
export var testIds = {
|
|
22
22
|
searchError: 'link-search-error'
|
|
23
23
|
};
|
|
24
|
-
var LinkSearchError = function LinkSearchError() {
|
|
24
|
+
export var LinkSearchError = function LinkSearchError() {
|
|
25
25
|
var intl = useIntl();
|
|
26
26
|
return jsx(EmptyState, {
|
|
27
27
|
testId: testIds.searchError,
|
|
@@ -43,5 +43,4 @@ var LinkSearchError = function LinkSearchError() {
|
|
|
43
43
|
return jsx(GenericErrorSVG, null);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
};
|
|
47
|
-
export default LinkSearchError;
|
|
46
|
+
};
|
|
@@ -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 {
|
|
16
|
-
import LinkSearchNoResults, { testIds as noResultsTestIds } from './link-search-no-results';
|
|
17
|
-
import { useTrackResultsShown } from './use-track-results-shown';
|
|
18
|
-
import { handleNavKeyDown } from '../utils';
|
|
14
|
+
import { handleNavKeyDown } from '../../../common/utils/handleNavKeyDown';
|
|
15
|
+
import { NoResults, testIds as noResultsTestIds } from './link-search-no-results';
|
|
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',
|
|
@@ -34,14 +34,13 @@ export var messages = defineMessages({
|
|
|
34
34
|
description: 'Announce search results for screen-reader users.'
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
export var testIds = _objectSpread(_objectSpread({}, noResultsTestIds), {}, {
|
|
37
|
+
export var testIds = _objectSpread(_objectSpread(_objectSpread({}, noResultsTestIds), searchResultItemTestIds), {}, {
|
|
38
38
|
resultListTitle: 'link-picker-list-title',
|
|
39
|
-
searchResultItem: 'link-search-list-item',
|
|
40
39
|
searchResultList: 'link-search-list',
|
|
41
40
|
searchResultLoadingIndicator: 'link-picker.results-loading-indicator',
|
|
42
41
|
tabsLoadingIndicator: 'link-picker.tabs-loading-indicator'
|
|
43
42
|
});
|
|
44
|
-
var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
|
+
export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
45
44
|
var onChange = _ref.onChange,
|
|
46
45
|
onSelect = _ref.onSelect,
|
|
47
46
|
onKeyDown = _ref.onKeyDown,
|
|
@@ -104,14 +103,14 @@ var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
104
103
|
if ((items === null || items === void 0 ? void 0 : items.length) === 0) {
|
|
105
104
|
if (getBooleanFF('platform.linking-platform.link-picker.enable-empty-state')) {
|
|
106
105
|
if (hasSearchTerm) {
|
|
107
|
-
return jsx(
|
|
106
|
+
return jsx(NoResults, null);
|
|
108
107
|
} else {
|
|
109
108
|
return jsx("div", {
|
|
110
109
|
css: emptyStateNoResultsWrapper
|
|
111
110
|
}, activePlugin !== null && activePlugin !== void 0 && activePlugin.emptyStateNoResults ? activePlugin.emptyStateNoResults() : null);
|
|
112
111
|
}
|
|
113
112
|
} else {
|
|
114
|
-
return jsx(
|
|
113
|
+
return jsx(NoResults, null);
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
if (items && items.length > 0) {
|
|
@@ -164,5 +163,4 @@ var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
164
163
|
ref: ref,
|
|
165
164
|
css: listContainerStyles
|
|
166
165
|
}, restProps), itemsContent, loadingContent);
|
|
167
|
-
});
|
|
168
|
-
export default LinkSearchList;
|
|
166
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
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 {
|
|
5
|
-
import NoResultsSVG from './no-results-svg';
|
|
5
|
+
import { NoResultsSVG } from './no-results-svg';
|
|
6
6
|
import { emptyStateWrapperStyles } from './styled';
|
|
7
7
|
export var messages = defineMessages({
|
|
8
8
|
noResults: {
|
|
@@ -19,7 +19,7 @@ export var messages = defineMessages({
|
|
|
19
19
|
export var testIds = {
|
|
20
20
|
emptyResultPage: 'link-search-no-results'
|
|
21
21
|
};
|
|
22
|
-
var NoResults = function NoResults() {
|
|
22
|
+
export var NoResults = function NoResults() {
|
|
23
23
|
var intl = useIntl();
|
|
24
24
|
return jsx("div", {
|
|
25
25
|
css: emptyStateWrapperStyles
|
|
@@ -31,5 +31,4 @@ var NoResults = function NoResults() {
|
|
|
31
31
|
return jsx(NoResultsSVG, null);
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
|
-
};
|
|
35
|
-
export default NoResults;
|
|
34
|
+
};
|
package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { noResultsSVGStyles } from './styled';
|
|
5
|
-
var NoResultsSVG = function NoResultsSVG() {
|
|
5
|
+
export var NoResultsSVG = function NoResultsSVG() {
|
|
6
6
|
var id = 'link-picker-ui-no-results-svg';
|
|
7
7
|
return jsx("svg", {
|
|
8
8
|
css: noResultsSVGStyles,
|
|
@@ -53,5 +53,4 @@ var NoResultsSVG = function NoResultsSVG() {
|
|
|
53
53
|
transform: "translate(0 .62)",
|
|
54
54
|
d: "M0 0h207.16v189.87H0z"
|
|
55
55
|
}))));
|
|
56
|
-
};
|
|
57
|
-
export default NoResultsSVG;
|
|
56
|
+
};
|
|
@@ -1,11 +1,48 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef, Fragment } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { transformTimeStamp } from '../transformTimeStamp';
|
|
5
|
-
import { itemNameStyles, itemIconStyles, listItemContextStyles, listItemNameStyles, composeListItemStyles, imgStyles, listItemContainerStyles, listItemContainerInnerStyles } from './styled';
|
|
6
|
-
import { testIds } from '..';
|
|
7
4
|
import { useIntl } from 'react-intl-next';
|
|
8
|
-
|
|
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';
|
|
8
|
+
export var testIds = {
|
|
9
|
+
searchResultItem: 'link-search-list-item',
|
|
10
|
+
searchResultIcon: 'link-search-list-item-icon'
|
|
11
|
+
};
|
|
12
|
+
var isSVG = function isSVG(icon) {
|
|
13
|
+
return icon.startsWith('<svg') && icon.endsWith('</svg>');
|
|
14
|
+
};
|
|
15
|
+
var base64SVG = function base64SVG(icon) {
|
|
16
|
+
return "data:image/svg+xml;base64,".concat(Buffer.from(icon).toString('base64'));
|
|
17
|
+
};
|
|
18
|
+
var ListItemIcon = function ListItemIcon(props) {
|
|
19
|
+
var item = props.item,
|
|
20
|
+
intl = props.intl;
|
|
21
|
+
var icon = item.icon,
|
|
22
|
+
iconAlt = item.iconAlt;
|
|
23
|
+
if (!icon) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var alt = typeof iconAlt === 'string' ? iconAlt : intl.formatMessage(iconAlt);
|
|
27
|
+
if (typeof icon !== 'string') {
|
|
28
|
+
var Glyph = icon;
|
|
29
|
+
return jsx("span", {
|
|
30
|
+
css: itemIconStyles
|
|
31
|
+
}, jsx(Glyph, {
|
|
32
|
+
alt: alt,
|
|
33
|
+
"data-testid": testIds.searchResultIcon
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
return jsx("span", {
|
|
37
|
+
css: itemIconStyles
|
|
38
|
+
}, jsx("img", {
|
|
39
|
+
"data-testid": testIds.searchResultIcon,
|
|
40
|
+
src: isSVG(icon) ? base64SVG(icon) : icon,
|
|
41
|
+
alt: alt,
|
|
42
|
+
css: imgStyles
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
export var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9
46
|
var item = _ref.item,
|
|
10
47
|
selected = _ref.selected,
|
|
11
48
|
active = _ref.active,
|
|
@@ -50,39 +87,4 @@ var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
87
|
}, container)), date && jsx("div", {
|
|
51
88
|
css: listItemContainerInnerStyles
|
|
52
89
|
}, container && jsx(Fragment, null, "\xA0 \u2022\xA0 "), jsx(Fragment, null, date)))));
|
|
53
|
-
});
|
|
54
|
-
export default LinkSearchListItem;
|
|
55
|
-
var isSVG = function isSVG(icon) {
|
|
56
|
-
return icon.startsWith('<svg') && icon.endsWith('</svg>');
|
|
57
|
-
};
|
|
58
|
-
var base64SVG = function base64SVG(icon) {
|
|
59
|
-
return "data:image/svg+xml;base64,".concat(Buffer.from(icon).toString('base64'));
|
|
60
|
-
};
|
|
61
|
-
var testId = 'link-search-list-item-icon';
|
|
62
|
-
var ListItemIcon = function ListItemIcon(props) {
|
|
63
|
-
var item = props.item,
|
|
64
|
-
intl = props.intl;
|
|
65
|
-
var icon = item.icon,
|
|
66
|
-
iconAlt = item.iconAlt;
|
|
67
|
-
if (!icon) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
var alt = typeof iconAlt === 'string' ? iconAlt : intl.formatMessage(iconAlt);
|
|
71
|
-
if (typeof icon !== 'string') {
|
|
72
|
-
var Glyph = icon;
|
|
73
|
-
return jsx("span", {
|
|
74
|
-
css: itemIconStyles
|
|
75
|
-
}, jsx(Glyph, {
|
|
76
|
-
alt: alt,
|
|
77
|
-
"data-testid": testId
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
return jsx("span", {
|
|
81
|
-
css: itemIconStyles
|
|
82
|
-
}, jsx("img", {
|
|
83
|
-
"data-testid": testId,
|
|
84
|
-
src: isSVG(icon) ? base64SVG(icon) : icon,
|
|
85
|
-
alt: alt,
|
|
86
|
-
css: imgStyles
|
|
87
|
-
}));
|
|
88
|
-
};
|
|
90
|
+
});
|
|
@@ -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) {
|
|
@@ -141,5 +144,4 @@ export var ScrollingTabList = function ScrollingTabList(props) {
|
|
|
141
144
|
return scrollForward(ref);
|
|
142
145
|
}
|
|
143
146
|
}))));
|
|
144
|
-
};
|
|
145
|
-
export default ScrollingTabList;
|
|
147
|
+
};
|
|
@@ -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,20 +2,20 @@ 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'
|
|
17
17
|
};
|
|
18
|
-
var TextInput = function TextInput(_ref) {
|
|
18
|
+
export var TextInput = function TextInput(_ref) {
|
|
19
19
|
var name = _ref.name,
|
|
20
20
|
label = _ref.label,
|
|
21
21
|
autoFocus = _ref.autoFocus,
|
|
@@ -87,5 +87,4 @@ var TextInput = function TextInput(_ref) {
|
|
|
87
87
|
testId: testIds.urlError
|
|
88
88
|
}, error)));
|
|
89
89
|
}));
|
|
90
|
-
};
|
|
91
|
-
export default TextInput;
|
|
90
|
+
};
|
|
@@ -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,14 +2,14 @@
|
|
|
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
|
/**
|
|
10
10
|
* UFO + Analytics tracking for component mount (and unmount)
|
|
11
11
|
*/
|
|
12
|
-
function TrackMount() {
|
|
12
|
+
export function TrackMount() {
|
|
13
13
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
14
14
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
15
15
|
var linkPickerSessionId = useLinkPickerSessionId();
|
|
@@ -25,5 +25,4 @@ function TrackMount() {
|
|
|
25
25
|
};
|
|
26
26
|
}, [createAnalyticsEvent]);
|
|
27
27
|
return null;
|
|
28
|
-
}
|
|
29
|
-
export default TrackMount;
|
|
28
|
+
}
|