@atlaskit/editor-plugin-card 22.1.11 → 23.0.0

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,13 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 23.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3422261e7a40e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3422261e7a40e) -
8
+ Clean up experiment `platform_editor_smartlink_local_cache`.
9
+ - Updated dependencies
10
+
3
11
  ## 22.1.11
4
12
 
5
13
  ### Patch Changes
@@ -12,7 +12,6 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _hooks = require("@atlaskit/editor-common/hooks");
13
13
  var _ui = require("@atlaskit/editor-common/ui");
14
14
  var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable");
15
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
15
  var _utils = require("../pm-plugins/utils");
17
16
  var _SmartCardSSRReactContextsProvider = require("../ui/SmartCardSSRReactContextsProvider");
18
17
  var _genericCard = require("./genericCard");
@@ -59,13 +58,10 @@ function InlineCardNodeView(props) {
59
58
  linkType: "inline"
60
59
  }) : null;
61
60
  (0, _react.useEffect)(function () {
62
- if ((0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) {
63
- // Refresh cache in the background
64
- provider === null || provider === void 0 || provider.then(function (providerInstance) {
65
- var _refreshCache, _ref;
66
- (_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 || _refreshCache.call(_ref, props.node);
67
- });
68
- }
61
+ provider === null || provider === void 0 || provider.then(function (providerInstance) {
62
+ var _refreshCache, _ref;
63
+ (_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 || _refreshCache.call(_ref, props.node);
64
+ });
69
65
  }, [provider, props.node]);
70
66
  var linkPosition = (0, _react.useMemo)(function () {
71
67
  if (!getPos || typeof getPos === 'boolean') {
@@ -15,7 +15,6 @@ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-ex
15
15
  var _fg = require("@atlaskit/platform-feature-flags/fg");
16
16
  var _smartCard = require("@atlaskit/smart-card");
17
17
  var _ssr = require("@atlaskit/smart-card/ssr");
18
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
18
  var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
20
19
  var _actions = require("../pm-plugins/actions");
21
20
  var _toolbar = require("../ui/toolbar");
@@ -117,7 +116,7 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
117
116
  }, [propsOnClick, url, view, pluginInjectionApi]);
118
117
  var onClick = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
119
118
  var card = (0, _react.useMemo)(function () {
120
- if ((isPageSSRed || cardState && (0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url) {
119
+ if ((isPageSSRed || cardState) && url) {
121
120
  return /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
122
121
  key: url,
123
122
  url: url,
@@ -1,34 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.lazyInlineCardView = void 0;
8
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
- var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
10
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
12
7
  var _inlineCard = require("./inlineCard");
13
- 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" != (0, _typeof2.default)(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); }
14
8
  var lazyInlineCardView = exports.lazyInlineCardView = function lazyInlineCardView(props) {
15
- var _props$isPageSSRed = props.isPageSSRed,
16
- isPageSSRed = _props$isPageSSRed === void 0 ? false : _props$isPageSSRed;
17
- if ((0, _editorExperiment.editorExperiment)('platform_editor_exp_lazy_node_views', false) || (0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true) || isPageSSRed) {
18
- return (0, _inlineCard.inlineCardNodeView)(props);
19
- }
20
- return (0, _lazyNodeView.withLazyLoading)({
21
- nodeName: 'inlineCard',
22
- getNodeViewOptions: function getNodeViewOptions() {},
23
- loader: function loader() {
24
- var result = Promise.resolve().then(function () {
25
- return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-inline-card-item-nodeview" */
26
- './inlineCard'));
27
- }).then(function (_ref) {
28
- var inlineCardNodeView = _ref.inlineCardNodeView;
29
- return inlineCardNodeView(props);
30
- });
31
- return result;
32
- }
33
- });
9
+ return (0, _inlineCard.inlineCardNodeView)(props);
34
10
  };
@@ -3,7 +3,6 @@ import React, { useEffect, useMemo } from 'react';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { UnsupportedInline } from '@atlaskit/editor-common/ui';
5
5
  import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { getAwarenessProps } from '../pm-plugins/utils';
8
7
  import { SmartCardSSRReactContextsProvider } from '../ui/SmartCardSSRReactContextsProvider';
9
8
  import { Card } from './genericCard';
@@ -52,13 +51,10 @@ export function InlineCardNodeView(props) {
52
51
  linkType: "inline"
53
52
  }) : null;
54
53
  useEffect(() => {
55
- if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) {
56
- // Refresh cache in the background
57
- provider === null || provider === void 0 ? void 0 : provider.then(providerInstance => {
58
- var _refreshCache, _ref;
59
- (_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 ? void 0 : _refreshCache.call(_ref, props.node);
60
- });
61
- }
54
+ provider === null || provider === void 0 ? void 0 : provider.then(providerInstance => {
55
+ var _refreshCache, _ref;
56
+ (_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 ? void 0 : _refreshCache.call(_ref, props.node);
57
+ });
62
58
  }, [provider, props.node]);
63
59
  const linkPosition = useMemo(() => {
64
60
  if (!getPos || typeof getPos === 'boolean') {
@@ -8,7 +8,6 @@ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-e
8
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
9
9
  import { Card as SmartCard } from '@atlaskit/smart-card';
10
10
  import { CardSSR } from '@atlaskit/smart-card/ssr';
11
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
13
12
  import { registerCard, removeCard } from '../pm-plugins/actions';
14
13
  import { visitCardLinkAnalytics } from '../ui/toolbar';
@@ -115,7 +114,7 @@ export const InlineCard = /*#__PURE__*/memo(({
115
114
  }, [propsOnClick, url, view, pluginInjectionApi]);
116
115
  const onClick = editorExperiment('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
117
116
  const card = useMemo(() => {
118
- if ((isPageSSRed || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url) {
117
+ if ((isPageSSRed || cardState) && url) {
119
118
  return /*#__PURE__*/React.createElement(CardSSR, {
120
119
  key: url,
121
120
  url: url,
@@ -1,25 +1,4 @@
1
- import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
4
1
  import { inlineCardNodeView } from './inlineCard';
5
2
  export const lazyInlineCardView = props => {
6
- const {
7
- isPageSSRed = false
8
- } = props;
9
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) || isPageSSRed) {
10
- return inlineCardNodeView(props);
11
- }
12
- return withLazyLoading({
13
- nodeName: 'inlineCard',
14
- getNodeViewOptions: () => {},
15
- loader: () => {
16
- const result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-inline-card-item-nodeview" */
17
- './inlineCard').then(({
18
- inlineCardNodeView
19
- }) => {
20
- return inlineCardNodeView(props);
21
- });
22
- return result;
23
- }
24
- });
3
+ return inlineCardNodeView(props);
25
4
  };
@@ -3,7 +3,6 @@ import React, { useEffect, useMemo } from 'react';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { UnsupportedInline } from '@atlaskit/editor-common/ui';
5
5
  import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { getAwarenessProps } from '../pm-plugins/utils';
8
7
  import { SmartCardSSRReactContextsProvider } from '../ui/SmartCardSSRReactContextsProvider';
9
8
  import { Card } from './genericCard';
@@ -49,13 +48,10 @@ export function InlineCardNodeView(props) {
49
48
  linkType: "inline"
50
49
  }) : null;
51
50
  useEffect(function () {
52
- if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) {
53
- // Refresh cache in the background
54
- provider === null || provider === void 0 || provider.then(function (providerInstance) {
55
- var _refreshCache, _ref;
56
- (_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 || _refreshCache.call(_ref, props.node);
57
- });
58
- }
51
+ provider === null || provider === void 0 || provider.then(function (providerInstance) {
52
+ var _refreshCache, _ref;
53
+ (_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 || _refreshCache.call(_ref, props.node);
54
+ });
59
55
  }, [provider, props.node]);
60
56
  var linkPosition = useMemo(function () {
61
57
  if (!getPos || typeof getPos === 'boolean') {
@@ -8,7 +8,6 @@ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-e
8
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
9
9
  import { Card as SmartCard } from '@atlaskit/smart-card';
10
10
  import { CardSSR } from '@atlaskit/smart-card/ssr';
11
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
13
12
  import { registerCard, removeCard } from '../pm-plugins/actions';
14
13
  import { visitCardLinkAnalytics } from '../ui/toolbar';
@@ -107,7 +106,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
107
106
  }, [propsOnClick, url, view, pluginInjectionApi]);
108
107
  var onClick = editorExperiment('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
109
108
  var card = useMemo(function () {
110
- if ((isPageSSRed || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url) {
109
+ if ((isPageSSRed || cardState) && url) {
111
110
  return /*#__PURE__*/React.createElement(CardSSR, {
112
111
  key: url,
113
112
  url: url,
@@ -1,23 +1,4 @@
1
- import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
4
1
  import { inlineCardNodeView } from './inlineCard';
5
2
  export var lazyInlineCardView = function lazyInlineCardView(props) {
6
- var _props$isPageSSRed = props.isPageSSRed,
7
- isPageSSRed = _props$isPageSSRed === void 0 ? false : _props$isPageSSRed;
8
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) || isPageSSRed) {
9
- return inlineCardNodeView(props);
10
- }
11
- return withLazyLoading({
12
- nodeName: 'inlineCard',
13
- getNodeViewOptions: function getNodeViewOptions() {},
14
- loader: function loader() {
15
- var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-inline-card-item-nodeview" */
16
- './inlineCard').then(function (_ref) {
17
- var inlineCardNodeView = _ref.inlineCardNodeView;
18
- return inlineCardNodeView(props);
19
- });
20
- return result;
21
- }
22
- });
3
+ return inlineCardNodeView(props);
23
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "22.1.11",
3
+ "version": "23.0.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,26 +21,26 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^57.3.0",
24
+ "@atlaskit/adf-schema": "^57.4.0",
25
25
  "@atlaskit/analytics-next": "^12.5.0",
26
26
  "@atlaskit/button": "^25.3.0",
27
27
  "@atlaskit/css": "^1.1.0",
28
28
  "@atlaskit/custom-steps": "^1.1.0",
29
29
  "@atlaskit/editor-card-provider": "^7.3.0",
30
- "@atlaskit/editor-plugin-analytics": "^16.1.0",
31
- "@atlaskit/editor-plugin-annotation": "^16.0.0",
32
- "@atlaskit/editor-plugin-base": "^17.1.0",
33
- "@atlaskit/editor-plugin-connectivity": "^16.0.0",
34
- "@atlaskit/editor-plugin-decorations": "^16.1.0",
35
- "@atlaskit/editor-plugin-editor-disabled": "^16.1.0",
36
- "@atlaskit/editor-plugin-editor-viewmode": "^18.0.0",
37
- "@atlaskit/editor-plugin-feature-flags": "^15.1.0",
38
- "@atlaskit/editor-plugin-floating-toolbar": "^18.1.0",
39
- "@atlaskit/editor-plugin-grid": "^16.1.0",
40
- "@atlaskit/editor-plugin-selection": "^16.1.0",
41
- "@atlaskit/editor-plugin-toolbar": "^13.0.0",
42
- "@atlaskit/editor-plugin-ui-control-registry": "^10.0.0",
43
- "@atlaskit/editor-plugin-width": "^17.1.0",
30
+ "@atlaskit/editor-plugin-analytics": "^17.0.0",
31
+ "@atlaskit/editor-plugin-annotation": "^17.0.0",
32
+ "@atlaskit/editor-plugin-base": "^18.0.0",
33
+ "@atlaskit/editor-plugin-connectivity": "^17.0.0",
34
+ "@atlaskit/editor-plugin-decorations": "^17.0.0",
35
+ "@atlaskit/editor-plugin-editor-disabled": "^17.0.0",
36
+ "@atlaskit/editor-plugin-editor-viewmode": "^19.0.0",
37
+ "@atlaskit/editor-plugin-feature-flags": "^16.0.0",
38
+ "@atlaskit/editor-plugin-floating-toolbar": "^19.0.0",
39
+ "@atlaskit/editor-plugin-grid": "^17.0.0",
40
+ "@atlaskit/editor-plugin-selection": "^17.0.0",
41
+ "@atlaskit/editor-plugin-toolbar": "^14.0.0",
42
+ "@atlaskit/editor-plugin-ui-control-registry": "^11.0.0",
43
+ "@atlaskit/editor-plugin-width": "^18.0.0",
44
44
  "@atlaskit/editor-prosemirror": "^8.0.0",
45
45
  "@atlaskit/editor-shared-styles": "^4.1.0",
46
46
  "@atlaskit/editor-smart-link-draggable": "^1.2.0",
@@ -63,7 +63,7 @@
63
63
  "@atlaskit/primitives": "^22.5.0",
64
64
  "@atlaskit/prosemirror-history": "^1.2.0",
65
65
  "@atlaskit/smart-card": "^45.20.0",
66
- "@atlaskit/tmp-editor-statsig": "^178.0.0",
66
+ "@atlaskit/tmp-editor-statsig": "^179.0.0",
67
67
  "@atlaskit/tokens": "^16.11.0",
68
68
  "@babel/runtime": "^7.0.0",
69
69
  "@emotion/react": "^11.7.1",
@@ -73,7 +73,7 @@
73
73
  "uuid": "^11.1.1"
74
74
  },
75
75
  "peerDependencies": {
76
- "@atlaskit/editor-common": "^120.16.0",
76
+ "@atlaskit/editor-common": "^121.0.0",
77
77
  "@atlaskit/link-provider": "^5.5.0",
78
78
  "react": "^18.2.0 || ^19.2.0",
79
79
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"