@atlaskit/renderer 124.1.5 → 124.1.7

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,21 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 124.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cfc5fed7dc74`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8cfc5fed7dc74) -
8
+ Cleanup annotations_defensive_node_name_calculations
9
+
10
+ ## 124.1.6
11
+
12
+ ### Patch Changes
13
+
14
+ - [`6b08c3a8cde08`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6b08c3a8cde08) -
15
+ Construct confluence url from smart card embed preview href when smart card url is short
16
+ confluence url, in the form "{host}/wiki/x/{hash}"
17
+ - Updated dependencies
18
+
3
19
  ## 124.1.5
4
20
 
5
21
  ### Patch Changes
@@ -71,6 +71,9 @@
71
71
  {
72
72
  "path": "../../../linking-platform/link-datasource/afm-cc/tsconfig.json"
73
73
  },
74
+ {
75
+ "path": "../../../linking-platform/link-extractors/afm-cc/tsconfig.json"
76
+ },
74
77
  {
75
78
  "path": "../../../media/media-card/afm-cc/tsconfig.json"
76
79
  },
@@ -71,6 +71,9 @@
71
71
  {
72
72
  "path": "../../../linking-platform/link-datasource/afm-dev-agents/tsconfig.json"
73
73
  },
74
+ {
75
+ "path": "../../../linking-platform/link-extractors/afm-dev-agents/tsconfig.json"
76
+ },
74
77
  {
75
78
  "path": "../../../media/media-card/afm-dev-agents/tsconfig.json"
76
79
  },
@@ -71,6 +71,9 @@
71
71
  {
72
72
  "path": "../../../linking-platform/link-datasource/afm-jira/tsconfig.json"
73
73
  },
74
+ {
75
+ "path": "../../../linking-platform/link-extractors/afm-jira/tsconfig.json"
76
+ },
74
77
  {
75
78
  "path": "../../../media/media-card/afm-jira/tsconfig.json"
76
79
  },
@@ -71,6 +71,9 @@
71
71
  {
72
72
  "path": "../../../linking-platform/link-datasource/afm-passionfruit/tsconfig.json"
73
73
  },
74
+ {
75
+ "path": "../../../linking-platform/link-extractors/afm-passionfruit/tsconfig.json"
76
+ },
74
77
  {
75
78
  "path": "../../../media/media-card/afm-passionfruit/tsconfig.json"
76
79
  },
@@ -71,6 +71,9 @@
71
71
  {
72
72
  "path": "../../../linking-platform/link-datasource/afm-post-office/tsconfig.json"
73
73
  },
74
+ {
75
+ "path": "../../../linking-platform/link-extractors/afm-post-office/tsconfig.json"
76
+ },
74
77
  {
75
78
  "path": "../../../media/media-card/afm-post-office/tsconfig.json"
76
79
  },
@@ -71,6 +71,9 @@
71
71
  {
72
72
  "path": "../../../linking-platform/link-datasource/afm-rovo-extension/tsconfig.json"
73
73
  },
74
+ {
75
+ "path": "../../../linking-platform/link-extractors/afm-rovo-extension/tsconfig.json"
76
+ },
74
77
  {
75
78
  "path": "../../../media/media-card/afm-rovo-extension/tsconfig.json"
76
79
  },
@@ -71,6 +71,9 @@
71
71
  {
72
72
  "path": "../../../linking-platform/link-datasource/afm-townsquare/tsconfig.json"
73
73
  },
74
+ {
75
+ "path": "../../../linking-platform/link-extractors/afm-townsquare/tsconfig.json"
76
+ },
74
77
  {
75
78
  "path": "../../../media/media-card/afm-townsquare/tsconfig.json"
76
79
  },
@@ -25,6 +25,7 @@ var _SmartCardStorage = require("../../ui/SmartCardStorage");
25
25
  var _getCardClickHandler = require("../utils/getCardClickHandler");
26
26
  var _useInlineAnnotationProps = require("../../ui/annotations/element/useInlineAnnotationProps");
27
27
  var _PortalContext = require("../../ui/Renderer/PortalContext");
28
+ var _linkExtractors = require("@atlaskit/link-extractors");
28
29
  /**
29
30
  * @jsxRuntime classic
30
31
  * @jsx jsx
@@ -105,6 +106,7 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
105
106
  showPanelButtonIcon: showPanelButtonIcon,
106
107
  onClick: function onClick(event) {
107
108
  if (isPreviewPanelAvailable) {
109
+ var _extractSmartLinkEmbe;
108
110
  // Prevent anchor default behaviour(click to open the anchor link)
109
111
  // When glance panel is available, let openPreviewPanel handle it
110
112
  event.preventDefault();
@@ -112,7 +114,10 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
112
114
  url: resolvedUrl || '',
113
115
  ari: ari || '',
114
116
  name: name || '',
115
- iconUrl: iconUrl
117
+ iconUrl: iconUrl,
118
+ panelData: {
119
+ embedUrl: (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = (0, _linkExtractors.extractSmartLinkEmbed)(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
120
+ }
116
121
  });
117
122
  (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
118
123
  exposure: true
@@ -68,7 +68,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
68
68
  // we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
69
69
  var TABLE_WIDTH_INFO_TIMEOUT = 10000;
70
70
  var packageName = "@atlaskit/renderer";
71
- var packageVersion = "124.1.4";
71
+ var packageVersion = "124.1.6";
72
72
  var setAsQueryContainerStyles = (0, _react2.css)({
73
73
  containerName: 'ak-renderer-wrapper',
74
74
  containerType: 'inline-size'
@@ -42,27 +42,13 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
42
42
  annotationManager = _useAnnotationManager2.annotationManager,
43
43
  dispatch = _useAnnotationManager2.dispatch;
44
44
  var inlineNodeTypes = (0, _react.useMemo)(function () {
45
- if ((0, _platformFeatureFlags.fg)('annotations_defensive_node_name_calculations')) {
46
- if (!actions.isRangeAnnotatable(range)) {
47
- return undefined;
48
- }
49
- return (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
50
- pos: documentPosition,
51
- actions: actions
52
- });
53
- } else {
54
- if (!(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes')) {
55
- return undefined;
56
- }
57
- if (actions.isValidAnnotationRange(range)) {
58
- return (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
59
- pos: documentPosition,
60
- actions: actions
61
- });
62
- } else {
63
- return undefined;
64
- }
45
+ if (!actions.isRangeAnnotatable(range)) {
46
+ return undefined;
65
47
  }
48
+ return (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
49
+ pos: documentPosition,
50
+ actions: actions
51
+ });
66
52
  }, [documentPosition, actions, range]);
67
53
  var onCreateCallback = (0, _react.useCallback)(function (annotationId) {
68
54
  // We want to support creation on a documentPosition if the user is only using ranges
@@ -22,6 +22,7 @@ import { withSmartCardStorage } from '../../ui/SmartCardStorage';
22
22
  import { getCardClickHandler } from '../utils/getCardClickHandler';
23
23
  import { useInlineAnnotationProps } from '../../ui/annotations/element/useInlineAnnotationProps';
24
24
  import { usePortal } from '../../ui/Renderer/PortalContext';
25
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
25
26
  const HoverLinkOverlayNoop = props => jsx(Fragment, null, props.children);
26
27
  const HoverLinkOverlayWithCondition = componentWithCondition(() => editorExperiment('platform_editor_preview_panel_linking_exp', true, {
27
28
  exposure: true
@@ -88,6 +89,7 @@ const OverlayWithCardContext = ({
88
89
  showPanelButtonIcon: showPanelButtonIcon,
89
90
  onClick: event => {
90
91
  if (isPreviewPanelAvailable) {
92
+ var _extractSmartLinkEmbe;
91
93
  // Prevent anchor default behaviour(click to open the anchor link)
92
94
  // When glance panel is available, let openPreviewPanel handle it
93
95
  event.preventDefault();
@@ -95,7 +97,10 @@ const OverlayWithCardContext = ({
95
97
  url: resolvedUrl || '',
96
98
  ari: ari || '',
97
99
  name: name || '',
98
- iconUrl
100
+ iconUrl,
101
+ panelData: {
102
+ embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
103
+ }
99
104
  });
100
105
  editorExperiment('platform_editor_preview_panel_linking_exp', true, {
101
106
  exposure: true
@@ -54,7 +54,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
54
54
  // we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
55
55
  const TABLE_WIDTH_INFO_TIMEOUT = 10000;
56
56
  const packageName = "@atlaskit/renderer";
57
- const packageVersion = "124.1.4";
57
+ const packageVersion = "124.1.6";
58
58
  const setAsQueryContainerStyles = css({
59
59
  containerName: 'ak-renderer-wrapper',
60
60
  containerType: 'inline-size'
@@ -39,27 +39,13 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
39
39
  dispatch
40
40
  } = useAnnotationManagerDispatch();
41
41
  const inlineNodeTypes = useMemo(() => {
42
- if (fg('annotations_defensive_node_name_calculations')) {
43
- if (!actions.isRangeAnnotatable(range)) {
44
- return undefined;
45
- }
46
- return getRendererRangeInlineNodeNames({
47
- pos: documentPosition,
48
- actions
49
- });
50
- } else {
51
- if (!fg('editor_inline_comments_on_inline_nodes')) {
52
- return undefined;
53
- }
54
- if (actions.isValidAnnotationRange(range)) {
55
- return getRendererRangeInlineNodeNames({
56
- pos: documentPosition,
57
- actions
58
- });
59
- } else {
60
- return undefined;
61
- }
42
+ if (!actions.isRangeAnnotatable(range)) {
43
+ return undefined;
62
44
  }
45
+ return getRendererRangeInlineNodeNames({
46
+ pos: documentPosition,
47
+ actions
48
+ });
63
49
  }, [documentPosition, actions, range]);
64
50
  const onCreateCallback = useCallback(annotationId => {
65
51
  // We want to support creation on a documentPosition if the user is only using ranges
@@ -23,6 +23,7 @@ import { withSmartCardStorage } from '../../ui/SmartCardStorage';
23
23
  import { getCardClickHandler } from '../utils/getCardClickHandler';
24
24
  import { useInlineAnnotationProps } from '../../ui/annotations/element/useInlineAnnotationProps';
25
25
  import { usePortal } from '../../ui/Renderer/PortalContext';
26
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
26
27
  var HoverLinkOverlayNoop = function HoverLinkOverlayNoop(props) {
27
28
  return jsx(Fragment, null, props.children);
28
29
  };
@@ -96,6 +97,7 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
96
97
  showPanelButtonIcon: showPanelButtonIcon,
97
98
  onClick: function onClick(event) {
98
99
  if (isPreviewPanelAvailable) {
100
+ var _extractSmartLinkEmbe;
99
101
  // Prevent anchor default behaviour(click to open the anchor link)
100
102
  // When glance panel is available, let openPreviewPanel handle it
101
103
  event.preventDefault();
@@ -103,7 +105,10 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
103
105
  url: resolvedUrl || '',
104
106
  ari: ari || '',
105
107
  name: name || '',
106
- iconUrl: iconUrl
108
+ iconUrl: iconUrl,
109
+ panelData: {
110
+ embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
111
+ }
107
112
  });
108
113
  editorExperiment('platform_editor_preview_panel_linking_exp', true, {
109
114
  exposure: true
@@ -59,7 +59,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
59
59
  // we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
60
60
  var TABLE_WIDTH_INFO_TIMEOUT = 10000;
61
61
  var packageName = "@atlaskit/renderer";
62
- var packageVersion = "124.1.4";
62
+ var packageVersion = "124.1.6";
63
63
  var setAsQueryContainerStyles = css({
64
64
  containerName: 'ak-renderer-wrapper',
65
65
  containerType: 'inline-size'
@@ -33,27 +33,13 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
33
33
  annotationManager = _useAnnotationManager2.annotationManager,
34
34
  dispatch = _useAnnotationManager2.dispatch;
35
35
  var inlineNodeTypes = useMemo(function () {
36
- if (fg('annotations_defensive_node_name_calculations')) {
37
- if (!actions.isRangeAnnotatable(range)) {
38
- return undefined;
39
- }
40
- return getRendererRangeInlineNodeNames({
41
- pos: documentPosition,
42
- actions: actions
43
- });
44
- } else {
45
- if (!fg('editor_inline_comments_on_inline_nodes')) {
46
- return undefined;
47
- }
48
- if (actions.isValidAnnotationRange(range)) {
49
- return getRendererRangeInlineNodeNames({
50
- pos: documentPosition,
51
- actions: actions
52
- });
53
- } else {
54
- return undefined;
55
- }
36
+ if (!actions.isRangeAnnotatable(range)) {
37
+ return undefined;
56
38
  }
39
+ return getRendererRangeInlineNodeNames({
40
+ pos: documentPosition,
41
+ actions: actions
42
+ });
57
43
  }, [documentPosition, actions, range]);
58
44
  var onCreateCallback = useCallback(function (annotationId) {
59
45
  // We want to support creation on a documentPosition if the user is only using ranges
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "124.1.5",
3
+ "version": "124.1.7",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,6 +42,7 @@
42
42
  "@atlaskit/icon": "^28.5.0",
43
43
  "@atlaskit/link": "^3.2.0",
44
44
  "@atlaskit/link-datasource": "^4.25.0",
45
+ "@atlaskit/link-extractors": "^2.4.0",
45
46
  "@atlaskit/media-card": "^79.5.0",
46
47
  "@atlaskit/media-client": "^35.5.0",
47
48
  "@atlaskit/media-client-react": "^4.1.0",
@@ -52,7 +53,7 @@
52
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
54
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
54
55
  "@atlaskit/react-ufo": "^4.11.0",
55
- "@atlaskit/smart-card": "^43.0.0",
56
+ "@atlaskit/smart-card": "^43.1.0",
56
57
  "@atlaskit/status": "^3.0.0",
57
58
  "@atlaskit/task-decision": "^19.2.0",
58
59
  "@atlaskit/theme": "^21.0.0",
@@ -145,9 +146,6 @@
145
146
  "platform_editor_typography_ugc": {
146
147
  "type": "boolean"
147
148
  },
148
- "annotations_defensive_node_name_calculations": {
149
- "type": "boolean"
150
- },
151
149
  "editor_inline_comments_on_inline_nodes": {
152
150
  "type": "boolean"
153
151
  },