@atlaskit/smart-card 26.5.1 → 26.5.2

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.
Files changed (175) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/extractors/flexible/extract-state.js +4 -3
  3. package/dist/cjs/extractors/flexible/index.js +1 -1
  4. package/dist/cjs/i18n/cs.js +1 -0
  5. package/dist/cjs/i18n/da.js +1 -0
  6. package/dist/cjs/i18n/de.js +1 -0
  7. package/dist/cjs/i18n/en.js +1 -0
  8. package/dist/cjs/i18n/en_GB.js +1 -0
  9. package/dist/cjs/i18n/en_ZZ.js +1 -0
  10. package/dist/cjs/i18n/es.js +1 -0
  11. package/dist/cjs/i18n/fi.js +1 -0
  12. package/dist/cjs/i18n/fr.js +1 -0
  13. package/dist/cjs/i18n/hu.js +1 -0
  14. package/dist/cjs/i18n/it.js +1 -0
  15. package/dist/cjs/i18n/ja.js +1 -0
  16. package/dist/cjs/i18n/ko.js +1 -0
  17. package/dist/cjs/i18n/nb.js +1 -0
  18. package/dist/cjs/i18n/nl.js +1 -0
  19. package/dist/cjs/i18n/pl.js +1 -0
  20. package/dist/cjs/i18n/pt_BR.js +1 -0
  21. package/dist/cjs/i18n/ru.js +1 -0
  22. package/dist/cjs/i18n/sv.js +1 -0
  23. package/dist/cjs/i18n/th.js +1 -0
  24. package/dist/cjs/i18n/tr.js +1 -0
  25. package/dist/cjs/i18n/uk.js +1 -0
  26. package/dist/cjs/i18n/vi.js +1 -0
  27. package/dist/cjs/i18n/zh.js +1 -0
  28. package/dist/cjs/i18n/zh_TW.js +1 -0
  29. package/dist/cjs/version.json +1 -1
  30. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/feature-discovery/index.js +50 -0
  31. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/feature-discovery/styled.js +32 -0
  32. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/feature-discovery/types.js +5 -0
  33. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/index.js +2 -1
  34. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-trigger/index.js +17 -9
  35. package/dist/cjs/view/FlexibleCard/components/container/index.js +6 -2
  36. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +5 -1
  37. package/dist/es2019/extractors/flexible/extract-state.js +4 -3
  38. package/dist/es2019/extractors/flexible/index.js +1 -1
  39. package/dist/es2019/i18n/cs.js +1 -0
  40. package/dist/es2019/i18n/da.js +1 -0
  41. package/dist/es2019/i18n/de.js +1 -0
  42. package/dist/es2019/i18n/en.js +1 -0
  43. package/dist/es2019/i18n/en_GB.js +1 -0
  44. package/dist/es2019/i18n/en_ZZ.js +1 -0
  45. package/dist/es2019/i18n/es.js +1 -0
  46. package/dist/es2019/i18n/fi.js +1 -0
  47. package/dist/es2019/i18n/fr.js +1 -0
  48. package/dist/es2019/i18n/hu.js +1 -0
  49. package/dist/es2019/i18n/it.js +1 -0
  50. package/dist/es2019/i18n/ja.js +1 -0
  51. package/dist/es2019/i18n/ko.js +1 -0
  52. package/dist/es2019/i18n/nb.js +1 -0
  53. package/dist/es2019/i18n/nl.js +1 -0
  54. package/dist/es2019/i18n/pl.js +1 -0
  55. package/dist/es2019/i18n/pt_BR.js +1 -0
  56. package/dist/es2019/i18n/ru.js +1 -0
  57. package/dist/es2019/i18n/sv.js +1 -0
  58. package/dist/es2019/i18n/th.js +1 -0
  59. package/dist/es2019/i18n/tr.js +1 -0
  60. package/dist/es2019/i18n/uk.js +1 -0
  61. package/dist/es2019/i18n/vi.js +1 -0
  62. package/dist/es2019/i18n/zh.js +1 -0
  63. package/dist/es2019/i18n/zh_TW.js +1 -0
  64. package/dist/es2019/version.json +1 -1
  65. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/feature-discovery/index.js +41 -0
  66. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/feature-discovery/styled.js +29 -0
  67. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/feature-discovery/types.js +1 -0
  68. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/index.js +2 -1
  69. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/lozenge-action-trigger/index.js +15 -9
  70. package/dist/es2019/view/FlexibleCard/components/container/index.js +6 -2
  71. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +5 -1
  72. package/dist/esm/extractors/flexible/extract-state.js +4 -3
  73. package/dist/esm/extractors/flexible/index.js +1 -1
  74. package/dist/esm/i18n/cs.js +1 -0
  75. package/dist/esm/i18n/da.js +1 -0
  76. package/dist/esm/i18n/de.js +1 -0
  77. package/dist/esm/i18n/en.js +1 -0
  78. package/dist/esm/i18n/en_GB.js +1 -0
  79. package/dist/esm/i18n/en_ZZ.js +1 -0
  80. package/dist/esm/i18n/es.js +1 -0
  81. package/dist/esm/i18n/fi.js +1 -0
  82. package/dist/esm/i18n/fr.js +1 -0
  83. package/dist/esm/i18n/hu.js +1 -0
  84. package/dist/esm/i18n/it.js +1 -0
  85. package/dist/esm/i18n/ja.js +1 -0
  86. package/dist/esm/i18n/ko.js +1 -0
  87. package/dist/esm/i18n/nb.js +1 -0
  88. package/dist/esm/i18n/nl.js +1 -0
  89. package/dist/esm/i18n/pl.js +1 -0
  90. package/dist/esm/i18n/pt_BR.js +1 -0
  91. package/dist/esm/i18n/ru.js +1 -0
  92. package/dist/esm/i18n/sv.js +1 -0
  93. package/dist/esm/i18n/th.js +1 -0
  94. package/dist/esm/i18n/tr.js +1 -0
  95. package/dist/esm/i18n/uk.js +1 -0
  96. package/dist/esm/i18n/vi.js +1 -0
  97. package/dist/esm/i18n/zh.js +1 -0
  98. package/dist/esm/i18n/zh_TW.js +1 -0
  99. package/dist/esm/version.json +1 -1
  100. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/feature-discovery/index.js +42 -0
  101. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/feature-discovery/styled.js +24 -0
  102. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/feature-discovery/types.js +1 -0
  103. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/index.js +2 -1
  104. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-trigger/index.js +18 -10
  105. package/dist/esm/view/FlexibleCard/components/container/index.js +6 -2
  106. package/dist/esm/view/HoverCard/components/HoverCardContent.js +5 -1
  107. package/dist/types/extractors/common/lozenge/types.d.ts +4 -1
  108. package/dist/types/extractors/flexible/extract-state.d.ts +2 -1
  109. package/dist/types/i18n/cs.d.ts +1 -0
  110. package/dist/types/i18n/da.d.ts +1 -0
  111. package/dist/types/i18n/de.d.ts +1 -0
  112. package/dist/types/i18n/en.d.ts +1 -0
  113. package/dist/types/i18n/en_GB.d.ts +1 -0
  114. package/dist/types/i18n/en_ZZ.d.ts +1 -0
  115. package/dist/types/i18n/es.d.ts +1 -0
  116. package/dist/types/i18n/fi.d.ts +1 -0
  117. package/dist/types/i18n/fr.d.ts +1 -0
  118. package/dist/types/i18n/hu.d.ts +1 -0
  119. package/dist/types/i18n/it.d.ts +1 -0
  120. package/dist/types/i18n/ja.d.ts +1 -0
  121. package/dist/types/i18n/ko.d.ts +1 -0
  122. package/dist/types/i18n/nb.d.ts +1 -0
  123. package/dist/types/i18n/nl.d.ts +1 -0
  124. package/dist/types/i18n/pl.d.ts +1 -0
  125. package/dist/types/i18n/pt_BR.d.ts +1 -0
  126. package/dist/types/i18n/ru.d.ts +1 -0
  127. package/dist/types/i18n/sv.d.ts +1 -0
  128. package/dist/types/i18n/th.d.ts +1 -0
  129. package/dist/types/i18n/tr.d.ts +1 -0
  130. package/dist/types/i18n/uk.d.ts +1 -0
  131. package/dist/types/i18n/vi.d.ts +1 -0
  132. package/dist/types/i18n/zh.d.ts +1 -0
  133. package/dist/types/i18n/zh_TW.d.ts +1 -0
  134. package/dist/types/view/FlexibleCard/components/common/lozenge-action/feature-discovery/index.d.ts +10 -0
  135. package/dist/types/view/FlexibleCard/components/common/lozenge-action/feature-discovery/styled.d.ts +2 -0
  136. package/dist/types/view/FlexibleCard/components/common/lozenge-action/feature-discovery/types.d.ts +7 -0
  137. package/dist/types/view/FlexibleCard/components/common/lozenge-action/lozenge-action-trigger/type.d.ts +1 -0
  138. package/dist/types/view/FlexibleCard/components/common/lozenge-action/types.d.ts +2 -2
  139. package/dist/types/view/FlexibleCard/components/elements/lozenge/types.d.ts +2 -2
  140. package/dist/types/view/FlexibleCard/types.d.ts +23 -1
  141. package/dist/types-ts4.5/extractors/common/lozenge/types.d.ts +4 -1
  142. package/dist/types-ts4.5/extractors/flexible/extract-state.d.ts +2 -1
  143. package/dist/types-ts4.5/i18n/cs.d.ts +1 -0
  144. package/dist/types-ts4.5/i18n/da.d.ts +1 -0
  145. package/dist/types-ts4.5/i18n/de.d.ts +1 -0
  146. package/dist/types-ts4.5/i18n/en.d.ts +1 -0
  147. package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
  148. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
  149. package/dist/types-ts4.5/i18n/es.d.ts +1 -0
  150. package/dist/types-ts4.5/i18n/fi.d.ts +1 -0
  151. package/dist/types-ts4.5/i18n/fr.d.ts +1 -0
  152. package/dist/types-ts4.5/i18n/hu.d.ts +1 -0
  153. package/dist/types-ts4.5/i18n/it.d.ts +1 -0
  154. package/dist/types-ts4.5/i18n/ja.d.ts +1 -0
  155. package/dist/types-ts4.5/i18n/ko.d.ts +1 -0
  156. package/dist/types-ts4.5/i18n/nb.d.ts +1 -0
  157. package/dist/types-ts4.5/i18n/nl.d.ts +1 -0
  158. package/dist/types-ts4.5/i18n/pl.d.ts +1 -0
  159. package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -0
  160. package/dist/types-ts4.5/i18n/ru.d.ts +1 -0
  161. package/dist/types-ts4.5/i18n/sv.d.ts +1 -0
  162. package/dist/types-ts4.5/i18n/th.d.ts +1 -0
  163. package/dist/types-ts4.5/i18n/tr.d.ts +1 -0
  164. package/dist/types-ts4.5/i18n/uk.d.ts +1 -0
  165. package/dist/types-ts4.5/i18n/vi.d.ts +1 -0
  166. package/dist/types-ts4.5/i18n/zh.d.ts +1 -0
  167. package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -0
  168. package/dist/types-ts4.5/view/FlexibleCard/components/common/lozenge-action/feature-discovery/index.d.ts +10 -0
  169. package/dist/types-ts4.5/view/FlexibleCard/components/common/lozenge-action/feature-discovery/styled.d.ts +2 -0
  170. package/dist/types-ts4.5/view/FlexibleCard/components/common/lozenge-action/feature-discovery/types.d.ts +7 -0
  171. package/dist/types-ts4.5/view/FlexibleCard/components/common/lozenge-action/lozenge-action-trigger/type.d.ts +1 -0
  172. package/dist/types-ts4.5/view/FlexibleCard/components/common/lozenge-action/types.d.ts +2 -2
  173. package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/types.d.ts +2 -2
  174. package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +23 -1
  175. package/package.json +6 -5
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.5.1",
3
+ "version": "26.5.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,42 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { useEffect, useMemo } from 'react';
4
+ import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
5
+ import { getPulseStyles } from './styled';
6
+ var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
7
+ var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-status';
8
+ var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
9
+
10
+ /**
11
+ * This is a hacky solution to help with the feature discovery.
12
+ * This implementation must be removed once the experiment is completed.
13
+ * Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
14
+ * @see https://team.atlassian.com/project/ATLAS-13099/about
15
+ */
16
+ var FeatureDiscovery = function FeatureDiscovery(_ref) {
17
+ var appearance = _ref.appearance,
18
+ children = _ref.children,
19
+ testId = _ref.testId;
20
+ var storageClient = useMemo(function () {
21
+ return new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
22
+ }, []);
23
+ var discovered = useMemo(function () {
24
+ var _storageClient$getIte;
25
+ return (_storageClient$getIte = storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY)) !== null && _storageClient$getIte !== void 0 ? _storageClient$getIte : false;
26
+ }, [storageClient]);
27
+ useEffect(function () {
28
+ if (!discovered) {
29
+ storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, true, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
30
+ }
31
+ }, [storageClient, discovered]);
32
+ var component = useMemo(function () {
33
+ if (!discovered) {
34
+ return jsx("span", {
35
+ css: getPulseStyles(appearance),
36
+ "data-testid": "".concat(testId, "-discovery")
37
+ }, children);
38
+ }
39
+ }, [appearance, children, discovered, testId]);
40
+ return component !== null && component !== void 0 ? component : children;
41
+ };
42
+ export default FeatureDiscovery;
@@ -0,0 +1,24 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2;
3
+ import { css, keyframes } from '@emotion/react';
4
+ var pulseKeyframes = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n to {\n box-shadow: 0 0 0 7px rgba(0, 0, 0, 0);\n }\n"])));
5
+ var getPulseColor = function getPulseColor(appearance) {
6
+ switch (appearance) {
7
+ case 'inprogress':
8
+ return "var(--ds-background-information-bold, #0052CC)";
9
+ case 'moved':
10
+ return "var(--ds-background-warning-bold, #FFAB00)";
11
+ case 'new':
12
+ return "var(--ds-background-discovery-bold, #5243AA)";
13
+ case 'removed':
14
+ return "var(--ds-background-danger-bold, #DE350B)";
15
+ case 'success':
16
+ return "var(--ds-background-success-bold, #00875A)";
17
+ case 'default':
18
+ default:
19
+ return "var(--ds-background-neutral-bold, #42526E)";
20
+ }
21
+ };
22
+ export var getPulseStyles = function getPulseStyles(appearance) {
23
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-flex;\n border-radius: 3px;\n box-shadow: 0 0 0 0 ", ";\n animation: ", " 1.45s cubic-bezier(0.5, 0, 0, 1) 3;\n"])), getPulseColor(appearance), pulseKeyframes);
24
+ };
@@ -140,10 +140,11 @@ var LozengeAction = function LozengeAction(_ref) {
140
140
  var trigger = useCallback(function (props) {
141
141
  return jsx(LozengeActionTrigger, _extends({}, props, {
142
142
  appearance: selected.appearance,
143
+ showFeatureDiscovery: action === null || action === void 0 ? void 0 : action.showFeatureDiscovery,
143
144
  testId: testId,
144
145
  text: selected.text
145
146
  }));
146
- }, [testId, selected]);
147
+ }, [selected.appearance, selected.text, action === null || action === void 0 ? void 0 : action.showFeatureDiscovery, testId]);
147
148
  var handleItemClick = useCallback( /*#__PURE__*/function () {
148
149
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, text, appearance) {
149
150
  var updateAction, request;
@@ -1,15 +1,17 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["appearance", "testId", "text", "triggerRef"];
4
+ var _excluded = ["appearance", "showFeatureDiscovery", "testId", "text", "triggerRef"];
5
5
  /** @jsx jsx */
6
6
  import { jsx } from '@emotion/react';
7
- import { useCallback, useState } from 'react';
7
+ import { useCallback, useMemo, useState } from 'react';
8
8
  import Lozenge from '@atlaskit/lozenge';
9
9
  import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
10
10
  import { triggerButtonStyles, triggerLozengeStyles } from '../styled';
11
+ import FeatureDiscovery from '../feature-discovery';
11
12
  var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
12
13
  var appearance = _ref.appearance,
14
+ showFeatureDiscovery = _ref.showFeatureDiscovery,
13
15
  testId = _ref.testId,
14
16
  text = _ref.text,
15
17
  triggerRef = _ref.triggerRef,
@@ -24,6 +26,17 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
24
26
  var onMouseLeave = useCallback(function () {
25
27
  return setIsBold(false);
26
28
  }, []);
29
+ var lozenge = useMemo(function () {
30
+ return jsx(Lozenge, {
31
+ appearance: appearance,
32
+ isBold: isBold
33
+ }, jsx("span", {
34
+ css: triggerLozengeStyles
35
+ }, jsx("span", null, text), jsx(ChevronDownIcon, {
36
+ label: "options",
37
+ size: "medium"
38
+ })));
39
+ }, [appearance, isBold, text]);
27
40
  return jsx("button", _extends({
28
41
  type: "button"
29
42
  }, props, {
@@ -32,14 +45,9 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
32
45
  onMouseEnter: onMouseEnter,
33
46
  onMouseLeave: onMouseLeave,
34
47
  ref: triggerRef
35
- }), jsx(Lozenge, {
48
+ }), showFeatureDiscovery ? jsx(FeatureDiscovery, {
36
49
  appearance: appearance,
37
- isBold: isBold
38
- }, jsx("span", {
39
- css: triggerLozengeStyles
40
- }, jsx("span", null, text), jsx(ChevronDownIcon, {
41
- label: "options",
42
- size: "medium"
43
- }))));
50
+ testId: testId
51
+ }, lozenge) : lozenge);
44
52
  };
45
53
  export default LozengeActionTrigger;
@@ -177,8 +177,12 @@ var Container = function Container(_ref3) {
177
177
  url: context === null || context === void 0 ? void 0 : context.url,
178
178
  canOpen: hoverCardCanOpen,
179
179
  closeOnChildClick: true,
180
- hidePreviewButton: hideHoverCardPreviewButton,
181
- showServerActions: showServerActions
180
+ hidePreviewButton: hideHoverCardPreviewButton
181
+ // EDM-6709 extends the internal prop for showServerActions type to be
182
+ // an object. If we decide to use expose the type for hover preview
183
+ // remove the Boolean() conversion here.
184
+ ,
185
+ showServerActions: Boolean(showServerActions)
182
186
  }, containerContent);
183
187
  }
184
188
  return containerContent;
@@ -22,6 +22,7 @@ import { messages } from '../../../messages';
22
22
  import { useSmartCardActions } from '../../../state/actions';
23
23
  import { fireLinkClickedEvent } from '../../../utils/analytics/click';
24
24
  import { useSmartCardState } from '../../../state/store';
25
+ import { useFeatureFlag } from '@atlaskit/link-provider';
25
26
  export var hoverCardClassName = 'smart-links-hover-preview';
26
27
  export var getOpenAction = function getOpenAction(url, analytics, onActionClick) {
27
28
  return {
@@ -91,6 +92,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
91
92
  onMouseEnter = _ref.onMouseEnter,
92
93
  onMouseLeave = _ref.onMouseLeave,
93
94
  showServerActions = _ref.showServerActions;
95
+ var useLozengeAction = useFeatureFlag('useLozengeAction');
94
96
  var _useAnalyticsEvents = useAnalyticsEvents(),
95
97
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
96
98
  var defaultAnalytics = useSmartLinkAnalytics(url, undefined, id);
@@ -170,7 +172,9 @@ var HoverCardContent = function HoverCardContent(_ref) {
170
172
  onClick: onClick,
171
173
  onResolve: onResolve,
172
174
  renderers: renderers,
173
- showServerActions: showServerActions,
175
+ showServerActions: useLozengeAction === 'experiment' || showServerActions ? {
176
+ showStateActionFeatureDiscovery: true
177
+ } : false,
174
178
  ui: flexibleUiOptions,
175
179
  url: url,
176
180
  children: {},
@@ -1,7 +1,10 @@
1
1
  import { InvokeActions } from '../../../state/hooks/use-invoke/types';
2
2
  export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
3
+ export type LinkLozengeInvokeActions = InvokeActions & {
4
+ showFeatureDiscovery?: boolean;
5
+ };
3
6
  export interface LinkLozenge {
4
- action?: InvokeActions;
7
+ action?: LinkLozengeInvokeActions;
5
8
  text: string;
6
9
  appearance?: LinkLozengeColor;
7
10
  }
@@ -1,4 +1,5 @@
1
1
  import type { JsonLd } from 'json-ld-types';
2
2
  import type { LinkLozenge } from '../common/lozenge/types';
3
- declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => LinkLozenge | undefined;
3
+ import { ServerActionOptions } from '../../view/FlexibleCard/types';
4
+ declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => LinkLozenge | undefined;
4
5
  export default extractState;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import type { FeatureDiscoveryProps } from './types';
3
+ /**
4
+ * This is a hacky solution to help with the feature discovery.
5
+ * This implementation must be removed once the experiment is completed.
6
+ * Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
7
+ * @see https://team.atlassian.com/project/ATLAS-13099/about
8
+ */
9
+ declare const FeatureDiscovery: FC<FeatureDiscoveryProps>;
10
+ export default FeatureDiscovery;
@@ -0,0 +1,2 @@
1
+ import type { ThemeAppearance } from '@atlaskit/lozenge';
2
+ export declare const getPulseStyles: (appearance?: ThemeAppearance) => import("@emotion/react").SerializedStyles;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ThemeAppearance } from '@atlaskit/lozenge';
3
+ export type FeatureDiscoveryProps = {
4
+ appearance?: ThemeAppearance;
5
+ children: React.ReactElement;
6
+ testId?: string;
7
+ };
@@ -3,6 +3,7 @@ import type { ThemeAppearance } from '@atlaskit/lozenge';
3
3
  import type { CustomTriggerProps } from '@atlaskit/dropdown-menu';
4
4
  export type LozengeActionTriggerProps = {
5
5
  appearance?: ThemeAppearance;
6
+ showFeatureDiscovery?: boolean;
6
7
  testId?: string;
7
8
  text: string | React.ReactNode;
8
9
  } & CustomTriggerProps<HTMLButtonElement>;
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import type { ThemeAppearance } from '@atlaskit/lozenge';
3
- import type { InvokeActions } from '../../../../../state/hooks/use-invoke/types';
3
+ import type { LinkLozengeInvokeActions } from '../../../../../extractors/common/lozenge/types';
4
4
  export type LozengeItem = {
5
5
  appearance?: ThemeAppearance;
6
6
  id: string;
7
7
  text: string;
8
8
  };
9
9
  export type LozengeActionProps = {
10
- action: InvokeActions;
10
+ action: LinkLozengeInvokeActions;
11
11
  appearance?: ThemeAppearance;
12
12
  testId?: string;
13
13
  text: string | React.ReactNode;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { ElementProps } from '../types';
3
- import { InvokeActions } from '../../../../../state/hooks/use-invoke/types';
3
+ import type { LinkLozengeInvokeActions } from '../../../../../extractors/common/lozenge/types';
4
4
  export type LozengeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
5
5
  export type LozengeProps = ElementProps & {
6
6
  /**
7
7
  * Action that can be performed on the element
8
8
  */
9
- action?: InvokeActions;
9
+ action?: LinkLozengeInvokeActions;
10
10
  /**
11
11
  * Determines the appearance of the Atlaskit lozenge.
12
12
  */
@@ -60,7 +60,7 @@ export type FlexibleCardProps = {
60
60
  /**
61
61
  * Determines whether to show available server actions.
62
62
  */
63
- showServerActions?: boolean;
63
+ showServerActions?: boolean | ServerActionOptions;
64
64
  /**
65
65
  * A `testId` prop is provided for specified elements, which is a unique
66
66
  * string that appears as a data attribute `data-testid` in the rendered code,
@@ -120,6 +120,28 @@ export type FlexibleUiOptions = {
120
120
  */
121
121
  zIndex?: number;
122
122
  };
123
+ /**
124
+ * Server action options to control action behaviour.
125
+ *
126
+ * If the type is applied to exported component (<Card />, <HoverCard />)
127
+ * please verify with the team if the deprecated prop can be removed prior.
128
+ *
129
+ * In the case that it is being exposed in HoverCard, please remove
130
+ * boolean conversion `Boolean(showServerActions)` in
131
+ * /src/view/FlexibleCard/components/container/index.tsx line 287
132
+ * @internal
133
+ */
134
+ export type ServerActionOptions = {
135
+ /**
136
+ * DO NOT USE: This prop is part of an experiment. It will be removed once
137
+ * the experiment is completed. To be cleaned up on
138
+ * https://product-fabric.atlassian.net/browse/EDM-5795
139
+ * @see https://team.atlassian.com/project/ATLAS-13099/about
140
+ * @internal
141
+ * @deprecated
142
+ */
143
+ showStateActionFeatureDiscovery?: boolean;
144
+ };
123
145
  /**
124
146
  * Retry options used if Smart Link resolves to an errored state.
125
147
  */
@@ -1,7 +1,10 @@
1
1
  import { InvokeActions } from '../../../state/hooks/use-invoke/types';
2
2
  export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
3
+ export type LinkLozengeInvokeActions = InvokeActions & {
4
+ showFeatureDiscovery?: boolean;
5
+ };
3
6
  export interface LinkLozenge {
4
- action?: InvokeActions;
7
+ action?: LinkLozengeInvokeActions;
5
8
  text: string;
6
9
  appearance?: LinkLozengeColor;
7
10
  }
@@ -1,4 +1,5 @@
1
1
  import type { JsonLd } from 'json-ld-types';
2
2
  import type { LinkLozenge } from '../common/lozenge/types';
3
- declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => LinkLozenge | undefined;
3
+ import { ServerActionOptions } from '../../view/FlexibleCard/types';
4
+ declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => LinkLozenge | undefined;
4
5
  export default extractState;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  'fabric.linking.pending_request': string;
52
52
  'fabric.linking.preview': string;
53
53
  'fabric.linking.preview_close': string;
54
+ 'fabric.linking.preview_improved': string;
54
55
  'fabric.linking.preview_max_size': string;
55
56
  'fabric.linking.preview_min_size': string;
56
57
  'fabric.linking.priority_blocker': string;