@atlaskit/editor-plugin-card 5.4.13 → 5.4.15

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,20 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 5.4.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 5.4.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [#143317](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143317)
14
+ [`9af7f0abb556d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9af7f0abb556d) -
15
+ Add placeholder replace for SSRed element to ignore recalculation on TTVC
16
+ - Updated dependencies
17
+
3
18
  ## 5.4.13
4
19
 
5
20
  ### Patch Changes
@@ -115,6 +115,8 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
115
115
  return ((editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit' || editorAppearance === 'comment' && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1');
116
116
  }, [editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode, editorAppearance]);
117
117
  var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
118
+ var getPosFunction = typeof getPos === 'function' ? getPos : undefined;
119
+ var placeholderUniqId = (getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction()) || 0;
118
120
  return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/_react.default.createElement(_AwarenessWrapper.AwarenessWrapper, {
119
121
  isOverlayEnabled: isOverlayEnabled,
120
122
  isPulseEnabled: isPulseEnabled,
@@ -129,10 +131,11 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
129
131
  pluginInjectionApi: pluginInjectionApi,
130
132
  setOverlayHoveredStyles: setOverlayHoveredStyles,
131
133
  appearance: appearance
132
- }, innerCard) :
133
- /*#__PURE__*/
134
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
135
- _react.default.createElement("span", {
136
- className: "card"
134
+ }, innerCard) : /*#__PURE__*/_react.default.createElement("span", {
135
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
136
+ className: "card",
137
+ "data-vc": "editor-plugin-inline-card",
138
+ "data-ssr-placeholder": "editor-plugin-inline-card-".concat(placeholderUniqId),
139
+ "data-ssr-placeholder-replace": "editor-plugin-inline-card-".concat(placeholderUniqId)
137
140
  }, innerCard);
138
141
  });
@@ -101,25 +101,28 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
101
101
  return children;
102
102
  }, [shouldShowLinkOverlay, children, isSelected, isResolvedViewRendered, isInserted, isHovered, url, handleOverlayChange]);
103
103
  var isInline = appearance === 'inline';
104
+ var placeholderUniqId = linkPosition || 0;
104
105
  return (0, _react.useMemo)(function () {
105
106
  var _cardContext$value;
106
- return (
107
+ return (0, _react2.jsx)("span", {
108
+ css: shouldShowLinkPulse && loaderWrapperStyles
107
109
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
108
- (0, _react2.jsx)("span", {
109
- css: shouldShowLinkPulse && loaderWrapperStyles,
110
- className: "card"
111
- }, (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
112
- data: {
113
- attributes: (0, _utils.getResolvedAttributesFromStore)(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
114
- }
115
- }, (0, _react2.jsx)(_Pulse.DiscoveryPulse, {
116
- localStorageKey: _localStorage.LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
117
- localStorageKeyExpirationInMs: _localStorage.ONE_DAY_IN_MILLISECONDS,
118
- discoveryMode: "start",
119
- shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
120
- testId: "link-discovery-pulse",
121
- isInline: isInline
122
- }, cardWithOverlay)))
123
- );
124
- }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, isInline]);
110
+ ,
111
+ className: "card",
112
+ "data-vc": "awareness-wrapper",
113
+ "data-ssr-placeholder": "awareness-wrapper-".concat(placeholderUniqId),
114
+ "data-ssr-placeholder-replace": "awareness-wrapper-".concat(placeholderUniqId)
115
+ }, (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
116
+ data: {
117
+ attributes: (0, _utils.getResolvedAttributesFromStore)(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
118
+ }
119
+ }, (0, _react2.jsx)(_Pulse.DiscoveryPulse, {
120
+ localStorageKey: _localStorage.LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
121
+ localStorageKeyExpirationInMs: _localStorage.ONE_DAY_IN_MILLISECONDS,
122
+ discoveryMode: "start",
123
+ shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
124
+ testId: "link-discovery-pulse",
125
+ isInline: isInline
126
+ }, cardWithOverlay)));
127
+ }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, isInline, placeholderUniqId]);
125
128
  };
@@ -87,6 +87,8 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
87
87
  return ((editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit' || editorAppearance === 'comment' && fg('platform_editor_controls_patch_6')) && editorExperiment('platform_editor_controls', 'variant1');
88
88
  }, [editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode, editorAppearance]);
89
89
  const innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
90
+ const getPosFunction = typeof getPos === 'function' ? getPos : undefined;
91
+ const placeholderUniqId = (getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction()) || 0;
90
92
  return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/React.createElement(AwarenessWrapper, {
91
93
  isOverlayEnabled: isOverlayEnabled,
92
94
  isPulseEnabled: isPulseEnabled,
@@ -101,10 +103,11 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
101
103
  pluginInjectionApi: pluginInjectionApi,
102
104
  setOverlayHoveredStyles: setOverlayHoveredStyles,
103
105
  appearance: appearance
104
- }, innerCard) :
105
- /*#__PURE__*/
106
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
107
- React.createElement("span", {
108
- className: "card"
106
+ }, innerCard) : /*#__PURE__*/React.createElement("span", {
107
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
108
+ className: "card",
109
+ "data-vc": "editor-plugin-inline-card",
110
+ "data-ssr-placeholder": `editor-plugin-inline-card-${placeholderUniqId}`,
111
+ "data-ssr-placeholder-replace": `editor-plugin-inline-card-${placeholderUniqId}`
109
112
  }, innerCard);
110
113
  });
@@ -87,25 +87,28 @@ export const AwarenessWrapper = ({
87
87
  return children;
88
88
  }, [shouldShowLinkOverlay, children, isSelected, isResolvedViewRendered, isInserted, isHovered, url, handleOverlayChange]);
89
89
  const isInline = appearance === 'inline';
90
+ const placeholderUniqId = linkPosition || 0;
90
91
  return useMemo(() => {
91
92
  var _cardContext$value;
92
- return (
93
+ return jsx("span", {
94
+ css: shouldShowLinkPulse && loaderWrapperStyles
93
95
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
94
- jsx("span", {
95
- css: shouldShowLinkPulse && loaderWrapperStyles,
96
- className: "card"
97
- }, jsx(AnalyticsContext, {
98
- data: {
99
- attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
100
- }
101
- }, jsx(DiscoveryPulse, {
102
- localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
103
- localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
104
- discoveryMode: "start",
105
- shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
106
- testId: "link-discovery-pulse",
107
- isInline: isInline
108
- }, cardWithOverlay)))
109
- );
110
- }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, isInline]);
96
+ ,
97
+ className: "card",
98
+ "data-vc": "awareness-wrapper",
99
+ "data-ssr-placeholder": `awareness-wrapper-${placeholderUniqId}`,
100
+ "data-ssr-placeholder-replace": `awareness-wrapper-${placeholderUniqId}`
101
+ }, jsx(AnalyticsContext, {
102
+ data: {
103
+ attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
104
+ }
105
+ }, jsx(DiscoveryPulse, {
106
+ localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
107
+ localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
108
+ discoveryMode: "start",
109
+ shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
110
+ testId: "link-discovery-pulse",
111
+ isInline: isInline
112
+ }, cardWithOverlay)));
113
+ }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, isInline, placeholderUniqId]);
111
114
  };
@@ -105,6 +105,8 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
105
105
  return ((editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit' || editorAppearance === 'comment' && fg('platform_editor_controls_patch_6')) && editorExperiment('platform_editor_controls', 'variant1');
106
106
  }, [editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode, editorAppearance]);
107
107
  var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
108
+ var getPosFunction = typeof getPos === 'function' ? getPos : undefined;
109
+ var placeholderUniqId = (getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction()) || 0;
108
110
  return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/React.createElement(AwarenessWrapper, {
109
111
  isOverlayEnabled: isOverlayEnabled,
110
112
  isPulseEnabled: isPulseEnabled,
@@ -119,10 +121,11 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
119
121
  pluginInjectionApi: pluginInjectionApi,
120
122
  setOverlayHoveredStyles: setOverlayHoveredStyles,
121
123
  appearance: appearance
122
- }, innerCard) :
123
- /*#__PURE__*/
124
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
125
- React.createElement("span", {
126
- className: "card"
124
+ }, innerCard) : /*#__PURE__*/React.createElement("span", {
125
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
126
+ className: "card",
127
+ "data-vc": "editor-plugin-inline-card",
128
+ "data-ssr-placeholder": "editor-plugin-inline-card-".concat(placeholderUniqId),
129
+ "data-ssr-placeholder-replace": "editor-plugin-inline-card-".concat(placeholderUniqId)
127
130
  }, innerCard);
128
131
  });
@@ -93,25 +93,28 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
93
93
  return children;
94
94
  }, [shouldShowLinkOverlay, children, isSelected, isResolvedViewRendered, isInserted, isHovered, url, handleOverlayChange]);
95
95
  var isInline = appearance === 'inline';
96
+ var placeholderUniqId = linkPosition || 0;
96
97
  return useMemo(function () {
97
98
  var _cardContext$value;
98
- return (
99
+ return jsx("span", {
100
+ css: shouldShowLinkPulse && loaderWrapperStyles
99
101
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
100
- jsx("span", {
101
- css: shouldShowLinkPulse && loaderWrapperStyles,
102
- className: "card"
103
- }, jsx(AnalyticsContext, {
104
- data: {
105
- attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
106
- }
107
- }, jsx(DiscoveryPulse, {
108
- localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
109
- localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
110
- discoveryMode: "start",
111
- shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
112
- testId: "link-discovery-pulse",
113
- isInline: isInline
114
- }, cardWithOverlay)))
115
- );
116
- }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, isInline]);
102
+ ,
103
+ className: "card",
104
+ "data-vc": "awareness-wrapper",
105
+ "data-ssr-placeholder": "awareness-wrapper-".concat(placeholderUniqId),
106
+ "data-ssr-placeholder-replace": "awareness-wrapper-".concat(placeholderUniqId)
107
+ }, jsx(AnalyticsContext, {
108
+ data: {
109
+ attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
110
+ }
111
+ }, jsx(DiscoveryPulse, {
112
+ localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
113
+ localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
114
+ discoveryMode: "start",
115
+ shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
116
+ testId: "link-discovery-pulse",
117
+ isInline: isInline
118
+ }, cardWithOverlay)));
119
+ }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, isInline, placeholderUniqId]);
117
120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "5.4.13",
3
+ "version": "5.4.15",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/analytics-next": "^11.0.0",
38
38
  "@atlaskit/button": "^23.0.0",
39
39
  "@atlaskit/custom-steps": "^0.11.0",
40
- "@atlaskit/editor-common": "^103.8.0",
40
+ "@atlaskit/editor-common": "^103.11.0",
41
41
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
42
42
  "@atlaskit/editor-plugin-base": "^2.3.0",
43
43
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
46
46
  "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
47
47
  "@atlaskit/editor-plugin-feature-flags": "^1.4.0",
48
- "@atlaskit/editor-plugin-floating-toolbar": "^3.6.0",
48
+ "@atlaskit/editor-plugin-floating-toolbar": "^4.0.0",
49
49
  "@atlaskit/editor-plugin-grid": "^2.0.0",
50
50
  "@atlaskit/editor-plugin-width": "^3.0.0",
51
51
  "@atlaskit/editor-prosemirror": "7.0.0",
@@ -54,15 +54,15 @@
54
54
  "@atlaskit/icon": "^25.6.0",
55
55
  "@atlaskit/link-analytics": "^9.1.0",
56
56
  "@atlaskit/link-client-extension": "^4.0.0",
57
- "@atlaskit/link-datasource": "^4.3.0",
57
+ "@atlaskit/link-datasource": "^4.4.0",
58
58
  "@atlaskit/linking-common": "^8.0.0",
59
- "@atlaskit/linking-types": "^9.8.0",
59
+ "@atlaskit/linking-types": "^9.9.0",
60
60
  "@atlaskit/menu": "^3.2.0",
61
61
  "@atlaskit/platform-feature-flags": "^1.1.0",
62
62
  "@atlaskit/primitives": "^14.4.0",
63
63
  "@atlaskit/smart-card": "^36.8.0",
64
64
  "@atlaskit/theme": "^18.0.0",
65
- "@atlaskit/tmp-editor-statsig": "^4.9.0",
65
+ "@atlaskit/tmp-editor-statsig": "^4.12.0",
66
66
  "@atlaskit/tokens": "^4.8.0",
67
67
  "@babel/runtime": "^7.0.0",
68
68
  "@emotion/react": "^11.7.1",