@atlaskit/smart-card 45.27.0 → 45.28.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 +25 -0
- package/analytics.spec.yaml +23 -0
- package/dist/cjs/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/text-only--light-mode.png +3 -0
- package/dist/cjs/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image--light-mode.png +3 -0
- package/dist/cjs/common/analytics/generated/use-analytics-events.js +1 -1
- package/dist/cjs/entry-points/pre-auth-value-proposition-modal.js +12 -0
- package/dist/cjs/state/hooks/use-one-click-chat-spotlight-eligibility/evaluate.js +76 -0
- package/dist/cjs/state/hooks/use-one-click-chat-spotlight-eligibility/suppression.js +144 -0
- package/dist/cjs/state/services/pre-auth-value-proposition-modal/index.js +122 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/PreAuthValuePropositionModal/IllustrationPane.compiled.css +30 -0
- package/dist/cjs/view/PreAuthValuePropositionModal/IllustrationPane.js +58 -0
- package/dist/cjs/view/PreAuthValuePropositionModal/assets/graphics-with-grid-no-provider-icons-2x.png +0 -0
- package/dist/cjs/view/PreAuthValuePropositionModal/index.compiled.css +17 -0
- package/dist/cjs/view/PreAuthValuePropositionModal/index.js +304 -0
- package/dist/es2019/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/text-only--light-mode.png +3 -0
- package/dist/es2019/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image--light-mode.png +3 -0
- package/dist/es2019/common/analytics/generated/use-analytics-events.js +1 -1
- package/dist/es2019/entry-points/pre-auth-value-proposition-modal.js +1 -0
- package/dist/es2019/state/hooks/use-one-click-chat-spotlight-eligibility/evaluate.js +63 -0
- package/dist/es2019/state/hooks/use-one-click-chat-spotlight-eligibility/suppression.js +103 -0
- package/dist/es2019/state/services/pre-auth-value-proposition-modal/index.js +97 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/PreAuthValuePropositionModal/IllustrationPane.compiled.css +30 -0
- package/dist/es2019/view/PreAuthValuePropositionModal/IllustrationPane.js +51 -0
- package/dist/es2019/view/PreAuthValuePropositionModal/assets/graphics-with-grid-no-provider-icons-2x.png +0 -0
- package/dist/es2019/view/PreAuthValuePropositionModal/index.compiled.css +17 -0
- package/dist/es2019/view/PreAuthValuePropositionModal/index.js +282 -0
- package/dist/esm/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/text-only--light-mode.png +3 -0
- package/dist/esm/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image--light-mode.png +3 -0
- package/dist/esm/common/analytics/generated/use-analytics-events.js +1 -1
- package/dist/esm/entry-points/pre-auth-value-proposition-modal.js +1 -0
- package/dist/esm/state/hooks/use-one-click-chat-spotlight-eligibility/evaluate.js +68 -0
- package/dist/esm/state/hooks/use-one-click-chat-spotlight-eligibility/suppression.js +134 -0
- package/dist/esm/state/services/pre-auth-value-proposition-modal/index.js +115 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/PreAuthValuePropositionModal/IllustrationPane.compiled.css +30 -0
- package/dist/esm/view/PreAuthValuePropositionModal/IllustrationPane.js +52 -0
- package/dist/esm/view/PreAuthValuePropositionModal/assets/graphics-with-grid-no-provider-icons-2x.png +0 -0
- package/dist/esm/view/PreAuthValuePropositionModal/index.compiled.css +17 -0
- package/dist/esm/view/PreAuthValuePropositionModal/index.js +293 -0
- package/dist/types/common/analytics/generated/analytics.types.d.ts +14 -1
- package/dist/types/entry-points/pre-auth-value-proposition-modal.d.ts +1 -0
- package/dist/types/state/hooks/use-one-click-chat-spotlight-eligibility/evaluate.d.ts +29 -0
- package/dist/types/state/hooks/use-one-click-chat-spotlight-eligibility/suppression.d.ts +13 -0
- package/dist/types/state/services/pre-auth-value-proposition-modal/index.d.ts +11 -0
- package/dist/types/view/PreAuthValuePropositionModal/IllustrationPane.d.ts +10 -0
- package/dist/types/view/PreAuthValuePropositionModal/index.d.ts +5 -0
- package/package.json +1 -1
- package/pre-auth-value-proposition-modal/package.json +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.28.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`109d353d55cfb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/109d353d55cfb) -
|
|
8
|
+
Add a pre-auth value proposition modal for unauthenticated third-party Smart Links created or
|
|
9
|
+
converted in the editor. `@atlaskit/smart-card/pre-auth-value-proposition-modal` exports the
|
|
10
|
+
controlled modal; editor lazy-loads it from Smart Link lifecycle events. Variants
|
|
11
|
+
`modal_text_only` and `modal_with_image` (plus `control`) are behind experiment
|
|
12
|
+
`platform_sl_3p_preauth_value_modal` and gate `platform_sl_3p_preauth_value_modal_killswitch`.
|
|
13
|
+
Connect reuses the existing auth flow. The modal shows once per provider and at most once every
|
|
14
|
+
seven days across providers. Open/close analytics use `source: 'preAuthValuePropositionModal'`.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
20
|
+
## 45.27.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [`27b51e491d701`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/27b51e491d701) -
|
|
25
|
+
Add internal eligibility and suppression utilities for One Click Chat Spotlight V2; production
|
|
26
|
+
integration under platform_sl_one_click_chat_spotlight_v2_fg follows separately.
|
|
27
|
+
|
|
3
28
|
## 45.27.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
package/analytics.spec.yaml
CHANGED
|
@@ -288,6 +288,29 @@ events:
|
|
|
288
288
|
type: number
|
|
289
289
|
description: total time spent over the related links modal
|
|
290
290
|
|
|
291
|
+
- modal opened (preAuthValueProposition):
|
|
292
|
+
type: ui
|
|
293
|
+
description: >
|
|
294
|
+
Fired when the pre-auth value proposition modal is shown after an eligible
|
|
295
|
+
unauthorized Smart Link is created or converted.
|
|
296
|
+
attributes:
|
|
297
|
+
<<: [*PackageMetaDataContext, *CommonContext]
|
|
298
|
+
|
|
299
|
+
- modal closed (preAuthValueProposition):
|
|
300
|
+
type: ui
|
|
301
|
+
description: >
|
|
302
|
+
Fired when the user dismisses the pre-auth value proposition modal without connecting.
|
|
303
|
+
attributes:
|
|
304
|
+
<<: [*PackageMetaDataContext, *CommonContext]
|
|
305
|
+
closeMethod:
|
|
306
|
+
required: true
|
|
307
|
+
type: ['button', 'escape', 'overlay']
|
|
308
|
+
description: How the user dismissed the modal.
|
|
309
|
+
dwellTime:
|
|
310
|
+
required: true
|
|
311
|
+
type: number
|
|
312
|
+
description: Time in milliseconds from modal open complete to dismiss.
|
|
313
|
+
|
|
291
314
|
- relatedLinks success:
|
|
292
315
|
type: operational
|
|
293
316
|
description: fired when related links are retrieved successfully
|
|
@@ -14,7 +14,7 @@ var _createEventPayload = _interopRequireDefault(require("./create-event-payload
|
|
|
14
14
|
*
|
|
15
15
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
16
16
|
*
|
|
17
|
-
* @codegen <<SignedSource::
|
|
17
|
+
* @codegen <<SignedSource::4715d46f4a378244afd94dadfd9e5f51>>
|
|
18
18
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
19
19
|
*/
|
|
20
20
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "PreAuthValuePropositionModal", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _PreAuthValuePropositionModal.PreAuthValuePropositionModal;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _PreAuthValuePropositionModal = require("../view/PreAuthValuePropositionModal");
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEVEN_DAYS_MS = void 0;
|
|
7
|
+
exports.evaluateExperiment = evaluateExperiment;
|
|
8
|
+
exports.evaluateOpportunity = evaluateOpportunity;
|
|
9
|
+
/** No link, content, or account identifiers belong in eligibility diagnostics. */
|
|
10
|
+
|
|
11
|
+
var SEVEN_DAYS_MS = exports.SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
|
|
12
|
+
var result = function result(reason) {
|
|
13
|
+
return {
|
|
14
|
+
isEligible: reason === 'eligible',
|
|
15
|
+
reason: reason
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Calendar days use the browser's local timezone; seven-day windows use elapsed time. */
|
|
20
|
+
function evaluateOpportunity(input) {
|
|
21
|
+
if (!input.gateEnabled) {
|
|
22
|
+
return result('gate_off');
|
|
23
|
+
}
|
|
24
|
+
if (input.appearance !== 'inline' || input.status !== 'resolved') {
|
|
25
|
+
return result('not_resolved_inline');
|
|
26
|
+
}
|
|
27
|
+
if (input.provider !== 'google-object-provider' && input.provider !== 'github-object-provider') {
|
|
28
|
+
return result('unsupported_provider');
|
|
29
|
+
}
|
|
30
|
+
if (!input.authorized) {
|
|
31
|
+
return result('provider_unauthorized');
|
|
32
|
+
}
|
|
33
|
+
if (!input.hasAccess) {
|
|
34
|
+
return result('object_inaccessible');
|
|
35
|
+
}
|
|
36
|
+
if (!input.rovoAvailable) {
|
|
37
|
+
return result('rovo_unavailable');
|
|
38
|
+
}
|
|
39
|
+
if (!input.consumerOptedIn) {
|
|
40
|
+
return result('consumer_not_opted_in');
|
|
41
|
+
}
|
|
42
|
+
if (input.product !== 'jira_web' && input.product !== 'confluence_web') {
|
|
43
|
+
return result('unsupported_product');
|
|
44
|
+
}
|
|
45
|
+
if (!input.history) {
|
|
46
|
+
return result('suppression_unavailable');
|
|
47
|
+
}
|
|
48
|
+
if (input.spotlightActive) {
|
|
49
|
+
return result('spotlight_active');
|
|
50
|
+
}
|
|
51
|
+
var _input$history = input.history,
|
|
52
|
+
dismissedAt = _input$history.dismissedAt,
|
|
53
|
+
impressions = _input$history.impressions;
|
|
54
|
+
var cutoff = input.now - SEVEN_DAYS_MS;
|
|
55
|
+
if (dismissedAt !== undefined && dismissedAt > cutoff) {
|
|
56
|
+
return result('dismissal_cooldown');
|
|
57
|
+
}
|
|
58
|
+
var startOfDay = new Date(input.now);
|
|
59
|
+
startOfDay.setHours(0, 0, 0, 0);
|
|
60
|
+
if (impressions.some(function (timestamp) {
|
|
61
|
+
return timestamp >= startOfDay.getTime();
|
|
62
|
+
})) {
|
|
63
|
+
return result('shown_today');
|
|
64
|
+
}
|
|
65
|
+
if (impressions.filter(function (timestamp) {
|
|
66
|
+
return timestamp > cutoff;
|
|
67
|
+
}).length >= 3) {
|
|
68
|
+
return result('weekly_limit');
|
|
69
|
+
}
|
|
70
|
+
return result('eligible');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Pure cohort evaluation, kept separate so suppressed opportunities never expose the experiment. */
|
|
74
|
+
function evaluateExperiment(value) {
|
|
75
|
+
return result(value === true ? 'eligible' : value === false ? 'control' : 'experiment_unavailable');
|
|
76
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.claimSpotlight = claimSpotlight;
|
|
8
|
+
exports.createSuppressionStore = createSuppressionStore;
|
|
9
|
+
exports.getSuppressionStore = getSuppressionStore;
|
|
10
|
+
exports.isSpotlightActive = isSpotlightActive;
|
|
11
|
+
exports.releaseSpotlight = releaseSpotlight;
|
|
12
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
+
var _StorageClient = require("@atlaskit/frontend-utilities/StorageClient");
|
|
18
|
+
var _evaluate = require("./evaluate");
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
/** Shared across inline cards. Account identifiers are held in memory only. */
|
|
22
|
+
var stores = new Map();
|
|
23
|
+
var activeSpotlight;
|
|
24
|
+
var isHistory = function isHistory(value) {
|
|
25
|
+
if ((0, _typeof2.default)(value) !== 'object' || value === null || !('impressions' in value)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return Array.isArray(value.impressions) && value.impressions.every(function (timestamp) {
|
|
29
|
+
return typeof timestamp === 'number' && Number.isFinite(timestamp);
|
|
30
|
+
}) && (!('dismissedAt' in value) || value.dismissedAt === undefined || typeof value.dismissedAt === 'number' && Number.isFinite(value.dismissedAt));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** Reuses Smart Card's StorageClient, with timestamp-only values and a one-way user namespace. */
|
|
34
|
+
function createSuppressionStore(storage) {
|
|
35
|
+
var isAvailable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
|
|
36
|
+
return true;
|
|
37
|
+
};
|
|
38
|
+
var blocked = false;
|
|
39
|
+
var read = function read() {
|
|
40
|
+
try {
|
|
41
|
+
var value = storage.getItem('history');
|
|
42
|
+
if (blocked || !isAvailable()) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
return value === undefined ? {
|
|
46
|
+
impressions: []
|
|
47
|
+
} : isHistory(value) ? value : undefined;
|
|
48
|
+
} catch (_unused) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var write = function write(history) {
|
|
53
|
+
try {
|
|
54
|
+
storage.setItemWithExpiry('history', history, _evaluate.SEVEN_DAYS_MS);
|
|
55
|
+
// StorageClient can swallow write failures. Verify persistence before counting delivery.
|
|
56
|
+
var persisted = isAvailable() && JSON.stringify(storage.getItem('history')) === JSON.stringify(history);
|
|
57
|
+
blocked = !persisted;
|
|
58
|
+
return persisted;
|
|
59
|
+
} catch (_unused2) {
|
|
60
|
+
blocked = true;
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
read: read,
|
|
66
|
+
impress: function impress(now) {
|
|
67
|
+
var history = read();
|
|
68
|
+
return !!history && write(_objectSpread(_objectSpread({}, history), {}, {
|
|
69
|
+
impressions: [].concat((0, _toConsumableArray2.default)(history.impressions.filter(function (timestamp) {
|
|
70
|
+
return timestamp > now - _evaluate.SEVEN_DAYS_MS;
|
|
71
|
+
})), [now])
|
|
72
|
+
}));
|
|
73
|
+
},
|
|
74
|
+
dismiss: function dismiss(now) {
|
|
75
|
+
var history = read();
|
|
76
|
+
return !!history && write(_objectSpread(_objectSpread({}, history), {}, {
|
|
77
|
+
dismissedAt: now
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function getSuppressionStore(accountId) {
|
|
83
|
+
var cached = stores.get(accountId);
|
|
84
|
+
if (cached) {
|
|
85
|
+
return cached;
|
|
86
|
+
}
|
|
87
|
+
var pending = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
88
|
+
var _window$crypto, digest, namespace, available, storage, _t;
|
|
89
|
+
return _regenerator.default.wrap(function (_context) {
|
|
90
|
+
while (1) switch (_context.prev = _context.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
_context.prev = 0;
|
|
93
|
+
if (!(typeof window === 'undefined' || !((_window$crypto = window.crypto) !== null && _window$crypto !== void 0 && _window$crypto.subtle))) {
|
|
94
|
+
_context.next = 1;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
return _context.abrupt("return", undefined);
|
|
98
|
+
case 1:
|
|
99
|
+
_context.next = 2;
|
|
100
|
+
return window.crypto.subtle.digest('SHA-256', new TextEncoder().encode("one-click-chat-spotlight-v2:".concat(accountId)));
|
|
101
|
+
case 2:
|
|
102
|
+
digest = _context.sent;
|
|
103
|
+
namespace = Array.from(new Uint8Array(digest), function (byte) {
|
|
104
|
+
return byte.toString(16).padStart(2, '0');
|
|
105
|
+
}).join('');
|
|
106
|
+
available = true;
|
|
107
|
+
storage = new _StorageClient.StorageClient("one-click-chat-spotlight-v2:".concat(namespace), {
|
|
108
|
+
handlers: {
|
|
109
|
+
captureException: function captureException() {
|
|
110
|
+
available = false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return _context.abrupt("return", createSuppressionStore(storage, function () {
|
|
115
|
+
return available;
|
|
116
|
+
}));
|
|
117
|
+
case 3:
|
|
118
|
+
_context.prev = 3;
|
|
119
|
+
_t = _context["catch"](0);
|
|
120
|
+
return _context.abrupt("return", undefined);
|
|
121
|
+
case 4:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee, null, [[0, 3]]);
|
|
126
|
+
}))();
|
|
127
|
+
stores.set(accountId, pending);
|
|
128
|
+
return pending;
|
|
129
|
+
}
|
|
130
|
+
function claimSpotlight(owner) {
|
|
131
|
+
if (activeSpotlight && activeSpotlight !== owner) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
activeSpotlight = owner;
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
function releaseSpotlight(owner) {
|
|
138
|
+
if (activeSpotlight === owner) {
|
|
139
|
+
activeSpotlight = undefined;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function isSpotlightActive(owner) {
|
|
143
|
+
return activeSpotlight !== undefined && activeSpotlight !== owner;
|
|
144
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.preAuthValuePropositionModalService = exports.PreAuthValuePropositionModalService = exports.PRE_AUTH_VALUE_PROPOSITION_MODAL_STORAGE_ITEM_KEY = exports.PRE_AUTH_VALUE_PROPOSITION_MODAL_COOLDOWN_MS = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
var _StorageClient = require("@atlaskit/frontend-utilities/StorageClient");
|
|
14
|
+
var SMART_CARD_STORAGE_SCOPE = '@atlaskit/smart-card';
|
|
15
|
+
var PRE_AUTH_VALUE_PROPOSITION_MODAL_STORAGE_ITEM_KEY = exports.PRE_AUTH_VALUE_PROPOSITION_MODAL_STORAGE_ITEM_KEY = 'pre-auth-value-proposition-modal-shown-providers:v3';
|
|
16
|
+
var weekInMs = 7 * 24 * 60 * 60 * 1000;
|
|
17
|
+
var PRE_AUTH_VALUE_PROPOSITION_MODAL_COOLDOWN_MS = exports.PRE_AUTH_VALUE_PROPOSITION_MODAL_COOLDOWN_MS = weekInMs;
|
|
18
|
+
var smartCardStorage;
|
|
19
|
+
var getSmartCardStorage = function getSmartCardStorage() {
|
|
20
|
+
if (typeof window === 'undefined') {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (smartCardStorage !== undefined) {
|
|
24
|
+
return smartCardStorage;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
smartCardStorage = new _StorageClient.StorageClient(SMART_CARD_STORAGE_SCOPE);
|
|
28
|
+
} catch (_unused) {
|
|
29
|
+
smartCardStorage = null;
|
|
30
|
+
}
|
|
31
|
+
return smartCardStorage;
|
|
32
|
+
};
|
|
33
|
+
var isShownExtensionKeys = function isShownExtensionKeys(value) {
|
|
34
|
+
return Array.isArray(value) && value.every(function (extensionKey) {
|
|
35
|
+
return typeof extensionKey === 'string';
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var isStoredShowState = function isStoredShowState(value) {
|
|
39
|
+
if ((0, _typeof2.default)(value) !== 'object' || value === null) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
var storedShowState = value;
|
|
43
|
+
return typeof storedShowState.lastShownAt === 'number' && Number.isFinite(storedShowState.lastShownAt) && isShownExtensionKeys(storedShowState.shownExtensionKeys);
|
|
44
|
+
};
|
|
45
|
+
var EMPTY_STORED_SHOW_STATE = {
|
|
46
|
+
lastShownAt: 0,
|
|
47
|
+
shownExtensionKeys: []
|
|
48
|
+
};
|
|
49
|
+
var PreAuthValuePropositionModalService = exports.PreAuthValuePropositionModalService = /*#__PURE__*/function () {
|
|
50
|
+
function PreAuthValuePropositionModalService() {
|
|
51
|
+
(0, _classCallCheck2.default)(this, PreAuthValuePropositionModalService);
|
|
52
|
+
(0, _defineProperty2.default)(this, "storedShowState", null);
|
|
53
|
+
}
|
|
54
|
+
return (0, _createClass2.default)(PreAuthValuePropositionModalService, [{
|
|
55
|
+
key: "hasReachedShowLimit",
|
|
56
|
+
value: function hasReachedShowLimit(extensionKey) {
|
|
57
|
+
var _this$getStoredShowSt = this.getStoredShowState(),
|
|
58
|
+
lastShownAt = _this$getStoredShowSt.lastShownAt,
|
|
59
|
+
shownExtensionKeys = _this$getStoredShowSt.shownExtensionKeys;
|
|
60
|
+
if (shownExtensionKeys.includes(extensionKey)) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return lastShownAt > 0 && Date.now() - lastShownAt < PRE_AUTH_VALUE_PROPOSITION_MODAL_COOLDOWN_MS;
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "recordShow",
|
|
67
|
+
value: function recordShow(extensionKey) {
|
|
68
|
+
if (this.hasReachedShowLimit(extensionKey)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
var _this$getStoredShowSt2 = this.getStoredShowState(),
|
|
72
|
+
shownExtensionKeys = _this$getStoredShowSt2.shownExtensionKeys;
|
|
73
|
+
var nextStoredShowState = {
|
|
74
|
+
lastShownAt: Date.now(),
|
|
75
|
+
shownExtensionKeys: [].concat((0, _toConsumableArray2.default)(shownExtensionKeys), [extensionKey])
|
|
76
|
+
};
|
|
77
|
+
this.storedShowState = nextStoredShowState;
|
|
78
|
+
try {
|
|
79
|
+
var _getSmartCardStorage;
|
|
80
|
+
(_getSmartCardStorage = getSmartCardStorage()) === null || _getSmartCardStorage === void 0 || _getSmartCardStorage.setItemWithExpiry(PRE_AUTH_VALUE_PROPOSITION_MODAL_STORAGE_ITEM_KEY, nextStoredShowState);
|
|
81
|
+
} catch (_unused2) {
|
|
82
|
+
// Browser Storage Controls, quota, private mode, and SSR must not break the editor.
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "reset",
|
|
87
|
+
value: function reset() {
|
|
88
|
+
this.storedShowState = null;
|
|
89
|
+
try {
|
|
90
|
+
var _getSmartCardStorage2;
|
|
91
|
+
(_getSmartCardStorage2 = getSmartCardStorage()) === null || _getSmartCardStorage2 === void 0 || _getSmartCardStorage2.removeItem(PRE_AUTH_VALUE_PROPOSITION_MODAL_STORAGE_ITEM_KEY);
|
|
92
|
+
} catch (_unused3) {
|
|
93
|
+
// Browser Storage Controls, quota, private mode, and SSR must not break the editor.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "getStoredShowState",
|
|
98
|
+
value: function getStoredShowState() {
|
|
99
|
+
if (this.storedShowState !== null) {
|
|
100
|
+
return this.storedShowState;
|
|
101
|
+
}
|
|
102
|
+
var storedShowState = this.readStoredShowState();
|
|
103
|
+
this.storedShowState = storedShowState;
|
|
104
|
+
return storedShowState;
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "readStoredShowState",
|
|
108
|
+
value: function readStoredShowState() {
|
|
109
|
+
try {
|
|
110
|
+
var _getSmartCardStorage3;
|
|
111
|
+
var storedShowState = (_getSmartCardStorage3 = getSmartCardStorage()) === null || _getSmartCardStorage3 === void 0 ? void 0 : _getSmartCardStorage3.getItem(PRE_AUTH_VALUE_PROPOSITION_MODAL_STORAGE_ITEM_KEY);
|
|
112
|
+
if (!isStoredShowState(storedShowState)) {
|
|
113
|
+
return EMPTY_STORED_SHOW_STATE;
|
|
114
|
+
}
|
|
115
|
+
return storedShowState;
|
|
116
|
+
} catch (_unused4) {
|
|
117
|
+
return EMPTY_STORED_SHOW_STATE;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}]);
|
|
121
|
+
}();
|
|
122
|
+
var preAuthValuePropositionModalService = exports.preAuthValuePropositionModalService = new PreAuthValuePropositionModalService();
|
|
@@ -25,7 +25,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
25
25
|
var context = exports.context = {
|
|
26
26
|
componentName: 'smart-cards',
|
|
27
27
|
packageName: "@atlaskit/smart-card" || '',
|
|
28
|
-
packageVersion: "45.
|
|
28
|
+
packageVersion: "45.27.1" || ''
|
|
29
29
|
};
|
|
30
30
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
31
31
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "45.
|
|
22
|
+
packageVersion: "45.27.1",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
._154i18e8{top:53px}
|
|
2
|
+
._154i1rp4{top:215px}
|
|
3
|
+
._154intd2{top:184px}
|
|
4
|
+
._154invl5{top:355px}
|
|
5
|
+
._18m915vq{overflow-y:hidden}
|
|
6
|
+
._1bah1h6o{justify-content:center}
|
|
7
|
+
._1bsb1kdj{width:25pc}
|
|
8
|
+
._1bsb1ylp{width:40px}
|
|
9
|
+
._1bsbl52n{width:17px}
|
|
10
|
+
._1bsbo7ao{width:15px}
|
|
11
|
+
._1e0c1txw{display:flex}
|
|
12
|
+
._1e0c1ule{display:block}
|
|
13
|
+
._1ein1kw7{border-end-end-radius:inherit}
|
|
14
|
+
._1ltv1uvc{left:107px}
|
|
15
|
+
._1ltv5rga{left:123px}
|
|
16
|
+
._1ltvs0l4{left:121px}
|
|
17
|
+
._1ltvvbgk{left:4pc}
|
|
18
|
+
._1o9zidpf{flex-shrink:0}
|
|
19
|
+
._1reo15vq{overflow-x:hidden}
|
|
20
|
+
._4cvr1h6o{align-items:center}
|
|
21
|
+
._4t3i1osq{height:100%}
|
|
22
|
+
._4t3i1ylp{height:40px}
|
|
23
|
+
._4t3ikbql{height:450px}
|
|
24
|
+
._4t3il52n{height:17px}
|
|
25
|
+
._4t3io7ao{height:15px}
|
|
26
|
+
._5fbc1kw7{border-start-end-radius:inherit}
|
|
27
|
+
._kqswh2mm{position:relative}
|
|
28
|
+
._kqswstnw{position:absolute}
|
|
29
|
+
._t9ec1b7d{transform:rotate(-3.18deg)}
|
|
30
|
+
._t9ec751h{transform:rotate(3.37deg)}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* IllustrationPane.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
require("./IllustrationPane.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _box = require("@atlaskit/primitives/compiled/box");
|
|
13
|
+
var _graphicsWithGridNoProviderIcons2x = _interopRequireDefault(require("./assets/graphics-with-grid-no-provider-icons-2x.png"));
|
|
14
|
+
// Asset imports require an explicit extension for TypeScript and ESLint resolution.
|
|
15
|
+
// oxlint-disable-next-line import/extensions
|
|
16
|
+
var styles = {
|
|
17
|
+
illustration: "_1e0c1ule _4t3ikbql _1bsb1kdj",
|
|
18
|
+
illustrationLayer: "_1reo15vq _18m915vq _1ein1kw7 _5fbc1kw7 _4t3ikbql _kqswh2mm _1bsb1kdj",
|
|
19
|
+
rightPane: "_1reo15vq _18m915vq _4cvr1h6o _1ein1kw7 _5fbc1kw7 _1e0c1txw _1o9zidpf _4t3i1osq _1bah1h6o _1bsb1kdj"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Pixel offsets and rotations are from the Figma illustration, not space tokens.
|
|
23
|
+
var illustrationIconStyles = {
|
|
24
|
+
footer: "_4t3io7ao _1ltv1uvc _kqswstnw _154invl5 _t9ec1b7d _1bsbo7ao",
|
|
25
|
+
searchFirst: "_4t3il52n _1ltv5rga _kqswstnw _154intd2 _t9ec751h _1bsbl52n",
|
|
26
|
+
searchSecond: "_4t3il52n _1ltvs0l4 _kqswstnw _154i1rp4 _t9ec751h _1bsbl52n",
|
|
27
|
+
top: "_1reo15vq _18m915vq _4t3i1ylp _1ltvvbgk _kqswstnw _154i18e8 _1bsb1ylp"
|
|
28
|
+
};
|
|
29
|
+
var IllustrationPane = function IllustrationPane(_ref) {
|
|
30
|
+
var renderProviderIcon = _ref.renderProviderIcon;
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
32
|
+
xcss: styles.rightPane
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
34
|
+
xcss: styles.illustrationLayer
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
36
|
+
alt: "",
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
"data-testid": "pre-auth-value-proposition-modal-illustration",
|
|
39
|
+
height: 450,
|
|
40
|
+
src: _graphicsWithGridNoProviderIcons2x.default,
|
|
41
|
+
srcSet: "".concat(_graphicsWithGridNoProviderIcons2x.default, " 2x"),
|
|
42
|
+
width: 400,
|
|
43
|
+
className: (0, _runtime.ax)([styles.illustration])
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
className: (0, _runtime.ax)([illustrationIconStyles.top])
|
|
47
|
+
}, renderProviderIcon(40, 'pre-auth-value-proposition-modal-illustration-icon')), /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
className: (0, _runtime.ax)([illustrationIconStyles.searchFirst])
|
|
50
|
+
}, renderProviderIcon(17, 'pre-auth-value-proposition-modal-illustration-icon')), /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
className: (0, _runtime.ax)([illustrationIconStyles.searchSecond])
|
|
53
|
+
}, renderProviderIcon(17, 'pre-auth-value-proposition-modal-illustration-icon')), /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: (0, _runtime.ax)([illustrationIconStyles.footer])
|
|
56
|
+
}, renderProviderIcon(15, 'pre-auth-value-proposition-modal-illustration-icon'))));
|
|
57
|
+
};
|
|
58
|
+
var _default = exports.default = IllustrationPane;
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
._2rko1kw7{border-radius:inherit}
|
|
2
|
+
._zulp1ejb{gap:var(--ds-space-300,24px)}
|
|
3
|
+
._zulppxbi{gap:var(--ds-space-200,1pc)}._16jlkb7n{flex-grow:1}
|
|
4
|
+
._18m915vq{overflow-y:hidden}
|
|
5
|
+
._19bv1jfw{padding-left:var(--ds-space-500,40px)}
|
|
6
|
+
._1bsb1kdj{width:25pc}
|
|
7
|
+
._1bsbnklw{width:20pc}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1o9zidpf{flex-shrink:0}
|
|
10
|
+
._1reo15vq{overflow-x:hidden}
|
|
11
|
+
._2lx21bp4{flex-direction:column}
|
|
12
|
+
._4cvr1fhb{align-items:stretch}
|
|
13
|
+
._4cvr1h6o{align-items:center}
|
|
14
|
+
._4t3i1osq{height:100%}
|
|
15
|
+
._ca0q1jfw{padding-top:var(--ds-space-500,40px)}
|
|
16
|
+
._n3td1jfw{padding-bottom:var(--ds-space-500,40px)}
|
|
17
|
+
._u5f31jfw{padding-right:var(--ds-space-500,40px)}
|