@atlaskit/smart-card 40.21.1 → 40.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +4 -2
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/index.js +17 -5
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +4 -2
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/index.js +16 -4
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +4 -2
- package/dist/esm/view/LinkUrl/HyperlinkResolver/index.js +16 -4
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/LinkUrl/HyperlinkResolver/index.d.ts +0 -1
- package/dist/types-ts4.5/view/LinkUrl/HyperlinkResolver/index.d.ts +0 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 40.22.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`dea73b984ba7b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dea73b984ba7b) -
|
|
8
|
+
NAVX-1842 Adding aria-hidden attribute to dropdown chevron in smart-card lozenge
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 40.22.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`05e3ebc53b525`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/05e3ebc53b525) -
|
|
16
|
+
Add logic to resolve hyperlinks which match a google domain
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 40.21.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "
|
|
14
|
+
packageVersion: "0.0.0-development"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -98,13 +98,15 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
98
98
|
}, /*#__PURE__*/React.createElement("span", null, text), /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
99
99
|
as: "span",
|
|
100
100
|
xcss: styles.chevronDown
|
|
101
|
-
}, /*#__PURE__*/React.createElement(_chevronDown.default, {
|
|
101
|
+
}, /*#__PURE__*/React.createElement(_chevronDown.default, (0, _extends2.default)({
|
|
102
102
|
color: "currentColor",
|
|
103
103
|
label: "options",
|
|
104
104
|
LEGACY_size: "medium",
|
|
105
105
|
LEGACY_margin: "-4px -8px -4px -7px",
|
|
106
106
|
size: "small"
|
|
107
|
-
}))
|
|
107
|
+
}, (0, _platformFeatureFlags.fg)('navx-1842-hiding-unnecessary-image-descriptions') ? {
|
|
108
|
+
"aria-hidden": true
|
|
109
|
+
} : {}))))));
|
|
108
110
|
}, [appearance, isHovering, isPressing, text, isOpen, lozengeBackgroundColor, lozengeForegroundColor]);
|
|
109
111
|
return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({
|
|
110
112
|
type: "button"
|
|
@@ -5,26 +5,38 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
11
11
|
var _state = require("../../../state");
|
|
12
12
|
var _errorBoundary = _interopRequireDefault(require("./error-boundary"));
|
|
13
13
|
var _resolveHyperlink = require("./resolve-hyperlink");
|
|
14
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
-
var isSharePointDomain =
|
|
15
|
+
var isSharePointDomain = function isSharePointDomain(href) {
|
|
16
16
|
try {
|
|
17
17
|
var hostname = new URL(href).hostname.toLowerCase();
|
|
18
|
-
return hostname.includes('sharepoint.com') || hostname.includes('onedrive.
|
|
18
|
+
return hostname.includes('sharepoint.com') || hostname.includes('onedrive.live.com');
|
|
19
19
|
} catch (_unused) {
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
var isGoogleDomain = function isGoogleDomain(href) {
|
|
24
|
+
try {
|
|
25
|
+
var hostname = new URL(href).hostname.toLowerCase();
|
|
26
|
+
return hostname.includes('docs.google.com') || hostname.includes('drive.google.com');
|
|
27
|
+
} catch (_unused2) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
23
31
|
var HyperlinkResolver = function HyperlinkResolver(_ref) {
|
|
24
32
|
var href = _ref.href;
|
|
25
33
|
var hasSmartCardProvider = !!(0, _react.useContext)(_state.SmartCardContext);
|
|
26
|
-
var
|
|
27
|
-
|
|
34
|
+
var isSharePointResolveEnabled = _featureGateJsClient.default.getExperimentValue('platform_editor_resolve_hyperlinks_confluence', 'isEnabled', false) || _featureGateJsClient.default.getExperimentValue('platform_editor_resolve_hyperlinks_jira', 'isEnabled', false);
|
|
35
|
+
var isGoogleResolveEnabled = _featureGateJsClient.default.getExperimentValue('platform_editor_resolve_google_hyperlinks', 'isEnabled', false);
|
|
36
|
+
var shouldResolveSharePoint = isSharePointDomain(href) && isSharePointResolveEnabled;
|
|
37
|
+
var shouldResolveGoogle = isGoogleDomain(href) && isGoogleResolveEnabled;
|
|
38
|
+
var shouldResolveHyperlink = hasSmartCardProvider && (shouldResolveSharePoint || shouldResolveGoogle);
|
|
39
|
+
if (!shouldResolveHyperlink) {
|
|
28
40
|
return null;
|
|
29
41
|
}
|
|
30
42
|
return /*#__PURE__*/_react.default.createElement(_resolveHyperlink.ResolveHyperlink, {
|
|
@@ -21,7 +21,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
21
21
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
22
22
|
var PACKAGE_DATA = {
|
|
23
23
|
packageName: "@atlaskit/smart-card",
|
|
24
|
-
packageVersion: "
|
|
24
|
+
packageVersion: "0.0.0-development",
|
|
25
25
|
componentName: 'linkUrl'
|
|
26
26
|
};
|
|
27
27
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "
|
|
5
|
+
packageVersion: "0.0.0-development"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -68,13 +68,15 @@ const LozengeActionTrigger = ({
|
|
|
68
68
|
}, /*#__PURE__*/React.createElement("span", null, text), /*#__PURE__*/React.createElement(Box, {
|
|
69
69
|
as: "span",
|
|
70
70
|
xcss: styles.chevronDown
|
|
71
|
-
}, /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
71
|
+
}, /*#__PURE__*/React.createElement(ChevronDownIcon, _extends({
|
|
72
72
|
color: "currentColor",
|
|
73
73
|
label: "options",
|
|
74
74
|
LEGACY_size: "medium",
|
|
75
75
|
LEGACY_margin: "-4px -8px -4px -7px",
|
|
76
76
|
size: "small"
|
|
77
|
-
})
|
|
77
|
+
}, fg('navx-1842-hiding-unnecessary-image-descriptions') ? {
|
|
78
|
+
"aria-hidden": true
|
|
79
|
+
} : {}))))));
|
|
78
80
|
}, [appearance, isHovering, isPressing, text, isOpen, lozengeBackgroundColor, lozengeForegroundColor]);
|
|
79
81
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
80
82
|
type: "button"
|
|
@@ -3,10 +3,18 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
|
3
3
|
import { SmartCardContext } from '../../../state';
|
|
4
4
|
import withErrorBoundary from './error-boundary';
|
|
5
5
|
import { ResolveHyperlink } from './resolve-hyperlink';
|
|
6
|
-
|
|
6
|
+
const isSharePointDomain = href => {
|
|
7
7
|
try {
|
|
8
8
|
const hostname = new URL(href).hostname.toLowerCase();
|
|
9
|
-
return hostname.includes('sharepoint.com') || hostname.includes('onedrive.
|
|
9
|
+
return hostname.includes('sharepoint.com') || hostname.includes('onedrive.live.com');
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const isGoogleDomain = href => {
|
|
15
|
+
try {
|
|
16
|
+
const hostname = new URL(href).hostname.toLowerCase();
|
|
17
|
+
return hostname.includes('docs.google.com') || hostname.includes('drive.google.com');
|
|
10
18
|
} catch {
|
|
11
19
|
return false;
|
|
12
20
|
}
|
|
@@ -15,8 +23,12 @@ const HyperlinkResolver = ({
|
|
|
15
23
|
href
|
|
16
24
|
}) => {
|
|
17
25
|
const hasSmartCardProvider = !!useContext(SmartCardContext);
|
|
18
|
-
const
|
|
19
|
-
|
|
26
|
+
const isSharePointResolveEnabled = FeatureGates.getExperimentValue('platform_editor_resolve_hyperlinks_confluence', 'isEnabled', false) || FeatureGates.getExperimentValue('platform_editor_resolve_hyperlinks_jira', 'isEnabled', false);
|
|
27
|
+
const isGoogleResolveEnabled = FeatureGates.getExperimentValue('platform_editor_resolve_google_hyperlinks', 'isEnabled', false);
|
|
28
|
+
const shouldResolveSharePoint = isSharePointDomain(href) && isSharePointResolveEnabled;
|
|
29
|
+
const shouldResolveGoogle = isGoogleDomain(href) && isGoogleResolveEnabled;
|
|
30
|
+
const shouldResolveHyperlink = hasSmartCardProvider && (shouldResolveSharePoint || shouldResolveGoogle);
|
|
31
|
+
if (!shouldResolveHyperlink) {
|
|
20
32
|
return null;
|
|
21
33
|
}
|
|
22
34
|
return /*#__PURE__*/React.createElement(ResolveHyperlink, {
|
|
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
11
11
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
12
12
|
const PACKAGE_DATA = {
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "
|
|
14
|
+
packageVersion: "0.0.0-development",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -90,13 +90,15 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
90
90
|
}, /*#__PURE__*/React.createElement("span", null, text), /*#__PURE__*/React.createElement(Box, {
|
|
91
91
|
as: "span",
|
|
92
92
|
xcss: styles.chevronDown
|
|
93
|
-
}, /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
93
|
+
}, /*#__PURE__*/React.createElement(ChevronDownIcon, _extends({
|
|
94
94
|
color: "currentColor",
|
|
95
95
|
label: "options",
|
|
96
96
|
LEGACY_size: "medium",
|
|
97
97
|
LEGACY_margin: "-4px -8px -4px -7px",
|
|
98
98
|
size: "small"
|
|
99
|
-
})
|
|
99
|
+
}, fg('navx-1842-hiding-unnecessary-image-descriptions') ? {
|
|
100
|
+
"aria-hidden": true
|
|
101
|
+
} : {}))))));
|
|
100
102
|
}, [appearance, isHovering, isPressing, text, isOpen, lozengeBackgroundColor, lozengeForegroundColor]);
|
|
101
103
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
102
104
|
type: "button"
|
|
@@ -3,19 +3,31 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
|
3
3
|
import { SmartCardContext } from '../../../state';
|
|
4
4
|
import withErrorBoundary from './error-boundary';
|
|
5
5
|
import { ResolveHyperlink } from './resolve-hyperlink';
|
|
6
|
-
|
|
6
|
+
var isSharePointDomain = function isSharePointDomain(href) {
|
|
7
7
|
try {
|
|
8
8
|
var hostname = new URL(href).hostname.toLowerCase();
|
|
9
|
-
return hostname.includes('sharepoint.com') || hostname.includes('onedrive.
|
|
9
|
+
return hostname.includes('sharepoint.com') || hostname.includes('onedrive.live.com');
|
|
10
10
|
} catch (_unused) {
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
+
var isGoogleDomain = function isGoogleDomain(href) {
|
|
15
|
+
try {
|
|
16
|
+
var hostname = new URL(href).hostname.toLowerCase();
|
|
17
|
+
return hostname.includes('docs.google.com') || hostname.includes('drive.google.com');
|
|
18
|
+
} catch (_unused2) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
14
22
|
var HyperlinkResolver = function HyperlinkResolver(_ref) {
|
|
15
23
|
var href = _ref.href;
|
|
16
24
|
var hasSmartCardProvider = !!useContext(SmartCardContext);
|
|
17
|
-
var
|
|
18
|
-
|
|
25
|
+
var isSharePointResolveEnabled = FeatureGates.getExperimentValue('platform_editor_resolve_hyperlinks_confluence', 'isEnabled', false) || FeatureGates.getExperimentValue('platform_editor_resolve_hyperlinks_jira', 'isEnabled', false);
|
|
26
|
+
var isGoogleResolveEnabled = FeatureGates.getExperimentValue('platform_editor_resolve_google_hyperlinks', 'isEnabled', false);
|
|
27
|
+
var shouldResolveSharePoint = isSharePointDomain(href) && isSharePointResolveEnabled;
|
|
28
|
+
var shouldResolveGoogle = isGoogleDomain(href) && isGoogleResolveEnabled;
|
|
29
|
+
var shouldResolveHyperlink = hasSmartCardProvider && (shouldResolveSharePoint || shouldResolveGoogle);
|
|
30
|
+
if (!shouldResolveHyperlink) {
|
|
19
31
|
return null;
|
|
20
32
|
}
|
|
21
33
|
return /*#__PURE__*/React.createElement(ResolveHyperlink, {
|
|
@@ -14,7 +14,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
14
14
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
15
15
|
var PACKAGE_DATA = {
|
|
16
16
|
packageName: "@atlaskit/smart-card",
|
|
17
|
-
packageVersion: "
|
|
17
|
+
packageVersion: "0.0.0-development",
|
|
18
18
|
componentName: 'linkUrl'
|
|
19
19
|
};
|
|
20
20
|
var Anchor = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.22.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"@atlaskit/spinner": "^19.0.0",
|
|
68
68
|
"@atlaskit/textarea": "^8.0.0",
|
|
69
69
|
"@atlaskit/textfield": "^8.0.0",
|
|
70
|
-
"@atlaskit/theme": "^
|
|
71
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
70
|
+
"@atlaskit/theme": "^21.0.0",
|
|
71
|
+
"@atlaskit/tmp-editor-statsig": "^12.16.0",
|
|
72
72
|
"@atlaskit/tokens": "^6.3.0",
|
|
73
73
|
"@atlaskit/tooltip": "^20.4.0",
|
|
74
74
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -231,6 +231,9 @@
|
|
|
231
231
|
},
|
|
232
232
|
"navx-1706-smart-link-layered-link-a11y-update": {
|
|
233
233
|
"type": "boolean"
|
|
234
|
+
},
|
|
235
|
+
"navx-1842-hiding-unnecessary-image-descriptions": {
|
|
236
|
+
"type": "boolean"
|
|
234
237
|
}
|
|
235
238
|
},
|
|
236
239
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|