@atlaskit/smart-card 43.25.16 → 43.26.0
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 +14 -0
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +2 -1
- package/dist/cjs/hooks/useConfluencePageData.js +0 -4
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +4 -35
- package/dist/cjs/view/Card/types.js +6 -5
- package/dist/cjs/view/CardWithUrl/component.js +1 -17
- package/dist/cjs/view/EmbedCard/components/IFrame.js +2 -5
- package/dist/cjs/view/EmbedModal/components/embed-content/index.js +2 -4
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +2 -1
- package/dist/es2019/hooks/useConfluencePageData.js +0 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +5 -36
- package/dist/es2019/view/Card/types.js +6 -5
- package/dist/es2019/view/CardWithUrl/component.js +1 -15
- package/dist/es2019/view/EmbedCard/components/IFrame.js +2 -5
- package/dist/es2019/view/EmbedModal/components/embed-content/index.js +3 -5
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +2 -1
- package/dist/esm/hooks/useConfluencePageData.js +0 -4
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/UnauthorisedView.js +5 -36
- package/dist/esm/view/Card/types.js +6 -5
- package/dist/esm/view/CardWithUrl/component.js +1 -17
- package/dist/esm/view/EmbedCard/components/IFrame.js +2 -5
- package/dist/esm/view/EmbedModal/components/embed-content/index.js +2 -4
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/Card/types.d.ts +17 -9
- package/dist/types-ts4.5/view/Card/types.d.ts +17 -9
- package/package.json +2 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`848f2503b1c81`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/848f2503b1c81) -
|
|
8
|
+
Add rovoChatAction to Smart Links actionOptions
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`85bb0e4e578ed`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/85bb0e4e578ed) -
|
|
13
|
+
NAVX-3610 cleaning up navx-3264-refactoring-unauth-provider-images-fe
|
|
14
|
+
- [`29ab57db0034f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/29ab57db0034f) -
|
|
15
|
+
Remove platform_deprecate_lp_cc_embed checks
|
|
16
|
+
|
|
3
17
|
## 43.25.16
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _helpers = require("../../../state/helpers");
|
|
8
8
|
var _rovo = require("../../../utils/rovo");
|
|
9
9
|
var extractRovoChatAction = function extractRovoChatAction(response, rovoConfig, actionOptions) {
|
|
10
|
+
var _actionOptions$rovoCh;
|
|
10
11
|
// Experiment cleanup note: platform_sl_3p_auth_rovo_action
|
|
11
12
|
// If action is available by default, we need to allow RovoChatAction to be configurable to opt-out
|
|
12
13
|
// if (!canShowAction(CardAction.RovoChatAction, actionOptions)) {
|
|
@@ -21,7 +22,7 @@ var extractRovoChatAction = function extractRovoChatAction(response, rovoConfig,
|
|
|
21
22
|
// Experiment cleanup note: platform_sl_3p_auth_rovo_action
|
|
22
23
|
// If feature isn't support all 3P, this value should come from meta.supportedFeature
|
|
23
24
|
var isSupportedFeature = (0, _helpers.getExtensionKey)(response) === 'google-object-provider';
|
|
24
|
-
var isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 :
|
|
25
|
+
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
25
26
|
return isSupportedFeature && isOptIn ? true : undefined;
|
|
26
27
|
};
|
|
27
28
|
var _default = exports.default = extractRovoChatAction;
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.userType = exports.useConfluencePageData = exports.EMBEDDED_CONFLUENCE_MODE = exports.CONFLUENCE_EXTENSION_KEYS = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _tokens = require("@atlaskit/tokens");
|
|
10
9
|
var userType = exports.userType = /*#__PURE__*/function (userType) {
|
|
11
10
|
userType["ATLASSIAN_ACCOUNT"] = "atlassianAccount";
|
|
@@ -29,9 +28,6 @@ var CONFLUENCE_EXTENSION_KEYS = exports.CONFLUENCE_EXTENSION_KEYS = /*#__PURE__*
|
|
|
29
28
|
}({});
|
|
30
29
|
var useConfluencePageData = exports.useConfluencePageData = function useConfluencePageData(url, extensionKey) {
|
|
31
30
|
var parsedData = (0, _react.useMemo)(function () {
|
|
32
|
-
if (!(0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed')) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
31
|
if (!url || typeof url !== 'string' || !url.startsWith('http://') && !url.startsWith('https://') || !extensionKey || !Object.values(CONFLUENCE_EXTENSION_KEYS).find(function (key) {
|
|
36
32
|
return key === extensionKey;
|
|
37
33
|
})) {
|
|
@@ -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: "43.25.
|
|
14
|
+
packageVersion: "43.25.16"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,7 +15,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
16
|
var _reactIntlNext = require("react-intl-next");
|
|
17
17
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
20
19
|
var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
|
|
21
20
|
var _constants = require("../../../constants");
|
|
@@ -31,11 +30,7 @@ var _elementGroup = _interopRequireDefault(require("../../FlexibleCard/component
|
|
|
31
30
|
var _utils = require("../../FlexibleCard/components/blocks/utils");
|
|
32
31
|
var _elements = require("../../FlexibleCard/components/elements");
|
|
33
32
|
var _AuthorizeAction = require("../actions/AuthorizeAction");
|
|
34
|
-
var _figma2x = _interopRequireDefault(require("./assets/figma@2x.png"));
|
|
35
33
|
var _general2x = _interopRequireDefault(require("./assets/general@2x.png"));
|
|
36
|
-
var _googleDrive2x = _interopRequireDefault(require("./assets/google-drive@2x.png"));
|
|
37
|
-
var _onedrive2x = _interopRequireDefault(require("./assets/onedrive@2x.png"));
|
|
38
|
-
var _slack2x = _interopRequireDefault(require("./assets/slack@2x.png"));
|
|
39
34
|
var _unresolvedView = _interopRequireDefault(require("./unresolved-view"));
|
|
40
35
|
var _utils2 = require("./utils");
|
|
41
36
|
var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyle");
|
|
@@ -102,13 +97,12 @@ var getBetterTitle = function getBetterTitle(url) {
|
|
|
102
97
|
}
|
|
103
98
|
};
|
|
104
99
|
var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
|
|
105
|
-
var _useFlexibleCardConte,
|
|
100
|
+
var _useFlexibleCardConte, _data$preview$url, _data$preview;
|
|
106
101
|
var actions = _ref.actions,
|
|
107
102
|
children = _ref.children,
|
|
108
103
|
url = _ref.url,
|
|
109
104
|
CompetitorPrompt = _ref.CompetitorPrompt,
|
|
110
|
-
testId = _ref.testId
|
|
111
|
-
cardState = _ref.cardState;
|
|
105
|
+
testId = _ref.testId;
|
|
112
106
|
var _ref2 = (_useFlexibleCardConte = (0, _flexibleUiContext.useFlexibleCardContext)()) !== null && _useFlexibleCardConte !== void 0 ? _useFlexibleCardConte : {
|
|
113
107
|
ui: undefined,
|
|
114
108
|
data: undefined
|
|
@@ -132,32 +126,7 @@ var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
|
|
|
132
126
|
className: (0, _runtime.ax)(["_k48p1pd9 _syaz13af"])
|
|
133
127
|
});
|
|
134
128
|
var position = _utils2.titleBlockOptions.position;
|
|
135
|
-
var
|
|
136
|
-
var overrideUrl = data === null || data === void 0 || (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url;
|
|
137
|
-
var isHardcodedImage = !overrideUrl;
|
|
138
|
-
if (isHardcodedImage) {
|
|
139
|
-
if ((0, _platformFeatureFlags.fg)('navx-3264-refactoring-unauth-provider-images-fe')) {
|
|
140
|
-
overrideUrl = _general2x.default;
|
|
141
|
-
} else {
|
|
142
|
-
switch (extensionKey) {
|
|
143
|
-
case 'figma-object-provider':
|
|
144
|
-
overrideUrl = _figma2x.default;
|
|
145
|
-
break;
|
|
146
|
-
case 'google-object-provider':
|
|
147
|
-
overrideUrl = _googleDrive2x.default;
|
|
148
|
-
break;
|
|
149
|
-
case 'onedrive-object-provider':
|
|
150
|
-
overrideUrl = _onedrive2x.default;
|
|
151
|
-
break;
|
|
152
|
-
case 'slack-object-provider':
|
|
153
|
-
overrideUrl = _slack2x.default;
|
|
154
|
-
break;
|
|
155
|
-
default:
|
|
156
|
-
overrideUrl = _general2x.default;
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
129
|
+
var overrideUrl = (_data$preview$url = data === null || data === void 0 || (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url) !== null && _data$preview$url !== void 0 ? _data$preview$url : _general2x.default;
|
|
161
130
|
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, _utils2.titleBlockOptions, {
|
|
162
131
|
testId: "".concat(testId, "-errored-view"),
|
|
163
132
|
className: (0, _runtime.ax)(["_7cca15wb _1f3816vg"])
|
|
@@ -184,7 +153,7 @@ var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
|
|
|
184
153
|
}, (0, _utils.renderElementItems)([{
|
|
185
154
|
name: _constants.ElementName.HostName
|
|
186
155
|
}])))), children, actionGroup), hasActions ? /*#__PURE__*/React.createElement("div", {
|
|
187
|
-
className: (0, _runtime.ax)(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw",
|
|
156
|
+
className: (0, _runtime.ax)(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw", "_1bsbo60d"])
|
|
188
157
|
}, /*#__PURE__*/React.createElement("div", {
|
|
189
158
|
style: {
|
|
190
159
|
backgroundImage: "url(".concat(overrideUrl, ")")
|
|
@@ -5,14 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.CardAction = void 0;
|
|
7
7
|
var CardAction = exports.CardAction = /*#__PURE__*/function (CardAction) {
|
|
8
|
+
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
9
|
+
CardAction["AutomationAction"] = "AutomationAction";
|
|
10
|
+
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
11
|
+
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
8
12
|
CardAction["DownloadAction"] = "DownloadAction";
|
|
13
|
+
CardAction["FollowAction"] = "FollowAction";
|
|
9
14
|
CardAction["PreviewAction"] = "PreviewAction";
|
|
15
|
+
CardAction["RovoChatAction"] = "RovoChatAction";
|
|
10
16
|
CardAction["ViewAction"] = "ViewAction";
|
|
11
|
-
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
12
|
-
CardAction["FollowAction"] = "FollowAction";
|
|
13
|
-
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
14
|
-
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
15
|
-
CardAction["AutomationAction"] = "AutomationAction";
|
|
16
17
|
return CardAction;
|
|
17
18
|
}({});
|
|
18
19
|
/**
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.CardWithUrlContent = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
11
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
@@ -33,8 +31,6 @@ var _FlexibleCard = _interopRequireDefault(require("../FlexibleCard"));
|
|
|
33
31
|
var _InlineCard = require("../InlineCard");
|
|
34
32
|
var _useSmartLinkEvents = require("../SmartLinkEvents/useSmartLinkEvents");
|
|
35
33
|
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); }
|
|
36
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
37
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
38
34
|
var thirdPartyARIPrefix = 'ari:third-party';
|
|
39
35
|
var EmbedCardComponent = (0, _platformFeatureFlagsReact.componentWithFG)('rovo_chat_embed_card_dwell_and_hover_metrics', _EmbedCard.EmbedCardUpdated, _EmbedCard.EmbedCard);
|
|
40
36
|
function Component(_ref) {
|
|
@@ -663,21 +659,9 @@ function ComponentUpdated(_ref2) {
|
|
|
663
659
|
var CardWithUrlContentComponent = (0, _platformFeatureFlagsReact.componentWithFG)('rovo_chat_embed_card_dwell_and_hover_metrics', ComponentUpdated, Component);
|
|
664
660
|
var CardWithUrlContent = exports.CardWithUrlContent = function CardWithUrlContent(props) {
|
|
665
661
|
var display = (0, _flexible.isFlexibleUiCard)(props.children, props === null || props === void 0 ? void 0 : props.ui) ? _constants.CardDisplay.Flexible : props.appearance;
|
|
666
|
-
var actionOptions = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ?
|
|
667
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
668
|
-
(0, _react.useMemo)(function () {
|
|
669
|
-
return props.actionOptions ? _objectSpread({
|
|
670
|
-
rovoChatAction: true
|
|
671
|
-
}, props === null || props === void 0 ? void 0 : props.actionOptions) : {
|
|
672
|
-
hide: false,
|
|
673
|
-
rovoChatAction: true
|
|
674
|
-
};
|
|
675
|
-
}, [props.actionOptions]) : undefined;
|
|
676
662
|
return /*#__PURE__*/_react.default.createElement(_modal.SmartLinkModalProvider, null, /*#__PURE__*/_react.default.createElement(_SmartLinkAnalyticsContext.SmartLinkAnalyticsContext, {
|
|
677
663
|
url: props.url,
|
|
678
664
|
id: props.id,
|
|
679
665
|
display: display
|
|
680
|
-
}, /*#__PURE__*/_react.default.createElement(CardWithUrlContentComponent,
|
|
681
|
-
actionOptions: actionOptions
|
|
682
|
-
} : undefined))));
|
|
666
|
+
}, /*#__PURE__*/_react.default.createElement(CardWithUrlContentComponent, props)));
|
|
683
667
|
};
|
|
@@ -9,7 +9,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _embeddedConfluence = require("@atlaskit/embedded-confluence");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _useConfluencePageData = require("../../../hooks/useConfluencePageData");
|
|
14
13
|
var _excluded = ["childRef", "className", "extensionKey"];
|
|
15
14
|
/**
|
|
@@ -20,12 +19,10 @@ var IFrame = exports.IFrame = function IFrame(_ref) {
|
|
|
20
19
|
className = _ref.className,
|
|
21
20
|
extensionKey = _ref.extensionKey,
|
|
22
21
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
23
|
-
var confluencePageData = (0,
|
|
24
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
25
|
-
(0, _useConfluencePageData.useConfluencePageData)(props.src || '', extensionKey || '') : undefined;
|
|
22
|
+
var confluencePageData = (0, _useConfluencePageData.useConfluencePageData)(props.src || '', extensionKey || '');
|
|
26
23
|
|
|
27
24
|
// Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
|
|
28
|
-
return confluencePageData
|
|
25
|
+
return confluencePageData ? /*#__PURE__*/_react.default.createElement(_embeddedConfluence.Page, {
|
|
29
26
|
hostname: confluencePageData.hostname,
|
|
30
27
|
spaceKey: confluencePageData.spaceKey,
|
|
31
28
|
contentId: confluencePageData.contentId,
|
|
@@ -12,7 +12,6 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
14
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _utils = require("../../../../utils");
|
|
17
16
|
var _IFrame = require("../../../EmbedCard/components/IFrame");
|
|
18
17
|
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); }
|
|
@@ -33,10 +32,9 @@ var EmbedContent = function EmbedContent(_ref) {
|
|
|
33
32
|
'data-testid': "".concat(testId, "-embed")
|
|
34
33
|
};
|
|
35
34
|
return /*#__PURE__*/React.createElement(_IFrame.IFrame, (0, _extends2.default)({
|
|
36
|
-
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed")
|
|
37
|
-
}, (0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed') ? {
|
|
35
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed"),
|
|
38
36
|
extensionKey: extensionKey
|
|
39
|
-
}
|
|
37
|
+
}, props, {
|
|
40
38
|
className: (0, _runtime.ax)(["_1bsb1osq _4t3i815d"])
|
|
41
39
|
}));
|
|
42
40
|
};
|
|
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "43.25.
|
|
25
|
+
packageVersion: "43.25.16",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getExtensionKey } from '../../../state/helpers';
|
|
2
2
|
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
3
3
|
const extractRovoChatAction = (response, rovoConfig, actionOptions) => {
|
|
4
|
+
var _actionOptions$rovoCh;
|
|
4
5
|
// Experiment cleanup note: platform_sl_3p_auth_rovo_action
|
|
5
6
|
// If action is available by default, we need to allow RovoChatAction to be configurable to opt-out
|
|
6
7
|
// if (!canShowAction(CardAction.RovoChatAction, actionOptions)) {
|
|
@@ -15,7 +16,7 @@ const extractRovoChatAction = (response, rovoConfig, actionOptions) => {
|
|
|
15
16
|
// Experiment cleanup note: platform_sl_3p_auth_rovo_action
|
|
16
17
|
// If feature isn't support all 3P, this value should come from meta.supportedFeature
|
|
17
18
|
const isSupportedFeature = getExtensionKey(response) === 'google-object-provider';
|
|
18
|
-
const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : actionOptions.rovoChatAction) === true;
|
|
19
|
+
const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
19
20
|
return isSupportedFeature && isOptIn ? true : undefined;
|
|
20
21
|
};
|
|
21
22
|
export default extractRovoChatAction;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { setGlobalTheme, themeStringToObject } from '@atlaskit/tokens';
|
|
4
3
|
export let userType = /*#__PURE__*/function (userType) {
|
|
5
4
|
userType["ATLASSIAN_ACCOUNT"] = "atlassianAccount";
|
|
@@ -23,9 +22,6 @@ export let CONFLUENCE_EXTENSION_KEYS = /*#__PURE__*/function (CONFLUENCE_EXTENSI
|
|
|
23
22
|
}({});
|
|
24
23
|
export const useConfluencePageData = (url, extensionKey) => {
|
|
25
24
|
const parsedData = useMemo(() => {
|
|
26
|
-
if (!fg('platform_deprecate_lp_cc_embed')) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
25
|
if (!url || typeof url !== 'string' || !url.startsWith('http://') && !url.startsWith('https://') || !extensionKey || !Object.values(CONFLUENCE_EXTENSION_KEYS).find(key => key === extensionKey)) {
|
|
30
26
|
return undefined;
|
|
31
27
|
}
|
|
@@ -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: "43.25.
|
|
5
|
+
packageVersion: "43.25.16"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -6,13 +6,12 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { useCallback, useMemo } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
11
10
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
12
11
|
import { ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../constants';
|
|
13
12
|
import { messages } from '../../../messages';
|
|
14
13
|
import { useFlexibleCardContext } from '../../../state/flexible-ui-context';
|
|
15
|
-
import {
|
|
14
|
+
import { hasAuthScopeOverrides } from '../../../state/helpers';
|
|
16
15
|
import { isNewBlockcardUnauthorizedRefreshExperimentEnabled } from '../../../utils/experiments';
|
|
17
16
|
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
18
17
|
import FlexibleCard from '../../FlexibleCard';
|
|
@@ -22,11 +21,7 @@ import ElementGroup from '../../FlexibleCard/components/blocks/element-group';
|
|
|
22
21
|
import { renderElementItems } from '../../FlexibleCard/components/blocks/utils';
|
|
23
22
|
import { LinkIcon, Title } from '../../FlexibleCard/components/elements';
|
|
24
23
|
import { AuthorizeAction } from '../actions/AuthorizeAction';
|
|
25
|
-
import unauthIllustrationFigma from './assets/figma@2x.png';
|
|
26
24
|
import unauthIllustrationGeneral from './assets/general@2x.png';
|
|
27
|
-
import unauthIllustrationGdrive from './assets/google-drive@2x.png';
|
|
28
|
-
import unauthIllustrationOnedrive from './assets/onedrive@2x.png';
|
|
29
|
-
import unauthIllustrationSlack from './assets/slack@2x.png';
|
|
30
25
|
import UnresolvedView from './unresolved-view';
|
|
31
26
|
import { FlexibleCardUiOptions, titleBlockOptions } from './utils';
|
|
32
27
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
@@ -95,10 +90,9 @@ const NewUnauthorisedBlock = ({
|
|
|
95
90
|
children,
|
|
96
91
|
url,
|
|
97
92
|
CompetitorPrompt,
|
|
98
|
-
testId
|
|
99
|
-
cardState
|
|
93
|
+
testId
|
|
100
94
|
}) => {
|
|
101
|
-
var _useFlexibleCardConte,
|
|
95
|
+
var _useFlexibleCardConte, _data$preview$url, _data$preview;
|
|
102
96
|
const {
|
|
103
97
|
ui,
|
|
104
98
|
data
|
|
@@ -125,32 +119,7 @@ const NewUnauthorisedBlock = ({
|
|
|
125
119
|
const {
|
|
126
120
|
position
|
|
127
121
|
} = titleBlockOptions;
|
|
128
|
-
|
|
129
|
-
let overrideUrl = data === null || data === void 0 ? void 0 : (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url;
|
|
130
|
-
let isHardcodedImage = !overrideUrl;
|
|
131
|
-
if (isHardcodedImage) {
|
|
132
|
-
if (fg('navx-3264-refactoring-unauth-provider-images-fe')) {
|
|
133
|
-
overrideUrl = unauthIllustrationGeneral;
|
|
134
|
-
} else {
|
|
135
|
-
switch (extensionKey) {
|
|
136
|
-
case 'figma-object-provider':
|
|
137
|
-
overrideUrl = unauthIllustrationFigma;
|
|
138
|
-
break;
|
|
139
|
-
case 'google-object-provider':
|
|
140
|
-
overrideUrl = unauthIllustrationGdrive;
|
|
141
|
-
break;
|
|
142
|
-
case 'onedrive-object-provider':
|
|
143
|
-
overrideUrl = unauthIllustrationOnedrive;
|
|
144
|
-
break;
|
|
145
|
-
case 'slack-object-provider':
|
|
146
|
-
overrideUrl = unauthIllustrationSlack;
|
|
147
|
-
break;
|
|
148
|
-
default:
|
|
149
|
-
overrideUrl = unauthIllustrationGeneral;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
122
|
+
let overrideUrl = (_data$preview$url = data === null || data === void 0 ? void 0 : (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url) !== null && _data$preview$url !== void 0 ? _data$preview$url : unauthIllustrationGeneral;
|
|
154
123
|
return /*#__PURE__*/React.createElement(Block, _extends({}, titleBlockOptions, {
|
|
155
124
|
testId: `${testId}-errored-view`,
|
|
156
125
|
className: ax(["_7cca15wb _1f3816vg"])
|
|
@@ -177,7 +146,7 @@ const NewUnauthorisedBlock = ({
|
|
|
177
146
|
}, renderElementItems([{
|
|
178
147
|
name: ElementName.HostName
|
|
179
148
|
}])))), children, actionGroup), hasActions ? /*#__PURE__*/React.createElement("div", {
|
|
180
|
-
className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw",
|
|
149
|
+
className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw", "_1bsbo60d"])
|
|
181
150
|
}, /*#__PURE__*/React.createElement("div", {
|
|
182
151
|
style: {
|
|
183
152
|
backgroundImage: `url(${overrideUrl})`
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export let CardAction = /*#__PURE__*/function (CardAction) {
|
|
2
|
+
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
3
|
+
CardAction["AutomationAction"] = "AutomationAction";
|
|
4
|
+
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
5
|
+
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
2
6
|
CardAction["DownloadAction"] = "DownloadAction";
|
|
7
|
+
CardAction["FollowAction"] = "FollowAction";
|
|
3
8
|
CardAction["PreviewAction"] = "PreviewAction";
|
|
9
|
+
CardAction["RovoChatAction"] = "RovoChatAction";
|
|
4
10
|
CardAction["ViewAction"] = "ViewAction";
|
|
5
|
-
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
6
|
-
CardAction["FollowAction"] = "FollowAction";
|
|
7
|
-
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
8
|
-
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
9
|
-
CardAction["AutomationAction"] = "AutomationAction";
|
|
10
11
|
return CardAction;
|
|
11
12
|
}({});
|
|
12
13
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
3
2
|
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
|
|
4
3
|
import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
|
|
@@ -647,22 +646,9 @@ function ComponentUpdated({
|
|
|
647
646
|
const CardWithUrlContentComponent = componentWithFG('rovo_chat_embed_card_dwell_and_hover_metrics', ComponentUpdated, Component);
|
|
648
647
|
export const CardWithUrlContent = props => {
|
|
649
648
|
const display = isFlexibleUiCard(props.children, props === null || props === void 0 ? void 0 : props.ui) ? CardDisplay.Flexible : props.appearance;
|
|
650
|
-
const actionOptions = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
|
|
651
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
652
|
-
useMemo(() => {
|
|
653
|
-
return props.actionOptions ? {
|
|
654
|
-
rovoChatAction: true,
|
|
655
|
-
...(props === null || props === void 0 ? void 0 : props.actionOptions)
|
|
656
|
-
} : {
|
|
657
|
-
hide: false,
|
|
658
|
-
rovoChatAction: true
|
|
659
|
-
};
|
|
660
|
-
}, [props.actionOptions]) : undefined;
|
|
661
649
|
return /*#__PURE__*/React.createElement(SmartLinkModalProvider, null, /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
662
650
|
url: props.url,
|
|
663
651
|
id: props.id,
|
|
664
652
|
display: display
|
|
665
|
-
}, /*#__PURE__*/React.createElement(CardWithUrlContentComponent,
|
|
666
|
-
actionOptions
|
|
667
|
-
} : undefined))));
|
|
653
|
+
}, /*#__PURE__*/React.createElement(CardWithUrlContentComponent, props)));
|
|
668
654
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Page } from '@atlaskit/embedded-confluence';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { useConfluencePageData } from '../../../hooks/useConfluencePageData';
|
|
6
5
|
/**
|
|
7
6
|
* Iframe element isolated for DI purposes
|
|
@@ -12,12 +11,10 @@ export const IFrame = ({
|
|
|
12
11
|
extensionKey,
|
|
13
12
|
...props
|
|
14
13
|
}) => {
|
|
15
|
-
const confluencePageData =
|
|
16
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
17
|
-
useConfluencePageData(props.src || '', extensionKey || '') : undefined;
|
|
14
|
+
const confluencePageData = useConfluencePageData(props.src || '', extensionKey || '');
|
|
18
15
|
|
|
19
16
|
// Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
|
|
20
|
-
return confluencePageData
|
|
17
|
+
return confluencePageData ? /*#__PURE__*/React.createElement(Page, {
|
|
21
18
|
hostname: confluencePageData.hostname,
|
|
22
19
|
spaceKey: confluencePageData.spaceKey,
|
|
23
20
|
contentId: confluencePageData.contentId,
|
|
@@ -4,7 +4,6 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { getIframeSandboxAttribute } from '../../../../utils';
|
|
9
8
|
import { IFrame } from '../../../EmbedCard/components/IFrame';
|
|
10
9
|
const iframeCss = null;
|
|
@@ -25,10 +24,9 @@ const EmbedContent = ({
|
|
|
25
24
|
'data-testid': `${testId}-embed`
|
|
26
25
|
};
|
|
27
26
|
return /*#__PURE__*/React.createElement(IFrame, _extends({
|
|
28
|
-
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : `${testId}-embed
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} : {}, props, {
|
|
27
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : `${testId}-embed`,
|
|
28
|
+
extensionKey: extensionKey
|
|
29
|
+
}, props, {
|
|
32
30
|
className: ax(["_1bsb1osq _4t3i815d"])
|
|
33
31
|
}));
|
|
34
32
|
};
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "43.25.
|
|
15
|
+
packageVersion: "43.25.16",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getExtensionKey } from '../../../state/helpers';
|
|
2
2
|
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
3
3
|
var extractRovoChatAction = function extractRovoChatAction(response, rovoConfig, actionOptions) {
|
|
4
|
+
var _actionOptions$rovoCh;
|
|
4
5
|
// Experiment cleanup note: platform_sl_3p_auth_rovo_action
|
|
5
6
|
// If action is available by default, we need to allow RovoChatAction to be configurable to opt-out
|
|
6
7
|
// if (!canShowAction(CardAction.RovoChatAction, actionOptions)) {
|
|
@@ -15,7 +16,7 @@ var extractRovoChatAction = function extractRovoChatAction(response, rovoConfig,
|
|
|
15
16
|
// Experiment cleanup note: platform_sl_3p_auth_rovo_action
|
|
16
17
|
// If feature isn't support all 3P, this value should come from meta.supportedFeature
|
|
17
18
|
var isSupportedFeature = getExtensionKey(response) === 'google-object-provider';
|
|
18
|
-
var isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 :
|
|
19
|
+
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
19
20
|
return isSupportedFeature && isOptIn ? true : undefined;
|
|
20
21
|
};
|
|
21
22
|
export default extractRovoChatAction;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { setGlobalTheme, themeStringToObject } from '@atlaskit/tokens';
|
|
4
3
|
export var userType = /*#__PURE__*/function (userType) {
|
|
5
4
|
userType["ATLASSIAN_ACCOUNT"] = "atlassianAccount";
|
|
@@ -23,9 +22,6 @@ export var CONFLUENCE_EXTENSION_KEYS = /*#__PURE__*/function (CONFLUENCE_EXTENSI
|
|
|
23
22
|
}({});
|
|
24
23
|
export var useConfluencePageData = function useConfluencePageData(url, extensionKey) {
|
|
25
24
|
var parsedData = useMemo(function () {
|
|
26
|
-
if (!fg('platform_deprecate_lp_cc_embed')) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
25
|
if (!url || typeof url !== 'string' || !url.startsWith('http://') && !url.startsWith('https://') || !extensionKey || !Object.values(CONFLUENCE_EXTENSION_KEYS).find(function (key) {
|
|
30
26
|
return key === extensionKey;
|
|
31
27
|
})) {
|
|
@@ -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: "43.25.
|
|
7
|
+
packageVersion: "43.25.16"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -8,13 +8,12 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
8
8
|
import { useCallback, useMemo } from 'react';
|
|
9
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
10
|
import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
13
12
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
14
13
|
import { ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../constants';
|
|
15
14
|
import { messages } from '../../../messages';
|
|
16
15
|
import { useFlexibleCardContext } from '../../../state/flexible-ui-context';
|
|
17
|
-
import {
|
|
16
|
+
import { hasAuthScopeOverrides } from '../../../state/helpers';
|
|
18
17
|
import { isNewBlockcardUnauthorizedRefreshExperimentEnabled } from '../../../utils/experiments';
|
|
19
18
|
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
20
19
|
import FlexibleCard from '../../FlexibleCard';
|
|
@@ -24,11 +23,7 @@ import ElementGroup from '../../FlexibleCard/components/blocks/element-group';
|
|
|
24
23
|
import { renderElementItems } from '../../FlexibleCard/components/blocks/utils';
|
|
25
24
|
import { LinkIcon, Title } from '../../FlexibleCard/components/elements';
|
|
26
25
|
import { AuthorizeAction } from '../actions/AuthorizeAction';
|
|
27
|
-
import unauthIllustrationFigma from './assets/figma@2x.png';
|
|
28
26
|
import unauthIllustrationGeneral from './assets/general@2x.png';
|
|
29
|
-
import unauthIllustrationGdrive from './assets/google-drive@2x.png';
|
|
30
|
-
import unauthIllustrationOnedrive from './assets/onedrive@2x.png';
|
|
31
|
-
import unauthIllustrationSlack from './assets/slack@2x.png';
|
|
32
27
|
import UnresolvedView from './unresolved-view';
|
|
33
28
|
import { FlexibleCardUiOptions, titleBlockOptions } from './utils';
|
|
34
29
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
@@ -93,13 +88,12 @@ var getBetterTitle = function getBetterTitle(url) {
|
|
|
93
88
|
}
|
|
94
89
|
};
|
|
95
90
|
var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
|
|
96
|
-
var _useFlexibleCardConte,
|
|
91
|
+
var _useFlexibleCardConte, _data$preview$url, _data$preview;
|
|
97
92
|
var actions = _ref.actions,
|
|
98
93
|
children = _ref.children,
|
|
99
94
|
url = _ref.url,
|
|
100
95
|
CompetitorPrompt = _ref.CompetitorPrompt,
|
|
101
|
-
testId = _ref.testId
|
|
102
|
-
cardState = _ref.cardState;
|
|
96
|
+
testId = _ref.testId;
|
|
103
97
|
var _ref2 = (_useFlexibleCardConte = useFlexibleCardContext()) !== null && _useFlexibleCardConte !== void 0 ? _useFlexibleCardConte : {
|
|
104
98
|
ui: undefined,
|
|
105
99
|
data: undefined
|
|
@@ -123,32 +117,7 @@ var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
|
|
|
123
117
|
className: ax(["_k48p1pd9 _syaz13af"])
|
|
124
118
|
});
|
|
125
119
|
var position = titleBlockOptions.position;
|
|
126
|
-
var
|
|
127
|
-
var overrideUrl = data === null || data === void 0 || (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url;
|
|
128
|
-
var isHardcodedImage = !overrideUrl;
|
|
129
|
-
if (isHardcodedImage) {
|
|
130
|
-
if (fg('navx-3264-refactoring-unauth-provider-images-fe')) {
|
|
131
|
-
overrideUrl = unauthIllustrationGeneral;
|
|
132
|
-
} else {
|
|
133
|
-
switch (extensionKey) {
|
|
134
|
-
case 'figma-object-provider':
|
|
135
|
-
overrideUrl = unauthIllustrationFigma;
|
|
136
|
-
break;
|
|
137
|
-
case 'google-object-provider':
|
|
138
|
-
overrideUrl = unauthIllustrationGdrive;
|
|
139
|
-
break;
|
|
140
|
-
case 'onedrive-object-provider':
|
|
141
|
-
overrideUrl = unauthIllustrationOnedrive;
|
|
142
|
-
break;
|
|
143
|
-
case 'slack-object-provider':
|
|
144
|
-
overrideUrl = unauthIllustrationSlack;
|
|
145
|
-
break;
|
|
146
|
-
default:
|
|
147
|
-
overrideUrl = unauthIllustrationGeneral;
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
120
|
+
var overrideUrl = (_data$preview$url = data === null || data === void 0 || (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url) !== null && _data$preview$url !== void 0 ? _data$preview$url : unauthIllustrationGeneral;
|
|
152
121
|
return /*#__PURE__*/React.createElement(Block, _extends({}, titleBlockOptions, {
|
|
153
122
|
testId: "".concat(testId, "-errored-view"),
|
|
154
123
|
className: ax(["_7cca15wb _1f3816vg"])
|
|
@@ -175,7 +144,7 @@ var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
|
|
|
175
144
|
}, renderElementItems([{
|
|
176
145
|
name: ElementName.HostName
|
|
177
146
|
}])))), children, actionGroup), hasActions ? /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw",
|
|
147
|
+
className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw", "_1bsbo60d"])
|
|
179
148
|
}, /*#__PURE__*/React.createElement("div", {
|
|
180
149
|
style: {
|
|
181
150
|
backgroundImage: "url(".concat(overrideUrl, ")")
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export var CardAction = /*#__PURE__*/function (CardAction) {
|
|
2
|
+
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
3
|
+
CardAction["AutomationAction"] = "AutomationAction";
|
|
4
|
+
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
5
|
+
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
2
6
|
CardAction["DownloadAction"] = "DownloadAction";
|
|
7
|
+
CardAction["FollowAction"] = "FollowAction";
|
|
3
8
|
CardAction["PreviewAction"] = "PreviewAction";
|
|
9
|
+
CardAction["RovoChatAction"] = "RovoChatAction";
|
|
4
10
|
CardAction["ViewAction"] = "ViewAction";
|
|
5
|
-
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
6
|
-
CardAction["FollowAction"] = "FollowAction";
|
|
7
|
-
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
8
|
-
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
9
|
-
CardAction["AutomationAction"] = "AutomationAction";
|
|
10
11
|
return CardAction;
|
|
11
12
|
}({});
|
|
12
13
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
1
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
6
2
|
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
|
|
7
3
|
import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
|
|
@@ -654,21 +650,9 @@ function ComponentUpdated(_ref2) {
|
|
|
654
650
|
var CardWithUrlContentComponent = componentWithFG('rovo_chat_embed_card_dwell_and_hover_metrics', ComponentUpdated, Component);
|
|
655
651
|
export var CardWithUrlContent = function CardWithUrlContent(props) {
|
|
656
652
|
var display = isFlexibleUiCard(props.children, props === null || props === void 0 ? void 0 : props.ui) ? CardDisplay.Flexible : props.appearance;
|
|
657
|
-
var actionOptions = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
|
|
658
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
659
|
-
useMemo(function () {
|
|
660
|
-
return props.actionOptions ? _objectSpread({
|
|
661
|
-
rovoChatAction: true
|
|
662
|
-
}, props === null || props === void 0 ? void 0 : props.actionOptions) : {
|
|
663
|
-
hide: false,
|
|
664
|
-
rovoChatAction: true
|
|
665
|
-
};
|
|
666
|
-
}, [props.actionOptions]) : undefined;
|
|
667
653
|
return /*#__PURE__*/React.createElement(SmartLinkModalProvider, null, /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
668
654
|
url: props.url,
|
|
669
655
|
id: props.id,
|
|
670
656
|
display: display
|
|
671
|
-
}, /*#__PURE__*/React.createElement(CardWithUrlContentComponent,
|
|
672
|
-
actionOptions: actionOptions
|
|
673
|
-
} : undefined))));
|
|
657
|
+
}, /*#__PURE__*/React.createElement(CardWithUrlContentComponent, props)));
|
|
674
658
|
};
|
|
@@ -3,7 +3,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["childRef", "className", "extensionKey"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Page } from '@atlaskit/embedded-confluence';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { useConfluencePageData } from '../../../hooks/useConfluencePageData';
|
|
8
7
|
/**
|
|
9
8
|
* Iframe element isolated for DI purposes
|
|
@@ -13,12 +12,10 @@ export var IFrame = function IFrame(_ref) {
|
|
|
13
12
|
className = _ref.className,
|
|
14
13
|
extensionKey = _ref.extensionKey,
|
|
15
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
var confluencePageData =
|
|
17
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
18
|
-
useConfluencePageData(props.src || '', extensionKey || '') : undefined;
|
|
15
|
+
var confluencePageData = useConfluencePageData(props.src || '', extensionKey || '');
|
|
19
16
|
|
|
20
17
|
// Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
|
|
21
|
-
return confluencePageData
|
|
18
|
+
return confluencePageData ? /*#__PURE__*/React.createElement(Page, {
|
|
22
19
|
hostname: confluencePageData.hostname,
|
|
23
20
|
spaceKey: confluencePageData.spaceKey,
|
|
24
21
|
contentId: confluencePageData.contentId,
|
|
@@ -4,7 +4,6 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { getIframeSandboxAttribute } from '../../../../utils';
|
|
9
8
|
import { IFrame } from '../../../EmbedCard/components/IFrame';
|
|
10
9
|
var iframeCss = null;
|
|
@@ -24,10 +23,9 @@ var EmbedContent = function EmbedContent(_ref) {
|
|
|
24
23
|
'data-testid': "".concat(testId, "-embed")
|
|
25
24
|
};
|
|
26
25
|
return /*#__PURE__*/React.createElement(IFrame, _extends({
|
|
27
|
-
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed")
|
|
28
|
-
}, fg('platform_deprecate_lp_cc_embed') ? {
|
|
26
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed"),
|
|
29
27
|
extensionKey: extensionKey
|
|
30
|
-
}
|
|
28
|
+
}, props, {
|
|
31
29
|
className: ax(["_1bsb1osq _4t3i815d"])
|
|
32
30
|
}));
|
|
33
31
|
};
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "43.25.
|
|
18
|
+
packageVersion: "43.25.16",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -16,14 +16,15 @@ export type OnResolveCallback = (data: {
|
|
|
16
16
|
url?: string;
|
|
17
17
|
}) => void;
|
|
18
18
|
export declare enum CardAction {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ViewAction = "ViewAction",
|
|
19
|
+
AISummaryAction = "AISummaryAction",
|
|
20
|
+
AutomationAction = "AutomationAction",
|
|
22
21
|
ChangeStatusAction = "ChangeStatusAction",
|
|
23
|
-
FollowAction = "FollowAction",
|
|
24
22
|
CopyLinkAction = "CopyLinkAction",
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
DownloadAction = "DownloadAction",
|
|
24
|
+
FollowAction = "FollowAction",
|
|
25
|
+
PreviewAction = "PreviewAction",
|
|
26
|
+
RovoChatAction = "RovoChatAction",
|
|
27
|
+
ViewAction = "ViewAction"
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* A CardActionOptions object contains the configuration for the actions available on the card.
|
|
@@ -42,6 +43,15 @@ export type CardActionOptions = CardActionVisibilityOptions & {
|
|
|
42
43
|
*/
|
|
43
44
|
size?: EmbedModalSize;
|
|
44
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Rovo Chat action sends prompt messages to Rovo Chat.
|
|
48
|
+
* It requires setting rovoOptions on SmartCardProvider and opt-in via this prop to surface.
|
|
49
|
+
*
|
|
50
|
+
* This is an experiment feature and maybe removed any given time.
|
|
51
|
+
*/
|
|
52
|
+
rovoChatAction?: {
|
|
53
|
+
optIn: boolean;
|
|
54
|
+
};
|
|
45
55
|
};
|
|
46
56
|
/**
|
|
47
57
|
* Determines which actions are visible on the card.
|
|
@@ -57,9 +67,7 @@ export type CardActionVisibilityOptions = {
|
|
|
57
67
|
* This can be used for experiment before the prop become public API after experiment is successful.
|
|
58
68
|
* Warning: Internal prop can be changed/refactored anytime without notice.
|
|
59
69
|
*/
|
|
60
|
-
export type InternalCardActionOptions = CardActionOptions & {
|
|
61
|
-
rovoChatAction?: boolean;
|
|
62
|
-
};
|
|
70
|
+
export type InternalCardActionOptions = CardActionOptions & {};
|
|
63
71
|
interface ActionProps {
|
|
64
72
|
/**
|
|
65
73
|
* Configure visibility of actions available.
|
|
@@ -16,14 +16,15 @@ export type OnResolveCallback = (data: {
|
|
|
16
16
|
url?: string;
|
|
17
17
|
}) => void;
|
|
18
18
|
export declare enum CardAction {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ViewAction = "ViewAction",
|
|
19
|
+
AISummaryAction = "AISummaryAction",
|
|
20
|
+
AutomationAction = "AutomationAction",
|
|
22
21
|
ChangeStatusAction = "ChangeStatusAction",
|
|
23
|
-
FollowAction = "FollowAction",
|
|
24
22
|
CopyLinkAction = "CopyLinkAction",
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
DownloadAction = "DownloadAction",
|
|
24
|
+
FollowAction = "FollowAction",
|
|
25
|
+
PreviewAction = "PreviewAction",
|
|
26
|
+
RovoChatAction = "RovoChatAction",
|
|
27
|
+
ViewAction = "ViewAction"
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* A CardActionOptions object contains the configuration for the actions available on the card.
|
|
@@ -42,6 +43,15 @@ export type CardActionOptions = CardActionVisibilityOptions & {
|
|
|
42
43
|
*/
|
|
43
44
|
size?: EmbedModalSize;
|
|
44
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Rovo Chat action sends prompt messages to Rovo Chat.
|
|
48
|
+
* It requires setting rovoOptions on SmartCardProvider and opt-in via this prop to surface.
|
|
49
|
+
*
|
|
50
|
+
* This is an experiment feature and maybe removed any given time.
|
|
51
|
+
*/
|
|
52
|
+
rovoChatAction?: {
|
|
53
|
+
optIn: boolean;
|
|
54
|
+
};
|
|
45
55
|
};
|
|
46
56
|
/**
|
|
47
57
|
* Determines which actions are visible on the card.
|
|
@@ -57,9 +67,7 @@ export type CardActionVisibilityOptions = {
|
|
|
57
67
|
* This can be used for experiment before the prop become public API after experiment is successful.
|
|
58
68
|
* Warning: Internal prop can be changed/refactored anytime without notice.
|
|
59
69
|
*/
|
|
60
|
-
export type InternalCardActionOptions = CardActionOptions & {
|
|
61
|
-
rovoChatAction?: boolean;
|
|
62
|
-
};
|
|
70
|
+
export type InternalCardActionOptions = CardActionOptions & {};
|
|
63
71
|
interface ActionProps {
|
|
64
72
|
/**
|
|
65
73
|
* Configure visibility of actions available.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.26.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@atlaskit/textfield": "^8.2.0",
|
|
74
74
|
"@atlaskit/theme": "^22.0.0",
|
|
75
75
|
"@atlaskit/tile": "^1.0.0",
|
|
76
|
-
"@atlaskit/tmp-editor-statsig": "^35.
|
|
76
|
+
"@atlaskit/tmp-editor-statsig": "^35.3.0",
|
|
77
77
|
"@atlaskit/tokens": "^11.0.0",
|
|
78
78
|
"@atlaskit/tooltip": "^20.14.0",
|
|
79
79
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -190,9 +190,6 @@
|
|
|
190
190
|
"platform_smartlink_3pclick_analytics": {
|
|
191
191
|
"type": "boolean"
|
|
192
192
|
},
|
|
193
|
-
"platform_deprecate_lp_cc_embed": {
|
|
194
|
-
"type": "boolean"
|
|
195
|
-
},
|
|
196
193
|
"navx-1895-new-logo-design": {
|
|
197
194
|
"type": "boolean"
|
|
198
195
|
},
|
|
@@ -223,9 +220,6 @@
|
|
|
223
220
|
"platform_navx_send_context_to_ugs_for_rel_links": {
|
|
224
221
|
"type": "boolean"
|
|
225
222
|
},
|
|
226
|
-
"navx-3264-refactoring-unauth-provider-images-fe": {
|
|
227
|
-
"type": "boolean"
|
|
228
|
-
},
|
|
229
223
|
"platform-button-icon-spacing-cleanup": {
|
|
230
224
|
"type": "boolean"
|
|
231
225
|
},
|