@atlaskit/editor-plugin-card 19.0.3 → 19.0.4
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 +9 -0
- package/dist/cjs/nodeviews/blockCard.js +1 -2
- package/dist/cjs/nodeviews/embedCard.js +1 -2
- package/dist/cjs/nodeviews/inlineCard.js +1 -2
- package/dist/cjs/pm-plugins/main.js +1 -2
- package/dist/es2019/nodeviews/blockCard.js +1 -2
- package/dist/es2019/nodeviews/embedCard.js +1 -2
- package/dist/es2019/nodeviews/inlineCard.js +1 -2
- package/dist/es2019/pm-plugins/main.js +1 -2
- package/dist/esm/nodeviews/blockCard.js +1 -2
- package/dist/esm/nodeviews/embedCard.js +1 -2
- package/dist/esm/nodeviews/inlineCard.js +1 -2
- package/dist/esm/pm-plugins/main.js +1 -2
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 19.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1f436e4732b98`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f436e4732b98) -
|
|
8
|
+
Clean up the shipped smart link drag-and-drop feature gate and make the drag-and-drop path
|
|
9
|
+
permanent.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 19.0.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -21,7 +21,6 @@ var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/rea
|
|
|
21
21
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
22
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
23
23
|
var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable");
|
|
24
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
24
|
var _smartCard = require("@atlaskit/smart-card");
|
|
26
25
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
27
26
|
var _datasource = require("../nodeviews/datasource");
|
|
@@ -248,7 +247,7 @@ var BlockCard = exports.BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
248
247
|
value: function stopEvent(event) {
|
|
249
248
|
if (event.type === 'dragstart') {
|
|
250
249
|
var target = event.target;
|
|
251
|
-
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')
|
|
250
|
+
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')) {
|
|
252
251
|
return true;
|
|
253
252
|
}
|
|
254
253
|
}
|
|
@@ -26,7 +26,6 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
|
|
|
26
26
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
27
27
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
28
28
|
var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable");
|
|
29
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
29
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
31
30
|
var _smartCard = require("@atlaskit/smart-card");
|
|
32
31
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
@@ -566,7 +565,7 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
566
565
|
value: function stopEvent(event) {
|
|
567
566
|
if (event.type === 'dragstart') {
|
|
568
567
|
var target = event.target;
|
|
569
|
-
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')
|
|
568
|
+
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')) {
|
|
570
569
|
return true;
|
|
571
570
|
}
|
|
572
571
|
}
|
|
@@ -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 _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
18
17
|
var _utils = require("../pm-plugins/utils");
|
|
@@ -59,7 +58,7 @@ function InlineCardNodeView(props) {
|
|
|
59
58
|
CompetitorPrompt = props.CompetitorPrompt,
|
|
60
59
|
intl = props.intl,
|
|
61
60
|
smartCardContext = props.smartCardContext;
|
|
62
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)
|
|
61
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) ? ['editorViewMode', 'card'] : ['editorViewMode'], (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) ? selectorWithCard : selectorWithoutCard),
|
|
63
62
|
mode = _useSharedPluginState.mode,
|
|
64
63
|
resolvedInlineSmartLinks = _useSharedPluginState.resolvedInlineSmartLinks;
|
|
65
64
|
var url = node.attrs.url;
|
|
@@ -15,7 +15,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
16
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
17
17
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
20
19
|
var _inlineCard = require("../nodeviews/inlineCard");
|
|
21
20
|
var _lazyBlockCard = require("../nodeviews/lazy-block-card");
|
|
@@ -130,7 +129,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
130
129
|
var newState = (0, _reducers.default)(pluginStateWithUpdatedPos, meta);
|
|
131
130
|
|
|
132
131
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
133
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)
|
|
132
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)) {
|
|
134
133
|
var resolvedRequest = pluginState.requests.find(function (req) {
|
|
135
134
|
return req.url === meta.url;
|
|
136
135
|
});
|
|
@@ -9,7 +9,6 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
|
9
9
|
import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
10
10
|
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
14
13
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
15
14
|
import { Datasource } from '../nodeviews/datasource';
|
|
@@ -211,7 +210,7 @@ export class BlockCard extends ReactNodeView {
|
|
|
211
210
|
stopEvent(event) {
|
|
212
211
|
if (event.type === 'dragstart') {
|
|
213
212
|
const target = event.target;
|
|
214
|
-
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')
|
|
213
|
+
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')) {
|
|
215
214
|
return true;
|
|
216
215
|
}
|
|
217
216
|
}
|
|
@@ -14,7 +14,6 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
14
14
|
import { floatingLayouts, isRichMediaInsideOfBlockNode } from '@atlaskit/editor-common/utils';
|
|
15
15
|
import { akEditorFullPageNarrowBreakout, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
17
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
17
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
19
18
|
import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
|
|
20
19
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
@@ -539,7 +538,7 @@ export class EmbedCard extends ReactNodeView {
|
|
|
539
538
|
stopEvent(event) {
|
|
540
539
|
if (event.type === 'dragstart') {
|
|
541
540
|
const target = event.target;
|
|
542
|
-
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')
|
|
541
|
+
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')) {
|
|
543
542
|
return true;
|
|
544
543
|
}
|
|
545
544
|
}
|
|
@@ -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 { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
9
8
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
@@ -54,7 +53,7 @@ export function InlineCardNodeView(props) {
|
|
|
54
53
|
const {
|
|
55
54
|
mode,
|
|
56
55
|
resolvedInlineSmartLinks
|
|
57
|
-
} = useSharedPluginStateWithSelector(pluginInjectionApi, expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)
|
|
56
|
+
} = useSharedPluginStateWithSelector(pluginInjectionApi, expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) ? ['editorViewMode', 'card'] : ['editorViewMode'], expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) ? selectorWithCard : selectorWithoutCard);
|
|
58
57
|
const url = node.attrs.url;
|
|
59
58
|
const CompetitorPromptComponent = CompetitorPrompt && url ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
60
59
|
sourceUrl: url,
|
|
@@ -6,7 +6,6 @@ import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/st
|
|
|
6
6
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
11
10
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
12
11
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
@@ -121,7 +120,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
121
120
|
const newState = reducer(pluginStateWithUpdatedPos, meta);
|
|
122
121
|
|
|
123
122
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
124
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)
|
|
123
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)) {
|
|
125
124
|
const resolvedRequest = pluginState.requests.find(req => req.url === meta.url);
|
|
126
125
|
if ((resolvedRequest === null || resolvedRequest === void 0 ? void 0 : resolvedRequest.appearance) === 'inline') {
|
|
127
126
|
var _newState$resolvedInl, _newState$resolvedInl2;
|
|
@@ -18,7 +18,6 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
|
18
18
|
import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
19
19
|
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
20
20
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
21
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
21
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
23
22
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
24
23
|
import { Datasource } from '../nodeviews/datasource';
|
|
@@ -243,7 +242,7 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
243
242
|
value: function stopEvent(event) {
|
|
244
243
|
if (event.type === 'dragstart') {
|
|
245
244
|
var target = event.target;
|
|
246
|
-
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')
|
|
245
|
+
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')) {
|
|
247
246
|
return true;
|
|
248
247
|
}
|
|
249
248
|
}
|
|
@@ -25,7 +25,6 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
25
25
|
import { floatingLayouts, isRichMediaInsideOfBlockNode } from '@atlaskit/editor-common/utils';
|
|
26
26
|
import { akEditorFullPageNarrowBreakout, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
27
27
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
28
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
28
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
30
29
|
import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
|
|
31
30
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
@@ -561,7 +560,7 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
561
560
|
value: function stopEvent(event) {
|
|
562
561
|
if (event.type === 'dragstart') {
|
|
563
562
|
var target = event.target;
|
|
564
|
-
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')
|
|
563
|
+
if (target instanceof HTMLElement && target.closest('[data-smart-element-link]')) {
|
|
565
564
|
return true;
|
|
566
565
|
}
|
|
567
566
|
}
|
|
@@ -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 { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
9
8
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
@@ -49,7 +48,7 @@ export function InlineCardNodeView(props) {
|
|
|
49
48
|
CompetitorPrompt = props.CompetitorPrompt,
|
|
50
49
|
intl = props.intl,
|
|
51
50
|
smartCardContext = props.smartCardContext;
|
|
52
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)
|
|
51
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) ? ['editorViewMode', 'card'] : ['editorViewMode'], expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) ? selectorWithCard : selectorWithoutCard),
|
|
53
52
|
mode = _useSharedPluginState.mode,
|
|
54
53
|
resolvedInlineSmartLinks = _useSharedPluginState.resolvedInlineSmartLinks;
|
|
55
54
|
var url = node.attrs.url;
|
|
@@ -10,7 +10,6 @@ import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/st
|
|
|
10
10
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
15
14
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
16
15
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
@@ -123,7 +122,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
123
122
|
var newState = reducer(pluginStateWithUpdatedPos, meta);
|
|
124
123
|
|
|
125
124
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
126
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)
|
|
125
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false)) {
|
|
127
126
|
var resolvedRequest = pluginState.requests.find(function (req) {
|
|
128
127
|
return req.url === meta.url;
|
|
129
128
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.4",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@atlaskit/primitives": "^22.2.0",
|
|
62
62
|
"@atlaskit/prosemirror-history": "^1.1.0",
|
|
63
63
|
"@atlaskit/smart-card": "^45.17.0",
|
|
64
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^141.0.0",
|
|
65
65
|
"@atlaskit/tokens": "^16.3.0",
|
|
66
66
|
"@babel/runtime": "^7.0.0",
|
|
67
67
|
"@emotion/react": "^11.7.1",
|
|
@@ -116,9 +116,6 @@
|
|
|
116
116
|
"platform_native_embeds_rollout_non_maui_experience": {
|
|
117
117
|
"type": "boolean"
|
|
118
118
|
},
|
|
119
|
-
"cc_drag_and_drop_smart_link_from_content_to_tree": {
|
|
120
|
-
"type": "boolean"
|
|
121
|
-
},
|
|
122
119
|
"confluence-issue-terminology-refresh": {
|
|
123
120
|
"type": "boolean"
|
|
124
121
|
},
|