@atlaskit/editor-plugin-card 13.0.9 → 13.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 13.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 13.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`df047c96e4f78`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/df047c96e4f78) -
14
+ Refresh cash for a smart card if it's not been fetched before
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 13.0.9
4
21
 
5
22
  ### Patch Changes
@@ -199,6 +199,15 @@ function InlineCardNodeView(props) {
199
199
  sourceUrl: url,
200
200
  linkType: "inline"
201
201
  }) : null;
202
+ (0, _react.useEffect)(function () {
203
+ if ((0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) {
204
+ // Refresh cache in the background
205
+ provider === null || provider === void 0 || provider.then(function (providerInstance) {
206
+ var _refreshCache, _ref4;
207
+ (_refreshCache = (_ref4 = providerInstance).refreshCache) === null || _refreshCache === void 0 || _refreshCache.call(_ref4, props.node);
208
+ });
209
+ }
210
+ }, [provider, props.node]);
202
211
  var inlineCardContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(WrappedInlineCardWithAwareness, (0, _extends2.default)({
203
212
  node: node,
204
213
  view: view,
@@ -219,8 +228,8 @@ function InlineCardNodeView(props) {
219
228
  source: _editorSmartLinkDraggable.SMART_LINK_DRAG_TYPES.EDITOR
220
229
  }, inlineCardContent) : inlineCardContent;
221
230
  }
222
- var inlineCardNodeView = exports.inlineCardNodeView = function inlineCardNodeView(_ref4) {
223
- var inlineCardViewProducer = _ref4.inlineCardViewProducer;
231
+ var inlineCardNodeView = exports.inlineCardNodeView = function inlineCardNodeView(_ref5) {
232
+ var inlineCardViewProducer = _ref5.inlineCardViewProducer;
224
233
  return function (node, view, getPos, decorations) {
225
234
  return inlineCardViewProducer(node, view, getPos, decorations);
226
235
  };
@@ -198,6 +198,15 @@ export function InlineCardNodeView(props) {
198
198
  sourceUrl: url,
199
199
  linkType: "inline"
200
200
  }) : null;
201
+ useEffect(() => {
202
+ if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) {
203
+ // Refresh cache in the background
204
+ provider === null || provider === void 0 ? void 0 : provider.then(providerInstance => {
205
+ var _refreshCache, _ref;
206
+ (_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 ? void 0 : _refreshCache.call(_ref, props.node);
207
+ });
208
+ }
209
+ }, [provider, props.node]);
201
210
  const inlineCardContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
202
211
  node: node,
203
212
  view: view,
@@ -187,6 +187,15 @@ export function InlineCardNodeView(props) {
187
187
  sourceUrl: url,
188
188
  linkType: "inline"
189
189
  }) : null;
190
+ useEffect(function () {
191
+ if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) {
192
+ // Refresh cache in the background
193
+ provider === null || provider === void 0 || provider.then(function (providerInstance) {
194
+ var _refreshCache, _ref4;
195
+ (_refreshCache = (_ref4 = providerInstance).refreshCache) === null || _refreshCache === void 0 || _refreshCache.call(_ref4, props.node);
196
+ });
197
+ }
198
+ }, [provider, props.node]);
190
199
  var inlineCardContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
191
200
  node: node,
192
201
  view: view,
@@ -207,8 +216,8 @@ export function InlineCardNodeView(props) {
207
216
  source: SMART_LINK_DRAG_TYPES.EDITOR
208
217
  }, inlineCardContent) : inlineCardContent;
209
218
  }
210
- export var inlineCardNodeView = function inlineCardNodeView(_ref4) {
211
- var inlineCardViewProducer = _ref4.inlineCardViewProducer;
219
+ export var inlineCardNodeView = function inlineCardNodeView(_ref5) {
220
+ var inlineCardViewProducer = _ref5.inlineCardViewProducer;
212
221
  return function (node, view, getPos, decorations) {
213
222
  return inlineCardViewProducer(node, view, getPos, decorations);
214
223
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "13.0.9",
3
+ "version": "13.1.1",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/prosemirror-history": "^0.2.0",
63
63
  "@atlaskit/smart-card": "^43.26.0",
64
64
  "@atlaskit/theme": "^22.0.0",
65
- "@atlaskit/tmp-editor-statsig": "^41.0.0",
65
+ "@atlaskit/tmp-editor-statsig": "^43.0.0",
66
66
  "@atlaskit/tokens": "^11.1.0",
67
67
  "@babel/runtime": "^7.0.0",
68
68
  "@emotion/react": "^11.7.1",
@@ -72,7 +72,7 @@
72
72
  "uuid": "^3.1.0"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^112.6.0",
75
+ "@atlaskit/editor-common": "^112.7.0",
76
76
  "@atlaskit/link-provider": "^4.2.0",
77
77
  "react": "^18.2.0",
78
78
  "react-intl-next": "npm:react-intl@^5.18.1"