@atlaskit/editor-plugin-card 12.0.0 → 12.0.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 +16 -0
- package/dist/cjs/pm-plugins/doc.js +10 -2
- package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
- package/dist/cjs/ui/EditToolbarButton/index.js +1 -1
- package/dist/cjs/ui/HyperlinkToolbarAppearanceDropdown.js +1 -1
- package/dist/cjs/ui/ResizableEmbedCard.js +7 -2
- package/dist/es2019/pm-plugins/doc.js +11 -3
- package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
- package/dist/es2019/ui/EditToolbarButton/index.js +1 -1
- package/dist/es2019/ui/HyperlinkToolbarAppearanceDropdown.js +1 -1
- package/dist/es2019/ui/ResizableEmbedCard.js +7 -2
- package/dist/esm/pm-plugins/doc.js +10 -2
- package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
- package/dist/esm/ui/EditToolbarButton/index.js +1 -1
- package/dist/esm/ui/HyperlinkToolbarAppearanceDropdown.js +1 -1
- package/dist/esm/ui/ResizableEmbedCard.js +7 -2
- package/dist/types/pm-plugins/doc.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/doc.d.ts +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 12.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b429c01ce6af9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b429c01ce6af9) -
|
|
8
|
+
icon migration entry point update
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 12.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`e56d251bf0184`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e56d251bf0184) -
|
|
16
|
+
[EDITOR-3966] Fix embed sizing issue in sync block
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 12.0.0
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -402,7 +402,7 @@ var setSelectedCardAppearance = exports.setSelectedCardAppearance = function set
|
|
|
402
402
|
if ((0, _utils2.appearanceForNodeType)(selectedNode.type) === appearance && !selectedNode.attrs.datasource) {
|
|
403
403
|
return false;
|
|
404
404
|
}
|
|
405
|
-
var attrs = getAttrsForAppearance(appearance, selectedNode);
|
|
405
|
+
var attrs = (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') ? getAttrsForAppearance(appearance, selectedNode, state.selection.$from.parent.type.name === 'bodiedSyncBlock') : getAttrsForAppearance(appearance, selectedNode);
|
|
406
406
|
var _state$selection = state.selection,
|
|
407
407
|
from = _state$selection.from,
|
|
408
408
|
to = _state$selection.to;
|
|
@@ -546,10 +546,18 @@ var insertDatasource = exports.insertDatasource = function insertDatasource(stat
|
|
|
546
546
|
* Get attributes for new Card Appearance
|
|
547
547
|
*/
|
|
548
548
|
var getAttrsForAppearance = exports.getAttrsForAppearance = function getAttrsForAppearance(appearance, selectedNode) {
|
|
549
|
+
var isInsideBodiedSyncBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
549
550
|
if (appearance === 'embed') {
|
|
551
|
+
var _selectedNode$attrs$w;
|
|
550
552
|
return _objectSpread(_objectSpread({}, selectedNode.attrs), {}, {
|
|
551
553
|
layout: 'center'
|
|
552
|
-
}
|
|
554
|
+
}, isInsideBodiedSyncBlock
|
|
555
|
+
// 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
|
+
// For editor, width is not required to render the embed card, but it's required in renderer
|
|
557
|
+
// 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
|
+
? {
|
|
559
|
+
width: (_selectedNode$attrs$w = selectedNode.attrs.width) !== null && _selectedNode$attrs$w !== void 0 ? _selectedNode$attrs$w : 100
|
|
560
|
+
} : {});
|
|
553
561
|
}
|
|
554
562
|
if ((0, _utils2.isDatasourceNode)(selectedNode)) {
|
|
555
563
|
return {
|
|
@@ -12,8 +12,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
14
14
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
15
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
15
16
|
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
16
|
-
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
17
17
|
var _menu = require("@atlaskit/menu");
|
|
18
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
19
|
var _utils = require("../../pm-plugins/utils");
|
|
@@ -13,7 +13,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
15
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
16
|
-
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
16
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
17
17
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
18
18
|
var _menu = require("@atlaskit/menu");
|
|
19
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
@@ -14,7 +14,7 @@ var _card = require("@atlaskit/editor-common/card");
|
|
|
14
14
|
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
15
15
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
16
16
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
17
|
-
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
17
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
18
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
19
|
var _LinkToolbarAppearanceDropdown = require("./LinkToolbarAppearanceDropdown");
|
|
20
20
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -17,7 +17,9 @@ var _react2 = require("@emotion/react");
|
|
|
17
17
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
18
18
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
19
19
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var _smartCard = require("@atlaskit/smart-card");
|
|
22
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
21
23
|
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; }
|
|
22
24
|
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; }
|
|
23
25
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -106,8 +108,11 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
|
|
|
106
108
|
layoutColumn = _this$props$view$stat.layoutColumn,
|
|
107
109
|
table = _this$props$view$stat.table,
|
|
108
110
|
expand = _this$props$view$stat.expand,
|
|
109
|
-
nestedExpand = _this$props$view$stat.nestedExpand
|
|
110
|
-
|
|
111
|
+
nestedExpand = _this$props$view$stat.nestedExpand,
|
|
112
|
+
bodiedSyncBlock = _this$props$view$stat.bodiedSyncBlock;
|
|
113
|
+
|
|
114
|
+
// Hide resizing guideline when embed is nested
|
|
115
|
+
if (_this.$pos && !!(0, _utils.findParentNodeOfTypeClosestToPos)(_this.$pos, (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') ? [layoutColumn, table, expand, nestedExpand, bodiedSyncBlock] : [layoutColumn, table, expand, nestedExpand])) {
|
|
111
116
|
return [];
|
|
112
117
|
}
|
|
113
118
|
if (snapWidth > _this.wideLayoutWidth) {
|
|
@@ -372,7 +372,7 @@ export const setSelectedCardAppearance = (appearance, editorAnalyticsApi) => (st
|
|
|
372
372
|
if (appearanceForNodeType(selectedNode.type) === appearance && !selectedNode.attrs.datasource) {
|
|
373
373
|
return false;
|
|
374
374
|
}
|
|
375
|
-
const attrs = getAttrsForAppearance(appearance, selectedNode);
|
|
375
|
+
const attrs = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding') ? getAttrsForAppearance(appearance, selectedNode, state.selection.$from.parent.type.name === 'bodiedSyncBlock') : getAttrsForAppearance(appearance, selectedNode);
|
|
376
376
|
const {
|
|
377
377
|
from,
|
|
378
378
|
to
|
|
@@ -527,11 +527,19 @@ export const insertDatasource = (state, adf, view, sourceEvent) => {
|
|
|
527
527
|
/**
|
|
528
528
|
* Get attributes for new Card Appearance
|
|
529
529
|
*/
|
|
530
|
-
export const getAttrsForAppearance = (appearance, selectedNode) => {
|
|
530
|
+
export const getAttrsForAppearance = (appearance, selectedNode, isInsideBodiedSyncBlock = false) => {
|
|
531
531
|
if (appearance === 'embed') {
|
|
532
|
+
var _selectedNode$attrs$w;
|
|
532
533
|
return {
|
|
533
534
|
...selectedNode.attrs,
|
|
534
|
-
layout: 'center'
|
|
535
|
+
layout: 'center',
|
|
536
|
+
...(isInsideBodiedSyncBlock
|
|
537
|
+
// 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
|
+
// For editor, width is not required to render the embed card, but it's required in renderer
|
|
539
|
+
// 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
|
+
? {
|
|
541
|
+
width: (_selectedNode$attrs$w = selectedNode.attrs.width) !== null && _selectedNode$attrs$w !== void 0 ? _selectedNode$attrs$w : 100
|
|
542
|
+
} : {})
|
|
535
543
|
};
|
|
536
544
|
}
|
|
537
545
|
if (isDatasourceNode(selectedNode)) {
|
|
@@ -10,8 +10,8 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
10
10
|
import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
13
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
13
14
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
14
|
-
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
15
15
|
import { ButtonItem } from '@atlaskit/menu';
|
|
16
16
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
17
17
|
import { focusEditorView } from '../../pm-plugins/utils';
|
|
@@ -10,7 +10,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
10
10
|
import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
13
|
-
import ChevronDownIcon from '@atlaskit/icon/core/
|
|
13
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
14
14
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
15
15
|
import { ButtonItem } from '@atlaskit/menu';
|
|
16
16
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
@@ -3,7 +3,7 @@ import { appearancePropsMap } from '@atlaskit/editor-common/card';
|
|
|
3
3
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
4
4
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
6
|
-
import ChevronDownIcon from '@atlaskit/icon/core/
|
|
6
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
7
7
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
8
8
|
import { LinkAppearanceMenu } from './LinkToolbarAppearanceDropdown';
|
|
9
9
|
const CustomHyperlinkDropdown = props => {
|
|
@@ -11,7 +11,9 @@ import { jsx } from '@emotion/react';
|
|
|
11
11
|
import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
13
13
|
import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { embedHeaderHeight } from '@atlaskit/smart-card';
|
|
16
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
17
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
16
18
|
export default class ResizableEmbedCard extends React.Component {
|
|
17
19
|
constructor(...args) {
|
|
@@ -98,9 +100,12 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
98
100
|
layoutColumn,
|
|
99
101
|
table,
|
|
100
102
|
expand,
|
|
101
|
-
nestedExpand
|
|
103
|
+
nestedExpand,
|
|
104
|
+
bodiedSyncBlock
|
|
102
105
|
} = this.props.view.state.schema.nodes;
|
|
103
|
-
|
|
106
|
+
|
|
107
|
+
// Hide resizing guideline when embed is nested
|
|
108
|
+
if (this.$pos && !!findParentNodeOfTypeClosestToPos(this.$pos, editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding') ? [layoutColumn, table, expand, nestedExpand, bodiedSyncBlock] : [layoutColumn, table, expand, nestedExpand])) {
|
|
104
109
|
return [];
|
|
105
110
|
}
|
|
106
111
|
if (snapWidth > this.wideLayoutWidth) {
|
|
@@ -396,7 +396,7 @@ export var setSelectedCardAppearance = function setSelectedCardAppearance(appear
|
|
|
396
396
|
if (appearanceForNodeType(selectedNode.type) === appearance && !selectedNode.attrs.datasource) {
|
|
397
397
|
return false;
|
|
398
398
|
}
|
|
399
|
-
var attrs = getAttrsForAppearance(appearance, selectedNode);
|
|
399
|
+
var attrs = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding') ? getAttrsForAppearance(appearance, selectedNode, state.selection.$from.parent.type.name === 'bodiedSyncBlock') : getAttrsForAppearance(appearance, selectedNode);
|
|
400
400
|
var _state$selection = state.selection,
|
|
401
401
|
from = _state$selection.from,
|
|
402
402
|
to = _state$selection.to;
|
|
@@ -540,10 +540,18 @@ export var insertDatasource = function insertDatasource(state, adf, view, source
|
|
|
540
540
|
* Get attributes for new Card Appearance
|
|
541
541
|
*/
|
|
542
542
|
export var getAttrsForAppearance = function getAttrsForAppearance(appearance, selectedNode) {
|
|
543
|
+
var isInsideBodiedSyncBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
543
544
|
if (appearance === 'embed') {
|
|
545
|
+
var _selectedNode$attrs$w;
|
|
544
546
|
return _objectSpread(_objectSpread({}, selectedNode.attrs), {}, {
|
|
545
547
|
layout: 'center'
|
|
546
|
-
}
|
|
548
|
+
}, isInsideBodiedSyncBlock
|
|
549
|
+
// 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
|
+
// For editor, width is not required to render the embed card, but it's required in renderer
|
|
551
|
+
// 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
|
+
? {
|
|
553
|
+
width: (_selectedNode$attrs$w = selectedNode.attrs.width) !== null && _selectedNode$attrs$w !== void 0 ? _selectedNode$attrs$w : 100
|
|
554
|
+
} : {});
|
|
547
555
|
}
|
|
548
556
|
if (isDatasourceNode(selectedNode)) {
|
|
549
557
|
return {
|
|
@@ -11,8 +11,8 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
11
11
|
import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
14
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
14
15
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
15
|
-
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
16
16
|
import { ButtonItem } from '@atlaskit/menu';
|
|
17
17
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
18
18
|
import { focusEditorView } from '../../pm-plugins/utils';
|
|
@@ -13,7 +13,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
13
13
|
import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
14
14
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
15
15
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
16
|
-
import ChevronDownIcon from '@atlaskit/icon/core/
|
|
16
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
17
17
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
18
18
|
import { ButtonItem } from '@atlaskit/menu';
|
|
19
19
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
@@ -6,7 +6,7 @@ import { appearancePropsMap } from '@atlaskit/editor-common/card';
|
|
|
6
6
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
7
7
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
9
|
-
import ChevronDownIcon from '@atlaskit/icon/core/
|
|
9
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
10
10
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
11
11
|
import { LinkAppearanceMenu } from './LinkToolbarAppearanceDropdown';
|
|
12
12
|
var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
|
|
@@ -20,7 +20,9 @@ import { jsx } from '@emotion/react';
|
|
|
20
20
|
import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
|
|
21
21
|
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
22
22
|
import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
23
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
24
|
import { embedHeaderHeight } from '@atlaskit/smart-card';
|
|
25
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
24
26
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
25
27
|
var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
26
28
|
function ResizableEmbedCard() {
|
|
@@ -102,8 +104,11 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
102
104
|
layoutColumn = _this$props$view$stat.layoutColumn,
|
|
103
105
|
table = _this$props$view$stat.table,
|
|
104
106
|
expand = _this$props$view$stat.expand,
|
|
105
|
-
nestedExpand = _this$props$view$stat.nestedExpand
|
|
106
|
-
|
|
107
|
+
nestedExpand = _this$props$view$stat.nestedExpand,
|
|
108
|
+
bodiedSyncBlock = _this$props$view$stat.bodiedSyncBlock;
|
|
109
|
+
|
|
110
|
+
// Hide resizing guideline when embed is nested
|
|
111
|
+
if (_this.$pos && !!findParentNodeOfTypeClosestToPos(_this.$pos, editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding') ? [layoutColumn, table, expand, nestedExpand, bodiedSyncBlock] : [layoutColumn, table, expand, nestedExpand])) {
|
|
107
112
|
return [];
|
|
108
113
|
}
|
|
109
114
|
if (snapWidth > _this.wideLayoutWidth) {
|
|
@@ -37,5 +37,5 @@ export declare const insertDatasource: (state: EditorState, adf: DatasourceAdf |
|
|
|
37
37
|
/**
|
|
38
38
|
* Get attributes for new Card Appearance
|
|
39
39
|
*/
|
|
40
|
-
export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node) => import("prosemirror-model").Attrs;
|
|
40
|
+
export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node, isInsideBodiedSyncBlock?: boolean) => import("prosemirror-model").Attrs;
|
|
41
41
|
export {};
|
|
@@ -37,5 +37,5 @@ export declare const insertDatasource: (state: EditorState, adf: DatasourceAdf |
|
|
|
37
37
|
/**
|
|
38
38
|
* Get attributes for new Card Appearance
|
|
39
39
|
*/
|
|
40
|
-
export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node) => import("prosemirror-model").Attrs;
|
|
40
|
+
export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node, isInsideBodiedSyncBlock?: boolean) => import("prosemirror-model").Attrs;
|
|
41
41
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"platform_editor_adf_with_localid": {
|
|
123
123
|
"type": "boolean"
|
|
124
124
|
},
|
|
125
|
+
"platform_synced_block_dogfooding": {
|
|
126
|
+
"type": "boolean"
|
|
127
|
+
},
|
|
125
128
|
"platform_editor_ai_generic_prep_for_aifc_2": {
|
|
126
129
|
"type": "boolean"
|
|
127
130
|
},
|