@atlaskit/editor-plugin-card 0.3.5 → 0.3.6
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 +6 -0
- package/dist/cjs/nodeviews/datasource.js +1 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/nodeviews/datasource.js +2 -9
- package/dist/es2019/version.json +1 -1
- package/dist/esm/nodeviews/datasource.js +2 -9
- package/dist/esm/version.json +1 -1
- package/dist/types/nodeviews/datasource.d.ts +0 -2
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +0 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 0.3.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fd24b65bb62`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd24b65bb62) - Fix table width bug when layout is undefined for datasource.
|
|
8
|
+
|
|
3
9
|
## 0.3.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -122,12 +122,6 @@ var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
122
122
|
var _this2;
|
|
123
123
|
(0, _classCallCheck2.default)(this, Datasource);
|
|
124
124
|
_this2 = _super2.call(this, props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
|
|
125
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this2), "calcTableWidth", function (layout, containerWidth) {
|
|
126
|
-
if (layout === 'center') {
|
|
127
|
-
return 'inherit';
|
|
128
|
-
}
|
|
129
|
-
return (0, _utils.calcBreakoutWidthPx)(layout, containerWidth);
|
|
130
|
-
});
|
|
131
125
|
var sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.dependencies) === null || _props$pluginInjectio2 === void 0 ? void 0 : (_props$pluginInjectio3 = _props$pluginInjectio2.width) === null || _props$pluginInjectio3 === void 0 ? void 0 : _props$pluginInjectio3.sharedState;
|
|
132
126
|
_this2.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
|
|
133
127
|
sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(function (_ref2) {
|
|
@@ -150,11 +144,10 @@ var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
150
144
|
key: "render",
|
|
151
145
|
value: function render() {
|
|
152
146
|
var attrs = this.node.attrs;
|
|
153
|
-
var calculatedWidth = this.calcTableWidth(attrs.layout, this.tableWidth);
|
|
154
147
|
return (0, _react2.jsx)("div", {
|
|
155
148
|
className: _styles.DATASOURCE_INNER_CONTAINER_CLASSNAME,
|
|
156
149
|
style: {
|
|
157
|
-
minWidth:
|
|
150
|
+
minWidth: (0, _utils.calcBreakoutWidth)(attrs.layout, this.tableWidth)
|
|
158
151
|
}
|
|
159
152
|
}, (0, _react2.jsx)(DatasourceComponent, {
|
|
160
153
|
node: this.node,
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
7
7
|
import { DATASOURCE_INNER_CONTAINER_CLASSNAME, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
8
|
-
import {
|
|
8
|
+
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { DatasourceTableView } from '@atlaskit/link-datasource';
|
|
10
10
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
11
11
|
export class DatasourceComponent extends React.PureComponent {
|
|
@@ -90,12 +90,6 @@ export class Datasource extends ReactNodeView {
|
|
|
90
90
|
constructor(props) {
|
|
91
91
|
var _props$pluginInjectio, _props$pluginInjectio2, _props$pluginInjectio3, _sharedState$currentS;
|
|
92
92
|
super(props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
|
|
93
|
-
_defineProperty(this, "calcTableWidth", (layout, containerWidth) => {
|
|
94
|
-
if (layout === 'center') {
|
|
95
|
-
return 'inherit';
|
|
96
|
-
}
|
|
97
|
-
return calcBreakoutWidthPx(layout, containerWidth);
|
|
98
|
-
});
|
|
99
93
|
const sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.dependencies) === null || _props$pluginInjectio2 === void 0 ? void 0 : (_props$pluginInjectio3 = _props$pluginInjectio2.width) === null || _props$pluginInjectio3 === void 0 ? void 0 : _props$pluginInjectio3.sharedState;
|
|
100
94
|
this.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
|
|
101
95
|
sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(({
|
|
@@ -117,11 +111,10 @@ export class Datasource extends ReactNodeView {
|
|
|
117
111
|
const {
|
|
118
112
|
attrs
|
|
119
113
|
} = this.node;
|
|
120
|
-
const calculatedWidth = this.calcTableWidth(attrs.layout, this.tableWidth);
|
|
121
114
|
return jsx("div", {
|
|
122
115
|
className: DATASOURCE_INNER_CONTAINER_CLASSNAME,
|
|
123
116
|
style: {
|
|
124
|
-
minWidth:
|
|
117
|
+
minWidth: calcBreakoutWidth(attrs.layout, this.tableWidth)
|
|
125
118
|
}
|
|
126
119
|
}, jsx(DatasourceComponent, {
|
|
127
120
|
node: this.node,
|
package/dist/es2019/version.json
CHANGED
|
@@ -15,7 +15,7 @@ import { jsx } from '@emotion/react';
|
|
|
15
15
|
import PropTypes from 'prop-types';
|
|
16
16
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
17
17
|
import { DATASOURCE_INNER_CONTAINER_CLASSNAME, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
18
|
-
import {
|
|
18
|
+
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
19
19
|
import { DatasourceTableView } from '@atlaskit/link-datasource';
|
|
20
20
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
21
21
|
export var DatasourceComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -115,12 +115,6 @@ export var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
115
115
|
var _this2;
|
|
116
116
|
_classCallCheck(this, Datasource);
|
|
117
117
|
_this2 = _super2.call(this, props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
|
|
118
|
-
_defineProperty(_assertThisInitialized(_this2), "calcTableWidth", function (layout, containerWidth) {
|
|
119
|
-
if (layout === 'center') {
|
|
120
|
-
return 'inherit';
|
|
121
|
-
}
|
|
122
|
-
return calcBreakoutWidthPx(layout, containerWidth);
|
|
123
|
-
});
|
|
124
118
|
var sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.dependencies) === null || _props$pluginInjectio2 === void 0 ? void 0 : (_props$pluginInjectio3 = _props$pluginInjectio2.width) === null || _props$pluginInjectio3 === void 0 ? void 0 : _props$pluginInjectio3.sharedState;
|
|
125
119
|
_this2.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
|
|
126
120
|
sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(function (_ref2) {
|
|
@@ -143,11 +137,10 @@ export var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
143
137
|
key: "render",
|
|
144
138
|
value: function render() {
|
|
145
139
|
var attrs = this.node.attrs;
|
|
146
|
-
var calculatedWidth = this.calcTableWidth(attrs.layout, this.tableWidth);
|
|
147
140
|
return jsx("div", {
|
|
148
141
|
className: DATASOURCE_INNER_CONTAINER_CLASSNAME,
|
|
149
142
|
style: {
|
|
150
|
-
minWidth:
|
|
143
|
+
minWidth: calcBreakoutWidth(attrs.layout, this.tableWidth)
|
|
151
144
|
}
|
|
152
145
|
}, jsx(DatasourceComponent, {
|
|
153
146
|
node: this.node,
|
package/dist/esm/version.json
CHANGED
|
@@ -9,7 +9,6 @@ import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
9
9
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { cardPlugin } from '../index';
|
|
12
|
-
import { DatasourceTableLayout } from '../ui/LayoutButton/types';
|
|
13
12
|
interface DatasourceProps extends ReactComponentProps {
|
|
14
13
|
node: PMNode;
|
|
15
14
|
view: EditorView;
|
|
@@ -36,7 +35,6 @@ export declare class Datasource extends ReactNodeView<DatasourceProps> {
|
|
|
36
35
|
private tableWidth;
|
|
37
36
|
constructor(props: DatasourceProps);
|
|
38
37
|
createDomRef(): HTMLElement;
|
|
39
|
-
calcTableWidth: (layout: DatasourceTableLayout, containerWidth?: number) => number | 'inherit';
|
|
40
38
|
render(): jsx.JSX.Element;
|
|
41
39
|
}
|
|
42
40
|
export {};
|
|
@@ -9,7 +9,6 @@ import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
9
9
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { cardPlugin } from '../index';
|
|
12
|
-
import { DatasourceTableLayout } from '../ui/LayoutButton/types';
|
|
13
12
|
interface DatasourceProps extends ReactComponentProps {
|
|
14
13
|
node: PMNode;
|
|
15
14
|
view: EditorView;
|
|
@@ -36,7 +35,6 @@ export declare class Datasource extends ReactNodeView<DatasourceProps> {
|
|
|
36
35
|
private tableWidth;
|
|
37
36
|
constructor(props: DatasourceProps);
|
|
38
37
|
createDomRef(): HTMLElement;
|
|
39
|
-
calcTableWidth: (layout: DatasourceTableLayout, containerWidth?: number) => number | 'inherit';
|
|
40
38
|
render(): jsx.JSX.Element;
|
|
41
39
|
}
|
|
42
40
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^26.4.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^74.
|
|
36
|
+
"@atlaskit/editor-common": "^74.34.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
50
50
|
"@atlaskit/smart-card": "^26.14.0",
|
|
51
51
|
"@atlaskit/theme": "^12.5.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.14.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
|
55
55
|
"lodash": "^4.17.21",
|