@atlaskit/editor-plugin-card 10.1.1 → 10.1.3
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 +16 -0
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/index.js +4 -0
- package/dist/cjs/ui/EditorSmartCardEvents.js +2 -1
- package/dist/cjs/ui/HyperlinkToolbarAppearanceDropdown.js +1 -2
- package/dist/cjs/ui/LayoutButton/utils.js +11 -9
- package/dist/cjs/ui/toolbar.js +2 -3
- package/dist/es2019/ui/EditorLinkingPlatformAnalytics/index.js +4 -0
- package/dist/es2019/ui/EditorSmartCardEvents.js +2 -1
- package/dist/es2019/ui/HyperlinkToolbarAppearanceDropdown.js +1 -2
- package/dist/es2019/ui/LayoutButton/utils.js +15 -13
- package/dist/es2019/ui/toolbar.js +2 -3
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/index.js +4 -0
- package/dist/esm/ui/EditorSmartCardEvents.js +2 -1
- package/dist/esm/ui/HyperlinkToolbarAppearanceDropdown.js +1 -2
- package/dist/esm/ui/LayoutButton/utils.js +11 -9
- package/dist/esm/ui/toolbar.js +2 -3
- package/dist/types/ui/EditorLinkingPlatformAnalytics/index.d.ts +1 -1
- package/dist/types/ui/LayoutButton/utils.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +1 -1
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 10.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1c474ad18f3ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c474ad18f3ac) -
|
|
8
|
+
[ED-28566] Clean up platform_editor_controls_patch_15
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 10.1.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`13e707b0d5324`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/13e707b0d5324) -
|
|
16
|
+
Hydration fixes for card plugin ContentComponent
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 10.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
var _EditorAnalyticsContext = require("../EditorAnalyticsContext");
|
|
16
17
|
var _DatasourceEvents = require("./DatasourceEvents");
|
|
17
18
|
var _LinkEvents = require("./LinkEvents");
|
|
@@ -27,6 +28,9 @@ var EditorLinkingPlatformAnalytics = exports.EditorLinkingPlatformAnalytics = /*
|
|
|
27
28
|
return (0, _createClass2.default)(EditorLinkingPlatformAnalytics, [{
|
|
28
29
|
key: "render",
|
|
29
30
|
value: function render() {
|
|
31
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && !this.props.editorView) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
30
34
|
return /*#__PURE__*/_react.default.createElement(_linkProvider.EditorSmartCardProvider, null, /*#__PURE__*/_react.default.createElement(_linkProvider.EditorSmartCardProviderValueGuard, null, /*#__PURE__*/_react.default.createElement(_EditorAnalyticsContext.EditorAnalyticsContext, {
|
|
31
35
|
editorView: this.props.editorView
|
|
32
36
|
}, /*#__PURE__*/_react.default.createElement(_LinkEvents.LinkEventsBinding
|
|
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.EditorSmartCardEvents = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _smartCard = require("@atlaskit/smart-card");
|
|
9
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
9
10
|
var _actions = require("../pm-plugins/actions");
|
|
10
11
|
var EditorSmartCardEvents = exports.EditorSmartCardEvents = function EditorSmartCardEvents(_ref) {
|
|
11
12
|
var editorView = _ref.editorView;
|
|
12
13
|
var events = (0, _smartCard.useSmartLinkEvents)();
|
|
13
14
|
(0, _react.useEffect)(function () {
|
|
14
|
-
if (!events) {
|
|
15
|
+
if (!events || (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
editorView.dispatch((0, _actions.registerSmartCardEvents)(events)(editorView.state.tr));
|
|
@@ -15,7 +15,6 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
|
15
15
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
16
16
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
17
17
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
20
19
|
var _LinkToolbarAppearanceDropdown = require("./LinkToolbarAppearanceDropdown");
|
|
21
20
|
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" != _typeof(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); }
|
|
@@ -211,7 +210,7 @@ var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
|
|
|
211
210
|
dispatchCommand: dispatchCommand,
|
|
212
211
|
settingsConfig: settingsConfig,
|
|
213
212
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
214
|
-
})), !(
|
|
213
|
+
})), !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean((_props$editorPluginAp3 = props.editorPluginApi) === null || _props$editorPluginAp3 === void 0 ? void 0 : _props$editorPluginAp3.toolbar)) && /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarSeparator, {
|
|
215
214
|
areAnyNewToolbarFlagsEnabled: (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean((_props$editorPluginAp4 = props.editorPluginApi) === null || _props$editorPluginAp4 === void 0 ? void 0 : _props$editorPluginAp4.toolbar))
|
|
216
215
|
}));
|
|
217
216
|
};
|
|
@@ -12,15 +12,17 @@ var _types = require("./types");
|
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var getDatasource = exports.getDatasource = function getDatasource(editorView) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
if (editorView) {
|
|
16
|
+
var _editorView$state = editorView.state,
|
|
17
|
+
selection = _editorView$state.selection,
|
|
18
|
+
schema = _editorView$state.schema;
|
|
19
|
+
var blockCard = schema.nodes.blockCard;
|
|
20
|
+
var findResult = (0, _utils.findSelectedNodeOfType)([blockCard])(selection);
|
|
21
|
+
if (findResult && (0, _utils2.isDatasourceNode)(findResult.node)) {
|
|
22
|
+
return _objectSpread(_objectSpread({}, findResult), {}, {
|
|
23
|
+
node: findResult.node
|
|
24
|
+
});
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
return {
|
|
26
28
|
node: undefined,
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -32,7 +32,6 @@ var _linkBrokenEditorUnlink = _interopRequireDefault(require("@atlaskit/icon/cor
|
|
|
32
32
|
var _linkExternalShortcut = _interopRequireDefault(require("@atlaskit/icon/core/migration/link-external--shortcut"));
|
|
33
33
|
var _settingsEditorSettings = _interopRequireDefault(require("@atlaskit/icon/core/migration/settings--editor-settings"));
|
|
34
34
|
var _settings = _interopRequireDefault(require("@atlaskit/icon/core/settings"));
|
|
35
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
36
35
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
37
36
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
38
37
|
var _doc = require("../pm-plugins/doc");
|
|
@@ -384,10 +383,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
384
383
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
385
384
|
title: intl.formatMessage(_messages.default.remove),
|
|
386
385
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
387
|
-
}]) : [].concat(openPreviewPanelItems, editButtonItems, (0, _toConsumableArray2.default)(
|
|
386
|
+
}]) : [].concat(openPreviewPanelItems, editButtonItems, (0, _toConsumableArray2.default)([].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi, !areAllNewToolbarFlagsDisabled)), [{
|
|
388
387
|
type: 'separator',
|
|
389
388
|
fullHeight: true
|
|
390
|
-
}])
|
|
389
|
+
}])), [{
|
|
391
390
|
id: 'editor.link.openLink',
|
|
392
391
|
type: 'button',
|
|
393
392
|
icon: _linkExternal.default,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { EditorAnalyticsContext } from '../EditorAnalyticsContext';
|
|
4
5
|
import { DatasourceEventsBinding } from './DatasourceEvents';
|
|
5
6
|
import { LinkEventsBinding } from './LinkEvents';
|
|
@@ -7,6 +8,9 @@ import { LinkEventsBinding } from './LinkEvents';
|
|
|
7
8
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
8
9
|
export class EditorLinkingPlatformAnalytics extends React.PureComponent {
|
|
9
10
|
render() {
|
|
11
|
+
if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !this.props.editorView) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
10
14
|
return /*#__PURE__*/React.createElement(EditorSmartCardProvider, null, /*#__PURE__*/React.createElement(EditorSmartCardProviderValueGuard, null, /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
|
|
11
15
|
editorView: this.props.editorView
|
|
12
16
|
}, /*#__PURE__*/React.createElement(LinkEventsBinding
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { useSmartLinkEvents } from '@atlaskit/smart-card';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { registerSmartCardEvents } from '../pm-plugins/actions';
|
|
4
5
|
export const EditorSmartCardEvents = ({
|
|
5
6
|
editorView
|
|
6
7
|
}) => {
|
|
7
8
|
const events = useSmartLinkEvents();
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
if (!events) {
|
|
10
|
+
if (!events || expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
editorView.dispatch(registerSmartCardEvents(events)(editorView.state.tr));
|
|
@@ -4,7 +4,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
4
4
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
6
6
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
9
8
|
import { LinkAppearanceMenu } from './LinkToolbarAppearanceDropdown';
|
|
10
9
|
const CustomHyperlinkDropdown = props => {
|
|
@@ -126,7 +125,7 @@ const CustomHyperlinkDropdown = props => {
|
|
|
126
125
|
dispatchCommand: dispatchCommand,
|
|
127
126
|
settingsConfig: settingsConfig,
|
|
128
127
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
129
|
-
})), !
|
|
128
|
+
})), !areToolbarFlagsEnabled(Boolean((_props$editorPluginAp6 = props.editorPluginApi) === null || _props$editorPluginAp6 === void 0 ? void 0 : _props$editorPluginAp6.toolbar)) && /*#__PURE__*/React.createElement(Separator, {
|
|
130
129
|
areAnyNewToolbarFlagsEnabled: areToolbarFlagsEnabled(Boolean((_props$editorPluginAp7 = props.editorPluginApi) === null || _props$editorPluginAp7 === void 0 ? void 0 : _props$editorPluginAp7.toolbar))
|
|
131
130
|
}));
|
|
132
131
|
};
|
|
@@ -2,19 +2,21 @@ import { findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
2
2
|
import { isDatasourceNode } from '../../pm-plugins/utils';
|
|
3
3
|
import { DATASOURCE_TABLE_LAYOUTS } from './types';
|
|
4
4
|
export const getDatasource = editorView => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
if (editorView) {
|
|
6
|
+
const {
|
|
7
|
+
selection,
|
|
8
|
+
schema
|
|
9
|
+
} = editorView.state;
|
|
10
|
+
const {
|
|
11
|
+
blockCard
|
|
12
|
+
} = schema.nodes;
|
|
13
|
+
const findResult = findSelectedNodeOfType([blockCard])(selection);
|
|
14
|
+
if (findResult && isDatasourceNode(findResult.node)) {
|
|
15
|
+
return {
|
|
16
|
+
...findResult,
|
|
17
|
+
node: findResult.node
|
|
18
|
+
};
|
|
19
|
+
}
|
|
18
20
|
}
|
|
19
21
|
return {
|
|
20
22
|
node: undefined,
|
|
@@ -22,7 +22,6 @@ import UnlinkIcon from '@atlaskit/icon/core/migration/link-broken--editor-unlink
|
|
|
22
22
|
import OpenIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
|
|
23
23
|
import CogIcon from '@atlaskit/icon/core/migration/settings--editor-settings';
|
|
24
24
|
import SettingsIcon from '@atlaskit/icon/core/settings';
|
|
25
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
26
25
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
27
26
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
28
27
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
@@ -372,10 +371,10 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
372
371
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
373
372
|
title: intl.formatMessage(commonMessages.remove),
|
|
374
373
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
375
|
-
}] : [...openPreviewPanelItems, ...editButtonItems, ...
|
|
374
|
+
}] : [...openPreviewPanelItems, ...editButtonItems, ...[...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi, !areAllNewToolbarFlagsDisabled), {
|
|
376
375
|
type: 'separator',
|
|
377
376
|
fullHeight: true
|
|
378
|
-
}]
|
|
377
|
+
}], {
|
|
379
378
|
id: 'editor.link.openLink',
|
|
380
379
|
type: 'button',
|
|
381
380
|
icon: LinkExternalIcon,
|
|
@@ -7,6 +7,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
11
|
import { EditorAnalyticsContext } from '../EditorAnalyticsContext';
|
|
11
12
|
import { DatasourceEventsBinding } from './DatasourceEvents';
|
|
12
13
|
import { LinkEventsBinding } from './LinkEvents';
|
|
@@ -21,6 +22,9 @@ export var EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureCo
|
|
|
21
22
|
return _createClass(EditorLinkingPlatformAnalytics, [{
|
|
22
23
|
key: "render",
|
|
23
24
|
value: function render() {
|
|
25
|
+
if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !this.props.editorView) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
24
28
|
return /*#__PURE__*/React.createElement(EditorSmartCardProvider, null, /*#__PURE__*/React.createElement(EditorSmartCardProviderValueGuard, null, /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
|
|
25
29
|
editorView: this.props.editorView
|
|
26
30
|
}, /*#__PURE__*/React.createElement(LinkEventsBinding
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { useSmartLinkEvents } from '@atlaskit/smart-card';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { registerSmartCardEvents } from '../pm-plugins/actions';
|
|
4
5
|
export var EditorSmartCardEvents = function EditorSmartCardEvents(_ref) {
|
|
5
6
|
var editorView = _ref.editorView;
|
|
6
7
|
var events = useSmartLinkEvents();
|
|
7
8
|
useEffect(function () {
|
|
8
|
-
if (!events) {
|
|
9
|
+
if (!events || expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
9
10
|
return;
|
|
10
11
|
}
|
|
11
12
|
editorView.dispatch(registerSmartCardEvents(events)(editorView.state.tr));
|
|
@@ -7,7 +7,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
7
7
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
9
9
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
12
11
|
import { LinkAppearanceMenu } from './LinkToolbarAppearanceDropdown';
|
|
13
12
|
var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
|
|
@@ -202,7 +201,7 @@ var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
|
|
|
202
201
|
dispatchCommand: dispatchCommand,
|
|
203
202
|
settingsConfig: settingsConfig,
|
|
204
203
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
205
|
-
})), !
|
|
204
|
+
})), !areToolbarFlagsEnabled(Boolean((_props$editorPluginAp3 = props.editorPluginApi) === null || _props$editorPluginAp3 === void 0 ? void 0 : _props$editorPluginAp3.toolbar)) && /*#__PURE__*/React.createElement(Separator, {
|
|
206
205
|
areAnyNewToolbarFlagsEnabled: areToolbarFlagsEnabled(Boolean((_props$editorPluginAp4 = props.editorPluginApi) === null || _props$editorPluginAp4 === void 0 ? void 0 : _props$editorPluginAp4.toolbar))
|
|
207
206
|
}));
|
|
208
207
|
};
|
|
@@ -5,15 +5,17 @@ import { findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
5
5
|
import { isDatasourceNode } from '../../pm-plugins/utils';
|
|
6
6
|
import { DATASOURCE_TABLE_LAYOUTS } from './types';
|
|
7
7
|
export var getDatasource = function getDatasource(editorView) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
if (editorView) {
|
|
9
|
+
var _editorView$state = editorView.state,
|
|
10
|
+
selection = _editorView$state.selection,
|
|
11
|
+
schema = _editorView$state.schema;
|
|
12
|
+
var blockCard = schema.nodes.blockCard;
|
|
13
|
+
var findResult = findSelectedNodeOfType([blockCard])(selection);
|
|
14
|
+
if (findResult && isDatasourceNode(findResult.node)) {
|
|
15
|
+
return _objectSpread(_objectSpread({}, findResult), {}, {
|
|
16
|
+
node: findResult.node
|
|
17
|
+
});
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
return {
|
|
19
21
|
node: undefined,
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -26,7 +26,6 @@ import UnlinkIcon from '@atlaskit/icon/core/migration/link-broken--editor-unlink
|
|
|
26
26
|
import OpenIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
|
|
27
27
|
import CogIcon from '@atlaskit/icon/core/migration/settings--editor-settings';
|
|
28
28
|
import SettingsIcon from '@atlaskit/icon/core/settings';
|
|
29
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
30
29
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
31
30
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
32
31
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
@@ -375,10 +374,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
375
374
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
376
375
|
title: intl.formatMessage(commonMessages.remove),
|
|
377
376
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
378
|
-
}]) : [].concat(openPreviewPanelItems, editButtonItems, _toConsumableArray(
|
|
377
|
+
}]) : [].concat(openPreviewPanelItems, editButtonItems, _toConsumableArray([].concat(_toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi, !areAllNewToolbarFlagsDisabled)), [{
|
|
379
378
|
type: 'separator',
|
|
380
379
|
fullHeight: true
|
|
381
|
-
}])
|
|
380
|
+
}])), [{
|
|
382
381
|
id: 'editor.link.openLink',
|
|
383
382
|
type: 'button',
|
|
384
383
|
icon: LinkExternalIcon,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { type DatasourceTableLayout } from './types';
|
|
3
|
-
export declare const getDatasource: (editorView: EditorView) => {
|
|
3
|
+
export declare const getDatasource: (editorView: EditorView | undefined) => {
|
|
4
4
|
node: import("../../types").DatasourceNode;
|
|
5
5
|
start: number;
|
|
6
6
|
depth: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { type DatasourceTableLayout } from './types';
|
|
3
|
-
export declare const getDatasource: (editorView: EditorView) => {
|
|
3
|
+
export declare const getDatasource: (editorView: EditorView | undefined) => {
|
|
4
4
|
node: import("../../types").DatasourceNode;
|
|
5
5
|
start: number;
|
|
6
6
|
depth: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.3",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
49
49
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
50
50
|
"@atlaskit/frontend-utilities": "^3.1.0",
|
|
51
|
-
"@atlaskit/icon": "^28.
|
|
51
|
+
"@atlaskit/icon": "^28.2.0",
|
|
52
52
|
"@atlaskit/link": "^3.2.0",
|
|
53
53
|
"@atlaskit/link-analytics": "^11.0.0",
|
|
54
54
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
55
55
|
"@atlaskit/link-datasource": "^4.23.0",
|
|
56
|
-
"@atlaskit/linking-common": "^9.
|
|
56
|
+
"@atlaskit/linking-common": "^9.6.0",
|
|
57
57
|
"@atlaskit/linking-types": "^14.0.0",
|
|
58
58
|
"@atlaskit/menu": "^8.4.0",
|
|
59
59
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@atlaskit/primitives": "^14.14.0",
|
|
62
62
|
"@atlaskit/smart-card": "^41.0.0",
|
|
63
63
|
"@atlaskit/theme": "^21.0.0",
|
|
64
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^12.23.0",
|
|
65
65
|
"@atlaskit/tokens": "^6.3.0",
|
|
66
66
|
"@babel/runtime": "^7.0.0",
|
|
67
67
|
"@emotion/react": "^11.7.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"uuid": "^3.1.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^109.
|
|
74
|
+
"@atlaskit/editor-common": "^109.8.0",
|
|
75
75
|
"@atlaskit/link-provider": "^4.0.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -122,9 +122,6 @@
|
|
|
122
122
|
"dst-a11y__replace-anchor-with-link__linking-platfo": {
|
|
123
123
|
"type": "boolean"
|
|
124
124
|
},
|
|
125
|
-
"platform_editor_controls_patch_15": {
|
|
126
|
-
"type": "boolean"
|
|
127
|
-
},
|
|
128
125
|
"platform_editor_adf_with_localid": {
|
|
129
126
|
"type": "boolean"
|
|
130
127
|
}
|