@atlaskit/editor-plugin-card 12.1.0 → 12.1.2
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 +14 -0
- package/dist/cjs/pm-plugins/doc.js +3 -7
- package/dist/cjs/ui/InlineCardOverlay/index.js +1 -4
- package/dist/cjs/ui/toolbar.js +10 -11
- package/dist/es2019/pm-plugins/doc.js +3 -7
- package/dist/es2019/ui/InlineCardOverlay/index.js +2 -5
- package/dist/es2019/ui/toolbar.js +3 -4
- package/dist/esm/pm-plugins/doc.js +3 -7
- package/dist/esm/ui/InlineCardOverlay/index.js +2 -5
- package/dist/esm/ui/toolbar.js +3 -4
- package/dist/types/ui/toolbar.d.ts +2 -2
- package/dist/types-ts4.5/ui/toolbar.d.ts +2 -2
- package/package.json +9 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 12.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7080196995b11`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7080196995b11) -
|
|
8
|
+
Cleaning up FG platform_editor_ai_generic_prep_for_aifc
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 12.1.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 12.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -322,11 +322,7 @@ var changeSelectedCardToLinkFallback = exports.changeSelectedCardToLinkFallback
|
|
|
322
322
|
})(tr);
|
|
323
323
|
}
|
|
324
324
|
if (dispatch) {
|
|
325
|
-
|
|
326
|
-
dispatch(tr.setMeta('addToHistory', false));
|
|
327
|
-
} else {
|
|
328
|
-
dispatch(tr.scrollIntoView());
|
|
329
|
-
}
|
|
325
|
+
dispatch(tr.setMeta('addToHistory', false));
|
|
330
326
|
}
|
|
331
327
|
return true;
|
|
332
328
|
};
|
|
@@ -551,11 +547,11 @@ var getAttrsForAppearance = exports.getAttrsForAppearance = function getAttrsFor
|
|
|
551
547
|
var _selectedNode$attrs$w;
|
|
552
548
|
return _objectSpread(_objectSpread({}, selectedNode.attrs), {}, {
|
|
553
549
|
layout: 'center'
|
|
554
|
-
}, isInsideBodiedSyncBlock
|
|
550
|
+
}, isInsideBodiedSyncBlock ?
|
|
555
551
|
// When converting to embed, width attribute is set to null and when the document is published, the width attribute is set to 100 as per schema default
|
|
556
552
|
// For editor, width is not required to render the embed card, but it's required in renderer
|
|
557
553
|
// Because sync block has nested renderer in editor, we need width to be defined even in editor so embed in reference sync block can be rendered properly
|
|
558
|
-
|
|
554
|
+
{
|
|
559
555
|
width: (_selectedNode$attrs$w = selectedNode.attrs.width) !== null && _selectedNode$attrs$w !== void 0 ? _selectedNode$attrs$w : 100
|
|
560
556
|
} : {});
|
|
561
557
|
}
|
|
@@ -83,7 +83,7 @@ var iconStyles = (0, _react2.css)({
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
var labelStyles = (0, _react2.css)({
|
|
86
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
86
|
+
font: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
87
87
|
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
88
88
|
width: 'max-content'
|
|
89
89
|
});
|
|
@@ -136,7 +136,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
136
136
|
var maxOverlayWidth = (0, _react.useRef)(0);
|
|
137
137
|
var minOverlayWidth = (0, _react.useRef)(ESTIMATED_MIN_WIDTH_IN_PX);
|
|
138
138
|
var parentWidth = (0, _react.useRef)(0);
|
|
139
|
-
var iconSize = (0, _react.useRef)('small');
|
|
140
139
|
var containerRef = (0, _react.useRef)(null);
|
|
141
140
|
var setVisibility = (0, _react.useCallback)(function () {
|
|
142
141
|
if (!containerRef.current || !maxOverlayWidth.current) {
|
|
@@ -186,7 +185,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
186
185
|
min = _getOverlayWidths.min;
|
|
187
186
|
maxOverlayWidth.current = max;
|
|
188
187
|
minOverlayWidth.current = min;
|
|
189
|
-
iconSize.current = (0, _utils.getIconSize)(_label);
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
190
|
if (isVisible) {
|
|
@@ -259,7 +257,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
259
257
|
css: iconStyles
|
|
260
258
|
}, (0, _react2.jsx)(_customize.default, {
|
|
261
259
|
label: label,
|
|
262
|
-
LEGACY_size: iconSize.current,
|
|
263
260
|
testId: "".concat(testId, "-icon")
|
|
264
261
|
})), showLabel && (0, _react2.jsx)("span", {
|
|
265
262
|
css: labelStyles
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -12,13 +12,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _card = require("@atlaskit/editor-common/card");
|
|
15
|
-
var
|
|
15
|
+
var _link2 = require("@atlaskit/editor-common/link");
|
|
16
16
|
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
17
17
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
18
18
|
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
19
19
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
20
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
21
|
-
var
|
|
21
|
+
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
22
22
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
23
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
24
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
@@ -27,7 +27,6 @@ var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
|
27
27
|
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
28
28
|
var _linkBroken = _interopRequireDefault(require("@atlaskit/icon/core/link-broken"));
|
|
29
29
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
30
|
-
var _comment2 = _interopRequireDefault(require("@atlaskit/icon/core/migration/comment"));
|
|
31
30
|
var _settings = _interopRequireDefault(require("@atlaskit/icon/core/settings"));
|
|
32
31
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
33
32
|
var _doc = require("../pm-plugins/doc");
|
|
@@ -47,7 +46,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
47
46
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
48
47
|
var removeCard = exports.removeCard = function removeCard(editorAnalyticsApi) {
|
|
49
48
|
return (0, _card.commandWithMetadata)(function (state, dispatch) {
|
|
50
|
-
if (!(state.selection instanceof
|
|
49
|
+
if (!(state.selection instanceof _state2.NodeSelection)) {
|
|
51
50
|
return false;
|
|
52
51
|
}
|
|
53
52
|
var type = state.selection.node.type.name;
|
|
@@ -74,7 +73,7 @@ var removeCard = exports.removeCard = function removeCard(editorAnalyticsApi) {
|
|
|
74
73
|
};
|
|
75
74
|
var visitCardLinkAnalytics = exports.visitCardLinkAnalytics = function visitCardLinkAnalytics(editorAnalyticsApi, inputMethod) {
|
|
76
75
|
return function (state, dispatch) {
|
|
77
|
-
if (!(state.selection instanceof
|
|
76
|
+
if (!(state.selection instanceof _state2.NodeSelection)) {
|
|
78
77
|
return false;
|
|
79
78
|
}
|
|
80
79
|
var type = state.selection.node.type;
|
|
@@ -88,7 +87,7 @@ var visitCardLinkAnalytics = exports.visitCardLinkAnalytics = function visitCard
|
|
|
88
87
|
};
|
|
89
88
|
var openLinkSettings = exports.openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
90
89
|
return function (state, dispatch) {
|
|
91
|
-
if (!(state.selection instanceof
|
|
90
|
+
if (!(state.selection instanceof _state2.NodeSelection)) {
|
|
92
91
|
return false;
|
|
93
92
|
}
|
|
94
93
|
if (dispatch) {
|
|
@@ -111,7 +110,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(cardOpt
|
|
|
111
110
|
embedCard = _state$schema$nodes.embedCard;
|
|
112
111
|
var nodeType = [inlineCard, blockCard, embedCard];
|
|
113
112
|
var pluginState = _pluginKey.pluginKey.getState(state);
|
|
114
|
-
if (!(state.selection instanceof
|
|
113
|
+
if (!(state.selection instanceof _state2.NodeSelection)) {
|
|
115
114
|
return;
|
|
116
115
|
}
|
|
117
116
|
var selectedNode = state.selection.node;
|
|
@@ -296,7 +295,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
296
295
|
type: 'button',
|
|
297
296
|
icon: _comment.default,
|
|
298
297
|
testId: 'inline-card-toolbar-comment-button',
|
|
299
|
-
iconFallback:
|
|
298
|
+
iconFallback: _comment.default,
|
|
300
299
|
title: intl.formatMessage(_messages.annotationMessages.createComment),
|
|
301
300
|
showTitle: (0, _experiments.editorExperiment)('platform_editor_controls', 'control') ? undefined : true,
|
|
302
301
|
onClick: onCommentButtonClick,
|
|
@@ -530,7 +529,7 @@ var getSettingsButton = exports.getSettingsButton = function getSettingsButton(i
|
|
|
530
529
|
iconFallback: _settings.default,
|
|
531
530
|
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
532
531
|
onClick: openLinkSettings(editorAnalyticsApi),
|
|
533
|
-
href: userPreferencesLink || (0,
|
|
532
|
+
href: userPreferencesLink || (0, _link2.getLinkPreferencesURLFromENV)(),
|
|
534
533
|
target: '_blank'
|
|
535
534
|
};
|
|
536
535
|
};
|
|
@@ -732,7 +731,7 @@ var shouldRenderToolbarPulse = exports.shouldRenderToolbarPulse = function shoul
|
|
|
732
731
|
return embedEnabled && appearance === 'inline' && status === 'resolved' && isDiscoverabilityEnabled;
|
|
733
732
|
};
|
|
734
733
|
var getStartingToolbarItems = exports.getStartingToolbarItems = function getStartingToolbarItems(options, api) {
|
|
735
|
-
return function (intl, link, onEditLink, metadata,
|
|
734
|
+
return function (intl, link, onEditLink, metadata, _state) {
|
|
736
735
|
var areAllNewToolbarFlagsDisabled = !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
737
736
|
var editLinkItem = options.allowDatasource ? [{
|
|
738
737
|
type: 'custom',
|
|
@@ -824,7 +823,7 @@ var getStartingToolbarItems = exports.getStartingToolbarItems = function getStar
|
|
|
824
823
|
};
|
|
825
824
|
};
|
|
826
825
|
var getEndingToolbarItems = exports.getEndingToolbarItems = function getEndingToolbarItems(options, api) {
|
|
827
|
-
return function (intl,
|
|
826
|
+
return function (intl, _link) {
|
|
828
827
|
/**
|
|
829
828
|
* Require either provider to be supplied (controls link preferences)
|
|
830
829
|
* Or explicit user preferences config in order to enable button
|
|
@@ -294,11 +294,7 @@ export const changeSelectedCardToLinkFallback = (text, href, sendAnalytics, node
|
|
|
294
294
|
})(tr);
|
|
295
295
|
}
|
|
296
296
|
if (dispatch) {
|
|
297
|
-
|
|
298
|
-
dispatch(tr.setMeta('addToHistory', false));
|
|
299
|
-
} else {
|
|
300
|
-
dispatch(tr.scrollIntoView());
|
|
301
|
-
}
|
|
297
|
+
dispatch(tr.setMeta('addToHistory', false));
|
|
302
298
|
}
|
|
303
299
|
return true;
|
|
304
300
|
};
|
|
@@ -533,11 +529,11 @@ export const getAttrsForAppearance = (appearance, selectedNode, isInsideBodiedSy
|
|
|
533
529
|
return {
|
|
534
530
|
...selectedNode.attrs,
|
|
535
531
|
layout: 'center',
|
|
536
|
-
...(isInsideBodiedSyncBlock
|
|
532
|
+
...(isInsideBodiedSyncBlock ?
|
|
537
533
|
// When converting to embed, width attribute is set to null and when the document is published, the width attribute is set to 100 as per schema default
|
|
538
534
|
// For editor, width is not required to render the embed card, but it's required in renderer
|
|
539
535
|
// Because sync block has nested renderer in editor, we need width to be defined even in editor so embed in reference sync block can be rendered properly
|
|
540
|
-
|
|
536
|
+
{
|
|
541
537
|
width: (_selectedNode$attrs$w = selectedNode.attrs.width) !== null && _selectedNode$attrs$w !== void 0 ? _selectedNode$attrs$w : 100
|
|
542
538
|
} : {})
|
|
543
539
|
};
|
|
@@ -15,7 +15,7 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
15
15
|
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
|
|
16
16
|
import CustomizeIcon from '@atlaskit/icon/core/customize';
|
|
17
17
|
import { B100, N0, N700 } from '@atlaskit/theme/colors';
|
|
18
|
-
import { getChildElement,
|
|
18
|
+
import { getChildElement, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
|
|
19
19
|
const DEBOUNCE_IN_MS = 5;
|
|
20
20
|
const ESTIMATED_MIN_WIDTH_IN_PX = 16;
|
|
21
21
|
const PADDING_IN_PX = 4;
|
|
@@ -76,7 +76,7 @@ const iconStyles = css({
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
const labelStyles = css({
|
|
79
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
79
|
+
font: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
80
80
|
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
81
81
|
width: 'max-content'
|
|
82
82
|
});
|
|
@@ -118,7 +118,6 @@ const InlineCardOverlay = ({
|
|
|
118
118
|
const maxOverlayWidth = useRef(0);
|
|
119
119
|
const minOverlayWidth = useRef(ESTIMATED_MIN_WIDTH_IN_PX);
|
|
120
120
|
const parentWidth = useRef(0);
|
|
121
|
-
const iconSize = useRef('small');
|
|
122
121
|
const containerRef = useRef(null);
|
|
123
122
|
const setVisibility = useCallback(() => {
|
|
124
123
|
if (!containerRef.current || !maxOverlayWidth.current) {
|
|
@@ -169,7 +168,6 @@ const InlineCardOverlay = ({
|
|
|
169
168
|
} = getOverlayWidths(iconAndLabel, label);
|
|
170
169
|
maxOverlayWidth.current = max;
|
|
171
170
|
minOverlayWidth.current = min;
|
|
172
|
-
iconSize.current = getIconSize(label);
|
|
173
171
|
}
|
|
174
172
|
}
|
|
175
173
|
if (isVisible) {
|
|
@@ -240,7 +238,6 @@ const InlineCardOverlay = ({
|
|
|
240
238
|
css: iconStyles
|
|
241
239
|
}, jsx(CustomizeIcon, {
|
|
242
240
|
label: label,
|
|
243
|
-
LEGACY_size: iconSize.current,
|
|
244
241
|
testId: `${testId}-icon`
|
|
245
242
|
})), showLabel && jsx("span", {
|
|
246
243
|
css: labelStyles
|
|
@@ -17,7 +17,6 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
|
17
17
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
18
18
|
import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
|
|
19
19
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
20
|
-
import LegacyCommentIcon from '@atlaskit/icon/core/migration/comment';
|
|
21
20
|
import CogIcon from '@atlaskit/icon/core/settings';
|
|
22
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
23
22
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
@@ -288,7 +287,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
288
287
|
type: 'button',
|
|
289
288
|
icon: CommentIcon,
|
|
290
289
|
testId: 'inline-card-toolbar-comment-button',
|
|
291
|
-
iconFallback:
|
|
290
|
+
iconFallback: CommentIcon,
|
|
292
291
|
title: intl.formatMessage(annotationMessages.createComment),
|
|
293
292
|
showTitle: editorExperiment('platform_editor_controls', 'control') ? undefined : true,
|
|
294
293
|
onClick: onCommentButtonClick,
|
|
@@ -717,7 +716,7 @@ export const shouldRenderToolbarPulse = (embedEnabled, appearance, status, isDis
|
|
|
717
716
|
return embedEnabled && appearance === 'inline' && status === 'resolved' && isDiscoverabilityEnabled;
|
|
718
717
|
};
|
|
719
718
|
export const getStartingToolbarItems = (options, api) => {
|
|
720
|
-
return (intl, link, onEditLink, metadata,
|
|
719
|
+
return (intl, link, onEditLink, metadata, _state) => {
|
|
721
720
|
const areAllNewToolbarFlagsDisabled = !areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
722
721
|
const editLinkItem = options.allowDatasource ? [{
|
|
723
722
|
type: 'custom',
|
|
@@ -804,7 +803,7 @@ export const getStartingToolbarItems = (options, api) => {
|
|
|
804
803
|
}, ...editLinkItem];
|
|
805
804
|
};
|
|
806
805
|
};
|
|
807
|
-
export const getEndingToolbarItems = (options, api) => (intl,
|
|
806
|
+
export const getEndingToolbarItems = (options, api) => (intl, _link) => {
|
|
808
807
|
/**
|
|
809
808
|
* Require either provider to be supplied (controls link preferences)
|
|
810
809
|
* Or explicit user preferences config in order to enable button
|
|
@@ -316,11 +316,7 @@ export var changeSelectedCardToLinkFallback = function changeSelectedCardToLinkF
|
|
|
316
316
|
})(tr);
|
|
317
317
|
}
|
|
318
318
|
if (dispatch) {
|
|
319
|
-
|
|
320
|
-
dispatch(tr.setMeta('addToHistory', false));
|
|
321
|
-
} else {
|
|
322
|
-
dispatch(tr.scrollIntoView());
|
|
323
|
-
}
|
|
319
|
+
dispatch(tr.setMeta('addToHistory', false));
|
|
324
320
|
}
|
|
325
321
|
return true;
|
|
326
322
|
};
|
|
@@ -545,11 +541,11 @@ export var getAttrsForAppearance = function getAttrsForAppearance(appearance, se
|
|
|
545
541
|
var _selectedNode$attrs$w;
|
|
546
542
|
return _objectSpread(_objectSpread({}, selectedNode.attrs), {}, {
|
|
547
543
|
layout: 'center'
|
|
548
|
-
}, isInsideBodiedSyncBlock
|
|
544
|
+
}, isInsideBodiedSyncBlock ?
|
|
549
545
|
// When converting to embed, width attribute is set to null and when the document is published, the width attribute is set to 100 as per schema default
|
|
550
546
|
// For editor, width is not required to render the embed card, but it's required in renderer
|
|
551
547
|
// Because sync block has nested renderer in editor, we need width to be defined even in editor so embed in reference sync block can be rendered properly
|
|
552
|
-
|
|
548
|
+
{
|
|
553
549
|
width: (_selectedNode$attrs$w = selectedNode.attrs.width) !== null && _selectedNode$attrs$w !== void 0 ? _selectedNode$attrs$w : 100
|
|
554
550
|
} : {});
|
|
555
551
|
}
|
|
@@ -19,7 +19,7 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
19
19
|
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
|
|
20
20
|
import CustomizeIcon from '@atlaskit/icon/core/customize';
|
|
21
21
|
import { B100, N0, N700 } from '@atlaskit/theme/colors';
|
|
22
|
-
import { getChildElement,
|
|
22
|
+
import { getChildElement, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
|
|
23
23
|
var DEBOUNCE_IN_MS = 5;
|
|
24
24
|
var ESTIMATED_MIN_WIDTH_IN_PX = 16;
|
|
25
25
|
var PADDING_IN_PX = 4;
|
|
@@ -75,7 +75,7 @@ var iconStyles = css({
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
var labelStyles = css({
|
|
78
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
78
|
+
font: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
79
79
|
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
80
80
|
width: 'max-content'
|
|
81
81
|
});
|
|
@@ -128,7 +128,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
128
128
|
var maxOverlayWidth = useRef(0);
|
|
129
129
|
var minOverlayWidth = useRef(ESTIMATED_MIN_WIDTH_IN_PX);
|
|
130
130
|
var parentWidth = useRef(0);
|
|
131
|
-
var iconSize = useRef('small');
|
|
132
131
|
var containerRef = useRef(null);
|
|
133
132
|
var setVisibility = useCallback(function () {
|
|
134
133
|
if (!containerRef.current || !maxOverlayWidth.current) {
|
|
@@ -178,7 +177,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
178
177
|
min = _getOverlayWidths.min;
|
|
179
178
|
maxOverlayWidth.current = max;
|
|
180
179
|
minOverlayWidth.current = min;
|
|
181
|
-
iconSize.current = getIconSize(_label);
|
|
182
180
|
}
|
|
183
181
|
}
|
|
184
182
|
if (isVisible) {
|
|
@@ -251,7 +249,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
251
249
|
css: iconStyles
|
|
252
250
|
}, jsx(CustomizeIcon, {
|
|
253
251
|
label: label,
|
|
254
|
-
LEGACY_size: iconSize.current,
|
|
255
252
|
testId: "".concat(testId, "-icon")
|
|
256
253
|
})), showLabel && jsx("span", {
|
|
257
254
|
css: labelStyles
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -21,7 +21,6 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
|
21
21
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
22
22
|
import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
|
|
23
23
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
24
|
-
import LegacyCommentIcon from '@atlaskit/icon/core/migration/comment';
|
|
25
24
|
import CogIcon from '@atlaskit/icon/core/settings';
|
|
26
25
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
27
26
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
@@ -287,7 +286,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
287
286
|
type: 'button',
|
|
288
287
|
icon: CommentIcon,
|
|
289
288
|
testId: 'inline-card-toolbar-comment-button',
|
|
290
|
-
iconFallback:
|
|
289
|
+
iconFallback: CommentIcon,
|
|
291
290
|
title: intl.formatMessage(annotationMessages.createComment),
|
|
292
291
|
showTitle: editorExperiment('platform_editor_controls', 'control') ? undefined : true,
|
|
293
292
|
onClick: onCommentButtonClick,
|
|
@@ -723,7 +722,7 @@ export var shouldRenderToolbarPulse = function shouldRenderToolbarPulse(embedEna
|
|
|
723
722
|
return embedEnabled && appearance === 'inline' && status === 'resolved' && isDiscoverabilityEnabled;
|
|
724
723
|
};
|
|
725
724
|
export var getStartingToolbarItems = function getStartingToolbarItems(options, api) {
|
|
726
|
-
return function (intl, link, onEditLink, metadata,
|
|
725
|
+
return function (intl, link, onEditLink, metadata, _state) {
|
|
727
726
|
var areAllNewToolbarFlagsDisabled = !areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
728
727
|
var editLinkItem = options.allowDatasource ? [{
|
|
729
728
|
type: 'custom',
|
|
@@ -815,7 +814,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
815
814
|
};
|
|
816
815
|
};
|
|
817
816
|
export var getEndingToolbarItems = function getEndingToolbarItems(options, api) {
|
|
818
|
-
return function (intl,
|
|
817
|
+
return function (intl, _link) {
|
|
819
818
|
/**
|
|
820
819
|
* Require either provider to be supplied (controls link preferences)
|
|
821
820
|
* Or explicit user preferences config in order to enable button
|
|
@@ -15,5 +15,5 @@ export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearanc
|
|
|
15
15
|
export declare const getStartingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string, onEditLink: Command, metadata: {
|
|
16
16
|
title: string;
|
|
17
17
|
url: string;
|
|
18
|
-
},
|
|
19
|
-
export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape,
|
|
18
|
+
}, _state?: EditorState) => FloatingToolbarItem<Command>[];
|
|
19
|
+
export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, _link: string) => FloatingToolbarItem<Command>[];
|
|
@@ -15,5 +15,5 @@ export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearanc
|
|
|
15
15
|
export declare const getStartingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string, onEditLink: Command, metadata: {
|
|
16
16
|
title: string;
|
|
17
17
|
url: string;
|
|
18
|
-
},
|
|
19
|
-
export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape,
|
|
18
|
+
}, _state?: EditorState) => FloatingToolbarItem<Command>[];
|
|
19
|
+
export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, _link: string) => FloatingToolbarItem<Command>[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,28 +41,28 @@
|
|
|
41
41
|
"@atlaskit/editor-plugin-feature-flags": "^6.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-floating-toolbar": "^9.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-grid": "^7.0.0",
|
|
44
|
-
"@atlaskit/editor-plugin-toolbar": "^4.
|
|
44
|
+
"@atlaskit/editor-plugin-toolbar": "^4.1.0",
|
|
45
45
|
"@atlaskit/editor-plugin-width": "^8.0.0",
|
|
46
46
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
47
47
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
48
48
|
"@atlaskit/frontend-utilities": "^3.2.0",
|
|
49
|
-
"@atlaskit/icon": "^29.
|
|
49
|
+
"@atlaskit/icon": "^29.4.0",
|
|
50
50
|
"@atlaskit/link": "^3.3.0",
|
|
51
51
|
"@atlaskit/link-analytics": "^11.0.0",
|
|
52
52
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
53
|
-
"@atlaskit/link-datasource": "^4.
|
|
53
|
+
"@atlaskit/link-datasource": "^4.32.0",
|
|
54
54
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
55
55
|
"@atlaskit/linking-common": "^9.9.0",
|
|
56
56
|
"@atlaskit/linking-types": "^14.2.0",
|
|
57
57
|
"@atlaskit/menu": "^8.4.0",
|
|
58
58
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
59
59
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
60
|
-
"@atlaskit/primitives": "^17.
|
|
60
|
+
"@atlaskit/primitives": "^17.1.0",
|
|
61
61
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
62
|
-
"@atlaskit/smart-card": "^43.
|
|
62
|
+
"@atlaskit/smart-card": "^43.22.0",
|
|
63
63
|
"@atlaskit/theme": "^21.0.0",
|
|
64
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
65
|
-
"@atlaskit/tokens": "^
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^16.30.0",
|
|
65
|
+
"@atlaskit/tokens": "^10.1.0",
|
|
66
66
|
"@babel/runtime": "^7.0.0",
|
|
67
67
|
"@emotion/react": "^11.7.1",
|
|
68
68
|
"lodash": "^4.17.21",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"uuid": "^3.1.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^111.
|
|
74
|
+
"@atlaskit/editor-common": "^111.8.0",
|
|
75
75
|
"@atlaskit/link-provider": "^4.1.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -127,9 +127,6 @@
|
|
|
127
127
|
},
|
|
128
128
|
"platform_editor_ai_generic_prep_for_aifc_2": {
|
|
129
129
|
"type": "boolean"
|
|
130
|
-
},
|
|
131
|
-
"platform_editor_ai_generic_prep_for_aifc": {
|
|
132
|
-
"type": "boolean"
|
|
133
130
|
}
|
|
134
131
|
},
|
|
135
132
|
"stricter": {
|