@atlaskit/editor-plugin-card 0.5.2 → 0.5.4
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 +12 -0
- package/dist/cjs/toolbar.js +2 -1
- package/dist/cjs/ui/ResizableEmbedCard.js +28 -1
- package/dist/es2019/toolbar.js +2 -1
- package/dist/es2019/ui/ResizableEmbedCard.js +28 -1
- package/dist/esm/toolbar.js +2 -1
- package/dist/esm/ui/ResizableEmbedCard.js +28 -1
- package/dist/types/ui/ResizableEmbedCard.d.ts +3 -2
- package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 0.5.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`dfb663969a0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dfb663969a0) - ED-19820: Fix for table scroll when insert media node when extended-resize-experience is off
|
|
8
|
+
|
|
9
|
+
## 0.5.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`882e4e88358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/882e4e88358) - Add playwright tests and add test ids to find elements
|
|
14
|
+
|
|
3
15
|
## 0.5.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -352,7 +352,8 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(state, metadata
|
|
|
352
352
|
metadata: metadata,
|
|
353
353
|
className: 'datasource-edit',
|
|
354
354
|
title: intl.formatMessage(_messages.linkToolbarMessages.editDatasource),
|
|
355
|
-
onClick: (0, _EditLinkToolbar.editDatasource)(node, editorAnalyticsApi)
|
|
355
|
+
onClick: (0, _EditLinkToolbar.editDatasource)(node, editorAnalyticsApi),
|
|
356
|
+
testId: 'datasource-edit-button'
|
|
356
357
|
}];
|
|
357
358
|
if (node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.url) {
|
|
358
359
|
toolbarItems.push({
|
|
@@ -216,6 +216,17 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
216
216
|
return _editorSharedStyles.akEditorWideLayoutWidth;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
+
|
|
220
|
+
// check if is inside of a table
|
|
221
|
+
}, {
|
|
222
|
+
key: "isNestedInTable",
|
|
223
|
+
value: function isNestedInTable() {
|
|
224
|
+
var table = this.props.view.state.schema.nodes.table;
|
|
225
|
+
if (!this.$pos) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
return !!(0, _utils.findParentNodeOfTypeClosestToPos)(this.$pos, table);
|
|
229
|
+
}
|
|
219
230
|
}, {
|
|
220
231
|
key: "calcSnapPoints",
|
|
221
232
|
value: function calcSnapPoints() {
|
|
@@ -330,6 +341,21 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
330
341
|
enable[side] = false;
|
|
331
342
|
}
|
|
332
343
|
});
|
|
344
|
+
var nestedInTableHandleStyles = function nestedInTableHandleStyles(isNestedInTable) {
|
|
345
|
+
if (!isNestedInTable) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
left: {
|
|
350
|
+
left: "calc(".concat("var(--ds-space-025, 0.125em)", " * -0.5)"),
|
|
351
|
+
paddingLeft: '0px'
|
|
352
|
+
},
|
|
353
|
+
right: {
|
|
354
|
+
right: "calc(".concat("var(--ds-space-025, 0.125em)", " * -0.5)"),
|
|
355
|
+
paddingRight: '0px'
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
};
|
|
333
359
|
|
|
334
360
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
335
361
|
return (0, _react2.jsx)("div", {
|
|
@@ -351,7 +377,8 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
351
377
|
scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
|
|
352
378
|
highlights: this.highlights,
|
|
353
379
|
innerPadding: _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide,
|
|
354
|
-
nodeType: "embed"
|
|
380
|
+
nodeType: "embed",
|
|
381
|
+
handleStyles: nestedInTableHandleStyles(this.isNestedInTable())
|
|
355
382
|
}), children, this.getHeightDefiningComponent())));
|
|
356
383
|
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
|
|
357
384
|
}
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -345,7 +345,8 @@ const getDatasourceButtonGroup = (state, metadata, intl, editorAnalyticsApi, nod
|
|
|
345
345
|
metadata: metadata,
|
|
346
346
|
className: 'datasource-edit',
|
|
347
347
|
title: intl.formatMessage(linkToolbarMessages.editDatasource),
|
|
348
|
-
onClick: editDatasource(node, editorAnalyticsApi)
|
|
348
|
+
onClick: editDatasource(node, editorAnalyticsApi),
|
|
349
|
+
testId: 'datasource-edit-button'
|
|
349
350
|
}];
|
|
350
351
|
if (node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.url) {
|
|
351
352
|
toolbarItems.push({
|
|
@@ -194,6 +194,17 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
194
194
|
return akEditorWideLayoutWidth;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
+
|
|
198
|
+
// check if is inside of a table
|
|
199
|
+
isNestedInTable() {
|
|
200
|
+
const {
|
|
201
|
+
table
|
|
202
|
+
} = this.props.view.state.schema.nodes;
|
|
203
|
+
if (!this.$pos) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
return !!findParentNodeOfTypeClosestToPos(this.$pos, table);
|
|
207
|
+
}
|
|
197
208
|
calcSnapPoints() {
|
|
198
209
|
const {
|
|
199
210
|
offsetLeft
|
|
@@ -304,6 +315,21 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
304
315
|
enable[side] = false;
|
|
305
316
|
}
|
|
306
317
|
});
|
|
318
|
+
const nestedInTableHandleStyles = isNestedInTable => {
|
|
319
|
+
if (!isNestedInTable) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
return {
|
|
323
|
+
left: {
|
|
324
|
+
left: `calc(${"var(--ds-space-025, 0.125em)"} * -0.5)`,
|
|
325
|
+
paddingLeft: '0px'
|
|
326
|
+
},
|
|
327
|
+
right: {
|
|
328
|
+
right: `calc(${"var(--ds-space-025, 0.125em)"} * -0.5)`,
|
|
329
|
+
paddingRight: '0px'
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
};
|
|
307
333
|
|
|
308
334
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
309
335
|
return jsx("div", {
|
|
@@ -325,7 +351,8 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
325
351
|
scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
|
|
326
352
|
highlights: this.highlights,
|
|
327
353
|
innerPadding: akEditorMediaResizeHandlerPaddingWide,
|
|
328
|
-
nodeType: "embed"
|
|
354
|
+
nodeType: "embed",
|
|
355
|
+
handleStyles: nestedInTableHandleStyles(this.isNestedInTable())
|
|
329
356
|
}), children, this.getHeightDefiningComponent())));
|
|
330
357
|
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
|
|
331
358
|
}
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -338,7 +338,8 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(state, metadata
|
|
|
338
338
|
metadata: metadata,
|
|
339
339
|
className: 'datasource-edit',
|
|
340
340
|
title: intl.formatMessage(linkToolbarMessages.editDatasource),
|
|
341
|
-
onClick: editDatasource(node, editorAnalyticsApi)
|
|
341
|
+
onClick: editDatasource(node, editorAnalyticsApi),
|
|
342
|
+
testId: 'datasource-edit-button'
|
|
342
343
|
}];
|
|
343
344
|
if (node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.url) {
|
|
344
345
|
toolbarItems.push({
|
|
@@ -210,6 +210,17 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
210
210
|
return akEditorWideLayoutWidth;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
+
|
|
214
|
+
// check if is inside of a table
|
|
215
|
+
}, {
|
|
216
|
+
key: "isNestedInTable",
|
|
217
|
+
value: function isNestedInTable() {
|
|
218
|
+
var table = this.props.view.state.schema.nodes.table;
|
|
219
|
+
if (!this.$pos) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
return !!findParentNodeOfTypeClosestToPos(this.$pos, table);
|
|
223
|
+
}
|
|
213
224
|
}, {
|
|
214
225
|
key: "calcSnapPoints",
|
|
215
226
|
value: function calcSnapPoints() {
|
|
@@ -324,6 +335,21 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
324
335
|
enable[side] = false;
|
|
325
336
|
}
|
|
326
337
|
});
|
|
338
|
+
var nestedInTableHandleStyles = function nestedInTableHandleStyles(isNestedInTable) {
|
|
339
|
+
if (!isNestedInTable) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
left: {
|
|
344
|
+
left: "calc(".concat("var(--ds-space-025, 0.125em)", " * -0.5)"),
|
|
345
|
+
paddingLeft: '0px'
|
|
346
|
+
},
|
|
347
|
+
right: {
|
|
348
|
+
right: "calc(".concat("var(--ds-space-025, 0.125em)", " * -0.5)"),
|
|
349
|
+
paddingRight: '0px'
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
};
|
|
327
353
|
|
|
328
354
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
329
355
|
return jsx("div", {
|
|
@@ -345,7 +371,8 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
345
371
|
scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
|
|
346
372
|
highlights: this.highlights,
|
|
347
373
|
innerPadding: akEditorMediaResizeHandlerPaddingWide,
|
|
348
|
-
nodeType: "embed"
|
|
374
|
+
nodeType: "embed",
|
|
375
|
+
handleStyles: nestedInTableHandleStyles(this.isNestedInTable())
|
|
349
376
|
}), children, this.getHeightDefiningComponent())));
|
|
350
377
|
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
|
|
351
378
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
5
|
-
import { ResizerProps } from '@atlaskit/editor-common/ui';
|
|
4
|
+
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
5
|
+
import type { ResizerProps } from '@atlaskit/editor-common/ui';
|
|
6
6
|
type State = {
|
|
7
7
|
offsetLeft: number;
|
|
8
8
|
resizedPctWidth?: number;
|
|
@@ -39,6 +39,7 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
39
39
|
calcColumnLeftOffset: () => number;
|
|
40
40
|
wrapper?: HTMLElement;
|
|
41
41
|
get wideLayoutWidth(): number;
|
|
42
|
+
isNestedInTable(): boolean;
|
|
42
43
|
calcSnapPoints(): number[];
|
|
43
44
|
calcPxWidth: (useLayout?: RichMediaLayout) => number;
|
|
44
45
|
get insideInlineLike(): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
5
|
-
import { ResizerProps } from '@atlaskit/editor-common/ui';
|
|
4
|
+
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
5
|
+
import type { ResizerProps } from '@atlaskit/editor-common/ui';
|
|
6
6
|
type State = {
|
|
7
7
|
offsetLeft: number;
|
|
8
8
|
resizedPctWidth?: number;
|
|
@@ -39,6 +39,7 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
39
39
|
calcColumnLeftOffset: () => number;
|
|
40
40
|
wrapper?: HTMLElement;
|
|
41
41
|
get wideLayoutWidth(): number;
|
|
42
|
+
isNestedInTable(): boolean;
|
|
42
43
|
calcSnapPoints(): number[];
|
|
43
44
|
calcPxWidth: (useLayout?: RichMediaLayout) => number;
|
|
44
45
|
get insideInlineLike(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/link-analytics": "^8.2.0",
|
|
48
48
|
"@atlaskit/link-datasource": "^1.0.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
50
|
-
"@atlaskit/smart-card": "^26.
|
|
50
|
+
"@atlaskit/smart-card": "^26.21.0",
|
|
51
51
|
"@atlaskit/theme": "^12.6.0",
|
|
52
52
|
"@atlaskit/tokens": "^1.20.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|