@atlaskit/smart-card 45.0.3 → 45.1.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 45.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 45.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`754e04aa98a74`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/754e04aa98a74) -
14
+ Add new 'timeZone' prop for ModifiedOn smartlink block to allow for server hydrated modified on
15
+ display
16
+
17
+ ### Patch Changes
18
+
19
+ - [`8e6266d49dafa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e6266d49dafa) -
20
+ NAVX-5111 Updating formatting for inline cta rovo chat prompts
21
+ - Updated dependencies
22
+
3
23
  ## 45.0.3
4
24
 
5
25
  ### Patch Changes
@@ -1089,13 +1089,13 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
1089
1089
  },
1090
1090
  rovo_prompt_message_summarize_document: {
1091
1091
  id: 'fabric.linking.rovo_prompt_message_summarize_document.non-final',
1092
- defaultMessage: "Summarize this doc {url} into a concise, easy-to-scan overview. Adapt to whatever the content is and focus on the main ideas, important decisions, key updates, and next steps, only include these if they exist; don't mention their absence. Avoid unnecessary detail, repetition, or formatting commentary. Write in plain language and optimize for a quick 5\u201310 second read",
1093
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from.'
1092
+ defaultMessage: "<p>Summarize this doc <a>{url}</a> into a concise, easy-to-scan overview. Adapt to whatever the content is and focus on the main ideas, important decisions, key updates, and next steps, only include these if they exist; don't mention their absence. Avoid unnecessary detail, repetition, or formatting commentary. Write in plain language and optimize for a quick 5\u201310 second read</p>",
1093
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1094
1094
  },
1095
1095
  rovo_prompt_message_summarize_presentation: {
1096
1096
  id: 'fabric.linking.rovo_prompt_message_summarize_presentation.non-final',
1097
- defaultMessage: "Summarize this Google Slides deck {url} into a concise executive overview. Focus on the tldr, key findings, decisions, metrics, risks, and next steps, if there are any. Use a short executive summary followed by 2-3 bullet points. Avoid slide-by-slide narration, design details, repetition, and filler.",
1098
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from.'
1097
+ defaultMessage: "<p>Summarize this Google Slides deck <a>{url}</a> into a concise executive overview. Focus on the tldr, key findings, decisions, metrics, risks, and next steps, if there are any. Use a short executive summary followed by 2-3 bullet points. Avoid slide-by-slide narration, design details, repetition, and filler.</p>",
1098
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1099
1099
  },
1100
1100
  rovo_prompt_button_explain_code: {
1101
1101
  id: 'fabric.linking.rovo_prompt_button_explain_code.non-final',
@@ -1104,7 +1104,7 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
1104
1104
  },
1105
1105
  rovo_prompt_message_explain_code: {
1106
1106
  id: 'fabric.linking.rovo_prompt_message_explain_code.non-final',
1107
- defaultMessage: "<p>Explain this code, pull request, or commit {url} in clear, plain language for a non-technical audience.</p><p>Cover:</p><ol><li><strong>Purpose</strong> \u2014 What problem does it solve or what goal does it achieve?</li><li><strong>How it works</strong> \u2014 High-level mechanics (no implementation detail unless critical to understanding).</li><li><strong>Why</strong> \u2014 Motivation for the change or design choice.</li><li><strong>Impact</strong> \u2014 Key behavior changes, risks, or downstream effects worth noting.</li></ol><p>Constraints:</p><ul><li>3\u20135 sentences or 100\u2013150 words max.</li><li>Omit sections with nothing meaningful to say.</li><li>Prefer concrete language over abstract descriptions (e.g., \"speeds up page load by caching results\" over \"improves performance\").</li></ul>",
1107
+ defaultMessage: "<p>Explain this code, pull request, or commit <a>{url}</a> in clear, plain language for a non-technical audience.</p><p>Cover:</p><ol><li><strong>Purpose</strong> \u2014 What problem does it solve or what goal does it achieve?</li><li><strong>How it works</strong> \u2014 High-level mechanics (no implementation detail unless critical to understanding).</li><li><strong>Why</strong> \u2014 Motivation for the change or design choice.</li><li><strong>Impact</strong> \u2014 Key behavior changes, risks, or downstream effects worth noting.</li></ol><p>Constraints:</p><ul><li>3\u20135 sentences or 100\u2013150 words max.</li><li>Omit sections with nothing meaningful to say.</li><li>Prefer concrete language over abstract descriptions (e.g., \"speeds up page load by caching results\" over \"improves performance\").</li></ul>",
1108
1108
  description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1109
1109
  },
1110
1110
  rovo_prompt_button_catch_up: {
@@ -1114,7 +1114,7 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
1114
1114
  },
1115
1115
  rovo_prompt_message_catch_up: {
1116
1116
  id: 'fabric.linking.rovo_prompt_message_catch_up.non-final',
1117
- defaultMessage: "Catch me up on the latest {provider} conversations or channel activity in {url} from the last two weeks. If there's no activity in the past two weeks, expand the window to the most recent 30 days (or until meaningful activity is found). Summarize the most important updates, decisions, and discussions so the user can quickly understand what they missed. Focus on key changes, unresolved questions, and any action items or follow-ups. Prioritize recent messages with the most activity. Keep the response concise \u2014 ideally 80\u2013150 words or a short set of 3\u20135 key bullets.",
1117
+ defaultMessage: "<p>Catch me up on the latest {provider} conversations or channel activity in <a>{url}</a> from the last two weeks. If there's no activity in the past two weeks, expand the window to the most recent 30 days (or until meaningful activity is found). Summarize the most important updates, decisions, and discussions so the user can quickly understand what they missed. Focus on key changes, unresolved questions, and any action items or follow-ups. Prioritize recent messages with the most activity. Keep the response concise \u2014 ideally 80\u2013150 words or a short set of 3\u20135 key bullets.</p>",
1118
1118
  description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. {provider} is the 3P app name (Please make sure all html tags remain the same.)'
1119
1119
  },
1120
1120
  rovo_prompt_button_salesforce_prep: {
@@ -1124,8 +1124,8 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
1124
1124
  },
1125
1125
  rovo_prompt_message_salesforce_prep: {
1126
1126
  id: 'fabric.linking.rovo_prompt_message_salesforce_prep.non-final',
1127
- defaultMessage: "Prep me for this Salesforce record {url}. What's the current state, what's the recent activity, what risks or opportunities should I be aware of, and what would be useful to know before a conversation about it?",
1128
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from'
1127
+ defaultMessage: "<p>Prep me for this Salesforce record <a>{url}</a>. What's the current state, what's the recent activity, what risks or opportunities should I be aware of, and what would be useful to know before a conversation about it?</p>",
1128
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1129
1129
  },
1130
1130
  // TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
1131
1131
  pre_auth_block_social_proof_not_low: {
@@ -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: "45.0.2" || ''
14
+ packageVersion: "45.1.0" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -11,11 +11,41 @@ require("./index.compiled.css");
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _runtime = require("@compiled/react/runtime");
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
15
  var _intlUtils = require("@formatjs/intl-utils");
15
16
  var _reactIntl = require("react-intl");
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
18
  var _messages = require("../../../../../../messages");
17
19
  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); }
20
+ 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; }
21
+ 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; }
18
22
  var styles = null;
23
+ var ABSOLUTE_DATE_FORMAT = {
24
+ month: 'short',
25
+ day: 'numeric',
26
+ year: 'numeric'
27
+ };
28
+ var isValidTimeZone = function isValidTimeZone(timeZone) {
29
+ try {
30
+ new Intl.DateTimeFormat(undefined, {
31
+ timeZone: timeZone
32
+ });
33
+ return true;
34
+ } catch (_unused) {
35
+ return false;
36
+ }
37
+ };
38
+ var formatAbsoluteDateWithOptionalTimeZone = function formatAbsoluteDateWithOptionalTimeZone(_ref) {
39
+ var date = _ref.date,
40
+ formatDate = _ref.formatDate,
41
+ timeZone = _ref.timeZone;
42
+ if (!timeZone || !isValidTimeZone(timeZone)) {
43
+ return formatDate(date, ABSOLUTE_DATE_FORMAT);
44
+ }
45
+ return formatDate(date, _objectSpread(_objectSpread({}, ABSOLUTE_DATE_FORMAT), {}, {
46
+ timeZone: timeZone
47
+ }));
48
+ };
19
49
  var typeToDescriptorMap = {
20
50
  created: {
21
51
  relative: _messages.messages.created_on_relative,
@@ -43,18 +73,19 @@ var fontOverrideStyleMap = {
43
73
  * @see ModifiedOn
44
74
  * @see SentOn
45
75
  */
46
- var BaseDateTimeElement = function BaseDateTimeElement(_ref) {
47
- var date = _ref.date,
48
- name = _ref.name,
49
- className = _ref.className,
50
- type = _ref.type,
51
- _ref$testId = _ref.testId,
52
- testId = _ref$testId === void 0 ? 'smart-element-date-time' : _ref$testId,
53
- text = _ref.text,
54
- _ref$hideDatePrefix = _ref.hideDatePrefix,
55
- hideDatePrefix = _ref$hideDatePrefix === void 0 ? false : _ref$hideDatePrefix,
56
- color = _ref.color,
57
- fontSize = _ref.fontSize;
76
+ var BaseDateTimeElement = function BaseDateTimeElement(_ref2) {
77
+ var date = _ref2.date,
78
+ name = _ref2.name,
79
+ className = _ref2.className,
80
+ type = _ref2.type,
81
+ _ref2$testId = _ref2.testId,
82
+ testId = _ref2$testId === void 0 ? 'smart-element-date-time' : _ref2$testId,
83
+ text = _ref2.text,
84
+ _ref2$hideDatePrefix = _ref2.hideDatePrefix,
85
+ hideDatePrefix = _ref2$hideDatePrefix === void 0 ? false : _ref2$hideDatePrefix,
86
+ color = _ref2.color,
87
+ fontSize = _ref2.fontSize,
88
+ timeZone = _ref2.timeZone;
58
89
  var _useIntl = (0, _reactIntl.useIntl)(),
59
90
  formatRelativeTime = _useIntl.formatRelativeTime,
60
91
  formatDate = _useIntl.formatDate;
@@ -66,7 +97,11 @@ var BaseDateTimeElement = function BaseDateTimeElement(_ref) {
66
97
  var typeVariant;
67
98
  if (isLongerThenWeek) {
68
99
  typeVariant = 'absolute';
69
- context = formatDate(date, {
100
+ context = (0, _platformFeatureFlags.fg)('dfo_issue_view_remote_data_srr_group') ? formatAbsoluteDateWithOptionalTimeZone({
101
+ date: date,
102
+ formatDate: formatDate,
103
+ timeZone: timeZone
104
+ }) : formatDate(date, {
70
105
  month: 'short',
71
106
  day: 'numeric',
72
107
  year: 'numeric'
@@ -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.0.2",
22
+ packageVersion: "45.1.0",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -1083,13 +1083,13 @@ export const messages = defineMessages({
1083
1083
  },
1084
1084
  rovo_prompt_message_summarize_document: {
1085
1085
  id: 'fabric.linking.rovo_prompt_message_summarize_document.non-final',
1086
- defaultMessage: `Summarize this doc {url} into a concise, easy-to-scan overview. Adapt to whatever the content is and focus on the main ideas, important decisions, key updates, and next steps, only include these if they exist; don't mention their absence. Avoid unnecessary detail, repetition, or formatting commentary. Write in plain language and optimize for a quick 5–10 second read`,
1087
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from.'
1086
+ defaultMessage: `<p>Summarize this doc <a>{url}</a> into a concise, easy-to-scan overview. Adapt to whatever the content is and focus on the main ideas, important decisions, key updates, and next steps, only include these if they exist; don't mention their absence. Avoid unnecessary detail, repetition, or formatting commentary. Write in plain language and optimize for a quick 5–10 second read</p>`,
1087
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1088
1088
  },
1089
1089
  rovo_prompt_message_summarize_presentation: {
1090
1090
  id: 'fabric.linking.rovo_prompt_message_summarize_presentation.non-final',
1091
- defaultMessage: `Summarize this Google Slides deck {url} into a concise executive overview. Focus on the tldr, key findings, decisions, metrics, risks, and next steps, if there are any. Use a short executive summary followed by 2-3 bullet points. Avoid slide-by-slide narration, design details, repetition, and filler.`,
1092
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from.'
1091
+ defaultMessage: `<p>Summarize this Google Slides deck <a>{url}</a> into a concise executive overview. Focus on the tldr, key findings, decisions, metrics, risks, and next steps, if there are any. Use a short executive summary followed by 2-3 bullet points. Avoid slide-by-slide narration, design details, repetition, and filler.</p>`,
1092
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1093
1093
  },
1094
1094
  rovo_prompt_button_explain_code: {
1095
1095
  id: 'fabric.linking.rovo_prompt_button_explain_code.non-final',
@@ -1098,7 +1098,7 @@ export const messages = defineMessages({
1098
1098
  },
1099
1099
  rovo_prompt_message_explain_code: {
1100
1100
  id: 'fabric.linking.rovo_prompt_message_explain_code.non-final',
1101
- defaultMessage: `<p>Explain this code, pull request, or commit {url} in clear, plain language for a non-technical audience.</p><p>Cover:</p><ol><li><strong>Purpose</strong> — What problem does it solve or what goal does it achieve?</li><li><strong>How it works</strong> — High-level mechanics (no implementation detail unless critical to understanding).</li><li><strong>Why</strong> — Motivation for the change or design choice.</li><li><strong>Impact</strong> — Key behavior changes, risks, or downstream effects worth noting.</li></ol><p>Constraints:</p><ul><li>3–5 sentences or 100–150 words max.</li><li>Omit sections with nothing meaningful to say.</li><li>Prefer concrete language over abstract descriptions (e.g., "speeds up page load by caching results" over "improves performance").</li></ul>`,
1101
+ defaultMessage: `<p>Explain this code, pull request, or commit <a>{url}</a> in clear, plain language for a non-technical audience.</p><p>Cover:</p><ol><li><strong>Purpose</strong> — What problem does it solve or what goal does it achieve?</li><li><strong>How it works</strong> — High-level mechanics (no implementation detail unless critical to understanding).</li><li><strong>Why</strong> — Motivation for the change or design choice.</li><li><strong>Impact</strong> — Key behavior changes, risks, or downstream effects worth noting.</li></ol><p>Constraints:</p><ul><li>3–5 sentences or 100–150 words max.</li><li>Omit sections with nothing meaningful to say.</li><li>Prefer concrete language over abstract descriptions (e.g., "speeds up page load by caching results" over "improves performance").</li></ul>`,
1102
1102
  description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1103
1103
  },
1104
1104
  rovo_prompt_button_catch_up: {
@@ -1108,7 +1108,7 @@ export const messages = defineMessages({
1108
1108
  },
1109
1109
  rovo_prompt_message_catch_up: {
1110
1110
  id: 'fabric.linking.rovo_prompt_message_catch_up.non-final',
1111
- defaultMessage: `Catch me up on the latest {provider} conversations or channel activity in {url} from the last two weeks. If there's no activity in the past two weeks, expand the window to the most recent 30 days (or until meaningful activity is found). Summarize the most important updates, decisions, and discussions so the user can quickly understand what they missed. Focus on key changes, unresolved questions, and any action items or follow-ups. Prioritize recent messages with the most activity. Keep the response concise — ideally 80–150 words or a short set of 3–5 key bullets.`,
1111
+ defaultMessage: `<p>Catch me up on the latest {provider} conversations or channel activity in <a>{url}</a> from the last two weeks. If there's no activity in the past two weeks, expand the window to the most recent 30 days (or until meaningful activity is found). Summarize the most important updates, decisions, and discussions so the user can quickly understand what they missed. Focus on key changes, unresolved questions, and any action items or follow-ups. Prioritize recent messages with the most activity. Keep the response concise — ideally 80–150 words or a short set of 3–5 key bullets.</p>`,
1112
1112
  description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. {provider} is the 3P app name (Please make sure all html tags remain the same.)'
1113
1113
  },
1114
1114
  rovo_prompt_button_salesforce_prep: {
@@ -1118,8 +1118,8 @@ export const messages = defineMessages({
1118
1118
  },
1119
1119
  rovo_prompt_message_salesforce_prep: {
1120
1120
  id: 'fabric.linking.rovo_prompt_message_salesforce_prep.non-final',
1121
- defaultMessage: `Prep me for this Salesforce record {url}. What's the current state, what's the recent activity, what risks or opportunities should I be aware of, and what would be useful to know before a conversation about it?`,
1122
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from'
1121
+ defaultMessage: `<p>Prep me for this Salesforce record <a>{url}</a>. What's the current state, what's the recent activity, what risks or opportunities should I be aware of, and what would be useful to know before a conversation about it?</p>`,
1122
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1123
1123
  },
1124
1124
  // TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
1125
1125
  pre_auth_block_social_proof_not_low: {
@@ -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: "45.0.2" || ''
5
+ packageVersion: "45.1.0" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -5,8 +5,37 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { selectUnit } from '@formatjs/intl-utils';
7
7
  import { FormattedMessage, useIntl } from 'react-intl';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { messages } from '../../../../../../messages';
9
10
  const styles = null;
11
+ const ABSOLUTE_DATE_FORMAT = {
12
+ month: 'short',
13
+ day: 'numeric',
14
+ year: 'numeric'
15
+ };
16
+ const isValidTimeZone = timeZone => {
17
+ try {
18
+ new Intl.DateTimeFormat(undefined, {
19
+ timeZone
20
+ });
21
+ return true;
22
+ } catch {
23
+ return false;
24
+ }
25
+ };
26
+ const formatAbsoluteDateWithOptionalTimeZone = ({
27
+ date,
28
+ formatDate,
29
+ timeZone
30
+ }) => {
31
+ if (!timeZone || !isValidTimeZone(timeZone)) {
32
+ return formatDate(date, ABSOLUTE_DATE_FORMAT);
33
+ }
34
+ return formatDate(date, {
35
+ ...ABSOLUTE_DATE_FORMAT,
36
+ timeZone
37
+ });
38
+ };
10
39
  const typeToDescriptorMap = {
11
40
  created: {
12
41
  relative: messages.created_on_relative,
@@ -43,7 +72,8 @@ const BaseDateTimeElement = ({
43
72
  text,
44
73
  hideDatePrefix = false,
45
74
  color,
46
- fontSize
75
+ fontSize,
76
+ timeZone
47
77
  }) => {
48
78
  const {
49
79
  formatRelativeTime,
@@ -57,7 +87,11 @@ const BaseDateTimeElement = ({
57
87
  let typeVariant;
58
88
  if (isLongerThenWeek) {
59
89
  typeVariant = 'absolute';
60
- context = formatDate(date, {
90
+ context = fg('dfo_issue_view_remote_data_srr_group') ? formatAbsoluteDateWithOptionalTimeZone({
91
+ date,
92
+ formatDate,
93
+ timeZone
94
+ }) : formatDate(date, {
61
95
  month: 'short',
62
96
  day: 'numeric',
63
97
  year: 'numeric'
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "45.0.2",
12
+ packageVersion: "45.1.0",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -1083,13 +1083,13 @@ export var messages = defineMessages({
1083
1083
  },
1084
1084
  rovo_prompt_message_summarize_document: {
1085
1085
  id: 'fabric.linking.rovo_prompt_message_summarize_document.non-final',
1086
- defaultMessage: "Summarize this doc {url} into a concise, easy-to-scan overview. Adapt to whatever the content is and focus on the main ideas, important decisions, key updates, and next steps, only include these if they exist; don't mention their absence. Avoid unnecessary detail, repetition, or formatting commentary. Write in plain language and optimize for a quick 5\u201310 second read",
1087
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from.'
1086
+ defaultMessage: "<p>Summarize this doc <a>{url}</a> into a concise, easy-to-scan overview. Adapt to whatever the content is and focus on the main ideas, important decisions, key updates, and next steps, only include these if they exist; don't mention their absence. Avoid unnecessary detail, repetition, or formatting commentary. Write in plain language and optimize for a quick 5\u201310 second read</p>",
1087
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1088
1088
  },
1089
1089
  rovo_prompt_message_summarize_presentation: {
1090
1090
  id: 'fabric.linking.rovo_prompt_message_summarize_presentation.non-final',
1091
- defaultMessage: "Summarize this Google Slides deck {url} into a concise executive overview. Focus on the tldr, key findings, decisions, metrics, risks, and next steps, if there are any. Use a short executive summary followed by 2-3 bullet points. Avoid slide-by-slide narration, design details, repetition, and filler.",
1092
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from.'
1091
+ defaultMessage: "<p>Summarize this Google Slides deck <a>{url}</a> into a concise executive overview. Focus on the tldr, key findings, decisions, metrics, risks, and next steps, if there are any. Use a short executive summary followed by 2-3 bullet points. Avoid slide-by-slide narration, design details, repetition, and filler.</p>",
1092
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1093
1093
  },
1094
1094
  rovo_prompt_button_explain_code: {
1095
1095
  id: 'fabric.linking.rovo_prompt_button_explain_code.non-final',
@@ -1098,7 +1098,7 @@ export var messages = defineMessages({
1098
1098
  },
1099
1099
  rovo_prompt_message_explain_code: {
1100
1100
  id: 'fabric.linking.rovo_prompt_message_explain_code.non-final',
1101
- defaultMessage: "<p>Explain this code, pull request, or commit {url} in clear, plain language for a non-technical audience.</p><p>Cover:</p><ol><li><strong>Purpose</strong> \u2014 What problem does it solve or what goal does it achieve?</li><li><strong>How it works</strong> \u2014 High-level mechanics (no implementation detail unless critical to understanding).</li><li><strong>Why</strong> \u2014 Motivation for the change or design choice.</li><li><strong>Impact</strong> \u2014 Key behavior changes, risks, or downstream effects worth noting.</li></ol><p>Constraints:</p><ul><li>3\u20135 sentences or 100\u2013150 words max.</li><li>Omit sections with nothing meaningful to say.</li><li>Prefer concrete language over abstract descriptions (e.g., \"speeds up page load by caching results\" over \"improves performance\").</li></ul>",
1101
+ defaultMessage: "<p>Explain this code, pull request, or commit <a>{url}</a> in clear, plain language for a non-technical audience.</p><p>Cover:</p><ol><li><strong>Purpose</strong> \u2014 What problem does it solve or what goal does it achieve?</li><li><strong>How it works</strong> \u2014 High-level mechanics (no implementation detail unless critical to understanding).</li><li><strong>Why</strong> \u2014 Motivation for the change or design choice.</li><li><strong>Impact</strong> \u2014 Key behavior changes, risks, or downstream effects worth noting.</li></ol><p>Constraints:</p><ul><li>3\u20135 sentences or 100\u2013150 words max.</li><li>Omit sections with nothing meaningful to say.</li><li>Prefer concrete language over abstract descriptions (e.g., \"speeds up page load by caching results\" over \"improves performance\").</li></ul>",
1102
1102
  description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1103
1103
  },
1104
1104
  rovo_prompt_button_catch_up: {
@@ -1108,7 +1108,7 @@ export var messages = defineMessages({
1108
1108
  },
1109
1109
  rovo_prompt_message_catch_up: {
1110
1110
  id: 'fabric.linking.rovo_prompt_message_catch_up.non-final',
1111
- defaultMessage: "Catch me up on the latest {provider} conversations or channel activity in {url} from the last two weeks. If there's no activity in the past two weeks, expand the window to the most recent 30 days (or until meaningful activity is found). Summarize the most important updates, decisions, and discussions so the user can quickly understand what they missed. Focus on key changes, unresolved questions, and any action items or follow-ups. Prioritize recent messages with the most activity. Keep the response concise \u2014 ideally 80\u2013150 words or a short set of 3\u20135 key bullets.",
1111
+ defaultMessage: "<p>Catch me up on the latest {provider} conversations or channel activity in <a>{url}</a> from the last two weeks. If there's no activity in the past two weeks, expand the window to the most recent 30 days (or until meaningful activity is found). Summarize the most important updates, decisions, and discussions so the user can quickly understand what they missed. Focus on key changes, unresolved questions, and any action items or follow-ups. Prioritize recent messages with the most activity. Keep the response concise \u2014 ideally 80\u2013150 words or a short set of 3\u20135 key bullets.</p>",
1112
1112
  description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. {provider} is the 3P app name (Please make sure all html tags remain the same.)'
1113
1113
  },
1114
1114
  rovo_prompt_button_salesforce_prep: {
@@ -1118,8 +1118,8 @@ export var messages = defineMessages({
1118
1118
  },
1119
1119
  rovo_prompt_message_salesforce_prep: {
1120
1120
  id: 'fabric.linking.rovo_prompt_message_salesforce_prep.non-final',
1121
- defaultMessage: "Prep me for this Salesforce record {url}. What's the current state, what's the recent activity, what risks or opportunities should I be aware of, and what would be useful to know before a conversation about it?",
1122
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from'
1121
+ defaultMessage: "<p>Prep me for this Salesforce record <a>{url}</a>. What's the current state, what's the recent activity, what risks or opportunities should I be aware of, and what would be useful to know before a conversation about it?</p>",
1122
+ description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1123
1123
  },
1124
1124
  // TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
1125
1125
  pre_auth_block_social_proof_not_low: {
@@ -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: "45.0.2" || ''
7
+ packageVersion: "45.1.0" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,12 +1,42 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  import "./index.compiled.css";
4
5
  import * as React from 'react';
5
6
  import { ax, ix } from "@compiled/react/runtime";
7
+ 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; }
8
+ 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; }
6
9
  import { selectUnit } from '@formatjs/intl-utils';
7
10
  import { FormattedMessage, useIntl } from 'react-intl';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
8
12
  import { messages } from '../../../../../../messages';
9
13
  var styles = null;
14
+ var ABSOLUTE_DATE_FORMAT = {
15
+ month: 'short',
16
+ day: 'numeric',
17
+ year: 'numeric'
18
+ };
19
+ var isValidTimeZone = function isValidTimeZone(timeZone) {
20
+ try {
21
+ new Intl.DateTimeFormat(undefined, {
22
+ timeZone: timeZone
23
+ });
24
+ return true;
25
+ } catch (_unused) {
26
+ return false;
27
+ }
28
+ };
29
+ var formatAbsoluteDateWithOptionalTimeZone = function formatAbsoluteDateWithOptionalTimeZone(_ref) {
30
+ var date = _ref.date,
31
+ formatDate = _ref.formatDate,
32
+ timeZone = _ref.timeZone;
33
+ if (!timeZone || !isValidTimeZone(timeZone)) {
34
+ return formatDate(date, ABSOLUTE_DATE_FORMAT);
35
+ }
36
+ return formatDate(date, _objectSpread(_objectSpread({}, ABSOLUTE_DATE_FORMAT), {}, {
37
+ timeZone: timeZone
38
+ }));
39
+ };
10
40
  var typeToDescriptorMap = {
11
41
  created: {
12
42
  relative: messages.created_on_relative,
@@ -34,18 +64,19 @@ var fontOverrideStyleMap = {
34
64
  * @see ModifiedOn
35
65
  * @see SentOn
36
66
  */
37
- var BaseDateTimeElement = function BaseDateTimeElement(_ref) {
38
- var date = _ref.date,
39
- name = _ref.name,
40
- className = _ref.className,
41
- type = _ref.type,
42
- _ref$testId = _ref.testId,
43
- testId = _ref$testId === void 0 ? 'smart-element-date-time' : _ref$testId,
44
- text = _ref.text,
45
- _ref$hideDatePrefix = _ref.hideDatePrefix,
46
- hideDatePrefix = _ref$hideDatePrefix === void 0 ? false : _ref$hideDatePrefix,
47
- color = _ref.color,
48
- fontSize = _ref.fontSize;
67
+ var BaseDateTimeElement = function BaseDateTimeElement(_ref2) {
68
+ var date = _ref2.date,
69
+ name = _ref2.name,
70
+ className = _ref2.className,
71
+ type = _ref2.type,
72
+ _ref2$testId = _ref2.testId,
73
+ testId = _ref2$testId === void 0 ? 'smart-element-date-time' : _ref2$testId,
74
+ text = _ref2.text,
75
+ _ref2$hideDatePrefix = _ref2.hideDatePrefix,
76
+ hideDatePrefix = _ref2$hideDatePrefix === void 0 ? false : _ref2$hideDatePrefix,
77
+ color = _ref2.color,
78
+ fontSize = _ref2.fontSize,
79
+ timeZone = _ref2.timeZone;
49
80
  var _useIntl = useIntl(),
50
81
  formatRelativeTime = _useIntl.formatRelativeTime,
51
82
  formatDate = _useIntl.formatDate;
@@ -57,7 +88,11 @@ var BaseDateTimeElement = function BaseDateTimeElement(_ref) {
57
88
  var typeVariant;
58
89
  if (isLongerThenWeek) {
59
90
  typeVariant = 'absolute';
60
- context = formatDate(date, {
91
+ context = fg('dfo_issue_view_remote_data_srr_group') ? formatAbsoluteDateWithOptionalTimeZone({
92
+ date: date,
93
+ formatDate: formatDate,
94
+ timeZone: timeZone
95
+ }) : formatDate(date, {
61
96
  month: 'short',
62
97
  day: 'numeric',
63
98
  year: 'numeric'
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "45.0.2",
15
+ packageVersion: "45.1.0",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
@@ -325,7 +325,7 @@ export type ModifiedBy = {
325
325
  */
326
326
  export type ModifiedOn = {
327
327
  name: ElementName.ModifiedOn;
328
- } & Pick<ModifiedOnProps, 'fontSize' | 'text'>;
328
+ } & Pick<ModifiedOnProps, 'fontSize' | 'text' | 'timeZone'>;
329
329
  /**
330
330
  * Represents the props available for an Preview element.
331
331
  * @see Preview
@@ -23,6 +23,10 @@ export type BaseDateTimeElementProps = ElementProps & {
23
23
  * The override text which will show next to the date
24
24
  */
25
25
  text?: string;
26
+ /**
27
+ * IANA timezone used for absolute date formatting.
28
+ */
29
+ timeZone?: string;
26
30
  /**
27
31
  * Whether the date time element text should contain "Modified" or "Created" or "sent"
28
32
  */
@@ -36,6 +40,6 @@ export type BaseDateTimeElementProps = ElementProps & {
36
40
  * @see ModifiedOn
37
41
  * @see SentOn
38
42
  */
39
- declare const BaseDateTimeElement: ({ date, name, className, type, testId, text, hideDatePrefix, color, fontSize, }: BaseDateTimeElementProps) => JSX.Element | null;
43
+ declare const BaseDateTimeElement: ({ date, name, className, type, testId, text, hideDatePrefix, color, fontSize, timeZone, }: BaseDateTimeElementProps) => JSX.Element | null;
40
44
  export default BaseDateTimeElement;
41
45
  export declare const toDateTimeProps: (type: "created" | "modified" | "sent", dateString?: string) => Partial<BaseDateTimeElementProps> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "45.0.3",
3
+ "version": "45.1.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -70,7 +70,7 @@
70
70
  "@atlaskit/lozenge": "^14.0.0",
71
71
  "@atlaskit/menu": "^9.0.0",
72
72
  "@atlaskit/modal-dialog": "^16.0.0",
73
- "@atlaskit/motion": "^7.0.0",
73
+ "@atlaskit/motion": "^7.1.0",
74
74
  "@atlaskit/object": "^2.0.0",
75
75
  "@atlaskit/outbound-auth-flow-client": "^4.0.0",
76
76
  "@atlaskit/platform-feature-flags": "^2.0.0",
@@ -87,7 +87,7 @@
87
87
  "@atlaskit/textfield": "^9.0.0",
88
88
  "@atlaskit/theme": "^26.0.0",
89
89
  "@atlaskit/tile": "^2.0.0",
90
- "@atlaskit/tmp-editor-statsig": "^106.0.0",
90
+ "@atlaskit/tmp-editor-statsig": "^108.0.0",
91
91
  "@atlaskit/tokens": "^14.0.0",
92
92
  "@atlaskit/tooltip": "^23.0.0",
93
93
  "@atlaskit/ufo": "^1.0.0",
@@ -274,6 +274,9 @@
274
274
  },
275
275
  "platform_smartlink_inline_resolve_optimization": {
276
276
  "type": "boolean"
277
+ },
278
+ "dfo_issue_view_remote_data_srr_group": {
279
+ "type": "boolean"
277
280
  }
278
281
  },
279
282
  "compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"