@atlaskit/editor-plugin-card 2.6.3 → 2.6.5
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/nodeviews/datasource.js +4 -1
- package/dist/cjs/nodeviews/genericCard.js +5 -3
- package/dist/cjs/nodeviews/inlineCard.js +15 -10
- package/dist/cjs/pm-plugins/doc.js +15 -5
- package/dist/cjs/pm-plugins/main.js +9 -6
- package/dist/cjs/ui/AwarenessWrapper/index.js +4 -1
- package/dist/cjs/ui/ConfigureOverlay/index.js +4 -1
- package/dist/cjs/ui/DatasourceAppearanceButton.js +4 -1
- package/dist/cjs/ui/EditDatasourceButton.js +4 -1
- package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +4 -1
- package/dist/cjs/ui/EditToolbarButton/index.js +4 -1
- package/dist/cjs/ui/InlineCardOverlay/index.js +4 -1
- package/dist/cjs/ui/LayoutButton/index.js +4 -1
- package/dist/cjs/ui/ResizableEmbedCard.js +4 -1
- package/dist/cjs/ui/useFetchDatasourceDataInfo.js +4 -1
- package/dist/cjs/ui/useFetchDatasourceInfo.js +4 -1
- package/dist/es2019/nodeviews/datasource.js +4 -1
- package/dist/es2019/nodeviews/genericCard.js +5 -3
- package/dist/es2019/nodeviews/inlineCard.js +16 -10
- package/dist/es2019/pm-plugins/doc.js +17 -7
- package/dist/es2019/pm-plugins/main.js +10 -5
- package/dist/es2019/ui/AwarenessWrapper/index.js +4 -1
- package/dist/es2019/ui/ConfigureOverlay/index.js +4 -1
- package/dist/es2019/ui/DatasourceAppearanceButton.js +4 -1
- package/dist/es2019/ui/EditDatasourceButton.js +4 -1
- package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +4 -1
- package/dist/es2019/ui/EditToolbarButton/index.js +4 -1
- package/dist/es2019/ui/InlineCardOverlay/index.js +4 -1
- package/dist/es2019/ui/LayoutButton/index.js +4 -1
- package/dist/es2019/ui/ResizableEmbedCard.js +4 -1
- package/dist/es2019/ui/useFetchDatasourceDataInfo.js +4 -1
- package/dist/es2019/ui/useFetchDatasourceInfo.js +4 -1
- package/dist/esm/nodeviews/datasource.js +4 -1
- package/dist/esm/nodeviews/genericCard.js +5 -3
- package/dist/esm/nodeviews/inlineCard.js +15 -10
- package/dist/esm/pm-plugins/doc.js +17 -7
- package/dist/esm/pm-plugins/main.js +9 -6
- package/dist/esm/ui/AwarenessWrapper/index.js +4 -1
- package/dist/esm/ui/ConfigureOverlay/index.js +4 -1
- package/dist/esm/ui/DatasourceAppearanceButton.js +4 -1
- package/dist/esm/ui/EditDatasourceButton.js +4 -1
- package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +4 -1
- package/dist/esm/ui/EditToolbarButton/index.js +4 -1
- package/dist/esm/ui/InlineCardOverlay/index.js +4 -1
- package/dist/esm/ui/LayoutButton/index.js +4 -1
- package/dist/esm/ui/ResizableEmbedCard.js +4 -1
- package/dist/esm/ui/useFetchDatasourceDataInfo.js +4 -1
- package/dist/esm/ui/useFetchDatasourceInfo.js +4 -1
- package/dist/types/nodeviews/datasource.d.ts +4 -1
- package/dist/types/nodeviews/genericCard.d.ts +1 -0
- package/dist/types/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/ui/InlineCardOverlay/index.d.ts +4 -1
- package/dist/types/ui/ResizableEmbedCard.d.ts +4 -1
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +4 -1
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types-ts4.5/ui/InlineCardOverlay/index.d.ts +4 -1
- package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +4 -1
- package/package.json +8 -5
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
3
3
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
5
8
|
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
6
9
|
|
|
7
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
4
7
|
import React from 'react';
|
|
5
8
|
|
|
6
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
2
5
|
import { useEffect, useState } from 'react';
|
|
3
6
|
import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
4
7
|
export const useFetchDatasourceDataInfo = ({
|
|
@@ -11,7 +11,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
11
11
|
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) { _defineProperty(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; }
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @jsxRuntime classic
|
|
16
|
+
* @jsx jsx
|
|
17
|
+
*/
|
|
15
18
|
import React from 'react';
|
|
16
19
|
|
|
17
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -22,7 +22,8 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
22
22
|
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
23
23
|
url = _ref.url,
|
|
24
24
|
onClickCallback = _ref.onClickCallback,
|
|
25
|
-
children = _ref.children
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
__livePage = _ref.__livePage;
|
|
26
27
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['editorViewMode']),
|
|
27
28
|
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
28
29
|
var onClick = useCallback(function (event) {
|
|
@@ -43,7 +44,7 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
43
44
|
*
|
|
44
45
|
* const allowNavigation = isLivePage && !onClickCallback;
|
|
45
46
|
*/
|
|
46
|
-
var _allowNavigation = !onClickCallback;
|
|
47
|
+
var _allowNavigation = __livePage && !onClickCallback;
|
|
47
48
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children({
|
|
48
49
|
onClick: _allowNavigation ? undefined : onClick
|
|
49
50
|
}));
|
|
@@ -112,7 +113,8 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
112
113
|
}, /*#__PURE__*/React.createElement(WithClickHandler, {
|
|
113
114
|
pluginInjectionApi: pluginInjectionApi,
|
|
114
115
|
onClickCallback: onClickCallback,
|
|
115
|
-
url: url
|
|
116
|
+
url: url,
|
|
117
|
+
__livePage: this.props.__livePage
|
|
116
118
|
}, function (_ref2) {
|
|
117
119
|
var onClick = _ref2.onClick;
|
|
118
120
|
return /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
@@ -92,7 +92,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
92
92
|
var WrappedInlineCardWithAwareness = Card(InlineCardWithAwareness, UnsupportedInline);
|
|
93
93
|
var WrappedInlineCard = Card(InlineCard, UnsupportedInline);
|
|
94
94
|
export function InlineCardNodeView(props) {
|
|
95
|
-
var
|
|
95
|
+
var _floatingToolbarState;
|
|
96
96
|
var useAlternativePreloader = props.useAlternativePreloader,
|
|
97
97
|
node = props.node,
|
|
98
98
|
view = props.view,
|
|
@@ -103,20 +103,20 @@ export function InlineCardNodeView(props) {
|
|
|
103
103
|
allowBlockCards = props.allowBlockCards,
|
|
104
104
|
enableInlineUpgradeFeatures = props.enableInlineUpgradeFeatures,
|
|
105
105
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
106
|
-
onClickCallback = props.onClickCallback
|
|
106
|
+
onClickCallback = props.onClickCallback,
|
|
107
|
+
__livePage = props.__livePage;
|
|
107
108
|
var _useState = useState(false),
|
|
108
109
|
_useState2 = _slicedToArray(_useState, 2),
|
|
109
110
|
isOverlayHovered = _useState2[0],
|
|
110
111
|
setIsOverlayHovered = _useState2[1];
|
|
111
|
-
var
|
|
112
|
-
|
|
112
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorViewMode']),
|
|
113
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
114
|
+
floatingToolbarState = _useSharedPluginState.floatingToolbarState;
|
|
115
|
+
var floatingToolbarNode = floatingToolbarState === null || floatingToolbarState === void 0 || (_floatingToolbarState = floatingToolbarState.configWithNodeInfo) === null || _floatingToolbarState === void 0 ? void 0 : _floatingToolbarState.node;
|
|
116
|
+
if (__livePage && fg('platform.linking-platform.smart-links-in-live-pages')) {
|
|
113
117
|
var showHoverPreview = floatingToolbarNode !== node;
|
|
114
118
|
var livePagesHoverCardFadeInDelay = 800;
|
|
115
|
-
|
|
116
|
-
targetElementPos: getPos(),
|
|
117
|
-
view: view,
|
|
118
|
-
isHoveredCallback: setIsOverlayHovered
|
|
119
|
-
}, /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
119
|
+
var inlineCard = /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
120
120
|
isHovered: isOverlayHovered,
|
|
121
121
|
node: node,
|
|
122
122
|
view: view,
|
|
@@ -129,7 +129,12 @@ export function InlineCardNodeView(props) {
|
|
|
129
129
|
hoverPreviewOptions: {
|
|
130
130
|
fadeInDelay: livePagesHoverCardFadeInDelay
|
|
131
131
|
}
|
|
132
|
-
})
|
|
132
|
+
});
|
|
133
|
+
return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
134
|
+
targetElementPos: getPos(),
|
|
135
|
+
view: view,
|
|
136
|
+
isHoveredCallback: setIsOverlayHovered
|
|
137
|
+
}, inlineCard);
|
|
133
138
|
}
|
|
134
139
|
return /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
|
|
135
140
|
node: node,
|
|
@@ -6,10 +6,10 @@ import isEqual from 'lodash/isEqual';
|
|
|
6
6
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, SMART_LINK_TYPE, unlinkPayload } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
9
|
-
import { getLinkCreationAnalyticsEvent, isFromCurrentDomain, nodesBetweenChanged, processRawValue } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { getAnnotationMarksForPos, getLinkCreationAnalyticsEvent, isFromCurrentDomain, nodesBetweenChanged, processRawValue } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
11
11
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
-
import {
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { appearanceForNodeType, isDatasourceConfigEditable, isDatasourceNode, selectedCardAppearance } from '../utils';
|
|
14
14
|
import { hideDatasourceModal, queueCards, removeDatasourceStash, resolveCard, setDatasourceStash } from './actions';
|
|
15
15
|
import { pluginKey } from './plugin-key';
|
|
@@ -28,6 +28,7 @@ function replaceLinksToCards(tr, cardAdf, schema, request) {
|
|
|
28
28
|
// replace all the outstanding links with their cards
|
|
29
29
|
var pos = tr.mapping.map(request.pos);
|
|
30
30
|
var $pos = tr.doc.resolve(pos);
|
|
31
|
+
var $head = tr.selection.$head;
|
|
31
32
|
var node = tr.doc.nodeAt(pos);
|
|
32
33
|
if (!node || !node.type.isText) {
|
|
33
34
|
return;
|
|
@@ -43,6 +44,15 @@ function replaceLinksToCards(tr, cardAdf, schema, request) {
|
|
|
43
44
|
nodes.push(schema.text(' '));
|
|
44
45
|
}
|
|
45
46
|
tr.replaceWith(pos, pos + (node.text || url).length, nodes);
|
|
47
|
+
if (fg('editor_inline_comments_paste_insert_nodes')) {
|
|
48
|
+
var annotationMarksForPos = getAnnotationMarksForPos($head);
|
|
49
|
+
if (annotationMarksForPos && annotationMarksForPos.length > 0) {
|
|
50
|
+
annotationMarksForPos.forEach(function (annotationMark) {
|
|
51
|
+
// Add the annotation mark on to the inlineCard node and the trailing space node.
|
|
52
|
+
tr.addMark(pos, pos + nodes[0].nodeSize + nodes[1].nodeSize, annotationMark);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
46
56
|
return $pos.node($pos.depth - 1).type.name;
|
|
47
57
|
}
|
|
48
58
|
export var replaceQueuedUrlWithCard = function replaceQueuedUrlWithCard(url, cardData, analyticsAction, editorAnalyticsApi, createAnalyticsEvent) {
|
|
@@ -365,7 +375,7 @@ export var setSelectedCardAppearance = function setSelectedCardAppearance(appear
|
|
|
365
375
|
return false;
|
|
366
376
|
}
|
|
367
377
|
var attrs;
|
|
368
|
-
if (
|
|
378
|
+
if (fg('platform.linking-platform.enable-datasource-appearance-toolbar')) {
|
|
369
379
|
if (appearanceForNodeType(selectedNode.type) === appearance && !selectedNode.attrs.datasource) {
|
|
370
380
|
return false;
|
|
371
381
|
}
|
|
@@ -455,7 +465,7 @@ export var updateCardViaDatasource = function updateCardViaDatasource(args) {
|
|
|
455
465
|
if (isColumnChange || isUrlChange) {
|
|
456
466
|
tr.setNodeMarkup(from, schemaNodes.blockCard, _objectSpread(_objectSpread({}, oldAttrs), newAdf.attrs));
|
|
457
467
|
}
|
|
458
|
-
} else if (
|
|
468
|
+
} else if (node.type.isText && fg('platform.linking-platform.enable-datasource-appearance-toolbar')) {
|
|
459
469
|
// url to datasource
|
|
460
470
|
var link;
|
|
461
471
|
state.doc.nodesBetween(from, to, function (node, pos) {
|
|
@@ -527,7 +537,7 @@ export var getAttrsForAppearance = function getAttrsForAppearance(appearance, se
|
|
|
527
537
|
layout: 'center'
|
|
528
538
|
});
|
|
529
539
|
}
|
|
530
|
-
if (
|
|
540
|
+
if (fg('platform.linking-platform.editor-datasource-typeguards')) {
|
|
531
541
|
if (isDatasourceNode(selectedNode)) {
|
|
532
542
|
return {
|
|
533
543
|
url: selectedNode.attrs.url
|
|
@@ -543,8 +553,8 @@ export var getAttrsForAppearance = function getAttrsForAppearance(appearance, se
|
|
|
543
553
|
return selectedNode.attrs;
|
|
544
554
|
};
|
|
545
555
|
var updateDatasourceStash = function updateDatasourceStash(tr, selectedNode) {
|
|
546
|
-
if (
|
|
547
|
-
if (
|
|
556
|
+
if (fg('platform.linking-platform.enable-datasource-appearance-toolbar')) {
|
|
557
|
+
if (fg('platform.linking-platform.editor-datasource-typeguards')) {
|
|
548
558
|
if (isDatasourceNode(selectedNode) && !isDatasourceConfigEditable(selectedNode.attrs.datasource.id) && selectedNode.attrs.url) {
|
|
549
559
|
setDatasourceStash(tr, {
|
|
550
560
|
url: selectedNode.attrs.url,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
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; }
|
|
4
4
|
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) { _defineProperty(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; }
|
|
5
5
|
import rafSchedule from 'raf-schd';
|
|
@@ -63,9 +63,10 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
63
63
|
showUpgradeDiscoverability = options.showUpgradeDiscoverability,
|
|
64
64
|
allowEmbeds = options.allowEmbeds,
|
|
65
65
|
allowBlockCards = options.allowBlockCards,
|
|
66
|
-
onClickCallback = options.onClickCallback
|
|
66
|
+
onClickCallback = options.onClickCallback,
|
|
67
|
+
__livePage = options.__livePage;
|
|
67
68
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability && platform !== 'mobile';
|
|
68
|
-
var inlineCardViewProducer = getInlineNodeViewProducer({
|
|
69
|
+
var inlineCardViewProducer = getInlineNodeViewProducer(_objectSpread({
|
|
69
70
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
70
71
|
Component: InlineCardNodeView,
|
|
71
72
|
extraComponentProps: {
|
|
@@ -76,12 +77,14 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
76
77
|
allowEmbeds: allowEmbeds,
|
|
77
78
|
allowBlockCards: allowBlockCards,
|
|
78
79
|
pluginInjectionApi: pluginInjectionApi,
|
|
79
|
-
onClickCallback: onClickCallback
|
|
80
|
-
|
|
80
|
+
onClickCallback: onClickCallback,
|
|
81
|
+
__livePage: __livePage
|
|
82
|
+
}
|
|
83
|
+
}, __livePage && fg('platform.linking-platform.smart-links-in-live-pages') && {
|
|
81
84
|
extraNodeViewProps: {
|
|
82
85
|
stopEvent: stopEvent
|
|
83
86
|
}
|
|
84
|
-
});
|
|
87
|
+
}));
|
|
85
88
|
return new SafePlugin({
|
|
86
89
|
state: {
|
|
87
90
|
init: function init() {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
3
6
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
7
|
|
|
5
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
3
6
|
import { useCallback, useState } from 'react';
|
|
4
7
|
|
|
5
8
|
// not permitted to migrate atlaskit packages to compiled yet, see https://hello.atlassian.net/wiki/spaces/UAF/pages/3006969423/Migrating+AFM+platform+components+to+Compiled+a+guide
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
3
6
|
import { useCallback, useRef, useState } from 'react';
|
|
4
7
|
|
|
5
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["extensionKey"];
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
5
8
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
9
|
|
|
7
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -6,7 +6,10 @@ var _excluded = ["children", "isSelected", "isVisible", "testId", "url"];
|
|
|
6
6
|
var _active;
|
|
7
7
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
8
8
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @jsxRuntime classic
|
|
11
|
+
* @jsx jsx
|
|
12
|
+
*/
|
|
10
13
|
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
11
14
|
|
|
12
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
5
8
|
import { useCallback, useMemo } from 'react';
|
|
6
9
|
|
|
7
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -10,7 +10,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
10
10
|
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) { _defineProperty(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; }
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @jsxRuntime classic
|
|
15
|
+
* @jsx jsx
|
|
16
|
+
*/
|
|
14
17
|
import React from 'react';
|
|
15
18
|
|
|
16
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
5
8
|
import { useEffect, useState } from 'react';
|
|
6
9
|
import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
7
10
|
export var useFetchDatasourceDataInfo = function useFetchDatasourceDataInfo(_ref) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
5
8
|
import { useEffect, useState } from 'react';
|
|
6
9
|
export var useFetchDatasourceInfo = function useFetchDatasourceInfo(_ref) {
|
|
7
10
|
var isRegularCardNode = _ref.isRegularCardNode,
|
|
@@ -42,6 +42,7 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
42
42
|
onClickCallback?: OnClickCallback;
|
|
43
43
|
showHoverPreview?: BaseCardProps['showHoverPreview'];
|
|
44
44
|
hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
|
|
45
|
+
__livePage?: boolean;
|
|
45
46
|
}
|
|
46
47
|
export interface SmartCardProps extends CardProps {
|
|
47
48
|
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
@@ -3,5 +3,5 @@ import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react
|
|
|
3
3
|
import type { SmartCardProps } from './genericCard';
|
|
4
4
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
5
5
|
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, }: SmartCardProps) => JSX.Element | null>;
|
|
6
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
6
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage'>;
|
|
7
7
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): JSX.Element;
|
|
@@ -42,6 +42,7 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
42
42
|
onClickCallback?: OnClickCallback;
|
|
43
43
|
showHoverPreview?: BaseCardProps['showHoverPreview'];
|
|
44
44
|
hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
|
|
45
|
+
__livePage?: boolean;
|
|
45
46
|
}
|
|
46
47
|
export interface SmartCardProps extends CardProps {
|
|
47
48
|
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
@@ -3,5 +3,5 @@ import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react
|
|
|
3
3
|
import type { SmartCardProps } from './genericCard';
|
|
4
4
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
5
5
|
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, }: SmartCardProps) => JSX.Element | null>;
|
|
6
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
6
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage'>;
|
|
7
7
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/adf-schema": "^39.0.3",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
37
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
38
|
-
"@atlaskit/editor-common": "^86.
|
|
38
|
+
"@atlaskit/editor-common": "^86.4.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
49
49
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
50
|
-
"@atlaskit/icon": "^22.
|
|
50
|
+
"@atlaskit/icon": "^22.7.0",
|
|
51
51
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
52
52
|
"@atlaskit/link-client-extension": "^1.9.0",
|
|
53
53
|
"@atlaskit/link-datasource": "^2.5.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/menu": "2.8.1",
|
|
57
57
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
58
58
|
"@atlaskit/primitives": "^11.0.0",
|
|
59
|
-
"@atlaskit/smart-card": "^27.
|
|
59
|
+
"@atlaskit/smart-card": "^27.10.0",
|
|
60
60
|
"@atlaskit/theme": "^12.11.0",
|
|
61
61
|
"@atlaskit/tokens": "^1.56.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"raf-schd": "^4.0.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/link-provider": "^1.
|
|
69
|
+
"@atlaskit/link-provider": "^1.13.0",
|
|
70
70
|
"react": "^16.8.0",
|
|
71
71
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
72
72
|
},
|
|
@@ -139,6 +139,9 @@
|
|
|
139
139
|
},
|
|
140
140
|
"linking-platform-contenteditable-false-live-view": {
|
|
141
141
|
"type": "boolean"
|
|
142
|
+
},
|
|
143
|
+
"editor_inline_comments_paste_insert_nodes": {
|
|
144
|
+
"type": "boolean"
|
|
142
145
|
}
|
|
143
146
|
},
|
|
144
147
|
"stricter": {
|