@atlaskit/editor-plugin-card 5.4.25 → 5.4.27
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 +18 -0
- package/dist/cjs/ui/OpenButtonOverlay/index.js +6 -3
- package/dist/cjs/ui/toolbar.js +23 -4
- package/dist/es2019/ui/OpenButtonOverlay/index.js +8 -5
- package/dist/es2019/ui/toolbar.js +24 -3
- package/dist/esm/ui/OpenButtonOverlay/index.js +7 -5
- package/dist/esm/ui/toolbar.js +22 -3
- package/dist/types/ui/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/ui/toolbar.d.ts +2 -1
- package/package.json +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 5.4.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#150983](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150983)
|
|
8
|
+
[`a363af43f9cd6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a363af43f9cd6) -
|
|
9
|
+
[ux] Adds i18n title for Open button that is shown on hovering a smartlink.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 5.4.26
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#149482](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149482)
|
|
17
|
+
[`1f1f73876c3c8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f1f73876c3c8) -
|
|
18
|
+
ED-27860 Add analytics for copy and delete button in floating toolbars
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 5.4.25
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -9,7 +9,9 @@ exports.default = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
|
+
var _reactIntlNext = require("react-intl-next");
|
|
12
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
15
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
14
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
17
|
var _primitives = require("@atlaskit/primitives");
|
|
@@ -80,8 +82,9 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
80
82
|
editorAppearance = _ref.editorAppearance,
|
|
81
83
|
editorAnalyticsApi = _ref.editorAnalyticsApi,
|
|
82
84
|
view = _ref.view;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
86
|
+
formatMessage = _useIntl.formatMessage;
|
|
87
|
+
var label = (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_8') ? formatMessage(_messages.cardMessages.openButtonTitle) : 'Open';
|
|
85
88
|
var containerRef = (0, _react.useRef)(null);
|
|
86
89
|
var openButtonRef = (0, _react.useRef)(null);
|
|
87
90
|
var hiddenTextRef = (0, _react.useRef)(null);
|
|
@@ -132,7 +135,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
132
135
|
};
|
|
133
136
|
var sendVisitLinkAnalytics = function sendVisitLinkAnalytics(inputMethod) {
|
|
134
137
|
if (editorAnalyticsApi && view) {
|
|
135
|
-
(0, _toolbar.
|
|
138
|
+
(0, _toolbar.visitCardLinkAnalyticsOnly)(editorAnalyticsApi, inputMethod)(view.state, view.dispatch);
|
|
136
139
|
}
|
|
137
140
|
};
|
|
138
141
|
var handleDoubleClick = function handleDoubleClick() {
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.visitCardLink = exports.shouldRenderToolbarPulse = exports.removeCard = exports.openLinkSettings = exports.getStartingToolbarItems = exports.getSettingsButton = exports.getEndingToolbarItems = exports.floatingToolbar = void 0;
|
|
8
|
+
exports.visitCardLinkAnalyticsOnly = exports.visitCardLink = exports.shouldRenderToolbarPulse = exports.removeCard = exports.openLinkSettings = exports.getStartingToolbarItems = exports.getSettingsButton = exports.getEndingToolbarItems = exports.floatingToolbar = void 0;
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -59,7 +59,7 @@ var removeCard = exports.removeCard = function removeCard(editorAnalyticsApi) {
|
|
|
59
59
|
actionSubject: _analytics.ACTION_SUBJECT.SMART_LINK,
|
|
60
60
|
actionSubjectId: type,
|
|
61
61
|
attributes: {
|
|
62
|
-
inputMethod: _analytics.INPUT_METHOD.TOOLBAR,
|
|
62
|
+
inputMethod: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? _analytics.INPUT_METHOD.FLOATING_TB : _analytics.INPUT_METHOD.TOOLBAR,
|
|
63
63
|
displayMode: type
|
|
64
64
|
},
|
|
65
65
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
@@ -81,6 +81,11 @@ var visitCardLink = exports.visitCardLink = function visitCardLink(editorAnalyti
|
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
83
|
var type = state.selection.node.type;
|
|
84
|
+
|
|
85
|
+
// EDM-12466:
|
|
86
|
+
// During smart_link_editor_update_toolbar_open_link clean up
|
|
87
|
+
// Consider updating the code to use visitCardLink or visitCardLinkAnalyticsOnly for all input methods:
|
|
88
|
+
// INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR | NPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK
|
|
84
89
|
if (!(0, _platformFeatureFlags.fg)('smart_link_editor_update_toolbar_open_link')) {
|
|
85
90
|
var _titleUrlPairFromNode = (0, _utils3.titleUrlPairFromNode)(state.selection.node),
|
|
86
91
|
url = _titleUrlPairFromNode.url;
|
|
@@ -97,6 +102,20 @@ var visitCardLink = exports.visitCardLink = function visitCardLink(editorAnalyti
|
|
|
97
102
|
return true;
|
|
98
103
|
};
|
|
99
104
|
};
|
|
105
|
+
var visitCardLinkAnalyticsOnly = exports.visitCardLinkAnalyticsOnly = function visitCardLinkAnalyticsOnly(editorAnalyticsApi, inputMethod) {
|
|
106
|
+
return function (state, dispatch) {
|
|
107
|
+
if (!(state.selection instanceof _state.NodeSelection)) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
var type = state.selection.node.type;
|
|
111
|
+
if (dispatch) {
|
|
112
|
+
var tr = state.tr;
|
|
113
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildVisitedNonHyperLinkPayload)(type.name, inputMethod))(tr);
|
|
114
|
+
dispatch(tr);
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
100
119
|
var openLinkSettings = exports.openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
101
120
|
return function (state, dispatch) {
|
|
102
121
|
if (!(state.selection instanceof _state.NodeSelection)) {
|
|
@@ -454,7 +473,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
454
473
|
onClick: function onClick() {
|
|
455
474
|
var _pluginInjectionApi$c2, _pluginInjectionApi$f;
|
|
456
475
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 || _pluginInjectionApi$c2.actions.execute( // @ts-ignore
|
|
457
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.commands.copyNode(node.type));
|
|
476
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.commands.copyNode(node.type, _analytics.INPUT_METHOD.FLOATING_TB));
|
|
458
477
|
return true;
|
|
459
478
|
},
|
|
460
479
|
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
@@ -645,7 +664,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
645
664
|
onClick: function onClick() {
|
|
646
665
|
var _pluginInjectionApi$c3, _pluginInjectionApi$f2;
|
|
647
666
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c3 = pluginInjectionApi.core) === null || _pluginInjectionApi$c3 === void 0 || _pluginInjectionApi$c3.actions.execute( // @ts-ignore
|
|
648
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.commands.copyNode(node.type));
|
|
667
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.commands.copyNode(node.type, _analytics.INPUT_METHOD.FLOATING_TB));
|
|
649
668
|
return true;
|
|
650
669
|
},
|
|
651
670
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true, _editorSharedStyles.akEditorSelectedNodeClassName),
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
8
8
|
import { css, jsx } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
9
|
-
|
|
9
|
+
import { useIntl } from 'react-intl-next';
|
|
10
10
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import { cardMessages } from '@atlaskit/editor-common/messages';
|
|
11
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
13
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
13
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
15
|
-
import {
|
|
16
|
+
import { visitCardLinkAnalyticsOnly } from '../toolbar';
|
|
16
17
|
const containerStyles = css({
|
|
17
18
|
position: 'relative'
|
|
18
19
|
});
|
|
@@ -66,8 +67,10 @@ const OpenButtonOverlay = ({
|
|
|
66
67
|
editorAnalyticsApi,
|
|
67
68
|
view
|
|
68
69
|
}) => {
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
const {
|
|
71
|
+
formatMessage
|
|
72
|
+
} = useIntl();
|
|
73
|
+
const label = fg('platform_editor_controls_patch_8') ? formatMessage(cardMessages.openButtonTitle) : 'Open';
|
|
71
74
|
const containerRef = useRef(null);
|
|
72
75
|
const openButtonRef = useRef(null);
|
|
73
76
|
const hiddenTextRef = useRef(null);
|
|
@@ -112,7 +115,7 @@ const OpenButtonOverlay = ({
|
|
|
112
115
|
};
|
|
113
116
|
const sendVisitLinkAnalytics = inputMethod => {
|
|
114
117
|
if (editorAnalyticsApi && view) {
|
|
115
|
-
|
|
118
|
+
visitCardLinkAnalyticsOnly(editorAnalyticsApi, inputMethod)(view.state, view.dispatch);
|
|
116
119
|
}
|
|
117
120
|
};
|
|
118
121
|
const handleDoubleClick = () => {
|
|
@@ -44,7 +44,7 @@ export const removeCard = editorAnalyticsApi => commandWithMetadata((state, disp
|
|
|
44
44
|
actionSubject: ACTION_SUBJECT.SMART_LINK,
|
|
45
45
|
actionSubjectId: type,
|
|
46
46
|
attributes: {
|
|
47
|
-
inputMethod: INPUT_METHOD.TOOLBAR,
|
|
47
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? INPUT_METHOD.FLOATING_TB : INPUT_METHOD.TOOLBAR,
|
|
48
48
|
displayMode: type
|
|
49
49
|
},
|
|
50
50
|
eventType: EVENT_TYPE.TRACK
|
|
@@ -68,6 +68,11 @@ export const visitCardLink = (editorAnalyticsApi, inputMethod) => (state, dispat
|
|
|
68
68
|
const {
|
|
69
69
|
type
|
|
70
70
|
} = state.selection.node;
|
|
71
|
+
|
|
72
|
+
// EDM-12466:
|
|
73
|
+
// During smart_link_editor_update_toolbar_open_link clean up
|
|
74
|
+
// Consider updating the code to use visitCardLink or visitCardLinkAnalyticsOnly for all input methods:
|
|
75
|
+
// INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR | NPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK
|
|
71
76
|
if (!fg('smart_link_editor_update_toolbar_open_link')) {
|
|
72
77
|
const {
|
|
73
78
|
url
|
|
@@ -86,6 +91,22 @@ export const visitCardLink = (editorAnalyticsApi, inputMethod) => (state, dispat
|
|
|
86
91
|
}
|
|
87
92
|
return true;
|
|
88
93
|
};
|
|
94
|
+
export const visitCardLinkAnalyticsOnly = (editorAnalyticsApi, inputMethod) => (state, dispatch) => {
|
|
95
|
+
if (!(state.selection instanceof NodeSelection)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
const {
|
|
99
|
+
type
|
|
100
|
+
} = state.selection.node;
|
|
101
|
+
if (dispatch) {
|
|
102
|
+
const {
|
|
103
|
+
tr
|
|
104
|
+
} = state;
|
|
105
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(buildVisitedNonHyperLinkPayload(type.name, inputMethod))(tr);
|
|
106
|
+
dispatch(tr);
|
|
107
|
+
}
|
|
108
|
+
return true;
|
|
109
|
+
};
|
|
89
110
|
export const openLinkSettings = editorAnalyticsApi => (state, dispatch) => {
|
|
90
111
|
if (!(state.selection instanceof NodeSelection)) {
|
|
91
112
|
return false;
|
|
@@ -444,7 +465,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
444
465
|
onClick: () => {
|
|
445
466
|
var _pluginInjectionApi$c4, _pluginInjectionApi$f;
|
|
446
467
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c4 = pluginInjectionApi.core) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.actions.execute( // @ts-ignore
|
|
447
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.commands.copyNode(node.type));
|
|
468
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.commands.copyNode(node.type, INPUT_METHOD.FLOATING_TB));
|
|
448
469
|
return true;
|
|
449
470
|
},
|
|
450
471
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
@@ -637,7 +658,7 @@ const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hove
|
|
|
637
658
|
onClick: () => {
|
|
638
659
|
var _pluginInjectionApi$c5, _pluginInjectionApi$f2;
|
|
639
660
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c5 = pluginInjectionApi.core) === null || _pluginInjectionApi$c5 === void 0 ? void 0 : _pluginInjectionApi$c5.actions.execute( // @ts-ignore
|
|
640
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.commands.copyNode(node.type));
|
|
661
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.commands.copyNode(node.type, INPUT_METHOD.FLOATING_TB));
|
|
641
662
|
return true;
|
|
642
663
|
},
|
|
643
664
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true, akEditorSelectedNodeClassName),
|
|
@@ -7,13 +7,14 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
7
7
|
*/
|
|
8
8
|
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
9
9
|
import { css, jsx } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
10
|
-
|
|
10
|
+
import { useIntl } from 'react-intl-next';
|
|
11
11
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import { cardMessages } from '@atlaskit/editor-common/messages';
|
|
12
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
14
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
14
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
16
|
-
import {
|
|
17
|
+
import { visitCardLinkAnalyticsOnly } from '../toolbar';
|
|
17
18
|
var containerStyles = css({
|
|
18
19
|
position: 'relative'
|
|
19
20
|
});
|
|
@@ -67,8 +68,9 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
67
68
|
editorAppearance = _ref.editorAppearance,
|
|
68
69
|
editorAnalyticsApi = _ref.editorAnalyticsApi,
|
|
69
70
|
view = _ref.view;
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
var _useIntl = useIntl(),
|
|
72
|
+
formatMessage = _useIntl.formatMessage;
|
|
73
|
+
var label = fg('platform_editor_controls_patch_8') ? formatMessage(cardMessages.openButtonTitle) : 'Open';
|
|
72
74
|
var containerRef = useRef(null);
|
|
73
75
|
var openButtonRef = useRef(null);
|
|
74
76
|
var hiddenTextRef = useRef(null);
|
|
@@ -119,7 +121,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
119
121
|
};
|
|
120
122
|
var sendVisitLinkAnalytics = function sendVisitLinkAnalytics(inputMethod) {
|
|
121
123
|
if (editorAnalyticsApi && view) {
|
|
122
|
-
|
|
124
|
+
visitCardLinkAnalyticsOnly(editorAnalyticsApi, inputMethod)(view.state, view.dispatch);
|
|
123
125
|
}
|
|
124
126
|
};
|
|
125
127
|
var handleDoubleClick = function handleDoubleClick() {
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -49,7 +49,7 @@ export var removeCard = function removeCard(editorAnalyticsApi) {
|
|
|
49
49
|
actionSubject: ACTION_SUBJECT.SMART_LINK,
|
|
50
50
|
actionSubjectId: type,
|
|
51
51
|
attributes: {
|
|
52
|
-
inputMethod: INPUT_METHOD.TOOLBAR,
|
|
52
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? INPUT_METHOD.FLOATING_TB : INPUT_METHOD.TOOLBAR,
|
|
53
53
|
displayMode: type
|
|
54
54
|
},
|
|
55
55
|
eventType: EVENT_TYPE.TRACK
|
|
@@ -71,6 +71,11 @@ export var visitCardLink = function visitCardLink(editorAnalyticsApi, inputMetho
|
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
73
|
var type = state.selection.node.type;
|
|
74
|
+
|
|
75
|
+
// EDM-12466:
|
|
76
|
+
// During smart_link_editor_update_toolbar_open_link clean up
|
|
77
|
+
// Consider updating the code to use visitCardLink or visitCardLinkAnalyticsOnly for all input methods:
|
|
78
|
+
// INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR | NPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK
|
|
74
79
|
if (!fg('smart_link_editor_update_toolbar_open_link')) {
|
|
75
80
|
var _titleUrlPairFromNode = titleUrlPairFromNode(state.selection.node),
|
|
76
81
|
url = _titleUrlPairFromNode.url;
|
|
@@ -87,6 +92,20 @@ export var visitCardLink = function visitCardLink(editorAnalyticsApi, inputMetho
|
|
|
87
92
|
return true;
|
|
88
93
|
};
|
|
89
94
|
};
|
|
95
|
+
export var visitCardLinkAnalyticsOnly = function visitCardLinkAnalyticsOnly(editorAnalyticsApi, inputMethod) {
|
|
96
|
+
return function (state, dispatch) {
|
|
97
|
+
if (!(state.selection instanceof NodeSelection)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
var type = state.selection.node.type;
|
|
101
|
+
if (dispatch) {
|
|
102
|
+
var tr = state.tr;
|
|
103
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent(buildVisitedNonHyperLinkPayload(type.name, inputMethod))(tr);
|
|
104
|
+
dispatch(tr);
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
90
109
|
export var openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
91
110
|
return function (state, dispatch) {
|
|
92
111
|
if (!(state.selection instanceof NodeSelection)) {
|
|
@@ -444,7 +463,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
444
463
|
onClick: function onClick() {
|
|
445
464
|
var _pluginInjectionApi$c2, _pluginInjectionApi$f;
|
|
446
465
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 || _pluginInjectionApi$c2.actions.execute( // @ts-ignore
|
|
447
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.commands.copyNode(node.type));
|
|
466
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.commands.copyNode(node.type, INPUT_METHOD.FLOATING_TB));
|
|
448
467
|
return true;
|
|
449
468
|
},
|
|
450
469
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
@@ -635,7 +654,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
635
654
|
onClick: function onClick() {
|
|
636
655
|
var _pluginInjectionApi$c3, _pluginInjectionApi$f2;
|
|
637
656
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c3 = pluginInjectionApi.core) === null || _pluginInjectionApi$c3 === void 0 || _pluginInjectionApi$c3.actions.execute( // @ts-ignore
|
|
638
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.commands.copyNode(node.type));
|
|
657
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.commands.copyNode(node.type, INPUT_METHOD.FLOATING_TB));
|
|
639
658
|
return true;
|
|
640
659
|
},
|
|
641
660
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true, akEditorSelectedNodeClassName),
|
|
@@ -7,7 +7,8 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
7
7
|
import type { cardPlugin } from '../index';
|
|
8
8
|
import type { CardPluginOptions } from '../types';
|
|
9
9
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
10
|
-
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, inputMethod: INPUT_METHOD.
|
|
10
|
+
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR) => Command;
|
|
11
|
+
export declare const visitCardLinkAnalyticsOnly: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, inputMethod: INPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK) => Command;
|
|
11
12
|
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
12
13
|
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
13
14
|
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
|
@@ -7,7 +7,8 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
7
7
|
import type { cardPlugin } from '../index';
|
|
8
8
|
import type { CardPluginOptions } from '../types';
|
|
9
9
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
10
|
-
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, inputMethod: INPUT_METHOD.
|
|
10
|
+
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR) => Command;
|
|
11
|
+
export declare const visitCardLinkAnalyticsOnly: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, inputMethod: INPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK) => Command;
|
|
11
12
|
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
12
13
|
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
13
14
|
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.27",
|
|
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": "^
|
|
40
|
+
"@atlaskit/editor-common": "^104.0.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": "^4.
|
|
48
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^4.1.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",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@atlaskit/menu": "^5.0.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
62
|
"@atlaskit/primitives": "^14.7.0",
|
|
63
|
-
"@atlaskit/smart-card": "^36.
|
|
63
|
+
"@atlaskit/smart-card": "^36.15.0",
|
|
64
64
|
"@atlaskit/theme": "^18.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^4.16.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.8.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -140,10 +140,16 @@
|
|
|
140
140
|
"platform_editor_controls_patch_6": {
|
|
141
141
|
"type": "boolean"
|
|
142
142
|
},
|
|
143
|
+
"platform_editor_controls_patch_analytics": {
|
|
144
|
+
"type": "boolean"
|
|
145
|
+
},
|
|
146
|
+
"platform_editor_controls_patch_analytics_2": {
|
|
147
|
+
"type": "boolean"
|
|
148
|
+
},
|
|
143
149
|
"smart_link_editor_update_toolbar_open_link": {
|
|
144
150
|
"type": "boolean"
|
|
145
151
|
},
|
|
146
|
-
"
|
|
152
|
+
"platform_editor_controls_patch_8": {
|
|
147
153
|
"type": "boolean"
|
|
148
154
|
}
|
|
149
155
|
},
|