@atlaskit/editor-plugin-card 7.3.0 → 7.3.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 +8 -0
- package/dist/cjs/ui/OpenPreviewButton/index.js +78 -0
- package/dist/cjs/ui/toolbar.js +14 -2
- package/dist/es2019/ui/OpenPreviewButton/index.js +73 -0
- package/dist/es2019/ui/toolbar.js +12 -2
- package/dist/esm/ui/OpenPreviewButton/index.js +71 -0
- package/dist/esm/ui/toolbar.js +14 -2
- package/dist/types/nodeviews/blockCard.d.ts +3 -3
- package/dist/types/nodeviews/datasource.d.ts +1 -1
- package/dist/types/nodeviews/embedCard.d.ts +4 -4
- package/dist/types/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
- package/dist/types/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
- package/dist/types/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
- package/dist/types/pm-plugins/actions.d.ts +1 -1
- package/dist/types/pm-plugins/doc.d.ts +1 -1
- package/dist/types/pm-plugins/util/resolve.d.ts +1 -1
- package/dist/types/pm-plugins/util/state.d.ts +18 -18
- package/dist/types/pm-plugins/utils.d.ts +2 -5
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/ui/AwarenessWrapper/index.d.ts +0 -1
- package/dist/types/ui/ConfigureOverlay/index.d.ts +0 -1
- package/dist/types/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
- package/dist/types/ui/InlineCardOverlay/types.d.ts +0 -1
- package/dist/types/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/ui/LayoutButton/utils.d.ts +2 -1
- package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types/ui/OpenPreviewButton/index.d.ts +11 -0
- package/dist/types/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types/ui/ToolbarViewedEvent.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +3 -3
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +4 -4
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/doc.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/util/state.d.ts +18 -18
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +2 -5
- package/dist/types-ts4.5/types/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
- package/dist/types-ts4.5/ui/InlineCardOverlay/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +2 -1
- package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +11 -0
- package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 7.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a32e07a545f72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a32e07a545f72) -
|
|
8
|
+
[ux] Adds 'Open preview panel' button to the smartlink toolbar when the panel is supported.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 7.3.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OpenPreviewPanelToolbarButton = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
10
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
11
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
|
+
var _panelRight = _interopRequireDefault(require("@atlaskit/icon/core/panel-right"));
|
|
13
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
14
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _smartCard = require("@atlaskit/smart-card");
|
|
16
|
+
var OpenPreviewPanelToolbarButton = exports.OpenPreviewPanelToolbarButton = function OpenPreviewPanelToolbarButton(_ref) {
|
|
17
|
+
var node = _ref.node,
|
|
18
|
+
intl = _ref.intl;
|
|
19
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
20
|
+
store = _useSmartLinkContext.store,
|
|
21
|
+
isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
|
|
22
|
+
openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
|
|
23
|
+
var url = node.attrs.url;
|
|
24
|
+
var cardState = store === null || store === void 0 ? void 0 : store.getState()[url];
|
|
25
|
+
if (cardState) {
|
|
26
|
+
var ari = (0, _smartCard.getObjectAri)(cardState.details);
|
|
27
|
+
var name = (0, _smartCard.getObjectName)(cardState.details);
|
|
28
|
+
var iconUrl = (0, _smartCard.getObjectIconUrl)(cardState.details);
|
|
29
|
+
var isPanelAvailable = ari && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
30
|
+
ari: ari
|
|
31
|
+
}));
|
|
32
|
+
var handleOpenGlancePanelClick = function handleOpenGlancePanelClick() {
|
|
33
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
34
|
+
openPreviewPanel({
|
|
35
|
+
url: url,
|
|
36
|
+
ari: ari,
|
|
37
|
+
name: name || '',
|
|
38
|
+
iconUrl: iconUrl
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var title = intl.formatMessage(_messages.linkMessages.openPreviewPanel);
|
|
43
|
+
var icon = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ? /*#__PURE__*/_react.default.createElement(_panelRight.default, {
|
|
44
|
+
label: "",
|
|
45
|
+
spacing: "spacious"
|
|
46
|
+
}) :
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
// This is a hack required for Jira until areToolbarFlagsEnabled are enabled to ensure the icon has padding
|
|
49
|
+
// Padding is removed when areToolbarFlagsEnabed for a button with icon only in platform/packages/editor/editor-common/src/ui/FloatingToolbar/Button.tsx
|
|
50
|
+
_react.default.createElement(_compiled.Inline, {
|
|
51
|
+
as: "span",
|
|
52
|
+
space: "space.050",
|
|
53
|
+
alignBlock: "center"
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
55
|
+
as: "span",
|
|
56
|
+
"aria-hidden": true,
|
|
57
|
+
role: "presentation"
|
|
58
|
+
}), /*#__PURE__*/_react.default.createElement(_panelRight.default, {
|
|
59
|
+
label: "",
|
|
60
|
+
spacing: "spacious"
|
|
61
|
+
}), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
62
|
+
as: "span",
|
|
63
|
+
"aria-hidden": true,
|
|
64
|
+
role: "presentation"
|
|
65
|
+
}));
|
|
66
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
68
|
+
gap: "space.050"
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
70
|
+
testId: "open-preview-panel-floating-toolbar-button",
|
|
71
|
+
onClick: handleOpenGlancePanelClick,
|
|
72
|
+
icon: icon,
|
|
73
|
+
title: title
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
};
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -45,6 +45,7 @@ var _HyperlinkToolbarAppearance = require("./HyperlinkToolbarAppearance");
|
|
|
45
45
|
var _HyperlinkToolbarAppearanceDropdown = require("./HyperlinkToolbarAppearanceDropdown");
|
|
46
46
|
var _LinkToolbarAppearance = require("./LinkToolbarAppearance");
|
|
47
47
|
var _LinkToolbarAppearanceDropdown = require("./LinkToolbarAppearanceDropdown");
|
|
48
|
+
var _OpenPreviewButton = require("./OpenPreviewButton");
|
|
48
49
|
var _ToolbarViewedEvent = require("./ToolbarViewedEvent");
|
|
49
50
|
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); }
|
|
50
51
|
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; }
|
|
@@ -330,7 +331,18 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
330
331
|
testId: 'link-toolbar-edit-link-button',
|
|
331
332
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
332
333
|
}];
|
|
333
|
-
var
|
|
334
|
+
var openPreviewPanelItems = (0, _platformFeatureFlags.fg)('platform_editor_preview_panel_linking') ? [{
|
|
335
|
+
type: 'custom',
|
|
336
|
+
fallback: [],
|
|
337
|
+
render: function render() {
|
|
338
|
+
return /*#__PURE__*/_react.default.createElement(_OpenPreviewButton.OpenPreviewPanelToolbarButton, {
|
|
339
|
+
node: node,
|
|
340
|
+
intl: intl,
|
|
341
|
+
editorAnalyticsApi: editorAnalyticsApi
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}] : [];
|
|
345
|
+
var toolbarItems = isNewEditorToolbarDisabled ? [].concat(editItems, commentItems, openPreviewPanelItems, [{
|
|
334
346
|
id: 'editor.link.openLink',
|
|
335
347
|
type: 'button',
|
|
336
348
|
icon: _linkExternal.default,
|
|
@@ -367,7 +379,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
367
379
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
368
380
|
title: intl.formatMessage(_messages.default.remove),
|
|
369
381
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
370
|
-
}]) : [].concat(editButtonItems, (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
382
|
+
}]) : [].concat(openPreviewPanelItems, editButtonItems, (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
371
383
|
type: 'separator',
|
|
372
384
|
fullHeight: true
|
|
373
385
|
}]) : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { linkMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
4
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
6
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
7
|
+
import { Inline, Box, Flex } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
|
|
9
|
+
export const OpenPreviewPanelToolbarButton = ({
|
|
10
|
+
node,
|
|
11
|
+
intl
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
store,
|
|
15
|
+
isPreviewPanelAvailable,
|
|
16
|
+
openPreviewPanel
|
|
17
|
+
} = useSmartLinkContext();
|
|
18
|
+
const url = node.attrs.url;
|
|
19
|
+
const cardState = store === null || store === void 0 ? void 0 : store.getState()[url];
|
|
20
|
+
if (cardState) {
|
|
21
|
+
const ari = getObjectAri(cardState.details);
|
|
22
|
+
const name = getObjectName(cardState.details);
|
|
23
|
+
const iconUrl = getObjectIconUrl(cardState.details);
|
|
24
|
+
const isPanelAvailable = ari && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
25
|
+
ari
|
|
26
|
+
}));
|
|
27
|
+
const handleOpenGlancePanelClick = () => {
|
|
28
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
29
|
+
openPreviewPanel({
|
|
30
|
+
url,
|
|
31
|
+
ari,
|
|
32
|
+
name: name || '',
|
|
33
|
+
iconUrl
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const title = intl.formatMessage(linkMessages.openPreviewPanel);
|
|
38
|
+
const icon = areToolbarFlagsEnabled() ? /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
39
|
+
label: "",
|
|
40
|
+
spacing: "spacious"
|
|
41
|
+
}) :
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
// This is a hack required for Jira until areToolbarFlagsEnabled are enabled to ensure the icon has padding
|
|
44
|
+
// Padding is removed when areToolbarFlagsEnabed for a button with icon only in platform/packages/editor/editor-common/src/ui/FloatingToolbar/Button.tsx
|
|
45
|
+
React.createElement(Inline, {
|
|
46
|
+
as: "span",
|
|
47
|
+
space: "space.050",
|
|
48
|
+
alignBlock: "center"
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
50
|
+
as: "span",
|
|
51
|
+
"aria-hidden": true,
|
|
52
|
+
role: "presentation"
|
|
53
|
+
}), /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
54
|
+
label: "",
|
|
55
|
+
spacing: "spacious"
|
|
56
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
57
|
+
as: "span",
|
|
58
|
+
"aria-hidden": true,
|
|
59
|
+
role: "presentation"
|
|
60
|
+
}));
|
|
61
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
62
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
63
|
+
gap: "space.050"
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
65
|
+
testId: "open-preview-panel-floating-toolbar-button",
|
|
66
|
+
onClick: handleOpenGlancePanelClick,
|
|
67
|
+
icon: icon,
|
|
68
|
+
title: title
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
@@ -35,6 +35,7 @@ import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
|
35
35
|
import { getCustomHyperlinkAppearanceDropdown } from './HyperlinkToolbarAppearanceDropdown';
|
|
36
36
|
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
37
37
|
import { getLinkAppearanceDropdown } from './LinkToolbarAppearanceDropdown';
|
|
38
|
+
import { OpenPreviewPanelToolbarButton } from './OpenPreviewButton';
|
|
38
39
|
import { ToolbarViewedEvent } from './ToolbarViewedEvent';
|
|
39
40
|
export const removeCard = editorAnalyticsApi => commandWithMetadata((state, dispatch) => {
|
|
40
41
|
if (!(state.selection instanceof NodeSelection)) {
|
|
@@ -320,7 +321,16 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
320
321
|
testId: 'link-toolbar-edit-link-button',
|
|
321
322
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
322
323
|
}];
|
|
323
|
-
const
|
|
324
|
+
const openPreviewPanelItems = fg('platform_editor_preview_panel_linking') ? [{
|
|
325
|
+
type: 'custom',
|
|
326
|
+
fallback: [],
|
|
327
|
+
render: () => /*#__PURE__*/React.createElement(OpenPreviewPanelToolbarButton, {
|
|
328
|
+
node: node,
|
|
329
|
+
intl: intl,
|
|
330
|
+
editorAnalyticsApi: editorAnalyticsApi
|
|
331
|
+
})
|
|
332
|
+
}] : [];
|
|
333
|
+
const toolbarItems = isNewEditorToolbarDisabled ? [...editItems, ...commentItems, ...openPreviewPanelItems, {
|
|
324
334
|
id: 'editor.link.openLink',
|
|
325
335
|
type: 'button',
|
|
326
336
|
icon: LinkExternalIcon,
|
|
@@ -357,7 +367,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
357
367
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
358
368
|
title: intl.formatMessage(commonMessages.remove),
|
|
359
369
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
360
|
-
}] : [...editButtonItems, ...(fg('platform_editor_controls_patch_15') ? [...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
370
|
+
}] : [...openPreviewPanelItems, ...editButtonItems, ...(fg('platform_editor_controls_patch_15') ? [...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
361
371
|
type: 'separator',
|
|
362
372
|
fullHeight: true
|
|
363
373
|
}] : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { linkMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
4
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
6
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
7
|
+
import { Inline, Box, Flex } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
|
|
9
|
+
export var OpenPreviewPanelToolbarButton = function OpenPreviewPanelToolbarButton(_ref) {
|
|
10
|
+
var node = _ref.node,
|
|
11
|
+
intl = _ref.intl;
|
|
12
|
+
var _useSmartLinkContext = useSmartLinkContext(),
|
|
13
|
+
store = _useSmartLinkContext.store,
|
|
14
|
+
isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
|
|
15
|
+
openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
|
|
16
|
+
var url = node.attrs.url;
|
|
17
|
+
var cardState = store === null || store === void 0 ? void 0 : store.getState()[url];
|
|
18
|
+
if (cardState) {
|
|
19
|
+
var ari = getObjectAri(cardState.details);
|
|
20
|
+
var name = getObjectName(cardState.details);
|
|
21
|
+
var iconUrl = getObjectIconUrl(cardState.details);
|
|
22
|
+
var isPanelAvailable = ari && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
23
|
+
ari: ari
|
|
24
|
+
}));
|
|
25
|
+
var handleOpenGlancePanelClick = function handleOpenGlancePanelClick() {
|
|
26
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
27
|
+
openPreviewPanel({
|
|
28
|
+
url: url,
|
|
29
|
+
ari: ari,
|
|
30
|
+
name: name || '',
|
|
31
|
+
iconUrl: iconUrl
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var title = intl.formatMessage(linkMessages.openPreviewPanel);
|
|
36
|
+
var icon = areToolbarFlagsEnabled() ? /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
37
|
+
label: "",
|
|
38
|
+
spacing: "spacious"
|
|
39
|
+
}) :
|
|
40
|
+
/*#__PURE__*/
|
|
41
|
+
// This is a hack required for Jira until areToolbarFlagsEnabled are enabled to ensure the icon has padding
|
|
42
|
+
// Padding is removed when areToolbarFlagsEnabed for a button with icon only in platform/packages/editor/editor-common/src/ui/FloatingToolbar/Button.tsx
|
|
43
|
+
React.createElement(Inline, {
|
|
44
|
+
as: "span",
|
|
45
|
+
space: "space.050",
|
|
46
|
+
alignBlock: "center"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
48
|
+
as: "span",
|
|
49
|
+
"aria-hidden": true,
|
|
50
|
+
role: "presentation"
|
|
51
|
+
}), /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
52
|
+
label: "",
|
|
53
|
+
spacing: "spacious"
|
|
54
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
55
|
+
as: "span",
|
|
56
|
+
"aria-hidden": true,
|
|
57
|
+
role: "presentation"
|
|
58
|
+
}));
|
|
59
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
60
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
61
|
+
gap: "space.050"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
63
|
+
testId: "open-preview-panel-floating-toolbar-button",
|
|
64
|
+
onClick: handleOpenGlancePanelClick,
|
|
65
|
+
icon: icon,
|
|
66
|
+
title: title
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
};
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -39,6 +39,7 @@ import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
|
39
39
|
import { getCustomHyperlinkAppearanceDropdown } from './HyperlinkToolbarAppearanceDropdown';
|
|
40
40
|
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
41
41
|
import { getLinkAppearanceDropdown } from './LinkToolbarAppearanceDropdown';
|
|
42
|
+
import { OpenPreviewPanelToolbarButton } from './OpenPreviewButton';
|
|
42
43
|
import { ToolbarViewedEvent } from './ToolbarViewedEvent';
|
|
43
44
|
export var removeCard = function removeCard(editorAnalyticsApi) {
|
|
44
45
|
return commandWithMetadata(function (state, dispatch) {
|
|
@@ -321,7 +322,18 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
321
322
|
testId: 'link-toolbar-edit-link-button',
|
|
322
323
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
323
324
|
}];
|
|
324
|
-
var
|
|
325
|
+
var openPreviewPanelItems = fg('platform_editor_preview_panel_linking') ? [{
|
|
326
|
+
type: 'custom',
|
|
327
|
+
fallback: [],
|
|
328
|
+
render: function render() {
|
|
329
|
+
return /*#__PURE__*/React.createElement(OpenPreviewPanelToolbarButton, {
|
|
330
|
+
node: node,
|
|
331
|
+
intl: intl,
|
|
332
|
+
editorAnalyticsApi: editorAnalyticsApi
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}] : [];
|
|
336
|
+
var toolbarItems = isNewEditorToolbarDisabled ? [].concat(editItems, commentItems, openPreviewPanelItems, [{
|
|
325
337
|
id: 'editor.link.openLink',
|
|
326
338
|
type: 'button',
|
|
327
339
|
icon: LinkExternalIcon,
|
|
@@ -358,7 +370,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
358
370
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
359
371
|
title: intl.formatMessage(commonMessages.remove),
|
|
360
372
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
361
|
-
}]) : [].concat(editButtonItems, _toConsumableArray(fg('platform_editor_controls_patch_15') ? [].concat(_toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
373
|
+
}]) : [].concat(openPreviewPanelItems, editButtonItems, _toConsumableArray(fg('platform_editor_controls_patch_15') ? [].concat(_toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
362
374
|
type: 'separator',
|
|
363
375
|
fullHeight: true
|
|
364
376
|
}]) : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
@@ -13,15 +13,15 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
13
13
|
id?: string;
|
|
14
14
|
});
|
|
15
15
|
onResolve: (data: {
|
|
16
|
-
url?: string
|
|
17
|
-
title?: string
|
|
16
|
+
url?: string;
|
|
17
|
+
title?: string;
|
|
18
18
|
}) => void;
|
|
19
19
|
componentWillUnmount(): void;
|
|
20
20
|
private removeCardDispatched;
|
|
21
21
|
private removeCard;
|
|
22
22
|
gapCursorSpan: () => React.JSX.Element | undefined;
|
|
23
23
|
onError: ({ err }: {
|
|
24
|
-
err?: Error
|
|
24
|
+
err?: Error;
|
|
25
25
|
}) => void;
|
|
26
26
|
render(): React.JSX.Element;
|
|
27
27
|
}
|
|
@@ -32,7 +32,7 @@ export declare class DatasourceComponent extends React.PureComponent<DatasourceC
|
|
|
32
32
|
handleColumnResize: (key: string, width: number) => void;
|
|
33
33
|
handleWrappedColumnChange: (key: string, shouldWrap: boolean) => void;
|
|
34
34
|
onError: ({ err }: {
|
|
35
|
-
err?: Error
|
|
35
|
+
err?: Error;
|
|
36
36
|
}) => void;
|
|
37
37
|
private getColumnsInfo;
|
|
38
38
|
render(): jsx.JSX.Element | null;
|
|
@@ -22,9 +22,9 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
22
22
|
state: EmbedCardState;
|
|
23
23
|
private getPosSafely;
|
|
24
24
|
onResolve: (data: {
|
|
25
|
-
url?: string
|
|
26
|
-
title?: string
|
|
27
|
-
aspectRatio?: number
|
|
25
|
+
url?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
aspectRatio?: number;
|
|
28
28
|
}) => void;
|
|
29
29
|
updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
|
|
30
30
|
private getLineLength;
|
|
@@ -36,7 +36,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
36
36
|
saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
|
|
37
37
|
onHeightUpdate: (height: number) => void;
|
|
38
38
|
onError: ({ err }: {
|
|
39
|
-
err?: Error
|
|
39
|
+
err?: Error;
|
|
40
40
|
}) => void;
|
|
41
41
|
componentWillUnmount(): void;
|
|
42
42
|
private removeCardDispatched;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const blockCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const embedCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const inlineCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -17,7 +17,7 @@ export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) =
|
|
|
17
17
|
export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
|
|
18
18
|
export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
|
|
19
19
|
layout: DatasourceTableLayout;
|
|
20
|
-
datasourceTableRef?: HTMLElement
|
|
20
|
+
datasourceTableRef?: HTMLElement;
|
|
21
21
|
}) => (tr: Transaction) => Transaction;
|
|
22
22
|
export declare const showLinkToolbar: (tr: Transaction) => Transaction;
|
|
23
23
|
export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
|
|
@@ -12,7 +12,7 @@ import type { Request } from '../types';
|
|
|
12
12
|
export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf | DatasourceAdf, analyticsAction?: ACTION, editorAnalyticsApi?: EditorAnalyticsAPI, createAnalyticsEvent?: CreateUIAnalyticsEvent) => Command;
|
|
13
13
|
export declare const handleFallbackWithAnalytics: (request: Request, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
14
14
|
export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
|
|
15
|
-
export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: CardAppearance |
|
|
15
|
+
export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: CardAppearance | "url") => Transaction;
|
|
16
16
|
export declare const convertHyperlinkToSmartCard: (state: EditorState, source: CardReplacementInputMethod, appearance: CardAppearance, normalizeLinkText?: boolean) => Transaction;
|
|
17
17
|
export declare const changeSelectedCardToLink: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
18
18
|
export declare const changeSelectedCardToLinkFallback: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
@@ -6,4 +6,4 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
import type { DatasourceAdf } from '@atlaskit/linking-common';
|
|
7
7
|
import type { Request } from '../../types';
|
|
8
8
|
export declare const resolveWithProvider: (view: EditorView, provider: CardProvider, request: Request, options: CardOptions, editorAnalyticsApi: EditorAnalyticsAPI | undefined, createAnalyticsEvent: CreateUIAnalyticsEvent | undefined) => Promise<void | DatasourceAdf<Record<string, unknown>> | import("@atlaskit/linking-common").InlineCardAdf | import("@atlaskit/linking-common").BlockCardAdf | import("@atlaskit/linking-common").EmbedCardAdf>;
|
|
9
|
-
export declare const handleProvider: (_:
|
|
9
|
+
export declare const handleProvider: (_: "cardProvider", provider: Promise<CardProvider> | undefined, view: EditorView) => void;
|
|
@@ -8,35 +8,35 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
|
|
|
8
8
|
appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
|
|
9
9
|
compareLinkText: boolean;
|
|
10
10
|
source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
|
|
11
|
-
previousAppearance?:
|
|
12
|
-
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION
|
|
13
|
-
shouldReplaceLink?: boolean
|
|
11
|
+
previousAppearance?: import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
|
|
12
|
+
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION;
|
|
13
|
+
shouldReplaceLink?: boolean;
|
|
14
14
|
sourceEvent?: import("@atlaskit/analytics-next").UIAnalyticsEvent | null | undefined;
|
|
15
15
|
}[];
|
|
16
16
|
cards: {
|
|
17
17
|
pos: number;
|
|
18
|
-
title?: string
|
|
19
|
-
url?: string
|
|
20
|
-
id?: string
|
|
18
|
+
title?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
id?: string;
|
|
21
21
|
}[];
|
|
22
22
|
provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
|
|
23
23
|
datasourceStash: {
|
|
24
24
|
[x: string]: {
|
|
25
|
-
views: import("@atlaskit/linking-common").
|
|
25
|
+
views: import("@atlaskit/linking-common").DatasourceAdfView[];
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
showLinkingToolbar: boolean;
|
|
29
|
-
smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents
|
|
30
|
-
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance
|
|
29
|
+
smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents;
|
|
30
|
+
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance;
|
|
31
31
|
showDatasourceModal: boolean;
|
|
32
|
-
datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType
|
|
33
|
-
datasourceTableRef?: HTMLElement
|
|
34
|
-
layout?: "
|
|
35
|
-
inlineCardAwarenessCandidatePosition?: number
|
|
36
|
-
overlayCandidatePosition?: number
|
|
37
|
-
removeOverlay?: (
|
|
38
|
-
selectedInlineLinkPosition?: number
|
|
39
|
-
allowEmbeds?: boolean
|
|
40
|
-
allowBlockCards?: boolean
|
|
32
|
+
datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType;
|
|
33
|
+
datasourceTableRef?: HTMLElement;
|
|
34
|
+
layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout;
|
|
35
|
+
inlineCardAwarenessCandidatePosition?: number;
|
|
36
|
+
overlayCandidatePosition?: number;
|
|
37
|
+
removeOverlay?: () => void;
|
|
38
|
+
selectedInlineLinkPosition?: number;
|
|
39
|
+
allowEmbeds?: boolean;
|
|
40
|
+
allowBlockCards?: boolean;
|
|
41
41
|
};
|
|
42
42
|
export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];
|
|
@@ -22,17 +22,14 @@ export declare const displayInfoForCard: (node: Node, info?: CardInfo) => TitleU
|
|
|
22
22
|
export declare const findCardInfo: (state: EditorState) => CardInfo | undefined;
|
|
23
23
|
export declare const isEmbedSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
|
|
24
24
|
export declare const isBlockSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
|
|
25
|
-
export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext[
|
|
25
|
+
export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext["store"]) => {};
|
|
26
26
|
export declare const isDatasourceConfigEditable: (datasourceId: string) => boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Typeguard that checks node attributes are datasource node attributes
|
|
29
29
|
* ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
|
|
30
30
|
* this function will not be updated automatically
|
|
31
31
|
*/
|
|
32
|
-
export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is
|
|
33
|
-
url?: string | undefined;
|
|
34
|
-
datasource: import("@atlaskit/linking-common").Datasource<Record<string, unknown>>;
|
|
35
|
-
} & Partial<import("@atlaskit/adf-schema").RichMediaAttributes>;
|
|
32
|
+
export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is DatasourceNode["attrs"];
|
|
36
33
|
/**
|
|
37
34
|
* Typeguard that checks a node is a datasource node (blockCard and has datasource attributes)
|
|
38
35
|
* ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
|
|
@@ -31,7 +31,7 @@ export declare const buildEditLinkToolbar: ({ providerFactory, node, pluginInjec
|
|
|
31
31
|
providerFactory: ProviderFactory;
|
|
32
32
|
node: Node;
|
|
33
33
|
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
34
|
-
linkPicker?:
|
|
34
|
+
linkPicker?: LinkPickerOptions;
|
|
35
35
|
lpLinkPicker: boolean;
|
|
36
36
|
}) => FloatingToolbarItem<Command>;
|
|
37
37
|
export declare const editLinkToolbarConfig: (showLinkingToolbar: boolean, lpLinkPicker?: boolean) => Partial<FloatingToolbarConfig>;
|
|
@@ -2,6 +2,6 @@ import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlas
|
|
|
2
2
|
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
3
3
|
export declare const getCustomHyperlinkAppearanceDropdown: ({ url, intl, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
4
4
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
5
|
-
allowDatasource?: boolean
|
|
6
|
-
isDatasourceView?: boolean
|
|
5
|
+
allowDatasource?: boolean;
|
|
6
|
+
isDatasourceView?: boolean;
|
|
7
7
|
}) => FloatingToolbarCustom<Command>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import { type DatasourceTableLayout } from './types';
|
|
2
3
|
export declare const getDatasource: (editorView: EditorView) => {
|
|
3
4
|
node: import("../../types").DatasourceNode;
|
|
4
5
|
start: number;
|
|
@@ -8,4 +9,4 @@ export declare const getDatasource: (editorView: EditorView) => {
|
|
|
8
9
|
node: undefined;
|
|
9
10
|
pos: undefined;
|
|
10
11
|
};
|
|
11
|
-
export declare const isDatasourceTableLayout: (layout: unknown) => layout is
|
|
12
|
+
export declare const isDatasourceTableLayout: (layout: unknown) => layout is DatasourceTableLayout;
|
|
@@ -9,6 +9,6 @@ type Props = LinkToolbarAppearanceProps & {
|
|
|
9
9
|
export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
|
|
10
10
|
export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
|
|
11
11
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
12
|
-
allowDatasource?: boolean
|
|
12
|
+
allowDatasource?: boolean;
|
|
13
13
|
}) => FloatingToolbarDropdown<Command>;
|
|
14
14
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
type OpenPreviewPanelToolbarButtonProps = {
|
|
6
|
+
node: PMNode;
|
|
7
|
+
intl: IntlShape;
|
|
8
|
+
editorAnalyticsApi?: EditorAnalyticsAPI;
|
|
9
|
+
};
|
|
10
|
+
export declare const OpenPreviewPanelToolbarButton: ({ node, intl, }: OpenPreviewPanelToolbarButtonProps) => React.JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -32,7 +32,7 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
32
32
|
width: number | null;
|
|
33
33
|
layout: RichMediaLayout;
|
|
34
34
|
};
|
|
35
|
-
calcUnwrappedLayout: (pct: number, width: number) =>
|
|
35
|
+
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
36
36
|
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
37
37
|
/**
|
|
38
38
|
* The maxmimum number of grid columns this node can resize to.
|
|
@@ -7,5 +7,5 @@ type ToolbarViewedEventProps = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Provides analytics context and card context
|
|
9
9
|
*/
|
|
10
|
-
export declare const ToolbarViewedEvent: ({ url, display, editorView, }: ToolbarViewedEventProps & Omit<EditorAnalyticsContextProps,
|
|
10
|
+
export declare const ToolbarViewedEvent: ({ url, display, editorView, }: ToolbarViewedEventProps & Omit<EditorAnalyticsContextProps, "children">) => React.JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -13,15 +13,15 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
13
13
|
id?: string;
|
|
14
14
|
});
|
|
15
15
|
onResolve: (data: {
|
|
16
|
-
url?: string
|
|
17
|
-
title?: string
|
|
16
|
+
url?: string;
|
|
17
|
+
title?: string;
|
|
18
18
|
}) => void;
|
|
19
19
|
componentWillUnmount(): void;
|
|
20
20
|
private removeCardDispatched;
|
|
21
21
|
private removeCard;
|
|
22
22
|
gapCursorSpan: () => React.JSX.Element | undefined;
|
|
23
23
|
onError: ({ err }: {
|
|
24
|
-
err?: Error
|
|
24
|
+
err?: Error;
|
|
25
25
|
}) => void;
|
|
26
26
|
render(): React.JSX.Element;
|
|
27
27
|
}
|
|
@@ -32,7 +32,7 @@ export declare class DatasourceComponent extends React.PureComponent<DatasourceC
|
|
|
32
32
|
handleColumnResize: (key: string, width: number) => void;
|
|
33
33
|
handleWrappedColumnChange: (key: string, shouldWrap: boolean) => void;
|
|
34
34
|
onError: ({ err }: {
|
|
35
|
-
err?: Error
|
|
35
|
+
err?: Error;
|
|
36
36
|
}) => void;
|
|
37
37
|
private getColumnsInfo;
|
|
38
38
|
render(): jsx.JSX.Element | null;
|
|
@@ -22,9 +22,9 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
22
22
|
state: EmbedCardState;
|
|
23
23
|
private getPosSafely;
|
|
24
24
|
onResolve: (data: {
|
|
25
|
-
url?: string
|
|
26
|
-
title?: string
|
|
27
|
-
aspectRatio?: number
|
|
25
|
+
url?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
aspectRatio?: number;
|
|
28
28
|
}) => void;
|
|
29
29
|
updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
|
|
30
30
|
private getLineLength;
|
|
@@ -36,7 +36,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
36
36
|
saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
|
|
37
37
|
onHeightUpdate: (height: number) => void;
|
|
38
38
|
onError: ({ err }: {
|
|
39
|
-
err?: Error
|
|
39
|
+
err?: Error;
|
|
40
40
|
}) => void;
|
|
41
41
|
componentWillUnmount(): void;
|
|
42
42
|
private removeCardDispatched;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const blockCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const embedCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const inlineCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -17,7 +17,7 @@ export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) =
|
|
|
17
17
|
export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
|
|
18
18
|
export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
|
|
19
19
|
layout: DatasourceTableLayout;
|
|
20
|
-
datasourceTableRef?: HTMLElement
|
|
20
|
+
datasourceTableRef?: HTMLElement;
|
|
21
21
|
}) => (tr: Transaction) => Transaction;
|
|
22
22
|
export declare const showLinkToolbar: (tr: Transaction) => Transaction;
|
|
23
23
|
export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
|
|
@@ -12,7 +12,7 @@ import type { Request } from '../types';
|
|
|
12
12
|
export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf | DatasourceAdf, analyticsAction?: ACTION, editorAnalyticsApi?: EditorAnalyticsAPI, createAnalyticsEvent?: CreateUIAnalyticsEvent) => Command;
|
|
13
13
|
export declare const handleFallbackWithAnalytics: (request: Request, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
14
14
|
export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
|
|
15
|
-
export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: CardAppearance |
|
|
15
|
+
export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: CardAppearance | "url") => Transaction;
|
|
16
16
|
export declare const convertHyperlinkToSmartCard: (state: EditorState, source: CardReplacementInputMethod, appearance: CardAppearance, normalizeLinkText?: boolean) => Transaction;
|
|
17
17
|
export declare const changeSelectedCardToLink: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
18
18
|
export declare const changeSelectedCardToLinkFallback: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
@@ -6,4 +6,4 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
import type { DatasourceAdf } from '@atlaskit/linking-common';
|
|
7
7
|
import type { Request } from '../../types';
|
|
8
8
|
export declare const resolveWithProvider: (view: EditorView, provider: CardProvider, request: Request, options: CardOptions, editorAnalyticsApi: EditorAnalyticsAPI | undefined, createAnalyticsEvent: CreateUIAnalyticsEvent | undefined) => Promise<void | DatasourceAdf<Record<string, unknown>> | import("@atlaskit/linking-common").InlineCardAdf | import("@atlaskit/linking-common").BlockCardAdf | import("@atlaskit/linking-common").EmbedCardAdf>;
|
|
9
|
-
export declare const handleProvider: (_:
|
|
9
|
+
export declare const handleProvider: (_: "cardProvider", provider: Promise<CardProvider> | undefined, view: EditorView) => void;
|
|
@@ -8,35 +8,35 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
|
|
|
8
8
|
appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
|
|
9
9
|
compareLinkText: boolean;
|
|
10
10
|
source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
|
|
11
|
-
previousAppearance?:
|
|
12
|
-
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION
|
|
13
|
-
shouldReplaceLink?: boolean
|
|
11
|
+
previousAppearance?: import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
|
|
12
|
+
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION;
|
|
13
|
+
shouldReplaceLink?: boolean;
|
|
14
14
|
sourceEvent?: import("@atlaskit/analytics-next").UIAnalyticsEvent | null | undefined;
|
|
15
15
|
}[];
|
|
16
16
|
cards: {
|
|
17
17
|
pos: number;
|
|
18
|
-
title?: string
|
|
19
|
-
url?: string
|
|
20
|
-
id?: string
|
|
18
|
+
title?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
id?: string;
|
|
21
21
|
}[];
|
|
22
22
|
provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
|
|
23
23
|
datasourceStash: {
|
|
24
24
|
[x: string]: {
|
|
25
|
-
views: import("@atlaskit/linking-common").
|
|
25
|
+
views: import("@atlaskit/linking-common").DatasourceAdfView[];
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
showLinkingToolbar: boolean;
|
|
29
|
-
smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents
|
|
30
|
-
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance
|
|
29
|
+
smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents;
|
|
30
|
+
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance;
|
|
31
31
|
showDatasourceModal: boolean;
|
|
32
|
-
datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType
|
|
33
|
-
datasourceTableRef?: HTMLElement
|
|
34
|
-
layout?: "
|
|
35
|
-
inlineCardAwarenessCandidatePosition?: number
|
|
36
|
-
overlayCandidatePosition?: number
|
|
37
|
-
removeOverlay?: (
|
|
38
|
-
selectedInlineLinkPosition?: number
|
|
39
|
-
allowEmbeds?: boolean
|
|
40
|
-
allowBlockCards?: boolean
|
|
32
|
+
datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType;
|
|
33
|
+
datasourceTableRef?: HTMLElement;
|
|
34
|
+
layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout;
|
|
35
|
+
inlineCardAwarenessCandidatePosition?: number;
|
|
36
|
+
overlayCandidatePosition?: number;
|
|
37
|
+
removeOverlay?: () => void;
|
|
38
|
+
selectedInlineLinkPosition?: number;
|
|
39
|
+
allowEmbeds?: boolean;
|
|
40
|
+
allowBlockCards?: boolean;
|
|
41
41
|
};
|
|
42
42
|
export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];
|
|
@@ -22,17 +22,14 @@ export declare const displayInfoForCard: (node: Node, info?: CardInfo) => TitleU
|
|
|
22
22
|
export declare const findCardInfo: (state: EditorState) => CardInfo | undefined;
|
|
23
23
|
export declare const isEmbedSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
|
|
24
24
|
export declare const isBlockSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
|
|
25
|
-
export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext[
|
|
25
|
+
export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext["store"]) => {};
|
|
26
26
|
export declare const isDatasourceConfigEditable: (datasourceId: string) => boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Typeguard that checks node attributes are datasource node attributes
|
|
29
29
|
* ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
|
|
30
30
|
* this function will not be updated automatically
|
|
31
31
|
*/
|
|
32
|
-
export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is
|
|
33
|
-
url?: string | undefined;
|
|
34
|
-
datasource: import("@atlaskit/linking-common").Datasource<Record<string, unknown>>;
|
|
35
|
-
} & Partial<import("@atlaskit/adf-schema").RichMediaAttributes>;
|
|
32
|
+
export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is DatasourceNode["attrs"];
|
|
36
33
|
/**
|
|
37
34
|
* Typeguard that checks a node is a datasource node (blockCard and has datasource attributes)
|
|
38
35
|
* ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
|
|
@@ -31,7 +31,7 @@ export declare const buildEditLinkToolbar: ({ providerFactory, node, pluginInjec
|
|
|
31
31
|
providerFactory: ProviderFactory;
|
|
32
32
|
node: Node;
|
|
33
33
|
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
34
|
-
linkPicker?:
|
|
34
|
+
linkPicker?: LinkPickerOptions;
|
|
35
35
|
lpLinkPicker: boolean;
|
|
36
36
|
}) => FloatingToolbarItem<Command>;
|
|
37
37
|
export declare const editLinkToolbarConfig: (showLinkingToolbar: boolean, lpLinkPicker?: boolean) => Partial<FloatingToolbarConfig>;
|
|
@@ -2,6 +2,6 @@ import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlas
|
|
|
2
2
|
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
3
3
|
export declare const getCustomHyperlinkAppearanceDropdown: ({ url, intl, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
4
4
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
5
|
-
allowDatasource?: boolean
|
|
6
|
-
isDatasourceView?: boolean
|
|
5
|
+
allowDatasource?: boolean;
|
|
6
|
+
isDatasourceView?: boolean;
|
|
7
7
|
}) => FloatingToolbarCustom<Command>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import { type DatasourceTableLayout } from './types';
|
|
2
3
|
export declare const getDatasource: (editorView: EditorView) => {
|
|
3
4
|
node: import("../../types").DatasourceNode;
|
|
4
5
|
start: number;
|
|
@@ -8,4 +9,4 @@ export declare const getDatasource: (editorView: EditorView) => {
|
|
|
8
9
|
node: undefined;
|
|
9
10
|
pos: undefined;
|
|
10
11
|
};
|
|
11
|
-
export declare const isDatasourceTableLayout: (layout: unknown) => layout is
|
|
12
|
+
export declare const isDatasourceTableLayout: (layout: unknown) => layout is DatasourceTableLayout;
|
|
@@ -9,6 +9,6 @@ type Props = LinkToolbarAppearanceProps & {
|
|
|
9
9
|
export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
|
|
10
10
|
export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
|
|
11
11
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
12
|
-
allowDatasource?: boolean
|
|
12
|
+
allowDatasource?: boolean;
|
|
13
13
|
}) => FloatingToolbarDropdown<Command>;
|
|
14
14
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
type OpenPreviewPanelToolbarButtonProps = {
|
|
6
|
+
node: PMNode;
|
|
7
|
+
intl: IntlShape;
|
|
8
|
+
editorAnalyticsApi?: EditorAnalyticsAPI;
|
|
9
|
+
};
|
|
10
|
+
export declare const OpenPreviewPanelToolbarButton: ({ node, intl, }: OpenPreviewPanelToolbarButtonProps) => React.JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -32,7 +32,7 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
32
32
|
width: number | null;
|
|
33
33
|
layout: RichMediaLayout;
|
|
34
34
|
};
|
|
35
|
-
calcUnwrappedLayout: (pct: number, width: number) =>
|
|
35
|
+
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
36
36
|
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
37
37
|
/**
|
|
38
38
|
* The maxmimum number of grid columns this node can resize to.
|
|
@@ -7,5 +7,5 @@ type ToolbarViewedEventProps = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Provides analytics context and card context
|
|
9
9
|
*/
|
|
10
|
-
export declare const ToolbarViewedEvent: ({ url, display, editorView, }: ToolbarViewedEventProps & Omit<EditorAnalyticsContextProps,
|
|
10
|
+
export declare const ToolbarViewedEvent: ({ url, display, editorView, }: ToolbarViewedEventProps & Omit<EditorAnalyticsContextProps, "children">) => React.JSX.Element;
|
|
11
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
50
50
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
51
51
|
"@atlaskit/frontend-utilities": "^3.1.0",
|
|
52
|
-
"@atlaskit/icon": "^27.
|
|
52
|
+
"@atlaskit/icon": "^27.11.0",
|
|
53
53
|
"@atlaskit/link": "^3.2.0",
|
|
54
54
|
"@atlaskit/link-analytics": "^10.0.0",
|
|
55
55
|
"@atlaskit/link-client-extension": "^5.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/primitives": "^14.11.0",
|
|
63
63
|
"@atlaskit/smart-card": "^40.8.0",
|
|
64
64
|
"@atlaskit/theme": "^19.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^9.27.0",
|
|
66
66
|
"@atlaskit/tokens": "^6.0.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": "^107.
|
|
75
|
+
"@atlaskit/editor-common": "^107.21.0",
|
|
76
76
|
"@atlaskit/link-provider": "^3.4.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
78
78
|
"react-intl-next": "npm:react-intl@^5.18.1"
|