@atlaskit/editor-plugin-card 0.8.1 → 0.8.3
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/.eslintrc.js +12 -0
- package/CHANGELOG.md +14 -0
- package/dist/cjs/datasourceErrorBoundary.js +6 -3
- package/dist/cjs/ui/LayoutButton/index.js +1 -4
- package/dist/es2019/datasourceErrorBoundary.js +6 -3
- package/dist/es2019/ui/LayoutButton/index.js +1 -1
- package/dist/esm/datasourceErrorBoundary.js +6 -3
- package/dist/esm/ui/LayoutButton/index.js +1 -1
- package/dist/types/datasourceErrorBoundary.d.ts +2 -2
- package/dist/types/ui/LayoutButton/index.d.ts +7 -7
- package/dist/types-ts4.5/datasourceErrorBoundary.d.ts +2 -2
- package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +7 -7
- package/package.json +4 -4
package/.eslintrc.js
CHANGED
|
@@ -2,6 +2,18 @@ module.exports = {
|
|
|
2
2
|
rules: {
|
|
3
3
|
'@typescript-eslint/no-duplicate-imports': 'error',
|
|
4
4
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
5
|
+
'@typescript-eslint/ban-types': [
|
|
6
|
+
'error',
|
|
7
|
+
{
|
|
8
|
+
types: {
|
|
9
|
+
'React.FC':
|
|
10
|
+
'Please use types directly on props instead, and explicitly define children if required',
|
|
11
|
+
'React.FunctionalComponent':
|
|
12
|
+
'Please use types directly on props instead, and explicitly define children if required',
|
|
13
|
+
},
|
|
14
|
+
extendDefaults: false,
|
|
15
|
+
},
|
|
16
|
+
],
|
|
5
17
|
},
|
|
6
18
|
overrides: [
|
|
7
19
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 0.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 0.8.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4e7058a65f4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e7058a65f4) - Add eslint rule to ban React.FC and React.FunctionalComponent in editor. In most packages this is still a warning.
|
|
14
|
+
- [`08c899663fa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/08c899663fa) - Add datasource failed analytic events to datasourceErrorBoundary
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 0.8.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -14,6 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
17
|
+
var _linkDatasource = require("@atlaskit/link-datasource");
|
|
17
18
|
var _doc = require("./pm-plugins/doc");
|
|
18
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
19
20
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable @repo/internal/react/no-class-components */
|
|
@@ -52,11 +53,13 @@ var DatasourceErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
52
53
|
view = _this$props.view;
|
|
53
54
|
if (this.state.isError) {
|
|
54
55
|
if (url && (0, _adfSchema.isSafeUrl)(url)) {
|
|
55
|
-
return (0, _doc.setSelectedCardAppearance)('inline', undefined)(view.state, view.dispatch);
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_linkDatasource.DatasourceRenderFailedAnalyticsWrapper, null, (0, _doc.setSelectedCardAppearance)('inline', undefined)(view.state, view.dispatch));
|
|
57
|
+
} else {
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_linkDatasource.DatasourceRenderFailedAnalyticsWrapper, null, /*#__PURE__*/_react.default.createElement(UnsupportedComponent, null));
|
|
56
59
|
}
|
|
57
|
-
|
|
60
|
+
} else {
|
|
61
|
+
return this.props.children;
|
|
58
62
|
}
|
|
59
|
-
return this.props.children;
|
|
60
63
|
}
|
|
61
64
|
}], [{
|
|
62
65
|
key: "getDerivedStateFromError",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.LayoutButton = void 0;
|
|
9
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _react =
|
|
9
|
+
var _react = require("react");
|
|
11
10
|
var _react2 = require("@emotion/react");
|
|
12
11
|
var _reactIntlNext = require("react-intl-next");
|
|
13
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
@@ -19,8 +18,6 @@ var _expand = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/expand
|
|
|
19
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
19
|
var _actions = require("../../pm-plugins/actions");
|
|
21
20
|
var _utils2 = require("./utils");
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
21
|
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; }
|
|
25
22
|
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; } /** @jsx jsx */
|
|
26
23
|
var toolbarButtonWrapperStyles = (0, _react2.css)({
|
|
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
5
|
+
import { DatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
|
|
5
6
|
import { setSelectedCardAppearance } from './pm-plugins/doc';
|
|
6
7
|
export class DatasourceErrorBoundary extends React.Component {
|
|
7
8
|
constructor(...args) {
|
|
@@ -32,10 +33,12 @@ export class DatasourceErrorBoundary extends React.Component {
|
|
|
32
33
|
} = this.props;
|
|
33
34
|
if (this.state.isError) {
|
|
34
35
|
if (url && isSafeUrl(url)) {
|
|
35
|
-
return setSelectedCardAppearance('inline', undefined)(view.state, view.dispatch);
|
|
36
|
+
return /*#__PURE__*/React.createElement(DatasourceRenderFailedAnalyticsWrapper, null, setSelectedCardAppearance('inline', undefined)(view.state, view.dispatch));
|
|
37
|
+
} else {
|
|
38
|
+
return /*#__PURE__*/React.createElement(DatasourceRenderFailedAnalyticsWrapper, null, /*#__PURE__*/React.createElement(UnsupportedComponent, null));
|
|
36
39
|
}
|
|
37
|
-
|
|
40
|
+
} else {
|
|
41
|
+
return this.props.children;
|
|
38
42
|
}
|
|
39
|
-
return this.props.children;
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
@@ -10,6 +10,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
13
|
+
import { DatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
|
|
13
14
|
import { setSelectedCardAppearance } from './pm-plugins/doc';
|
|
14
15
|
export var DatasourceErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
15
16
|
_inherits(DatasourceErrorBoundary, _React$Component);
|
|
@@ -46,11 +47,13 @@ export var DatasourceErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
46
47
|
view = _this$props.view;
|
|
47
48
|
if (this.state.isError) {
|
|
48
49
|
if (url && isSafeUrl(url)) {
|
|
49
|
-
return setSelectedCardAppearance('inline', undefined)(view.state, view.dispatch);
|
|
50
|
+
return /*#__PURE__*/React.createElement(DatasourceRenderFailedAnalyticsWrapper, null, setSelectedCardAppearance('inline', undefined)(view.state, view.dispatch));
|
|
51
|
+
} else {
|
|
52
|
+
return /*#__PURE__*/React.createElement(DatasourceRenderFailedAnalyticsWrapper, null, /*#__PURE__*/React.createElement(UnsupportedComponent, null));
|
|
50
53
|
}
|
|
51
|
-
|
|
54
|
+
} else {
|
|
55
|
+
return this.props.children;
|
|
52
56
|
}
|
|
53
|
-
return this.props.children;
|
|
54
57
|
}
|
|
55
58
|
}], [{
|
|
56
59
|
key: "getDerivedStateFromError",
|
|
@@ -2,7 +2,7 @@ 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
|
/** @jsx jsx */
|
|
5
|
-
import
|
|
5
|
+
import { useCallback, useMemo } from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { injectIntl } from 'react-intl-next';
|
|
8
8
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { APIError } from '@atlaskit/smart-card';
|
|
3
|
-
import { DatasourceProps } from './nodeviews/datasource';
|
|
2
|
+
import type { APIError } from '@atlaskit/smart-card';
|
|
3
|
+
import type { DatasourceProps } from './nodeviews/datasource';
|
|
4
4
|
export declare class DatasourceErrorBoundary extends React.Component<{
|
|
5
5
|
url?: string;
|
|
6
6
|
unsupportedComponent: React.ComponentType;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
|
|
5
|
-
export declare const LayoutButton:
|
|
6
|
-
declare const _default:
|
|
7
|
-
WrappedComponent:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
|
|
5
|
+
export declare const LayoutButton: ({ onLayoutChange, layout, intl: { formatMessage }, mountPoint, boundariesElement, scrollableElement, targetElement, testId, }: LayoutButtonProps) => jsx.JSX.Element | null;
|
|
6
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>> & {
|
|
7
|
+
WrappedComponent: import("react").ComponentType<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { APIError } from '@atlaskit/smart-card';
|
|
3
|
-
import { DatasourceProps } from './nodeviews/datasource';
|
|
2
|
+
import type { APIError } from '@atlaskit/smart-card';
|
|
3
|
+
import type { DatasourceProps } from './nodeviews/datasource';
|
|
4
4
|
export declare class DatasourceErrorBoundary extends React.Component<{
|
|
5
5
|
url?: string;
|
|
6
6
|
unsupportedComponent: React.ComponentType;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
|
|
5
|
-
export declare const LayoutButton:
|
|
6
|
-
declare const _default:
|
|
7
|
-
WrappedComponent:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
|
|
5
|
+
export declare const LayoutButton: ({ onLayoutChange, layout, intl: { formatMessage }, mountPoint, boundariesElement, scrollableElement, targetElement, testId, }: LayoutButtonProps) => jsx.JSX.Element | null;
|
|
6
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>> & {
|
|
7
|
+
WrappedComponent: import("react").ComponentType<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
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": "^29.1.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/editor-common": "^76.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"@atlaskit/editor-plugin-hyperlink": "^0.5.0",
|
|
43
43
|
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
45
|
-
"@atlaskit/editor-shared-styles": "^2.
|
|
45
|
+
"@atlaskit/editor-shared-styles": "^2.8.0",
|
|
46
46
|
"@atlaskit/icon": "^21.12.0",
|
|
47
47
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
48
|
-
"@atlaskit/link-datasource": "^1.
|
|
48
|
+
"@atlaskit/link-datasource": "^1.4.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
50
50
|
"@atlaskit/smart-card": "^26.28.0",
|
|
51
51
|
"@atlaskit/theme": "^12.6.0",
|