@atlaskit/smart-card 40.20.0 → 40.20.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 (43) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/hooks/useConfluencePageData.js +103 -0
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/EmbedCard/components/Frame.js +3 -1
  5. package/dist/cjs/view/EmbedCard/components/IFrame.js +31 -2
  6. package/dist/cjs/view/EmbedCard/index.js +4 -2
  7. package/dist/cjs/view/EmbedCard/views/ResolvedView.js +4 -2
  8. package/dist/cjs/view/EmbedModal/components/embed-content/index.js +6 -2
  9. package/dist/cjs/view/EmbedModal/index.js +4 -2
  10. package/dist/cjs/view/LinkUrl/index.js +1 -1
  11. package/dist/es2019/hooks/useConfluencePageData.js +96 -0
  12. package/dist/es2019/utils/analytics/analytics.js +1 -1
  13. package/dist/es2019/view/EmbedCard/components/Frame.js +3 -1
  14. package/dist/es2019/view/EmbedCard/components/IFrame.js +30 -1
  15. package/dist/es2019/view/EmbedCard/index.js +4 -2
  16. package/dist/es2019/view/EmbedCard/views/ResolvedView.js +4 -2
  17. package/dist/es2019/view/EmbedModal/components/embed-content/index.js +6 -2
  18. package/dist/es2019/view/EmbedModal/index.js +4 -2
  19. package/dist/es2019/view/LinkUrl/index.js +1 -1
  20. package/dist/esm/hooks/useConfluencePageData.js +97 -0
  21. package/dist/esm/utils/analytics/analytics.js +1 -1
  22. package/dist/esm/view/EmbedCard/components/Frame.js +3 -1
  23. package/dist/esm/view/EmbedCard/components/IFrame.js +31 -2
  24. package/dist/esm/view/EmbedCard/index.js +4 -2
  25. package/dist/esm/view/EmbedCard/views/ResolvedView.js +4 -2
  26. package/dist/esm/view/EmbedModal/components/embed-content/index.js +6 -2
  27. package/dist/esm/view/EmbedModal/index.js +4 -2
  28. package/dist/esm/view/LinkUrl/index.js +1 -1
  29. package/dist/types/hooks/useConfluencePageData.d.ts +39 -0
  30. package/dist/types/view/EmbedCard/components/Frame.d.ts +1 -0
  31. package/dist/types/view/EmbedCard/components/IFrame.d.ts +2 -1
  32. package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +2 -0
  33. package/dist/types/view/EmbedModal/components/embed-content/index.d.ts +1 -1
  34. package/dist/types/view/EmbedModal/components/embed-content/types.d.ts +1 -0
  35. package/dist/types/view/EmbedModal/types.d.ts +1 -0
  36. package/dist/types-ts4.5/hooks/useConfluencePageData.d.ts +39 -0
  37. package/dist/types-ts4.5/view/EmbedCard/components/Frame.d.ts +1 -0
  38. package/dist/types-ts4.5/view/EmbedCard/components/IFrame.d.ts +2 -1
  39. package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +2 -0
  40. package/dist/types-ts4.5/view/EmbedModal/components/embed-content/index.d.ts +1 -1
  41. package/dist/types-ts4.5/view/EmbedModal/components/embed-content/types.d.ts +1 -0
  42. package/dist/types-ts4.5/view/EmbedModal/types.d.ts +1 -0
  43. package/package.json +10 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 40.20.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3f4271f8a0790`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3f4271f8a0790) -
8
+ Replace LP-CC-EMBED iframe with embedded confluence iframe
9
+
10
+ ## 40.20.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 40.20.0
4
17
 
5
18
  ### Minor Changes
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.userType = exports.useConfluencePageData = exports.EMBEDDED_CONFLUENCE_MODE = exports.CONFLUENCE_EXTENSION_KEYS = void 0;
7
+ var _react = require("react");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
+ var _tokens = require("@atlaskit/tokens");
10
+ var userType = exports.userType = /*#__PURE__*/function (userType) {
11
+ userType["ATLASSIAN_ACCOUNT"] = "atlassianAccount";
12
+ userType["HASHED_EMAIL"] = "hashedEmail";
13
+ userType["LOOM"] = "loom";
14
+ userType["TRELLO"] = "trello";
15
+ userType["OPSGENIE"] = "opsgenie";
16
+ userType["JA_USER_ID"] = "jiraAlign";
17
+ userType["HALP"] = "halp";
18
+ return userType;
19
+ }({});
20
+ var EMBEDDED_CONFLUENCE_MODE = exports.EMBEDDED_CONFLUENCE_MODE = /*#__PURE__*/function (EMBEDDED_CONFLUENCE_MODE) {
21
+ EMBEDDED_CONFLUENCE_MODE["VIEW_MODE"] = "view";
22
+ EMBEDDED_CONFLUENCE_MODE["EDIT_MODE"] = "edit";
23
+ return EMBEDDED_CONFLUENCE_MODE;
24
+ }({});
25
+ var CONFLUENCE_EXTENSION_KEYS = exports.CONFLUENCE_EXTENSION_KEYS = /*#__PURE__*/function (CONFLUENCE_EXTENSION_KEYS) {
26
+ CONFLUENCE_EXTENSION_KEYS["PAGE"] = "integration-confluence-object-provider";
27
+ CONFLUENCE_EXTENSION_KEYS["CANVAS"] = "canvas-native-object-provider";
28
+ return CONFLUENCE_EXTENSION_KEYS;
29
+ }({});
30
+ var useConfluencePageData = exports.useConfluencePageData = function useConfluencePageData(url, extensionKey) {
31
+ var parsedData = (0, _react.useMemo)(function () {
32
+ if (!(0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed')) {
33
+ return undefined;
34
+ }
35
+ if (!url || typeof url !== 'string' || !url.startsWith('http://') && !url.startsWith('https://') || !extensionKey || !Object.values(CONFLUENCE_EXTENSION_KEYS).find(function (key) {
36
+ return key === extensionKey;
37
+ })) {
38
+ return undefined;
39
+ }
40
+ var urlObj;
41
+ try {
42
+ urlObj = new URL(url);
43
+ } catch (_unused) {
44
+ return undefined;
45
+ }
46
+ var _urlObj = urlObj,
47
+ searchParams = _urlObj.searchParams,
48
+ hash = _urlObj.hash;
49
+ var hostname = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('hostname')) || '';
50
+ var contentId = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('contentId')) || '';
51
+ var spaceKey = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('spaceKey')) || '';
52
+
53
+ // Early return for invalid URLs
54
+ if (!contentId || !hostname) {
55
+ return undefined;
56
+ }
57
+ var themeState = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('themeState')) || '';
58
+ var themeMode = searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('themeMode');
59
+ var enableInlineComments = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('enableInlineComments')) === 'true';
60
+ var enablePageComments = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('enablePageComments')) === 'true';
61
+ var userId = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('userId')) || '';
62
+ var userIdType = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('userInfo')) || undefined;
63
+ var parentProduct = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('parentProduct')) || '';
64
+ var inlineComments = enableInlineComments ? ['inline-comments'] : [];
65
+ var pageComments = enablePageComments ? ['page-comments'] : [];
66
+
67
+ // Calculate theme state object here
68
+ var calculatedThemeStateObject;
69
+ if (themeState) {
70
+ calculatedThemeStateObject = (0, _tokens.themeStringToObject)(decodeURIComponent(themeState));
71
+ } else if (themeMode) {
72
+ calculatedThemeStateObject = {
73
+ colorMode: themeMode
74
+ };
75
+ }
76
+ return {
77
+ hostname: hostname,
78
+ spaceKey: spaceKey,
79
+ contentId: contentId,
80
+ parentProduct: parentProduct,
81
+ userId: userId,
82
+ userIdType: userIdType,
83
+ hash: hash || '',
84
+ enableInlineComments: enableInlineComments,
85
+ enablePageComments: enablePageComments,
86
+ themeStateObject: calculatedThemeStateObject,
87
+ allowedFeatures: {
88
+ edit: ['delete-draft'],
89
+ view: ['byline-contributors', 'byline-extensions', 'page-reactions'].concat(pageComments, inlineComments)
90
+ },
91
+ mode: EMBEDDED_CONFLUENCE_MODE.VIEW_MODE,
92
+ locale: 'en'
93
+ };
94
+ }, [url, extensionKey]);
95
+
96
+ // Handle theme side effect - only when theme object changes
97
+ (0, _react.useEffect)(function () {
98
+ if (parsedData !== null && parsedData !== void 0 && parsedData.themeStateObject) {
99
+ (0, _tokens.setGlobalTheme)(parsedData.themeStateObject);
100
+ }
101
+ }, [parsedData === null || parsedData === void 0 ? void 0 : parsedData.themeStateObject]);
102
+ return parsedData;
103
+ };
@@ -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: "40.19.1"
14
+ packageVersion: "40.20.1"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -35,7 +35,8 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
35
35
  testId = _ref.testId,
36
36
  onIframeDwell = _ref.onIframeDwell,
37
37
  onIframeFocus = _ref.onIframeFocus,
38
- title = _ref.title;
38
+ title = _ref.title,
39
+ extensionKey = _ref.extensionKey;
39
40
  var _useState = (0, _react.useState)(false),
40
41
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
41
42
  isIframeLoaded = _useState2[0],
@@ -124,6 +125,7 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
124
125
  },
125
126
  sandbox: (0, _utils.getIframeSandboxAttribute)(isTrusted),
126
127
  title: title,
128
+ extensionKey: extensionKey,
127
129
  className: (0, _runtime.ax)(["_19itidpf _1reo15vq _18m915vq _2rkofajl _154iidpf _1ltvidpf _1bsb1osq _4t3i1osq _kqswh2mm"])
128
130
  }));
129
131
  });
@@ -8,16 +8,45 @@ exports.IFrame = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
- var _excluded = ["childRef", "className"];
11
+ var _embeddedConfluence = require("@atlaskit/embedded-confluence");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
+ var _useConfluencePageData = require("../../../hooks/useConfluencePageData");
14
+ var _excluded = ["childRef", "className", "extensionKey"];
12
15
  /**
13
16
  * Iframe element isolated for DI purposes
14
17
  */
15
18
  var IFrame = exports.IFrame = function IFrame(_ref) {
16
19
  var childRef = _ref.childRef,
17
20
  className = _ref.className,
21
+ extensionKey = _ref.extensionKey,
18
22
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
23
+ var confluencePageData = (0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed') ?
24
+ // eslint-disable-next-line react-hooks/rules-of-hooks
25
+ (0, _useConfluencePageData.useConfluencePageData)(props.src || '', extensionKey || '') : undefined;
26
+
27
+ // Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
28
+ return confluencePageData && (0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed') ? /*#__PURE__*/_react.default.createElement(_embeddedConfluence.Page, {
29
+ hostname: confluencePageData.hostname,
30
+ spaceKey: confluencePageData.spaceKey,
31
+ contentId: confluencePageData.contentId,
32
+ parentProduct: confluencePageData.parentProduct
33
+ // @ts-expect-error - TODO userId is not a valid prop for the Page component, need to look into this, why did they do this in POC PR
34
+ ,
35
+ userId: confluencePageData.userId,
36
+ userIdType: confluencePageData.userIdType,
37
+ hash: confluencePageData.hash,
38
+ enableInlineComments: confluencePageData.enableInlineComments,
39
+ enablePageComments: confluencePageData.enablePageComments,
40
+ themeStateObject: confluencePageData.themeStateObject,
41
+ allowedFeatures: confluencePageData.allowedFeatures,
42
+ mode: confluencePageData.mode,
43
+ locale: confluencePageData.locale,
44
+ viewComponent: _embeddedConfluence.ViewPage,
45
+ editComponent: _embeddedConfluence.EditPage
46
+ }) :
47
+ /*#__PURE__*/
19
48
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
20
- return /*#__PURE__*/_react.default.createElement("iframe", (0, _extends2.default)({
49
+ _react.default.createElement("iframe", (0, _extends2.default)({
21
50
  className: className
22
51
  }, props, {
23
52
  ref: childRef,
@@ -112,7 +112,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
112
112
  onIframeFocus: onIframeFocus,
113
113
  testId: testId,
114
114
  CompetitorPrompt: CompetitorPrompt,
115
- hideIconLoadingSkeleton: hideIconLoadingSkeleton
115
+ hideIconLoadingSkeleton: hideIconLoadingSkeleton,
116
+ extensionKey: extensionKey
116
117
  }));
117
118
  } else {
118
119
  if (platform === 'mobile') {
@@ -170,7 +171,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
170
171
  isSelected: isSelected,
171
172
  inheritDimensions: inheritDimensions,
172
173
  onClick: handleFrameClick,
173
- ref: iframeRef
174
+ ref: iframeRef,
175
+ extensionKey: extensionKey
174
176
  }));
175
177
  }
176
178
  var forbiddenAccessContext = (0, _extractAccessContext.extractRequestAccessContextImproved)({
@@ -31,7 +31,8 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
31
31
  isSupportTheming = _ref.isSupportTheming,
32
32
  type = _ref.type,
33
33
  CompetitorPrompt = _ref.CompetitorPrompt,
34
- hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton;
34
+ hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton,
35
+ extensionKey = _ref.extensionKey;
35
36
  var iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
36
37
  var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
37
38
  var text = title || (context === null || context === void 0 ? void 0 : context.text);
@@ -84,6 +85,7 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
84
85
  ref: embedIframeRef,
85
86
  onIframeDwell: onIframeDwell,
86
87
  onIframeFocus: onIframeFocus,
87
- title: text
88
+ title: text,
89
+ extensionKey: extensionKey
88
90
  }));
89
91
  });
@@ -12,6 +12,7 @@ var React = _interopRequireWildcard(require("react"));
12
12
  var _runtime = require("@compiled/react/runtime");
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
14
  var _reactMagneticDi = require("react-magnetic-di");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _utils = require("../../../../utils");
16
17
  var _IFrame = require("../../../EmbedCard/components/IFrame");
17
18
  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); }
@@ -21,7 +22,8 @@ var EmbedContent = function EmbedContent(_ref) {
21
22
  name = _ref.name,
22
23
  src = _ref.src,
23
24
  testId = _ref.testId,
24
- ariaLabel = _ref.ariaLabel;
25
+ ariaLabel = _ref.ariaLabel,
26
+ extensionKey = _ref.extensionKey;
25
27
  var sandbox = (0, _utils.getIframeSandboxAttribute)(isTrusted);
26
28
  var props = {
27
29
  frameBorder: 0,
@@ -32,7 +34,9 @@ var EmbedContent = function EmbedContent(_ref) {
32
34
  };
33
35
  return /*#__PURE__*/React.createElement(_IFrame.IFrame, (0, _extends2.default)({
34
36
  "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed")
35
- }, props, {
37
+ }, (0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed') ? {
38
+ extensionKey: extensionKey
39
+ } : {}, props, {
36
40
  className: (0, _runtime.ax)(["_1bsb1osq _4t3i815d"])
37
41
  }));
38
42
  };
@@ -47,7 +47,8 @@ var EmbedModal = function EmbedModal(_ref) {
47
47
  _ref$testId = _ref.testId,
48
48
  testId = _ref$testId === void 0 ? 'smart-embed-preview-modal' : _ref$testId,
49
49
  title = _ref.title,
50
- invokeViewAction = _ref.invokeViewAction;
50
+ invokeViewAction = _ref.invokeViewAction,
51
+ extensionKey = _ref.extensionKey;
51
52
  var defaultWidth = toWidth(size);
52
53
  var _useState = (0, _react.useState)(showModal),
53
54
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -128,7 +129,8 @@ var EmbedModal = function EmbedModal(_ref) {
128
129
  name: iframeName,
129
130
  src: previewUrl,
130
131
  testId: testId,
131
- ariaLabel: title
132
+ ariaLabel: title,
133
+ extensionKey: extensionKey
132
134
  }))));
133
135
  };
134
136
  var _default = exports.default = (0, _analytics.default)((0, _errorBoundary.default)(EmbedModal));
@@ -21,7 +21,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
21
21
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
22
22
  var PACKAGE_DATA = {
23
23
  packageName: "@atlaskit/smart-card",
24
- packageVersion: "40.19.1",
24
+ packageVersion: "40.20.1",
25
25
  componentName: 'linkUrl'
26
26
  };
27
27
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -0,0 +1,96 @@
1
+ import { useEffect, useMemo } from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { setGlobalTheme, themeStringToObject } from '@atlaskit/tokens';
4
+ export let userType = /*#__PURE__*/function (userType) {
5
+ userType["ATLASSIAN_ACCOUNT"] = "atlassianAccount";
6
+ userType["HASHED_EMAIL"] = "hashedEmail";
7
+ userType["LOOM"] = "loom";
8
+ userType["TRELLO"] = "trello";
9
+ userType["OPSGENIE"] = "opsgenie";
10
+ userType["JA_USER_ID"] = "jiraAlign";
11
+ userType["HALP"] = "halp";
12
+ return userType;
13
+ }({});
14
+ export let EMBEDDED_CONFLUENCE_MODE = /*#__PURE__*/function (EMBEDDED_CONFLUENCE_MODE) {
15
+ EMBEDDED_CONFLUENCE_MODE["VIEW_MODE"] = "view";
16
+ EMBEDDED_CONFLUENCE_MODE["EDIT_MODE"] = "edit";
17
+ return EMBEDDED_CONFLUENCE_MODE;
18
+ }({});
19
+ export let CONFLUENCE_EXTENSION_KEYS = /*#__PURE__*/function (CONFLUENCE_EXTENSION_KEYS) {
20
+ CONFLUENCE_EXTENSION_KEYS["PAGE"] = "integration-confluence-object-provider";
21
+ CONFLUENCE_EXTENSION_KEYS["CANVAS"] = "canvas-native-object-provider";
22
+ return CONFLUENCE_EXTENSION_KEYS;
23
+ }({});
24
+ export const useConfluencePageData = (url, extensionKey) => {
25
+ const parsedData = useMemo(() => {
26
+ if (!fg('platform_deprecate_lp_cc_embed')) {
27
+ return undefined;
28
+ }
29
+ if (!url || typeof url !== 'string' || !url.startsWith('http://') && !url.startsWith('https://') || !extensionKey || !Object.values(CONFLUENCE_EXTENSION_KEYS).find(key => key === extensionKey)) {
30
+ return undefined;
31
+ }
32
+ let urlObj;
33
+ try {
34
+ urlObj = new URL(url);
35
+ } catch {
36
+ return undefined;
37
+ }
38
+ const {
39
+ searchParams,
40
+ hash
41
+ } = urlObj;
42
+ const hostname = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('hostname')) || '';
43
+ const contentId = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('contentId')) || '';
44
+ const spaceKey = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('spaceKey')) || '';
45
+
46
+ // Early return for invalid URLs
47
+ if (!contentId || !hostname) {
48
+ return undefined;
49
+ }
50
+ const themeState = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('themeState')) || '';
51
+ const themeMode = searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('themeMode');
52
+ const enableInlineComments = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('enableInlineComments')) === 'true';
53
+ const enablePageComments = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('enablePageComments')) === 'true';
54
+ const userId = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('userId')) || '';
55
+ const userIdType = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('userInfo')) || undefined;
56
+ const parentProduct = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('parentProduct')) || '';
57
+ const inlineComments = enableInlineComments ? ['inline-comments'] : [];
58
+ const pageComments = enablePageComments ? ['page-comments'] : [];
59
+
60
+ // Calculate theme state object here
61
+ let calculatedThemeStateObject;
62
+ if (themeState) {
63
+ calculatedThemeStateObject = themeStringToObject(decodeURIComponent(themeState));
64
+ } else if (themeMode) {
65
+ calculatedThemeStateObject = {
66
+ colorMode: themeMode
67
+ };
68
+ }
69
+ return {
70
+ hostname,
71
+ spaceKey,
72
+ contentId,
73
+ parentProduct,
74
+ userId,
75
+ userIdType,
76
+ hash: hash || '',
77
+ enableInlineComments,
78
+ enablePageComments,
79
+ themeStateObject: calculatedThemeStateObject,
80
+ allowedFeatures: {
81
+ edit: ['delete-draft'],
82
+ view: ['byline-contributors', 'byline-extensions', 'page-reactions', ...pageComments, ...inlineComments]
83
+ },
84
+ mode: EMBEDDED_CONFLUENCE_MODE.VIEW_MODE,
85
+ locale: 'en'
86
+ };
87
+ }, [url, extensionKey]);
88
+
89
+ // Handle theme side effect - only when theme object changes
90
+ useEffect(() => {
91
+ if (parsedData !== null && parsedData !== void 0 && parsedData.themeStateObject) {
92
+ setGlobalTheme(parsedData.themeStateObject);
93
+ }
94
+ }, [parsedData === null || parsedData === void 0 ? void 0 : parsedData.themeStateObject]);
95
+ return parsedData;
96
+ };
@@ -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: "40.19.1"
5
+ packageVersion: "40.20.1"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -24,7 +24,8 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
24
24
  testId,
25
25
  onIframeDwell,
26
26
  onIframeFocus,
27
- title
27
+ title,
28
+ extensionKey
28
29
  }, iframeRef) => {
29
30
  const [isIframeLoaded, setIframeLoaded] = useState(false);
30
31
  const [isMouseOver, setMouseOver] = useState(false);
@@ -96,6 +97,7 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
96
97
  },
97
98
  sandbox: getIframeSandboxAttribute(isTrusted),
98
99
  title: title,
100
+ extensionKey: extensionKey,
99
101
  className: ax(["_19itidpf _1reo15vq _18m915vq _2rkofajl _154iidpf _1ltvidpf _1bsb1osq _4t3i1osq _kqswh2mm"])
100
102
  }));
101
103
  });
@@ -1,15 +1,44 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { EditPage, Page, ViewPage } from '@atlaskit/embedded-confluence';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { useConfluencePageData } from '../../../hooks/useConfluencePageData';
3
6
  /**
4
7
  * Iframe element isolated for DI purposes
5
8
  */
6
9
  export const IFrame = ({
7
10
  childRef,
8
11
  className,
12
+ extensionKey,
9
13
  ...props
10
14
  }) => {
15
+ const confluencePageData = fg('platform_deprecate_lp_cc_embed') ?
16
+ // eslint-disable-next-line react-hooks/rules-of-hooks
17
+ useConfluencePageData(props.src || '', extensionKey || '') : undefined;
18
+
19
+ // Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
20
+ return confluencePageData && fg('platform_deprecate_lp_cc_embed') ? /*#__PURE__*/React.createElement(Page, {
21
+ hostname: confluencePageData.hostname,
22
+ spaceKey: confluencePageData.spaceKey,
23
+ contentId: confluencePageData.contentId,
24
+ parentProduct: confluencePageData.parentProduct
25
+ // @ts-expect-error - TODO userId is not a valid prop for the Page component, need to look into this, why did they do this in POC PR
26
+ ,
27
+ userId: confluencePageData.userId,
28
+ userIdType: confluencePageData.userIdType,
29
+ hash: confluencePageData.hash,
30
+ enableInlineComments: confluencePageData.enableInlineComments,
31
+ enablePageComments: confluencePageData.enablePageComments,
32
+ themeStateObject: confluencePageData.themeStateObject,
33
+ allowedFeatures: confluencePageData.allowedFeatures,
34
+ mode: confluencePageData.mode,
35
+ locale: confluencePageData.locale,
36
+ viewComponent: ViewPage,
37
+ editComponent: EditPage
38
+ }) :
39
+ /*#__PURE__*/
11
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
12
- return /*#__PURE__*/React.createElement("iframe", _extends({
41
+ React.createElement("iframe", _extends({
13
42
  className: className
14
43
  }, props, {
15
44
  ref: childRef,
@@ -109,7 +109,8 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
109
109
  onIframeFocus: onIframeFocus,
110
110
  testId: testId,
111
111
  CompetitorPrompt: CompetitorPrompt,
112
- hideIconLoadingSkeleton: hideIconLoadingSkeleton
112
+ hideIconLoadingSkeleton: hideIconLoadingSkeleton,
113
+ extensionKey: extensionKey
113
114
  }));
114
115
  } else {
115
116
  if (platform === 'mobile') {
@@ -167,7 +168,8 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
167
168
  isSelected: isSelected,
168
169
  inheritDimensions: inheritDimensions,
169
170
  onClick: handleFrameClick,
170
- ref: iframeRef
171
+ ref: iframeRef,
172
+ extensionKey: extensionKey
171
173
  }));
172
174
  }
173
175
  const forbiddenAccessContext = extractRequestAccessContextImproved({
@@ -23,7 +23,8 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
23
23
  isSupportTheming,
24
24
  type,
25
25
  CompetitorPrompt,
26
- hideIconLoadingSkeleton
26
+ hideIconLoadingSkeleton,
27
+ extensionKey
27
28
  }, embedIframeRef) => {
28
29
  const iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
29
30
  const src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
@@ -75,6 +76,7 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
75
76
  ref: embedIframeRef,
76
77
  onIframeDwell: onIframeDwell,
77
78
  onIframeFocus: onIframeFocus,
78
- title: text
79
+ title: text,
80
+ extensionKey: extensionKey
79
81
  }));
80
82
  });
@@ -4,6 +4,7 @@ import "./index.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { di } from 'react-magnetic-di';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { getIframeSandboxAttribute } from '../../../../utils';
8
9
  import { IFrame } from '../../../EmbedCard/components/IFrame';
9
10
  const iframeCss = null;
@@ -12,7 +13,8 @@ const EmbedContent = ({
12
13
  name,
13
14
  src,
14
15
  testId,
15
- ariaLabel
16
+ ariaLabel,
17
+ extensionKey
16
18
  }) => {
17
19
  const sandbox = getIframeSandboxAttribute(isTrusted);
18
20
  const props = {
@@ -24,7 +26,9 @@ const EmbedContent = ({
24
26
  };
25
27
  return /*#__PURE__*/React.createElement(IFrame, _extends({
26
28
  "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : `${testId}-embed`
27
- }, props, {
29
+ }, fg('platform_deprecate_lp_cc_embed') ? {
30
+ extensionKey
31
+ } : {}, props, {
28
32
  className: ax(["_1bsb1osq _4t3i815d"])
29
33
  }));
30
34
  };
@@ -30,7 +30,8 @@ const EmbedModal = ({
30
30
  src,
31
31
  testId = 'smart-embed-preview-modal',
32
32
  title,
33
- invokeViewAction
33
+ invokeViewAction,
34
+ extensionKey
34
35
  }) => {
35
36
  const defaultWidth = toWidth(size);
36
37
  const [isOpen, setIsOpen] = useState(showModal);
@@ -104,7 +105,8 @@ const EmbedModal = ({
104
105
  name: iframeName,
105
106
  src: previewUrl,
106
107
  testId: testId,
107
- ariaLabel: title
108
+ ariaLabel: title,
109
+ extensionKey: extensionKey
108
110
  }))));
109
111
  };
110
112
  export default withAnalytics(withErrorBoundary(EmbedModal));
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
11
11
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
12
12
  const PACKAGE_DATA = {
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "40.19.1",
14
+ packageVersion: "40.20.1",
15
15
  componentName: 'linkUrl'
16
16
  };
17
17
  const Anchor = withLinkClickedEvent('a');
@@ -0,0 +1,97 @@
1
+ import { useEffect, useMemo } from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { setGlobalTheme, themeStringToObject } from '@atlaskit/tokens';
4
+ export var userType = /*#__PURE__*/function (userType) {
5
+ userType["ATLASSIAN_ACCOUNT"] = "atlassianAccount";
6
+ userType["HASHED_EMAIL"] = "hashedEmail";
7
+ userType["LOOM"] = "loom";
8
+ userType["TRELLO"] = "trello";
9
+ userType["OPSGENIE"] = "opsgenie";
10
+ userType["JA_USER_ID"] = "jiraAlign";
11
+ userType["HALP"] = "halp";
12
+ return userType;
13
+ }({});
14
+ export var EMBEDDED_CONFLUENCE_MODE = /*#__PURE__*/function (EMBEDDED_CONFLUENCE_MODE) {
15
+ EMBEDDED_CONFLUENCE_MODE["VIEW_MODE"] = "view";
16
+ EMBEDDED_CONFLUENCE_MODE["EDIT_MODE"] = "edit";
17
+ return EMBEDDED_CONFLUENCE_MODE;
18
+ }({});
19
+ export var CONFLUENCE_EXTENSION_KEYS = /*#__PURE__*/function (CONFLUENCE_EXTENSION_KEYS) {
20
+ CONFLUENCE_EXTENSION_KEYS["PAGE"] = "integration-confluence-object-provider";
21
+ CONFLUENCE_EXTENSION_KEYS["CANVAS"] = "canvas-native-object-provider";
22
+ return CONFLUENCE_EXTENSION_KEYS;
23
+ }({});
24
+ export var useConfluencePageData = function useConfluencePageData(url, extensionKey) {
25
+ var parsedData = useMemo(function () {
26
+ if (!fg('platform_deprecate_lp_cc_embed')) {
27
+ return undefined;
28
+ }
29
+ if (!url || typeof url !== 'string' || !url.startsWith('http://') && !url.startsWith('https://') || !extensionKey || !Object.values(CONFLUENCE_EXTENSION_KEYS).find(function (key) {
30
+ return key === extensionKey;
31
+ })) {
32
+ return undefined;
33
+ }
34
+ var urlObj;
35
+ try {
36
+ urlObj = new URL(url);
37
+ } catch (_unused) {
38
+ return undefined;
39
+ }
40
+ var _urlObj = urlObj,
41
+ searchParams = _urlObj.searchParams,
42
+ hash = _urlObj.hash;
43
+ var hostname = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('hostname')) || '';
44
+ var contentId = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('contentId')) || '';
45
+ var spaceKey = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('spaceKey')) || '';
46
+
47
+ // Early return for invalid URLs
48
+ if (!contentId || !hostname) {
49
+ return undefined;
50
+ }
51
+ var themeState = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('themeState')) || '';
52
+ var themeMode = searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('themeMode');
53
+ var enableInlineComments = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('enableInlineComments')) === 'true';
54
+ var enablePageComments = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('enablePageComments')) === 'true';
55
+ var userId = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('userId')) || '';
56
+ var userIdType = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('userInfo')) || undefined;
57
+ var parentProduct = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('parentProduct')) || '';
58
+ var inlineComments = enableInlineComments ? ['inline-comments'] : [];
59
+ var pageComments = enablePageComments ? ['page-comments'] : [];
60
+
61
+ // Calculate theme state object here
62
+ var calculatedThemeStateObject;
63
+ if (themeState) {
64
+ calculatedThemeStateObject = themeStringToObject(decodeURIComponent(themeState));
65
+ } else if (themeMode) {
66
+ calculatedThemeStateObject = {
67
+ colorMode: themeMode
68
+ };
69
+ }
70
+ return {
71
+ hostname: hostname,
72
+ spaceKey: spaceKey,
73
+ contentId: contentId,
74
+ parentProduct: parentProduct,
75
+ userId: userId,
76
+ userIdType: userIdType,
77
+ hash: hash || '',
78
+ enableInlineComments: enableInlineComments,
79
+ enablePageComments: enablePageComments,
80
+ themeStateObject: calculatedThemeStateObject,
81
+ allowedFeatures: {
82
+ edit: ['delete-draft'],
83
+ view: ['byline-contributors', 'byline-extensions', 'page-reactions'].concat(pageComments, inlineComments)
84
+ },
85
+ mode: EMBEDDED_CONFLUENCE_MODE.VIEW_MODE,
86
+ locale: 'en'
87
+ };
88
+ }, [url, extensionKey]);
89
+
90
+ // Handle theme side effect - only when theme object changes
91
+ useEffect(function () {
92
+ if (parsedData !== null && parsedData !== void 0 && parsedData.themeStateObject) {
93
+ setGlobalTheme(parsedData.themeStateObject);
94
+ }
95
+ }, [parsedData === null || parsedData === void 0 ? void 0 : parsedData.themeStateObject]);
96
+ return parsedData;
97
+ };
@@ -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: "40.19.1"
7
+ packageVersion: "40.20.1"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -26,7 +26,8 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
26
26
  testId = _ref.testId,
27
27
  onIframeDwell = _ref.onIframeDwell,
28
28
  onIframeFocus = _ref.onIframeFocus,
29
- title = _ref.title;
29
+ title = _ref.title,
30
+ extensionKey = _ref.extensionKey;
30
31
  var _useState = useState(false),
31
32
  _useState2 = _slicedToArray(_useState, 2),
32
33
  isIframeLoaded = _useState2[0],
@@ -115,6 +116,7 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
115
116
  },
116
117
  sandbox: getIframeSandboxAttribute(isTrusted),
117
118
  title: title,
119
+ extensionKey: extensionKey,
118
120
  className: ax(["_19itidpf _1reo15vq _18m915vq _2rkofajl _154iidpf _1ltvidpf _1bsb1osq _4t3i1osq _kqswh2mm"])
119
121
  }));
120
122
  });
@@ -1,16 +1,45 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["childRef", "className"];
3
+ var _excluded = ["childRef", "className", "extensionKey"];
4
4
  import React from 'react';
5
+ import { EditPage, Page, ViewPage } from '@atlaskit/embedded-confluence';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { useConfluencePageData } from '../../../hooks/useConfluencePageData';
5
8
  /**
6
9
  * Iframe element isolated for DI purposes
7
10
  */
8
11
  export var IFrame = function IFrame(_ref) {
9
12
  var childRef = _ref.childRef,
10
13
  className = _ref.className,
14
+ extensionKey = _ref.extensionKey,
11
15
  props = _objectWithoutProperties(_ref, _excluded);
16
+ var confluencePageData = fg('platform_deprecate_lp_cc_embed') ?
17
+ // eslint-disable-next-line react-hooks/rules-of-hooks
18
+ useConfluencePageData(props.src || '', extensionKey || '') : undefined;
19
+
20
+ // Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
21
+ return confluencePageData && fg('platform_deprecate_lp_cc_embed') ? /*#__PURE__*/React.createElement(Page, {
22
+ hostname: confluencePageData.hostname,
23
+ spaceKey: confluencePageData.spaceKey,
24
+ contentId: confluencePageData.contentId,
25
+ parentProduct: confluencePageData.parentProduct
26
+ // @ts-expect-error - TODO userId is not a valid prop for the Page component, need to look into this, why did they do this in POC PR
27
+ ,
28
+ userId: confluencePageData.userId,
29
+ userIdType: confluencePageData.userIdType,
30
+ hash: confluencePageData.hash,
31
+ enableInlineComments: confluencePageData.enableInlineComments,
32
+ enablePageComments: confluencePageData.enablePageComments,
33
+ themeStateObject: confluencePageData.themeStateObject,
34
+ allowedFeatures: confluencePageData.allowedFeatures,
35
+ mode: confluencePageData.mode,
36
+ locale: confluencePageData.locale,
37
+ viewComponent: ViewPage,
38
+ editComponent: EditPage
39
+ }) :
40
+ /*#__PURE__*/
12
41
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
13
- return /*#__PURE__*/React.createElement("iframe", _extends({
42
+ React.createElement("iframe", _extends({
14
43
  className: className
15
44
  }, props, {
16
45
  ref: childRef,
@@ -104,7 +104,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref2, iframeRef)
104
104
  onIframeFocus: onIframeFocus,
105
105
  testId: testId,
106
106
  CompetitorPrompt: CompetitorPrompt,
107
- hideIconLoadingSkeleton: hideIconLoadingSkeleton
107
+ hideIconLoadingSkeleton: hideIconLoadingSkeleton,
108
+ extensionKey: extensionKey
108
109
  }));
109
110
  } else {
110
111
  if (platform === 'mobile') {
@@ -162,7 +163,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref2, iframeRef)
162
163
  isSelected: isSelected,
163
164
  inheritDimensions: inheritDimensions,
164
165
  onClick: handleFrameClick,
165
- ref: iframeRef
166
+ ref: iframeRef,
167
+ extensionKey: extensionKey
166
168
  }));
167
169
  }
168
170
  var forbiddenAccessContext = extractRequestAccessContextImproved({
@@ -24,7 +24,8 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
24
24
  isSupportTheming = _ref.isSupportTheming,
25
25
  type = _ref.type,
26
26
  CompetitorPrompt = _ref.CompetitorPrompt,
27
- hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton;
27
+ hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton,
28
+ extensionKey = _ref.extensionKey;
28
29
  var iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
29
30
  var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
30
31
  var text = title || (context === null || context === void 0 ? void 0 : context.text);
@@ -77,6 +78,7 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
77
78
  ref: embedIframeRef,
78
79
  onIframeDwell: onIframeDwell,
79
80
  onIframeFocus: onIframeFocus,
80
- title: text
81
+ title: text,
82
+ extensionKey: extensionKey
81
83
  }));
82
84
  });
@@ -4,6 +4,7 @@ import "./index.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { di } from 'react-magnetic-di';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { getIframeSandboxAttribute } from '../../../../utils';
8
9
  import { IFrame } from '../../../EmbedCard/components/IFrame';
9
10
  var iframeCss = null;
@@ -12,7 +13,8 @@ var EmbedContent = function EmbedContent(_ref) {
12
13
  name = _ref.name,
13
14
  src = _ref.src,
14
15
  testId = _ref.testId,
15
- ariaLabel = _ref.ariaLabel;
16
+ ariaLabel = _ref.ariaLabel,
17
+ extensionKey = _ref.extensionKey;
16
18
  var sandbox = getIframeSandboxAttribute(isTrusted);
17
19
  var props = {
18
20
  frameBorder: 0,
@@ -23,7 +25,9 @@ var EmbedContent = function EmbedContent(_ref) {
23
25
  };
24
26
  return /*#__PURE__*/React.createElement(IFrame, _extends({
25
27
  "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed")
26
- }, props, {
28
+ }, fg('platform_deprecate_lp_cc_embed') ? {
29
+ extensionKey: extensionKey
30
+ } : {}, props, {
27
31
  className: ax(["_1bsb1osq _4t3i815d"])
28
32
  }));
29
33
  };
@@ -38,7 +38,8 @@ var EmbedModal = function EmbedModal(_ref) {
38
38
  _ref$testId = _ref.testId,
39
39
  testId = _ref$testId === void 0 ? 'smart-embed-preview-modal' : _ref$testId,
40
40
  title = _ref.title,
41
- invokeViewAction = _ref.invokeViewAction;
41
+ invokeViewAction = _ref.invokeViewAction,
42
+ extensionKey = _ref.extensionKey;
42
43
  var defaultWidth = toWidth(size);
43
44
  var _useState = useState(showModal),
44
45
  _useState2 = _slicedToArray(_useState, 2),
@@ -119,7 +120,8 @@ var EmbedModal = function EmbedModal(_ref) {
119
120
  name: iframeName,
120
121
  src: previewUrl,
121
122
  testId: testId,
122
- ariaLabel: title
123
+ ariaLabel: title,
124
+ extensionKey: extensionKey
123
125
  }))));
124
126
  };
125
127
  export default withAnalytics(withErrorBoundary(EmbedModal));
@@ -14,7 +14,7 @@ import LinkWarningModal from './LinkWarningModal';
14
14
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
15
15
  var PACKAGE_DATA = {
16
16
  packageName: "@atlaskit/smart-card",
17
- packageVersion: "40.19.1",
17
+ packageVersion: "40.20.1",
18
18
  componentName: 'linkUrl'
19
19
  };
20
20
  var Anchor = withLinkClickedEvent('a');
@@ -0,0 +1,39 @@
1
+ export declare enum userType {
2
+ ATLASSIAN_ACCOUNT = "atlassianAccount",
3
+ HASHED_EMAIL = "hashedEmail",
4
+ LOOM = "loom",
5
+ TRELLO = "trello",
6
+ OPSGENIE = "opsgenie",
7
+ JA_USER_ID = "jiraAlign",
8
+ HALP = "halp"
9
+ }
10
+ export type PageAllowedFeatures = {
11
+ edit: string[];
12
+ view: string[];
13
+ };
14
+ export declare enum EMBEDDED_CONFLUENCE_MODE {
15
+ VIEW_MODE = "view",
16
+ EDIT_MODE = "edit"
17
+ }
18
+ export declare enum CONFLUENCE_EXTENSION_KEYS {
19
+ PAGE = "integration-confluence-object-provider",
20
+ CANVAS = "canvas-native-object-provider"
21
+ }
22
+ export declare const useConfluencePageData: (url: string, extensionKey: string) => {
23
+ hostname: string;
24
+ spaceKey: string;
25
+ contentId: string;
26
+ parentProduct: string;
27
+ userId: string;
28
+ userIdType: userType;
29
+ hash: string;
30
+ enableInlineComments: boolean;
31
+ enablePageComments: boolean;
32
+ themeStateObject: Partial<import("@atlaskit/tokens").ThemeState> | undefined;
33
+ allowedFeatures: {
34
+ edit: string[];
35
+ view: string[];
36
+ };
37
+ mode: EMBEDDED_CONFLUENCE_MODE;
38
+ locale: string;
39
+ } | undefined;
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
  export interface FrameProps {
7
+ extensionKey?: string;
7
8
  isTrusted?: boolean;
8
9
  onIframeDwell?: (dwellTime: number, dwellPercentVisible: number) => void;
9
10
  onIframeFocus?: () => void;
@@ -2,9 +2,10 @@ import React from 'react';
2
2
  interface IFrameProps {
3
3
  childRef?: React.Ref<HTMLIFrameElement>;
4
4
  className?: string;
5
+ extensionKey?: string;
5
6
  }
6
7
  /**
7
8
  * Iframe element isolated for DI purposes
8
9
  */
9
- export declare const IFrame: ({ childRef, className, ...props }: React.ComponentProps<"iframe"> & IFrameProps) => React.JSX.Element;
10
+ export declare const IFrame: ({ childRef, className, extensionKey, ...props }: React.ComponentProps<"iframe"> & IFrameProps) => React.JSX.Element;
10
11
  export {};
@@ -8,6 +8,8 @@ export interface EmbedCardResolvedViewProps {
8
8
  }>;
9
9
  /** The context view model */
10
10
  context?: ContextViewModel;
11
+ /** The extension key */
12
+ extensionKey?: string;
11
13
  /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
12
14
  frameStyle?: FrameStyle;
13
15
  /** For image icons in the title, whether to hide the loading skeleton while the image is loading. */
@@ -1,3 +1,3 @@
1
1
  import { type EmbedProps } from './types';
2
- declare const EmbedContent: ({ isTrusted, name, src, testId, ariaLabel }: EmbedProps) => JSX.Element;
2
+ declare const EmbedContent: ({ isTrusted, name, src, testId, ariaLabel, extensionKey }: EmbedProps) => JSX.Element;
3
3
  export default EmbedContent;
@@ -1,5 +1,6 @@
1
1
  export type EmbedProps = {
2
2
  ariaLabel?: string;
3
+ extensionKey?: string;
3
4
  isTrusted: boolean;
4
5
  name: string;
5
6
  src?: string;
@@ -12,6 +12,7 @@ export type EmbedModalContext = {
12
12
  size: EmbedModalSize;
13
13
  };
14
14
  export type EmbedModalProps = {
15
+ extensionKey?: string;
15
16
  fireEvent?: FireEventFunction;
16
17
  iframeName: string;
17
18
  invokeDownloadAction?: InvokeClientActionProps;
@@ -0,0 +1,39 @@
1
+ export declare enum userType {
2
+ ATLASSIAN_ACCOUNT = "atlassianAccount",
3
+ HASHED_EMAIL = "hashedEmail",
4
+ LOOM = "loom",
5
+ TRELLO = "trello",
6
+ OPSGENIE = "opsgenie",
7
+ JA_USER_ID = "jiraAlign",
8
+ HALP = "halp"
9
+ }
10
+ export type PageAllowedFeatures = {
11
+ edit: string[];
12
+ view: string[];
13
+ };
14
+ export declare enum EMBEDDED_CONFLUENCE_MODE {
15
+ VIEW_MODE = "view",
16
+ EDIT_MODE = "edit"
17
+ }
18
+ export declare enum CONFLUENCE_EXTENSION_KEYS {
19
+ PAGE = "integration-confluence-object-provider",
20
+ CANVAS = "canvas-native-object-provider"
21
+ }
22
+ export declare const useConfluencePageData: (url: string, extensionKey: string) => {
23
+ hostname: string;
24
+ spaceKey: string;
25
+ contentId: string;
26
+ parentProduct: string;
27
+ userId: string;
28
+ userIdType: userType;
29
+ hash: string;
30
+ enableInlineComments: boolean;
31
+ enablePageComments: boolean;
32
+ themeStateObject: Partial<import("@atlaskit/tokens").ThemeState> | undefined;
33
+ allowedFeatures: {
34
+ edit: string[];
35
+ view: string[];
36
+ };
37
+ mode: EMBEDDED_CONFLUENCE_MODE;
38
+ locale: string;
39
+ } | undefined;
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
  export interface FrameProps {
7
+ extensionKey?: string;
7
8
  isTrusted?: boolean;
8
9
  onIframeDwell?: (dwellTime: number, dwellPercentVisible: number) => void;
9
10
  onIframeFocus?: () => void;
@@ -2,9 +2,10 @@ import React from 'react';
2
2
  interface IFrameProps {
3
3
  childRef?: React.Ref<HTMLIFrameElement>;
4
4
  className?: string;
5
+ extensionKey?: string;
5
6
  }
6
7
  /**
7
8
  * Iframe element isolated for DI purposes
8
9
  */
9
- export declare const IFrame: ({ childRef, className, ...props }: React.ComponentProps<"iframe"> & IFrameProps) => React.JSX.Element;
10
+ export declare const IFrame: ({ childRef, className, extensionKey, ...props }: React.ComponentProps<"iframe"> & IFrameProps) => React.JSX.Element;
10
11
  export {};
@@ -8,6 +8,8 @@ export interface EmbedCardResolvedViewProps {
8
8
  }>;
9
9
  /** The context view model */
10
10
  context?: ContextViewModel;
11
+ /** The extension key */
12
+ extensionKey?: string;
11
13
  /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
12
14
  frameStyle?: FrameStyle;
13
15
  /** For image icons in the title, whether to hide the loading skeleton while the image is loading. */
@@ -1,3 +1,3 @@
1
1
  import { type EmbedProps } from './types';
2
- declare const EmbedContent: ({ isTrusted, name, src, testId, ariaLabel }: EmbedProps) => JSX.Element;
2
+ declare const EmbedContent: ({ isTrusted, name, src, testId, ariaLabel, extensionKey }: EmbedProps) => JSX.Element;
3
3
  export default EmbedContent;
@@ -1,5 +1,6 @@
1
1
  export type EmbedProps = {
2
2
  ariaLabel?: string;
3
+ extensionKey?: string;
3
4
  isTrusted: boolean;
4
5
  name: string;
5
6
  src?: string;
@@ -12,6 +12,7 @@ export type EmbedModalContext = {
12
12
  size: EmbedModalSize;
13
13
  };
14
14
  export type EmbedModalProps = {
15
+ extensionKey?: string;
15
16
  fireEvent?: FireEventFunction;
16
17
  iframeName: string;
17
18
  invokeDownloadAction?: InvokeClientActionProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "40.20.0",
3
+ "version": "40.20.2",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,10 +33,11 @@
33
33
  "@atlaskit/badge": "^18.1.0",
34
34
  "@atlaskit/button": "^23.4.0",
35
35
  "@atlaskit/checkbox": "^17.1.0",
36
- "@atlaskit/css": "^0.13.0",
36
+ "@atlaskit/css": "^0.14.0",
37
37
  "@atlaskit/dropdown-menu": "^16.3.0",
38
+ "@atlaskit/embedded-confluence": "^4.1.0",
38
39
  "@atlaskit/feature-gate-js-client": "^5.5.0",
39
- "@atlaskit/form": "^12.4.0",
40
+ "@atlaskit/form": "^12.5.0",
40
41
  "@atlaskit/frontend-utilities": "^3.1.0",
41
42
  "@atlaskit/heading": "^5.2.0",
42
43
  "@atlaskit/icon": "^28.1.0",
@@ -61,15 +62,15 @@
61
62
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
62
63
  "@atlaskit/platform-feature-flags": "^1.1.0",
63
64
  "@atlaskit/popup": "^4.3.0",
64
- "@atlaskit/primitives": "^14.13.0",
65
+ "@atlaskit/primitives": "^14.14.0",
65
66
  "@atlaskit/section-message": "^8.7.0",
66
67
  "@atlaskit/select": "^21.2.0",
67
68
  "@atlaskit/spinner": "^19.0.0",
68
69
  "@atlaskit/textarea": "^8.0.0",
69
70
  "@atlaskit/textfield": "^8.0.0",
70
71
  "@atlaskit/theme": "^20.0.0",
71
- "@atlaskit/tmp-editor-statsig": "^12.5.0",
72
- "@atlaskit/tokens": "^6.2.0",
72
+ "@atlaskit/tmp-editor-statsig": "^12.6.0",
73
+ "@atlaskit/tokens": "^6.3.0",
73
74
  "@atlaskit/tooltip": "^20.4.0",
74
75
  "@atlaskit/ufo": "^0.4.0",
75
76
  "@babel/runtime": "^7.0.0",
@@ -223,6 +224,9 @@
223
224
  "ptc-enable-embed-team-smart-links": {
224
225
  "type": "boolean"
225
226
  },
227
+ "platform_deprecate_lp_cc_embed": {
228
+ "type": "boolean"
229
+ },
226
230
  "navx-1483-a11y-close-button-in-modal-updates": {
227
231
  "type": "boolean"
228
232
  },